@designa8/vibedesign-v6 1.10.7 → 1.12.2
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 +755 -252
- package/dist/index.js +756 -253
- package/dist/styles.css +60 -0
- package/package.json +11 -1
- package/src/atoms/AppLayout/preview.tsx +5 -14
- package/src/atoms/ChatScreen/index.ts +1 -1
- package/src/atoms/ExportDesignMdModal/ExportDesignMdModal.tsx +322 -0
- package/src/atoms/ExportDesignMdModal/index.ts +6 -0
- package/src/atoms/ExportDesignMdModal/preview.tsx +30 -0
- package/src/atoms/Modal/Modal.tsx +11 -4
- package/src/atoms/PublishModal/PublishModal.tsx +342 -0
- package/src/atoms/PublishModal/index.ts +2 -0
- package/src/atoms/PublishModal/preview.tsx +37 -0
- package/src/index.ts +2 -0
package/dist/styles.css
CHANGED
|
@@ -293,6 +293,9 @@
|
|
|
293
293
|
.collapse {
|
|
294
294
|
visibility: collapse;
|
|
295
295
|
}
|
|
296
|
+
.invisible {
|
|
297
|
+
visibility: hidden;
|
|
298
|
+
}
|
|
296
299
|
.visible {
|
|
297
300
|
visibility: visible;
|
|
298
301
|
}
|
|
@@ -325,6 +328,9 @@
|
|
|
325
328
|
.top-1 {
|
|
326
329
|
top: var(--spacing);
|
|
327
330
|
}
|
|
331
|
+
.top-sm {
|
|
332
|
+
top: var(--spacing-sm);
|
|
333
|
+
}
|
|
328
334
|
.-right-1\.5 {
|
|
329
335
|
right: calc(var(--spacing) * -1.5);
|
|
330
336
|
}
|
|
@@ -337,6 +343,9 @@
|
|
|
337
343
|
.right-md {
|
|
338
344
|
right: var(--spacing-md);
|
|
339
345
|
}
|
|
346
|
+
.right-sm {
|
|
347
|
+
right: var(--spacing-sm);
|
|
348
|
+
}
|
|
340
349
|
.bottom-full {
|
|
341
350
|
bottom: 100%;
|
|
342
351
|
}
|
|
@@ -397,6 +406,9 @@
|
|
|
397
406
|
.mt-xxs {
|
|
398
407
|
margin-top: var(--spacing-xxs);
|
|
399
408
|
}
|
|
409
|
+
.-mb-px {
|
|
410
|
+
margin-bottom: -1px;
|
|
411
|
+
}
|
|
400
412
|
.mb-0 {
|
|
401
413
|
margin-bottom: 0;
|
|
402
414
|
}
|
|
@@ -532,6 +544,9 @@
|
|
|
532
544
|
.h-sm {
|
|
533
545
|
height: var(--spacing-sm);
|
|
534
546
|
}
|
|
547
|
+
.max-h-64 {
|
|
548
|
+
max-height: calc(var(--spacing) * 64);
|
|
549
|
+
}
|
|
535
550
|
.min-h-0 {
|
|
536
551
|
min-height: 0;
|
|
537
552
|
}
|
|
@@ -577,6 +592,12 @@
|
|
|
577
592
|
.w-5\/6 {
|
|
578
593
|
width: calc(5 / 6 * 100%);
|
|
579
594
|
}
|
|
595
|
+
.w-6 {
|
|
596
|
+
width: calc(var(--spacing) * 6);
|
|
597
|
+
}
|
|
598
|
+
.w-9 {
|
|
599
|
+
width: calc(var(--spacing) * 9);
|
|
600
|
+
}
|
|
580
601
|
.w-10 {
|
|
581
602
|
width: calc(var(--spacing) * 10);
|
|
582
603
|
}
|
|
@@ -681,6 +702,9 @@
|
|
|
681
702
|
.rotate-0 {
|
|
682
703
|
rotate: 0deg;
|
|
683
704
|
}
|
|
705
|
+
.rotate-90 {
|
|
706
|
+
rotate: 90deg;
|
|
707
|
+
}
|
|
684
708
|
.rotate-180 {
|
|
685
709
|
rotate: 180deg;
|
|
686
710
|
}
|
|
@@ -702,12 +726,18 @@
|
|
|
702
726
|
.cursor-pointer {
|
|
703
727
|
cursor: pointer;
|
|
704
728
|
}
|
|
729
|
+
.resize {
|
|
730
|
+
resize: both;
|
|
731
|
+
}
|
|
705
732
|
.resize-none {
|
|
706
733
|
resize: none;
|
|
707
734
|
}
|
|
708
735
|
.list-none {
|
|
709
736
|
list-style-type: none;
|
|
710
737
|
}
|
|
738
|
+
.grid-cols-1 {
|
|
739
|
+
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
740
|
+
}
|
|
711
741
|
.grid-cols-2 {
|
|
712
742
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
713
743
|
}
|
|
@@ -922,6 +952,10 @@
|
|
|
922
952
|
border-bottom-style: var(--tw-border-style);
|
|
923
953
|
border-bottom-width: 1px;
|
|
924
954
|
}
|
|
955
|
+
.border-b-2 {
|
|
956
|
+
border-bottom-style: var(--tw-border-style);
|
|
957
|
+
border-bottom-width: 2px;
|
|
958
|
+
}
|
|
925
959
|
.border-l {
|
|
926
960
|
border-left-style: var(--tw-border-style);
|
|
927
961
|
border-left-width: 1px;
|
|
@@ -945,6 +979,12 @@
|
|
|
945
979
|
.border-primary-disabled {
|
|
946
980
|
border-color: var(--color-primary-disabled);
|
|
947
981
|
}
|
|
982
|
+
.border-primary\/30 {
|
|
983
|
+
border-color: color-mix(in srgb, #6B63D6 30%, transparent);
|
|
984
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
985
|
+
border-color: color-mix(in oklab, var(--color-primary) 30%, transparent);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
948
988
|
.border-semantic-error {
|
|
949
989
|
border-color: var(--color-semantic-error);
|
|
950
990
|
}
|
|
@@ -993,6 +1033,12 @@
|
|
|
993
1033
|
.bg-primary-hover {
|
|
994
1034
|
background-color: var(--color-primary-hover);
|
|
995
1035
|
}
|
|
1036
|
+
.bg-primary\/10 {
|
|
1037
|
+
background-color: color-mix(in srgb, #6B63D6 10%, transparent);
|
|
1038
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1039
|
+
background-color: color-mix(in oklab, var(--color-primary) 10%, transparent);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
996
1042
|
.bg-semantic-error {
|
|
997
1043
|
background-color: var(--color-semantic-error);
|
|
998
1044
|
}
|
|
@@ -1152,6 +1198,12 @@
|
|
|
1152
1198
|
.text-left {
|
|
1153
1199
|
text-align: left;
|
|
1154
1200
|
}
|
|
1201
|
+
.text-right {
|
|
1202
|
+
text-align: right;
|
|
1203
|
+
}
|
|
1204
|
+
.font-mono {
|
|
1205
|
+
font-family: var(--font-mono);
|
|
1206
|
+
}
|
|
1155
1207
|
.\!text-body-sm {
|
|
1156
1208
|
font-size: var(--text-body-sm) !important;
|
|
1157
1209
|
line-height: var(--tw-leading, var(--text-body-sm--line-height)) !important;
|
|
@@ -1279,6 +1331,9 @@
|
|
|
1279
1331
|
.italic {
|
|
1280
1332
|
font-style: italic;
|
|
1281
1333
|
}
|
|
1334
|
+
.underline {
|
|
1335
|
+
text-decoration-line: underline;
|
|
1336
|
+
}
|
|
1282
1337
|
.opacity-0 {
|
|
1283
1338
|
opacity: 0%;
|
|
1284
1339
|
}
|
|
@@ -1632,6 +1687,11 @@
|
|
|
1632
1687
|
width: auto;
|
|
1633
1688
|
}
|
|
1634
1689
|
}
|
|
1690
|
+
.md\:grid-cols-2 {
|
|
1691
|
+
@media (width >= 48rem) {
|
|
1692
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1635
1695
|
.md\:flex-nowrap {
|
|
1636
1696
|
@media (width >= 48rem) {
|
|
1637
1697
|
flex-wrap: nowrap;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@designa8/vibedesign-v6",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.2",
|
|
4
4
|
"description": "Design system \"Plasma Design System\" generated by atom-server.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -74,6 +74,11 @@
|
|
|
74
74
|
"kind": "Atom",
|
|
75
75
|
"description": null
|
|
76
76
|
},
|
|
77
|
+
{
|
|
78
|
+
"name": "ExportDesignMdModal",
|
|
79
|
+
"kind": "Organism",
|
|
80
|
+
"description": null
|
|
81
|
+
},
|
|
77
82
|
{
|
|
78
83
|
"name": "FilterTabBar",
|
|
79
84
|
"kind": "Atom",
|
|
@@ -109,6 +114,11 @@
|
|
|
109
114
|
"kind": "Molecule",
|
|
110
115
|
"description": null
|
|
111
116
|
},
|
|
117
|
+
{
|
|
118
|
+
"name": "PublishModal",
|
|
119
|
+
"kind": "Organism",
|
|
120
|
+
"description": null
|
|
121
|
+
},
|
|
112
122
|
{
|
|
113
123
|
"name": "TopNavbar",
|
|
114
124
|
"kind": "Organism",
|
|
@@ -16,20 +16,11 @@ const sampleMessages: ChatMessage[] = [
|
|
|
16
16
|
role: "ai",
|
|
17
17
|
content:
|
|
18
18
|
"I'll build a polished landing page with a hero, feature grid, and a 3-tier pricing section. Here's the plan:",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
id: "p3",
|
|
26
|
-
label: "Create pricing card component",
|
|
27
|
-
status: "in_progress",
|
|
28
|
-
currentTool: "Writing atom…",
|
|
29
|
-
},
|
|
30
|
-
{ id: "p4", label: "Wire up responsiveness", status: "pending" },
|
|
31
|
-
],
|
|
32
|
-
},
|
|
19
|
+
timeline: [
|
|
20
|
+
{ id: "p1", kind: "thinking", label: "Scaffold page layout", status: "done" },
|
|
21
|
+
{ id: "p2", kind: "write", label: "Build hero section with CTA", status: "done" },
|
|
22
|
+
{ id: "p3", kind: "write", label: "Create pricing card component", status: "running" },
|
|
23
|
+
],
|
|
33
24
|
},
|
|
34
25
|
{
|
|
35
26
|
id: "3",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ChatScreen } from "./ChatScreen";
|
|
2
|
-
export type { ChatScreenProps, ChatMessage, MessageRole,
|
|
2
|
+
export type { ChatScreenProps, ChatMessage, MessageRole, TimelineItem } from "./ChatScreen";
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { Modal } from "../Modal";
|
|
3
|
+
import { Button } from "../Button";
|
|
4
|
+
import { Chip } from "../Chip";
|
|
5
|
+
import { Typography } from "../Typography";
|
|
6
|
+
|
|
7
|
+
export type ExportDesignMdSource = "production" | "local";
|
|
8
|
+
|
|
9
|
+
export interface ExportDesignMdLine {
|
|
10
|
+
/** Raw text of this line (may be empty for a blank line) */
|
|
11
|
+
text: string;
|
|
12
|
+
/** Visual emphasis for the line */
|
|
13
|
+
tone?: "heading" | "default";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ExportDesignMdModalProps {
|
|
17
|
+
/** Controls whether the modal is visible */
|
|
18
|
+
isOpen: boolean;
|
|
19
|
+
/** Called when the user dismisses the modal (backdrop, Esc, close, Cancel) */
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
/** Called when the user confirms the export */
|
|
22
|
+
onExport?: () => void;
|
|
23
|
+
/** Called when the user downloads the .md file */
|
|
24
|
+
onDownload?: () => void;
|
|
25
|
+
/** Called when the user copies the preview to the clipboard */
|
|
26
|
+
onCopy?: () => void;
|
|
27
|
+
/** Name of the design system shown in the generated heading */
|
|
28
|
+
designSystemName?: string;
|
|
29
|
+
/** Which source tab is selected by default */
|
|
30
|
+
defaultSource?: ExportDesignMdSource;
|
|
31
|
+
/** Lines rendered in the code preview panel */
|
|
32
|
+
lines?: ExportDesignMdLine[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Note: token values below are written out as literal strings on purpose —
|
|
36
|
+
// this is a *documentation preview* of the project's own DESIGN.md export,
|
|
37
|
+
// so it must show the raw token names/values a consumer agent would read,
|
|
38
|
+
// not live-bound `var(--color-*)` references. Not a design-system violation.
|
|
39
|
+
const defaultLines: ExportDesignMdLine[] = [
|
|
40
|
+
{ text: "# Design System", tone: "heading" },
|
|
41
|
+
{ text: "" },
|
|
42
|
+
{ text: "Design system generated by Atoms Design." },
|
|
43
|
+
{ text: "Consume it via the npm registry." },
|
|
44
|
+
{ text: "" },
|
|
45
|
+
{
|
|
46
|
+
text: "IMPORTANT: Read this skill file in full BEFORE editing any file in the consumer app.",
|
|
47
|
+
},
|
|
48
|
+
{ text: "" },
|
|
49
|
+
{
|
|
50
|
+
text: "Use this skill whenever the user wants to add, change, fix, restyle, resize,",
|
|
51
|
+
},
|
|
52
|
+
{ text: "extend, or audit UI in their app." },
|
|
53
|
+
{ text: "" },
|
|
54
|
+
{ text: "## 1. Colors", tone: "heading" },
|
|
55
|
+
{ text: "" },
|
|
56
|
+
{ text: "primary: {colors.primary}" },
|
|
57
|
+
{ text: "on-primary: {colors.on-primary}" },
|
|
58
|
+
{ text: "primary-hover: {colors.primary-hover}" },
|
|
59
|
+
{ text: "primary-active: {colors.primary-active}" },
|
|
60
|
+
{ text: "canvas: {colors.canvas}" },
|
|
61
|
+
{ text: "surface: {colors.surface}" },
|
|
62
|
+
{ text: "ink: {colors.ink}" },
|
|
63
|
+
{ text: "body: {colors.body}" },
|
|
64
|
+
{ text: "muted: {colors.muted}" },
|
|
65
|
+
{ text: "hairline: {colors.hairline}" },
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
const CloudIcon = () => (
|
|
69
|
+
<svg
|
|
70
|
+
viewBox="0 0 24 24"
|
|
71
|
+
width="16"
|
|
72
|
+
height="16"
|
|
73
|
+
fill="none"
|
|
74
|
+
stroke="currentColor"
|
|
75
|
+
strokeWidth="2"
|
|
76
|
+
strokeLinecap="round"
|
|
77
|
+
strokeLinejoin="round"
|
|
78
|
+
aria-hidden="true"
|
|
79
|
+
>
|
|
80
|
+
<path d="M17.5 19a4.5 4.5 0 0 0 0-9 5.5 5.5 0 0 0-10.8-1.5A4 4 0 0 0 6.5 16" />
|
|
81
|
+
<path d="M8 19h9.5" />
|
|
82
|
+
</svg>
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
const LinkIcon = () => (
|
|
86
|
+
<svg
|
|
87
|
+
viewBox="0 0 24 24"
|
|
88
|
+
width="16"
|
|
89
|
+
height="16"
|
|
90
|
+
fill="none"
|
|
91
|
+
stroke="currentColor"
|
|
92
|
+
strokeWidth="2"
|
|
93
|
+
strokeLinecap="round"
|
|
94
|
+
strokeLinejoin="round"
|
|
95
|
+
aria-hidden="true"
|
|
96
|
+
>
|
|
97
|
+
<path d="M9 17H7A5 5 0 0 1 7 7h2" />
|
|
98
|
+
<path d="M15 7h2a5 5 0 1 1 0 10h-2" />
|
|
99
|
+
<line x1="8" y1="12" x2="16" y2="12" />
|
|
100
|
+
</svg>
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const CopyIcon = () => (
|
|
104
|
+
<svg
|
|
105
|
+
viewBox="0 0 24 24"
|
|
106
|
+
width="14"
|
|
107
|
+
height="14"
|
|
108
|
+
fill="none"
|
|
109
|
+
stroke="currentColor"
|
|
110
|
+
strokeWidth="2"
|
|
111
|
+
strokeLinecap="round"
|
|
112
|
+
strokeLinejoin="round"
|
|
113
|
+
aria-hidden="true"
|
|
114
|
+
>
|
|
115
|
+
<rect x="9" y="9" width="11" height="11" rx="2" />
|
|
116
|
+
<path d="M5 15V5a2 2 0 0 1 2-2h10" />
|
|
117
|
+
</svg>
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
const DownloadIcon = () => (
|
|
121
|
+
<svg
|
|
122
|
+
viewBox="0 0 24 24"
|
|
123
|
+
width="14"
|
|
124
|
+
height="14"
|
|
125
|
+
fill="none"
|
|
126
|
+
stroke="currentColor"
|
|
127
|
+
strokeWidth="2"
|
|
128
|
+
strokeLinecap="round"
|
|
129
|
+
strokeLinejoin="round"
|
|
130
|
+
aria-hidden="true"
|
|
131
|
+
>
|
|
132
|
+
<path d="M12 3v12" />
|
|
133
|
+
<path d="M7 10l5 5 5-5" />
|
|
134
|
+
<path d="M5 21h14" />
|
|
135
|
+
</svg>
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
export const ExportDesignMdModal = React.forwardRef<
|
|
139
|
+
HTMLDivElement,
|
|
140
|
+
ExportDesignMdModalProps
|
|
141
|
+
>(
|
|
142
|
+
(
|
|
143
|
+
{
|
|
144
|
+
isOpen,
|
|
145
|
+
onClose,
|
|
146
|
+
onExport,
|
|
147
|
+
onDownload,
|
|
148
|
+
onCopy,
|
|
149
|
+
designSystemName = "Design System",
|
|
150
|
+
defaultSource = "production",
|
|
151
|
+
lines = defaultLines,
|
|
152
|
+
},
|
|
153
|
+
ref
|
|
154
|
+
) => {
|
|
155
|
+
const [source, setSource] = useState<ExportDesignMdSource>(defaultSource);
|
|
156
|
+
|
|
157
|
+
const handleCopy = () => {
|
|
158
|
+
const text = lines.map((l) => l.text).join("\n");
|
|
159
|
+
if (typeof navigator !== "undefined" && navigator.clipboard) {
|
|
160
|
+
navigator.clipboard.writeText(text).catch(() => {});
|
|
161
|
+
}
|
|
162
|
+
onCopy?.();
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
<Modal
|
|
167
|
+
ref={ref}
|
|
168
|
+
isOpen={isOpen}
|
|
169
|
+
onClose={onClose}
|
|
170
|
+
title="Export DESIGN.md"
|
|
171
|
+
size="xl"
|
|
172
|
+
footer={
|
|
173
|
+
<div className="flex w-full items-center justify-between">
|
|
174
|
+
<Button variant="secondary" size="sm" onClick={onDownload}>
|
|
175
|
+
<DownloadIcon />
|
|
176
|
+
Download .md
|
|
177
|
+
</Button>
|
|
178
|
+
<div className="flex items-center gap-sm">
|
|
179
|
+
<Button variant="secondary" onClick={onClose}>
|
|
180
|
+
Cancel
|
|
181
|
+
</Button>
|
|
182
|
+
<Button variant="primary" onClick={onExport}>
|
|
183
|
+
Export
|
|
184
|
+
</Button>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
}
|
|
188
|
+
>
|
|
189
|
+
<div className="w-full space-y-lg">
|
|
190
|
+
<Typography role="body-md" color="muted">
|
|
191
|
+
Generate and export the DESIGN.md file for handoff to AI coding
|
|
192
|
+
agents or your team.
|
|
193
|
+
</Typography>
|
|
194
|
+
|
|
195
|
+
{/* Source tabs */}
|
|
196
|
+
<div className="flex flex-wrap items-center justify-between gap-md">
|
|
197
|
+
<div className="inline-flex items-center gap-xs p-xxs bg-surface-soft border border-hairline rounded-md">
|
|
198
|
+
<Button
|
|
199
|
+
variant={source === "production" ? "primary" : "ghost"}
|
|
200
|
+
size="sm"
|
|
201
|
+
onClick={() => setSource("production")}
|
|
202
|
+
>
|
|
203
|
+
<CloudIcon />
|
|
204
|
+
Production
|
|
205
|
+
</Button>
|
|
206
|
+
<Button
|
|
207
|
+
variant={source === "local" ? "primary" : "ghost"}
|
|
208
|
+
size="sm"
|
|
209
|
+
onClick={() => setSource("local")}
|
|
210
|
+
>
|
|
211
|
+
<LinkIcon />
|
|
212
|
+
Local (npm link)
|
|
213
|
+
</Button>
|
|
214
|
+
</div>
|
|
215
|
+
<Typography role="body-sm" color="muted" className="flex-1 min-w-[16rem]">
|
|
216
|
+
{source === "production"
|
|
217
|
+
? "Consumer apps install from the public npm registry ('npm install')."
|
|
218
|
+
: "Consumer apps resolve the package via a local 'npm link' during development."}
|
|
219
|
+
</Typography>
|
|
220
|
+
</div>
|
|
221
|
+
|
|
222
|
+
{/* Preview */}
|
|
223
|
+
<div>
|
|
224
|
+
<Typography
|
|
225
|
+
role="caption"
|
|
226
|
+
color="muted"
|
|
227
|
+
uppercase
|
|
228
|
+
className="mb-xs block"
|
|
229
|
+
>
|
|
230
|
+
Preview
|
|
231
|
+
</Typography>
|
|
232
|
+
<div className="relative w-full bg-canvas border border-hairline rounded-md overflow-hidden">
|
|
233
|
+
<Button
|
|
234
|
+
variant="secondary"
|
|
235
|
+
size="sm"
|
|
236
|
+
onClick={handleCopy}
|
|
237
|
+
className="absolute top-sm right-sm"
|
|
238
|
+
>
|
|
239
|
+
<CopyIcon />
|
|
240
|
+
Copy
|
|
241
|
+
</Button>
|
|
242
|
+
<div className="max-h-64 overflow-y-auto px-md py-sm font-mono text-body-sm">
|
|
243
|
+
{lines.map((line, i) => (
|
|
244
|
+
<div key={i} className="flex gap-md">
|
|
245
|
+
<span className="w-6 flex-shrink-0 text-right text-muted-soft select-none">
|
|
246
|
+
{i + 1}
|
|
247
|
+
</span>
|
|
248
|
+
<span
|
|
249
|
+
className={
|
|
250
|
+
line.tone === "heading"
|
|
251
|
+
? "text-primary font-weight-heading-sm"
|
|
252
|
+
: "text-body"
|
|
253
|
+
}
|
|
254
|
+
>
|
|
255
|
+
{line.text.replace("Design System", designSystemName) ||
|
|
256
|
+
"\u00A0"}
|
|
257
|
+
</span>
|
|
258
|
+
</div>
|
|
259
|
+
))}
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
|
|
264
|
+
{/* Storage options */}
|
|
265
|
+
<div className="w-full space-y-sm">
|
|
266
|
+
<div className="flex w-full items-center gap-md p-md bg-surface-soft border border-hairline rounded-md">
|
|
267
|
+
<span className="flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-sm bg-surface border border-hairline text-primary">
|
|
268
|
+
<CloudIcon />
|
|
269
|
+
</span>
|
|
270
|
+
<div className="min-w-0 flex-1">
|
|
271
|
+
<Typography role="body-md" color="ink" className="font-weight-heading-sm">
|
|
272
|
+
Production (npm install)
|
|
273
|
+
</Typography>
|
|
274
|
+
<Typography role="body-sm" color="muted">
|
|
275
|
+
Generated for public npm registry consumption.
|
|
276
|
+
</Typography>
|
|
277
|
+
</div>
|
|
278
|
+
{source === "production" ? (
|
|
279
|
+
<Chip label="Active" variant="primary" size="sm" />
|
|
280
|
+
) : (
|
|
281
|
+
<Button
|
|
282
|
+
variant="secondary"
|
|
283
|
+
size="sm"
|
|
284
|
+
onClick={() => setSource("production")}
|
|
285
|
+
>
|
|
286
|
+
Switch
|
|
287
|
+
</Button>
|
|
288
|
+
)}
|
|
289
|
+
</div>
|
|
290
|
+
|
|
291
|
+
<div className="flex w-full items-center gap-md p-md bg-surface-soft border border-hairline rounded-md">
|
|
292
|
+
<span className="flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-sm bg-surface border border-hairline text-muted">
|
|
293
|
+
<LinkIcon />
|
|
294
|
+
</span>
|
|
295
|
+
<div className="min-w-0 flex-1">
|
|
296
|
+
<Typography role="body-md" color="ink" className="font-weight-heading-sm">
|
|
297
|
+
Local (npm link)
|
|
298
|
+
</Typography>
|
|
299
|
+
<Typography role="body-sm" color="muted">
|
|
300
|
+
Generated for local development with npm link.
|
|
301
|
+
</Typography>
|
|
302
|
+
</div>
|
|
303
|
+
{source === "local" ? (
|
|
304
|
+
<Chip label="Active" variant="primary" size="sm" />
|
|
305
|
+
) : (
|
|
306
|
+
<Button
|
|
307
|
+
variant="secondary"
|
|
308
|
+
size="sm"
|
|
309
|
+
onClick={() => setSource("local")}
|
|
310
|
+
>
|
|
311
|
+
Switch
|
|
312
|
+
</Button>
|
|
313
|
+
)}
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
</Modal>
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
);
|
|
321
|
+
|
|
322
|
+
ExportDesignMdModal.displayName = "ExportDesignMdModal";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { ExportDesignMdModal } from "./ExportDesignMdModal";
|
|
3
|
+
import { Button } from "../Button";
|
|
4
|
+
|
|
5
|
+
export default function ExportDesignMdModalPreview() {
|
|
6
|
+
const [open, setOpen] = useState(false);
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<div className="w-full max-w-3xl mx-auto p-lg space-y-md">
|
|
10
|
+
<div>
|
|
11
|
+
<h2 className="text-heading-md text-ink">Export DESIGN.md</h2>
|
|
12
|
+
<p className="text-body-md text-muted mt-xs">
|
|
13
|
+
Opens a dialog for handing off the design system's token file to an
|
|
14
|
+
AI coding agent or teammate, with a source toggle and live preview.
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<Button variant="primary" onClick={() => setOpen(true)}>
|
|
19
|
+
Export DESIGN.md
|
|
20
|
+
</Button>
|
|
21
|
+
|
|
22
|
+
<ExportDesignMdModal
|
|
23
|
+
isOpen={open}
|
|
24
|
+
onClose={() => setOpen(false)}
|
|
25
|
+
onExport={() => setOpen(false)}
|
|
26
|
+
onDownload={() => {}}
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -13,13 +13,14 @@ export interface ModalProps {
|
|
|
13
13
|
/** Optional footer actions */
|
|
14
14
|
footer?: React.ReactNode;
|
|
15
15
|
/** Max-width variant */
|
|
16
|
-
size?: "sm" | "md" | "lg";
|
|
16
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const sizeMap: Record<NonNullable<ModalProps["size"]>, string> = {
|
|
20
20
|
sm: "max-w-sm",
|
|
21
21
|
md: "max-w-lg",
|
|
22
22
|
lg: "max-w-2xl",
|
|
23
|
+
xl: "max-w-4xl",
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
export const Modal = React.forwardRef<HTMLDivElement, ModalProps>(
|
|
@@ -72,17 +73,23 @@ export const Modal = React.forwardRef<HTMLDivElement, ModalProps>(
|
|
|
72
73
|
onClick={handleBackdropClick}
|
|
73
74
|
className={[
|
|
74
75
|
"fixed inset-0 flex items-center justify-center p-base",
|
|
75
|
-
"bg-[var(--color-scrim)]/
|
|
76
|
+
"bg-[var(--color-scrim)]/60",
|
|
76
77
|
"transition-opacity duration-250 ease-in-out",
|
|
77
78
|
visible ? "opacity-100" : "opacity-0",
|
|
78
79
|
].join(" ")}
|
|
79
80
|
style={{ zIndex: "var(--z-modal, 1000)" }}
|
|
80
81
|
>
|
|
81
|
-
{/* Panel
|
|
82
|
+
{/* Panel — bg-surface (not bg-canvas) so the panel visibly separates
|
|
83
|
+
from the page behind the scrim, especially in dark mode where
|
|
84
|
+
canvas and scrim are both near-black. A hairline border adds a
|
|
85
|
+
crisp edge since box-shadow alone reads as nearly invisible on
|
|
86
|
+
dark backgrounds. max-h-[90vh] caps the panel so content-heavy
|
|
87
|
+
modals never overflow the viewport — the body's overflow-y-auto
|
|
88
|
+
below lets long content scroll within that capped height. */}
|
|
82
89
|
<div
|
|
83
90
|
ref={ref}
|
|
84
91
|
className={[
|
|
85
|
-
"relative w-full bg-
|
|
92
|
+
"relative w-full max-h-[90vh] bg-surface border border-hairline rounded-lg",
|
|
86
93
|
"shadow-[0_8px_40px_0_rgba(0,0,0,0.18)]",
|
|
87
94
|
"flex flex-col overflow-hidden",
|
|
88
95
|
sizeMap[size],
|