Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dist
.eslintcache
.eve
.workflow-data
.design

# Local Netlify folder
.netlify
Expand Down
36 changes: 36 additions & 0 deletions app/components/content/AgentsAside.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<script setup lang="ts">
/**
* An unnumbered aside inside a section, e.g. the evals under the Conventions numbers: a label,
* title and description on the left, the default slot (a visual and its link) on the right.
*/
defineProps<{
id?: string
/** The mono label above the title, e.g. "Evals". */
label?: string
}>()

defineSlots<{ title?: () => unknown, description?: () => unknown, default?: () => unknown }>()
</script>

<template>
<div
:id="id"
class="not-prose scroll-mt-[calc(var(--ui-header-height)+84px)] mt-[clamp(24px,4vw,64px)] flex flex-wrap items-center justify-between gap-x-16 gap-y-8 p-[clamp(24px,4vw,64px)] rounded-[20px] border border-default bg-elevated/40"
>
<div class="flex-[1_1_420px] min-w-0 flex flex-col gap-3">
<p v-if="label" class="flex items-center gap-2.5 font-mono text-[13px]/none font-medium tracking-[0.08em] uppercase text-muted">
<span class="size-2 rounded-full bg-primary" />
{{ label }}
</p>
<h3 class="font-heading font-medium text-[clamp(26px,2.6vw,36px)]/[1.1] tracking-[-0.03em] text-highlighted [&_p]:my-0">
<slot name="title" />
</h3>
<div class="max-w-136 text-base/[1.6] text-muted [&_p]:my-0">
<slot name="description" />
</div>
</div>
<div class="flex-[0_1_440px] min-w-0 flex flex-col gap-3 *:my-0">
<slot />
</div>
</div>
</template>
85 changes: 85 additions & 0 deletions app/components/content/AgentsCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<script setup lang="ts">
/**
* `UPageCard` with the `/agents` page's look: a visual in the header slot, a title and an
* optional link line at the bottom.
*/
const props = defineProps<{
to?: string
target?: string
/** The label of the link line, e.g. "See the template". */
link?: string
/** Full-bleed header: the visual spans the card edge to edge, above a border. */
bleed?: boolean
/** A lucide icon before the title. */
icon?: string
/** Make the whole card a button that emits `select`, for actions that aren't links. */
action?: boolean
}>()

const emit = defineEmits<{ select: [] }>()

const slots = defineSlots<{
header?: () => unknown
title?: () => unknown
description?: () => unknown
default?: () => unknown
}>()

