|
| 1 | +"use client"; |
| 2 | + |
| 3 | +import { useState } from "react"; |
| 4 | +import { |
| 5 | + Button, |
| 6 | + Card, |
| 7 | + Image, |
| 8 | + Input, |
| 9 | + Modal, |
| 10 | + Otp, |
| 11 | + Select, |
| 12 | + Skeleton, |
| 13 | + Tabs, |
| 14 | + TextArea, |
| 15 | + Toggle, |
| 16 | +} from "./components/ui"; |
| 17 | +import { Animation, Glow } from "./components/global"; |
| 18 | + |
1 | 19 | export default function Home() {
|
| 20 | + const [isModalOpen, setIsModalOpen] = useState(false); |
| 21 | + const [toggleState, setToggleState] = useState(false); |
| 22 | + const [inputValue, setInputValue] = useState(""); |
| 23 | + const [textAreaValue, setTextAreaValue] = useState(""); |
| 24 | + |
| 25 | + const tabs = [ |
| 26 | + { label: "Overview", value: "overview" }, |
| 27 | + { label: "Components", value: "components" }, |
| 28 | + { label: "Settings", value: "settings" }, |
| 29 | + ]; |
| 30 | + |
| 31 | + const selectOptions = [ |
| 32 | + { label: "Option 1", value: "1" }, |
| 33 | + { label: "Option 2", value: "2" }, |
| 34 | + { label: "Option 3", value: "3" }, |
| 35 | + ]; |
| 36 | + |
2 | 37 | return (
|
3 |
| - <div> |
4 |
| - <h1>Next.js Template</h1> |
5 |
| - </div> |
| 38 | + <Animation> |
| 39 | + <div className="min-h-screen bg-[#0f0f0f] p-8"> |
| 40 | + <div className="max-w-6xl mx-auto space-y-12"> |
| 41 | + {/* Header */} |
| 42 | + <div className="text-center space-y-4"> |
| 43 | + <h1 className="text-4xl font-bold text-white">UI Components</h1> |
| 44 | + <p className="text-[#FFFFFF80]"> |
| 45 | + A showcase of all available UI components |
| 46 | + </p> |
| 47 | + </div> |
| 48 | + |
| 49 | + {/* Tabs Navigation */} |
| 50 | + <Tabs |
| 51 | + tabs={tabs} |
| 52 | + defaultValue="components" |
| 53 | + className="justify-center" |
| 54 | + /> |
| 55 | + |
| 56 | + {/* Components Grid */} |
| 57 | + <div className="grid grid-cols-1 md:grid-cols-2 gap-8"> |
| 58 | + {/* Buttons Section */} |
| 59 | + <Glow className="p-6 space-y-4"> |
| 60 | + <h2 className="text-xl font-semibold text-white mb-4">Buttons</h2> |
| 61 | + <div className="space-y-4"> |
| 62 | + <Button variant="default">Default Button</Button> |
| 63 | + <Button variant="primary">Primary Button</Button> |
| 64 | + <Button variant="secondary">Secondary Button</Button> |
| 65 | + <Button variant="danger">Danger Button</Button> |
| 66 | + <Button variant="google">Google Button</Button> |
| 67 | + <Button loading>Loading Button</Button> |
| 68 | + </div> |
| 69 | + </Glow> |
| 70 | + |
| 71 | + {/* Form Inputs Section */} |
| 72 | + <Glow className="p-6 space-y-4"> |
| 73 | + <h2 className="text-xl font-semibold text-white mb-4">Inputs</h2> |
| 74 | + <Input |
| 75 | + placeholder="Regular Input" |
| 76 | + value={inputValue} |
| 77 | + onChange={(e: React.ChangeEvent<HTMLInputElement>) => |
| 78 | + setInputValue(e.target.value) |
| 79 | + } |
| 80 | + /> |
| 81 | + <Input |
| 82 | + type="password" |
| 83 | + placeholder="Password Input" |
| 84 | + value={inputValue} |
| 85 | + onChange={(e: React.ChangeEvent<HTMLInputElement>) => |
| 86 | + setInputValue(e.target.value) |
| 87 | + } |
| 88 | + /> |
| 89 | + <TextArea |
| 90 | + name="textarea" |
| 91 | + value={textAreaValue} |
| 92 | + onChange={(e: React.ChangeEvent<HTMLInputElement>) => |
| 93 | + setTextAreaValue(e.target.value) |
| 94 | + } |
| 95 | + placeholder="Text Area Input" |
| 96 | + /> |
| 97 | + </Glow> |
| 98 | + |
| 99 | + {/* Toggle & Select Section */} |
| 100 | + <Glow className="p-6 space-y-4"> |
| 101 | + <h2 className="text-xl font-semibold text-white mb-4"> |
| 102 | + Interactive Components |
| 103 | + </h2> |
| 104 | + <div className="space-y-6"> |
| 105 | + <div className="flex items-center justify-between"> |
| 106 | + <span className="text-white">Toggle Component</span> |
| 107 | + <Toggle checked={toggleState} onChange={setToggleState} /> |
| 108 | + </div> |
| 109 | + <Select |
| 110 | + options={selectOptions} |
| 111 | + placeholder="Select an option" |
| 112 | + onChange={(value) => console.log(value)} |
| 113 | + /> |
| 114 | + </div> |
| 115 | + </Glow> |
| 116 | + |
| 117 | + {/* Card & Image Section */} |
| 118 | + <Glow className="p-6 space-y-4"> |
| 119 | + <h2 className="text-xl font-semibold text-white mb-4"> |
| 120 | + Display Components |
| 121 | + </h2> |
| 122 | + <Card> |
| 123 | + <div className="bg-[#283142] p-4 rounded-lg"> |
| 124 | + <Image |
| 125 | + src="/placeholder.jpg" |
| 126 | + alt="Placeholder" |
| 127 | + width={300} |
| 128 | + height={200} |
| 129 | + className="rounded-lg" |
| 130 | + /> |
| 131 | + </div> |
| 132 | + </Card> |
| 133 | + </Glow> |
| 134 | + |
| 135 | + {/* Loading States Section */} |
| 136 | + <Glow className="p-6 space-y-4"> |
| 137 | + <h2 className="text-xl font-semibold text-white mb-4"> |
| 138 | + Loading States |
| 139 | + </h2> |
| 140 | + <div className="space-y-4"> |
| 141 | + <Skeleton className="h-12 w-full" /> |
| 142 | + <Skeleton className="h-12 w-3/4" /> |
| 143 | + <Skeleton className="h-12 w-1/2" /> |
| 144 | + </div> |
| 145 | + </Glow> |
| 146 | + |
| 147 | + {/* Modal & OTP Section */} |
| 148 | + <Glow className="p-6 space-y-4"> |
| 149 | + <h2 className="text-xl font-semibold text-white mb-4"> |
| 150 | + Advanced Components |
| 151 | + </h2> |
| 152 | + <div className="space-y-4"> |
| 153 | + <Button onClick={() => setIsModalOpen(true)}>Open Modal</Button> |
| 154 | + <div className="mt-8"> |
| 155 | + <h3 className="text-white mb-4">OTP Input</h3> |
| 156 | + <Otp /> |
| 157 | + </div> |
| 158 | + </div> |
| 159 | + </Glow> |
| 160 | + </div> |
| 161 | + </div> |
| 162 | + |
| 163 | + {/* Modal */} |
| 164 | + <Modal |
| 165 | + isOpen={isModalOpen} |
| 166 | + onClose={() => setIsModalOpen(false)} |
| 167 | + title="Modal Example" |
| 168 | + > |
| 169 | + <div className="space-y-4"> |
| 170 | + <p className="text-white"> |
| 171 | + This is an example modal that showcases the Modal component. |
| 172 | + </p> |
| 173 | + <Button |
| 174 | + variant="primary" |
| 175 | + onClick={() => setIsModalOpen(false)} |
| 176 | + className="w-full" |
| 177 | + > |
| 178 | + Close Modal |
| 179 | + </Button> |
| 180 | + </div> |
| 181 | + </Modal> |
| 182 | + </div> |
| 183 | + </Animation> |
6 | 184 | );
|
7 | 185 | }
|
0 commit comments