@@ -5,18 +5,57 @@ import type { Meta, StoryObj } from '@storybook/web-components';
5
5
import { spread } from '../../../storyhelpers' ;
6
6
import { repeat } from 'lit/directives/repeat.js' ;
7
7
8
- const swatchesColor = [
8
+ const swatches = [
9
9
{ label : 'Blood Orange' , value : '#d0021b' } ,
10
10
{ label : 'Avocado' , value : '#417505' } ,
11
11
{ label : 'Tufts Blue' , value : '#4a90e2' } ,
12
12
] ;
13
13
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
+
14
53
const meta : Meta = {
15
54
id : 'uui-color-swatches' ,
16
55
component : 'uui-color-swatches' ,
17
56
title : 'Inputs/Color/Color Swatches' ,
18
57
args : {
19
- swatches : swatchesColor ,
58
+ swatches : swatches ,
20
59
} ,
21
60
argTypes : {
22
61
value : { control : { type : 'color' } } ,
@@ -26,14 +65,17 @@ const meta: Meta = {
26
65
render : ( args : any ) => html `
27
66
< uui-color-swatches
28
67
${ spread ( args , [ 'swatches' , 'showLabel' ] ) }
29
- label ="My color pallette "> ${ repeat ( args . swatches , ( swatch : any ) => {
68
+ label ="My color palette "> ${ repeat ( args . swatches , ( swatch : any ) => {
30
69
const label = typeof swatch === 'string' ? swatch : swatch . label ;
31
70
const value = typeof swatch === 'string' ? swatch : swatch . value ;
71
+ const color = typeof swatch === 'string' ? swatch : swatch . color ;
32
72
return html `
33
73
< uui-color-swatch
34
74
label ="${ label } "
35
75
.showLabel =${ args . showLabel }
36
- .value =${ value } > </ uui-color-swatch > ` ;
76
+ .color ="${ color } "
77
+ .value=${ value } >
78
+ </ uui-color-swatch > ` ;
37
79
} ) }
38
80
</ uui-color-swatches >
39
81
` ,
@@ -72,3 +114,11 @@ export const ShowLabel: Story = {
72
114
showLabel : true ,
73
115
} ,
74
116
} ;
117
+
118
+ export const Gradient : Story = {
119
+ args : {
120
+ swatches : gradients ,
121
+ showLabel : true ,
122
+ value : 'lemon-twist' ,
123
+ } ,
124
+ } ;
0 commit comments