Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
"use client";
import { mergeProps } from "@base-ui/react/merge-props";
import { useRender } from "@base-ui/react/use-render";
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "~/lib/utils";
const badgeVariants = cva(
"relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-3.5 sm:[&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button&,a&]:cursor-pointer [button&,a&]:pointer-coarse:after:absolute [button&,a&]:pointer-coarse:after:size-full [button&,a&]:pointer-coarse:after:min-h-11 [button&,a&]:pointer-coarse:after:min-w-11",
{
defaultVariants: {
size: "default",
variant: "default",
},
variants: {
size: {
"telemetry-health":
"shrink justify-start gap-1.5 whitespace-normal rounded-full px-2.5 py-1 text-[10px] font-semibold uppercase tracking-[0.08em]",
default:
"h-5.5 min-w-5.5 px-[calc(--spacing(1)-1px)] text-sm sm:h-4.5 sm:min-w-4.5 sm:text-xs",
lg: "h-6.5 min-w-6.5 px-[calc(--spacing(1.5)-1px)] text-base sm:h-5.5 sm:min-w-5.5 sm:text-sm",
sm: "h-5 min-w-5 rounded-[.25rem] px-[calc(--spacing(1)-1px)] text-xs sm:h-4 sm:min-w-4 sm:text-[.625rem]",
},
variant: {
"keybinding-default":
"bg-secondary text-foreground [button&,a&]:hover:bg-accent/80 font-normal text-muted-foreground/70",
"keybinding-custom":
"bg-secondary text-foreground [button&,a&]:hover:bg-accent/80 font-normal text-muted-foreground",
"telemetry-neutral": "border-border/70 bg-muted/45 text-muted-foreground",
"telemetry-healthy":
"border-success/25 bg-success/10 text-success-foreground dark:text-success-bright-foreground",
"telemetry-warning":
"border-telemetry-monitor/30 bg-telemetry-monitor/10 text-telemetry-status-foreground",
"telemetry-danger": "border-destructive/30 bg-destructive/10 text-destructive",
default: "bg-primary text-primary-foreground [button&,a&]:hover:bg-primary/90",
destructive: "bg-destructive text-on-solid [button&,a&]:hover:bg-destructive/90",
error: "bg-destructive/8 text-destructive-foreground dark:bg-destructive/16",
info: "bg-info/8 text-info-foreground dark:bg-info/16",
outline: "bg-secondary text-foreground [button&,a&]:hover:bg-accent/80",
quiet: "border-border/60 bg-background/60 text-muted-foreground",
secondary: "bg-secondary text-secondary-foreground [button&,a&]:hover:bg-secondary/90",
success: "bg-success/8 text-success-foreground dark:bg-success/16",
warning: "bg-warning/8 text-warning-foreground dark:bg-warning/16",
},
presentation: {
"connection-kind": "h-4 px-1.5 text-10px",
"default-trait":
"gap-0 border-border/70 bg-muted/60 px-1.5 py-0 font-semibold text-10px text-muted-foreground leading-none",
"environment-pill": "rounded-full px-1.5 text-muted-foreground",
},
},
},
);
interface BadgeProps extends useRender.ComponentProps<"span"> {
variant?: VariantProps<typeof badgeVariants>["variant"];
presentation?: VariantProps<typeof badgeVariants>["presentation"];
size?: VariantProps<typeof badgeVariants>["size"];
}
function Badge({ className, variant, size, presentation, render, ...props }: BadgeProps) {
const defaultProps = {
className: cn(badgeVariants({ className, size, variant, presentation })),
"data-slot": "badge",
};
return useRender({
defaultTagName: "span",
props: mergeProps<"span">(defaultProps, props),
render,
});
}
export { Badge, badgeVariants };