const external = computed(() => !!props.to && /^https?:\/\//.test(props.to))

const hasFooter = computed(() => !!props.link || !!slots.default)
const interactive = computed(() => !!props.to || props.action)

const ui = computed(() => ({
root: ['min-h-fit overflow-hidden rounded-2xl bg-elevated ring-default [--agents-code-bg:var(--ui-bg)]', interactive.value ? 'hover:ring-accented transition-[box-shadow]' : ''].join(' '),
container: props.bleed ? 'min-w-0 p-0 sm:p-0 gap-0 h-full' : 'min-w-0 p-6 sm:p-6 gap-5 h-full',
wrapper: 'h-full',
header: props.bleed ? 'w-full mb-0 border-b border-default' : 'w-full mb-5',
body: props.bleed ? ['w-full px-6 pt-6 flex-1', hasFooter.value ? '' : 'pb-6'].join(' ') : 'w-full flex-1',
title: 'font-heading text-[22px]/[1.25] font-medium text-highlighted [&_p]:my-0',
description: 'mt-3 text-[15px]/[1.6] text-muted *:my-0 [&>*+*]:mt-4!',
footer: props.bleed ? 'w-full px-6 pb-6 pt-3 mt-auto' : 'w-full pt-5 mt-auto'
}))
</script>

<template>
<UPageCard :to="to" :target="target" variant="outline" :ui="ui">
<template v-if="slots.header" #header>
<div aria-hidden="true">
<slot name="header" />
</div>
</template>

<template v-if="slots.title" #title>
<span class="flex items-center justify-between gap-3">
<span class="flex items-center gap-2.5">
<UIcon v-if="icon" :name="icon" class="shrink-0 size-5" />
<slot name="title" />
</span>
</span>
</template>

<template v-if="slots.description" #description>
<slot name="description" />
</template>

<template v-if="link || slots.default" #footer>
<div class="w-full flex flex-col gap-4 [&>*]:my-0">
<slot />
<button
v-if="link && action"
type="button"
class="self-start inline-flex items-center gap-1.5 text-[15px] font-medium text-primary after:absolute after:inset-0 after:rounded-2xl focus-visible:outline-none focus-visible:after:outline-2 focus-visible:after:outline-primary"
@click="emit('select')"
>
{{ link }}
<UIcon name="i-lucide-arrow-right" class="size-4" />
</button>
<span v-else-if="link" class="inline-flex items-center gap-1.5 text-[15px] font-medium text-primary">
{{ link }}
<UIcon :name="external ? 'i-lucide-arrow-up-right' : 'i-lucide-arrow-right'" class="size-4" />
</span>
</div>
</template>
</UPageCard>
</template>
26 changes: 26 additions & 0 deletions app/components/content/AgentsCaveat.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script setup lang="ts">
/**
* The note under a set of numbers: its title on the left, how they were measured and the
* source on the right. Always visible.
*/
defineProps<{
icon?: string
}>()

defineSlots<{ title?: () => unknown, default?: () => unknown }>()
</script>

<template>
<div class="not-prose flex flex-wrap items-start gap-x-12 gap-y-3">
<p class="flex-[0_1_260px] flex items-center gap-2.5 text-[15px] font-semibold text-highlighted [&_p]:my-0">
<UIcon :name="icon ?? 'i-lucide-info'" class="shrink-0 size-4.5 text-muted" />
<slot name="title" />
</p>
<div
class="flex-[999_1_480px] min-w-0 max-w-208 flex flex-col gap-2 text-[15px]/[1.65] text-muted [&>p]:my-0
[&_a:not([data-slot])]:text-primary [&_a:not([data-slot])]:underline [&_a:not([data-slot])]:underline-offset-3"
>
<slot />
</div>
</div>
</template>
79 changes: 79 additions & 0 deletions app/components/content/AgentsChatPreview.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<script setup lang="ts">
/** Decorative chat previews for the Build AI cards. */
defineProps<{
variant: 'template' | 'components' | 'nuxi'
}>()

const motion = useAgentsMotion()
</script>

<template>
<div class="min-h-54 flex flex-col justify-between gap-3 p-5 rounded-[10px] border border-default bg-default">
<template v-if="variant === 'template'">
<div class="self-end w-[46%] h-7.5 rounded-[10px] bg-accented" />
<div class="flex flex-col gap-2">
<div class="w-[88%] h-2.25 rounded-full bg-accented" />
<div class="w-[74%] h-2.25 rounded-full bg-accented" />
<div class="w-[52%] h-2.25 rounded-full bg-accented" />
<svg width="34" height="10" class="block mt-0.5">
<circle
v-for="(cx, i) in [5, 17, 29]"
:key="cx"
:cx="cx"
cy="5"
r="3"
class="fill-(--ui-text-muted)"
>
<animate
v-if="motion"
attributeName="opacity"
values="0.25;1;0.25"
dur="1.2s"
:begin="`${i * 0.2}s`"
repeatCount="indefinite"
/>
</circle>
</svg>
</div>
</template>

<template v-else-if="variant === 'nuxi'">
<div class="self-end w-[52%] h-7.5 rounded-[10px] bg-accented" />
<div class="flex gap-3">
<AgentNuxiIcon class="shrink-0 size-6 text-primary" :interactive="false" />
<div class="flex-1 flex flex-col gap-2 pt-1.5">
<div class="w-[90%] h-2.25 rounded-full bg-accented" />
<div class="w-[68%] h-2.25 rounded-full bg-accented" />
<div class="flex gap-1.5 mt-1 font-mono text-[11px]/none text-muted">
<span class="px-1.5 py-1 rounded-md border border-default">docs</span>
<span class="px-1.5 py-1 rounded-md border border-default">modules</span>
</div>
</div>
</div>
</template>

<template v-else>
<div class="flex items-center gap-2 h-8 px-2.5 rounded-lg border border-default font-mono text-xs/none font-medium text-muted">
<UIcon name="i-lucide-chevron-right" class="size-3.5" />
Reasoning
<span class="ms-auto text-[11px] text-dimmed">done</span>
</div>
<div class="flex items-center gap-2 h-8 px-2.5 rounded-lg border border-default font-mono text-xs/none font-medium text-muted">
<UIcon name="i-lucide-wrench" class="size-3.5" />
Tool call
<UIcon name="i-lucide-loader-circle" class="ms-auto size-3.5 text-primary" :class="{ 'animate-spin': motion }" />
</div>
<div class="flex flex-col gap-2 mt-1">
<div class="w-[84%] h-2.25 rounded-full bg-accented" />
<div class="w-[62%] h-2.25 rounded-full bg-accented" />
</div>
</template>

<div class="mt-1.5 flex items-center justify-between gap-3 h-10 ps-3.5 pe-1.5 rounded-[10px] border border-default bg-elevated">
<div class="w-[40%] h-2.25 rounded-full bg-accented" />
<span class="inline-flex items-center justify-center size-7 rounded-[7px] bg-inverted text-inverted">
<UIcon name="i-lucide-arrow-up" class="size-3.5" />
</span>
</div>
</div>
</template>
35 changes: 35 additions & 0 deletions app/components/content/AgentsCodeFrameVisual.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<script setup lang="ts">
/** Decorative: a source-mapped code frame with the failing line marked, and its copy button. */
const motion = useAgentsMotion()
</script>

<template>
<div class="h-46 px-5 pt-5 pb-4 flex flex-col justify-between gap-3 bg-neutral-900/50">
<code class="block overflow-hidden whitespace-pre font-mono text-xs/[1.8] text-dimmed">
<span class="block">{{ ' 12 │ const post = await getPost(id)' }}</span>
<span class="block text-highlighted"><span class="text-error">❯</span>{{ ' 13 │ return post.' }}<span class="relative inline-block">titel<svg width="100%" height="6" viewBox="0 0 40 6" preserveAspectRatio="none" class="absolute left-0 -bottom-1 overflow-visible"><path
d="M0 3 Q2.5 0 5 3 T10 3 T15 3 T20 3 T25 3 T30 3 T35 3 T40 3"
fill="none"
class="stroke-(--ui-error)"
stroke-width="1.2"
stroke-dasharray="60"
:stroke-dashoffset="motion ? 60 : 0"
><animate
v-if="motion"
attributeName="stroke-dashoffset"
values="60;0;0;60"
keyTimes="0;0.25;0.85;1"
dur="4s"
repeatCount="indefinite"
/></path></svg></span>.trim()</span>
<span class="block">{{ ' 14 │ }' }}</span>
</code>
<div class="flex items-center justify-between gap-2">
<span class="font-mono text-[11px]/none text-dimmed truncate">server/api/posts/[slug].get.ts</span>
<span class="shrink-0 inline-flex items-center gap-1.5 h-6.5 px-2 rounded-md border border-default text-xs/none font-medium text-muted">
<UIcon name="i-lucide-copy" class="size-3" />
Copy as prompt
</span>
</div>
</div>
</template>
26 changes: 26 additions & 0 deletions app/components/content/AgentsCodeGroup.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script setup lang="ts">
import { ProseCodeGroup } from '#components'

/**
* `ProseCodeGroup` for the `/agents` page, styled like `AgentsProsePre`: one box with mono file
* tabs in the header. On narrow screens the tabs scroll under a solid strip at the end,
* so they never run beneath the copy button.
*/
</script>

<template>
<ProseCodeGroup
:ui="{
root: 'my-0 [&_pre]:rounded-t-none',
list: [
'gap-0.5 p-1 ps-1.5 rounded-t-xl border-default bg-(--agents-code-bg,var(--ui-bg-elevated))',
'after:content-[\'\'] after:sticky after:-end-1 after:-my-1 after:-me-1 after:ms-auto after:self-stretch after:shrink-0 after:w-12 after:bg-(--agents-code-bg,var(--ui-bg-elevated))'
].join(' '),
indicator: 'inset-y-1 rounded-md bg-accented shadow-none',
trigger: 'min-h-9 px-2.5 gap-2 rounded-md font-mono text-[13px] font-medium text-muted data-[state=active]:text-highlighted hover:bg-transparent hover:text-highlighted',
triggerIcon: 'size-3.5'
}"
>
<slot />
</ProseCodeGroup>
</template>
55 changes: 55 additions & 0 deletions app/components/content/AgentsConfigCheckVisual.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<script setup lang="ts">
/** Decorative: runtime config values checked one by one, two of them failing. */
const motion = useAgentsMotion()

