Comparing version 1.3.0 to 2.0.0
@@ -6,4 +6,28 @@ # Change Log | ||
# [2.0.0](https://github.com/ambar/reiconify/compare/v1.7.0...v2.0.0) (2021-01-23) | ||
### Features | ||
* **base-icon:** support forwardRef ([7fab6de](https://github.com/ambar/reiconify/commit/7fab6de)) | ||
### BREAKING CHANGES | ||
* **base-icon:** migrate to esbuild | ||
# [1.4.0](https://github.com/ambar/reiconify/compare/v1.3.1...v1.4.0) (2020-08-20) | ||
**Note:** Version bump only for package base-icon | ||
# [1.3.0](https://github.com/ambar/reiconify/compare/v1.2.2...v1.3.0) (2018-11-19) | ||
**Note:** Version bump only for package base-icon |
@@ -1,69 +0,26 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
import React, {forwardRef} from "react"; | ||
const ZWSP = "\u200B"; | ||
const InlineCenter = ({children, disabled = false}) => disabled ? children : /* @__PURE__ */ React.createElement("span", { | ||
style: {display: "inline-flex", alignItems: "center"} | ||
}, ZWSP, children); | ||
const BaseIcon = forwardRef(({ | ||
size, | ||
as: As = "svg", | ||
text = false, | ||
center = false, | ||
fill = "currentColor", | ||
...rest | ||
}, ref) => { | ||
if (text) { | ||
size = "1.2em"; | ||
} | ||
return /* @__PURE__ */ React.createElement(InlineCenter, { | ||
disabled: !center | ||
}, /* @__PURE__ */ React.createElement(As, { | ||
ref, | ||
...rest, | ||
...size && {width: size, height: size}, | ||
fill | ||
})); | ||
}); | ||
exports.default = exports.withTextProp = exports.withCenterProp = void 0; | ||
var _react = _interopRequireDefault(require("react")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
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 ZWSP = "\u200B"; // use zero-width space to mock [strut](https://www.w3.org/TR/CSS22/visudet.html#strut), ​ | ||
var withCenterProp = function withCenterProp() { | ||
var strutStyle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { | ||
display: 'inline-flex', | ||
alignItems: 'center' | ||
}; | ||
return function (Component) { | ||
return function (_ref) { | ||
var center = _ref.center, | ||
props = _objectWithoutProperties(_ref, ["center"]); | ||
return center ? _react.default.createElement("span", { | ||
style: strutStyle | ||
}, ZWSP, _react.default.createElement(Component, props)) : _react.default.createElement(Component, props); | ||
}; | ||
}; | ||
}; | ||
exports.withCenterProp = withCenterProp; | ||
var withTextProp = function withTextProp() { | ||
var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '1.2em'; | ||
return function (Component) { | ||
return function (_ref2) { | ||
var text = _ref2.text, | ||
props = _objectWithoutProperties(_ref2, ["text"]); | ||
return _react.default.createElement(Component, Object.assign({}, props, text && { | ||
size: size | ||
})); | ||
}; | ||
}; | ||
}; | ||
exports.withTextProp = withTextProp; | ||
var BaseIcon = function BaseIcon(_ref3) { | ||
var size = _ref3.size, | ||
props = _objectWithoutProperties(_ref3, ["size"]); | ||
return _react.default.createElement("svg", Object.assign({}, props, size && { | ||
width: size, | ||
height: size | ||
})); | ||
}; | ||
BaseIcon.defaultProps = { | ||
fill: 'currentColor' | ||
}; | ||
var _default = withTextProp()(withCenterProp()(BaseIcon)); | ||
exports.default = _default; | ||
export default BaseIcon; |
{ | ||
"name": "base-icon", | ||
"version": "1.3.0", | ||
"version": "2.0.0", | ||
"description": "React base icon", | ||
@@ -12,15 +12,14 @@ "repository": "ambar/reiconify", | ||
], | ||
"jest": { | ||
"preset": "es-jest" | ||
}, | ||
"scripts": { | ||
"prepare": "npm test && npm run build", | ||
"build": "rm -rf lib && NODE_ENV=production babel src --out-dir lib", | ||
"prepare": "yarn test && yarn build", | ||
"prebuild": "rm -rf lib", | ||
"build": "esbuild src/BaseIcon.jsx --outfile=lib/BaseIcon.js", | ||
"test": "jest" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.1.0", | ||
"@babel/core": "^7.1.0", | ||
"@babel/preset-env": "^7.1.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"jest": "^23.6.0" | ||
}, | ||
"gitHead": "ce8164588ec788d9ede0f1ec99eca232a0417b52" | ||
"esbuild": "^0.8.34" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
2504
26