|
| 1 | +import {createElement as h} from 'react'; |
| 2 | +import {storiesOf} from '@storybook/react'; |
| 3 | +const {action} = require('@storybook/addon-actions'); |
| 4 | +const {linkTo} = require('@storybook/addon-links'); |
| 5 | +const {create} = require('../lib'); |
| 6 | +const {addonSheet} = require('../addon/sheet'); |
| 7 | + |
| 8 | +const renderer = create(h); |
| 9 | +addonSheet(renderer); |
| 10 | +const {sheet} = renderer; |
| 11 | + |
| 12 | +const styles = sheet({ |
| 13 | + tomato: { |
| 14 | + bd: '1px solid tomato', |
| 15 | + }, |
| 16 | + yellow: { |
| 17 | + bd: '1px solid yellow', |
| 18 | + }, |
| 19 | +}, 'hello'); |
| 20 | + |
| 21 | + |
| 22 | +const styles2 = renderer.sheet({ |
| 23 | + tomato: { |
| 24 | + bd: '1px solid tomato', |
| 25 | + }, |
| 26 | + yellow: { |
| 27 | + bd: '1px solid yellow', |
| 28 | + }, |
| 29 | +}); |
| 30 | + |
| 31 | +storiesOf('sheet()', module) |
| 32 | + .add('Default', () => |
| 33 | + h('div', null, |
| 34 | + h('div', {className: styles.tomato}, 'Red'), |
| 35 | + h('div', {className: styles.yellow}, 'Yellow'), |
| 36 | + ) |
| 37 | + ) |
| 38 | + .add('No block name', () => |
| 39 | + h('div', null, |
| 40 | + h('div', {className: styles2.tomato}, 'Red'), |
| 41 | + h('div', {className: styles2.yellow}, 'Yellow'), |
| 42 | + ) |
| 43 | + ) |
0 commit comments