Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
es2021: true,
'react-native/react-native': true,
},
extends: ['standard-with-typescript', 'plugin:react/recommended', 'prettier'],
extends: ['standard-with-typescript', 'plugin:react/recommended', 'prettier', 'plugin:storybook/recommended'],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ yarn-error.log
# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

react-native-dropdown-selector-*.tgz
react-native-dropdown-selector-*.tgz
*storybook.log
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules/
package-lock.json
example/
src/stories/
25 changes: 25 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { StorybookConfig } from '@storybook/react-webpack5';

const config: StorybookConfig = {
stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],

addons: [
'@storybook/addon-webpack5-compiler-swc',
'@storybook/addon-onboarding',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
'@storybook/addon-webpack5-compiler-babel',
'@chromatic-com/storybook'
],

framework: {
name: '@storybook/react-webpack5',
options: {},
},

docs: {
autodocs: true
}
};
export default config;
14 changes: 14 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Preview } from '@storybook/react';

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
22 changes: 22 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = async ({ config }) => {
config.resolve.alias = {
...config.resolve.alias,
'react-native$': 'react-native-web',
};

config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
{
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'],
},
},
],
});

config.resolve.extensions.push('.ts', '.tsx');

return config;
};
34 changes: 25 additions & 9 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading