Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
satazor committed Jul 1, 2018
0 parents commit 492936d
Show file tree
Hide file tree
Showing 54 changed files with 16,495 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
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
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/public
/coverage
12 changes: 12 additions & 0 deletions .eslintrc.json
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"
]
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
npm-debug.log
/coverage
3 changes: 3 additions & 0 deletions .storybook/addons.js
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';
11 changes: 11 additions & 0 deletions .storybook/config.js
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);
5 changes: 5 additions & 0 deletions .storybook/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import "../src/styles/index";

body {
margin: 10px;
}
87 changes: 87 additions & 0 deletions .storybook/webpack.config.js
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;
};
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/coverage
3 changes: 3 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "stylelint-config-moxy"
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @discussify/styleguide

Discussify's living styleguide.
Loading

0 comments on commit 492936d

Please sign in to comment.