@kbfront/kb-ui
Version:
KB React UI Library
24 lines • 1.47 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var Text_1 = require("components/Text");
var useWindowSize_1 = require("utils/hooks/useWindowSize");
var index_1 = require("../../enum/index");
require("./index.scss");
var Typography = function (_a) {
var _b = _a.variant, variant = _b === void 0 ? 1 : _b, component = _a.component, fontSize = _a.fontSize, _c = _a.weight, weight = _c === void 0 ? Text_1.ETextWeight.NORMAL : _c, _d = _a.align, align = _d === void 0 ? Text_1.ETextAlign.LEFT : _d, _e = _a.transform, transform = _e === void 0 ? Text_1.ETextTransform.NONE : _e, _f = _a.color, color = _f === void 0 ? index_1.EColor.BLACK : _f, children = _a.children, _g = _a.className, className = _g === void 0 ? "" : _g, title = _a.title;
var resize = useWindowSize_1.useWindowSize();
var HTag = "h" + component.charAt(1);
var style = {
fontWeight: weight,
textAlign: align,
fontSize: fontSize + "rem",
textTransform: transform,
};
return (react_1.default.createElement(HTag, { title: title && title, style: resize > 768 ? style : null, className: "kb-heading-" + variant + " color-" + color + " " + className }, children));
};
exports.default = Typography;
//# sourceMappingURL=index.js.map