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
75 lines (55 loc) • 4.92 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 _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _colorCodes = require('../../colorCodes');
var _styledComponents = require('styled-components');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var WebsiteLinkIcon = function (_Component) {
_inherits(WebsiteLinkIcon, _Component);
function WebsiteLinkIcon() {
_classCallCheck(this, WebsiteLinkIcon);
return _possibleConstructorReturn(this, (WebsiteLinkIcon.__proto__ || Object.getPrototypeOf(WebsiteLinkIcon)).apply(this, arguments));
}
_createClass(WebsiteLinkIcon, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
'svg',
{ x: '0', y: '0', viewBox: '0 0 20 20', width: this.props.width },
_react2.default.createElement(
'g',
{ stroke: 'none', strokeWidth: '1', fill: 'none', fillRule: 'evenodd' },
_react2.default.createElement(
'g',
{ id: 'ic_desktop_windows_black_24px' },
_react2.default.createElement('polygon', { id: 'Shape', points: '0 0 20 0 20 20 0 20' }),
_react2.default.createElement('path', {
d: 'M16.6666667,1.66666667 L3.33333333,1.66666667 C2.5,1.66666667 1.66985348,2.50833333 1.66985348,3.33333333 L1.66666667,13.3333333 C1.66666667,14.1583333 2.1969697,15 3.03030303,15 L8.33333333,15 L8.33333333,16.6666667 L6.66666667,16.6666667 L6.66666667,18.3333333 L13.3333333,18.3333333 L13.3333333,16.6666667 L11.6666667,16.6666667 L11.6666667,15 L16.6666667,15 C17.5,15 18.3333333,14.1583333 18.3333333,13.3333333 L18.3365201,3.33333333 C18.3365201,2.50833333 17.5,1.66666667 16.6666667,1.66666667 Z M16.6660432,13.3333333 L3.33270987,13.3333333 L3.33270987,3.33333333 L16.6660432,3.33333333 L16.6660432,13.3333333 Z M12.3213739,11.7726732 L11.25,8.33333333 L14.7240806,9.39399351 L14.0530303,10.0583333 L15.7954545,11.7759497 L14.7229813,12.8333333 L12.9924242,11.1083333 L12.3213739,11.7726732 Z M5.00126064,4.99935659 L7.50126064,4.99935659 L7.50126064,7.49935659 L5.00126064,7.49935659 L5.00126064,4.99935659 Z M8.33333333,4.99935659 L15,4.99935659 L15,5.83268992 L8.33333333,5.83268992 L8.33333333,4.99935659 Z M8.33333333,6.66602325 L10.8333333,6.66602325 L10.8333333,7.49935659 L8.33333333,7.49935659 L8.33333333,6.66602325 Z',
id: 'Combined-Shape',
fill: this.props.theme.accent.primary,
fillRule: 'nonzero'
})
)
)
);
}
}]);
return WebsiteLinkIcon;
}(_react.Component);
WebsiteLinkIcon.propTypes = {
width: _propTypes.PropTypes.string
};
WebsiteLinkIcon.defaultProps = {
width: '20px',
theme: _extends({}, _colorCodes.guidelineColors)
};
exports.default = (0, _styledComponents.withTheme)(WebsiteLinkIcon);