import React__default from 'react';
import '@emotion/core';
import { a as createCommonjsModule, g as getDefaultExportFromCjs } from './_commonjsHelpers-f108cd30.js';
import { a as __assign, b as __makeTemplateObject } from './_tslib-5c49bd3f.js';
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
import '@emotion/styled';
import '@emotion/react';
import { s as styled } from './css-efbd0d2d.js';
import { u as useId } from './auto-id.esm-d84df351.js';
import { c as createIconComponent_1 } from './createIconComponent-c09f9274.js';
import { u as useCustomCss } from './utilities-357c56e6.js';

var plusHeavy = createCommonjsModule(function (module, exports) {

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _createIconComponent = _interopRequireDefault(createIconComponent_1);

var _react = _interopRequireDefault(React__default);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var IconPlusHeavy = (0, _createIconComponent["default"])({
  content: _react["default"].createElement("g", null, _react["default"].createElement("path", {
    d: "M35 64.64a5.34 5.34 0 0 1-5.34-5.34V10.7a5.34 5.34 0 1 1 10.68 0v48.6A5.34 5.34 0 0 1 35 64.64z"
  }), _react["default"].createElement("path", {
    d: "M59.3 40.34H10.7a5.34 5.34 0 1 1 0-10.68h48.6a5.34 5.34 0 1 1 0 10.68z"
  })),
  height: undefined,
  width: undefined
});
IconPlusHeavy.displayName = 'IconPlusHeavy';
var _default = IconPlusHeavy;
exports["default"] = _default;
});

var PlusIcon = /*@__PURE__*/getDefaultExportFromCjs(plusHeavy);

