'use strict';

var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.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 index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
var clsx = require('../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.cjs');
var search_module = require('./search.module.css.cjs');

const searchField = index.cva(search_module.default.searchField, {
    variants: {
        size: {
            small: search_module.default["search-small"],
            large: search_module.default["search-large"],
        }
    },
    defaultVariants: {
        size: "large",
    }
});
const Search = ({ className, disabled, placeholder = "Search", size, showClearButton, onClear, value, ref, ...props }) => {
    return (jsxRuntime.jsxRuntimeExports.jsx("div", { className: search_module.default.container, role: "search", children: jsxRuntime.jsxRuntimeExports.jsxs("div", { className: search_module.default.inputWrapper, children: [jsxRuntime.jsxRuntimeExports.jsx("span", { className: search_module.default.leadingIcon, "aria-hidden": "true", children: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.MagnifyingGlassIcon, {}) }), jsxRuntime.jsxRuntimeExports.jsx("input", { ref: ref, type: "text", className: clsx.clsx(searchField({ size, className }), disabled && search_module.default["search-disabled"]), placeholder: placeholder, disabled: disabled, value: value, "aria-label": placeholder, ...props }), showClearButton && value && (jsxRuntime.jsxRuntimeExports.jsx("button", { className: search_module.default.clearButton, onClick: onClear, disabled: disabled, type: "button", "aria-label": "Clear search", tabIndex: 0, children: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.CrossCircledIcon, {}) }))] }) }));
};
Search.displayName = "Search";

exports.Search = Search;
//# sourceMappingURL=search.cjs.map
