Skip to content

Commit 79063f3

Browse files
author
jfusco
committed
Committing initial codebase for tagging component
1 parent 6577cdb commit 79063f3

28 files changed

+1082
-1
lines changed

.babelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
"react",
4+
"es2015"
5+
]
6+
}

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is for unifying the coding style for different editors and IDEs.
2+
3+
# No .editorconfig files above the root directory
4+
root = true
5+
6+
# All files unicode
7+
[*]
8+
charset = utf-8
9+
10+
# Main styles for our files
11+
[*]
12+
indent_style = tab
13+
end_of_line = lf
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true
16+
indent_size = 4

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules/
2+
/dist/
3+
/components/

.eslintrc

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"parser": "babel-eslint",
3+
"rules": {
4+
"eqeqeq": [2, "allow-null"],
5+
"no-extra-semi": 2,
6+
"semi": ["error", "always"],
7+
"no-cond-assign": 2,
8+
"accessor-pairs": 2,
9+
"no-with": 2,
10+
"no-sparse-arrays": 2,
11+
"vars-on-top": 2,
12+
"no-void": 2,
13+
"no-undef": 2,
14+
"no-caller": 2,
15+
"no-new": 2,
16+
"yoda": 2,
17+
"no-whitespace-before-property": 2,
18+
"no-inner-declarations": 2,
19+
"no-ex-assign": 2,
20+
"no-else-return": 2,
21+
"no-dupe-keys": 2,
22+
"constructor-super": 2,
23+
"no-extra-boolean-cast": 2,
24+
"no-obj-calls": 2,
25+
"no-empty": 2,
26+
"semi-spacing": ["error", {
27+
"before": false, "after": true
28+
}],
29+
"keyword-spacing": ["error", {"overrides": {
30+
"if": {"after": true},
31+
"else": {"before": true, "after": true},
32+
"for": {"after": false},
33+
"while": {"after": false},
34+
"function": {"after": true}
35+
}}],
36+
"space-before-function-paren": ["error", {
37+
"anonymous": "never", "named": "never"
38+
}],
39+
"comma-dangle": [2, "never"],
40+
"comma-style": [2, "last"],
41+
"comma-spacing": ["error", {
42+
"before": false, "after": true
43+
}],
44+
"quotes": [2, "single", "avoid-escape"],
45+
"no-trailing-spaces": 2,
46+
"no-lonely-if": 0,
47+
"eol-last": 2,
48+
"no-nested-ternary": 2,
49+
"space-in-parens": [2, "never"],
50+
"brace-style": [2, "1tbs", {
51+
"allowSingleLine": true
52+
}],
53+
"object-curly-spacing": [2, "never", {
54+
"objectsInObjects": true,
55+
"arraysInObjects": true
56+
}],
57+
"computed-property-spacing": ["error", "never"],
58+
"block-spacing": ["error", "always"],
59+
"one-var": [2, {
60+
"let": "always",
61+
"const": "never"
62+
}],
63+
"no-spaced-func": 2,
64+
"spaced-comment": 0,
65+
"quote-props": [2, "as-needed", {
66+
"keywords": true
67+
}],
68+
"linebreak-style": ["error", "unix"],
69+
"guard-for-in": 2,
70+
"prefer-const": 2,
71+
"no-var": 2,
72+
"prefer-arrow-callback": 2,
73+
"no-const-assign": 2,
74+
"arrow-parens": [2, "as-needed"],
75+
"arrow-spacing": [2, {
76+
"before": true,
77+
"after": true
78+
}]
79+
},
80+
"globals": {
81+
"console": true,
82+
"alert": true,
83+
"document": true,
84+
"window": true,
85+
"WeakMap": true
86+
}
87+
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/node_modules/
2+
/.idea/
3+
*.DS_Store
4+
npm-debug.log

