Skip to content

Commit e13259d

Browse files
committed
✅ checkbox
1 parent 1dee82b commit e13259d

File tree

17 files changed

+301
-8
lines changed

17 files changed

+301
-8
lines changed

app/(docs)/docs/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function ComponentLayout({
1515
<div className="hidden lg:block">
1616
<SideNav />
1717
</div>
18-
<div className="lg:ml-72 mt-16 px-4 lg:px-0">{children}</div>
18+
<div className="lg:ml-72 px-4 lg:px-0">{children}</div>
1919
</div>
2020
);
2121
}

app/(marketing)/blogs/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ export default function BlogsLayout({
99
}: Readonly<{
1010
children: React.ReactNode;
1111
}>) {
12-
return <div className="max-w-6xl mx-auto pt-12">{children}</div>;
12+
return <div className="max-w-6xl mx-auto pt-12 px-4 lg:px-0">{children}</div>;
1313
}

app/(marketing)/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export default async function Home() {
222222
Github Stars
223223
</Text>
224224
<Text as="h1" className="text-outlined text-7xl lg:text-8xl">
225-
230+
225+
300+
226226
</Text>
227227
<Image
228228
src="/images/shooting_star.svg"

app/(sink)/demo/components/page.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Avatar,
77
Badge,
88
Button,
9+
Checkbox,
910
Menu,
1011
Tabs,
1112
TabsContent,
@@ -31,6 +32,15 @@ export default function page() {
3132
<BadgeStyleVariants />
3233
</div>
3334

35+
<div className="space-x-4">
36+
<Checkbox />
37+
<Checkbox variant="outline" />
38+
<Checkbox variant="solid" />
39+
<Checkbox size="sm" />
40+
<Checkbox size="md" />
41+
<Checkbox size="lg" />
42+
</div>
43+
3444
<div className="flex items-center space-x-4">
3545
<Avatar>
3646
<Avatar.Image src="/images/avatar.jpeg" alt="Arif Logs" />

app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const metadata: Metadata = {
2929
description:
3030
"RetroUI - Retro styled component library built with React and TailwindCSS for modern web apps.",
3131
openGraph: {
32-
images: "/banner.png",
32+
images: "https://retroui.dev/banner.png",
3333
title: "Retro Styled React UI Library | Retro UI",
3434
},
3535
};

components/SideNav.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { navConfig } from "@/config/navigation";
2-
import { Text } from "@/packages/ui";
2+
import { Badge, Text } from "@/packages/ui";
33
import Link from "next/link";
44

55
export default function SideNav() {
@@ -15,6 +15,11 @@ export default function SideNav() {
1515
{item.children.map((child) => (
1616
<Link key={child.title} href={child.href}>
1717
{child.title}
18+
{child.tag && (
19+
<Badge size="sm" className="ml-2">
20+
{child.tag}
21+
</Badge>
22+
)}
1823
</Link>
1924
))}
2025
</div>

config/components.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ export const componentConfig = {
2626
name: "card",
2727
filePath: "packages/ui/Cards/Card.tsx",
2828
},
29-
29+
checkbox: {
30+
name: "checkbox",
31+
filePath: "packages/ui/Form/Checkbox.tsx",
32+
},
3033
dialog: {
3134
name: "dialog",
3235
filePath: "packages/ui/Dialog/Dialog.tsx",
@@ -141,6 +144,28 @@ export const componentConfig = {
141144
() => import("@/preview/components/card-style-testimonial")
142145
),
143146
},
147+
"checkbox-style-default": {
148+
name: "checkbox-style-default",
149+
filePath: "preview/components/checkbox-style-default.tsx",
150+
preview: lazy(
151+
() => import("@/preview/components/checkbox-style-default")
152+
),
153+
},
154+
"checkbox-style-variants": {
155+
name: "checkbox-style-toggle",
156+
filePath: "preview/components/checkbox-style-variants.tsx",
157+
preview: lazy(
158+
() => import("@/preview/components/checkbox-style-variants")
159+
),
160+
},
161+
"checkbox-style-sizes": {
162+
name: "checkbox-style-default",
163+
filePath: "preview/components/checkbox-style-sizes.tsx",
164+
preview: lazy(() => import("@/preview/components/checkbox-style-sizes")),
165+
},
166+
"dropdown-style-default": {
167+
name: "dropdown-style-default",
168+
},
144169
"input-style-default": {
145170
name: "input-style-default",
146171
filePath: "preview/components/input-style-default.tsx",

config/navigation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const navConfig: INavigationConfig = {
2323
{ title: "Badge", href: `${componentsRoute}/badge` },
2424
{ title: "Button", href: `${componentsRoute}/button` },
2525
{ title: "Card", href: `${componentsRoute}/card` },
26+
{ title: "Checkbox", href: `${componentsRoute}/checkbox`, tag: "New" },
2627
{ title: "Dialog", href: `${componentsRoute}/dialog` },
2728
{ title: "Input", href: `${componentsRoute}/input` },
2829
{ title: "Menu", href: `${componentsRoute}/menu` },

content/docs/components/checkbox.mdx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: Checkbox
3+
description: Let users confirm or reject an option.
4+
lastUpdated: 13 Feb, 2024
5+
links:
6+
api_reference: https://www.radix-ui.com/primitives/docs/components/checkbox#api-reference
7+
source: https://github.com/Logging-Stuff/RetroUI/blob/main/packages/ui/Form/Checkbox.tsx
8+
---
9+
10+
<ComponentShowcase name="checkbox-style-default" />
11+
<br />
12+
<br />
13+
14+
## Installation
15+
16+
#### 1. Install dependencies:
17+
18+
```sh
19+
npm install @radix-ui/react-checkbox class-variance-authority lucide-react
20+
```
21+
22+
<br />
23+
24+
#### 2. Copy the code 👇 into your project:
25+
26+
<ComponentSource name="checkbox" />
27+
<br />
28+
<br />
29+
30+
## Examples
31+
32+
### Variants
33+
34+
<ComponentShowcase name="checkbox-style-variants" />
35+
<br />
36+
<br />
37+
38+
### Sizes
39+
40+
<ComponentShowcase name="checkbox-style-sizes" />

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@headlessui/react": "^2.1.9",
1313
"@radix-ui/react-accordion": "^1.2.1",
1414
"@radix-ui/react-avatar": "^1.1.1",
15+
"@radix-ui/react-checkbox": "^1.1.4",
1516
"@radix-ui/react-dialog": "^1.1.2",
1617
"@radix-ui/react-dropdown-menu": "^2.1.2",
1718
"@radix-ui/react-visually-hidden": "^1.1.0",

0 commit comments

Comments
 (0)