UNPKG

@up-group-ui/react-controls

Version:
30 lines 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UpLink = exports.MethodTypePush = void 0; var tslib_1 = require("tslib"); var jsx_runtime_1 = require("react/jsx-runtime"); var styles_1 = require("./styles"); var theming_1 = (0, tslib_1.__importStar)(require("../../../Common/theming")); exports.MethodTypePush = 'push'; var UpLink = function (props) { var children = props.children, href = props.href, onClick = props.onClick, target = props.target, dataFor = props.dataFor, label = props.label; var tooltipProps = {}; if (dataFor) { tooltipProps = { 'data-tip': 'tooltip', 'data-for': dataFor, }; } var handleClick = function (e) { onClick(e); }; return ((0, jsx_runtime_1.jsx)("a", (0, tslib_1.__assign)({ className: (0, styles_1.getStyles)(props), href: href, target: target, onClick: handleClick }, tooltipProps, { children: label || children }), void 0)); }; exports.UpLink = UpLink; UpLink.defaultProps = { method: exports.MethodTypePush, onClick: function (e) { }, theme: theming_1.default, }; exports.default = (0, theming_1.withTheme)(UpLink); //# sourceMappingURL=UpLink.js.map