From e1db9b1b6901fbc91f5392e79cf923918b0aac8e Mon Sep 17 00:00:00 2001 From: DeepnaPooja Date: Fri, 2 Oct 2026 13:19:02 +0530 Subject: [PATCH] add shared card and toggle components --- distribution_fe/components/ui/card.tsx | 99 ++++++++++++++++++++++++ distribution_fe/components/ui/switch.tsx | 31 ++++++++ 2 files changed, 130 insertions(+) create mode 100644 distribution_fe/components/ui/card.tsx create mode 100644 distribution_fe/components/ui/switch.tsx diff --git a/distribution_fe/components/ui/card.tsx b/distribution_fe/components/ui/card.tsx new file mode 100644 index 0000000..3a62fd8 --- /dev/null +++ b/distribution_fe/components/ui/card.tsx @@ -0,0 +1,99 @@ +import * as React from "react" +import { cn } from "cn" + +function Card({ + className, + size = "default", + ...props +}: React.ComponentProps<"div"> & { size?: "default" | "sm" }) { + return ( +
img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] dark:ring-foreground/10 *:[img:first-child]:rounded-t-[min(var(--radius-4xl),24px)] *:[img:last-child]:rounded-b-[min(var(--radius-4xl),24px)]", + 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, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardContent({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardFooter({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +export { + Card, + CardHeader, + CardFooter, + CardTitle, + CardAction, + CardDescription, + CardContent, +} diff --git a/distribution_fe/components/ui/switch.tsx b/distribution_fe/components/ui/switch.tsx new file mode 100644 index 0000000..3424d16 --- /dev/null +++ b/distribution_fe/components/ui/switch.tsx @@ -0,0 +1,31 @@ +"use client" + +import { Switch as SwitchPrimitive } from "@base-ui/react/switch" +import { cn } from "cn" + +function Switch({ + className, + size = "default", + ...props +}: SwitchPrimitive.Root.Props & { + size?: "sm" | "default" +}) { + return ( + + + + ) +} + +export { Switch }