@backmatter/studio 0.0.8 → 0.0.9
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/dist/chunks/UiKitApp-b8qFsmA-.js +2401 -0
- package/dist/chunks/WorkspaceRoutes-BKKEkAq7.js +90126 -0
- package/dist/chunks/{dashboard-bNp6AbKE.js → dashboard-BNUcbYU0.js} +380 -382
- package/dist/chunks/{index-DoDE-hwB.js → index-laWAz5_p.js} +111 -112
- package/dist/dashboard.js +2 -2
- package/dist/index.js +287 -146
- package/dist/site-widget.css +1615 -0
- package/dist/site-widget.js +30896 -630
- package/dist/studio.css +268 -67
- package/package.json +4 -4
- package/src/App.tsx +12 -29
- package/src/api.ts +55 -0
- package/src/chat/ChangeCard.tsx +2 -0
- package/src/chat/ChatMessage.tsx +73 -62
- package/src/chat/ChatPanel.tsx +110 -15
- package/src/chat/DocListCard.tsx +2 -0
- package/src/chat/LiveStatus.tsx +78 -8
- package/src/chat/Reveal.tsx +34 -0
- package/src/chat/Shimmer.tsx +65 -23
- package/src/chat/chat-helpers.ts +35 -0
- package/src/chat/motion.ts +73 -0
- package/src/chat/useStickToBottom.ts +129 -14
- package/src/chrome/ContentExplorerSidebar.tsx +23 -8
- package/src/chrome/content-tree-visibility.ts +55 -0
- package/src/devbar-state.ts +125 -0
- package/src/index.css +3 -131
- package/src/pages/CliAuthorizePage.tsx +61 -28
- package/src/pages/MediaGalleryPage.tsx +74 -11
- package/src/pages/MediaLightbox.tsx +93 -1
- package/src/pages/SettingsUsagePage.tsx +23 -1
- package/src/pages/media-grid.ts +13 -0
- package/src/pages/ui-kit/UiKitApp.tsx +164 -0
- package/src/pages/ui-kit/buttons.tsx +30 -0
- package/src/pages/ui-kit/catalog.tsx +41 -0
- package/src/pages/ui-kit/colors.tsx +95 -0
- package/src/pages/ui-kit/devbar.tsx +160 -0
- package/src/pages/ui-kit/feedback.tsx +39 -0
- package/src/pages/ui-kit/fields.tsx +47 -0
- package/src/pages/ui-kit/lists.tsx +19 -0
- package/src/pages/ui-kit/overlays.tsx +39 -0
- package/src/pages/ui-kit/path.ts +9 -0
- package/src/pages/ui-kit/sections.tsx +32 -0
- package/src/pages/ui-kit/surfaces.tsx +121 -0
- package/src/pages/ui-kit/topic.tsx +112 -0
- package/src/pages/ui-kit/topics.ts +71 -0
- package/src/pages/ui-kit/type.tsx +55 -0
- package/src/preview-frame-radius.ts +51 -0
- package/src/preview-frame.tsx +93 -49
- package/src/shell-resets.css +155 -0
- package/src/site-bar.tsx +1791 -425
- package/src/site-dashboard-href.ts +21 -0
- package/src/site-devbar-overlay-inject.ts +15 -0
- package/src/site-devbar-overlay.css +217 -0
- package/src/site-pointer.ts +1 -1
- package/src/site-publish-menu.tsx +33 -0
- package/src/site-widget-styles.ts +7 -0
- package/src/site-widget.tsx +61 -21
- package/src/studio-prose-ui.css +39 -0
- package/src/theme/ThemeProvider.tsx +4 -1
- package/src/workspace-path.ts +10 -6
- package/dist/chunks/EmbedPublishPage-CtIlaeGO.js +0 -149
- package/dist/chunks/UiKitPage-DcnSQ-Hf.js +0 -173
- package/dist/chunks/WorkspaceRoutes-DVpUOaMV.js +0 -59550
- package/dist/chunks/status-bar-action-C0fsAWvD.js +0 -30618
- package/src/pages/UiKitPage.tsx +0 -331
package/src/pages/UiKitPage.tsx
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
// packages/studio/src/pages/UiKitPage.tsx
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import * as stylex from "@stylexjs/stylex";
|
|
4
|
-
import { StatusBar, StatusItem } from "../chrome/StatusBar";
|
|
5
|
-
import { colors, radius, space, type } from "../styles/tokens.stylex";
|
|
6
|
-
import { useTheme } from "../theme/ThemeProvider";
|
|
7
|
-
import { BackLink } from "../ui/BackLink";
|
|
8
|
-
import { Button, ButtonLink } from "../ui/Button";
|
|
9
|
-
import { Field } from "../ui/Field";
|
|
10
|
-
import { Input, Select, Textarea } from "../ui/Input";
|
|
11
|
-
import { List, ListRow } from "../ui/ListRow";
|
|
12
|
-
import { PageHeader, Panel, Stack } from "../ui/Page";
|
|
13
|
-
import { Text } from "../ui/Text";
|
|
14
|
-
|
|
15
|
-
const VARIANTS = ["primary", "secondary", "ghost", "danger"] as const;
|
|
16
|
-
|
|
17
|
-
export function UiKitPage() {
|
|
18
|
-
const { preference, resolved, setPreference } = useTheme();
|
|
19
|
-
const [locale, setLocale] = useState("en");
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<div {...stylex.props(styles.page)}>
|
|
23
|
-
<header {...stylex.props(styles.top)}>
|
|
24
|
-
<div>
|
|
25
|
-
<Text as="p" size="xs" tone="muted" weight="semibold">
|
|
26
|
-
DEV ONLY · /__ui
|
|
27
|
-
</Text>
|
|
28
|
-
<Text as="h1" size="display" weight="semibold">
|
|
29
|
-
UI kit
|
|
30
|
-
</Text>
|
|
31
|
-
<Text tone="muted" size="sm">
|
|
32
|
-
StyleX + Base UI primitives. Theme is {preference} (resolved{" "}
|
|
33
|
-
{resolved}
|
|
34
|
-
).
|
|
35
|
-
</Text>
|
|
36
|
-
<div {...stylex.props(styles.back)}>
|
|
37
|
-
<BackLink to="/">← Back to app</BackLink>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
<div {...stylex.props(styles.themeRow)}>
|
|
41
|
-
<Button
|
|
42
|
-
variant={preference === "system" ? "primary" : "secondary"}
|
|
43
|
-
onClick={() => setPreference("system")}
|
|
44
|
-
>
|
|
45
|
-
System
|
|
46
|
-
</Button>
|
|
47
|
-
<Button
|
|
48
|
-
variant={preference === "light" ? "primary" : "secondary"}
|
|
49
|
-
onClick={() => setPreference("light")}
|
|
50
|
-
>
|
|
51
|
-
Light
|
|
52
|
-
</Button>
|
|
53
|
-
<Button
|
|
54
|
-
variant={preference === "dark" ? "primary" : "secondary"}
|
|
55
|
-
onClick={() => setPreference("dark")}
|
|
56
|
-
>
|
|
57
|
-
Dark
|
|
58
|
-
</Button>
|
|
59
|
-
</div>
|
|
60
|
-
</header>
|
|
61
|
-
|
|
62
|
-
<Stack gap="lg">
|
|
63
|
-
<section {...stylex.props(styles.section)}>
|
|
64
|
-
<SectionTitle>Buttons</SectionTitle>
|
|
65
|
-
<Panel>
|
|
66
|
-
<Stack gap="md">
|
|
67
|
-
{VARIANTS.map((variant) => (
|
|
68
|
-
<Row key={variant} label={variant}>
|
|
69
|
-
<Button variant={variant}>{variant}</Button>
|
|
70
|
-
<Button variant={variant} disabled>
|
|
71
|
-
disabled
|
|
72
|
-
</Button>
|
|
73
|
-
<ButtonLink variant={variant} to="/__ui">
|
|
74
|
-
link
|
|
75
|
-
</ButtonLink>
|
|
76
|
-
</Row>
|
|
77
|
-
))}
|
|
78
|
-
</Stack>
|
|
79
|
-
</Panel>
|
|
80
|
-
</section>
|
|
81
|
-
|
|
82
|
-
<section {...stylex.props(styles.section)}>
|
|
83
|
-
<SectionTitle>Fields</SectionTitle>
|
|
84
|
-
<Panel>
|
|
85
|
-
<Stack>
|
|
86
|
-
<Field label="Text" hint="Functional note under the field.">
|
|
87
|
-
<Input
|
|
88
|
-
defaultValue="Ada Lovelace"
|
|
89
|
-
autoComplete="off"
|
|
90
|
-
spellCheck={false}
|
|
91
|
-
/>
|
|
92
|
-
</Field>
|
|
93
|
-
<Field label="Disabled">
|
|
94
|
-
<Input defaultValue="Locked" disabled />
|
|
95
|
-
</Field>
|
|
96
|
-
<Field label="Select">
|
|
97
|
-
<Select
|
|
98
|
-
aria-label="Locale"
|
|
99
|
-
value={locale}
|
|
100
|
-
onValueChange={(next) => setLocale(next ?? "en")}
|
|
101
|
-
options={[
|
|
102
|
-
{ value: "en", label: "English (en)" },
|
|
103
|
-
{ value: "da", label: "Dansk (da)" },
|
|
104
|
-
]}
|
|
105
|
-
/>
|
|
106
|
-
</Field>
|
|
107
|
-
<Field label="Body (mono)">
|
|
108
|
-
<Textarea
|
|
109
|
-
mono
|
|
110
|
-
rows={4}
|
|
111
|
-
defaultValue={"---\ntitle: Hello\n---\n\nParagraph."}
|
|
112
|
-
/>
|
|
113
|
-
</Field>
|
|
114
|
-
</Stack>
|
|
115
|
-
</Panel>
|
|
116
|
-
</section>
|
|
117
|
-
|
|
118
|
-
<section {...stylex.props(styles.section)}>
|
|
119
|
-
<SectionTitle>Text</SectionTitle>
|
|
120
|
-
<Panel>
|
|
121
|
-
<Stack gap="sm">
|
|
122
|
-
<Text size="display" weight="semibold">
|
|
123
|
-
Display · 20px
|
|
124
|
-
</Text>
|
|
125
|
-
<Text size="xl" weight="semibold">
|
|
126
|
-
Title · 16px
|
|
127
|
-
</Text>
|
|
128
|
-
<Text size="lg" weight="medium">
|
|
129
|
-
Heading · 14px
|
|
130
|
-
</Text>
|
|
131
|
-
<Text>Body · 13px</Text>
|
|
132
|
-
<Text size="sm" tone="muted">
|
|
133
|
-
Muted · 12px
|
|
134
|
-
</Text>
|
|
135
|
-
<Text size="xs" tone="muted" weight="semibold">
|
|
136
|
-
OVERLINE
|
|
137
|
-
</Text>
|
|
138
|
-
<Text tone="danger">Danger</Text>
|
|
139
|
-
<Text tone="success">Success</Text>
|
|
140
|
-
<Text mono size="sm">
|
|
141
|
-
Geist Mono / content/en/blog/hello.mdx
|
|
142
|
-
</Text>
|
|
143
|
-
</Stack>
|
|
144
|
-
</Panel>
|
|
145
|
-
</section>
|
|
146
|
-
|
|
147
|
-
<section {...stylex.props(styles.section)}>
|
|
148
|
-
<SectionTitle>List + page chrome</SectionTitle>
|
|
149
|
-
<Panel>
|
|
150
|
-
<PageHeader
|
|
151
|
-
kicker={<BackLink to="/__ui">← Kit</BackLink>}
|
|
152
|
-
title="Documents"
|
|
153
|
-
description="Sample page header with action."
|
|
154
|
-
action={<Button>New</Button>}
|
|
155
|
-
/>
|
|
156
|
-
<List>
|
|
157
|
-
<ListRow
|
|
158
|
-
to="/__ui"
|
|
159
|
-
title="hello-world"
|
|
160
|
-
meta="en"
|
|
161
|
-
trailing="modified"
|
|
162
|
-
/>
|
|
163
|
-
<ListRow
|
|
164
|
-
to="/__ui"
|
|
165
|
-
title="about"
|
|
166
|
-
meta="da"
|
|
167
|
-
trailing="new"
|
|
168
|
-
/>
|
|
169
|
-
</List>
|
|
170
|
-
</Panel>
|
|
171
|
-
</section>
|
|
172
|
-
|
|
173
|
-
<section {...stylex.props(styles.section)}>
|
|
174
|
-
<SectionTitle>Top bar</SectionTitle>
|
|
175
|
-
<Panel>
|
|
176
|
-
<div {...stylex.props(styles.statusWrap)}>
|
|
177
|
-
<StatusBar>
|
|
178
|
-
<StatusItem>main</StatusItem>
|
|
179
|
-
<StatusItem>2 uncommitted</StatusItem>
|
|
180
|
-
</StatusBar>
|
|
181
|
-
<StatusBar>
|
|
182
|
-
<StatusItem>feat/sale</StatusItem>
|
|
183
|
-
<StatusItem>Unsaved</StatusItem>
|
|
184
|
-
</StatusBar>
|
|
185
|
-
<StatusBar>
|
|
186
|
-
<StatusItem tone="danger">Save failed</StatusItem>
|
|
187
|
-
</StatusBar>
|
|
188
|
-
</div>
|
|
189
|
-
</Panel>
|
|
190
|
-
</section>
|
|
191
|
-
|
|
192
|
-
<section {...stylex.props(styles.section)}>
|
|
193
|
-
<SectionTitle>Surfaces</SectionTitle>
|
|
194
|
-
<div {...stylex.props(styles.swatches)}>
|
|
195
|
-
<Swatch label="bgApp" fill={styles.bgApp} />
|
|
196
|
-
<Swatch label="bgSidebar" fill={styles.bgSidebar} />
|
|
197
|
-
<Swatch label="bgSurface" fill={styles.bgSurface} />
|
|
198
|
-
<Swatch label="accent" fill={styles.accent} />
|
|
199
|
-
<Swatch label="danger" fill={styles.dangerFill} />
|
|
200
|
-
<Swatch label="success" fill={styles.successFill} />
|
|
201
|
-
</div>
|
|
202
|
-
</section>
|
|
203
|
-
</Stack>
|
|
204
|
-
</div>
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
function SectionTitle({ children }: { children: string }) {
|
|
209
|
-
return (
|
|
210
|
-
<Text as="h2" size="xs" tone="muted" weight="semibold">
|
|
211
|
-
{children}
|
|
212
|
-
</Text>
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
function Row({
|
|
217
|
-
label,
|
|
218
|
-
children,
|
|
219
|
-
}: {
|
|
220
|
-
label: string;
|
|
221
|
-
children: React.ReactNode;
|
|
222
|
-
}) {
|
|
223
|
-
return (
|
|
224
|
-
<div {...stylex.props(styles.row)}>
|
|
225
|
-
<span {...stylex.props(styles.rowLabel)}>{label}</span>
|
|
226
|
-
<div {...stylex.props(styles.rowItems)}>{children}</div>
|
|
227
|
-
</div>
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function Swatch({
|
|
232
|
-
label,
|
|
233
|
-
fill,
|
|
234
|
-
}: {
|
|
235
|
-
label: string;
|
|
236
|
-
fill: stylex.StyleXStyles;
|
|
237
|
-
}) {
|
|
238
|
-
return (
|
|
239
|
-
<div {...stylex.props(styles.swatch)}>
|
|
240
|
-
<div {...stylex.props(styles.chip, fill)} />
|
|
241
|
-
<Text size="xs" tone="muted" mono>
|
|
242
|
-
{label}
|
|
243
|
-
</Text>
|
|
244
|
-
</div>
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
const styles = stylex.create({
|
|
249
|
-
page: {
|
|
250
|
-
minHeight: "100dvh",
|
|
251
|
-
maxWidth: "880px",
|
|
252
|
-
marginInline: "auto",
|
|
253
|
-
paddingInline: space.xxl,
|
|
254
|
-
paddingBlock: space.xxl,
|
|
255
|
-
},
|
|
256
|
-
section: {
|
|
257
|
-
display: "flex",
|
|
258
|
-
flexDirection: "column",
|
|
259
|
-
gap: space.sm,
|
|
260
|
-
},
|
|
261
|
-
top: {
|
|
262
|
-
display: "flex",
|
|
263
|
-
flexWrap: "wrap",
|
|
264
|
-
alignItems: "flex-start",
|
|
265
|
-
justifyContent: "space-between",
|
|
266
|
-
gap: space.lg,
|
|
267
|
-
marginBottom: space.xxl,
|
|
268
|
-
},
|
|
269
|
-
back: {
|
|
270
|
-
marginTop: space.md,
|
|
271
|
-
},
|
|
272
|
-
themeRow: {
|
|
273
|
-
display: "flex",
|
|
274
|
-
flexWrap: "wrap",
|
|
275
|
-
gap: space.sm,
|
|
276
|
-
},
|
|
277
|
-
row: {
|
|
278
|
-
display: "flex",
|
|
279
|
-
flexWrap: "wrap",
|
|
280
|
-
alignItems: "center",
|
|
281
|
-
gap: space.lg,
|
|
282
|
-
},
|
|
283
|
-
rowLabel: {
|
|
284
|
-
width: "88px",
|
|
285
|
-
flexShrink: 0,
|
|
286
|
-
fontSize: type.xs,
|
|
287
|
-
fontWeight: 600,
|
|
288
|
-
letterSpacing: "0.04em",
|
|
289
|
-
textTransform: "uppercase",
|
|
290
|
-
color: colors.textMuted,
|
|
291
|
-
},
|
|
292
|
-
rowItems: {
|
|
293
|
-
display: "flex",
|
|
294
|
-
flexWrap: "wrap",
|
|
295
|
-
alignItems: "center",
|
|
296
|
-
gap: space.sm,
|
|
297
|
-
},
|
|
298
|
-
statusWrap: {
|
|
299
|
-
display: "flex",
|
|
300
|
-
flexDirection: "column",
|
|
301
|
-
gap: space.md,
|
|
302
|
-
overflow: "hidden",
|
|
303
|
-
borderRadius: radius.md,
|
|
304
|
-
borderWidth: 1,
|
|
305
|
-
borderStyle: "solid",
|
|
306
|
-
borderColor: colors.border,
|
|
307
|
-
},
|
|
308
|
-
swatches: {
|
|
309
|
-
display: "grid",
|
|
310
|
-
gridTemplateColumns: "repeat(auto-fill, minmax(120px, 1fr))",
|
|
311
|
-
gap: space.md,
|
|
312
|
-
},
|
|
313
|
-
swatch: {
|
|
314
|
-
display: "flex",
|
|
315
|
-
flexDirection: "column",
|
|
316
|
-
gap: space.sm,
|
|
317
|
-
},
|
|
318
|
-
chip: {
|
|
319
|
-
height: "40px",
|
|
320
|
-
borderRadius: radius.md,
|
|
321
|
-
borderWidth: 1,
|
|
322
|
-
borderStyle: "solid",
|
|
323
|
-
borderColor: colors.border,
|
|
324
|
-
},
|
|
325
|
-
bgApp: { backgroundColor: colors.bgApp },
|
|
326
|
-
bgSidebar: { backgroundColor: colors.bgSidebar },
|
|
327
|
-
bgSurface: { backgroundColor: colors.bgSurface },
|
|
328
|
-
accent: { backgroundColor: colors.accent },
|
|
329
|
-
dangerFill: { backgroundColor: colors.danger },
|
|
330
|
-
successFill: { backgroundColor: colors.success },
|
|
331
|
-
});
|