'use strict';

var tslib_es6 = require('./tslib.es6-cjs.js');
var React = require('react');
var classnames = require('classnames');
var Content = require('./Content-cjs.js');

var styles = {"glimmer":"-lyJkOGbceo-","reverseTheme":"NH-8hViLjFA-","header":"_6-ozsHDHcVI-","button":"_7AvaYGpXkLU-","buttonFill":"sm9yBV3e4Qg-","spinning":"-HieXHs-LiA-"};

var sizes = {"small":"bjemHBSLuQ0-","base":"MXFqgzJq5jw-","large":"B2DzIy8pibk-","larger":"-ll1bKXJm9s-","largest":"jieKjQ6-Scs-","auto":"_8qp0RoxJfHE-","spinning":"ADVQ641JXWE-"};

var shapes = {"rectangle":"vAVS-6e-jJo-","rectangleShort":"tZgae6SZ8WA-","rectangleShorter":"ec-sGgENoOw-","square":"ONvR3LocsA4-","circle":"j-gTsb6UsQs-","spinning":"oa6-bbY8pQ4-"};

var timings = {"base":"_6dlpcG-oxT4-","fast":"NlRB1Xq-sFE-","spinning":"OsYgmBAZYXA-"};

const GLIMMER_TEST_ID = "ATL-Glimmer";
const GLIMMER_HEADER_TEST_ID = "ATL-GlimmerHeader";
const GLIMMER_TEXT_TEST_ID = "ATL-GlimmerText";
const GLIMMER_BUTTON_TEST_ID = "ATL-GlimmerButton";
function Glimmer({ size = "base", shape = "rectangle", timing = "base", reverseTheme = false, width, }) {
    const className = classnames(styles.glimmer, sizes[size], shapes[shape], timings[timing], { [styles.reverseTheme]: reverseTheme });
    return (React.createElement("div", { "aria-busy": "true", role: "status", className: className, "data-testid": GLIMMER_TEST_ID, style: { width } }));
}
Glimmer.Header = function GlimmerHeader(_a) {
    var { level = 3 } = _a, props = tslib_es6.__rest(_a, ["level"]);
    const headerSize = {
        1: "largest",
        2: "larger",
        3: "large",
        4: "base",
        5: "small",
    };
    return (React.createElement("div", { className: styles.header, "data-testid": GLIMMER_HEADER_TEST_ID },
        React.createElement(Glimmer, Object.assign({ size: headerSize[level] }, props))));
};
Glimmer.Text = function GlimmerText(_a) {
    var { width, lines = 3 } = _a, props = tslib_es6.__rest(_a, ["width", "lines"]);
    const children = [
        React.createElement(Glimmer, Object.assign({ key: "1", size: "small", shape: "rectangleShort" }, props)),
        React.createElement(Glimmer, Object.assign({ key: "2", size: "small" }, props)),
        React.createElement(Glimmer, Object.assign({ key: "3", size: "small", shape: "rectangleShorter" }, props)),
    ].slice(0, lines);
    return (React.createElement("div", { style: { width }, "data-testid": GLIMMER_TEXT_TEST_ID },
        React.createElement(Content.Content, { spacing: "small" }, children)));
};
Glimmer.Button = function GlimmerButton(_a) {
    var { fullWidth = false } = _a, props = tslib_es6.__rest(_a, ["fullWidth"]);
    const buttonClassNames = classnames(styles.button, {
        [styles.buttonFill]: fullWidth,
    });
    return (React.createElement("div", { className: buttonClassNames, "data-testid": GLIMMER_BUTTON_TEST_ID },
        React.createElement(Glimmer, Object.assign({}, props, { size: "auto" }))));
};

exports.GLIMMER_TEST_ID = GLIMMER_TEST_ID;
exports.Glimmer = Glimmer;
