import { __rest, __assign } from '../../node_modules/tslib/tslib.es6.js';
import React, { forwardRef } from 'react';
import { Button as Button$1 } from '@chakra-ui/react';

var Button = forwardRef(function (props, ref) {
    var _a = props.variant, variant = _a === void 0 ? 'primary' : _a, _b = props.size, size = _b === void 0 ? 'lg' : _b, _c = props.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = props.as, as = _d === void 0 ? 'button' : _d, isExternal = props.isExternal, ariaLabel = props.ariaLabel, icon = props.icon, rest = __rest(props, ["variant", "size", "isDisabled", "as", "isExternal", "ariaLabel", "icon"]);
    return (React.createElement(Button$1, __assign({ ref: ref, leftIcon: props.children ? props.leftIcon : icon, rightIcon: props.children ? props.rightIcon : undefined, iconSpacing: props.children ? 'xs' : 0, as: as, variant: variant, size: size, isDisabled: isDisabled, "aria-label": props.children ? undefined : ariaLabel }, rest, (props.as === 'a'
        ? {
            target: isExternal ? '_blank' : undefined,
            rel: props.rel || (isExternal ? 'noopener noreferrer' : undefined),
        }
        : {})), props.children));
});
Button.displayName = 'Button';

export { Button as default };
//# sourceMappingURL=index.js.map
