fomantic-ui-react
Version:
Fomantic-UI React -- A React Component Library.
108 lines (85 loc) • 3.14 kB
JavaScript
/**
* fomantic-ui-react v0.0.1-alpha.10
* (c) 2022 FireLoong <fireloong@foxmail.com>
* @license MIT
*/
import { _ as _defineProperty, a as _objectWithoutProperties } from '../_chunks/dep-9f1126c1.js';
import { createElement } from 'react';
var _excluded = ["as", "className", "name", "disabled", "loading", "fitted", "link", "circular", "bordered", "colored", "color", "inverted", "flipped", "rotated", "size", "onClick"];
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
var Icon = function Icon(_ref) {
var _ref$as = _ref.as,
as = _ref$as === void 0 ? "i" : _ref$as,
className = _ref.className,
name = _ref.name,
disabled = _ref.disabled,
loading = _ref.loading,
fitted = _ref.fitted,
link = _ref.link,
circular = _ref.circular,
bordered = _ref.bordered,
colored = _ref.colored,
color = _ref.color,
inverted = _ref.inverted,
flipped = _ref.flipped,
rotated = _ref.rotated,
size = _ref.size,
onClick = _ref.onClick,
iconProps = _objectWithoutProperties(_ref, _excluded);
var classNames = ["icon", name];
if (size) {
classNames.push(size);
}
if (disabled) {
classNames.push("disabled");
}
if (loading) {
classNames.push("loading");
}
if (fitted) {
classNames.push("fitted");
}
if (link) {
classNames.push("link");
}
if (flipped) {
if (flipped === "horizontally") {
classNames.push("horizontally flipped");
} else if (flipped === "vertically") {
classNames.push("vertically flipped");
}
}
if (rotated) {
if (rotated === "clockwise") {
classNames.push("clockwise rotated");
} else if (rotated === "counterclockwise") {
classNames.push("counterclockwise rotated");
}
}
if (circular) {
classNames.push("circular");
}
if (bordered) {
classNames.push("bordered");
}
if (colored) {
classNames.push("colored");
}
if (inverted) {
classNames.push("inverted");
}
if (color) {
classNames.push(color);
}
if (className) {
classNames.push(className);
}
return /*#__PURE__*/createElement(as, _objectSpread({
className: classNames.join(" "),
onClick: onClick
}, iconProps));
};
Icon.displayName = "Icon";
export { Icon as default };
//# sourceMappingURL=Icon.js.map