@designa8/vibedesign-v6 1.9.7 → 1.10.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/README.md +1 -1
- package/dist/index.cjs +691 -162
- package/dist/index.js +677 -148
- package/dist/styles.css +46 -0
- package/package.json +11 -1
- package/src/atoms/AppSidebarMobile/AppSidebarMobile.tsx +352 -0
- package/src/atoms/AppSidebarMobile/index.ts +2 -0
- package/src/atoms/AppSidebarMobile/preview.tsx +92 -0
- package/src/atoms/HomePageTemplate/HomePageTemplate.tsx +330 -0
- package/src/atoms/HomePageTemplate/index.ts +2 -0
- package/src/atoms/HomePageTemplate/preview.tsx +21 -0
- package/src/index.ts +2 -0
package/dist/styles.css
CHANGED
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
--radius-md: 12px;
|
|
42
42
|
--radius-lg: 16px;
|
|
43
43
|
--radius-xl: 24px;
|
|
44
|
+
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
44
45
|
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
45
46
|
--animate-spin: spin 1s linear infinite;
|
|
46
47
|
--animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
@@ -530,9 +531,15 @@
|
|
|
530
531
|
.h-full {
|
|
531
532
|
height: 100%;
|
|
532
533
|
}
|
|
534
|
+
.h-md {
|
|
535
|
+
height: var(--spacing-md);
|
|
536
|
+
}
|
|
533
537
|
.h-px {
|
|
534
538
|
height: 1px;
|
|
535
539
|
}
|
|
540
|
+
.h-sm {
|
|
541
|
+
height: var(--spacing-sm);
|
|
542
|
+
}
|
|
536
543
|
.min-h-0 {
|
|
537
544
|
min-height: 0;
|
|
538
545
|
}
|
|
@@ -578,6 +585,9 @@
|
|
|
578
585
|
.w-5 {
|
|
579
586
|
width: calc(var(--spacing) * 5);
|
|
580
587
|
}
|
|
588
|
+
.w-5\/6 {
|
|
589
|
+
width: calc(5 / 6 * 100%);
|
|
590
|
+
}
|
|
581
591
|
.w-10 {
|
|
582
592
|
width: calc(var(--spacing) * 10);
|
|
583
593
|
}
|
|
@@ -1044,6 +1054,9 @@
|
|
|
1044
1054
|
.p-lg {
|
|
1045
1055
|
padding: var(--spacing-lg);
|
|
1046
1056
|
}
|
|
1057
|
+
.p-md {
|
|
1058
|
+
padding: var(--spacing-md);
|
|
1059
|
+
}
|
|
1047
1060
|
.p-sm {
|
|
1048
1061
|
padding: var(--spacing-sm);
|
|
1049
1062
|
}
|
|
@@ -1627,6 +1640,16 @@
|
|
|
1627
1640
|
opacity: 50%;
|
|
1628
1641
|
}
|
|
1629
1642
|
}
|
|
1643
|
+
.md\:flex {
|
|
1644
|
+
@media (width >= 48rem) {
|
|
1645
|
+
display: flex;
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
.md\:hidden {
|
|
1649
|
+
@media (width >= 48rem) {
|
|
1650
|
+
display: none;
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1630
1653
|
.md\:inline-flex {
|
|
1631
1654
|
@media (width >= 48rem) {
|
|
1632
1655
|
display: inline-flex;
|
|
@@ -1642,6 +1665,29 @@
|
|
|
1642
1665
|
flex-wrap: nowrap;
|
|
1643
1666
|
}
|
|
1644
1667
|
}
|
|
1668
|
+
.md\:gap-xl {
|
|
1669
|
+
@media (width >= 48rem) {
|
|
1670
|
+
gap: var(--spacing-xl);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
.md\:px-lg {
|
|
1674
|
+
@media (width >= 48rem) {
|
|
1675
|
+
padding-inline: var(--spacing-lg);
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
.md\:py-xxl {
|
|
1679
|
+
@media (width >= 48rem) {
|
|
1680
|
+
padding-block: var(--spacing-xxl);
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
.md\:text-body-md {
|
|
1684
|
+
@media (width >= 48rem) {
|
|
1685
|
+
font-size: var(--text-body-md);
|
|
1686
|
+
line-height: var(--tw-leading, var(--text-body-md--line-height));
|
|
1687
|
+
letter-spacing: var(--tw-tracking, var(--text-body-md--letter-spacing));
|
|
1688
|
+
font-weight: var(--tw-font-weight, var(--text-body-md--font-weight));
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1645
1691
|
|
|
1646
1692
|
:root {
|
|
1647
1693
|
--grid-columns: 12;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@designa8/vibedesign-v6",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "Design system \"Plasma Design System\" generated by atom-server.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
"kind": "Organism",
|
|
45
45
|
"description": null
|
|
46
46
|
},
|
|
47
|
+
{
|
|
48
|
+
"name": "AppSidebarMobile",
|
|
49
|
+
"kind": "Organism",
|
|
50
|
+
"description": null
|
|
51
|
+
},
|
|
47
52
|
{
|
|
48
53
|
"name": "AuthScreen",
|
|
49
54
|
"kind": "Organism",
|
|
@@ -74,6 +79,11 @@
|
|
|
74
79
|
"kind": "Atom",
|
|
75
80
|
"description": null
|
|
76
81
|
},
|
|
82
|
+
{
|
|
83
|
+
"name": "HomePageTemplate",
|
|
84
|
+
"kind": "Template",
|
|
85
|
+
"description": null
|
|
86
|
+
},
|
|
77
87
|
{
|
|
78
88
|
"name": "Input",
|
|
79
89
|
"kind": "Atom",
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button } from "../Button";
|
|
3
|
+
import { NavItem } from "../NavItem";
|
|
4
|
+
import { WorkspaceMenu } from "../WorkspaceMenu";
|
|
5
|
+
import { UpgradeCard } from "../UpgradeCard";
|
|
6
|
+
import type { NavItemSubItem } from "../NavItem";
|
|
7
|
+
|
|
8
|
+
/* ─── Icons ─────────────────────────────────────────────────────────────── */
|
|
9
|
+
|
|
10
|
+
const LogoIcon = () => (
|
|
11
|
+
<svg width="28" height="28" viewBox="0 0 48 48" fill="none" aria-hidden="true">
|
|
12
|
+
<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)" }} />
|
|
13
|
+
<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)" }} />
|
|
14
|
+
<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 }} />
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const HamburgerIcon = () => (
|
|
19
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" aria-hidden="true" style={{ width: "20px", height: "20px" }}>
|
|
20
|
+
<line x1="3" y1="6" x2="21" y2="6" />
|
|
21
|
+
<line x1="3" y1="12" x2="21" y2="12" />
|
|
22
|
+
<line x1="3" y1="18" x2="21" y2="18" />
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const CloseIcon = () => (
|
|
27
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" aria-hidden="true" style={{ width: "20px", height: "20px" }}>
|
|
28
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
29
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
30
|
+
</svg>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const GiftIcon = () => (
|
|
34
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" style={{ width: "20px", height: "20px" }} aria-hidden="true">
|
|
35
|
+
<polyline points="20 12 20 22 4 22 4 12" />
|
|
36
|
+
<rect x="2" y="7" width="20" height="5" />
|
|
37
|
+
<line x1="12" y1="22" x2="12" y2="7" />
|
|
38
|
+
<path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z" />
|
|
39
|
+
<path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z" />
|
|
40
|
+
</svg>
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const InboxIcon = () => (
|
|
44
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" style={{ width: "18px", height: "18px" }} aria-hidden="true">
|
|
45
|
+
<polyline points="22 12 16 12 14 15 10 15 8 12 2 12" />
|
|
46
|
+
<path d="M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" />
|
|
47
|
+
</svg>
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
/* ─── Types ─────────────────────────────────────────────────────────────── */
|
|
51
|
+
|
|
52
|
+
export interface MobileNavSubItem {
|
|
53
|
+
id: string;
|
|
54
|
+
label: string;
|
|
55
|
+
onDelete?: (id: string) => void;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface MobileNavEntry {
|
|
59
|
+
id: string;
|
|
60
|
+
label: string;
|
|
61
|
+
icon?: React.ReactNode;
|
|
62
|
+
subItems?: MobileNavSubItem[];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface AppSidebarMobileProps {
|
|
66
|
+
brandName?: string;
|
|
67
|
+
entries?: MobileNavEntry[];
|
|
68
|
+
activeId?: string;
|
|
69
|
+
onSelect?: (id: string) => void;
|
|
70
|
+
activeSubId?: string;
|
|
71
|
+
onSubSelect?: (id: string) => void;
|
|
72
|
+
workspaceName?: string;
|
|
73
|
+
showShareCard?: boolean;
|
|
74
|
+
showUpgradeCard?: boolean;
|
|
75
|
+
userInitials?: string;
|
|
76
|
+
onInboxClick?: () => void;
|
|
77
|
+
open?: boolean;
|
|
78
|
+
onOpenChange?: (open: boolean) => void;
|
|
79
|
+
className?: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* ─── Component ─────────────────────────────────────────────────────────── */
|
|
83
|
+
|
|
84
|
+
export const AppSidebarMobile = React.forwardRef<HTMLDivElement, AppSidebarMobileProps>(
|
|
85
|
+
(
|
|
86
|
+
{
|
|
87
|
+
brandName = "Atoms",
|
|
88
|
+
entries = [],
|
|
89
|
+
activeId,
|
|
90
|
+
onSelect,
|
|
91
|
+
activeSubId: _activeSubId,
|
|
92
|
+
onSubSelect,
|
|
93
|
+
workspaceName,
|
|
94
|
+
showShareCard = false,
|
|
95
|
+
showUpgradeCard = false,
|
|
96
|
+
userInitials,
|
|
97
|
+
onInboxClick,
|
|
98
|
+
open: openProp,
|
|
99
|
+
onOpenChange,
|
|
100
|
+
className,
|
|
101
|
+
},
|
|
102
|
+
ref,
|
|
103
|
+
) => {
|
|
104
|
+
/* ── State ── */
|
|
105
|
+
const [internalOpen, setInternalOpen] = React.useState(false);
|
|
106
|
+
const isControlled = openProp !== undefined;
|
|
107
|
+
const open = isControlled ? openProp : internalOpen;
|
|
108
|
+
|
|
109
|
+
const setOpen = (next: boolean) => {
|
|
110
|
+
if (!isControlled) setInternalOpen(next);
|
|
111
|
+
onOpenChange?.(next);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const [expandedIds, setExpandedIds] = React.useState<Set<string>>(new Set());
|
|
115
|
+
const toggleExpanded = (id: string) => {
|
|
116
|
+
setExpandedIds((prev) => {
|
|
117
|
+
const next = new Set(prev);
|
|
118
|
+
next.has(id) ? next.delete(id) : next.add(id);
|
|
119
|
+
return next;
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/* ── Escape key ── */
|
|
124
|
+
React.useEffect(() => {
|
|
125
|
+
if (!open) return;
|
|
126
|
+
const handler = (e: KeyboardEvent) => { if (e.key === "Escape") setOpen(false); };
|
|
127
|
+
window.addEventListener("keydown", handler);
|
|
128
|
+
return () => window.removeEventListener("keydown", handler);
|
|
129
|
+
}, [open]);
|
|
130
|
+
|
|
131
|
+
/* ── Slide animation ── */
|
|
132
|
+
const [visible, setVisible] = React.useState(false);
|
|
133
|
+
const [mounted, setMounted] = React.useState(false);
|
|
134
|
+
|
|
135
|
+
React.useEffect(() => {
|
|
136
|
+
if (open) {
|
|
137
|
+
setMounted(true);
|
|
138
|
+
requestAnimationFrame(() => requestAnimationFrame(() => setVisible(true)));
|
|
139
|
+
} else {
|
|
140
|
+
setVisible(false);
|
|
141
|
+
const t = setTimeout(() => setMounted(false), 300);
|
|
142
|
+
return () => clearTimeout(t);
|
|
143
|
+
}
|
|
144
|
+
}, [open]);
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
<>
|
|
148
|
+
{/* ── Trigger ── */}
|
|
149
|
+
<div ref={ref} className={className}>
|
|
150
|
+
<Button
|
|
151
|
+
variant="ghost"
|
|
152
|
+
size="sm"
|
|
153
|
+
aria-label="Open navigation"
|
|
154
|
+
aria-expanded={open}
|
|
155
|
+
onClick={() => setOpen(true)}
|
|
156
|
+
className="!p-xs !rounded-md"
|
|
157
|
+
>
|
|
158
|
+
<HamburgerIcon />
|
|
159
|
+
</Button>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
{/* ── Overlay — rendered as a sibling in the same DOM tree,
|
|
163
|
+
uses fixed positioning so it covers the full viewport.
|
|
164
|
+
No portal needed — fixed elements always escape overflow clipping.
|
|
165
|
+
The drawer panel gets an EXPLICIT inline background-color so it
|
|
166
|
+
can never inherit transparency from any ancestor. ── */}
|
|
167
|
+
{mounted && (
|
|
168
|
+
<div
|
|
169
|
+
role="dialog"
|
|
170
|
+
aria-modal="true"
|
|
171
|
+
aria-label="Navigation menu"
|
|
172
|
+
style={{
|
|
173
|
+
position: "fixed",
|
|
174
|
+
inset: 0,
|
|
175
|
+
zIndex: 9999,
|
|
176
|
+
}}
|
|
177
|
+
>
|
|
178
|
+
{/* Scrim */}
|
|
179
|
+
<div
|
|
180
|
+
aria-hidden="true"
|
|
181
|
+
onClick={() => setOpen(false)}
|
|
182
|
+
style={{
|
|
183
|
+
position: "absolute",
|
|
184
|
+
inset: 0,
|
|
185
|
+
backgroundColor: "var(--color-scrim)",
|
|
186
|
+
opacity: visible ? 0.5 : 0,
|
|
187
|
+
transition: "opacity 0.25s ease",
|
|
188
|
+
}}
|
|
189
|
+
/>
|
|
190
|
+
|
|
191
|
+
{/* Drawer panel
|
|
192
|
+
KEY FIX: background-color is set BOTH as a Tailwind class AND
|
|
193
|
+
as an inline style with a CSS var + html fallback so it is
|
|
194
|
+
always fully opaque — never transparent. */}
|
|
195
|
+
<div
|
|
196
|
+
style={{
|
|
197
|
+
position: "absolute",
|
|
198
|
+
top: 0,
|
|
199
|
+
left: 0,
|
|
200
|
+
bottom: 0,
|
|
201
|
+
width: "min(280px, 85vw)",
|
|
202
|
+
display: "flex",
|
|
203
|
+
flexDirection: "column",
|
|
204
|
+
/* Solid opaque fill — CSS var resolves from the project tokens;
|
|
205
|
+
the inline style wins over any inherited transparency. */
|
|
206
|
+
backgroundColor: "var(--color-canvas)",
|
|
207
|
+
borderRight: "1px solid var(--color-hairline)",
|
|
208
|
+
boxShadow: "var(--shadow-lg)",
|
|
209
|
+
transform: visible ? "translateX(0)" : "translateX(-100%)",
|
|
210
|
+
transition: "transform 0.28s cubic-bezier(0.32,0,0.15,1)",
|
|
211
|
+
overflowY: "auto",
|
|
212
|
+
overflowX: "hidden",
|
|
213
|
+
}}
|
|
214
|
+
>
|
|
215
|
+
{/* Header */}
|
|
216
|
+
<div
|
|
217
|
+
className="flex items-center justify-between px-md pt-md pb-sm flex-shrink-0"
|
|
218
|
+
style={{ backgroundColor: "var(--color-canvas)" }}
|
|
219
|
+
>
|
|
220
|
+
<div className="flex items-center gap-sm">
|
|
221
|
+
<LogoIcon />
|
|
222
|
+
<span className="text-body-sm font-weight-heading-sm text-ink truncate">{brandName}</span>
|
|
223
|
+
</div>
|
|
224
|
+
<Button
|
|
225
|
+
variant="ghost"
|
|
226
|
+
size="sm"
|
|
227
|
+
aria-label="Close navigation"
|
|
228
|
+
onClick={() => setOpen(false)}
|
|
229
|
+
className="!p-xs !rounded-md"
|
|
230
|
+
>
|
|
231
|
+
<CloseIcon />
|
|
232
|
+
</Button>
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
{/* Workspace switcher */}
|
|
236
|
+
{workspaceName && (
|
|
237
|
+
<div
|
|
238
|
+
className="px-sm pb-sm"
|
|
239
|
+
style={{ backgroundColor: "var(--color-canvas)" }}
|
|
240
|
+
>
|
|
241
|
+
<WorkspaceMenu
|
|
242
|
+
workspaceName={workspaceName}
|
|
243
|
+
initials={workspaceName.charAt(0).toUpperCase()}
|
|
244
|
+
/>
|
|
245
|
+
</div>
|
|
246
|
+
)}
|
|
247
|
+
|
|
248
|
+
{/* Nav entries */}
|
|
249
|
+
<div
|
|
250
|
+
className="flex-1 overflow-y-auto px-sm pb-sm"
|
|
251
|
+
style={{ backgroundColor: "var(--color-canvas)" }}
|
|
252
|
+
>
|
|
253
|
+
<ul className="space-y-xxs" role="list">
|
|
254
|
+
{entries.map((entry) => {
|
|
255
|
+
const isActive = activeId === entry.id;
|
|
256
|
+
const hasSubItems = !!(entry.subItems?.length);
|
|
257
|
+
const isExpanded = expandedIds.has(entry.id);
|
|
258
|
+
|
|
259
|
+
const mappedSubItems: NavItemSubItem[] | undefined = hasSubItems
|
|
260
|
+
? entry.subItems!.map((sub) => ({
|
|
261
|
+
id: sub.id,
|
|
262
|
+
label: sub.label,
|
|
263
|
+
onDelete: sub.onDelete,
|
|
264
|
+
onClick: onSubSelect
|
|
265
|
+
? (_id: string) => { onSubSelect(_id); setOpen(false); }
|
|
266
|
+
: undefined,
|
|
267
|
+
}))
|
|
268
|
+
: undefined;
|
|
269
|
+
|
|
270
|
+
return (
|
|
271
|
+
<NavItem
|
|
272
|
+
key={entry.id}
|
|
273
|
+
icon={entry.icon}
|
|
274
|
+
label={entry.label}
|
|
275
|
+
active={isActive}
|
|
276
|
+
subItems={mappedSubItems}
|
|
277
|
+
expanded={hasSubItems ? isExpanded : undefined}
|
|
278
|
+
onExpandToggle={hasSubItems ? () => toggleExpanded(entry.id) : undefined}
|
|
279
|
+
onClick={(e) => {
|
|
280
|
+
onSelect?.(entry.id);
|
|
281
|
+
if (!hasSubItems) setOpen(false);
|
|
282
|
+
else e.preventDefault();
|
|
283
|
+
}}
|
|
284
|
+
/>
|
|
285
|
+
);
|
|
286
|
+
})}
|
|
287
|
+
</ul>
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
{/* Footer */}
|
|
291
|
+
<div
|
|
292
|
+
className="flex-shrink-0 px-sm pb-lg space-y-sm"
|
|
293
|
+
style={{ backgroundColor: "var(--color-canvas)" }}
|
|
294
|
+
>
|
|
295
|
+
{showShareCard && (
|
|
296
|
+
<div className="rounded-xl border border-hairline bg-surface px-md py-sm flex items-center justify-between gap-md">
|
|
297
|
+
<div className="flex flex-col gap-xxs min-w-0">
|
|
298
|
+
<span className="text-body-sm font-weight-heading-sm text-ink">Share & earn</span>
|
|
299
|
+
<span className="text-caption text-muted">100 credits per paid referral</span>
|
|
300
|
+
</div>
|
|
301
|
+
<span
|
|
302
|
+
className="flex-shrink-0 flex items-center justify-center rounded-full bg-surface-strong"
|
|
303
|
+
style={{ width: "36px", height: "36px" }}
|
|
304
|
+
>
|
|
305
|
+
<GiftIcon />
|
|
306
|
+
</span>
|
|
307
|
+
</div>
|
|
308
|
+
)}
|
|
309
|
+
|
|
310
|
+
{showUpgradeCard && (
|
|
311
|
+
<UpgradeCard eyebrow="" title="Upgrade to Pro" subtitle="Unlock more features" />
|
|
312
|
+
)}
|
|
313
|
+
|
|
314
|
+
{(userInitials || onInboxClick) && (
|
|
315
|
+
<div className="flex items-center justify-between pt-xs">
|
|
316
|
+
{userInitials && (
|
|
317
|
+
<span
|
|
318
|
+
className="flex items-center justify-center rounded-full bg-primary text-on-primary text-body-sm font-weight-heading-sm cursor-pointer hover:bg-primary-hover transition-colors duration-150"
|
|
319
|
+
style={{ width: "36px", height: "36px" }}
|
|
320
|
+
aria-label="User profile"
|
|
321
|
+
>
|
|
322
|
+
{userInitials}
|
|
323
|
+
</span>
|
|
324
|
+
)}
|
|
325
|
+
{onInboxClick && (
|
|
326
|
+
<Button
|
|
327
|
+
variant="ghost"
|
|
328
|
+
size="sm"
|
|
329
|
+
aria-label="Inbox"
|
|
330
|
+
onClick={onInboxClick}
|
|
331
|
+
className="!p-xs !rounded-sm relative"
|
|
332
|
+
>
|
|
333
|
+
<InboxIcon />
|
|
334
|
+
<span
|
|
335
|
+
className="absolute rounded-full bg-semantic-error"
|
|
336
|
+
aria-label="New notifications"
|
|
337
|
+
style={{ width: "8px", height: "8px", top: "4px", right: "4px" }}
|
|
338
|
+
/>
|
|
339
|
+
</Button>
|
|
340
|
+
)}
|
|
341
|
+
</div>
|
|
342
|
+
)}
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
</div>
|
|
346
|
+
)}
|
|
347
|
+
</>
|
|
348
|
+
);
|
|
349
|
+
},
|
|
350
|
+
);
|
|
351
|
+
|
|
352
|
+
AppSidebarMobile.displayName = "AppSidebarMobile";
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AppSidebarMobile } from "./AppSidebarMobile";
|
|
3
|
+
|
|
4
|
+
const HomeIcon = () => (
|
|
5
|
+
<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">
|
|
6
|
+
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
|
7
|
+
<polyline points="9 22 9 12 15 12 15 22" />
|
|
8
|
+
</svg>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
const FolderIcon = () => (
|
|
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="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" />
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const ENTRIES = [
|
|
18
|
+
{ id: "home", label: "Home", icon: <HomeIcon /> },
|
|
19
|
+
{
|
|
20
|
+
id: "projects",
|
|
21
|
+
label: "All projects",
|
|
22
|
+
icon: <FolderIcon />,
|
|
23
|
+
subItems: [
|
|
24
|
+
{ id: "p1", label: "Design system" },
|
|
25
|
+
{ id: "p2", label: "Landing page" },
|
|
26
|
+
{ id: "p3", label: "Dashboard" },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
export default function Preview() {
|
|
32
|
+
const [activeId, setActiveId] = React.useState("home");
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className="w-full max-w-3xl mx-auto p-lg space-y-lg">
|
|
36
|
+
{/* Description */}
|
|
37
|
+
<div className="rounded-xl bg-surface border border-hairline p-lg flex items-center justify-between gap-md">
|
|
38
|
+
<div>
|
|
39
|
+
<p className="text-body-sm font-weight-heading-sm text-ink mb-xs">Mobile Navigation Drawer</p>
|
|
40
|
+
<p className="text-caption text-muted">Tap the hamburger button to open the slide-in drawer. The scrim dismisses it.</p>
|
|
41
|
+
</div>
|
|
42
|
+
<AppSidebarMobile
|
|
43
|
+
brandName="Atoms"
|
|
44
|
+
entries={ENTRIES}
|
|
45
|
+
activeId={activeId}
|
|
46
|
+
onSelect={setActiveId}
|
|
47
|
+
workspaceName="Hello Designer"
|
|
48
|
+
showShareCard
|
|
49
|
+
showUpgradeCard
|
|
50
|
+
userInitials="N"
|
|
51
|
+
onInboxClick={() => {}}
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
{/* Simulated mobile frame */}
|
|
56
|
+
<div
|
|
57
|
+
className="mx-auto rounded-xl overflow-hidden border border-hairline bg-surface-soft"
|
|
58
|
+
style={{ width: "320px", height: "520px", position: "relative" }}
|
|
59
|
+
>
|
|
60
|
+
{/* Fake mobile top bar */}
|
|
61
|
+
<div className="flex items-center justify-between px-md py-sm bg-canvas border-b border-hairline">
|
|
62
|
+
<AppSidebarMobile
|
|
63
|
+
brandName="Atoms"
|
|
64
|
+
entries={ENTRIES}
|
|
65
|
+
activeId={activeId}
|
|
66
|
+
onSelect={setActiveId}
|
|
67
|
+
workspaceName="Hello Designer"
|
|
68
|
+
showShareCard
|
|
69
|
+
showUpgradeCard
|
|
70
|
+
userInitials="N"
|
|
71
|
+
onInboxClick={() => {}}
|
|
72
|
+
/>
|
|
73
|
+
<span className="text-body-sm font-weight-heading-sm text-ink">Atoms</span>
|
|
74
|
+
<span
|
|
75
|
+
className="flex items-center justify-center rounded-full bg-primary text-on-primary text-caption"
|
|
76
|
+
style={{ width: "28px", height: "28px" }}
|
|
77
|
+
>
|
|
78
|
+
N
|
|
79
|
+
</span>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
{/* Placeholder content */}
|
|
83
|
+
<div className="p-md space-y-sm">
|
|
84
|
+
<div className="h-md rounded-md bg-surface-strong w-3/4" />
|
|
85
|
+
<div className="h-sm rounded-md bg-surface-strong w-full" />
|
|
86
|
+
<div className="h-sm rounded-md bg-surface-strong w-5/6" />
|
|
87
|
+
<div className="h-sm rounded-md bg-surface-strong w-4/5" />
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
}
|