Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Commit bf1e44b

Browse files
committed
add an export to lang modal
0 parents  commit bf1e44b

File tree

106 files changed

+42116
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+42116
-0
lines changed

.babelrc

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"env": {
3+
"production": {
4+
"presets": ["minify"]
5+
},
6+
"test": {
7+
"presets": [
8+
["es2015"]
9+
],
10+
"plugins": [
11+
"react-hot-loader/babel",
12+
"syntax-object-rest-spread",
13+
"transform-object-rest-spread",
14+
"transform-class-properties"
15+
]
16+
}
17+
},
18+
"presets": [
19+
"react",
20+
['es2015', {'modules': false}]
21+
],
22+
"plugins": [
23+
"react-hot-loader/babel",
24+
"syntax-object-rest-spread",
25+
"transform-object-rest-spread",
26+
"transform-class-properties"
27+
]
28+
}

.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# EditorConfig helps developers define and maintain
2+
# consistent coding styles between different editors and IDEs.
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_style = space
9+
indent_size = 2
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
insert_final_newline = true
16+
trim_trailing_whitespace = true

.eslintrc

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"env": {
3+
"mocha": true,
4+
"node": true
5+
},
6+
"globals": {
7+
"expect": true,
8+
"sinon": true
9+
},
10+
"rules": {
11+
"camelcase": 1
12+
},
13+
"extends": [
14+
"mongodb-js/node",
15+
"mongodb-js/browser",
16+
"mongodb-js/react"
17+
],
18+
"plugins": ["react"]
19+
}

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
npm-debug.log
3+
node_modules/
4+
lib/
5+
lib-cov
6+
coverage
7+
.lock-wscript
8+
.idea/
9+
*.iml
10+
.nvmrc
11+
.nyc_output

.jsfmtrc

