@iress-oss/ids-mcp-server 6.0.0-alpha.1-canary-20251204032753-fe18cab → 6.0.0-alpha.1-canary-20251204040305-3639454
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generated/docs/components_components-alert-docs.md +1054 -0
- package/generated/docs/components_components-autocomplete-docs.md +3304 -0
- package/generated/docs/components_components-autocomplete-recipes-docs.md +98 -0
- package/generated/docs/components_components-badge-docs.md +312 -0
- package/generated/docs/components_components-button-docs.md +2339 -0
- package/generated/docs/components_components-buttongroup-docs.md +980 -0
- package/generated/docs/components_components-card-docs.md +1970 -0
- package/generated/docs/components_components-checkbox-docs.md +1083 -0
- package/generated/docs/components_components-checkboxgroup-docs.md +1597 -0
- package/generated/docs/components_components-checkboxgroup-recipes-docs.md +209 -0
- package/generated/docs/components_components-col-docs.md +755 -0
- package/generated/docs/components_components-container-docs.md +172 -0
- package/generated/docs/components_components-divider-docs.md +235 -0
- package/generated/docs/components_components-expander-docs.md +428 -0
- package/generated/docs/components_components-field-docs.md +3345 -0
- package/generated/docs/components_components-filter-docs.md +4091 -0
- package/generated/docs/components_components-hide-docs.md +450 -0
- package/generated/docs/components_components-icon-docs.md +1017 -0
- package/generated/docs/components_components-image-docs.md +168 -0
- package/generated/docs/components_components-inline-docs.md +1962 -0
- package/generated/docs/components_components-input-docs.md +1388 -0
- package/generated/docs/components_components-input-recipes-docs.md +349 -0
- package/generated/docs/components_components-inputcurrency-docs.md +636 -0
- package/generated/docs/components_components-inputcurrency-recipes-docs.md +208 -0
- package/generated/docs/components_components-introduction-docs.md +448 -0
- package/generated/docs/components_components-label-docs.md +229 -0
- package/generated/docs/components_components-link-docs.md +454 -0
- package/generated/docs/components_components-menu-docs.md +2219 -0
- package/generated/docs/components_components-menu-menuitem-docs.md +1455 -0
- package/generated/docs/components_components-modal-docs.md +2002 -0
- package/generated/docs/components_components-panel-docs.md +342 -0
- package/generated/docs/components_components-placeholder-docs.md +98 -0
- package/generated/docs/components_components-popover-docs.md +1631 -0
- package/generated/docs/components_components-popover-recipes-docs.md +537 -0
- package/generated/docs/components_components-progress-docs.md +128 -0
- package/generated/docs/components_components-provider-docs.md +123 -0
- package/generated/docs/components_components-radio-docs.md +499 -0
- package/generated/docs/components_components-radiogroup-docs.md +1573 -0
- package/generated/docs/components_components-readonly-docs.md +277 -0
- package/generated/docs/components_components-richselect-docs.md +6101 -0
- package/generated/docs/components_components-row-docs.md +2172 -0
- package/generated/docs/components_components-select-docs.md +1110 -0
- package/generated/docs/components_components-skeleton-docs.md +467 -0
- package/generated/docs/components_components-skeleton-recipes-docs.md +110 -0
- package/generated/docs/components_components-skiplink-docs.md +220 -0
- package/generated/docs/components_components-slideout-docs.md +1910 -0
- package/generated/docs/components_components-slider-docs.md +1284 -0
- package/generated/docs/components_components-spinner-docs.md +90 -0
- package/generated/docs/components_components-stack-docs.md +730 -0
- package/generated/docs/components_components-table-docs.md +4038 -0
- package/generated/docs/components_components-tabset-docs.md +955 -0
- package/generated/docs/components_components-tabset-tab-docs.md +342 -0
- package/generated/docs/components_components-tag-docs.md +410 -0
- package/generated/docs/components_components-text-docs.md +593 -0
- package/generated/docs/components_components-toaster-docs.md +451 -0
- package/generated/docs/components_components-toggle-docs.md +513 -0
- package/generated/docs/components_components-tooltip-docs.md +564 -0
- package/generated/docs/components_components-validationmessage-docs.md +608 -0
- package/generated/docs/components_contact-us-docs.md +9 -0
- package/generated/docs/components_foundations-accessibility-docs.md +33 -0
- package/generated/docs/components_foundations-consistency-docs.md +44 -0
- package/generated/docs/components_foundations-content-docs.md +18 -0
- package/generated/docs/components_foundations-introduction-docs.md +17 -0
- package/generated/docs/components_foundations-principles-docs.md +60 -0
- package/generated/docs/components_foundations-responsive-layout-docs.md +2692 -0
- package/generated/docs/components_foundations-user-experience-docs.md +53 -0
- package/generated/docs/components_foundations-visual-design-docs.md +39 -0
- package/generated/docs/components_foundations-z-index-stacking-docs.md +288 -0
- package/generated/docs/components_frequently-asked-questions-docs.md +44 -0
- package/generated/docs/components_get-started-develop-docs.md +47 -0
- package/generated/docs/components_get-started-using-storybook-docs.md +55 -0
- package/generated/docs/components_introduction-docs.md +85 -0
- package/generated/docs/components_patterns-form-docs.md +2469 -0
- package/generated/docs/components_patterns-form-recipes-docs.md +1597 -0
- package/generated/docs/components_patterns-introduction-docs.md +31 -0
- package/generated/docs/components_patterns-loading-docs.md +1908 -0
- package/generated/docs/components_patterns-shadow-docs.md +195 -0
- package/generated/docs/components_resources-code-katas-docs.md +25 -0
- package/generated/docs/components_resources-introduction-docs.md +28 -0
- package/generated/docs/components_resources-mcp-server-docs.md +23 -0
- package/generated/docs/components_resources-migration-guides-from-v4-to-v5-docs.md +142 -0
- package/generated/docs/components_styling-props-colour-docs.md +91 -0
- package/generated/docs/components_styling-props-elevation-docs.md +69 -0
- package/generated/docs/components_styling-props-radius-docs.md +63 -0
- package/generated/docs/components_styling-props-reference-docs.md +160 -0
- package/generated/docs/components_styling-props-screen-readers-docs.md +66 -0
- package/generated/docs/components_styling-props-sizing-docs.md +217 -0
- package/generated/docs/components_styling-props-spacing-docs.md +545 -0
- package/generated/docs/components_styling-props-typography-docs.md +66 -0
- package/generated/docs/components_versions-docs.md +14 -0
- package/generated/docs/guidelines.md +3083 -0
- package/generated/docs/introduction-docs.md +37 -0
- package/generated/docs/tokens_colour-docs.md +479 -0
- package/generated/docs/tokens_elevation-docs.md +39 -0
- package/generated/docs/tokens_introduction-docs.md +150 -0
- package/generated/docs/tokens_radius-docs.md +67 -0
- package/generated/docs/tokens_spacing-docs.md +87 -0
- package/generated/docs/tokens_typography-docs.md +305 -0
- package/package.json +2 -2
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
Recipes
|
|
2
|
+
=======
|
|
3
|
+
|
|
4
|
+
With `IressMenu`
|
|
5
|
+
----------------
|
|
6
|
+
|
|
7
|
+
When an `IressMenu` is used inside `IressPopover`, it adds some additional functionality to the popover, including:
|
|
8
|
+
|
|
9
|
+
* `IressPopover` will automatically close the popover when a menu item is clicked.
|
|
10
|
+
* `IressMenu` will automatically focus the first menu item when the popover is opened.
|
|
11
|
+
|
|
12
|
+
[](./iframe.html?id=components-popover-recipes--with-menu)
|
|
13
|
+
|
|
14
|
+
role=listbox
|
|
15
|
+
|
|
16
|
+
Multi-select
|
|
17
|
+
|
|
18
|
+
### Listbox menu behaviour
|
|
19
|
+
|
|
20
|
+
* Once activated, focus is set to the first menu item
|
|
21
|
+
* Menu items can be navigated using arrow keys
|
|
22
|
+
* Popover will close when:
|
|
23
|
+
* the `esc` key is pressed
|
|
24
|
+
* the `tab` key is pressed (focus moves to the next focusable element in the DOM)
|
|
25
|
+
* a menu item is clicked (except when a listbox menu is in `multiSelect` mode)
|
|
26
|
+
* When user presses the `up` key when the first item is focused
|
|
27
|
+
|
|
28
|
+
role=menu
|
|
29
|
+
|
|
30
|
+
### Application menu behaviour
|
|
31
|
+
|
|
32
|
+
* Once activated, focus is set to the first menu item
|
|
33
|
+
* Menu items can be navigated using the `up` and `down` arrow keys
|
|
34
|
+
* Popover will close when:
|
|
35
|
+
* the `esc` key is pressed
|
|
36
|
+
* the `tab` key is pressed (focus moves to the focusable element in the DOM)
|
|
37
|
+
* a menu item is clicked
|
|
38
|
+
|
|
39
|
+
role=list
|
|
40
|
+
|
|
41
|
+
### Navigation/list menu behaviour
|
|
42
|
+
|
|
43
|
+
* Once activated, focus is set to the popover panel
|
|
44
|
+
* Menu items can be navigated using the `tab` key
|
|
45
|
+
* Popover will close when:
|
|
46
|
+
* the `esc` key is pressed
|
|
47
|
+
* the popover panel loses focus
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
<IressStack
|
|
52
|
+
gap\="md"
|
|
53
|
+
maxWidth\="container.lg"
|
|
54
|
+
mx\="auto"
|
|
55
|
+
px\="lg"
|
|
56
|
+
\>
|
|
57
|
+
<IressRow
|
|
58
|
+
gutter\="lg"
|
|
59
|
+
verticalAlign\="middle"
|
|
60
|
+
\>
|
|
61
|
+
<IressCol span\={2}\>
|
|
62
|
+
<IressPopover
|
|
63
|
+
activator\={<IressButton fluid\>role=listbox</IressButton\>}
|
|
64
|
+
container\={document.body}
|
|
65
|
+
type\="listbox"
|
|
66
|
+
\>
|
|
67
|
+
<IressMenu
|
|
68
|
+
defaultSelected\={3}
|
|
69
|
+
role\="listbox"
|
|
70
|
+
\>
|
|
71
|
+
<IressMenuItem value\={0}\>
|
|
72
|
+
New task </IressMenuItem\>
|
|
73
|
+
<IressMenuItem value\={1}\>
|
|
74
|
+
Send prospect welcome pack </IressMenuItem\>
|
|
75
|
+
<IressMenuItem value\={2}\>
|
|
76
|
+
Book in Discovery meeting </IressMenuItem\>
|
|
77
|
+
<IressMenuItem value\={3}\>
|
|
78
|
+
Prospect proceeding </IressMenuItem\>
|
|
79
|
+
</IressMenu\>
|
|
80
|
+
</IressPopover\>
|
|
81
|
+
</IressCol\>
|
|
82
|
+
<IressCol\>
|
|
83
|
+
<MenuInPopoverRoleDescription role\="listbox"\>
|
|
84
|
+
<IressToggle
|
|
85
|
+
mb\="md"
|
|
86
|
+
onChange\={() \=> {}}
|
|
87
|
+
\>
|
|
88
|
+
Multi-select </IressToggle\>
|
|
89
|
+
</MenuInPopoverRoleDescription\>
|
|
90
|
+
</IressCol\>
|
|
91
|
+
</IressRow\>
|
|
92
|
+
<IressRow
|
|
93
|
+
gutter\="lg"
|
|
94
|
+
verticalAlign\="middle"
|
|
95
|
+
\>
|
|
96
|
+
<IressCol span\={2}\>
|
|
97
|
+
<IressPopover
|
|
98
|
+
activator\={<IressButton fluid\>role=menu</IressButton\>}
|
|
99
|
+
container\={document.body}
|
|
100
|
+
type\="menu"
|
|
101
|
+
\>
|
|
102
|
+
<IressMenu
|
|
103
|
+
defaultSelected\={3}
|
|
104
|
+
role\="menu"
|
|
105
|
+
\>
|
|
106
|
+
<IressMenuItem value\={0}\>
|
|
107
|
+
New task </IressMenuItem\>
|
|
108
|
+
<IressMenuItem value\={1}\>
|
|
109
|
+
Send prospect welcome pack </IressMenuItem\>
|
|
110
|
+
<IressMenuItem value\={2}\>
|
|
111
|
+
Book in Discovery meeting </IressMenuItem\>
|
|
112
|
+
<IressMenuItem value\={3}\>
|
|
113
|
+
Prospect proceeding </IressMenuItem\>
|
|
114
|
+
</IressMenu\>
|
|
115
|
+
</IressPopover\>
|
|
116
|
+
</IressCol\>
|
|
117
|
+
<IressCol\>
|
|
118
|
+
<MenuInPopoverRoleDescription role\="menu" />
|
|
119
|
+
</IressCol\>
|
|
120
|
+
</IressRow\>
|
|
121
|
+
<IressRow
|
|
122
|
+
gutter\="lg"
|
|
123
|
+
verticalAlign\="middle"
|
|
124
|
+
\>
|
|
125
|
+
<IressCol span\={2}\>
|
|
126
|
+
<IressPopover
|
|
127
|
+
activator\={<IressButton fluid\>role=list</IressButton\>}
|
|
128
|
+
container\={document.body}
|
|
129
|
+
\>
|
|
130
|
+
<IressMenu
|
|
131
|
+
defaultSelected\={3}
|
|
132
|
+
role\="list"
|
|
133
|
+
\>
|
|
134
|
+
<IressMenuItem value\={0}\>
|
|
135
|
+
New task </IressMenuItem\>
|
|
136
|
+
<IressMenuItem value\={1}\>
|
|
137
|
+
Send prospect welcome pack </IressMenuItem\>
|
|
138
|
+
<IressMenuItem value\={2}\>
|
|
139
|
+
Book in Discovery meeting </IressMenuItem\>
|
|
140
|
+
<IressMenuItem value\={3}\>
|
|
141
|
+
Prospect proceeding </IressMenuItem\>
|
|
142
|
+
</IressMenu\>
|
|
143
|
+
</IressPopover\>
|
|
144
|
+
</IressCol\>
|
|
145
|
+
<IressCol\>
|
|
146
|
+
<MenuInPopoverRoleDescription role\="list" />
|
|
147
|
+
</IressCol\>
|
|
148
|
+
</IressRow\>
|
|
149
|
+
</IressStack\>
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
#### Props
|
|
154
|
+
|
|
155
|
+
| Name | Description | Default | Control |
|
|
156
|
+
| --- | --- | --- | --- |
|
|
157
|
+
| activator\* |
|
|
158
|
+
Content for an activator element, usually an `IressButton`.
|
|
159
|
+
|
|
160
|
+
PopoverActivatorProps\['children'\]
|
|
161
|
+
|
|
162
|
+
| \- | \- |
|
|
163
|
+
| align |
|
|
164
|
+
|
|
165
|
+
Sets the alignment of the popover relative to the activator element.
|
|
166
|
+
|
|
167
|
+
FloatingUIAligns
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
|
172
|
+
|
|
173
|
+
'auto'
|
|
174
|
+
|
|
175
|
+
| Set object |
|
|
176
|
+
| children |
|
|
177
|
+
|
|
178
|
+
The content to render within the popover.
|
|
179
|
+
|
|
180
|
+
ReactNode
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
| \- | \- |
|
|
185
|
+
| container |
|
|
186
|
+
|
|
187
|
+
The container element to render the popover into. By default, the popover will render where its parent is rendered.
|
|
188
|
+
|
|
189
|
+
**Note:** If the `container` doesn’t exist when the popover is mounted, ensure you pass an element directly (not a ref) and specify null as the default value before it is set. This lets it wait for the root to be available. For example, if you reference the parent element of a popover.
|
|
190
|
+
|
|
191
|
+
FloatingUIContainer
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
| \- | Set object |
|
|
196
|
+
| contentClassName |
|
|
197
|
+
|
|
198
|
+
Class name of the popover content.
|
|
199
|
+
|
|
200
|
+
string
|
|
201
|
+
|
|
202
|
+
<table class="css-3nr4py"><tbody><tr><td colspan="2"><strong>Deprecated</strong>: Use `contentStyle` instead.</td></tr></tbody></table>
|
|
203
|
+
|
|
204
|
+
| \- | Set string |
|
|
205
|
+
| contentStyle |
|
|
206
|
+
|
|
207
|
+
This allows you to customise the content styling specifically, which is the floating element. It accepts an object with any of the styling properties available on `IressCSSProps`, as well as `className` and `style`.
|
|
208
|
+
|
|
209
|
+
IressCustomiseSlot
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
| \- | Set object |
|
|
214
|
+
| defaultShow |
|
|
215
|
+
|
|
216
|
+
When set to `true` the popover will be visible by default. Use for uncontrolled popovers.
|
|
217
|
+
|
|
218
|
+
boolean
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
| \- | Set boolean |
|
|
223
|
+
| displayMode |
|
|
224
|
+
|
|
225
|
+
Sets the display mode of popover.
|
|
226
|
+
|
|
227
|
+
DisplayModes
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
|
232
|
+
|
|
233
|
+
'overlay'
|
|
234
|
+
|
|
235
|
+
| Set object |
|
|
236
|
+
| fluid |
|
|
237
|
+
|
|
238
|
+
Popovers can be fluid, meaning they will take up the full width of their container.
|
|
239
|
+
|
|
240
|
+
boolean
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
| \- | Set boolean |
|
|
245
|
+
| focusStartIndex |
|
|
246
|
+
|
|
247
|
+
Which index to start the focus on when the popover is opened. Only works with `type` listbox and menu. Note: The index must exist in the list of items, otherwise it will not work.
|
|
248
|
+
|
|
249
|
+
number
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
| \- | Set number |
|
|
254
|
+
| matchActivatorWidth |
|
|
255
|
+
|
|
256
|
+
Sets the popover to match the width of the activator. Note: This only works when `displayMode="overlay"`.
|
|
257
|
+
|
|
258
|
+
boolean
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
| \- | Set boolean |
|
|
263
|
+
| menuChildren |
|
|
264
|
+
|
|
265
|
+
string
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
| \- | Choose option...nonebasiccomplexnavigationheadingsdividersslotsextraInformationselectable |
|
|
270
|
+
| onActivated |
|
|
271
|
+
|
|
272
|
+
Is called when popover is activated.
|
|
273
|
+
|
|
274
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
275
|
+
|
|
276
|
+
| \- | \- |
|
|
277
|
+
| onDeactivated |
|
|
278
|
+
|
|
279
|
+
Is called when popover is deactivated.
|
|
280
|
+
|
|
281
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
282
|
+
|
|
283
|
+
| \- | \- |
|
|
284
|
+
| onNavigate |
|
|
285
|
+
|
|
286
|
+
Is called when registered popover items are navigated using arrow keys. Only works with `type` listbox and menu.
|
|
287
|
+
|
|
288
|
+
(activeIndex: number | null) => void
|
|
289
|
+
|
|
290
|
+
| \- | \- |
|
|
291
|
+
| role |
|
|
292
|
+
|
|
293
|
+
\-
|
|
294
|
+
|
|
295
|
+
| \- | \- |
|
|
296
|
+
| show |
|
|
297
|
+
|
|
298
|
+
When set to `true` the modal will be visible. Use for controlled popovers.
|
|
299
|
+
|
|
300
|
+
boolean
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
| \- | Set boolean |
|
|
305
|
+
| type |
|
|
306
|
+
|
|
307
|
+
Describes the type of content contained in the popover.
|
|
308
|
+
|
|
309
|
+
PopoverHookReturn\['type'\]
|
|
310
|
+
|
|
311
|
+
| \- | \- |
|
|
312
|
+
| virtualFocus |
|
|
313
|
+
|
|
314
|
+
Whether the focus is virtual (using `aria-activedescendant`). Use this if you need focus to remain on the reference element (such as an input), but allow arrow keys to navigate items. Note: This is only applicable when type is set to: `listbox` or `menu`, and only works out of the box with `IressMenu` and its subcomponents.
|
|
315
|
+
|
|
316
|
+
boolean
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
| \- | Set boolean |
|
|
321
|
+
|
|
322
|
+
Focusable children
|
|
323
|
+
------------------
|
|
324
|
+
|
|
325
|
+
If you are using the `listbox` or `menu` type popovers, you will notice that focusable children (with the exception of `IressMenuItem`) are not automatically focusable with the arrow keys. To make them focusable, you will need to embed the focusable children using the `usePopoverItem` hook.
|
|
326
|
+
|
|
327
|
+
The `usePopoverItem` hook will automatically handle the focus management for you. It has two optional arguments:
|
|
328
|
+
|
|
329
|
+
* The first argument is the typeahead label of the item you are registering. This will allow it to have a keyboard shortcut to focus the item.
|
|
330
|
+
* The second argument is a virtual node, which is used in `virtualFocus` enabled popovers and `IressInputPopover`, to mimic the `onKeyDown` and `onBlur` events of the original element when the item is virtually focused using `aria-activedescendant`. If not provided, nothing will happen when the element is virtually focused.
|
|
331
|
+
|
|
332
|
+
The `usePopoverItem` hook returns an object with the following properties:
|
|
333
|
+
|
|
334
|
+
* `isActiveInPopover`: A boolean that indicates if the item is currently focused in the popover. This can be used to style the item differently when it is focused.
|
|
335
|
+
* `...popoverItemProps`: The rest of the props that you should spread on the focusable element to make it focusable.
|
|
336
|
+
|
|
337
|
+
[](./iframe.html?id=components-popover-recipes--focusable-children)
|
|
338
|
+
|
|
339
|
+
Toggle
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
const CountButton \= () \=> {
|
|
344
|
+
const \[count, setCount\] \= useState(0);
|
|
345
|
+
const { isActiveInPopover, ...popoverItemProps } \= usePopoverItem('Count', {
|
|
346
|
+
onKeyDown: (e) \=> {
|
|
347
|
+
if (e.key \=== '+') {
|
|
348
|
+
setCount(count + 1);
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
});
|
|
352
|
+
return (
|
|
353
|
+
<IressButton
|
|
354
|
+
{...popoverItemProps}
|
|
355
|
+
active\={isActiveInPopover}
|
|
356
|
+
mode\="tertiary"
|
|
357
|
+
fluid
|
|
358
|
+
\>
|
|
359
|
+
Increase count using the + key: {count}
|
|
360
|
+
</IressButton\>
|
|
361
|
+
);
|
|
362
|
+
};
|
|
363
|
+
export const UsePopoverExample \= () \=> (
|
|
364
|
+
<IressPopover
|
|
365
|
+
activator\={<IressButton\>Toggle</IressButton\>}
|
|
366
|
+
container\={document.body}
|
|
367
|
+
type\="listbox"
|
|
368
|
+
virtualFocus
|
|
369
|
+
\>
|
|
370
|
+
<CountButton />
|
|
371
|
+
<CountButton />
|
|
372
|
+
</IressPopover\>
|
|
373
|
+
);
|
|
374
|
+
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
#### Props
|
|
378
|
+
|
|
379
|
+
| Name | Description | Default | Control |
|
|
380
|
+
| --- | --- | --- | --- |
|
|
381
|
+
| activator\* |
|
|
382
|
+
Content for an activator element, usually an `IressButton`.
|
|
383
|
+
|
|
384
|
+
PopoverActivatorProps\['children'\]
|
|
385
|
+
|
|
386
|
+
| \- | Set object |
|
|
387
|
+
| align |
|
|
388
|
+
|
|
389
|
+
Sets the alignment of the popover relative to the activator element.
|
|
390
|
+
|
|
391
|
+
FloatingUIAligns
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
|
396
|
+
|
|
397
|
+
'auto'
|
|
398
|
+
|
|
399
|
+
| Set object |
|
|
400
|
+
| children |
|
|
401
|
+
|
|
402
|
+
The content to render within the popover.
|
|
403
|
+
|
|
404
|
+
ReactNode
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
| \- | \- |
|
|
409
|
+
| container |
|
|
410
|
+
|
|
411
|
+
The container element to render the popover into. By default, the popover will render where its parent is rendered.
|
|
412
|
+
|
|
413
|
+
**Note:** If the `container` doesn’t exist when the popover is mounted, ensure you pass an element directly (not a ref) and specify null as the default value before it is set. This lets it wait for the root to be available. For example, if you reference the parent element of a popover.
|
|
414
|
+
|
|
415
|
+
FloatingUIContainer
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
| \- | Set object |
|
|
420
|
+
| contentClassName |
|
|
421
|
+
|
|
422
|
+
Class name of the popover content.
|
|
423
|
+
|
|
424
|
+
string
|
|
425
|
+
|
|
426
|
+
<table class="css-3nr4py"><tbody><tr><td colspan="2"><strong>Deprecated</strong>: Use `contentStyle` instead.</td></tr></tbody></table>
|
|
427
|
+
|
|
428
|
+
| \- | Set string |
|
|
429
|
+
| contentStyle |
|
|
430
|
+
|
|
431
|
+
This allows you to customise the content styling specifically, which is the floating element. It accepts an object with any of the styling properties available on `IressCSSProps`, as well as `className` and `style`.
|
|
432
|
+
|
|
433
|
+
IressCustomiseSlot
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
| \- | Set object |
|
|
438
|
+
| defaultShow |
|
|
439
|
+
|
|
440
|
+
When set to `true` the popover will be visible by default. Use for uncontrolled popovers.
|
|
441
|
+
|
|
442
|
+
boolean
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
| \- | Set boolean |
|
|
447
|
+
| displayMode |
|
|
448
|
+
|
|
449
|
+
Sets the display mode of popover.
|
|
450
|
+
|
|
451
|
+
DisplayModes
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
|
456
|
+
|
|
457
|
+
'overlay'
|
|
458
|
+
|
|
459
|
+
| Set object |
|
|
460
|
+
| fluid |
|
|
461
|
+
|
|
462
|
+
Popovers can be fluid, meaning they will take up the full width of their container.
|
|
463
|
+
|
|
464
|
+
boolean
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
| \- | Set boolean |
|
|
469
|
+
| focusStartIndex |
|
|
470
|
+
|
|
471
|
+
Which index to start the focus on when the popover is opened. Only works with `type` listbox and menu. Note: The index must exist in the list of items, otherwise it will not work.
|
|
472
|
+
|
|
473
|
+
number
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
| \- | Set number |
|
|
478
|
+
| matchActivatorWidth |
|
|
479
|
+
|
|
480
|
+
Sets the popover to match the width of the activator. Note: This only works when `displayMode="overlay"`.
|
|
481
|
+
|
|
482
|
+
boolean
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
| \- | Set boolean |
|
|
487
|
+
| menuChildren |
|
|
488
|
+
|
|
489
|
+
\-
|
|
490
|
+
|
|
491
|
+
| \- | Choose option...nonebasiccomplexnavigationheadingsdividersslotsextraInformationselectable |
|
|
492
|
+
| onActivated |
|
|
493
|
+
|
|
494
|
+
Is called when popover is activated.
|
|
495
|
+
|
|
496
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
497
|
+
|
|
498
|
+
| \- | \- |
|
|
499
|
+
| onDeactivated |
|
|
500
|
+
|
|
501
|
+
Is called when popover is deactivated.
|
|
502
|
+
|
|
503
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
504
|
+
|
|
505
|
+
| \- | \- |
|
|
506
|
+
| onNavigate |
|
|
507
|
+
|
|
508
|
+
Is called when registered popover items are navigated using arrow keys. Only works with `type` listbox and menu.
|
|
509
|
+
|
|
510
|
+
(activeIndex: number | null) => void
|
|
511
|
+
|
|
512
|
+
| \- | \- |
|
|
513
|
+
| show |
|
|
514
|
+
|
|
515
|
+
When set to `true` the modal will be visible. Use for controlled popovers.
|
|
516
|
+
|
|
517
|
+
boolean
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
| \- | Set boolean |
|
|
522
|
+
| type |
|
|
523
|
+
|
|
524
|
+
Describes the type of content contained in the popover.
|
|
525
|
+
|
|
526
|
+
PopoverHookReturn\['type'\]
|
|
527
|
+
|
|
528
|
+
| \- | Set object |
|
|
529
|
+
| virtualFocus |
|
|
530
|
+
|
|
531
|
+
Whether the focus is virtual (using `aria-activedescendant`). Use this if you need focus to remain on the reference element (such as an input), but allow arrow keys to navigate items. Note: This is only applicable when type is set to: `listbox` or `menu`, and only works out of the box with `IressMenu` and its subcomponents.
|
|
532
|
+
|
|
533
|
+
boolean
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
| \- | Set boolean |
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Progress
|
|
2
|
+
========
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
A progress component is used to indicate to a user the completion of a set of tasks or a process.
|
|
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
|
+
[](./iframe.html?id=components-progress--default)
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
<IressProgress
|
|
22
|
+
max\={30}
|
|
23
|
+
min\={10}
|
|
24
|
+
value\={20}
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Props
|
|
30
|
+
-----
|
|
31
|
+
|
|
32
|
+
| Name | Description | Default | Control |
|
|
33
|
+
| --- | --- | --- | --- |
|
|
34
|
+
| borderRadius |
|
|
35
|
+
The **`border-radius`** CSS property rounds the corners of an element's outer border edge using the radius tokens in the design system.
|
|
36
|
+
|
|
37
|
+
UtilityValues\['borderRadius'\]
|
|
38
|
+
|
|
39
|
+
| \- | Set object |
|
|
40
|
+
| max |
|
|
41
|
+
|
|
42
|
+
The maximum value of the progress indicator.
|
|
43
|
+
|
|
44
|
+
number
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
|
49
|
+
|
|
50
|
+
100
|
|
51
|
+
|
|
52
|
+
| |
|
|
53
|
+
| min |
|
|
54
|
+
|
|
55
|
+
The minimum value of the progress indicator. If `min` is set, the progress indicator will render as a `<meter />` element instead of a `<progress />` element, thereby changing its role to `meter` instead of `progressbar`.
|
|
56
|
+
|
|
57
|
+
TMin
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
| \- |
|
|
62
|
+
|
|
63
|
+
10
|
|
64
|
+
|
|
65
|
+
|
|
|
66
|
+
| sectionTitle |
|
|
67
|
+
|
|
68
|
+
The text that is announced by the screen reader. Should contain a description of the section the progress is being measured for. You can use {{current}} and {{max}} as string replacers for the current value and maximum value respectively.
|
|
69
|
+
|
|
70
|
+
string
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
| 'Progress is {{current}} of {{max}}' | Set string |
|
|
75
|
+
| value |
|
|
76
|
+
|
|
77
|
+
The current value of the progress indicator.
|
|
78
|
+
|
|
79
|
+
number
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
|
84
|
+
|
|
85
|
+
0
|
|
86
|
+
|
|
87
|
+
| |
|
|
88
|
+
|
|
89
|
+
Usage
|
|
90
|
+
-----
|
|
91
|
+
|
|
92
|
+
Progress shows how far through a task or operation you are in a graphical way. The simplest way to use it to set the `value` to specify how much of the task the user has completed, relative to the `max` value (which defaults to 100).
|
|
93
|
+
|
|
94
|
+
### Calculation to convert value in to width
|
|
95
|
+
|
|
96
|
+
The following calculation is used to derive the width percentage:
|
|
97
|
+
|
|
98
|
+
Math.round(
|
|
99
|
+
((this.value - this.min) / (this.max - this.min)) \* 100,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This caters for those scenarios where the `min` or `max` values change.
|
|
105
|
+
|
|
106
|
+
### Boundary limits
|
|
107
|
+
|
|
108
|
+
There is a danger that the value can exceed the boundaries set in the `min` and `max` values, and cause the percentage width of the bar to overflow the indicator. To prevent this the following rules are applied:
|
|
109
|
+
|
|
110
|
+
* If the `value` is less than the `min` prop, it is reset to the `min` prop;
|
|
111
|
+
* If the `value` is more than the `max` prop, it is reset to the `max` prop;
|
|
112
|
+
|
|
113
|
+
### Section Title
|
|
114
|
+
|
|
115
|
+
The `section-title` prop is used by assistive technologies and allows you to tailor the message announced when the progress component is selected. This could be to add extra context about where the user is in a process or section with a multi-part form.
|
|
116
|
+
|
|
117
|
+
### Use of tokens
|
|
118
|
+
|
|
119
|
+
The message supports the use of two tokens within the announcement, which are replaced when the component is rendered. They are:
|
|
120
|
+
|
|
121
|
+
* `{{current}}` - replaced with the `value`;
|
|
122
|
+
* `{{max}}` - replaced with the maximum limit;
|
|
123
|
+
|
|
124
|
+
For example, if the component has been implemented with a max of 10, a value of 6 has been set, and the default section title, the screen reader will announce:
|
|
125
|
+
|
|
126
|
+
Step 6 of 10
|
|
127
|
+
|
|
128
|
+
```
|