// // Copyright 2026 DXOS.org // import { Slider as SliderPrimitive } from '@ark-ui/react/slider'; import React, { type ReactNode, forwardRef, useId, useLayoutEffect, useRef, useState } from 'react'; import { invariant } from '@dxos/invariant'; import { mx } from '@dxos/ui-theme'; import { type ThemedClassName } from '@dxos/ui-types'; import { recipes } from '../../recipes.ts'; export type SliderProps = ThemedClassName< Omit< SliderPrimitive.RootProps, | 'children' | 'value' | 'defaultValue' | 'onValueChange' | 'onValueChangeEnd' | 'aria-label' | 'aria-labelledby' | 'thumbAlignment' | 'thumbSize' > > & { /** One entry per thumb. */ 'value'?: number[]; 'defaultValue'?: number[]; 'onValueChange'?: (value: number[]) => void; /** Fires once when a drag or key repeat ends. */ 'onValueCommit'?: (value: number[]) => void; /** Visible label above the track; names a single thumb. */ 'label'?: ReactNode; /** Names a single thumb without a visible label. */ 'aria-label'?: string; /** * Accessible name per thumb, by index: `role="slider"` has no text a label's `htmlFor` can reach. Required whenever * there is more than one thumb; with a visible `label` too, each thumb reads as "