forked from carbon-design-system/carbon-components-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: v3 improve story source for CvButton (carbon-design-system#1128)
* feat: v3 improve story source for CvButton * chore: storybook package bump Co-authored-by: Lee Chase <lee.chase@uk.ibm.com>
- Loading branch information
Showing
14 changed files
with
341 additions
and
72 deletions.
There are no files selected for viewing
Binary file not shown.
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,7 @@ | ||
// export const parameters = { | ||
// does not really work for | ||
// actions: { argTypesRegex: "^on[A-Z].*" }, | ||
// } | ||
// does not really work for Vue as it adds onClick as a property | ||
// actions: { argTypesRegex: '^on[A-Z].*' }, | ||
// actions: { argTypesRegex: '^(v-on:)|(@)[a-zA-Z].*' }, | ||
// }; | ||
|
||
import './_styles.scss'; |
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
23 changes: 17 additions & 6 deletions
23
packages/v3/src/components/CvButton/CvButtonSet.stories.js
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,21 +1,32 @@ | ||
import { CvButtonSet, CvButton } from './'; | ||
|
||
import { storyParametersObject } from '../../global/storybook-utils'; | ||
|
||
export default { | ||
title: 'Components/CvButtonSet', | ||
component: CvButtonSet, | ||
}; | ||
|
||
const template = ` | ||
<cv-button-set v-bind="$props"> | ||
<cv-button>One</cv-button> | ||
<cv-button kind="secondary">Two</cv-button> | ||
<cv-button kind="danger">Three</cv-button> | ||
</cv-button-set>`; | ||
const Template = (args, { argTypes }) => { | ||
return { | ||
props: Object.keys(argTypes), | ||
components: { CvButtonSet, CvButton }, | ||
template: ` | ||
<cv-button-set v-bind="$props"> | ||
<cv-button>One</cv-button> | ||
<cv-button kind="secondary">Two</cv-button> | ||
<cv-button kind="danger">Three</cv-button> | ||
</cv-button-set>`, | ||
template, | ||
setup() { | ||
return { args }; | ||
}, | ||
}; | ||
}; | ||
|
||
export const Default = Template.bind({}); | ||
Default.parameters = storyParametersObject( | ||
Default.parameters, | ||
template, | ||
Default.args | ||
); |
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
Oops, something went wrong.