ar-test/app/components/ui/badge.tsx

13 lines
585 B
TypeScript

import type { ComponentProps } from 'react';
import { cva, type VariantProps } from 'class-variance-authority';
import { toneSurface } from '~/components/ui/tone';
import { cn } from '~/lib/utils';
const badgeVariants = cva('inline-flex select-none items-center gap-1 rounded-chip px-1.5 py-0.5 text-3xs font-medium');
export interface BadgeProps extends ComponentProps<'span'>, VariantProps<typeof toneSurface> {}
export function Badge({ className, tone, ...props }: BadgeProps) {
return <span className={cn(toneSurface({ tone }), badgeVariants(), className)} {...props} />;
}