'use strict';

var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
var chip_module = require('./chip.module.css.cjs');

const chip = index.cva(chip_module.default.chip, {
    variants: {
        variant: {
            outline: chip_module.default["chip-variant-outline"],
            filled: chip_module.default["chip-variant-filled"],
        },
        size: {
            large: chip_module.default["chip-size-large"],
            small: chip_module.default["chip-size-small"],
        },
        style: {
            neutral: chip_module.default["chip-style-neutral"],
            accent: chip_module.default["chip-style-accent"],
        },
    },
    defaultVariants: {
        variant: "outline",
        size: "small",
        style: "neutral"
    },
});
const Chip = ({ variant, size, style, trailingIcon, leadingIcon, isDismissible, children, className, onDismiss, role = "status", ariaLabel, }) => {
    const handleDismiss = (e) => {
        e.stopPropagation();
        onDismiss?.();
    };
    return (jsxRuntime.jsxRuntimeExports.jsxs("span", { className: chip({ variant, size, style, className }), role: role, "aria-label": ariaLabel || (typeof children === 'string' ? children : undefined), children: [leadingIcon && (jsxRuntime.jsxRuntimeExports.jsx("span", { className: chip_module.default['leading-icon'], "aria-hidden": "true", role: "presentation", children: leadingIcon })), children, isDismissible ? (jsxRuntime.jsxRuntimeExports.jsx("button", { onClick: handleDismiss, className: chip_module.default['dismiss-button'], "aria-label": `Remove ${typeof children === 'string' ? children : 'item'}`, type: "button", children: jsxRuntime.jsxRuntimeExports.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", role: "presentation", children: jsxRuntime.jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.5066 3.3066C9.73115 3.08205 9.73115 2.71798 9.5066 2.49343C9.28205 2.26887 8.91798 2.26887 8.69343 2.49343L6.00001 5.18684L3.3066 2.49343C3.08205 2.26887 2.71798 2.26887 2.49343 2.49343C2.26887 2.71798 2.26887 3.08205 2.49343 3.3066L5.18684 6.00001L2.49343 8.69343C2.26887 8.91798 2.26887 9.28205 2.49343 9.5066C2.71798 9.73115 3.08205 9.73115 3.3066 9.5066L6.00001 6.81318L8.69343 9.5066C8.91798 9.73115 9.28205 9.73115 9.5066 9.5066C9.73115 9.28205 9.73115 8.91798 9.5066 8.69343L6.81318 6.00001L9.5066 3.3066Z", fill: "currentColor" }) }) })) : trailingIcon ? (jsxRuntime.jsxRuntimeExports.jsx("span", { className: chip_module.default['trailing-icon'], "aria-hidden": "true", role: "presentation", children: trailingIcon })) : null] }));
};
Chip.displayName = "Chip";

exports.Chip = Chip;
//# sourceMappingURL=chip.cjs.map
