-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 492936d
Showing
54 changed files
with
16,495 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[package.json] | ||
indent_size = 2 | ||
|
||
[{*.md,*.snap}] | ||
trim_trailing_whitespace = false |
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,2 @@ | ||
/public | ||
/coverage |
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,12 @@ | ||
{ | ||
"root": true, | ||
"parser": "babel-eslint", | ||
"extends": [ | ||
"eslint-config-moxy/es8", | ||
"eslint-config-moxy/addons/browser", | ||
"eslint-config-moxy/addons/object-spread", | ||
"eslint-config-moxy/addons/es6-modules", | ||
"eslint-config-moxy/addons/react", | ||
"eslint-config-moxy/addons/jest" | ||
] | ||
} |
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,3 @@ | ||
node_modules | ||
npm-debug.log | ||
/coverage |
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,3 @@ | ||
import 'storybook-readme/register'; | ||
import '@storybook/addon-knobs/register'; | ||
import '@storybook/addon-actions/register'; |
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,11 @@ | ||
import { configure } from '@storybook/react'; | ||
import './styles.css'; | ||
|
||
configure(() => { | ||
require('../stories/typography.js'); | ||
require('../stories/colors.js'); | ||
require('../stories/brand-logo.js'); | ||
require('../stories/icon.js'); | ||
require('../stories/button.js'); | ||
require('../stories/floating-d.js'); | ||
}, module); |
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,5 @@ | ||
@import "../src/styles/index"; | ||
|
||
body { | ||
margin: 10px; | ||
} |
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,87 @@ | ||
const path = require('path'); | ||
const SvgStorePlugin = require('external-svg-sprite-loader/lib/SvgStorePlugin'); | ||
|
||
module.exports = (storybookBaseConfig, configType) => { | ||
// CSS files loader which enables the use of postcss | ||
storybookBaseConfig.module.rules.push({ | ||
test: /\.css$/, | ||
loader: [ | ||
{ | ||
// Extract CSS files if we are not in development mode | ||
loader: 'style-loader', | ||
options: { | ||
convertToAbsoluteUrls: true, | ||
}, | ||
}, | ||
{ | ||
loader: 'css-loader', | ||
options: { | ||
modules: true, | ||
sourceMap: true, | ||
importLoaders: 1, | ||
camelCase: 'dashes', | ||
localIdentName: '[name]__[local]___[hash:base64:5]!', | ||
}, | ||
}, | ||
{ | ||
loader: 'postcss-loader', | ||
options: require('postcss-preset-moxy')({ | ||
// Any non-relative imports are resolved to this path | ||
importPath: path.join(__dirname, '../src/styles/imports'), | ||
}), | ||
}, | ||
], | ||
}); | ||
|
||
// Load SVG files and create an external sprite | ||
// While this has a lot of advantages such as not blocking the initial load, | ||
// it might not workout for every SVG, see: https://github.com/moxystudio/react-with-moxy/issues/6 | ||
storybookBaseConfig.module.rules.push({ | ||
test: /\.svg$/, | ||
exclude: [/\.inline\.svg$/, path.join(__dirname, '../src/media/fonts')], | ||
use: [ | ||
{ | ||
loader: 'external-svg-sprite-loader', | ||
options: { | ||
name: 'images/svg-sprite.svg', | ||
}, | ||
}, | ||
// Uniquify classnames and ids so that if svgxuse injects the sprite into the body, | ||
// it doesn't cause DOM conflicts | ||
{ | ||
loader: 'svg-css-modules-loader', | ||
options: { | ||
transformId: true, | ||
}, | ||
}, | ||
], | ||
}); | ||
storybookBaseConfig.plugins.push(new SvgStorePlugin()); | ||
|
||
// Support inline svgs, see explanation above | ||
storybookBaseConfig.module.rules.push({ | ||
test: /\.inline\.svg$/, | ||
use: [ | ||
'raw-loader', | ||
{ | ||
loader: 'svgo-loader', | ||
options: { | ||
plugins: [ | ||
{ removeTitle: true }, | ||
{ removeDimensions: true }, | ||
{ cleanupIDs: false }, | ||
], | ||
}, | ||
}, | ||
// Uniquify classnames and ids so they don't conflict with eachother | ||
{ | ||
loader: 'svg-css-modules-loader', | ||
options: { | ||
transformId: true, | ||
}, | ||
}, | ||
], | ||
}); | ||
|
||
return storybookBaseConfig; | ||
}; |
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 @@ | ||
/coverage |
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,3 @@ | ||
{ | ||
"extends": "stylelint-config-moxy" | ||
} |
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,3 @@ | ||
# @discussify/styleguide | ||
|
||
Discussify's living styleguide. |
Oops, something went wrong.