@hollis-labs/surface-page 0.0.0-stage → 0.1.0
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 +24 -2
- package/dist/chunks/chunk-ZT6LTRMY.js +220 -0
- package/dist/gallery.js +1016 -0
- package/dist/index.js +2000 -0
- package/dist/registry-items.json +36 -0
- package/dist/sdk.js +24 -0
- package/dist/types/ade/Overlay.d.ts +4 -0
- package/dist/types/ade/hub.d.ts +5 -0
- package/dist/types/agent/AgentPanel.d.ts +24 -0
- package/dist/types/agent/api.d.ts +57 -0
- package/dist/types/agent/index.d.ts +2 -0
- package/dist/types/agent/items.d.ts +25 -0
- package/dist/types/boot.d.ts +12 -0
- package/dist/types/cards/renderers.d.ts +22 -0
- package/dist/types/cards/store.d.ts +41 -0
- package/dist/types/cards/views.d.ts +9 -0
- package/dist/types/desk/Confirm.d.ts +2 -0
- package/dist/types/desk/Desktop.d.ts +6 -0
- package/dist/types/desk/Palette.d.ts +9 -0
- package/dist/types/desk/commands.d.ts +9 -0
- package/dist/types/desk/coreViews.d.ts +2 -0
- package/dist/types/desk/keys.d.ts +12 -0
- package/dist/types/desk/moduleApi.d.ts +3 -0
- package/dist/types/desk/store.d.ts +107 -0
- package/dist/types/gallery/Gallery.d.ts +49 -0
- package/dist/types/gallery/Specimen.d.ts +12 -0
- package/dist/types/gallery/ade.d.ts +1 -0
- package/dist/types/gallery/cards.d.ts +1 -0
- package/dist/types/gallery/chat.d.ts +1 -0
- package/dist/types/gallery/controls.d.ts +1 -0
- package/dist/types/gallery/display.d.ts +1 -0
- package/dist/types/gallery/genui.d.ts +1 -0
- package/dist/types/gallery/index.d.ts +9 -0
- package/dist/types/gallery/overlays.d.ts +1 -0
- package/dist/types/gallery/windows.d.ts +1 -0
- package/dist/types/genui/card.d.ts +2 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/sdk/anchors.d.ts +8 -0
- package/dist/types/sdk/hooks.d.ts +11 -0
- package/dist/types/sdk/icon.d.ts +5 -0
- package/dist/types/sdk/index.d.ts +9 -0
- package/dist/types/sdk/marks.d.ts +10 -0
- package/dist/types/sdk/runtime.d.ts +40 -0
- package/dist/types/sdk/types.d.ts +99 -0
- package/package.json +70 -4
- package/vite.d.ts +3 -0
- package/vite.js +42 -0
package/dist/gallery.js
ADDED
|
@@ -0,0 +1,1016 @@
|
|
|
1
|
+
// ../../web/src/gallery/Gallery.tsx
|
|
2
|
+
import { useState as useState4 } from "react";
|
|
3
|
+
import { Tabs as Tabs2, TabsContent as TabsContent2, TabsList as TabsList2, TabsTrigger as TabsTrigger2 } from "@/components/ui/tabs";
|
|
4
|
+
|
|
5
|
+
// ../../web/src/gallery/ade.tsx
|
|
6
|
+
import { useEffect, useRef, useState } from "react";
|
|
7
|
+
import { AttentionLayer } from "@/components/ui/attention-layer";
|
|
8
|
+
import { GuideBar } from "@/components/ui/guide-bar";
|
|
9
|
+
import { Label } from "@/components/ui/label";
|
|
10
|
+
import { Switch } from "@/components/ui/switch";
|
|
11
|
+
|
|
12
|
+
// ../../web/src/gallery/Specimen.tsx
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
function Section({ title, about, children }) {
|
|
15
|
+
return /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", children: [
|
|
16
|
+
/* @__PURE__ */ jsxs("header", { children: [
|
|
17
|
+
/* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold", children: title }),
|
|
18
|
+
about && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: about })
|
|
19
|
+
] }),
|
|
20
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-3 @2xl:grid-cols-2", children })
|
|
21
|
+
] });
|
|
22
|
+
}
|
|
23
|
+
function Specimen({ label, wide, children }) {
|
|
24
|
+
return /* @__PURE__ */ jsxs(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
className: `flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-background p-3 ${wide ? "@2xl:col-span-2" : ""}`,
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-xs text-muted-foreground", children: label }),
|
|
30
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// ../../web/src/gallery/ade.tsx
|
|
37
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
38
|
+
var rectOf = (el) => {
|
|
39
|
+
if (!el) return null;
|
|
40
|
+
const r = el.getBoundingClientRect();
|
|
41
|
+
return r.width && r.height ? { x: r.x, y: r.y, w: r.width, h: r.height } : null;
|
|
42
|
+
};
|
|
43
|
+
function AttentionDemo({ style }) {
|
|
44
|
+
const a = useRef(null);
|
|
45
|
+
const b = useRef(null);
|
|
46
|
+
const box = useRef(null);
|
|
47
|
+
const [, tick] = useState(0);
|
|
48
|
+
const [on, setOn] = useState(true);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const t = window.setInterval(() => tick((n) => n + 1), 200);
|
|
51
|
+
return () => window.clearInterval(t);
|
|
52
|
+
}, []);
|
|
53
|
+
const target = rectOf(b.current);
|
|
54
|
+
const from = rectOf(a.current);
|
|
55
|
+
const marks = on && target ? [{ id: style, actor: "agent", style, rects: [target], from, note: `A ${style}, with a note.`, by: "Agent" }] : [];
|
|
56
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex w-full flex-col gap-2", children: [
|
|
57
|
+
/* @__PURE__ */ jsxs2(Label, { className: "gap-2 text-xs", children: [
|
|
58
|
+
/* @__PURE__ */ jsx2(Switch, { checked: on, onCheckedChange: setOn, size: "sm" }),
|
|
59
|
+
" Show"
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ jsxs2(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
ref: box,
|
|
65
|
+
className: "relative grid h-36 w-full grid-cols-2 gap-4 rounded-md border border-dashed border-border p-4",
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ jsx2("div", { ref: a, className: "grid place-items-center rounded-md bg-muted text-xs", children: "from" }),
|
|
68
|
+
/* @__PURE__ */ jsx2("div", { ref: b, className: "grid place-items-center rounded-md bg-muted text-xs", children: "target" })
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx2(
|
|
73
|
+
AttentionLayer,
|
|
74
|
+
{
|
|
75
|
+
marks,
|
|
76
|
+
area: style === "spotlight" ? rectOf(box.current) : null,
|
|
77
|
+
onDismiss: () => setOn(false)
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
function Ade() {
|
|
83
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
84
|
+
/* @__PURE__ */ jsx2(Section, { title: "attention-layer", about: "Drawn over the whole window at rectangles the caller finds.", children: ["highlight", "spotlight", "arrow", "select"].map((s) => /* @__PURE__ */ jsx2(Specimen, { label: `style="${s}"`, children: /* @__PURE__ */ jsx2(AttentionDemo, { style: s }) }, s)) }),
|
|
85
|
+
/* @__PURE__ */ jsxs2(Section, { title: "guide-bar", children: [
|
|
86
|
+
/* @__PURE__ */ jsx2(Specimen, { label: "running, waits for Next", children: /* @__PURE__ */ jsx2(
|
|
87
|
+
GuideBar,
|
|
88
|
+
{
|
|
89
|
+
title: "A tour of Drafts",
|
|
90
|
+
say: "These are the modes: Review, Edit and Compare.",
|
|
91
|
+
step: 1,
|
|
92
|
+
steps: 3,
|
|
93
|
+
status: "running",
|
|
94
|
+
onNext: () => {
|
|
95
|
+
},
|
|
96
|
+
onPause: () => {
|
|
97
|
+
},
|
|
98
|
+
onStop: () => {
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
) }),
|
|
102
|
+
/* @__PURE__ */ jsx2(Specimen, { label: "running, waits for something to be done", children: /* @__PURE__ */ jsx2(
|
|
103
|
+
GuideBar,
|
|
104
|
+
{
|
|
105
|
+
title: "A tour of Drafts",
|
|
106
|
+
say: "Now open Scratch, where quick notes go.",
|
|
107
|
+
step: 3,
|
|
108
|
+
steps: 3,
|
|
109
|
+
status: "running",
|
|
110
|
+
waiting: "Open Scratch.",
|
|
111
|
+
hint: "Use the apps menu at the top left.",
|
|
112
|
+
onBack: () => {
|
|
113
|
+
},
|
|
114
|
+
onNext: () => {
|
|
115
|
+
},
|
|
116
|
+
onPause: () => {
|
|
117
|
+
},
|
|
118
|
+
onStop: () => {
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
) }),
|
|
122
|
+
/* @__PURE__ */ jsx2(Specimen, { label: "paused", children: /* @__PURE__ */ jsx2(
|
|
123
|
+
GuideBar,
|
|
124
|
+
{
|
|
125
|
+
title: "A tour of Drafts",
|
|
126
|
+
say: "This is the draft's text.",
|
|
127
|
+
step: 2,
|
|
128
|
+
steps: 3,
|
|
129
|
+
status: "paused",
|
|
130
|
+
onBack: () => {
|
|
131
|
+
},
|
|
132
|
+
onResume: () => {
|
|
133
|
+
},
|
|
134
|
+
onStop: () => {
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
) }),
|
|
138
|
+
/* @__PURE__ */ jsx2(Specimen, { label: "done", children: /* @__PURE__ */ jsx2(GuideBar, { title: "A tour of Drafts", say: "", step: 3, steps: 3, status: "done", onStop: () => {
|
|
139
|
+
} }) })
|
|
140
|
+
] })
|
|
141
|
+
] });
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// ../../web/src/gallery/cards.tsx
|
|
145
|
+
import { CardApproval } from "@/components/ui/card-approval";
|
|
146
|
+
import { CardChoice } from "@/components/ui/card-choice";
|
|
147
|
+
import { CardConfirm } from "@/components/ui/card-confirm";
|
|
148
|
+
import { CardForm } from "@/components/ui/card-form";
|
|
149
|
+
import { CardMiss } from "@/components/ui/card-miss";
|
|
150
|
+
import { CardNotice } from "@/components/ui/card-notice";
|
|
151
|
+
import { CardPlan } from "@/components/ui/card-plan";
|
|
152
|
+
import { CardProgress } from "@/components/ui/card-progress";
|
|
153
|
+
import { CardPrompt } from "@/components/ui/card-prompt";
|
|
154
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
155
|
+
var STATES = [
|
|
156
|
+
{ label: "open", state: "open" },
|
|
157
|
+
{ label: "pending", state: "pending" },
|
|
158
|
+
{ label: "submitted", state: "submitted" },
|
|
159
|
+
{ label: "canceled", state: "canceled" },
|
|
160
|
+
{ label: "expired", state: "expired" },
|
|
161
|
+
{ label: "superseded", state: "superseded" },
|
|
162
|
+
{ label: "failed", state: "failed" },
|
|
163
|
+
{ label: "stale", state: "open", stale: true }
|
|
164
|
+
];
|
|
165
|
+
var base = (s) => ({
|
|
166
|
+
state: s.state,
|
|
167
|
+
stale: s.stale,
|
|
168
|
+
onReload: s.stale ? () => {
|
|
169
|
+
} : void 0,
|
|
170
|
+
busy: s.state === "pending",
|
|
171
|
+
receipt: s.state === "submitted" ? "Approved" : void 0,
|
|
172
|
+
expires: s.state === "open" ? "at 14:05" : void 0,
|
|
173
|
+
onRespond: () => {
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
var FIELDS = [
|
|
177
|
+
{ key: "title", kind: "text", title: "Title", required: true },
|
|
178
|
+
{ key: "about", kind: "textarea", title: "About", description: "A line or two." },
|
|
179
|
+
{ key: "count", kind: "integer", title: "How many" },
|
|
180
|
+
{ key: "public", kind: "boolean", title: "Public" },
|
|
181
|
+
{ key: "kind", kind: "enum", title: "Kind", options: ["note", "draft", "plan"] }
|
|
182
|
+
];
|
|
183
|
+
function AllStates({ name, draw }) {
|
|
184
|
+
return /* @__PURE__ */ jsx3(Section, { title: name, children: STATES.map((s) => /* @__PURE__ */ jsx3(Specimen, { label: s.label, children: /* @__PURE__ */ jsx3("div", { className: "w-full", children: draw(base(s)) }) }, s.label)) });
|
|
185
|
+
}
|
|
186
|
+
function Cards() {
|
|
187
|
+
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
188
|
+
/* @__PURE__ */ jsx3(
|
|
189
|
+
AllStates,
|
|
190
|
+
{
|
|
191
|
+
name: "card-confirm",
|
|
192
|
+
draw: (p) => /* @__PURE__ */ jsx3(CardConfirm, { ...p, title: "Close three windows?", body: "Your unsaved draft stays open.", danger: false })
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
/* @__PURE__ */ jsx3(
|
|
196
|
+
AllStates,
|
|
197
|
+
{
|
|
198
|
+
name: "card-prompt",
|
|
199
|
+
draw: (p) => /* @__PURE__ */ jsx3(CardPrompt, { ...p, title: "A name", question: "What should the flow be called?", placeholder: "Research" })
|
|
200
|
+
}
|
|
201
|
+
),
|
|
202
|
+
/* @__PURE__ */ jsx3(
|
|
203
|
+
AllStates,
|
|
204
|
+
{
|
|
205
|
+
name: "card-choice",
|
|
206
|
+
draw: (p) => /* @__PURE__ */ jsx3(
|
|
207
|
+
CardChoice,
|
|
208
|
+
{
|
|
209
|
+
...p,
|
|
210
|
+
title: "Which layout?",
|
|
211
|
+
question: "Pick where the browser goes.",
|
|
212
|
+
options: [
|
|
213
|
+
{ id: "left", label: "Left", description: "Beside the draft" },
|
|
214
|
+
{ id: "below", label: "Below" },
|
|
215
|
+
{ id: "float", label: "Floating" }
|
|
216
|
+
],
|
|
217
|
+
allowOther: true
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
/* @__PURE__ */ jsx3(
|
|
223
|
+
AllStates,
|
|
224
|
+
{
|
|
225
|
+
name: "card-form",
|
|
226
|
+
draw: (p) => /* @__PURE__ */ jsx3(
|
|
227
|
+
CardForm,
|
|
228
|
+
{
|
|
229
|
+
...p,
|
|
230
|
+
title: "New flow",
|
|
231
|
+
body: "Fill in what you know.",
|
|
232
|
+
fields: FIELDS,
|
|
233
|
+
values: { title: "Research" }
|
|
234
|
+
}
|
|
235
|
+
)
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
/* @__PURE__ */ jsx3(
|
|
239
|
+
AllStates,
|
|
240
|
+
{
|
|
241
|
+
name: "card-approval",
|
|
242
|
+
draw: (p) => /* @__PURE__ */ jsx3(
|
|
243
|
+
CardApproval,
|
|
244
|
+
{
|
|
245
|
+
...p,
|
|
246
|
+
title: "Write the draft",
|
|
247
|
+
summary: "The agent wants to replace the draft's text.",
|
|
248
|
+
risk: "high",
|
|
249
|
+
requestedBy: "agent",
|
|
250
|
+
changes: [
|
|
251
|
+
{ label: "Title", before: "Launch", after: "Launch notes" },
|
|
252
|
+
{ label: "Lines", before: "4", after: "7" }
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
),
|
|
258
|
+
/* @__PURE__ */ jsxs3(Section, { title: "card-notice", children: [
|
|
259
|
+
["info", "success", "warning", "error"].map((t) => /* @__PURE__ */ jsx3(Specimen, { label: `tone="${t}"`, children: /* @__PURE__ */ jsx3("div", { className: "w-full", children: /* @__PURE__ */ jsx3(
|
|
260
|
+
CardNotice,
|
|
261
|
+
{
|
|
262
|
+
title: { info: "For your information", success: "Done", warning: "Heads up", error: "It failed" }[t],
|
|
263
|
+
body: "Something happened that you should know about.",
|
|
264
|
+
tone: t,
|
|
265
|
+
detail: t === "error" ? "exit status 1" : void 0,
|
|
266
|
+
onDismiss: () => {
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
) }) }, t)),
|
|
270
|
+
/* @__PURE__ */ jsx3(Specimen, { label: "dismissed", children: /* @__PURE__ */ jsx3("div", { className: "w-full", children: /* @__PURE__ */ jsx3(CardNotice, { title: "A notice", body: "Already dismissed.", state: "canceled" }) }) })
|
|
271
|
+
] }),
|
|
272
|
+
/* @__PURE__ */ jsxs3(Section, { title: "card-progress and card-plan", children: [
|
|
273
|
+
["running", "done", "failed"].map((s) => /* @__PURE__ */ jsx3(Specimen, { label: `progress ${s}`, children: /* @__PURE__ */ jsx3("div", { className: "w-full", children: /* @__PURE__ */ jsx3(
|
|
274
|
+
CardProgress,
|
|
275
|
+
{
|
|
276
|
+
title: "Reading the site",
|
|
277
|
+
label: "pages",
|
|
278
|
+
value: s === "running" ? 4 : 10,
|
|
279
|
+
max: 10,
|
|
280
|
+
status: s,
|
|
281
|
+
detail: s === "failed" ? "The site stopped answering." : void 0
|
|
282
|
+
}
|
|
283
|
+
) }) }, s)),
|
|
284
|
+
/* @__PURE__ */ jsx3(Specimen, { label: "progress, no value", children: /* @__PURE__ */ jsx3("div", { className: "w-full", children: /* @__PURE__ */ jsx3(CardProgress, { title: "Thinking", status: "running" }) }) }),
|
|
285
|
+
/* @__PURE__ */ jsx3(Specimen, { label: "plan", wide: true, children: /* @__PURE__ */ jsx3("div", { className: "w-full", children: /* @__PURE__ */ jsx3(
|
|
286
|
+
CardPlan,
|
|
287
|
+
{
|
|
288
|
+
title: "Write the article",
|
|
289
|
+
steps: [
|
|
290
|
+
{ id: "1", title: "Read the sources", status: "done" },
|
|
291
|
+
{ id: "2", title: "Outline", status: "done" },
|
|
292
|
+
{ id: "3", title: "Draft each section", status: "active", detail: "Section 2 of 4" },
|
|
293
|
+
{ id: "4", title: "Images", status: "skipped" },
|
|
294
|
+
{ id: "5", title: "Proofread", status: "pending" }
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
) }) })
|
|
298
|
+
] }),
|
|
299
|
+
/* @__PURE__ */ jsx3(Section, { title: "card-miss", about: "What draws when no renderer can.", children: ["unknown-kind", "version-skew", "failed"].map((r) => /* @__PURE__ */ jsx3(Specimen, { label: r, children: /* @__PURE__ */ jsx3("div", { className: "w-full", children: /* @__PURE__ */ jsx3(
|
|
300
|
+
CardMiss,
|
|
301
|
+
{
|
|
302
|
+
kind: "survey",
|
|
303
|
+
version: "2",
|
|
304
|
+
reason: r,
|
|
305
|
+
title: "A survey",
|
|
306
|
+
payload: { questions: 3 },
|
|
307
|
+
detail: r === "failed" ? "TypeError: x is undefined" : void 0
|
|
308
|
+
}
|
|
309
|
+
) }) }, r)) })
|
|
310
|
+
] });
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// ../../web/src/gallery/chat.tsx
|
|
314
|
+
import { Bot } from "lucide-react";
|
|
315
|
+
import { useState as useState2 } from "react";
|
|
316
|
+
import {
|
|
317
|
+
Conversation,
|
|
318
|
+
ConversationContent,
|
|
319
|
+
ConversationEmptyState,
|
|
320
|
+
ConversationScrollButton,
|
|
321
|
+
ConversationViewport
|
|
322
|
+
} from "@/components/ui/conversation";
|
|
323
|
+
import { Markdown } from "@/components/ui/markdown";
|
|
324
|
+
import { Message, MessageContent, MessageNotice } from "@/components/ui/message";
|
|
325
|
+
import { PromptInput, PromptInputFooter, PromptInputSubmit, PromptInputTextarea } from "@/components/ui/prompt-input";
|
|
326
|
+
import { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "@/components/ui/tool";
|
|
327
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
328
|
+
var ANSWER = `Here is the layout I set up:
|
|
329
|
+
|
|
330
|
+
- **Browser** on the left, at the page you named
|
|
331
|
+
- **Drafts** on the right, in front
|
|
332
|
+
- *Scratch* below it, for loose ends
|
|
333
|
+
|
|
334
|
+
\`\`\`json
|
|
335
|
+
{ "mode": "research", "ratio": 0.6 }
|
|
336
|
+
\`\`\`
|
|
337
|
+
|
|
338
|
+
| Window | Where |
|
|
339
|
+
|---|---|
|
|
340
|
+
| Browser | left |
|
|
341
|
+
| Drafts | right |`;
|
|
342
|
+
var STREAMING = "Opening the **Drafts window and `drafts_get";
|
|
343
|
+
function Chat() {
|
|
344
|
+
const [draft, setDraft] = useState2("");
|
|
345
|
+
return /* @__PURE__ */ jsxs4(Section, { title: "Conversation", about: "A canned thread: the person, the agent with Markdown, tool rows, a notice.", children: [
|
|
346
|
+
/* @__PURE__ */ jsx4(Specimen, { label: "Conversation, Message, Markdown, Tool, MessageNotice", wide: true, children: /* @__PURE__ */ jsx4("div", { className: "h-[52rem] w-full overflow-hidden rounded-md border border-border", children: /* @__PURE__ */ jsxs4(Conversation, { className: "h-full", children: [
|
|
347
|
+
/* @__PURE__ */ jsx4(ConversationViewport, { children: /* @__PURE__ */ jsxs4(ConversationContent, { children: [
|
|
348
|
+
/* @__PURE__ */ jsx4(Message, { from: "user", children: /* @__PURE__ */ jsx4(MessageContent, { children: "Set up a research layout for the article." }) }),
|
|
349
|
+
/* @__PURE__ */ jsxs4(Tool, { children: [
|
|
350
|
+
/* @__PURE__ */ jsx4(ToolHeader, { title: "desk_arrange", status: "done" }),
|
|
351
|
+
/* @__PURE__ */ jsxs4(ToolContent, { children: [
|
|
352
|
+
/* @__PURE__ */ jsx4(ToolInput, { input: { windows: [{ view: "browser" }, { view: "drafts", focus: true }] } }),
|
|
353
|
+
/* @__PURE__ */ jsx4(ToolOutput, { output: '{"arranged": true}' })
|
|
354
|
+
] })
|
|
355
|
+
] }),
|
|
356
|
+
/* @__PURE__ */ jsxs4(Tool, { defaultOpen: true, children: [
|
|
357
|
+
/* @__PURE__ */ jsx4(ToolHeader, { title: "browser_read", status: "error" }),
|
|
358
|
+
/* @__PURE__ */ jsxs4(ToolContent, { children: [
|
|
359
|
+
/* @__PURE__ */ jsx4(ToolInput, { input: { url: "https://example.invalid/" } }),
|
|
360
|
+
/* @__PURE__ */ jsx4(ToolOutput, { output: "The site could not be reached.", error: true })
|
|
361
|
+
] })
|
|
362
|
+
] }),
|
|
363
|
+
/* @__PURE__ */ jsx4(Tool, { children: /* @__PURE__ */ jsx4(ToolHeader, { title: "drafts_get", status: "running" }) }),
|
|
364
|
+
/* @__PURE__ */ jsx4(Message, { from: "assistant", children: /* @__PURE__ */ jsx4(MessageContent, { children: /* @__PURE__ */ jsx4(Markdown, { children: ANSWER }) }) }),
|
|
365
|
+
/* @__PURE__ */ jsx4(Message, { from: "assistant", children: /* @__PURE__ */ jsx4(MessageContent, { children: /* @__PURE__ */ jsx4(Markdown, { streaming: true, children: STREAMING }) }) }),
|
|
366
|
+
/* @__PURE__ */ jsx4(MessageNotice, { children: "Stopped." }),
|
|
367
|
+
/* @__PURE__ */ jsx4(MessageNotice, { tone: "error", children: "The agent could not finish." })
|
|
368
|
+
] }) }),
|
|
369
|
+
/* @__PURE__ */ jsx4(ConversationScrollButton, {})
|
|
370
|
+
] }) }) }),
|
|
371
|
+
/* @__PURE__ */ jsx4(Specimen, { label: "ConversationEmptyState", children: /* @__PURE__ */ jsx4(
|
|
372
|
+
ConversationEmptyState,
|
|
373
|
+
{
|
|
374
|
+
icon: /* @__PURE__ */ jsx4(Bot, {}),
|
|
375
|
+
title: "Ask the agent",
|
|
376
|
+
description: "It sees the window in front and can work the desk for you."
|
|
377
|
+
}
|
|
378
|
+
) }),
|
|
379
|
+
/* @__PURE__ */ jsx4(Specimen, { label: "PromptInput: ready and streaming", children: /* @__PURE__ */ jsxs4("div", { className: "flex w-full flex-col gap-2", children: [
|
|
380
|
+
/* @__PURE__ */ jsxs4(PromptInput, { onSubmit: (e) => e.preventDefault(), children: [
|
|
381
|
+
/* @__PURE__ */ jsx4(
|
|
382
|
+
PromptInputTextarea,
|
|
383
|
+
{
|
|
384
|
+
value: draft,
|
|
385
|
+
onChange: (e) => setDraft(e.target.value),
|
|
386
|
+
placeholder: "Ask, or /open, /layout, /run",
|
|
387
|
+
"aria-label": "Message"
|
|
388
|
+
}
|
|
389
|
+
),
|
|
390
|
+
/* @__PURE__ */ jsxs4(PromptInputFooter, { children: [
|
|
391
|
+
/* @__PURE__ */ jsx4("span", { className: "text-xs text-muted-foreground", children: "Enter sends" }),
|
|
392
|
+
/* @__PURE__ */ jsx4(PromptInputSubmit, { disabled: !draft.trim() })
|
|
393
|
+
] })
|
|
394
|
+
] }),
|
|
395
|
+
/* @__PURE__ */ jsxs4(PromptInput, { onSubmit: (e) => e.preventDefault(), children: [
|
|
396
|
+
/* @__PURE__ */ jsx4(PromptInputTextarea, { placeholder: "The agent is answering", "aria-label": "Message while streaming" }),
|
|
397
|
+
/* @__PURE__ */ jsxs4(PromptInputFooter, { children: [
|
|
398
|
+
/* @__PURE__ */ jsx4("span", { className: "text-xs text-muted-foreground", children: "working\u2026" }),
|
|
399
|
+
/* @__PURE__ */ jsx4(PromptInputSubmit, { status: "streaming", onStop: () => {
|
|
400
|
+
} })
|
|
401
|
+
] })
|
|
402
|
+
] })
|
|
403
|
+
] }) })
|
|
404
|
+
] });
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// ../../web/src/gallery/controls.tsx
|
|
408
|
+
import { Bold, Italic, Mail, Plus, Search, Underline } from "lucide-react";
|
|
409
|
+
import { Badge } from "@/components/ui/badge";
|
|
410
|
+
import { Button } from "@/components/ui/button";
|
|
411
|
+
import { Checkbox } from "@/components/ui/checkbox";
|
|
412
|
+
import { Field, FieldDescription, FieldError, FieldLabel } from "@/components/ui/field";
|
|
413
|
+
import { Input } from "@/components/ui/input";
|
|
414
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "@/components/ui/input-group";
|
|
415
|
+
import { Kbd, KbdGroup } from "@/components/ui/kbd";
|
|
416
|
+
import { Label as Label2 } from "@/components/ui/label";
|
|
417
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
|
418
|
+
import { Switch as Switch2 } from "@/components/ui/switch";
|
|
419
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
420
|
+
import { TextEditor } from "@/components/ui/text-editor";
|
|
421
|
+
import { Textarea } from "@/components/ui/textarea";
|
|
422
|
+
import { Toggle } from "@/components/ui/toggle";
|
|
423
|
+
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
|
424
|
+
import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
425
|
+
var VARIANTS = ["default", "outline", "secondary", "ghost", "destructive", "link"];
|
|
426
|
+
var SIZES = ["xs", "sm", "default", "lg"];
|
|
427
|
+
var ICON_SIZES = ["icon-xs", "icon-sm", "icon", "icon-lg"];
|
|
428
|
+
var FRUIT = [
|
|
429
|
+
{ value: "apple", label: "Apple" },
|
|
430
|
+
{ value: "pear", label: "Pear" },
|
|
431
|
+
{ value: "plum", label: "Plum" }
|
|
432
|
+
];
|
|
433
|
+
function Controls() {
|
|
434
|
+
return /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
435
|
+
/* @__PURE__ */ jsxs5(Section, { title: "Button", about: "variant \xD7 size; icon sizes; disabled.", children: [
|
|
436
|
+
VARIANTS.map((v) => /* @__PURE__ */ jsxs5(Specimen, { label: `variant="${v}"`, children: [
|
|
437
|
+
SIZES.map((s) => /* @__PURE__ */ jsx5(Button, { variant: v, size: s, children: s }, s)),
|
|
438
|
+
/* @__PURE__ */ jsx5(Button, { variant: v, disabled: true, children: "disabled" })
|
|
439
|
+
] }, v)),
|
|
440
|
+
/* @__PURE__ */ jsxs5(Specimen, { label: "icon sizes, with an icon and text", children: [
|
|
441
|
+
ICON_SIZES.map((s) => /* @__PURE__ */ jsx5(Button, { variant: "outline", size: s, "aria-label": s, children: /* @__PURE__ */ jsx5(Plus, {}) }, s)),
|
|
442
|
+
/* @__PURE__ */ jsxs5(Button, { children: [
|
|
443
|
+
/* @__PURE__ */ jsx5(Mail, {}),
|
|
444
|
+
" With icon"
|
|
445
|
+
] })
|
|
446
|
+
] })
|
|
447
|
+
] }),
|
|
448
|
+
/* @__PURE__ */ jsxs5(Section, { title: "Badge and Kbd", children: [
|
|
449
|
+
/* @__PURE__ */ jsx5(Specimen, { label: "Badge variants", children: ["default", "secondary", "outline", "destructive", "ghost", "link"].map((v) => /* @__PURE__ */ jsx5(Badge, { variant: v, children: v }, v)) }),
|
|
450
|
+
/* @__PURE__ */ jsxs5(Specimen, { label: "Kbd", children: [
|
|
451
|
+
/* @__PURE__ */ jsx5(Kbd, { children: "\u2318K" }),
|
|
452
|
+
/* @__PURE__ */ jsxs5(KbdGroup, { children: [
|
|
453
|
+
/* @__PURE__ */ jsx5(Kbd, { children: "Shift" }),
|
|
454
|
+
/* @__PURE__ */ jsx5(Kbd, { children: "Enter" })
|
|
455
|
+
] })
|
|
456
|
+
] })
|
|
457
|
+
] }),
|
|
458
|
+
/* @__PURE__ */ jsxs5(Section, { title: "Text entry", children: [
|
|
459
|
+
/* @__PURE__ */ jsxs5(Specimen, { label: "Input: default, disabled, invalid", children: [
|
|
460
|
+
/* @__PURE__ */ jsx5(Input, { placeholder: "Placeholder", "aria-label": "default" }),
|
|
461
|
+
/* @__PURE__ */ jsx5(Input, { placeholder: "Disabled", disabled: true, "aria-label": "disabled" }),
|
|
462
|
+
/* @__PURE__ */ jsx5(Input, { defaultValue: "Not an email", "aria-invalid": true, "aria-label": "invalid" })
|
|
463
|
+
] }),
|
|
464
|
+
/* @__PURE__ */ jsx5(Specimen, { label: "InputGroup", children: /* @__PURE__ */ jsxs5(InputGroup, { children: [
|
|
465
|
+
/* @__PURE__ */ jsx5(InputGroupAddon, { children: /* @__PURE__ */ jsx5(Search, {}) }),
|
|
466
|
+
/* @__PURE__ */ jsx5(InputGroupInput, { placeholder: "Search", "aria-label": "Search" }),
|
|
467
|
+
/* @__PURE__ */ jsx5(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx5(InputGroupButton, { children: "Go" }) })
|
|
468
|
+
] }) }),
|
|
469
|
+
/* @__PURE__ */ jsx5(Specimen, { label: "Textarea", children: /* @__PURE__ */ jsx5(Textarea, { placeholder: "Write something", "aria-label": "Textarea" }) }),
|
|
470
|
+
/* @__PURE__ */ jsx5(Specimen, { label: "TextEditor (a document's source)", children: /* @__PURE__ */ jsx5("div", { className: "h-24 w-full rounded-md border border-border", children: /* @__PURE__ */ jsx5(TextEditor, { "aria-label": "Source", defaultValue: "# A heading\n\nSome **Markdown**, in the monospace face." }) }) }),
|
|
471
|
+
/* @__PURE__ */ jsxs5(Specimen, { label: "Field: label, description, error", wide: true, children: [
|
|
472
|
+
/* @__PURE__ */ jsxs5(Field, { children: [
|
|
473
|
+
/* @__PURE__ */ jsx5(FieldLabel, { htmlFor: "g-name", children: "Name" }),
|
|
474
|
+
/* @__PURE__ */ jsx5(Input, { id: "g-name", placeholder: "Ada" }),
|
|
475
|
+
/* @__PURE__ */ jsx5(FieldDescription, { children: "What the agent calls you." })
|
|
476
|
+
] }),
|
|
477
|
+
/* @__PURE__ */ jsxs5(Field, { "data-invalid": "true", children: [
|
|
478
|
+
/* @__PURE__ */ jsx5(FieldLabel, { htmlFor: "g-mail", children: "Email" }),
|
|
479
|
+
/* @__PURE__ */ jsx5(Input, { id: "g-mail", defaultValue: "ada@", "aria-invalid": true }),
|
|
480
|
+
/* @__PURE__ */ jsx5(FieldError, { children: "That is not a whole address." })
|
|
481
|
+
] })
|
|
482
|
+
] })
|
|
483
|
+
] }),
|
|
484
|
+
/* @__PURE__ */ jsxs5(Section, { title: "Choices", children: [
|
|
485
|
+
/* @__PURE__ */ jsxs5(Specimen, { label: "Select: default, sm, disabled", children: [
|
|
486
|
+
/* @__PURE__ */ jsxs5(Select, { defaultValue: "pear", items: FRUIT, children: [
|
|
487
|
+
/* @__PURE__ */ jsx5(SelectTrigger, { "aria-label": "Fruit", children: /* @__PURE__ */ jsx5(SelectValue, {}) }),
|
|
488
|
+
/* @__PURE__ */ jsx5(SelectContent, { children: FRUIT.map((f) => /* @__PURE__ */ jsx5(SelectItem, { value: f.value, children: f.label }, f.value)) })
|
|
489
|
+
] }),
|
|
490
|
+
/* @__PURE__ */ jsxs5(Select, { defaultValue: "plum", items: FRUIT, children: [
|
|
491
|
+
/* @__PURE__ */ jsx5(SelectTrigger, { size: "sm", "aria-label": "Fruit, small", children: /* @__PURE__ */ jsx5(SelectValue, {}) }),
|
|
492
|
+
/* @__PURE__ */ jsx5(SelectContent, { children: FRUIT.map((f) => /* @__PURE__ */ jsx5(SelectItem, { value: f.value, children: f.label }, f.value)) })
|
|
493
|
+
] }),
|
|
494
|
+
/* @__PURE__ */ jsxs5(Select, { disabled: true, items: FRUIT, children: [
|
|
495
|
+
/* @__PURE__ */ jsx5(SelectTrigger, { "aria-label": "Fruit, disabled", children: /* @__PURE__ */ jsx5(SelectValue, { placeholder: "Disabled" }) }),
|
|
496
|
+
/* @__PURE__ */ jsx5(SelectContent, {})
|
|
497
|
+
] })
|
|
498
|
+
] }),
|
|
499
|
+
/* @__PURE__ */ jsxs5(Specimen, { label: "Checkbox and Switch: off, on, disabled", children: [
|
|
500
|
+
/* @__PURE__ */ jsxs5(Label2, { className: "gap-2", children: [
|
|
501
|
+
/* @__PURE__ */ jsx5(Checkbox, {}),
|
|
502
|
+
" off"
|
|
503
|
+
] }),
|
|
504
|
+
/* @__PURE__ */ jsxs5(Label2, { className: "gap-2", children: [
|
|
505
|
+
/* @__PURE__ */ jsx5(Checkbox, { defaultChecked: true }),
|
|
506
|
+
" on"
|
|
507
|
+
] }),
|
|
508
|
+
/* @__PURE__ */ jsxs5(Label2, { className: "gap-2", children: [
|
|
509
|
+
/* @__PURE__ */ jsx5(Checkbox, { disabled: true }),
|
|
510
|
+
" disabled"
|
|
511
|
+
] }),
|
|
512
|
+
/* @__PURE__ */ jsx5(Switch2, { "aria-label": "off" }),
|
|
513
|
+
/* @__PURE__ */ jsx5(Switch2, { defaultChecked: true, "aria-label": "on" }),
|
|
514
|
+
/* @__PURE__ */ jsx5(Switch2, { disabled: true, "aria-label": "disabled" })
|
|
515
|
+
] }),
|
|
516
|
+
/* @__PURE__ */ jsxs5(Specimen, { label: "Toggle and ToggleGroup (default, outline, sm)", children: [
|
|
517
|
+
/* @__PURE__ */ jsx5(Toggle, { "aria-label": "Bold", defaultPressed: true, children: /* @__PURE__ */ jsx5(Bold, {}) }),
|
|
518
|
+
/* @__PURE__ */ jsxs5(ToggleGroup, { defaultValue: ["bold"], "aria-label": "Style", children: [
|
|
519
|
+
/* @__PURE__ */ jsx5(ToggleGroupItem, { value: "bold", "aria-label": "Bold", children: /* @__PURE__ */ jsx5(Bold, {}) }),
|
|
520
|
+
/* @__PURE__ */ jsx5(ToggleGroupItem, { value: "italic", "aria-label": "Italic", children: /* @__PURE__ */ jsx5(Italic, {}) }),
|
|
521
|
+
/* @__PURE__ */ jsx5(ToggleGroupItem, { value: "underline", "aria-label": "Underline", children: /* @__PURE__ */ jsx5(Underline, {}) })
|
|
522
|
+
] }),
|
|
523
|
+
/* @__PURE__ */ jsxs5(ToggleGroup, { variant: "outline", size: "sm", spacing: 0, defaultValue: ["review"], "aria-label": "Mode", children: [
|
|
524
|
+
/* @__PURE__ */ jsx5(ToggleGroupItem, { value: "review", children: "Review" }),
|
|
525
|
+
/* @__PURE__ */ jsx5(ToggleGroupItem, { value: "edit", children: "Edit" }),
|
|
526
|
+
/* @__PURE__ */ jsx5(ToggleGroupItem, { value: "compare", children: "Compare" })
|
|
527
|
+
] })
|
|
528
|
+
] }),
|
|
529
|
+
/* @__PURE__ */ jsxs5(Specimen, { label: "Tabs: default and line", children: [
|
|
530
|
+
/* @__PURE__ */ jsxs5(Tabs, { defaultValue: "one", children: [
|
|
531
|
+
/* @__PURE__ */ jsxs5(TabsList, { children: [
|
|
532
|
+
/* @__PURE__ */ jsx5(TabsTrigger, { value: "one", children: "One" }),
|
|
533
|
+
/* @__PURE__ */ jsx5(TabsTrigger, { value: "two", children: "Two" }),
|
|
534
|
+
/* @__PURE__ */ jsx5(TabsTrigger, { value: "three", disabled: true, children: "Three" })
|
|
535
|
+
] }),
|
|
536
|
+
/* @__PURE__ */ jsx5(TabsContent, { value: "one", className: "pt-2 text-sm text-muted-foreground", children: "The first tab's content." })
|
|
537
|
+
] }),
|
|
538
|
+
/* @__PURE__ */ jsx5(Tabs, { defaultValue: "two", children: /* @__PURE__ */ jsxs5(TabsList, { variant: "line", children: [
|
|
539
|
+
/* @__PURE__ */ jsx5(TabsTrigger, { value: "one", children: "One" }),
|
|
540
|
+
/* @__PURE__ */ jsx5(TabsTrigger, { value: "two", children: "Two" })
|
|
541
|
+
] }) })
|
|
542
|
+
] })
|
|
543
|
+
] })
|
|
544
|
+
] });
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// ../../web/src/gallery/display.tsx
|
|
548
|
+
import { ChevronRight, FileText, Folder, Inbox } from "lucide-react";
|
|
549
|
+
import { Avatar, AvatarFallback, AvatarGroup, AvatarGroupCount } from "@/components/ui/avatar";
|
|
550
|
+
import {
|
|
551
|
+
Breadcrumb,
|
|
552
|
+
BreadcrumbItem,
|
|
553
|
+
BreadcrumbLink,
|
|
554
|
+
BreadcrumbList,
|
|
555
|
+
BreadcrumbPage,
|
|
556
|
+
BreadcrumbSeparator
|
|
557
|
+
} from "@/components/ui/breadcrumb";
|
|
558
|
+
import { Button as Button2 } from "@/components/ui/button";
|
|
559
|
+
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
|
|
560
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";
|
|
561
|
+
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "@/components/ui/empty";
|
|
562
|
+
import { Item, ItemActions, ItemContent, ItemDescription, ItemMedia, ItemTitle } from "@/components/ui/item";
|
|
563
|
+
import { Progress } from "@/components/ui/progress";
|
|
564
|
+
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/components/ui/resizable";
|
|
565
|
+
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
566
|
+
import { Separator } from "@/components/ui/separator";
|
|
567
|
+
import { Skeleton } from "@/components/ui/skeleton";
|
|
568
|
+
import { Spinner } from "@/components/ui/spinner";
|
|
569
|
+
import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
|
570
|
+
import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
571
|
+
var ROWS = [
|
|
572
|
+
{ name: "notes", kind: "module", state: "running" },
|
|
573
|
+
{ name: "drafts", kind: "module", state: "running" },
|
|
574
|
+
{ name: "builder", kind: "module", state: "stopped" }
|
|
575
|
+
];
|
|
576
|
+
function Display() {
|
|
577
|
+
return /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
578
|
+
/* @__PURE__ */ jsxs6(Section, { title: "Rows", about: "Item in each variant and size; a Table.", children: [
|
|
579
|
+
["default", "outline", "muted"].map((v) => /* @__PURE__ */ jsx6(Specimen, { label: `Item variant="${v}"`, children: /* @__PURE__ */ jsxs6(Item, { variant: v, children: [
|
|
580
|
+
/* @__PURE__ */ jsx6(ItemMedia, { variant: "icon", children: /* @__PURE__ */ jsx6(FileText, {}) }),
|
|
581
|
+
/* @__PURE__ */ jsxs6(ItemContent, { children: [
|
|
582
|
+
/* @__PURE__ */ jsx6(ItemTitle, { children: "Launch notes" }),
|
|
583
|
+
/* @__PURE__ */ jsx6(ItemDescription, { children: "markdown \xB7 r2 \xB7 7 lines" })
|
|
584
|
+
] }),
|
|
585
|
+
/* @__PURE__ */ jsx6(ItemActions, { children: /* @__PURE__ */ jsx6(Button2, { variant: "ghost", size: "icon-sm", "aria-label": "Open", children: /* @__PURE__ */ jsx6(ChevronRight, {}) }) })
|
|
586
|
+
] }) }, v)),
|
|
587
|
+
/* @__PURE__ */ jsx6(Specimen, { label: 'Item size="sm" and "xs"', children: /* @__PURE__ */ jsxs6("div", { className: "flex w-full flex-col gap-1", children: [
|
|
588
|
+
/* @__PURE__ */ jsx6(Item, { size: "sm", variant: "outline", children: /* @__PURE__ */ jsx6(ItemContent, { children: /* @__PURE__ */ jsx6(ItemTitle, { children: "Small" }) }) }),
|
|
589
|
+
/* @__PURE__ */ jsx6(Item, { size: "xs", variant: "outline", children: /* @__PURE__ */ jsx6(ItemContent, { children: /* @__PURE__ */ jsx6(ItemTitle, { children: "Extra small" }) }) })
|
|
590
|
+
] }) }),
|
|
591
|
+
/* @__PURE__ */ jsx6(Specimen, { label: "Table", wide: true, children: /* @__PURE__ */ jsxs6(Table, { children: [
|
|
592
|
+
/* @__PURE__ */ jsx6(TableCaption, { children: "The modules of this app." }),
|
|
593
|
+
/* @__PURE__ */ jsx6(TableHeader, { children: /* @__PURE__ */ jsxs6(TableRow, { children: [
|
|
594
|
+
/* @__PURE__ */ jsx6(TableHead, { children: "Name" }),
|
|
595
|
+
/* @__PURE__ */ jsx6(TableHead, { children: "Kind" }),
|
|
596
|
+
/* @__PURE__ */ jsx6(TableHead, { className: "text-right", children: "State" })
|
|
597
|
+
] }) }),
|
|
598
|
+
/* @__PURE__ */ jsx6(TableBody, { children: ROWS.map((r) => /* @__PURE__ */ jsxs6(TableRow, { children: [
|
|
599
|
+
/* @__PURE__ */ jsx6(TableCell, { className: "font-medium", children: r.name }),
|
|
600
|
+
/* @__PURE__ */ jsx6(TableCell, { children: r.kind }),
|
|
601
|
+
/* @__PURE__ */ jsx6(TableCell, { className: "text-right", children: r.state })
|
|
602
|
+
] }, r.name)) })
|
|
603
|
+
] }) })
|
|
604
|
+
] }),
|
|
605
|
+
/* @__PURE__ */ jsxs6(Section, { title: "Regions", children: [
|
|
606
|
+
/* @__PURE__ */ jsxs6(Specimen, { label: "Card: default and sm", children: [
|
|
607
|
+
/* @__PURE__ */ jsxs6(Card, { className: "w-full", children: [
|
|
608
|
+
/* @__PURE__ */ jsxs6(CardHeader, { children: [
|
|
609
|
+
/* @__PURE__ */ jsx6(CardTitle, { children: "A card" }),
|
|
610
|
+
/* @__PURE__ */ jsx6(CardDescription, { children: "With a header, content and a footer." }),
|
|
611
|
+
/* @__PURE__ */ jsx6(CardAction, { children: /* @__PURE__ */ jsx6(Button2, { variant: "outline", size: "xs", children: "Action" }) })
|
|
612
|
+
] }),
|
|
613
|
+
/* @__PURE__ */ jsx6(CardContent, { className: "text-sm", children: "The body of the card." }),
|
|
614
|
+
/* @__PURE__ */ jsx6(CardFooter, { children: /* @__PURE__ */ jsx6(Button2, { size: "sm", children: "Save" }) })
|
|
615
|
+
] }),
|
|
616
|
+
/* @__PURE__ */ jsx6(Card, { size: "sm", className: "w-full", children: /* @__PURE__ */ jsxs6(CardHeader, { children: [
|
|
617
|
+
/* @__PURE__ */ jsx6(CardTitle, { children: "Small" }),
|
|
618
|
+
/* @__PURE__ */ jsx6(CardDescription, { children: 'size="sm"' })
|
|
619
|
+
] }) })
|
|
620
|
+
] }),
|
|
621
|
+
/* @__PURE__ */ jsx6(Specimen, { label: "Empty", children: /* @__PURE__ */ jsxs6(Empty, { className: "border border-dashed border-border", children: [
|
|
622
|
+
/* @__PURE__ */ jsxs6(EmptyHeader, { children: [
|
|
623
|
+
/* @__PURE__ */ jsx6(EmptyMedia, { variant: "icon", children: /* @__PURE__ */ jsx6(Inbox, {}) }),
|
|
624
|
+
/* @__PURE__ */ jsx6(EmptyTitle, { children: "Nothing here yet" }),
|
|
625
|
+
/* @__PURE__ */ jsx6(EmptyDescription, { children: "Things you add show up here." })
|
|
626
|
+
] }),
|
|
627
|
+
/* @__PURE__ */ jsx6(EmptyContent, { children: /* @__PURE__ */ jsx6(Button2, { size: "sm", children: "Add one" }) })
|
|
628
|
+
] }) }),
|
|
629
|
+
/* @__PURE__ */ jsx6(Specimen, { label: "ScrollArea", children: /* @__PURE__ */ jsx6(ScrollArea, { className: "h-28 w-full rounded-md border border-border", children: /* @__PURE__ */ jsx6("div", { className: "flex flex-col gap-1 p-2 text-sm", children: Array.from({ length: 12 }, (_, i) => `Line ${i + 1}`).map((l) => /* @__PURE__ */ jsx6("span", { children: l }, l)) }) }) }),
|
|
630
|
+
/* @__PURE__ */ jsx6(Specimen, { label: "ResizablePanelGroup", children: /* @__PURE__ */ jsx6("div", { className: "h-28 w-full rounded-md border border-border", children: /* @__PURE__ */ jsxs6(ResizablePanelGroup, { orientation: "horizontal", children: [
|
|
631
|
+
/* @__PURE__ */ jsx6(ResizablePanel, { defaultSize: "40", className: "grid place-items-center text-sm", children: "One" }),
|
|
632
|
+
/* @__PURE__ */ jsx6(ResizableHandle, { withHandle: true }),
|
|
633
|
+
/* @__PURE__ */ jsx6(ResizablePanel, { className: "grid place-items-center text-sm", children: "Two" })
|
|
634
|
+
] }) }) }),
|
|
635
|
+
/* @__PURE__ */ jsx6(Specimen, { label: "Collapsible (open)", children: /* @__PURE__ */ jsxs6(Collapsible, { defaultOpen: true, className: "w-full", children: [
|
|
636
|
+
/* @__PURE__ */ jsxs6(CollapsibleTrigger, { render: /* @__PURE__ */ jsx6(Button2, { variant: "ghost", size: "sm" }), children: [
|
|
637
|
+
/* @__PURE__ */ jsx6(Folder, {}),
|
|
638
|
+
" Details"
|
|
639
|
+
] }),
|
|
640
|
+
/* @__PURE__ */ jsx6(CollapsibleContent, { className: "px-2 pt-1 text-sm text-muted-foreground", children: "What was folded away." })
|
|
641
|
+
] }) }),
|
|
642
|
+
/* @__PURE__ */ jsxs6(Specimen, { label: "Breadcrumb and Separator", children: [
|
|
643
|
+
/* @__PURE__ */ jsx6(Breadcrumb, { children: /* @__PURE__ */ jsxs6(BreadcrumbList, { children: [
|
|
644
|
+
/* @__PURE__ */ jsx6(BreadcrumbItem, { children: /* @__PURE__ */ jsx6(BreadcrumbLink, { href: "#gallery", children: "Home" }) }),
|
|
645
|
+
/* @__PURE__ */ jsx6(BreadcrumbSeparator, {}),
|
|
646
|
+
/* @__PURE__ */ jsx6(BreadcrumbItem, { children: /* @__PURE__ */ jsx6(BreadcrumbLink, { href: "#gallery", children: "Notes" }) }),
|
|
647
|
+
/* @__PURE__ */ jsx6(BreadcrumbSeparator, {}),
|
|
648
|
+
/* @__PURE__ */ jsx6(BreadcrumbItem, { children: /* @__PURE__ */ jsx6(BreadcrumbPage, { children: "Launch" }) })
|
|
649
|
+
] }) }),
|
|
650
|
+
/* @__PURE__ */ jsx6(Separator, {})
|
|
651
|
+
] })
|
|
652
|
+
] }),
|
|
653
|
+
/* @__PURE__ */ jsxs6(Section, { title: "Status", children: [
|
|
654
|
+
/* @__PURE__ */ jsxs6(Specimen, { label: "Spinner, Skeleton, Progress", children: [
|
|
655
|
+
/* @__PURE__ */ jsx6(Spinner, {}),
|
|
656
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex w-40 flex-col gap-1.5", children: [
|
|
657
|
+
/* @__PURE__ */ jsx6(Skeleton, { className: "h-3 w-full" }),
|
|
658
|
+
/* @__PURE__ */ jsx6(Skeleton, { className: "h-3 w-2/3" })
|
|
659
|
+
] }),
|
|
660
|
+
/* @__PURE__ */ jsx6(Progress, { value: 62, className: "w-40", "aria-label": "62 percent" })
|
|
661
|
+
] }),
|
|
662
|
+
/* @__PURE__ */ jsxs6(Specimen, { label: "Avatar: sizes and a group", children: [
|
|
663
|
+
/* @__PURE__ */ jsx6(Avatar, { size: "sm", children: /* @__PURE__ */ jsx6(AvatarFallback, { children: "AL" }) }),
|
|
664
|
+
/* @__PURE__ */ jsx6(Avatar, { children: /* @__PURE__ */ jsx6(AvatarFallback, { children: "AL" }) }),
|
|
665
|
+
/* @__PURE__ */ jsx6(Avatar, { size: "lg", children: /* @__PURE__ */ jsx6(AvatarFallback, { children: "AL" }) }),
|
|
666
|
+
/* @__PURE__ */ jsxs6(AvatarGroup, { children: [
|
|
667
|
+
/* @__PURE__ */ jsx6(Avatar, { children: /* @__PURE__ */ jsx6(AvatarFallback, { children: "A" }) }),
|
|
668
|
+
/* @__PURE__ */ jsx6(Avatar, { children: /* @__PURE__ */ jsx6(AvatarFallback, { children: "B" }) }),
|
|
669
|
+
/* @__PURE__ */ jsx6(AvatarGroupCount, { children: "+3" })
|
|
670
|
+
] })
|
|
671
|
+
] })
|
|
672
|
+
] })
|
|
673
|
+
] });
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// ../../web/src/gallery/genui.tsx
|
|
677
|
+
import { GenuiSurface } from "@/components/ui/genui-surface";
|
|
678
|
+
import { Fragment as Fragment5, jsx as jsx7 } from "react/jsx-runtime";
|
|
679
|
+
var PATTERNS = [
|
|
680
|
+
{
|
|
681
|
+
name: "approval",
|
|
682
|
+
pattern: {
|
|
683
|
+
kind: "approval",
|
|
684
|
+
title: "Publish the post",
|
|
685
|
+
summary: "The agent wants to publish the draft to the blog.",
|
|
686
|
+
changes: [{ label: "Status", before: "draft", after: "published" }],
|
|
687
|
+
choices: [{ label: "Publish", risk: "high" }, { label: "Keep as draft" }]
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
name: "form",
|
|
692
|
+
pattern: {
|
|
693
|
+
kind: "form",
|
|
694
|
+
title: "New flow",
|
|
695
|
+
fields: [
|
|
696
|
+
{ key: "name", label: "Name", type: "text", required: true, help: "What to call it." },
|
|
697
|
+
{ key: "about", label: "About", type: "textarea", required: false, maxLength: 200 },
|
|
698
|
+
{ key: "steps", label: "Steps", type: "integer", required: false, min: 1, max: 9 },
|
|
699
|
+
{ key: "public", label: "Public", type: "checkbox", required: false }
|
|
700
|
+
],
|
|
701
|
+
draft: { name: "Research" },
|
|
702
|
+
submitLabel: "Create"
|
|
703
|
+
}
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
name: "list_detail",
|
|
707
|
+
pattern: {
|
|
708
|
+
kind: "list_detail",
|
|
709
|
+
title: "Open questions",
|
|
710
|
+
items: [
|
|
711
|
+
{ id: "a", title: "Which theme is the baseline?", summary: "Design" },
|
|
712
|
+
{ id: "b", title: "Where does the registry live?", summary: "Settled" }
|
|
713
|
+
],
|
|
714
|
+
selectedId: "a",
|
|
715
|
+
detail: { title: "Which theme is the baseline?", body: "Decided after the plumbing, not before." }
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
];
|
|
719
|
+
var PHASES = [
|
|
720
|
+
{ phase: "ready" },
|
|
721
|
+
{ phase: "busy" },
|
|
722
|
+
{ phase: "pending", message: "Waiting for the host." },
|
|
723
|
+
{ phase: "confirmation", confirmation: "This publishes the post. Go on?" },
|
|
724
|
+
{ phase: "unknown", message: "It may or may not have happened. Check before trying again." },
|
|
725
|
+
{ phase: "terminal", status: "accepted" },
|
|
726
|
+
{ phase: "terminal", status: "refused", message: "Not allowed here." },
|
|
727
|
+
{ phase: "stale" }
|
|
728
|
+
];
|
|
729
|
+
function Genui() {
|
|
730
|
+
return /* @__PURE__ */ jsx7(Fragment5, { children: PATTERNS.map(({ name, pattern }) => /* @__PURE__ */ jsx7(Section, { title: `genui-surface: ${name}`, children: PHASES.map((p) => /* @__PURE__ */ jsx7(Specimen, { label: p.status ? `${p.phase} \xB7 ${p.status}` : p.phase, children: /* @__PURE__ */ jsx7("div", { className: "w-full", children: /* @__PURE__ */ jsx7(
|
|
731
|
+
GenuiSurface,
|
|
732
|
+
{
|
|
733
|
+
pattern,
|
|
734
|
+
phase: p.phase,
|
|
735
|
+
status: p.status,
|
|
736
|
+
message: p.message,
|
|
737
|
+
confirmation: p.confirmation,
|
|
738
|
+
canConfirm: p.phase === "confirmation",
|
|
739
|
+
onChoose: () => {
|
|
740
|
+
},
|
|
741
|
+
onConfirm: () => {
|
|
742
|
+
},
|
|
743
|
+
onCheck: () => {
|
|
744
|
+
},
|
|
745
|
+
onSelect: () => {
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
) }) }, `${p.phase}:${p.status ?? ""}`)) }, name)) });
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
// ../../web/src/gallery/overlays.tsx
|
|
752
|
+
import { Copy, Settings, Trash2 } from "lucide-react";
|
|
753
|
+
import {
|
|
754
|
+
AlertDialog,
|
|
755
|
+
AlertDialogAction,
|
|
756
|
+
AlertDialogCancel,
|
|
757
|
+
AlertDialogContent,
|
|
758
|
+
AlertDialogDescription,
|
|
759
|
+
AlertDialogFooter,
|
|
760
|
+
AlertDialogHeader,
|
|
761
|
+
AlertDialogTitle,
|
|
762
|
+
AlertDialogTrigger
|
|
763
|
+
} from "@/components/ui/alert-dialog";
|
|
764
|
+
import { Button as Button3 } from "@/components/ui/button";
|
|
765
|
+
import {
|
|
766
|
+
Command,
|
|
767
|
+
CommandEmpty,
|
|
768
|
+
CommandGroup,
|
|
769
|
+
CommandInput,
|
|
770
|
+
CommandItem,
|
|
771
|
+
CommandList,
|
|
772
|
+
CommandShortcut
|
|
773
|
+
} from "@/components/ui/command";
|
|
774
|
+
import {
|
|
775
|
+
ContextMenu,
|
|
776
|
+
ContextMenuContent,
|
|
777
|
+
ContextMenuItem,
|
|
778
|
+
ContextMenuShortcut,
|
|
779
|
+
ContextMenuTrigger
|
|
780
|
+
} from "@/components/ui/context-menu";
|
|
781
|
+
import {
|
|
782
|
+
Dialog,
|
|
783
|
+
DialogClose,
|
|
784
|
+
DialogContent,
|
|
785
|
+
DialogDescription,
|
|
786
|
+
DialogFooter,
|
|
787
|
+
DialogHeader,
|
|
788
|
+
DialogTitle,
|
|
789
|
+
DialogTrigger
|
|
790
|
+
} from "@/components/ui/dialog";
|
|
791
|
+
import {
|
|
792
|
+
DropdownMenu,
|
|
793
|
+
DropdownMenuContent,
|
|
794
|
+
DropdownMenuItem,
|
|
795
|
+
DropdownMenuLabel,
|
|
796
|
+
DropdownMenuSeparator,
|
|
797
|
+
DropdownMenuShortcut,
|
|
798
|
+
DropdownMenuTrigger
|
|
799
|
+
} from "@/components/ui/dropdown-menu";
|
|
800
|
+
import {
|
|
801
|
+
Popover,
|
|
802
|
+
PopoverContent,
|
|
803
|
+
PopoverDescription,
|
|
804
|
+
PopoverHeader,
|
|
805
|
+
PopoverTitle,
|
|
806
|
+
PopoverTrigger
|
|
807
|
+
} from "@/components/ui/popover";
|
|
808
|
+
import {
|
|
809
|
+
Sheet,
|
|
810
|
+
SheetContent,
|
|
811
|
+
SheetDescription,
|
|
812
|
+
SheetFooter,
|
|
813
|
+
SheetHeader,
|
|
814
|
+
SheetTitle,
|
|
815
|
+
SheetTrigger
|
|
816
|
+
} from "@/components/ui/sheet";
|
|
817
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
|
818
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
819
|
+
function Overlays() {
|
|
820
|
+
return /* @__PURE__ */ jsxs7(Section, { title: "Over the page", about: "Open each from its trigger. Command is shown inline as well.", children: [
|
|
821
|
+
/* @__PURE__ */ jsxs7(Specimen, { label: "Dialog and AlertDialog", children: [
|
|
822
|
+
/* @__PURE__ */ jsxs7(Dialog, { children: [
|
|
823
|
+
/* @__PURE__ */ jsx8(DialogTrigger, { render: /* @__PURE__ */ jsx8(Button3, { variant: "outline", children: "Open dialog" }) }),
|
|
824
|
+
/* @__PURE__ */ jsxs7(DialogContent, { children: [
|
|
825
|
+
/* @__PURE__ */ jsxs7(DialogHeader, { children: [
|
|
826
|
+
/* @__PURE__ */ jsx8(DialogTitle, { children: "A dialog" }),
|
|
827
|
+
/* @__PURE__ */ jsx8(DialogDescription, { children: "Something to read or fill in before going on." })
|
|
828
|
+
] }),
|
|
829
|
+
/* @__PURE__ */ jsxs7(DialogFooter, { children: [
|
|
830
|
+
/* @__PURE__ */ jsx8(DialogClose, { render: /* @__PURE__ */ jsx8(Button3, { variant: "outline", children: "Cancel" }) }),
|
|
831
|
+
/* @__PURE__ */ jsx8(Button3, { children: "Save" })
|
|
832
|
+
] })
|
|
833
|
+
] })
|
|
834
|
+
] }),
|
|
835
|
+
/* @__PURE__ */ jsxs7(AlertDialog, { children: [
|
|
836
|
+
/* @__PURE__ */ jsx8(AlertDialogTrigger, { render: /* @__PURE__ */ jsx8(Button3, { variant: "destructive", children: "Delete\u2026" }) }),
|
|
837
|
+
/* @__PURE__ */ jsxs7(AlertDialogContent, { children: [
|
|
838
|
+
/* @__PURE__ */ jsxs7(AlertDialogHeader, { children: [
|
|
839
|
+
/* @__PURE__ */ jsx8(AlertDialogTitle, { children: "Delete the draft?" }),
|
|
840
|
+
/* @__PURE__ */ jsx8(AlertDialogDescription, { children: "Its revisions go too. This cannot be undone." })
|
|
841
|
+
] }),
|
|
842
|
+
/* @__PURE__ */ jsxs7(AlertDialogFooter, { children: [
|
|
843
|
+
/* @__PURE__ */ jsx8(AlertDialogCancel, { children: "Cancel" }),
|
|
844
|
+
/* @__PURE__ */ jsx8(AlertDialogAction, { children: "Delete" })
|
|
845
|
+
] })
|
|
846
|
+
] })
|
|
847
|
+
] })
|
|
848
|
+
] }),
|
|
849
|
+
/* @__PURE__ */ jsxs7(Specimen, { label: "Sheet, Popover, Tooltip", children: [
|
|
850
|
+
/* @__PURE__ */ jsxs7(Sheet, { children: [
|
|
851
|
+
/* @__PURE__ */ jsx8(SheetTrigger, { render: /* @__PURE__ */ jsx8(Button3, { variant: "outline", children: "Open sheet" }) }),
|
|
852
|
+
/* @__PURE__ */ jsxs7(SheetContent, { children: [
|
|
853
|
+
/* @__PURE__ */ jsxs7(SheetHeader, { children: [
|
|
854
|
+
/* @__PURE__ */ jsx8(SheetTitle, { children: "A sheet" }),
|
|
855
|
+
/* @__PURE__ */ jsx8(SheetDescription, { children: "A panel from the edge of the screen." })
|
|
856
|
+
] }),
|
|
857
|
+
/* @__PURE__ */ jsx8(SheetFooter, { children: /* @__PURE__ */ jsx8(Button3, { children: "Done" }) })
|
|
858
|
+
] })
|
|
859
|
+
] }),
|
|
860
|
+
/* @__PURE__ */ jsxs7(Popover, { children: [
|
|
861
|
+
/* @__PURE__ */ jsx8(PopoverTrigger, { render: /* @__PURE__ */ jsx8(Button3, { variant: "outline", children: "Open popover" }) }),
|
|
862
|
+
/* @__PURE__ */ jsx8(PopoverContent, { children: /* @__PURE__ */ jsxs7(PopoverHeader, { children: [
|
|
863
|
+
/* @__PURE__ */ jsx8(PopoverTitle, { children: "A popover" }),
|
|
864
|
+
/* @__PURE__ */ jsx8(PopoverDescription, { children: "A little more, next to what it is about." })
|
|
865
|
+
] }) })
|
|
866
|
+
] }),
|
|
867
|
+
/* @__PURE__ */ jsxs7(Tooltip, { children: [
|
|
868
|
+
/* @__PURE__ */ jsx8(TooltipTrigger, { render: /* @__PURE__ */ jsx8(Button3, { variant: "ghost", size: "icon", "aria-label": "Settings" }), children: /* @__PURE__ */ jsx8(Settings, {}) }),
|
|
869
|
+
/* @__PURE__ */ jsx8(TooltipContent, { children: "Settings" })
|
|
870
|
+
] })
|
|
871
|
+
] }),
|
|
872
|
+
/* @__PURE__ */ jsxs7(Specimen, { label: "DropdownMenu and ContextMenu", children: [
|
|
873
|
+
/* @__PURE__ */ jsxs7(DropdownMenu, { children: [
|
|
874
|
+
/* @__PURE__ */ jsx8(DropdownMenuTrigger, { render: /* @__PURE__ */ jsx8(Button3, { variant: "outline", children: "Open menu" }) }),
|
|
875
|
+
/* @__PURE__ */ jsxs7(DropdownMenuContent, { children: [
|
|
876
|
+
/* @__PURE__ */ jsx8(DropdownMenuLabel, { children: "Draft" }),
|
|
877
|
+
/* @__PURE__ */ jsxs7(DropdownMenuItem, { children: [
|
|
878
|
+
/* @__PURE__ */ jsx8(Copy, {}),
|
|
879
|
+
" Duplicate ",
|
|
880
|
+
/* @__PURE__ */ jsx8(DropdownMenuShortcut, { children: "\u2318D" })
|
|
881
|
+
] }),
|
|
882
|
+
/* @__PURE__ */ jsx8(DropdownMenuSeparator, {}),
|
|
883
|
+
/* @__PURE__ */ jsxs7(DropdownMenuItem, { variant: "destructive", children: [
|
|
884
|
+
/* @__PURE__ */ jsx8(Trash2, {}),
|
|
885
|
+
" Delete"
|
|
886
|
+
] })
|
|
887
|
+
] })
|
|
888
|
+
] }),
|
|
889
|
+
/* @__PURE__ */ jsxs7(ContextMenu, { children: [
|
|
890
|
+
/* @__PURE__ */ jsx8(ContextMenuTrigger, { className: "grid h-16 w-48 place-items-center rounded-md border border-dashed border-border text-xs text-muted-foreground", children: "Right-click here" }),
|
|
891
|
+
/* @__PURE__ */ jsxs7(ContextMenuContent, { children: [
|
|
892
|
+
/* @__PURE__ */ jsxs7(ContextMenuItem, { children: [
|
|
893
|
+
"Copy ",
|
|
894
|
+
/* @__PURE__ */ jsx8(ContextMenuShortcut, { children: "\u2318C" })
|
|
895
|
+
] }),
|
|
896
|
+
/* @__PURE__ */ jsx8(ContextMenuItem, { children: "Rename" })
|
|
897
|
+
] })
|
|
898
|
+
] })
|
|
899
|
+
] }),
|
|
900
|
+
/* @__PURE__ */ jsx8(Specimen, { label: "Command (inline)", children: /* @__PURE__ */ jsxs7(Command, { className: "w-full rounded-lg border border-border", children: [
|
|
901
|
+
/* @__PURE__ */ jsx8(CommandInput, { placeholder: "Run a command\u2026" }),
|
|
902
|
+
/* @__PURE__ */ jsxs7(CommandList, { children: [
|
|
903
|
+
/* @__PURE__ */ jsx8(CommandEmpty, { children: "Nothing matches." }),
|
|
904
|
+
/* @__PURE__ */ jsxs7(CommandGroup, { heading: "Desk", children: [
|
|
905
|
+
/* @__PURE__ */ jsxs7(CommandItem, { children: [
|
|
906
|
+
"Open Notes ",
|
|
907
|
+
/* @__PURE__ */ jsx8(CommandShortcut, { children: "\u2318N" })
|
|
908
|
+
] }),
|
|
909
|
+
/* @__PURE__ */ jsx8(CommandItem, { children: "Tile every window" }),
|
|
910
|
+
/* @__PURE__ */ jsx8(CommandItem, { children: "Show the agent" })
|
|
911
|
+
] })
|
|
912
|
+
] })
|
|
913
|
+
] }) })
|
|
914
|
+
] });
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
// ../../web/src/gallery/windows.tsx
|
|
918
|
+
import { FileText as FileText2, Globe, StickyNote } from "lucide-react";
|
|
919
|
+
import { useState as useState3 } from "react";
|
|
920
|
+
import { WindowManager } from "@/components/ui/window-manager";
|
|
921
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
922
|
+
var START = {
|
|
923
|
+
root: {
|
|
924
|
+
type: "row",
|
|
925
|
+
children: [
|
|
926
|
+
{ type: "stack", id: "left", weight: 60, wins: ["draft", "notes"], selected: 0 },
|
|
927
|
+
{ type: "stack", id: "right", weight: 40, wins: ["browser"] }
|
|
928
|
+
]
|
|
929
|
+
},
|
|
930
|
+
floats: [
|
|
931
|
+
{
|
|
932
|
+
id: "f",
|
|
933
|
+
rect: { x: 40, y: 150, w: 220, h: 110 },
|
|
934
|
+
root: { type: "row", children: [{ type: "stack", wins: ["scratch"] }] }
|
|
935
|
+
}
|
|
936
|
+
]
|
|
937
|
+
};
|
|
938
|
+
var WINDOWS = [
|
|
939
|
+
{ id: "draft", title: "Launch notes", icon: /* @__PURE__ */ jsx9(FileText2, { className: "size-3.5" }), dirty: true },
|
|
940
|
+
{ id: "notes", title: "Notes", icon: /* @__PURE__ */ jsx9(StickyNote, { className: "size-3.5" }) },
|
|
941
|
+
{ id: "browser", title: "Example Domain", icon: /* @__PURE__ */ jsx9(Globe, { className: "size-3.5" }) },
|
|
942
|
+
{ id: "scratch", title: "Scratch", icon: /* @__PURE__ */ jsx9(StickyNote, { className: "size-3.5" }) }
|
|
943
|
+
];
|
|
944
|
+
function Windows() {
|
|
945
|
+
const [tree, setTree] = useState3(START);
|
|
946
|
+
const [focus, setFocus] = useState3("draft");
|
|
947
|
+
return /* @__PURE__ */ jsx9(
|
|
948
|
+
Section,
|
|
949
|
+
{
|
|
950
|
+
title: "window-manager",
|
|
951
|
+
about: "Drag a tab to move, split, tab or float a window. The tree is local to this window.",
|
|
952
|
+
children: /* @__PURE__ */ jsx9(Specimen, { label: "two stacks and a float", wide: true, children: /* @__PURE__ */ jsx9(
|
|
953
|
+
"div",
|
|
954
|
+
{
|
|
955
|
+
className: "relative h-80 w-full overflow-hidden rounded-md border border-border bg-muted/40",
|
|
956
|
+
style: { "--window-gap": "6px" },
|
|
957
|
+
children: /* @__PURE__ */ jsx9(
|
|
958
|
+
WindowManager,
|
|
959
|
+
{
|
|
960
|
+
tree,
|
|
961
|
+
windows: WINDOWS,
|
|
962
|
+
focus,
|
|
963
|
+
onArrange: (t, f) => {
|
|
964
|
+
setTree(t);
|
|
965
|
+
setFocus(f);
|
|
966
|
+
},
|
|
967
|
+
onClose: () => {
|
|
968
|
+
},
|
|
969
|
+
children: (id) => /* @__PURE__ */ jsxs8("div", { className: "p-3 text-xs text-muted-foreground", children: [
|
|
970
|
+
"The body of \u201C",
|
|
971
|
+
WINDOWS.find((w) => w.id === id)?.title,
|
|
972
|
+
"\u201D."
|
|
973
|
+
] })
|
|
974
|
+
}
|
|
975
|
+
)
|
|
976
|
+
}
|
|
977
|
+
) })
|
|
978
|
+
}
|
|
979
|
+
);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
// ../../web/src/gallery/Gallery.tsx
|
|
983
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
984
|
+
var SECTIONS = [
|
|
985
|
+
{ id: "controls", title: "Controls", draw: Controls },
|
|
986
|
+
{ id: "display", title: "Display", draw: Display },
|
|
987
|
+
{ id: "overlays", title: "Overlays", draw: Overlays },
|
|
988
|
+
{ id: "chat", title: "Chat", draw: Chat },
|
|
989
|
+
{ id: "cards", title: "Cards", draw: Cards },
|
|
990
|
+
{ id: "genui", title: "GenUI", draw: Genui },
|
|
991
|
+
{ id: "ade", title: "ADE", draw: Ade },
|
|
992
|
+
{ id: "windows", title: "Windows", draw: Windows }
|
|
993
|
+
];
|
|
994
|
+
function Gallery({ win }) {
|
|
995
|
+
const first = typeof win.args.section === "string" ? win.args.section : "controls";
|
|
996
|
+
const [section, setSection] = useState4(first);
|
|
997
|
+
return /* @__PURE__ */ jsxs9(
|
|
998
|
+
Tabs2,
|
|
999
|
+
{
|
|
1000
|
+
value: section,
|
|
1001
|
+
onValueChange: (v) => setSection(String(v)),
|
|
1002
|
+
className: "@container flex h-full min-h-0 flex-col",
|
|
1003
|
+
children: [
|
|
1004
|
+
/* @__PURE__ */ jsx10("div", { className: "shrink-0 border-b border-border px-3 py-2", children: /* @__PURE__ */ jsx10(TabsList2, { variant: "line", className: "flex-wrap", children: SECTIONS.map((s) => /* @__PURE__ */ jsx10(TabsTrigger2, { value: s.id, "data-gallery-tab": s.id, children: s.title }, s.id)) }) }),
|
|
1005
|
+
/* @__PURE__ */ jsx10("div", { className: "min-h-0 flex-1 overflow-auto bg-muted/30", children: SECTIONS.map((s) => /* @__PURE__ */ jsx10(TabsContent2, { value: s.id, "data-gallery-section": s.id, className: "flex flex-col gap-6 p-4", children: /* @__PURE__ */ jsx10(s.draw, {}) }, s.id)) })
|
|
1006
|
+
]
|
|
1007
|
+
}
|
|
1008
|
+
);
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
// ../../web/src/gallery/index.ts
|
|
1012
|
+
var galleryViews = { "surface/gallery": Gallery };
|
|
1013
|
+
export {
|
|
1014
|
+
Gallery,
|
|
1015
|
+
galleryViews
|
|
1016
|
+
};
|