@@ -33,6 +33,12 @@ c-10.663,0-17.467,1.853-20.417,5.568c-2.949,3.711-4.428,10.23-4.428,19.558v31.11
3333 </ svg >
3434) ;
3535
36+ const smallIconSVG = (
37+ < svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 20 20" height = "20" width = "20" >
38+ < path d = "m10 17-1.042-.938q-2.083-1.854-3.437-3.177-1.354-1.323-2.136-2.354Q2.604 9.5 2.302 8.646 2 7.792 2 6.896q0-1.854 1.271-3.125T6.396 2.5q1.021 0 1.979.438.958.437 1.625 1.229.667-.792 1.625-1.229.958-.438 1.979-.438 1.854 0 3.125 1.271T18 6.896q0 .896-.292 1.729-.291.833-1.073 1.854-.781 1.021-2.145 2.365-1.365 1.344-3.49 3.26Zm0-2.021q1.938-1.729 3.188-2.948 1.25-1.219 1.989-2.125.74-.906 1.031-1.614.292-.709.292-1.396 0-1.229-.833-2.063Q14.833 4 13.604 4q-.729 0-1.364.302-.636.302-1.094.844L10.417 6h-.834l-.729-.854q-.458-.542-1.114-.844Q7.083 4 6.396 4q-1.229 0-2.063.833-.833.834-.833 2.063 0 .687.271 1.364.271.678.989 1.573.719.896 1.98 2.125Q8 13.188 10 14.979Zm0-5.5Z" />
39+ </ svg >
40+ ) ;
41+
3642const opinionatedTheme = {
3743 chip : {
3844 baseColor : "#e6e6e6" ,
@@ -44,79 +50,33 @@ const opinionatedTheme = {
4450export const Chromatic = ( ) => (
4551 < >
4652 < ExampleContainer >
47- < Title title = "Default" theme = "light" level = { 4 } />
48- < DxcChip label = "Default" />
49- </ ExampleContainer >
50- < ExampleContainer >
51- < Title title = "With prefix (SVG)" theme = "light" level = { 4 } />
52- < DxcChip label = "Prefix" prefixIcon = { iconSVG } />
53+ < Title title = "Basic chip" theme = "light" level = { 4 } />
54+ < DxcChip label = "Default Chip" />
5355 </ ExampleContainer >
5456 < ExampleContainer >
55- < Title title = "With action prefix ( SVG)" theme = "light" level = { 4 } />
56- < DxcChip label = "Action prefix" prefixIcon = { iconSVG } onClickPrefix = { ( ) => { } } />
57+ < Title title = "Chip with prefix SVG (small icon )" theme = "light" level = { 4 } />
58+ < DxcChip label = "Chip with prefix" prefixIcon = { smallIconSVG } />
5759 </ ExampleContainer >
5860 < ExampleContainer >
59- < Title title = "Disabled action prefix ( SVG)" theme = "light" level = { 4 } />
60- < DxcChip label = "Disabled action prefix" prefixIcon = { iconSVG } onClickPrefix = { ( ) => { } } disabled />
61+ < Title title = "Chip with suffix SVG (large icon )" theme = "light" level = { 4 } />
62+ < DxcChip label = "Chip with suffix" suffixIcon = { iconSVG } />
6163 </ ExampleContainer >
6264 < ExampleContainer >
63- < Title title = "With suffix (Material icon)" theme = "light" level = { 4 } />
64- < DxcChip label = "Suffix" suffixIcon = "filled_check_circle" />
65- </ ExampleContainer >
66- < ExampleContainer >
67- < Title title = "With action suffix (Material icon)" theme = "light" level = { 4 } />
68- < DxcChip label = "Action suffix" suffixIcon = "filled_check_circle" onClickSuffix = { ( ) => { } } />
69- </ ExampleContainer >
70- < ExampleContainer >
71- < Title title = "Action prefix and suffix" theme = "light" level = { 4 } />
72- < DxcChip
73- label = "Action prefix and suffix"
74- prefixIcon = "filled_check_circle"
75- onClickPrefix = { ( ) => { } }
76- suffixIcon = { iconSVG }
77- />
65+ < Title title = "Chip with prefix (SVG) and suffix (URL)" theme = "light" level = { 4 } />
66+ < DxcChip label = "Chip with prefix and suffix" prefixIcon = { iconSVG } suffixIcon = "filled_check_circle" />
7867 </ ExampleContainer >
7968 < ExampleContainer >
80- < Title title = "Prefix and action suffix" theme = "light" level = { 4 } />
81- < DxcChip
82- label = "Prefix and action suffix"
83- prefixIcon = "filled_check_circle"
84- suffixIcon = { iconSVG }
85- onClickSuffix = { ( ) => { } }
86- />
87- </ ExampleContainer >
88- < ExampleContainer >
89- < Title title = "Disabled action suffix (Material icon)" theme = "light" level = { 4 } />
90- < DxcChip label = "Disabled action suffix" suffixIcon = "filled_check_circle" onClickSuffix = { ( ) => { } } disabled />
91- </ ExampleContainer >
92- < ExampleContainer >
93- < Title title = "Disabled action prefix and suffix" theme = "light" level = { 4 } />
94- < DxcChip
95- label = "Disabled action prefix"
96- disabled
97- prefixIcon = { iconSVG }
98- onClickPrefix = { ( ) => { } }
99- suffixIcon = "filled_check_circle"
100- />
101- </ ExampleContainer >
102- < ExampleContainer >
103- < Title title = "Prefix and disabled action suffix" theme = "light" level = { 4 } />
104- < DxcChip
105- label = "Disabled action suffix"
106- disabled
107- prefixIcon = { iconSVG }
108- suffixIcon = "filled_check_circle"
109- onClickSuffix = { ( ) => { } }
110- />
69+ < Title title = "Disabled chip" theme = "light" level = { 4 } />
70+ < DxcChip label = "Disabled" disabled prefixIcon = { iconSVG } suffixIcon = "filled_check_circle" />
11171 </ ExampleContainer >
11272 < ExampleContainer >
113- < Title title = "With ellipsis" theme = "light" level = { 4 } />
73+ < Title title = "Chip with ellipsis" theme = "light" level = { 4 } />
11474 < div style = { { width : "200px" } } >
11575 < DxcChip label = "With ellipsis asdfasdf asdf asdfasdf asdf asdfasdf asdfasdf asdf asdf adfasrfasf afsdg afgasfg asdf asdf asdf asdf asdf asdf asdf afdg asfg asdfg asdf asdf asdf asdfasdf asd fas df asd asdf asdf asdfasd fg ssssssssssss ssss" />
11676 </ div >
11777 </ ExampleContainer >
11878 < ExampleContainer >
119- < Title title = "With ellipsis and suffix" theme = "light" level = { 4 } />
79+ < Title title = "Chip with ellipsis and suffix" theme = "light" level = { 4 } />
12080 < div style = { { width : "200px" } } >
12181 < DxcChip
12282 suffixIcon = { iconSVG }
@@ -125,7 +85,7 @@ export const Chromatic = () => (
12585 </ div >
12686 </ ExampleContainer >
12787 < ExampleContainer >
128- < Title title = "With ellipsis and prefix" theme = "light" level = { 4 } />
88+ < Title title = "Chip with ellipsis and prefix" theme = "light" level = { 4 } />
12989 < div style = { { width : "200px" } } >
13090 < DxcChip
13191 prefixIcon = { iconSVG }
@@ -134,11 +94,10 @@ export const Chromatic = () => (
13494 </ div >
13595 </ ExampleContainer >
13696 < ExampleContainer >
137- < Title title = "With ellipsis, action prefix and suffix " theme = "light" level = { 4 } />
97+ < Title title = "Chip with ellipsis, suffix and prefix " theme = "light" level = { 4 } />
13898 < div style = { { width : "200px" } } >
13999 < DxcChip
140100 prefixIcon = { iconSVG }
141- onClickPrefix = { ( ) => { } }
142101 suffixIcon = { iconSVG }
143102 label = "With ellipsis asdfasdf asdf asdfasdf asdf asdfasdf asdfasdf asdf asdf adfasrfasf afsdg afgasfg asdf asdf asdf asdf asdf asdf asdf afdg asfg asdfg asdf asdf asdf asdfasdf asd fas df asd asdf asdf asdfasdf"
144103 />
@@ -175,48 +134,57 @@ export const Chromatic = () => (
175134 </ ExampleContainer >
176135 < Title title = "Opinionated theme" theme = "light" level = { 2 } />
177136 < ExampleContainer >
178- < Title title = "With prefix and suffix" theme = "light" level = { 4 } />
137+ < Title title = "Chip with prefix and suffix" theme = "light" level = { 4 } />
179138 < HalstackProvider theme = { opinionatedTheme } >
180- < DxcChip label = "Chip" prefixIcon = { iconSVG } onClickPrefix = { ( ) => { } } suffixIcon = "filled_check_circle" />
139+ < DxcChip label = "Chip" prefixIcon = { iconSVG } suffixIcon = "filled_check_circle" />
181140 </ HalstackProvider >
182141 </ ExampleContainer >
183142 < ExampleContainer >
184- < Title title = "With prefix and suffix" theme = "light" level = { 4 } />
143+ < Title title = "Chip with prefix and suffix" theme = "light" level = { 4 } />
185144 < HalstackProvider theme = { opinionatedTheme } >
186- < DxcChip
187- label = "Disabled"
188- disabled
189- prefixIcon = { iconSVG }
190- suffixIcon = "filled_check_circle"
191- onClickSuffix = { ( ) => { } }
192- />
145+ < DxcChip label = "Chip" disabled prefixIcon = { iconSVG } suffixIcon = "filled_check_circle" />
193146 </ HalstackProvider >
194147 </ ExampleContainer >
195148 < ExampleContainer pseudoState = "pseudo-hover" >
196149 < Title title = "Hovered" theme = "light" level = { 4 } />
197150 < HalstackProvider theme = { opinionatedTheme } >
198- < DxcChip label = "Chip" prefixIcon = { iconSVG } suffixIcon = { iconSVG } onClickPrefix = { ( ) => { } } />
151+ < DxcChip
152+ label = "Chip"
153+ prefixIcon = { iconSVG }
154+ suffixIcon = { iconSVG }
155+ onClickPrefix = { ( ) => { } }
156+ onClickSuffix = { ( ) => { } }
157+ />
199158 </ HalstackProvider >
200159 </ ExampleContainer >
201160 < ExampleContainer pseudoState = "pseudo-active" >
202161 < Title title = "Actived" theme = "light" level = { 4 } />
203162 < HalstackProvider theme = { opinionatedTheme } >
204- < DxcChip label = "Chip" prefixIcon = { iconSVG } suffixIcon = { iconSVG } onClickPrefix = { ( ) => { } } />
163+ < DxcChip
164+ label = "Chip"
165+ prefixIcon = { iconSVG }
166+ suffixIcon = { iconSVG }
167+ onClickPrefix = { ( ) => { } }
168+ onClickSuffix = { ( ) => { } }
169+ />
205170 </ HalstackProvider >
206171 </ ExampleContainer >
207172 </ >
208173) ;
209-
210174const ChipPrefixFocused = ( ) => (
211175 < ExampleContainer >
212- < Title title = "With prefix" theme = "light" level = { 4 } />
213- < DxcChip label = "Prefix" prefixIcon = { iconSVG } onClickPrefix = { ( ) => { } } />
176+ < Title title = "Chip with prefix" theme = "light" level = { 4 } />
177+ < DxcChip
178+ label = "Chip with prefix"
179+ prefixIcon = { iconSVG }
180+ onClickPrefix = { ( ) => { } }
181+ />
214182 </ ExampleContainer >
215183) ;
216184const ChipSuffixFocused = ( ) => (
217185 < ExampleContainer >
218- < Title title = "With suffix" theme = "light" level = { 4 } />
219- < DxcChip label = "Suffix " suffixIcon = "filled_delete" onClickSuffix = { ( ) => { } } />
186+ < Title title = "Chip with suffix" theme = "light" level = { 4 } />
187+ < DxcChip label = "Chip with suffix " suffixIcon = "filled_delete" onClickSuffix = { ( ) => { } } />
220188 </ ExampleContainer >
221189) ;
222190
0 commit comments