@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.
Files changed (132) hide show
  1. package/generated/docs/components_components-alert-docs.md +492 -0
  2. package/generated/docs/components_components-autocomplete-docs.md +3485 -0
  3. package/generated/docs/{components-autocomplete-recipes-docs.md → components_components-autocomplete-recipes-docs.md} +32 -14
  4. package/generated/docs/{components-badge-docs.md → components_components-badge-docs.md} +222 -30
  5. package/generated/docs/components_components-button-docs.md +2078 -0
  6. package/generated/docs/components_components-button-recipes-docs.md +37 -0
  7. package/generated/docs/components_components-buttongroup-docs.md +1045 -0
  8. package/generated/docs/components_components-card-docs.md +2276 -0
  9. package/generated/docs/{components-card-recipes-docs.md → components_components-card-recipes-docs.md} +131 -14
  10. package/generated/docs/components_components-checkbox-docs.md +1054 -0
  11. package/generated/docs/{components-checkboxgroup-docs.md → components_components-checkboxgroup-docs.md} +1000 -81
  12. package/generated/docs/{components-checkboxgroup-recipes-docs.md → components_components-checkboxgroup-recipes-docs.md} +101 -11
  13. package/generated/docs/{components-col-docs.md → components_components-col-docs.md} +331 -58
  14. package/generated/docs/components_components-combobox-docs.md +3767 -0
  15. package/generated/docs/{components-container-docs.md → components_components-container-docs.md} +61 -24
  16. package/generated/docs/{components-divider-docs.md → components_components-divider-docs.md} +83 -24
  17. package/generated/docs/{components-expander-docs.md → components_components-expander-docs.md} +264 -33
  18. package/generated/docs/{components-field-docs.md → components_components-field-docs.md} +814 -120
  19. package/generated/docs/components_components-filter-docs.md +4080 -0
  20. package/generated/docs/{components-form-docs.md → components_components-form-docs.md} +1515 -353
  21. package/generated/docs/{components-form-recipes-docs.md → components_components-form-recipes-docs.md} +170 -54
  22. package/generated/docs/components_components-hide-docs.md +293 -0
  23. package/generated/docs/components_components-icon-docs.md +1337 -0
  24. package/generated/docs/{components-inline-docs.md → components_components-inline-docs.md} +462 -42
  25. package/generated/docs/components_components-input-docs.md +1468 -0
  26. package/generated/docs/components_components-input-recipes-docs.md +367 -0
  27. package/generated/docs/components_components-inputcurrency-docs.md +432 -0
  28. package/generated/docs/{components-inputcurrency-recipes-docs.md → components_components-inputcurrency-recipes-docs.md} +110 -17
  29. package/generated/docs/components_components-label-docs.md +323 -0
  30. package/generated/docs/components_components-menu-docs.md +2345 -0
  31. package/generated/docs/components_components-menu-menuitem-docs.md +633 -0
  32. package/generated/docs/{components-modal-docs.md → components_components-modal-docs.md} +1625 -232
  33. package/generated/docs/components_components-navbar-docs.md +1847 -0
  34. package/generated/docs/{components-navbar-recipes-docs.md → components_components-navbar-recipes-docs.md} +697 -39
  35. package/generated/docs/{components-panel-docs.md → components_components-panel-docs.md} +754 -57
  36. package/generated/docs/components_components-placeholder-docs.md +92 -0
  37. package/generated/docs/components_components-popover-docs.md +1641 -0
  38. package/generated/docs/{components-popover-recipes-docs.md → components_components-popover-recipes-docs.md} +347 -17
  39. package/generated/docs/components_components-progress-docs.md +115 -0
  40. package/generated/docs/{components-provider-docs.md → components_components-provider-docs.md} +41 -32
  41. package/generated/docs/components_components-radio-docs.md +491 -0
  42. package/generated/docs/{components-radiogroup-docs.md → components_components-radiogroup-docs.md} +943 -75
  43. package/generated/docs/components_components-readonly-docs.md +263 -0
  44. package/generated/docs/components_components-richselect-docs.md +6497 -0
  45. package/generated/docs/{components-row-docs.md → components_components-row-docs.md} +353 -43
  46. package/generated/docs/{components-select-docs.md → components_components-select-docs.md} +719 -61
  47. package/generated/docs/components_components-skeleton-docs.md +480 -0
  48. package/generated/docs/{components-skeleton-recipes-docs.md → components_components-skeleton-recipes-docs.md} +50 -10
  49. package/generated/docs/{components-skiplink-docs.md → components_components-skiplink-docs.md} +53 -14
  50. package/generated/docs/components_components-slideout-docs.md +2262 -0
  51. package/generated/docs/components_components-slider-docs.md +1276 -0
  52. package/generated/docs/components_components-spinner-docs.md +82 -0
  53. package/generated/docs/{components-stack-docs.md → components_components-stack-docs.md} +223 -40
  54. package/generated/docs/components_components-table-docs.md +3651 -0
  55. package/generated/docs/components_components-tabset-docs.md +772 -0
  56. package/generated/docs/components_components-tabset-tab-docs.md +262 -0
  57. package/generated/docs/components_components-tag-docs.md +259 -0
  58. package/generated/docs/{components-text-docs.md → components_components-text-docs.md} +491 -51
  59. package/generated/docs/{components-toaster-docs.md → components_components-toaster-docs.md} +181 -79
  60. package/generated/docs/components_components-toaster-toast-docs.md +634 -0
  61. package/generated/docs/components_components-toggle-docs.md +461 -0
  62. package/generated/docs/{components-tooltip-docs.md → components_components-tooltip-docs.md} +286 -41
  63. package/generated/docs/{components-validationmessage-docs.md → components_components-validationmessage-docs.md} +230 -61
  64. package/generated/docs/components_contact-us-docs.md +12 -0
  65. package/generated/docs/{foundations-accessibility-docs.md → components_foundations-accessibility-docs.md} +11 -21
  66. package/generated/docs/{foundations-colours-docs.md → components_foundations-colour-030-colours.md} +8 -15
  67. package/generated/docs/{foundations-consistency-docs.md → components_foundations-consistency-docs.md} +12 -20
  68. package/generated/docs/{foundations-content-docs.md → components_foundations-content-docs.md} +6 -11
  69. package/generated/docs/components_foundations-introduction-docs.md +15 -0
  70. package/generated/docs/{foundations-principles-docs.md → components_foundations-principles-docs.md} +14 -24
  71. package/generated/docs/components_foundations-typography-docs.md +608 -0
  72. package/generated/docs/{foundations-user-experience-docs.md → components_foundations-user-experience-docs.md} +16 -26
  73. package/generated/docs/{foundations-visual-design-docs.md → components_foundations-visual-design-docs.md} +10 -17
  74. package/generated/docs/{frequently-asked-questions-docs.md → components_frequently-asked-questions-docs.md} +14 -23
  75. package/generated/docs/components_get-started-develop-docs.md +84 -0
  76. package/generated/docs/components_get-started-using-storybook-docs.md +55 -0
  77. package/generated/docs/components_introduction-docs.md +15 -0
  78. package/generated/docs/{patterns-loading-docs.md → components_patterns-loading-docs.md} +711 -143
  79. package/generated/docs/components_resources-changelog-docs.md +4 -0
  80. package/generated/docs/{resources-code-katas-docs.md → components_resources-code-katas-docs.md} +5 -9
  81. package/generated/docs/{resources-migration-guides-from-v4-to-v5-docs.md → components_resources-migration-guides-from-v4-to-v5-docs.md} +54 -239
  82. package/generated/docs/{versions-docs.md → components_versions-docs.md} +5 -8
  83. package/generated/docs/guidelines.md +484 -200
  84. package/generated/docs/introduction-docs.md +19 -30
  85. package/package.json +41 -45
  86. package/generated/docs/components-alert-docs.md +0 -130
  87. package/generated/docs/components-autocomplete-docs.md +0 -754
  88. package/generated/docs/components-button-docs.md +0 -362
  89. package/generated/docs/components-button-recipes-docs.md +0 -76
  90. package/generated/docs/components-buttongroup-docs.md +0 -310
  91. package/generated/docs/components-card-docs.md +0 -494
  92. package/generated/docs/components-checkbox-docs.md +0 -193
  93. package/generated/docs/components-combobox-docs.md +0 -1016
  94. package/generated/docs/components-filter-docs.md +0 -1109
  95. package/generated/docs/components-hide-docs.md +0 -265
  96. package/generated/docs/components-icon-docs.md +0 -553
  97. package/generated/docs/components-input-docs.md +0 -335
  98. package/generated/docs/components-input-recipes-docs.md +0 -140
  99. package/generated/docs/components-inputcurrency-docs.md +0 -157
  100. package/generated/docs/components-label-docs.md +0 -135
  101. package/generated/docs/components-menu-docs.md +0 -704
  102. package/generated/docs/components-menu-menuitem-docs.md +0 -193
  103. package/generated/docs/components-navbar-docs.md +0 -291
  104. package/generated/docs/components-placeholder-docs.md +0 -27
  105. package/generated/docs/components-popover-docs.md +0 -464
  106. package/generated/docs/components-progress-docs.md +0 -104
  107. package/generated/docs/components-radio-docs.md +0 -107
  108. package/generated/docs/components-readonly-docs.md +0 -89
  109. package/generated/docs/components-richselect-docs.md +0 -2433
  110. package/generated/docs/components-skeleton-docs.md +0 -214
  111. package/generated/docs/components-slideout-docs.md +0 -538
  112. package/generated/docs/components-slider-docs.md +0 -346
  113. package/generated/docs/components-spinner-docs.md +0 -59
  114. package/generated/docs/components-table-ag-grid-docs.md +0 -1074
  115. package/generated/docs/components-table-docs.md +0 -1305
  116. package/generated/docs/components-tabset-docs.md +0 -341
  117. package/generated/docs/components-tabset-tab-docs.md +0 -86
  118. package/generated/docs/components-tag-docs.md +0 -115
  119. package/generated/docs/components-toaster-toast-docs.md +0 -157
  120. package/generated/docs/components-toggle-docs.md +0 -158
  121. package/generated/docs/contact-us-docs.md +0 -27
  122. package/generated/docs/extensions-editor-docs.md +0 -288
  123. package/generated/docs/extensions-editor-recipes-docs.md +0 -39
  124. package/generated/docs/foundations-introduction-docs.md +0 -17
  125. package/generated/docs/foundations-typography-docs.md +0 -191
  126. package/generated/docs/get-started-develop-docs.md +0 -209
  127. package/generated/docs/get-started-using-storybook-docs.md +0 -68
  128. package/generated/docs/resources-changelog-docs.md +0 -6
  129. package/generated/docs/themes-available-themes-docs.md +0 -66
  130. package/generated/docs/themes-introduction-docs.md +0 -121
  131. package/generated/docs/themes-tokens-docs.md +0 -1200
  132. /package/{LICENSE.txt → LICENSE} +0 -0
