Skip to content

Commit

Permalink
Committing initial codebase for tagging component
Browse files Browse the repository at this point in the history
  • Loading branch information
jfusco committed Jul 17, 2016
1 parent 6577cdb commit 79063f3
Show file tree
Hide file tree
Showing 28 changed files with 1,082 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"react",
"es2015"
]
}
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file is for unifying the coding style for different editors and IDEs.

# No .editorconfig files above the root directory
root = true

# All files unicode
[*]
charset = utf-8

# Main styles for our files
[*]
indent_style = tab
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_size = 4
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/
/dist/
/components/
87 changes: 87 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"parser": "babel-eslint",
"rules": {
"eqeqeq": [2, "allow-null"],
"no-extra-semi": 2,
"semi": ["error", "always"],
"no-cond-assign": 2,
"accessor-pairs": 2,
"no-with": 2,
"no-sparse-arrays": 2,
"vars-on-top": 2,
"no-void": 2,
"no-undef": 2,
"no-caller": 2,
"no-new": 2,
"yoda": 2,
"no-whitespace-before-property": 2,
"no-inner-declarations": 2,
"no-ex-assign": 2,
"no-else-return": 2,
"no-dupe-keys": 2,
"constructor-super": 2,
"no-extra-boolean-cast": 2,
"no-obj-calls": 2,
"no-empty": 2,
"semi-spacing": ["error", {
"before": false, "after": true
}],
"keyword-spacing": ["error", {"overrides": {
"if": {"after": true},
"else": {"before": true, "after": true},
"for": {"after": false},
"while": {"after": false},
"function": {"after": true}
}}],
"space-before-function-paren": ["error", {
"anonymous": "never", "named": "never"
}],
"comma-dangle": [2, "never"],
"comma-style": [2, "last"],
"comma-spacing": ["error", {
"before": false, "after": true
}],
"quotes": [2, "single", "avoid-escape"],
"no-trailing-spaces": 2,
"no-lonely-if": 0,
"eol-last": 2,
"no-nested-ternary": 2,
"space-in-parens": [2, "never"],
"brace-style": [2, "1tbs", {
"allowSingleLine": true
}],
"object-curly-spacing": [2, "never", {
"objectsInObjects": true,
"arraysInObjects": true
}],
"computed-property-spacing": ["error", "never"],
"block-spacing": ["error", "always"],
"one-var": [2, {
"let": "always",
"const": "never"
}],
"no-spaced-func": 2,
"spaced-comment": 0,
"quote-props": [2, "as-needed", {
"keywords": true
}],
"linebreak-style": ["error", "unix"],
"guard-for-in": 2,
"prefer-const": 2,
"no-var": 2,
"prefer-arrow-callback": 2,
"no-const-assign": 2,
"arrow-parens": [2, "as-needed"],
"arrow-spacing": [2, {
"before": true,
"after": true
}]
},
"globals": {
"console": true,
"alert": true,
"document": true,
"window": true,
"WeakMap": true
}
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules/
/.idea/
*.DS_Store
npm-debug.log
166 changes: 166 additions & 0 deletions .scsslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
linters:

BangFormat:
enabled: true
space_before_bang: true
space_after_bang: false

BorderZero:
enabled: true

ColorKeyword:
enabled: true

Comment:
enabled: false

DebugStatement:
enabled: true

DeclarationOrder:
enabled: true

DuplicateProperty:
enabled: false

ElsePlacement:
enabled: true
style: same_line

EmptyLineBetweenBlocks:
enabled: true
ignore_single_line_blocks: false

EmptyRule:
enabled: true

FinalNewline:
enabled: false
present: false

HexLength:
enabled: true
style: short

HexNotation:
enabled: true
style: uppercase

HexValidation:
enabled: true

IdSelector:
enabled: false

ImportPath:
enabled: true
leading_underscore: false
filename_extension: false

ImportantRule:
enabled: false

Indentation:
enabled: true
character: tab
width: 1

LeadingZero:
enabled: true
style: include_zero

MergeableSelector:
enabled: false
force_nesting: false

NameFormat:
enabled: true
convention: hyphenated_lowercase
allow_leading_underscore: true

NestingDepth:
enabled: true
max_depth: 5

PlaceholderInExtend:
enabled: false

PropertySortOrder:
enabled: false
ignore_unspecified: false

PropertySpelling:
enabled: true
extra_properties: []

QualifyingElement:
enabled: true
allow_element_with_attribute: true
allow_element_with_class: false
allow_element_with_id: false

SelectorDepth:
enabled: true
max_depth: 5

SelectorFormat:
enabled: true
convention: hyphenated_lowercase

Shorthand:
enabled: true

SingleLinePerProperty:
enabled: true
allow_single_line_rule_sets: false

SingleLinePerSelector:
enabled: true

SpaceAfterComma:
enabled: true

SpaceAfterPropertyColon:
enabled: true
style: one_space

SpaceAfterPropertyName:
enabled: true

SpaceBeforeBrace:
enabled: true
style: space
allow_single_line_padding: true

SpaceBetweenParens:
enabled: true
spaces: 0

StringQuotes:
enabled: true
style: double_quotes

TrailingSemicolon:
enabled: true

TrailingZero:
enabled: true

UnnecessaryMantissa:
enabled: true

UnnecessaryParentReference:
enabled: true

UrlFormat:
enabled: false

UrlQuotes:
enabled: true

VendorPrefix:
enabled: false

ZeroUnit:
enabled: true
severity: warning
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# react-tags
Simple tagging component for React projects
> Simple tagging component for React projects.
46 changes: 46 additions & 0 deletions dist-components/Tag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Tag = function Tag(props) {
var onRemoveClick = function onRemoveClick(e) {
e.preventDefault();

props.removeTag();
};

var removeIcon = function removeIcon() {
if (props.readOnly) return null;

return _react2.default.createElement(
'a',
{ onClick: onRemoveClick, href: '#' },
props.removeTagIcon
);
};

return _react2.default.createElement(
'span',
null,
props.name,
removeIcon()
);
};

exports.default = Tag;


Tag.propTypes = {
name: _react2.default.PropTypes.string.isRequired,
removeTag: _react2.default.PropTypes.func.isRequired,
readOnly: _react2.default.PropTypes.bool,
removeTagIcon: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.element])
};
Loading

0 comments on commit 79063f3

Please sign in to comment.