|
| 1 | +'use client'; |
| 2 | + |
| 3 | +import { |
| 4 | + Badge, |
| 5 | + Button, |
| 6 | + Checkbox, |
| 7 | + Input, |
| 8 | + Kbd, |
| 9 | + Label, |
| 10 | + Progress, |
| 11 | + Separator, |
| 12 | + Slider, |
| 13 | + Spinner, |
| 14 | + Switch, |
| 15 | + Textarea, |
| 16 | + Toggle, |
| 17 | + Card, |
| 18 | + CardContent, |
| 19 | + CardHeader, |
| 20 | + CardTitle, |
| 21 | + CardDescription, |
| 22 | +} from '@trycompai/design-system'; |
| 23 | +import { Bold, Italic, Underline, Plus, Settings } from 'lucide-react'; |
| 24 | + |
| 25 | +export default function DesignPage() { |
| 26 | + return ( |
| 27 | + <div className="p-8 space-y-16 max-w-4xl"> |
| 28 | + <header> |
| 29 | + <h1 className="text-2xl font-semibold">Design System</h1> |
| 30 | + <p className="text-muted-foreground">Theme testing & component inspection</p> |
| 31 | + </header> |
| 32 | + |
| 33 | + {/* Border Radius */} |
| 34 | + <section className="space-y-4"> |
| 35 | + <h2 className="text-xl font-semibold">Border Radius Tokens</h2> |
| 36 | + <div className="flex gap-6 items-end"> |
| 37 | + <div className="space-y-2 text-center"> |
| 38 | + <div className="size-16 bg-primary rounded-sm" /> |
| 39 | + <code className="text-xs text-muted-foreground block">sm</code> |
| 40 | + </div> |
| 41 | + <div className="space-y-2 text-center"> |
| 42 | + <div className="size-16 bg-primary rounded-md" /> |
| 43 | + <code className="text-xs text-muted-foreground block">md</code> |
| 44 | + </div> |
| 45 | + <div className="space-y-2 text-center"> |
| 46 | + <div className="size-16 bg-primary rounded-lg" /> |
| 47 | + <code className="text-xs text-muted-foreground block">lg</code> |
| 48 | + </div> |
| 49 | + <div className="space-y-2 text-center"> |
| 50 | + <div className="size-16 bg-primary rounded-xl" /> |
| 51 | + <code className="text-xs text-muted-foreground block">xl</code> |
| 52 | + </div> |
| 53 | + </div> |
| 54 | + <div className="p-4 bg-muted rounded-md font-mono text-xs space-y-1"> |
| 55 | + <div>--radius-sm: calc(var(--radius) - 2px)</div> |
| 56 | + <div>--radius-md: calc(var(--radius) - 1px)</div> |
| 57 | + <div>--radius-lg: var(--radius)</div> |
| 58 | + <div>--radius-xl: calc(var(--radius) + 2px)</div> |
| 59 | + </div> |
| 60 | + </section> |
| 61 | + |
| 62 | + <Separator /> |
| 63 | + |
| 64 | + {/* Colors */} |
| 65 | + <section className="space-y-4"> |
| 66 | + <h2 className="text-xl font-semibold">Colors</h2> |
| 67 | + <div className="grid grid-cols-6 gap-3"> |
| 68 | + <div className="space-y-2 text-center"> |
| 69 | + <div className="h-12 bg-primary rounded-md" /> |
| 70 | + <code className="text-xs text-muted-foreground">primary</code> |
| 71 | + </div> |
| 72 | + <div className="space-y-2 text-center"> |
| 73 | + <div className="h-12 bg-secondary rounded-md" /> |
| 74 | + <code className="text-xs text-muted-foreground">secondary</code> |
| 75 | + </div> |
| 76 | + <div className="space-y-2 text-center"> |
| 77 | + <div className="h-12 bg-muted rounded-md" /> |
| 78 | + <code className="text-xs text-muted-foreground">muted</code> |
| 79 | + </div> |
| 80 | + <div className="space-y-2 text-center"> |
| 81 | + <div className="h-12 bg-accent rounded-md" /> |
| 82 | + <code className="text-xs text-muted-foreground">accent</code> |
| 83 | + </div> |
| 84 | + <div className="space-y-2 text-center"> |
| 85 | + <div className="h-12 bg-destructive rounded-md" /> |
| 86 | + <code className="text-xs text-muted-foreground">destructive</code> |
| 87 | + </div> |
| 88 | + <div className="space-y-2 text-center"> |
| 89 | + <div className="h-12 bg-border rounded-md border" /> |
| 90 | + <code className="text-xs text-muted-foreground">border</code> |
| 91 | + </div> |
| 92 | + </div> |
| 93 | + </section> |
| 94 | + |
| 95 | + <Separator /> |
| 96 | + |
| 97 | + {/* Buttons */} |
| 98 | + <section className="space-y-4"> |
| 99 | + <h2 className="text-xl font-semibold">Buttons</h2> |
| 100 | + |
| 101 | + <div className="space-y-6"> |
| 102 | + <div> |
| 103 | + <p className="text-sm text-muted-foreground mb-3">Variants</p> |
| 104 | + <div className="flex gap-3 flex-wrap"> |
| 105 | + <Button>Default</Button> |
| 106 | + <Button variant="outline">Outline</Button> |
| 107 | + <Button variant="secondary">Secondary</Button> |
| 108 | + <Button variant="ghost">Ghost</Button> |
| 109 | + <Button variant="destructive">Destructive</Button> |
| 110 | + <Button variant="link">Link</Button> |
| 111 | + </div> |
| 112 | + </div> |
| 113 | + |
| 114 | + <div> |
| 115 | + <p className="text-sm text-muted-foreground mb-3">Sizes</p> |
| 116 | + <div className="flex gap-3 items-center flex-wrap"> |
| 117 | + <Button size="xs">Extra Small</Button> |
| 118 | + <Button size="sm">Small</Button> |
| 119 | + <Button size="default">Default</Button> |
| 120 | + <Button size="lg">Large</Button> |
| 121 | + </div> |
| 122 | + </div> |
| 123 | + |
| 124 | + <div> |
| 125 | + <p className="text-sm text-muted-foreground mb-3">With Icons</p> |
| 126 | + <div className="flex gap-3 flex-wrap"> |
| 127 | + <Button iconLeft={<Plus />}>Add Item</Button> |
| 128 | + <Button variant="outline" iconRight={<Settings />}>Settings</Button> |
| 129 | + <Button size="icon"><Plus /></Button> |
| 130 | + <Button size="icon" variant="outline"><Settings /></Button> |
| 131 | + </div> |
| 132 | + </div> |
| 133 | + |
| 134 | + <div> |
| 135 | + <p className="text-sm text-muted-foreground mb-3">States</p> |
| 136 | + <div className="flex gap-3 flex-wrap"> |
| 137 | + <Button disabled>Disabled</Button> |
| 138 | + <Button loading>Loading</Button> |
| 139 | + </div> |
| 140 | + </div> |
| 141 | + </div> |
| 142 | + </section> |
| 143 | + |
| 144 | + <Separator /> |
| 145 | + |
| 146 | + {/* Badges */} |
| 147 | + <section className="space-y-4"> |
| 148 | + <h2 className="text-xl font-semibold">Badges</h2> |
| 149 | + <div className="flex gap-3 flex-wrap"> |
| 150 | + <Badge>Default</Badge> |
| 151 | + <Badge variant="secondary">Secondary</Badge> |
| 152 | + <Badge variant="outline">Outline</Badge> |
| 153 | + <Badge variant="destructive">Destructive</Badge> |
| 154 | + <Badge variant="ghost">Ghost</Badge> |
| 155 | + </div> |
| 156 | + </section> |
| 157 | + |
| 158 | + <Separator /> |
| 159 | + |
| 160 | + {/* Form Controls */} |
| 161 | + <section className="space-y-4"> |
| 162 | + <h2 className="text-xl font-semibold">Form Controls</h2> |
| 163 | + |
| 164 | + <div className="grid grid-cols-2 gap-8"> |
| 165 | + <div className="space-y-4"> |
| 166 | + <div className="space-y-2"> |
| 167 | + <Label htmlFor="input">Input</Label> |
| 168 | + <Input id="input" placeholder="Type something..." /> |
| 169 | + </div> |
| 170 | + |
| 171 | + <div className="space-y-2"> |
| 172 | + <Label htmlFor="textarea">Textarea</Label> |
| 173 | + <Textarea id="textarea" placeholder="Type more..." /> |
| 174 | + </div> |
| 175 | + </div> |
| 176 | + |
| 177 | + <div className="space-y-4"> |
| 178 | + <div className="flex items-center gap-2"> |
| 179 | + <Checkbox id="checkbox" /> |
| 180 | + <Label htmlFor="checkbox">Checkbox label</Label> |
| 181 | + </div> |
| 182 | + |
| 183 | + <div className="flex items-center gap-2"> |
| 184 | + <Switch id="switch" /> |
| 185 | + <Label htmlFor="switch">Switch label</Label> |
| 186 | + </div> |
| 187 | + |
| 188 | + <div className="space-y-2"> |
| 189 | + <Label>Slider</Label> |
| 190 | + <Slider defaultValue={[50]} max={100} /> |
| 191 | + </div> |
| 192 | + </div> |
| 193 | + </div> |
| 194 | + </section> |
| 195 | + |
| 196 | + <Separator /> |
| 197 | + |
| 198 | + {/* Toggles */} |
| 199 | + <section className="space-y-4"> |
| 200 | + <h2 className="text-xl font-semibold">Toggle</h2> |
| 201 | + <div className="flex gap-2"> |
| 202 | + <Toggle aria-label="Bold"> |
| 203 | + <Bold className="size-4" /> |
| 204 | + </Toggle> |
| 205 | + <Toggle aria-label="Italic"> |
| 206 | + <Italic className="size-4" /> |
| 207 | + </Toggle> |
| 208 | + <Toggle aria-label="Underline"> |
| 209 | + <Underline className="size-4" /> |
| 210 | + </Toggle> |
| 211 | + </div> |
| 212 | + </section> |
| 213 | + |
| 214 | + <Separator /> |
| 215 | + |
| 216 | + {/* Cards */} |
| 217 | + <section className="space-y-4"> |
| 218 | + <h2 className="text-xl font-semibold">Card</h2> |
| 219 | + <div className="grid grid-cols-2 gap-4"> |
| 220 | + <Card> |
| 221 | + <CardHeader> |
| 222 | + <CardTitle>Card Title</CardTitle> |
| 223 | + <CardDescription>Card description goes here</CardDescription> |
| 224 | + </CardHeader> |
| 225 | + <CardContent> |
| 226 | + <p>Card content with some text.</p> |
| 227 | + </CardContent> |
| 228 | + </Card> |
| 229 | + <Card> |
| 230 | + <CardHeader> |
| 231 | + <CardTitle>Another Card</CardTitle> |
| 232 | + <CardDescription>With different content</CardDescription> |
| 233 | + </CardHeader> |
| 234 | + <CardContent> |
| 235 | + <div className="flex gap-2"> |
| 236 | + <Button size="sm">Action</Button> |
| 237 | + <Button size="sm" variant="outline">Cancel</Button> |
| 238 | + </div> |
| 239 | + </CardContent> |
| 240 | + </Card> |
| 241 | + </div> |
| 242 | + </section> |
| 243 | + |
| 244 | + <Separator /> |
| 245 | + |
| 246 | + {/* Progress */} |
| 247 | + <section className="space-y-4"> |
| 248 | + <h2 className="text-xl font-semibold">Progress</h2> |
| 249 | + <div className="space-y-3 max-w-md"> |
| 250 | + <Progress value={25} /> |
| 251 | + <Progress value={50} /> |
| 252 | + <Progress value={75} /> |
| 253 | + </div> |
| 254 | + </section> |
| 255 | + |
| 256 | + <Separator /> |
| 257 | + |
| 258 | + {/* Kbd */} |
| 259 | + <section className="space-y-4"> |
| 260 | + <h2 className="text-xl font-semibold">Keyboard</h2> |
| 261 | + <div className="flex items-center gap-2"> |
| 262 | + <Kbd>⌘</Kbd> |
| 263 | + <Kbd>K</Kbd> |
| 264 | + <span className="text-muted-foreground mx-2">or</span> |
| 265 | + <Kbd>Ctrl</Kbd> |
| 266 | + <Kbd>Shift</Kbd> |
| 267 | + <Kbd>P</Kbd> |
| 268 | + </div> |
| 269 | + </section> |
| 270 | + |
| 271 | + <Separator /> |
| 272 | + |
| 273 | + {/* Loading States */} |
| 274 | + <section className="space-y-4"> |
| 275 | + <h2 className="text-xl font-semibold">Loading States</h2> |
| 276 | + <div className="flex items-center gap-6"> |
| 277 | + <Spinner /> |
| 278 | + <div className="space-y-2"> |
| 279 | + <div className="h-4 w-48 bg-muted rounded animate-pulse" /> |
| 280 | + <div className="h-4 w-32 bg-muted rounded animate-pulse" /> |
| 281 | + </div> |
| 282 | + </div> |
| 283 | + </section> |
| 284 | + |
| 285 | + <Separator /> |
| 286 | + |
| 287 | + {/* Typography */} |
| 288 | + <section className="space-y-4"> |
| 289 | + <h2 className="text-xl font-semibold">Typography</h2> |
| 290 | + <div className="space-y-2"> |
| 291 | + <h1 className="text-3xl font-semibold">Heading 1</h1> |
| 292 | + <h2 className="text-2xl font-semibold">Heading 2</h2> |
| 293 | + <h3 className="text-xl font-semibold">Heading 3</h3> |
| 294 | + <h4 className="text-lg font-semibold">Heading 4</h4> |
| 295 | + <p>Regular text paragraph</p> |
| 296 | + <p className="text-muted-foreground">Muted text</p> |
| 297 | + <p className="text-sm">Small text</p> |
| 298 | + </div> |
| 299 | + </section> |
| 300 | + </div> |
| 301 | + ); |
| 302 | +} |
0 commit comments