UNPKG

@kbfront/kb-ui

Version:

KB React UI Library

51 lines 2.27 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.EFlexDirection = exports.EFlexAlign = exports.EJustify = void 0; var react_1 = __importDefault(require("react")); require("./index.scss"); var EJustify; (function (EJustify) { EJustify["SA"] = "sa"; EJustify["SB"] = "sb"; EJustify["SE"] = "se"; EJustify["C"] = "c"; EJustify["FS"] = "fs"; EJustify["FE"] = "fe"; })(EJustify = exports.EJustify || (exports.EJustify = {})); var EFlexAlign; (function (EFlexAlign) { EFlexAlign["B"] = "b"; EFlexAlign["S"] = "s"; EFlexAlign["C"] = "c"; EFlexAlign["FS"] = "fs"; EFlexAlign["FE"] = "fe"; })(EFlexAlign = exports.EFlexAlign || (exports.EFlexAlign = {})); var EFlexDirection; (function (EFlexDirection) { EFlexDirection["ROW"] = "r"; EFlexDirection["RR"] = "rr"; EFlexDirection["COLUMN"] = "c"; EFlexDirection["CR"] = "cr"; })(EFlexDirection = exports.EFlexDirection || (exports.EFlexDirection = {})); var Flex = function (_a) { var children = _a.children, justify = _a.justify, align = _a.align, direction = _a.direction, _b = _a.className, className = _b === void 0 ? '' : _b, marginLeft = _a.marginLeft, marginRight = _a.marginRight, marginTop = _a.marginTop, marginBottom = _a.marginBottom, margin = _a.margin; var marginVal; if (margin !== undefined) { marginVal = margin === null || margin === void 0 ? void 0 : margin.map(function (value) { return value + "rem"; }); } var style = { margin: "" + (marginVal !== undefined && (marginVal === null || marginVal === void 0 ? void 0 : marginVal.join(" "))), marginLeft: marginLeft + "rem", marginRight: marginRight + "rem", marginTop: marginTop + "rem", marginBottom: marginBottom + "rem", }; return (react_1.default.createElement("div", { className: "kb-flex " + (justify ? "justify-" + justify : "") + " " + (align ? "align-" + align : "") + " " + (direction ? "direction-" + direction : "") + " " + className, style: style }, children)); }; exports.default = Flex; //# sourceMappingURL=index.js.map