@atlaskit/spotlight
Version:
A spotlight introduces users to points of interest, from focused messages to multi-step tours.
53 lines (52 loc) • 2.73 kB
JavaScript
/* index.tsx generated by @compiled/babel-plugin v3.0.2 */
;
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SpotlightPrimaryLink = void 0;
require("./index.compiled.css");
var _react = _interopRequireWildcard(require("react"));
var React = _react;
var _runtime = require("@compiled/react/runtime");
var _css = require("@atlaskit/css");
var _compiled = require("@atlaskit/primitives/compiled");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var styles = {
root: "_2rko12b0 _vchhusvi _1e0c1txw _4cvr1h6o _syaz15cr",
outline: "_4bfu1r31 _1hmsglyw _ajmmnqa1 _1dqonqa1 _189ee4h9 _1h6d8yml _18zr12x7 _bfhk1aqn _9oik1r31 _1bnxglyw _jf4cnqa1 _irr31ibz _1nrm1r31 _c2waglyw _1iohnqa1 _1di6of27",
primary: "_4bfu1r31 _1hmsglyw _ajmmnqa1 _1dqonqa1 _189ee4h9 _1h6da755 _18zr12x7 _bfhk1856 _9oik1r31 _1bnxglyw _jf4cnqa1 _irr3hf2y _1nrm1r31 _c2waglyw _1iohnqa1 _1di6g6ey"
};
/**
* __Spotlight primary link__
*
* `SpotlightPrimaryLink` is a link-styled primary control that mirrors the appearance of `SpotlightPrimaryAction`.
* Use it when the primary control should navigate to a URL instead of performing an action (e.g. "Get started", "View guide").
*
*/
var SpotlightPrimaryLink = exports.SpotlightPrimaryLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
var ariaLabel = _ref['aria-label'],
onClick = _ref.onClick,
children = _ref.children,
testId = _ref.testId,
_ref$appearance = _ref.appearance,
appearance = _ref$appearance === void 0 ? 'outline' : _ref$appearance,
href = _ref.href,
target = _ref.target,
rel = _ref.rel;
return /*#__PURE__*/React.createElement(_compiled.Anchor, {
"aria-label": ariaLabel,
ref: ref,
testId: testId,
xcss: (0, _css.cx)(styles.root, styles[appearance]),
href: href,
target: target,
rel: rel,
onClick: onClick ? function (e, _analyticsEvent) {
return onClick(e);
} : undefined,
componentName: "SpotlightPrimaryLink"
}, /*#__PURE__*/React.createElement(_compiled.Text, {
as: "span"
}, children));
});