wix-storybook-utils
Version:
Utilities for automated component documentation within Storybook
50 lines • 1.6 kB
JavaScript
import { __assign, __spreadArray } from "tslib";
import React from 'react';
import { storiesOf } from '@storybook/react';
import { StorybookComponents } from '../../StorybookComponents';
import Text from '..';
var sizes = ['tiny', 'small', 'medium'];
var weights = ['thin', 'normal', 'bold'];
var tests = __spreadArray(__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;
storiesOf('Text', module).add(it, function () { return (React.createElement(StorybookComponents.Background, { skin: background },
React.createElement(Text, __assign({}, props)))); });
});
//# sourceMappingURL=Text.visual.js.map