Skip to content

Commit 15b8178

Browse files
committed
fix: merge conflict
2 parents 19c447f + 59df8d9 commit 15b8178

5 files changed

Lines changed: 115 additions & 6 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
on:
2-
workflow_dispatch:
2+
workflow_dispatch:
33

44
permissions:
55
contents: write

src/components/ComponentCard.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,12 @@ export const ComponentCard = ({
225225
</TabsContent>
226226

227227
<TabsContent value="code" className="p-4 sm:p-5 lg:p-6">
228-
<CodeBlock code={code} componentName={title} />
229-
{loading ? <Skeleton width="100%" height="200px" /> : <CodeBlock code={code} />}
230-
{loading ? <Skeleton width="100%" height="200px" className={isDark ? 'bg-zinc-700' : 'bg-zinc-200'} /> : <CodeBlock code={code} />}
231-
</TabsContent>
228+
{loading ? (
229+
<Skeleton width="100%" height="200px" className={isDark ? 'bg-zinc-700' : 'bg-zinc-200'} />
230+
) : (
231+
<CodeBlock code={code} componentName={title} />
232+
)}
233+
</TabsContent>
232234
</Tabs>
233235
</Card>
234236
);

src/components/ui/Accordion.tsx

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import { useState } from "react";
2+
import { ChevronDown } from "lucide-react";
3+
4+
interface AccordionItemProps {
5+
title: string;
6+
content: string;
7+
isOpen: boolean;
8+
onClick: () => void;
9+
}
10+
11+
const AccordionItem = ({ title, content, isOpen, onClick }: AccordionItemProps) => {
12+
return (
13+
<div className="border-b bg-black dark:bg-white border-gray-100 last:border-none">
14+
<button
15+
onClick={onClick}
16+
className="flex w-full items-center justify-between py-3 px-4 text-left text-sm font-medium text-white dark:text-gray-700 transition-colors rounded-xl"
17+
>
18+
<span>{title}</span>
19+
<ChevronDown
20+
className={`h-4 w-4 text-gray-400 transition-transform duration-200 ${
21+
isOpen ? "rotate-180" : ""
22+
}`}
23+
/>
24+
</button>
25+
<div
26+
className={`transition-all duration-300 ease-in-out overflow-hidden ${
27+
isOpen ? "max-h-96 opacity-100" : "max-h-0 opacity-0"
28+
}`}
29+
>
30+
<div className="px-4 pb-3 dark:text-gray-600 text-gray-200 text-sm leading-relaxed">
31+
{content}
32+
</div>
33+
</div>
34+
</div>
35+
);
36+
};
37+
38+
const Accordion = () => {
39+
const [openIndex, setOpenIndex] = useState<number | null>(null);
40+
41+
const items = [
42+
{
43+
title: "✨ What is DevUI?",
44+
content:
45+
"DevUI is a modern, open-source component library to build beautiful apps faster.",
46+
},
47+
{
48+
title: "🤝 Can I contribute?",
49+
content:
50+
"Yes! Fork our GitHub repo, submit your PR, and join our awesome community.",
51+
},
52+
{
53+
title: "💜 Is it free?",
54+
content:
55+
"Absolutely! DevUI is free under the MIT license. Use it anywhere without limits.",
56+
},
57+
];
58+
59+
return (
60+
<div className="w-full max-w-lg mx-auto p-6">
61+
<div className="rounded-2xl border border-gray-200 bg-white shadow-sm overflow-hidden">
62+
{items.map((item, i) => (
63+
<AccordionItem
64+
key={i}
65+
{...item}
66+
isOpen={openIndex === i}
67+
onClick={() => setOpenIndex(openIndex === i ? null : i)}
68+
/>
69+
))}
70+
</div>
71+
</div>
72+
);
73+
};
74+
75+
export default Accordion;

src/components/ui/card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function Card({ className, ...props }: React.ComponentProps<"div">) {
77
<div
88
data-slot="card"
99
className={cn(
10-
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm transition-shadow transition-colors duration-300 hover:shadow-md hover:border-primary/30",
10+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm transition-shadow duration-300 hover:shadow-md hover:border-primary/30",
1111
className
1212
)}
1313
{...props}

src/data/components.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ import {
5959
DrawerTitle,
6060
DrawerTrigger,
6161
} from "@/components/ui/drawer";
62+
6263
import { FileUpload } from "@/components/ui/file-upload";
6364
// REMOVED: import React, { useState } from "react";
6465
// ADDED: Import the component that now correctly encapsulates useState:
6566
import { SliderDemo } from "@/components/ui/sliderDemo";
67+
import Accordion from "@/components/ui/Accordion";
6668

6769
export const componentsData = [
6870
{
@@ -1078,4 +1080,34 @@ export function SonnerDemo() {
10781080
)
10791081
}`,
10801082
},
1083+
{
1084+
id: "accordion",
1085+
title: "Accordion",
1086+
description: "A vertically stacked set of expandable panels that reveal hidden content.",
1087+
category: "Display",
1088+
preview: <Accordion />,
1089+
code: `import Accordion from "@/components/ui/Accordion"
1090+
1091+
import Accordion from "@/components/ui/Accordion"
1092+
1093+
export function AccordionDemo() {
1094+
const items = [
1095+
{
1096+
title: "✨ What is DevUI?",
1097+
content: "DevUI is a modern, open-source component library to build beautiful apps faster."
1098+
},
1099+
{
1100+
title: "🤝 Can I contribute?",
1101+
content: "Yes! Fork our GitHub repo, submit your PR, and join our awesome community."
1102+
},
1103+
{
1104+
title: "💜 Is it free?",
1105+
content: "Absolutely! DevUI is free under the MIT license. Use it anywhere without limits."
1106+
}
1107+
]
1108+
1109+
return <Accordion items={items} />
1110+
}`,
1111+
},
1112+
10811113
];

0 commit comments

Comments
 (0)