mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-15 15:35:25 +02:00
🎨 Update UI package (#1070)
Add new components and update various existing ones.
This commit is contained in:
parent
a4ffbee081
commit
e6792a4283
33 changed files with 386 additions and 56 deletions
40
packages/ui/src/icon.tsx
Normal file
40
packages/ui/src/icon.tsx
Normal file
|
@ -0,0 +1,40 @@
|
|||
"use client";
|
||||
import { Slot } from "@radix-ui/react-slot";
|
||||
import { cn } from "./lib/utils";
|
||||
import { VariantProps, cva } from "class-variance-authority";
|
||||
|
||||
const iconVariants = cva("", {
|
||||
variants: {
|
||||
variant: {
|
||||
default: "text-gray-500",
|
||||
success: "text-green-500",
|
||||
danger: "text-rose-500",
|
||||
primary: "text-primary-200",
|
||||
},
|
||||
size: {
|
||||
md: "w-4 h-4",
|
||||
lg: "w-5 h-5",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
size: "md",
|
||||
variant: "default",
|
||||
},
|
||||
});
|
||||
|
||||
export interface IconProps extends VariantProps<typeof iconVariants> {
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
export function Icon({ children, size, variant }: IconProps) {
|
||||
return (
|
||||
<Slot
|
||||
className={cn(
|
||||
iconVariants({ size, variant }),
|
||||
"group-[.bg-primary]:text-primary-200 group",
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</Slot>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue