@iress-oss/ids-mcp-server 6.0.0-alpha.0 → 6.0.0-alpha.1-canary-20251204014525-3f0dce4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/searchHandlers.test.js +8 -2
- package/dist/toolHandler.test.js +9 -9
- package/dist/utils.test.js +6 -2
- package/package.json +32 -30
- package/generated/docs/components-alert-docs.md +0 -702
- package/generated/docs/components-autocomplete-docs.md +0 -1433
- package/generated/docs/components-autocomplete-recipes-docs.md +0 -104
- package/generated/docs/components-badge-docs.md +0 -531
- package/generated/docs/components-button-docs.md +0 -1442
- package/generated/docs/components-buttongroup-docs.md +0 -748
- package/generated/docs/components-card-docs.md +0 -944
- package/generated/docs/components-checkbox-docs.md +0 -694
- package/generated/docs/components-checkboxgroup-docs.md +0 -1087
- package/generated/docs/components-checkboxgroup-recipes-docs.md +0 -119
- package/generated/docs/components-col-docs.md +0 -881
- package/generated/docs/components-container-docs.md +0 -123
- package/generated/docs/components-divider-docs.md +0 -576
- package/generated/docs/components-expander-docs.md +0 -594
- package/generated/docs/components-field-docs.md +0 -2007
- package/generated/docs/components-filter-docs.md +0 -1322
- package/generated/docs/components-hide-docs.md +0 -702
- package/generated/docs/components-icon-docs.md +0 -816
- package/generated/docs/components-image-docs.md +0 -493
- package/generated/docs/components-inline-docs.md +0 -2003
- package/generated/docs/components-input-docs.md +0 -867
- package/generated/docs/components-input-recipes-docs.md +0 -140
- package/generated/docs/components-inputcurrency-docs.md +0 -689
- package/generated/docs/components-inputcurrency-recipes-docs.md +0 -115
- package/generated/docs/components-introduction-docs.md +0 -450
- package/generated/docs/components-label-docs.md +0 -562
- package/generated/docs/components-link-docs.md +0 -586
- package/generated/docs/components-menu-docs.md +0 -1146
- package/generated/docs/components-menu-menuitem-docs.md +0 -739
- package/generated/docs/components-modal-docs.md +0 -1346
- package/generated/docs/components-panel-docs.md +0 -600
- package/generated/docs/components-placeholder-docs.md +0 -446
- package/generated/docs/components-popover-docs.md +0 -1529
- package/generated/docs/components-popover-recipes-docs.md +0 -211
- package/generated/docs/components-progress-docs.md +0 -568
- package/generated/docs/components-provider-docs.md +0 -160
- package/generated/docs/components-radio-docs.md +0 -563
- package/generated/docs/components-radiogroup-docs.md +0 -1153
- package/generated/docs/components-readonly-docs.md +0 -535
- package/generated/docs/components-richselect-docs.md +0 -5836
- package/generated/docs/components-row-docs.md +0 -2354
- package/generated/docs/components-select-docs.md +0 -940
- package/generated/docs/components-skeleton-docs.md +0 -597
- package/generated/docs/components-skeleton-recipes-docs.md +0 -76
- package/generated/docs/components-skiplink-docs.md +0 -587
- package/generated/docs/components-slideout-docs.md +0 -1036
- package/generated/docs/components-slider-docs.md +0 -828
- package/generated/docs/components-spinner-docs.md +0 -450
- package/generated/docs/components-stack-docs.md +0 -923
- package/generated/docs/components-table-ag-grid-docs.md +0 -1444
- package/generated/docs/components-table-docs.md +0 -2327
- package/generated/docs/components-tabset-docs.md +0 -768
- package/generated/docs/components-tabset-tab-docs.md +0 -550
- package/generated/docs/components-tag-docs.md +0 -548
- package/generated/docs/components-text-docs.md +0 -585
- package/generated/docs/components-toaster-docs.md +0 -755
- package/generated/docs/components-toggle-docs.md +0 -614
- package/generated/docs/components-tooltip-docs.md +0 -747
- package/generated/docs/components-validationmessage-docs.md +0 -1161
- package/generated/docs/contact-us-docs.md +0 -27
- package/generated/docs/extensions-editor-docs.md +0 -1181
- package/generated/docs/extensions-editor-recipes-docs.md +0 -89
- package/generated/docs/foundations-accessibility-docs.md +0 -40
- package/generated/docs/foundations-consistency-docs.md +0 -52
- package/generated/docs/foundations-content-docs.md +0 -23
- package/generated/docs/foundations-grid-docs.md +0 -74
- package/generated/docs/foundations-introduction-docs.md +0 -19
- package/generated/docs/foundations-principles-docs.md +0 -70
- package/generated/docs/foundations-responsive-breakpoints-docs.md +0 -193
- package/generated/docs/foundations-tokens-colour-docs.md +0 -564
- package/generated/docs/foundations-tokens-elevation-docs.md +0 -155
- package/generated/docs/foundations-tokens-introduction-docs.md +0 -190
- package/generated/docs/foundations-tokens-radius-docs.md +0 -71
- package/generated/docs/foundations-tokens-spacing-docs.md +0 -89
- package/generated/docs/foundations-tokens-typography-docs.md +0 -322
- package/generated/docs/foundations-user-experience-docs.md +0 -63
- package/generated/docs/foundations-visual-design-docs.md +0 -46
- package/generated/docs/foundations-z-index-stacking-docs.md +0 -31
- package/generated/docs/frequently-asked-questions-docs.md +0 -53
- package/generated/docs/get-started-develop-docs.md +0 -209
- package/generated/docs/get-started-using-storybook-docs.md +0 -68
- package/generated/docs/guidelines.md +0 -2054
- package/generated/docs/introduction-docs.md +0 -87
- package/generated/docs/news-version-6-docs.md +0 -93
- package/generated/docs/patterns-form-docs.md +0 -3902
- package/generated/docs/patterns-form-recipes-docs.md +0 -1370
- package/generated/docs/patterns-introduction-docs.md +0 -24
- package/generated/docs/patterns-loading-docs.md +0 -4043
- package/generated/docs/resources-code-katas-docs.md +0 -29
- package/generated/docs/resources-introduction-docs.md +0 -38
- package/generated/docs/resources-mcp-server-docs.md +0 -27
- package/generated/docs/resources-migration-guides-from-v4-to-v5-docs.md +0 -437
- package/generated/docs/styling-props-colour-docs.md +0 -172
- package/generated/docs/styling-props-elevation-docs.md +0 -88
- package/generated/docs/styling-props-radius-docs.md +0 -86
- package/generated/docs/styling-props-reference-docs.md +0 -160
- package/generated/docs/styling-props-screen-readers-docs.md +0 -71
- package/generated/docs/styling-props-sizing-docs.md +0 -627
- package/generated/docs/styling-props-spacing-docs.md +0 -2282
- package/generated/docs/styling-props-typography-docs.md +0 -121
- package/generated/docs/themes-available-themes-docs.md +0 -66
- package/generated/docs/themes-introduction-docs.md +0 -121
- package/generated/docs/versions-docs.md +0 -17
- /package/{LICENSE.txt → LICENSE} +0 -0
|
@@ -1,1036 +0,0 @@
|
|
|
1
|
-
[](#slideout)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
|
-
* * *
|
|
10
|
-
|
|
11
|
-
Updated
|
|
12
|
-
|
|
13
|
-
**Recently updated**
|
|
14
|
-
|
|
15
|
-
This component has been recently updated with new props. The props have been marked as beta. Please tell us if there are any issues.
|
|
16
|
-
|
|
17
|
-
Read more
|
|
18
|
-
|
|
19
|
-
[](#use-a-slideout-when)Use a slideout when:
|
|
20
|
-
--------------------------------------------
|
|
21
|
-
|
|
22
|
-
* Providing supplemental tasks that require the underlying page to still be visible
|
|
23
|
-
* Providing non-essential information related to the underlying page
|
|
24
|
-
|
|
25
|
-
Toggle slideout
|
|
26
|
-
|
|
27
|
-
Hide code
|
|
28
|
-
|
|
29
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
30
|
-
|
|
31
|
-
const Story \= () \=> {
|
|
32
|
-
const { showSlideout } \= useSlideout();
|
|
33
|
-
const SLIDEOUT\_ID \= 'storybook-slideout';
|
|
34
|
-
return (
|
|
35
|
-
<\>
|
|
36
|
-
<IressButton onClick\={() \=> showSlideout(SLIDEOUT\_ID)}\>
|
|
37
|
-
Toggle slideout </IressButton\>
|
|
38
|
-
<IressSlideout
|
|
39
|
-
footer\="Footer slot"
|
|
40
|
-
id\="storybook-slideout"
|
|
41
|
-
\>
|
|
42
|
-
Slideout content </IressSlideout\>
|
|
43
|
-
</\>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const App \= () \=> (
|
|
48
|
-
<IressSlideoutProvider\>
|
|
49
|
-
<Story />
|
|
50
|
-
</IressSlideoutProvider\>
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
Copy
|
|
54
|
-
|
|
55
|
-
[](#props)Props
|
|
56
|
-
---------------
|
|
57
|
-
|
|
58
|
-
| Name | Description | Default | Control |
|
|
59
|
-
| --- | --- | --- | --- |
|
|
60
|
-
| bg |
|
|
61
|
-
**`bg`** sets the background color of an element using the `background-color` css property using the color tokens in the design system.
|
|
62
|
-
|
|
63
|
-
We recommend using the following token values for best background contrast:
|
|
64
|
-
|
|
65
|
-
* `colour.primary.fill` for primary backgrounds that need to stand out
|
|
66
|
-
* `colour.primary.surface` for primary backgrounds that need to be less prominent
|
|
67
|
-
* `colour.neutral.10` for the base background color, normally white in light mode or shade of grey in dark mode
|
|
68
|
-
* `colour.neutral.20` for a slightly darker background color, used in neutral state components
|
|
69
|
-
* `colour.system.danger.fill` for error backgrounds that need to stand out
|
|
70
|
-
* `colour.system.danger.surface` for error backgrounds that need to be less prominent
|
|
71
|
-
* `colour.system.success.fill` for success backgrounds that need to stand out
|
|
72
|
-
* `colour.system.success.surface` for success backgrounds that need to be less prominent
|
|
73
|
-
* `colour.system.warning.fill` for warning backgrounds that need to stand out
|
|
74
|
-
* `colour.system.warning.surface` for warning backgrounds that need to be less prominent
|
|
75
|
-
* `colour.system.info.fill` for info backgrounds that need to stand out
|
|
76
|
-
* `colour.system.info.surface` for info backgrounds that need to be less prominent
|
|
77
|
-
|
|
78
|
-
ResponsiveProp<ColorToken> | undefined
|
|
79
|
-
|
|
80
|
-
| \- | Set object |
|
|
81
|
-
| borderRadius |
|
|
82
|
-
|
|
83
|
-
The **`border-radius`** CSS property rounds the corners of an element's outer border edge using the radius tokens in the design system.
|
|
84
|
-
|
|
85
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
86
|
-
| --- | --- | --- | --- | --- |
|
|
87
|
-
| **4** | **4** | **5** | **12** | **9** |
|
|
88
|
-
| 1 _\-x-_ | | 3 _\-x-_ | | |
|
|
89
|
-
|
|
90
|
-
ResponsiveProp<RadiusToken> | undefined
|
|
91
|
-
|
|
92
|
-
| \- | Set object |
|
|
93
|
-
| children |
|
|
94
|
-
|
|
95
|
-
Content to be displayed within the slideout.
|
|
96
|
-
|
|
97
|
-
ReactNode
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
| \- |
|
|
102
|
-
|
|
103
|
-
"Slideout content"
|
|
104
|
-
|
|
105
|
-
|
|
|
106
|
-
| closeText |
|
|
107
|
-
|
|
108
|
-
Screenreader text for close button.
|
|
109
|
-
|
|
110
|
-
stringundefined
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
|
115
|
-
|
|
116
|
-
Close
|
|
117
|
-
|
|
118
|
-
| Set object |
|
|
119
|
-
| color |
|
|
120
|
-
|
|
121
|
-
The **`color`** CSS property sets the foreground color value of an element's text and text decorations using the colour tokens from the design system. It also sets the `currentcolor` value. `currentcolor` may be used as an indirect value on _other_ properties and is the default for other color properties, such as `border-color`.
|
|
122
|
-
|
|
123
|
-
We recommend using the following token values for best color contrast:
|
|
124
|
-
|
|
125
|
-
* `colour.primary.onFill` used on top of `colour.primary.fill` for primary text that needs to stand out
|
|
126
|
-
* `colour.primary.text` used on top of `colour.primary.surface` or `colour.neutral.10` for primary text that needs to be less prominent
|
|
127
|
-
* `colour.neutral.70` used on top of `colour.neutral.10` or `colour.neutral.20` for muted text
|
|
128
|
-
* `colour.neutral.80` used on top of `colour.neutral.10` or `colour.neutral.20` for standard text
|
|
129
|
-
* `colour.system.danger.onFill` used on top of `colour.system.danger.fill` for error text that needs to stand out
|
|
130
|
-
* `colour.system.danger.text` used on top of `colour.system.danger.surface` for error text that needs to be less prominent
|
|
131
|
-
* `colour.system.success.onFill` used on top of `colour.system.success.fill` for success text that needs to stand out
|
|
132
|
-
* `colour.system.success.text` used on top of `colour.system.success.surface` for success text that needs to be less prominent
|
|
133
|
-
* `colour.system.warning.onFill` used on top of `colour.system.warning.fill` for warning text that needs to stand out
|
|
134
|
-
* `colour.system.warning.text` used on top of `colour.system.warning.surface` for warning text that needs to be less prominent
|
|
135
|
-
* `colour.system.info.onFill` used on top of `colour.system.info.fill` for informative text that needs to stand out
|
|
136
|
-
* `colour.system.info.text` used on top of `colour.system.info.surface` for informative text that needs to be less prominent
|
|
137
|
-
|
|
138
|
-
ResponsiveProp<ColorToken> | undefined
|
|
139
|
-
|
|
140
|
-
| \- | Set object |
|
|
141
|
-
| container |
|
|
142
|
-
|
|
143
|
-
The container element to render the slideout into. By default, the slideout will render at the end of the document body.
|
|
144
|
-
|
|
145
|
-
FloatingUIContainerundefined
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
| \- | Set object |
|
|
150
|
-
| defaultShow |
|
|
151
|
-
|
|
152
|
-
When set to `true` the slideout will be visible. Use for uncontrolled slideouts.
|
|
153
|
-
|
|
154
|
-
booleanundefined
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
|
159
|
-
|
|
160
|
-
false
|
|
161
|
-
|
|
162
|
-
| Set object |
|
|
163
|
-
| eleToPush |
|
|
164
|
-
|
|
165
|
-
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.
|
|
166
|
-
|
|
167
|
-
string | HTMLElement | MutableRefObject<HTMLElement | null> | undefined
|
|
168
|
-
|
|
169
|
-
| \- | Set object |
|
|
170
|
-
| focusable |
|
|
171
|
-
|
|
172
|
-
The `focusable` prop is used to apply the focus elevation when focused. It can be set to `true` to apply focus styles on focus, or `'within'` to apply focus styles when the element or any of its children are focused.
|
|
173
|
-
|
|
174
|
-
"true""within"undefined
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
| \- | Set object |
|
|
179
|
-
| footer |
|
|
180
|
-
|
|
181
|
-
Panel to place slideout controls.
|
|
182
|
-
|
|
183
|
-
ReactNode
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
| \- |
|
|
188
|
-
|
|
189
|
-
"Footer slot"
|
|
190
|
-
|
|
191
|
-
|
|
|
192
|
-
| heading |
|
|
193
|
-
|
|
194
|
-
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.
|
|
195
|
-
|
|
196
|
-
string | ReactElement<any, string | JSXElementConstructor<any>> | undefined
|
|
197
|
-
|
|
198
|
-
| \- | Set object |
|
|
199
|
-
| hide |
|
|
200
|
-
|
|
201
|
-
Set **`hide`** to hide an element completely using `display: none`. It can also be set to an object of breakpoints to hide the element at specific breakpoints.
|
|
202
|
-
|
|
203
|
-
Hide on all breakpoints: `hide: true` Hide on specific breakpoints: `hide: { xs: false, sm: true, md: false, lg: true, xl: false, xxl: true }`
|
|
204
|
-
|
|
205
|
-
Notes:
|
|
206
|
-
|
|
207
|
-
* If you need to hide an element but allow it to be visible to screen readers, use the `srOnly` prop instead.
|
|
208
|
-
* Consider if you can conditionally render the element instead of hiding it.
|
|
209
|
-
|
|
210
|
-
ResponsiveProp<boolean> | undefined
|
|
211
|
-
|
|
212
|
-
| \- | Set object |
|
|
213
|
-
| id |
|
|
214
|
-
|
|
215
|
-
Unique ID for the slideout. Use if you would like to open this slideout from anywhere in your app using the `useSlideout` hook.
|
|
216
|
-
|
|
217
|
-
stringundefined
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
| \- |
|
|
222
|
-
|
|
223
|
-
"storybook-slideout"
|
|
224
|
-
|
|
225
|
-
|
|
|
226
|
-
| layerStyle |
|
|
227
|
-
|
|
228
|
-
Elevate a layer by using a **`layerStyle`**. These are connected to the elevation tokens in the design system. They can be combined to create hierarchy and structure.
|
|
229
|
-
|
|
230
|
-
* `elevation.raised`: Raised elevations sit slightly higher than other content. They are reserved for cards that can be moved, such as Jira issue cards and Trello cards. In special circumstances, they can be used for cards as a way to provide additional heirarchy or emphasis.
|
|
231
|
-
* `elevation.floating`: Floating is the highest elevation available. It is reserved for a UI that sits over another UI, such as modals, dialogs, dropdown menus, floating toolbars, and floating single-action buttons.
|
|
232
|
-
* `elevation.overflow`: Overflow is a shadow indicating content has scrolled outside a view. It can be used for vertical or horizontal scroll. An example of overflow shadows is the horizontal scroll in tables on a Confluence page.
|
|
233
|
-
|
|
234
|
-
ResponsiveProp<"elevation.raised" | "elevation.floating" | "elevation.overflow" | "elevation.focus" | "elevation.focusCompact"> | undefined
|
|
235
|
-
|
|
236
|
-
| \- | Set object |
|
|
237
|
-
| m |
|
|
238
|
-
|
|
239
|
-
The **`m`** property is short for `margin`, and sets the margin area on all four sides of an element.
|
|
240
|
-
|
|
241
|
-
It uses the spacing tokens in the design system. You can also use the negative values to overlap elements or ignore padding based on the design requirements.
|
|
242
|
-
|
|
243
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
244
|
-
| --- | --- | --- | --- | --- |
|
|
245
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
246
|
-
|
|
247
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
248
|
-
|
|
249
|
-
| \- | Set object |
|
|
250
|
-
| maxWidth |
|
|
251
|
-
|
|
252
|
-
The **`max-width`** CSS property sets the maximum width of an element. It prevents the used value of the `width` property from becoming larger than the value specified by `max-width`.
|
|
253
|
-
|
|
254
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
255
|
-
| --- | --- | --- | --- | --- |
|
|
256
|
-
| **1** | **1** | **1** | **12** | **7** |
|
|
257
|
-
|
|
258
|
-
ResponsiveProp<"auto" | SizeToken | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | ... 8 more ... | "11/12"> | undefined
|
|
259
|
-
|
|
260
|
-
| \- | Set object |
|
|
261
|
-
| mb |
|
|
262
|
-
|
|
263
|
-
The **`mb`** property is short for `margin-bottom` and sets the margin area on the bottom side of an element. A positive value places it farther from its neighbors, while a negative value places it closer.
|
|
264
|
-
|
|
265
|
-
It uses the spacing tokens in the design system.
|
|
266
|
-
|
|
267
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
268
|
-
| --- | --- | --- | --- | --- |
|
|
269
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
270
|
-
|
|
271
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
272
|
-
|
|
273
|
-
| \- | Set object |
|
|
274
|
-
| ml |
|
|
275
|
-
|
|
276
|
-
The **`ml`** property is short for `margin-left` and sets the margin area on the left side of an element. A positive value places it farther from its neighbors, while a negative value places it closer.
|
|
277
|
-
|
|
278
|
-
It uses the spacing tokens in the design system.
|
|
279
|
-
|
|
280
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
281
|
-
| --- | --- | --- | --- | --- |
|
|
282
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
283
|
-
|
|
284
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
285
|
-
|
|
286
|
-
| \- | Set object |
|
|
287
|
-
| mode |
|
|
288
|
-
|
|
289
|
-
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.
|
|
290
|
-
|
|
291
|
-
"overlay""push"undefined
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
|
296
|
-
|
|
297
|
-
overlay
|
|
298
|
-
|
|
299
|
-
| Set object |
|
|
300
|
-
| mr |
|
|
301
|
-
|
|
302
|
-
The **`mr`** property is short for `margin-right` and sets the margin area on the right side of an element. A positive value places it farther from its neighbors, while a negative value places it closer.
|
|
303
|
-
|
|
304
|
-
It uses the spacing tokens in the design system.
|
|
305
|
-
|
|
306
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
307
|
-
| --- | --- | --- | --- | --- |
|
|
308
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
309
|
-
|
|
310
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
311
|
-
|
|
312
|
-
| \- | Set object |
|
|
313
|
-
| mt |
|
|
314
|
-
|
|
315
|
-
The **`mt`** property is short for `margin-top` and sets the margin area on the top side of an element. A positive value places it farther from its neighbors, while a negative value places it closer.
|
|
316
|
-
|
|
317
|
-
It uses the spacing tokens in the design system.
|
|
318
|
-
|
|
319
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
320
|
-
| --- | --- | --- | --- | --- |
|
|
321
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
322
|
-
|
|
323
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
324
|
-
|
|
325
|
-
| \- | Set object |
|
|
326
|
-
| mx |
|
|
327
|
-
|
|
328
|
-
The **`mx`** property is short for `margin-inline`. It is a shorthand property that defines both the logical inline start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation.
|
|
329
|
-
|
|
330
|
-
It uses the spacing tokens in the design system. You can also use the negative values to overlap elements or ignore padding based on the design requirements.
|
|
331
|
-
|
|
332
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
333
|
-
| --- | --- | --- | --- | --- |
|
|
334
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
335
|
-
|
|
336
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
337
|
-
|
|
338
|
-
| \- | Set object |
|
|
339
|
-
| my |
|
|
340
|
-
|
|
341
|
-
The **`my`** property is short for `margin-block`. It defines the logical block start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation.
|
|
342
|
-
|
|
343
|
-
It uses the spacing tokens in the design system. You can also use the negative values to overlap elements or ignore padding based on the design requirements.
|
|
344
|
-
|
|
345
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
346
|
-
| --- | --- | --- | --- | --- |
|
|
347
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
348
|
-
|
|
349
|
-
ResponsiveProp<SpacingToken | "auto"> | undefined
|
|
350
|
-
|
|
351
|
-
| \- | Set object |
|
|
352
|
-
| noGutter |
|
|
353
|
-
|
|
354
|
-
The **`noGutter`** property is used to remove the bottom margin from the last child of a component. This is useful when you want to avoid extra spacing at the end of a layout.
|
|
355
|
-
|
|
356
|
-
booleanundefined
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
| \- | Set object |
|
|
361
|
-
| onEntered |
|
|
362
|
-
|
|
363
|
-
Emitted when the slideout has opened.
|
|
364
|
-
|
|
365
|
-
(() => void) | undefined
|
|
366
|
-
|
|
367
|
-
| \- | \- |
|
|
368
|
-
| onExited |
|
|
369
|
-
|
|
370
|
-
Emitted when the slideout has closed.
|
|
371
|
-
|
|
372
|
-
(() => void) | undefined
|
|
373
|
-
|
|
374
|
-
| \- | \- |
|
|
375
|
-
| onShowChange |
|
|
376
|
-
|
|
377
|
-
Emitted when the slideout has opened or closed internally. Use for controlled slideouts.
|
|
378
|
-
|
|
379
|
-
((show: boolean, reason?: OpenChangeReason | undefined) => void) | undefined
|
|
380
|
-
|
|
381
|
-
| \- | \- |
|
|
382
|
-
| onStatus |
|
|
383
|
-
|
|
384
|
-
Emitted when the slideout has mounted, unmounted, opened or closed. Open and close occur before animation begins.
|
|
385
|
-
|
|
386
|
-
((status: "initial" | "open" | "close" | "unmounted") => void) | undefined
|
|
387
|
-
|
|
388
|
-
| \- | \- |
|
|
389
|
-
| p |
|
|
390
|
-
|
|
391
|
-
The **`p`** property is short for `padding`, and sets the padding area on all four sides of an element at once.
|
|
392
|
-
|
|
393
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
394
|
-
|
|
395
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
396
|
-
| --- | --- | --- | --- | --- |
|
|
397
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
398
|
-
|
|
399
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
400
|
-
|
|
401
|
-
| \- | Set object |
|
|
402
|
-
| pb |
|
|
403
|
-
|
|
404
|
-
The **`pb`** property is short for `padding-bottom` and sets the padding area on the bottom side of an element.
|
|
405
|
-
|
|
406
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
407
|
-
|
|
408
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
409
|
-
| --- | --- | --- | --- | --- |
|
|
410
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
411
|
-
|
|
412
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
413
|
-
|
|
414
|
-
| \- | Set object |
|
|
415
|
-
| pl |
|
|
416
|
-
|
|
417
|
-
The **`pl`** property is short for `padding-left` and sets the padding area on the left side of an element.
|
|
418
|
-
|
|
419
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
420
|
-
|
|
421
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
422
|
-
| --- | --- | --- | --- | --- |
|
|
423
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
424
|
-
|
|
425
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
426
|
-
|
|
427
|
-
| \- | Set object |
|
|
428
|
-
| position |
|
|
429
|
-
|
|
430
|
-
Position of the slideout relative to the page. `left` or `right`.
|
|
431
|
-
|
|
432
|
-
"left""right"undefined
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
|
437
|
-
|
|
438
|
-
right
|
|
439
|
-
|
|
440
|
-
| Set object |
|
|
441
|
-
| pr |
|
|
442
|
-
|
|
443
|
-
The **`pr`** property is short for `padding-right` and sets the padding area on the right side of an element.
|
|
444
|
-
|
|
445
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
446
|
-
|
|
447
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
448
|
-
| --- | --- | --- | --- | --- |
|
|
449
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
450
|
-
|
|
451
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
452
|
-
|
|
453
|
-
| \- | Set object |
|
|
454
|
-
| pt |
|
|
455
|
-
|
|
456
|
-
The **`pt`** property is short for `padding-top` and sets the padding area on the top side of an element.
|
|
457
|
-
|
|
458
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
459
|
-
|
|
460
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
461
|
-
| --- | --- | --- | --- | --- |
|
|
462
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
463
|
-
|
|
464
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
465
|
-
|
|
466
|
-
| \- | Set object |
|
|
467
|
-
| px |
|
|
468
|
-
|
|
469
|
-
The **`px`** property is short for `padding-inline`. It is a shorthand property that defines both the logical inline start and end paddings of an element, which maps to physical paddings depending on the element's writing mode, directionality, and text orientation.
|
|
470
|
-
|
|
471
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
472
|
-
|
|
473
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
474
|
-
| --- | --- | --- | --- | --- |
|
|
475
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
476
|
-
|
|
477
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
478
|
-
|
|
479
|
-
| \- | Set object |
|
|
480
|
-
| py |
|
|
481
|
-
|
|
482
|
-
The **`py`** property is short for `padding-block`. It defines the logical block start and end paddings of an element, which maps to physical paddings depending on the element's writing mode, directionality, and text orientation.
|
|
483
|
-
|
|
484
|
-
It uses the spacing tokens in the design system. Padding cannot use negative values, if you need to overlap elements or ignore padding, use the margin property instead.
|
|
485
|
-
|
|
486
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
487
|
-
| --- | --- | --- | --- | --- |
|
|
488
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
489
|
-
|
|
490
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
491
|
-
|
|
492
|
-
| \- | Set object |
|
|
493
|
-
| rowGap |
|
|
494
|
-
|
|
495
|
-
The **`row-gap`** CSS property sets the size of the gap (gutter) between an element's rows.
|
|
496
|
-
|
|
497
|
-
Note: It only has an effect when used as a direct child of a layout component, such as IressRow, IressStack or IressInline.
|
|
498
|
-
|
|
499
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
500
|
-
| --- | --- | --- | --- | --- |
|
|
501
|
-
| **47** | **52** | **10.1** | **16** | No |
|
|
502
|
-
|
|
503
|
-
ResponsiveProp<"xs" | "sm" | "md" | "lg" | "xl" | "none" | "spacing.000" | "spacing.050" | "spacing.100" | "spacing.150" | "spacing.200" | "spacing.250" | "spacing.300" | "spacing.350" | ... 9 more ... | "slider.tick"> | undefined
|
|
504
|
-
|
|
505
|
-
| \- | Set object |
|
|
506
|
-
| show |
|
|
507
|
-
|
|
508
|
-
When set to `true` the slideout will be visible. Use for controlled slideouts.
|
|
509
|
-
|
|
510
|
-
booleanundefined
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
| \- | \- |
|
|
515
|
-
| size |
|
|
516
|
-
|
|
517
|
-
Accepts a single `SlideoutSize`. Slideouts will display at 100% for mobile screens (<576px).
|
|
518
|
-
|
|
519
|
-
"sm""md"undefined
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
|
524
|
-
|
|
525
|
-
sm
|
|
526
|
-
|
|
527
|
-
| Set object |
|
|
528
|
-
| srOnly |
|
|
529
|
-
|
|
530
|
-
Set **`srOnly`** to hide an element visually but still make it accessible to screen readers. It can also be set to an object of breakpoints to hide the element at specific breakpoints.
|
|
531
|
-
|
|
532
|
-
Hide on all breakpoints: `srOnly: true` Hide on specific breakpoints: `srOnly: { xs: false, sm: true, md: false, lg: true, xl: false, xxl: true }`
|
|
533
|
-
|
|
534
|
-
ResponsiveProp<boolean> | undefined
|
|
535
|
-
|
|
536
|
-
| \- | Set object |
|
|
537
|
-
| stretch |
|
|
538
|
-
|
|
539
|
-
The **`stretch`** property is used to stretch an element to fill the available space in its parent container. It sets the `height` property to `100%` and `alignSelf` to `stretch`, allowing the element to expand and contract based on the size of its parent.
|
|
540
|
-
|
|
541
|
-
booleanundefined
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
| \- | Set object |
|
|
546
|
-
| textAlign |
|
|
547
|
-
|
|
548
|
-
The **`text-align`** CSS property sets the horizontal alignment of the inline-level content inside a block element or table-cell box.
|
|
549
|
-
|
|
550
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
551
|
-
| --- | --- | --- | --- | --- |
|
|
552
|
-
| **1** | **1** | **1** | **12** | **3** |
|
|
553
|
-
|
|
554
|
-
ResponsiveProp<"center" | "left" | "right" | "inherit" | "justify"> | undefined
|
|
555
|
-
|
|
556
|
-
| \- | Set object |
|
|
557
|
-
| textStyle |
|
|
558
|
-
|
|
559
|
-
Select the typography to be used using the **`textStyle`** prop. These are connected to the typography tokens in the design system.'
|
|
560
|
-
|
|
561
|
-
* `typography.body.sm` - Use for small components such as badges and disclaimers, as well as compact variations of tables and lists.
|
|
562
|
-
* `typography.body.md` - The most commonly used body text size, used for most text content in the product and the default state of all components in the design system.
|
|
563
|
-
* `typography.body.lg` - Use for tag lines, subtitles, and other large text content in the product.
|
|
564
|
-
* `typography.heading.1` - Use for the main page title to establish a clear hierarchy. There is typically only one H1 per screen, emphasising the primary purpose or context of the page.
|
|
565
|
-
* `typography.heading.2` - Use for primary section headings within a page to organise content and guide the user through key areas. Also suitable for large components—such as modals—where space allows and where it pairs well with body.md or body.lg.
|
|
566
|
-
* `typography.heading.3` - Use for sub-sections under H2s to further structure content and maintain a clear visual hierarchy. Ideal for breaking down complex sections into manageable parts.
|
|
567
|
-
* `typography.heading.4` - Use for supporting headings within content blocks or small components where space is limited—such as table headers, cards, or side panels. Provides structure without overwhelming the layout.
|
|
568
|
-
* `typography.heading.5` - Use for minor labels or titles in compact UI elements, such as cards, sidebars, or inline labels. Best used to emphasise supplementary information without drawing too much attention. Works well with body.sm and is ideal for subtle content like fine print. Use sparingly to preserve typographic hierarchy.
|
|
569
|
-
* `typography.code` - Used to display code snippets in the product, such as in the API documentation.
|
|
570
|
-
|
|
571
|
-
ResponsiveProp<"typography.heading.1" | "typography.heading.2" | "typography.heading.3" | "typography.heading.4" | "typography.heading.5" | "typography.body.sm" | "typography.body.sm.regular" | ... 10 more ... | "typography.code"> | undefined
|
|
572
|
-
|
|
573
|
-
| \- | Set object |
|
|
574
|
-
| width |
|
|
575
|
-
|
|
576
|
-
The **`width`** CSS property sets an element's width. By default, it sets the width of the content area, but if `box-sizing` is set to `border-box`, it sets the width of the border area.
|
|
577
|
-
|
|
578
|
-
This prop only allows widths available throughout the component library. To use a custom width, you need to use the `style` prop, or add a custom class to the element and use CSS.
|
|
579
|
-
|
|
580
|
-
| Chrome | Firefox | Safari | Edge | IE |
|
|
581
|
-
| --- | --- | --- | --- | --- |
|
|
582
|
-
| **1** | **1** | **1** | **12** | **4** |
|
|
583
|
-
|
|
584
|
-
ResponsiveProp<"auto" | SizeToken | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | ... 8 more ... | "11/12"> | undefined
|
|
585
|
-
|
|
586
|
-
| \- | Set object |
|
|
587
|
-
|
|
588
|
-
[](#controlling-the-slideout)Controlling the slideout
|
|
589
|
-
-----------------------------------------------------
|
|
590
|
-
|
|
591
|
-
### [](#using-the-show-property)Using the `show` property
|
|
592
|
-
|
|
593
|
-
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`.
|
|
594
|
-
|
|
595
|
-
Show slideout using state
|
|
596
|
-
|
|
597
|
-
Hide code
|
|
598
|
-
|
|
599
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
600
|
-
|
|
601
|
-
import { IressButton, IressSlideout, IressSlideoutProps } from '@iress-oss/ids-components';
|
|
602
|
-
import { useState } from 'react';
|
|
603
|
-
export const SlideoutUsingState \= () \=> {
|
|
604
|
-
const \[show, setShow\] \= useState(false);
|
|
605
|
-
return (
|
|
606
|
-
<\>
|
|
607
|
-
<IressButton onClick\={() \=> setShow(true)}\>
|
|
608
|
-
Show slideout using state </IressButton\>
|
|
609
|
-
<IressSlideout
|
|
610
|
-
{...{
|
|
611
|
-
children: 'This slideout was opened via state',
|
|
612
|
-
}}
|
|
613
|
-
show\={show}
|
|
614
|
-
onShowChange\={setShow}
|
|
615
|
-
footer\={<IressButton onClick\={() \=> setShow(false)}\>Close</IressButton\>}
|
|
616
|
-
/>
|
|
617
|
-
</\>
|
|
618
|
-
);
|
|
619
|
-
};
|
|
620
|
-
|
|
621
|
-
Copy
|
|
622
|
-
|
|
623
|
-
### [](#using-the-iressslideoutprovider)Using the `IressSlideoutProvider`
|
|
624
|
-
|
|
625
|
-
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.
|
|
626
|
-
|
|
627
|
-
To use, wrap your `<App/>` or the component that you want to use the `useSlideout` hook with `<IressSlideoutProvider />`.
|
|
628
|
-
|
|
629
|
-
Show slideout using provider
|
|
630
|
-
|
|
631
|
-
Hide code
|
|
632
|
-
|
|
633
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
634
|
-
|
|
635
|
-
const SLIDEOUT\_ID \= 'storybook-slideout';
|
|
636
|
-
export const App \= (slideoutProps: IressSlideoutProps) \=> (
|
|
637
|
-
<IressSlideoutProvider\>
|
|
638
|
-
<SlideoutWithTrigger {...slideoutProps} />
|
|
639
|
-
</IressSlideoutProvider\>
|
|
640
|
-
);
|
|
641
|
-
const SlideoutWithTrigger \= ({
|
|
642
|
-
id \= SLIDEOUT\_ID,
|
|
643
|
-
...slideoutProps
|
|
644
|
-
}: IressSlideoutProps) \=> {
|
|
645
|
-
const { showSlideout } \= useSlideout();
|
|
646
|
-
return (
|
|
647
|
-
<\>
|
|
648
|
-
<IressButton onClick\={() \=> showSlideout(id)}\>
|
|
649
|
-
Show slideout using provider </IressButton\>
|
|
650
|
-
<IressSlideout
|
|
651
|
-
{...slideoutProps}
|
|
652
|
-
id\={id}
|
|
653
|
-
footer\={
|
|
654
|
-
<IressButton onClick\={() \=> showSlideout(id, false)}\>
|
|
655
|
-
Close slideout </IressButton\>
|
|
656
|
-
}
|
|
657
|
-
\>
|
|
658
|
-
{slideoutProps.children ?? 'Slideout content'}
|
|
659
|
-
</IressSlideout\>
|
|
660
|
-
</\>
|
|
661
|
-
);
|
|
662
|
-
};
|
|
663
|
-
|
|
664
|
-
Copy
|
|
665
|
-
|
|
666
|
-
#### [](#provider-api)Props
|
|
667
|
-
|
|
668
|
-
These are some settings you can use to customise the provider, such as setting where the slideouts are rendered in the DOM.
|
|
669
|
-
|
|
670
|
-
| Name | Description | Default | Control |
|
|
671
|
-
| --- | --- | --- | --- |
|
|
672
|
-
| children |
|
|
673
|
-
\-
|
|
674
|
-
|
|
675
|
-
| \- | \- |
|
|
676
|
-
| container |
|
|
677
|
-
|
|
678
|
-
The container element to render the slideout into. By default, the slideout will render at the end of the document body.
|
|
679
|
-
|
|
680
|
-
FloatingUIContainerundefined
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
| \- | \- |
|
|
685
|
-
| Show Storybook only itemsStorybook only | Show Storybook only items |
|
|
686
|
-
|
|
687
|
-
[](#examples)Examples
|
|
688
|
-
---------------------
|
|
689
|
-
|
|
690
|
-
### [](#modes)Modes
|
|
691
|
-
|
|
692
|
-
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.
|
|
693
|
-
|
|
694
|
-
Overlay slideoutPush slideout
|
|
695
|
-
|
|
696
|
-
Hide code
|
|
697
|
-
|
|
698
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
699
|
-
|
|
700
|
-
const Story \= () \=> {
|
|
701
|
-
const { showSlideout } \= useSlideout();
|
|
702
|
-
const SLIDEOUT\_ID \= 'storybook-slideout';
|
|
703
|
-
return (
|
|
704
|
-
<IressPanel bg\="alt"\>
|
|
705
|
-
<IressInline gap\="md"\>
|
|
706
|
-
<IressButton onClick\={() \=> showSlideout("overlay")}\>
|
|
707
|
-
Overlay slideout </IressButton\>
|
|
708
|
-
<IressSlideout
|
|
709
|
-
footer\=""
|
|
710
|
-
id\="overlay"
|
|
711
|
-
mode\="overlay"
|
|
712
|
-
\>
|
|
713
|
-
<h2\>
|
|
714
|
-
Overlay </h2\>
|
|
715
|
-
For most situations{' '}
|
|
716
|
-
<code\>
|
|
717
|
-
overlay </code\>
|
|
718
|
-
{' '}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.
|
|
719
|
-
</IressSlideout\>
|
|
720
|
-
<IressButton onClick\={() \=> showSlideout("push")}\>
|
|
721
|
-
Push slideout </IressButton\>
|
|
722
|
-
<IressSlideout
|
|
723
|
-
eleToPush\="#storybook-docs, html"
|
|
724
|
-
footer\=""
|
|
725
|
-
id\="push"
|
|
726
|
-
mode\="push"
|
|
727
|
-
\>
|
|
728
|
-
<IressText\>
|
|
729
|
-
<h2\>
|
|
730
|
-
Push </h2\>
|
|
731
|
-
<p\>
|
|
732
|
-
If you have a data-heavy screen where you need all of the data to be visible when the slideout is open, use{' '}
|
|
733
|
-
<code\>
|
|
734
|
-
push </code\>
|
|
735
|
-
. To allow push to work you will need to supply the ID of the element that needs to be pushed via the{' '}
|
|
736
|
-
<code\>
|
|
737
|
-
eleToPush </code\>
|
|
738
|
-
{' '}prop. If the ID is not supplied, or the element cannot be found, the slideout will revert to{' '}
|
|
739
|
-
<code\>
|
|
740
|
-
overlay </code\>
|
|
741
|
-
{' '}behaviour.
|
|
742
|
-
</p\>
|
|
743
|
-
<p\>
|
|
744
|
-
{\`Be aware though that push will only work on larger screens (>1200px); on smaller screens the slideout will overlay the content.\`}
|
|
745
|
-
</p\>
|
|
746
|
-
<IressPanel bg\="alt"\>
|
|
747
|
-
<CurrentBreakpoint />
|
|
748
|
-
</IressPanel\>
|
|
749
|
-
</IressText\>
|
|
750
|
-
</IressSlideout\>
|
|
751
|
-
</IressInline\>
|
|
752
|
-
</IressPanel\>
|
|
753
|
-
);
|
|
754
|
-
};
|
|
755
|
-
|
|
756
|
-
export const App \= () \=> (
|
|
757
|
-
<IressSlideoutProvider\>
|
|
758
|
-
<Story />
|
|
759
|
-
</IressSlideoutProvider\>
|
|
760
|
-
);
|
|
761
|
-
|
|
762
|
-
Copy
|
|
763
|
-
|
|
764
|
-
### [](#position)Position
|
|
765
|
-
|
|
766
|
-
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.
|
|
767
|
-
|
|
768
|
-
rightleft
|
|
769
|
-
|
|
770
|
-
Hide code
|
|
771
|
-
|
|
772
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
773
|
-
|
|
774
|
-
const Slideouts \= () \=> {
|
|
775
|
-
const { showSlideout } \= useSlideout();
|
|
776
|
-
return (
|
|
777
|
-
<IressInline gap\="md" horizontalAlign\="between"\>
|
|
778
|
-
<IressButton onClick\={() \=> showSlideout('right')}\>right</IressButton\>
|
|
779
|
-
<IressSlideout id\="right" position\="right"\>
|
|
780
|
-
Slideout opened on the right </IressSlideout\>
|
|
781
|
-
<IressButton onClick\={() \=> showSlideout('left')}\>left</IressButton\>
|
|
782
|
-
<IressSlideout id\="left" position\="left"\>
|
|
783
|
-
Slideout opened on the left </IressSlideout\>
|
|
784
|
-
</IressInline\>
|
|
785
|
-
);
|
|
786
|
-
};
|
|
787
|
-
export const SlideoutPositions \= () \=> (
|
|
788
|
-
<IressSlideoutProvider\>
|
|
789
|
-
<Slideouts />
|
|
790
|
-
</IressSlideoutProvider\>
|
|
791
|
-
);
|
|
792
|
-
|
|
793
|
-
Copy
|
|
794
|
-
|
|
795
|
-
### [](#size)Size
|
|
796
|
-
|
|
797
|
-
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`.
|
|
798
|
-
|
|
799
|
-
smmd
|
|
800
|
-
|
|
801
|
-
Hide code
|
|
802
|
-
|
|
803
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
804
|
-
|
|
805
|
-
const Slideouts \= () \=> {
|
|
806
|
-
const { showSlideout } \= useSlideout();
|
|
807
|
-
return (
|
|
808
|
-
<IressInline gap\="spacing.400"\>
|
|
809
|
-
<IressButton onClick\={() \=> showSlideout('sm')}\>sm</IressButton\>
|
|
810
|
-
<IressSlideout id\="sm" size\="sm"\>
|
|
811
|
-
Small slideout </IressSlideout\>
|
|
812
|
-
<IressButton onClick\={() \=> showSlideout('md')}\>md</IressButton\>
|
|
813
|
-
<IressSlideout id\="md" size\="md"\>
|
|
814
|
-
Medium slideout </IressSlideout\>
|
|
815
|
-
</IressInline\>
|
|
816
|
-
);
|
|
817
|
-
};
|
|
818
|
-
export const SlideoutSizes \= () \=> (
|
|
819
|
-
<IressSlideoutProvider\>
|
|
820
|
-
<Slideouts />
|
|
821
|
-
</IressSlideoutProvider\>
|
|
822
|
-
);
|
|
823
|
-
|
|
824
|
-
Copy
|
|
825
|
-
|
|
826
|
-
### [](#padding)Padding
|
|
827
|
-
|
|
828
|
-
Slideout padding now is a global styling prop.
|
|
829
|
-
|
|
830
|
-
[](/?path=/docs/styling-props-spacing--docs#padding)
|
|
831
|
-
|
|
832
|
-
[Learn more](/?path=/docs/styling-props-spacing--docs#padding)
|
|
833
|
-
|
|
834
|
-
### [](#footer)Footer
|
|
835
|
-
|
|
836
|
-
The `footer` prop is used to set content that should appear underneath the main content. Usually used for extra controls like buttons etc.
|
|
837
|
-
|
|
838
|
-
Show slideout with footer
|
|
839
|
-
|
|
840
|
-
Hide code
|
|
841
|
-
|
|
842
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
843
|
-
|
|
844
|
-
const Story \= () \=> {
|
|
845
|
-
const { showSlideout } \= useSlideout();
|
|
846
|
-
const SLIDEOUT\_ID \= 'storybook-slideout';
|
|
847
|
-
return (
|
|
848
|
-
<\>
|
|
849
|
-
<IressButton onClick\={() \=> showSlideout(SLIDEOUT\_ID)}\>
|
|
850
|
-
Show slideout with footer </IressButton\>
|
|
851
|
-
<IressSlideout
|
|
852
|
-
footer\={<IressButton\>Footer button</IressButton\>}
|
|
853
|
-
id\="storybook-slideout"
|
|
854
|
-
\>
|
|
855
|
-
Slideout content </IressSlideout\>
|
|
856
|
-
</\>
|
|
857
|
-
);
|
|
858
|
-
};
|
|
859
|
-
|
|
860
|
-
export const App \= () \=> (
|
|
861
|
-
<IressSlideoutProvider\>
|
|
862
|
-
<Story />
|
|
863
|
-
</IressSlideoutProvider\>
|
|
864
|
-
);
|
|
865
|
-
|
|
866
|
-
Copy
|
|
867
|
-
|
|
868
|
-
### [](#absolute-position-slideouts)Absolute position slideouts
|
|
869
|
-
|
|
870
|
-
By default, slideout is set to `position: fixed` which means it will appear from the edge of the browser window. By setting the `position: 'absolute'` in custom inline style, 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.
|
|
871
|
-
|
|
872
|
-
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 inline style `style={{top: '30px', height: 'calc(100% - 30px)'}}` to adjust that if you need to.
|
|
873
|
-
|
|
874
|
-
Show slideout
|
|
875
|
-
|
|
876
|
-
### Absolute slideout
|
|
877
|
-
|
|
878
|
-
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..
|
|
879
|
-
|
|
880
|
-
Hide code
|
|
881
|
-
|
|
882
|
-
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
883
|
-
|
|
884
|
-
import {
|
|
885
|
-
IressStack,
|
|
886
|
-
IressButton,
|
|
887
|
-
IressText,
|
|
888
|
-
IressSlideout,
|
|
889
|
-
IressSlideoutProps,
|
|
890
|
-
} from '@iress-oss/ids-components';
|
|
891
|
-
import { useRef, useState } from 'react';
|
|
892
|
-
import { cssVars } from '@iress-oss/ids-tokens';
|
|
893
|
-
export const AbsolutePositionSlideout \= () \=> {
|
|
894
|
-
const \[show, setShow\] \= useState(false);
|
|
895
|
-
const containerRef \= useRef<HTMLDivElement | null\>(null);
|
|
896
|
-
return (
|
|
897
|
-
<IressStack gap\="md"\>
|
|
898
|
-
<IressButton onClick\={() \=> setShow(true)}\>Show slideout</IressButton\>
|
|
899
|
-
<div
|
|
900
|
-
ref\={containerRef}
|
|
901
|
-
style\={{
|
|
902
|
-
height: '300px',
|
|
903
|
-
border: \`1px solid ${cssVars.colour.neutral\[30\]}\`,
|
|
904
|
-
padding: '1rem',
|
|
905
|
-
overflow: 'hidden',
|
|
906
|
-
position: 'relative',
|
|
907
|
-
}}
|
|
908
|
-
\>
|
|
909
|
-
<IressText id\="contents"\>
|
|
910
|
-
<h3\>Absolute slideout</h3\>
|
|
911
|
-
<p\>
|
|
912
|
-
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\>
|
|
913
|
-
</IressText\>
|
|
914
|
-
<IressSlideout
|
|
915
|
-
{...{
|
|
916
|
-
children: 'Slideout content',
|
|
917
|
-
footer: 'Footer slot',
|
|
918
|
-
id: 'storybook-slideout',
|
|
919
|
-
eleToPush: '#contents',
|
|
920
|
-
position: 'left',
|
|
921
|
-
mode: 'push',
|
|
922
|
-
}}
|
|
923
|
-
container\={containerRef}
|
|
924
|
-
show\={show}
|
|
925
|
-
onShowChange\={setShow}
|
|
926
|
-
style\={
|
|
927
|
-
{
|
|
928
|
-
position: 'absolute',
|
|
929
|
-
} as never
|
|
930
|
-
}
|
|
931
|
-
/>
|
|
932
|
-
</div\>
|
|
933
|
-
</IressStack\>
|
|
934
|
-
);
|
|
935
|
-
};
|
|
936
|
-
|
|
937
|
-
Copy
|
|
938
|
-
|
|
939
|
-
[](#migrating-to-version-5)Migrating to version 5
|
|
940
|
-
-------------------------------------------------
|
|
941
|
-
|
|
942
|
-
### [](#adding-the-provider)Adding the provider
|
|
943
|
-
|
|
944
|
-
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.
|
|
945
|
-
|
|
946
|
-
\[data-radix-scroll-area-viewport\] {
|
|
947
|
-
scrollbar-width: none;
|
|
948
|
-
-ms-overflow-style: none;
|
|
949
|
-
-webkit-overflow-scrolling: touch;
|
|
950
|
-
}
|
|
951
|
-
\[data-radix-scroll-area-viewport\]::-webkit-scrollbar {
|
|
952
|
-
display: none;
|
|
953
|
-
}
|
|
954
|
-
:where(\[data-radix-scroll-area-viewport\]) {
|
|
955
|
-
display: flex;
|
|
956
|
-
flex-direction: column;
|
|
957
|
-
align-items: stretch;
|
|
958
|
-
}
|
|
959
|
-
:where(\[data-radix-scroll-area-content\]) {
|
|
960
|
-
flex-grow: 1;
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
const App \= () \=> (
|
|
964
|
-
<IressSlideoutProvider\>Rest of app here</IressSlideoutProvider\>
|
|
965
|
-
);
|
|
966
|
-
|
|
967
|
-
Copy
|
|
968
|
-
|
|
969
|
-
### [](#testing)Testing
|
|
970
|
-
|
|
971
|
-
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.
|
|
972
|
-
|
|
973
|
-
See below for an example in version 4 and version 5.
|
|
974
|
-
|
|
975
|
-
Mode
|
|
976
|
-
|
|
977
|
-
DiffOldNew
|
|
978
|
-
|
|
979
|
-
<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>
|
|
980
|
-
|
|
981
|
-
### [](#speed-up-tests)Speed up tests
|
|
982
|
-
|
|
983
|
-
You can speed up tests by wrapping your tests in a provider that overrides the theme tokens for animations.
|
|
984
|
-
|
|
985
|
-
\[data-radix-scroll-area-viewport\] {
|
|
986
|
-
scrollbar-width: none;
|
|
987
|
-
-ms-overflow-style: none;
|
|
988
|
-
-webkit-overflow-scrolling: touch;
|
|
989
|
-
}
|
|
990
|
-
\[data-radix-scroll-area-viewport\]::-webkit-scrollbar {
|
|
991
|
-
display: none;
|
|
992
|
-
}
|
|
993
|
-
:where(\[data-radix-scroll-area-viewport\]) {
|
|
994
|
-
display: flex;
|
|
995
|
-
flex-direction: column;
|
|
996
|
-
align-items: stretch;
|
|
997
|
-
}
|
|
998
|
-
:where(\[data-radix-scroll-area-content\]) {
|
|
999
|
-
flex-grow: 1;
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
const themeOverrides: Record<string, string\> \= {
|
|
1003
|
-
'--iress-slideout-animation-duration': '0s',
|
|
1004
|
-
};
|
|
1005
|
-
export const TestAppProvider \= ({ children }: PropsWithChildren) \=> {
|
|
1006
|
-
const containerRef \= useRef<HTMLDivElement\>(null);
|
|
1007
|
-
return (
|
|
1008
|
-
<IressModalProvider container\={containerRef}\>
|
|
1009
|
-
<div style\={themeOverrides} ref\={containerRef}\>
|
|
1010
|
-
{children}
|
|
1011
|
-
</div\>
|
|
1012
|
-
</IressModalProvider\>
|
|
1013
|
-
);
|
|
1014
|
-
};
|
|
1015
|
-
|
|
1016
|
-
Copy
|
|
1017
|
-
|
|
1018
|
-
On this page
|
|
1019
|
-
|
|
1020
|
-
* [Overview](#overview)
|
|
1021
|
-
* [Use a slideout when:](#use-a-slideout-when)
|
|
1022
|
-
* [Props](#props)
|
|
1023
|
-
* [Controlling the slideout](#controlling-the-slideout)
|
|
1024
|
-
* [Using the show property](#using-the-show-property)
|
|
1025
|
-
* [Using the IressSlideoutProvider](#using-the-iressslideoutprovider)
|
|
1026
|
-
* [Examples](#examples)
|
|
1027
|
-
* [Modes](#modes)
|
|
1028
|
-
* [Position](#position)
|
|
1029
|
-
* [Size](#size)
|
|
1030
|
-
* [Padding](#padding)
|
|
1031
|
-
* [Footer](#footer)
|
|
1032
|
-
* [Absolute position slideouts](#absolute-position-slideouts)
|
|
1033
|
-
* [Migrating to version 5](#migrating-to-version-5)
|
|
1034
|
-
* [Adding the provider](#adding-the-provider)
|
|
1035
|
-
* [Testing](#testing)
|
|
1036
|
-
* [Speed up tests](#speed-up-tests)
|