UNPKG

@vtex/styleguide

Version:

> VTEX Styleguide React components ([Docs](https://vtex.github.io/styleguide))

76 lines (60 loc) 2.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require("react"); var _react2 = _interopRequireDefault(_react); var _propTypes = require("prop-types"); var _propTypes2 = _interopRequireDefault(_propTypes); var _IconBase = require("../IconBase"); var _utils = require("../utils"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } var iconBase = { width: 16, height: 16 }; var VARIATIONS = { SOLID: 'M15.3 4L1.30001 3.72529e-09C0.500006 -0.2 -0.199994 0.5 5.72577e-06 1.3L4.00001 15.3C4.30001 16.2 5.50001 16.3 5.90001 15.4L8.70001 8.8L15.3 6C16.3 5.5 16.2 4.3 15.3 4Z', OUTLINE: 'M4.00001 15.3L5.72577e-06 1.3C-0.199994 0.5 0.500006 -0.2 1.30001 3.72529e-09L15.3 4C16.2 4.3 16.3 5.5 15.4 5.9L8.80001 8.8L6.00001 15.4C5.50001 16.3 4.30001 16.2 4.00001 15.3ZM2.50001 2.5L5.20001 12L7.10001 7.6C7.20001 7.4 7.40001 7.2 7.60001 7.1L12 5.2L2.50001 2.5Z' }; var Location = /*#__PURE__*/ function (_PureComponent) { _inheritsLoose(Location, _PureComponent); function Location() { return _PureComponent.apply(this, arguments) || this; } var _proto = Location.prototype; _proto.render = function render() { var _this$props = this.props, color = _this$props.color, size = _this$props.size, solid = _this$props.solid, block = _this$props.block; var newSize = (0, _utils.calcIconSize)(iconBase, size); return _react2.default.createElement(_IconBase.Svg, { name: "location", variation: solid ? 'solid' : null, size: newSize, block: block }, _react2.default.createElement("path", { d: solid ? VARIATIONS.SOLID : VARIATIONS.OUTLINE, fill: color })); }; return Location; }(_react.PureComponent); Location.defaultProps = { color: 'currentColor', size: 16, solid: false, block: false }; Location.propTypes = { color: _propTypes2.default.string, size: _propTypes2.default.number, solid: _propTypes2.default.bool, block: _propTypes2.default.bool }; exports.default = Location;