UNPKG

@kbfront/kb-ui

Version:

KB React UI Library

24 lines 1.39 kB
"use strict"; 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 Paragraph = function (_a) { var children = _a.children, fontSize = _a.fontSize, _b = _a.weight, weight = _b === void 0 ? Text_1.ETextWeight.NORMAL : _b, _c = _a.align, align = _c === void 0 ? Text_1.ETextAlign.LEFT : _c, _d = _a.transform, transform = _d === void 0 ? Text_1.ETextTransform.NONE : _d, _e = _a.color, color = _e === void 0 ? index_1.EColor.BLACK : _e, lineHeight = _a.lineHeight, _f = _a.className, className = _f === void 0 ? "" : _f, title = _a.title; var resize = useWindowSize_1.useWindowSize(); var style = { lineHeight: lineHeight, fontWeight: weight, textAlign: align, fontSize: fontSize + "rem", textTransform: transform, }; return (react_1.default.createElement("p", { title: title && title, style: resize > 768 ? style : null, className: "kb-paragraph color-" + color + " " + className }, children)); }; exports.default = Paragraph; //# sourceMappingURL=index.js.map