@vibe/core 4.2.5 → 4.3.0-alpha-9bd83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/metadata/accessibility/Accordion.md +10 -0
- package/dist/metadata/accessibility/AlertBanner.md +9 -0
- package/dist/metadata/accessibility/Avatar.md +12 -0
- package/dist/metadata/accessibility/AvatarGroup.md +6 -0
- package/dist/metadata/accessibility/BreadcrumbsBar.md +10 -0
- package/dist/metadata/accessibility/Button.md +13 -0
- package/dist/metadata/accessibility/ButtonGroup.md +9 -0
- package/dist/metadata/accessibility/Checkbox.md +13 -0
- package/dist/metadata/accessibility/Chips.md +10 -0
- package/dist/metadata/accessibility/Combobox.md +6 -0
- package/dist/metadata/accessibility/DropdownBasicDropdown.md +10 -0
- package/dist/metadata/accessibility/IconButton.md +26 -0
- package/dist/metadata/accessibility/Info.md +12 -0
- package/dist/metadata/accessibility/Link.md +8 -0
- package/dist/metadata/accessibility/List.md +11 -0
- package/dist/metadata/accessibility/Menu.md +10 -0
- package/dist/metadata/accessibility/MenuButton.md +6 -0
- package/dist/metadata/accessibility/MenuItem.md +8 -0
- package/dist/metadata/accessibility/Modal.md +35 -0
- package/dist/metadata/accessibility/NumberField.md +9 -0
- package/dist/metadata/accessibility/RadioButton.md +11 -0
- package/dist/metadata/accessibility/Search.md +10 -0
- package/dist/metadata/accessibility/Tabs.md +10 -0
- package/dist/metadata/accessibility/TextArea.md +17 -0
- package/dist/metadata/accessibility/TextField.md +16 -0
- package/dist/metadata/accessibility/Toast.md +4 -0
- package/dist/metadata/accessibility/Toggle.md +7 -0
- package/dist/metadata/accessibility/Tooltip.md +11 -0
- package/dist/metadata/components.json +20940 -0
- package/dist/metadata/examples/Accordion.md +136 -0
- package/dist/metadata/examples/AlertBanner.md +85 -0
- package/dist/metadata/examples/AttentionBox.md +267 -0
- package/dist/metadata/examples/Avatar.md +118 -0
- package/dist/metadata/examples/AvatarGroup.md +390 -0
- package/dist/metadata/examples/Badge.md +59 -0
- package/dist/metadata/examples/BaseInput.md +2 -0
- package/dist/metadata/examples/BaseList.md +342 -0
- package/dist/metadata/examples/Box.md +208 -0
- package/dist/metadata/examples/BreadcrumbItem.md +54 -0
- package/dist/metadata/examples/BreadcrumbsBar.md +64 -0
- package/dist/metadata/examples/Button.md +174 -0
- package/dist/metadata/examples/ButtonGroup.md +180 -0
- package/dist/metadata/examples/Checkbox.md +24 -0
- package/dist/metadata/examples/Chips.md +192 -0
- package/dist/metadata/examples/Clickable.md +31 -0
- package/dist/metadata/examples/ColorPicker.md +2 -0
- package/dist/metadata/examples/Combobox.md +438 -0
- package/dist/metadata/examples/Counter.md +188 -0
- package/dist/metadata/examples/DatePicker.md +43 -0
- package/dist/metadata/examples/Dialog.md +521 -0
- package/dist/metadata/examples/DialogContentContainer.md +18 -0
- package/dist/metadata/examples/Divider.md +50 -0
- package/dist/metadata/examples/DropdownBasicDropdown.md +479 -0
- package/dist/metadata/examples/DropdownBoxMode.md +218 -0
- package/dist/metadata/examples/EditableHeading.md +33 -0
- package/dist/metadata/examples/EditableText.md +36 -0
- package/dist/metadata/examples/EmptyState.md +192 -0
- package/dist/metadata/examples/ExpandCollapse.md +77 -0
- package/dist/metadata/examples/Flex.md +916 -0
- package/dist/metadata/examples/Heading.md +124 -0
- package/dist/metadata/examples/HiddenText.md +8 -0
- package/dist/metadata/examples/Icon.md +67 -0
- package/dist/metadata/examples/IconButton.md +141 -0
- package/dist/metadata/examples/Info.md +80 -0
- package/dist/metadata/examples/Label.md +109 -0
- package/dist/metadata/examples/Link.md +52 -0
- package/dist/metadata/examples/List.md +125 -0
- package/dist/metadata/examples/ListItem.md +42 -0
- package/dist/metadata/examples/Loader.md +148 -0
- package/dist/metadata/examples/Menu.md +141 -0
- package/dist/metadata/examples/MenuButton.md +127 -0
- package/dist/metadata/examples/MenuDivider.md +35 -0
- package/dist/metadata/examples/MenuGridItem.md +65 -0
- package/dist/metadata/examples/MenuItem.md +98 -0
- package/dist/metadata/examples/MenuItemButton.md +42 -0
- package/dist/metadata/examples/MenuTitle.md +25 -0
- package/dist/metadata/examples/ModalBasicLayout.md +400 -0
- package/dist/metadata/examples/ModalMediaLayout.md +240 -0
- package/dist/metadata/examples/ModalSideBySideLayout.md +313 -0
- package/dist/metadata/examples/MultiStepIndicator.md +189 -0
- package/dist/metadata/examples/NumberField.md +68 -0
- package/dist/metadata/examples/ProgressBar.md +152 -0
- package/dist/metadata/examples/RadioButton.md +41 -0
- package/dist/metadata/examples/Search.md +24 -0
- package/dist/metadata/examples/Skeleton.md +161 -0
- package/dist/metadata/examples/Slider.md +109 -0
- package/dist/metadata/examples/SplitButton.md +120 -0
- package/dist/metadata/examples/Steps.md +106 -0
- package/dist/metadata/examples/Table.md +449 -0
- package/dist/metadata/examples/Tabs.md +241 -0
- package/dist/metadata/examples/Text.md +188 -0
- package/dist/metadata/examples/TextArea.md +28 -0
- package/dist/metadata/examples/TextField.md +119 -0
- package/dist/metadata/examples/TextWithHighlight.md +2 -0
- package/dist/metadata/examples/ThemeProvider.md +47 -0
- package/dist/metadata/examples/Tipseen.md +111 -0
- package/dist/metadata/examples/Toast.md +127 -0
- package/dist/metadata/examples/Toggle.md +38 -0
- package/dist/metadata/examples/Tooltip.md +53 -0
- package/dist/metadata/examples/VirtualizedGrid.md +54 -0
- package/dist/metadata/examples/VirtualizedList.md +50 -0
- package/dist/metadata/examples/useGridKeyboardNavigationContext.md +61 -0
- package/dist/mocked_classnames/scripts/build-all-metadata.d.ts +1 -0
- package/dist/mocked_classnames/scripts/extract-accessibility.d.ts +4 -0
- package/dist/mocked_classnames/scripts/extract-examples.d.ts +3 -0
- package/dist/scripts/build-all-metadata.d.ts +1 -0
- package/dist/scripts/extract-accessibility.d.ts +4 -0
- package/dist/scripts/extract-examples.d.ts +3 -0
- package/package.json +12 -10
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
# Storybook Code Examples
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
return <Modal id="modal-media" show={show} size="medium" onClose={() => setShow(false)} container={container} {...args}>
|
|
7
|
+
<ModalMediaLayout>
|
|
8
|
+
<ModalMedia>
|
|
9
|
+
<img src={mediaImage} alt="media placeholder" style={{
|
|
10
|
+
width: "100%",
|
|
11
|
+
objectFit: "cover"
|
|
12
|
+
}} />
|
|
13
|
+
</ModalMedia>
|
|
14
|
+
<ModalHeader title="Modal title" />
|
|
15
|
+
<ModalContent>
|
|
16
|
+
<Text type="text1" align="inherit" element="p">
|
|
17
|
+
The media modal is ideal for introducing new features or onboarding, the user can also{" "}
|
|
18
|
+
<Link inheritFontSize inlineText text="add a link" />.
|
|
19
|
+
</Text>
|
|
20
|
+
</ModalContent>
|
|
21
|
+
</ModalMediaLayout>
|
|
22
|
+
<ModalFooter primaryButton={{
|
|
23
|
+
text: "Confirm",
|
|
24
|
+
onClick: () => setShow(false)
|
|
25
|
+
}} secondaryButton={{
|
|
26
|
+
text: "Cancel",
|
|
27
|
+
onClick: () => setShow(false)
|
|
28
|
+
}} />
|
|
29
|
+
</Modal>;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Wizard
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
const steps = [<ModalMediaLayout>
|
|
36
|
+
<ModalMedia>
|
|
37
|
+
<img src={mediaImage} alt="media placeholder" style={{
|
|
38
|
+
width: "100%",
|
|
39
|
+
objectFit: "cover"
|
|
40
|
+
}} />
|
|
41
|
+
</ModalMedia>
|
|
42
|
+
<ModalHeader title="Modal with wizard" />
|
|
43
|
+
<ModalContent>
|
|
44
|
+
<Text type="text1" align="inherit" element="p">
|
|
45
|
+
We have made some changes to our modal component. Keep reading to see what improvements we made.
|
|
46
|
+
</Text>
|
|
47
|
+
</ModalContent>
|
|
48
|
+
</ModalMediaLayout>, <ModalMediaLayout>
|
|
49
|
+
<ModalMedia>
|
|
50
|
+
<img src={mediaImage} alt="media placeholder" style={{
|
|
51
|
+
width: "100%",
|
|
52
|
+
objectFit: "cover"
|
|
53
|
+
}} />
|
|
54
|
+
</ModalMedia>
|
|
55
|
+
<ModalHeader title="Modal with wizard" />
|
|
56
|
+
<ModalContent>
|
|
57
|
+
<Text type="text1" align="inherit" element="p">
|
|
58
|
+
Now the modal can also allow wizard process, when including stepper in the modal footer, it also contain an
|
|
59
|
+
animation.
|
|
60
|
+
</Text>
|
|
61
|
+
</ModalContent>
|
|
62
|
+
</ModalMediaLayout>];
|
|
63
|
+
const {
|
|
64
|
+
activeStep,
|
|
65
|
+
direction,
|
|
66
|
+
next,
|
|
67
|
+
back,
|
|
68
|
+
isFirstStep,
|
|
69
|
+
isLastStep,
|
|
70
|
+
goToStep
|
|
71
|
+
} = useWizard({
|
|
72
|
+
stepCount: steps.length
|
|
73
|
+
});
|
|
74
|
+
const primaryButtonText = isLastStep ? "Confirm" : "Next";
|
|
75
|
+
return <Modal id="modal-media" show={show} size="medium" onClose={() => setShow(false)} container={container}>
|
|
76
|
+
<TransitionView activeStep={activeStep} direction={direction}>
|
|
77
|
+
{steps}
|
|
78
|
+
</TransitionView>
|
|
79
|
+
<ModalFooterWizard activeStep={activeStep} stepCount={steps.length} onStepClick={goToStep} primaryButton={{
|
|
80
|
+
text: primaryButtonText,
|
|
81
|
+
onClick: next
|
|
82
|
+
}} secondaryButton={{
|
|
83
|
+
text: "Back",
|
|
84
|
+
onClick: back,
|
|
85
|
+
disabled: isFirstStep
|
|
86
|
+
}} />
|
|
87
|
+
</Modal>;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Announcement
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
return <Modal id="modal-media" show={show} size="medium" onClose={() => setShow(false)} container={container}>
|
|
94
|
+
<ModalMediaLayout>
|
|
95
|
+
<ModalMedia>
|
|
96
|
+
<img src={mediaImage} alt="media placeholder" style={{
|
|
97
|
+
width: "100%",
|
|
98
|
+
objectFit: "cover"
|
|
99
|
+
}} />
|
|
100
|
+
</ModalMedia>
|
|
101
|
+
<ModalHeader title="Meet our new feature" />
|
|
102
|
+
<ModalContent>
|
|
103
|
+
<Text type="text1" align="inherit" element="p">
|
|
104
|
+
Introducing our latest feature designed to make your workflow faster and easier. For more details{" "}
|
|
105
|
+
<Link inheritFontSize inlineText text="click here" />.
|
|
106
|
+
</Text>
|
|
107
|
+
</ModalContent>
|
|
108
|
+
</ModalMediaLayout>
|
|
109
|
+
<ModalFooter primaryButton={{
|
|
110
|
+
text: "Got it",
|
|
111
|
+
onClick: () => setShow(false)
|
|
112
|
+
}} secondaryButton={{
|
|
113
|
+
text: "Dismiss",
|
|
114
|
+
onClick: () => setShow(false)
|
|
115
|
+
}} />
|
|
116
|
+
</Modal>;
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## HeaderWithIconButton
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
return <Modal id="modal-media" show={show} renderHeaderAction={<IconButton icon={Menu} size="small" kind="tertiary" aria-label="Open Menu" />} size="medium" onClose={() => setShow(false)} container={container}>
|
|
123
|
+
<ModalMediaLayout>
|
|
124
|
+
<ModalMedia>
|
|
125
|
+
<img src={mediaImage} alt="media placeholder" style={{
|
|
126
|
+
width: "100%",
|
|
127
|
+
objectFit: "cover"
|
|
128
|
+
}} />
|
|
129
|
+
</ModalMedia>
|
|
130
|
+
<ModalHeader title="Modal title" />
|
|
131
|
+
<ModalContent>
|
|
132
|
+
<Text type="text1" align="inherit" element="p">
|
|
133
|
+
The media modal is ideal for introducing new features or onboarding, the user can also{" "}
|
|
134
|
+
<Link inheritFontSize inlineText text="add a link" />.
|
|
135
|
+
</Text>
|
|
136
|
+
</ModalContent>
|
|
137
|
+
</ModalMediaLayout>
|
|
138
|
+
<ModalFooter primaryButton={{
|
|
139
|
+
text: "Confirm",
|
|
140
|
+
onClick: () => setShow(false)
|
|
141
|
+
}} secondaryButton={{
|
|
142
|
+
text: "Cancel",
|
|
143
|
+
onClick: () => setShow(false)
|
|
144
|
+
}} />
|
|
145
|
+
</Modal>;
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Animation
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
const [showCenterPop, setShowCenterPop] = useState(false);
|
|
152
|
+
const [showTransition, setShowTransition] = useState(false);
|
|
153
|
+
const transitionSteps = [<ModalMediaLayout>
|
|
154
|
+
<ModalMedia>
|
|
155
|
+
<img src={mediaImage} alt="media placeholder" style={{
|
|
156
|
+
width: "100%",
|
|
157
|
+
objectFit: "cover"
|
|
158
|
+
}} />
|
|
159
|
+
</ModalMedia>
|
|
160
|
+
<ModalHeader title="Modal with wizard" />
|
|
161
|
+
<ModalContent>
|
|
162
|
+
<Text type="text1" align="inherit" element="p">
|
|
163
|
+
We have made some changes to our modal component. Keep reading to see what improvements we made.
|
|
164
|
+
</Text>
|
|
165
|
+
</ModalContent>
|
|
166
|
+
</ModalMediaLayout>, <ModalMediaLayout>
|
|
167
|
+
<ModalMedia>
|
|
168
|
+
<img src={mediaImage} alt="media placeholder" style={{
|
|
169
|
+
width: "100%",
|
|
170
|
+
objectFit: "cover"
|
|
171
|
+
}} />
|
|
172
|
+
</ModalMedia>
|
|
173
|
+
<ModalHeader title="Modal with wizard" />
|
|
174
|
+
<ModalContent>
|
|
175
|
+
<Text type="text1" align="inherit" element="p">
|
|
176
|
+
Now the modal can also allow wizard process, when including stepper in the modal footer, it also contain an
|
|
177
|
+
animation.
|
|
178
|
+
</Text>
|
|
179
|
+
</ModalContent>
|
|
180
|
+
</ModalMediaLayout>];
|
|
181
|
+
const {
|
|
182
|
+
activeStep,
|
|
183
|
+
direction,
|
|
184
|
+
next,
|
|
185
|
+
back,
|
|
186
|
+
isFirstStep,
|
|
187
|
+
isLastStep,
|
|
188
|
+
goToStep
|
|
189
|
+
} = useWizard({
|
|
190
|
+
stepCount: transitionSteps.length
|
|
191
|
+
});
|
|
192
|
+
return <>
|
|
193
|
+
<Flex gap="large" style={{
|
|
194
|
+
paddingBlock: 40
|
|
195
|
+
}}>
|
|
196
|
+
<Button onClick={() => setShowCenterPop(true)}>Center pop</Button>
|
|
197
|
+
<Button onClick={() => setShowTransition(true)}>Transition</Button>
|
|
198
|
+
</Flex>
|
|
199
|
+
|
|
200
|
+
<Modal id="modal-media-center" show={showCenterPop} size="medium" onClose={() => setShowCenterPop(false)}>
|
|
201
|
+
<ModalMediaLayout>
|
|
202
|
+
<ModalMedia>
|
|
203
|
+
<img src={mediaImage} alt="media placeholder" style={{
|
|
204
|
+
width: "100%",
|
|
205
|
+
objectFit: "cover"
|
|
206
|
+
}} />
|
|
207
|
+
</ModalMedia>
|
|
208
|
+
<ModalHeader title="Modal title" />
|
|
209
|
+
<ModalContent>
|
|
210
|
+
<Text type="text1" align="inherit" element="p">
|
|
211
|
+
The media modal is ideal for introducing new features or onboarding, the user can also{" "}
|
|
212
|
+
<Link inheritFontSize inlineText text="add a link" />.
|
|
213
|
+
</Text>
|
|
214
|
+
</ModalContent>
|
|
215
|
+
</ModalMediaLayout>
|
|
216
|
+
<ModalFooter primaryButton={{
|
|
217
|
+
text: "Confirm",
|
|
218
|
+
onClick: () => setShowCenterPop(false)
|
|
219
|
+
}} secondaryButton={{
|
|
220
|
+
text: "Cancel",
|
|
221
|
+
onClick: () => setShowCenterPop(false)
|
|
222
|
+
}} />
|
|
223
|
+
</Modal>
|
|
224
|
+
|
|
225
|
+
<Modal id="modal-media-transition" show={showTransition} size="medium" onClose={() => setShowTransition(false)}>
|
|
226
|
+
<TransitionView activeStep={activeStep} direction={direction}>
|
|
227
|
+
{transitionSteps}
|
|
228
|
+
</TransitionView>
|
|
229
|
+
<ModalFooterWizard activeStep={activeStep} stepCount={transitionSteps.length} onStepClick={goToStep} primaryButton={{
|
|
230
|
+
text: isLastStep ? "Confirm" : "Next",
|
|
231
|
+
onClick: next
|
|
232
|
+
}} secondaryButton={{
|
|
233
|
+
text: "Back",
|
|
234
|
+
onClick: back,
|
|
235
|
+
disabled: isFirstStep
|
|
236
|
+
}} />
|
|
237
|
+
</Modal>
|
|
238
|
+
</>;
|
|
239
|
+
```
|
|
240
|
+
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# Storybook Code Examples
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
const steps = [<ModalSideBySideLayout>
|
|
7
|
+
<ModalHeader title="Side by side modal" description={<Text type="text1">
|
|
8
|
+
Modal subtitle, can come with icon <Link inheritFontSize inlineText text="and link." />
|
|
9
|
+
</Text>} />
|
|
10
|
+
<ModalContent>
|
|
11
|
+
<Text type="text1" align="inherit" element="p">
|
|
12
|
+
Modal content will appear here, you can custom it however you want, according to the user needs. Please make
|
|
13
|
+
sure that the content is clear for completing the relevant task.
|
|
14
|
+
</Text>
|
|
15
|
+
</ModalContent>
|
|
16
|
+
<ModalMedia>
|
|
17
|
+
<img src={mediaImage} alt="side by side placeholder" style={{
|
|
18
|
+
width: "100%",
|
|
19
|
+
objectFit: "cover"
|
|
20
|
+
}} />
|
|
21
|
+
</ModalMedia>
|
|
22
|
+
</ModalSideBySideLayout>, <ModalSideBySideLayout>
|
|
23
|
+
<ModalHeader title="Side by side modal" description={<Text type="text1">
|
|
24
|
+
Modal subtitle, can come with icon <Link inheritFontSize inlineText text="and link." />
|
|
25
|
+
</Text>} />
|
|
26
|
+
<ModalContent>
|
|
27
|
+
<Text type="text1" align="inherit" element="p">
|
|
28
|
+
Modal content will appear here, you can custom it however you want, according to the user needs. Please make
|
|
29
|
+
sure that the content is clear for completing the relevant task.
|
|
30
|
+
</Text>
|
|
31
|
+
</ModalContent>
|
|
32
|
+
<ModalMedia>
|
|
33
|
+
<img src={mediaImage} alt="side by side placeholder" style={{
|
|
34
|
+
width: "100%",
|
|
35
|
+
objectFit: "cover"
|
|
36
|
+
}} />
|
|
37
|
+
</ModalMedia>
|
|
38
|
+
</ModalSideBySideLayout>];
|
|
39
|
+
const {
|
|
40
|
+
activeStep,
|
|
41
|
+
direction,
|
|
42
|
+
next,
|
|
43
|
+
back,
|
|
44
|
+
isFirstStep,
|
|
45
|
+
isLastStep,
|
|
46
|
+
goToStep
|
|
47
|
+
} = useWizard({
|
|
48
|
+
stepCount: steps.length
|
|
49
|
+
});
|
|
50
|
+
const primaryButtonText = isLastStep ? "Confirm" : "Next";
|
|
51
|
+
return <Modal id="modal-sbs" show={show} size="large" onClose={() => setShow(false)} style={{
|
|
52
|
+
height: 400
|
|
53
|
+
}} container={container} {...args}>
|
|
54
|
+
<TransitionView activeStep={activeStep} direction={direction}>
|
|
55
|
+
{steps}
|
|
56
|
+
</TransitionView>
|
|
57
|
+
<ModalFooterWizard activeStep={activeStep} stepCount={steps.length} onStepClick={goToStep} primaryButton={{
|
|
58
|
+
text: primaryButtonText,
|
|
59
|
+
onClick: next
|
|
60
|
+
}} secondaryButton={{
|
|
61
|
+
text: "Back",
|
|
62
|
+
onClick: back,
|
|
63
|
+
disabled: isFirstStep
|
|
64
|
+
}} />
|
|
65
|
+
</Modal>;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Wizard
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
const dropdownOptions = [{
|
|
72
|
+
label: "English",
|
|
73
|
+
value: "en"
|
|
74
|
+
}, {
|
|
75
|
+
label: "Hebrew",
|
|
76
|
+
value: "he"
|
|
77
|
+
}];
|
|
78
|
+
const steps = [<ModalSideBySideLayout>
|
|
79
|
+
<ModalHeader title="Modal with wizard" description="Fill in the details" />
|
|
80
|
+
<ModalContent>
|
|
81
|
+
<Flex direction="column" gap="medium">
|
|
82
|
+
<TextField title="Full name" placeholder="John Dow" />
|
|
83
|
+
<TextField title="Email" placeholder="Email@monday.com" />
|
|
84
|
+
</Flex>
|
|
85
|
+
</ModalContent>
|
|
86
|
+
<ModalMedia>
|
|
87
|
+
<img src={mediaImage} alt="side by side placeholder" style={{
|
|
88
|
+
width: "100%",
|
|
89
|
+
objectFit: "cover"
|
|
90
|
+
}} />
|
|
91
|
+
</ModalMedia>
|
|
92
|
+
</ModalSideBySideLayout>, <ModalSideBySideLayout>
|
|
93
|
+
<ModalHeader title="Modal with wizard" description="Update your settings defenitions" />
|
|
94
|
+
<ModalContent>
|
|
95
|
+
<Flex direction="column" gap="medium" align="stretch">
|
|
96
|
+
<TextField title="Fill address" placeholder="City, street, number" />
|
|
97
|
+
<Flex direction="column" align="stretch">
|
|
98
|
+
<Label labelText="Language preferences" />
|
|
99
|
+
<Dropdown insideOverflowWithTransformContainer insideLayerContext size="small" placeholder={dropdownOptions[0].label} options={dropdownOptions} />
|
|
100
|
+
</Flex>
|
|
101
|
+
</Flex>
|
|
102
|
+
</ModalContent>
|
|
103
|
+
<ModalMedia>
|
|
104
|
+
<img src={mediaImage} alt="side by side placeholder" style={{
|
|
105
|
+
width: "100%",
|
|
106
|
+
objectFit: "cover"
|
|
107
|
+
}} />
|
|
108
|
+
</ModalMedia>
|
|
109
|
+
</ModalSideBySideLayout>];
|
|
110
|
+
const {
|
|
111
|
+
activeStep,
|
|
112
|
+
direction,
|
|
113
|
+
next,
|
|
114
|
+
back,
|
|
115
|
+
isFirstStep,
|
|
116
|
+
isLastStep,
|
|
117
|
+
goToStep
|
|
118
|
+
} = useWizard({
|
|
119
|
+
stepCount: steps.length
|
|
120
|
+
});
|
|
121
|
+
const primaryButtonText = isLastStep ? "Confirm" : "Next";
|
|
122
|
+
return <Modal id="modal-sbs" show={show} size="large" onClose={() => setShow(false)} container={container} style={{
|
|
123
|
+
height: 400
|
|
124
|
+
}}>
|
|
125
|
+
<TransitionView activeStep={activeStep} direction={direction}>
|
|
126
|
+
{steps}
|
|
127
|
+
</TransitionView>
|
|
128
|
+
<ModalFooterWizard activeStep={activeStep} stepCount={steps.length} onStepClick={goToStep} primaryButton={{
|
|
129
|
+
text: primaryButtonText,
|
|
130
|
+
onClick: next
|
|
131
|
+
}} secondaryButton={{
|
|
132
|
+
text: "Back",
|
|
133
|
+
onClick: back,
|
|
134
|
+
disabled: isFirstStep
|
|
135
|
+
}} />
|
|
136
|
+
</Modal>;
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## HeaderWithIconButton
|
|
140
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
return <Modal id="modal-sbs" show={show} renderHeaderAction={<IconButton icon={Menu} size="small" kind="tertiary" aria-label="Open Menu" />} size="large" onClose={() => setShow(false)} container={container} style={{
|
|
143
|
+
height: 400
|
|
144
|
+
}}>
|
|
145
|
+
<ModalSideBySideLayout>
|
|
146
|
+
<ModalHeader title="Modal title" />
|
|
147
|
+
<ModalContent>
|
|
148
|
+
<Text type="text1" align="inherit" element="p">
|
|
149
|
+
Modal content will appear here, you can custom it however you want, according to the user needs. Please
|
|
150
|
+
make sure that the content is clear for completing the relevant task.
|
|
151
|
+
</Text>
|
|
152
|
+
</ModalContent>
|
|
153
|
+
<ModalMedia>
|
|
154
|
+
<img src={mediaImage} alt="side by side placeholder" style={{
|
|
155
|
+
width: "100%",
|
|
156
|
+
objectFit: "cover"
|
|
157
|
+
}} />
|
|
158
|
+
</ModalMedia>
|
|
159
|
+
</ModalSideBySideLayout>
|
|
160
|
+
<ModalFooter primaryButton={{
|
|
161
|
+
text: "Confirm",
|
|
162
|
+
onClick: () => setShow(false)
|
|
163
|
+
}} secondaryButton={{
|
|
164
|
+
text: "Cancel",
|
|
165
|
+
onClick: () => setShow(false)
|
|
166
|
+
}} />
|
|
167
|
+
</Modal>;
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Animation
|
|
171
|
+
|
|
172
|
+
```tsx
|
|
173
|
+
const [showAnchor, setShowAnchor] = useState(false);
|
|
174
|
+
const [showCenterPop, setShowCenterPop] = useState(false);
|
|
175
|
+
const [showTransition, setShowTransition] = useState(false);
|
|
176
|
+
const anchorButtonRef = useRef<HTMLButtonElement>(null);
|
|
177
|
+
const transitionSteps = [<ModalSideBySideLayout>
|
|
178
|
+
<ModalHeader title="Modal title" />
|
|
179
|
+
<ModalContent>
|
|
180
|
+
<Text type="text1" align="inherit" element="p">
|
|
181
|
+
Modal content will appear here, you can custom it however you want, according to the user needs. Please make
|
|
182
|
+
sure that the content is clear for completing the relevant task.
|
|
183
|
+
</Text>
|
|
184
|
+
</ModalContent>
|
|
185
|
+
<ModalMedia>
|
|
186
|
+
<img src={mediaImage} alt="side by side placeholder" style={{
|
|
187
|
+
width: "100%",
|
|
188
|
+
objectFit: "cover"
|
|
189
|
+
}} />
|
|
190
|
+
</ModalMedia>
|
|
191
|
+
</ModalSideBySideLayout>, <ModalSideBySideLayout>
|
|
192
|
+
<ModalHeader title="Modal title" />
|
|
193
|
+
<ModalContent>
|
|
194
|
+
<Text type="text1" align="inherit" element="p">
|
|
195
|
+
Modal content will appear here, you can custom it however you want, according to the user needs. Please make
|
|
196
|
+
sure that the content is clear for completing the relevant task.
|
|
197
|
+
</Text>
|
|
198
|
+
</ModalContent>
|
|
199
|
+
<ModalMedia>
|
|
200
|
+
<img src={mediaImage} alt="side by side placeholder" style={{
|
|
201
|
+
width: "100%",
|
|
202
|
+
objectFit: "cover"
|
|
203
|
+
}} />
|
|
204
|
+
</ModalMedia>
|
|
205
|
+
</ModalSideBySideLayout>, <ModalSideBySideLayout>
|
|
206
|
+
<ModalHeader title="Modal title" />
|
|
207
|
+
<ModalContent>
|
|
208
|
+
<Text type="text1" align="inherit" element="p">
|
|
209
|
+
Modal content will appear here, you can custom it however you want, according to the user needs. Please make
|
|
210
|
+
sure that the content is clear for completing the relevant task.
|
|
211
|
+
</Text>
|
|
212
|
+
</ModalContent>
|
|
213
|
+
<ModalMedia>
|
|
214
|
+
<img src={mediaImage} alt="side by side placeholder" style={{
|
|
215
|
+
width: "100%",
|
|
216
|
+
objectFit: "cover"
|
|
217
|
+
}} />
|
|
218
|
+
</ModalMedia>
|
|
219
|
+
</ModalSideBySideLayout>];
|
|
220
|
+
const {
|
|
221
|
+
activeStep,
|
|
222
|
+
direction,
|
|
223
|
+
next,
|
|
224
|
+
back,
|
|
225
|
+
isFirstStep,
|
|
226
|
+
isLastStep,
|
|
227
|
+
goToStep
|
|
228
|
+
} = useWizard({
|
|
229
|
+
stepCount: transitionSteps.length
|
|
230
|
+
});
|
|
231
|
+
return <>
|
|
232
|
+
<Flex gap="large" style={{
|
|
233
|
+
paddingBlock: 40
|
|
234
|
+
}}>
|
|
235
|
+
<Button ref={anchorButtonRef} onClick={() => setShowAnchor(true)}>
|
|
236
|
+
Anchor
|
|
237
|
+
</Button>
|
|
238
|
+
<Button onClick={() => setShowCenterPop(true)}>Center pop</Button>
|
|
239
|
+
<Button onClick={() => setShowTransition(true)}>Transition</Button>
|
|
240
|
+
</Flex>
|
|
241
|
+
|
|
242
|
+
<Modal id="modal-sbs-anchor" show={showAnchor} anchorElementRef={anchorButtonRef} size="large" onClose={() => setShowAnchor(false)} style={{
|
|
243
|
+
height: 400
|
|
244
|
+
}}>
|
|
245
|
+
<ModalSideBySideLayout>
|
|
246
|
+
<ModalHeader title="Modal title" />
|
|
247
|
+
<ModalContent>
|
|
248
|
+
<Text type="text1" align="inherit" element="p">
|
|
249
|
+
Modal content will appear here, you can custom it however you want, according to the user needs. Please
|
|
250
|
+
make sure that the content is clear for completing the relevant task.
|
|
251
|
+
</Text>
|
|
252
|
+
</ModalContent>
|
|
253
|
+
<ModalMedia>
|
|
254
|
+
<img src={mediaImage} alt="side by side placeholder" style={{
|
|
255
|
+
width: "100%",
|
|
256
|
+
objectFit: "cover"
|
|
257
|
+
}} />
|
|
258
|
+
</ModalMedia>
|
|
259
|
+
</ModalSideBySideLayout>
|
|
260
|
+
<ModalFooter primaryButton={{
|
|
261
|
+
text: "Confirm",
|
|
262
|
+
onClick: () => setShowAnchor(false)
|
|
263
|
+
}} secondaryButton={{
|
|
264
|
+
text: "Cancel",
|
|
265
|
+
onClick: () => setShowAnchor(false)
|
|
266
|
+
}} />
|
|
267
|
+
</Modal>
|
|
268
|
+
|
|
269
|
+
<Modal id="modal-sbs-center" show={showCenterPop} size="large" onClose={() => setShowCenterPop(false)} style={{
|
|
270
|
+
height: 400
|
|
271
|
+
}}>
|
|
272
|
+
<ModalSideBySideLayout>
|
|
273
|
+
<ModalHeader title="Modal title" />
|
|
274
|
+
<ModalContent>
|
|
275
|
+
<Text type="text1" align="inherit" element="p">
|
|
276
|
+
Modal content will appear here, you can custom it however you want, according to the user needs. Please
|
|
277
|
+
make sure that the content is clear for completing the relevant task.
|
|
278
|
+
</Text>
|
|
279
|
+
</ModalContent>
|
|
280
|
+
<ModalMedia>
|
|
281
|
+
<img src={mediaImage} alt="side by side placeholder" style={{
|
|
282
|
+
width: "100%",
|
|
283
|
+
objectFit: "cover"
|
|
284
|
+
}} />
|
|
285
|
+
</ModalMedia>
|
|
286
|
+
</ModalSideBySideLayout>
|
|
287
|
+
<ModalFooter primaryButton={{
|
|
288
|
+
text: "Confirm",
|
|
289
|
+
onClick: () => setShowCenterPop(false)
|
|
290
|
+
}} secondaryButton={{
|
|
291
|
+
text: "Cancel",
|
|
292
|
+
onClick: () => setShowCenterPop(false)
|
|
293
|
+
}} />
|
|
294
|
+
</Modal>
|
|
295
|
+
|
|
296
|
+
<Modal id="modal-sbs-transition" show={showTransition} size="large" onClose={() => setShowTransition(false)} style={{
|
|
297
|
+
height: 400
|
|
298
|
+
}}>
|
|
299
|
+
<TransitionView activeStep={activeStep} direction={direction}>
|
|
300
|
+
{transitionSteps}
|
|
301
|
+
</TransitionView>
|
|
302
|
+
<ModalFooterWizard activeStep={activeStep} stepCount={transitionSteps.length} onStepClick={goToStep} primaryButton={{
|
|
303
|
+
text: isLastStep ? "Confirm" : "Next",
|
|
304
|
+
onClick: next
|
|
305
|
+
}} secondaryButton={{
|
|
306
|
+
text: "Back",
|
|
307
|
+
onClick: back,
|
|
308
|
+
disabled: isFirstStep
|
|
309
|
+
}} />
|
|
310
|
+
</Modal>
|
|
311
|
+
</>;
|
|
312
|
+
```
|
|
313
|
+
|