import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { forwardRef } from 'react';
import styled from 'styled-components';
import { defaultThemeProp } from '../../theme';
import { useTheme } from '../../hooks';
import Button from '../Button';
import Flex from '../Flex';
import Icon, { registerIcon } from '../Icon';
import * as polarisSolidIcon from '../Icon/icons/polaris-solid.icon';
import { ThemeOverride } from '../Configuration';
registerIcon(polarisSolidIcon);
export const StyledAIButton = styled(Button) ``;
StyledAIButton.defaultProps = defaultThemeProp;
export default forwardRef(function AIButton({ label, icon = 'polaris-solid', disabled = false, iconOnly, variant = 'secondary', ...restProps }, ref) {
    const theme = useTheme();
    return (_jsx(ThemeOverride, { theme: {
            components: {
                button: {
                    color: theme.base.palette.ai,
                    'secondary-color': theme.base.palette.ai,
                    'secondary-fill-style': 'outline'
                }
            }
        }, children: _jsx(StyledAIButton, { ...restProps, variant: variant, ref: ref, disabled: disabled, icon: iconOnly, label: iconOnly ? label : undefined, children: _jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, as: 'span', children: [icon && _jsx(Icon, { name: icon }), !iconOnly && _jsx("span", { children: label })] }) }) }));
});
//# sourceMappingURL=AIButton.js.map