@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.
33 lines • 1.09 kB
JavaScript
export let AUTO_PLACEMENTS = /*#__PURE__*/function (AUTO_PLACEMENTS) {
AUTO_PLACEMENTS["AUTO"] = "auto";
AUTO_PLACEMENTS["AUTO_START"] = "auto-start";
AUTO_PLACEMENTS["AUTO_END"] = "auto-end";
return AUTO_PLACEMENTS;
}({});
export let PLACEMENTS = /*#__PURE__*/function (PLACEMENTS) {
PLACEMENTS["TOP"] = "top";
PLACEMENTS["TOP_START"] = "top-start";
PLACEMENTS["TOP_END"] = "top-end";
PLACEMENTS["BOTTOM"] = "bottom";
PLACEMENTS["BOTTOM_START"] = "bottom-start";
PLACEMENTS["BOTTOM_END"] = "bottom-end";
PLACEMENTS["RIGHT"] = "right";
PLACEMENTS["RIGHT_START"] = "right-start";
PLACEMENTS["RIGHT_END"] = "right-end";
PLACEMENTS["LEFT"] = "left";
PLACEMENTS["LEFT_START"] = "left-start";
PLACEMENTS["LEFT_END"] = "left-end";
return PLACEMENTS;
}({});
export const isFixedPlacement = placement => Object.values(PLACEMENTS).includes(placement);
export const getAutoAlignment = placement => {
switch (placement) {
case "auto-start":
return "start";
case "auto-end":
return "end";
case "auto":
default:
return undefined;
}
};