File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
second-gen/packages/swc/components/status-light/stories Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,9 @@ export const Sizes: Story = {
157157 CONTAINER (
158158 StatusLight . VALID_SIZES . map (
159159 ( size : StatusLightSize ) => html `
160- < swc-status-light size ="${ size } "> ${ size } </ swc-status-light >
160+ < swc-status-light size ="${ size } "
161+ > ${ sizeMap ( size ) } </ swc-status-light
162+ >
161163 `
162164 )
163165 ) ,
@@ -176,6 +178,23 @@ function capitalize(str?: string): string {
176178 return str . charAt ( 0 ) . toUpperCase ( ) + str . slice ( 1 ) ;
177179}
178180
181+ /* @todo Pull this up into a utility function for more components to leverage. Are all sizes accounted for? */
182+ function sizeMap ( str ?: StatusLightSize ) : string {
183+ const sizeLabels = {
184+ labels : {
185+ xxs : 'Extra-extra-small' ,
186+ xs : 'Extra-small' ,
187+ s : 'Small' ,
188+ m : 'Medium' ,
189+ l : 'Large' ,
190+ xl : 'Extra-large' ,
191+ xxl : 'Extra-extra-large' ,
192+ } ,
193+ } ;
194+
195+ return str ? sizeLabels . labels [ str ] : '' ;
196+ }
197+
179198/* @todo Pull this up into a decorator for all stories to leverage */
180199function CONTAINER ( content : TemplateResult < 1 > [ ] ) : TemplateResult {
181200 return html `< div
You can’t perform that action at this time.
0 commit comments