diff --git a/.eslintrc b/.eslintrc index c7c463744..3ab2380b6 100644 --- a/.eslintrc +++ b/.eslintrc @@ -186,7 +186,7 @@ "react/no-did-update-set-state": 2, "react/no-multi-comp": 2, "react/no-unknown-property": 2, - "react/prop-types": 0, + "react/prop-types": [2, { "ignore": ["style", "children"] }], "react/react-in-jsx-scope": 2, "react/require-extension": [2, { "extensions": [".js", ".jsx"] }], "react/self-closing-comp": 2, diff --git a/demo/app.js b/demo/app.js index eb204621d..47333e098 100644 --- a/demo/app.js +++ b/demo/app.js @@ -1,5 +1,5 @@ const React = require('react'); -const { Select, Icon, RangeSelector, Loader, DonutChart } = require('../src/Index'); +const { Select, Icon, RangeSelector, Loader, DonutChart, TypeAhead } = require('../src/Index'); const styles = { block: { @@ -280,6 +280,22 @@ const Demo = React.createClass({



+ +

+ +
+ {this._renderItemList()} +
+ + ); + } +}); + +const styles = { + component: { + backgroundColor: '#FFFFFF', + borderColor: '#e5e5e5', + borderRadius: '3px', + borderStyle: 'solid', + borderWidth: '1px', + boxSizing: 'border-box', + fontFamily: StyleConstants.FontFamily, + fontSize: '12px', + paddingTop: '10px', + paddingRight: '10px', + paddingBottom: '10px', + paddingLeft: '10px', + position: 'relative', + WebkitAppearance: 'none', + width: '100%', + minHeight: '35px', + + ':focus': { + backgroundColor: '#FFFFFF', + boxShadow: 'none', + color: StyleConstants.Colors.FONT, + outline: 'none' + } + }, + activeItem: { + backgroundColor: StyleConstants.Colors.PRIMARY, + color: StyleConstants.Colors.INVERSE_PRIMARY + }, + clearFix: { + clear: 'both' + }, + input: { + backgroundColor: '#FFFFFF', + borderWidth: 0, + color: StyleConstants.Colors.FONT, + fontSize: '13px', + minWidth: '33%', + outline: 'none', + WebkitAppearance: 'none', + + ':focus': { + borderWidth: 0, + boxShadow: 'none', + outline: 'none' + } + }, + itemList: { + minHeight: '20px', + maxHeight: '200px', + overflow: 'auto' + }, + itemListContainer: { + clear: 'both', + backgroundColor: '#fff', + position: 'absolute', + left: -1, + right: -1, + marginTop: '7px', + marginBottom: '20px', + border: '1px solid #E5E5E5', + borderRadius: '0 0 3px 3px', + boxShadow: '0 30px 30px 10px rgba(0,0,0,0.1)', + zIndex: 10 + }, + itemTag: { + backgroundColor: '#eee', + borderColor: '#e5e5e5', + borderRadius: '3px', + borderStyle: 'solid', + borderWidth: '1px', + display: 'inline-block', + lineHeight: '0.8em', + marginTop: '1px', + marginRight: '2px', + marginBottom: '1px', + paddingLeft: '3px', + position: 'relative' + }, + item: { + color: StyleConstants.Colors.LIGHT_FONT, + cursor: 'pointer', + paddingTop: '10px', + paddingRight: '10px', + paddingBottom: '10px', + paddingLeft: '10px', + lineHeight: '1em', + + ':focus': { + border: 'none', + boxShadow: 'none', + outline: 'none' + }, + ':hover': { + backgroundColor: StyleConstants.Colors.PRIMARY, + color: StyleConstants.Colors.INVERSE_PRIMARY + } + }, + removeIcon: { + color: StyleConstants.Colors.LIGHT_FONT, + marginLeft: '5px', + cursor: 'pointer' + } +}; + +module.exports = Radium(TypeAhead); \ No newline at end of file