create-theokit 1.23.1 → 1.23.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/package.json
CHANGED
|
@@ -115,6 +115,10 @@ function ProgressDemo({
|
|
|
115
115
|
/**
|
|
116
116
|
* Renders the demo surface for a non-`chat` `mode`, IN PLACE OF the composer. Each interactive demo
|
|
117
117
|
* completes back to chat via `onComplete` and reports its outcome via `onToast`.
|
|
118
|
+
*
|
|
119
|
+
* The friendly look is the Claude-Code trick: the surface sits in a rounded box with padding, so the GROUP
|
|
120
|
+
* breathes (like the welcome banner) while the menu items inside stay tight — Claude Code doesn't space menu
|
|
121
|
+
* rows either; the box + padding is what makes it feel airy. Restyle the border/padding here to taste.
|
|
118
122
|
*/
|
|
119
123
|
export function DemoSurface({
|
|
120
124
|
mode,
|
|
@@ -129,53 +133,61 @@ export function DemoSurface({
|
|
|
129
133
|
onComplete: () => void
|
|
130
134
|
onToast: (t: ToastPayload) => void
|
|
131
135
|
}): ReactElement {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
136
|
+
const body = ((): ReactElement => {
|
|
137
|
+
switch (mode) {
|
|
138
|
+
case 'plan':
|
|
139
|
+
return (
|
|
140
|
+
<PlanApproval
|
|
141
|
+
plan={DEMO_PLAN}
|
|
142
|
+
onDecision={(d) => {
|
|
143
|
+
onComplete()
|
|
144
|
+
onToast({
|
|
145
|
+
message:
|
|
146
|
+
d.kind === 'approve'
|
|
147
|
+
? 'Plan approved'
|
|
148
|
+
: `Revision requested${d.feedback ? `: ${d.feedback}` : ''}`,
|
|
149
|
+
variant: 'success',
|
|
150
|
+
})
|
|
151
|
+
}}
|
|
152
|
+
/>
|
|
153
|
+
)
|
|
154
|
+
case 'ask':
|
|
155
|
+
return (
|
|
156
|
+
<QuestionPrompt
|
|
157
|
+
header="Backend"
|
|
158
|
+
question="Which backend should the app ship next to?"
|
|
159
|
+
options={DEMO_ASK_OPTIONS}
|
|
160
|
+
allowFreeText
|
|
161
|
+
onAnswer={(a) => {
|
|
162
|
+
onComplete()
|
|
163
|
+
onToast({
|
|
164
|
+
message: `Answered: ${a.values.join(', ')}${a.text ? ` (${a.text})` : ''}`,
|
|
165
|
+
variant: 'info',
|
|
166
|
+
})
|
|
167
|
+
}}
|
|
168
|
+
/>
|
|
169
|
+
)
|
|
170
|
+
case 'select':
|
|
171
|
+
return (
|
|
172
|
+
<SelectList
|
|
173
|
+
items={DEMO_SELECT_ITEMS}
|
|
174
|
+
multi
|
|
175
|
+
onSubmit={(values) => {
|
|
176
|
+
onComplete()
|
|
177
|
+
onToast({ message: `Selected: ${values.join(', ') || '(none)'}`, variant: 'info' })
|
|
178
|
+
}}
|
|
179
|
+
/>
|
|
180
|
+
)
|
|
181
|
+
case 'progress':
|
|
182
|
+
return (
|
|
183
|
+
<ProgressDemo elapsed={elapsed} tokens={tokens} onComplete={onComplete} onToast={onToast} />
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
})()
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<Box flexDirection="column" borderStyle="round" paddingX={2} paddingY={1}>
|
|
190
|
+
{body}
|
|
191
|
+
</Box>
|
|
192
|
+
)
|
|
181
193
|
}
|