-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(web-react): Introduce
disabled
state to Slider
#DS-1325
Also, drop the `isSelected` and `isRequired` props.
- Loading branch information
1 parent
86ba5ff
commit 2cf320f
Showing
12 changed files
with
155 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 21 additions & 5 deletions
26
packages/web-react/src/components/UNSTABLE_Slider/demo/SliderDefault.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,31 @@ | ||
import React, { ChangeEvent, useState } from 'react'; | ||
import { DEMO_SLIDER_DEFAULT_VALUE } from '../constants'; | ||
import { DEMO_SLIDER_DEFAULT_VALUE, DEMO_SLIDER_STEPS_VALUE } from '../constants'; | ||
import UNSTABLE_Slider from '../UNSTABLE_Slider'; | ||
|
||
const SliderDefault = () => { | ||
const [value, setValue] = useState(DEMO_SLIDER_DEFAULT_VALUE); | ||
const [defaultValue, setDefaultValue] = useState(DEMO_SLIDER_DEFAULT_VALUE); | ||
const [stepsValue, setStepsValue] = useState(DEMO_SLIDER_STEPS_VALUE); | ||
|
||
const handleChange = (event: ChangeEvent<HTMLInputElement>) => { | ||
setValue(Number(event.target.value)); | ||
const handleDefaultChange = (event: ChangeEvent<HTMLInputElement>) => { | ||
setDefaultValue(Number(event.target.value)); | ||
}; | ||
|
||
return <UNSTABLE_Slider id="slider-default" label="Slider" value={value} onChange={handleChange} />; | ||
const handleStepsChange = (event: ChangeEvent<HTMLInputElement>) => { | ||
setStepsValue(Number(event.target.value)); | ||
}; | ||
|
||
return ( | ||
<> | ||
<UNSTABLE_Slider id="slider-default" label="Slider" value={defaultValue} onChange={handleDefaultChange} /> | ||
<UNSTABLE_Slider | ||
id="slider-steps" | ||
label="Custom steps" | ||
max={10} | ||
value={stepsValue} | ||
onChange={handleStepsChange} | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default SliderDefault; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
packages/web-react/src/components/UNSTABLE_Slider/demo/SliderSelected.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.