UNPKG

@renderlesskit/react

Version:

Collection of headless components/hooks that are accessible, composable, customizable from low level to build your own UI & Design System powered by Reakit

23 lines (22 loc) 836 B
/** * Handle Inequalities with received values * * minimum ≤ value ≤ maximum * minimum ≤ low ≤ maximum (if low is specified) * minimum ≤ high ≤ maximum (if high is specified) * minimum ≤ optimum ≤ maximum (if optimum is specified) * * @see https://html.spec.whatwg.org/multipage/form-elements.html#the-meter-element:attr-meter-max-3:~:text=following%20inequalities%20must%20hold */ export declare function clamp(value: number, min: number, max: number): number; declare type CalculateStatusProps = { value: number; optimum: number; min: number; max: number; low: number; high: number; }; export declare const calculateStatus: (props: CalculateStatusProps) => "safe" | "caution" | "danger"; export declare const isInRange: (value: number, min: number, max: number) => boolean; export {};