UNPKG

@atlaskit/spotlight

Version:

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

68 lines 2.43 kB
/* index.tsx generated by @compiled/babel-plugin v3.0.2 */ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; var _excluded = ["children", "placement", "motion", "isVisible", "shouldDismissOnClickOutside", "dismiss", "back", "testId", "offset", "strategy"]; 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. */ var renderPopoverContent = function renderPopoverContent(Component, _ref) { var children = _ref.children, placement = _ref.placement, motion = _ref.motion, isVisible = _ref.isVisible, shouldDismissOnClickOutside = _ref.shouldDismissOnClickOutside, dismiss = _ref.dismiss, back = _ref.back, testId = _ref.testId, offset = _ref.offset, strategy = _ref.strategy, actionProps = _objectWithoutProperties(_ref, _excluded); 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 var PopoverContent = function PopoverContent(props) { return fg('platform-dst-top-layer-spotlight') ? renderPopoverContent(TopLayer, props) : renderPopoverContent(Legacy, props); };