import 'react';
import '@emotion/core';
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-6c5a4424.js';
import { u as useCustomCss } from './utilities-73e80dab.js';

var ContextButton = function (_a) {
    var _b = _a.variant, variant = _b === void 0 ? 'primary' : _b, userProvidedId = _a.id, _c = _a.customCss, customCss = _c === void 0 ? '' : _c, onClick = _a.onClick, _d = _a.disabled, disabled = _d === void 0 ? false : _d, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, children = _a.children, className = _a.className;
    var id = useId(userProvidedId);
    var resolvedCss = useCustomCss(customCss);
    return (jsx(StyledButton, __assign({ className: className, "aria-disabled": disabled, "data-variant": variant, onClick: disabled ? undefined : onClick, css: resolvedCss, id: id }, { children: jsxs(StyledTextDiv, { children: [leftIcon && jsx(StyledLeftIconDiv, { children: leftIcon }, void 0), children, rightIcon && jsx(StyledRightIconDiv, { children: rightIcon }, void 0)] }, void 0) }), void 0));
};
var StyledButton = styled('button')(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  border: none;\n  outline: none;\n  background-color: ", ";\n  border-radius: 8px;\n  color: #ffffff;\n  text-transform: uppercase;\n  font-weight: bold;\n  font-size: 16px;\n  &[aria-disabled='true'] {\n    cursor: not-allowed;\n    background-color: #999999 !important;\n  }\n  &:focus-visible {\n    box-shadow: 0 0 0 2px ", ";\n  }\n  &:hover {\n    background-color: ", ";\n  }\n  &[data-variant='secondary'] {\n    background-color: ", ";\n    color: ", ";\n    &:hover {\n      background-color: ", ";\n    }\n  }\n  &[data-variant='danger'] {\n    background-color: ", ";\n    &:hover {\n      background-color: ", ";\n    }\n  }\n  &[data-variant='success'] {\n    background-color: ", ";\n    &:hover {\n      background-color: ", ";\n    }\n  }\n"], ["\n  border: none;\n  outline: none;\n  background-color: ", ";\n  border-radius: 8px;\n  color: #ffffff;\n  text-transform: uppercase;\n  font-weight: bold;\n  font-size: 16px;\n  &[aria-disabled='true'] {\n    cursor: not-allowed;\n    background-color: #999999 !important;\n  }\n  &:focus-visible {\n    box-shadow: 0 0 0 2px ", ";\n  }\n  &:hover {\n    background-color: ", ";\n  }\n  &[data-variant='secondary'] {\n    background-color: ", ";\n    color: ", ";\n    &:hover {\n      background-color: ",
    ";\n    }\n  }\n  &[data-variant='danger'] {\n    background-color: ", ";\n    &:hover {\n      background-color: ", ";\n    }\n  }\n  &[data-variant='success'] {\n    background-color: ", ";\n    &:hover {\n      background-color: ",
    ";\n    }\n  }\n"])), function (_a) {
    var theme = _a.theme;
    return theme.colors.primary;
}, function (_a) {
    var theme = _a.theme;
    return theme.colors.inputFocus;
}, function (_a) {
    var theme = _a.theme;
    return theme.lighten(theme.colors.primary, 4);
}, function (_a) {
    var theme = _a.theme;
    return theme.colors.secondary;
}, function (_a) {
    var theme = _a.theme;
    return theme.darken(theme.colors.secondary, 47);
}, function (_a) {
    var theme = _a.theme;
    return theme.lighten(theme.colors.secondary, 4);
}, function (_a) {
    var theme = _a.theme;
    return theme.colors.danger;
}, function (_a) {
    var theme = _a.theme;
    return theme.lighten(theme.colors.danger, 4);
}, function (_a) {
    var theme = _a.theme;
    return theme.colors.success;
}, function (_a) {
    var theme = _a.theme;
    return theme.lighten(theme.colors.success, 4);
});
var StyledTextDiv = styled('div')(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n  padding-top: 10px;\n  padding-bottom: 10px;\n  padding-left: 13px;\n  padding-right: 15px;\n  display: flex;\n  flex-direction: row;\n"], ["\n  padding-top: 10px;\n  padding-bottom: 10px;\n  padding-left: 13px;\n  padding-right: 15px;\n  display: flex;\n  flex-direction: row;\n"])));
var StyledLeftIconDiv = styled('div')(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n  padding-right: 10px;\n"], ["\n  padding-right: 10px;\n"])));
var StyledRightIconDiv = styled('div')(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n  padding-left: 10px;\n"], ["\n  padding-left: 10px;\n"])));
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;

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