UNPKG

wix-storybook-utils

Version:

Utilities for automated component documentation within Storybook

52 lines 1.8 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var react_1 = tslib_1.__importDefault(require("react")); var react_2 = require("@storybook/react"); var StorybookComponents_1 = require("../../StorybookComponents"); var __1 = tslib_1.__importDefault(require("..")); var sizes = ['tiny', 'small', 'medium']; var weights = ['thin', 'normal', 'bold']; var tests = tslib_1.__spreadArray(tslib_1.__spreadArray([], sizes.reduce(function (accu, size) { weights.forEach(function (weight) { return accu.push({ it: "size=".concat(size, " weight=").concat(weight), props: { size: size, weight: weight, children: "Text - size=".concat(size, ", weight=").concat(weight), }, }); }); return accu; }, []), true), [ { it: 'light=true', props: { light: true, children: 'Text - light', }, background: 'dark', }, { it: 'light=true secondary=true', props: { light: true, secondary: true, children: 'Text - light secondary', }, }, { it: 'secondary', props: { secondary: true, children: 'Text - secondary', }, }, ], false); tests.forEach(function (_a) { var it = _a.it, props = _a.props, _b = _a.background, background = _b === void 0 ? 'light' : _b; (0, react_2.storiesOf)('Text', module).add(it, function () { return (react_1.default.createElement(StorybookComponents_1.StorybookComponents.Background, { skin: background }, react_1.default.createElement(__1.default, tslib_1.__assign({}, props)))); }); }); //# sourceMappingURL=Text.visual.js.map