import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
export const SoftPage = ({ children, className, maxWidth, restrictWidth, style, ...rest }) => {
    let widthClassname;
    let newStyle;
    if (restrictWidth === true) {
        widthClassname = 'softPage--restrictWidth-default';
    }
    else if (restrictWidth !== false) {
        widthClassname = 'softPage--restrictWidth-custom';
        const value = typeof maxWidth === 'number' ? `${restrictWidth}px` : restrictWidth;
        newStyle = { ...style, maxWidth: value };
    }
    const classes = classNames('softPage', widthClassname, className);
    return (React.createElement("div", Object.assign({ className: classes, style: newStyle || style }, rest), children));
};
// @ts-ignore
SoftPage.propTypes = {
    children: PropTypes.node,
    className: PropTypes.string,
    /**
     * Sets the max-width of the page,
     * set to `true` to use the default size,
     * set to `false` to not restrict the width,
     * set to a number for a custom width in px,
     * set to a string for a custom width in custom measurement.
     */
    restrictWidth: PropTypes.oneOfType([
        PropTypes.bool,
        PropTypes.number,
        PropTypes.string,
    ]),
};
// @ts-ignore
SoftPage.defaultProps = {
    restrictWidth: false,
};
//# sourceMappingURL=SoftPage.js.map