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.

39 lines (38 loc) 1.35 kB
"use strict"; exports.__esModule = true; exports.isFixedPlacement = exports.getAutoAlignment = exports.PLACEMENTS = exports.AUTO_PLACEMENTS = void 0; let AUTO_PLACEMENTS = exports.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; }({}); let PLACEMENTS = exports.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; }({}); const isFixedPlacement = placement => Object.values(PLACEMENTS).includes(placement); exports.isFixedPlacement = isFixedPlacement; const getAutoAlignment = placement => { switch (placement) { case "auto-start": return "start"; case "auto-end": return "end"; case "auto": default: return undefined; } }; exports.getAutoAlignment = getAutoAlignment;