Files
NapCatQQ/.pnpm-store/v3/files/ab/3bec66f961fc43a79437ee7ba84861441594975621eafefd864d162cd709db4923f999f976d3a17fb6ba3e348ddb50ff1dc60fec3402713fb76bbf03e3084a
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

58 lines
2.7 KiB
Plaintext

import { AriaSliderProps, AriaSliderThumbProps } from "@react-types/slider";
import { DOMAttributes, RefObject } from "@react-types/shared";
import { LabelHTMLAttributes, OutputHTMLAttributes, InputHTMLAttributes } from "react";
import { SliderState } from "@react-stately/slider";
export interface SliderAria {
/** Props for the label element. */
labelProps: LabelHTMLAttributes<HTMLLabelElement>;
/** Props for the root element of the slider component; groups slider inputs. */
groupProps: DOMAttributes;
/** Props for the track element. */
trackProps: DOMAttributes;
/** Props for the output element, displaying the value of the slider thumbs. */
outputProps: OutputHTMLAttributes<HTMLOutputElement>;
}
/**
* Provides the behavior and accessibility implementation for a slider component representing one or more values.
*
* @param props Props for the slider.
* @param state State for the slider, as returned by `useSliderState`.
* @param trackRef Ref for the "track" element. The width of this element provides the "length"
* of the track -- the span of one dimensional space that the slider thumb can be. It also
* accepts click and drag motions, so that the closest thumb will follow clicks and drags on
* the track.
*/
export function useSlider<T extends number | number[]>(props: AriaSliderProps<T>, state: SliderState, trackRef: RefObject<Element | null>): SliderAria;
export interface SliderThumbAria {
/** Props for the root thumb element; handles the dragging motion. */
thumbProps: DOMAttributes;
/** Props for the visually hidden range input element. */
inputProps: InputHTMLAttributes<HTMLInputElement>;
/** Props for the label element for this thumb (optional). */
labelProps: LabelHTMLAttributes<HTMLLabelElement>;
/** Whether this thumb is currently being dragged. */
isDragging: boolean;
/** Whether the thumb is currently focused. */
isFocused: boolean;
/** Whether the thumb is disabled. */
isDisabled: boolean;
}
export interface AriaSliderThumbOptions extends AriaSliderThumbProps {
/** A ref to the track element. */
trackRef: RefObject<Element | null>;
/** A ref to the thumb input element. */
inputRef: RefObject<HTMLInputElement | null>;
}
/**
* Provides behavior and accessibility for a thumb of a slider component.
*
* @param opts Options for this Slider thumb.
* @param state Slider state, created via `useSliderState`.
*/
export function useSliderThumb(opts: AriaSliderThumbOptions, state: SliderState): SliderThumbAria;
export type { AriaSliderProps } from '@react-types/slider';
export type { AriaSliderThumbProps } from '@react-types/slider';
export type { Orientation } from '@react-types/shared';
//# sourceMappingURL=types.d.ts.map