UNPKG

@atlaskit/onboarding

Version:

An onboarding spotlight introduces new features to users through focused messages or multi-step tours.

140 lines (136 loc) 7.08 kB
/* target.tsx generated by @compiled/babel-plugin v3.0.2 */ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _typeof = require("@babel/runtime/helpers/typeof"); Object.defineProperty(exports, "__esModule", { value: true }); exports.TargetOverlay = exports.TargetInner = exports.Pulse = void 0; require("./target.compiled.css"); var React = _interopRequireWildcard(require("react")); var _runtime = require("@compiled/react/runtime"); var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); var _excluded = ["bgColor", "children", "className", "radius", "testId", "style"], _excluded2 = ["bgColor", "children", "className", "pulse", "radius", "testId"], _excluded3 = ["onClick"], _excluded4 = ["bgColor", "children", "className", "radius", "pulse", "testId"]; 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); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } var reduceMotionAsPerUserPreference = null; // NOTE: // Pulse color "rgb(101, 84, 192)" derived from "colors.P300" var baseShadow = "0 0 0 2px ".concat("var(--ds-border-discovery, #AF59E1)"); var easing = 'cubic-bezier(0.55, 0.055, 0.675, 0.19)'; var pulseKeyframes = null; var animationStyles = null; var Base = function Base(_ref) { var bgColor = _ref.bgColor, children = _ref.children, className = _ref.className, radius = _ref.radius, testId = _ref.testId, style = _ref.style, props = (0, _objectWithoutProperties2.default)(_ref, _excluded); return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop className: className, "data-testid": testId, style: _objectSpread(_objectSpread({}, style), {}, { backgroundColor: bgColor, borderRadius: radius ? typeof radius === 'number' ? "".concat(radius, "px") : radius : undefined }) // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props }, props), children); }; /** * __Target inner__ * * Used to apply spotlight border and pulse to spotlight targets. * * @internal */ var TargetInner = exports.TargetInner = function TargetInner(_ref2) { var bgColor = _ref2.bgColor, children = _ref2.children, className = _ref2.className, pulse = _ref2.pulse, radius = _ref2.radius, testId = _ref2.testId, props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2); return /*#__PURE__*/React.createElement(Base, (0, _extends2.default)({ bgColor: bgColor // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop , className: (0, _runtime.ax)([pulse && "", pulse && "_5sag19pg _tip812c5 _j7hq10vn _1pglmcjr _16qs1peg", "_1bumglyw _sedtglyw", className]), radius: radius, testId: testId // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props }, props, { style: _objectSpread(_objectSpread({}, props.style), {}, { "--_has9i8": (0, _runtime.ix)("".concat(baseShadow, ", 0 0 0 ", "var(--ds-border-discovery, #AF59E1)")), "--_1v4eexu": (0, _runtime.ix)("".concat(baseShadow, ", 0 0 0 10px rgba(101, 84, 192, 0.01)")) }) }), children); }; var targetOverlayStyles = null; /** * __Target overlay__ * * Overlays a spotlight target, allowing for custom click events that are intended * only for onboarding. * * @internal */ // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports, @repo/internal/react/require-jsdoc var TargetOverlay = exports.TargetOverlay = function TargetOverlay(_ref3) { var onClick = _ref3.onClick, props = (0, _objectWithoutProperties2.default)(_ref3, _excluded3); return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({ onClick: onClick // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props }, props, { style: { cursor: onClick ? 'pointer' : 'auto' }, className: (0, _runtime.ax)(["_1bsb1osq _4t3i1osq _kqswstnw _152tze3t _1e02ze3t"]) })); }; /** * __Spotlight pulse__ * * A spotlight pulse draws attention to a new feature. * * - [Examples](https://atlassian.design/components/onboarding/examples) * - [Code](https://atlassian.design/components/onboarding/code) * - [Usage](https://atlassian.design/components/onboarding/usage) * * @deprecated Use `@atlaskit/spotlight` instead. */ // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports, @repo/internal/react/require-jsdoc var Pulse = exports.Pulse = function Pulse(_ref4) { var bgColor = _ref4.bgColor, children = _ref4.children, className = _ref4.className, radius = _ref4.radius, _ref4$pulse = _ref4.pulse, pulse = _ref4$pulse === void 0 ? true : _ref4$pulse, testId = _ref4.testId, props = (0, _objectWithoutProperties2.default)(_ref4, _excluded4); return /*#__PURE__*/React.createElement(Base, (0, _extends2.default)({ bgColor: bgColor // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop , className: (0, _runtime.ax)([pulse && "", pulse && "_5sag19pg _tip812c5 _j7hq10vn _1pglmcjr _16qs1peg", "_1bumglyw _sedtglyw", className]), radius: radius, testId: testId // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props }, props, { style: _objectSpread(_objectSpread({}, props.style), {}, { "--_has9i8": (0, _runtime.ix)("".concat(baseShadow, ", 0 0 0 ", "var(--ds-border-discovery, #AF59E1)")), "--_1v4eexu": (0, _runtime.ix)("".concat(baseShadow, ", 0 0 0 10px rgba(101, 84, 192, 0.01)")) }) }), children); };