-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1f3964
commit 0e05acb
Showing
5 changed files
with
4,203 additions
and
4,788 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,27 @@ | ||
const path = require('path'); | ||
module.exports = { | ||
"stories": [ | ||
"../stories/**/*.stories.mdx", | ||
"../stories/**/*.stories.@(js|jsx|ts|tsx)" | ||
], | ||
"addons": [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials" | ||
], | ||
"framework": "@storybook/vue", | ||
"webpackFinal": async (config, { configType }) => { | ||
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION' | ||
// You can change the configuration based on that. | ||
// 'PRODUCTION' is used when building the static version of storybook. | ||
|
||
// Make whatever fine-grained changes you need | ||
config.module.rules.push({ | ||
test: /\.scss$/, | ||
use: ['style-loader', 'css-loader', 'sass-loader'], | ||
include: path.resolve(__dirname, '../'), | ||
}); | ||
|
||
// Return the altered config | ||
return config; | ||
}, | ||
} |
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,14 @@ | ||
import Vue from 'vue'; | ||
import KThemePlugin from '../lib/KThemePlugin'; | ||
|
||
KThemePlugin(Vue); | ||
|
||
export const parameters = { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
} |
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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import KButton from '../lib/buttons-and-links/KButton.vue'; | ||
|
||
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export | ||
export default { | ||
title: 'KButton', | ||
component: KButton, | ||
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes | ||
argTypes: { | ||
text: { | ||
control: 'text', | ||
defaultValue: 'Click me!', | ||
}, | ||
icon: { | ||
control: { | ||
type: 'text', | ||
defaultValue: null, | ||
} | ||
}, | ||
iconAfter: { | ||
control: { | ||
type: 'text', | ||
defaultValue: null, | ||
} | ||
} | ||
}, | ||
}; | ||
|
||
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args | ||
const Template = (args, { argTypes }) => ({ | ||
props: Object.keys(argTypes), | ||
components: { KButton }, | ||
template: '<KButton v-bind="$props">{{ text }}</KButton>', | ||
}); | ||
|
||
export const Primary = Template.bind({}); | ||
// More on args: https://storybook.js.org/docs/vue/writing-stories/args | ||
Primary.args = { | ||
primary: true, | ||
text: 'Primary Button', | ||
}; | ||
|
||
export const Secondary = Template.bind({}); | ||
Secondary.args = { | ||
primary: false, | ||
text: 'Secondary Button', | ||
}; | ||
|
||
export const PrimaryDisabled = Template.bind({}); | ||
// More on args: https://storybook.js.org/docs/vue/writing-stories/args | ||
PrimaryDisabled.args = { | ||
primary: true, | ||
text: 'Primary Button', | ||
disabled: true, | ||
}; | ||
|
||
export const SecondaryDisabled = Template.bind({}); | ||
SecondaryDisabled.args = { | ||
primary: false, | ||
text: 'Secondary Button', | ||
disabled: true, | ||
}; | ||
|
||
export const BasicLink = Template.bind({}); | ||
BasicLink.args = { | ||
primary: true, | ||
appearance: 'basic-link', | ||
text: 'Link', | ||
}; | ||
|
||
export const FlatButtonPrimary = Template.bind({}); | ||
FlatButtonPrimary.args = { | ||
primary: true, | ||
appearance: 'flat-button', | ||
text: 'Flat Primary', | ||
}; | ||
|
||
export const FlatButtonSecondary = Template.bind({}); | ||
FlatButtonSecondary.args = { | ||
primary: true, | ||
appearance: 'flat-button', | ||
text: 'Flat Secondary', | ||
}; | ||
|
||
export const WithIconBefore = Template.bind({}); | ||
WithIconBefore.args = { | ||
primary: true, | ||
text: 'Add', | ||
icon: 'add', | ||
}; | ||
export const WithIconAfter = Template.bind({}); | ||
WithIconAfter.args = { | ||
primary: true, | ||
text: 'Remove', | ||
iconAfter: 'remove', | ||
}; |
Oops, something went wrong.