@smitch/fluid
Version:
A lightweight, Tailwind-powered React/Next.js UI component library.
18 lines • 1.29 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useMemo } from 'react';
import Button from '../Button';
import { HiMiniXMark } from 'react-icons/hi2';
import { twMerge } from 'tailwind-merge';
var sizes = {
sm: 'w-',
md: 'w-6',
lg: 'w-8',
xl: 'w-12',
};
var CloseButton = function (_a) {
var _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.className, className = _c === void 0 ? '' : _c, onClick = _a.onClick, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.layout, layout = _e === void 0 ? 'circle' : _e, _f = _a.title, title = _f === void 0 ? 'Close?' : _f, _g = _a.hoverScale, hoverScale = _g === void 0 ? true : _g;
var sizeClasses = useMemo(function () { return sizes[size]; }, [size]);
return (_jsxs(Button, { className: twMerge("closebtn fixed p-0 right-4 top-4 bg-dark text-light dark:bg-light dark:text-dark ".concat(sizeClasses), className), onClick: onClick, btnBackground: 'transparent', btnColor: 'current', layout: layout, size: size, title: title, disabled: disabled, hoverScale: hoverScale, id: 'close', children: [_jsx(HiMiniXMark, { className: "h-auto w-full" }), _jsx("span", { className: 'sr-only', children: "Close" })] }));
};
export default CloseButton;
//# sourceMappingURL=CloseButton.js.map