import { default as React } from 'react'; import { BreakpointSupport } from '../../../helpers'; import { FeedbackTextProps } from '../feedback-text/feedback-text'; type SliderBreakpointProps = { /** * Text/element rendered to the left of the track (e.g. the minimum value). */ minLabel?: React.ReactNode; /** * Text/element rendered to the right of the track (e.g. the maximum value). * Ignored when `showCurrentValue` is `true`. */ maxLabel?: React.ReactNode; /** * When `true`, renders the current value to the right of the track instead of `maxLabel`. * @default false */ showCurrentValue?: boolean; /** * Formats the current value, used by both the thumb tooltip and the `showCurrentValue` label. * @default (value) => value */ valueFormatter?: (value: number) => React.ReactNode; /** * Renders a tooltip above the thumb showing the current value. Shown only while the slider is * hovered, focused, or being dragged. Value is formatted via `valueFormatter`. * @default true */ tooltip?: boolean; /** * Node rendered to the right of the slider, typically a NumberField used to edit the same value. */ addonRight?: React.ReactNode; /** * Helper text rendered below the slider. */ helper?: FeedbackTextProps; /** * Additional class name(s) applied to the root element. */ className?: string; }; export interface SliderProps extends BreakpointSupport { /** * Unique identifier for the underlying input element. * Generated automatically if not provided. */ id?: string; /** * Name attribute of the underlying input element. */ name?: string; /** * Label text rendered above the slider. */ label?: React.ReactNode; /** * Controls the visibility of the label. Pass `true` to hide it visually while keeping it * available to assistive technology, or `'keep-space'` to reserve the vertical space. */ hideLabel?: boolean | 'keep-space'; /** * Marks the field as required. */ required?: boolean; /** * Minimum allowed value. * @default 0 */ min?: number; /** * Maximum allowed value. * @default 100 */ max?: number; /** * Step size. * @default 1 */ step?: number; /** * Controlled value. Use together with `onChange`. */ value?: number; /** * Default value for uncontrolled usage. * @default min */ defaultValue?: number; /** * Callback fired when the value changes. */ onChange?: (value: number) => void; /** * Disables the slider. */ disabled?: boolean; /** * Marks the slider as invalid for validation purposes. */ invalid?: boolean; /** * Accessible label used when no visible `label` is provided. */ 'aria-label'?: string; /** * ID of an element that labels the slider, used when no visible `label` is provided. */ 'aria-labelledby'?: string; /** * Human-readable text alternative of the current value. */ 'aria-valuetext'?: string; } export declare const Slider: React.ForwardRefExoticComponent>; export default Slider;