@@ -19,18 +19,20 @@ export default {
1919 component : "ColorSlider" ,
2020 argTypes : {
2121 colorHandleStyle : { table : { disable : true } } ,
22- vertical : { table : { disable : true } } ,
2322 isDisabled,
2423 isFocused : {
2524 ...isFocused ,
2625 if : { arg : "isDisabled" , truthy : false } ,
2726 } ,
28- gradientStops : {
29- name : "Gradient stops " ,
27+ color : {
28+ name : "Color " ,
3029 description :
31- "The <linear-color-stop> value of the CSS linear-gradient. Can be multiple stops separated by commas." ,
32- type : { name : "array" } ,
33- table : { disable : true } ,
30+ "Supports standard color input or any valid input for the <code>background</code> property such as, <code>linear-gradient(red, blue)</code>." ,
31+ type : { name : "string" , required : true } ,
32+ table : {
33+ type : { summary : "string" } ,
34+ } ,
35+ control : "color" ,
3436 } ,
3537 selectedColor : {
3638 name : "Selected color" ,
@@ -40,12 +42,19 @@ export default {
4042 control : "color" ,
4143 } ,
4244 gradientType : {
43- name : "Gradient type" ,
44- description : "The gradient can be defined in the markup using CSS or with an image." ,
45- options : [ "gradient" , "image" ] ,
45+ name : "Color type" ,
46+ description :
47+ "The color can be defined in the markup using CSS or with an image." ,
48+ options : [ "color" , "image" ] ,
4649 control : { type : "select" } ,
4750 table : { disable : true } ,
4851 } ,
52+ vertical : {
53+ name : "Vertical" ,
54+ description : "The orientation of the component." ,
55+ type : { name : "boolean" } ,
56+ control : "boolean" ,
57+ } ,
4958 } ,
5059 args : {
5160 rootClass : "spectrum-ColorSlider" ,
@@ -70,8 +79,8 @@ export default {
7079 */
7180export const Default = ColorSliderGroup . bind ( { } ) ;
7281Default . args = {
73- gradientStops :
74- [ " rgb(255, 0, 0) 0%" , " rgb(255, 255, 0) 17%" , " rgb(0, 255, 0) 33%" , " rgb(0, 255, 255) 50%" , " rgb(0, 0, 255) 67%" , " rgb(255, 0, 255) 83%" , " rgb(255, 0, 0) 100%" ] ,
82+ color :
83+ "linear-gradient(to right, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)" ,
7584} ;
7685
7786// ********* VRT ONLY ********* //
@@ -81,7 +90,7 @@ WithForcedColors.tags = ["!autodocs", "!dev"];
8190WithForcedColors . parameters = {
8291 chromatic : {
8392 forcedColors : "active" ,
84- modes : disableDefaultModes
93+ modes : disableDefaultModes ,
8594 } ,
8695} ;
8796
@@ -92,6 +101,8 @@ WithForcedColors.parameters = {
92101export const Vertical = Template . bind ( { } ) ;
93102Vertical . args = {
94103 vertical : true ,
104+ color :
105+ "linear-gradient(to bottom, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)" ,
95106} ;
96107Vertical . tags = [ "!dev" ] ;
97108Vertical . parameters = {
@@ -100,7 +111,7 @@ Vertical.parameters = {
100111
101112export const Alpha = Template . bind ( { } ) ;
102113Alpha . args = {
103- gradientStops : [ " rgba(0, 0, 0, 1) 0%" , " rgba(0, 0, 0, 0) 100%" ] ,
114+ color : "linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%)" ,
104115 selectedColor : "rgba(0, 0, 0, 1)" ,
105116} ;
106117Alpha . tags = [ "!dev" ] ;
0 commit comments