@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,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from "react";
|
|
2
2
|
import { Button } from "../Button";
|
|
3
|
+
import { Icon } from "../Icon";
|
|
3
4
|
|
|
4
5
|
export interface ModalProps {
|
|
5
6
|
/** Controls whether the modal is visible */
|
|
@@ -12,11 +13,13 @@ export interface ModalProps {
|
|
|
12
13
|
children?: React.ReactNode;
|
|
13
14
|
/** Optional footer actions */
|
|
14
15
|
footer?: React.ReactNode;
|
|
15
|
-
/** Max-width variant
|
|
16
|
-
|
|
16
|
+
/** Max-width variant. "full" fills almost the entire viewport (e.g. for
|
|
17
|
+
* media/image viewers) and always shows a close control even without a
|
|
18
|
+
* title. */
|
|
19
|
+
size?: "sm" | "md" | "lg" | "xl" | "full";
|
|
17
20
|
}
|
|
18
21
|
|
|
19
|
-
const sizeMap: Record<
|
|
22
|
+
const sizeMap: Record<"sm" | "md" | "lg" | "xl", string> = {
|
|
20
23
|
sm: "max-w-sm",
|
|
21
24
|
md: "max-w-lg",
|
|
22
25
|
lg: "max-w-2xl",
|
|
@@ -29,6 +32,7 @@ export const Modal = React.forwardRef<HTMLDivElement, ModalProps>(
|
|
|
29
32
|
const [mounted, setMounted] = useState(false);
|
|
30
33
|
const [visible, setVisible] = useState(false);
|
|
31
34
|
const overlayRef = useRef<HTMLDivElement>(null);
|
|
35
|
+
const isFull = size === "full";
|
|
32
36
|
|
|
33
37
|
// Open: mount first, then trigger transition on the next frame
|
|
34
38
|
useEffect(() => {
|
|
@@ -64,6 +68,18 @@ export const Modal = React.forwardRef<HTMLDivElement, ModalProps>(
|
|
|
64
68
|
if (e.target === overlayRef.current) onClose();
|
|
65
69
|
};
|
|
66
70
|
|
|
71
|
+
const closeButton = (
|
|
72
|
+
<Button
|
|
73
|
+
variant="ghost"
|
|
74
|
+
size="sm"
|
|
75
|
+
aria-label="Close modal"
|
|
76
|
+
onClick={onClose}
|
|
77
|
+
className="!px-xs !py-xs"
|
|
78
|
+
>
|
|
79
|
+
<Icon name="close" />
|
|
80
|
+
</Button>
|
|
81
|
+
);
|
|
82
|
+
|
|
67
83
|
return (
|
|
68
84
|
<div
|
|
69
85
|
ref={overlayRef}
|
|
@@ -83,56 +99,46 @@ export const Modal = React.forwardRef<HTMLDivElement, ModalProps>(
|
|
|
83
99
|
from the page behind the scrim, especially in dark mode where
|
|
84
100
|
canvas and scrim are both near-black. A hairline border adds a
|
|
85
101
|
crisp edge since box-shadow alone reads as nearly invisible on
|
|
86
|
-
dark backgrounds. max-h-
|
|
87
|
-
|
|
88
|
-
|
|
102
|
+
dark backgrounds. Non-full sizes cap at max-h-full — since the
|
|
103
|
+
overlay is a fixed, viewport-sized flex container, a percentage
|
|
104
|
+
max-height resolves against its definite height, so content-heavy
|
|
105
|
+
modals never overflow. "full" instead drops the max-w/max-h caps
|
|
106
|
+
and takes almost the entire overlay so a high-resolution
|
|
107
|
+
object-contain image (or other full-bleed content) can fill the
|
|
108
|
+
viewport. The body's overflow-y-auto lets long content scroll
|
|
109
|
+
within whichever height applies. */}
|
|
89
110
|
<div
|
|
90
111
|
ref={ref}
|
|
91
112
|
className={[
|
|
92
|
-
"relative
|
|
113
|
+
"relative bg-surface border border-hairline rounded-lg",
|
|
93
114
|
"shadow-[0_8px_40px_0_rgba(0,0,0,0.18)]",
|
|
94
115
|
"flex flex-col overflow-hidden",
|
|
95
|
-
|
|
116
|
+
isFull
|
|
117
|
+
? "w-[calc(100%-2*var(--spacing-base))] h-[calc(100%-2*var(--spacing-base))] max-w-none max-h-none"
|
|
118
|
+
: `w-full max-h-full ${sizeMap[size as "sm" | "md" | "lg" | "xl"]}`,
|
|
96
119
|
"transition-all duration-250 ease-in-out",
|
|
97
120
|
visible
|
|
98
121
|
? "opacity-100 translate-y-0 scale-100"
|
|
99
122
|
: "opacity-0 translate-y-2 scale-95",
|
|
100
123
|
].join(" ")}
|
|
101
124
|
>
|
|
102
|
-
{/* Header
|
|
103
|
-
|
|
125
|
+
{/* Header — always shown for size="full" (even without a title)
|
|
126
|
+
so there's always a way to dismiss a near-viewport panel. */}
|
|
127
|
+
{(title || isFull) && (
|
|
104
128
|
<div className="flex items-center justify-between px-lg py-base border-b border-hairline">
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
className="!px-xs !py-xs"
|
|
114
|
-
>
|
|
115
|
-
<svg
|
|
116
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
117
|
-
width="16"
|
|
118
|
-
height="16"
|
|
119
|
-
viewBox="0 0 24 24"
|
|
120
|
-
fill="none"
|
|
121
|
-
stroke="currentColor"
|
|
122
|
-
strokeWidth="2"
|
|
123
|
-
strokeLinecap="round"
|
|
124
|
-
strokeLinejoin="round"
|
|
125
|
-
aria-hidden="true"
|
|
126
|
-
>
|
|
127
|
-
<line x1="18" y1="6" x2="6" y2="18" />
|
|
128
|
-
<line x1="6" y1="6" x2="18" y2="18" />
|
|
129
|
-
</svg>
|
|
130
|
-
</Button>
|
|
129
|
+
{title ? (
|
|
130
|
+
<h2 id="modal-title" className="text-heading-sm text-ink">
|
|
131
|
+
{title}
|
|
132
|
+
</h2>
|
|
133
|
+
) : (
|
|
134
|
+
<span />
|
|
135
|
+
)}
|
|
136
|
+
{closeButton}
|
|
131
137
|
</div>
|
|
132
138
|
)}
|
|
133
139
|
|
|
134
140
|
{/* Body */}
|
|
135
|
-
<div className="flex-1 px-lg py-base text-body-md text-body overflow-y-auto">
|
|
141
|
+
<div className="flex-1 min-h-0 px-lg py-base text-body-md text-body overflow-y-auto">
|
|
136
142
|
{children}
|
|
137
143
|
</div>
|
|
138
144
|
|
|
@@ -6,6 +6,7 @@ export default function ModalPreview() {
|
|
|
6
6
|
const [basicOpen, setBasicOpen] = useState(false);
|
|
7
7
|
const [confirmOpen, setConfirmOpen] = useState(false);
|
|
8
8
|
const [largeOpen, setLargeOpen] = useState(false);
|
|
9
|
+
const [fullOpen, setFullOpen] = useState(false);
|
|
9
10
|
|
|
10
11
|
return (
|
|
11
12
|
<div className="w-full max-w-3xl mx-auto p-lg space-y-xl">
|
|
@@ -29,6 +30,9 @@ export default function ModalPreview() {
|
|
|
29
30
|
<Button variant="ghost" onClick={() => setLargeOpen(true)}>
|
|
30
31
|
Open large modal
|
|
31
32
|
</Button>
|
|
33
|
+
<Button variant="ghost" onClick={() => setFullOpen(true)}>
|
|
34
|
+
Open full-viewport modal
|
|
35
|
+
</Button>
|
|
32
36
|
</div>
|
|
33
37
|
|
|
34
38
|
{/* ── Basic modal ── */}
|
|
@@ -106,6 +110,15 @@ export default function ModalPreview() {
|
|
|
106
110
|
</div>
|
|
107
111
|
</div>
|
|
108
112
|
</Modal>
|
|
113
|
+
|
|
114
|
+
{/* ── Full-viewport modal (no title — close control still shows) ── */}
|
|
115
|
+
<Modal isOpen={fullOpen} onClose={() => setFullOpen(false)} size="full">
|
|
116
|
+
<div className="w-full h-full rounded-md bg-surface-soft border border-hairline flex items-center justify-center">
|
|
117
|
+
<span className="text-body-sm text-muted">
|
|
118
|
+
High-resolution image (object-contain) fills the viewer
|
|
119
|
+
</span>
|
|
120
|
+
</div>
|
|
121
|
+
</Modal>
|
|
109
122
|
</div>
|
|
110
123
|
);
|
|
111
124
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Button } from "../Button";
|
|
3
|
+
import { Icon } from "../Icon";
|
|
3
4
|
|
|
4
5
|
export interface NavItemShortcut {
|
|
5
6
|
/** E.g. "⌘" */
|
|
@@ -47,41 +48,15 @@ export interface NavItemProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
47
48
|
* Does NOT affect the parent NavItem's own `active` state.
|
|
48
49
|
*/
|
|
49
50
|
activeSubId?: string;
|
|
51
|
+
/**
|
|
52
|
+
* When true, this nav group always shows its sub-items/children expanded,
|
|
53
|
+
* regardless of the `expanded` prop, and hides the chevron affordance
|
|
54
|
+
* entirely (there is nothing to fold/unfold). Clicking the item still
|
|
55
|
+
* fires `onClick`, but `onExpandToggle` is never called. Defaults to false.
|
|
56
|
+
*/
|
|
57
|
+
alwaysExpanded?: boolean;
|
|
50
58
|
}
|
|
51
59
|
|
|
52
|
-
const ChevronDownIcon = () => (
|
|
53
|
-
<svg
|
|
54
|
-
viewBox="0 0 24 24"
|
|
55
|
-
fill="none"
|
|
56
|
-
stroke="currentColor"
|
|
57
|
-
strokeWidth="2"
|
|
58
|
-
strokeLinecap="round"
|
|
59
|
-
strokeLinejoin="round"
|
|
60
|
-
aria-hidden="true"
|
|
61
|
-
style={{ width: "14px", height: "14px", flexShrink: 0 }}
|
|
62
|
-
>
|
|
63
|
-
<polyline points="6 9 12 15 18 9" />
|
|
64
|
-
</svg>
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
const TrashIcon = () => (
|
|
68
|
-
<svg
|
|
69
|
-
viewBox="0 0 24 24"
|
|
70
|
-
fill="none"
|
|
71
|
-
stroke="currentColor"
|
|
72
|
-
strokeWidth="1.75"
|
|
73
|
-
strokeLinecap="round"
|
|
74
|
-
strokeLinejoin="round"
|
|
75
|
-
aria-hidden="true"
|
|
76
|
-
style={{ width: "14px", height: "14px", flexShrink: 0 }}
|
|
77
|
-
>
|
|
78
|
-
<polyline points="3 6 5 6 21 6" />
|
|
79
|
-
<path d="M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" />
|
|
80
|
-
<path d="M10 11v6M14 11v6" />
|
|
81
|
-
<path d="M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2" />
|
|
82
|
-
</svg>
|
|
83
|
-
);
|
|
84
|
-
|
|
85
60
|
interface SubItemRowProps {
|
|
86
61
|
item: NavItemSubItem;
|
|
87
62
|
isActive?: boolean;
|
|
@@ -141,7 +116,7 @@ const SubItemRow = ({ item, isActive = false }: SubItemRowProps) => {
|
|
|
141
116
|
].join(" ")}
|
|
142
117
|
tabIndex={hovered ? 0 : -1}
|
|
143
118
|
>
|
|
144
|
-
<
|
|
119
|
+
<Icon name="trash-delete" style={{ width: "14px", height: "14px" }} />
|
|
145
120
|
</Button>
|
|
146
121
|
)}
|
|
147
122
|
</li>
|
|
@@ -162,6 +137,7 @@ export const NavItem = React.forwardRef<HTMLLIElement, NavItemProps>(
|
|
|
162
137
|
iconOnly = false,
|
|
163
138
|
onClick,
|
|
164
139
|
activeSubId,
|
|
140
|
+
alwaysExpanded = false,
|
|
165
141
|
className,
|
|
166
142
|
...rest
|
|
167
143
|
},
|
|
@@ -170,13 +146,23 @@ export const NavItem = React.forwardRef<HTMLLIElement, NavItemProps>(
|
|
|
170
146
|
const hasSubItems = subItems && subItems.length > 0;
|
|
171
147
|
const hasChildren = React.Children.count(children) > 0;
|
|
172
148
|
const isExpandable = hasSubItems || hasChildren;
|
|
149
|
+
const effectiveExpanded = alwaysExpanded ? true : expanded;
|
|
173
150
|
const contentRef = React.useRef<HTMLDivElement>(null);
|
|
174
|
-
const [mounted, setMounted] = React.useState(Boolean(
|
|
175
|
-
const [visible, setVisible] = React.useState(Boolean(
|
|
151
|
+
const [mounted, setMounted] = React.useState(Boolean(effectiveExpanded));
|
|
152
|
+
const [visible, setVisible] = React.useState(Boolean(effectiveExpanded));
|
|
176
153
|
const [contentHeight, setContentHeight] = React.useState(0);
|
|
177
154
|
|
|
155
|
+
// The vertical guide line on the nested <ul> must sit exactly on the
|
|
156
|
+
// parent icon's horizontal center. The parent Button uses !px-sm
|
|
157
|
+
// (spacing.sm) and the icon box is 18px wide, so the icon center sits
|
|
158
|
+
// spacing.sm + 9px from the NavItem's left edge.
|
|
159
|
+
const treeGuideStyle: React.CSSProperties = {
|
|
160
|
+
marginLeft: "calc(var(--spacing-sm) + 9px)",
|
|
161
|
+
paddingLeft: "var(--spacing-sm)",
|
|
162
|
+
};
|
|
163
|
+
|
|
178
164
|
React.useEffect(() => {
|
|
179
|
-
if (
|
|
165
|
+
if (effectiveExpanded) {
|
|
180
166
|
setMounted(true);
|
|
181
167
|
const raf = requestAnimationFrame(() => {
|
|
182
168
|
if (contentRef.current) {
|
|
@@ -193,7 +179,7 @@ export const NavItem = React.forwardRef<HTMLLIElement, NavItemProps>(
|
|
|
193
179
|
setVisible(false);
|
|
194
180
|
const timer = window.setTimeout(() => setMounted(false), 220);
|
|
195
181
|
return () => window.clearTimeout(timer);
|
|
196
|
-
}, [
|
|
182
|
+
}, [effectiveExpanded, subItems, children]);
|
|
197
183
|
|
|
198
184
|
React.useEffect(() => {
|
|
199
185
|
if (!mounted || !contentRef.current) return;
|
|
@@ -208,7 +194,7 @@ export const NavItem = React.forwardRef<HTMLLIElement, NavItemProps>(
|
|
|
208
194
|
}, [mounted, subItems, children]);
|
|
209
195
|
|
|
210
196
|
const handleClick: React.MouseEventHandler<HTMLButtonElement> = (e) => {
|
|
211
|
-
if (isExpandable && onExpandToggle) {
|
|
197
|
+
if (isExpandable && onExpandToggle && !alwaysExpanded) {
|
|
212
198
|
onExpandToggle();
|
|
213
199
|
}
|
|
214
200
|
onClick?.(e);
|
|
@@ -224,7 +210,7 @@ export const NavItem = React.forwardRef<HTMLLIElement, NavItemProps>(
|
|
|
224
210
|
variant="ghost"
|
|
225
211
|
size="sm"
|
|
226
212
|
aria-current={active ? "page" : undefined}
|
|
227
|
-
aria-expanded={isExpandable ?
|
|
213
|
+
aria-expanded={isExpandable ? effectiveExpanded : undefined}
|
|
228
214
|
aria-label={iconOnly ? label : undefined}
|
|
229
215
|
title={iconOnly ? label : undefined}
|
|
230
216
|
onClick={handleClick}
|
|
@@ -286,15 +272,15 @@ export const NavItem = React.forwardRef<HTMLLIElement, NavItemProps>(
|
|
|
286
272
|
</span>
|
|
287
273
|
)}
|
|
288
274
|
|
|
289
|
-
{!iconOnly && isExpandable && (
|
|
275
|
+
{!iconOnly && isExpandable && !alwaysExpanded && (
|
|
290
276
|
<span
|
|
291
277
|
aria-hidden="true"
|
|
292
278
|
className={[
|
|
293
279
|
"ml-auto text-muted transition-transform duration-200 ease-in-out",
|
|
294
|
-
|
|
280
|
+
effectiveExpanded ? "rotate-180" : "rotate-0",
|
|
295
281
|
].join(" ")}
|
|
296
282
|
>
|
|
297
|
-
<
|
|
283
|
+
<Icon name="chevron-down" style={{ width: "14px", height: "14px" }} />
|
|
298
284
|
</span>
|
|
299
285
|
)}
|
|
300
286
|
</Button>
|
|
@@ -312,8 +298,9 @@ export const NavItem = React.forwardRef<HTMLLIElement, NavItemProps>(
|
|
|
312
298
|
<div ref={contentRef}>
|
|
313
299
|
{hasSubItems && (
|
|
314
300
|
<ul
|
|
315
|
-
className="
|
|
301
|
+
className="border-l border-hairline-soft space-y-xxs"
|
|
316
302
|
role="list"
|
|
303
|
+
style={treeGuideStyle}
|
|
317
304
|
>
|
|
318
305
|
{subItems!.map((item) => (
|
|
319
306
|
<SubItemRow
|
|
@@ -327,8 +314,9 @@ export const NavItem = React.forwardRef<HTMLLIElement, NavItemProps>(
|
|
|
327
314
|
|
|
328
315
|
{hasChildren && (
|
|
329
316
|
<ul
|
|
330
|
-
className="
|
|
317
|
+
className="border-l border-hairline-soft space-y-xxs"
|
|
331
318
|
role="list"
|
|
319
|
+
style={treeGuideStyle}
|
|
332
320
|
>
|
|
333
321
|
{children}
|
|
334
322
|
</ul>
|
|
@@ -1,32 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { NavItem } from "./NavItem";
|
|
3
|
+
import { Icon } from "../Icon";
|
|
3
4
|
|
|
4
|
-
const HomeIcon =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</svg>
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
const SearchIcon = (
|
|
12
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" style={{ width: "18px", height: "18px" }}>
|
|
13
|
-
<circle cx="11" cy="11" r="8" />
|
|
14
|
-
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
15
|
-
</svg>
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const FolderIcon = (
|
|
19
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" style={{ width: "18px", height: "18px" }}>
|
|
20
|
-
<path d="M3 7a2 2 0 0 1 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2A2 2 0 0 0 13.07 8H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z" />
|
|
21
|
-
</svg>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
const SettingsIcon = (
|
|
25
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" style={{ width: "18px", height: "18px" }}>
|
|
26
|
-
<circle cx="12" cy="12" r="3" />
|
|
27
|
-
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" />
|
|
28
|
-
</svg>
|
|
29
|
-
);
|
|
5
|
+
const HomeIcon = <Icon name="home" style={{ width: "18px", height: "18px" }} />;
|
|
6
|
+
const SearchIcon = <Icon name="search-magnifier" style={{ width: "18px", height: "18px" }} />;
|
|
7
|
+
const FolderIcon = <Icon name="folder" style={{ width: "18px", height: "18px" }} />;
|
|
8
|
+
const SettingsIcon = <Icon name="settings-gear" style={{ width: "18px", height: "18px" }} />;
|
|
30
9
|
|
|
31
10
|
export default function NavItemPreview() {
|
|
32
11
|
const [projectsExpanded, setProjectsExpanded] = React.useState(true);
|
|
@@ -105,6 +84,22 @@ export default function NavItemPreview() {
|
|
|
105
84
|
</ul>
|
|
106
85
|
</div>
|
|
107
86
|
|
|
87
|
+
{/* Always-expanded group — no chevron, cannot be folded */}
|
|
88
|
+
<div>
|
|
89
|
+
<p className="text-caption text-muted mb-sm">Always-expanded group (alwaysExpanded — no chevron, stays open)</p>
|
|
90
|
+
<ul className="space-y-xxs w-64">
|
|
91
|
+
<NavItem
|
|
92
|
+
icon={FolderIcon}
|
|
93
|
+
label="Workspaces"
|
|
94
|
+
alwaysExpanded
|
|
95
|
+
subItems={[
|
|
96
|
+
{ id: "w1", label: "Marketing" },
|
|
97
|
+
{ id: "w2", label: "Engineering" },
|
|
98
|
+
]}
|
|
99
|
+
/>
|
|
100
|
+
</ul>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
108
103
|
{/* Collapsed group */}
|
|
109
104
|
<div>
|
|
110
105
|
<p className="text-caption text-muted mb-sm">Collapsed group</p>
|