Skip to content

Commit

Permalink
type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CrisTofani committed Oct 23, 2023
1 parent b1e059b commit 5274d7a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ export type Badge = WithTestID<{
| "contrast";
}>;

type VariantProps = {
type SolidVariantProps = {
background: IOColors;
foreground: IOColors;
background?: IOColors;
};

const mapVariants: Record<NonNullable<Badge["variant"]>, VariantProps> = {
const mapVariants: Record<NonNullable<Badge["variant"]>, SolidVariantProps> = {
default: {
foreground: "grey-700",
background: "grey-50"
Expand Down Expand Up @@ -74,9 +74,14 @@ const mapVariants: Record<NonNullable<Badge["variant"]>, VariantProps> = {
}
};

type OutlinedVariantProps = {
foreground: IOColors;
background?: never;
};

const mapOutlineVariants: Record<
NonNullable<Badge["variant"]>,
VariantProps
OutlinedVariantProps
> = {
default: {
foreground: "grey-700"
Expand Down

0 comments on commit 5274d7a

Please sign in to comment.