UNPKG

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

60 lines (48 loc) 2.7 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.Icon = undefined; 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 display: inline-block;\n position: ', ';\n background-image: url(', ');\n background-repeat: ', ';\n background-size: ', ';\n background-position: ', ';\n width: ', ';\n height: ', ';\n font-size: ', ';\n color: ', ';\n top: ', ';\n right: ', ';\n left: ', ';\n font-weight: ', ';\n cursor: ', ';\n &:before {\n content: ', ';\n }\n'], ['\n display: inline-block;\n position: ', ';\n background-image: url(', ');\n background-repeat: ', ';\n background-size: ', ';\n background-position: ', ';\n width: ', ';\n height: ', ';\n font-size: ', ';\n color: ', ';\n top: ', ';\n right: ', ';\n left: ', ';\n font-weight: ', ';\n cursor: ', ';\n &:before {\n content: ', ';\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 Icon = exports.Icon = _styledComponents2.default.i(_templateObject, function (props) { return props.position; }, function (props) { return props.url; }, function (props) { return props.repeat || 'no-repeat'; }, function (props) { return props.size || '10px'; }, function (props) { return props.position || '10px 10px'; }, function (props) { return props.width || '30px'; }, function (props) { return props.height || '25px'; }, function (props) { return props.fontSize || '30px'; }, function (props) { return props.color || props.theme.border.primary; }, function (props) { return props.top || '30px'; }, function (props) { return props.right || '30px'; }, function (props) { return props.left; }, function (props) { return props.fontWeight || 'normal'; }, function (props) { return props.cursor || 'default'; }, function (props) { return props.content + ' !important'; }); Icon.defaultProps = defaultProps; exports.default = Icon;