@ui-machines/rating
Version:
Core logic for the rating widget implemented as a state machine
19 lines (18 loc) • 520 B
TypeScript
import { Context } from "@ui-machines/types";
export declare type MachineContext = Context<{
max: number;
name?: string;
value: number;
hoveredValue: number;
readonly?: boolean;
disabled?: boolean;
allowHalf?: boolean;
autoFocus?: boolean;
getLabelText?(value: number): string;
onChange?: (value: number) => void;
readonly isInteractive: boolean;
readonly isHovering: boolean;
}>;
export declare type MachineState = {
value: "unknown" | "idle" | "hover" | "focus";
};