UNPKG

@atlaskit/onboarding

Version:

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

33 lines 1.42 kB
import React from 'react'; import { fg } from '@atlaskit/platform-feature-flags/fg'; import NodeResolverSpotlightTarget from './node-resolver-spotlight-target'; import { TargetConsumer } from './spotlight-manager'; /** * __Spotlight target__ * * A spotlight target marks a component to be used for introducing new features to users through focused messages or multi-step tours. * * - [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. */ var SpotlightTarget = function SpotlightTarget(_ref) { var children = _ref.children, name = _ref.name; return /*#__PURE__*/React.createElement(TargetConsumer, null, function (getTargetRef) { if (typeof children === 'function') { return children({ targetRef: getTargetRef === null || getTargetRef === void 0 ? void 0 : getTargetRef(name) }); } return getTargetRef ? /*#__PURE__*/React.createElement(NodeResolverSpotlightTarget, { name: name, hasNodeResolver: !fg('platform_design_system_team_onboarding_noderesolve'), getTargetRef: getTargetRef }, /*#__PURE__*/React.createElement(React.Fragment, null, children)) : children; }); }; SpotlightTarget.displayName = 'SpotlightTarget'; export default SpotlightTarget;