Skip to content

Commit 1feaa24

Browse files
🔧 [config] add react storybook.
1 parent 81dd701 commit 1feaa24

File tree

9 files changed

+8228
-1786
lines changed

9 files changed

+8228
-1786
lines changed

.storybook/config.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { configure, setAddon } from '@storybook/react';
2+
import infoAddon, {setDefaults} from '@storybook/addon-info';
3+
4+
// addon-info
5+
setDefaults({
6+
inline: true,
7+
maxPropsIntoLine: 1,
8+
maxPropObjectKeys: 10,
9+
maxPropArrayLength: 10,
10+
maxPropStringLength: 100,
11+
source: true,
12+
});
13+
14+
setAddon(infoAddon);
15+
16+
function loadStories() {
17+
require('../stories');
18+
}
19+
20+
configure(loadStories, module);

.storybook/webpack.config.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// you can use this file to add your custom webpack plugins, loaders and anything you like.
2+
// This is just the basic way to add additional webpack configurations.
3+
// For more information refer the docs: https://storybook.js.org/docs/react-storybook/configurations/custom-webpack-config
4+
5+
// IMPORTANT
6+
// When you add this file, we won't add the default configurations which is similar
7+
// to "React Create App". This only has babel loader to load JavaScript.
8+
const path = require('path');
9+
const ROOT_PATH = process.cwd();
10+
11+
module.exports = {
12+
plugins: [
13+
// your custom plugins
14+
],
15+
16+
module: {
17+
rules: [
18+
// add your custom loaders.
19+
{
20+
test: /\.css$/,
21+
use: [
22+
{loader: 'style-loader'},
23+
{loader: 'css-loader'},
24+
{
25+
loader: 'postcss-loader',
26+
options: {config: {path: path.join(ROOT_PATH, 'postcss.config.js')}},
27+
},
28+
],
29+
},
30+
],
31+
},
32+
};

config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module.exports = {
1+
module.exports = {
22
name: 'mobile-datepicker',
33
};

lib/index.css

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108

109109
.datepicker-scroll {
110110
list-style-type: none;
111+
padding: 0;
111112
&>li {
112113
height: 40px;
113114
line-height: 40px;

0 commit comments

Comments
 (0)