/** * Enhanced Slider Component (Phase 6.4.4) * * SwiftUI-inspired Slider component with range selection, formatting, * and precise value control for numeric input. */ import type { ModifiableComponent, ModifierBuilder } from '@tachui/core'; import type { Signal } from '@tachui/core'; import type { ComponentInstance, ComponentProps } from '@tachui/core'; /** * Slider component properties */ export interface SliderProps extends ComponentProps { value: number | Signal; onValueChange?: (value: number) => void; min?: number; max?: number; step?: number; formatter?: (value: number) => string; minimumValueLabel?: string; maximumValueLabel?: string; variant?: 'default' | 'filled' | 'minimal'; trackColor?: string; thumbColor?: string; activeTrackColor?: string; size?: 'small' | 'medium' | 'large'; disabled?: boolean | Signal; showValue?: boolean; showLabels?: boolean; marks?: SliderMark[]; range?: boolean; vertical?: boolean; accessibilityLabel?: string; accessibilityHint?: string; accessibilityValueDescription?: (value: number) => string; } /** * Slider mark configuration */ export interface SliderMark { value: number; label?: string; color?: string; } /** * Enhanced Slider component class */ export declare class EnhancedSlider implements ComponentInstance { props: SliderProps; readonly type: "component"; readonly id: string; mounted: boolean; cleanup: (() => void)[]; constructor(props: SliderProps); /** * Get current value */ private getValue; /** * Check if slider is disabled */ private isDisabled; /** * Format value for display */ private formatValue; /** * Handle value change */ private handleValueChange; /** * How far along the track the fill reaches, as the percentage the styles * read through `--slider-progress`. Derived from the current value on every * render, so it follows the binding the same way the thumb does. */ private getTrackFillPercentage; /** * Put the thumb back on whatever the value says now. * * The browser has already moved it by the time this runs, and the slider is * controlled by `value`: unchanged when `onValueChange` wrote the reported * value straight through, snapped to the step when it rounded, and back * where it started when the binding is a plain number or the handler * declined the change. Only the thumb needs this — the track fill is drawn * from the value on every render, so leaving the thumb where the pointer * dropped it is what would put the two out of step. */ private syncThumb; /** * Handle input events */ private handleInput; /** * Get slider size styles */ private getSizeStyles; /** * Get slider variant styles */ private getVariantStyles; /** * Render slider marks */ private renderMarks; /** * Render value labels */ private renderLabels; /** * Render value display */ private renderValueDisplay; render(): import("@tachui/core").DOMNode; } /** * Slider component function */ export declare function Slider(value: number | Signal, props?: Omit): ModifiableComponent & { modifier: ModifierBuilder>; }; /** * Slider style variants */ export declare const SliderStyles: { /** * Default slider (default) */ Default(value: number | Signal, props?: Omit): ModifiableComponent & { modifier: ModifierBuilder>; }; /** * Filled slider with background */ Filled(value: number | Signal, props?: Omit): ModifiableComponent & { modifier: ModifierBuilder>; }; /** * Minimal slider with minimal styling */ Minimal(value: number | Signal, props?: Omit): ModifiableComponent & { modifier: ModifierBuilder>; }; /** * Vertical slider */ Vertical(value: number | Signal, props?: Omit): ModifiableComponent & { modifier: ModifierBuilder>; }; /** * Range slider with marks */ WithMarks(value: number | Signal, marks: SliderMark[], props?: Omit): ModifiableComponent & { modifier: ModifierBuilder>; }; /** * Slider with value display */ WithValue(value: number | Signal, props?: Omit): ModifiableComponent & { modifier: ModifierBuilder>; }; /** * Slider with labels */ WithLabels(value: number | Signal, minimumLabel: string, maximumLabel: string, props?: Omit): ModifiableComponent & { modifier: ModifierBuilder>; }; }; /** * Slider utilities */ export declare const SliderUtils: { /** * Create marks for common ranges */ createMarks(min: number, max: number, step: number): SliderMark[]; /** * Create percentage marks */ createPercentageMarks(): SliderMark[]; /** * Create custom formatter */ createFormatter(unit: string, decimals?: number): (value: number) => string; /** * Snap value to step */ snapToStep(value: number, min: number, step: number): number; /** * Convert slider value to different scale */ mapToScale(value: number, fromMin: number, fromMax: number, toMin: number, toMax: number): number; }; //# sourceMappingURL=Slider.d.ts.map