From 5beed55523eae0111d636531e941ec505c911669 Mon Sep 17 00:00:00 2001 From: Corban Riley Date: Sun, 5 Jan 2025 20:59:32 -0500 Subject: [PATCH] Tag converted to tailwind --- src/components/Tag/Tag.tsx | 64 ++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/src/components/Tag/Tag.tsx b/src/components/Tag/Tag.tsx index 0aa6e31e..1df63f11 100644 --- a/src/components/Tag/Tag.tsx +++ b/src/components/Tag/Tag.tsx @@ -1,42 +1,40 @@ -import { ComponentType, ElementType, forwardRef } from 'react' +import { cva, VariantProps } from 'class-variance-authority' +import { ComponentType } from 'react' -import { - Box, - PolymorphicComponent, - PolymorphicProps, - PolymorphicRef, -} from '~/components/Box' import { Text } from '~/components/Text' import { IconProps } from '~/icons/types' -type TagProps = { +const tagVariants = cva( + [ + 'inline-flex', + 'gap-1', + 'px-2', + 'py-1', + 'whitespace-nowrap', + 'bg-button-glass', + 'text-text-80', + 'rounded-xs', + ], + { + variants: { + // Add any variants here if needed in the future + }, + } +) + +interface TagProps extends VariantProps { label: string icon?: ComponentType + className?: string } -export const Tag: PolymorphicComponent = forwardRef( - ( - props: PolymorphicProps, - ref: PolymorphicRef - ) => { - const { icon: Icon, label, ...rest } = props +export const Tag = (props: TagProps) => { + const { icon: Icon, label, className, ...rest } = props - return ( - - {Icon && } - {label} - - ) - } -) + return ( +
+ {Icon && } + {label} +
+ ) +}