var BorderedButton = function (_a) {
    var _b = _a.variant, variant = _b === void 0 ? 'primary' : _b, customColor = _a.customColor, userProvidedId = _a.id, _c = _a.customCss, customCss = _c === void 0 ? '' : _c, onClick = _a.onClick, icon = _a.icon, _d = _a.removeIcon, removeIcon = _d === void 0 ? false : _d, children = _a.children;
    var id = useId(userProvidedId);
    var resolvedCss = useCustomCss(customCss);
    return (jsx(StyledButton, __assign({ id: id, css: resolvedCss, "data-variant": customColor ? 'none' : variant, customColor: customColor, onClick: onClick }, { children: jsxs(InnerWrapper, { children: [!removeIcon && (jsx(IconCircle, __assign({ "data-variant": customColor ? 'none' : variant, customColor: customColor }, { children: jsx(IconWrapper, { children: icon ? icon : jsx(PlusIcon, {}, void 0) }, void 0) }), void 0)), children] }, void 0) }), void 0));
};
var StyledButton = styled('button')(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  border: 2px dashed ", ";\n  outline: none;\n  background-color: transparent;\n  border-radius: 8px;\n  width: 100%;\n  padding: 10px;\n  color: ", ";\n  font-weight: bold;\n  font-size: 14px;\n  &:hover {\n    background-color: ", ";\n  }\n  &:focus-visible {\n    box-shadow: 0 0 0 2px ", ";\n  }\n  &[data-variant='secondary'] {\n    border-color: ", ";\n    color: ", ";\n    &:hover {\n      background-color: ", ";\n    }\n  }\n  &[data-variant='danger'] {\n    border-color: ", ";\n    color: ", ";\n    &:hover {\n      background-color: ", ";\n    }\n  }\n  &[data-variant='success'] {\n    border-color: ", ";\n    color: ", ";\n    &:hover {\n      background-color: ", ";\n    }\n  }\n  &[data-variant='none'] {\n    border-color: ", ";\n    color: ", ";\n  }\n"], ["\n  border: 2px dashed ", ";\n  outline: none;\n  background-color: transparent;\n  border-radius: 8px;\n  width: 100%;\n  padding: 10px;\n  color: ", ";\n  font-weight: bold;\n  font-size: 14px;\n  &:hover {\n    background-color: ", ";\n  }\n  &:focus-visible {\n    box-shadow: 0 0 0 2px ", ";\n  }\n  &[data-variant='secondary'] {\n    border-color: ", ";\n    color: ", ";\n    &:hover {\n      background-color: ",
    ";\n    }\n  }\n  &[data-variant='danger'] {\n    border-color: ", ";\n    color: ", ";\n    &:hover {\n      background-color: ",
    ";\n    }\n  }\n  &[data-variant='success'] {\n    border-color: ", ";\n    color: ", ";\n    &:hover {\n      background-color: ",
    ";\n    }\n  }\n  &[data-variant='none'] {\n    border-color: ", ";\n    color: ", ";\n  }\n"])), function (_a) {
    var theme = _a.theme;
    return theme.colors.primary;
}, function (_a) {
    var theme = _a.theme;
    return theme.colors.primary;
}, function (_a) {
    var theme = _a.theme;
    return theme.lighten(theme.colors.primary, 52);
}, function (_a) {
    var theme = _a.theme;
    return theme.colors.inputFocus;
}, function (_a) {
    var theme = _a.theme;
    return theme.darken(theme.colors.secondary, 28);
}, function (_a) {
    var theme = _a.theme;
    return theme.darken(theme.colors.secondary, 46);
}, function (_a) {
    var theme = _a.theme;
    return theme.lighten(theme.colors.secondary, 8);
}, function (_a) {
    var theme = _a.theme;
    return theme.colors.danger;
}, function (_a) {
    var theme = _a.theme;
    return theme.colors.danger;
}, function (_a) {
    var theme = _a.theme;
    return theme.lighten(theme.colors.danger, 56);
}, function (_a) {
    var theme = _a.theme;
    return theme.colors.success;
}, function (_a) {
    var theme = _a.theme;
    return theme.colors.success;
}, function (_a) {
    var theme = _a.theme;
    return theme.lighten(theme.colors.success, 69);
}, function (_a) {
    var customColor = _a.customColor;
    return customColor;
}, function (_a) {
    var customColor = _a.customColor;
    return customColor;
});
var IconWrapper = styled('div')(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n  width: 1em;\n  height: 1em;\n  color: white;\n  fill: white;\n"], ["\n  width: 1em;\n  height: 1em;\n  color: white;\n  fill: white;\n"])));
var IconCircle = styled('div')(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n  padding: 3px;\n  border-radius: 30px;\n  background-color: ", ";\n  &[data-variant='secondary'] {\n    background-color: ", ";\n  }\n  &[data-variant='danger'] {\n    background-color: ", ";\n  }\n  &[data-variant='success'] {\n    background-color: ", ";\n  }\n  &[data-variant='none'] {\n    background-color: ", ";\n  }\n"], ["\n  padding: 3px;\n  border-radius: 30px;\n  background-color: ", ";\n  &[data-variant='secondary'] {\n    background-color: ",
    ";\n  }\n  &[data-variant='danger'] {\n    background-color: ", ";\n  }\n  &[data-variant='success'] {\n    background-color: ", ";\n  }\n  &[data-variant='none'] {\n    background-color: ", ";\n  }\n"])), function (_a) {
    var theme = _a.theme;
    return theme.colors.primary;
}, function (_a) {
    var theme = _a.theme;
    return theme.darken(theme.colors.secondary, 46);
}, function (_a) {
    var theme = _a.theme;
    return theme.colors.danger;
}, function (_a) {
    var theme = _a.theme;
    return theme.colors.success;
}, function (_a) {
    var customColor = _a.customColor;
    return customColor;
});
var InnerWrapper = styled('div')(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n  display: flex;\n  flex-direction: row;\n  justify-content: center;\n  align-items: center;\n  gap: 8px;\n"], ["\n  display: flex;\n  flex-direction: row;\n  justify-content: center;\n  align-items: center;\n  gap: 8px;\n"])));
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;

export { BorderedButton };
//# sourceMappingURL=BorderedButton.js.map
