Skip to content

Commit

Permalink
update stories
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuza committed Jul 17, 2020
1 parent 93664cc commit f63fb8a
Showing 1 changed file with 42 additions and 45 deletions.
87 changes: 42 additions & 45 deletions src/atoms/label/Label.stories.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,53 @@
import { storiesOf } from '@storybook/vue'
import { select, text } from '@storybook/addon-knobs'

import generateVueInfoTable from '@utils/helpers/generate-vue-info-table.js'
import getClassKnobsConfig from '@utils/helpers/get-class-knobs-config.js'
import selectorsConfig from './Label.selectors.json'

import ALabel from './Label.vue'

const info = `
<p>Check <b>Knobs</b> tab to edit component properties dynamically.</p><br>
${generateVueInfoTable(selectorsConfig, 'BEM modifiers')}
`

const classKnobsConfig = getClassKnobsConfig(selectorsConfig)

storiesOf('Atoms/Label', module)
.addParameters({ info })
.add('Default', () => ({
components: { ALabel },
props: {
classKnobs: {
default: select('BEM Modifier', classKnobsConfig)
},
textKnobs: {
default: text('Text', 'Label')
}
export default {
title: 'Atoms/Label',
component: ALabel
}

export const Default = () => ({
components: { ALabel },
props: {
classKnobs: {
default: select('BEM Modifier', classKnobsConfig)
},
textKnobs: {
default: text('Text', 'Label')
}
},
template: `
<a-label :class="classKnobs">
{{ textKnobs }}
</a-label>
`
})

export const CustomTag = () => ({
components: { ALabel },
props: {
classKnobs: {
default: select('BEM Modifier', classKnobsConfig)
},
template: `
<a-label :class="classKnobs">
{{ textKnobs }}
</a-label>
`
}))
.add('Custom tag', () => ({
components: { ALabel },
props: {
classKnobs: {
default: select('BEM Modifier', classKnobsConfig)
},
textKnobs: {
default: text('Text', 'Custom tag label')
},
tagKnob: {
default: text('Html tag', 'span')
}
textKnobs: {
default: text('Text', 'Custom tag label')
},
template: `
<a-label
:tag="tagKnob"
:class="classKnobs"
>
{{ textKnobs }}
</a-label>
`
}))
tagKnob: {
default: text('Html tag', 'span')
}
},
template: `
<a-label
:tag="tagKnob"
:class="classKnobs"
>
{{ textKnobs }}
</a-label>
`
})

0 comments on commit f63fb8a

Please sign in to comment.