UNPKG

@atlaskit/modal-dialog

Version:

A modal dialog displays content that requires user interaction, in a layer above the page.

57 lines (55 loc) 2.48 kB
/* positioner.tsx generated by @compiled/babel-plugin v0.36.1 */ import "./positioner.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import { easeInOut } from '@atlaskit/motion/curves'; import { durations } from '@atlaskit/motion/durations'; import { layers } from '@atlaskit/theme/constants'; var gutter = 60; var maxWidthDimensions = "calc(100vw - ".concat(gutter * 2, "px)"); var maxHeightDimensions = "calc(100vh - ".concat(gutter * 2 - 1, "px)"); // Flex and min-content are set to constrain the height of the body and support multi-column scrolling experiences var positionerStyles = null; var scrollStyles = { viewport: "_4t3i1wug _kqswh2mm _1sg41wqb _maxs1wug _1jvh1wqb _1uca1wug _eoawglyw", body: "_we1i18uh _e8uozwhf _y1k5stnw _5ee41wqb _1urridpf _1juqidpf _yakv1wug _4lht1wug _eoawglyw", fullScreen: "" }; var stackTransitionStyles = null; var stackTransformStyles = null; var stackIdleStyles = null; function getScrollBehavior(_ref) { var isFullScreen = _ref.isFullScreen, shouldScrollInViewport = _ref.shouldScrollInViewport; if (isFullScreen) { return 'fullScreen'; } if (shouldScrollInViewport) { return 'viewport'; } return 'body'; } var Positioner = function Positioner(props) { var children = props.children, stackIndex = props.stackIndex, shouldScrollInViewport = props.shouldScrollInViewport, testId = props.testId, isFullScreen = props.isFullScreen; var scrollBehavior = getScrollBehavior({ isFullScreen: isFullScreen, shouldScrollInViewport: shouldScrollInViewport }); return /*#__PURE__*/React.createElement("div", { style: { '--modal-dialog-translate-y': "calc(".concat(stackIndex, "px * ", "var(--ds-space-100, 8px)", ")"), // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766 transitionDuration: "".concat(durations.medium, "ms"), // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop transitionTimingFunction: easeInOut }, "data-testid": testId && "".concat(testId, "--positioner"), className: ax(["_1e0c1txw _1bsb1osq _p12f1osq _4t3i1osq _kqsw1n9t _1pby16oo _2lx21bp4 _152tidpf _1e02idpf", "_k8m01e03 _1bumglyw _sedtglyw", stackIndex > 0 ? "_t9ec1b95" : "_t9ecglyw", scrollStyles[scrollBehavior]]) }, children); }; // eslint-disable-next-line @repo/internal/react/require-jsdoc export default Positioner;