import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__chakra_ui_react__ from "@chakra-ui/react";
// Maps "as" prop to RP variants
const asToVariant = {
    h1: 'xl',
    h2: 'lg',
    h3: 'md',
    h4: 'sm',
    h5: 'sm',
    h6: 'sm'
};
// Backwards compatibility for "size" to "variant".
// We're "up sizing" from the old "size" values to the new
// "variant" values. So: xs -> sm, sm -> md, etc.
const sizeToVariant = {
    xl: 'xl',
    lg: 'xl',
    md: 'lg',
    sm: 'md',
    xs: 'sm'
};
// Default <hX> sizes based on variant prop
const variantToHTMLHeadingElementTagSize = {
    xl: 'h1',
    lg: 'h2',
    md: 'h3',
    sm: 'h4'
};
const DEFAULT_VARIANT = 'lg';
const Heading = ({ variant, size, as, ...rest })=>{
    // determine variant based either on variant, as, or size (in that order)
    var v = variant ? variant : as ? asToVariant[as] : size ? sizeToVariant[size] : DEFAULT_VARIANT;
    var h = as ? as : variantToHTMLHeadingElementTagSize[v];
    return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__chakra_ui_react__.Heading, {
        variant: v,
        as: h,
        ...rest
    });
};
/* ESM default export */ const Heading_rslib_entry_ = Heading;
export { Heading_rslib_entry_ as default };
