UNPKG

@kiwicom/orbit-components

Version:

Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.

31 lines (23 loc) 902 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _styledComponents = require("styled-components"); var _consts = require("../consts"); var resolvePopoverHorizontal = function resolvePopoverHorizontal(_ref) { var anchor = _ref.anchor, containerLeft = _ref.containerLeft, containerWidth = _ref.containerWidth, popoverWidth = _ref.popoverWidth, theme = _ref.theme; if (anchor === _consts.ALIGNS.START) { return (0, _styledComponents.css)(["left:", "px;"], theme.rtl ? Math.floor(containerLeft + containerWidth - popoverWidth) : Math.floor(containerLeft)); } if (anchor === _consts.ALIGNS.END) { return (0, _styledComponents.css)(["left:", "px;"], Math.floor(containerLeft + containerWidth - popoverWidth)); } return null; }; var _default = resolvePopoverHorizontal; exports.default = _default;