UNPKG

@atlaskit/tag

Version:

A tag labels UI objects for quick recognition and navigation.

40 lines (38 loc) • 1.52 kB
/* removable-wrapper-2.tsx generated by @compiled/babel-plugin v3.0.2 */ /** * Shared utilities for TagNew and AvatarTag components. * Note: CSS styles cannot be shared due to Compiled CSS static analysis requirements. */ import "./removable-wrapper-2.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import ExitingPersistence from '@atlaskit/motion/exiting-persistence'; import ShrinkOut from '@atlaskit/motion/shrink-out'; import { removableShrinkOutChildKey } from './shared'; import { TagStatus } from './tag-status'; var motionWrapperStyles = null; // Props for the removable wrapper // Shared component for motion wrapper // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports export function RemovableWrapper(_ref) { var isRemovable = _ref.isRemovable, status = _ref.status, onShrinkOutExitComplete = _ref.onShrinkOutExitComplete, children = _ref.children; if (isRemovable) { return /*#__PURE__*/React.createElement(ExitingPersistence, null, !(status === TagStatus.Removed) && /*#__PURE__*/React.createElement(ShrinkOut, { key: removableShrinkOutChildKey, onFinish: onShrinkOutExitComplete ? function (phase) { if (phase === 'exiting') { onShrinkOutExitComplete(); } } : undefined }, function (motion) { return /*#__PURE__*/React.createElement("span", { ref: motion.ref, className: ax(["_1e0c116y"]) }, children); })); } return children; }