-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Adds new tag list modifier (#1219)
- Loading branch information
1 parent
76e06e1
commit ded4537
Showing
6 changed files
with
79 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default { | ||
PRIMARY: 'primary', | ||
SECONDARY: 'secondary', | ||
}; |
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,23 +1,23 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import { storiesOf } from '@storybook/vue'; | ||
import { array } from '@storybook/addon-knobs'; | ||
import HdTagsList from 'homeday-blocks/src/components/HdTagsList.vue'; | ||
import TYPES from 'homeday-blocks/src/components/HdTagTypes'; | ||
import ITEMS from './mocks/FORM_ITEMS'; | ||
|
||
storiesOf('Components/Content/HdTagsList', module).add('default 🎛', () => ({ | ||
components: { HdTagsList }, | ||
template: ` | ||
<hd-tags-list | ||
:items="items" | ||
/> | ||
`, | ||
props: { | ||
items: { | ||
type: Array, | ||
default: array( | ||
'items', | ||
ITEMS.map(({ label }) => label) | ||
), | ||
export default { | ||
title: 'Components/Content/HdTagsList', | ||
component: HdTagsList, | ||
argTypes: { | ||
modifier: { | ||
control: { type: 'select', options: Object.values(TYPES) }, | ||
}, | ||
}, | ||
})); | ||
args: { | ||
modifier: TYPES.PRIMARY, | ||
items: ITEMS.map(({ label }) => label), | ||
}, | ||
}; | ||
|
||
export const DEFAULT = (_, { argTypes }) => ({ | ||
props: Object.keys(argTypes), | ||
components: { HdTagsList }, | ||
template: '<hd-tags-list v-bind="$props" />', | ||
}); |
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
15 changes: 13 additions & 2 deletions
15
tests/unit/components/__snapshots__/HdTagsList.spec.js.snap
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