@@ -20,45 +20,44 @@ const DefaultTemplate: StoryFn<ExtendedFeaturesBlockModel> = (args) => {
2020 ) ;
2121} ;
2222
23- const ColSizesTemplate : StoryFn < Record < number , ExtendedFeaturesBlockModel > > = ( args ) => (
23+ const ColSizesTemplate : StoryFn < Record < string , ExtendedFeaturesBlockModel > > = ( args ) => (
2424 < div style = { { padding : '64px' , display : 'flex' , flexDirection : 'column' , gap : 20 } } >
25- { Object . values ( args ) . map ( ( itemArgs , index ) => {
26- const transformed = blockTransform ( itemArgs ) as ExtendedFeaturesProps ;
27- return < ExtendedFeaturesBlock key = { index } { ...transformed } /> ;
28- } ) }
25+ { Object . entries ( args )
26+ . map ( ( [ key , item ] ) => {
27+ const transformed = blockTransform ( item ) as ExtendedFeaturesProps ;
28+ return < ExtendedFeaturesBlock key = { key } { ...transformed } /> ;
29+ } )
30+ . filter ( Boolean ) }
2931 </ div >
3032) ;
3133
3234export const Default = DefaultTemplate . bind ( { } ) ;
3335export const WithLabel = DefaultTemplate . bind ( { } ) ;
3436export const ColSizes = ColSizesTemplate . bind ( { } ) ;
3537
36- const DEFAULT_BLOCK = data . default . content as unknown as ExtendedFeaturesBlockModel ;
38+ Default . args = data . default . content as ExtendedFeaturesBlockModel ;
3739
38- const WITH_LABEL_BLOCK = {
40+ WithLabel . args = {
3941 ...data . default . content ,
4042 items : data . withLabel ?. content ?. items ,
41- } as unknown as ExtendedFeaturesBlockModel ;
43+ } as ExtendedFeaturesBlockModel ;
4244
43- const COL_SIZES : Record < number , ExtendedFeaturesBlockModel > = {
44- 0 : {
45+ const COL_SIZES : Record < string , ExtendedFeaturesBlockModel > = {
46+ four_columns : {
4547 ...data . default . content ,
4648 ...data . colSizes ?. four ,
47- } as unknown as ExtendedFeaturesBlockModel ,
48- 1 : {
49+ } as ExtendedFeaturesBlockModel ,
50+ three_columns : {
4951 ...data . default . content ,
5052 ...data . colSizes ?. three ,
51- } as unknown as ExtendedFeaturesBlockModel ,
52- 2 : {
53+ } as ExtendedFeaturesBlockModel ,
54+ two_columns : {
5355 ...data . default . content ,
5456 ...data . colSizes ?. two ,
55- } as unknown as ExtendedFeaturesBlockModel ,
57+ } as ExtendedFeaturesBlockModel ,
5658} ;
5759
58- Default . args = DEFAULT_BLOCK ;
59- WithLabel . args = WITH_LABEL_BLOCK ;
6060ColSizes . args = COL_SIZES ;
61-
6261ColSizes . parameters = {
6362 controls : {
6463 include : Object . keys ( COL_SIZES ) ,
0 commit comments