@nitive/whitepaper-react
Version:
React components automatically generated by whitepaper-bem
52 lines (38 loc) • 4.06 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Vector = Vector;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _bem = require("../../_internal/bem");
require("./_size/vector_size_m.post.css");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _extends() { _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; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
var modNames = ['name', 'size'];
function Vector(_ref) {
var additionalModNames = _ref.modNames,
props = _objectWithoutProperties(_ref, ["modNames"]);
return _react.default.createElement(_bem.Bem, _extends({
block: "vector"
}, props, {
modNames: modNames.concat(additionalModNames || []),
getHtml: function getHtml(props) {
if (props.name === 'contacts' && props.size === 'm') {
return '<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80"><g fill="none"><path fill="var(--color-typo-brand)" d="M53 58.999h6v-4c0-5.362-3.258-9.973-7.899-11.959a13.973 13.973 0 0 0 3.164-1.74C58.899 44.104 62 49.193 62 54.999v7h-9v-3zm-7.499-36.984a14.079 14.079 0 0 0-2.378-2.635C44.04 19.132 45.004 19 46 19c6.075 0 11 4.925 11 11s-4.925 11-11 11c-.996 0-1.96-.132-2.877-.38.9-.773 1.7-1.66 2.378-2.635A8 8 0 0 0 54 30a8 8 0 0 0-8.499-7.985z"/><path fill="var(--color-typo-primary)" d="M28.899 43.04C24.258 45.026 21 49.637 21 55v4h26v-4c0-5.362-3.258-9.973-7.899-11.959a13.973 13.973 0 0 0 3.164-1.74C46.899 44.104 50 49.193 50 54.999v7H18v-7c0-5.806 3.101-10.895 7.735-13.699.968.709 2.03 1.296 3.164 1.74zM34 19c6.075 0 11 4.925 11 11s-4.925 11-11 11-11-4.925-11-11 4.925-11 11-11zm0 3a8 8 0 0 0-8 8 8 8 0 0 0 8 8 8 8 0 0 0 8-8 8 8 0 0 0-8-8z"/></g></svg>';
}
if (props.name === 'link' && props.size === 'm') {
return '<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80"><g fill="none"><path fill="var(--color-typo-primary)" d="M51.5 40v.5c-.1 2.9-1.3 5.6-3.4 7.6L34 62.3c-2.2 2.2-5.2 3.4-8.1 3.4-3 0-5.9-1.1-8.1-3.4-4.5-4.5-4.5-11.8 0-16.3l5.2-5.2 2.1 2.1-5.2 5.2c-1.6 1.6-2.5 3.7-2.5 6s.9 4.4 2.5 6c1.6 1.6 3.7 2.5 6 2.5s4.4-.9 6-2.5L46 46c1.6-1.6 2.5-3.7 2.5-6v-.7c-.2-2-1-3.9-2.5-5.3-1.4-1.5-3.3-2.3-5.3-2.5l2.6-2.6c1.8.5 3.5 1.5 4.9 2.9 1.4 1.4 2.4 3 2.9 4.9.2 1.1.4 2.2.4 3.3z"/><path fill="var(--color-typo-brand)" d="M62.3 34l-5.4 5.4-2.1-2.1 5.4-5.4c1.6-1.6 2.5-3.7 2.5-6s-.9-4.4-2.5-6c-1.6-1.6-3.7-2.5-6-2.5s-4.4.9-6 2.5L34 34c-1.6 1.6-2.5 3.7-2.5 6v.7c.2 2 1 3.9 2.5 5.3 1.4 1.5 3.3 2.3 5.3 2.5L36.8 51c-1.8-.5-3.5-1.5-4.9-2.9-1.4-1.4-2.4-3-2.9-4.9-.3-1-.5-2.1-.5-3.3v-.5c.1-2.9 1.3-5.6 3.4-7.6L46 17.7c4.5-4.5 11.8-4.5 16.3 0s4.5 11.8 0 16.3z"/></g></svg>';
}
}
}));
}
Vector.propTypes = {
tag: _propTypes.default.string,
className: _propTypes.default.string,
modNames: _propTypes.default.arrayOf(_propTypes.default.string),
name: _propTypes.default.oneOf(['contacts', 'link']),
size: _propTypes.default.oneOf(['m'])
};
;