UNPKG

@momentum-ui/react-collaboration

Version:

Cisco Momentum UI Framework for React Collaboration Applications

60 lines 2.55 kB
/** @component link */ 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 from 'react'; import PropTypes from 'prop-types'; /** * @deprecated - Components in the legacy folder (/src/legacy) are deprecated. Please use a component from the components folder (/src/components) instead. Legacy components may not follow accessibility standards. **/ var Link = function (_a) { var className = _a.className, children = _a.children, color = _a.color, disabled = _a.disabled, tag = _a.tag, theme = _a.theme, props = __rest(_a, ["className", "children", "color", "disabled", "tag", "theme"]); return React.createElement(tag, __assign(__assign({ className: 'md-link' + "".concat((color && " md-link--".concat(color)) || '') + "".concat((theme && " md-link--".concat(theme)) || '') + "".concat((className && " ".concat(className)) || ''), disabled: disabled }, (!disabled && { tabIndex: 0 })), props), children); }; Link.propTypes = { /** @prop Children nodes to render inside Link Component | null */ children: PropTypes.node.isRequired, /** @prop Optional css class string | '' */ className: PropTypes.string, /** @prop Optional color css styling | 'blue' */ color: PropTypes.string, /** @prop Sets the attribute disabled to the Link | false */ disabled: PropTypes.bool, /** @prop Set HTML tag type | 'a' */ tag: PropTypes.oneOf(['a', 'div', 'span']), /** @prop Set Link theme | '' */ theme: PropTypes.string, }; Link.defaultProps = { children: null, className: '', color: 'blue', disabled: false, tag: 'a', theme: '', }; Link.displayName = 'Link'; export default Link; //# sourceMappingURL=index.js.map