@@ -1,2433 +0,0 @@
1
- [](#rich-select)Rich select
2
- ===========================
3
-
4
- Overview
5
- --------
6
-
7
- Rich selects provide select and multi-select functionality with the benefit of live filtering.
8
-
9
- * * *
10
-
11
- Beta
12
-
13
- Replaces IressCombobox and IressMultiCombobox
14
-
15
- This component is in beta and will replace IressCombobox and IressMultiCombobox in the next major version.
16
-
17
- Hide code
18
-
19
- \[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; }
20
-
21
- <IressRichSelect
22
- container\={document.body}
23
- options\={\[
24
- {
25
- label: 'Option 1',
26
- meta: \[
27
- 'Some',
28
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
29
- \],
30
- value: '1'
31
- },
32
- {
33
- label: 'Option 2',
34
- meta: \[
35
- 'Some',
36
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
37
- \],
38
- value: '2'
39
- },
40
- {
41
- label: 'Option 3',
42
- meta: \[
43
- 'Some',
44
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
45
- \],
46
- value: '3'
47
- },
48
- {
49
- label: 'Option 4',
50
- meta: \[
51
- 'Some',
52
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
53
- \],
54
- value: '4'
55
- },
56
- {
57
- label: 'Option 5',
58
- meta: \[
59
- 'Some',
60
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
61
- \],
62
- value: '5'
63
- }
64
- \]}
65
- placeholder\=""
66
- />
67
-
68
- Copy
69
-
70
- [](#usage)Usage
71
- ---------------
72
-
73
- `IressRichSelect` is an alternative to `IressSelect` when you have a large number of options and want to provide a search functionality to help the user find the option they are looking for.
74
-
75
- ### [](#when-to-use)When To Use
76
-
77
- * If you have less than 5 options to choose from, consider using `IressRadioGroup` instead.
78
- * If your application is expected to be used on mobile devices, consider using `IressSelect` instead to make use of the native select functionality.
79
- * You probably need `IressAutoComplete` if you're looking for an input box that can be typed.
80
- * Otherwise, `IressRichSelect` is the way to go.
81
-
82
- [](#accessibility)Accessibility
83
- -------------------------------
84
-
85
- This component follows the [WAI combobox pattern](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/).
86
-
87
- There are two key differences:
88
-
89
- * For better usability, virtual focus is used to highlight the suggestions inside the popover. This means focus remains on the input, but the suggestions are highlighted as if they are in focus, allowing the user to type and navigate the suggestions with the arrow keys. To denote the highlighted suggestion to screen readers, the aria-activedescendant attribute is used.
90
- * Instead of displaying the input to filter options directly, the input is only shown once the user has activated the dropdown. This allows for an intuitive user experience by separating the display of the current value, and the filtering of options.
91
-
92
- [](#examples)Examples
93
- ---------------------
94
-
95
- ### [](#single-select)Single select
96
-
97
- The `options` prop is required for `IressRichSelect`. You can provide an array of `LabelValueMeta[]` objects to the `options` prop.
98
-
99
- Hide code
100
-
101
- \[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; }
102
-
103
- <IressRichSelect
104
- container\={document.body}
105
- options\={\[
106
- {
107
- label: 'Option 1',
108
- meta: \[
109
- 'Some',
110
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
111
- \],
112
- value: '1'
113
- },
114
- {
115
- label: 'Option 2',
116
- meta: \[
117
- 'Some',
118
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
119
- \],
120
- value: '2'
121
- },
122
- {
123
- label: 'Option 3',
124
- meta: \[
125
- 'Some',
126
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
127
- \],
128
- value: '3'
129
- },
130
- {
131
- label: 'Option 4',
132
- meta: \[
133
- 'Some',
134
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
135
- \],
136
- value: '4'
137
- },
138
- {
139
- label: 'Option 5',
140
- meta: \[
141
- 'Some',
142
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
143
- \],
144
- value: '5'
145
- }
146
- \]}
147
- placeholder\=""
148
- />
149
-
150
- Copy
151
-
152
- ### [](#multi-select)Multi-select
153
-
154
- Adding the `multiSelect` prop will allow the user to select multiple options.
155
-
156
- Selected: None
157
-
158
- Hide code
159
-
160
- \[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; }
161
-
162
- <IressRichSelect
163
- container\={document.body}
164
- multiSelect
165
- options\={\[
166
- {
167
- label: 'Option 1',
168
- meta: \[
169
- 'Some',
170
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
171
- \],
172
- value: '1'
173
- },
174
- {
175
- label: 'Option 2',
176
- meta: \[
177
- 'Some',
178
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
179
- \],
180
- value: '2'
181
- },
182
- {
183
- label: 'Option 3',
184
- meta: \[
185
- 'Some',
186
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
187
- \],
188
- value: '3'
189
- },
190
- {
191
- label: 'Option 4',
192
- meta: \[
193
- 'Some',
194
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
195
- \],
196
- value: '4'
197
- },
198
- {
199
- label: 'Option 5',
200
- meta: \[
201
- 'Some',
202
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
203
- \],
204
- value: '5'
205
- }
206
- \]}
207
- placeholder\=""
208
- />
209
-
210
- Copy
211
-
212
- ### [](#asynchronous-options)Asynchronous options
213
-
214
- If you would like to render suggestions from the server, you can pass a function to the `options` prop. It accepts a string parameter and returns a promise that resolves to an array of `LabelValueMeta[]` objects.
215
-
216
- The user experience slightly changes as well. Instead of displaying the options immediately, the user will see a search input that will filter the options as they type.
217
-
218
- No filtering is done for asynchronous options, you must filter the options yourself using the query. However, the results are automatically highlighted based on the query when rendered in the UI.
219
-
220
- Single select
221
-
222
- Multi-select
223
-
224
- Selected: None
225
-
226
- Hide code
227
-
228
- \[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; }
229
-
230
- interface StarWarsCharacter {
231
- name: string;
232
- gender: string;
233
- }
234
- interface StarWarsCharacterApi {
235
- results: StarWarsCharacter\[\];
236
- }
237
- const options \= async (query: string) \=> {
238
- if (!query) return \[\];
239
- if (query \=== 'error') {
240
- throw new Error();
241
- }
242
- const data \= await fetch(
243
- \`https://swapi.py4e.com/api/people/?search=${query}\`,
244
- ).then((response) \=> response.json() as Promise<StarWarsCharacterApi\>);
245
- return data.results.map((character: StarWarsCharacter) \=> ({
246
- label: character.name,
247
- value: character.name,
248
- meta: character.gender,
249
- }));
250
- };
251
- export const SelectAsync \= () \=> (
252
- <IressRow gutter\="md"\>
253
- <IressCol\>
254
- <IressField label\="Single select" htmlFor\="single-select"\>
255
- <IressRichSelect
256
- container\={document.body}
257
- options\={options}
258
- id\="single-select"
259
- />
260
- </IressField\>
261
- </IressCol\>
262
- <IressCol\>
263
- <IressField label\="Multi-select" htmlFor\="multi-select"\>
264
- <IressRichSelect
265
- container\={document.body}
266
- options\={options}
267
- id\="multi-select"
268
- multiSelect
269
- />
270
- </IressField\>
271
- </IressCol\>
272
- </IressRow\>
273
- );
274
-
275
- Copy
276
-
277
- ### [](#initial-options)Initial options
278
-
279
- If you are using asynchronous options, you can provide an initial set of options to display before the user has interacted with the select using the `initialOptions` prop.
280
-
281
- Selected: None
282
-
283
- Hide code
284
-
285
- \[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; }
286
-
287
- export const SelectInitialOptions \= () \=> (
288
- <IressRichSelect
289
- container\={document.body}
290
- initialOptions\={\[
291
- { label: 'Frequently selected 1', value: 'freq-1' },
292
- { label: 'Frequently selected 2', value: 'freq-2' },
293
- \]}
294
- multiSelect
295
- options\={async () \=>
296
- Promise.resolve(\[
297
- { label: 'Option 1', value: 'option-1' },
298
- { label: 'Option 2', value: 'option-2' },
299
- { label: 'Option 3', value: 'option-3' },
300
- { label: 'Option 4', value: 'option-4' },
301
- { label: 'Option 5', value: 'option-5' },
302
- \])
303
- }
304
- virtualFocus\={false}
305
- />
306
- );
307
-
308
- Copy
309
-
310
- ### [](#sizing)Sizing
311
-
312
- Rich selects can be resized to suit a specific number of characters. This sets an expectation of what data is to be presented; for example using the `16` width for a credit card number.
313
-
314
- Widths can also be set as a percentage, allowing the select to take up a proportion of the width of its container.
315
-
316
- 2
317
-
318
- 4
319
-
320
- 6
321
-
322
- 8
323
-
324
- 10
325
-
326
- 12
327
-
328
- 16
329
-
330
- 25perc
331
-
332
- 50perc
333
-
334
- 75perc
335
-
336
- 100perc
337
-
338
- Hide code
339
-
340
- \[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; }
341
-
342
- <IressStack gutter\="md"\>
343
- <div\>
344
- <IressRichSelect
345
- container\={document.body}
346
- options\={\[
347
- {
348
- label: 'Option 1',
349
- meta: \[
350
- 'Some',
351
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
352
- \],
353
- value: '1'
354
- },
355
- {
356
- label: 'Option 2',
357
- meta: \[
358
- 'Some',
359
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
360
- \],
361
- value: '2'
362
- },
363
- {
364
- label: 'Option 3',
365
- meta: \[
366
- 'Some',
367
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
368
- \],
369
- value: '3'
370
- },
371
- {
372
- label: 'Option 4',
373
- meta: \[
374
- 'Some',
375
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
376
- \],
377
- value: '4'
378
- },
379
- {
380
- label: 'Option 5',
381
- meta: \[
382
- 'Some',
383
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
384
- \],
385
- value: '5'
386
- }
387
- \]}
388
- placeholder\="2"
389
- width\="2"
390
- />
391
- </div\>
392
- <div\>
393
- <IressRichSelect
394
- container\={document.body}
395
- options\={\[
396
- {
397
- label: 'Option 1',
398
- meta: \[
399
- 'Some',
400
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
401
- \],
402
- value: '1'
403
- },
404
- {
405
- label: 'Option 2',
406
- meta: \[
407
- 'Some',
408
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
409
- \],
410
- value: '2'
411
- },
412
- {
413
- label: 'Option 3',
414
- meta: \[
415
- 'Some',
416
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
417
- \],
418
- value: '3'
419
- },
420
- {
421
- label: 'Option 4',
422
- meta: \[
423
- 'Some',
424
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
425
- \],
426
- value: '4'
427
- },
428
- {
429
- label: 'Option 5',
430
- meta: \[
431
- 'Some',
432
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
433
- \],
434
- value: '5'
435
- }
436
- \]}
437
- placeholder\="4"
438
- width\="4"
439
- />
440
- </div\>
441
- <div\>
442
- <IressRichSelect
443
- container\={document.body}
444
- options\={\[
445
- {
446
- label: 'Option 1',
447
- meta: \[
448
- 'Some',
449
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
450
- \],
451
- value: '1'
452
- },
453
- {
454
- label: 'Option 2',
455
- meta: \[
456
- 'Some',
457
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
458
- \],
459
- value: '2'
460
- },
461
- {
462
- label: 'Option 3',
463
- meta: \[
464
- 'Some',
465
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
466
- \],
467
- value: '3'
468
- },
469
- {
470
- label: 'Option 4',
471
- meta: \[
472
- 'Some',
473
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
474
- \],
475
- value: '4'
476
- },
477
- {
478
- label: 'Option 5',
479
- meta: \[
480
- 'Some',
481
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
482
- \],
483
- value: '5'
484
- }
485
- \]}
486
- placeholder\="6"
487
- width\="6"
488
- />
489
- </div\>
490
- <div\>
491
- <IressRichSelect
492
- container\={document.body}
493
- options\={\[
494
- {
495
- label: 'Option 1',
496
- meta: \[
497
- 'Some',
498
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
499
- \],
500
- value: '1'
501
- },
502
- {
503
- label: 'Option 2',
504
- meta: \[
505
- 'Some',
506
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
507
- \],
508
- value: '2'
509
- },
510
- {
511
- label: 'Option 3',
512
- meta: \[
513
- 'Some',
514
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
515
- \],
516
- value: '3'
517
- },
518
- {
519
- label: 'Option 4',
520
- meta: \[
521
- 'Some',
522
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
523
- \],
524
- value: '4'
525
- },
526
- {
527
- label: 'Option 5',
528
- meta: \[
529
- 'Some',
530
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
531
- \],
532
- value: '5'
533
- }
534
- \]}
535
- placeholder\="8"
536
- width\="8"
537
- />
538
- </div\>
539
- <div\>
540
- <IressRichSelect
541
- container\={document.body}
542
- options\={\[
543
- {
544
- label: 'Option 1',
545
- meta: \[
546
- 'Some',
547
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
548
- \],
549
- value: '1'
550
- },
551
- {
552
- label: 'Option 2',
553
- meta: \[
554
- 'Some',
555
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
556
- \],
557
- value: '2'
558
- },
559
- {
560
- label: 'Option 3',
561
- meta: \[
562
- 'Some',
563
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
564
- \],
565
- value: '3'
566
- },
567
- {
568
- label: 'Option 4',
569
- meta: \[
570
- 'Some',
571
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
572
- \],
573
- value: '4'
574
- },
575
- {
576
- label: 'Option 5',
577
- meta: \[
578
- 'Some',
579
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
580
- \],
581
- value: '5'
582
- }
583
- \]}
584
- placeholder\="10"
585
- width\="10"
586
- />
587
- </div\>
588
- <div\>
589
- <IressRichSelect
590
- container\={document.body}
591
- options\={\[
592
- {
593
- label: 'Option 1',
594
- meta: \[
595
- 'Some',
596
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
597
- \],
598
- value: '1'
599
- },
600
- {
601
- label: 'Option 2',
602
- meta: \[
603
- 'Some',
604
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
605
- \],
606
- value: '2'
607
- },
608
- {
609
- label: 'Option 3',
610
- meta: \[
611
- 'Some',
612
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
613
- \],
614
- value: '3'
615
- },
616
- {
617
- label: 'Option 4',
618
- meta: \[
619
- 'Some',
620
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
621
- \],
622
- value: '4'
623
- },
624
- {
625
- label: 'Option 5',
626
- meta: \[
627
- 'Some',
628
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
629
- \],
630
- value: '5'
631
- }
632
- \]}
633
- placeholder\="12"
634
- width\="12"
635
- />
636
- </div\>
637
- <div\>
638
- <IressRichSelect
639
- container\={document.body}
640
- options\={\[
641
- {
642
- label: 'Option 1',
643
- meta: \[
644
- 'Some',
645
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
646
- \],
647
- value: '1'
648
- },
649
- {
650
- label: 'Option 2',
651
- meta: \[
652
- 'Some',
653
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
654
- \],
655
- value: '2'
656
- },
657
- {
658
- label: 'Option 3',
659
- meta: \[
660
- 'Some',
661
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
662
- \],
663
- value: '3'
664
- },
665
- {
666
- label: 'Option 4',
667
- meta: \[
668
- 'Some',
669
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
670
- \],
671
- value: '4'
672
- },
673
- {
674
- label: 'Option 5',
675
- meta: \[
676
- 'Some',
677
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
678
- \],
679
- value: '5'
680
- }
681
- \]}
682
- placeholder\="16"
683
- width\="16"
684
- />
685
- </div\>
686
- <div\>
687
- <IressRichSelect
688
- container\={document.body}
689
- options\={\[
690
- {
691
- label: 'Option 1',
692
- meta: \[
693
- 'Some',
694
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
695
- \],
696
- value: '1'
697
- },
698
- {
699
- label: 'Option 2',
700
- meta: \[
701
- 'Some',
702
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
703
- \],
704
- value: '2'
705
- },
706
- {
707
- label: 'Option 3',
708
- meta: \[
709
- 'Some',
710
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
711
- \],
712
- value: '3'
713
- },
714
- {
715
- label: 'Option 4',
716
- meta: \[
717
- 'Some',
718
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
719
- \],
720
- value: '4'
721
- },
722
- {
723
- label: 'Option 5',
724
- meta: \[
725
- 'Some',
726
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
727
- \],
728
- value: '5'
729
- }
730
- \]}
731
- placeholder\="25perc"
732
- width\="25perc"
733
- />
734
- </div\>
735
- <div\>
736
- <IressRichSelect
737
- container\={document.body}
738
- options\={\[
739
- {
740
- label: 'Option 1',
741
- meta: \[
742
- 'Some',
743
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
744
- \],
745
- value: '1'
746
- },
747
- {
748
- label: 'Option 2',
749
- meta: \[
750
- 'Some',
751
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
752
- \],
753
- value: '2'
754
- },
755
- {
756
- label: 'Option 3',
757
- meta: \[
758
- 'Some',
759
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
760
- \],
761
- value: '3'
762
- },
763
- {
764
- label: 'Option 4',
765
- meta: \[
766
- 'Some',
767
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
768
- \],
769
- value: '4'
770
- },
771
- {
772
- label: 'Option 5',
773
- meta: \[
774
- 'Some',
775
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
776
- \],
777
- value: '5'
778
- }
779
- \]}
780
- placeholder\="50perc"
781
- width\="50perc"
782
- />
783
- </div\>
784
- <div\>
785
- <IressRichSelect
786
- container\={document.body}
787
- options\={\[
788
- {
789
- label: 'Option 1',
790
- meta: \[
791
- 'Some',
792
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
793
- \],
794
- value: '1'
795
- },
796
- {
797
- label: 'Option 2',
798
- meta: \[
799
- 'Some',
800
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
801
- \],
802
- value: '2'
803
- },
804
- {
805
- label: 'Option 3',
806
- meta: \[
807
- 'Some',
808
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
809
- \],
810
- value: '3'
811
- },
812
- {
813
- label: 'Option 4',
814
- meta: \[
815
- 'Some',
816
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
817
- \],
818
- value: '4'
819
- },
820
- {
821
- label: 'Option 5',
822
- meta: \[
823
- 'Some',
824
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
825
- \],
826
- value: '5'
827
- }
828
- \]}
829
- placeholder\="75perc"
830
- width\="75perc"
831
- />
832
- </div\>
833
- <div\>
834
- <IressRichSelect
835
- container\={document.body}
836
- options\={\[
837
- {
838
- label: 'Option 1',
839
- meta: \[
840
- 'Some',
841
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
842
- \],
843
- value: '1'
844
- },
845
- {
846
- label: 'Option 2',
847
- meta: \[
848
- 'Some',
849
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
850
- \],
851
- value: '2'
852
- },
853
- {
854
- label: 'Option 3',
855
- meta: \[
856
- 'Some',
857
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
858
- \],
859
- value: '3'
860
- },
861
- {
862
- label: 'Option 4',
863
- meta: \[
864
- 'Some',
865
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
866
- \],
867
- value: '4'
868
- },
869
- {
870
- label: 'Option 5',
871
- meta: \[
872
- 'Some',
873
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
874
- \],
875
- value: '5'
876
- }
877
- \]}
878
- placeholder\="100perc"
879
- width\="100perc"
880
- />
881
- </div\>
882
- </IressStack\>
883
-
884
- Copy
885
-
886
- ### [](#custom-label)Custom label
887
-
888
- You can provide a custom label for the selected options by passing a function to the `renderLabel` prop. It expects a function that returns a ReactNode.
889
-
890
- It passes `SelectLabelRenderProps` as an argument, which contains the selected options and some other useful properties for customising a label.
891
-
892
- As per the example here, you can use this prop to render `IressSelectLabel` as a simple text label instead of tags when using the `multiSelect` prop.
893
-
894
- **Note:** As the label is expected to activate the dropdown, it is best to provide a button or other interactive element as the label. If the interactive element is nested, it should have the `role="combobox"` to indicate the intention that it will be activating the dropdown (as is the case of `IressSelectTags` which has multiple Buttons, but adds the combobox role to the chevron).
895
-
896
- Hide code
897
-
898
- \[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; }
899
-
900
- const CustomLabel: IressRichSelectProps\['renderLabel'\] \= ({ value }) \=> (
901
- <IressSelectLabel role\="combobox" selected\={value} />
902
- );
903
- export const SelectCustomLabel \= () \=> (
904
- <IressRichSelect
905
- multiSelect
906
- options\={\[
907
- { label: 'Option 1', value: 'option-1' },
908
- { label: 'Option 2', value: 'option-2' },
909
- \]}
910
- placeholder\="Select an item"
911
- renderLabel\={CustomLabel}
912
- container\={document.body}
913
- />
914
- );
915
-
916
- Copy
917
-
918
- ### [](#custom-options)Custom options
919
-
920
- In some cases, you may need to customise the options that are displayed. You can pass a function to the `renderOptions` prop. It expects a function that returns a ReactNode.
921
-
922
- It passes `SelectOptionRenderProps` as an argument, which contains the options and some other useful properties for customising the options.
923
-
924
- Selected: None
925
-
926
- Hide code
927
-
928
- \[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; }
929
-
930
- const CustomOptions: IressRichSelectProps\['renderOptions'\] \= ({
931
- loading,
932
- query,
933
- results,
934
- setQuery,
935
- setValue,
936
- value,
937
- }) \=> {
938
- const valueArray \= Array.isArray(value) ? value : \[value\];
939
- const selected \= value ? (valueArray as LabelValueMeta\[\]) : \[\];
940
- const simpleSelected \= selected.map(
941
- (selectedItem: FormattedLabelValueMeta) \=> {
942
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- We only need the unformatted object keys when displaying the selected value
943
- const { formattedLabel, ...unformatted } \= selectedItem;
944
- return unformatted;
945
- },
946
- );
947
- const hasResults \= !!results.length || (query && !loading);
948
- const hasSelected \= !!selected.length;
949
- const hasResultsAndSelected \= hasResults && hasSelected;
950
- return (
951
- <IressSelectSearch
952
- activator\={
953
- <IressSelectSearchInput
954
- onChange\={(e) \=> setQuery(e.currentTarget.value)}
955
- value\={query}
956
- loading\={loading}
957
- placeholder\="Search and select"
958
- />
959
- }
960
- style\={{
961
- maxHeight: '210px',
962
- }}
963
- \>
964
- {hasSelected && (
965
- <IressSelectMenu
966
- heading\={\`Selected (${selected.length})\`}
967
- items\={simpleSelected}
968
- multiSelect
969
- onChange\={setValue}
970
- selected\={value}
971
- />
972
- )}
973
- {hasResultsAndSelected && <IressMenuDivider gutter\="xs" />}
974
- {hasResults && (
975
- <IressSelectMenu
976
- heading\={query ? 'Search results' : 'All options'}
977
- items\={results}
978
- multiSelect
979
- noResults\={query ? 'No results found' : undefined}
980
- onChange\={setValue}
981
- selected\={value}
982
- hideSelectedItems
983
- />
984
- )}
985
- </IressSelectSearch\>
986
- );
987
- };
988
- export const SelectCustomOptions \= () \=> (
989
- <IressRichSelect
990
- container\={document.body}
991
- multiSelect
992
- options\={\[
993
- { label: 'Option 1', value: 'option-1' },
994
- { label: 'Option 2', value: 'option-2' },
995
- { label: 'Option 3', value: 'option-3' },
996
- { label: 'Option 4', value: 'option-4' },
997
- { label: 'Option 5', value: 'option-5' },
998
- \]}
999
- renderOptions\={CustomOptions}
1000
- virtualFocus\={false}
1001
- />
1002
- );
1003
-
1004
- Copy
1005
-
1006
- ### [](#create-new-option)Create new option
1007
-
1008
- You can use the `renderOptions` prop to add additional functionality to the options list. This is useful for allowing users to create new options.
1009
-
1010
- Select an item
1011
-
1012
- Selected: None
1013
-
1014
- Hide code
1015
-
1016
- \[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; }
1017
-
1018
- const FREQUENTLY\_SELECTED \= \[
1019
- { label: 'Frequently selected 1', value: 'freq-1' },
1020
- { label: 'Frequently selected 2', value: 'freq-2' },
1021
- \];
1022
- const OPTIONS \= \[
1023
- { label: 'Option 1', value: 'option-1' },
1024
- { label: 'Option 2', value: 'option-2' },
1025
- { label: 'Option 3', value: 'option-3' },
1026
- { label: 'Option 4', value: 'option-4' },
1027
- { label: 'Option 5', value: 'option-5' },
1028
- \];
1029
- const WithNewOption: IressRichSelectProps\['renderOptions'\] \= ({
1030
- loading,
1031
- debouncedQuery,
1032
- query,
1033
- results,
1034
- setQuery,
1035
- setValue,
1036
- value,
1037
- }) \=> {
1038
- const selectedArray \= toArray(value);
1039
- const simpleSelected \= selectedArray.map(
1040
- (selectedItem: FormattedLabelValueMeta) \=> {
1041
- // eslint-disable-next-line @typescript-eslint/no-unused-vars -- We only need the unformatted object keys when displaying the selected value
1042
- const { formattedLabel, ...unformatted } \= selectedItem;
1043
- return unformatted;
1044
- },
1045
- );
1046
- const hasResults \=
1047
- (!!results.length && results !== OPTIONS) || (debouncedQuery && !loading);
1048
- const hasSelected \= !!selectedArray.length;
1049
- const hasResultsAndSelected \= hasResults && hasSelected;
1050
- const showFrequentlySelected \=
1051
- !hasResults &&
1052
- !FREQUENTLY\_SELECTED.every((frequent) \=>
1053
- selectedArray.some((selected) \=> selected.value \=== frequent.value),
1054
- );
1055
- const canCreate \=
1056
- debouncedQuery &&
1057
- !results.some((result) \=> result.label \=== debouncedQuery) &&
1058
- !selectedArray.some((selected) \=> selected.label \=== debouncedQuery);
1059
- const hasFrequentlyAndOther \=
1060
- showFrequentlySelected && (hasResults || hasSelected);
1061
- const headingId \= useId();
1062
- const inputRef \= useRef<InputRef | null\>(null);
1063
- return (
1064
- <IressSelectSearch
1065
- activator\={
1066
- <IressSelectSearchInput
1067
- onChange\={(e) \=> setQuery(e.currentTarget.value)}
1068
- value\={query}
1069
- loading\={loading}
1070
- placeholder\="Search for items"
1071
- ref\={inputRef}
1072
- />
1073
- }
1074
- \>
1075
- <IressSelectBody header={
1076
- canCreate && (
1077
- <IressSelectCreate
1078
- heading\="Add custom option"
1079
- label\={debouncedQuery}
1080
- loading\={loading}
1081
- onCreate\={() \=> {
1082
- setValue(\[...selectedArray, { label: query, value: query }\]);
1083
- setQuery('');
1084
- close();
1085
- }}
1086
- />
1087
- )
1088
- }
1089
- > {hasSelected && (
1090
- <IressSelectMenu
1091
- aria-labelledby\={headingId}
1092
- heading\={
1093
- <IressSelectHeading
1094
- clearAll
1095
- onClearAll\={() \=> {
1096
- setValue(\[\]);
1097
- inputRef.current?.focus();
1098
- }}
1099
- \>
1100
- <h2 id\={headingId}\>Selected ({selectedArray.length})</h2\>
1101
- </IressSelectHeading\>
1102
- }
1103
- items\={simpleSelected}
1104
- multiSelect
1105
- onChange\={setValue}
1106
- selected\={value}
1107
- />
1108
- )}
1109
- {hasResultsAndSelected && <IressMenuDivider gutter\="xs" />}
1110
- {hasResults && (
1111
- <IressSelectMenu
1112
- heading\="Search results"
1113
- items\={results}
1114
- multiSelect
1115
- noResults\={debouncedQuery ? 'No results found' : undefined}
1116
- onChange\={setValue}
1117
- selected\={value}
1118
- hideSelectedItems
1119
- />
1120
- )}
1121
- {hasFrequentlyAndOther && <IressMenuDivider gutter\="xs" />}
1122
- {showFrequentlySelected && (
1123
- <IressSelectMenu
1124
- heading\="Frequently selected"
1125
- items\={FREQUENTLY\_SELECTED}
1126
- multiSelect
1127
- onChange\={setValue}
1128
- selected\={value}
1129
- hideSelectedItems
1130
- />
1131
- )}
1132
- </IressSelectBody\>
1133
- </IressSelectSearch\>
1134
- );
1135
- };
1136
- export const SelectNewOption \= () \=> (
1137
- <IressRichSelect
1138
- container\={document.body}
1139
- multiSelect
1140
- options\={OPTIONS}
1141
- placeholder\="Select an item"
1142
- renderOptions\={WithNewOption}
1143
- virtualFocus\={false}
1144
- />
1145
- );
1146
-
1147
- Copy
1148
-
1149
- ### [](#header-and-footer)Header and Footer
1150
-
1151
- Use the `header` `footer` prop to add a header/footer to the select panel. They can be any component you like, but you need to manage the styling on your own. If you want to keep the padding align with option items, try to wrap inside `<IressMenuText>` (it's essentially a div container, see the example below):
1152
-
1153
- Hide code
1154
-
1155
- \[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; }
1156
-
1157
- <IressRichSelect
1158
- container\={document.body}
1159
- footer\={<\><IressDivider style\={{marginBottom: 0}} /><IressMenuText\><IressInline gutter\="sm"\><IressButton\>Button 1</IressButton\><IressButton\>Button 2</IressButton\></IressInline\></IressMenuText\></\>}
1160
- header\={<\><IressMenuText\><IressText element\="h3" style\={{margin: 0}}\>Header</IressText\></IressMenuText\><IressDivider style\={{marginTop: 0}} /></\>}
1161
- options\={\[
1162
- {
1163
- label: 'Option 1',
1164
- meta: \[
1165
- 'Some',
1166
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
1167
- \],
1168
- value: '1'
1169
- },
1170
- {
1171
- label: 'Option 2',
1172
- meta: \[
1173
- 'Some',
1174
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
1175
- \],
1176
- value: '2'
1177
- },
1178
- {
1179
- label: 'Option 3',
1180
- meta: \[
1181
- 'Some',
1182
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
1183
- \],
1184
- value: '3'
1185
- },
1186
- {
1187
- label: 'Option 4',
1188
- meta: \[
1189
- 'Some',
1190
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
1191
- \],
1192
- value: '4'
1193
- },
1194
- {
1195
- label: 'Option 5',
1196
- meta: \[
1197
- 'Some',
1198
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
1199
- \],
1200
- value: '5'
1201
- }
1202
- \]}
1203
- placeholder\=""
1204
- />
1205
-
1206
- Copy
1207
-
1208
- ### [](#readonly)Readonly
1209
-
1210
- The `readonly` prop can be set to `true` to prevent the user from changing the value of the select. This will change the select to a custom read-only style, and will display multiple values seperated with a comma.
1211
-
1212
- If you need more control over the read-only state (for example, rendering a stylised version of the value), you can use the [`IressReadonly` component](?path=/docs/components-readonly--docs).
1213
-
1214
- Option 1, Option 2, Option 3, Option 4, Option 5
1215
-
1216
- Hide code
1217
-
1218
- \[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; }
1219
-
1220
- <IressRichSelect
1221
- container\={document.body}
1222
- multiSelect
1223
- options\={\[
1224
- {
1225
- label: 'Option 1',
1226
- meta: \[
1227
- 'Some',
1228
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
1229
- \],
1230
- value: '1'
1231
- },
1232
- {
1233
- label: 'Option 2',
1234
- meta: \[
1235
- 'Some',
1236
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
1237
- \],
1238
- value: '2'
1239
- },
1240
- {
1241
- label: 'Option 3',
1242
- meta: \[
1243
- 'Some',
1244
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
1245
- \],
1246
- value: '3'
1247
- },
1248
- {
1249
- label: 'Option 4',
1250
- meta: \[
1251
- 'Some',
1252
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
1253
- \],
1254
- value: '4'
1255
- },
1256
- {
1257
- label: 'Option 5',
1258
- meta: \[
1259
- 'Some',
1260
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
1261
- \],
1262
- value: '5'
1263
- }
1264
- \]}
1265
- placeholder\=""
1266
- readonly
1267
- value\={\[
1268
- {
1269
- label: 'Option 1',
1270
- meta: \[
1271
- 'Some',
1272
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
1273
- \],
1274
- value: '1'
1275
- },
1276
- {
1277
- label: 'Option 2',
1278
- meta: \[
1279
- 'Some',
1280
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
1281
- \],
1282
- value: '2'
1283
- },
1284
- {
1285
- label: 'Option 3',
1286
- meta: \[
1287
- 'Some',
1288
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
1289
- \],
1290
- value: '3'
1291
- },
1292
- {
1293
- label: 'Option 4',
1294
- meta: \[
1295
- 'Some',
1296
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
1297
- \],
1298
- value: '4'
1299
- },
1300
- {
1301
- label: 'Option 5',
1302
- meta: \[
1303
- 'Some',
1304
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
1305
- \],
1306
- value: '5'
1307
- }
1308
- \]}
1309
- />
1310
-
1311
- Copy
1312
-
1313
- [](#sub-components)Sub-components
1314
- ---------------------------------
1315
-
1316
- `IressRichSelect` is composed of several sub-components that can be used to customise the appearance and behaviour of the select.
1317
-
1318
- These are completely optional, the default behaviour should be sufficient for most use cases. They have been exposed to allow you to customise the select based on any use case.
1319
-
1320
- Below is a mapping of the available sub-components to the previous [Create new option example](#create-new-option).
1321
-
1322
- ![](/@fs/app/packages/components/src/components/RichSelect/assets/ids-rich-select--sub-component-mapping.svg)
1323
-
1324
- ### [](#iressselectbody)IressSelectBody
1325
-
1326
- A container for the options list. It accepts `header` and `footer` props, allowing you to fix content to the top or bottom of the dropdown.
1327
-
1328
- Add custom option
1329
- -----------------
1330
-
1331
- New option
1332
-
1333
- * * *
1334
-
1335
- Option 1Some
1336
-
1337
- Active
1338
-
1339
- Option 2Some
1340
-
1341
- Active
1342
-
1343
- Option 3Some
1344
-
1345
- Active
1346
-
1347
- Option 4Some
1348
-
1349
- Active
1350
-
1351
- Option 5Some
1352
-
1353
- Active
1354
-
1355
- Option 6Some
1356
-
1357
- Active
1358
-
1359
- Option 7Some
1360
-
1361
- Active
1362
-
1363
- Option 8Some
1364
-
1365
- Active
1366
-
1367
- Option 9Some
1368
-
1369
- Active
1370
-
1371
- Option 10Some
1372
-
1373
- Active
1374
-
1375
- Option 11Some
1376
-
1377
- Active
1378
-
1379
- Option 12Some
1380
-
1381
- Active
1382
-
1383
- Option 13Some
1384
-
1385
- Active
1386
-
1387
- Option 14Some
1388
-
1389
- Active
1390
-
1391
- Option 15Some
1392
-
1393
- Active
1394
-
1395
- This will always be fixed to the bottom
1396
-
1397
- Hide code
1398
-
1399
- \[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; }
1400
-
1401
- <IressSelectBody
1402
- footer\={<IressPanel\>This will always be fixed to the bottom</IressPanel\>}
1403
- header\={<\><IressSelectCreate heading\="Add custom option" /><IressMenuDivider gutter\="none" /></\>}
1404
- style\={{
1405
- border: '1px solid var(--iress-g-border-color)'
1406
- }}
1407
- \>
1408
- <IressSelectMenu
1409
- fluid
1410
- items\={\[
1411
- {
1412
- label: 'Option 1',
1413
- meta: \[
1414
- 'Some',
1415
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
1416
- \],
1417
- value: '1'
1418
- },
1419
- {
1420
- label: 'Option 2',
1421
- meta: \[
1422
- 'Some',
1423
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
1424
- \],
1425
- value: '2'
1426
- },
1427
- {
1428
- label: 'Option 3',
1429
- meta: \[
1430
- 'Some',
1431
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
1432
- \],
1433
- value: '3'
1434
- },
1435
- {
1436
- label: 'Option 4',
1437
- meta: \[
1438
- 'Some',
1439
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
1440
- \],
1441
- value: '4'
1442
- },
1443
- {
1444
- label: 'Option 5',
1445
- meta: \[
1446
- 'Some',
1447
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
1448
- \],
1449
- value: '5'
1450
- },
1451
- {
1452
- label: 'Option 6',
1453
- meta: \[
1454
- 'Some',
1455
- <IressText key\="5-active" mode\="success"\>Active</IressText\>
1456
- \],
1457
- value: '6'
1458
- },
1459
- {
1460
- label: 'Option 7',
1461
- meta: \[
1462
- 'Some',
1463
- <IressText key\="6-active" mode\="success"\>Active</IressText\>
1464
- \],
1465
- value: '7'
1466
- },
1467
- {
1468
- label: 'Option 8',
1469
- meta: \[
1470
- 'Some',
1471
- <IressText key\="7-active" mode\="success"\>Active</IressText\>
1472
- \],
1473
- value: '8'
1474
- },
1475
- {
1476
- label: 'Option 9',
1477
- meta: \[
1478
- 'Some',
1479
- <IressText key\="8-active" mode\="success"\>Active</IressText\>
1480
- \],
1481
- value: '9'
1482
- },
1483
- {
1484
- label: 'Option 10',
1485
- meta: \[
1486
- 'Some',
1487
- <IressText key\="9-active" mode\="success"\>Active</IressText\>
1488
- \],
1489
- value: '10'
1490
- },
1491
- {
1492
- label: 'Option 11',
1493
- meta: \[
1494
- 'Some',
1495
- <IressText key\="10-active" mode\="success"\>Active</IressText\>
1496
- \],
1497
- value: '11'
1498
- },
1499
- {
1500
- label: 'Option 12',
1501
- meta: \[
1502
- 'Some',
1503
- <IressText key\="11-active" mode\="success"\>Active</IressText\>
1504
- \],
1505
- value: '12'
1506
- },
1507
- {
1508
- label: 'Option 13',
1509
- meta: \[
1510
- 'Some',
1511
- <IressText key\="12-active" mode\="success"\>Active</IressText\>
1512
- \],
1513
- value: '13'
1514
- },
1515
- {
1516
- label: 'Option 14',
1517
- meta: \[
1518
- 'Some',
1519
- <IressText key\="13-active" mode\="success"\>Active</IressText\>
1520
- \],
1521
- value: '14'
1522
- },
1523
- {
1524
- label: 'Option 15',
1525
- meta: \[
1526
- 'Some',
1527
- <IressText key\="14-active" mode\="success"\>Active</IressText\>
1528
- \],
1529
- value: '15'
1530
- }
1531
- \]}
1532
- />
1533
- </IressSelectBody\>
1534
-
1535
- Copy
1536
-
1537
- ### [](#iressselectcreate)IressSelectCreate
1538
-
1539
- A button designed to create an option if the desired option is not in the list. Use the `onCreate` prop to handle the creation of the new option.
1540
-
1541
- Add custom option
1542
- -----------------
1543
-
1544
- WX
1545
-
1546
- Hide code
1547
-
1548
- \[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; }
1549
-
1550
- <IressSelectCreate
1551
- heading\="Add custom option"
1552
- label\="WX"
1553
- />
1554
-
1555
- Copy
1556
-
1557
- ### [](#iressselectheading)IressSelectHeading
1558
-
1559
- A heading designed to allow clearing of a list. To show the clear all button, you can set `clearAll` (it can be a string if you want to override the text). Use the `onClearAll` prop to handle the clearing of the list.
1560
-
1561
- Selected (2)
1562
- ------------
1563
-
1564
- Clear all
1565
-
1566
- Hide code
1567
-
1568
- \[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; }
1569
-
1570
- <IressSelectHeading clearAll\>
1571
- <h2\>
1572
- Selected (2) </h2\>
1573
- </IressSelectHeading\>
1574
-
1575
- Copy
1576
-
1577
- ### [](#iressselectlabel)IressSelectLabel
1578
-
1579
- A button designed to display a text representation of the selected items. It supports both single and multiple selected items.
1580
-
1581
- It is used to render the activator of the `IressRichSelect` in single select mode when no `renderLabel` prop is provided.
1582
-
1583
- Hide code
1584
-
1585
- \[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; }
1586
-
1587
- <IressSelectLabel placeholder\="" />
1588
-
1589
- Copy
1590
-
1591
- Option 1
1592
-
1593
- Hide code
1594
-
1595
- \[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; }
1596
-
1597
- <IressSelectLabel
1598
- placeholder\=""
1599
- selected\={{
1600
- label: 'Option 1',
1601
- meta: \[
1602
- 'Some',
1603
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
1604
- \],
1605
- value: '1'
1606
- }}
1607
- />
1608
-
1609
- Copy
1610
-
1611
- 5 selected
1612
-
1613
- Hide code
1614
-
1615
- \[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; }
1616
-
1617
- <IressSelectLabel
1618
- placeholder\=""
1619
- selected\={\[
1620
- {
1621
- label: 'Option 1',
1622
- meta: \[
1623
- 'Some',
1624
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
1625
- \],
1626
- value: '1'
1627
- },
1628
- {
1629
- label: 'Option 2',
1630
- meta: \[
1631
- 'Some',
1632
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
1633
- \],
1634
- value: '2'
1635
- },
1636
- {
1637
- label: 'Option 3',
1638
- meta: \[
1639
- 'Some',
1640
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
1641
- \],
1642
- value: '3'
1643
- },
1644
- {
1645
- label: 'Option 4',
1646
- meta: \[
1647
- 'Some',
1648
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
1649
- \],
1650
- value: '4'
1651
- },
1652
- {
1653
- label: 'Option 5',
1654
- meta: \[
1655
- 'Some',
1656
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
1657
- \],
1658
- value: '5'
1659
- }
1660
- \]}
1661
- />
1662
-
1663
- Copy
1664
-
1665
- #### [](#select-label-props)Props
1666
-
1667
- | Name | Description | Default | Control |
1668
- | --- | --- | --- | --- |
1669
- | append |
1670
- Append content.
1671
-
1672
- ReactNode
1673
-
1674
-
1675
-
1676
- |
1677
-
1678
- <IressIcon />
1679
-
1680
-
1681
-
1682
- | Set object |
1683
- | placeholder |
1684
-
1685
- Placeholder, shown when there is nothing selected.
1686
-
1687
- ReactNode
1688
-
1689
-
1690
-
1691
- | \- |
1692
-
1693
- ""
1694
-
1695
- |
1696
- | prepend |
1697
-
1698
- Prepend content.
1699
-
1700
- ReactNode
1701
-
1702
-
1703
-
1704
- | \- | Set object |
1705
- | selected |
1706
-
1707
- Selected items.
1708
-
1709
- LabelValueMeta | LabelValueMeta\[\] | undefined
1710
-
1711
- | \- | Set object |
1712
- | selectedOptionsText |
1713
-
1714
- Text displayed next to label when two or more options are selected.
1715
-
1716
- stringundefined
1717
-
1718
-
1719
-
1720
- | {{numOptions}} selected | Set object |
1721
-
1722
- ### [](#iressselectmenu)IressSelectMenu
1723
-
1724
- A menu component designed to transform an array of `LabelValueMeta[]` into a listbox menu. It accepts a `heading` and `noResults` prop to provide context to the user in certain scenarios. It also accepts a range of other props to customise appearance and behaviour.
1725
-
1726
- It is used to render the available options of the `IressRichSelect` in single select mode when no `renderOptions` prop is provided.
1727
-
1728
- Search results
1729
- --------------
1730
-
1731
- Option 1Option 2Option 3Option 4Option 5
1732
-
1733
- Hide code
1734
-
1735
- \[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; }
1736
-
1737
- <IressSelectMenu
1738
- fluid
1739
- heading\="Search results"
1740
- items\={\[
1741
- {
1742
- label: 'Option 1',
1743
- value: '1'
1744
- },
1745
- {
1746
- label: 'Option 2',
1747
- value: '2'
1748
- },
1749
- {
1750
- label: 'Option 3',
1751
- value: '3'
1752
- },
1753
- {
1754
- label: 'Option 4',
1755
- value: '4'
1756
- },
1757
- {
1758
- label: 'Option 5',
1759
- value: '5'
1760
- }
1761
- \]}
1762
- noResults\="No results found"
1763
- />
1764
-
1765
- Copy
1766
-
1767
- Search results
1768
- --------------
1769
-
1770
- No results found
1771
-
1772
- Hide code
1773
-
1774
- \[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; }
1775
-
1776
- <IressSelectMenu
1777
- fluid
1778
- heading\="Search results"
1779
- items\={\[\]}
1780
- noResults\="No results found"
1781
- />
1782
-
1783
- Copy
1784
-
1785
- #### [](#select-menu-props)Props
1786
-
1787
- | Name | Description | Default | Control |
1788
- | --- | --- | --- | --- |
1789
- | defaultSelected |
1790
- Initially selected values of menu when `role` is listbox. Used for uncontrolled menus.
1791
-
1792
- MenuSelectedundefined
1793
-
1794
-
1795
-
1796
- | \- | Set object |
1797
- | heading |
1798
-
1799
- Heading slot. Often used for a title or description. If a string, will automatically provide an id for aria-labelledby.
1800
-
1801
- ReactNode
1802
-
1803
-
1804
-
1805
- | \- |
1806
-
1807
- "Search results"
1808
-
1809
- |
1810
- | hideSelectedItems |
1811
-
1812
- Hide selected items from menu. Useful for autocomplete scenarios.
1813
-
1814
- booleanundefined
1815
-
1816
-
1817
-
1818
- | \- | Set object |
1819
- | items |
1820
-
1821
- Items to be displayed in the menu, array of FormattedLabelValueMeta.
1822
-
1823
- FormattedLabelValueMeta\[\] | undefined
1824
-
1825
- | \[\] |
1826
-
1827
- RAW
1828
-
1829
- items : \[
1830
-
1831
- 0 : {...} 2 keys
1832
-
1833
- 1 : {...} 2 keys
1834
-
1835
- 2 : {...} 2 keys
1836
-
1837
- 3 : {...} 2 keys
1838
-
1839
- 4 : {...} 2 keys
1840
-
1841
- \]
1842
-
1843
-
1844
-
1845
-
1846
-
1847
- |
1848
- | limitDesktop |
1849
-
1850
- Maximum number of results displayed on larger screen sizes (>= 768).
1851
-
1852
- numberundefined
1853
-
1854
-
1855
-
1856
- | \- | Set object |
1857
- | limitMobile |
1858
-
1859
- Maximum number of results displayed on mobile screen sizes (< 768).
1860
-
1861
- numberundefined
1862
-
1863
-
1864
-
1865
- | \- | Set object |
1866
- | multiSelect |
1867
-
1868
- If set to true, menu items will contain checkboxes.
1869
-
1870
- booleanundefined
1871
-
1872
-
1873
-
1874
- | \- | Set object |
1875
- | noResults |
1876
-
1877
- No results text to display when no items are found.
1878
-
1879
- ReactNode
1880
-
1881
-
1882
-
1883
- | \- |
1884
-
1885
- "No results found"
1886
-
1887
- |
1888
- | onChange |
1889
-
1890
- Emitted when the value changes when item is selected from the menu
1891
-
1892
- ((selected?: LabelValueMeta | LabelValueMeta\[\] | undefined) => void) | undefined
1893
-
1894
- | \- | \- |
1895
- | selected |
1896
-
1897
- Selected items.
1898
-
1899
- LabelValueMeta | LabelValueMeta\[\] | undefined
1900
-
1901
- | \- | Set object |
1902
- | selectedFirst |
1903
-
1904
- Set whether to display selected items first in the menu.
1905
-
1906
- booleanundefined
1907
-
1908
-
1909
-
1910
- | \- | Set object |
1911
- | Show Menu props itemsMenu props | Show Menu props items |
1912
-
1913
- ### [](#iressselectsearch)IressSelectSearch
1914
-
1915
- A custom inline search navigator, designed to create a search experience within a dropdown. The activator passed in will be pinned on the top of the dropdown when used in `IressRichSelect`. It can be combined with other components to create a rich select experience, including:
1916
-
1917
- * Keeping focus on the input while the user navigates the options with the arrow keys.
1918
- * Combine with different components such as `IressSelectBody`, `IressSelectCreate` and `IressSelectMenu` to allow multiple items to be pinned to the top of the dropdown.
1919
-
1920
- It is used to filter the available options of the `IressRichSelect` when an asynchronous `options` function is used and no `renderOptions` prop is provided.
1921
-
1922
- Add custom option
1923
- -----------------
1924
-
1925
- New option
1926
-
1927
- * * *
1928
-
1929
- Option 1Some
1930
-
1931
- Active
1932
-
1933
- Option 2Some
1934
-
1935
- Active
1936
-
1937
- Option 3Some
1938
-
1939
- Active
1940
-
1941
- Option 4Some
1942
-
1943
- Active
1944
-
1945
- Option 5Some
1946
-
1947
- Active
1948
-
1949
- Option 6Some
1950
-
1951
- Active
1952
-
1953
- Option 7Some
1954
-
1955
- Active
1956
-
1957
- Option 8Some
1958
-
1959
- Active
1960
-
1961
- Option 9Some
1962
-
1963
- Active
1964
-
1965
- Option 10Some
1966
-
1967
- Active
1968
-
1969
- Option 11Some
1970
-
1971
- Active
1972
-
1973
- Option 12Some
1974
-
1975
- Active
1976
-
1977
- Option 13Some
1978
-
1979
- Active
1980
-
1981
- Option 14Some
1982
-
1983
- Active
1984
-
1985
- Option 15Some
1986
-
1987
- Active
1988
-
1989
- This will always be fixed to the bottom
1990
-
1991
- Hide code
1992
-
1993
- \[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; }
1994
-
1995
- <IressSelectSearch
1996
- activator\={<IressSelectSearchInput placeholder\="Search and select" />}
1997
- style\={{
1998
- border: '1px solid var(--iress-g-border-color)',
1999
- maxHeight: 400
2000
- }}
2001
- \>
2002
- <IressSelectBody
2003
- footer\={<IressPanel\>This will always be fixed to the bottom</IressPanel\>}
2004
- header\={<\><IressSelectCreate heading\="Add custom option" /><IressMenuDivider gutter\="none" /></\>}
2005
- \>
2006
- <IressSelectMenu
2007
- fluid
2008
- items\={\[
2009
- {
2010
- label: 'Option 1',
2011
- meta: \[
2012
- 'Some',
2013
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
2014
- \],
2015
- value: '1'
2016
- },
2017
- {
2018
- label: 'Option 2',
2019
- meta: \[
2020
- 'Some',
2021
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
2022
- \],
2023
- value: '2'
2024
- },
2025
- {
2026
- label: 'Option 3',
2027
- meta: \[
2028
- 'Some',
2029
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
2030
- \],
2031
- value: '3'
2032
- },
2033
- {
2034
- label: 'Option 4',
2035
- meta: \[
2036
- 'Some',
2037
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
2038
- \],
2039
- value: '4'
2040
- },
2041
- {
2042
- label: 'Option 5',
2043
- meta: \[
2044
- 'Some',
2045
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
2046
- \],
2047
- value: '5'
2048
- },
2049
- {
2050
- label: 'Option 6',
2051
- meta: \[
2052
- 'Some',
2053
- <IressText key\="5-active" mode\="success"\>Active</IressText\>
2054
- \],
2055
- value: '6'
2056
- },
2057
- {
2058
- label: 'Option 7',
2059
- meta: \[
2060
- 'Some',
2061
- <IressText key\="6-active" mode\="success"\>Active</IressText\>
2062
- \],
2063
- value: '7'
2064
- },
2065
- {
2066
- label: 'Option 8',
2067
- meta: \[
2068
- 'Some',
2069
- <IressText key\="7-active" mode\="success"\>Active</IressText\>
2070
- \],
2071
- value: '8'
2072
- },
2073
- {
2074
- label: 'Option 9',
2075
- meta: \[
2076
- 'Some',
2077
- <IressText key\="8-active" mode\="success"\>Active</IressText\>
2078
- \],
2079
- value: '9'
2080
- },
2081
- {
2082
- label: 'Option 10',
2083
- meta: \[
2084
- 'Some',
2085
- <IressText key\="9-active" mode\="success"\>Active</IressText\>
2086
- \],
2087
- value: '10'
2088
- },
2089
- {
2090
- label: 'Option 11',
2091
- meta: \[
2092
- 'Some',
2093
- <IressText key\="10-active" mode\="success"\>Active</IressText\>
2094
- \],
2095
- value: '11'
2096
- },
2097
- {
2098
- label: 'Option 12',
2099
- meta: \[
2100
- 'Some',
2101
- <IressText key\="11-active" mode\="success"\>Active</IressText\>
2102
- \],
2103
- value: '12'
2104
- },
2105
- {
2106
- label: 'Option 13',
2107
- meta: \[
2108
- 'Some',
2109
- <IressText key\="12-active" mode\="success"\>Active</IressText\>
2110
- \],
2111
- value: '13'
2112
- },
2113
- {
2114
- label: 'Option 14',
2115
- meta: \[
2116
- 'Some',
2117
- <IressText key\="13-active" mode\="success"\>Active</IressText\>
2118
- \],
2119
- value: '14'
2120
- },
2121
- {
2122
- label: 'Option 15',
2123
- meta: \[
2124
- 'Some',
2125
- <IressText key\="14-active" mode\="success"\>Active</IressText\>
2126
- \],
2127
- value: '15'
2128
- }
2129
- \]}
2130
- />
2131
- </IressSelectBody\>
2132
- </IressSelectSearch\>
2133
-
2134
- Copy
2135
-
2136
- ### [](#iressselectsearchinput)IressSelectSearchInput
2137
-
2138
- A custom input designed specifically to be used inside a dropdown. It has a simple appearance, with only a single border used to divide it from the rest of the dropdown. The border will change depending on its location inside the dropdown. It should not be used outside of a dropdown.
2139
-
2140
- It is used to filter the available options of the `IressRichSelect` when an asynchronous `options` function is used and no `renderOptions` prop is provided.
2141
-
2142
- Hide code
2143
-
2144
- \[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; }
2145
-
2146
- <IressSelectSearchInput />
2147
-
2148
- Copy
2149
-
2150
- ### [](#iressselecttags)IressSelectTags
2151
-
2152
- A component designed to display multiple selected items as tags, as well as providing functionality to delete each tag without having to open the dropdown. It supports both single and multiple selected items.
2153
-
2154
- It is used to render the activator of the `IressRichSelect` if `multiSelect` has been set and no `renderLabel` prop is provided.
2155
-
2156
- Select an item
2157
-
2158
- Hide code
2159
-
2160
- \[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; }
2161
-
2162
- <IressSelectTags placeholder\="Select an item" />
2163
-
2164
- Copy
2165
-
2166
- Option 1
2167
-
2168
- Hide code
2169
-
2170
- \[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; }
2171
-
2172
- <IressSelectTags
2173
- placeholder\="Select an item"
2174
- selected\={{
2175
- label: 'Option 1',
2176
- meta: \[
2177
- 'Some',
2178
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
2179
- \],
2180
- value: '1'
2181
- }}
2182
- />
2183
-
2184
- Copy
2185
-
2186
- #### [](#select-tags-props)Props
2187
-
2188
- | Name | Description | Default | Control |
2189
- | --- | --- | --- | --- |
2190
- | append |
2191
- Append content.
2192
-
2193
- ReactNode
2194
-
2195
-
2196
-
2197
- |
2198
-
2199
- <IressButton />
2200
-
2201
-
2202
-
2203
- | Set object |
2204
- | limit |
2205
-
2206
- Limit of tags to display before shortening to `selectedOptionsText`
2207
-
2208
- numberundefined
2209
-
2210
-
2211
-
2212
- |
2213
-
2214
- 5
2215
-
2216
- | Set object |
2217
- | onDelete |
2218
-
2219
- Emitted when a tag is deleted.
2220
-
2221
- ((item?: LabelValueMeta | undefined, e?: SyntheticEvent<ButtonRef, Event> | undefined) => void) | undefined
2222
-
2223
- | \- | \- |
2224
- | onDeleteAll |
2225
-
2226
- Emitted when the combined tag delete button is clicked.
2227
-
2228
- ((e: SyntheticEvent<ButtonRef, Event>) => void) | undefined
2229
-
2230
- | \- | \- |
2231
- | onToggleActions |
2232
-
2233
- Emitted when actions are toggled.
2234
-
2235
- ((open?: boolean | undefined) => void) | undefined
2236
-
2237
- | \- | \- |
2238
- | placeholder |
2239
-
2240
- Placeholder, shown when there is nothing selected.
2241
-
2242
- ReactNode
2243
-
2244
-
2245
-
2246
- | \- |
2247
-
2248
- "Select an item"
2249
-
2250
- |
2251
- | prepend |
2252
-
2253
- Prepend content.
2254
-
2255
- ReactNode
2256
-
2257
-
2258
-
2259
- | \- | Set object |
2260
- | selected |
2261
-
2262
- Selected items.
2263
-
2264
- LabelValueMeta | LabelValueMeta\[\] | undefined
2265
-
2266
- | \- | Set object |
2267
- | selectedOptionsText |
2268
-
2269
- Text displayed next to label when two or more options are selected.
2270
-
2271
- stringundefined
2272
-
2273
-
2274
-
2275
- | {{numOptions}} selected | Set object |
2276
-
2277
- #### [](#maximum-tag-limit)Maximum tag limit
2278
-
2279
- By default, the maximum number of tags that can be displayed is 5. If more than 5 tags are selected, the label will display the number of selected items. This can be changed using the `limit` prop.
2280
-
2281
- 5 selected
2282
-
2283
- Expand allDelete all
2284
-
2285
- Hide code
2286
-
2287
- \[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; }
2288
-
2289
- <IressSelectTags
2290
- limit\={3}
2291
- placeholder\="Select an item"
2292
- selected\={\[
2293
- {
2294
- label: 'Option 1',
2295
- meta: \[
2296
- 'Some',
2297
- <IressText key\="0-active" mode\="success"\>Active</IressText\>
2298
- \],
2299
- value: '1'
2300
- },
2301
- {
2302
- label: 'Option 2',
2303
- meta: \[
2304
- 'Some',
2305
- <IressText key\="1-active" mode\="success"\>Active</IressText\>
2306
- \],
2307
- value: '2'
2308
- },
2309
- {
2310
- label: 'Option 3',
2311
- meta: \[
2312
- 'Some',
2313
- <IressText key\="2-active" mode\="success"\>Active</IressText\>
2314
- \],
2315
- value: '3'
2316
- },
2317
- {
2318
- label: 'Option 4',
2319
- meta: \[
2320
- 'Some',
2321
- <IressText key\="3-active" mode\="success"\>Active</IressText\>
2322
- \],
2323
- value: '4'
2324
- },
2325
- {
2326
- label: 'Option 5',
2327
- meta: \[
2328
- 'Some',
2329
- <IressText key\="4-active" mode\="success"\>Active</IressText\>
2330
- \],
2331
- value: '5'
2332
- }
2333
- \]}
2334
- />
2335
-
2336
- Copy
2337
-
2338
- [](#testing)Testing
2339
- -------------------
2340
-
2341
- ### [](#getting-the-value)Getting the value
2342
-
2343
- The value of the rich select is not accessed the same way as other inputs because it is not an input but a button. To get the value, you need to use `getByText` instead of `getByValue`.
2344
-
2345
- \[data-radix-scroll-area-viewport\] {
2346
- scrollbar-width: none;
2347
- -ms-overflow-style: none;
2348
- -webkit-overflow-scrolling: touch;
2349
- }
2350
- \[data-radix-scroll-area-viewport\]::-webkit-scrollbar {
2351
- display: none;
2352
- }
2353
- :where(\[data-radix-scroll-area-viewport\]) {
2354
- display: flex;
2355
- flex-direction: column;
2356
- align-items: stretch;
2357
- }
2358
- :where(\[data-radix-scroll-area-content\]) {
2359
- flex-grow: 1;
2360
- }
2361
-
2362
- render(<IressRichSelect options\={options} value\={{ label: 'Option 1' }} />);
2363
- const select \= screen.getByRole('combobox');
2364
- // Will work
2365
- expect(select).toHaveTextContent('Option 1');
2366
- // Won't work
2367
- expect(select).toHaveValue('Option 1');
2368
-
2369
- Copy
2370
-
2371
- If the `multiSelect` prop is set to true, the value will be prefixed by the text `Selected:` , as per below.
2372
-
2373
- \[data-radix-scroll-area-viewport\] {
2374
- scrollbar-width: none;
2375
- -ms-overflow-style: none;
2376
- -webkit-overflow-scrolling: touch;
2377
- }
2378
- \[data-radix-scroll-area-viewport\]::-webkit-scrollbar {
2379
- display: none;
2380
- }
2381
- :where(\[data-radix-scroll-area-viewport\]) {
2382
- display: flex;
2383
- flex-direction: column;
2384
- align-items: stretch;
2385
- }
2386
- :where(\[data-radix-scroll-area-content\]) {
2387
- flex-grow: 1;
2388
- }
2389
-
2390
- render(
2391
- <IressRichSelect
2392
- options\={options}
2393
- value\={\[{ label: 'Option 1' }\]}
2394
- multiSelect
2395
- />,
2396
- );
2397
- const select \= screen.getByRole('combobox');
2398
- // Will work
2399
- expect(select).toHaveTextContent('Selected: Option 1');
2400
- // Won't work
2401
- expect(select).toHaveValue('Option 1');
2402
-
2403
- Copy
2404
-
2405
- On this page
2406
-
2407
- * [Overview](#overview)
2408
- * [Props](#props)
2409
- * [Usage](#usage)
2410
- * [When To Use](#when-to-use)
2411
- * [Accessibility](#accessibility)
2412
- * [Examples](#examples)
2413
- * [Single select](#single-select)
2414
- * [Multi-select](#multi-select)
2415
- * [Asynchronous options](#asynchronous-options)
2416
- * [Initial options](#initial-options)
2417
- * [Sizing](#sizing)
2418
- * [Custom label](#custom-label)
2419
- * [Custom options](#custom-options)
2420
- * [Create new option](#create-new-option)
2421
- * [Header and Footer](#header-and-footer)
2422
- * [Readonly](#readonly)
2423
- * [Sub-components](#sub-components)
2424
- * [IressSelectBody](#iressselectbody)
2425
- * [IressSelectCreate](#iressselectcreate)
2426
- * [IressSelectHeading](#iressselectheading)
2427
- * [IressSelectLabel](#iressselectlabel)
2428
- * [IressSelectMenu](#iressselectmenu)
2429
- * [IressSelectSearch](#iressselectsearch)
2430
- * [IressSelectSearchInput](#iressselectsearchinput)
2431
- * [IressSelectTags](#iressselecttags)
2432
- * [Testing](#testing)
2433
- * [Getting the value](#getting-the-value)