UNPKG

@atlaskit/onboarding

Version:

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

131 lines (128 loc) 5.77 kB
/* target.tsx generated by @compiled/babel-plugin v3.0.2 */ import _extends from "@babel/runtime/helpers/extends"; import _defineProperty from "@babel/runtime/helpers/defineProperty"; import _objectWithoutProperties from "@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"]; import "./target.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; 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) { _defineProperty(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 = _objectWithoutProperties(_ref, _excluded); return /*#__PURE__*/React.createElement("div", _extends({ // 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 */ export var TargetInner = function TargetInner(_ref2) { var bgColor = _ref2.bgColor, children = _ref2.children, className = _ref2.className, pulse = _ref2.pulse, radius = _ref2.radius, testId = _ref2.testId, props = _objectWithoutProperties(_ref2, _excluded2); return /*#__PURE__*/React.createElement(Base, _extends({ bgColor: bgColor // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop , className: 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": ix("".concat(baseShadow, ", 0 0 0 ", "var(--ds-border-discovery, #AF59E1)")), "--_1v4eexu": 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 export var TargetOverlay = function TargetOverlay(_ref3) { var onClick = _ref3.onClick, props = _objectWithoutProperties(_ref3, _excluded3); return /*#__PURE__*/React.createElement("div", _extends({ onClick: onClick // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props }, props, { style: { cursor: onClick ? 'pointer' : 'auto' }, className: 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 export var 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 = _objectWithoutProperties(_ref4, _excluded4); return /*#__PURE__*/React.createElement(Base, _extends({ bgColor: bgColor // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop , className: 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": ix("".concat(baseShadow, ", 0 0 0 ", "var(--ds-border-discovery, #AF59E1)")), "--_1v4eexu": ix("".concat(baseShadow, ", 0 0 0 10px rgba(101, 84, 192, 0.01)")) }) }), children); };