@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.
26 lines (20 loc) • 739 B
JavaScript
import { css } from "styled-components";
import { left } from "../../../utils/rtl";
var resolvePlacement = function resolvePlacement(_ref) {
var inputSize = _ref.inputSize,
theme = _ref.theme,
placement = _ref.placement,
inlineLabel = _ref.inlineLabel;
var vertical = placement === "top-start" || placement === "top-end" ? "bottom" : "top";
if (inputSize === "normal") {
if (theme.rtl) {
return css(["", ":0;", ":8px;"], vertical, left);
}
return css(["", ":0;", ":18px;"], vertical, left);
}
if (theme.rtl) {
return css(["", ":0;", ":8px;"], vertical, left);
}
return css(["", ":0;", ":", ";"], vertical, left, inlineLabel ? "22px" : "18px");
};
export default resolvePlacement;