import type { IntentName } from "@charcuterie/tokens"; import type { ComponentPropsWithRef, ReactNode } from "react"; import type { SliderSize } from "../sliderStyles.ts"; /** * Re-exported rather than declared here: the three sizes are the bar's, * and `RangeSlider` paints the same bar from `../sliderStyles.ts`. */ export type { SliderSize }; export type SliderProps = Omit, "children" | "defaultValue" | "onChange"> & { intent?: IntentName; isDisabled?: boolean; isLabelVisible?: boolean; /** * Read-only in the `aria-readonly` sense: focusable, full contrast, * announced as unchangeable. A media scrubber for a stream with no * seekable range is this, not `isDisabled` — the position is still * worth reading. */ isReadOnly?: boolean; isValueShown?: boolean; /** Required. A slider with no name is an unlabelled number. */ label: string; /** * PageUp / PageDown. Defaults to ten steps, which is the APG's * suggestion and the only sensible answer that does not need the * caller to know the range. */ largeStep?: number; max?: number; min?: number; /** * Fires on every movement — each arrow key, and each pointer sample * while dragging. Use it to paint. See `onChangeEnd` for committing. */ onChange?: (value: number) => void; /** * Fires once, when the interaction ends: pointer release, or key up. * * This exists because the expensive consumer of a slider is almost * never the paint. A seek scrubber that issued its network call from * `onChange` would send one request per pointer sample and arrive at * the right offset last, after a queue of stale ones. */ onChangeEnd?: (value: number) => void; size?: SliderSize; step?: number; value?: number; /** * How the value reads aloud and, when `isValueShown`, on screen. * Without it a scrubber announces "1274", which is a number of * seconds nobody has. */ valueFormat?: (value: number) => string; }; /** * A single-value range control: the thing `` is, * without the OS painting it. * * The fleet had no way to ask for a value along a range, so QueuePilot's * Now-playing bar could not have a scrubber * ([decision](../../../../docs/decisions/2026-08-22-the-slider-is-a-div-with-role-slider-not-an-input-range.md)). * `ProgressBar` looks like the answer and is not: it is output, it takes * no input, and `role="progressbar"` tells assistive technology exactly * that. * * ## Why a `div` and not `` * * The same reason `Select` is deprecated. A range input's thumb and * track are UA pseudo-elements — `::-webkit-slider-thumb`, * `::-moz-range-track` — and they are not one surface: the two engines * disagree about which of them the track's fill even belongs to, so a * token-styled range is two stylesheets that drift. Windows paints its * own. `role="slider"` on a focusable `div` is the APG's own pattern, * gets the same AT support, and every pixel of it is ours. * * ## Drag does not commit * * `onChange` fires per movement, `onChangeEnd` once on release. Both are * optional and the component is fully controlled through `value`, so a * caller that wants the simple thing passes `onChange` alone and a * caller with a network call behind it splits them. * * While dragging, the component holds the value locally and paints from * that rather than from the `value` prop. Without it a controlled * scrubber whose owner only commits `onChangeEnd` would render the thumb * pinned under the finger at the old position — the drag would look * broken while behaving correctly. */ export declare const Slider: ({ className, intent, isDisabled, isLabelVisible, isReadOnly, isValueShown, label, largeStep, max, min, onChange, onChangeEnd, size, step, value, valueFormat, ...divProps }: SliderProps) => ReactNode; //# sourceMappingURL=Slider.d.ts.map