UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

16 lines (15 loc) 756 B
"use client"; //#region packages/@mantine/core/src/components/Input/InputWrapper/get-input-offsets/get-input-offsets.ts 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"); return { offsetBottom: hasDescription && belowInput.includes("description") || hasError && belowInput.includes("error"), offsetTop }; } //#endregion exports.getInputOffsets = getInputOffsets; //# sourceMappingURL=get-input-offsets.cjs.map