UNPKG

wix-storybook-utils

Version:

Utilities for automated component documentation within Storybook

16 lines 1.18 kB
import { __assign } from "tslib"; import * as React from 'react'; import { SectionType } from '../../typings/story-section'; import { sectionWithSiblings } from '../section-with-siblings'; import { SkeletonRectangle } from '../../SkeletonRectangle/SkeletonRectangle'; import { code, description } from '..'; import { description as descriptionView } from './description'; import { code as codeView } from './code'; import { Layout, Cell } from '../../ui/Layout'; export var example = function (section, storyConfig) { var wide = section.wide, loading = section.loading; return (React.createElement(Layout, { gap: wide ? '0px' : '30px', key: section.key }, React.createElement(Cell, { span: wide ? 8 : 4 }, sectionWithSiblings(description(__assign(__assign({}, section), { loading: false, type: SectionType.Description })), descriptionView(__assign(__assign({}, section), { size: wide ? 'small' : 'normal' })), true)), React.createElement(Cell, { span: wide ? 12 : 8 }, loading ? (React.createElement(SkeletonRectangle, { height: "96px" })) : (sectionWithSiblings(code(section), codeView(section, storyConfig)))))); }; //# sourceMappingURL=example.js.map