diff --git a/.storybook/addons.js b/.storybook/addons.js index ae6d3f8..1859afa 100644 --- a/.storybook/addons.js +++ b/.storybook/addons.js @@ -1,3 +1,4 @@ import "@storybook/addon-actions/register"; import "@storybook/addon-links/register"; import "storybook-addon-material-ui/register"; +import '@storybook/addon-storysource/register'; diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js index 1288899..ce1d1ff 100644 --- a/.storybook/webpack.config.js +++ b/.storybook/webpack.config.js @@ -1,16 +1,29 @@ module.exports = ({ config }) => { - config.module.rules.push({ - test: /\.tsx?$/, - use: [ - { - loader: require.resolve("babel-loader"), - options: { - presets: [require.resolve("babel-preset-react-app")] - } - }, - require.resolve("react-docgen-typescript-loader") - ] - }); + config.module.rules.push( + { + test: /\.tsx?$/, + use: [ + { + loader: require.resolve("babel-loader"), + options: { + presets: [require.resolve("babel-preset-react-app")] + } + }, + + require.resolve("react-docgen-typescript-loader") + ] + }, + { + test: /\.stories\.tsx?$/, + loaders: [ + { + loader: require.resolve('@storybook/source-loader'), + options: { parser: 'typescript' }, + }, + ], + enforce: 'pre', + } + ); config.resolve.extensions.push(".ts", ".tsx"); diff --git a/package-lock.json b/package-lock.json index 040cd03..a90cbca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1949,6 +1949,176 @@ } } }, + "@storybook/addon-storysource": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/addon-storysource/-/addon-storysource-5.2.6.tgz", + "integrity": "sha512-3cqixGHrX6oYcaOWRwHVgD9KlSlwjspNZs5FsyRcoh5Gm0M3kXFah0UWHYqGy/JxSA2uGg47bXVTRmkydvSvyQ==", + "dev": true, + "requires": { + "@storybook/addons": "5.2.6", + "@storybook/components": "5.2.6", + "@storybook/router": "5.2.6", + "@storybook/source-loader": "5.2.6", + "@storybook/theming": "5.2.6", + "core-js": "^3.0.1", + "estraverse": "^4.2.0", + "loader-utils": "^1.2.3", + "prettier": "^1.16.4", + "prop-types": "^15.7.2", + "react-syntax-highlighter": "^8.0.1", + "regenerator-runtime": "^0.12.1", + "util-deprecate": "^1.0.2" + }, + "dependencies": { + "@storybook/addons": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/addons/-/addons-5.2.6.tgz", + "integrity": "sha512-5MF64lsAhIEMxTbVpYROz5Wez595iwSw45yXyP8gWt12d+EmFO5tdy7cYJCxcMuVhDfaCI78tFqS9orr1atVyA==", + "dev": true, + "requires": { + "@storybook/api": "5.2.6", + "@storybook/channels": "5.2.6", + "@storybook/client-logger": "5.2.6", + "@storybook/core-events": "5.2.6", + "core-js": "^3.0.1", + "global": "^4.3.2", + "util-deprecate": "^1.0.2" + } + }, + "@storybook/api": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/api/-/api-5.2.6.tgz", + "integrity": "sha512-X/di44/SAL68mD6RHTX2qdWwhjRW6BgcfPtu0dMd38ErB3AfsfP4BITXs6kFOeSM8kWiaQoyuw0pOBzA8vlYug==", + "dev": true, + "requires": { + "@storybook/channels": "5.2.6", + "@storybook/client-logger": "5.2.6", + "@storybook/core-events": "5.2.6", + "@storybook/router": "5.2.6", + "@storybook/theming": "5.2.6", + "core-js": "^3.0.1", + "fast-deep-equal": "^2.0.1", + "global": "^4.3.2", + "lodash": "^4.17.15", + "memoizerific": "^1.11.3", + "prop-types": "^15.6.2", + "react": "^16.8.3", + "semver": "^6.0.0", + "shallow-equal": "^1.1.0", + "store2": "^2.7.1", + "telejson": "^3.0.2", + "util-deprecate": "^1.0.2" + } + }, + "@storybook/channels": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/channels/-/channels-5.2.6.tgz", + "integrity": "sha512-/UsktYsXuvb1efjVPCEivhh5ywRhm7hl73pQnpJLJHRqyLMM2I5nGPFELTTNuU9yWy7sP9QL5gRqBBPe1sqjZQ==", + "dev": true, + "requires": { + "core-js": "^3.0.1" + } + }, + "@storybook/client-logger": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-5.2.6.tgz", + "integrity": "sha512-hJvPD267cCwLIRMOISjDH8h9wbwOcXIJip29UlJbU9iMtZtgE+YelmlpmZJvqcDfUiXWWrOh7tP76mj8EAfwIQ==", + "dev": true, + "requires": { + "core-js": "^3.0.1" + } + }, + "@storybook/components": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/components/-/components-5.2.6.tgz", + "integrity": "sha512-C7OS90bZ1ZvxlWUZ3B2MPFFggqAtUo7X8DqqS3IwsuDUiK9dD/KS0MwPgOuFDnOTW1R5XqmQd/ylt53w3s/U5g==", + "dev": true, + "requires": { + "@storybook/client-logger": "5.2.6", + "@storybook/theming": "5.2.6", + "@types/react-syntax-highlighter": "10.1.0", + "@types/react-textarea-autosize": "^4.3.3", + "core-js": "^3.0.1", + "global": "^4.3.2", + "markdown-to-jsx": "^6.9.1", + "memoizerific": "^1.11.3", + "polished": "^3.3.1", + "popper.js": "^1.14.7", + "prop-types": "^15.7.2", + "react": "^16.8.3", + "react-dom": "^16.8.3", + "react-focus-lock": "^1.18.3", + "react-helmet-async": "^1.0.2", + "react-popper-tooltip": "^2.8.3", + "react-syntax-highlighter": "^8.0.1", + "react-textarea-autosize": "^7.1.0", + "simplebar-react": "^1.0.0-alpha.6" + } + }, + "@storybook/core-events": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/core-events/-/core-events-5.2.6.tgz", + "integrity": "sha512-W8kLJ7tc0aAxs11CPUxUOCReocKL4MYGyjTg8qwk0USLzPUb/FUQWmhcm2ilFz6Nz8dXLcKrXdRVYTmiMsgAeg==", + "dev": true, + "requires": { + "core-js": "^3.0.1" + } + }, + "@storybook/router": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/router/-/router-5.2.6.tgz", + "integrity": "sha512-/FZd3fYg5s2QzOqSIP8UMOSnCIFFIlli/jKlOxvm3WpcpxgwQOY4lfHsLO+r9ThCLs2UvVg2R/HqGrOHqDFU7A==", + "dev": true, + "requires": { + "@reach/router": "^1.2.1", + "@types/reach__router": "^1.2.3", + "core-js": "^3.0.1", + "global": "^4.3.2", + "lodash": "^4.17.15", + "memoizerific": "^1.11.3", + "qs": "^6.6.0" + } + }, + "@storybook/theming": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/theming/-/theming-5.2.6.tgz", + "integrity": "sha512-Xa9R/H8DDgmvxsCHloJUJ2d9ZQl80AeqHrL+c/AKNpx05s9lV74DcinusCf0kz72YGUO/Xt1bAjuOvLnAaS8Gw==", + "dev": true, + "requires": { + "@emotion/core": "^10.0.14", + "@emotion/styled": "^10.0.14", + "@storybook/client-logger": "5.2.6", + "common-tags": "^1.8.0", + "core-js": "^3.0.1", + "deep-object-diff": "^1.1.0", + "emotion-theming": "^10.0.14", + "global": "^4.3.2", + "memoizerific": "^1.11.3", + "polished": "^3.3.1", + "prop-types": "^15.7.2", + "resolve-from": "^5.0.0" + } + }, + "qs": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.1.tgz", + "integrity": "sha512-Cxm7/SS/y/Z3MHWSxXb8lIFqgqBowP5JMlTUFyJN88y0SGQhVmZnqFK/PeuMX9LzUyWsqqhNxIyg0jlzq946yA==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==", + "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, "@storybook/addons": { "version": "5.2.5", "resolved": "https://registry.npmjs.org/@storybook/addons/-/addons-5.2.5.tgz", @@ -2589,6 +2759,145 @@ } } }, + "@storybook/source-loader": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/source-loader/-/source-loader-5.2.6.tgz", + "integrity": "sha512-OJWmmLlt84efk+xLEqkyVQBlD5n9tbPlkrepQKtGBpR0JXeGyyvJ/3S8jnpW3NYUrFjUgHPkSWBp/c5CfzPwSw==", + "dev": true, + "requires": { + "@storybook/addons": "5.2.6", + "@storybook/router": "5.2.6", + "core-js": "^3.0.1", + "estraverse": "^4.2.0", + "global": "^4.3.2", + "loader-utils": "^1.2.3", + "prettier": "^1.16.4", + "prop-types": "^15.7.2", + "regenerator-runtime": "^0.12.1" + }, + "dependencies": { + "@storybook/addons": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/addons/-/addons-5.2.6.tgz", + "integrity": "sha512-5MF64lsAhIEMxTbVpYROz5Wez595iwSw45yXyP8gWt12d+EmFO5tdy7cYJCxcMuVhDfaCI78tFqS9orr1atVyA==", + "dev": true, + "requires": { + "@storybook/api": "5.2.6", + "@storybook/channels": "5.2.6", + "@storybook/client-logger": "5.2.6", + "@storybook/core-events": "5.2.6", + "core-js": "^3.0.1", + "global": "^4.3.2", + "util-deprecate": "^1.0.2" + } + }, + "@storybook/api": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/api/-/api-5.2.6.tgz", + "integrity": "sha512-X/di44/SAL68mD6RHTX2qdWwhjRW6BgcfPtu0dMd38ErB3AfsfP4BITXs6kFOeSM8kWiaQoyuw0pOBzA8vlYug==", + "dev": true, + "requires": { + "@storybook/channels": "5.2.6", + "@storybook/client-logger": "5.2.6", + "@storybook/core-events": "5.2.6", + "@storybook/router": "5.2.6", + "@storybook/theming": "5.2.6", + "core-js": "^3.0.1", + "fast-deep-equal": "^2.0.1", + "global": "^4.3.2", + "lodash": "^4.17.15", + "memoizerific": "^1.11.3", + "prop-types": "^15.6.2", + "react": "^16.8.3", + "semver": "^6.0.0", + "shallow-equal": "^1.1.0", + "store2": "^2.7.1", + "telejson": "^3.0.2", + "util-deprecate": "^1.0.2" + } + }, + "@storybook/channels": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/channels/-/channels-5.2.6.tgz", + "integrity": "sha512-/UsktYsXuvb1efjVPCEivhh5ywRhm7hl73pQnpJLJHRqyLMM2I5nGPFELTTNuU9yWy7sP9QL5gRqBBPe1sqjZQ==", + "dev": true, + "requires": { + "core-js": "^3.0.1" + } + }, + "@storybook/client-logger": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/client-logger/-/client-logger-5.2.6.tgz", + "integrity": "sha512-hJvPD267cCwLIRMOISjDH8h9wbwOcXIJip29UlJbU9iMtZtgE+YelmlpmZJvqcDfUiXWWrOh7tP76mj8EAfwIQ==", + "dev": true, + "requires": { + "core-js": "^3.0.1" + } + }, + "@storybook/core-events": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/core-events/-/core-events-5.2.6.tgz", + "integrity": "sha512-W8kLJ7tc0aAxs11CPUxUOCReocKL4MYGyjTg8qwk0USLzPUb/FUQWmhcm2ilFz6Nz8dXLcKrXdRVYTmiMsgAeg==", + "dev": true, + "requires": { + "core-js": "^3.0.1" + } + }, + "@storybook/router": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/router/-/router-5.2.6.tgz", + "integrity": "sha512-/FZd3fYg5s2QzOqSIP8UMOSnCIFFIlli/jKlOxvm3WpcpxgwQOY4lfHsLO+r9ThCLs2UvVg2R/HqGrOHqDFU7A==", + "dev": true, + "requires": { + "@reach/router": "^1.2.1", + "@types/reach__router": "^1.2.3", + "core-js": "^3.0.1", + "global": "^4.3.2", + "lodash": "^4.17.15", + "memoizerific": "^1.11.3", + "qs": "^6.6.0" + } + }, + "@storybook/theming": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@storybook/theming/-/theming-5.2.6.tgz", + "integrity": "sha512-Xa9R/H8DDgmvxsCHloJUJ2d9ZQl80AeqHrL+c/AKNpx05s9lV74DcinusCf0kz72YGUO/Xt1bAjuOvLnAaS8Gw==", + "dev": true, + "requires": { + "@emotion/core": "^10.0.14", + "@emotion/styled": "^10.0.14", + "@storybook/client-logger": "5.2.6", + "common-tags": "^1.8.0", + "core-js": "^3.0.1", + "deep-object-diff": "^1.1.0", + "emotion-theming": "^10.0.14", + "global": "^4.3.2", + "memoizerific": "^1.11.3", + "polished": "^3.3.1", + "prop-types": "^15.7.2", + "resolve-from": "^5.0.0" + } + }, + "qs": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.1.tgz", + "integrity": "sha512-Cxm7/SS/y/Z3MHWSxXb8lIFqgqBowP5JMlTUFyJN88y0SGQhVmZnqFK/PeuMX9LzUyWsqqhNxIyg0jlzq946yA==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==", + "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, "@storybook/theming": { "version": "5.2.5", "resolved": "https://registry.npmjs.org/@storybook/theming/-/theming-5.2.5.tgz", diff --git a/package.json b/package.json index 2294c44..6a3ff41 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "@semantic-release/git": "^7.0.17", "@storybook/addon-info": "^5.2.5", "@storybook/addon-links": "^5.2.5", + "@storybook/addon-storysource": "^5.2.6", "@storybook/addons": "^5.2.5", "@storybook/react": "^5.2.5", "@typescript-eslint/eslint-plugin": "^2.6.0",