Skip to content

Commit bbaa57f

Browse files
authored
Merge pull request #43 from Logging-Stuff/shadcn-support
we can now install from shadcn
2 parents 2459ac8 + d6ff80d commit bbaa57f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1870
-84
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424

2525
- name: Build and push to DockerHub
2626
run: |
27-
docker build -t devarifhossain/retroui:1.1.1 ./
28-
docker push devarifhossain/retroui:1.1.1
27+
docker build -t devarifhossain/retroui:1.1.2 ./
28+
docker push devarifhossain/retroui:1.1.2
2929
3030
# - name: Set up SSH
3131
# uses: webfactory/ssh-agent@v0.9.0

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-
250+
225+
350+
226226
</Text>
227227
<Image
228228
src="/images/shooting_star.svg"

components/ComponentInstall.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { componentConfig } from "@/config";
2+
import { Tab, TabGroup, TabList, TabPanel, TabPanels } from "@headlessui/react";
3+
import { Code } from "lucide-react";
4+
import { HTMLAttributes } from "react";
5+
6+
interface IComponentShowcase extends HTMLAttributes<HTMLDivElement> {}
7+
8+
function ComponentInstallCli({ children }: { children: React.ReactNode }) {
9+
return <TabPanel>{children}</TabPanel>;
10+
}
11+
12+
function ComponentInstallManual({ children }: { children: React.ReactNode }) {
13+
return <TabPanel>{children}</TabPanel>;
14+
}
15+
16+
function ComponentInstall({ children }: IComponentShowcase) {
17+
return (
18+
<TabGroup>
19+
<TabList className="border-b bg-transparent flex space-x-4 mb-6">
20+
<Tab className="text-lg min-w-12 relative px-2 py-1 border-b-2 border-b-transparent bg-transparent data-[selected]:border-primary-500 data-[selected]:text-foreground focus:outline-none">
21+
CLI
22+
</Tab>
23+
<Tab className="text-lg min-w-12 relative px-2 py-1 border-b-2 border-b-transparent bg-transparent data-[selected]:border-primary-500 data-[selected]:text-foreground focus:outline-none">
24+
Manual
25+
</Tab>
26+
</TabList>
27+
28+
<TabPanels>{children}</TabPanels>
29+
</TabGroup>
30+
);
31+
}
32+
33+
Object.assign(ComponentInstall, {
34+
Cli: ComponentInstallCli,
35+
Manual: ComponentInstallManual,
36+
});
37+
38+
export { ComponentInstall };

components/ComponentShowcase.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ export function ComponentShowcase({ name, children }: IComponentShowcase) {
1212

1313
return (
1414
<TabGroup>
15-
<TabList className="space-x-4 ">
16-
<Tab className="text-lg px-1 border-black data-[selected]:border-b-2 focus:outline-none">
15+
<TabList className="space-x-4 border-b mb-6">
16+
<Tab className="min-w-12 text-lg relative px-2 py-1 border-b-2 border-b-transparent bg-transparent data-[selected]:border-primary-500 data-[selected]:text-foreground focus:outline-none">
1717
Preview
1818
</Tab>
19-
<Tab className="text-lg px-1 border-black data-[selected]:border-b-2 focus:outline-none">
19+
<Tab className="min-w-12 text-lg relative px-2 py-1 border-b-2 border-b-transparent bg-transparent data-[selected]:border-primary-500 data-[selected]:text-foreground focus:outline-none">
2020
Code
2121
</Tab>
2222
</TabList>

components/MDX.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { cn } from "@/lib/utils";
88
import { ComponentSource } from "./ComponentSource";
99
import { CodeBlock } from "./CodeBlock";
1010
import Link from "next/link";
11+
import { ComponentInstall } from "./ComponentInstall";
12+
import { TabGroup } from "@headlessui/react";
1113

1214
const components = (type: "doc" | "blog") => ({
1315
h1: (props: HTMLAttributes<HTMLHeadingElement>) => (
@@ -89,6 +91,7 @@ const components = (type: "doc" | "blog") => ({
8991
),
9092
ComponentShowcase,
9193
ComponentSource,
94+
ComponentInstall,
9295
});
9396

9497
export default function MDX({

config/components.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const componentConfig: {
55
[key: string]: {
66
name: string;
77
filePath: string;
8+
dependencies?: string[];
89
preview?: React.LazyExoticComponent<() => JSX.Element>;
910
};
1011
};
@@ -19,6 +20,7 @@ export const componentConfig: {
1920
core: {
2021
accordion: {
2122
name: "accordion",
23+
dependencies: ["@radix-ui/react-accordion", "lucide-react"],
2224
filePath: "packages/ui/Accordions/Accordion.tsx",
2325
},
2426
alert: {
@@ -51,7 +53,7 @@ export const componentConfig: {
5153
},
5254
input: {
5355
name: "input",
54-
filePath: "packages/ui/Input.tsx",
56+
filePath: "packages/ui/Form/Input.tsx",
5557
},
5658
menu: {
5759
name: "menu",

content/docs/components/accordion.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ links:
1313

1414
## Installation
1515

16+
<ComponentInstall>
17+
<ComponentInstall.Cli>
18+
```sh
19+
npx shadcn@latest add "https://retroui.dev/r/accordion.json"
20+
```
21+
</ComponentInstall.Cli>
22+
<ComponentInstall.Manual>
1623
#### 1. Install dependencies:
1724

1825
```sh
@@ -25,6 +32,9 @@ npm install @radix-ui/react-accordion lucide-react
2532

2633
<ComponentSource name="accordion" />
2734

35+
</ComponentInstall.Manual>
36+
</ComponentInstall>
37+
2838
<br />
2939
<br />
3040

content/docs/components/alert.mdx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ lastUpdated: 24 Oct, 2024
88
<br />
99
<br />
1010

11-
## Installation
12-
11+
<ComponentInstall>
12+
<ComponentInstall.Cli>
13+
```sh
14+
npx shadcn@latest add "https://retroui.dev/r/alert.json"
15+
```
16+
</ComponentInstall.Cli>
17+
<ComponentInstall.Manual>
1318
#### 1. Install dependencies:
1419

1520
```sh
@@ -22,6 +27,9 @@ npm install class-variance-authority
2227

2328
<ComponentSource name="alert" />
2429

30+
</ComponentInstall.Manual>
31+
</ComponentInstall>
32+
2533
<br />
2634
<br />
2735

content/docs/components/avatar.mdx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ lastUpdated: 12 Oct, 2024
88
<br />
99
<br />
1010

11-
## Installation
12-
11+
<ComponentInstall>
12+
<ComponentInstall.Cli>
13+
```sh
14+
npx shadcn@latest add "https://retroui.dev/r/avatar.json"
15+
```
16+
</ComponentInstall.Cli>
17+
<ComponentInstall.Manual>
1318
#### 1. Install dependencies:
1419

1520
```sh
@@ -22,6 +27,9 @@ npm install @radix-ui/react-avatar
2227

2328
<ComponentSource name="avatar" />
2429

30+
</ComponentInstall.Manual>
31+
</ComponentInstall>
32+
2533
<br />
2634
<br />
2735

content/docs/components/badge.mdx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ lastUpdated: 30 Oct, 2024
88
<br />
99
<br />
1010

11-
## Installation
12-
11+
<ComponentInstall>
12+
<ComponentInstall.Cli>
13+
```sh
14+
npx shadcn@latest add "https://retroui.dev/r/badge.json"
15+
```
16+
</ComponentInstall.Cli>
17+
<ComponentInstall.Manual>
1318
#### 1. Install dependencies:
1419

1520
```sh
@@ -21,9 +26,15 @@ npm install class-variance-authority
2126
#### 2. Copy the code 👇 into your project:
2227

2328
<ComponentSource name="badge" />
29+
30+
</ComponentInstall.Manual>
31+
</ComponentInstall>
32+
2433
<br />
2534
<br />
2635

36+
## Examples
37+
2738
### Default
2839

2940
<hr />

0 commit comments

Comments
 (0)