@zag-js/slider 1.18.3 → 1.18.5

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.
package/dist/index.d.mts CHANGED
@@ -18,14 +18,14 @@ interface ValueTextDetails {
18
18
  }
19
19
  type ElementIds = Partial<{
20
20
  root: string;
21
- thumb(index: number): string;
22
- hiddenInput(index: number): string;
21
+ thumb: (index: number) => string;
22
+ hiddenInput: (index: number) => string;
23
23
  control: string;
24
24
  track: string;
25
25
  range: string;
26
26
  label: string;
27
27
  valueText: string;
28
- marker(index: number): string;
28
+ marker: (index: number) => string;
29
29
  }>;
30
30
  interface SliderProps extends DirectionProperty, CommonProperties {
31
31
  /**
@@ -72,19 +72,19 @@ interface SliderProps extends DirectionProperty, CommonProperties {
72
72
  /**
73
73
  * Function invoked when the value of the slider changes
74
74
  */
75
- onValueChange?(details: ValueChangeDetails): void;
75
+ onValueChange?: ((details: ValueChangeDetails) => void) | undefined;
76
76
  /**
77
77
  * Function invoked when the slider value change is done
78
78
  */
79
- onValueChangeEnd?(details: ValueChangeDetails): void;
79
+ onValueChangeEnd?: ((details: ValueChangeDetails) => void) | undefined;
80
80
  /**
81
81
  * Function invoked when the slider's focused index changes
82
82
  */
83
- onFocusChange?(details: FocusChangeDetails): void;
83
+ onFocusChange?: ((details: FocusChangeDetails) => void) | undefined;
84
84
  /**
85
85
  * Function that returns a human readable value for the slider thumb
86
86
  */
87
- getAriaValueText?(details: ValueTextDetails): string;
87
+ getAriaValueText?: ((details: ValueTextDetails) => string) | undefined;
88
88
  /**
89
89
  * The minimum value of the slider
90
90
  * @default 0
@@ -237,15 +237,15 @@ interface SliderApi<T extends PropTypes = PropTypes> {
237
237
  /**
238
238
  * Function to set the value of the slider.
239
239
  */
240
- setValue(value: number[]): void;
240
+ setValue: (value: number[]) => void;
241
241
  /**
242
242
  * Returns the value of the thumb at the given index.
243
243
  */
244
- getThumbValue(index: number): number;
244
+ getThumbValue: (index: number) => number;
245
245
  /**
246
246
  * Sets the value of the thumb at the given index.
247
247
  */
248
- setThumbValue(index: number, value: number): void;
248
+ setThumbValue: (index: number, value: number) => void;
249
249
  /**
250
250
  * Returns the percent of the thumb at the given index.
251
251
  */
@@ -257,42 +257,42 @@ interface SliderApi<T extends PropTypes = PropTypes> {
257
257
  /**
258
258
  * Returns the percent of the thumb at the given index.
259
259
  */
260
- getThumbPercent(index: number): number;
260
+ getThumbPercent: (index: number) => number;
261
261
  /**
262
262
  * Sets the percent of the thumb at the given index.
263
263
  */
264
- setThumbPercent(index: number, percent: number): void;
264
+ setThumbPercent: (index: number, percent: number) => void;
265
265
  /**
266
266
  * Returns the min value of the thumb at the given index.
267
267
  */
268
- getThumbMin(index: number): number;
268
+ getThumbMin: (index: number) => number;
269
269
  /**
270
270
  * Returns the max value of the thumb at the given index.
271
271
  */
272
- getThumbMax(index: number): number;
272
+ getThumbMax: (index: number) => number;
273
273
  /**
274
274
  * Function to increment the value of the slider at the given index.
275
275
  */
276
- increment(index: number): void;
276
+ increment: (index: number) => void;
277
277
  /**
278
278
  * Function to decrement the value of the slider at the given index.
279
279
  */
280
- decrement(index: number): void;
280
+ decrement: (index: number) => void;
281
281
  /**
282
282
  * Function to focus the slider. This focuses the first thumb.
283
283
  */
284
- focus(): void;
285
- getLabelProps(): T["label"];
286
- getRootProps(): T["element"];
287
- getValueTextProps(): T["element"];
288
- getTrackProps(): T["element"];
289
- getThumbProps(props: ThumbProps): T["element"];
290
- getHiddenInputProps(props: ThumbProps): T["input"];
291
- getRangeProps(): T["element"];
292
- getControlProps(): T["element"];
293
- getMarkerGroupProps(): T["element"];
294
- getMarkerProps(props: MarkerProps): T["element"];
295
- getDraggingIndicatorProps(props: DraggingIndicatorProps): T["element"];
284
+ focus: VoidFunction;
285
+ getLabelProps: () => T["label"];
286
+ getRootProps: () => T["element"];
287
+ getValueTextProps: () => T["element"];
288
+ getTrackProps: () => T["element"];
289
+ getThumbProps: (props: ThumbProps) => T["element"];
290
+ getHiddenInputProps: (props: ThumbProps) => T["input"];
291
+ getRangeProps: () => T["element"];
292
+ getControlProps: () => T["element"];
293
+ getMarkerGroupProps: () => T["element"];
294
+ getMarkerProps: (props: MarkerProps) => T["element"];
295
+ getDraggingIndicatorProps: (props: DraggingIndicatorProps) => T["element"];
296
296
  }
297
297
 
298
298
  declare function connect<T extends PropTypes>(service: SliderService, normalize: NormalizeProps<T>): SliderApi<T>;
package/dist/index.d.ts CHANGED
@@ -18,14 +18,14 @@ interface ValueTextDetails {
18
18
  }
19
19
  type ElementIds = Partial<{
20
20
  root: string;
21
- thumb(index: number): string;
22
- hiddenInput(index: number): string;
21
+ thumb: (index: number) => string;
22
+ hiddenInput: (index: number) => string;
23
23
  control: string;
24
24
  track: string;
25
25
  range: string;
26
26
  label: string;
27
27
  valueText: string;
28
- marker(index: number): string;
28
+ marker: (index: number) => string;
29
29
  }>;
30
30
  interface SliderProps extends DirectionProperty, CommonProperties {
31
31
  /**
@@ -72,19 +72,19 @@ interface SliderProps extends DirectionProperty, CommonProperties {
72
72
  /**
73
73
  * Function invoked when the value of the slider changes
74
74
  */
75
- onValueChange?(details: ValueChangeDetails): void;
75
+ onValueChange?: ((details: ValueChangeDetails) => void) | undefined;
76
76
  /**
77
77
  * Function invoked when the slider value change is done
78
78
  */
79
- onValueChangeEnd?(details: ValueChangeDetails): void;
79
+ onValueChangeEnd?: ((details: ValueChangeDetails) => void) | undefined;
80
80
  /**
81
81
  * Function invoked when the slider's focused index changes
82
82
  */
83
- onFocusChange?(details: FocusChangeDetails): void;
83
+ onFocusChange?: ((details: FocusChangeDetails) => void) | undefined;
84
84
  /**
85
85
  * Function that returns a human readable value for the slider thumb
86
86
  */
87
- getAriaValueText?(details: ValueTextDetails): string;
87
+ getAriaValueText?: ((details: ValueTextDetails) => string) | undefined;
88
88
  /**
89
89
  * The minimum value of the slider
90
90
  * @default 0
@@ -237,15 +237,15 @@ interface SliderApi<T extends PropTypes = PropTypes> {
237
237
  /**
238
238
  * Function to set the value of the slider.
239
239
  */
240
- setValue(value: number[]): void;
240
+ setValue: (value: number[]) => void;
241
241
  /**
242
242
  * Returns the value of the thumb at the given index.
243
243
  */
244
- getThumbValue(index: number): number;
244
+ getThumbValue: (index: number) => number;
245
245
  /**
246
246
  * Sets the value of the thumb at the given index.
247
247
  */
248
- setThumbValue(index: number, value: number): void;
248
+ setThumbValue: (index: number, value: number) => void;
249
249
  /**
250
250
  * Returns the percent of the thumb at the given index.
251
251
  */
@@ -257,42 +257,42 @@ interface SliderApi<T extends PropTypes = PropTypes> {
257
257
  /**
258
258
  * Returns the percent of the thumb at the given index.
259
259
  */
260
- getThumbPercent(index: number): number;
260
+ getThumbPercent: (index: number) => number;
261
261
  /**
262
262
  * Sets the percent of the thumb at the given index.
263
263
  */
264
- setThumbPercent(index: number, percent: number): void;
264
+ setThumbPercent: (index: number, percent: number) => void;
265
265
  /**
266
266
  * Returns the min value of the thumb at the given index.
267
267
  */
268
- getThumbMin(index: number): number;
268
+ getThumbMin: (index: number) => number;
269
269
  /**
270
270
  * Returns the max value of the thumb at the given index.
271
271
  */
272
- getThumbMax(index: number): number;
272
+ getThumbMax: (index: number) => number;
273
273
  /**
274
274
  * Function to increment the value of the slider at the given index.
275
275
  */
276
- increment(index: number): void;
276
+ increment: (index: number) => void;
277
277
  /**
278
278
  * Function to decrement the value of the slider at the given index.
279
279
  */
280
- decrement(index: number): void;
280
+ decrement: (index: number) => void;
281
281
  /**
282
282
  * Function to focus the slider. This focuses the first thumb.
283
283
  */
284
- focus(): void;
285
- getLabelProps(): T["label"];
286
- getRootProps(): T["element"];
287
- getValueTextProps(): T["element"];
288
- getTrackProps(): T["element"];
289
- getThumbProps(props: ThumbProps): T["element"];
290
- getHiddenInputProps(props: ThumbProps): T["input"];
291
- getRangeProps(): T["element"];
292
- getControlProps(): T["element"];
293
- getMarkerGroupProps(): T["element"];
294
- getMarkerProps(props: MarkerProps): T["element"];
295
- getDraggingIndicatorProps(props: DraggingIndicatorProps): T["element"];
284
+ focus: VoidFunction;
285
+ getLabelProps: () => T["label"];
286
+ getRootProps: () => T["element"];
287
+ getValueTextProps: () => T["element"];
288
+ getTrackProps: () => T["element"];
289
+ getThumbProps: (props: ThumbProps) => T["element"];
290
+ getHiddenInputProps: (props: ThumbProps) => T["input"];
291
+ getRangeProps: () => T["element"];
292
+ getControlProps: () => T["element"];
293
+ getMarkerGroupProps: () => T["element"];
294
+ getMarkerProps: (props: MarkerProps) => T["element"];
295
+ getDraggingIndicatorProps: (props: DraggingIndicatorProps) => T["element"];
296
296
  }
297
297
 
298
298
  declare function connect<T extends PropTypes>(service: SliderService, normalize: NormalizeProps<T>): SliderApi<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/slider",
3
- "version": "1.18.3",
3
+ "version": "1.18.5",
4
4
  "description": "Core logic for the slider widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -27,11 +27,11 @@
27
27
  "url": "https://github.com/chakra-ui/zag/issues"
28
28
  },
29
29
  "dependencies": {
30
- "@zag-js/anatomy": "1.18.3",
31
- "@zag-js/core": "1.18.3",
32
- "@zag-js/dom-query": "1.18.3",
33
- "@zag-js/utils": "1.18.3",
34
- "@zag-js/types": "1.18.3"
30
+ "@zag-js/anatomy": "1.18.5",
31
+ "@zag-js/core": "1.18.5",
32
+ "@zag-js/dom-query": "1.18.5",
33
+ "@zag-js/utils": "1.18.5",
34
+ "@zag-js/types": "1.18.5"
35
35
  },
36
36
  "devDependencies": {
37
37
  "clean-package": "2.2.0"