wix-storybook-utils
Version:
Utilities for automated component documentation within Storybook
20 lines • 1.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.example = void 0;
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var story_section_1 = require("../../typings/story-section");
var section_with_siblings_1 = require("../section-with-siblings");
var SkeletonRectangle_1 = require("../../SkeletonRectangle/SkeletonRectangle");
var __1 = require("..");
var description_1 = require("./description");
var code_1 = require("./code");
var Layout_1 = require("../../ui/Layout");
var example = function (section, storyConfig) {
var wide = section.wide, loading = section.loading;
return (React.createElement(Layout_1.Layout, { gap: wide ? '0px' : '30px', key: section.key },
React.createElement(Layout_1.Cell, { span: wide ? 8 : 4 }, (0, section_with_siblings_1.sectionWithSiblings)((0, __1.description)(tslib_1.__assign(tslib_1.__assign({}, section), { loading: false, type: story_section_1.SectionType.Description })), (0, description_1.description)(tslib_1.__assign(tslib_1.__assign({}, section), { size: wide ? 'small' : 'normal' })), true)),
React.createElement(Layout_1.Cell, { span: wide ? 12 : 8 }, loading ? (React.createElement(SkeletonRectangle_1.SkeletonRectangle, { height: "96px" })) : ((0, section_with_siblings_1.sectionWithSiblings)((0, __1.code)(section), (0, code_1.code)(section, storyConfig))))));
};
exports.example = example;
//# sourceMappingURL=example.js.map