'use strict';

var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
var React = require('react');
var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
var reactIcons_esm = require('../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs');
var callout_module = require('./callout.module.css.cjs');

function _interopNamespaceDefault(e) {
    var n = Object.create(null);
    if (e) {
        Object.keys(e).forEach(function (k) {
            if (k !== 'default') {
                var d = Object.getOwnPropertyDescriptor(e, k);
                Object.defineProperty(n, k, d.get ? d : {
                    enumerable: true,
                    get: function () { return e[k]; }
                });
            }
        });
    }
    n.default = e;
    return Object.freeze(n);
}

var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);

const callout = index.cva(callout_module.default.callout, {
    variants: {
        type: {
            grey: callout_module.default['callout-grey'],
            success: callout_module.default['callout-success'],
            alert: callout_module.default['callout-alert'],
            gradient: callout_module.default['callout-gradient'],
            accent: callout_module.default['callout-accent'],
            attention: callout_module.default['callout-attention'],
            normal: callout_module.default['callout-normal'],
        },
        outline: {
            true: callout_module.default['callout-outline'],
        },
        highContrast: {
            true: callout_module.default['callout-high-contrast'],
        },
    },
    defaultVariants: {
        type: 'grey',
    },
});
const Callout = React__namespace.forwardRef(({ className, type = 'grey', outline, highContrast, children, action, dismissible, onDismiss, width, ...props }, ref) => {
    const style = width ? { width: typeof width === 'number' ? `${width}px` : width } : undefined;
    const getRole = () => {
        switch (type) {
            case 'alert':
                return 'alert';
            case 'success':
                return 'status';
            default:
                return 'status';
        }
    };
    return (jsxRuntime.jsxRuntimeExports.jsx("div", { ref: ref, className: `${callout({ type, outline, highContrast })} ${className || ''}`, style: style, role: getRole(), "aria-live": type === 'alert' ? 'assertive' : 'polite', ...props, children: jsxRuntime.jsxRuntimeExports.jsxs("div", { className: callout_module.default.container, children: [jsxRuntime.jsxRuntimeExports.jsxs("div", { className: callout_module.default.messageContainer, children: [jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.InfoCircledIcon, { className: callout_module.default.icon, "aria-hidden": "true" }), jsxRuntime.jsxRuntimeExports.jsx("div", { className: callout_module.default.message, children: children })] }), jsxRuntime.jsxRuntimeExports.jsxs("div", { className: callout_module.default.actionsContainer, children: [action && (jsxRuntime.jsxRuntimeExports.jsx("div", { className: callout_module.default.action, children: action })), dismissible && (jsxRuntime.jsxRuntimeExports.jsx("button", { className: callout_module.default.dismiss, onClick: onDismiss, "aria-label": "Dismiss message", 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" }) }) }))] })] }) }));
});
Callout.displayName = 'Callout';

exports.Callout = Callout;
//# sourceMappingURL=callout.cjs.map
