From a7f088fb631f6f1ea196ccd7d4826d9c68f25110 Mon Sep 17 00:00:00 2001 From: diubi Date: Wed, 11 Mar 2026 22:41:52 +0100 Subject: [PATCH 1/4] Card initial commit --- src/app/page.tsx | 14 +++++++- src/components/ui/card.tsx | 74 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 src/components/ui/card.tsx diff --git a/src/app/page.tsx b/src/app/page.tsx index ecc1240..e625073 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,6 +1,7 @@ -import { Users } from "lucide-react" +import { CropIcon, Users } from "lucide-react" import { Button } from "@/components/ui/button" import { ButtonWithIcon } from "@/components/ui/buttonWithIcon" +import { Card, CardAction, CardBottomButton, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" export default function Home() { return ( @@ -17,6 +18,17 @@ export default function Home() { + + + + Card Title + + + +

description: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incidunt ut labore et dolore magna aliqua.

+
+ Button +
) } diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx new file mode 100644 index 0000000..630278a --- /dev/null +++ b/src/components/ui/card.tsx @@ -0,0 +1,74 @@ +import type { LucideIcon } from "lucide-react" +import type * as React from "react" +import { cn } from "@/lib/utils" +import { Glass } from "../glass" +import { Button } from "./button" + +function Card({ className, size = "default", ...props }: React.ComponentProps<"div"> & { size?: "default" | "sm" }) { + return ( + img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col", + className + )} + {...props} + /> + ) +} + +function CardHeader({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardTitle({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardDescription({ className, ...props }: React.ComponentProps<"div">) { + return
+} + +function CardAction({ className, icon: Icon, ...props }: React.ComponentProps<"div"> & { icon: LucideIcon }) { + return ( +
+ +
+ ) +} + +function CardContent({ className, ...props }: React.ComponentProps<"div">) { + return
+} + +function CardBottomButton({ className, ...props }: React.ComponentProps) { + return ( +
- - - - Title - - - -

- description: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incidunt ut - labore et dolore magna aliqua. -

-
- Label -
) } diff --git a/src/components/ui/card.tsx b/src/components/ui/cards/card.tsx similarity index 97% rename from src/components/ui/card.tsx rename to src/components/ui/cards/card.tsx index 516f553..212585d 100644 --- a/src/components/ui/card.tsx +++ b/src/components/ui/cards/card.tsx @@ -1,8 +1,8 @@ import type { LucideIcon } from "lucide-react" import * as React from "react" import { cn } from "@/lib/utils" -import { Glass } from "../glass" -import { Button } from "./button" +import { Glass } from "../../glass" +import { Button } from "../button" function Card({ className,