@react-types/slider 3.8.3 → 3.9.0
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/package.json +8 -4
- package/src/index.d.ts +3 -127
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-types/slider",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -9,13 +9,17 @@
|
|
|
9
9
|
"url": "https://github.com/adobe/react-spectrum"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@react-
|
|
12
|
+
"@react-aria/slider": "^3.9.0",
|
|
13
|
+
"@react-spectrum/slider": "^3.9.0",
|
|
14
|
+
"@react-stately/slider": "^3.8.0"
|
|
13
15
|
},
|
|
14
16
|
"peerDependencies": {
|
|
15
|
-
"react": "^
|
|
17
|
+
"@react-spectrum/provider": "^3.0.0",
|
|
18
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
19
|
+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
16
20
|
},
|
|
17
21
|
"publishConfig": {
|
|
18
22
|
"access": "public"
|
|
19
23
|
},
|
|
20
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
|
|
21
25
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,127 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
DOMProps,
|
|
5
|
-
FocusableDOMProps,
|
|
6
|
-
FocusableProps,
|
|
7
|
-
InputDOMProps,
|
|
8
|
-
LabelableProps,
|
|
9
|
-
LabelPosition,
|
|
10
|
-
Orientation,
|
|
11
|
-
RangeInputBase,
|
|
12
|
-
RangeValue,
|
|
13
|
-
StyleProps,
|
|
14
|
-
ValidationState,
|
|
15
|
-
ValueBase
|
|
16
|
-
} from '@react-types/shared';
|
|
17
|
-
import {ReactNode} from 'react';
|
|
18
|
-
|
|
19
|
-
export interface SliderProps<T = number | number[]> extends RangeInputBase<number>, ValueBase<T>, LabelableProps {
|
|
20
|
-
/**
|
|
21
|
-
* The orientation of the Slider.
|
|
22
|
-
* @default 'horizontal'
|
|
23
|
-
*/
|
|
24
|
-
orientation?: Orientation,
|
|
25
|
-
/** Whether the whole Slider is disabled. */
|
|
26
|
-
isDisabled?: boolean,
|
|
27
|
-
/** Fired when the slider stops moving, due to being let go. */
|
|
28
|
-
onChangeEnd?: (value: T) => void,
|
|
29
|
-
// These are duplicated from ValueBase to define defaults for the docs.
|
|
30
|
-
/**
|
|
31
|
-
* The slider's minimum value.
|
|
32
|
-
* @default 0
|
|
33
|
-
*/
|
|
34
|
-
minValue?: number,
|
|
35
|
-
/**
|
|
36
|
-
* The slider's maximum value.
|
|
37
|
-
* @default 100
|
|
38
|
-
*/
|
|
39
|
-
maxValue?: number,
|
|
40
|
-
/**
|
|
41
|
-
* The slider's step value.
|
|
42
|
-
* @default 1
|
|
43
|
-
*/
|
|
44
|
-
step?: number
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface SliderThumbProps extends FocusableProps, LabelableProps {
|
|
48
|
-
/**
|
|
49
|
-
* The orientation of the Slider.
|
|
50
|
-
* @default 'horizontal'
|
|
51
|
-
* @deprecated - pass to the slider instead.
|
|
52
|
-
*/
|
|
53
|
-
orientation?: Orientation,
|
|
54
|
-
/** Whether the Thumb is disabled. */
|
|
55
|
-
isDisabled?: boolean,
|
|
56
|
-
/**
|
|
57
|
-
* Index of the thumb within the slider.
|
|
58
|
-
* @default 0
|
|
59
|
-
*/
|
|
60
|
-
index?: number,
|
|
61
|
-
/** @deprecated */
|
|
62
|
-
isRequired?: boolean,
|
|
63
|
-
/** @deprecated */
|
|
64
|
-
isInvalid?: boolean,
|
|
65
|
-
/** @deprecated */
|
|
66
|
-
validationState?: ValidationState
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface AriaSliderProps<T = number | number[]> extends SliderProps<T>, DOMProps, AriaLabelingProps {}
|
|
70
|
-
export interface AriaSliderThumbProps extends SliderThumbProps, DOMProps, Omit<FocusableDOMProps, 'excludeFromTabOrder'>, InputDOMProps, AriaLabelingProps, AriaValidationProps {}
|
|
71
|
-
|
|
72
|
-
export interface SpectrumBarSliderBase<T> extends AriaSliderProps<T>, ValueBase<T>, StyleProps {
|
|
73
|
-
/**
|
|
74
|
-
* The display format of the value label.
|
|
75
|
-
*/
|
|
76
|
-
formatOptions?: Intl.NumberFormatOptions,
|
|
77
|
-
/**
|
|
78
|
-
* The label's overall position relative to the element it is labeling.
|
|
79
|
-
* @default 'top'
|
|
80
|
-
*/
|
|
81
|
-
labelPosition?: LabelPosition,
|
|
82
|
-
/** Whether the value's label is displayed. True by default if there's a `label`, false by default if not. */
|
|
83
|
-
showValueLabel?: boolean,
|
|
84
|
-
/** A function that returns the content to display as the value's label. Overrides default formatted number. */
|
|
85
|
-
getValueLabel?: (value: T) => string,
|
|
86
|
-
/**
|
|
87
|
-
* A ContextualHelp element to place next to the label.
|
|
88
|
-
*/
|
|
89
|
-
contextualHelp?: ReactNode
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface SpectrumSliderProps extends SpectrumBarSliderBase<number>, InputDOMProps {
|
|
93
|
-
/**
|
|
94
|
-
* Whether a fill color is shown between the start of the slider and the current value.
|
|
95
|
-
* @see https://spectrum.adobe.com/page/slider/#Fill.
|
|
96
|
-
*/
|
|
97
|
-
isFilled?: boolean,
|
|
98
|
-
/**
|
|
99
|
-
* The offset from which to start the fill.
|
|
100
|
-
* @see https://spectrum.adobe.com/page/slider/#Fill-start.
|
|
101
|
-
*/
|
|
102
|
-
fillOffset?: number,
|
|
103
|
-
/**
|
|
104
|
-
* The background of the track, specified as the stops for a CSS background: `linear-gradient(to right/left, ...trackGradient)`.
|
|
105
|
-
* @example trackGradient={['red', 'green']}
|
|
106
|
-
* @example trackGradient={['red 20%', 'green 40%']}
|
|
107
|
-
* @see https://spectrum.adobe.com/page/slider/#Gradient.
|
|
108
|
-
*/
|
|
109
|
-
trackGradient?: string[]
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export interface SpectrumRangeSliderProps extends SpectrumBarSliderBase<RangeValue<number>> {
|
|
113
|
-
/**
|
|
114
|
-
* The name of the start input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
|
|
115
|
-
*/
|
|
116
|
-
startName?: string,
|
|
117
|
-
/**
|
|
118
|
-
* The name of the end input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
|
|
119
|
-
*/
|
|
120
|
-
endName?: string,
|
|
121
|
-
/**
|
|
122
|
-
* The `<form>` element to associate the slider with.
|
|
123
|
-
* The value of this attribute must be the id of a `<form>` in the same document.
|
|
124
|
-
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).
|
|
125
|
-
*/
|
|
126
|
-
form?: string
|
|
127
|
-
}
|
|
1
|
+
export {SliderProps} from '@react-stately/slider';
|
|
2
|
+
export {SliderThumbProps, AriaSliderProps, AriaSliderThumbProps} from '@react-aria/slider';
|
|
3
|
+
export {SpectrumBarSliderBase, SpectrumSliderProps, SpectrumRangeSliderProps} from '@react-spectrum/slider';
|