-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/update-button' into feature/update
- Loading branch information
Showing
7 changed files
with
73 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<button | ||
:class="getClass('button')" | ||
:variant="variant" | ||
type="button" | ||
v-bind="$attrs" | ||
v-on="$listeners" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,58 @@ | ||
import { text } from '@storybook/addon-knobs' | ||
import { action } from '@storybook/addon-actions' | ||
|
||
import AButton from './Button.vue' | ||
|
||
export default { | ||
title: 'Atoms/Button', | ||
component: AButton | ||
component: AButton, | ||
argTypes: { | ||
variant: { | ||
control: { | ||
type: 'multi-select', | ||
options: [ | ||
'primary', | ||
'secondary', | ||
'fluid' | ||
] | ||
} | ||
}, | ||
onClick: { | ||
action: 'clicked' | ||
}, | ||
text: { | ||
control: { | ||
type: 'text' | ||
} | ||
} | ||
} | ||
} | ||
|
||
export const Default = () => ({ | ||
const Template = (args, { argTypes }) => ({ | ||
components: { AButton }, | ||
props: { | ||
textKnobs: { | ||
default: text('Text', 'Button text') | ||
} | ||
}, | ||
methods: { | ||
buttonClick: action('Click') | ||
}, | ||
props: Object.keys(argTypes), | ||
template: ` | ||
<a-button | ||
variant="primary" | ||
@click="buttonClick" | ||
:variant="variant" | ||
type="button" | ||
v-bind="$props" | ||
@click="onClick" | ||
> | ||
{{ textKnobs }} | ||
{{ text }} | ||
</a-button> | ||
` | ||
}) | ||
|
||
export const Secondary = () => ({ | ||
components: { AButton }, | ||
props: { | ||
textKnobs: { | ||
default: text('Text', 'Button text') | ||
} | ||
}, | ||
methods: { | ||
buttonClick: action('Click') | ||
}, | ||
template: ` | ||
<a-button | ||
variant="secondary" | ||
@click="buttonClick" | ||
> | ||
{{ textKnobs }} | ||
</a-button> | ||
` | ||
}) | ||
export const Primary = Template.bind({}) | ||
Primary.args = { | ||
variant: 'primary', | ||
text: 'Button primary' | ||
} | ||
export const Secondary = Template.bind({}) | ||
Secondary.args = { | ||
variant: 'secondary', | ||
text: 'Button secondary' | ||
} | ||
|
||
export const SecondaryFuild = () => ({ | ||
components: { AButton }, | ||
props: { | ||
textKnobs: { | ||
default: text('Text', 'Button text') | ||
} | ||
}, | ||
methods: { | ||
buttonClick: action('Click') | ||
}, | ||
template: ` | ||
<a-button | ||
:variant="['secondary', 'fluid']" | ||
@click="buttonClick" | ||
> | ||
{{ textKnobs }} | ||
</a-button> | ||
` | ||
}) | ||
export const Fluid = Template.bind({}) | ||
Fluid.args = { | ||
variant: 'fluid', | ||
text: 'Button fluid' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters