@iress-oss/ids-mcp-server 5.15.0 → 5.20.2

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