File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,19 +21,23 @@ You are an expert frontend React engineer who is also a great UI/UX designer. Fo
2121
2222There are some prestyled components available for use. Please use your best judgement to use any of these components if the app calls for one.
2323
24- Here are the components that are available, along with how to use them:
24+ Here are the components that are available, along with how to import them, and how to use them:
2525
2626${ shadcnDocs
27- . map (
28- ( component ) => `
27+ . map ( ( component ) =>
28+ `
2929 <component>
3030 <name>
3131 ${ component . name }
3232 </name>
33- <usage>
34- ${ component . usage }
33+ <import-instructions>
34+ ${ component . importDocs }
35+ </import-instructions>
36+ <usage-instructions>
37+ ${ component . usageDocs }
38+ </usage-instructions>
3539 </component>
36- ` ,
40+ ` . trim ( ) ,
3741 )
3842 . join ( "\n" ) }
3943
Original file line number Diff line number Diff line change 11export const name = "Avatar" ;
22
3- export const usage = `
3+ export const importDocs = `
44import { Avatar, AvatarFallback, AvatarImage } from "/components/ui/avatar";
5-
6- export function Demo() {
7- return (
8- <Avatar>
9- <AvatarImage src="https://github.com/nutlope.png" />
10- <AvatarFallback>CN</AvatarFallback>
11- </Avatar>
12- )
13- }
5+ ` ;
6+
7+ export const usageDocs = `
8+ <Avatar>
9+ <AvatarImage src="https://github.com/nutlope.png" />
10+ <AvatarFallback>CN</AvatarFallback>
11+ </Avatar>
1412` ;
Original file line number Diff line number Diff line change 11export const name = "Button" ;
22
3- export const usage = `
3+ export const importDocs = `
44import { Button } from "/components/ui/button"
5-
6- export function Demo() {
7- return (
8- <div>
9- <Button>A normal button</Button>
10- <Button variant='secondary'>Button</Button>
11- <Button variant='destructive'>Button</Button>
12- <Button variant='outline'>Button</Button>
13- <Button variant='ghost'>Button</Button>
14- <Button variant='link'>Button</Button>
15- </div>
16- )
17- }
5+ ` ;
6+
7+ export const usageDocs = `
8+ <Button>A normal button</Button>
9+ <Button variant='secondary'>Button</Button>
10+ <Button variant='destructive'>Button</Button>
11+ <Button variant='outline'>Button</Button>
12+ <Button variant='ghost'>Button</Button>
13+ <Button variant='link'>Button</Button>
1814` ;
Original file line number Diff line number Diff line change 11export const name = "Card" ;
22
3- export const usage = `
3+ export const importDocs = `
44import {
55 Card,
66 CardContent,
99 CardHeader,
1010 CardTitle,
1111} from "/components/ui/card"
12+ ` ;
1213
14+ export const usageDocs = `
1315<Card>
1416 <CardHeader>
1517 <CardTitle>Card Title</CardTitle>
Original file line number Diff line number Diff line change 11export const name = "Checkbox" ;
22
3- export const usage = `
4- import {
5- Card,
6- CardContent,
7- CardDescription,
8- CardFooter,
9- CardHeader,
10- CardTitle,
11- } from "/components/ui/card"
3+ export const importDocs = `
4+ import { Checkbox } from "/components/ui/checkbox"
5+ ` ;
126
13- <Card>
14- <CardHeader>
15- <CardTitle>Card Title</CardTitle>
16- <CardDescription>Card Description</CardDescription>
17- </CardHeader>
18- <CardContent>
19- <p>Card Content</p>
20- </CardContent>
21- <CardFooter>
22- <p>Card Footer</p>
23- </CardFooter>
24- </Card>
7+ export const usageDocs = `
8+ <Checkbox />
259` ;
Original file line number Diff line number Diff line change 11import * as Avatar from "./avatar" ;
22import * as Button from "./button" ;
33import * as Card from "./card" ;
4+ import * as Checkbox from "./checkbox" ;
5+ import * as Input from "./input" ;
6+ import * as Label from "./label" ;
7+ import * as RadioGroup from "./radio-group" ;
8+ import * as Select from "./select" ;
9+ import * as Textarea from "./textarea" ;
410
5- const shadcnDocs = [ Avatar , Button , Card ] ;
11+ const shadcnDocs = [
12+ Avatar ,
13+ Button ,
14+ Card ,
15+ Checkbox ,
16+ Input ,
17+ Label ,
18+ RadioGroup ,
19+ Select ,
20+ Textarea ,
21+ ] ;
622
723export default shadcnDocs ;
Original file line number Diff line number Diff line change 1+ export const name = "Input" ;
2+
3+ export const importDocs = `
4+ import { Input } from "/components/ui/input"
5+ ` ;
6+
7+ export const usageDocs = `
8+ <Input />
9+ ` ;
Original file line number Diff line number Diff line change 1+ export const name = "Label" ;
2+
3+ export const importDocs = `
4+ import { Label } from "/components/ui/label"
5+ ` ;
6+
7+ export const usageDocs = `
8+ <Label htmlFor="email">Your email address</Label>
9+ ` ;
Original file line number Diff line number Diff line change 1+ export const name = "RadioGroup" ;
2+
3+ export const importDocs = `
4+ import { Label } from "/components/ui/label"
5+ import { RadioGroup, RadioGroupItem } from "/components/ui/radio-group"
6+ ` ;
7+
8+ export const usageDocs = `
9+ <RadioGroup defaultValue="option-one">
10+ <div className="flex items-center space-x-2">
11+ <RadioGroupItem value="option-one" id="option-one" />
12+ <Label htmlFor="option-one">Option One</Label>
13+ </div>
14+ <div className="flex items-center space-x-2">
15+ <RadioGroupItem value="option-two" id="option-two" />
16+ <Label htmlFor="option-two">Option Two</Label>
17+ </div>
18+ </RadioGroup>
19+ ` ;
Original file line number Diff line number Diff line change 1+ export const name = "Select" ;
2+
3+ export const importDocs = `
4+ import {
5+ Select,
6+ SelectContent,
7+ SelectItem,
8+ SelectTrigger,
9+ SelectValue,
10+ } from "@/components/ui/select"
11+ ` ;
12+
13+ export const usageDocs = `
14+ <Select>
15+ <SelectTrigger className="w-[180px]">
16+ <SelectValue placeholder="Theme" />
17+ </SelectTrigger>
18+ <SelectContent>
19+ <SelectItem value="light">Light</SelectItem>
20+ <SelectItem value="dark">Dark</SelectItem>
21+ <SelectItem value="system">System</SelectItem>
22+ </SelectContent>
23+ </Select>
24+ ` ;
You can’t perform that action at this time.
0 commit comments