import React__default from 'react';
import styled from '../../../../../../node_modules/@mui/material/styles/styled.mjs';
import Button from '../../../../../../node_modules/@mui/material/Button/Button.mjs';
import buttonClasses from '../../../../../../node_modules/@mui/material/Button/buttonClasses.mjs';

const variantToMUIVariant = {
    ghost: 'outlined',
    primary: 'contained',
    text: 'text'
};
const StyledButton$1 = styled(Button)(({ theme, isCompact, iconOnly })=>[
        {
            borderRadius: 3,
            boxShadow: 'none',
            fontSize: theme.typography.body1.fontSize,
            minHeight: 40,
            whiteSpace: 'nowrap',
            width: 'fit-content',
            [`&.${buttonClasses.fullWidth}`]: {
                width: '100%'
            },
            '&, &:active, &:hover': {
                boxShadow: 'none'
            },
            [theme.breakpoints.down('sm')]: {
                whiteSpace: 'unset',
                minHeight: 'fit-content'
            }
        },
        isCompact && {
            [`& .${buttonClasses.startIcon}`]: {
                marginRight: theme.spacing(0.5)
            },
            [`& .${buttonClasses.endIcon}`]: {
                marginLeft: theme.spacing(0.5)
            },
            fontSize: theme.typography.body1.fontSize,
            minHeight: 30,
            padding: '0 10px',
            minWidth: 'fit-content'
        },
        iconOnly && {
            [`& .${buttonClasses.startIcon}, & .${buttonClasses.endIcon}`]: {
                margin: 0
            }
        }
    ]);
const ButtonCore = ({ children, compact, variant, ...props })=>{
    const buttonVariant = variant ?? 'primary';
    return /*#__PURE__*/ React__default.createElement(StyledButton$1, {
        ...props,
        iconOnly: !children,
        isCompact: compact,
        variant: variantToMUIVariant[buttonVariant]
    }, children);
};

export { ButtonCore };
//# sourceMappingURL=Button.mjs.map
