'use strict';

var React = require('react');
var classnames = require('classnames');
var jobberHooks = require('@jobber/hooks');
var getMappedAtlantisSpaceToken = require('./getMappedAtlantisSpaceToken-cjs.js');

var styles = {"contentBlock":"rJamQZ6fRes-","left":"bqjXV8MRO-4-","right":"sCMxIxKkFe0-","center":"_2pIQVKvVL1I-","andText":"_6dF2no3aTxw-","gutters":"_8k8YLsatGag-","spinning":"sjMwRWFdKeo-"};

const AtlantisBreakpoints = {
    xs: 0,
    sm: 490,
    md: 768,
    lg: 1080,
    xl: 1440,
};
const getMappedBreakpointWidth = (maxWidth) => {
    if (typeof maxWidth === "number") {
        return `${maxWidth}px`;
    }
    if (AtlantisBreakpoints[maxWidth]) {
        return (AtlantisBreakpoints[maxWidth] + "px");
    }
    return maxWidth;
};

function ContentBlock({ children, maxWidth = jobberHooks.Breakpoints.smaller, andText, gutters, justify = "left", as: Tag = "div", dataAttributes, ariaAttributes, role, id, UNSAFE_className, UNSAFE_style, }) {
    return (React.createElement(Tag, Object.assign({ role: role, id: id }, dataAttributes, ariaAttributes, { style: Object.assign({ "--content-block-max-width": getMappedBreakpointWidth(maxWidth), "--content-block-gutters": getMappedAtlantisSpaceToken.getMappedAtlantisSpaceToken(gutters) }, UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.container), className: classnames(styles.contentBlock, andText && styles.andText, gutters && styles.gutters, justify === "left" && styles.left, justify === "right" && styles.right, justify === "center" && styles.center, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.container) }), children));
}

exports.ContentBlock = ContentBlock;
