fix: harden kumo base component styling

This commit is contained in:
2026-07-02 10:21:25 -07:00
parent 04f2dfc229
commit c394d85236
9 changed files with 234 additions and 13 deletions

View File

@@ -1,6 +1,8 @@
import * as React from "react";
import { Badge as KumoBadge } from "@cloudflare/kumo/components/badge";
import { cn } from "@/lib/utils";
type KumoBadgeProps = React.ComponentProps<typeof KumoBadge>;
type LegacyBadgeVariant = "default" | "secondary" | "outline" | "success" | "warning" | "danger";
@@ -19,8 +21,8 @@ export type BadgeProps = Omit<KumoBadgeProps, "variant" | "children"> & {
children?: React.ReactNode;
};
export function Badge({ variant = "default", ...props }: BadgeProps): React.ReactElement {
export function Badge({ className, variant = "default", ...props }: BadgeProps): React.ReactElement {
const mappedVariant = variant in variantMap ? variantMap[variant as LegacyBadgeVariant] : (variant as KumoBadgeProps["variant"]);
return <KumoBadge variant={mappedVariant} {...(props as KumoBadgeProps)} />;
return <KumoBadge className={cn("teatea-badge", className)} variant={mappedVariant} {...(props as KumoBadgeProps)} />;
}