+174
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
{
2+
"preset": "default",
3+
"plugins": [
4+
"esformatter-quotes",
5+
"esformatter-semicolons",
6+
"esformatter-braces",
7+
"esformatter-quote-props",
8+
"esformatter-dot-notation",
9+
"esformatter-var-each",
10+
"esformatter-parseint",
11+
"esformatter-eol-last",
12+
"esformatter-spaced-lined-comment",
13+
"esformatter-remove-trailing-commas"
14+
],
15+
"quotes": {
16+
"type": "single",
17+
"avoidEscape": false
18+
},
19+
"indent": {
20+
"value": " "
21+
},
22+
"whiteSpace" : {
23+
"value" : " ",
24+
"removeTrailing" : 1,
25+
"before" : {
26+
"ArrayExpressionOpening" : 0,
27+
"ArrayExpressionClosing" : 0,
28+
"ArrayExpressionComma" : 0,
29+
"ArgumentComma" : 0,
30+
"ArgumentList" : 0,
31+
"ArgumentListArrayExpression" : 0,
32+
"ArgumentListFunctionExpression" : 0,
33+
"ArgumentListObjectExpression" : 0,
34+
"AssignmentOperator" : 1,
35+
"BinaryExpression": 0,
36+
"BinaryExpressionOperator" : 1,
37+
"BlockComment" : 1,
38+
"CallExpression" : -1,
39+
"CatchParameterList" : 0,
40+
"CatchOpeningBrace" : 1,
41+
"CatchClosingBrace" : 1,
42+
"CatchKeyword" : 1,
43+
"CommaOperator" : 0,
44+
"ConditionalExpressionConsequent" : 1,
45+
"ConditionalExpressionAlternate" : 1,
46+
"DoWhileStatementOpeningBrace" : 1,
47+
"DoWhileStatementClosingBrace" : 1,
48+
"DoWhileStatementConditional" : 1,
49+
"EmptyStatement" : 0,
50+
"ExpressionClosingParentheses" : 0,
51+
"FinallyKeyword" : -1,
52+
"FinallyOpeningBrace" : 1,
53+
"FinallyClosingBrace" : 1,
54+
"ForInStatement" : 1,
55+
"ForInStatementExpressionOpening" : 1,
56+
"ForInStatementExpressionClosing" : 0,
57+
"ForInStatementOpeningBrace" : 1,
58+
"ForInStatementClosingBrace" : 1,
59+
"ForStatement" : 1,
60+
"ForStatementExpressionOpening" : 1,
61+
"ForStatementExpressionClosing" : 0,
62+
"ForStatementOpeningBrace" : 1,
63+
"ForStatementClosingBrace" : 1,
64+
"ForStatementSemicolon" : 0,
65+
"FunctionDeclarationOpeningBrace" : 1,
66+
"FunctionDeclarationClosingBrace" : 1,
67+
"FunctionExpressionOpeningBrace" : 1,
68+
"FunctionExpressionClosingBrace" : 1,
69+
"IfStatementConditionalOpening" : 1,
70+
"IfStatementConditionalClosing" : 0,
71+
"IfStatementOpeningBrace" : 1,
72+
"IfStatementClosingBrace" : 1,
73+
"ElseStatementOpeningBrace" : 1,
74+
"ElseStatementClosingBrace" : 1,
75+
"ElseIfStatementOpeningBrace" : 1,
76+
"ElseIfStatementClosingBrace" : 1,
77+
"MemberExpressionClosing" : 0,
78+
"LineComment" : 1,
79+
"LogicalExpressionOperator" : 1,
80+
"Property" : 1,
81+
"PropertyValue" : 1,
82+
"ParameterComma" : 0,
83+
"ParameterList" : 0,
84+
"SwitchDiscriminantOpening" : 1,
85+
"SwitchDiscriminantClosing" : 0,
86+
"ThrowKeyword": 1,
87+
"TryKeyword": -1,
88+
"TryOpeningBrace" : 1,
89+
"TryClosingBrace" : 1,
90+
"UnaryExpressionOperator": 0,
91+
"VariableName" : 1,
92+
"VariableValue" : 1,
93+
"WhileStatementConditionalOpening" : 1,
94+
"WhileStatementConditionalClosing" : 0,
95+
"WhileStatementOpeningBrace" : 1,
96+
"WhileStatementClosingBrace" : 1
97+
},
98+
99+
"after" : {
100+
"ArrayExpressionOpening" : 0,
101+
"ArrayExpressionClosing" : 0,
102+
"ArrayExpressionComma" : 1,
103+
"ArgumentComma" : 1,
104+
"ArgumentList" : 0,
105+
"ArgumentListArrayExpression" : 0,
106+
"ArgumentListFunctionExpression" : 0,
107+
"ArgumentListObjectExpression" : 0,
108+
"AssignmentOperator" : 1,
109+
"BinaryExpression": 0,
110+
"BinaryExpressionOperator" : 1,
111+
"BlockComment" : 1,
112+
"CallExpression" : 0,
113+
"CatchParameterList" : 0,
114+
"CatchOpeningBrace" : 1,
115+
"CatchClosingBrace" : 1,
116+
"CatchKeyword" : 1,
117+
"CommaOperator" : 1,
118+
"ConditionalExpressionConsequent" : 1,
119+
"ConditionalExpressionTest" : 1,
120+
"DoWhileStatementOpeningBrace" : 1,
121+
"DoWhileStatementClosingBrace" : 1,
122+
"DoWhileStatementBody" : 1,
123+
"EmptyStatement" : 0,
124+
"ExpressionOpeningParentheses" : 0,
125+
"FinallyKeyword" : -1,
126+
"FinallyOpeningBrace" : 1,
127+
"FinallyClosingBrace" : 1,
128+
"ForInStatement" : 1,
129+
"ForInStatementExpressionOpening" : 0,
130+
"ForInStatementExpressionClosing" : 1,
131+
"ForInStatementOpeningBrace" : 1,
132+
"ForInStatementClosingBrace" : 1,
133+
"ForStatement" : 1,
134+
"ForStatementExpressionOpening" : 0,
135+
"ForStatementExpressionClosing" : 1,
136+
"ForStatementClosingBrace" : 1,
137+
"ForStatementOpeningBrace" : 1,
138+
"ForStatementSemicolon" : 1,
139+
"FunctionReservedWord": 0,
140+
"FunctionName" : 0,
141+
"FunctionExpressionOpeningBrace" : 1,
142+
"FunctionExpressionClosingBrace" : 0,
143+
"FunctionDeclarationOpeningBrace" : 0,
144+
"FunctionDeclarationClosingBrace" : 0,
145+
"IfStatementConditionalOpening" : 0,
146+
"IfStatementConditionalClosing" : 1,
147+
"IfStatementOpeningBrace" : 1,
148+
"IfStatementClosingBrace" : 1,
149+
"ElseStatementOpeningBrace" : 1,
150+
"ElseStatementClosingBrace" : 1,
151+
"ElseIfStatementOpeningBrace" : 1,
152+
"ElseIfStatementClosingBrace" : 1,
153+
"MemberExpressionOpening" : 0,
154+
"LogicalExpressionOperator" : 1,
155+
"ObjectExpressionClosingBrace": 0,
156+
"PropertyName" : 0,
157+
"PropertyValue" : 0,
158+
"ParameterComma" : 1,
159+
"ParameterList" : 0,
160+
"SwitchDiscriminantOpening" : 0,
161+
"SwitchDiscriminantClosing" : 1,
162+
"ThrowKeyword": 1,
163+
"TryKeyword": -1,
164+
"TryOpeningBrace" : 1,
165+
"TryClosingBrace" : 1,
166+
"UnaryExpressionOperator": 0,
167+
"VariableName" : 1,
168+
"WhileStatementConditionalOpening" : 0,
169+
"WhileStatementConditionalClosing" : 1,
170+
"WhileStatementOpeningBrace" : 1,
171+
"WhileStatementClosingBrace" : 1
172+
}
173+
}
174+
}

.npmignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.jshintrc
2+
.jsfmtrc
3+
.travis.yml
4+
.zuul.yml
5+
test/

.nycrc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"exclude": [
3+
"config",
4+
".tmp",
5+
"test"
6+
],
7+
"reporter": [
8+
"text",
9+
"html"
10+
],
11+
"sourceMap": false,
12+
"instrument": false
13+
}

.storybook/config.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { configure, addDecorator, setAddon } from '@storybook/react';
2+
import chaptersAddon from 'react-storybook-addon-chapters';
3+
import PageDecorator from 'storybook/decorators/page';
4+
5+
setAddon(chaptersAddon);
6+
7+
// Add decorators globally to wrap our stories with
8+
addDecorator(PageDecorator);
9+
10+
// Dynamically load all stories found in the components directory that
11+
// match the .stores.js extension
12+
const req = require.context('../src', true, /\.stories\.js$/);
13+
14+
function loadStories() {
15+
req.keys().forEach((filename) => req(filename));
16+
}
17+
18+
configure(loadStories, module);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import classnames from 'classnames';
4+
import styles from './ComponentPreview.less';
5+
6+
const ComponentPreview = ({ dark, className, children }) => {
7+
const _className = classnames(
8+
styles.root,
9+
{ [styles['root--light']]: !dark },
10+
{ [styles['root--dark']]: dark },
11+
className
12+
);
13+
14+
return (
15+
<div className={_className}>
16+
{children}
17+
</div>
18+
);
19+
};
20+
21+
ComponentPreview.defaultProps = {
22+
dark: false,
23+
className: ''
24+
};
25+
26+
ComponentPreview.propTypes = {
27+
className: PropTypes.string,
28+
children: PropTypes.node,
29+
dark: PropTypes.bool
30+
};
31+
32+
export default ComponentPreview;
33+
export { ComponentPreview };
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.root {
2+
@gutter: 1rem;
3+
4+
margin-top: @gutter / 2;
5+
padding: @gutter;
6+
border: 1px solid transparent;
7+
position: relative;
8+
9+
&::before {
10+
content: 'Live Preview';
11+
display: block;
12+
color: rgb(137, 141, 151);
13+
position: absolute;
14+
top: -(@gutter + (@gutter/2));
15+
left: 0;
16+
font-size: 16px;
17+
margin-bottom: 20px;
18+
margin-top: 0px;
19+
pointer-events: none;
20+
}
21+
}
22+
23+
.root--light {
24+
background-color: #fff;
25+
border-color: rgb(204, 214, 221);
26+
}
27+
28+
.root--dark {
29+
background-color: #333;
30+
border-color: #000;
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import ComponentPreview from './ComponentPreview';
2+
3+
export default ComponentPreview;
4+
export { ComponentPreview };
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
import classnames from 'classnames';
3+
import styles from './PageDecorator.less';
4+
5+
const PageDecorator = (storyFn) => (
6+
<article className={classnames(styles.article)}>
7+
{ storyFn() }
8+
</article>
9+
);
10+
11+
export default PageDecorator;
12+
export { PageDecorator };
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.article {
2+
padding: 2rem;
3+
4+
h1:first-child {
5+
margin-top: 0;
6+
}
7+
}

.storybook/decorators/page/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import PageDecorator from './PageDecorator';
2+
3+
export default PageDecorator;
4+
export { PageDecorator };

0 commit comments

Comments
 (0)