@@ -5,18 +5,57 @@ import type { Meta, StoryObj } from '@storybook/web-components';
55import { spread } from '../../../storyhelpers' ;
66import { repeat } from 'lit/directives/repeat.js' ;
77
8- const swatchesColor = [
8+ const swatches = [
99 { label : 'Blood Orange' , value : '#d0021b' } ,
1010 { label : 'Avocado' , value : '#417505' } ,
1111 { label : 'Tufts Blue' , value : '#4a90e2' } ,
1212] ;
1313
14+ const gradients = [
15+ {
16+ label : 'Vital Ocean' ,
17+ value : 'ocean' ,
18+ color :
19+ 'linear-gradient(90deg,rgba(2, 0, 36, 1) 0%, rgba(9, 9, 121, 1) 35%, rgba(0, 212, 255, 1) 100%)' ,
20+ } ,
21+ {
22+ label : 'Disco Club' ,
23+ value : 'avocado' ,
24+ color :
25+ 'radial-gradient(circle,rgba(63, 94, 251, 1) 0%, rgba(252, 70, 107, 1) 100%)' ,
26+ } ,
27+ {
28+ label : 'Deep Sunset' ,
29+ value : 'sunset' ,
30+ color :
31+ 'linear-gradient(90deg,rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%)' ,
32+ } ,
33+ {
34+ label : 'Bubble Gum' ,
35+ value : 'gum' ,
36+ color :
37+ 'radial-gradient(circle,rgba(238, 174, 202, 1) 0%, rgba(148, 187, 233, 1) 100%)' ,
38+ } ,
39+ {
40+ label : 'Blue Lagoon' ,
41+ value : 'lagoon' ,
42+ color :
43+ 'linear-gradient(90deg,rgba(67, 198, 172, 1) 0%, rgba(25, 22, 84, 1) 100%)' ,
44+ } ,
45+ {
46+ label : 'Lemon Twist' ,
47+ value : 'lemon-twist' ,
48+ color :
49+ 'linear-gradient(90deg,rgba(60, 165, 92, 1) 0%, rgba(181, 172, 73, 1) 100%)' ,
50+ } ,
51+ ] ;
52+
1453const meta : Meta = {
1554 id : 'uui-color-swatches' ,
1655 component : 'uui-color-swatches' ,
1756 title : 'Inputs/Color/Color Swatches' ,
1857 args : {
19- swatches : swatchesColor ,
58+ swatches : swatches ,
2059 } ,
2160 argTypes : {
2261 value : { control : { type : 'color' } } ,
@@ -26,14 +65,17 @@ const meta: Meta = {
2665 render : ( args : any ) => html `
2766< uui-color-swatches
2867 ${ spread ( args , [ 'swatches' , 'showLabel' ] ) }
29- label ="My color pallette "> ${ repeat ( args . swatches , ( swatch : any ) => {
68+ label ="My color palette "> ${ repeat ( args . swatches , ( swatch : any ) => {
3069 const label = typeof swatch === 'string' ? swatch : swatch . label ;
3170 const value = typeof swatch === 'string' ? swatch : swatch . value ;
71+ const color = typeof swatch === 'string' ? swatch : swatch . color ;
3272 return html `
3373 < uui-color-swatch
3474 label ="${ label } "
3575 .showLabel =${ args . showLabel }
36- .value =${ value } > </ uui-color-swatch > ` ;
76+ .color ="${ color } "
77+ .value=${ value } >
78+ </ uui-color-swatch > ` ;
3779 } ) }
3880</ uui-color-swatches >
3981 ` ,
@@ -72,3 +114,11 @@ export const ShowLabel: Story = {
72114 showLabel : true ,
73115 } ,
74116} ;
117+
118+ export const Gradient : Story = {
119+ args : {
120+ swatches : gradients ,
121+ showLabel : true ,
122+ value : 'lemon-twist' ,
123+ } ,
124+ } ;
0 commit comments