@designa8/vibedesign-v6 1.8.4 → 1.9.4
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 +453 -141
- package/dist/index.js +452 -140
- package/dist/styles.css +101 -9
- package/package.json +6 -1
- package/src/atoms/AppLayout/AppLayout.tsx +219 -31
- package/src/atoms/ComponentCard/ComponentCard.tsx +150 -0
- package/src/atoms/ComponentCard/index.ts +2 -0
- package/src/atoms/ComponentCard/preview.tsx +111 -0
- package/src/atoms/PreviewToolbar/PreviewToolbar.tsx +81 -67
- package/src/atoms/PreviewToolbar/preview.tsx +42 -16
- package/src/index.ts +1 -0
- package/src/tokens.css +12 -0
package/dist/styles.css
CHANGED
|
@@ -79,6 +79,18 @@
|
|
|
79
79
|
--color-semantic-success-soft: #dcfce7;
|
|
80
80
|
--color-semantic-warning-soft: #fef9c3;
|
|
81
81
|
--color-semantic-error-soft: #fee2e2;
|
|
82
|
+
--color-kind-atom-bg: #E8F4FD;
|
|
83
|
+
--color-kind-atom-text: #2878C0;
|
|
84
|
+
--color-kind-atom-border: #B8D9F0;
|
|
85
|
+
--color-kind-molecule-bg: #F0EEFF;
|
|
86
|
+
--color-kind-molecule-text: #6B63D6;
|
|
87
|
+
--color-kind-molecule-border: #C8C3F5;
|
|
88
|
+
--color-kind-organism-bg: #E9F9EF;
|
|
89
|
+
--color-kind-organism-text: #15803D;
|
|
90
|
+
--color-kind-organism-border: #A7E0BE;
|
|
91
|
+
--color-kind-template-bg: #FEF3C7;
|
|
92
|
+
--color-kind-template-text: #B45309;
|
|
93
|
+
--color-kind-template-border: #FBD98A;
|
|
82
94
|
--font-body: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
83
95
|
--text-display-lg: 48px;
|
|
84
96
|
--text-display-lg--font-weight: 700;
|
|
@@ -364,9 +376,6 @@
|
|
|
364
376
|
.mx-xs {
|
|
365
377
|
margin-inline: var(--spacing-xs);
|
|
366
378
|
}
|
|
367
|
-
.mx-xxs {
|
|
368
|
-
margin-inline: var(--spacing-xxs);
|
|
369
|
-
}
|
|
370
379
|
.my-xl {
|
|
371
380
|
margin-block: var(--spacing-xl);
|
|
372
381
|
}
|
|
@@ -412,6 +421,9 @@
|
|
|
412
421
|
.ml-lg {
|
|
413
422
|
margin-left: var(--spacing-lg);
|
|
414
423
|
}
|
|
424
|
+
.ml-sm {
|
|
425
|
+
margin-left: var(--spacing-sm);
|
|
426
|
+
}
|
|
415
427
|
.ml-xs {
|
|
416
428
|
margin-left: var(--spacing-xs);
|
|
417
429
|
}
|
|
@@ -470,9 +482,15 @@
|
|
|
470
482
|
.\!h-8 {
|
|
471
483
|
height: calc(var(--spacing) * 8) !important;
|
|
472
484
|
}
|
|
485
|
+
.\!h-full {
|
|
486
|
+
height: 100% !important;
|
|
487
|
+
}
|
|
473
488
|
.h-1\.5 {
|
|
474
489
|
height: calc(var(--spacing) * 1.5);
|
|
475
490
|
}
|
|
491
|
+
.h-2 {
|
|
492
|
+
height: calc(var(--spacing) * 2);
|
|
493
|
+
}
|
|
476
494
|
.h-2\.5 {
|
|
477
495
|
height: calc(var(--spacing) * 2.5);
|
|
478
496
|
}
|
|
@@ -533,6 +551,12 @@
|
|
|
533
551
|
.\!w-full {
|
|
534
552
|
width: 100% !important;
|
|
535
553
|
}
|
|
554
|
+
.w-1\/2 {
|
|
555
|
+
width: calc(1 / 2 * 100%);
|
|
556
|
+
}
|
|
557
|
+
.w-1\/4 {
|
|
558
|
+
width: calc(1 / 4 * 100%);
|
|
559
|
+
}
|
|
536
560
|
.w-2\.5 {
|
|
537
561
|
width: calc(var(--spacing) * 2.5);
|
|
538
562
|
}
|
|
@@ -542,15 +566,24 @@
|
|
|
542
566
|
.w-3 {
|
|
543
567
|
width: calc(var(--spacing) * 3);
|
|
544
568
|
}
|
|
569
|
+
.w-3\/4 {
|
|
570
|
+
width: calc(3 / 4 * 100%);
|
|
571
|
+
}
|
|
545
572
|
.w-4 {
|
|
546
573
|
width: calc(var(--spacing) * 4);
|
|
547
574
|
}
|
|
575
|
+
.w-4\/5 {
|
|
576
|
+
width: calc(4 / 5 * 100%);
|
|
577
|
+
}
|
|
548
578
|
.w-5 {
|
|
549
579
|
width: calc(var(--spacing) * 5);
|
|
550
580
|
}
|
|
551
581
|
.w-10 {
|
|
552
582
|
width: calc(var(--spacing) * 10);
|
|
553
583
|
}
|
|
584
|
+
.w-12 {
|
|
585
|
+
width: calc(var(--spacing) * 12);
|
|
586
|
+
}
|
|
554
587
|
.w-14 {
|
|
555
588
|
width: calc(var(--spacing) * 14);
|
|
556
589
|
}
|
|
@@ -563,6 +596,9 @@
|
|
|
563
596
|
.w-64 {
|
|
564
597
|
width: calc(var(--spacing) * 64);
|
|
565
598
|
}
|
|
599
|
+
.w-72 {
|
|
600
|
+
width: calc(var(--spacing) * 72);
|
|
601
|
+
}
|
|
566
602
|
.w-auto {
|
|
567
603
|
width: auto;
|
|
568
604
|
}
|
|
@@ -572,9 +608,6 @@
|
|
|
572
608
|
.w-full {
|
|
573
609
|
width: 100%;
|
|
574
610
|
}
|
|
575
|
-
.w-px {
|
|
576
|
-
width: 1px;
|
|
577
|
-
}
|
|
578
611
|
.max-w-2xl {
|
|
579
612
|
max-width: var(--container-2xl);
|
|
580
613
|
}
|
|
@@ -700,6 +733,9 @@
|
|
|
700
733
|
.items-start {
|
|
701
734
|
align-items: flex-start;
|
|
702
735
|
}
|
|
736
|
+
.items-stretch {
|
|
737
|
+
align-items: stretch;
|
|
738
|
+
}
|
|
703
739
|
.\!justify-center {
|
|
704
740
|
justify-content: center !important;
|
|
705
741
|
}
|
|
@@ -715,6 +751,9 @@
|
|
|
715
751
|
.justify-end {
|
|
716
752
|
justify-content: flex-end;
|
|
717
753
|
}
|
|
754
|
+
.justify-start {
|
|
755
|
+
justify-content: flex-start;
|
|
756
|
+
}
|
|
718
757
|
.\!gap-md {
|
|
719
758
|
gap: var(--spacing-md) !important;
|
|
720
759
|
}
|
|
@@ -880,9 +919,6 @@
|
|
|
880
919
|
.rounded-xs {
|
|
881
920
|
border-radius: var(--radius-xs);
|
|
882
921
|
}
|
|
883
|
-
.rounded-tr-xl {
|
|
884
|
-
border-top-right-radius: var(--radius-xl);
|
|
885
|
-
}
|
|
886
922
|
.\!border-0 {
|
|
887
923
|
border-style: var(--tw-border-style) !important;
|
|
888
924
|
border-width: 0px !important;
|
|
@@ -891,6 +927,10 @@
|
|
|
891
927
|
border-style: var(--tw-border-style);
|
|
892
928
|
border-width: 1px;
|
|
893
929
|
}
|
|
930
|
+
.border-2 {
|
|
931
|
+
border-style: var(--tw-border-style);
|
|
932
|
+
border-width: 2px;
|
|
933
|
+
}
|
|
894
934
|
.border-t {
|
|
895
935
|
border-top-style: var(--tw-border-style);
|
|
896
936
|
border-top-width: 1px;
|
|
@@ -953,6 +993,9 @@
|
|
|
953
993
|
.bg-ink {
|
|
954
994
|
background-color: var(--color-ink);
|
|
955
995
|
}
|
|
996
|
+
.bg-muted {
|
|
997
|
+
background-color: var(--color-muted);
|
|
998
|
+
}
|
|
956
999
|
.bg-on-primary {
|
|
957
1000
|
background-color: var(--color-on-primary);
|
|
958
1001
|
}
|
|
@@ -1001,6 +1044,9 @@
|
|
|
1001
1044
|
.p-lg {
|
|
1002
1045
|
padding: var(--spacing-lg);
|
|
1003
1046
|
}
|
|
1047
|
+
.p-sm {
|
|
1048
|
+
padding: var(--spacing-sm);
|
|
1049
|
+
}
|
|
1004
1050
|
.p-xl {
|
|
1005
1051
|
padding: var(--spacing-xl);
|
|
1006
1052
|
}
|
|
@@ -1230,6 +1276,9 @@
|
|
|
1230
1276
|
.text-semantic-warning {
|
|
1231
1277
|
color: var(--color-semantic-warning);
|
|
1232
1278
|
}
|
|
1279
|
+
.capitalize {
|
|
1280
|
+
text-transform: capitalize;
|
|
1281
|
+
}
|
|
1233
1282
|
.uppercase {
|
|
1234
1283
|
text-transform: uppercase;
|
|
1235
1284
|
}
|
|
@@ -1248,9 +1297,18 @@
|
|
|
1248
1297
|
.opacity-15 {
|
|
1249
1298
|
opacity: 15%;
|
|
1250
1299
|
}
|
|
1300
|
+
.opacity-20 {
|
|
1301
|
+
opacity: 20%;
|
|
1302
|
+
}
|
|
1251
1303
|
.opacity-25 {
|
|
1252
1304
|
opacity: 25%;
|
|
1253
1305
|
}
|
|
1306
|
+
.opacity-30 {
|
|
1307
|
+
opacity: 30%;
|
|
1308
|
+
}
|
|
1309
|
+
.opacity-40 {
|
|
1310
|
+
opacity: 40%;
|
|
1311
|
+
}
|
|
1254
1312
|
.opacity-50 {
|
|
1255
1313
|
opacity: 50%;
|
|
1256
1314
|
}
|
|
@@ -1260,6 +1318,9 @@
|
|
|
1260
1318
|
.opacity-75 {
|
|
1261
1319
|
opacity: 75%;
|
|
1262
1320
|
}
|
|
1321
|
+
.opacity-80 {
|
|
1322
|
+
opacity: 80%;
|
|
1323
|
+
}
|
|
1263
1324
|
.opacity-100 {
|
|
1264
1325
|
opacity: 100%;
|
|
1265
1326
|
}
|
|
@@ -1369,6 +1430,14 @@
|
|
|
1369
1430
|
color: var(--color-muted-soft);
|
|
1370
1431
|
}
|
|
1371
1432
|
}
|
|
1433
|
+
.hover\:-translate-y-0\.5 {
|
|
1434
|
+
&:hover {
|
|
1435
|
+
@media (hover: hover) {
|
|
1436
|
+
--tw-translate-y: calc(var(--spacing) * -0.5);
|
|
1437
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1372
1441
|
.hover\:\!bg-surface-soft {
|
|
1373
1442
|
&:hover {
|
|
1374
1443
|
@media (hover: hover) {
|
|
@@ -1446,6 +1515,14 @@
|
|
|
1446
1515
|
}
|
|
1447
1516
|
}
|
|
1448
1517
|
}
|
|
1518
|
+
.hover\:shadow-md {
|
|
1519
|
+
&:hover {
|
|
1520
|
+
@media (hover: hover) {
|
|
1521
|
+
--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgba(0,0,0,0.07)), 0 2px 4px -1px var(--tw-shadow-color, rgba(0,0,0,0.04));
|
|
1522
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1449
1526
|
.hover\:brightness-90 {
|
|
1450
1527
|
&:hover {
|
|
1451
1528
|
@media (hover: hover) {
|
|
@@ -1550,6 +1627,21 @@
|
|
|
1550
1627
|
opacity: 50%;
|
|
1551
1628
|
}
|
|
1552
1629
|
}
|
|
1630
|
+
.md\:inline-flex {
|
|
1631
|
+
@media (width >= 48rem) {
|
|
1632
|
+
display: inline-flex;
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
.md\:w-auto {
|
|
1636
|
+
@media (width >= 48rem) {
|
|
1637
|
+
width: auto;
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
.md\:flex-nowrap {
|
|
1641
|
+
@media (width >= 48rem) {
|
|
1642
|
+
flex-wrap: nowrap;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1553
1645
|
|
|
1554
1646
|
:root {
|
|
1555
1647
|
--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.9.4",
|
|
4
4
|
"description": "Design system \"Plasma Design System\" generated by atom-server.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -64,6 +64,11 @@
|
|
|
64
64
|
"kind": "Atom",
|
|
65
65
|
"description": null
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
"name": "ComponentCard",
|
|
69
|
+
"kind": "Atom",
|
|
70
|
+
"description": null
|
|
71
|
+
},
|
|
67
72
|
{
|
|
68
73
|
"name": "FilterTabBar",
|
|
69
74
|
"kind": "Atom",
|
|
@@ -9,20 +9,21 @@ import type { PromptMode } from "../PromptInputBar";
|
|
|
9
9
|
// ─── Constants ────────────────────────────────────────────────────────────────
|
|
10
10
|
|
|
11
11
|
const TOPBAR_HEIGHT = 48;
|
|
12
|
+
const MOBILE_TOPBAR_HEIGHT = 52;
|
|
13
|
+
const BOTTOM_TAB_HEIGHT = 56;
|
|
12
14
|
const CURVE_R = 16;
|
|
13
15
|
const MIN_CHAT_WIDTH = 260;
|
|
14
16
|
const MAX_CHAT_WIDTH = 600;
|
|
15
|
-
const COLLAPSE_DURATION = 250;
|
|
16
|
-
/** Width of the grey rail visible when chat is fully collapsed */
|
|
17
|
+
const COLLAPSE_DURATION = 250;
|
|
17
18
|
const COLLAPSED_RAIL_WIDTH = 12;
|
|
18
|
-
/**
|
|
19
|
-
* The gap between the right panel card's top-right corner and the viewport edge.
|
|
20
|
-
* Matches CURVE_R so both corners feel balanced.
|
|
21
|
-
*/
|
|
22
19
|
const PANEL_GAP_RIGHT = CURVE_R;
|
|
20
|
+
/** Tailwind md breakpoint — 768px */
|
|
21
|
+
const MOBILE_BREAKPOINT = 768;
|
|
23
22
|
|
|
24
23
|
// ─── Types ────────────────────────────────────────────────────────────────────
|
|
25
24
|
|
|
25
|
+
export type MobilePanel = "chat" | "view";
|
|
26
|
+
|
|
26
27
|
export interface AppLayoutProps {
|
|
27
28
|
navbarProps?: TopNavbarProps;
|
|
28
29
|
chatProps?: ChatScreenProps;
|
|
@@ -36,9 +37,27 @@ export interface AppLayoutProps {
|
|
|
36
37
|
onBackToProjects?: () => void;
|
|
37
38
|
onHome?: () => void;
|
|
38
39
|
avatarInitials?: string;
|
|
40
|
+
/** Mobile: which panel is shown by default. Defaults to "chat". */
|
|
41
|
+
defaultMobilePanel?: MobilePanel;
|
|
39
42
|
className?: string;
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
// ─── useIsMobile ──────────────────────────────────────────────────────────────
|
|
46
|
+
|
|
47
|
+
function useIsMobile(): boolean {
|
|
48
|
+
const [mobile, setMobile] = React.useState(
|
|
49
|
+
() => typeof window !== "undefined" && window.innerWidth < MOBILE_BREAKPOINT,
|
|
50
|
+
);
|
|
51
|
+
React.useEffect(() => {
|
|
52
|
+
const mq = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
53
|
+
const handler = (e: MediaQueryListEvent) => setMobile(e.matches);
|
|
54
|
+
mq.addEventListener("change", handler);
|
|
55
|
+
setMobile(mq.matches);
|
|
56
|
+
return () => mq.removeEventListener("change", handler);
|
|
57
|
+
}, []);
|
|
58
|
+
return mobile;
|
|
59
|
+
}
|
|
60
|
+
|
|
42
61
|
// ─── Icons ────────────────────────────────────────────────────────────────────
|
|
43
62
|
|
|
44
63
|
const LayoutPanelIcon = () => (
|
|
@@ -71,6 +90,21 @@ const ChevronDownIcon = () => (
|
|
|
71
90
|
</svg>
|
|
72
91
|
);
|
|
73
92
|
|
|
93
|
+
const ChatIcon = () => (
|
|
94
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
95
|
+
strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
96
|
+
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
|
|
97
|
+
</svg>
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
const ViewIcon = () => (
|
|
101
|
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
102
|
+
strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
103
|
+
<circle cx="12" cy="12" r="3" />
|
|
104
|
+
<path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7-10-7-10-7z" />
|
|
105
|
+
</svg>
|
|
106
|
+
);
|
|
107
|
+
|
|
74
108
|
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
75
109
|
|
|
76
110
|
function applyWidth(els: (HTMLElement | null)[], px: number) {
|
|
@@ -175,23 +209,18 @@ const AvatarNav: React.FC<AvatarNavProps> = ({ initials, onBackToProjects, onHom
|
|
|
175
209
|
};
|
|
176
210
|
|
|
177
211
|
// ─── Concave corner ornament ──────────────────────────────────────────────────
|
|
178
|
-
//
|
|
179
|
-
// Sits over the top-left join between the surface-soft background and the
|
|
180
|
-
// white canvas card. It paints surface-soft first, then carves the quarter-
|
|
181
|
-
// circle out in canvas white — so the card's border-t / border-l are hidden
|
|
182
|
-
// exactly at the corner, giving a seamless concave notch.
|
|
183
212
|
|
|
184
213
|
const ConcaveCorner: React.FC = () => (
|
|
185
214
|
<div
|
|
186
215
|
aria-hidden="true"
|
|
187
216
|
style={{
|
|
188
217
|
position: "absolute",
|
|
189
|
-
top: -1,
|
|
218
|
+
top: -1,
|
|
190
219
|
left: -1,
|
|
191
220
|
width: CURVE_R + 1,
|
|
192
221
|
height: CURVE_R + 1,
|
|
193
222
|
pointerEvents: "none",
|
|
194
|
-
zIndex: 2,
|
|
223
|
+
zIndex: 2,
|
|
195
224
|
overflow: "hidden",
|
|
196
225
|
}}
|
|
197
226
|
>
|
|
@@ -201,9 +230,7 @@ const ConcaveCorner: React.FC = () => (
|
|
|
201
230
|
viewBox={`0 0 ${CURVE_R + 1} ${CURVE_R + 1}`}
|
|
202
231
|
fill="none"
|
|
203
232
|
>
|
|
204
|
-
{/* surface-soft fill that bleeds over the border */}
|
|
205
233
|
<rect width={CURVE_R + 1} height={CURVE_R + 1} fill="var(--color-surface-soft)" />
|
|
206
|
-
{/* canvas quarter-circle cutout */}
|
|
207
234
|
<path
|
|
208
235
|
d={`M${CURVE_R + 1} 0 L${CURVE_R + 1} ${CURVE_R + 1} Q0 ${CURVE_R + 1} 0 0 Z`}
|
|
209
236
|
fill="var(--color-canvas)"
|
|
@@ -245,6 +272,107 @@ const PromptFooter: React.FC<{ chatProps?: ChatScreenProps }> = ({ chatProps })
|
|
|
245
272
|
);
|
|
246
273
|
};
|
|
247
274
|
|
|
275
|
+
// ─── Mobile bottom tab bar ────────────────────────────────────────────────────
|
|
276
|
+
|
|
277
|
+
interface MobileTabBarProps {
|
|
278
|
+
activePanel: MobilePanel;
|
|
279
|
+
onChange: (p: MobilePanel) => void;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
const MobileTabBar: React.FC<MobileTabBarProps> = ({ activePanel, onChange }) => (
|
|
283
|
+
<div
|
|
284
|
+
className="flex-shrink-0 flex items-stretch border-t border-hairline-soft bg-canvas"
|
|
285
|
+
style={{ height: BOTTOM_TAB_HEIGHT }}
|
|
286
|
+
role="tablist"
|
|
287
|
+
aria-label="Switch panel"
|
|
288
|
+
>
|
|
289
|
+
{(["chat", "view"] as MobilePanel[]).map((panel) => {
|
|
290
|
+
const active = activePanel === panel;
|
|
291
|
+
return (
|
|
292
|
+
<Button
|
|
293
|
+
key={panel}
|
|
294
|
+
role="tab"
|
|
295
|
+
type="button"
|
|
296
|
+
variant="ghost"
|
|
297
|
+
size="sm"
|
|
298
|
+
aria-selected={active}
|
|
299
|
+
onClick={() => onChange(panel)}
|
|
300
|
+
className={[
|
|
301
|
+
"flex-1 flex-col !gap-xxs !rounded-none !border-0 !h-full",
|
|
302
|
+
active ? "!text-primary" : "!text-muted",
|
|
303
|
+
].join(" ")}
|
|
304
|
+
>
|
|
305
|
+
{panel === "chat" ? <ChatIcon /> : <ViewIcon />}
|
|
306
|
+
<span
|
|
307
|
+
className={["text-caption", active ? "font-weight-heading-sm text-primary" : "text-muted"].join(" ")}
|
|
308
|
+
style={{ textTransform: "capitalize" }}
|
|
309
|
+
>
|
|
310
|
+
{panel === "chat" ? "Chat" : "View"}
|
|
311
|
+
</span>
|
|
312
|
+
</Button>
|
|
313
|
+
);
|
|
314
|
+
})}
|
|
315
|
+
</div>
|
|
316
|
+
);
|
|
317
|
+
|
|
318
|
+
// ─── Mobile top bar ───────────────────────────────────────────────────────────
|
|
319
|
+
|
|
320
|
+
interface MobileTopBarProps {
|
|
321
|
+
projectName: string;
|
|
322
|
+
avatarInitials: string;
|
|
323
|
+
activePanel: MobilePanel;
|
|
324
|
+
navbarProps?: TopNavbarProps;
|
|
325
|
+
onRenameProject?: () => void;
|
|
326
|
+
onBackToProjects?: () => void;
|
|
327
|
+
onHome?: () => void;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const MobileTopBar: React.FC<MobileTopBarProps> = ({
|
|
331
|
+
projectName,
|
|
332
|
+
avatarInitials,
|
|
333
|
+
activePanel,
|
|
334
|
+
navbarProps,
|
|
335
|
+
onRenameProject,
|
|
336
|
+
onBackToProjects,
|
|
337
|
+
onHome,
|
|
338
|
+
}) => (
|
|
339
|
+
<div
|
|
340
|
+
className="w-full flex flex-shrink-0 items-center px-sm gap-sm border-b border-hairline-soft bg-canvas"
|
|
341
|
+
style={{ height: MOBILE_TOPBAR_HEIGHT }}
|
|
342
|
+
>
|
|
343
|
+
{activePanel === "chat" ? (
|
|
344
|
+
<>
|
|
345
|
+
<AvatarNav
|
|
346
|
+
initials={avatarInitials}
|
|
347
|
+
onBackToProjects={onBackToProjects}
|
|
348
|
+
onHome={onHome}
|
|
349
|
+
/>
|
|
350
|
+
<div className="flex-1 min-w-0">
|
|
351
|
+
<WorkspaceMenu
|
|
352
|
+
workspaceName={projectName}
|
|
353
|
+
onRename={onRenameProject}
|
|
354
|
+
className="w-full"
|
|
355
|
+
/>
|
|
356
|
+
</div>
|
|
357
|
+
</>
|
|
358
|
+
) : (
|
|
359
|
+
<>
|
|
360
|
+
<div className="flex-1 min-w-0">
|
|
361
|
+
<span className="text-body-md font-weight-heading-sm text-ink truncate block">
|
|
362
|
+
{projectName}
|
|
363
|
+
</span>
|
|
364
|
+
</div>
|
|
365
|
+
<div className="flex-shrink-0" style={{ minWidth: "fit-content" }}>
|
|
366
|
+
<TopNavbar
|
|
367
|
+
{...navbarProps}
|
|
368
|
+
className="!border-0 !py-0 !px-0 !bg-transparent w-auto"
|
|
369
|
+
/>
|
|
370
|
+
</div>
|
|
371
|
+
</>
|
|
372
|
+
)}
|
|
373
|
+
</div>
|
|
374
|
+
);
|
|
375
|
+
|
|
248
376
|
// ─── Main Component ───────────────────────────────────────────────────────────
|
|
249
377
|
|
|
250
378
|
export const AppLayout = React.forwardRef<HTMLDivElement, AppLayoutProps>(
|
|
@@ -262,10 +390,14 @@ export const AppLayout = React.forwardRef<HTMLDivElement, AppLayoutProps>(
|
|
|
262
390
|
onBackToProjects,
|
|
263
391
|
onHome,
|
|
264
392
|
avatarInitials = "A",
|
|
393
|
+
defaultMobilePanel = "chat",
|
|
265
394
|
className,
|
|
266
395
|
},
|
|
267
396
|
ref,
|
|
268
397
|
) => {
|
|
398
|
+
const isMobile = useIsMobile();
|
|
399
|
+
|
|
400
|
+
// Desktop state
|
|
269
401
|
const [activeTab, setActiveTab] = React.useState(rightPanelActiveTab);
|
|
270
402
|
const [chatWidth, setChatWidth] = React.useState(defaultChatWidth);
|
|
271
403
|
const [chatCollapsed, setChatCollapsed] = React.useState(false);
|
|
@@ -280,6 +412,9 @@ export const AppLayout = React.forwardRef<HTMLDivElement, AppLayoutProps>(
|
|
|
280
412
|
const startWidth = React.useRef(defaultChatWidth);
|
|
281
413
|
const currentWidth = React.useRef(defaultChatWidth);
|
|
282
414
|
|
|
415
|
+
// Mobile state
|
|
416
|
+
const [mobilePanel, setMobilePanel] = React.useState<MobilePanel>(defaultMobilePanel);
|
|
417
|
+
|
|
283
418
|
const collapseTransition = `width ${COLLAPSE_DURATION}ms cubic-bezier(0.4,0,0.2,1)`;
|
|
284
419
|
const opacityTransition = `opacity ${COLLAPSE_DURATION}ms ease`;
|
|
285
420
|
|
|
@@ -336,15 +471,78 @@ export const AppLayout = React.forwardRef<HTMLDivElement, AppLayoutProps>(
|
|
|
336
471
|
const renderedWidth = chatCollapsed ? COLLAPSED_RAIL_WIDTH : chatWidth;
|
|
337
472
|
const hasTabs = Array.isArray(rightPanelTabs) && rightPanelTabs.length > 0;
|
|
338
473
|
|
|
474
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
475
|
+
// MOBILE LAYOUT
|
|
476
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
477
|
+
if (isMobile) {
|
|
478
|
+
return (
|
|
479
|
+
<div
|
|
480
|
+
ref={ref}
|
|
481
|
+
className={["w-full flex flex-col overflow-hidden bg-canvas", className].filter(Boolean).join(" ")}
|
|
482
|
+
style={{ height: "100vh" }}
|
|
483
|
+
>
|
|
484
|
+
<MobileTopBar
|
|
485
|
+
projectName={projectName}
|
|
486
|
+
avatarInitials={avatarInitials}
|
|
487
|
+
activePanel={mobilePanel}
|
|
488
|
+
navbarProps={navbarProps}
|
|
489
|
+
onRenameProject={onRenameProject}
|
|
490
|
+
onBackToProjects={onBackToProjects}
|
|
491
|
+
onHome={onHome}
|
|
492
|
+
/>
|
|
493
|
+
|
|
494
|
+
<div className="flex-1 min-h-0 overflow-hidden relative">
|
|
495
|
+
{/* Chat panel */}
|
|
496
|
+
<div
|
|
497
|
+
className="absolute inset-0 flex flex-col"
|
|
498
|
+
style={{
|
|
499
|
+
background: "var(--color-surface-soft)",
|
|
500
|
+
opacity: mobilePanel === "chat" ? 1 : 0,
|
|
501
|
+
pointerEvents: mobilePanel === "chat" ? "auto" : "none",
|
|
502
|
+
transition: "opacity 200ms ease",
|
|
503
|
+
zIndex: mobilePanel === "chat" ? 1 : 0,
|
|
504
|
+
}}
|
|
505
|
+
>
|
|
506
|
+
<ChatScreen
|
|
507
|
+
{...chatProps}
|
|
508
|
+
className="flex-1 min-h-0"
|
|
509
|
+
renderFooter={chatProps?.renderFooter ?? <PromptFooter chatProps={chatProps} />}
|
|
510
|
+
/>
|
|
511
|
+
</div>
|
|
512
|
+
|
|
513
|
+
{/* View panel */}
|
|
514
|
+
<div
|
|
515
|
+
className="absolute inset-0 flex flex-col overflow-auto"
|
|
516
|
+
style={{
|
|
517
|
+
background: "var(--color-canvas)",
|
|
518
|
+
opacity: mobilePanel === "view" ? 1 : 0,
|
|
519
|
+
pointerEvents: mobilePanel === "view" ? "auto" : "none",
|
|
520
|
+
transition: "opacity 200ms ease",
|
|
521
|
+
zIndex: mobilePanel === "view" ? 1 : 0,
|
|
522
|
+
}}
|
|
523
|
+
>
|
|
524
|
+
{rightPanel !== undefined
|
|
525
|
+
? <div className="w-full flex-1">{rightPanel}</div>
|
|
526
|
+
: <RightPanelPlaceholder />
|
|
527
|
+
}
|
|
528
|
+
</div>
|
|
529
|
+
</div>
|
|
530
|
+
|
|
531
|
+
<MobileTabBar activePanel={mobilePanel} onChange={setMobilePanel} />
|
|
532
|
+
</div>
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
537
|
+
// DESKTOP LAYOUT (unchanged)
|
|
538
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
339
539
|
return (
|
|
340
540
|
<div
|
|
341
541
|
ref={ref}
|
|
342
542
|
className={["w-full flex flex-col overflow-hidden", className].filter(Boolean).join(" ")}
|
|
343
543
|
style={{ height: "100vh", background: "var(--color-surface-soft)" }}
|
|
344
544
|
>
|
|
345
|
-
{/*
|
|
346
|
-
TOP BAR
|
|
347
|
-
══════════════════════════════════════════════════════════════ */}
|
|
545
|
+
{/* TOP BAR */}
|
|
348
546
|
<div
|
|
349
547
|
className="w-full flex flex-shrink-0 items-center"
|
|
350
548
|
style={{ height: TOPBAR_HEIGHT, background: "var(--color-surface-soft)" }}
|
|
@@ -440,12 +638,10 @@ export const AppLayout = React.forwardRef<HTMLDivElement, AppLayoutProps>(
|
|
|
440
638
|
</div>
|
|
441
639
|
</div>
|
|
442
640
|
|
|
443
|
-
{/*
|
|
444
|
-
BODY ROW
|
|
445
|
-
══════════════════════════════════════════════════════════════ */}
|
|
641
|
+
{/* BODY ROW */}
|
|
446
642
|
<div className="flex flex-1 min-h-0 overflow-hidden">
|
|
447
643
|
|
|
448
|
-
{/* Chat panel
|
|
644
|
+
{/* Chat panel */}
|
|
449
645
|
<div
|
|
450
646
|
ref={bodyChatColRef}
|
|
451
647
|
className="flex flex-col flex-shrink-0 overflow-hidden"
|
|
@@ -496,13 +692,7 @@ export const AppLayout = React.forwardRef<HTMLDivElement, AppLayoutProps>(
|
|
|
496
692
|
/>
|
|
497
693
|
</div>
|
|
498
694
|
|
|
499
|
-
{/*
|
|
500
|
-
Layout:
|
|
501
|
-
• margin-right = PANEL_GAP_RIGHT → balanced side gap on the right
|
|
502
|
-
• border-top + border-left + border-right on the card itself
|
|
503
|
-
• top-left corner: concave SVG ornament covers the join
|
|
504
|
-
• top-right corner: rounded-tr-xl so the card sits inside the gap
|
|
505
|
-
──────────────────────────────────────────────────────────── */}
|
|
695
|
+
{/* White canvas card */}
|
|
506
696
|
<div
|
|
507
697
|
className="flex-1 min-w-0 flex flex-col overflow-hidden"
|
|
508
698
|
style={{
|
|
@@ -514,9 +704,7 @@ export const AppLayout = React.forwardRef<HTMLDivElement, AppLayoutProps>(
|
|
|
514
704
|
position: "relative",
|
|
515
705
|
}}
|
|
516
706
|
>
|
|
517
|
-
{/* Concave corner: covers the top-left border join with a smooth notch */}
|
|
518
707
|
<ConcaveCorner />
|
|
519
|
-
|
|
520
708
|
<div
|
|
521
709
|
className="flex-1 min-h-0 overflow-auto flex flex-col"
|
|
522
710
|
style={{ position: "relative", zIndex: 0 }}
|