@designa8/vibedesign-v6 1.15.3 → 1.20.13
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/README.md +6 -32
- package/dist/index.cjs +3232 -2143
- package/dist/index.js +3242 -2153
- package/dist/styles.css +266 -28
- package/package.json +52 -2
- package/src/atoms/AppLayout/AppLayout.tsx +401 -395
- package/src/atoms/AppLayout/preview.tsx +29 -0
- package/src/atoms/AppSidebar/AppSidebar.tsx +182 -94
- package/src/atoms/AppSidebar/preview.tsx +20 -59
- package/src/atoms/AppSidebarMobile/AppSidebarMobile.tsx +27 -73
- package/src/atoms/AppSidebarMobile/preview.tsx +18 -18
- package/src/atoms/AuthLogin/AuthLogin.tsx +200 -0
- package/src/atoms/AuthLogin/index.ts +2 -0
- package/src/atoms/AuthLogin/preview.tsx +22 -0
- package/src/atoms/AuthScreen/AuthScreen.tsx +7 -7
- package/src/atoms/AuthSignUp/AuthSignUp.tsx +243 -0
- package/src/atoms/AuthSignUp/index.ts +2 -0
- package/src/atoms/AuthSignUp/preview.tsx +22 -0
- package/src/atoms/BillingToggle/BillingToggle.tsx +65 -0
- package/src/atoms/BillingToggle/index.ts +2 -0
- package/src/atoms/BillingToggle/preview.tsx +23 -0
- package/src/atoms/Button/Button.tsx +33 -17
- package/src/atoms/Button/preview.tsx +16 -0
- package/src/atoms/ChatHistorySidebar/ChatHistorySidebar.tsx +370 -0
- package/src/atoms/ChatHistorySidebar/index.ts +2 -0
- package/src/atoms/ChatHistorySidebar/preview.tsx +60 -0
- package/src/atoms/ChatScreen/ChatScreen.tsx +331 -134
- package/src/atoms/ChatScreen/preview.tsx +123 -2
- package/src/atoms/Checkbox/Checkbox.tsx +89 -0
- package/src/atoms/Checkbox/index.ts +2 -0
- package/src/atoms/Checkbox/preview.tsx +60 -0
- package/src/atoms/Dropdown/Dropdown.tsx +195 -0
- package/src/atoms/Dropdown/index.ts +2 -0
- package/src/atoms/Dropdown/preview.tsx +56 -0
- package/src/atoms/ExportDesignMdModal/ExportDesignMdModal.tsx +46 -185
- package/src/atoms/ExportDesignMdModal/preview.tsx +24 -8
- package/src/atoms/FaqAccordionItem/FaqAccordionItem.tsx +60 -0
- package/src/atoms/FaqAccordionItem/index.ts +2 -0
- package/src/atoms/FaqAccordionItem/preview.tsx +26 -0
- package/src/atoms/FilterTabBar/FilterTabBar.tsx +8 -22
- package/src/atoms/HomePageTemplate/HomePageTemplate.tsx +20 -33
- package/src/atoms/HomePageTemplate/preview.tsx +2 -2
- package/src/atoms/Icon/Icon.tsx +7 -5
- package/src/atoms/Icon/icons.data.ts +53 -0
- package/src/atoms/Input/Input.tsx +17 -9
- package/src/atoms/Input/preview.tsx +24 -25
- package/src/atoms/Menu/Menu.tsx +320 -0
- package/src/atoms/Menu/index.ts +2 -0
- package/src/atoms/Menu/preview.tsx +63 -0
- package/src/atoms/Modal/Modal.tsx +43 -37
- package/src/atoms/Modal/preview.tsx +13 -0
- package/src/atoms/NavItem/NavItem.tsx +33 -45
- package/src/atoms/NavItem/preview.tsx +21 -26
- package/src/atoms/PreviewToolbar/PreviewToolbar.tsx +144 -192
- package/src/atoms/PreviewToolbar/preview.tsx +24 -4
- package/src/atoms/PricingCard/PricingCard.tsx +164 -0
- package/src/atoms/PricingCard/index.ts +2 -0
- package/src/atoms/PricingCard/preview.tsx +45 -0
- package/src/atoms/PricingPageTemplate/PricingPageTemplate.tsx +219 -0
- package/src/atoms/PricingPageTemplate/index.ts +2 -0
- package/src/atoms/PricingPageTemplate/preview.tsx +10 -0
- package/src/atoms/PromptInputBar/PromptInputBar.tsx +117 -158
- package/src/atoms/WorkspaceMenu/WorkspaceMenu.tsx +41 -167
- package/src/index.ts +10 -0
- package/src/tokens.css +5 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { Modal } from "../Modal";
|
|
3
3
|
import { Button } from "../Button";
|
|
4
4
|
import { Chip } from "../Chip";
|
|
5
5
|
import { Typography } from "../Typography";
|
|
6
|
+
import { Icon } from "../Icon";
|
|
6
7
|
|
|
7
8
|
export type ExportDesignMdSource = "production" | "local";
|
|
8
9
|
|
|
@@ -24,11 +25,15 @@ export interface ExportDesignMdModalProps {
|
|
|
24
25
|
onDownload?: () => void;
|
|
25
26
|
/** Called when the user copies the preview to the clipboard */
|
|
26
27
|
onCopy?: () => void;
|
|
27
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Kept for backwards compatibility. The source is now locked to
|
|
30
|
+
* `defaultSource` for the lifetime of the modal — there is no toggle,
|
|
31
|
+
* so this callback is never invoked.
|
|
32
|
+
*/
|
|
28
33
|
onSourceChange?: (source: ExportDesignMdSource) => void;
|
|
29
34
|
/** Name of the design system shown in the generated heading */
|
|
30
35
|
designSystemName?: string;
|
|
31
|
-
/**
|
|
36
|
+
/** The single source this modal is locked to for its lifetime */
|
|
32
37
|
defaultSource?: ExportDesignMdSource;
|
|
33
38
|
/** Lines rendered in the code preview panel */
|
|
34
39
|
lines?: ExportDesignMdLine[];
|
|
@@ -69,101 +74,23 @@ const defaultLines: ExportDesignMdLine[] = [
|
|
|
69
74
|
{ text: "hairline: {colors.hairline}" },
|
|
70
75
|
];
|
|
71
76
|
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const LinkIcon = () => (
|
|
90
|
-
<svg
|
|
91
|
-
viewBox="0 0 24 24"
|
|
92
|
-
width="16"
|
|
93
|
-
height="16"
|
|
94
|
-
fill="none"
|
|
95
|
-
stroke="currentColor"
|
|
96
|
-
strokeWidth="2"
|
|
97
|
-
strokeLinecap="round"
|
|
98
|
-
strokeLinejoin="round"
|
|
99
|
-
aria-hidden="true"
|
|
100
|
-
>
|
|
101
|
-
<path d="M9 17H7A5 5 0 0 1 7 7h2" />
|
|
102
|
-
<path d="M15 7h2a5 5 0 1 1 0 10h-2" />
|
|
103
|
-
<line x1="8" y1="12" x2="16" y2="12" />
|
|
104
|
-
</svg>
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
const CopyIcon = () => (
|
|
108
|
-
<svg
|
|
109
|
-
viewBox="0 0 24 24"
|
|
110
|
-
width="14"
|
|
111
|
-
height="14"
|
|
112
|
-
fill="none"
|
|
113
|
-
stroke="currentColor"
|
|
114
|
-
strokeWidth="2"
|
|
115
|
-
strokeLinecap="round"
|
|
116
|
-
strokeLinejoin="round"
|
|
117
|
-
aria-hidden="true"
|
|
118
|
-
>
|
|
119
|
-
<rect x="9" y="9" width="11" height="11" rx="2" />
|
|
120
|
-
<path d="M5 15V5a2 2 0 0 1 2-2h10" />
|
|
121
|
-
</svg>
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
const DownloadIcon = () => (
|
|
125
|
-
<svg
|
|
126
|
-
viewBox="0 0 24 24"
|
|
127
|
-
width="14"
|
|
128
|
-
height="14"
|
|
129
|
-
fill="none"
|
|
130
|
-
stroke="currentColor"
|
|
131
|
-
strokeWidth="2"
|
|
132
|
-
strokeLinecap="round"
|
|
133
|
-
strokeLinejoin="round"
|
|
134
|
-
aria-hidden="true"
|
|
135
|
-
>
|
|
136
|
-
<path d="M12 3v12" />
|
|
137
|
-
<path d="M7 10l5 5 5-5" />
|
|
138
|
-
<path d="M5 21h14" />
|
|
139
|
-
</svg>
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
const SpinnerIcon = () => (
|
|
143
|
-
<svg
|
|
144
|
-
viewBox="0 0 24 24"
|
|
145
|
-
width="20"
|
|
146
|
-
height="20"
|
|
147
|
-
fill="none"
|
|
148
|
-
className="animate-spin text-primary"
|
|
149
|
-
aria-hidden="true"
|
|
150
|
-
>
|
|
151
|
-
<circle
|
|
152
|
-
cx="12"
|
|
153
|
-
cy="12"
|
|
154
|
-
r="9"
|
|
155
|
-
stroke="currentColor"
|
|
156
|
-
strokeWidth="2.5"
|
|
157
|
-
strokeOpacity="0.25"
|
|
158
|
-
/>
|
|
159
|
-
<path
|
|
160
|
-
d="M21 12a9 9 0 0 0-9-9"
|
|
161
|
-
stroke="currentColor"
|
|
162
|
-
strokeWidth="2.5"
|
|
163
|
-
strokeLinecap="round"
|
|
164
|
-
/>
|
|
165
|
-
</svg>
|
|
166
|
-
);
|
|
77
|
+
const SOURCE_INFO: Record<
|
|
78
|
+
ExportDesignMdSource,
|
|
79
|
+
{ icon: string; title: string; description: string; helper: string }
|
|
80
|
+
> = {
|
|
81
|
+
production: {
|
|
82
|
+
icon: "cloud",
|
|
83
|
+
title: "Production (npm install)",
|
|
84
|
+
description: "Generated for public npm registry consumption.",
|
|
85
|
+
helper: "Consumer apps install from the public npm registry ('npm install').",
|
|
86
|
+
},
|
|
87
|
+
local: {
|
|
88
|
+
icon: "external-link-arrow-up-right",
|
|
89
|
+
title: "Local (npm link)",
|
|
90
|
+
description: "Generated for local development with npm link.",
|
|
91
|
+
helper: "Consumer apps resolve the package via a local 'npm link' during development.",
|
|
92
|
+
},
|
|
93
|
+
};
|
|
167
94
|
|
|
168
95
|
export const ExportDesignMdModal = React.forwardRef<
|
|
169
96
|
HTMLDivElement,
|
|
@@ -176,7 +103,6 @@ export const ExportDesignMdModal = React.forwardRef<
|
|
|
176
103
|
onExport,
|
|
177
104
|
onDownload,
|
|
178
105
|
onCopy,
|
|
179
|
-
onSourceChange,
|
|
180
106
|
designSystemName = "Design System",
|
|
181
107
|
defaultSource = "production",
|
|
182
108
|
lines = defaultLines,
|
|
@@ -184,12 +110,8 @@ export const ExportDesignMdModal = React.forwardRef<
|
|
|
184
110
|
},
|
|
185
111
|
ref
|
|
186
112
|
) => {
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
const changeSource = (next: ExportDesignMdSource) => {
|
|
190
|
-
setSource(next);
|
|
191
|
-
onSourceChange?.(next);
|
|
192
|
-
};
|
|
113
|
+
const source = defaultSource;
|
|
114
|
+
const info = SOURCE_INFO[source];
|
|
193
115
|
|
|
194
116
|
const handleCopy = () => {
|
|
195
117
|
const text = lines.map((l) => l.text).join("\n");
|
|
@@ -209,7 +131,7 @@ export const ExportDesignMdModal = React.forwardRef<
|
|
|
209
131
|
footer={
|
|
210
132
|
<div className="flex w-full items-center justify-between">
|
|
211
133
|
<Button variant="secondary" size="sm" onClick={onDownload}>
|
|
212
|
-
<
|
|
134
|
+
<Icon name="download" />
|
|
213
135
|
Download .md
|
|
214
136
|
</Button>
|
|
215
137
|
<div className="flex items-center gap-sm">
|
|
@@ -229,32 +151,24 @@ export const ExportDesignMdModal = React.forwardRef<
|
|
|
229
151
|
agents or your team.
|
|
230
152
|
</Typography>
|
|
231
153
|
|
|
232
|
-
{/*
|
|
233
|
-
<div className="flex
|
|
234
|
-
<
|
|
235
|
-
<
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
variant={source === "local" ? "primary" : "ghost"}
|
|
245
|
-
size="sm"
|
|
246
|
-
onClick={() => changeSource("local")}
|
|
247
|
-
>
|
|
248
|
-
<LinkIcon />
|
|
249
|
-
Local (npm link)
|
|
250
|
-
</Button>
|
|
154
|
+
{/* Locked source info row */}
|
|
155
|
+
<div className="flex w-full items-center gap-md p-md bg-surface-soft border border-hairline rounded-md">
|
|
156
|
+
<span className="flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-sm bg-surface border border-hairline text-primary">
|
|
157
|
+
<Icon name={info.icon} />
|
|
158
|
+
</span>
|
|
159
|
+
<div className="min-w-0 flex-1">
|
|
160
|
+
<Typography role="body-md" color="ink" className="font-weight-heading-sm">
|
|
161
|
+
{info.title}
|
|
162
|
+
</Typography>
|
|
163
|
+
<Typography role="body-sm" color="muted">
|
|
164
|
+
{info.description}
|
|
165
|
+
</Typography>
|
|
251
166
|
</div>
|
|
252
|
-
<
|
|
253
|
-
{source === "production"
|
|
254
|
-
? "Consumer apps install from the public npm registry ('npm install')."
|
|
255
|
-
: "Consumer apps resolve the package via a local 'npm link' during development."}
|
|
256
|
-
</Typography>
|
|
167
|
+
<Chip label="Active" variant="primary" size="sm" />
|
|
257
168
|
</div>
|
|
169
|
+
<Typography role="body-sm" color="muted">
|
|
170
|
+
{info.helper}
|
|
171
|
+
</Typography>
|
|
258
172
|
|
|
259
173
|
{/* Preview */}
|
|
260
174
|
<div>
|
|
@@ -273,7 +187,7 @@ export const ExportDesignMdModal = React.forwardRef<
|
|
|
273
187
|
onClick={handleCopy}
|
|
274
188
|
className="absolute top-sm right-sm"
|
|
275
189
|
>
|
|
276
|
-
<
|
|
190
|
+
<Icon name="copy-clipboard" />
|
|
277
191
|
Copy
|
|
278
192
|
</Button>
|
|
279
193
|
<div className="max-h-64 overflow-y-auto px-md py-sm font-mono text-body-sm">
|
|
@@ -302,7 +216,7 @@ export const ExportDesignMdModal = React.forwardRef<
|
|
|
302
216
|
aria-label="Loading preview"
|
|
303
217
|
className="absolute inset-0 flex items-center justify-center gap-sm bg-canvas opacity-90"
|
|
304
218
|
>
|
|
305
|
-
<
|
|
219
|
+
<Icon name="loading-spinner" className="animate-spin text-primary" />
|
|
306
220
|
<Typography role="body-sm" color="muted">
|
|
307
221
|
Loading preview…
|
|
308
222
|
</Typography>
|
|
@@ -310,59 +224,6 @@ export const ExportDesignMdModal = React.forwardRef<
|
|
|
310
224
|
) : null}
|
|
311
225
|
</div>
|
|
312
226
|
</div>
|
|
313
|
-
|
|
314
|
-
{/* Storage options */}
|
|
315
|
-
<div className="w-full space-y-sm">
|
|
316
|
-
<div className="flex w-full items-center gap-md p-md bg-surface-soft border border-hairline rounded-md">
|
|
317
|
-
<span className="flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-sm bg-surface border border-hairline text-primary">
|
|
318
|
-
<CloudIcon />
|
|
319
|
-
</span>
|
|
320
|
-
<div className="min-w-0 flex-1">
|
|
321
|
-
<Typography role="body-md" color="ink" className="font-weight-heading-sm">
|
|
322
|
-
Production (npm install)
|
|
323
|
-
</Typography>
|
|
324
|
-
<Typography role="body-sm" color="muted">
|
|
325
|
-
Generated for public npm registry consumption.
|
|
326
|
-
</Typography>
|
|
327
|
-
</div>
|
|
328
|
-
{source === "production" ? (
|
|
329
|
-
<Chip label="Active" variant="primary" size="sm" />
|
|
330
|
-
) : (
|
|
331
|
-
<Button
|
|
332
|
-
variant="secondary"
|
|
333
|
-
size="sm"
|
|
334
|
-
onClick={() => changeSource("production")}
|
|
335
|
-
>
|
|
336
|
-
Switch
|
|
337
|
-
</Button>
|
|
338
|
-
)}
|
|
339
|
-
</div>
|
|
340
|
-
|
|
341
|
-
<div className="flex w-full items-center gap-md p-md bg-surface-soft border border-hairline rounded-md">
|
|
342
|
-
<span className="flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-sm bg-surface border border-hairline text-muted">
|
|
343
|
-
<LinkIcon />
|
|
344
|
-
</span>
|
|
345
|
-
<div className="min-w-0 flex-1">
|
|
346
|
-
<Typography role="body-md" color="ink" className="font-weight-heading-sm">
|
|
347
|
-
Local (npm link)
|
|
348
|
-
</Typography>
|
|
349
|
-
<Typography role="body-sm" color="muted">
|
|
350
|
-
Generated for local development with npm link.
|
|
351
|
-
</Typography>
|
|
352
|
-
</div>
|
|
353
|
-
{source === "local" ? (
|
|
354
|
-
<Chip label="Active" variant="primary" size="sm" />
|
|
355
|
-
) : (
|
|
356
|
-
<Button
|
|
357
|
-
variant="secondary"
|
|
358
|
-
size="sm"
|
|
359
|
-
onClick={() => changeSource("local")}
|
|
360
|
-
>
|
|
361
|
-
Switch
|
|
362
|
-
</Button>
|
|
363
|
-
)}
|
|
364
|
-
</div>
|
|
365
|
-
</div>
|
|
366
227
|
</div>
|
|
367
228
|
</Modal>
|
|
368
229
|
);
|
|
@@ -3,7 +3,8 @@ import { ExportDesignMdModal } from "./ExportDesignMdModal";
|
|
|
3
3
|
import { Button } from "../Button";
|
|
4
4
|
|
|
5
5
|
export default function ExportDesignMdModalPreview() {
|
|
6
|
-
const [
|
|
6
|
+
const [openProduction, setOpenProduction] = useState(false);
|
|
7
|
+
const [openLocal, setOpenLocal] = useState(false);
|
|
7
8
|
|
|
8
9
|
return (
|
|
9
10
|
<div className="w-full max-w-3xl mx-auto p-lg space-y-md">
|
|
@@ -11,19 +12,34 @@ export default function ExportDesignMdModalPreview() {
|
|
|
11
12
|
<h2 className="text-heading-md text-ink">Export DESIGN.md</h2>
|
|
12
13
|
<p className="text-body-md text-muted mt-xs">
|
|
13
14
|
Opens a dialog for handing off the design system's token file to an
|
|
14
|
-
AI coding agent or teammate
|
|
15
|
+
AI coding agent or teammate. The source is locked per instance —
|
|
16
|
+
no toggle, just a live preview and export/download actions.
|
|
15
17
|
</p>
|
|
16
18
|
</div>
|
|
17
19
|
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
<div className="flex flex-wrap items-center gap-sm">
|
|
21
|
+
<Button variant="primary" onClick={() => setOpenProduction(true)}>
|
|
22
|
+
Export (production)
|
|
23
|
+
</Button>
|
|
24
|
+
<Button variant="secondary" onClick={() => setOpenLocal(true)}>
|
|
25
|
+
Export (local npm link)
|
|
26
|
+
</Button>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<ExportDesignMdModal
|
|
30
|
+
isOpen={openProduction}
|
|
31
|
+
onClose={() => setOpenProduction(false)}
|
|
32
|
+
onExport={() => setOpenProduction(false)}
|
|
33
|
+
onDownload={() => {}}
|
|
34
|
+
defaultSource="production"
|
|
35
|
+
/>
|
|
21
36
|
|
|
22
37
|
<ExportDesignMdModal
|
|
23
|
-
isOpen={
|
|
24
|
-
onClose={() =>
|
|
25
|
-
onExport={() =>
|
|
38
|
+
isOpen={openLocal}
|
|
39
|
+
onClose={() => setOpenLocal(false)}
|
|
40
|
+
onExport={() => setOpenLocal(false)}
|
|
26
41
|
onDownload={() => {}}
|
|
42
|
+
defaultSource="local"
|
|
27
43
|
/>
|
|
28
44
|
</div>
|
|
29
45
|
);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button } from "../Button";
|
|
3
|
+
import { Icon } from "../Icon";
|
|
4
|
+
|
|
5
|
+
export interface FaqAccordionItemProps
|
|
6
|
+
extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
7
|
+
/** The question text shown in the row header. */
|
|
8
|
+
question: string;
|
|
9
|
+
/** The answer text revealed when expanded. */
|
|
10
|
+
answer: string;
|
|
11
|
+
/** Whether this item is currently expanded. */
|
|
12
|
+
open: boolean;
|
|
13
|
+
/** Called when the row header is clicked, with the new open state. */
|
|
14
|
+
onToggle: () => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const FaqAccordionItem = React.forwardRef<HTMLDivElement, FaqAccordionItemProps>(
|
|
18
|
+
({ question, answer, open, onToggle, className, ...rest }, ref) => {
|
|
19
|
+
const contentId = React.useId();
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div
|
|
23
|
+
ref={ref}
|
|
24
|
+
className={["rounded-md border border-hairline bg-canvas", className].filter(Boolean).join(" ")}
|
|
25
|
+
{...rest}
|
|
26
|
+
>
|
|
27
|
+
<Button
|
|
28
|
+
type="button"
|
|
29
|
+
variant="ghost"
|
|
30
|
+
pushEffect={false}
|
|
31
|
+
aria-expanded={open}
|
|
32
|
+
aria-controls={contentId}
|
|
33
|
+
onClick={onToggle}
|
|
34
|
+
className="!w-full !justify-between !gap-md !px-md !py-sm !rounded-md !text-left !border-0"
|
|
35
|
+
>
|
|
36
|
+
<span className="text-body-sm font-weight-heading-sm text-ink">{question}</span>
|
|
37
|
+
<Icon
|
|
38
|
+
name="chevron-down"
|
|
39
|
+
className={[
|
|
40
|
+
"size-4 flex-shrink-0 text-muted transition-transform duration-200",
|
|
41
|
+
open ? "rotate-180" : "rotate-0",
|
|
42
|
+
].join(" ")}
|
|
43
|
+
/>
|
|
44
|
+
</Button>
|
|
45
|
+
|
|
46
|
+
<div
|
|
47
|
+
id={contentId}
|
|
48
|
+
className="grid overflow-hidden transition-all duration-200 ease-in-out"
|
|
49
|
+
style={{ gridTemplateRows: open ? "1fr" : "0fr", opacity: open ? 1 : 0 }}
|
|
50
|
+
>
|
|
51
|
+
<div className="min-h-0 overflow-hidden">
|
|
52
|
+
<p className="px-md pb-sm text-body-sm text-muted">{answer}</p>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
FaqAccordionItem.displayName = "FaqAccordionItem";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { FaqAccordionItem } from "./FaqAccordionItem";
|
|
3
|
+
|
|
4
|
+
const FAQS = [
|
|
5
|
+
{ q: "Can I change plans anytime?", a: "Yes — you can upgrade, downgrade, or cancel your plan at any time from your account settings. Changes take effect on your next billing cycle." },
|
|
6
|
+
{ q: "Is there a free trial for Pro?", a: "Pro comes with a 14-day free trial, no credit card required. You can cancel anytime during the trial with no charge." },
|
|
7
|
+
{ q: "What payment methods do you accept?", a: "We accept all major credit cards, as well as invoicing for Enterprise plans." },
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
export default function FaqAccordionItemPreview() {
|
|
11
|
+
const [openIndex, setOpenIndex] = useState<number | null>(0);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div className="w-full max-w-3xl mx-auto p-lg space-y-sm">
|
|
15
|
+
{FAQS.map((item, i) => (
|
|
16
|
+
<FaqAccordionItem
|
|
17
|
+
key={item.q}
|
|
18
|
+
question={item.q}
|
|
19
|
+
answer={item.a}
|
|
20
|
+
open={openIndex === i}
|
|
21
|
+
onToggle={() => setOpenIndex(openIndex === i ? null : i)}
|
|
22
|
+
/>
|
|
23
|
+
))}
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -12,36 +12,24 @@ export interface FilterTab {
|
|
|
12
12
|
icon?: React.ReactNode;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export type FilterTabBarSize = "sm" | "md";
|
|
16
|
-
|
|
17
15
|
export interface FilterTabBarProps
|
|
18
16
|
extends Omit<React.ComponentPropsWithoutRef<"div">, "onChange"> {
|
|
19
17
|
tabs: FilterTab[];
|
|
20
18
|
/** Currently active tab value */
|
|
21
19
|
value: string;
|
|
22
20
|
onChange: (value: string) => void;
|
|
23
|
-
/**
|
|
24
|
-
* Compact "sm" matches Input size="sm" total height (h-8 / 32px including
|
|
25
|
-
* border) so an icon-only tab bar can sit flush next to a sm input.
|
|
26
|
-
* Defaults to "md".
|
|
27
|
-
*/
|
|
28
|
-
size?: FilterTabBarSize;
|
|
29
21
|
}
|
|
30
22
|
|
|
31
23
|
export const FilterTabBar = React.forwardRef<HTMLDivElement, FilterTabBarProps>(
|
|
32
|
-
({ tabs, value, onChange,
|
|
33
|
-
const isSm = size === "sm";
|
|
34
|
-
|
|
24
|
+
({ tabs, value, onChange, className = "", ...rest }, ref) => {
|
|
35
25
|
return (
|
|
36
26
|
<div
|
|
37
27
|
ref={ref}
|
|
38
28
|
role="tablist"
|
|
39
29
|
aria-label="Filter tabs"
|
|
40
30
|
className={[
|
|
41
|
-
"inline-flex
|
|
42
|
-
|
|
43
|
-
? "items-stretch h-8 p-xxs rounded-lg gap-xxs"
|
|
44
|
-
: "items-center p-xs rounded-xl gap-xs",
|
|
31
|
+
"inline-flex items-center gap-xs p-xs",
|
|
32
|
+
"bg-canvas border border-hairline rounded-xl shadow-sm",
|
|
45
33
|
className,
|
|
46
34
|
]
|
|
47
35
|
.filter(Boolean)
|
|
@@ -61,13 +49,11 @@ export const FilterTabBar = React.forwardRef<HTMLDivElement, FilterTabBarProps>(
|
|
|
61
49
|
variant={isActive ? "primary" : "ghost"}
|
|
62
50
|
size="sm"
|
|
63
51
|
onClick={() => onChange(tab.value)}
|
|
64
|
-
className={
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
.filter(Boolean)
|
|
70
|
-
.join(" ")}
|
|
52
|
+
className={
|
|
53
|
+
isIconOnly
|
|
54
|
+
? "!w-7 !h-7 !p-0 shrink-0 justify-center rounded-full leading-none"
|
|
55
|
+
: "gap-xs !rounded-lg"
|
|
56
|
+
}
|
|
71
57
|
>
|
|
72
58
|
{tab.icon && (
|
|
73
59
|
<span className="inline-flex items-center justify-center shrink-0" aria-hidden="true">
|
|
@@ -4,37 +4,9 @@ import type { NavEntry } from "../AppSidebar";
|
|
|
4
4
|
import { AppSidebarMobile } from "../AppSidebarMobile";
|
|
5
5
|
import { PromptInputBar } from "../PromptInputBar";
|
|
6
6
|
import { Button } from "../Button";
|
|
7
|
+
import { Icon } from "../Icon";
|
|
7
8
|
import type { PromptMode, PromptInputBarModel } from "../PromptInputBar";
|
|
8
9
|
|
|
9
|
-
/* ─── Icons ─────────────────────────────────────────────────────────────── */
|
|
10
|
-
|
|
11
|
-
const HomeIcon = () => (
|
|
12
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" style={{ width: "18px", height: "18px" }} aria-hidden="true">
|
|
13
|
-
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
|
14
|
-
<polyline points="9 22 9 12 15 12 15 22" />
|
|
15
|
-
</svg>
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const FolderIcon = () => (
|
|
19
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" style={{ width: "18px", height: "18px" }} aria-hidden="true">
|
|
20
|
-
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" />
|
|
21
|
-
</svg>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
const LogoIcon = () => (
|
|
25
|
-
<svg width="26" height="26" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
26
|
-
<path d="M12 36C12 36 8 28 16 22C20 19 26 20 26 20C26 20 22 26 18 30C16 32 12 36 12 36Z" style={{ fill: "var(--color-logo-orange)" }} />
|
|
27
|
-
<path d="M24 8C24 8 36 12 36 24C36 30 32 36 26 38C26 38 28 30 26 24C25 20 24 8 24 8Z" style={{ fill: "var(--color-logo-violet)" }} />
|
|
28
|
-
<path d="M12 36C12 36 16 24 24 20C28 18 36 20 36 20C36 20 30 28 26 32C22 36 12 36 12 36Z" style={{ fill: "var(--color-logo-pink)", opacity: 0.7 }} />
|
|
29
|
-
</svg>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const SparkleIcon = () => (
|
|
33
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" style={{ width: "14px", height: "14px" }} aria-hidden="true">
|
|
34
|
-
<path d="M12 2l2.4 7.4H22l-6.2 4.5 2.4 7.4L12 17 5.8 21.3l2.4-7.4L2 9.4h7.6z" />
|
|
35
|
-
</svg>
|
|
36
|
-
);
|
|
37
|
-
|
|
38
10
|
/* ─── Suggestion Chip ────────────────────────────────────────────────────── */
|
|
39
11
|
interface SuggestionChipProps {
|
|
40
12
|
label: string;
|
|
@@ -69,6 +41,11 @@ export interface HomePageTemplateProps {
|
|
|
69
41
|
userName?: string;
|
|
70
42
|
/** User initials for the footer avatar */
|
|
71
43
|
userInitials?: string;
|
|
44
|
+
/**
|
|
45
|
+
* User's email address, shown as the header of the account menu that opens
|
|
46
|
+
* when the footer avatar is clicked. Forwarded to AppSidebar as `userEmail`.
|
|
47
|
+
*/
|
|
48
|
+
userEmail?: string;
|
|
72
49
|
/** Controlled prompt value */
|
|
73
50
|
promptValue?: string;
|
|
74
51
|
/** Called when prompt input changes */
|
|
@@ -112,6 +89,12 @@ export interface HomePageTemplateProps {
|
|
|
112
89
|
* Forwarded to both AppSidebar and AppSidebarMobile.
|
|
113
90
|
*/
|
|
114
91
|
onDarkModeToggle?: () => void;
|
|
92
|
+
/**
|
|
93
|
+
* Called when the user chooses "Logout" from the footer avatar menu.
|
|
94
|
+
* Forwarded to AppSidebar (desktop). AppSidebarMobile does not yet expose an
|
|
95
|
+
* onLogout prop, so it is not forwarded there.
|
|
96
|
+
*/
|
|
97
|
+
onLogout?: () => void;
|
|
115
98
|
/**
|
|
116
99
|
* List of available AI models forwarded to PromptInputBar.
|
|
117
100
|
* When omitted, the built-in DEFAULT_MODELS list is used.
|
|
@@ -139,11 +122,11 @@ export interface HomePageTemplateProps {
|
|
|
139
122
|
|
|
140
123
|
/* ─── Nav entries ────────────────────────────────────────────────────────── */
|
|
141
124
|
const NAV_ENTRIES: NavEntry[] = [
|
|
142
|
-
{ id: "home", label: "Home", icon: <
|
|
125
|
+
{ id: "home", label: "Home", icon: <Icon name="home" style={{ width: "18px", height: "18px" }} /> },
|
|
143
126
|
{
|
|
144
127
|
id: "projects",
|
|
145
128
|
label: "All projects",
|
|
146
|
-
icon: <
|
|
129
|
+
icon: <Icon name="folder" style={{ width: "18px", height: "18px" }} />,
|
|
147
130
|
subItems: [
|
|
148
131
|
{ id: "proj-1", label: "Design system" },
|
|
149
132
|
{ id: "proj-2", label: "Landing page" },
|
|
@@ -174,6 +157,7 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
174
157
|
{
|
|
175
158
|
userName = "Hello Designer",
|
|
176
159
|
userInitials = "N",
|
|
160
|
+
userEmail,
|
|
177
161
|
promptValue,
|
|
178
162
|
onPromptChange,
|
|
179
163
|
mode = "Build",
|
|
@@ -188,6 +172,7 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
188
172
|
onSubSelect,
|
|
189
173
|
darkMode,
|
|
190
174
|
onDarkModeToggle,
|
|
175
|
+
onLogout,
|
|
191
176
|
models,
|
|
192
177
|
selectedModelId,
|
|
193
178
|
onModelChange,
|
|
@@ -253,9 +238,11 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
253
238
|
showShareCard={true}
|
|
254
239
|
showUpgradeCard={true}
|
|
255
240
|
userInitials={userInitials}
|
|
241
|
+
userEmail={userEmail}
|
|
256
242
|
onInboxClick={() => {}}
|
|
257
243
|
darkMode={darkMode}
|
|
258
244
|
onDarkModeToggle={onDarkModeToggle}
|
|
245
|
+
onLogout={onLogout}
|
|
259
246
|
defaultExpandedIds={defaultExpandedIds}
|
|
260
247
|
style={{ height: "100%" }}
|
|
261
248
|
/>
|
|
@@ -291,7 +278,7 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
291
278
|
onDarkModeToggle={onDarkModeToggle}
|
|
292
279
|
/>
|
|
293
280
|
<div className="flex items-center gap-xs">
|
|
294
|
-
<
|
|
281
|
+
<Icon name="atom" style={{ width: "22px", height: "22px" }} />
|
|
295
282
|
<span className="text-body-sm font-weight-heading-sm text-ink">Atoms</span>
|
|
296
283
|
</div>
|
|
297
284
|
</div>
|
|
@@ -315,7 +302,7 @@ export const HomePageTemplate = React.forwardRef<HTMLDivElement, HomePageTemplat
|
|
|
315
302
|
aria-label="New design system"
|
|
316
303
|
className="!rounded-full flex items-center gap-xs"
|
|
317
304
|
>
|
|
318
|
-
<
|
|
305
|
+
<Icon name="sparkle" style={{ width: "14px", height: "14px" }} />
|
|
319
306
|
New design system
|
|
320
307
|
</Button>
|
|
321
308
|
|
|
@@ -5,8 +5,7 @@ export default function Preview() {
|
|
|
5
5
|
const [darkMode, setDarkMode] = React.useState(false);
|
|
6
6
|
|
|
7
7
|
return (
|
|
8
|
-
|
|
9
|
-
<div className="w-full" style={{ height: "100vh", overflow: "hidden" }}>
|
|
8
|
+
<div className="w-full" style={{ height: "640px", overflow: "hidden" }}>
|
|
10
9
|
<HomePageTemplate
|
|
11
10
|
userName="Hello Designer"
|
|
12
11
|
userInitials="N"
|
|
@@ -18,6 +17,7 @@ export default function Preview() {
|
|
|
18
17
|
]}
|
|
19
18
|
darkMode={darkMode}
|
|
20
19
|
onDarkModeToggle={() => setDarkMode((d) => !d)}
|
|
20
|
+
onLogout={() => window.alert("Logged out")}
|
|
21
21
|
style={{ width: "100%", height: "100%" }}
|
|
22
22
|
/>
|
|
23
23
|
</div>
|