"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
            t[p[i]] = s[p[i]];
    return t;
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var automation_attribute_1 = __importDefault(require("../../_helpers/automation-attribute"));
var container_styles_1 = __importDefault(require("../../_helpers/container-styles"));
var button_1 = __importDefault(require("../../atoms/button"));
var heading_1 = __importDefault(require("../../atoms/heading"));
var paragraph_1 = __importDefault(require("../../atoms/paragraph"));
var styled_1 = __importDefault(require("../../styled"));
var tokens_1 = require("../../tokens");
var Container = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  ", ";\n  margin-top: ", ";\n"], ["\n  ", ";\n  margin-top: ", ";\n"])), container_styles_1.default, tokens_1.spacing.xlarge);
var MainTitle = styled_1.default(heading_1.default)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n  margin-top: 0;\n"], ["\n  margin-top: 0;\n"])));
var TempStack = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  > * {\n    flex: 0 auto;\n  }\n"], ["\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  > * {\n    flex: 0 auto;\n  }\n"])));
var Item = styled_1.default.li(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n  padding: ", ";\n  border-bottom: 1px solid ", ";\n"], ["\n  padding: ", ";\n  border-bottom: 1px solid ", ";\n"])), tokens_1.spacing.medium, tokens_1.colors.text.error);
var ItemsContainer = styled_1.default.ul(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n  border: 1px solid ", ";\n  border-radius: ", ";\n  list-style: none;\n  ", ";\n  padding-left: 0;\n  margin-bottom: 0;\n  > ", ":last-child {\n      border-bottom: none;\n    }\n  }\n"], ["\n  border: 1px solid ", ";\n  border-radius: ", ";\n  list-style: none;\n  ", ";\n  padding-left: 0;\n  margin-bottom: 0;\n  > ", ":last-child {\n      border-bottom: none;\n    }\n  }\n"])), tokens_1.colors.text.error, tokens_1.misc.radius, "", Item);
var Title = styled_1.default(heading_1.default)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n  font-size: 1.0714285714em;\n  color: ", ";\n  margin: 0;\n"], ["\n  font-size: 1.0714285714em;\n  color: ", ";\n  margin: 0;\n"])), tokens_1.colors.text.error);
var Description = styled_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n  margin-right: ", ";\n  p {\n    color: ", ";\n    margin: 0;\n    margin-top: 0.5em;\n  }\n"], ["\n  margin-right: ", ";\n  p {\n    color: ", ";\n    margin: 0;\n    margin-top: 0.5em;\n  }\n"])), tokens_1.spacing.small, tokens_1.colors.text.secondary);
var Action = styled_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n  text-align: right;\n"], ["\n  text-align: right;\n"])));
var DangerZone = function (_a) {
    var items = _a.items, props = __rest(_a, ["items"]);
    return (React.createElement(Container, __assign({}, automation_attribute_1.default("danger-zone"), props),
        React.createElement(MainTitle, { size: 3 }, "Danger Zone"),
        React.createElement(ItemsContainer, null, items.map(function (item) { return (React.createElement(Item, { key: item.title },
            React.createElement(TempStack, null,
                React.createElement(Description, null,
                    React.createElement(Title, { size: 4 }, item.title),
                    item.description ? React.createElement(paragraph_1.default, null, item.description) : null),
                React.createElement(Action, null,
                    React.createElement(button_1.default, __assign({ type: item.action.type || "button", onClick: function (e) {
                            item.action.onClick(e);
                        }, appearance: "destructive", loading: item.action.loading }, automation_attribute_1.default("danger-zone.action")), item.action.label))))); }))));
};
exports.default = DangerZone;
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
//# sourceMappingURL=danger-zone.js.map