@iress-oss/ids-mcp-server 5.15.0 → 5.20.1
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/generated/docs/components_components-alert-docs.md +492 -0
- package/generated/docs/components_components-autocomplete-docs.md +3485 -0
- package/generated/docs/{components-autocomplete-recipes-docs.md → components_components-autocomplete-recipes-docs.md} +32 -14
- package/generated/docs/{components-badge-docs.md → components_components-badge-docs.md} +222 -30
- package/generated/docs/components_components-button-docs.md +2078 -0
- package/generated/docs/components_components-button-recipes-docs.md +37 -0
- package/generated/docs/components_components-buttongroup-docs.md +1045 -0
- package/generated/docs/components_components-card-docs.md +2276 -0
- package/generated/docs/{components-card-recipes-docs.md → components_components-card-recipes-docs.md} +131 -14
- package/generated/docs/components_components-checkbox-docs.md +1054 -0
- package/generated/docs/{components-checkboxgroup-docs.md → components_components-checkboxgroup-docs.md} +1000 -81
- package/generated/docs/{components-checkboxgroup-recipes-docs.md → components_components-checkboxgroup-recipes-docs.md} +101 -11
- package/generated/docs/{components-col-docs.md → components_components-col-docs.md} +331 -58
- package/generated/docs/components_components-combobox-docs.md +3767 -0
- package/generated/docs/{components-container-docs.md → components_components-container-docs.md} +61 -24
- package/generated/docs/{components-divider-docs.md → components_components-divider-docs.md} +83 -24
- package/generated/docs/{components-expander-docs.md → components_components-expander-docs.md} +264 -33
- package/generated/docs/{components-field-docs.md → components_components-field-docs.md} +814 -120
- package/generated/docs/components_components-filter-docs.md +4080 -0
- package/generated/docs/{components-form-docs.md → components_components-form-docs.md} +1515 -353
- package/generated/docs/{components-form-recipes-docs.md → components_components-form-recipes-docs.md} +170 -54
- package/generated/docs/components_components-hide-docs.md +293 -0
- package/generated/docs/components_components-icon-docs.md +1337 -0
- package/generated/docs/{components-inline-docs.md → components_components-inline-docs.md} +462 -42
- package/generated/docs/components_components-input-docs.md +1468 -0
- package/generated/docs/components_components-input-recipes-docs.md +367 -0
- package/generated/docs/components_components-inputcurrency-docs.md +432 -0
- package/generated/docs/{components-inputcurrency-recipes-docs.md → components_components-inputcurrency-recipes-docs.md} +110 -17
- package/generated/docs/components_components-label-docs.md +323 -0
- package/generated/docs/components_components-menu-docs.md +2345 -0
- package/generated/docs/components_components-menu-menuitem-docs.md +633 -0
- package/generated/docs/{components-modal-docs.md → components_components-modal-docs.md} +1625 -232
- package/generated/docs/components_components-navbar-docs.md +1847 -0
- package/generated/docs/{components-navbar-recipes-docs.md → components_components-navbar-recipes-docs.md} +697 -39
- package/generated/docs/{components-panel-docs.md → components_components-panel-docs.md} +754 -57
- package/generated/docs/components_components-placeholder-docs.md +92 -0
- package/generated/docs/components_components-popover-docs.md +1641 -0
- package/generated/docs/{components-popover-recipes-docs.md → components_components-popover-recipes-docs.md} +347 -17
- package/generated/docs/components_components-progress-docs.md +115 -0
- package/generated/docs/{components-provider-docs.md → components_components-provider-docs.md} +41 -32
- package/generated/docs/components_components-radio-docs.md +491 -0
- package/generated/docs/{components-radiogroup-docs.md → components_components-radiogroup-docs.md} +943 -75
- package/generated/docs/components_components-readonly-docs.md +263 -0
- package/generated/docs/components_components-richselect-docs.md +6497 -0
- package/generated/docs/{components-row-docs.md → components_components-row-docs.md} +353 -43
- package/generated/docs/{components-select-docs.md → components_components-select-docs.md} +719 -61
- package/generated/docs/components_components-skeleton-docs.md +480 -0
- package/generated/docs/{components-skeleton-recipes-docs.md → components_components-skeleton-recipes-docs.md} +50 -10
- package/generated/docs/{components-skiplink-docs.md → components_components-skiplink-docs.md} +53 -14
- package/generated/docs/components_components-slideout-docs.md +2262 -0
- package/generated/docs/components_components-slider-docs.md +1276 -0
- package/generated/docs/components_components-spinner-docs.md +82 -0
- package/generated/docs/{components-stack-docs.md → components_components-stack-docs.md} +223 -40
- package/generated/docs/components_components-table-docs.md +3651 -0
- package/generated/docs/components_components-tabset-docs.md +772 -0
- package/generated/docs/components_components-tabset-tab-docs.md +262 -0
- package/generated/docs/components_components-tag-docs.md +259 -0
- package/generated/docs/{components-text-docs.md → components_components-text-docs.md} +491 -51
- package/generated/docs/{components-toaster-docs.md → components_components-toaster-docs.md} +181 -79
- package/generated/docs/components_components-toaster-toast-docs.md +634 -0
- package/generated/docs/components_components-toggle-docs.md +461 -0
- package/generated/docs/{components-tooltip-docs.md → components_components-tooltip-docs.md} +286 -41
- package/generated/docs/{components-validationmessage-docs.md → components_components-validationmessage-docs.md} +230 -61
- package/generated/docs/components_contact-us-docs.md +12 -0
- package/generated/docs/{foundations-accessibility-docs.md → components_foundations-accessibility-docs.md} +11 -21
- package/generated/docs/{foundations-colours-docs.md → components_foundations-colour-030-colours.md} +8 -15
- package/generated/docs/{foundations-consistency-docs.md → components_foundations-consistency-docs.md} +12 -20
- package/generated/docs/{foundations-content-docs.md → components_foundations-content-docs.md} +6 -11
- package/generated/docs/components_foundations-introduction-docs.md +15 -0
- package/generated/docs/{foundations-principles-docs.md → components_foundations-principles-docs.md} +14 -24
- package/generated/docs/components_foundations-typography-docs.md +608 -0
- package/generated/docs/{foundations-user-experience-docs.md → components_foundations-user-experience-docs.md} +16 -26
- package/generated/docs/{foundations-visual-design-docs.md → components_foundations-visual-design-docs.md} +10 -17
- package/generated/docs/{frequently-asked-questions-docs.md → components_frequently-asked-questions-docs.md} +14 -23
- package/generated/docs/components_get-started-develop-docs.md +84 -0
- package/generated/docs/components_get-started-using-storybook-docs.md +55 -0
- package/generated/docs/components_introduction-docs.md +15 -0
- package/generated/docs/{patterns-loading-docs.md → components_patterns-loading-docs.md} +711 -143
- package/generated/docs/components_resources-changelog-docs.md +4 -0
- package/generated/docs/{resources-code-katas-docs.md → components_resources-code-katas-docs.md} +5 -9
- package/generated/docs/{resources-migration-guides-from-v4-to-v5-docs.md → components_resources-migration-guides-from-v4-to-v5-docs.md} +54 -239
- package/generated/docs/{versions-docs.md → components_versions-docs.md} +5 -8
- package/generated/docs/guidelines.md +484 -200
- package/generated/docs/introduction-docs.md +19 -30
- package/package.json +41 -45
- package/generated/docs/components-alert-docs.md +0 -130
- package/generated/docs/components-autocomplete-docs.md +0 -754
- package/generated/docs/components-button-docs.md +0 -362
- package/generated/docs/components-button-recipes-docs.md +0 -76
- package/generated/docs/components-buttongroup-docs.md +0 -310
- package/generated/docs/components-card-docs.md +0 -494
- package/generated/docs/components-checkbox-docs.md +0 -193
- package/generated/docs/components-combobox-docs.md +0 -1016
- package/generated/docs/components-filter-docs.md +0 -1109
- package/generated/docs/components-hide-docs.md +0 -265
- package/generated/docs/components-icon-docs.md +0 -553
- package/generated/docs/components-input-docs.md +0 -335
- package/generated/docs/components-input-recipes-docs.md +0 -140
- package/generated/docs/components-inputcurrency-docs.md +0 -157
- package/generated/docs/components-label-docs.md +0 -135
- package/generated/docs/components-menu-docs.md +0 -704
- package/generated/docs/components-menu-menuitem-docs.md +0 -193
- package/generated/docs/components-navbar-docs.md +0 -291
- package/generated/docs/components-placeholder-docs.md +0 -27
- package/generated/docs/components-popover-docs.md +0 -464
- package/generated/docs/components-progress-docs.md +0 -104
- package/generated/docs/components-radio-docs.md +0 -107
- package/generated/docs/components-readonly-docs.md +0 -89
- package/generated/docs/components-richselect-docs.md +0 -2433
- package/generated/docs/components-skeleton-docs.md +0 -214
- package/generated/docs/components-slideout-docs.md +0 -538
- package/generated/docs/components-slider-docs.md +0 -346
- package/generated/docs/components-spinner-docs.md +0 -59
- package/generated/docs/components-table-ag-grid-docs.md +0 -1074
- package/generated/docs/components-table-docs.md +0 -1305
- package/generated/docs/components-tabset-docs.md +0 -341
- package/generated/docs/components-tabset-tab-docs.md +0 -86
- package/generated/docs/components-tag-docs.md +0 -115
- package/generated/docs/components-toaster-toast-docs.md +0 -157
- package/generated/docs/components-toggle-docs.md +0 -158
- package/generated/docs/contact-us-docs.md +0 -27
- package/generated/docs/extensions-editor-docs.md +0 -288
- package/generated/docs/extensions-editor-recipes-docs.md +0 -39
- package/generated/docs/foundations-introduction-docs.md +0 -17
- package/generated/docs/foundations-typography-docs.md +0 -191
- package/generated/docs/get-started-develop-docs.md +0 -209
- package/generated/docs/get-started-using-storybook-docs.md +0 -68
- package/generated/docs/resources-changelog-docs.md +0 -6
- package/generated/docs/themes-available-themes-docs.md +0 -66
- package/generated/docs/themes-introduction-docs.md +0 -121
- package/generated/docs/themes-tokens-docs.md +0 -1200
- /package/{LICENSE.txt → LICENSE} +0 -0
|
@@ -0,0 +1,2262 @@
|
|
|
1
|
+
Slideout
|
|
2
|
+
========
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
Slideouts are used to show additional information or to allow users to perform secondary tasks without leaving their normal workflow.
|
|
8
|
+
|
|
9
|
+
Read more
|
|
10
|
+
|
|
11
|
+
[](#use-a-slideout-when)Use a slideout when:
|
|
12
|
+
--------------------------------------------
|
|
13
|
+
|
|
14
|
+
* Providing supplemental tasks that require the underlying page to still be visible
|
|
15
|
+
* Providing non-essential information related to the underlying page
|
|
16
|
+
|
|
17
|
+
[](./iframe.html?id=components-slideout--default)
|
|
18
|
+
|
|
19
|
+
Show slideout
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
const Story \= () \=> {
|
|
24
|
+
const { showSlideout } \= useSlideout();
|
|
25
|
+
const SLIDEOUT\_ID \= 'storybook-slideout';
|
|
26
|
+
return (
|
|
27
|
+
const Story \= () \=> {
|
|
28
|
+
const { showSlideout } \= useSlideout();
|
|
29
|
+
const SLIDEOUT\_ID \= 'storybook-slideout';
|
|
30
|
+
return (
|
|
31
|
+
<\>
|
|
32
|
+
<IressButton onClick\={() \=> showSlideout(SLIDEOUT\_ID)}\>
|
|
33
|
+
Show slideout </IressButton\>
|
|
34
|
+
<IressSlideout
|
|
35
|
+
footer\="Footer slot"
|
|
36
|
+
id\="storybook-slideout"
|
|
37
|
+
\>
|
|
38
|
+
Slideout content </IressSlideout\>
|
|
39
|
+
</\>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const App \= () \=> (
|
|
44
|
+
<IressSlideoutProvider\>
|
|
45
|
+
<Story />
|
|
46
|
+
</IressSlideoutProvider\>
|
|
47
|
+
);
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const App \= () \=> (
|
|
52
|
+
<IressSlideoutProvider\>
|
|
53
|
+
<Story />
|
|
54
|
+
</IressSlideoutProvider\>
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Props
|
|
60
|
+
-----
|
|
61
|
+
|
|
62
|
+
| Name | Description | Default | Control |
|
|
63
|
+
| --- | --- | --- | --- |
|
|
64
|
+
| backdrop |
|
|
65
|
+
When set to `true` a backdrop will be displayed to cover the contents of the page. The slideout will then become the only element that can be interacted with.
|
|
66
|
+
|
|
67
|
+
boolean
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
| \- | Set boolean |
|
|
72
|
+
| children |
|
|
73
|
+
|
|
74
|
+
Content to be displayed within the slideout.
|
|
75
|
+
|
|
76
|
+
ReactNode
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
| \- |
|
|
81
|
+
|
|
82
|
+
"Slideout content"
|
|
83
|
+
|
|
84
|
+
|
|
|
85
|
+
| closeText |
|
|
86
|
+
|
|
87
|
+
Screenreader text for close button.
|
|
88
|
+
|
|
89
|
+
string
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
|
94
|
+
|
|
95
|
+
'Close'
|
|
96
|
+
|
|
97
|
+
| Set string |
|
|
98
|
+
| container |
|
|
99
|
+
|
|
100
|
+
The container element to render the slideout into. By default, the slideout will render at the end of the document body.
|
|
101
|
+
|
|
102
|
+
FloatingUIContainer
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
| \- | Set object |
|
|
107
|
+
| defaultShow |
|
|
108
|
+
|
|
109
|
+
When set to `true` the slideout will be visible. Use for uncontrolled slideouts.
|
|
110
|
+
|
|
111
|
+
boolean
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
|
116
|
+
|
|
117
|
+
false
|
|
118
|
+
|
|
119
|
+
| Set boolean |
|
|
120
|
+
| eleToPush |
|
|
121
|
+
|
|
122
|
+
The element that needs to be pushed relative to the slideout. This can be a string selector to match an existing element in the DOM, a html element, or a React reference. Will be ignored if `mode` is not set to `push` or if element does not exist.
|
|
123
|
+
|
|
124
|
+
union
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
| \- | Set object |
|
|
129
|
+
| footer |
|
|
130
|
+
|
|
131
|
+
Panel to place slideout controls.
|
|
132
|
+
|
|
133
|
+
ReactNode
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
| \- |
|
|
138
|
+
|
|
139
|
+
"Footer slot"
|
|
140
|
+
|
|
141
|
+
|
|
|
142
|
+
| heading |
|
|
143
|
+
|
|
144
|
+
Sets the heading for the slideout. If passed an element, it will render the element with an id, to ensure its connection to the slideout.
|
|
145
|
+
|
|
146
|
+
union
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
| \- | Set object |
|
|
151
|
+
| id |
|
|
152
|
+
|
|
153
|
+
Unique ID for the slideout. Use if you would like to open this slideout from anywhere in your app using the `useSlideout` hook.
|
|
154
|
+
|
|
155
|
+
string
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
| \- | storybook-slideout |
|
|
160
|
+
| mode |
|
|
161
|
+
|
|
162
|
+
Sets how the Slideout interacts with the content of the page. `overlay` overlays the page content, obscuring the content below. `push` will push the element (specified by `eleToPush`) across the page. `push` will revert back to `overlay` if `eleToPush` is not specified or if the screen size < 1200px.
|
|
163
|
+
|
|
164
|
+
union
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
|
169
|
+
|
|
170
|
+
'overlay'
|
|
171
|
+
|
|
172
|
+
| Set object |
|
|
173
|
+
| onEntered |
|
|
174
|
+
|
|
175
|
+
Emitted when the slideout has opened.
|
|
176
|
+
|
|
177
|
+
() => void
|
|
178
|
+
|
|
179
|
+
| \- | \- |
|
|
180
|
+
| onExited |
|
|
181
|
+
|
|
182
|
+
Emitted when the slideout has closed.
|
|
183
|
+
|
|
184
|
+
() => void
|
|
185
|
+
|
|
186
|
+
| \- | \- |
|
|
187
|
+
| onShowChange |
|
|
188
|
+
|
|
189
|
+
Emitted when the slideout has opened or closed internally. Use for controlled slideouts.
|
|
190
|
+
|
|
191
|
+
(show: boolean, reason?: OpenChangeReason) => void
|
|
192
|
+
|
|
193
|
+
| \- | \- |
|
|
194
|
+
| onStatus |
|
|
195
|
+
|
|
196
|
+
Emitted when the slideout has mounted, unmounted, opened or closed. Open and close occur before animation begins.
|
|
197
|
+
|
|
198
|
+
(status: 'unmounted' | 'initial' | 'open' | 'close') => void
|
|
199
|
+
|
|
200
|
+
| \- | \- |
|
|
201
|
+
| padding |
|
|
202
|
+
|
|
203
|
+
Sets the padding of the wrapping panel component.
|
|
204
|
+
|
|
205
|
+
union
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
|
210
|
+
|
|
211
|
+
'md'
|
|
212
|
+
|
|
213
|
+
| Set object |
|
|
214
|
+
| position |
|
|
215
|
+
|
|
216
|
+
Position of the slideout relative to the page. `left` or `right`.
|
|
217
|
+
|
|
218
|
+
union
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
|
223
|
+
|
|
224
|
+
'right'
|
|
225
|
+
|
|
226
|
+
| Set object |
|
|
227
|
+
| show |
|
|
228
|
+
|
|
229
|
+
When set to `true` the slideout will be visible. Use for controlled slideouts.
|
|
230
|
+
|
|
231
|
+
boolean
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
| \- | \- |
|
|
236
|
+
| size |
|
|
237
|
+
|
|
238
|
+
Accepts a single `SlideoutSize`. Slideouts will display at 100% for mobile screens (<576px).
|
|
239
|
+
|
|
240
|
+
union
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
|
245
|
+
|
|
246
|
+
'sm'
|
|
247
|
+
|
|
248
|
+
| Set object |
|
|
249
|
+
|
|
250
|
+
Controlling the slideout
|
|
251
|
+
------------------------
|
|
252
|
+
|
|
253
|
+
### Using the `show` property
|
|
254
|
+
|
|
255
|
+
You can use state to control the slideout by setting the `show` property to `true` or `false`. To sync your state with the slideout, you can use the `onShowChange` prop, which is normally passed the set function from `useState`.
|
|
256
|
+
|
|
257
|
+
[](./iframe.html?id=components-slideout--show-with-state)
|
|
258
|
+
|
|
259
|
+
Show slideout using state
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
import { IressButton, IressSlideout, type IressSlideoutProps } from '@iress-oss/ids-components';
|
|
264
|
+
import { useState } from 'react';
|
|
265
|
+
export const SlideoutUsingState \= () \=> {
|
|
266
|
+
const \[show, setShow\] \= useState(false);
|
|
267
|
+
return (
|
|
268
|
+
<\>
|
|
269
|
+
<IressButton onClick\={() \=> setShow(true)}\>
|
|
270
|
+
Show slideout using state </IressButton\>
|
|
271
|
+
<IressSlideout
|
|
272
|
+
{...{
|
|
273
|
+
children: 'This slideout was opened via state',
|
|
274
|
+
}}
|
|
275
|
+
show\={show}
|
|
276
|
+
onShowChange\={setShow}
|
|
277
|
+
footer\={<IressButton onClick\={() \=> setShow(false)}\>Close</IressButton\>}
|
|
278
|
+
/>
|
|
279
|
+
</\>
|
|
280
|
+
);
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
#### Props
|
|
286
|
+
|
|
287
|
+
| Name | Description | Default | Control |
|
|
288
|
+
| --- | --- | --- | --- |
|
|
289
|
+
| backdrop |
|
|
290
|
+
When set to `true` a backdrop will be displayed to cover the contents of the page. The slideout will then become the only element that can be interacted with.
|
|
291
|
+
|
|
292
|
+
boolean
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
| \- | Set boolean |
|
|
297
|
+
| children |
|
|
298
|
+
|
|
299
|
+
Content to be displayed within the slideout.
|
|
300
|
+
|
|
301
|
+
ReactNode
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
| \- |
|
|
306
|
+
|
|
307
|
+
"This slideout was opened via state"
|
|
308
|
+
|
|
309
|
+
|
|
|
310
|
+
| closeText |
|
|
311
|
+
|
|
312
|
+
Screenreader text for close button.
|
|
313
|
+
|
|
314
|
+
string
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
|
319
|
+
|
|
320
|
+
'Close'
|
|
321
|
+
|
|
322
|
+
| Set string |
|
|
323
|
+
| container |
|
|
324
|
+
|
|
325
|
+
The container element to render the slideout into. By default, the slideout will render at the end of the document body.
|
|
326
|
+
|
|
327
|
+
FloatingUIContainer
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
| \- | Set object |
|
|
332
|
+
| defaultShow |
|
|
333
|
+
|
|
334
|
+
When set to `true` the slideout will be visible. Use for uncontrolled slideouts.
|
|
335
|
+
|
|
336
|
+
boolean
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
|
341
|
+
|
|
342
|
+
false
|
|
343
|
+
|
|
344
|
+
| Set boolean |
|
|
345
|
+
| eleToPush |
|
|
346
|
+
|
|
347
|
+
The element that needs to be pushed relative to the slideout. This can be a string selector to match an existing element in the DOM, a html element, or a React reference. Will be ignored if `mode` is not set to `push` or if element does not exist.
|
|
348
|
+
|
|
349
|
+
union
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
| \- | Set object |
|
|
354
|
+
| footer |
|
|
355
|
+
|
|
356
|
+
Panel to place slideout controls.
|
|
357
|
+
|
|
358
|
+
ReactNode
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
| \- | \- |
|
|
363
|
+
| heading |
|
|
364
|
+
|
|
365
|
+
Sets the heading for the slideout. If passed an element, it will render the element with an id, to ensure its connection to the slideout.
|
|
366
|
+
|
|
367
|
+
union
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
| \- | Set object |
|
|
372
|
+
| id |
|
|
373
|
+
|
|
374
|
+
Unique ID for the slideout. Use if you would like to open this slideout from anywhere in your app using the `useSlideout` hook.
|
|
375
|
+
|
|
376
|
+
string
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
| \- | Set string |
|
|
381
|
+
| mode |
|
|
382
|
+
|
|
383
|
+
Sets how the Slideout interacts with the content of the page. `overlay` overlays the page content, obscuring the content below. `push` will push the element (specified by `eleToPush`) across the page. `push` will revert back to `overlay` if `eleToPush` is not specified or if the screen size < 1200px.
|
|
384
|
+
|
|
385
|
+
union
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
|
390
|
+
|
|
391
|
+
'overlay'
|
|
392
|
+
|
|
393
|
+
| Set object |
|
|
394
|
+
| onEntered |
|
|
395
|
+
|
|
396
|
+
Emitted when the slideout has opened.
|
|
397
|
+
|
|
398
|
+
() => void
|
|
399
|
+
|
|
400
|
+
| \- | \- |
|
|
401
|
+
| onExited |
|
|
402
|
+
|
|
403
|
+
Emitted when the slideout has closed.
|
|
404
|
+
|
|
405
|
+
() => void
|
|
406
|
+
|
|
407
|
+
| \- | \- |
|
|
408
|
+
| onShowChange |
|
|
409
|
+
|
|
410
|
+
Emitted when the slideout has opened or closed internally. Use for controlled slideouts.
|
|
411
|
+
|
|
412
|
+
(show: boolean, reason?: OpenChangeReason) => void
|
|
413
|
+
|
|
414
|
+
| \- | \- |
|
|
415
|
+
| onStatus |
|
|
416
|
+
|
|
417
|
+
Emitted when the slideout has mounted, unmounted, opened or closed. Open and close occur before animation begins.
|
|
418
|
+
|
|
419
|
+
(status: 'unmounted' | 'initial' | 'open' | 'close') => void
|
|
420
|
+
|
|
421
|
+
| \- | \- |
|
|
422
|
+
| padding |
|
|
423
|
+
|
|
424
|
+
Sets the padding of the wrapping panel component.
|
|
425
|
+
|
|
426
|
+
union
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
|
|
|
431
|
+
|
|
432
|
+
'md'
|
|
433
|
+
|
|
434
|
+
| Set object |
|
|
435
|
+
| position |
|
|
436
|
+
|
|
437
|
+
Position of the slideout relative to the page. `left` or `right`.
|
|
438
|
+
|
|
439
|
+
union
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
|
|
|
444
|
+
|
|
445
|
+
'right'
|
|
446
|
+
|
|
447
|
+
| Set object |
|
|
448
|
+
| show |
|
|
449
|
+
|
|
450
|
+
When set to `true` the slideout will be visible. Use for controlled slideouts.
|
|
451
|
+
|
|
452
|
+
boolean
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
| \- | \- |
|
|
457
|
+
| size |
|
|
458
|
+
|
|
459
|
+
Accepts a single `SlideoutSize`. Slideouts will display at 100% for mobile screens (<576px).
|
|
460
|
+
|
|
461
|
+
union
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
|
466
|
+
|
|
467
|
+
'sm'
|
|
468
|
+
|
|
469
|
+
| Set object |
|
|
470
|
+
|
|
471
|
+
### Using the `IressSlideoutProvider`
|
|
472
|
+
|
|
473
|
+
You can use the `IressSlideoutProvider` to open and close slideout from anywhere in your application, as long as the slideout has a unique `id`. In this case you would use the `useSlideout` hook to open and close the slideout.
|
|
474
|
+
|
|
475
|
+
To use, wrap your `<App/>` or the component that you want to use the `useSlideout` hook with `<IressSlideoutProvider />`.
|
|
476
|
+
|
|
477
|
+
[](./iframe.html?id=components-slideout-provider--provider)
|
|
478
|
+
|
|
479
|
+
Show slideout using provider
|
|
480
|
+
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
const SLIDEOUT\_ID \= 'storybook-slideout';
|
|
484
|
+
export const App \= (slideoutProps: IressSlideoutProps) \=> (
|
|
485
|
+
<IressSlideoutProvider\>
|
|
486
|
+
<SlideoutWithTrigger {...slideoutProps} />
|
|
487
|
+
</IressSlideoutProvider\>
|
|
488
|
+
);
|
|
489
|
+
const SlideoutWithTrigger \= ({
|
|
490
|
+
id \= SLIDEOUT\_ID,
|
|
491
|
+
...slideoutProps
|
|
492
|
+
}: IressSlideoutProps) \=> {
|
|
493
|
+
const { showSlideout } \= useSlideout();
|
|
494
|
+
return (
|
|
495
|
+
<\>
|
|
496
|
+
<IressButton onClick\={() \=> showSlideout(id)}\>
|
|
497
|
+
Show slideout using provider </IressButton\>
|
|
498
|
+
<IressSlideout
|
|
499
|
+
{...slideoutProps}
|
|
500
|
+
id\={id}
|
|
501
|
+
footer\={
|
|
502
|
+
<IressButton onClick\={() \=> showSlideout(id, false)}\>
|
|
503
|
+
Close slideout </IressButton\>
|
|
504
|
+
}
|
|
505
|
+
\>
|
|
506
|
+
{slideoutProps.children ?? 'Slideout content'}
|
|
507
|
+
</IressSlideout\>
|
|
508
|
+
</\>
|
|
509
|
+
);
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
#### Props
|
|
515
|
+
|
|
516
|
+
These are some settings you can use to customise the provider, such as setting where the slideouts are rendered in the DOM.
|
|
517
|
+
|
|
518
|
+
| Name | Description | Default | Control |
|
|
519
|
+
| --- | --- | --- | --- |
|
|
520
|
+
| children |
|
|
521
|
+
\-
|
|
522
|
+
|
|
523
|
+
| \- | \- |
|
|
524
|
+
| container |
|
|
525
|
+
|
|
526
|
+
The container element to render the slideout into. By default, the slideout will render at the end of the document body.
|
|
527
|
+
|
|
528
|
+
FloatingUIContainer
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
| \- | \- |
|
|
533
|
+
| injectPushStyles |
|
|
534
|
+
|
|
535
|
+
If you are rendering a slideout inside a micro-frontend, using `push` mode and `eleToPush` is targetting an element in the parent app, you will need to set this to `true` to ensure the styles are injected into the parent app. This will ensure the slideout is positioned correctly and the element is pushed correctly.
|
|
536
|
+
|
|
537
|
+
union
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
| \- | Set object |
|
|
542
|
+
| Show Storybook only itemsStorybook only | Show Storybook only items |
|
|
543
|
+
|
|
544
|
+
Examples
|
|
545
|
+
--------
|
|
546
|
+
|
|
547
|
+
### Modes
|
|
548
|
+
|
|
549
|
+
Slideouts can be used in two modes - `overlay` and `push`. In `overlay` mode the slideout sits on top of the content, useful if space is at a premium. In `push` mode the slideout will push the page container to make it smaller; this means you can see all of the page content when the page is available. Overlay is the default.
|
|
550
|
+
|
|
551
|
+
[](./iframe.html?id=components-slideout--modes)
|
|
552
|
+
|
|
553
|
+
Overlay slideoutPush slideout
|
|
554
|
+
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
const Story \= () \=> {
|
|
558
|
+
const { showSlideout } \= useSlideout();
|
|
559
|
+
const SLIDEOUT\_ID \= 'storybook-slideout';
|
|
560
|
+
return (
|
|
561
|
+
const Story \= () \=> {
|
|
562
|
+
const { showSlideout } \= useSlideout();
|
|
563
|
+
const SLIDEOUT\_ID \= 'storybook-slideout';
|
|
564
|
+
return (
|
|
565
|
+
<IressInline gutter\="md"\>
|
|
566
|
+
<IressButton onClick\={() \=> showSlideout("overlay")}\>
|
|
567
|
+
Overlay slideout </IressButton\>
|
|
568
|
+
<IressSlideout
|
|
569
|
+
footer\=""
|
|
570
|
+
id\="overlay"
|
|
571
|
+
mode\="overlay"
|
|
572
|
+
\>
|
|
573
|
+
<h2\>
|
|
574
|
+
Overlay </h2\>
|
|
575
|
+
For most situations{' '}
|
|
576
|
+
<code\>
|
|
577
|
+
overlay </code\>
|
|
578
|
+
{' '}will be what you need, which is why this is the default behaviour. You do not need to specify the mode if you want your slideout to sit on top of the page.
|
|
579
|
+
</IressSlideout\>
|
|
580
|
+
<IressButton onClick\={() \=> showSlideout("push")}\>
|
|
581
|
+
Push slideout </IressButton\>
|
|
582
|
+
<IressSlideout
|
|
583
|
+
eleToPush\="#storybook-docs"
|
|
584
|
+
footer\=""
|
|
585
|
+
id\="push"
|
|
586
|
+
mode\="push"
|
|
587
|
+
\>
|
|
588
|
+
<IressText\>
|
|
589
|
+
<h2\>
|
|
590
|
+
Push </h2\>
|
|
591
|
+
<p\>
|
|
592
|
+
If you have a data-heavy screen where you need all of the data to be visible when the slideout is open, use{' '}
|
|
593
|
+
<code\>
|
|
594
|
+
push </code\>
|
|
595
|
+
. To allow push to work you will need to supply the ID of the element that needs to be pushed via the{' '}
|
|
596
|
+
<code\>
|
|
597
|
+
eleToPush </code\>
|
|
598
|
+
{' '}prop. If the ID is not supplied, or the element cannot be found, the slideout will revert to{' '}
|
|
599
|
+
<code\>
|
|
600
|
+
overlay </code\>
|
|
601
|
+
{' '}behaviour.
|
|
602
|
+
</p\>
|
|
603
|
+
<p\>
|
|
604
|
+
{\`Be aware though that push will only work on larger screens (>1200px); on smaller screens the slideout will overlay the content.\`}
|
|
605
|
+
</p\>
|
|
606
|
+
</IressText\>
|
|
607
|
+
</IressSlideout\>
|
|
608
|
+
</IressInline\>
|
|
609
|
+
);
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
export const App \= () \=> (
|
|
613
|
+
<IressSlideoutProvider\>
|
|
614
|
+
<Story />
|
|
615
|
+
</IressSlideoutProvider\>
|
|
616
|
+
);
|
|
617
|
+
);
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
export const App \= () \=> (
|
|
621
|
+
<IressSlideoutProvider\>
|
|
622
|
+
<Story />
|
|
623
|
+
</IressSlideoutProvider\>
|
|
624
|
+
);
|
|
625
|
+
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
#### Props
|
|
629
|
+
|
|
630
|
+
| Name | Description | Default | Control |
|
|
631
|
+
| --- | --- | --- | --- |
|
|
632
|
+
| backdrop |
|
|
633
|
+
When set to `true` a backdrop will be displayed to cover the contents of the page. The slideout will then become the only element that can be interacted with.
|
|
634
|
+
|
|
635
|
+
boolean
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
| \- | Set boolean |
|
|
640
|
+
| children |
|
|
641
|
+
|
|
642
|
+
Content to be displayed within the slideout.
|
|
643
|
+
|
|
644
|
+
ReactNode
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
| \- | \- |
|
|
649
|
+
| closeText |
|
|
650
|
+
|
|
651
|
+
Screenreader text for close button.
|
|
652
|
+
|
|
653
|
+
string
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
|
|
|
658
|
+
|
|
659
|
+
'Close'
|
|
660
|
+
|
|
661
|
+
| Set string |
|
|
662
|
+
| container |
|
|
663
|
+
|
|
664
|
+
The container element to render the slideout into. By default, the slideout will render at the end of the document body.
|
|
665
|
+
|
|
666
|
+
FloatingUIContainer
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
| \- | Set object |
|
|
671
|
+
| defaultShow |
|
|
672
|
+
|
|
673
|
+
When set to `true` the slideout will be visible. Use for uncontrolled slideouts.
|
|
674
|
+
|
|
675
|
+
boolean
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
|
|
|
680
|
+
|
|
681
|
+
false
|
|
682
|
+
|
|
683
|
+
| Set boolean |
|
|
684
|
+
| eleToPush |
|
|
685
|
+
|
|
686
|
+
The element that needs to be pushed relative to the slideout. This can be a string selector to match an existing element in the DOM, a html element, or a React reference. Will be ignored if `mode` is not set to `push` or if element does not exist.
|
|
687
|
+
|
|
688
|
+
union
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
| \- | Set object |
|
|
693
|
+
| footer |
|
|
694
|
+
|
|
695
|
+
Panel to place slideout controls.
|
|
696
|
+
|
|
697
|
+
ReactNode
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
| \- |
|
|
702
|
+
|
|
703
|
+
""
|
|
704
|
+
|
|
705
|
+
|
|
|
706
|
+
| heading |
|
|
707
|
+
|
|
708
|
+
Sets the heading for the slideout. If passed an element, it will render the element with an id, to ensure its connection to the slideout.
|
|
709
|
+
|
|
710
|
+
union
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
| \- | Set object |
|
|
715
|
+
| id |
|
|
716
|
+
|
|
717
|
+
Unique ID for the slideout. Use if you would like to open this slideout from anywhere in your app using the `useSlideout` hook.
|
|
718
|
+
|
|
719
|
+
string
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
| \- | \- |
|
|
724
|
+
| mode |
|
|
725
|
+
|
|
726
|
+
Sets how the Slideout interacts with the content of the page. `overlay` overlays the page content, obscuring the content below. `push` will push the element (specified by `eleToPush`) across the page. `push` will revert back to `overlay` if `eleToPush` is not specified or if the screen size < 1200px.
|
|
727
|
+
|
|
728
|
+
union
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
|
|
|
733
|
+
|
|
734
|
+
'overlay'
|
|
735
|
+
|
|
736
|
+
| \- |
|
|
737
|
+
| onEntered |
|
|
738
|
+
|
|
739
|
+
Emitted when the slideout has opened.
|
|
740
|
+
|
|
741
|
+
() => void
|
|
742
|
+
|
|
743
|
+
| \- | \- |
|
|
744
|
+
| onExited |
|
|
745
|
+
|
|
746
|
+
Emitted when the slideout has closed.
|
|
747
|
+
|
|
748
|
+
() => void
|
|
749
|
+
|
|
750
|
+
| \- | \- |
|
|
751
|
+
| onShowChange |
|
|
752
|
+
|
|
753
|
+
Emitted when the slideout has opened or closed internally. Use for controlled slideouts.
|
|
754
|
+
|
|
755
|
+
(show: boolean, reason?: OpenChangeReason) => void
|
|
756
|
+
|
|
757
|
+
| \- | \- |
|
|
758
|
+
| onStatus |
|
|
759
|
+
|
|
760
|
+
Emitted when the slideout has mounted, unmounted, opened or closed. Open and close occur before animation begins.
|
|
761
|
+
|
|
762
|
+
(status: 'unmounted' | 'initial' | 'open' | 'close') => void
|
|
763
|
+
|
|
764
|
+
| \- | \- |
|
|
765
|
+
| padding |
|
|
766
|
+
|
|
767
|
+
Sets the padding of the wrapping panel component.
|
|
768
|
+
|
|
769
|
+
union
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
|
|
|
774
|
+
|
|
775
|
+
'md'
|
|
776
|
+
|
|
777
|
+
| Set object |
|
|
778
|
+
| position |
|
|
779
|
+
|
|
780
|
+
Position of the slideout relative to the page. `left` or `right`.
|
|
781
|
+
|
|
782
|
+
union
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
|
|
|
787
|
+
|
|
788
|
+
'right'
|
|
789
|
+
|
|
790
|
+
| Set object |
|
|
791
|
+
| show |
|
|
792
|
+
|
|
793
|
+
When set to `true` the slideout will be visible. Use for controlled slideouts.
|
|
794
|
+
|
|
795
|
+
boolean
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
| \- | \- |
|
|
800
|
+
| size |
|
|
801
|
+
|
|
802
|
+
Accepts a single `SlideoutSize`. Slideouts will display at 100% for mobile screens (<576px).
|
|
803
|
+
|
|
804
|
+
union
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
|
|
|
809
|
+
|
|
810
|
+
'sm'
|
|
811
|
+
|
|
812
|
+
| Set object |
|
|
813
|
+
|
|
814
|
+
### Position
|
|
815
|
+
|
|
816
|
+
Slideouts can appear from the left or the right of the screen. The default is right, but you can use the `position` prop to set it to slide in from the left.
|
|
817
|
+
|
|
818
|
+
[](./iframe.html?id=components-slideout--position)
|
|
819
|
+
|
|
820
|
+
rightleft
|
|
821
|
+
|
|
822
|
+
```
|
|
823
|
+
|
|
824
|
+
const Slideouts \= () \=> {
|
|
825
|
+
const { showSlideout } \= useSlideout();
|
|
826
|
+
return (
|
|
827
|
+
<IressInline gutter\="md"\>
|
|
828
|
+
{SLIDEOUT\_POSITIONS.map((position) \=> (
|
|
829
|
+
<\>
|
|
830
|
+
<IressButton onClick\={() \=> showSlideout(position)}\>
|
|
831
|
+
{position}
|
|
832
|
+
</IressButton\>
|
|
833
|
+
<IressSlideout id\={position} position\={position}\>
|
|
834
|
+
Slideout opened on the {position}
|
|
835
|
+
</IressSlideout\>
|
|
836
|
+
</\>
|
|
837
|
+
))}
|
|
838
|
+
</IressInline\>
|
|
839
|
+
);
|
|
840
|
+
};
|
|
841
|
+
export const SlideoutPositions \= () \=> (
|
|
842
|
+
<IressSlideoutProvider\>
|
|
843
|
+
<Slideouts />
|
|
844
|
+
</IressSlideoutProvider\>
|
|
845
|
+
);
|
|
846
|
+
|
|
847
|
+
```
|
|
848
|
+
|
|
849
|
+
#### Props
|
|
850
|
+
|
|
851
|
+
| Name | Description | Default | Control |
|
|
852
|
+
| --- | --- | --- | --- |
|
|
853
|
+
| backdrop |
|
|
854
|
+
When set to `true` a backdrop will be displayed to cover the contents of the page. The slideout will then become the only element that can be interacted with.
|
|
855
|
+
|
|
856
|
+
boolean
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
| \- | Set boolean |
|
|
861
|
+
| children |
|
|
862
|
+
|
|
863
|
+
Content to be displayed within the slideout.
|
|
864
|
+
|
|
865
|
+
ReactNode
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
| \- | \- |
|
|
870
|
+
| closeText |
|
|
871
|
+
|
|
872
|
+
Screenreader text for close button.
|
|
873
|
+
|
|
874
|
+
string
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
|
|
|
879
|
+
|
|
880
|
+
'Close'
|
|
881
|
+
|
|
882
|
+
| Set string |
|
|
883
|
+
| container |
|
|
884
|
+
|
|
885
|
+
The container element to render the slideout into. By default, the slideout will render at the end of the document body.
|
|
886
|
+
|
|
887
|
+
FloatingUIContainer
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
| \- | Set object |
|
|
892
|
+
| defaultShow |
|
|
893
|
+
|
|
894
|
+
When set to `true` the slideout will be visible. Use for uncontrolled slideouts.
|
|
895
|
+
|
|
896
|
+
boolean
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
|
|
|
901
|
+
|
|
902
|
+
false
|
|
903
|
+
|
|
904
|
+
| Set boolean |
|
|
905
|
+
| eleToPush |
|
|
906
|
+
|
|
907
|
+
The element that needs to be pushed relative to the slideout. This can be a string selector to match an existing element in the DOM, a html element, or a React reference. Will be ignored if `mode` is not set to `push` or if element does not exist.
|
|
908
|
+
|
|
909
|
+
union
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
| \- | Set object |
|
|
914
|
+
| footer |
|
|
915
|
+
|
|
916
|
+
Panel to place slideout controls.
|
|
917
|
+
|
|
918
|
+
ReactNode
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
| \- |
|
|
923
|
+
|
|
924
|
+
"Footer slot"
|
|
925
|
+
|
|
926
|
+
|
|
|
927
|
+
| heading |
|
|
928
|
+
|
|
929
|
+
Sets the heading for the slideout. If passed an element, it will render the element with an id, to ensure its connection to the slideout.
|
|
930
|
+
|
|
931
|
+
union
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
| \- | Set object |
|
|
936
|
+
| id |
|
|
937
|
+
|
|
938
|
+
Unique ID for the slideout. Use if you would like to open this slideout from anywhere in your app using the `useSlideout` hook.
|
|
939
|
+
|
|
940
|
+
string
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
| \- | storybook-slideout |
|
|
945
|
+
| mode |
|
|
946
|
+
|
|
947
|
+
Sets how the Slideout interacts with the content of the page. `overlay` overlays the page content, obscuring the content below. `push` will push the element (specified by `eleToPush`) across the page. `push` will revert back to `overlay` if `eleToPush` is not specified or if the screen size < 1200px.
|
|
948
|
+
|
|
949
|
+
union
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
|
|
954
|
+
|
|
955
|
+
'overlay'
|
|
956
|
+
|
|
957
|
+
| Set object |
|
|
958
|
+
| onEntered |
|
|
959
|
+
|
|
960
|
+
Emitted when the slideout has opened.
|
|
961
|
+
|
|
962
|
+
() => void
|
|
963
|
+
|
|
964
|
+
| \- | \- |
|
|
965
|
+
| onExited |
|
|
966
|
+
|
|
967
|
+
Emitted when the slideout has closed.
|
|
968
|
+
|
|
969
|
+
() => void
|
|
970
|
+
|
|
971
|
+
| \- | \- |
|
|
972
|
+
| onShowChange |
|
|
973
|
+
|
|
974
|
+
Emitted when the slideout has opened or closed internally. Use for controlled slideouts.
|
|
975
|
+
|
|
976
|
+
(show: boolean, reason?: OpenChangeReason) => void
|
|
977
|
+
|
|
978
|
+
| \- | \- |
|
|
979
|
+
| onStatus |
|
|
980
|
+
|
|
981
|
+
Emitted when the slideout has mounted, unmounted, opened or closed. Open and close occur before animation begins.
|
|
982
|
+
|
|
983
|
+
(status: 'unmounted' | 'initial' | 'open' | 'close') => void
|
|
984
|
+
|
|
985
|
+
| \- | \- |
|
|
986
|
+
| padding |
|
|
987
|
+
|
|
988
|
+
Sets the padding of the wrapping panel component.
|
|
989
|
+
|
|
990
|
+
union
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
|
|
|
995
|
+
|
|
996
|
+
'md'
|
|
997
|
+
|
|
998
|
+
| Set object |
|
|
999
|
+
| position |
|
|
1000
|
+
|
|
1001
|
+
Position of the slideout relative to the page. `left` or `right`.
|
|
1002
|
+
|
|
1003
|
+
union
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
|
|
|
1008
|
+
|
|
1009
|
+
'right'
|
|
1010
|
+
|
|
1011
|
+
| Set object |
|
|
1012
|
+
| show |
|
|
1013
|
+
|
|
1014
|
+
When set to `true` the slideout will be visible. Use for controlled slideouts.
|
|
1015
|
+
|
|
1016
|
+
boolean
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
| \- | \- |
|
|
1021
|
+
| size |
|
|
1022
|
+
|
|
1023
|
+
Accepts a single `SlideoutSize`. Slideouts will display at 100% for mobile screens (<576px).
|
|
1024
|
+
|
|
1025
|
+
union
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
|
|
1029
|
+
|
|
|
1030
|
+
|
|
1031
|
+
'sm'
|
|
1032
|
+
|
|
1033
|
+
| Set object |
|
|
1034
|
+
|
|
1035
|
+
### Backdrop
|
|
1036
|
+
|
|
1037
|
+
Slideouts can be used with or without a backdrop. Using a backdrop places more emphasis on the slideout, but prevents users from accessing content on the rest of the page. If your users need to interact with page content (for example to copy information), don't use a backdrop.
|
|
1038
|
+
|
|
1039
|
+
The slideout backdrop works in the same way as the modal backdrop; clicking on the backdrop will close the slideout.
|
|
1040
|
+
|
|
1041
|
+
[](./iframe.html?id=components-slideout--backdrop)
|
|
1042
|
+
|
|
1043
|
+
Show slideout with backdrop
|
|
1044
|
+
|
|
1045
|
+
```
|
|
1046
|
+
|
|
1047
|
+
const Story \= () \=> {
|
|
1048
|
+
const { showSlideout } \= useSlideout();
|
|
1049
|
+
const SLIDEOUT\_ID \= 'storybook-slideout';
|
|
1050
|
+
return (
|
|
1051
|
+
const Story \= () \=> {
|
|
1052
|
+
const { showSlideout } \= useSlideout();
|
|
1053
|
+
const SLIDEOUT\_ID \= 'storybook-slideout';
|
|
1054
|
+
return (
|
|
1055
|
+
<\>
|
|
1056
|
+
<IressButton onClick\={() \=> showSlideout(SLIDEOUT\_ID)}\>
|
|
1057
|
+
Show slideout with backdrop </IressButton\>
|
|
1058
|
+
<IressSlideout
|
|
1059
|
+
backdrop
|
|
1060
|
+
footer\="Footer slot"
|
|
1061
|
+
id\="storybook-slideout"
|
|
1062
|
+
\>
|
|
1063
|
+
Slideout content </IressSlideout\>
|
|
1064
|
+
</\>
|
|
1065
|
+
);
|
|
1066
|
+
};
|
|
1067
|
+
|
|
1068
|
+
export const App \= () \=> (
|
|
1069
|
+
<IressSlideoutProvider\>
|
|
1070
|
+
<Story />
|
|
1071
|
+
</IressSlideoutProvider\>
|
|
1072
|
+
);
|
|
1073
|
+
);
|
|
1074
|
+
};
|
|
1075
|
+
|
|
1076
|
+
export const App \= () \=> (
|
|
1077
|
+
<IressSlideoutProvider\>
|
|
1078
|
+
<Story />
|
|
1079
|
+
</IressSlideoutProvider\>
|
|
1080
|
+
);
|
|
1081
|
+
|
|
1082
|
+
```
|
|
1083
|
+
|
|
1084
|
+
#### Props
|
|
1085
|
+
|
|
1086
|
+
| Name | Description | Default | Control |
|
|
1087
|
+
| --- | --- | --- | --- |
|
|
1088
|
+
| backdrop |
|
|
1089
|
+
When set to `true` a backdrop will be displayed to cover the contents of the page. The slideout will then become the only element that can be interacted with.
|
|
1090
|
+
|
|
1091
|
+
boolean
|
|
1092
|
+
|
|
1093
|
+
|
|
1094
|
+
|
|
1095
|
+
| \- | FalseTrue |
|
|
1096
|
+
| children |
|
|
1097
|
+
|
|
1098
|
+
Content to be displayed within the slideout.
|
|
1099
|
+
|
|
1100
|
+
ReactNode
|
|
1101
|
+
|
|
1102
|
+
|
|
1103
|
+
|
|
1104
|
+
| \- |
|
|
1105
|
+
|
|
1106
|
+
"Slideout content"
|
|
1107
|
+
|
|
1108
|
+
|
|
|
1109
|
+
| closeText |
|
|
1110
|
+
|
|
1111
|
+
Screenreader text for close button.
|
|
1112
|
+
|
|
1113
|
+
string
|
|
1114
|
+
|
|
1115
|
+
|
|
1116
|
+
|
|
1117
|
+
|
|
|
1118
|
+
|
|
1119
|
+
'Close'
|
|
1120
|
+
|
|
1121
|
+
| Set string |
|
|
1122
|
+
| container |
|
|
1123
|
+
|
|
1124
|
+
The container element to render the slideout into. By default, the slideout will render at the end of the document body.
|
|
1125
|
+
|
|
1126
|
+
FloatingUIContainer
|
|
1127
|
+
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
| \- | Set object |
|
|
1131
|
+
| defaultShow |
|
|
1132
|
+
|
|
1133
|
+
When set to `true` the slideout will be visible. Use for uncontrolled slideouts.
|
|
1134
|
+
|
|
1135
|
+
boolean
|
|
1136
|
+
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
|
|
|
1140
|
+
|
|
1141
|
+
false
|
|
1142
|
+
|
|
1143
|
+
| Set boolean |
|
|
1144
|
+
| eleToPush |
|
|
1145
|
+
|
|
1146
|
+
The element that needs to be pushed relative to the slideout. This can be a string selector to match an existing element in the DOM, a html element, or a React reference. Will be ignored if `mode` is not set to `push` or if element does not exist.
|
|
1147
|
+
|
|
1148
|
+
union
|
|
1149
|
+
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
| \- | Set object |
|
|
1153
|
+
| footer |
|
|
1154
|
+
|
|
1155
|
+
Panel to place slideout controls.
|
|
1156
|
+
|
|
1157
|
+
ReactNode
|
|
1158
|
+
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
| \- |
|
|
1162
|
+
|
|
1163
|
+
"Footer slot"
|
|
1164
|
+
|
|
1165
|
+
|
|
|
1166
|
+
| heading |
|
|
1167
|
+
|
|
1168
|
+
Sets the heading for the slideout. If passed an element, it will render the element with an id, to ensure its connection to the slideout.
|
|
1169
|
+
|
|
1170
|
+
union
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
| \- | Set object |
|
|
1175
|
+
| id |
|
|
1176
|
+
|
|
1177
|
+
Unique ID for the slideout. Use if you would like to open this slideout from anywhere in your app using the `useSlideout` hook.
|
|
1178
|
+
|
|
1179
|
+
string
|
|
1180
|
+
|
|
1181
|
+
|
|
1182
|
+
|
|
1183
|
+
| \- | storybook-slideout |
|
|
1184
|
+
| mode |
|
|
1185
|
+
|
|
1186
|
+
Sets how the Slideout interacts with the content of the page. `overlay` overlays the page content, obscuring the content below. `push` will push the element (specified by `eleToPush`) across the page. `push` will revert back to `overlay` if `eleToPush` is not specified or if the screen size < 1200px.
|
|
1187
|
+
|
|
1188
|
+
union
|
|
1189
|
+
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
|
|
|
1193
|
+
|
|
1194
|
+
'overlay'
|
|
1195
|
+
|
|
1196
|
+
| Set object |
|
|
1197
|
+
| onEntered |
|
|
1198
|
+
|
|
1199
|
+
Emitted when the slideout has opened.
|
|
1200
|
+
|
|
1201
|
+
() => void
|
|
1202
|
+
|
|
1203
|
+
| \- | \- |
|
|
1204
|
+
| onExited |
|
|
1205
|
+
|
|
1206
|
+
Emitted when the slideout has closed.
|
|
1207
|
+
|
|
1208
|
+
() => void
|
|
1209
|
+
|
|
1210
|
+
| \- | \- |
|
|
1211
|
+
| onShowChange |
|
|
1212
|
+
|
|
1213
|
+
Emitted when the slideout has opened or closed internally. Use for controlled slideouts.
|
|
1214
|
+
|
|
1215
|
+
(show: boolean, reason?: OpenChangeReason) => void
|
|
1216
|
+
|
|
1217
|
+
| \- | \- |
|
|
1218
|
+
| onStatus |
|
|
1219
|
+
|
|
1220
|
+
Emitted when the slideout has mounted, unmounted, opened or closed. Open and close occur before animation begins.
|
|
1221
|
+
|
|
1222
|
+
(status: 'unmounted' | 'initial' | 'open' | 'close') => void
|
|
1223
|
+
|
|
1224
|
+
| \- | \- |
|
|
1225
|
+
| padding |
|
|
1226
|
+
|
|
1227
|
+
Sets the padding of the wrapping panel component.
|
|
1228
|
+
|
|
1229
|
+
union
|
|
1230
|
+
|
|
1231
|
+
|
|
1232
|
+
|
|
1233
|
+
|
|
|
1234
|
+
|
|
1235
|
+
'md'
|
|
1236
|
+
|
|
1237
|
+
| Set object |
|
|
1238
|
+
| position |
|
|
1239
|
+
|
|
1240
|
+
Position of the slideout relative to the page. `left` or `right`.
|
|
1241
|
+
|
|
1242
|
+
union
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
|
|
|
1247
|
+
|
|
1248
|
+
'right'
|
|
1249
|
+
|
|
1250
|
+
| Set object |
|
|
1251
|
+
| show |
|
|
1252
|
+
|
|
1253
|
+
When set to `true` the slideout will be visible. Use for controlled slideouts.
|
|
1254
|
+
|
|
1255
|
+
boolean
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
| \- | \- |
|
|
1260
|
+
| size |
|
|
1261
|
+
|
|
1262
|
+
Accepts a single `SlideoutSize`. Slideouts will display at 100% for mobile screens (<576px).
|
|
1263
|
+
|
|
1264
|
+
union
|
|
1265
|
+
|
|
1266
|
+
|
|
1267
|
+
|
|
1268
|
+
|
|
|
1269
|
+
|
|
1270
|
+
'sm'
|
|
1271
|
+
|
|
1272
|
+
| Set object |
|
|
1273
|
+
|
|
1274
|
+
### Size
|
|
1275
|
+
|
|
1276
|
+
The width of your slideout can be set using the `size` prop. By default it is `sm`, but it can be made larger by setting `size` to `md` or `lg`.
|
|
1277
|
+
|
|
1278
|
+
[](./iframe.html?id=components-slideout--size)
|
|
1279
|
+
|
|
1280
|
+
smmdlg
|
|
1281
|
+
|
|
1282
|
+
```
|
|
1283
|
+
|
|
1284
|
+
const Slideouts \= () \=> {
|
|
1285
|
+
const { showSlideout } \= useSlideout();
|
|
1286
|
+
return (
|
|
1287
|
+
<IressInline gutter\="md"\>
|
|
1288
|
+
{SLIDEOUT\_SIZES.map((size) \=> (
|
|
1289
|
+
<\>
|
|
1290
|
+
<IressButton onClick\={() \=> showSlideout(size)}\>{size}</IressButton\>
|
|
1291
|
+
<IressSlideout id\={size} size\={size}\>
|
|
1292
|
+
{size} slideout </IressSlideout\>
|
|
1293
|
+
</\>
|
|
1294
|
+
))}
|
|
1295
|
+
</IressInline\>
|
|
1296
|
+
);
|
|
1297
|
+
};
|
|
1298
|
+
export const SlideoutSizes \= () \=> (
|
|
1299
|
+
<IressSlideoutProvider\>
|
|
1300
|
+
<Slideouts />
|
|
1301
|
+
</IressSlideoutProvider\>
|
|
1302
|
+
);
|
|
1303
|
+
|
|
1304
|
+
```
|
|
1305
|
+
|
|
1306
|
+
#### Props
|
|
1307
|
+
|
|
1308
|
+
| Name | Description | Default | Control |
|
|
1309
|
+
| --- | --- | --- | --- |
|
|
1310
|
+
| backdrop |
|
|
1311
|
+
When set to `true` a backdrop will be displayed to cover the contents of the page. The slideout will then become the only element that can be interacted with.
|
|
1312
|
+
|
|
1313
|
+
boolean
|
|
1314
|
+
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
| \- | Set boolean |
|
|
1318
|
+
| children |
|
|
1319
|
+
|
|
1320
|
+
Content to be displayed within the slideout.
|
|
1321
|
+
|
|
1322
|
+
ReactNode
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
|
|
1326
|
+
| \- | \- |
|
|
1327
|
+
| closeText |
|
|
1328
|
+
|
|
1329
|
+
Screenreader text for close button.
|
|
1330
|
+
|
|
1331
|
+
string
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
|
|
|
1336
|
+
|
|
1337
|
+
'Close'
|
|
1338
|
+
|
|
1339
|
+
| Set string |
|
|
1340
|
+
| container |
|
|
1341
|
+
|
|
1342
|
+
The container element to render the slideout into. By default, the slideout will render at the end of the document body.
|
|
1343
|
+
|
|
1344
|
+
FloatingUIContainer
|
|
1345
|
+
|
|
1346
|
+
|
|
1347
|
+
|
|
1348
|
+
| \- | Set object |
|
|
1349
|
+
| defaultShow |
|
|
1350
|
+
|
|
1351
|
+
When set to `true` the slideout will be visible. Use for uncontrolled slideouts.
|
|
1352
|
+
|
|
1353
|
+
boolean
|
|
1354
|
+
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
|
|
|
1358
|
+
|
|
1359
|
+
false
|
|
1360
|
+
|
|
1361
|
+
| Set boolean |
|
|
1362
|
+
| eleToPush |
|
|
1363
|
+
|
|
1364
|
+
The element that needs to be pushed relative to the slideout. This can be a string selector to match an existing element in the DOM, a html element, or a React reference. Will be ignored if `mode` is not set to `push` or if element does not exist.
|
|
1365
|
+
|
|
1366
|
+
union
|
|
1367
|
+
|
|
1368
|
+
|
|
1369
|
+
|
|
1370
|
+
| \- | Set object |
|
|
1371
|
+
| footer |
|
|
1372
|
+
|
|
1373
|
+
Panel to place slideout controls.
|
|
1374
|
+
|
|
1375
|
+
ReactNode
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
| \- |
|
|
1380
|
+
|
|
1381
|
+
"Size slideout footer"
|
|
1382
|
+
|
|
1383
|
+
|
|
|
1384
|
+
| heading |
|
|
1385
|
+
|
|
1386
|
+
Sets the heading for the slideout. If passed an element, it will render the element with an id, to ensure its connection to the slideout.
|
|
1387
|
+
|
|
1388
|
+
union
|
|
1389
|
+
|
|
1390
|
+
|
|
1391
|
+
|
|
1392
|
+
| \- | Set object |
|
|
1393
|
+
| id |
|
|
1394
|
+
|
|
1395
|
+
Unique ID for the slideout. Use if you would like to open this slideout from anywhere in your app using the `useSlideout` hook.
|
|
1396
|
+
|
|
1397
|
+
string
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+
|
|
1401
|
+
| \- | \- |
|
|
1402
|
+
| mode |
|
|
1403
|
+
|
|
1404
|
+
Sets how the Slideout interacts with the content of the page. `overlay` overlays the page content, obscuring the content below. `push` will push the element (specified by `eleToPush`) across the page. `push` will revert back to `overlay` if `eleToPush` is not specified or if the screen size < 1200px.
|
|
1405
|
+
|
|
1406
|
+
union
|
|
1407
|
+
|
|
1408
|
+
|
|
1409
|
+
|
|
1410
|
+
|
|
|
1411
|
+
|
|
1412
|
+
'overlay'
|
|
1413
|
+
|
|
1414
|
+
| Set object |
|
|
1415
|
+
| onEntered |
|
|
1416
|
+
|
|
1417
|
+
Emitted when the slideout has opened.
|
|
1418
|
+
|
|
1419
|
+
() => void
|
|
1420
|
+
|
|
1421
|
+
| \- | \- |
|
|
1422
|
+
| onExited |
|
|
1423
|
+
|
|
1424
|
+
Emitted when the slideout has closed.
|
|
1425
|
+
|
|
1426
|
+
() => void
|
|
1427
|
+
|
|
1428
|
+
| \- | \- |
|
|
1429
|
+
| onShowChange |
|
|
1430
|
+
|
|
1431
|
+
Emitted when the slideout has opened or closed internally. Use for controlled slideouts.
|
|
1432
|
+
|
|
1433
|
+
(show: boolean, reason?: OpenChangeReason) => void
|
|
1434
|
+
|
|
1435
|
+
| \- | \- |
|
|
1436
|
+
| onStatus |
|
|
1437
|
+
|
|
1438
|
+
Emitted when the slideout has mounted, unmounted, opened or closed. Open and close occur before animation begins.
|
|
1439
|
+
|
|
1440
|
+
(status: 'unmounted' | 'initial' | 'open' | 'close') => void
|
|
1441
|
+
|
|
1442
|
+
| \- | \- |
|
|
1443
|
+
| padding |
|
|
1444
|
+
|
|
1445
|
+
Sets the padding of the wrapping panel component.
|
|
1446
|
+
|
|
1447
|
+
union
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
|
|
|
1452
|
+
|
|
1453
|
+
'md'
|
|
1454
|
+
|
|
1455
|
+
| Set object |
|
|
1456
|
+
| position |
|
|
1457
|
+
|
|
1458
|
+
Position of the slideout relative to the page. `left` or `right`.
|
|
1459
|
+
|
|
1460
|
+
union
|
|
1461
|
+
|
|
1462
|
+
|
|
1463
|
+
|
|
1464
|
+
|
|
|
1465
|
+
|
|
1466
|
+
'right'
|
|
1467
|
+
|
|
1468
|
+
| Set object |
|
|
1469
|
+
| show |
|
|
1470
|
+
|
|
1471
|
+
When set to `true` the slideout will be visible. Use for controlled slideouts.
|
|
1472
|
+
|
|
1473
|
+
boolean
|
|
1474
|
+
|
|
1475
|
+
|
|
1476
|
+
|
|
1477
|
+
| \- | \- |
|
|
1478
|
+
| size |
|
|
1479
|
+
|
|
1480
|
+
Accepts a single `SlideoutSize`. Slideouts will display at 100% for mobile screens (<576px).
|
|
1481
|
+
|
|
1482
|
+
union
|
|
1483
|
+
|
|
1484
|
+
|
|
1485
|
+
|
|
1486
|
+
|
|
|
1487
|
+
|
|
1488
|
+
'sm'
|
|
1489
|
+
|
|
1490
|
+
| \- |
|
|
1491
|
+
|
|
1492
|
+
### Padding
|
|
1493
|
+
|
|
1494
|
+
Slideout padding follows the panel padding convention. It can be set to either `none`, `sm`, `md` or `lg`, and defaults to `md` if not set.
|
|
1495
|
+
|
|
1496
|
+
[](./iframe.html?id=components-slideout--padding)
|
|
1497
|
+
|
|
1498
|
+
nonesmmdlg
|
|
1499
|
+
|
|
1500
|
+
```
|
|
1501
|
+
|
|
1502
|
+
const Slideouts \= () \=> {
|
|
1503
|
+
const { showSlideout } \= useSlideout();
|
|
1504
|
+
return (
|
|
1505
|
+
<IressInline gutter\="md"\>
|
|
1506
|
+
{PADDING\_SIZES.map((padding) \=> (
|
|
1507
|
+
<\>
|
|
1508
|
+
<IressButton onClick\={() \=> showSlideout(padding)}\>
|
|
1509
|
+
{padding}
|
|
1510
|
+
</IressButton\>
|
|
1511
|
+
<IressSlideout id\={padding} padding\={padding}\>
|
|
1512
|
+
Slideout opened with {padding} padding </IressSlideout\>
|
|
1513
|
+
</\>
|
|
1514
|
+
))}
|
|
1515
|
+
</IressInline\>
|
|
1516
|
+
);
|
|
1517
|
+
};
|
|
1518
|
+
export const SlideoutPaddings \= () \=> (
|
|
1519
|
+
<IressSlideoutProvider\>
|
|
1520
|
+
<Slideouts />
|
|
1521
|
+
</IressSlideoutProvider\>
|
|
1522
|
+
);
|
|
1523
|
+
|
|
1524
|
+
```
|
|
1525
|
+
|
|
1526
|
+
#### Props
|
|
1527
|
+
|
|
1528
|
+
| Name | Description | Default | Control |
|
|
1529
|
+
| --- | --- | --- | --- |
|
|
1530
|
+
| backdrop |
|
|
1531
|
+
When set to `true` a backdrop will be displayed to cover the contents of the page. The slideout will then become the only element that can be interacted with.
|
|
1532
|
+
|
|
1533
|
+
boolean
|
|
1534
|
+
|
|
1535
|
+
|
|
1536
|
+
|
|
1537
|
+
| \- | Set boolean |
|
|
1538
|
+
| children |
|
|
1539
|
+
|
|
1540
|
+
Content to be displayed within the slideout.
|
|
1541
|
+
|
|
1542
|
+
ReactNode
|
|
1543
|
+
|
|
1544
|
+
|
|
1545
|
+
|
|
1546
|
+
| \- | \- |
|
|
1547
|
+
| closeText |
|
|
1548
|
+
|
|
1549
|
+
Screenreader text for close button.
|
|
1550
|
+
|
|
1551
|
+
string
|
|
1552
|
+
|
|
1553
|
+
|
|
1554
|
+
|
|
1555
|
+
|
|
|
1556
|
+
|
|
1557
|
+
'Close'
|
|
1558
|
+
|
|
1559
|
+
| Set string |
|
|
1560
|
+
| container |
|
|
1561
|
+
|
|
1562
|
+
The container element to render the slideout into. By default, the slideout will render at the end of the document body.
|
|
1563
|
+
|
|
1564
|
+
FloatingUIContainer
|
|
1565
|
+
|
|
1566
|
+
|
|
1567
|
+
|
|
1568
|
+
| \- | Set object |
|
|
1569
|
+
| defaultShow |
|
|
1570
|
+
|
|
1571
|
+
When set to `true` the slideout will be visible. Use for uncontrolled slideouts.
|
|
1572
|
+
|
|
1573
|
+
boolean
|
|
1574
|
+
|
|
1575
|
+
|
|
1576
|
+
|
|
1577
|
+
|
|
|
1578
|
+
|
|
1579
|
+
false
|
|
1580
|
+
|
|
1581
|
+
| Set boolean |
|
|
1582
|
+
| eleToPush |
|
|
1583
|
+
|
|
1584
|
+
The element that needs to be pushed relative to the slideout. This can be a string selector to match an existing element in the DOM, a html element, or a React reference. Will be ignored if `mode` is not set to `push` or if element does not exist.
|
|
1585
|
+
|
|
1586
|
+
union
|
|
1587
|
+
|
|
1588
|
+
|
|
1589
|
+
|
|
1590
|
+
| \- | Set object |
|
|
1591
|
+
| footer |
|
|
1592
|
+
|
|
1593
|
+
Panel to place slideout controls.
|
|
1594
|
+
|
|
1595
|
+
ReactNode
|
|
1596
|
+
|
|
1597
|
+
|
|
1598
|
+
|
|
1599
|
+
| \- |
|
|
1600
|
+
|
|
1601
|
+
""
|
|
1602
|
+
|
|
1603
|
+
|
|
|
1604
|
+
| heading |
|
|
1605
|
+
|
|
1606
|
+
Sets the heading for the slideout. If passed an element, it will render the element with an id, to ensure its connection to the slideout.
|
|
1607
|
+
|
|
1608
|
+
union
|
|
1609
|
+
|
|
1610
|
+
|
|
1611
|
+
|
|
1612
|
+
| \- | Set object |
|
|
1613
|
+
| id |
|
|
1614
|
+
|
|
1615
|
+
Unique ID for the slideout. Use if you would like to open this slideout from anywhere in your app using the `useSlideout` hook.
|
|
1616
|
+
|
|
1617
|
+
string
|
|
1618
|
+
|
|
1619
|
+
|
|
1620
|
+
|
|
1621
|
+
| \- | \- |
|
|
1622
|
+
| mode |
|
|
1623
|
+
|
|
1624
|
+
Sets how the Slideout interacts with the content of the page. `overlay` overlays the page content, obscuring the content below. `push` will push the element (specified by `eleToPush`) across the page. `push` will revert back to `overlay` if `eleToPush` is not specified or if the screen size < 1200px.
|
|
1625
|
+
|
|
1626
|
+
union
|
|
1627
|
+
|
|
1628
|
+
|
|
1629
|
+
|
|
1630
|
+
|
|
|
1631
|
+
|
|
1632
|
+
'overlay'
|
|
1633
|
+
|
|
1634
|
+
| Set object |
|
|
1635
|
+
| onEntered |
|
|
1636
|
+
|
|
1637
|
+
Emitted when the slideout has opened.
|
|
1638
|
+
|
|
1639
|
+
() => void
|
|
1640
|
+
|
|
1641
|
+
| \- | \- |
|
|
1642
|
+
| onExited |
|
|
1643
|
+
|
|
1644
|
+
Emitted when the slideout has closed.
|
|
1645
|
+
|
|
1646
|
+
() => void
|
|
1647
|
+
|
|
1648
|
+
| \- | \- |
|
|
1649
|
+
| onShowChange |
|
|
1650
|
+
|
|
1651
|
+
Emitted when the slideout has opened or closed internally. Use for controlled slideouts.
|
|
1652
|
+
|
|
1653
|
+
(show: boolean, reason?: OpenChangeReason) => void
|
|
1654
|
+
|
|
1655
|
+
| \- | \- |
|
|
1656
|
+
| onStatus |
|
|
1657
|
+
|
|
1658
|
+
Emitted when the slideout has mounted, unmounted, opened or closed. Open and close occur before animation begins.
|
|
1659
|
+
|
|
1660
|
+
(status: 'unmounted' | 'initial' | 'open' | 'close') => void
|
|
1661
|
+
|
|
1662
|
+
| \- | \- |
|
|
1663
|
+
| padding |
|
|
1664
|
+
|
|
1665
|
+
Sets the padding of the wrapping panel component.
|
|
1666
|
+
|
|
1667
|
+
union
|
|
1668
|
+
|
|
1669
|
+
|
|
1670
|
+
|
|
1671
|
+
|
|
|
1672
|
+
|
|
1673
|
+
'md'
|
|
1674
|
+
|
|
1675
|
+
| \- |
|
|
1676
|
+
| position |
|
|
1677
|
+
|
|
1678
|
+
Position of the slideout relative to the page. `left` or `right`.
|
|
1679
|
+
|
|
1680
|
+
union
|
|
1681
|
+
|
|
1682
|
+
|
|
1683
|
+
|
|
1684
|
+
|
|
|
1685
|
+
|
|
1686
|
+
'right'
|
|
1687
|
+
|
|
1688
|
+
| Set object |
|
|
1689
|
+
| show |
|
|
1690
|
+
|
|
1691
|
+
When set to `true` the slideout will be visible. Use for controlled slideouts.
|
|
1692
|
+
|
|
1693
|
+
boolean
|
|
1694
|
+
|
|
1695
|
+
|
|
1696
|
+
|
|
1697
|
+
| \- | \- |
|
|
1698
|
+
| size |
|
|
1699
|
+
|
|
1700
|
+
Accepts a single `SlideoutSize`. Slideouts will display at 100% for mobile screens (<576px).
|
|
1701
|
+
|
|
1702
|
+
union
|
|
1703
|
+
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
|
|
|
1707
|
+
|
|
1708
|
+
'sm'
|
|
1709
|
+
|
|
1710
|
+
| Set object |
|
|
1711
|
+
|
|
1712
|
+
### Footer
|
|
1713
|
+
|
|
1714
|
+
The `footer` prop is used to set content that should appear underneath the main content. Usually used for extra controls like buttons etc.
|
|
1715
|
+
|
|
1716
|
+
[](./iframe.html?id=components-slideout--footer)
|
|
1717
|
+
|
|
1718
|
+
Show slideout with footer
|
|
1719
|
+
|
|
1720
|
+
```
|
|
1721
|
+
|
|
1722
|
+
const Story \= () \=> {
|
|
1723
|
+
const { showSlideout } \= useSlideout();
|
|
1724
|
+
const SLIDEOUT\_ID \= 'storybook-slideout';
|
|
1725
|
+
return (
|
|
1726
|
+
const Story \= () \=> {
|
|
1727
|
+
const { showSlideout } \= useSlideout();
|
|
1728
|
+
const SLIDEOUT\_ID \= 'storybook-slideout';
|
|
1729
|
+
return (
|
|
1730
|
+
<\>
|
|
1731
|
+
<IressButton onClick\={() \=> showSlideout(SLIDEOUT\_ID)}\>
|
|
1732
|
+
Show slideout with footer </IressButton\>
|
|
1733
|
+
<IressSlideout
|
|
1734
|
+
footer\={<IressButton\>Footer button</IressButton\>}
|
|
1735
|
+
id\="storybook-slideout"
|
|
1736
|
+
\>
|
|
1737
|
+
Slideout content </IressSlideout\>
|
|
1738
|
+
</\>
|
|
1739
|
+
);
|
|
1740
|
+
};
|
|
1741
|
+
|
|
1742
|
+
export const App \= () \=> (
|
|
1743
|
+
<IressSlideoutProvider\>
|
|
1744
|
+
<Story />
|
|
1745
|
+
</IressSlideoutProvider\>
|
|
1746
|
+
);
|
|
1747
|
+
);
|
|
1748
|
+
};
|
|
1749
|
+
|
|
1750
|
+
export const App \= () \=> (
|
|
1751
|
+
<IressSlideoutProvider\>
|
|
1752
|
+
<Story />
|
|
1753
|
+
</IressSlideoutProvider\>
|
|
1754
|
+
);
|
|
1755
|
+
|
|
1756
|
+
```
|
|
1757
|
+
|
|
1758
|
+
#### Props
|
|
1759
|
+
|
|
1760
|
+
| Name | Description | Default | Control |
|
|
1761
|
+
| --- | --- | --- | --- |
|
|
1762
|
+
| backdrop |
|
|
1763
|
+
When set to `true` a backdrop will be displayed to cover the contents of the page. The slideout will then become the only element that can be interacted with.
|
|
1764
|
+
|
|
1765
|
+
boolean
|
|
1766
|
+
|
|
1767
|
+
|
|
1768
|
+
|
|
1769
|
+
| \- | Set boolean |
|
|
1770
|
+
| children |
|
|
1771
|
+
|
|
1772
|
+
Content to be displayed within the slideout.
|
|
1773
|
+
|
|
1774
|
+
ReactNode
|
|
1775
|
+
|
|
1776
|
+
|
|
1777
|
+
|
|
1778
|
+
| \- |
|
|
1779
|
+
|
|
1780
|
+
"Slideout content"
|
|
1781
|
+
|
|
1782
|
+
|
|
|
1783
|
+
| closeText |
|
|
1784
|
+
|
|
1785
|
+
Screenreader text for close button.
|
|
1786
|
+
|
|
1787
|
+
string
|
|
1788
|
+
|
|
1789
|
+
|
|
1790
|
+
|
|
1791
|
+
|
|
|
1792
|
+
|
|
1793
|
+
'Close'
|
|
1794
|
+
|
|
1795
|
+
| Set string |
|
|
1796
|
+
| container |
|
|
1797
|
+
|
|
1798
|
+
The container element to render the slideout into. By default, the slideout will render at the end of the document body.
|
|
1799
|
+
|
|
1800
|
+
FloatingUIContainer
|
|
1801
|
+
|
|
1802
|
+
|
|
1803
|
+
|
|
1804
|
+
| \- | Set object |
|
|
1805
|
+
| defaultShow |
|
|
1806
|
+
|
|
1807
|
+
When set to `true` the slideout will be visible. Use for uncontrolled slideouts.
|
|
1808
|
+
|
|
1809
|
+
boolean
|
|
1810
|
+
|
|
1811
|
+
|
|
1812
|
+
|
|
1813
|
+
|
|
|
1814
|
+
|
|
1815
|
+
false
|
|
1816
|
+
|
|
1817
|
+
| Set boolean |
|
|
1818
|
+
| eleToPush |
|
|
1819
|
+
|
|
1820
|
+
The element that needs to be pushed relative to the slideout. This can be a string selector to match an existing element in the DOM, a html element, or a React reference. Will be ignored if `mode` is not set to `push` or if element does not exist.
|
|
1821
|
+
|
|
1822
|
+
union
|
|
1823
|
+
|
|
1824
|
+
|
|
1825
|
+
|
|
1826
|
+
| \- | Set object |
|
|
1827
|
+
| footer |
|
|
1828
|
+
|
|
1829
|
+
Panel to place slideout controls.
|
|
1830
|
+
|
|
1831
|
+
ReactNode
|
|
1832
|
+
|
|
1833
|
+
|
|
1834
|
+
|
|
1835
|
+
| \- | \- |
|
|
1836
|
+
| heading |
|
|
1837
|
+
|
|
1838
|
+
Sets the heading for the slideout. If passed an element, it will render the element with an id, to ensure its connection to the slideout.
|
|
1839
|
+
|
|
1840
|
+
union
|
|
1841
|
+
|
|
1842
|
+
|
|
1843
|
+
|
|
1844
|
+
| \- | Set object |
|
|
1845
|
+
| id |
|
|
1846
|
+
|
|
1847
|
+
Unique ID for the slideout. Use if you would like to open this slideout from anywhere in your app using the `useSlideout` hook.
|
|
1848
|
+
|
|
1849
|
+
string
|
|
1850
|
+
|
|
1851
|
+
|
|
1852
|
+
|
|
1853
|
+
| \- | storybook-slideout |
|
|
1854
|
+
| mode |
|
|
1855
|
+
|
|
1856
|
+
Sets how the Slideout interacts with the content of the page. `overlay` overlays the page content, obscuring the content below. `push` will push the element (specified by `eleToPush`) across the page. `push` will revert back to `overlay` if `eleToPush` is not specified or if the screen size < 1200px.
|
|
1857
|
+
|
|
1858
|
+
union
|
|
1859
|
+
|
|
1860
|
+
|
|
1861
|
+
|
|
1862
|
+
|
|
|
1863
|
+
|
|
1864
|
+
'overlay'
|
|
1865
|
+
|
|
1866
|
+
| Set object |
|
|
1867
|
+
| onEntered |
|
|
1868
|
+
|
|
1869
|
+
Emitted when the slideout has opened.
|
|
1870
|
+
|
|
1871
|
+
() => void
|
|
1872
|
+
|
|
1873
|
+
| \- | \- |
|
|
1874
|
+
| onExited |
|
|
1875
|
+
|
|
1876
|
+
Emitted when the slideout has closed.
|
|
1877
|
+
|
|
1878
|
+
() => void
|
|
1879
|
+
|
|
1880
|
+
| \- | \- |
|
|
1881
|
+
| onShowChange |
|
|
1882
|
+
|
|
1883
|
+
Emitted when the slideout has opened or closed internally. Use for controlled slideouts.
|
|
1884
|
+
|
|
1885
|
+
(show: boolean, reason?: OpenChangeReason) => void
|
|
1886
|
+
|
|
1887
|
+
| \- | \- |
|
|
1888
|
+
| onStatus |
|
|
1889
|
+
|
|
1890
|
+
Emitted when the slideout has mounted, unmounted, opened or closed. Open and close occur before animation begins.
|
|
1891
|
+
|
|
1892
|
+
(status: 'unmounted' | 'initial' | 'open' | 'close') => void
|
|
1893
|
+
|
|
1894
|
+
| \- | \- |
|
|
1895
|
+
| padding |
|
|
1896
|
+
|
|
1897
|
+
Sets the padding of the wrapping panel component.
|
|
1898
|
+
|
|
1899
|
+
union
|
|
1900
|
+
|
|
1901
|
+
|
|
1902
|
+
|
|
1903
|
+
|
|
|
1904
|
+
|
|
1905
|
+
'md'
|
|
1906
|
+
|
|
1907
|
+
| Set object |
|
|
1908
|
+
| position |
|
|
1909
|
+
|
|
1910
|
+
Position of the slideout relative to the page. `left` or `right`.
|
|
1911
|
+
|
|
1912
|
+
union
|
|
1913
|
+
|
|
1914
|
+
|
|
1915
|
+
|
|
1916
|
+
|
|
|
1917
|
+
|
|
1918
|
+
'right'
|
|
1919
|
+
|
|
1920
|
+
| Set object |
|
|
1921
|
+
| show |
|
|
1922
|
+
|
|
1923
|
+
When set to `true` the slideout will be visible. Use for controlled slideouts.
|
|
1924
|
+
|
|
1925
|
+
boolean
|
|
1926
|
+
|
|
1927
|
+
|
|
1928
|
+
|
|
1929
|
+
| \- | \- |
|
|
1930
|
+
| size |
|
|
1931
|
+
|
|
1932
|
+
Accepts a single `SlideoutSize`. Slideouts will display at 100% for mobile screens (<576px).
|
|
1933
|
+
|
|
1934
|
+
union
|
|
1935
|
+
|
|
1936
|
+
|
|
1937
|
+
|
|
1938
|
+
|
|
|
1939
|
+
|
|
1940
|
+
'sm'
|
|
1941
|
+
|
|
1942
|
+
| Set object |
|
|
1943
|
+
|
|
1944
|
+
### Absolute position slideouts
|
|
1945
|
+
|
|
1946
|
+
By default, slideout is set to `position: fixed` which means it will appear from the edge of the browser window. By setting the `--iress-position` css variable to `absolute` the slideout can appear from the edge of its closest relative positioned container. You will also need to set the `container` prop to the a reference of the relatively positioned container, so it can appear in the correct place in the DOM.
|
|
1947
|
+
|
|
1948
|
+
If you're using an absolutely positioned slideout you may also want to change the vertical and horizontal positioning. By default this will be the top left or top right of the container, but you can use `--iress-offset-top` and `--iress-initial-offset` to adjust that if you need to.
|
|
1949
|
+
|
|
1950
|
+
[](./iframe.html?id=components-slideout--absolute-position)
|
|
1951
|
+
|
|
1952
|
+
Show slideout
|
|
1953
|
+
|
|
1954
|
+
### Absolute slideout
|
|
1955
|
+
|
|
1956
|
+
Almost before was mighty present had him time. But scorching counsel if mine dote men have or, one yet from pangs and for and despair there. If below nor but the name these deemed oh..
|
|
1957
|
+
|
|
1958
|
+
```
|
|
1959
|
+
|
|
1960
|
+
import {
|
|
1961
|
+
IressStack,
|
|
1962
|
+
IressButton,
|
|
1963
|
+
IressText,
|
|
1964
|
+
IressSlideout,
|
|
1965
|
+
type IressSlideoutProps,
|
|
1966
|
+
} from '@iress-oss/ids-components';
|
|
1967
|
+
import { useRef, useState } from 'react';
|
|
1968
|
+
export const AbsolutePositionSlideout \= () \=> {
|
|
1969
|
+
const \[show, setShow\] \= useState(false);
|
|
1970
|
+
const containerRef \= useRef<HTMLDivElement | null\>(null);
|
|
1971
|
+
return (
|
|
1972
|
+
<IressStack gutter\="md"\>
|
|
1973
|
+
<IressButton onClick\={() \=> setShow(true)}\>Show slideout</IressButton\>
|
|
1974
|
+
<div
|
|
1975
|
+
ref\={containerRef}
|
|
1976
|
+
style\={{
|
|
1977
|
+
height: '300px',
|
|
1978
|
+
border:
|
|
1979
|
+
'1px solid var(--iress-g-border-color, var(--iress-default-border-color))',
|
|
1980
|
+
padding: '1rem',
|
|
1981
|
+
overflow: 'hidden',
|
|
1982
|
+
position: 'relative',
|
|
1983
|
+
}}
|
|
1984
|
+
\>
|
|
1985
|
+
<IressText id\="contents"\>
|
|
1986
|
+
<h3\>Absolute slideout</h3\>
|
|
1987
|
+
<p\>
|
|
1988
|
+
Almost before was mighty present had him time. But scorching counsel if mine dote men have or, one yet from pangs and for and despair there. If below nor but the name these deemed oh.. </p\>
|
|
1989
|
+
</IressText\>
|
|
1990
|
+
<IressSlideout
|
|
1991
|
+
{...{
|
|
1992
|
+
children: 'Slideout content',
|
|
1993
|
+
footer: 'Footer slot',
|
|
1994
|
+
id: 'storybook-slideout',
|
|
1995
|
+
eleToPush: '#contents',
|
|
1996
|
+
position: 'left',
|
|
1997
|
+
mode: 'push',
|
|
1998
|
+
}}
|
|
1999
|
+
container\={containerRef}
|
|
2000
|
+
show\={show}
|
|
2001
|
+
onShowChange\={setShow}
|
|
2002
|
+
style\={
|
|
2003
|
+
{
|
|
2004
|
+
'--iress-position': 'absolute',
|
|
2005
|
+
} as never
|
|
2006
|
+
}
|
|
2007
|
+
/>
|
|
2008
|
+
</div\>
|
|
2009
|
+
</IressStack\>
|
|
2010
|
+
);
|
|
2011
|
+
};
|
|
2012
|
+
|
|
2013
|
+
```
|
|
2014
|
+
|
|
2015
|
+
#### Props
|
|
2016
|
+
|
|
2017
|
+
| Name | Description | Default | Control |
|
|
2018
|
+
| --- | --- | --- | --- |
|
|
2019
|
+
| backdrop |
|
|
2020
|
+
When set to `true` a backdrop will be displayed to cover the contents of the page. The slideout will then become the only element that can be interacted with.
|
|
2021
|
+
|
|
2022
|
+
boolean
|
|
2023
|
+
|
|
2024
|
+
|
|
2025
|
+
|
|
2026
|
+
| \- | Set boolean |
|
|
2027
|
+
| children |
|
|
2028
|
+
|
|
2029
|
+
Content to be displayed within the slideout.
|
|
2030
|
+
|
|
2031
|
+
ReactNode
|
|
2032
|
+
|
|
2033
|
+
|
|
2034
|
+
|
|
2035
|
+
| \- |
|
|
2036
|
+
|
|
2037
|
+
"Slideout content"
|
|
2038
|
+
|
|
2039
|
+
|
|
|
2040
|
+
| closeText |
|
|
2041
|
+
|
|
2042
|
+
Screenreader text for close button.
|
|
2043
|
+
|
|
2044
|
+
string
|
|
2045
|
+
|
|
2046
|
+
|
|
2047
|
+
|
|
2048
|
+
|
|
|
2049
|
+
|
|
2050
|
+
'Close'
|
|
2051
|
+
|
|
2052
|
+
| Set string |
|
|
2053
|
+
| container |
|
|
2054
|
+
|
|
2055
|
+
The container element to render the slideout into. By default, the slideout will render at the end of the document body.
|
|
2056
|
+
|
|
2057
|
+
FloatingUIContainer
|
|
2058
|
+
|
|
2059
|
+
|
|
2060
|
+
|
|
2061
|
+
| \- | Set object |
|
|
2062
|
+
| defaultShow |
|
|
2063
|
+
|
|
2064
|
+
When set to `true` the slideout will be visible. Use for uncontrolled slideouts.
|
|
2065
|
+
|
|
2066
|
+
boolean
|
|
2067
|
+
|
|
2068
|
+
|
|
2069
|
+
|
|
2070
|
+
|
|
|
2071
|
+
|
|
2072
|
+
false
|
|
2073
|
+
|
|
2074
|
+
| Set boolean |
|
|
2075
|
+
| eleToPush |
|
|
2076
|
+
|
|
2077
|
+
The element that needs to be pushed relative to the slideout. This can be a string selector to match an existing element in the DOM, a html element, or a React reference. Will be ignored if `mode` is not set to `push` or if element does not exist.
|
|
2078
|
+
|
|
2079
|
+
union
|
|
2080
|
+
|
|
2081
|
+
|
|
2082
|
+
|
|
2083
|
+
| \- |
|
|
2084
|
+
|
|
2085
|
+
"#contents"
|
|
2086
|
+
|
|
2087
|
+
|
|
|
2088
|
+
| footer |
|
|
2089
|
+
|
|
2090
|
+
Panel to place slideout controls.
|
|
2091
|
+
|
|
2092
|
+
ReactNode
|
|
2093
|
+
|
|
2094
|
+
|
|
2095
|
+
|
|
2096
|
+
| \- |
|
|
2097
|
+
|
|
2098
|
+
"Footer slot"
|
|
2099
|
+
|
|
2100
|
+
|
|
|
2101
|
+
| heading |
|
|
2102
|
+
|
|
2103
|
+
Sets the heading for the slideout. If passed an element, it will render the element with an id, to ensure its connection to the slideout.
|
|
2104
|
+
|
|
2105
|
+
union
|
|
2106
|
+
|
|
2107
|
+
|
|
2108
|
+
|
|
2109
|
+
| \- | Set object |
|
|
2110
|
+
| id |
|
|
2111
|
+
|
|
2112
|
+
Unique ID for the slideout. Use if you would like to open this slideout from anywhere in your app using the `useSlideout` hook.
|
|
2113
|
+
|
|
2114
|
+
string
|
|
2115
|
+
|
|
2116
|
+
|
|
2117
|
+
|
|
2118
|
+
| \- | storybook-slideout |
|
|
2119
|
+
| mode |
|
|
2120
|
+
|
|
2121
|
+
Sets how the Slideout interacts with the content of the page. `overlay` overlays the page content, obscuring the content below. `push` will push the element (specified by `eleToPush`) across the page. `push` will revert back to `overlay` if `eleToPush` is not specified or if the screen size < 1200px.
|
|
2122
|
+
|
|
2123
|
+
union
|
|
2124
|
+
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
|
|
|
2128
|
+
|
|
2129
|
+
'overlay'
|
|
2130
|
+
|
|
2131
|
+
|
|
|
2132
|
+
|
|
2133
|
+
"push"
|
|
2134
|
+
|
|
2135
|
+
|
|
|
2136
|
+
| onEntered |
|
|
2137
|
+
|
|
2138
|
+
Emitted when the slideout has opened.
|
|
2139
|
+
|
|
2140
|
+
() => void
|
|
2141
|
+
|
|
2142
|
+
| \- | \- |
|
|
2143
|
+
| onExited |
|
|
2144
|
+
|
|
2145
|
+
Emitted when the slideout has closed.
|
|
2146
|
+
|
|
2147
|
+
() => void
|
|
2148
|
+
|
|
2149
|
+
| \- | \- |
|
|
2150
|
+
| onShowChange |
|
|
2151
|
+
|
|
2152
|
+
Emitted when the slideout has opened or closed internally. Use for controlled slideouts.
|
|
2153
|
+
|
|
2154
|
+
(show: boolean, reason?: OpenChangeReason) => void
|
|
2155
|
+
|
|
2156
|
+
| \- | \- |
|
|
2157
|
+
| onStatus |
|
|
2158
|
+
|
|
2159
|
+
Emitted when the slideout has mounted, unmounted, opened or closed. Open and close occur before animation begins.
|
|
2160
|
+
|
|
2161
|
+
(status: 'unmounted' | 'initial' | 'open' | 'close') => void
|
|
2162
|
+
|
|
2163
|
+
| \- | \- |
|
|
2164
|
+
| padding |
|
|
2165
|
+
|
|
2166
|
+
Sets the padding of the wrapping panel component.
|
|
2167
|
+
|
|
2168
|
+
union
|
|
2169
|
+
|
|
2170
|
+
|
|
2171
|
+
|
|
2172
|
+
|
|
|
2173
|
+
|
|
2174
|
+
'md'
|
|
2175
|
+
|
|
2176
|
+
| Set object |
|
|
2177
|
+
| position |
|
|
2178
|
+
|
|
2179
|
+
Position of the slideout relative to the page. `left` or `right`.
|
|
2180
|
+
|
|
2181
|
+
union
|
|
2182
|
+
|
|
2183
|
+
|
|
2184
|
+
|
|
2185
|
+
|
|
|
2186
|
+
|
|
2187
|
+
'right'
|
|
2188
|
+
|
|
2189
|
+
|
|
|
2190
|
+
|
|
2191
|
+
"left"
|
|
2192
|
+
|
|
2193
|
+
|
|
|
2194
|
+
| show |
|
|
2195
|
+
|
|
2196
|
+
When set to `true` the slideout will be visible. Use for controlled slideouts.
|
|
2197
|
+
|
|
2198
|
+
boolean
|
|
2199
|
+
|
|
2200
|
+
|
|
2201
|
+
|
|
2202
|
+
| \- | \- |
|
|
2203
|
+
| size |
|
|
2204
|
+
|
|
2205
|
+
Accepts a single `SlideoutSize`. Slideouts will display at 100% for mobile screens (<576px).
|
|
2206
|
+
|
|
2207
|
+
union
|
|
2208
|
+
|
|
2209
|
+
|
|
2210
|
+
|
|
2211
|
+
|
|
|
2212
|
+
|
|
2213
|
+
'sm'
|
|
2214
|
+
|
|
2215
|
+
| Set object |
|
|
2216
|
+
|
|
2217
|
+
Migrating to version 5
|
|
2218
|
+
----------------------
|
|
2219
|
+
|
|
2220
|
+
### Adding the provider
|
|
2221
|
+
|
|
2222
|
+
For your components to work as previously, you will need to set up the `IressSlideoutProvider` at the root of your application. This will allow you to use the `useSlideout` hook to open and close slideouts from anywhere in your application using the ID of the slideout.
|
|
2223
|
+
|
|
2224
|
+
const App \= () \=> (
|
|
2225
|
+
<IressSlideoutProvider\>Rest of app here</IressSlideoutProvider\>
|
|
2226
|
+
);
|
|
2227
|
+
|
|
2228
|
+
```
|
|
2229
|
+
|
|
2230
|
+
### Testing
|
|
2231
|
+
|
|
2232
|
+
In version 5, slideouts are rendered conditionally, meaning they will not be available in the DOM until they are shown. This means that you will need to update your tests to account for this, as you cannot interact with its contents until it is shown, unlike in version 4.
|
|
2233
|
+
|
|
2234
|
+
See below for an example in version 4 and version 5.
|
|
2235
|
+
|
|
2236
|
+
Diff
|
|
2237
|
+
|
|
2238
|
+
Old
|
|
2239
|
+
|
|
2240
|
+
New
|
|
2241
|
+
|
|
2242
|
+
<table class="css-1n5o7vh-diff-container"><tbody><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">import { render, waitFor, screen } from '@testing-library/react';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">import { render, screen, waitForElementToBeRemoved } from '@testing-library/react';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">import { idsFireEvent, componentLoad } from '@iress/ids-react-test-utils';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">import { userEvent } from '@testing-library/user-event';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> </pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text">test('opening and closing a slideout', async () => {</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> await componentLoad([</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> const trigger = screen.getByRole('button', { name: /open slideout/i });</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> 'slideout-trigger',</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> 'slideout',</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> // activate slideout</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> ]);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> await userEvent.click(trigger);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> const slideout = await screen.findByRole('complementary'); // this assumes the slideout has the role="complementary"</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> const trigger = screen.getByTestId('slideout-trigger');</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> const slideout = screen.getByTestId('slideout');</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> // In version 5, you can only interact with the slideout once it has been loaded here.</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-10regm7-empty-line"><pre></pre></td><td class="css-vl0irh-content css-10regm7-empty-line"><pre class="css-o1u8iu-content-text"></pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-10regm7-empty-line"><pre></pre></td><td class="css-vl0irh-content css-10regm7-empty-line"><pre class="css-o1u8iu-content-text"></pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> // In version 4, you can already interact with the slideout here as its in the DOM at this stage.</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> </pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> // activate slideout</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> idsFireEvent.click(trigger);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> await waitFor(() => expect(slideout).toBeVisible());</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> </pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text"> // close slideout</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> const closeButton = screen.getByTestId('slideout__close-button');</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> const closeButton = screen.getByRole('button', { name: /close/i });</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> idsFireEvent.click(closeButton);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> await userEvent.click(closeButton);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> await waitFor(() => expect(slideout).not.toBeVisible());</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> await waitForElementToBeRemoved(slideout);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text">});</pre></td></tr></tbody></table>
|
|
2243
|
+
|
|
2244
|
+
### Speed up tests
|
|
2245
|
+
|
|
2246
|
+
You can speed up tests by wrapping your tests in a provider that overrides the theme tokens for animations.
|
|
2247
|
+
|
|
2248
|
+
const themeOverrides: Record<string, string\> \= {
|
|
2249
|
+
'--iress-slideout-animation-duration': '0s',
|
|
2250
|
+
};
|
|
2251
|
+
export const TestAppProvider \= ({ children }: PropsWithChildren) \=> {
|
|
2252
|
+
const containerRef \= useRef<HTMLDivElement\>(null);
|
|
2253
|
+
return (
|
|
2254
|
+
<IressModalProvider container\={containerRef}\>
|
|
2255
|
+
<div style\={themeOverrides} ref\={containerRef}\>
|
|
2256
|
+
{children}
|
|
2257
|
+
</div\>
|
|
2258
|
+
</IressModalProvider\>
|
|
2259
|
+
);
|
|
2260
|
+
};
|
|
2261
|
+
|
|
2262
|
+
```
|