Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: update to storybook 7 #66

Closed
wants to merge 12 commits into from
Closed
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: '@archilogic/eslint-config/vue'
extends: ['@archilogic/eslint-config/vue', 'plugin:storybook/recommended']
}
21 changes: 12 additions & 9 deletions .storybook/main.cjs → .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { mergeConfig } = require('vite')
const svgLoader = require('vite-svg-loader')
import { mergeConfig } from 'vite'
import svgLoader from 'vite-svg-loader'

module.exports = {
export default {
async viteFinal(config) {
// return the customized config
return mergeConfig(config, {
Expand All @@ -16,16 +16,19 @@ module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
{
name: '@storybook/addon-postcss',
name: '@storybook/addon-styling',
options: {
postcssLoaderOptions: {
implementation: require('postcss')
}
postCss: true
}
},
'@storybook/addon-links',
'@storybook/addon-essentials'
],
core: { builder: '@storybook/builder-vite' },
framework: '@storybook/vue3'
framework: {
name: '@storybook/vue3-vite',
options: {}
},
docs: {
autodocs: true
}
}
6 changes: 6 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { addons } from '@storybook/manager-api'
import { themes } from '@storybook/theming'

addons.setConfig({
theme: themes.light
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without this, the new default for Storybook is 'auto', which looks weird next to our non-dark-mode-friendly design system. I also didn't want to change too much while Iana is away 😅

Screenshot 2023-08-09 at 14 23 36

})
17 changes: 0 additions & 17 deletions .storybook/preview.cjs

This file was deleted.

19 changes: 19 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import '../tailwind/index.css'

export default {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/
}
},
options: {
storySort: {
order: ['Guide', 'Primitives', ['Spacing', 'Colors', 'Typography'], 'Components'],
method: 'alphabetical'
}
}
}
}
Loading