Skip to content

Commit df7730d

Browse files
committed
docs: implement wizard TODOs — per-item colors and inline doc links
- Give each option its own tinted icon badge via a static color map, and restore a check mark for the selected state (the badge no longer carries it). - Render the recommended-docs list as inline NuxtLink rows instead of UPageList/UPageCard. - Realign the recommendation map with the reworked sections: map the moved 'agent' item, broaden the merged 'specific framework' option, and drop the now-dead keys.
1 parent 1e017ff commit df7730d

1 file changed

Lines changed: 69 additions & 41 deletions

File tree

docs/app/components/global/GettingStartedWizard.vue

Lines changed: 69 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,32 @@ interface WizardItem {
1414
value: string
1515
label: string
1616
icon: string
17+
/** Accent color key from `ICON_COLORS`, giving each item its own tinted badge. */
18+
color: keyof typeof ICON_COLORS
1719
description?: string
1820
}
1921
22+
/**
23+
* Per-item icon badge colors. Spelled out as full class strings (not
24+
* interpolated) so Tailwind's scanner keeps them in the build.
25+
*/
26+
const ICON_COLORS = {
27+
sky: 'bg-sky-500/10 text-sky-500',
28+
indigo: 'bg-indigo-500/10 text-indigo-500',
29+
violet: 'bg-violet-500/10 text-violet-500',
30+
purple: 'bg-purple-500/10 text-purple-500',
31+
fuchsia: 'bg-fuchsia-500/10 text-fuchsia-500',
32+
pink: 'bg-pink-500/10 text-pink-500',
33+
rose: 'bg-rose-500/10 text-rose-500',
34+
amber: 'bg-amber-500/10 text-amber-500',
35+
orange: 'bg-orange-500/10 text-orange-500',
36+
emerald: 'bg-emerald-500/10 text-emerald-500',
37+
teal: 'bg-teal-500/10 text-teal-500',
38+
cyan: 'bg-cyan-500/10 text-cyan-500',
39+
blue: 'bg-blue-500/10 text-blue-500',
40+
green: 'bg-green-500/10 text-green-500',
41+
} as const
42+
2043
interface WizardSection {
2144
key: string
2245
title: string
@@ -38,51 +61,51 @@ const sections: WizardSection[] = [
3861
title: 'Target environments',
3962
hint: 'What do you expect your tool to work with?',
4063
items: [
41-
{ value: 'standalone', label: 'Standalone', icon: 'i-lucide-terminal', description: 'A CLI or dev server with no host framework' },
42-
{ value: 'framework', label: 'Specific framework', icon: 'i-lucide-shapes', description: 'Specifically for frameworks like Vite, Next.js, Nuxt, etc.' },
43-
{ value: 'all', label: 'All frameworks', icon: 'i-lucide-infinity', description: 'I want to support as many frameworks as possible' },
64+
{ value: 'standalone', label: 'Standalone', icon: 'i-lucide-terminal', color: 'sky', description: 'A CLI or dev server with no host framework' },
65+
{ value: 'framework', label: 'Specific framework', icon: 'i-lucide-shapes', color: 'violet', description: 'Specifically for frameworks like Vite, Next.js, Nuxt, etc.' },
66+
{ value: 'all', label: 'All frameworks', icon: 'i-lucide-infinity', color: 'emerald', description: 'I want to support as many frameworks as possible' },
4467
],
4568
},
4669
{
4770
key: 'dataSource',
4871
title: 'Data source',
4972
hint: 'Where do you want to visualize data from?',
5073
items: [
51-
{ value: 'node', label: 'The node side', icon: 'i-lucide-server', description: 'Server state, build output, the filesystem, child processes' },
52-
{ value: 'browser', label: 'The user\'s web app', icon: 'i-lucide-app-window', description: 'State living in the page you\'re developing' },
74+
{ value: 'node', label: 'The node side', icon: 'i-lucide-server', color: 'indigo', description: 'Server state, build output, the filesystem, child processes' },
75+
{ value: 'browser', label: 'The user\'s web app', icon: 'i-lucide-app-window', color: 'cyan', description: 'State living in the page you\'re developing' },
5376
],
5477
},
5578
{
5679
key: 'availability',
5780
title: 'Data availability',
5881
hint: 'When is the data available?',
5982
items: [
60-
{ value: 'dev', label: 'Development time', icon: 'i-lucide-code', description: 'Live, over a running dev server' },
61-
{ value: 'build', label: 'Production build time', icon: 'i-lucide-hammer', description: 'Data from the production build' },
62-
{ value: 'static', label: 'Statically available', icon: 'i-lucide-hard-drive', description: 'Local filesystem, uploaded files, etc.' },
63-
{ value: 'remote', label: 'Remotely', icon: 'i-lucide-cloud', description: 'Over the web' },
83+
{ value: 'dev', label: 'Development time', icon: 'i-lucide-code', color: 'blue', description: 'Live, over a running dev server' },
84+
{ value: 'build', label: 'Production build time', icon: 'i-lucide-hammer', color: 'amber', description: 'Data from the production build' },
85+
{ value: 'static', label: 'Statically available', icon: 'i-lucide-hard-drive', color: 'teal', description: 'Local filesystem, uploaded files, etc.' },
86+
{ value: 'remote', label: 'Remotely', icon: 'i-lucide-cloud', color: 'sky', description: 'Over the web' },
6487
],
6588
},
6689
{
6790
key: 'frontend',
6891
title: 'Frontend approach',
6992
hint: 'How do you want to build the frontend view?',
7093
items: [
71-
{ value: 'framework', label: 'A preferred framework', icon: 'i-lucide-component', description: 'Vue, React, Svelte, Solid...' },
72-
{ value: 'webcomponents', label: 'Web Components', icon: 'i-lucide-box', description: 'Use Web Components for renderering' },
73-
{ value: 'nodeside', label: 'Build it on the node side', icon: 'i-lucide-braces', description: 'Describe the UI as data instead of shipping a bundle' },
94+
{ value: 'framework', label: 'A preferred framework', icon: 'i-lucide-component', color: 'green', description: 'Vue, React, Svelte, Solid...' },
95+
{ value: 'webcomponents', label: 'Web Components', icon: 'i-lucide-box', color: 'orange', description: 'Use Web Components for renderering' },
96+
{ value: 'nodeside', label: 'Build it on the node side', icon: 'i-lucide-braces', color: 'purple', description: 'Describe the UI as data instead of shipping a bundle' },
7497
],
7598
},
7699
{
77100
key: 'requirements',
78101
title: 'Other requirements',
79102
hint: 'Any specific requirements?',
80103
items: [
81-
{ value: 'agent', label: 'Exposed to coding agents', icon: 'i-lucide-bot', description: 'Some functionality should be available to coding agents.' },
82-
{ value: 'terminal', label: 'Sub process access', icon: 'i-lucide-square-terminal', description: 'Need to spawn other child process from the node side' },
83-
{ value: 'streaming', label: 'Streaming data', icon: 'i-lucide-radio', description: 'Push chunk-style data from the node side to the browser side' },
84-
{ value: 'deep-linking', label: 'Deep linking', icon: 'i-lucide-link', description: 'Shareable URLs into a specific view' },
85-
{ value: 'overlay', label: 'User app overlay', icon: 'i-lucide-layers', description: 'I want to overlay a UI on top of the user\'s web app' },
104+
{ value: 'agent', label: 'Exposed to coding agents', icon: 'i-lucide-bot', color: 'pink', description: 'Some functionality should be available to coding agents.' },
105+
{ value: 'terminal', label: 'Sub process access', icon: 'i-lucide-square-terminal', color: 'amber', description: 'Need to spawn other child process from the node side' },
106+
{ value: 'streaming', label: 'Streaming data', icon: 'i-lucide-radio', color: 'rose', description: 'Push chunk-style data from the node side to the browser side' },
107+
{ value: 'deep-linking', label: 'Deep linking', icon: 'i-lucide-link', color: 'cyan', description: 'Shareable URLs into a specific view' },
108+
{ value: 'overlay', label: 'User app overlay', icon: 'i-lucide-layers', color: 'fuchsia', description: 'I want to overlay a UI on top of the user\'s web app' },
86109
],
87110
},
88111
]
@@ -135,9 +158,7 @@ const RECOMMENDATIONS: Record<string, string[]> = {
135158
'dataSource:browser': ['/guide/client-context', '/guide/deep-linking', '/plugins/a11y'],
136159
137160
'environments:standalone': ['/guide/standalone-cli', '/adapters/cac', '/adapters/build'],
138-
'environments:vite': ['/frameworks/vite', '/adapters/vite'],
139-
'environments:next': ['/frameworks/next'],
140-
'environments:framework': ['/frameworks/nuxt', '/adapters/embedded'],
161+
'environments:framework': ['/frameworks/vite', '/frameworks/next', '/frameworks/nuxt', '/adapters/vite', '/adapters/embedded'],
141162
'environments:all': ['/adapters/initiate', '/adapters', '/guide/devframe-definition'],
142163
143164
'availability:dev': ['/guide/rpc', '/guide/transports'],
@@ -149,14 +170,11 @@ const RECOMMENDATIONS: Record<string, string[]> = {
149170
'frontend:webcomponents': ['/guide/hub', '/guide/build-your-own-hub-ui'],
150171
'frontend:nodeside': ['/guide/json-render', '/guide/build-your-own-json-render-frontend'],
151172
152-
'agent:agent': ['/guide/agent-native', '/adapters/mcp'],
153-
173+
'requirements:agent': ['/guide/agent-native', '/adapters/mcp'],
174+
'requirements:terminal': ['/plugins/terminals'],
154175
'requirements:streaming': ['/guide/streaming'],
155-
'requirements:overlay': ['/guide/client-context', '/plugins/a11y'],
156-
'requirements:hub': ['/guide/hub', '/guide/hub-initiate', '/guide/services'],
157-
'requirements:security': ['/guide/security', '/helpers/interactive-auth'],
158176
'requirements:deep-linking': ['/guide/deep-linking'],
159-
'requirements:terminal': ['/plugins/terminals'],
177+
'requirements:overlay': ['/guide/client-context', '/plugins/a11y'],
160178
}
161179
162180
const selections = reactive<Record<string, string[]>>(
@@ -261,7 +279,6 @@ function reset(): void {
261279
</div>
262280

263281
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2.5">
264-
<!-- Add colors for different items -->
265282
<button
266283
v-for="item in section.items"
267284
:key="item.value"
@@ -275,8 +292,8 @@ function reset(): void {
275292
@click="toggle(section.key, item.value)"
276293
>
277294
<span
278-
class="inline-flex items-center justify-center size-8 shrink-0 rounded-full transition-colors"
279-
:class="isChecked(section.key, item.value) ? 'bg-primary/10 text-primary' : 'bg-elevated text-muted'"
295+
class="inline-flex items-center justify-center size-8 shrink-0 rounded-full"
296+
:class="ICON_COLORS[item.color]"
280297
>
281298
<UIcon :name="item.icon" class="size-4" />
282299
</span>
@@ -287,28 +304,39 @@ function reset(): void {
287304
class="block text-xs text-muted mt-0.5"
288305
>{{ item.description }}</span>
289306
</span>
307+
<UIcon
308+
v-if="isChecked(section.key, item.value)"
309+
name="i-lucide-circle-check"
310+
class="size-4 shrink-0 text-primary"
311+
/>
290312
</button>
291313
</div>
292314
</div>
293315

294316
<div class="px-5 py-4 sm:px-6 bg-muted">
295-
<p class="font-medium text-highlighted mb-2">
317+
<p class="font-medium text-highlighted mb-3">
296318
{{ hasSelections ? 'Recommended docs, based on your answers' : 'Start here' }}
297319
</p>
298-
<!-- TODO: use inline elements, instead UPage -->
299-
<UPageList divide>
300-
<UPageCard
320+
<div class="flex flex-col divide-y divide-default rounded-lg border border-default overflow-hidden bg-default">
321+
<NuxtLink
301322
v-for="doc in recommendedDocs"
302323
:key="doc.path"
303324
:to="doc.path"
304-
:icon="doc.icon"
305-
:title="doc.title"
306-
:description="doc.description"
307-
orientation="horizontal"
308-
variant="ghost"
309-
:ui="{ container: 'p-3 sm:p-3', leadingIcon: 'size-5' }"
310-
/>
311-
</UPageList>
325+
class="group flex items-center gap-3 p-3 transition-colors hover:bg-elevated/50"
326+
>
327+
<span class="inline-flex items-center justify-center size-8 shrink-0 rounded-full bg-elevated text-muted">
328+
<UIcon :name="doc.icon" class="size-4" />
329+
</span>
330+
<span class="min-w-0 flex-1">
331+
<span class="block text-sm font-medium text-highlighted">{{ doc.title }}</span>
332+
<span class="block text-xs text-muted mt-0.5">{{ doc.description }}</span>
333+
</span>
334+
<UIcon
335+
name="i-lucide-arrow-right"
336+
class="size-4 shrink-0 text-dimmed transition-transform group-hover:translate-x-0.5 group-hover:text-muted"
337+
/>
338+
</NuxtLink>
339+
</div>
312340
</div>
313341
</div>
314342
</template>

0 commit comments

Comments
 (0)