UNPKG

wix-storybook-utils

Version:

Utilities for automated component documentation within Storybook

18 lines 1.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.description = void 0; var tslib_1 = require("tslib"); var React = tslib_1.__importStar(require("react")); var classnames_1 = tslib_1.__importDefault(require("classnames")); var Markdown_1 = tslib_1.__importDefault(require("../../Markdown")); var styles_scss_1 = tslib_1.__importDefault(require("./styles.scss")); var SkeletonRectangle_1 = require("../../SkeletonRectangle/SkeletonRectangle"); var description = function (_a) { var _b; var _c = _a.dataHook, dataHook = _c === void 0 ? '' : _c, text = _a.text, _d = _a.size, size = _d === void 0 ? 'normal' : _d, _e = _a.width, width = _e === void 0 ? '100%' : _e, loading = _a.loading; return loading ? (React.createElement(SkeletonRectangle_1.SkeletonRectangle, { margin: "0 0 38px 0", height: "24px" })) : (React.createElement("div", { style: { width: width }, className: (0, classnames_1.default)(styles_scss_1.default.description, (_b = {}, _b[styles_scss_1.default.descriptionSmall] = size === 'small', _b)) }, typeof text === 'string' ? (React.createElement(Markdown_1.default, { "data-hook": "".concat(dataHook, "-markdown"), source: text })) : (text))); }; exports.description = description; //# sourceMappingURL=description.js.map