Skip to content

Commit 8098704

Browse files
author
Kubit
committed
Add new content to Modal on storybook
1 parent 677f41d commit 8098704

File tree

1 file changed

+115
-9
lines changed

1 file changed

+115
-9
lines changed

src/components/modalV2/stories/modal.stories.tsx

Lines changed: 115 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ import type { Meta, StoryObj } from '@storybook/react';
22
import React from 'react';
33

44
import { ICONS } from '@/assets';
5+
import { Button } from '@/components/button';
6+
import { Carousel, CarouselAlignType } from '@/components/carousel';
57
import { CssAnimationTimingFunction, CssAnimationVariants } from '@/components/cssAnimation';
68
import { FooterPositionType } from '@/components/footer';
79
import { ReplaceContent } from '@/components/storybook/replaceContent/replaceContent';
810
import { STYLES_NAME } from '@/constants';
911
import { themesObject, variantsObject } from '@/designSystem/themesObject';
12+
import { ROLES } from '@/types';
1013

1114
import { ModalControlled as Story } from '../modalControlled';
1215
import { argtypes } from './argtypes';
@@ -59,18 +62,121 @@ export const Modal: Story = {
5962
variant: Object.values(variantsObject[themeSelected].ModalVariantType || {})[0] as string,
6063
title: { content: 'Modal title' },
6164
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,
64154
closeIcon: { icon: ICONS.ICON_CLOSE },
155+
65156
footer: {
66157
variant: Object.values(variantsObject[themeSelected].FooterVariants || {})[0] as string,
67158
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>,
74180
],
75181
},
76182
popover: {
@@ -89,7 +195,7 @@ export const Modal: Story = {
89195
animationYEndPosition: '0px',
90196
animationXEndPosition: '0px',
91197
},
92-
focusFirstDescendantAutomatically: false,
198+
focusFirstDescendantAutomatically: true,
93199
},
94200
themeArgs: themesObject[themeSelected][STYLES_NAME.MODAL],
95201
},

0 commit comments

Comments
 (0)