Skip to content

Commit

Permalink
feat(input): control input position in storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
ovlb committed Oct 9, 2020
1 parent a12bc62 commit de67b49
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions packages/input/tests/input.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import TournantInput from '../src/index.vue'
import { withKnobs, text } from '@storybook/addon-knobs'
import { withKnobs, text, radios } from '@storybook/addon-knobs'

// const dataNoError = { $error: false, $dirty: false }

Expand Down Expand Up @@ -67,11 +67,35 @@ export const withError = () => ({
</tournant-input>`
})

const descriptionPositions = {
Top: 'top',
Bottom: 'bottom'
}

export const withDescription = () => ({
components: { TournantInput },
props: {
descriptionPosition: {
default: radios(
'Description position',
descriptionPositions,
'bottom',
'tuidescpos'
)
}
},
data: () => ({
validation: { $error: false, $dirty: false },
password: ''
}),
template: `<tournant-input label="password" :validation="validation" value="" v-model="password" type="password" description="Your password must be unique to this site." />`
template: `
<tournant-input
label="password"
:validation="validation"
value=""
v-model="password"
type="password"
description="Your password must be unique to this site."
:description-position="descriptionPosition" />
`
})

0 comments on commit de67b49

Please sign in to comment.