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.

36 lines (27 loc) 962 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _styledComponents = require("styled-components"); var _rtl = require("../../../utils/rtl"); const resolvePlacement = ({ inputSize, theme, placement, inlineLabel }) => { const vertical = placement === "top-start" || placement === "top-end" ? "bottom" : "top"; if (inputSize === "normal") { if (theme.rtl) { return (0, _styledComponents.css)(["", ":2px;", ":", ""], vertical, _rtl.left, inlineLabel ? "4px" : "0px"); } return (0, _styledComponents.css)(["", ":2px;", ":", ";"], vertical, _rtl.left, inlineLabel ? "12px" : "8px"); } if (theme.rtl) { return (0, _styledComponents.css)(["", ":2px;", ":0px;"], vertical, _rtl.left); } return (0, _styledComponents.css)(["", ":2px;", ":", ";"], vertical, _rtl.left, inlineLabel ? "8px" : "8px"); }; var _default = resolvePlacement; exports.default = _default;