import { type KeyboardEvent, type MouseEvent, type Ref } from "react"; import { type IconType } from "../@types/icon.js"; import { type IUiDropdownButtonRenderProps } from "../UiDropdown/types.js"; /** * @internal */ export interface IUiToolbarStepperAccessibilityConfig { /** * Name of the value, for example "Zoom". */ ariaLabel: string; /** * Name of the increase control, for example "Zoom in". */ incrementLabel: string; /** * Name of the decrease control, for example "Zoom out". */ decrementLabel: string; } /** * @internal */ export interface IUiToolbarStepperProps { /** * The committed value as text, for example "100%". */ value: string; onStep: (direction: 1 | -1) => void; /** * @defaultValue true */ canStepUp?: boolean; /** * @defaultValue true */ canStepDown?: boolean; isDisabled?: boolean; accessibilityConfig: IUiToolbarStepperAccessibilityConfig; decreaseIcon?: IconType; increaseIcon?: IconType; /** * Makes the value editable. Enter commits the typed text. Escape and blur * revert the typed text to the committed value. */ onCommit?: (value: string) => void; /** * Reports every change of the typed text. A consumer that applies the text live must pass it * back as `value` while it is being typed, because `value` is what the field shows. Such a * consumer has committed each keystroke already, so Escape and blur restore the `value` it * passes and any return to the text from before the edit is its own to make. A consumer that * waits for `onCommit` leaves `value` alone and gets that return from the field. */ onDraftChange?: (draft: string) => void; /** * Marks the typed text as not acceptable. * @defaultValue false */ isInvalid?: boolean; /** * Shown in the editable value while it is empty. */ placeholder?: string; /** * Held while the preset list is on screen. * @defaultValue false */ isOpen?: boolean; /** * Attributes from the `renderButton` callback of a {@link UiDropdown} with `triggerRole: "combobox"`. */ ariaAttributes?: IUiDropdownButtonRenderProps["ariaAttributes"]; inputRef?: Ref; onClick?: (event: MouseEvent) => void; /** * Runs before the built-in key handling, which is skipped when the event is default-prevented. */ onInputKeyDown?: (event: KeyboardEvent) => void; dataTestId?: string; } /** * Two side controls around a value that is adjusted by steps, for example zoom. Each part is its * own toolbar stop. To move through pages, use {@link UiToolbarPagination}. * * @internal */ export declare const UiToolbarStepper: import("react").ForwardRefExoticComponent>; //# sourceMappingURL=UiToolbarStepper.d.ts.map