@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
13 lines (11 loc) • 646 B
JavaScript
'use client';
function getInputOffsets(inputWrapperOrder, { hasDescription, hasError }) {
const inputIndex = inputWrapperOrder.findIndex((part) => part === "input");
const aboveInput = inputWrapperOrder.slice(0, inputIndex);
const belowInput = inputWrapperOrder.slice(inputIndex + 1);
const offsetTop = hasDescription && aboveInput.includes("description") || hasError && aboveInput.includes("error");
const offsetBottom = hasDescription && belowInput.includes("description") || hasError && belowInput.includes("error");
return { offsetBottom, offsetTop };
}
export { getInputOffsets };
//# sourceMappingURL=get-input-offsets.mjs.map