import { cn } from "./index3.js";
import { cva } from "class-variance-authority";
import { X } from "lucide-react";
import { forwardRef } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/components/atoms/display/Badge/Badge.tsx
var badgeVariants = cva("inline-flex items-center justify-center gap-1.5 font-medium transition-colors whitespace-nowrap shrink-0 [&>svg]:pointer-events-none [&>svg]:shrink-0", {
	variants: {
		variant: {
			solid: "",
			soft: "",
			outline: "border",
			dot: "bg-transparent text-muted-foreground"
		},
		color: {
			primary: "",
			secondary: "",
			info: "",
			success: "",
			warning: "",
			destructive: ""
		},
		size: {
			xs: "h-[18px] px-1.5 py-0.5 text-[10px] [&>svg]:size-2.5",
			sm: "h-5 px-2 py-0.5 text-xs [&>svg]:size-3",
			md: "h-[22px] px-2.5 py-1 text-xs [&>svg]:size-3.5",
			lg: "h-[26px] px-3 py-1.5 text-sm [&>svg]:size-4"
		},
		shape: {
			round: "rounded-full",
			rounded: "rounded-sm"
		}
	},
	compoundVariants: [
		{
			variant: "solid",
			color: "primary",
			className: "bg-primary text-primary-foreground hover:bg-primary/90"
		},
		{
			variant: "solid",
			color: "secondary",
			className: "bg-secondary text-secondary-foreground hover:bg-secondary/90"
		},
		{
			variant: "solid",
			color: "info",
			className: "bg-info text-info-foreground hover:bg-info/90"
		},
		{
			variant: "solid",
			color: "success",
			className: "bg-success text-success-foreground hover:bg-success/90"
		},
		{
			variant: "solid",
			color: "warning",
			className: "bg-warning text-warning-foreground hover:bg-warning/90"
		},
		{
			variant: "solid",
			color: "destructive",
			className: "bg-destructive text-destructive-foreground hover:bg-destructive/90"
		},
		{
			variant: "soft",
			color: "primary",
			className: "bg-primary/10 text-primary hover:bg-primary/20 dark:bg-primary/20 dark:hover:bg-primary/30"
		},
		{
			variant: "soft",
			color: "secondary",
			className: "bg-secondary text-secondary-foreground hover:bg-secondary/80"
		},
		{
			variant: "soft",
			color: "info",
			className: "bg-info/10 text-info hover:bg-info/20 dark:bg-info/20 dark:hover:bg-info/30"
		},
		{
			variant: "soft",
			color: "success",
			className: "bg-success/10 text-success hover:bg-success/20 dark:bg-success/20 dark:hover:bg-success/30"
		},
		{
			variant: "soft",
			color: "warning",
			className: "bg-warning/10 text-warning hover:bg-warning/20 dark:bg-warning/20 dark:hover:bg-warning/30"
		},
		{
			variant: "soft",
			color: "destructive",
			className: "bg-destructive/10 text-destructive hover:bg-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30"
		},
		{
			variant: "outline",
			color: "primary",
			className: "border-primary text-primary hover:bg-primary/10"
		},
		{
			variant: "outline",
			color: "secondary",
			className: "border-border text-secondary-foreground hover:bg-secondary/50"
		},
		{
			variant: "outline",
			color: "info",
			className: "border-info text-info hover:bg-info/10"
		},
		{
			variant: "outline",
			color: "success",
			className: "border-success text-success hover:bg-success/10"
		},
		{
			variant: "outline",
			color: "warning",
			className: "border-warning text-warning hover:bg-warning/10"
		},
		{
			variant: "outline",
			color: "destructive",
			className: "border-destructive text-destructive hover:bg-destructive/10"
		}
	],
	defaultVariants: {
		variant: "soft",
		color: "secondary",
		size: "sm",
		shape: "round"
	}
});
var dotColorClasses = {
	primary: "bg-primary",
	secondary: "bg-muted-foreground",
	info: "bg-info",
	success: "bg-success",
	warning: "bg-warning",
	destructive: "bg-destructive"
};
/**
* Dot indicator for the dot variant
*/
var BadgeDot = ({ color = "secondary" }) => /* @__PURE__ */ jsxs("span", {
	className: "relative flex size-2 shrink-0",
	"aria-hidden": "true",
	children: [/* @__PURE__ */ jsx("span", { className: cn("absolute inline-flex size-full animate-ping rounded-full opacity-40 motion-reduce:animate-none", dotColorClasses[color]) }), /* @__PURE__ */ jsx("span", { className: cn("relative inline-flex size-2 rounded-full", dotColorClasses[color]) })]
});
var Badge = forwardRef(({ children, leadingIcon, trailingIcon, avatar, iconOnly = false, closable = false, onClose, className, variant = "soft", color = "secondary", size = "sm", shape = "round", ...props }, ref) => {
	const isDot = variant === "dot";
	const paddingClasses = cn((avatar || leadingIcon || isDot) && "ps-1.5", (trailingIcon || closable) && "pe-1", iconOnly && "px-1.5");
	return /* @__PURE__ */ jsxs("span", {
		ref,
		"data-slot": "badge",
		...isDot && { role: "status" },
		className: cn(badgeVariants({
			variant,
			color,
			size,
			shape
		}), paddingClasses, className),
		...props,
		children: [
			isDot && /* @__PURE__ */ jsx(BadgeDot, { color: color ?? "secondary" }),
			avatar && !isDot && /* @__PURE__ */ jsx("span", {
				className: "shrink-0 -ms-0.5 [&>*]:size-4 [&>*]:rounded-full",
				children: avatar
			}),
			leadingIcon && !avatar && !isDot && leadingIcon,
			children,
			trailingIcon && !closable && trailingIcon,
			closable && /* @__PURE__ */ jsx("button", {
				type: "button",
				onClick: onClose,
				className: "group/close relative shrink-0 rounded-full hover:bg-current/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 -me-0.5 p-0.5 before:absolute before:-inset-3.5 before:content-['']",
				"aria-label": "Remove",
				children: /* @__PURE__ */ jsx(X, { className: "size-3 transition-transform duration-150 ease-out group-hover/close:rotate-90 motion-reduce:transition-none" })
			})
		]
	});
});
Badge.displayName = "Badge";
//#endregion
export { Badge, BadgeDot, badgeVariants };

//# sourceMappingURL=index13.js.map