From a7f088fb631f6f1ea196ccd7d4826d9c68f25110 Mon Sep 17 00:00:00 2001 From: diubi Date: Wed, 11 Mar 2026 22:41:52 +0100 Subject: [PATCH 1/7] 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, From c7e7edc30038c62c220d42216e11b8b3817ddb0e Mon Sep 17 00:00:00 2001 From: diubi Date: Tue, 17 Mar 2026 23:03:47 +0100 Subject: [PATCH 5/7] created cardCaption.tsx --- src/components/ui/cards/cardCaption.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/components/ui/cards/cardCaption.tsx diff --git a/src/components/ui/cards/cardCaption.tsx b/src/components/ui/cards/cardCaption.tsx new file mode 100644 index 0000000..79b9a25 --- /dev/null +++ b/src/components/ui/cards/cardCaption.tsx @@ -0,0 +1,16 @@ +import type { LucideIcon } from "lucide-react" +import { Card, CardAction, CardContent, CardHeader, CardTitle } from "./card" + +export function CardCaption({ title, description, icon }: { title: string; description: string; icon: LucideIcon }) { + return ( + + + {title} + + + +

{description}

+
+
+ ) +} From ba908ea33598a6fad4c43f0d6d7c7497c14d4502 Mon Sep 17 00:00:00 2001 From: diubi Date: Wed, 18 Mar 2026 00:15:54 +0100 Subject: [PATCH 6/7] Updated card-caption to use react-icons --- package.json | 3 ++- pnpm-lock.yaml | 12 ++++++++++++ src/app/page.tsx | 16 +++++++++++++++ src/components/card-caption.tsx | 26 +++++++++++++++++++++++++ src/components/ui/{cards => }/card.tsx | 21 ++++++++++++++------ src/components/ui/cards/cardCaption.tsx | 16 --------------- 6 files changed, 71 insertions(+), 23 deletions(-) create mode 100644 src/components/card-caption.tsx rename src/components/ui/{cards => }/card.tsx (76%) delete mode 100644 src/components/ui/cards/cardCaption.tsx diff --git a/package.json b/package.json index a42c193..c3efba7 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "react": "^19.2.3", "react-dom": "^19.2.3", "react-hook-form": "^7.68.0", + "react-icons": "^5.6.0", "tailwind-merge": "^3.4.0", "tailwindcss-animate": "^1.0.7", "zod": "^4.2.1" @@ -44,7 +45,7 @@ "tw-animate-css": "^1.4.0", "typescript": "^5.9.3" }, - "packageManager": "pnpm@10.17.1", + "packageManager": "pnpm@10.32.1", "engines": { "node": ">=24.5.2" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d138111..e3ff7d2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,6 +56,9 @@ importers: react-hook-form: specifier: ^7.68.0 version: 7.68.0(react@19.2.3) + react-icons: + specifier: ^5.6.0 + version: 5.6.0(react@19.2.3) tailwind-merge: specifier: ^3.4.0 version: 3.4.0 @@ -1035,6 +1038,11 @@ packages: peerDependencies: react: ^16.8.0 || ^17 || ^18 || ^19 + react-icons@5.6.0: + resolution: {integrity: sha512-RH93p5ki6LfOiIt0UtDyNg/cee+HLVR6cHHtW3wALfo+eOHTp8RnU2kRkI6E+H19zMIs03DyxUG/GfZMOGvmiA==} + peerDependencies: + react: '*' + react-remove-scroll-bar@2.3.8: resolution: {integrity: sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==} engines: {node: '>=10'} @@ -1904,6 +1912,10 @@ snapshots: dependencies: react: 19.2.3 + react-icons@5.6.0(react@19.2.3): + dependencies: + react: 19.2.3 + react-remove-scroll-bar@2.3.8(@types/react@19.2.7)(react@19.2.3): dependencies: react: 19.2.3 diff --git a/src/app/page.tsx b/src/app/page.tsx index ecc1240..3d84309 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,4 +1,6 @@ import { Users } from "lucide-react" +import { FaBookBookmark } from "react-icons/fa6" +import { CardCaption } from "@/components/card-caption" import { Button } from "@/components/ui/button" import { ButtonWithIcon } from "@/components/ui/buttonWithIcon" @@ -17,6 +19,20 @@ export default function Home() {
+
+ + +
) } diff --git a/src/components/card-caption.tsx b/src/components/card-caption.tsx new file mode 100644 index 0000000..78ede55 --- /dev/null +++ b/src/components/card-caption.tsx @@ -0,0 +1,26 @@ +import type { IconType } from "react-icons" +import { Card, CardAction, CardContent, CardHeader, CardTitle } from "./ui/card" + +export function CardCaption({ + title, + caption, + icon, + iconPosition = "right", +}: { + title: string + caption: string + icon?: IconType + iconPosition?: "top" | "right" +}) { + return ( + + + {title} + {icon && } + + +

{caption}

+
+
+ ) +} diff --git a/src/components/ui/cards/card.tsx b/src/components/ui/card.tsx similarity index 76% rename from src/components/ui/cards/card.tsx rename to src/components/ui/card.tsx index 212585d..5fdc386 100644 --- a/src/components/ui/cards/card.tsx +++ b/src/components/ui/card.tsx @@ -1,8 +1,8 @@ -import type { LucideIcon } from "lucide-react" import * as React from "react" +import type { IconType } from "react-icons" import { cn } from "@/lib/utils" -import { Glass } from "../../glass" -import { Button } from "../button" +import { Glass } from "../glass" +import { Button } from "./button" function Card({ className, @@ -14,7 +14,7 @@ function Card({ data-slot="card" data-size={size} className={cn( - "ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-xl text-sm has-[>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", + "w-78 h-66 ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-xl text-sm has-[>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} @@ -52,7 +52,12 @@ function CardDescription({ className, ...props }: React.ComponentProps<"div">) { return
} -function CardAction({ className, icon: Icon, ...props }: React.ComponentProps<"div"> & { icon: LucideIcon }) { +function CardAction({ + className, + icon: Icon, + iconSize = "normal", + ...props +}: React.ComponentProps<"div"> & { icon: IconType; iconSize: "normal" | "large" }) { const gradientId = React.useId() return ( @@ -69,7 +74,11 @@ function CardAction({ className, icon: Icon, ...props }: React.ComponentProps<"d - +
) } diff --git a/src/components/ui/cards/cardCaption.tsx b/src/components/ui/cards/cardCaption.tsx deleted file mode 100644 index 79b9a25..0000000 --- a/src/components/ui/cards/cardCaption.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import type { LucideIcon } from "lucide-react" -import { Card, CardAction, CardContent, CardHeader, CardTitle } from "./card" - -export function CardCaption({ title, description, icon }: { title: string; description: string; icon: LucideIcon }) { - return ( - - - {title} - - - -

{description}

-
-
- ) -} From 53c372f7a57645a774fbe0a6341a66c36c5891a1 Mon Sep 17 00:00:00 2001 From: diubi Date: Wed, 18 Mar 2026 00:33:26 +0100 Subject: [PATCH 7/7] Adjusted font sizes --- src/app/page.tsx | 2 +- src/components/ui/card.tsx | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 3d84309..03a15b9 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -21,7 +21,7 @@ export default function Home() {
) {
) { - return
+ return ( +
+ ) } function CardBottomButton({ className, ...props }: React.ComponentProps) {