const checks = [
{ key: 'apiSecret', note: 'required', ok: false, keyTimes: '0;0.1;0.16;0.9;1' },
{ key: 'apiBase', note: '', ok: true, keyTimes: '0;0.2;0.26;0.9;1' },
{ key: 'pageSize', note: 'expected number', ok: false, keyTimes: '0;0.3;0.36;0.9;1' }
]
</script>

<template>
<div class="h-46 p-5 flex flex-col justify-center gap-2.5 bg-neutral-900/50 font-mono text-xs/none">
<p class="mb-1 font-medium text-highlighted">
Invalid runtime config
</p>
<div
v-for="check in checks"
:key="check.key"
class="flex items-center gap-2.5 h-6.5 px-2.5 rounded-md border border-default bg-default"
>
<svg
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke-width="2.5"
stroke-linecap="round"
stroke-linejoin="round"
class="shrink-0"
:class="check.ok ? 'stroke-(--ui-text-dimmed)' : 'stroke-(--ui-error)'"
>
<g :opacity="motion ? 0 : 1">
<template v-if="check.ok">
<path d="M20 6 9 17l-5-5" />
</template>
<template v-else>
<path d="m15 9-6 6" />
<path d="m9 9 6 6" />
</template>
<animate
v-if="motion"
attributeName="opacity"
values="0;0;1;1;0"
:keyTimes="check.keyTimes"
dur="5s"
repeatCount="indefinite"
/>
</g>
</svg>
<span class="text-highlighted">{{ check.key }}</span>
<span class="ms-auto text-muted whitespace-nowrap">{{ check.note }}</span>
</div>
</div>
</template>
23 changes: 23 additions & 0 deletions app/components/content/AgentsConnect.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script setup lang="ts">
/**
* The "Connect your agent" layout: the setup console with the tool list and tips beside it,
* then the extra cards in a row below.
*/
defineSlots<{ default?: () => unknown, aside?: () => unknown, below?: () => unknown }>()
</script>

<template>
<div class="not-prose flex flex-col gap-4">
<div class="flex flex-wrap items-stretch gap-4">
<div class="flex-[1.5_1_560px] min-w-0 flex flex-col gap-5 p-4 sm:p-7 rounded-2xl border border-default bg-elevated [--agents-code-bg:var(--ui-bg)] *:my-0">
<slot />
</div>
<div class="flex-[1_1_360px] min-w-0 flex flex-col gap-6 *:my-0">
<slot name="aside" />
</div>
</div>
<div class="flex flex-col gap-4 *:my-0">
<slot name="below" />
</div>
</div>
</template>
Loading
Loading