UNPKG

@atlaskit/spotlight

Version:

A spotlight introduces users to points of interest, from focused messages to multi-step tours.

65 lines 1.9 kB
/* index.tsx generated by @compiled/babel-plugin v3.0.2 */ import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import { fg } from '@atlaskit/platform-feature-flags/fg'; import { PopoverContent as Legacy } from './legacy'; import { PopoverContent as TopLayer } from './top-layer'; /** * __PopoverContent__ * * A `PopoverContent` is the element that is shown as a popover. */ const renderPopoverContent = (Component, { children, placement, motion, isVisible, shouldDismissOnClickOutside, dismiss, back, testId, offset, strategy, ...actionProps }) => { if ('next' in actionProps && actionProps.next) { return /*#__PURE__*/React.createElement(Component, { placement: placement, motion: motion, isVisible: isVisible, shouldDismissOnClickOutside: shouldDismissOnClickOutside, dismiss: dismiss, back: back, testId: testId, offset: offset, strategy: strategy, next: actionProps.next }, children); } if ('done' in actionProps && actionProps.done) { return /*#__PURE__*/React.createElement(Component, { placement: placement, motion: motion, isVisible: isVisible, shouldDismissOnClickOutside: shouldDismissOnClickOutside, dismiss: dismiss, back: back, testId: testId, offset: offset, strategy: strategy, done: actionProps.done }, children); } return /*#__PURE__*/React.createElement(Component, { placement: placement, motion: motion, isVisible: isVisible, shouldDismissOnClickOutside: shouldDismissOnClickOutside, dismiss: dismiss, back: back, testId: testId, offset: offset, strategy: strategy }, children); }; export const PopoverContent = props => fg('platform-dst-top-layer-spotlight') ? renderPopoverContent(TopLayer, props) : renderPopoverContent(Legacy, props);