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