|
| 1 | +import { PlusIcon } from '@phosphor-icons/react/dist/ssr'; |
| 2 | +import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'; |
| 3 | +import { Button } from '@/components/ui/button'; |
| 4 | +import { |
| 5 | + Select, |
| 6 | + SelectContent, |
| 7 | + SelectItem, |
| 8 | + SelectTrigger, |
| 9 | + SelectValue, |
| 10 | +} from '@/components/ui/select'; |
| 11 | +import { Toggle } from '@/components/ui/toggle'; |
| 12 | +import { Container } from '../Container'; |
| 13 | + |
| 14 | +export default function Base() { |
| 15 | + return ( |
| 16 | + <> |
| 17 | + {/* Button */} |
| 18 | + <Container> |
| 19 | + <h3 className="text-muted-foreground text-sm">A button component.</h3> |
| 20 | + <div className="space-y-2"> |
| 21 | + {['default', 'secondary', 'outline', 'ghost', 'link', 'destructive'].map((variant) => ( |
| 22 | + <div key={variant}> |
| 23 | + <h4 className="text-muted-foreground mb-2 font-mono text-xs uppercase">{variant}</h4> |
| 24 | + <div className="grid w-full grid-cols-4 gap-2"> |
| 25 | + <div> |
| 26 | + <Button variant={variant as any} size="sm"> |
| 27 | + Size sm |
| 28 | + </Button> |
| 29 | + </div> |
| 30 | + <div> |
| 31 | + <Button variant={variant as any}>Size default</Button> |
| 32 | + </div> |
| 33 | + <div> |
| 34 | + <Button variant={variant as any} size="lg"> |
| 35 | + Size lg |
| 36 | + </Button> |
| 37 | + </div> |
| 38 | + <div> |
| 39 | + <Button variant={variant as any} size="icon"> |
| 40 | + <PlusIcon size={16} weight="bold" /> |
| 41 | + </Button> |
| 42 | + </div> |
| 43 | + </div> |
| 44 | + </div> |
| 45 | + ))} |
| 46 | + </div> |
| 47 | + </Container> |
| 48 | + |
| 49 | + {/* Toggle */} |
| 50 | + <Container> |
| 51 | + <h3 className="text-muted-foreground text-sm">A toggle component.</h3> |
| 52 | + <div className="space-y-2"> |
| 53 | + {['default', 'outline'].map((variant) => ( |
| 54 | + <div key={variant}> |
| 55 | + <h4 className="text-muted-foreground mb-2 font-mono text-xs uppercase">{variant}</h4> |
| 56 | + <div className="grid w-full grid-cols-3 gap-2"> |
| 57 | + <div> |
| 58 | + <Toggle key={variant} variant={variant as any} size="sm"> |
| 59 | + Size sm |
| 60 | + </Toggle> |
| 61 | + </div> |
| 62 | + <div> |
| 63 | + <Toggle key={variant} variant={variant as any}> |
| 64 | + Size default |
| 65 | + </Toggle> |
| 66 | + </div> |
| 67 | + <div> |
| 68 | + <Toggle key={variant} variant={variant as any} size="lg"> |
| 69 | + Size lg |
| 70 | + </Toggle> |
| 71 | + </div> |
| 72 | + </div> |
| 73 | + </div> |
| 74 | + ))} |
| 75 | + </div> |
| 76 | + </Container> |
| 77 | + |
| 78 | + {/* Alert */} |
| 79 | + <Container> |
| 80 | + <h3 className="text-muted-foreground text-sm">An alert component.</h3> |
| 81 | + <div className="space-y-6"> |
| 82 | + {['default', 'destructive'].map((variant) => ( |
| 83 | + <div key={variant}> |
| 84 | + <h4 className="text-muted-foreground mb-2 font-mono text-xs uppercase">{variant}</h4> |
| 85 | + <Alert key={variant} variant={variant as any}> |
| 86 | + <AlertTitle>Alert {variant} title</AlertTitle> |
| 87 | + <AlertDescription>This is a {variant} alert description.</AlertDescription> |
| 88 | + </Alert> |
| 89 | + </div> |
| 90 | + ))} |
| 91 | + </div> |
| 92 | + </Container> |
| 93 | + |
| 94 | + {/* Select */} |
| 95 | + <Container> |
| 96 | + <h3 className="text-muted-foreground text-sm">A select component.</h3> |
| 97 | + <div className="grid w-full grid-cols-2 gap-2"> |
| 98 | + <div> |
| 99 | + <h4 className="text-muted-foreground mb-2 font-mono text-xs uppercase">Size default</h4> |
| 100 | + <Select> |
| 101 | + <SelectTrigger> |
| 102 | + <SelectValue placeholder="Select a track" /> |
| 103 | + </SelectTrigger> |
| 104 | + <SelectContent> |
| 105 | + <SelectItem value="1">Track 1</SelectItem> |
| 106 | + <SelectItem value="2">Track 2</SelectItem> |
| 107 | + <SelectItem value="3">Track 3</SelectItem> |
| 108 | + </SelectContent> |
| 109 | + </Select> |
| 110 | + </div> |
| 111 | + <div> |
| 112 | + <h3 className="text-muted-foreground mb-2 font-mono text-xs uppercase">Size sm</h3> |
| 113 | + <Select> |
| 114 | + <SelectTrigger size="sm"> |
| 115 | + <SelectValue placeholder="Select a track" /> |
| 116 | + </SelectTrigger> |
| 117 | + <SelectContent> |
| 118 | + <SelectItem value="1">Track 1</SelectItem> |
| 119 | + <SelectItem value="2">Track 2</SelectItem> |
| 120 | + <SelectItem value="3">Track 3</SelectItem> |
| 121 | + </SelectContent> |
| 122 | + </Select> |
| 123 | + </div> |
| 124 | + </div> |
| 125 | + </Container> |
| 126 | + </> |
| 127 | + ); |
| 128 | +} |
0 commit comments