@designa8/vibedesign-v6 1.15.3 → 1.20.12
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 +1 -1
- package/dist/index.cjs +3232 -1994
- package/dist/index.js +3242 -2004
- package/dist/styles.css +266 -28
- package/package.json +51 -1
- 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/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 +51 -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
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button } from "../Button";
|
|
3
|
+
import { Icon } from "../Icon";
|
|
4
|
+
import { Menu, type MenuItem } from "../Menu";
|
|
5
|
+
|
|
6
|
+
/* ─── Types ──────────────────────────────────────────────────────────────── */
|
|
7
|
+
|
|
8
|
+
export interface ChatHistoryItem {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
/** Optional delete callback — a trash icon appears on hover when provided. */
|
|
12
|
+
onDelete?: (id: string) => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ChatHistorySidebarProps extends React.HTMLAttributes<HTMLElement> {
|
|
16
|
+
/** Brand mark label shown next to the avatar when expanded. */
|
|
17
|
+
brandName?: string;
|
|
18
|
+
|
|
19
|
+
/** Controlled collapsed state. */
|
|
20
|
+
collapsed?: boolean;
|
|
21
|
+
/** Called with the next collapsed state whenever the toggle is used. */
|
|
22
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
23
|
+
/** Uncontrolled initial collapsed state. Defaults to true (folded). */
|
|
24
|
+
defaultCollapsed?: boolean;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Recent chat entries rendered under the "Recents" heading.
|
|
28
|
+
* @deprecated use `chatHistoryItems` instead. Still honored when
|
|
29
|
+
* `chatHistoryItems` is omitted, for backwards compatibility.
|
|
30
|
+
*/
|
|
31
|
+
historyItems?: ChatHistoryItem[];
|
|
32
|
+
/** Root / non-component chat entries rendered under the "Recents" heading. */
|
|
33
|
+
chatHistoryItems?: ChatHistoryItem[];
|
|
34
|
+
/** Chats that produced a generated component, rendered under "Components". */
|
|
35
|
+
componentHistoryItems?: ChatHistoryItem[];
|
|
36
|
+
/**
|
|
37
|
+
* Conversations created by consumer-app DESIGN.md agent calls
|
|
38
|
+
* (atom-requests and fix-requests), rendered under "Design.md requests".
|
|
39
|
+
* This section is always rendered last and hidden when empty.
|
|
40
|
+
*/
|
|
41
|
+
designMdRequestItems?: ChatHistoryItem[];
|
|
42
|
+
/** ID of the currently-active chat, shared by all lists. */
|
|
43
|
+
activeHistoryId?: string;
|
|
44
|
+
/** Called when a chat row is selected, in any list. */
|
|
45
|
+
onSelectHistoryItem?: (id: string) => void;
|
|
46
|
+
|
|
47
|
+
onNewChat?: () => void;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Initials shown in the avatar circle rendered as the first item in the
|
|
51
|
+
* sidebar's header (above the fold/unfold toggle). Omit to hide the avatar.
|
|
52
|
+
*/
|
|
53
|
+
avatarInitials?: string;
|
|
54
|
+
/** Called when "Back to projects" is selected from the avatar menu. */
|
|
55
|
+
onBackToProjects?: () => void;
|
|
56
|
+
/** Called when "Home" is selected from the avatar menu. */
|
|
57
|
+
onHome?: () => void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* ─── Avatar nav trigger ─────────────────────────────────────────────────── */
|
|
61
|
+
/* The circular initials avatar composes the shared Menu molecule in `portal`
|
|
62
|
+
mode so the item list always paints above the sidebar's own clipped
|
|
63
|
+
(overflow-hidden) / animated content, regardless of the sidebar's collapse
|
|
64
|
+
transition or stacking context. */
|
|
65
|
+
|
|
66
|
+
interface AvatarNavProps {
|
|
67
|
+
initials: string;
|
|
68
|
+
onBackToProjects?: () => void;
|
|
69
|
+
onHome?: () => void;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const AvatarNav: React.FC<AvatarNavProps> = ({ initials, onBackToProjects, onHome }) => {
|
|
73
|
+
const items: MenuItem[] = [
|
|
74
|
+
{ id: "back-to-projects", label: "Back to projects", icon: "arrow-left", onSelect: onBackToProjects },
|
|
75
|
+
{ id: "home", label: "Home", icon: "home", onSelect: onHome },
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<Menu
|
|
80
|
+
items={items}
|
|
81
|
+
align="left"
|
|
82
|
+
portal
|
|
83
|
+
aria-label="Navigation"
|
|
84
|
+
className="flex-shrink-0"
|
|
85
|
+
trigger={
|
|
86
|
+
<Button
|
|
87
|
+
type="button"
|
|
88
|
+
variant="ghost"
|
|
89
|
+
size="sm"
|
|
90
|
+
aria-label="Open navigation menu"
|
|
91
|
+
className="!p-0 !gap-xxs !rounded-xl !bg-transparent !border-0 flex items-center"
|
|
92
|
+
>
|
|
93
|
+
<span
|
|
94
|
+
className="flex items-center justify-center rounded-full bg-primary text-on-primary select-none font-weight-heading-sm"
|
|
95
|
+
style={{ width: 32, height: 32, fontSize: 13, flexShrink: 0 }}
|
|
96
|
+
>
|
|
97
|
+
{initials}
|
|
98
|
+
</span>
|
|
99
|
+
</Button>
|
|
100
|
+
}
|
|
101
|
+
/>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/* ─── Row primitives ─────────────────────────────────────────────────────── */
|
|
106
|
+
|
|
107
|
+
interface RailButtonProps {
|
|
108
|
+
label: string;
|
|
109
|
+
icon: React.ReactNode;
|
|
110
|
+
onClick?: () => void;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const RailButton: React.FC<RailButtonProps> = ({ label, icon, onClick }) => (
|
|
114
|
+
<Button
|
|
115
|
+
type="button"
|
|
116
|
+
variant="ghost"
|
|
117
|
+
size="sm"
|
|
118
|
+
aria-label={label}
|
|
119
|
+
title={label}
|
|
120
|
+
onClick={onClick}
|
|
121
|
+
className="!w-full !justify-center !px-xs !py-sm !rounded-md !text-muted hover:!text-ink"
|
|
122
|
+
>
|
|
123
|
+
{icon}
|
|
124
|
+
</Button>
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
interface ExpandedRowProps {
|
|
128
|
+
label: string;
|
|
129
|
+
icon: React.ReactNode;
|
|
130
|
+
onClick?: () => void;
|
|
131
|
+
bold?: boolean;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const ExpandedRow: React.FC<ExpandedRowProps> = ({ label, icon, onClick, bold = false }) => (
|
|
135
|
+
<Button
|
|
136
|
+
type="button"
|
|
137
|
+
variant="ghost"
|
|
138
|
+
size="sm"
|
|
139
|
+
onClick={onClick}
|
|
140
|
+
className={[
|
|
141
|
+
"!w-full !justify-start !px-sm !py-xs !rounded-md !gap-sm",
|
|
142
|
+
bold ? "!font-weight-heading-sm !text-ink" : "!text-body hover:!text-ink",
|
|
143
|
+
].join(" ")}
|
|
144
|
+
>
|
|
145
|
+
<span className="flex-shrink-0 text-muted" style={{ width: "18px", height: "18px", display: "flex", alignItems: "center", justifyContent: "center" }}>
|
|
146
|
+
{icon}
|
|
147
|
+
</span>
|
|
148
|
+
<span className="flex-1 text-left text-body-sm truncate">{label}</span>
|
|
149
|
+
</Button>
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
interface HistoryRowProps {
|
|
153
|
+
item: ChatHistoryItem;
|
|
154
|
+
active?: boolean;
|
|
155
|
+
onClick?: () => void;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const HistoryRow: React.FC<HistoryRowProps> = ({ item, active = false, onClick }) => {
|
|
159
|
+
const [hovered, setHovered] = React.useState(false);
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<li
|
|
163
|
+
className={["list-none flex items-center gap-xs rounded-md", active ? "bg-primary-disabled" : ""].filter(Boolean).join(" ")}
|
|
164
|
+
onMouseEnter={() => setHovered(true)}
|
|
165
|
+
onMouseLeave={() => setHovered(false)}
|
|
166
|
+
>
|
|
167
|
+
<Button
|
|
168
|
+
type="button"
|
|
169
|
+
variant="ghost"
|
|
170
|
+
size="sm"
|
|
171
|
+
aria-current={active ? "page" : undefined}
|
|
172
|
+
onClick={onClick}
|
|
173
|
+
className={[
|
|
174
|
+
"!flex-1 !justify-start !px-sm !py-xs !text-body-sm !rounded-md !min-w-0",
|
|
175
|
+
active ? "!text-primary" : "!text-body hover:!text-ink",
|
|
176
|
+
].join(" ")}
|
|
177
|
+
>
|
|
178
|
+
<span dir="auto" className="block w-full truncate text-left">
|
|
179
|
+
{item.label}
|
|
180
|
+
</span>
|
|
181
|
+
</Button>
|
|
182
|
+
{item.onDelete && (
|
|
183
|
+
<Button
|
|
184
|
+
type="button"
|
|
185
|
+
variant="ghost"
|
|
186
|
+
size="sm"
|
|
187
|
+
aria-label={`Delete ${item.label}`}
|
|
188
|
+
onClick={(e) => {
|
|
189
|
+
e.stopPropagation();
|
|
190
|
+
item.onDelete!(item.id);
|
|
191
|
+
}}
|
|
192
|
+
className={[
|
|
193
|
+
"!p-xxs !rounded-xs !text-muted !min-w-0 !mr-xs transition-opacity duration-200 ease-in-out",
|
|
194
|
+
"hover:!text-semantic-error",
|
|
195
|
+
hovered ? "opacity-100" : "opacity-0",
|
|
196
|
+
].join(" ")}
|
|
197
|
+
tabIndex={hovered ? 0 : -1}
|
|
198
|
+
>
|
|
199
|
+
<Icon name="trash-delete" style={{ width: "14px", height: "14px" }} />
|
|
200
|
+
</Button>
|
|
201
|
+
)}
|
|
202
|
+
</li>
|
|
203
|
+
);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
/* ─── Component ──────────────────────────────────────────────────────────── */
|
|
207
|
+
|
|
208
|
+
export const ChatHistorySidebar = React.forwardRef<HTMLElement, ChatHistorySidebarProps>(
|
|
209
|
+
(
|
|
210
|
+
{
|
|
211
|
+
brandName,
|
|
212
|
+
collapsed: collapsedProp,
|
|
213
|
+
onCollapsedChange,
|
|
214
|
+
defaultCollapsed = true,
|
|
215
|
+
historyItems,
|
|
216
|
+
chatHistoryItems,
|
|
217
|
+
componentHistoryItems = [],
|
|
218
|
+
designMdRequestItems = [],
|
|
219
|
+
activeHistoryId,
|
|
220
|
+
onSelectHistoryItem,
|
|
221
|
+
onNewChat,
|
|
222
|
+
avatarInitials,
|
|
223
|
+
onBackToProjects,
|
|
224
|
+
onHome,
|
|
225
|
+
className,
|
|
226
|
+
...rest
|
|
227
|
+
},
|
|
228
|
+
ref,
|
|
229
|
+
) => {
|
|
230
|
+
const [internalCollapsed, setInternalCollapsed] = React.useState(defaultCollapsed);
|
|
231
|
+
const isControlled = collapsedProp !== undefined;
|
|
232
|
+
const collapsed = isControlled ? collapsedProp : internalCollapsed;
|
|
233
|
+
|
|
234
|
+
const recents = chatHistoryItems ?? historyItems ?? [];
|
|
235
|
+
const components = componentHistoryItems;
|
|
236
|
+
const designMdRequests = designMdRequestItems;
|
|
237
|
+
const bothEmpty = recents.length === 0 && components.length === 0 && designMdRequests.length === 0;
|
|
238
|
+
|
|
239
|
+
const toggle = () => {
|
|
240
|
+
const next = !collapsed;
|
|
241
|
+
if (!isControlled) setInternalCollapsed(next);
|
|
242
|
+
onCollapsedChange?.(next);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
const toggleButton = (
|
|
246
|
+
<Button
|
|
247
|
+
type="button"
|
|
248
|
+
variant="ghost"
|
|
249
|
+
size="sm"
|
|
250
|
+
aria-label={collapsed ? "Expand chat history" : "Collapse chat history"}
|
|
251
|
+
aria-expanded={!collapsed}
|
|
252
|
+
onClick={toggle}
|
|
253
|
+
className={[
|
|
254
|
+
"!p-xs !rounded-md flex-shrink-0 transition-all duration-200",
|
|
255
|
+
collapsed ? "!text-primary ring-2 ring-primary !bg-transparent hover:!bg-surface-soft" : "",
|
|
256
|
+
]
|
|
257
|
+
.filter(Boolean)
|
|
258
|
+
.join(" ")}
|
|
259
|
+
>
|
|
260
|
+
<Icon name="sidebar-panel-toggle" className="size-[18px]" />
|
|
261
|
+
</Button>
|
|
262
|
+
);
|
|
263
|
+
|
|
264
|
+
return (
|
|
265
|
+
<nav
|
|
266
|
+
ref={ref}
|
|
267
|
+
aria-label="Chat history"
|
|
268
|
+
className={[
|
|
269
|
+
"flex flex-col bg-canvas border-r border-hairline-soft h-full flex-shrink-0",
|
|
270
|
+
"transition-all duration-300 ease-in-out overflow-x-hidden",
|
|
271
|
+
collapsed ? "w-14" : "w-64",
|
|
272
|
+
className,
|
|
273
|
+
]
|
|
274
|
+
.filter(Boolean)
|
|
275
|
+
.join(" ")}
|
|
276
|
+
{...rest}
|
|
277
|
+
>
|
|
278
|
+
{/* Header — avatar first, then the fold/unfold toggle, with breathing room between them */}
|
|
279
|
+
{collapsed ? (
|
|
280
|
+
<div className="flex flex-col items-center gap-md px-sm pt-md pb-md flex-shrink-0">
|
|
281
|
+
{avatarInitials && (
|
|
282
|
+
<AvatarNav initials={avatarInitials} onBackToProjects={onBackToProjects} onHome={onHome} />
|
|
283
|
+
)}
|
|
284
|
+
{toggleButton}
|
|
285
|
+
</div>
|
|
286
|
+
) : (
|
|
287
|
+
<div className="flex items-center justify-between gap-sm px-sm pt-md pb-sm flex-shrink-0">
|
|
288
|
+
<div className="flex items-center gap-sm min-w-0 overflow-hidden">
|
|
289
|
+
{avatarInitials && (
|
|
290
|
+
<AvatarNav initials={avatarInitials} onBackToProjects={onBackToProjects} onHome={onHome} />
|
|
291
|
+
)}
|
|
292
|
+
{brandName && (
|
|
293
|
+
<span className="text-body-sm font-weight-heading-sm text-ink truncate">{brandName}</span>
|
|
294
|
+
)}
|
|
295
|
+
</div>
|
|
296
|
+
{toggleButton}
|
|
297
|
+
</div>
|
|
298
|
+
)}
|
|
299
|
+
|
|
300
|
+
{/* Primary action — New chat is the only entry point here */}
|
|
301
|
+
<div className="flex-shrink-0 px-xs space-y-xxs pb-sm">
|
|
302
|
+
{collapsed ? (
|
|
303
|
+
<RailButton label="New chat" icon={<Icon name="pencil-edit" className="size-[18px]" />} onClick={onNewChat} />
|
|
304
|
+
) : (
|
|
305
|
+
<ExpandedRow label="New chat" icon={<Icon name="pencil-edit" className="size-[18px]" />} onClick={onNewChat} bold />
|
|
306
|
+
)}
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
{/* Recents + Components + Design.md requests — only meaningful when expanded */}
|
|
310
|
+
{!collapsed && (
|
|
311
|
+
<div className="flex-1 min-h-0 overflow-y-auto overflow-x-hidden px-sm pb-md space-y-md">
|
|
312
|
+
{(recents.length > 0 || bothEmpty) && (
|
|
313
|
+
<div className="space-y-xxs">
|
|
314
|
+
<p className="text-caption text-muted-soft px-sm">Recents</p>
|
|
315
|
+
{recents.length > 0 ? (
|
|
316
|
+
<ul className="space-y-xxs" role="list">
|
|
317
|
+
{recents.map((item) => (
|
|
318
|
+
<HistoryRow
|
|
319
|
+
key={item.id}
|
|
320
|
+
item={item}
|
|
321
|
+
active={activeHistoryId === item.id}
|
|
322
|
+
onClick={() => onSelectHistoryItem?.(item.id)}
|
|
323
|
+
/>
|
|
324
|
+
))}
|
|
325
|
+
</ul>
|
|
326
|
+
) : (
|
|
327
|
+
<p className="text-body-sm text-muted-soft px-sm py-xs">No recent chats yet.</p>
|
|
328
|
+
)}
|
|
329
|
+
</div>
|
|
330
|
+
)}
|
|
331
|
+
|
|
332
|
+
{components.length > 0 && (
|
|
333
|
+
<div className="space-y-xxs">
|
|
334
|
+
<p className="text-caption text-muted-soft px-sm">Components</p>
|
|
335
|
+
<ul className="space-y-xxs" role="list">
|
|
336
|
+
{components.map((item) => (
|
|
337
|
+
<HistoryRow
|
|
338
|
+
key={item.id}
|
|
339
|
+
item={item}
|
|
340
|
+
active={activeHistoryId === item.id}
|
|
341
|
+
onClick={() => onSelectHistoryItem?.(item.id)}
|
|
342
|
+
/>
|
|
343
|
+
))}
|
|
344
|
+
</ul>
|
|
345
|
+
</div>
|
|
346
|
+
)}
|
|
347
|
+
|
|
348
|
+
{designMdRequests.length > 0 && (
|
|
349
|
+
<div className="space-y-xxs">
|
|
350
|
+
<p className="text-caption text-muted-soft px-sm">Design.md requests</p>
|
|
351
|
+
<ul className="space-y-xxs" role="list">
|
|
352
|
+
{designMdRequests.map((item) => (
|
|
353
|
+
<HistoryRow
|
|
354
|
+
key={item.id}
|
|
355
|
+
item={item}
|
|
356
|
+
active={activeHistoryId === item.id}
|
|
357
|
+
onClick={() => onSelectHistoryItem?.(item.id)}
|
|
358
|
+
/>
|
|
359
|
+
))}
|
|
360
|
+
</ul>
|
|
361
|
+
</div>
|
|
362
|
+
)}
|
|
363
|
+
</div>
|
|
364
|
+
)}
|
|
365
|
+
</nav>
|
|
366
|
+
);
|
|
367
|
+
},
|
|
368
|
+
);
|
|
369
|
+
|
|
370
|
+
ChatHistorySidebar.displayName = "ChatHistorySidebar";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ChatHistorySidebar, ChatHistoryItem } from "./ChatHistorySidebar";
|
|
3
|
+
|
|
4
|
+
const recents: ChatHistoryItem[] = [
|
|
5
|
+
{ id: "r1", label: "Plan a weekend trip to Lisbon" },
|
|
6
|
+
{ id: "r2", label: "Summarize quarterly earnings report" },
|
|
7
|
+
{ id: "r3", label: "Debug flaky CI pipeline" },
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
const componentsHistory: ChatHistoryItem[] = [
|
|
11
|
+
{ id: "c1", label: "Pricing card with annual toggle" },
|
|
12
|
+
{ id: "c2", label: "Onboarding checklist widget" },
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const designMdRequests: ChatHistoryItem[] = [
|
|
16
|
+
{ id: "d1", label: "Atom request: StatusBadge" },
|
|
17
|
+
{ id: "d2", label: "Fix request: Switch thumb animation" },
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
export default function ChatHistorySidebarPreview() {
|
|
21
|
+
const [collapsed, setCollapsed] = React.useState(false);
|
|
22
|
+
const [activeId, setActiveId] = React.useState("r2");
|
|
23
|
+
|
|
24
|
+
const [collapsedEmpty, setCollapsedEmpty] = React.useState(false);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div className="w-full max-w-3xl mx-auto p-lg space-y-lg">
|
|
28
|
+
<div className="flex gap-lg" style={{ height: 480 }}>
|
|
29
|
+
<ChatHistorySidebar
|
|
30
|
+
brandName="Acme"
|
|
31
|
+
avatarInitials="JD"
|
|
32
|
+
collapsed={collapsed}
|
|
33
|
+
onCollapsedChange={setCollapsed}
|
|
34
|
+
chatHistoryItems={recents}
|
|
35
|
+
componentHistoryItems={componentsHistory}
|
|
36
|
+
designMdRequestItems={designMdRequests}
|
|
37
|
+
activeHistoryId={activeId}
|
|
38
|
+
onSelectHistoryItem={setActiveId}
|
|
39
|
+
onNewChat={() => alert("New chat")}
|
|
40
|
+
/>
|
|
41
|
+
<div className="flex-1 flex items-center justify-center text-body-sm text-muted-soft">
|
|
42
|
+
Main content area
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div className="flex gap-lg" style={{ height: 320 }}>
|
|
47
|
+
<ChatHistorySidebar
|
|
48
|
+
brandName="Acme"
|
|
49
|
+
avatarInitials="JD"
|
|
50
|
+
collapsed={collapsedEmpty}
|
|
51
|
+
onCollapsedChange={setCollapsedEmpty}
|
|
52
|
+
onNewChat={() => alert("New chat")}
|
|
53
|
+
/>
|
|
54
|
+
<div className="flex-1 flex items-center justify-center text-body-sm text-muted-soft">
|
|
55
|
+
Empty state — no recent, component, or Design.md chats yet
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|