@zag-js/slider 2.0.0-next.2 → 2.0.0-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,397 +1,422 @@
1
- import { Machine, EventObject, Service } from '@zag-js/core';
2
- import { PropTypes, DirectionProperty, CommonProperties } from '@zag-js/types';
3
-
4
- type ThumbCollisionBehavior = "none" | "push" | "swap";
5
- type ThumbAlignment = "contain" | "center";
6
- type SliderOrigin = "start" | "center" | "end" | number;
7
- interface ValueChangeDetails {
8
- value: number[];
1
+ import { CommonProperties, DirectionProperty, PropTypes } from "@zag-js/types";
2
+ import { EventObject, Machine, Service } from "@zag-js/core";
3
+ import { AnimationFrame } from "@zag-js/dom-query";
4
+ export type ThumbCollisionBehavior = "none" | "push" | "swap";
5
+ export type ThumbAlignment = "contain" | "center";
6
+ export type SliderOrigin = "start" | "center" | "end" | number;
7
+ /**
8
+ * What changed the slider value:
9
+ * - `track-click`: the pointer was pressed on the track and the thumb jumped there
10
+ * - `drag`: a thumb was dragged
11
+ * - `keyboard`: an arrow, Page Up/Down, Home or End key was pressed
12
+ * - `script`: `setValue`, `setThumbValue`, `setThumbPercent`, `increment` or `decrement` was called
13
+ */
14
+ export type ValueChangeReason = "track-click" | "drag" | "keyboard" | "script";
15
+ export interface ValueChangeDetails {
16
+ value: number[];
17
+ /**
18
+ * What changed the value
19
+ */
20
+ reason?: ValueChangeReason | undefined;
9
21
  }
10
- interface FocusChangeDetails {
11
- focusedIndex: number;
12
- value: number[];
22
+ export interface FocusChangeDetails {
23
+ focusedIndex: number;
24
+ value: number[];
13
25
  }
14
- interface ValueTextDetails {
15
- value: number;
16
- index: number;
26
+ export interface ValueTextDetails {
27
+ value: number;
28
+ index: number;
17
29
  }
18
- interface ElementIds {
19
- root?: string | undefined;
20
- thumb?: ((index: number) => string) | undefined;
21
- hiddenInput?: ((index: number) => string) | undefined;
22
- control?: string | undefined;
23
- track?: string | undefined;
24
- range?: string | undefined;
25
- label?: string | undefined;
26
- valueText?: string | undefined;
27
- marker?: ((index: number) => string) | undefined;
30
+ export interface ThumbLabelDetails {
31
+ index: number;
28
32
  }
29
- interface SliderProps extends DirectionProperty, CommonProperties {
30
- /**
31
- * The ids of the elements in the slider. Useful for composition.
32
- */
33
- ids?: ElementIds | undefined;
34
- /**
35
- * The aria-label of each slider thumb. Useful for providing an accessible name to the slider
36
- */
37
- "aria-label"?: string[] | undefined;
38
- /**
39
- * The `id` of the elements that labels each slider thumb. Useful for providing an accessible name to the slider
40
- */
41
- "aria-labelledby"?: string[] | undefined;
42
- /**
43
- * The name associated with each slider thumb (when used in a form)
44
- */
45
- name?: string | undefined;
46
- /**
47
- * The associate form of the underlying input element.
48
- */
49
- form?: string | undefined;
50
- /**
51
- * The controlled value of the slider
52
- */
53
- value?: number[] | undefined;
54
- /**
55
- * The initial value of the slider when rendered.
56
- * Use when you don't need to control the value of the slider.
57
- */
58
- defaultValue?: number[] | undefined;
59
- /**
60
- * Whether the slider is disabled
61
- */
62
- disabled?: boolean | undefined;
63
- /**
64
- * Whether the slider is read-only
65
- */
66
- readOnly?: boolean | undefined;
67
- /**
68
- * Whether the slider is invalid
69
- */
70
- invalid?: boolean | undefined;
71
- /**
72
- * Function invoked when the value of the slider changes
73
- */
74
- onValueChange?: ((details: ValueChangeDetails) => void) | undefined;
75
- /**
76
- * Function invoked when the slider value change is done
77
- */
78
- onValueChangeEnd?: ((details: ValueChangeDetails) => void) | undefined;
79
- /**
80
- * Function invoked when the slider's focused index changes
81
- */
82
- onFocusChange?: ((details: FocusChangeDetails) => void) | undefined;
83
- /**
84
- * Function that returns a human readable value for the slider thumb
85
- */
86
- getAriaValueText?: ((details: ValueTextDetails) => string) | undefined;
87
- /**
88
- * The minimum value of the slider
89
- * @default 0
90
- */
91
- min?: number | undefined;
92
- /**
93
- * The maximum value of the slider
94
- * @default 100
95
- */
96
- max?: number | undefined;
97
- /**
98
- * The step value of the slider
99
- * @default 1
100
- */
101
- step?: number | undefined;
102
- /**
103
- * The step value of the slider when the `Shift` key is held, or the
104
- * `PageUp`/`PageDown` keys are used.
105
- * @default 10 * step
106
- */
107
- largeStep?: number | undefined;
108
- /**
109
- * The minimum permitted steps between multiple thumbs.
110
- *
111
- * `minStepsBetweenThumbs` * `step` should reflect the gap between the thumbs.
112
- *
113
- * - `step: 1` and `minStepsBetweenThumbs: 10` => gap is `10`
114
- * - `step: 10` and `minStepsBetweenThumbs: 2` => gap is `20`
115
- *
116
- * @default 0
117
- */
118
- minStepsBetweenThumbs?: number | undefined;
119
- /**
120
- * The orientation of the slider
121
- * @default "horizontal"
122
- */
123
- orientation?: "vertical" | "horizontal" | undefined;
124
- /**
125
- * The origin of the slider range. The track is filled from the origin to the thumb.
126
- * - `"start"` / `"end"`: fill from `min` / `max`
127
- * - `"center"`: fill from the midpoint of `min`/`max`
128
- * - a `number`: fill from that value instead, for when the neutral point isn't the midpoint
129
- *
130
- * @default "start"
131
- */
132
- origin?: SliderOrigin | undefined;
133
- /**
134
- * The alignment of the slider thumb relative to the track
135
- * - `center`: the thumb will extend beyond the bounds of the slider track.
136
- * - `contain`: the thumb will be contained within the bounds of the track.
137
- *
138
- * @default "contain"
139
- */
140
- thumbAlignment?: "contain" | "center" | undefined;
141
- /**
142
- * The slider thumbs dimensions
143
- */
144
- thumbSize?: {
145
- width: number;
146
- height: number;
147
- } | undefined;
148
- /**
149
- * Controls how thumbs behave when they collide during pointer interactions.
150
- * - `none` (default): Thumbs cannot move past each other; excess movement is ignored.
151
- * - `push`: Thumbs push each other without restoring their previous positions when dragged back.
152
- * - `swap`: Thumbs swap places when dragged past each other.
153
- *
154
- * @default "none"
155
- */
156
- thumbCollisionBehavior?: "none" | "push" | "swap" | undefined;
33
+ export interface ElementIds {
34
+ root?: string | undefined;
35
+ thumb?: ((index: number) => string) | undefined;
36
+ hiddenInput?: ((index: number) => string) | undefined;
37
+ control?: string | undefined;
38
+ track?: string | undefined;
39
+ range?: string | undefined;
40
+ label?: string | undefined;
41
+ valueText?: string | undefined;
42
+ marker?: ((index: number) => string) | undefined;
43
+ }
44
+ export interface SliderProps extends DirectionProperty, CommonProperties {
45
+ /**
46
+ * The ids of the elements in the slider. Useful for composition.
47
+ */
48
+ ids?: ElementIds | undefined;
49
+ /**
50
+ * The name associated with each slider thumb (when used in a form)
51
+ */
52
+ name?: string | undefined;
53
+ /**
54
+ * The associate form of the underlying input element.
55
+ */
56
+ form?: string | undefined;
57
+ /**
58
+ * The controlled value of the slider
59
+ */
60
+ value?: number[] | undefined;
61
+ /**
62
+ * The initial value of the slider when rendered.
63
+ * Use when you don't need to control the value of the slider.
64
+ */
65
+ defaultValue?: number[] | undefined;
66
+ /**
67
+ * Whether the slider is disabled
68
+ */
69
+ disabled?: boolean | undefined;
70
+ /**
71
+ * Whether the slider is read-only
72
+ */
73
+ readOnly?: boolean | undefined;
74
+ /**
75
+ * Whether the slider is invalid
76
+ */
77
+ invalid?: boolean | undefined;
78
+ /**
79
+ * Function invoked when the value of the slider changes
80
+ */
81
+ onValueChange?: ((details: ValueChangeDetails) => void) | undefined;
82
+ /**
83
+ * Function invoked when the slider value change is done
84
+ */
85
+ onValueChangeEnd?: ((details: ValueChangeDetails) => void) | undefined;
86
+ /**
87
+ * Function invoked when the slider's focused index changes
88
+ */
89
+ onFocusChange?: ((details: FocusChangeDetails) => void) | undefined;
90
+ /**
91
+ * Function that returns a human readable value for the slider thumb
92
+ */
93
+ getAriaValueText?: ((details: ValueTextDetails) => string) | undefined;
94
+ /**
95
+ * Function that returns the accessible name of each thumb, e.g. "Minimum price"
96
+ */
97
+ getAriaLabel?: ((details: ThumbLabelDetails) => string) | undefined;
98
+ /**
99
+ * Function that returns the `id` of the element that labels each thumb.
100
+ * Defaults to the label part when no `getAriaLabel` is provided.
101
+ */
102
+ getAriaLabelledBy?: ((details: ThumbLabelDetails) => string) | undefined;
103
+ /**
104
+ * The minimum value of the slider
105
+ * @default 0
106
+ */
107
+ min?: number | undefined;
108
+ /**
109
+ * The maximum value of the slider
110
+ * @default 100
111
+ */
112
+ max?: number | undefined;
113
+ /**
114
+ * The step value of the slider
115
+ * @default 1
116
+ */
117
+ step?: number | undefined;
118
+ /**
119
+ * The step value of the slider when the `Shift` key is held, or the
120
+ * `PageUp`/`PageDown` keys are used.
121
+ * @default 10 * step
122
+ */
123
+ largeStep?: number | undefined;
124
+ /**
125
+ * The minimum permitted steps between multiple thumbs.
126
+ *
127
+ * `minStepsBetweenThumbs` * `step` should reflect the gap between the thumbs.
128
+ *
129
+ * - `step: 1` and `minStepsBetweenThumbs: 10` => gap is `10`
130
+ * - `step: 10` and `minStepsBetweenThumbs: 2` => gap is `20`
131
+ *
132
+ * @default 0
133
+ */
134
+ minStepsBetweenThumbs?: number | undefined;
135
+ /**
136
+ * The orientation of the slider
137
+ * @default "horizontal"
138
+ */
139
+ orientation?: "vertical" | "horizontal" | undefined;
140
+ /**
141
+ * The origin of the slider range. The track is filled from the origin to the thumb.
142
+ * - `"start"` / `"end"`: fill from `min` / `max`
143
+ * - `"center"`: fill from the midpoint of `min`/`max`
144
+ * - a `number`: fill from that value instead, for when the neutral point isn't the midpoint
145
+ *
146
+ * @default "start"
147
+ */
148
+ origin?: SliderOrigin | undefined;
149
+ /**
150
+ * The alignment of the slider thumb relative to the track
151
+ * - `center`: the thumb will extend beyond the bounds of the slider track.
152
+ * - `contain`: the thumb will be contained within the bounds of the track.
153
+ *
154
+ * @default "contain"
155
+ */
156
+ thumbAlignment?: "contain" | "center" | undefined;
157
+ /**
158
+ * The slider thumbs dimensions. A number sets both the width and height.
159
+ */
160
+ thumbSize?: number | {
161
+ width: number;
162
+ height: number;
163
+ } | undefined;
164
+ /**
165
+ * Controls how thumbs behave when they collide during pointer interactions.
166
+ * - `none` (default): Thumbs cannot move past each other; excess movement is ignored.
167
+ * - `push`: Thumbs push each other without restoring their previous positions when dragged back.
168
+ * - `swap`: Thumbs swap places when dragged past each other.
169
+ *
170
+ * @default "none"
171
+ */
172
+ thumbCollisionBehavior?: "none" | "push" | "swap" | undefined;
157
173
  }
158
174
  type PropsWithDefault = "dir" | "min" | "max" | "step" | "largeStep" | "orientation" | "defaultValue" | "origin" | "thumbAlignment" | "minStepsBetweenThumbs" | "thumbCollisionBehavior";
159
175
  type Computed = Readonly<{
160
- /**
161
- * @computed
162
- * Whether the slider thumb has been measured
163
- */
164
- hasMeasuredThumbSize: boolean;
165
- /**
166
- * @computed
167
- * Whether the slider is interactive
168
- */
169
- isInteractive: boolean;
170
- /**
171
- * @computed
172
- * Whether the slider is vertical
173
- */
174
- isVertical: boolean;
175
- /**
176
- * @computed
177
- * Whether the slider is horizontal
178
- */
179
- isHorizontal: boolean;
180
- /**
181
- * @computed
182
- * Whether the slider is in RTL mode
183
- */
184
- isRtl: boolean;
185
- /**
186
- * @computed
187
- * The percentage of the slider value relative to the slider min/max
188
- */
189
- valuePercent: number[];
190
- /**
191
- * @computed
192
- * Whether the slider is disabled
193
- */
194
- isDisabled: boolean;
176
+ /**
177
+ * @computed
178
+ * Whether the slider thumb has been measured
179
+ */
180
+ hasMeasuredThumbSize: boolean;
181
+ /**
182
+ * @computed
183
+ * Whether the slider is interactive
184
+ */
185
+ isInteractive: boolean;
186
+ /**
187
+ * @computed
188
+ * Whether the slider is vertical
189
+ */
190
+ isVertical: boolean;
191
+ /**
192
+ * @computed
193
+ * Whether the slider is horizontal
194
+ */
195
+ isHorizontal: boolean;
196
+ /**
197
+ * @computed
198
+ * Whether the slider is in RTL mode
199
+ */
200
+ isRtl: boolean;
201
+ /**
202
+ * @computed
203
+ * The percentage of the slider value relative to the slider min/max
204
+ */
205
+ valuePercent: number[];
206
+ /**
207
+ * @computed
208
+ * Whether the slider is disabled
209
+ */
210
+ isDisabled: boolean;
195
211
  }>;
196
212
  interface Context {
197
- /**
198
- * The active index of the range slider. This represents
199
- * the currently dragged/focused thumb.
200
- */
201
- focusedIndex: number;
202
- /**
203
- * The value of the range slider
204
- */
205
- value: number[];
206
- /**
207
- * The size of the slider thumbs
208
- */
209
- thumbSize: Size | null;
213
+ /**
214
+ * The active index of the range slider. This represents
215
+ * the currently dragged/focused thumb.
216
+ */
217
+ focusedIndex: number;
218
+ /**
219
+ * The value of the range slider
220
+ */
221
+ value: number[];
222
+ /**
223
+ * The size of the slider thumbs
224
+ */
225
+ thumbSize: Size | null;
210
226
  }
211
- interface SliderSchema {
212
- state: "idle" | "dragging" | "focus";
213
- props: SliderProps;
214
- defaultPropKey: PropsWithDefault;
215
- context: Context;
216
- refs: {
217
- /**
218
- * The offset from the thumb center when pointer down occurs.
219
- * Used to maintain constant offset during drag.
220
- */
221
- thumbDragOffset: {
222
- x: number;
223
- y: number;
224
- } | null;
225
- /**
226
- * The values when a thumb drag starts.
227
- * Used for swap collision behavior to determine swap direction.
228
- */
229
- thumbDragStartValue: number[] | null;
230
- };
231
- computed: Computed;
232
- event: EventObject;
233
- action: string;
234
- effect: string;
235
- guard: string;
227
+ export interface SliderSchema {
228
+ state: "idle" | "dragging" | "focus";
229
+ props: SliderProps;
230
+ defaultPropKey: PropsWithDefault;
231
+ context: Context;
232
+ refs: {
233
+ /**
234
+ * The offset from the thumb center when pointer down occurs.
235
+ * Used to maintain constant offset during drag.
236
+ */
237
+ thumbDragOffset: {
238
+ x: number;
239
+ y: number;
240
+ } | null;
241
+ /**
242
+ * The values when a thumb drag starts.
243
+ * Used for swap collision behavior to determine swap direction.
244
+ */
245
+ startValue: number[] | null;
246
+ /**
247
+ * The reason of the last pointer-driven change, reported by `onValueChangeEnd`.
248
+ */
249
+ pointerReason: ValueChangeReason | undefined;
250
+ focusFrame: AnimationFrame;
251
+ };
252
+ computed: Computed;
253
+ event: EventObject;
254
+ action: string;
255
+ effect: string;
256
+ guard: string;
236
257
  }
237
- type SliderService = Service<SliderSchema>;
238
- type SliderMachine = Machine<SliderSchema>;
258
+ export type SliderService = Service<SliderSchema>;
259
+ export type SliderMachine = Machine<SliderSchema>;
239
260
  interface Size {
240
- width: number;
241
- height: number;
261
+ width: number;
262
+ height: number;
242
263
  }
243
- interface MarkerProps {
244
- value: number;
264
+ export interface MarkerProps {
265
+ value: number;
245
266
  }
246
- interface MarkerState {
247
- /**
248
- * The value of the marker
249
- */
250
- value: number;
251
- /**
252
- * Whether the marker is disabled
253
- */
254
- disabled: boolean;
255
- /**
256
- * The state of the marker relative to the slider value
257
- */
258
- state: "under-value" | "over-value" | "at-value";
267
+ export interface MarkerState {
268
+ /**
269
+ * The value of the marker
270
+ */
271
+ value: number;
272
+ /**
273
+ * Whether the marker is disabled
274
+ */
275
+ disabled: boolean;
276
+ /**
277
+ * The state of the marker relative to the slider value
278
+ */
279
+ state: "under-value" | "over-value" | "at-value";
280
+ /**
281
+ * Whether the marker is within the filled range, accounting for `origin`
282
+ */
283
+ inRange: boolean;
259
284
  }
260
- interface ThumbProps {
261
- index: number;
262
- name?: string | undefined;
285
+ export interface ThumbProps {
286
+ index: number;
287
+ name?: string | undefined;
288
+ disabled?: boolean | undefined;
263
289
  }
264
- interface ThumbState {
265
- /**
266
- * The index of the thumb
267
- */
268
- index: number;
269
- /**
270
- * The value of the thumb
271
- */
272
- value: number;
273
- /**
274
- * Whether the thumb is disabled
275
- */
276
- disabled: boolean;
277
- /**
278
- * Whether the thumb is focused
279
- */
280
- focused: boolean;
281
- /**
282
- * Whether the thumb is being dragged
283
- */
284
- dragging: boolean;
290
+ export interface ThumbState {
291
+ /**
292
+ * The index of the thumb
293
+ */
294
+ index: number;
295
+ /**
296
+ * The value of the thumb
297
+ */
298
+ value: number;
299
+ /**
300
+ * Whether the thumb is disabled
301
+ */
302
+ disabled: boolean;
303
+ /**
304
+ * Whether the thumb is focused
305
+ */
306
+ focused: boolean;
307
+ /**
308
+ * Whether the thumb is being dragged
309
+ */
310
+ dragging: boolean;
285
311
  }
286
- interface DraggingIndicatorProps {
287
- index: number;
312
+ export interface DraggingIndicatorProps {
313
+ index: number;
288
314
  }
289
- interface RootState {
290
- /**
291
- * Whether the slider is disabled
292
- */
293
- disabled: boolean;
294
- /**
295
- * Whether the slider is invalid
296
- */
297
- invalid: boolean;
298
- /**
299
- * Whether the slider is being dragged
300
- */
301
- dragging: boolean;
302
- /**
303
- * Whether the slider is focused
304
- */
305
- focused: boolean;
306
- /**
307
- * The orientation of the slider
308
- */
309
- orientation: "vertical" | "horizontal";
315
+ export interface RootState {
316
+ /**
317
+ * Whether the slider is disabled
318
+ */
319
+ disabled: boolean;
320
+ /**
321
+ * Whether the slider is invalid
322
+ */
323
+ invalid: boolean;
324
+ /**
325
+ * Whether the slider is being dragged
326
+ */
327
+ dragging: boolean;
328
+ /**
329
+ * Whether the slider is focused
330
+ */
331
+ focused: boolean;
332
+ /**
333
+ * The orientation of the slider
334
+ */
335
+ orientation: "vertical" | "horizontal";
310
336
  }
311
- interface SliderApi<T extends PropTypes = PropTypes> {
312
- /**
313
- * The value of the slider.
314
- */
315
- value: number[];
316
- /**
317
- * Whether the slider is being dragged.
318
- */
319
- dragging: boolean;
320
- /**
321
- * Whether the slider is focused.
322
- */
323
- focused: boolean;
324
- /**
325
- * Function to set the value of the slider.
326
- */
327
- setValue: (value: number[]) => void;
328
- /**
329
- * Returns the value of the thumb at the given index.
330
- */
331
- getThumbValue: (index: number) => number;
332
- /**
333
- * Sets the value of the thumb at the given index.
334
- */
335
- setThumbValue: (index: number, value: number) => void;
336
- /**
337
- * Returns the percent of the thumb at the given index.
338
- */
339
- getValuePercent: (value: number) => number;
340
- /**
341
- * Returns the value of the thumb at the given percent.
342
- */
343
- getPercentValue: (percent: number) => number;
344
- /**
345
- * Returns the percent of the thumb at the given index.
346
- */
347
- getThumbPercent: (index: number) => number;
348
- /**
349
- * Sets the percent of the thumb at the given index.
350
- */
351
- setThumbPercent: (index: number, percent: number) => void;
352
- /**
353
- * Returns the min value of the thumb at the given index.
354
- */
355
- getThumbMin: (index: number) => number;
356
- /**
357
- * Returns the max value of the thumb at the given index.
358
- */
359
- getThumbMax: (index: number) => number;
360
- /**
361
- * Function to increment the value of the slider at the given index.
362
- */
363
- increment: (index: number) => void;
364
- /**
365
- * Function to decrement the value of the slider at the given index.
366
- */
367
- decrement: (index: number) => void;
368
- /**
369
- * Function to focus the slider. This focuses the first thumb.
370
- */
371
- focus: VoidFunction;
372
- /**
373
- * Returns the state of the slider
374
- */
375
- getRootState: () => RootState;
376
- getLabelProps: () => T["label"];
377
- getRootProps: () => T["element"];
378
- getValueTextProps: () => T["element"];
379
- getTrackProps: () => T["element"];
380
- /**
381
- * Returns the state of a specific thumb
382
- */
383
- getThumbState: (props: ThumbProps) => ThumbState;
384
- getThumbProps: (props: ThumbProps) => T["element"];
385
- getHiddenInputProps: (props: ThumbProps) => T["input"];
386
- getRangeProps: () => T["element"];
387
- getControlProps: () => T["element"];
388
- getMarkerGroupProps: () => T["element"];
389
- /**
390
- * Returns the state of a specific marker
391
- */
392
- getMarkerState: (props: MarkerProps) => MarkerState;
393
- getMarkerProps: (props: MarkerProps) => T["element"];
394
- getDraggingIndicatorProps: (props: DraggingIndicatorProps) => T["element"];
337
+ export interface SliderApi<T extends PropTypes = PropTypes> {
338
+ /**
339
+ * The value of the slider.
340
+ */
341
+ value: number[];
342
+ /**
343
+ * Whether the slider is being dragged.
344
+ */
345
+ dragging: boolean;
346
+ /**
347
+ * Whether the slider is focused.
348
+ */
349
+ focused: boolean;
350
+ /**
351
+ * Function to set the value of the slider.
352
+ */
353
+ setValue: (value: number[]) => void;
354
+ /**
355
+ * Returns the value of the thumb at the given index.
356
+ */
357
+ getThumbValue: (index: number) => number;
358
+ /**
359
+ * Sets the value of the thumb at the given index.
360
+ */
361
+ setThumbValue: (index: number, value: number) => void;
362
+ /**
363
+ * Returns the percent of the thumb at the given index.
364
+ */
365
+ getValuePercent: (value: number) => number;
366
+ /**
367
+ * Returns the value of the thumb at the given percent.
368
+ */
369
+ getPercentValue: (percent: number) => number;
370
+ /**
371
+ * Returns the percent of the thumb at the given index.
372
+ */
373
+ getThumbPercent: (index: number) => number;
374
+ /**
375
+ * Sets the percent of the thumb at the given index.
376
+ */
377
+ setThumbPercent: (index: number, percent: number) => void;
378
+ /**
379
+ * Returns the min value of the thumb at the given index.
380
+ */
381
+ getThumbMin: (index: number) => number;
382
+ /**
383
+ * Returns the max value of the thumb at the given index.
384
+ */
385
+ getThumbMax: (index: number) => number;
386
+ /**
387
+ * Function to increment the value of the slider at the given index.
388
+ */
389
+ increment: (index: number) => void;
390
+ /**
391
+ * Function to decrement the value of the slider at the given index.
392
+ */
393
+ decrement: (index: number) => void;
394
+ /**
395
+ * Function to focus the slider. This focuses the first thumb.
396
+ */
397
+ focus: VoidFunction;
398
+ /**
399
+ * Returns the state of the slider
400
+ */
401
+ getRootState: () => RootState;
402
+ getLabelProps: () => T["label"];
403
+ getRootProps: () => T["element"];
404
+ getValueTextProps: () => T["element"];
405
+ getTrackProps: () => T["element"];
406
+ /**
407
+ * Returns the state of a specific thumb
408
+ */
409
+ getThumbState: (props: ThumbProps) => ThumbState;
410
+ getThumbProps: (props: ThumbProps) => T["element"];
411
+ getHiddenInputProps: (props: ThumbProps) => T["input"];
412
+ getRangeProps: () => T["element"];
413
+ getControlProps: () => T["element"];
414
+ getMarkerGroupProps: () => T["element"];
415
+ /**
416
+ * Returns the state of a specific marker
417
+ */
418
+ getMarkerState: (props: MarkerProps) => MarkerState;
419
+ getMarkerProps: (props: MarkerProps) => T["element"];
420
+ getDraggingIndicatorProps: (props: DraggingIndicatorProps) => T["element"];
395
421
  }
396
-
397
- export type { DraggingIndicatorProps, ElementIds, FocusChangeDetails, MarkerProps, MarkerState, RootState, SliderApi, SliderMachine, SliderOrigin, SliderProps, SliderSchema, SliderService, ThumbAlignment, ThumbCollisionBehavior, ThumbProps, ThumbState, ValueChangeDetails, ValueTextDetails };
422
+ export {};