fk-react-ui-components
Version:
Step 1 : Create a file in [ Seeds / Plants / Trees ] <br> Step 2 : It should export an Object with component name and story Component [Refer other components] <br> Step 3 : Story Component should return a react component <br> Step 3 : Created file should
55 lines (43 loc) • 3.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _templateObject = _taggedTemplateLiteral(['\n color: ', ';\n font-size: ', ';\n display: ', ';\n border: ', ';\n background-color: ', ';\n width: ', ';\n max-width: ', ';\n height: ', ';\n margin: ', ';\n padding: ', ';\n border-radius: ', ';\n box-shadow: ', ';\n &:focus {\n outline: none;\n }\n &:focus::-webkit-input-placeholder {\n color: transparent;\n }\n &:focus::-moz-placeholder {\n color: transparent;\n }\n &:focus:-ms-input-placeholder {\n color: transparent;\n }\n &.active {\n border-color: ', ';\n }\n'], ['\n color: ', ';\n font-size: ', ';\n display: ', ';\n border: ', ';\n background-color: ', ';\n width: ', ';\n max-width: ', ';\n height: ', ';\n margin: ', ';\n padding: ', ';\n border-radius: ', ';\n box-shadow: ', ';\n &:focus {\n outline: none;\n }\n &:focus::-webkit-input-placeholder {\n color: transparent;\n }\n &:focus::-moz-placeholder {\n color: transparent;\n }\n &:focus:-ms-input-placeholder {\n color: transparent;\n }\n &.active {\n border-color: ', ';\n }\n']);
var _styledComponents = require('styled-components');
var _styledComponents2 = _interopRequireDefault(_styledComponents);
var _colorCodes = require('../../colorCodes');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var defaultProps = {
theme: _extends({}, _colorCodes.guidelineColors)
};
var SearchInput = _styledComponents2.default.input(_templateObject, function (props) {
return props.color || props.theme.text.tertiary;
}, function (props) {
return props.fontSize || '13px';
}, function (props) {
return props.display || 'block';
}, function (props) {
return props.border || '1px solid ' + props.theme.border.primary;
}, function (props) {
return props.backgroundColor || 'rgba(234,234,234,0.6)';
}, function (props) {
return props.width || '100%';
}, function (props) {
return props.maxWidth || 'none';
}, function (props) {
return props.height || '40px';
}, function (props) {
return props.margin || '0px';
}, function (props) {
return props.padding || '7px';
}, function (props) {
return props.borderRadius || '4px';
}, function (props) {
return props.boxShadow || 'inset 0 1px 3px 0 rgba(63,63,63,0.15)';
}, function (props) {
return props.theme.accent.primary;
});
SearchInput.defaultProps = defaultProps;
exports.default = SearchInput;