Skip to content

Commit

Permalink
chore(Storybook): migrate to version 6 (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
eszthoff authored Aug 22, 2022
1 parent fb3babb commit 0513dd1
Show file tree
Hide file tree
Showing 234 changed files with 48,534 additions and 42,325 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
"react/display-name": "off",
"react/destructuring-assignment": "off",
"react/prop-types": "off",
"react/jsx-setDefaultAreaHighlight-newline": "off"
"react/jsx-setDefaultAreaHighlight-newline": "off",
"import/no-default-export": "off",
"no-underscore-dangle": "off"
}
}
],
Expand Down
3 changes: 0 additions & 3 deletions .storybook/.babelrc

This file was deleted.

6 changes: 2 additions & 4 deletions .storybook/oneui.theme.js → .storybook/TKTheme.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { create } from '@storybook/theming';
import brandImage from './textkernel.svg';

export const OneUITheme = create({
export default create({
base: 'light',

// Branding
brandTitle: 'Textkernel OneUI',
brandUrl: 'https://textkernel.com',
brandImage
brandImage,
});
2 changes: 0 additions & 2 deletions .storybook/addons.js

This file was deleted.

28 changes: 0 additions & 28 deletions .storybook/config.js

This file was deleted.

31 changes: 31 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const path = require('path');
const { getRules } = require('../scripts/build/webpack.config');

module.exports = {
stories: [
'../stories/theme/*.@(js|jsx|ts|tsx)',
'../stories/atoms/*.@(js|jsx|ts|tsx)',
'../stories/molecules/*.@(js|jsx|ts|tsx)',
'../stories/organisms/*.@(js|jsx|ts|tsx)',
'../stories/packages/*.@(js|jsx|ts|tsx)',
'../stories/**/*.@(js|jsx|ts|tsx)',
],
addons: [
'@storybook/addon-actions',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],
framework: '@storybook/react',
webpackFinal: async (config, { configType }) => {
const type = configType === 'DEVELOPMENT' ? 'dev' : 'prod';
const rules = getRules(type);

config.resolve.alias['@textkernel/oneui'] = path.resolve(__dirname, '../src');
// Make whatever fine-grained changes you need
config.module.rules.push(rules.js, rules.scss);

// Return the altered config
return config;
},
};
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/addons';
import TKTheme from './TKTheme';

addons.setConfig({
theme: TKTheme,
});
15 changes: 15 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
options: {
storySort: {
method: 'alphabetical',
order: ['Concepts', 'Theme', 'Atoms', 'Molecules', 'Organisms', 'Packages'],
},
},
};
69 changes: 0 additions & 69 deletions .storybook/webpack.config.js

This file was deleted.

Loading

0 comments on commit 0513dd1

Please sign in to comment.