@@ -2,11 +2,14 @@ import type { Meta, StoryObj } from '@storybook/react';
2
2
import React from 'react' ;
3
3
4
4
import { ICONS } from '@/assets' ;
5
+ import { Button } from '@/components/button' ;
6
+ import { Carousel , CarouselAlignType } from '@/components/carousel' ;
5
7
import { CssAnimationTimingFunction , CssAnimationVariants } from '@/components/cssAnimation' ;
6
8
import { FooterPositionType } from '@/components/footer' ;
7
9
import { ReplaceContent } from '@/components/storybook/replaceContent/replaceContent' ;
8
10
import { STYLES_NAME } from '@/constants' ;
9
11
import { themesObject , variantsObject } from '@/designSystem/themesObject' ;
12
+ import { ROLES } from '@/types' ;
10
13
11
14
import { ModalControlled as Story } from '../modalControlled' ;
12
15
import { argtypes } from './argtypes' ;
@@ -59,18 +62,121 @@ export const Modal: Story = {
59
62
variant : Object . values ( variantsObject [ themeSelected ] . ModalVariantType || { } ) [ 0 ] as string ,
60
63
title : { content : 'Modal title' } ,
61
64
dataTestId : 'modal' ,
62
- content : < ReplaceContent /> ,
63
- open : true ,
65
+ content : (
66
+ < Carousel
67
+ allowModifySliceWidth = { true }
68
+ centerMode = { false }
69
+ circular = { false }
70
+ disableSwipe = { false }
71
+ displayArrowsOnCarousel = { false }
72
+ elements = { [
73
+ < ReplaceContent
74
+ key = { 0 }
75
+ aria-label = "1 of 10"
76
+ aria-roledescription = "slide"
77
+ id = "carousel-item-1"
78
+ role = { ROLES . GROUP }
79
+ >
80
+ First Slide
81
+ </ ReplaceContent > ,
82
+ < ReplaceContent
83
+ key = { 1 }
84
+ aria-label = "2 of 10"
85
+ aria-roledescription = "slide"
86
+ id = "carousel-item-2"
87
+ role = { ROLES . GROUP }
88
+ >
89
+ Second Slide
90
+ </ ReplaceContent > ,
91
+ < ReplaceContent
92
+ key = { 2 }
93
+ aria-label = "3 of 10"
94
+ aria-roledescription = "slide"
95
+ id = "carousel-item-3"
96
+ role = { ROLES . GROUP }
97
+ >
98
+ Third Slide
99
+ </ ReplaceContent > ,
100
+ < ReplaceContent
101
+ key = { 3 }
102
+ aria-label = "4 of 10"
103
+ aria-roledescription = "slide"
104
+ id = "carousel-item-4"
105
+ role = { ROLES . GROUP }
106
+ >
107
+ Fourth Slide
108
+ </ ReplaceContent > ,
109
+ < ReplaceContent
110
+ key = { 4 }
111
+ aria-label = "5 of 10"
112
+ aria-roledescription = "slide"
113
+ id = "carousel-item-5"
114
+ role = { ROLES . GROUP }
115
+ >
116
+ Fifth Slice
117
+ </ ReplaceContent > ,
118
+ < ReplaceContent
119
+ key = { 5 }
120
+ aria-label = "6 of 10"
121
+ aria-roledescription = "slide"
122
+ id = "carousel-item-6"
123
+ role = { ROLES . GROUP }
124
+ >
125
+ Sixth Slide
126
+ </ ReplaceContent > ,
127
+ ] }
128
+ extraPadding = { 0 }
129
+ extraPaddingAsArrow = { true }
130
+ hasPagination = { true }
131
+ leftArrow = { {
132
+ icon : ICONS . ICON_CHEVRON_LEFT ,
133
+ [ 'aria-label' ] : 'Left arrow aria label' ,
134
+ } }
135
+ numElementsPerPage = { 3 }
136
+ numElementsToSlide = { 3 }
137
+ onePageAlign = { CarouselAlignType . CENTER }
138
+ pageControlArrowsControlVariant = {
139
+ Object . values ( variantsObject [ themeSelected ] . ArrowsControlVariant || { } ) [ 0 ] as string
140
+ }
141
+ pageControlVariant = {
142
+ Object . values ( variantsObject [ themeSelected ] . PageControlVariant || { } ) [ 0 ] as string
143
+ }
144
+ rightArrow = { {
145
+ icon : ICONS . ICON_CHEVRON_RIGHT ,
146
+ [ 'aria-label' ] : 'Right arrow aria label' ,
147
+ } }
148
+ variant = {
149
+ Object . values ( variantsObject [ themeSelected ] . CarouselVariantType || { } ) [ 0 ] as string
150
+ }
151
+ />
152
+ ) ,
153
+ // open: true,
64
154
closeIcon : { icon : ICONS . ICON_CLOSE } ,
155
+
65
156
footer : {
66
157
variant : Object . values ( variantsObject [ themeSelected ] . FooterVariants || { } ) [ 0 ] as string ,
67
158
content : [
68
- < ReplaceContent key = { 0 } data-position = { FooterPositionType . LEFT } width = { '100%' } >
69
- Footer content
70
- </ ReplaceContent > ,
71
- < ReplaceContent key = { 0 } data-position = { FooterPositionType . RIGHT } width = { '100%' } >
72
- Footer content
73
- </ ReplaceContent > ,
159
+ < Button
160
+ key = { 0 }
161
+ disabled
162
+ data-position = { FooterPositionType . LEFT }
163
+ size = { Object . values ( variantsObject [ themeSelected ] . ButtonSizeType || { } ) [ 0 ] as string }
164
+ variant = {
165
+ Object . values ( variantsObject [ themeSelected ] . ButtonVariantType || { } ) [ 0 ] as string
166
+ }
167
+ >
168
+ { 'Button' }
169
+ </ Button > ,
170
+ < Button
171
+ key = { 1 }
172
+ data-position = { FooterPositionType . RIGHT }
173
+ size = { Object . values ( variantsObject [ themeSelected ] . ButtonSizeType || { } ) [ 0 ] as string }
174
+ variant = {
175
+ Object . values ( variantsObject [ themeSelected ] . ButtonVariantType || { } ) [ 0 ] as string
176
+ }
177
+ >
178
+ { 'Button' }
179
+ </ Button > ,
74
180
] ,
75
181
} ,
76
182
popover : {
@@ -89,7 +195,7 @@ export const Modal: Story = {
89
195
animationYEndPosition : '0px' ,
90
196
animationXEndPosition : '0px' ,
91
197
} ,
92
- focusFirstDescendantAutomatically : false ,
198
+ focusFirstDescendantAutomatically : true ,
93
199
} ,
94
200
themeArgs : themesObject [ themeSelected ] [ STYLES_NAME . MODAL ] ,
95
201
} ,
0 commit comments