.scsslint.yml

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
linters:
2+
3+
BangFormat:
4+
enabled: true
5+
space_before_bang: true
6+
space_after_bang: false
7+
8+
BorderZero:
9+
enabled: true
10+
11+
ColorKeyword:
12+
enabled: true
13+
14+
Comment:
15+
enabled: false
16+
17+
DebugStatement:
18+
enabled: true
19+
20+
DeclarationOrder:
21+
enabled: true
22+
23+
DuplicateProperty:
24+
enabled: false
25+
26+
ElsePlacement:
27+
enabled: true
28+
style: same_line
29+
30+
EmptyLineBetweenBlocks:
31+
enabled: true
32+
ignore_single_line_blocks: false
33+
34+
EmptyRule:
35+
enabled: true
36+
37+
FinalNewline:
38+
enabled: false
39+
present: false
40+
41+
HexLength:
42+
enabled: true
43+
style: short
44+
45+
HexNotation:
46+
enabled: true
47+
style: uppercase
48+
49+
HexValidation:
50+
enabled: true
51+
52+
IdSelector:
53+
enabled: false
54+
55+
ImportPath:
56+
enabled: true
57+
leading_underscore: false
58+
filename_extension: false
59+
60+
ImportantRule:
61+
enabled: false
62+
63+
Indentation:
64+
enabled: true
65+
character: tab
66+
width: 1
67+
68+
LeadingZero:
69+
enabled: true
70+
style: include_zero
71+
72+
MergeableSelector:
73+
enabled: false
74+
force_nesting: false
75+
76+
NameFormat:
77+
enabled: true
78+
convention: hyphenated_lowercase
79+
allow_leading_underscore: true
80+
81+
NestingDepth:
82+
enabled: true
83+
max_depth: 5
84+
85+
PlaceholderInExtend:
86+
enabled: false
87+
88+
PropertySortOrder:
89+
enabled: false
90+
ignore_unspecified: false
91+
92+
PropertySpelling:
93+
enabled: true
94+
extra_properties: []
95+
96+
QualifyingElement:
97+
enabled: true
98+
allow_element_with_attribute: true
99+
allow_element_with_class: false
100+
allow_element_with_id: false
101+
102+
SelectorDepth:
103+
enabled: true
104+
max_depth: 5
105+
106+
SelectorFormat:
107+
enabled: true
108+
convention: hyphenated_lowercase
109+
110+
Shorthand:
111+
enabled: true
112+
113+
SingleLinePerProperty:
114+
enabled: true
115+
allow_single_line_rule_sets: false
116+
117+
SingleLinePerSelector:
118+
enabled: true
119+
120+
SpaceAfterComma:
121+
enabled: true
122+
123+
SpaceAfterPropertyColon:
124+
enabled: true
125+
style: one_space
126+
127+
SpaceAfterPropertyName:
128+
enabled: true
129+
130+
SpaceBeforeBrace:
131+
enabled: true
132+
style: space
133+
allow_single_line_padding: true
134+
135+
SpaceBetweenParens:
136+
enabled: true
137+
spaces: 0
138+
139+
StringQuotes:
140+
enabled: true
141+
style: double_quotes
142+
143+
TrailingSemicolon:
144+
enabled: true
145+
146+
TrailingZero:
147+
enabled: true
148+
149+
UnnecessaryMantissa:
150+
enabled: true
151+
152+
UnnecessaryParentReference:
153+
enabled: true
154+
155+
UrlFormat:
156+
enabled: false
157+
158+
UrlQuotes:
159+
enabled: true
160+
161+
VendorPrefix:
162+
enabled: false
163+
164+
ZeroUnit:
165+
enabled: true
166+
severity: warning

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# react-tags
2-
Simple tagging component for React projects
2+
> Simple tagging component for React projects.

dist-components/Tag.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
'use strict';
2+
3+
Object.defineProperty(exports, "__esModule", {
4+
value: true
5+
});
6+
7+
var _react = require('react');
8+
9+
var _react2 = _interopRequireDefault(_react);
10+
11+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12+
13+
var Tag = function Tag(props) {
14+
var onRemoveClick = function onRemoveClick(e) {
15+
e.preventDefault();
16+
17+
props.removeTag();
18+
};
19+
20+
var removeIcon = function removeIcon() {
21+
if (props.readOnly) return null;
22+
23+
return _react2.default.createElement(
24+
'a',
25+
{ onClick: onRemoveClick, href: '#' },
26+
props.removeTagIcon
27+
);
28+
};
29+
30+
return _react2.default.createElement(
31+
'span',
32+
null,
33+
props.name,
34+
removeIcon()
35+
);
36+
};
37+
38+
exports.default = Tag;
39+
40+
41+
Tag.propTypes = {
42+
name: _react2.default.PropTypes.string.isRequired,
43+
removeTag: _react2.default.PropTypes.func.isRequired,
44+
readOnly: _react2.default.PropTypes.bool,
45+
removeTagIcon: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.element])
46+
};

0 commit comments

Comments
 (0)