@momentum-ui/react-collaboration
Version:
Cisco Momentum UI Framework for React Collaboration Applications
40 lines • 2.92 kB
JavaScript
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import React, { Children, forwardRef, useRef } from 'react';
import classnames from 'classnames';
import { STYLE, DEFAULTS } from './ButtonCircleLink.constants';
import './ButtonCircleLink.style.scss';
import Link from '../Link';
var ButtonCircleLink = forwardRef(function (props, providedRef) {
var id = props.id, children = props.children, className = props.className, color = props.color, disabled = props.disabled, shallowDisabled = props.shallowDisabled, ghost = props.ghost, outline = props.outline, inverted = props.inverted, size = props.size, href = props.href, target = props.target, tooltipContent = props.tooltipContent, tooltipType = props.tooltipType, onPress = props.onPress, otherProps = __rest(props, ["id", "children", "className", "color", "disabled", "shallowDisabled", "ghost", "outline", "inverted", "size", "href", "target", "tooltipContent", "tooltipType", "onPress"]);
var buttonCircleRef = useRef();
var ref = providedRef || buttonCircleRef;
if (ghost && inverted) {
console.warn('MRV2: Momentum does not support a ghost inverted ButtonCircleLink.');
}
var multipleChildren = Children.count(children) > 1;
return (React.createElement(Link, __assign({ id: id, ref: ref, href: href, target: target, onPress: onPress, disabled: disabled, inverted: inverted, tooltipType: tooltipType, hasExternalLinkIcon: false, tooltipContent: tooltipContent, "data-color": color || DEFAULTS.COLOR, "data-ghost": ghost || DEFAULTS.GHOST, "data-multiple-children": multipleChildren, "data-outline": outline || DEFAULTS.OUTLINE, "data-size": size || DEFAULTS.SIZE, "data-inverted": inverted || DEFAULTS.INVERTED, className: classnames(STYLE.wrapper, className), "data-disabled": disabled || DEFAULTS.DISABLED, "data-shallow-disabled": shallowDisabled || DEFAULTS.SHALLOW_DISABLED, "aria-disabled": shallowDisabled || DEFAULTS.SHALLOW_DISABLED }, otherProps), children));
});
ButtonCircleLink.displayName = 'ButtonCircleLink';
export default ButtonCircleLink;
//# sourceMappingURL=ButtonCircleLink.js.map