@iress-oss/ids-mcp-server 5.15.0 → 5.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generated/docs/components_components-alert-docs.md +492 -0
- package/generated/docs/components_components-autocomplete-docs.md +3485 -0
- package/generated/docs/{components-autocomplete-recipes-docs.md → components_components-autocomplete-recipes-docs.md} +32 -14
- package/generated/docs/{components-badge-docs.md → components_components-badge-docs.md} +222 -30
- package/generated/docs/components_components-button-docs.md +2078 -0
- package/generated/docs/components_components-button-recipes-docs.md +37 -0
- package/generated/docs/components_components-buttongroup-docs.md +1045 -0
- package/generated/docs/components_components-card-docs.md +2276 -0
- package/generated/docs/{components-card-recipes-docs.md → components_components-card-recipes-docs.md} +131 -14
- package/generated/docs/components_components-checkbox-docs.md +1054 -0
- package/generated/docs/{components-checkboxgroup-docs.md → components_components-checkboxgroup-docs.md} +1000 -81
- package/generated/docs/{components-checkboxgroup-recipes-docs.md → components_components-checkboxgroup-recipes-docs.md} +101 -11
- package/generated/docs/{components-col-docs.md → components_components-col-docs.md} +331 -58
- package/generated/docs/components_components-combobox-docs.md +3767 -0
- package/generated/docs/{components-container-docs.md → components_components-container-docs.md} +61 -24
- package/generated/docs/{components-divider-docs.md → components_components-divider-docs.md} +83 -24
- package/generated/docs/{components-expander-docs.md → components_components-expander-docs.md} +264 -33
- package/generated/docs/{components-field-docs.md → components_components-field-docs.md} +814 -120
- package/generated/docs/components_components-filter-docs.md +4080 -0
- package/generated/docs/{components-form-docs.md → components_components-form-docs.md} +1515 -353
- package/generated/docs/{components-form-recipes-docs.md → components_components-form-recipes-docs.md} +170 -54
- package/generated/docs/components_components-hide-docs.md +293 -0
- package/generated/docs/components_components-icon-docs.md +1337 -0
- package/generated/docs/{components-inline-docs.md → components_components-inline-docs.md} +462 -42
- package/generated/docs/components_components-input-docs.md +1468 -0
- package/generated/docs/components_components-input-recipes-docs.md +367 -0
- package/generated/docs/components_components-inputcurrency-docs.md +432 -0
- package/generated/docs/{components-inputcurrency-recipes-docs.md → components_components-inputcurrency-recipes-docs.md} +110 -17
- package/generated/docs/components_components-label-docs.md +323 -0
- package/generated/docs/components_components-menu-docs.md +2345 -0
- package/generated/docs/components_components-menu-menuitem-docs.md +633 -0
- package/generated/docs/{components-modal-docs.md → components_components-modal-docs.md} +1625 -232
- package/generated/docs/components_components-navbar-docs.md +1847 -0
- package/generated/docs/{components-navbar-recipes-docs.md → components_components-navbar-recipes-docs.md} +697 -39
- package/generated/docs/{components-panel-docs.md → components_components-panel-docs.md} +754 -57
- package/generated/docs/components_components-placeholder-docs.md +92 -0
- package/generated/docs/components_components-popover-docs.md +1641 -0
- package/generated/docs/{components-popover-recipes-docs.md → components_components-popover-recipes-docs.md} +347 -17
- package/generated/docs/components_components-progress-docs.md +115 -0
- package/generated/docs/{components-provider-docs.md → components_components-provider-docs.md} +41 -32
- package/generated/docs/components_components-radio-docs.md +491 -0
- package/generated/docs/{components-radiogroup-docs.md → components_components-radiogroup-docs.md} +943 -75
- package/generated/docs/components_components-readonly-docs.md +263 -0
- package/generated/docs/components_components-richselect-docs.md +6497 -0
- package/generated/docs/{components-row-docs.md → components_components-row-docs.md} +353 -43
- package/generated/docs/{components-select-docs.md → components_components-select-docs.md} +719 -61
- package/generated/docs/components_components-skeleton-docs.md +480 -0
- package/generated/docs/{components-skeleton-recipes-docs.md → components_components-skeleton-recipes-docs.md} +50 -10
- package/generated/docs/{components-skiplink-docs.md → components_components-skiplink-docs.md} +53 -14
- package/generated/docs/components_components-slideout-docs.md +2262 -0
- package/generated/docs/components_components-slider-docs.md +1276 -0
- package/generated/docs/components_components-spinner-docs.md +82 -0
- package/generated/docs/{components-stack-docs.md → components_components-stack-docs.md} +223 -40
- package/generated/docs/components_components-table-docs.md +3651 -0
- package/generated/docs/components_components-tabset-docs.md +772 -0
- package/generated/docs/components_components-tabset-tab-docs.md +262 -0
- package/generated/docs/components_components-tag-docs.md +259 -0
- package/generated/docs/{components-text-docs.md → components_components-text-docs.md} +491 -51
- package/generated/docs/{components-toaster-docs.md → components_components-toaster-docs.md} +181 -79
- package/generated/docs/components_components-toaster-toast-docs.md +634 -0
- package/generated/docs/components_components-toggle-docs.md +461 -0
- package/generated/docs/{components-tooltip-docs.md → components_components-tooltip-docs.md} +286 -41
- package/generated/docs/{components-validationmessage-docs.md → components_components-validationmessage-docs.md} +230 -61
- package/generated/docs/components_contact-us-docs.md +12 -0
- package/generated/docs/{foundations-accessibility-docs.md → components_foundations-accessibility-docs.md} +11 -21
- package/generated/docs/{foundations-colours-docs.md → components_foundations-colour-030-colours.md} +8 -15
- package/generated/docs/{foundations-consistency-docs.md → components_foundations-consistency-docs.md} +12 -20
- package/generated/docs/{foundations-content-docs.md → components_foundations-content-docs.md} +6 -11
- package/generated/docs/components_foundations-introduction-docs.md +15 -0
- package/generated/docs/{foundations-principles-docs.md → components_foundations-principles-docs.md} +14 -24
- package/generated/docs/components_foundations-typography-docs.md +608 -0
- package/generated/docs/{foundations-user-experience-docs.md → components_foundations-user-experience-docs.md} +16 -26
- package/generated/docs/{foundations-visual-design-docs.md → components_foundations-visual-design-docs.md} +10 -17
- package/generated/docs/{frequently-asked-questions-docs.md → components_frequently-asked-questions-docs.md} +14 -23
- package/generated/docs/components_get-started-develop-docs.md +84 -0
- package/generated/docs/components_get-started-using-storybook-docs.md +55 -0
- package/generated/docs/components_introduction-docs.md +15 -0
- package/generated/docs/{patterns-loading-docs.md → components_patterns-loading-docs.md} +711 -143
- package/generated/docs/components_resources-changelog-docs.md +4 -0
- package/generated/docs/{resources-code-katas-docs.md → components_resources-code-katas-docs.md} +5 -9
- package/generated/docs/{resources-migration-guides-from-v4-to-v5-docs.md → components_resources-migration-guides-from-v4-to-v5-docs.md} +54 -239
- package/generated/docs/{versions-docs.md → components_versions-docs.md} +5 -8
- package/generated/docs/guidelines.md +484 -200
- package/generated/docs/introduction-docs.md +19 -30
- package/package.json +41 -45
- package/generated/docs/components-alert-docs.md +0 -130
- package/generated/docs/components-autocomplete-docs.md +0 -754
- package/generated/docs/components-button-docs.md +0 -362
- package/generated/docs/components-button-recipes-docs.md +0 -76
- package/generated/docs/components-buttongroup-docs.md +0 -310
- package/generated/docs/components-card-docs.md +0 -494
- package/generated/docs/components-checkbox-docs.md +0 -193
- package/generated/docs/components-combobox-docs.md +0 -1016
- package/generated/docs/components-filter-docs.md +0 -1109
- package/generated/docs/components-hide-docs.md +0 -265
- package/generated/docs/components-icon-docs.md +0 -553
- package/generated/docs/components-input-docs.md +0 -335
- package/generated/docs/components-input-recipes-docs.md +0 -140
- package/generated/docs/components-inputcurrency-docs.md +0 -157
- package/generated/docs/components-label-docs.md +0 -135
- package/generated/docs/components-menu-docs.md +0 -704
- package/generated/docs/components-menu-menuitem-docs.md +0 -193
- package/generated/docs/components-navbar-docs.md +0 -291
- package/generated/docs/components-placeholder-docs.md +0 -27
- package/generated/docs/components-popover-docs.md +0 -464
- package/generated/docs/components-progress-docs.md +0 -104
- package/generated/docs/components-radio-docs.md +0 -107
- package/generated/docs/components-readonly-docs.md +0 -89
- package/generated/docs/components-richselect-docs.md +0 -2433
- package/generated/docs/components-skeleton-docs.md +0 -214
- package/generated/docs/components-slideout-docs.md +0 -538
- package/generated/docs/components-slider-docs.md +0 -346
- package/generated/docs/components-spinner-docs.md +0 -59
- package/generated/docs/components-table-ag-grid-docs.md +0 -1074
- package/generated/docs/components-table-docs.md +0 -1305
- package/generated/docs/components-tabset-docs.md +0 -341
- package/generated/docs/components-tabset-tab-docs.md +0 -86
- package/generated/docs/components-tag-docs.md +0 -115
- package/generated/docs/components-toaster-toast-docs.md +0 -157
- package/generated/docs/components-toggle-docs.md +0 -158
- package/generated/docs/contact-us-docs.md +0 -27
- package/generated/docs/extensions-editor-docs.md +0 -288
- package/generated/docs/extensions-editor-recipes-docs.md +0 -39
- package/generated/docs/foundations-introduction-docs.md +0 -17
- package/generated/docs/foundations-typography-docs.md +0 -191
- package/generated/docs/get-started-develop-docs.md +0 -209
- package/generated/docs/get-started-using-storybook-docs.md +0 -68
- package/generated/docs/resources-changelog-docs.md +0 -6
- package/generated/docs/themes-available-themes-docs.md +0 -66
- package/generated/docs/themes-introduction-docs.md +0 -121
- package/generated/docs/themes-tokens-docs.md +0 -1200
- /package/{LICENSE.txt → LICENSE} +0 -0
|
@@ -0,0 +1,772 @@
|
|
|
1
|
+
Tab Set
|
|
2
|
+
=======
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
Tabs are used to display modular pieces of related data that do not need to be compared or accessed simultaneously.
|
|
8
|
+
|
|
9
|
+
[](./iframe.html?id=components-tabset--panels)
|
|
10
|
+
|
|
11
|
+
Address
|
|
12
|
+
|
|
13
|
+
Employment
|
|
14
|
+
|
|
15
|
+
History
|
|
16
|
+
|
|
17
|
+
Address information goes here
|
|
18
|
+
|
|
19
|
+
Employment information goes here
|
|
20
|
+
|
|
21
|
+
Medical history goes here
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
<IressTabSet\>
|
|
26
|
+
<IressTab label\="Address"\>
|
|
27
|
+
Address information goes here </IressTab\>
|
|
28
|
+
<IressTab label\="Employment"\>
|
|
29
|
+
Employment information goes here </IressTab\>
|
|
30
|
+
<IressTab label\="History"\>
|
|
31
|
+
Medical history goes here </IressTab\>
|
|
32
|
+
</IressTabSet\>
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Props
|
|
37
|
+
-----
|
|
38
|
+
|
|
39
|
+
| Name | Description | Default | Control |
|
|
40
|
+
| --- | --- | --- | --- |
|
|
41
|
+
| children |
|
|
42
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
43
|
+
|
|
44
|
+
ReactNode
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
| \- | \- |
|
|
49
|
+
| defaultSelected |
|
|
50
|
+
|
|
51
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
52
|
+
|
|
53
|
+
FormControlValue
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
| \- | Set object |
|
|
58
|
+
| layout |
|
|
59
|
+
|
|
60
|
+
Layout options for the positioning of tabs.
|
|
61
|
+
|
|
62
|
+
union
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
|
67
|
+
|
|
68
|
+
'top-left'
|
|
69
|
+
|
|
70
|
+
| Set object |
|
|
71
|
+
| onChange |
|
|
72
|
+
|
|
73
|
+
Emitted when a tab changes.
|
|
74
|
+
|
|
75
|
+
(event: TabSetChangedEventDetail) => void
|
|
76
|
+
|
|
77
|
+
| \- | \- |
|
|
78
|
+
| selected |
|
|
79
|
+
|
|
80
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
81
|
+
|
|
82
|
+
FormControlValue
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
| \- | Set object |
|
|
87
|
+
|
|
88
|
+
Usage
|
|
89
|
+
-----
|
|
90
|
+
|
|
91
|
+
The `IressTabSet` is a wrapper for `IressTab` components to make a up a set of tabs.
|
|
92
|
+
|
|
93
|
+
**Note:** The `mapTabs` helper function, originally used to map tabs to its sub-components, is now deprecated. Instead, you can use `array.map` to map the tabs to `IressTab`.
|
|
94
|
+
|
|
95
|
+
### Navigation
|
|
96
|
+
|
|
97
|
+
You can use the `IressTabSet` component to create tab navigation to control an area of the page, or even navigate between different pages.
|
|
98
|
+
|
|
99
|
+
[](./iframe.html?id=components-tabset--tab-navigation)
|
|
100
|
+
|
|
101
|
+
Address
|
|
102
|
+
|
|
103
|
+
Employment
|
|
104
|
+
|
|
105
|
+
History
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
<IressTabSet\>
|
|
110
|
+
<IressTab label\="Address" />
|
|
111
|
+
<IressTab label\="Employment" />
|
|
112
|
+
<IressTab label\="History" />
|
|
113
|
+
</IressTabSet\>
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### Props
|
|
118
|
+
|
|
119
|
+
| Name | Description | Default | Control |
|
|
120
|
+
| --- | --- | --- | --- |
|
|
121
|
+
| children |
|
|
122
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
123
|
+
|
|
124
|
+
ReactNode
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
| \- | \- |
|
|
129
|
+
| defaultSelected |
|
|
130
|
+
|
|
131
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
132
|
+
|
|
133
|
+
FormControlValue
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
| \- | Set object |
|
|
138
|
+
| layout |
|
|
139
|
+
|
|
140
|
+
Layout options for the positioning of tabs.
|
|
141
|
+
|
|
142
|
+
union
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
|
147
|
+
|
|
148
|
+
'top-left'
|
|
149
|
+
|
|
150
|
+
| Set object |
|
|
151
|
+
| onChange |
|
|
152
|
+
|
|
153
|
+
Emitted when a tab changes.
|
|
154
|
+
|
|
155
|
+
(event: TabSetChangedEventDetail) => void
|
|
156
|
+
|
|
157
|
+
| \- | \- |
|
|
158
|
+
| selected |
|
|
159
|
+
|
|
160
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
161
|
+
|
|
162
|
+
FormControlValue
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
| \- | Set object |
|
|
167
|
+
|
|
168
|
+
### With `children` prop
|
|
169
|
+
|
|
170
|
+
Using the `children` prop will automatically inject the content as a tab panel when active, along with appropriate attributes for accessibility, ensuring the tab and its associated panel can be navigated by screenreaders.
|
|
171
|
+
|
|
172
|
+
[](./iframe.html?id=components-tabset--panels)
|
|
173
|
+
|
|
174
|
+
Address
|
|
175
|
+
|
|
176
|
+
Employment
|
|
177
|
+
|
|
178
|
+
History
|
|
179
|
+
|
|
180
|
+
Address information goes here
|
|
181
|
+
|
|
182
|
+
Employment information goes here
|
|
183
|
+
|
|
184
|
+
Medical history goes here
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
<IressTabSet\>
|
|
189
|
+
<IressTab label\="Address"\>
|
|
190
|
+
Address information goes here </IressTab\>
|
|
191
|
+
<IressTab label\="Employment"\>
|
|
192
|
+
Employment information goes here </IressTab\>
|
|
193
|
+
<IressTab label\="History"\>
|
|
194
|
+
Medical history goes here </IressTab\>
|
|
195
|
+
</IressTabSet\>
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
#### Props
|
|
200
|
+
|
|
201
|
+
| Name | Description | Default | Control |
|
|
202
|
+
| --- | --- | --- | --- |
|
|
203
|
+
| children |
|
|
204
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
205
|
+
|
|
206
|
+
ReactNode
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
| \- | \- |
|
|
211
|
+
| defaultSelected |
|
|
212
|
+
|
|
213
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
214
|
+
|
|
215
|
+
FormControlValue
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
| \- | Set object |
|
|
220
|
+
| layout |
|
|
221
|
+
|
|
222
|
+
Layout options for the positioning of tabs.
|
|
223
|
+
|
|
224
|
+
union
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
|
229
|
+
|
|
230
|
+
'top-left'
|
|
231
|
+
|
|
232
|
+
| Set object |
|
|
233
|
+
| onChange |
|
|
234
|
+
|
|
235
|
+
Emitted when a tab changes.
|
|
236
|
+
|
|
237
|
+
(event: TabSetChangedEventDetail) => void
|
|
238
|
+
|
|
239
|
+
| \- | \- |
|
|
240
|
+
| selected |
|
|
241
|
+
|
|
242
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
243
|
+
|
|
244
|
+
FormControlValue
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
| \- | Set object |
|
|
249
|
+
|
|
250
|
+
Examples
|
|
251
|
+
--------
|
|
252
|
+
|
|
253
|
+
### Default selected
|
|
254
|
+
|
|
255
|
+
If you would like to set a tab by default, use the `defaultSelected` prop.
|
|
256
|
+
|
|
257
|
+
[](./iframe.html?id=components-tabset--default-selected)
|
|
258
|
+
|
|
259
|
+
Address
|
|
260
|
+
|
|
261
|
+
Employment
|
|
262
|
+
|
|
263
|
+
History
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
<IressTabSet defaultSelected\={2}\>
|
|
268
|
+
<IressTab label\="Address" />
|
|
269
|
+
<IressTab label\="Employment" />
|
|
270
|
+
<IressTab label\="History" />
|
|
271
|
+
</IressTabSet\>
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
#### Props
|
|
276
|
+
|
|
277
|
+
| Name | Description | Default | Control |
|
|
278
|
+
| --- | --- | --- | --- |
|
|
279
|
+
| children |
|
|
280
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
281
|
+
|
|
282
|
+
ReactNode
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
| \- | \- |
|
|
287
|
+
| defaultSelected |
|
|
288
|
+
|
|
289
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
290
|
+
|
|
291
|
+
FormControlValue
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
| \- |
|
|
296
|
+
|
|
297
|
+
2
|
|
298
|
+
|
|
299
|
+
|
|
|
300
|
+
| layout |
|
|
301
|
+
|
|
302
|
+
Layout options for the positioning of tabs.
|
|
303
|
+
|
|
304
|
+
union
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
|
309
|
+
|
|
310
|
+
'top-left'
|
|
311
|
+
|
|
312
|
+
| Set object |
|
|
313
|
+
| onChange |
|
|
314
|
+
|
|
315
|
+
Emitted when a tab changes.
|
|
316
|
+
|
|
317
|
+
(event: TabSetChangedEventDetail) => void
|
|
318
|
+
|
|
319
|
+
| \- | \- |
|
|
320
|
+
| selected |
|
|
321
|
+
|
|
322
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
323
|
+
|
|
324
|
+
FormControlValue
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
| \- | Set object |
|
|
329
|
+
|
|
330
|
+
### Controlled
|
|
331
|
+
|
|
332
|
+
You can use state to control the active tab by setting the `selected` property to which tab you would like to select. This should be the `value` of the tab you would like to select, or if you do not use the `value` prop, it's index.
|
|
333
|
+
|
|
334
|
+
[](./iframe.html?id=components-tabset--controlled)
|
|
335
|
+
|
|
336
|
+
Change to last tab
|
|
337
|
+
|
|
338
|
+
Address
|
|
339
|
+
|
|
340
|
+
Employment
|
|
341
|
+
|
|
342
|
+
History
|
|
343
|
+
|
|
344
|
+
Address information goes here
|
|
345
|
+
|
|
346
|
+
Employment information goes here
|
|
347
|
+
|
|
348
|
+
Medical history goes here
|
|
349
|
+
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
import {
|
|
353
|
+
IressButton,
|
|
354
|
+
IressStack,
|
|
355
|
+
IressTab,
|
|
356
|
+
IressTabSet,
|
|
357
|
+
type IressTabSetProps,
|
|
358
|
+
} from '@iress-oss/ids-components';
|
|
359
|
+
import { useState } from 'react';
|
|
360
|
+
export const TabsUsingState \= () \=> {
|
|
361
|
+
const \[selected, setSelected\] \= useState<number\>();
|
|
362
|
+
return (
|
|
363
|
+
<IressStack gutter\={IressStack.Gutter.Md}\>
|
|
364
|
+
<IressButton onClick\={() \=> setSelected(selected \=== 2 ? 0 : 2)}\>
|
|
365
|
+
{selected \=== 2 ? \`Back to first tab\` : \`Change to last tab\`}
|
|
366
|
+
</IressButton\>
|
|
367
|
+
<IressTabSet
|
|
368
|
+
|
|
369
|
+
selected\={selected}
|
|
370
|
+
onChange\={({ index }) \=> setSelected(index)}
|
|
371
|
+
\>
|
|
372
|
+
<IressTab label\="Address"\>Address information goes here</IressTab\>
|
|
373
|
+
<IressTab label\="Employment"\>Employment information goes here</IressTab\>
|
|
374
|
+
<IressTab label\="History"\>Medical history goes here</IressTab\>
|
|
375
|
+
</IressTabSet\>
|
|
376
|
+
</IressStack\>
|
|
377
|
+
);
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
#### Props
|
|
383
|
+
|
|
384
|
+
| Name | Description | Default | Control |
|
|
385
|
+
| --- | --- | --- | --- |
|
|
386
|
+
| children |
|
|
387
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
388
|
+
|
|
389
|
+
ReactNode
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
| \- | \- |
|
|
394
|
+
| defaultSelected |
|
|
395
|
+
|
|
396
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
397
|
+
|
|
398
|
+
FormControlValue
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
| \- | Set object |
|
|
403
|
+
| layout |
|
|
404
|
+
|
|
405
|
+
Layout options for the positioning of tabs.
|
|
406
|
+
|
|
407
|
+
union
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
|
412
|
+
|
|
413
|
+
'top-left'
|
|
414
|
+
|
|
415
|
+
| Set object |
|
|
416
|
+
| onChange |
|
|
417
|
+
|
|
418
|
+
Emitted when a tab changes.
|
|
419
|
+
|
|
420
|
+
(event: TabSetChangedEventDetail) => void
|
|
421
|
+
|
|
422
|
+
| \- | \- |
|
|
423
|
+
| selected |
|
|
424
|
+
|
|
425
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
426
|
+
|
|
427
|
+
FormControlValue
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
| \- | \- |
|
|
432
|
+
|
|
433
|
+
### Layout
|
|
434
|
+
|
|
435
|
+
`IressTabSet` controls the layout of the tab buttons. These will always appear at the top of the tab container, and can be aligned to the left (default), centrally or to the right via the `layout` prop.
|
|
436
|
+
|
|
437
|
+
[](./iframe.html?id=components-tabset--layout)
|
|
438
|
+
|
|
439
|
+
top-left
|
|
440
|
+
--------
|
|
441
|
+
|
|
442
|
+
Address
|
|
443
|
+
|
|
444
|
+
Employment
|
|
445
|
+
|
|
446
|
+
History
|
|
447
|
+
|
|
448
|
+
Address information goes here
|
|
449
|
+
|
|
450
|
+
Employment information goes here
|
|
451
|
+
|
|
452
|
+
Medical history goes here
|
|
453
|
+
|
|
454
|
+
top-center
|
|
455
|
+
----------
|
|
456
|
+
|
|
457
|
+
Address
|
|
458
|
+
|
|
459
|
+
Employment
|
|
460
|
+
|
|
461
|
+
History
|
|
462
|
+
|
|
463
|
+
Address information goes here
|
|
464
|
+
|
|
465
|
+
Employment information goes here
|
|
466
|
+
|
|
467
|
+
Medical history goes here
|
|
468
|
+
|
|
469
|
+
top-right
|
|
470
|
+
---------
|
|
471
|
+
|
|
472
|
+
Address
|
|
473
|
+
|
|
474
|
+
Employment
|
|
475
|
+
|
|
476
|
+
History
|
|
477
|
+
|
|
478
|
+
Address information goes here
|
|
479
|
+
|
|
480
|
+
Employment information goes here
|
|
481
|
+
|
|
482
|
+
Medical history goes here
|
|
483
|
+
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
<IressStack gutter\="md"\>
|
|
487
|
+
<IressPanel\>
|
|
488
|
+
<IressText element\="h2"\>
|
|
489
|
+
top-left </IressText\>
|
|
490
|
+
<IressTabSet layout\="top-left"\>
|
|
491
|
+
<IressTab label\="Address"\>
|
|
492
|
+
Address information goes here </IressTab\>
|
|
493
|
+
<IressTab label\="Employment"\>
|
|
494
|
+
Employment information goes here </IressTab\>
|
|
495
|
+
<IressTab label\="History"\>
|
|
496
|
+
Medical history goes here </IressTab\>
|
|
497
|
+
</IressTabSet\>
|
|
498
|
+
</IressPanel\>
|
|
499
|
+
<IressPanel\>
|
|
500
|
+
<IressText element\="h2"\>
|
|
501
|
+
top-center </IressText\>
|
|
502
|
+
<IressTabSet layout\="top-center"\>
|
|
503
|
+
<IressTab label\="Address"\>
|
|
504
|
+
Address information goes here </IressTab\>
|
|
505
|
+
<IressTab label\="Employment"\>
|
|
506
|
+
Employment information goes here </IressTab\>
|
|
507
|
+
<IressTab label\="History"\>
|
|
508
|
+
Medical history goes here </IressTab\>
|
|
509
|
+
</IressTabSet\>
|
|
510
|
+
</IressPanel\>
|
|
511
|
+
<IressPanel\>
|
|
512
|
+
<IressText element\="h2"\>
|
|
513
|
+
top-right </IressText\>
|
|
514
|
+
<IressTabSet layout\="top-right"\>
|
|
515
|
+
<IressTab label\="Address"\>
|
|
516
|
+
Address information goes here </IressTab\>
|
|
517
|
+
<IressTab label\="Employment"\>
|
|
518
|
+
Employment information goes here </IressTab\>
|
|
519
|
+
<IressTab label\="History"\>
|
|
520
|
+
Medical history goes here </IressTab\>
|
|
521
|
+
</IressTabSet\>
|
|
522
|
+
</IressPanel\>
|
|
523
|
+
</IressStack\>
|
|
524
|
+
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
#### Props
|
|
528
|
+
|
|
529
|
+
| Name | Description | Default | Control |
|
|
530
|
+
| --- | --- | --- | --- |
|
|
531
|
+
| children |
|
|
532
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
533
|
+
|
|
534
|
+
ReactNode
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
| \- | \- |
|
|
539
|
+
| defaultSelected |
|
|
540
|
+
|
|
541
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
542
|
+
|
|
543
|
+
FormControlValue
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
| \- | Set object |
|
|
548
|
+
| layout |
|
|
549
|
+
|
|
550
|
+
Layout options for the positioning of tabs.
|
|
551
|
+
|
|
552
|
+
union
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
|
|
|
557
|
+
|
|
558
|
+
'top-left'
|
|
559
|
+
|
|
560
|
+
| \- |
|
|
561
|
+
| onChange |
|
|
562
|
+
|
|
563
|
+
Emitted when a tab changes.
|
|
564
|
+
|
|
565
|
+
(event: TabSetChangedEventDetail) => void
|
|
566
|
+
|
|
567
|
+
| \- | \- |
|
|
568
|
+
| selected |
|
|
569
|
+
|
|
570
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
571
|
+
|
|
572
|
+
FormControlValue
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
| \- | Set object |
|
|
577
|
+
|
|
578
|
+
### Lazy Loading
|
|
579
|
+
|
|
580
|
+
As of version 5, tabs can be lazy loaded. However, to ensure they work correctly you will need to set the `value` prop on each `IressTab`, as shown in this example.
|
|
581
|
+
|
|
582
|
+
[](./iframe.html?id=components-tabset--lazy-loading)
|
|
583
|
+
|
|
584
|
+
Toggle tabs
|
|
585
|
+
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
import {
|
|
589
|
+
IressButton,
|
|
590
|
+
IressStack,
|
|
591
|
+
IressTab,
|
|
592
|
+
IressTabSet,
|
|
593
|
+
type IressTabSetProps,
|
|
594
|
+
} from '@iress-oss/ids-components';
|
|
595
|
+
import { useState } from 'react';
|
|
596
|
+
export const TabsLazyLoading \= () \=> {
|
|
597
|
+
const \[loadTabs, setLoadTabs\] \= useState<boolean\>();
|
|
598
|
+
return (
|
|
599
|
+
<IressStack gutter\="md"\>
|
|
600
|
+
<IressButton onClick\={() \=> setLoadTabs(!loadTabs)}\>
|
|
601
|
+
Toggle tabs </IressButton\>
|
|
602
|
+
<IressTabSet {...{
|
|
603
|
+
defaultSelected: 'medical',
|
|
604
|
+
}}\>
|
|
605
|
+
{loadTabs && (
|
|
606
|
+
<\>
|
|
607
|
+
<IressTab label\="Address" value\="address"\>
|
|
608
|
+
Address information goes here </IressTab\>
|
|
609
|
+
<IressTab label\="Employment" value\="employment"\>
|
|
610
|
+
Employment information goes here </IressTab\>
|
|
611
|
+
<IressTab label\="Medical history" value\="medical"\>
|
|
612
|
+
Medical history goes here </IressTab\>
|
|
613
|
+
</\>
|
|
614
|
+
)}
|
|
615
|
+
</IressTabSet\>
|
|
616
|
+
</IressStack\>
|
|
617
|
+
);
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
#### Props
|
|
623
|
+
|
|
624
|
+
| Name | Description | Default | Control |
|
|
625
|
+
| --- | --- | --- | --- |
|
|
626
|
+
| children |
|
|
627
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
628
|
+
|
|
629
|
+
ReactNode
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
| \- | \- |
|
|
634
|
+
| defaultSelected |
|
|
635
|
+
|
|
636
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
637
|
+
|
|
638
|
+
FormControlValue
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
| \- |
|
|
643
|
+
|
|
644
|
+
"medical"
|
|
645
|
+
|
|
646
|
+
|
|
|
647
|
+
| layout |
|
|
648
|
+
|
|
649
|
+
Layout options for the positioning of tabs.
|
|
650
|
+
|
|
651
|
+
union
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
|
656
|
+
|
|
657
|
+
'top-left'
|
|
658
|
+
|
|
659
|
+
| Set object |
|
|
660
|
+
| onChange |
|
|
661
|
+
|
|
662
|
+
Emitted when a tab changes.
|
|
663
|
+
|
|
664
|
+
(event: TabSetChangedEventDetail) => void
|
|
665
|
+
|
|
666
|
+
| \- | \- |
|
|
667
|
+
| selected |
|
|
668
|
+
|
|
669
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
670
|
+
|
|
671
|
+
FormControlValue
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
| \- | Set object |
|
|
676
|
+
|
|
677
|
+
### Badges and icons
|
|
678
|
+
|
|
679
|
+
You can add rich content into the `label` of the `IressTab` to customise the tab further.
|
|
680
|
+
|
|
681
|
+
Some common examples include:
|
|
682
|
+
|
|
683
|
+
* Adding a badge to the tab button.
|
|
684
|
+
* Adding icons to the tab button.
|
|
685
|
+
|
|
686
|
+
Notes:
|
|
687
|
+
|
|
688
|
+
* For best accessibility, the `IressTab` component will find the first focusable element inside the custom label to add the tab role.
|
|
689
|
+
|
|
690
|
+
[](./iframe.html?id=components-tabset--tabs-with-badges)
|
|
691
|
+
|
|
692
|
+
Address
|
|
693
|
+
|
|
694
|
+
3
|
|
695
|
+
|
|
696
|
+
Employment
|
|
697
|
+
|
|
698
|
+
History
|
|
699
|
+
|
|
700
|
+
Address information goes here
|
|
701
|
+
|
|
702
|
+
Employment information goes here
|
|
703
|
+
|
|
704
|
+
Medical history goes here
|
|
705
|
+
|
|
706
|
+
```
|
|
707
|
+
|
|
708
|
+
<IressTabSet\>
|
|
709
|
+
<IressBadge
|
|
710
|
+
host\={<IressTab label\="Address"\>Address information goes here</IressTab\>}
|
|
711
|
+
mode\="info"
|
|
712
|
+
pill
|
|
713
|
+
\>
|
|
714
|
+
3 </IressBadge\>
|
|
715
|
+
<IressTab label\={<IressInline gutter\="sm"\><IressIcon name\="user" />{' '}Employment</IressInline\>}\>
|
|
716
|
+
Employment information goes here </IressTab\>
|
|
717
|
+
<IressTab label\="History"\>
|
|
718
|
+
Medical history goes here </IressTab\>
|
|
719
|
+
</IressTabSet\>
|
|
720
|
+
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
#### Props
|
|
724
|
+
|
|
725
|
+
| Name | Description | Default | Control |
|
|
726
|
+
| --- | --- | --- | --- |
|
|
727
|
+
| children |
|
|
728
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
729
|
+
|
|
730
|
+
ReactNode
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
| \- | \- |
|
|
735
|
+
| defaultSelected |
|
|
736
|
+
|
|
737
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
738
|
+
|
|
739
|
+
FormControlValue
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
| \- | Set object |
|
|
744
|
+
| layout |
|
|
745
|
+
|
|
746
|
+
Layout options for the positioning of tabs.
|
|
747
|
+
|
|
748
|
+
union
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
|
|
|
753
|
+
|
|
754
|
+
'top-left'
|
|
755
|
+
|
|
756
|
+
| Set object |
|
|
757
|
+
| onChange |
|
|
758
|
+
|
|
759
|
+
Emitted when a tab changes.
|
|
760
|
+
|
|
761
|
+
(event: TabSetChangedEventDetail) => void
|
|
762
|
+
|
|
763
|
+
| \- | \- |
|
|
764
|
+
| selected |
|
|
765
|
+
|
|
766
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
767
|
+
|
|
768
|
+
FormControlValue
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
| \- | Set object |
|