mirror of
https://github.com/vercel-labs/json-render.git
synced 2026-10-03 12:28:17 +08:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6baaf3e71 |
@@ -1,20 +1,24 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
function Skeleton({ className = "" }: { className?: string }) {
|
function ScheduleItem({
|
||||||
return <div className={`rounded bg-muted-foreground/10 ${className}`} />;
|
time,
|
||||||
}
|
label,
|
||||||
|
color,
|
||||||
/** Simple form wireframe reused in both diagrams */
|
}: {
|
||||||
function FormUI() {
|
time: string;
|
||||||
|
label: string;
|
||||||
|
color: string;
|
||||||
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className="border border-border rounded-lg p-2.5 space-y-1.5 bg-muted/30">
|
<div className="flex items-center gap-2 py-1.5 border-t border-border/50 first:border-t-0">
|
||||||
{/* Title */}
|
<span className="text-[10px] text-muted-foreground/60 w-12 shrink-0 tabular-nums">
|
||||||
<Skeleton className="h-2.5 w-14 mb-1" />
|
{time}
|
||||||
{/* Input fields */}
|
</span>
|
||||||
<Skeleton className="h-4 w-full rounded-sm" />
|
<span
|
||||||
<Skeleton className="h-4 w-full rounded-sm" />
|
className="w-1.5 h-1.5 rounded-full shrink-0"
|
||||||
{/* Submit button */}
|
style={{ background: color }}
|
||||||
<Skeleton className="h-4 w-16 rounded-sm bg-muted-foreground/20 mt-1" />
|
/>
|
||||||
|
<span className="text-[11px] text-muted-foreground">{label}</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -22,48 +26,164 @@ function FormUI() {
|
|||||||
function InlineModeDiagram() {
|
function InlineModeDiagram() {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col h-full">
|
<div className="flex flex-col h-full">
|
||||||
<div className="text-xs font-medium text-muted-foreground mb-3 text-center">
|
<div className="text-sm font-medium text-foreground text-center mb-3">
|
||||||
Inline Mode
|
Inline Mode
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-1 border border-border rounded-lg bg-background overflow-hidden flex flex-col">
|
<div className="flex-1 border border-border rounded-2xl bg-background overflow-hidden flex flex-col">
|
||||||
{/* Chat area */}
|
<div className="flex-1 p-4 space-y-3 overflow-hidden">
|
||||||
<div className="flex-1 p-3 overflow-hidden flex justify-center">
|
{/* User message */}
|
||||||
<div className="w-1/3 min-w-[120px] space-y-3">
|
<div className="flex justify-end">
|
||||||
{/* User message */}
|
<div className="bg-muted-foreground/20 rounded-2xl rounded-br px-3.5 py-2 max-w-[85%]">
|
||||||
<div className="flex justify-end">
|
<span className="text-[11px] text-foreground/80">
|
||||||
<div className="bg-muted rounded-xl px-3 py-2">
|
I have back-to-back meetings today
|
||||||
<Skeleton className="h-2 w-14" />
|
</span>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Assistant text */}
|
{/* AI response */}
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="space-y-1.5">
|
<p className="text-[11px] text-muted-foreground/70">
|
||||||
<Skeleton className="h-2 w-full" />
|
Packed day! Here's what you've got:
|
||||||
<Skeleton className="h-2 w-3/4" />
|
</p>
|
||||||
</div>
|
<div className="bg-muted/40 border border-border rounded-xl p-3 w-[92%]">
|
||||||
|
<div className="text-[11px] font-semibold text-foreground/80 mb-2">
|
||||||
{/* Inline UI */}
|
Today's Schedule
|
||||||
<FormUI />
|
|
||||||
|
|
||||||
{/* More text after UI */}
|
|
||||||
<div className="space-y-1.5">
|
|
||||||
<Skeleton className="h-2 w-4/5" />
|
|
||||||
</div>
|
</div>
|
||||||
|
<ScheduleItem
|
||||||
|
time="10:00 AM"
|
||||||
|
label="Design Review"
|
||||||
|
color="#7aa2f7"
|
||||||
|
/>
|
||||||
|
<ScheduleItem
|
||||||
|
time="1:00 PM"
|
||||||
|
label="Sprint Planning"
|
||||||
|
color="#bb9af7"
|
||||||
|
/>
|
||||||
|
<ScheduleItem
|
||||||
|
time="3:30 PM"
|
||||||
|
label="Team Standup"
|
||||||
|
color="#9ece6a"
|
||||||
|
/>
|
||||||
|
<ScheduleItem
|
||||||
|
time="4:30 PM"
|
||||||
|
label="Eng All-Hands"
|
||||||
|
color="#e0af68"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Input bar */}
|
{/* Prompt input */}
|
||||||
<div className="p-2 flex justify-center">
|
<div className="p-2.5">
|
||||||
<div className="w-1/3 min-w-[120px] flex items-center gap-2">
|
<div className="bg-muted/50 border border-border rounded-xl px-2.5 py-1.5 flex items-center gap-1.5">
|
||||||
<Skeleton className="h-7 flex-1 rounded-md" />
|
<span className="text-[10px] text-muted-foreground/40 flex-1">
|
||||||
<Skeleton className="h-7 w-7 rounded-md" />
|
Message...
|
||||||
|
</span>
|
||||||
|
<div className="w-5 h-5 rounded-md bg-muted-foreground/20 flex items-center justify-center">
|
||||||
|
<svg
|
||||||
|
className="w-2.5 h-2.5 text-muted-foreground/50"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="currentColor"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"
|
||||||
|
transform="rotate(-90 12 12)"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="text-[10px] text-muted-foreground/60 mt-2 text-center">
|
<div className="mt-3 flex flex-col items-center gap-2">
|
||||||
Text + UI interleaved in messages
|
<div className="text-xs font-medium text-muted-foreground">
|
||||||
|
AI decides when UI beats text
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-1.5 text-[10px] text-muted-foreground/50">
|
||||||
|
<span>AI chatbots</span>
|
||||||
|
<span className="text-muted-foreground/30">/</span>
|
||||||
|
<span>Copilots</span>
|
||||||
|
<span className="text-muted-foreground/30">/</span>
|
||||||
|
<span>Assistants</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function LandingPage() {
|
||||||
|
return (
|
||||||
|
<div className="w-full h-full flex flex-col bg-muted/20">
|
||||||
|
{/* Nav */}
|
||||||
|
<div className="flex items-center justify-between px-3 py-2 border-b border-border/50">
|
||||||
|
<svg
|
||||||
|
width="12"
|
||||||
|
height="12"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
className="shrink-0"
|
||||||
|
>
|
||||||
|
<rect
|
||||||
|
x="2"
|
||||||
|
y="14"
|
||||||
|
width="5"
|
||||||
|
height="8"
|
||||||
|
rx="1"
|
||||||
|
className="fill-muted-foreground/60"
|
||||||
|
/>
|
||||||
|
<rect
|
||||||
|
x="9.5"
|
||||||
|
y="8"
|
||||||
|
width="5"
|
||||||
|
height="14"
|
||||||
|
rx="1"
|
||||||
|
className="fill-muted-foreground/60"
|
||||||
|
/>
|
||||||
|
<rect
|
||||||
|
x="17"
|
||||||
|
y="2"
|
||||||
|
width="5"
|
||||||
|
height="20"
|
||||||
|
rx="1"
|
||||||
|
className="fill-muted-foreground/60"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<span className="text-[9px] text-muted-foreground/50">Pricing</span>
|
||||||
|
<span className="text-[9px] text-muted-foreground/50">Blog</span>
|
||||||
|
<span className="text-[8px] font-semibold bg-foreground text-background rounded-md px-1.5 py-0.5 whitespace-nowrap">
|
||||||
|
Get Started
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Hero */}
|
||||||
|
<div className="flex-1 flex flex-col items-center justify-center gap-2.5 text-center px-4">
|
||||||
|
<span className="text-[8px] font-medium text-green-400 bg-green-400/10 border border-green-400/15 rounded-full px-2 py-0.5">
|
||||||
|
Trusted by 2,000+ teams
|
||||||
|
</span>
|
||||||
|
<div className="text-sm font-bold text-foreground leading-tight">
|
||||||
|
Analytics that
|
||||||
|
<br />
|
||||||
|
move the needle
|
||||||
|
</div>
|
||||||
|
<div className="text-[10px] text-muted-foreground/50 leading-relaxed">
|
||||||
|
Ship what matters. No setup required.
|
||||||
|
</div>
|
||||||
|
<div className="flex gap-1.5 mt-1">
|
||||||
|
<button className="bg-foreground text-background text-[9px] font-semibold rounded-lg px-3 py-1.5 whitespace-nowrap">
|
||||||
|
Start Free
|
||||||
|
</button>
|
||||||
|
<button className="border border-border text-muted-foreground text-[9px] font-medium rounded-lg px-3 py-1.5 whitespace-nowrap">
|
||||||
|
Book Demo
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Footer */}
|
||||||
|
<div className="flex justify-center gap-3 py-2 border-t border-border/50">
|
||||||
|
<span className="text-[8px] text-muted-foreground/30">Privacy</span>
|
||||||
|
<span className="text-[8px] text-muted-foreground/30">Terms</span>
|
||||||
|
<span className="text-[8px] text-muted-foreground/30">Status</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -72,28 +192,65 @@ function InlineModeDiagram() {
|
|||||||
function StandaloneModeDiagram() {
|
function StandaloneModeDiagram() {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col h-full">
|
<div className="flex flex-col h-full">
|
||||||
<div className="text-xs font-medium text-muted-foreground mb-3 text-center">
|
<div className="text-sm font-medium text-foreground text-center mb-3">
|
||||||
Standalone Mode
|
Standalone Mode
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-1 border border-border rounded-lg bg-background overflow-hidden flex flex-row">
|
<div className="flex-1 border border-border rounded-2xl bg-background overflow-hidden flex flex-row">
|
||||||
{/* Left panel - prompt */}
|
{/* Left panel - conversation */}
|
||||||
<div className="w-[38%] border-r border-border flex flex-col">
|
<div className="w-[38%] border-r border-border/50 flex flex-col">
|
||||||
<div className="flex-1" />
|
<div className="flex-1 p-3 space-y-2.5">
|
||||||
<div className="p-3 space-y-2">
|
{/* User message */}
|
||||||
<Skeleton className="h-7 w-full rounded-md" />
|
<div className="flex justify-end">
|
||||||
<Skeleton className="h-5 w-16 rounded-md" />
|
<div className="bg-muted-foreground/20 rounded-2xl rounded-br px-2.5 py-1.5">
|
||||||
|
<span className="text-[10px] text-foreground/80 block leading-relaxed">
|
||||||
|
A landing page for my analytics startup
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* AI text */}
|
||||||
|
<p className="text-[10px] text-muted-foreground/60 leading-relaxed">
|
||||||
|
Here's a clean landing page with a hero, nav, and CTAs.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Prompt input */}
|
||||||
|
<div className="p-2.5">
|
||||||
|
<div className="bg-muted/50 border border-border rounded-xl px-2.5 py-1.5 flex items-center gap-1.5">
|
||||||
|
<span className="text-[10px] text-muted-foreground/40 flex-1">
|
||||||
|
Message...
|
||||||
|
</span>
|
||||||
|
<div className="w-5 h-5 rounded-md bg-muted-foreground/20 flex items-center justify-center">
|
||||||
|
<svg
|
||||||
|
className="w-2.5 h-2.5 text-muted-foreground/50"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="currentColor"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"
|
||||||
|
transform="rotate(-90 12 12)"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Right panel - UI preview */}
|
{/* Right panel - landing page */}
|
||||||
<div className="flex-1 p-3 flex items-center justify-center">
|
<div className="flex-1">
|
||||||
<div className="w-3/4">
|
<LandingPage />
|
||||||
<FormUI />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="text-[10px] text-muted-foreground/60 mt-2 text-center">
|
<div className="mt-3 flex flex-col items-center gap-2">
|
||||||
Prompt separate from UI preview
|
<div className="text-xs font-medium text-muted-foreground">
|
||||||
|
Prompt in, UI out
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-1.5 text-[10px] text-muted-foreground/50">
|
||||||
|
<span>Website builders</span>
|
||||||
|
<span className="text-muted-foreground/30">/</span>
|
||||||
|
<span>Text-to-widget</span>
|
||||||
|
<span className="text-muted-foreground/30">/</span>
|
||||||
|
<span>Dashboards</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -103,10 +260,10 @@ export function GenerationModesDiagram() {
|
|||||||
return (
|
return (
|
||||||
<div className="not-prose my-8">
|
<div className="not-prose my-8">
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-6">
|
<div className="grid grid-cols-1 sm:grid-cols-2 gap-6">
|
||||||
<div className="h-[280px]">
|
<div className="h-[420px]">
|
||||||
<InlineModeDiagram />
|
<InlineModeDiagram />
|
||||||
</div>
|
</div>
|
||||||
<div className="h-[280px]">
|
<div className="h-[420px]">
|
||||||
<StandaloneModeDiagram />
|
<StandaloneModeDiagram />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user