-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add basic local storybook implementation for newspack-ui
- Loading branch information
1 parent
01c34f8
commit 4315e2d
Showing
10 changed files
with
15,749 additions
and
1,916 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
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,31 @@ | ||
const config = { | ||
stories: [ | ||
'../storybook/**/*.mdx', | ||
'../storybook/**/*.stories.@(js|jsx|mjs|ts|tsx)', | ||
'../src/**/*.mdx', | ||
'../src/**/*.stories.@(js|jsx|mjs|ts|tsx)', | ||
], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions', | ||
], | ||
framework: { | ||
name: '@storybook/react-webpack5', | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: 'tag', | ||
}, | ||
webpackFinal: async (config) => { | ||
// Add SASS support | ||
config.module.rules.push({ | ||
test: /\.scss$/, | ||
use: ['style-loader', 'css-loader', 'sass-loader'], | ||
}); | ||
|
||
return config; | ||
}, | ||
}; | ||
|
||
export default 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,23 @@ | ||
import '../src/newspack-ui/style.scss'; | ||
|
||
/** @type { import('@storybook/react').Preview } */ | ||
const preview = { | ||
parameters: { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}, | ||
decorators: [ | ||
(Story) => ( | ||
<div style={{ margin: '2em' }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
}; | ||
|
||
export default preview; |
Oops, something went wrong.