UNPKG

@momentum-ui/react-collaboration

Version:

Cisco Momentum UI Framework for React Collaboration Applications

39 lines 2.86 kB
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, { forwardRef, useRef } from 'react'; import classnames from 'classnames'; import { STYLE, DEFAULTS } from './ButtonPillLink.constants'; import './ButtonPillLink.style.scss'; import Link from '../Link'; var ButtonPillLink = forwardRef(function (props, providedRef) { var id = props.id, children = props.children, className = props.className, color = props.color, disabled = props.disabled, shallowDisabled = props.shallowDisabled, grown = props.grown, 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", "grown", "ghost", "outline", "inverted", "size", "href", "target", "tooltipContent", "tooltipType", "onPress"]); var buttonPillRef = useRef(); var ref = providedRef || buttonPillRef; if (ghost && inverted) { console.warn('MRV2: Momentum does not support a ghost inverted ButtonPillLink.'); } 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-disabled": disabled || DEFAULTS.DISABLED, "data-shallow-disabled": shallowDisabled || DEFAULTS.SHALLOW_DISABLED, "aria-disabled": shallowDisabled || DEFAULTS.SHALLOW_DISABLED, "data-ghost": ghost || DEFAULTS.GHOST, "data-grown": grown || DEFAULTS.GROWN, "data-outline": outline || DEFAULTS.OUTLINE, "data-size": size || DEFAULTS.SIZE, "data-inverted": inverted || DEFAULTS.INVERTED, className: classnames(STYLE.wrapper, className) }, otherProps), children)); }); ButtonPillLink.displayName = 'ButtonPillLink'; export default ButtonPillLink; //# sourceMappingURL=ButtonPillLink.js.map