-
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.
Updated storybook configs, updated addons packages
- Loading branch information
Showing
13 changed files
with
1,929 additions
and
885 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
node_modules | ||
/index.js | ||
!/.storybook | ||
.storybook/* | ||
src/atoms/icon/templates/* |
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 +1 @@ | ||
>=10.0.0 <=11.1.0 | ||
>=12.13.0 <13.0.0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
stories: ['../src/**/*.stories.@(js|mdx)'], | ||
addons: [ | ||
'@storybook/addon-docs', | ||
'@storybook/addon-a11y', | ||
'@storybook/addon-storysource', | ||
'@storybook/addon-knobs', | ||
'@storybook/addon-actions' | ||
] | ||
} |
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,8 @@ | ||
import { create } from '@storybook/theming/create'; | ||
|
||
export default create({ | ||
base: 'light', | ||
brandTitle: 'Alpaca UI', | ||
brandImage: 'assets/icons/alpaca.svg', | ||
brandUrl: 'https://github.com/SnowdogApps/alpaca-ui' | ||
}) |
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,27 @@ | ||
import { addDecorator, addParameters } from '@storybook/vue' | ||
|
||
import 'focus-visible' | ||
import 'svgxuse' | ||
|
||
import { withA11y } from '@storybook/addon-a11y' | ||
import { withKnobs } from '@storybook/addon-knobs' | ||
|
||
// Wrap every story in Alpaca App component | ||
import AApp from '../src/atoms/app/App.vue' | ||
|
||
addDecorator(withA11y) | ||
addDecorator(withKnobs) | ||
addDecorator(() => ({ | ||
components: { AApp }, | ||
template: ` | ||
<a-app style="padding: 10px;"> | ||
<story /> | ||
</a-app> | ||
` | ||
})) | ||
|
||
addParameters({ | ||
docs: { | ||
iframeHeight: '60px' | ||
} | ||
}); |
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
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,34 +1,30 @@ | ||
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 './Button.selectors.json' | ||
|
||
import AButton from './Button.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('Test/Button', module) | ||
.addParameters({ info }) | ||
.add('Default', () => ({ | ||
components: { AButton }, | ||
props: { | ||
classKnobs: { | ||
default: select('BEM Modifier', classKnobsConfig) | ||
}, | ||
textKnobs: { | ||
default: text('Text', 'Button text') | ||
} | ||
export default { | ||
title: 'Atoms/Button', | ||
component: AButton | ||
} | ||
|
||
export const Default = () => ({ | ||
components: { AButton }, | ||
props: { | ||
classKnobs: { | ||
default: select('BEM Modifier', classKnobsConfig) | ||
}, | ||
template: ` | ||
<a-button :class="classKnobs"> | ||
{{ textKnobs }} | ||
</a-button> | ||
` | ||
})) | ||
textKnobs: { | ||
default: text('Text', 'Button text') | ||
} | ||
}, | ||
template: ` | ||
<a-button :class="classKnobs"> | ||
{{ textKnobs }} | ||
</a-button> | ||
` | ||
}) |
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.