File tree Expand file tree Collapse file tree 2 files changed +7
-14
lines changed
Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,13 @@ export type SliderSingleVerticalProps = SliderBaseStateProps & {
2020 showTip ?: boolean ;
2121} ;
2222
23- export const SliderSingleVertical : React . FC <
24- SliderSingleVerticalProps
25- > = props => {
23+ export const SliderSingleVertical : React . FC < SliderSingleVerticalProps > = ( {
24+ orientation = "vertical" ,
25+ ...props
26+ } ) => {
2627 const { label, showTip, ...rest } = props ;
2728 const sliderLabel = `${ label ? label : "Styled" } Slider` ;
28- const state = useSliderBaseState ( props ) ;
29+ const state = useSliderBaseState ( { ... props , orientation } ) ;
2930 const slider = useSliderState ( { ...rest , label : sliderLabel , state } ) ;
3031 const { getThumbValueLabel, getValuePercent, values } = state ;
3132
@@ -52,7 +53,7 @@ export const SliderSingleVertical: React.FC<
5253 < Thumb
5354 index = { 0 }
5455 state = { state }
55- orientation = { props . orientation }
56+ orientation = { orientation }
5657 isDisabled = { props . isDisabled }
5758 trackRef = { slider . trackRef }
5859 aria-label = "Thumb"
Original file line number Diff line number Diff line change @@ -30,22 +30,18 @@ export default {
3030} as Meta ;
3131
3232export const Default : Story = {
33- args : {
34- orientation : "vertical" ,
35- } ,
33+ args : { } ,
3634} ;
3735
3836export const ThumbTip : Story = {
3937 args : {
40- orientation : "vertical" ,
4138 label : "Thumb Tipped" ,
4239 showTip : true ,
4340 } ,
4441} ;
4542
4643export const MinMax : Story = {
4744 args : {
48- orientation : "vertical" ,
4945 label : "Min Max" ,
5046 minValue : 20 ,
5147 maxValue : 80 ,
@@ -54,23 +50,20 @@ export const MinMax: Story = {
5450
5551export const Step : Story = {
5652 args : {
57- orientation : "vertical" ,
5853 label : "Stepped" ,
5954 step : 10 ,
6055 } ,
6156} ;
6257
6358export const DefaultValue : Story = {
6459 args : {
65- orientation : "vertical" ,
6660 label : "Default Valued" ,
6761 defaultValue : [ 80 ] ,
6862 } ,
6963} ;
7064
7165export const FormatOptions : Story = {
7266 args : {
73- orientation : "vertical" ,
7467 label : "Temperature Formatted" ,
7568 formatOptions : {
7669 style : "unit" ,
@@ -82,7 +75,6 @@ export const FormatOptions: Story = {
8275
8376export const Disabled : Story = {
8477 args : {
85- orientation : "vertical" ,
8678 label : "Disabled" ,
8779 isDisabled : true ,
8880 } ,
You can’t perform that action at this time.
0 commit comments