@uiw/react-icon
Advanced tools
Comparing version 5.0.0-bate-5 to 5.0.0-bate-6
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -10,13 +9,7 @@ value: true | ||
exports["default"] = Icon; | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _wIcon = _interopRequireDefault(require("@uiw/icons/fonts/w-icon.json")); | ||
var _style = require("./style"); | ||
Object.keys(_style).forEach(function (key) { | ||
@@ -33,22 +26,18 @@ if (key === "default" || key === "__esModule") return; | ||
}); | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
var _excluded = ["className", "prefixCls", "verticalAlign", "tagName", "color", "type", "spin"]; | ||
function Icon(props) { | ||
var className = props.className, | ||
_props$prefixCls = props.prefixCls, | ||
prefixCls = _props$prefixCls === void 0 ? 'w-icon' : _props$prefixCls, | ||
_props$verticalAlign = props.verticalAlign, | ||
verticalAlign = _props$verticalAlign === void 0 ? 'middle' : _props$verticalAlign, | ||
_props$tagName = props.tagName, | ||
TagName = _props$tagName === void 0 ? 'span' : _props$tagName, | ||
color = props.color, | ||
type = props.type, | ||
_props$spin = props.spin, | ||
spin = _props$spin === void 0 ? false : _props$spin, | ||
others = (0, _objectWithoutProperties2["default"])(props, _excluded); | ||
_props$prefixCls = props.prefixCls, | ||
prefixCls = _props$prefixCls === void 0 ? 'w-icon' : _props$prefixCls, | ||
_props$verticalAlign = props.verticalAlign, | ||
verticalAlign = _props$verticalAlign === void 0 ? 'middle' : _props$verticalAlign, | ||
_props$tagName = props.tagName, | ||
TagName = _props$tagName === void 0 ? 'span' : _props$tagName, | ||
color = props.color, | ||
type = props.type, | ||
_props$spin = props.spin, | ||
spin = _props$spin === void 0 ? false : _props$spin, | ||
others = (0, _objectWithoutProperties2["default"])(props, _excluded); | ||
var svg = null; | ||
if (typeof type === 'string') { | ||
@@ -72,3 +61,2 @@ svg = /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", { | ||
} | ||
others.style = (0, _objectSpread2["default"])({ | ||
@@ -75,0 +63,0 @@ fill: 'currentColor' |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -11,22 +9,14 @@ value: true | ||
exports.IconStyleBase = void 0; | ||
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); | ||
var _styledComponents = _interopRequireWildcard(require("styled-components")); | ||
var _templateObject, _templateObject2, _templateObject3, _templateObject4; | ||
var loadingCircle = (0, _styledComponents.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))); | ||
var IconStyleBase = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1em;\n width: 1em;\n fill: currentColor;\n & svg {\n height: 1em;\n width: 1em;\n fill: currentColor;\n }\n display: inline-flex;\n align-self: center;\n position: relative;\n transition: color 0.3s;\n box-sizing: inherit;\n ", "\n ", "\n"])), function (props) { | ||
var _props$params; | ||
return (props.verticalAlign === 'baseline' || ((_props$params = props.params) === null || _props$params === void 0 ? void 0 : _props$params.verticalAlign) === 'baseline') && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n top: 0.125em;\n "]))); | ||
}, function (props) { | ||
var _props$params2; | ||
return (props.spin || ((_props$params2 = props.params) === null || _props$params2 === void 0 ? void 0 : _props$params2.spin)) && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n & svg {\n animation: ", " 1s infinite linear;\n }\n "])), loadingCircle); | ||
}); | ||
exports.IconStyleBase = IconStyleBase; | ||
//# sourceMappingURL=index.js.map |
@@ -11,14 +11,12 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
var { | ||
className, | ||
prefixCls = 'w-icon', | ||
verticalAlign = 'middle', | ||
tagName: TagName = 'span', | ||
color, | ||
type, | ||
spin = false | ||
} = props, | ||
others = _objectWithoutPropertiesLoose(props, _excluded); | ||
className, | ||
prefixCls = 'w-icon', | ||
verticalAlign = 'middle', | ||
tagName: TagName = 'span', | ||
color, | ||
type, | ||
spin = false | ||
} = props, | ||
others = _objectWithoutPropertiesLoose(props, _excluded); | ||
var svg = null; | ||
if (typeof type === 'string') { | ||
@@ -40,11 +38,8 @@ svg = /*#__PURE__*/_jsx("svg", { | ||
} | ||
others.style = _extends({ | ||
fill: 'currentColor' | ||
}, others.style); | ||
var propps = _extends({}, others, { | ||
className: [prefixCls, className, prefixCls && verticalAlign ? prefixCls + "-" + verticalAlign : null, spin && prefixCls ? prefixCls + "-spin" : null].filter(Boolean).join(' ').trim() | ||
}); | ||
return /*#__PURE__*/React.createElement(IconStyleBase, _extends({}, propps, { | ||
@@ -51,0 +46,0 @@ verticalAlign, |
import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/taggedTemplateLiteralLoose"; | ||
var _templateObject, _templateObject2, _templateObject3, _templateObject4; | ||
import styled, { keyframes, css } from 'styled-components'; | ||
@@ -9,9 +7,7 @@ var loadingCircle = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))); | ||
var _props$params; | ||
return (props.verticalAlign === 'baseline' || ((_props$params = props.params) == null ? void 0 : _props$params.verticalAlign) === 'baseline') && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n top: 0.125em;\n "]))); | ||
}, props => { | ||
var _props$params2; | ||
return (props.spin || ((_props$params2 = props.params) == null ? void 0 : _props$params2.spin)) && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n & svg {\n animation: ", " 1s infinite linear;\n }\n "])), loadingCircle); | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@uiw/react-icon", | ||
"version": "5.0.0-bate-5", | ||
"version": "5.0.0-bate-6", | ||
"description": "Icon component", | ||
@@ -5,0 +5,0 @@ "author": "Kenny Wong <wowohoo@qq.com>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
48070