@brizy/ui
Version:
React elements in Brizy style
69 lines (68 loc) • 2.24 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.tabChildrenMap = exports.tabChildrenSingle = exports.tabChildrenSide = exports.tabChildrenTop = void 0;
const react_1 = __importDefault(require("react"));
const types_1 = require("../../EditorIcon/types");
const Tab_1 = require("../components/Tab");
const EditorIcon_1 = require("../../EditorIcon");
const options = {
left: [react_1.default.createElement(EditorIcon_1.EditorIcon, { key: 1, icon: types_1.IconsName.ArrowRightLegacy })],
right: [react_1.default.createElement(EditorIcon_1.EditorIcon, { key: 2, icon: types_1.IconsName.HeartLegacy })],
};
// this is used in docs and tests as Tabs children
exports.tabChildrenTop = [
{
tab: {
value: "currentShortcodeTab",
key: "currentShortcodeTab",
label: "Button",
},
options: options.left,
},
{
tab: {
value: "currentShortcodeIconTab",
key: "currentShortcodeIconTab",
label: "Icon",
},
options: options.right,
},
];
exports.tabChildrenSide = [
{
tab: {
value: "currentShortcodeTab",
key: "currentShortcodeTab",
icon: types_1.IconsName["t2-event-calendar"],
},
options: options.left,
},
{
tab: {
value: "currentShortcodeIconTab",
key: "currentShortcodeIconTab",
icon: types_1.IconsName.DuplicateLegacy,
},
options: options.right,
},
];
exports.tabChildrenSingle = [
{
tab: {
value: "currentShortcodeTab",
key: "currentShortcodeTab",
label: "Button",
},
options: options.left,
},
];
const tabChildrenMap = (tabChildren) => {
return tabChildren.map((children, idx) => {
const { tab, options } = children;
return (react_1.default.createElement(Tab_1.Tab, { key: idx, value: tab.value, label: tab.label, icon: tab.icon, title: tab.title }, options));
});
};
exports.tabChildrenMap = tabChildrenMap;