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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/generated/docs/components_components-alert-docs.md +496 -0
  2. package/generated/docs/components_components-autocomplete-docs.md +3429 -0
  3. package/generated/docs/{components-autocomplete-recipes-docs.md → components_components-autocomplete-recipes-docs.md} +39 -14
  4. package/generated/docs/{components-badge-docs.md → components_components-badge-docs.md} +222 -30
  5. package/generated/docs/components_components-button-docs.md +2078 -0
  6. package/generated/docs/components_components-button-recipes-docs.md +37 -0
  7. package/generated/docs/components_components-buttongroup-docs.md +1045 -0
  8. package/generated/docs/components_components-card-docs.md +2290 -0
  9. package/generated/docs/{components-card-recipes-docs.md → components_components-card-recipes-docs.md} +132 -15
  10. package/generated/docs/components_components-checkbox-docs.md +1040 -0
  11. package/generated/docs/{components-checkboxgroup-docs.md → components_components-checkboxgroup-docs.md} +1001 -82
  12. package/generated/docs/{components-checkboxgroup-recipes-docs.md → components_components-checkboxgroup-recipes-docs.md} +102 -12
  13. package/generated/docs/{components-col-docs.md → components_components-col-docs.md} +331 -58
  14. package/generated/docs/components_components-combobox-docs.md +3735 -0
  15. package/generated/docs/{components-container-docs.md → components_components-container-docs.md} +61 -24
  16. package/generated/docs/{components-divider-docs.md → components_components-divider-docs.md} +83 -24
  17. package/generated/docs/{components-expander-docs.md → components_components-expander-docs.md} +266 -33
  18. package/generated/docs/components_components-field-docs.md +1369 -0
  19. package/generated/docs/components_components-filter-docs.md +4080 -0
  20. package/generated/docs/{components-form-docs.md → components_components-form-docs.md} +1556 -360
  21. package/generated/docs/{components-form-recipes-docs.md → components_components-form-recipes-docs.md} +277 -60
  22. package/generated/docs/{components-hide-docs.md → components_components-hide-docs.md} +195 -124
  23. package/generated/docs/components_components-icon-docs.md +1337 -0
  24. package/generated/docs/{components-inline-docs.md → components_components-inline-docs.md} +462 -42
  25. package/generated/docs/components_components-input-docs.md +1468 -0
  26. package/generated/docs/components_components-input-recipes-docs.md +367 -0
  27. package/generated/docs/components_components-inputcurrency-docs.md +432 -0
  28. package/generated/docs/{components-inputcurrency-recipes-docs.md → components_components-inputcurrency-recipes-docs.md} +113 -17
  29. package/generated/docs/components_components-label-docs.md +323 -0
  30. package/generated/docs/components_components-menu-docs.md +2345 -0
  31. package/generated/docs/components_components-menu-menuitem-docs.md +633 -0
  32. package/generated/docs/{components-modal-docs.md → components_components-modal-docs.md} +1640 -231
  33. package/generated/docs/components_components-navbar-docs.md +1847 -0
  34. package/generated/docs/{components-navbar-recipes-docs.md → components_components-navbar-recipes-docs.md} +721 -40
  35. package/generated/docs/{components-panel-docs.md → components_components-panel-docs.md} +754 -57
  36. package/generated/docs/components_components-placeholder-docs.md +92 -0
  37. package/generated/docs/components_components-popover-docs.md +1643 -0
  38. package/generated/docs/components_components-popover-recipes-docs.md +491 -0
  39. package/generated/docs/components_components-progress-docs.md +115 -0
  40. package/generated/docs/{components-provider-docs.md → components_components-provider-docs.md} +42 -33
  41. package/generated/docs/components_components-radio-docs.md +491 -0
  42. package/generated/docs/{components-radiogroup-docs.md → components_components-radiogroup-docs.md} +927 -75
  43. package/generated/docs/components_components-readonly-docs.md +263 -0
  44. package/generated/docs/components_components-richselect-docs.md +6521 -0
  45. package/generated/docs/{components-row-docs.md → components_components-row-docs.md} +353 -43
  46. package/generated/docs/{components-select-docs.md → components_components-select-docs.md} +719 -61
  47. package/generated/docs/components_components-skeleton-docs.md +480 -0
  48. package/generated/docs/{components-skeleton-recipes-docs.md → components_components-skeleton-recipes-docs.md} +51 -11
  49. package/generated/docs/{components-skiplink-docs.md → components_components-skiplink-docs.md} +53 -14
  50. package/generated/docs/components_components-slideout-docs.md +2293 -0
  51. package/generated/docs/components_components-slider-docs.md +1276 -0
  52. package/generated/docs/components_components-spinner-docs.md +82 -0
  53. package/generated/docs/{components-stack-docs.md → components_components-stack-docs.md} +223 -40
  54. package/generated/docs/components_components-table-docs.md +3658 -0
  55. package/generated/docs/components_components-tabset-docs.md +772 -0
  56. package/generated/docs/components_components-tabset-tab-docs.md +262 -0
  57. package/generated/docs/components_components-tag-docs.md +257 -0
  58. package/generated/docs/{components-text-docs.md → components_components-text-docs.md} +491 -51
  59. package/generated/docs/{components-toaster-docs.md → components_components-toaster-docs.md} +187 -85
  60. package/generated/docs/components_components-toaster-toast-docs.md +634 -0
  61. package/generated/docs/components_components-toggle-docs.md +461 -0
  62. package/generated/docs/{components-tooltip-docs.md → components_components-tooltip-docs.md} +286 -41
  63. package/generated/docs/{components-validationmessage-docs.md → components_components-validationmessage-docs.md} +230 -61
  64. package/generated/docs/components_contact-us-docs.md +12 -0
  65. package/generated/docs/{foundations-accessibility-docs.md → components_foundations-accessibility-docs.md} +11 -21
  66. package/generated/docs/{foundations-colours-docs.md → components_foundations-colour-030-colours.md} +8 -15
  67. package/generated/docs/{foundations-consistency-docs.md → components_foundations-consistency-docs.md} +12 -20
  68. package/generated/docs/{foundations-content-docs.md → components_foundations-content-docs.md} +6 -11
  69. package/generated/docs/components_foundations-introduction-docs.md +15 -0
  70. package/generated/docs/{foundations-principles-docs.md → components_foundations-principles-docs.md} +14 -24
  71. package/generated/docs/components_foundations-typography-docs.md +608 -0
  72. package/generated/docs/{foundations-user-experience-docs.md → components_foundations-user-experience-docs.md} +16 -26
  73. package/generated/docs/{foundations-visual-design-docs.md → components_foundations-visual-design-docs.md} +10 -17
  74. package/generated/docs/{frequently-asked-questions-docs.md → components_frequently-asked-questions-docs.md} +14 -23
  75. package/generated/docs/components_get-started-develop-docs.md +84 -0
  76. package/generated/docs/components_get-started-using-storybook-docs.md +55 -0
  77. package/generated/docs/components_introduction-docs.md +15 -0
  78. package/generated/docs/{patterns-loading-docs.md → components_patterns-loading-docs.md} +798 -153
  79. package/generated/docs/components_resources-changelog-docs.md +4 -0
  80. package/generated/docs/{resources-code-katas-docs.md → components_resources-code-katas-docs.md} +5 -9
  81. package/generated/docs/{resources-migration-guides-from-v4-to-v5-docs.md → components_resources-migration-guides-from-v4-to-v5-docs.md} +54 -239
  82. package/generated/docs/components_sandbox-docs.md +4 -0
  83. package/generated/docs/{versions-docs.md → components_versions-docs.md} +5 -8
  84. package/generated/docs/guidelines.md +484 -200
  85. package/generated/docs/introduction-docs.md +19 -30
  86. package/package.json +41 -45
  87. package/generated/docs/components-alert-docs.md +0 -130
  88. package/generated/docs/components-autocomplete-docs.md +0 -754
  89. package/generated/docs/components-button-docs.md +0 -362
  90. package/generated/docs/components-button-recipes-docs.md +0 -76
  91. package/generated/docs/components-buttongroup-docs.md +0 -310
  92. package/generated/docs/components-card-docs.md +0 -494
  93. package/generated/docs/components-checkbox-docs.md +0 -193
  94. package/generated/docs/components-combobox-docs.md +0 -1016
  95. package/generated/docs/components-field-docs.md +0 -675
  96. package/generated/docs/components-filter-docs.md +0 -1109
  97. package/generated/docs/components-icon-docs.md +0 -553
  98. package/generated/docs/components-input-docs.md +0 -335
  99. package/generated/docs/components-input-recipes-docs.md +0 -140
  100. package/generated/docs/components-inputcurrency-docs.md +0 -157
  101. package/generated/docs/components-label-docs.md +0 -135
  102. package/generated/docs/components-menu-docs.md +0 -704
  103. package/generated/docs/components-menu-menuitem-docs.md +0 -193
  104. package/generated/docs/components-navbar-docs.md +0 -291
  105. package/generated/docs/components-placeholder-docs.md +0 -27
  106. package/generated/docs/components-popover-docs.md +0 -464
  107. package/generated/docs/components-popover-recipes-docs.md +0 -245
  108. package/generated/docs/components-progress-docs.md +0 -104
  109. package/generated/docs/components-radio-docs.md +0 -107
  110. package/generated/docs/components-readonly-docs.md +0 -89
  111. package/generated/docs/components-richselect-docs.md +0 -2433
  112. package/generated/docs/components-skeleton-docs.md +0 -214
  113. package/generated/docs/components-slideout-docs.md +0 -538
  114. package/generated/docs/components-slider-docs.md +0 -346
  115. package/generated/docs/components-spinner-docs.md +0 -59
  116. package/generated/docs/components-table-ag-grid-docs.md +0 -1074
  117. package/generated/docs/components-table-docs.md +0 -1305
  118. package/generated/docs/components-tabset-docs.md +0 -341
  119. package/generated/docs/components-tabset-tab-docs.md +0 -86
  120. package/generated/docs/components-tag-docs.md +0 -115
  121. package/generated/docs/components-toaster-toast-docs.md +0 -157
  122. package/generated/docs/components-toggle-docs.md +0 -158
  123. package/generated/docs/contact-us-docs.md +0 -27
  124. package/generated/docs/extensions-editor-docs.md +0 -288
  125. package/generated/docs/extensions-editor-recipes-docs.md +0 -39
  126. package/generated/docs/foundations-introduction-docs.md +0 -17
  127. package/generated/docs/foundations-typography-docs.md +0 -191
  128. package/generated/docs/get-started-develop-docs.md +0 -209
  129. package/generated/docs/get-started-using-storybook-docs.md +0 -68
  130. package/generated/docs/resources-changelog-docs.md +0 -6
  131. package/generated/docs/themes-available-themes-docs.md +0 -66
  132. package/generated/docs/themes-introduction-docs.md +0 -121
  133. package/generated/docs/themes-tokens-docs.md +0 -1200
  134. /package/{LICENSE.txt → LICENSE} +0 -0
@@ -1,5 +1,5 @@
1
- [](#loading)Loading
2
- ===================
1
+ Loading
2
+ =======
3
3
 
4
4
  Overview
5
5
  --------
@@ -10,14 +10,27 @@ The loading pattern is used to indicate that content is being loaded or processe
10
10
 
11
11
  Beta
12
12
 
13
- New component
13
+ **New component**
14
14
 
15
- This component is new, please provide feedback to the IDS team if you encounter any issues.
15
+ This component is new, please provide feedback to the Frontend Enablement team if you encounter any issues.
16
16
 
17
- Hide codeRefresh
17
+ [](./iframe.html?id=patterns-loading--wizard)
18
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; }
19
+ Hide codedrawOpen in CodeSandboxRefresh
20
20
 
21
+ import {
22
+ IressButton,
23
+ IressContainer,
24
+ IressForm,
25
+ IressFormField,
26
+ IressInputCurrency,
27
+ IressLoading,
28
+ IressPanel,
29
+ IressStack,
30
+ IressText,
31
+ } from '@/main';
32
+ import { useDeferredValue, useEffect, useState } from 'react';
33
+ import retirementGraph from './retirement-graph.png';
21
34
  interface PageProps {
22
35
  setPage: (page: number) \=> void;
23
36
  }
@@ -163,10 +176,13 @@ export const LoadingWizard \= () \=> {
163
176
  );
164
177
  };
165
178
 
166
- Copy
179
+ ```
167
180
 
168
- [](#usage)Usage
169
- ---------------
181
+ Props
182
+ -----
183
+
184
+ Usage
185
+ -----
170
186
 
171
187
  The main prop for the `IressLoading` component is the `pattern` prop. This prop determines the type of loading pattern to be used. The available options are:
172
188
 
@@ -194,19 +210,19 @@ The main prop for the `IressLoading` component is the `pattern` prop. This prop
194
210
 
195
211
  It is **recommended** to read the Patterns section of the documentation to understand how to use the loading patterns effectively.
196
212
 
197
- ### [](#be-consistent)Be consistent
213
+ ### Be consistent
198
214
 
199
215
  Apart from using the `IressLoading` component, there are a few things you need to do to ensure you are using the loading patterns correctly to ensure consistency across Iress products.
200
216
 
201
217
  * Consider the difference between what the system is doing and what the user is doing. For example, when a user is submitting a form, the system may be calling different APIs and you may be tempted to use the different loading patterns for each API. However, the user is only submitting the form once, so you should only use one loading pattern for the entire form submission process. In most cases, it will be the `page` loading pattern.
202
218
  * When switch between different applications, consider using the same loading pattern. This will help mask the loading time and improve the user experience.
203
219
 
204
- [](#behaviour)Behaviour
205
- -----------------------
220
+ Behaviour
221
+ ---------
206
222
 
207
223
  The `IressLoading` component is designed to create a seamless experience for users when loading content. They have been designed to meet best practices and improve user perception of loading times.
208
224
 
209
- ![Wait times less than 1 second, no loading indicator. Short wait times (1-3 seconds), use a loading indicator. Long wait times (3-10 seconds), use a loading indicator and provide feedback. Wait times longer than 10 seconds should be a background process.](/@fs/app/packages/components/src/patterns/Loading/assets/ux-collective-loading-time-matrix.webp)
225
+ ![Wait times less than 1 second, no loading indicator. Short wait times (1-3 seconds), use a loading indicator. Long wait times (3-10 seconds), use a loading indicator and provide feedback. Wait times longer than 10 seconds should be a background process.](/src/patterns/Loading/assets/ux-collective-loading-time-matrix.webp)
210
226
 
211
227
  Image © [UX Collective](https://uxdesign.cc/loading-progress-indicators-ui-components-series-f4b1fc35339a)
212
228
 
@@ -228,21 +244,21 @@ In future releases, we will be adding support for the following:
228
244
 
229
245
  The `IressLoading` patterns have been built using `IressSkeleton`, `IressSpinner` and `IressProgressBar` and other components, reducing the need to create custom loading components.
230
246
 
231
- [](#patterns)Patterns
232
- ---------------------
247
+ Patterns
248
+ --------
233
249
 
234
- ### [](#component)`component`
250
+ ### `component`
235
251
 
236
252
  The `component` loading pattern is used to indicate that a specific component is loading. It is typically used when the there is a slower component on the page that requires its own loading state. You would usually use this pattern when loading data visualisations such as charts and tables.
237
253
 
238
- #### [](#behavior)Behavior
254
+ #### Behavior
239
255
 
240
256
  1. When `loaded` is false, a skeleton will be displayed immediately (configured using `timeout.skeleton`). This skeleton can be customised using the `template` prop.
241
257
  2. When `loaded` is true, the skeleton will be removed and the `children` will be displayed.
242
258
  3. When `updated` is true, the `children` will be faded out to indicate the component is loading.
243
259
  4. After 1000ms (configured using `timeout.update`), the `Updating...` message will be fade in. This message can be customised using the `updated` prop.
244
260
 
245
- #### [](#custom-skeletons)Custom skeletons
261
+ #### Custom skeletons
246
262
 
247
263
  The skeleton representing the component should be as simple as possible, it does not need to be a perfect representation of the component. In most cases a simple rectangle is sufficient that takes up the approximate same space as the component that is loading.
248
264
 
@@ -250,18 +266,21 @@ The skeleton representing the component should be as simple as possible, it does
250
266
 
251
267
  Beta
252
268
 
253
- New component
269
+ **New component**
254
270
 
255
- This component is new, please provide feedback to the IDS team if you encounter any issues.
271
+ This component is new, please provide feedback to the Frontend Enablement team if you encounter any issues.
256
272
 
257
- ![](/@fs/app/packages/components/src/patterns/Loading/mocks/retirement-graph.png)
273
+ [](./iframe.html?id=patterns-loading-patterns-component--component)
258
274
 
259
- Update
275
+ ![](/src/patterns/Loading/mocks/retirement-graph.png)
260
276
 
261
- Hide codeRefresh
277
+ Update
262
278
 
263
- \[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; }
279
+ Hide codedrawOpen in CodeSandboxRefresh
264
280
 
281
+ import { IressButton, IressLoading, IressStack } from '@/main';
282
+ import { useCallback, useEffect, useState } from 'react';
283
+ import retirementGraph from './retirement-graph.png';
265
284
  const API \= {
266
285
  chart: async () \=>
267
286
  new Promise<boolean\>((resolve) \=> {
@@ -320,15 +339,91 @@ export const LoadingGraph \= () \=> {
320
339
  );
321
340
  };
322
341
 
323
- Copy
342
+ ```
343
+
344
+ #### Props
345
+
346
+ | Name | Description | Default | Control |
347
+ | --- | --- | --- | --- |
348
+ | children\* |
349
+ The chart that is being loaded for the first time or being refreshed/updated.
350
+
351
+ ReactNode
352
+
353
+
354
+
355
+ | \- | \- |
356
+ | loaded |
357
+
358
+ If set to `true`, will hide the skeleton and display the chart.
359
+
360
+ boolean
361
+
362
+
363
+
364
+ | \- | \- |
365
+ | pattern |
366
+
367
+ Use `pattern="component"` for the following use cases:
368
+
369
+ * Component that is expected to be slow to load, such as a chart, table or large graphic.
370
+ * Component that can be refreshed/updated with new data.
371
+
372
+ literal
373
+
374
+
375
+
376
+ | \- | \- |
377
+ | screenReaderText |
378
+
379
+ Only screen readers will see this message, it is changed to the `message` after the delay.
380
+
381
+ ReactNode
382
+
383
+
384
+
385
+ |
386
+
387
+ 'Loading...'
388
+
389
+ | \- |
390
+ | template |
391
+
392
+ Which template to use as the skeleton, or you can use a ReactNode to customise the skeleton completely.
393
+
394
+ union
395
+
396
+
397
+
398
+ |
399
+
400
+ 'chart'
401
+
402
+ | \- |
403
+ | timeout |
404
+
405
+ Set the timeouts for showing the skeleton and update messages.
406
+
407
+ { /\*\* \* The time in milliseconds before the skeleton is displayed. \* @default 0 \*/ skeleton?: number; /\*\* \* The time in milliseconds before the update message is displayed. \* @default 1000 \*/ update?: number; }
408
+
409
+ | \- | \- |
410
+ | update |
411
+
412
+ Set the chart to be updated. If a `ReactNode` is provided, it will be displayed as the message. If set to `true`, will display the default message `Updating...`.
413
+
414
+ ReactNode
415
+
416
+
417
+
418
+ | \- | \- |
324
419
 
325
- ### [](#default)`default`
420
+ ### `default`
326
421
 
327
422
  The `default` loading pattern is used when no other pattern matches a scenario, and will only indicate loading if something is taking a long time to load. It is used when long loading times are not expected.
328
423
 
329
424
  This pattern is used when the user is navigating between different pages or sections of the application.
330
425
 
331
- #### [](#behavior-1)Behavior
426
+ #### Behavior
332
427
 
333
428
  1. Displays nothing by default
334
429
 
@@ -339,27 +434,86 @@ This pattern is used when the user is navigating between different pages or sect
339
434
 
340
435
  Beta
341
436
 
342
- New component
437
+ **New component**
343
438
 
344
- This component is new, please provide feedback to the IDS team if you encounter any issues.
439
+ This component is new, please provide feedback to the Frontend Enablement team if you encounter any issues.
345
440
 
346
- This is taking longer than expected...
441
+ [](./iframe.html?id=patterns-loading-patterns-default--default)
347
442
 
348
- Hide codeRefresh
443
+ This is taking longer than expected...
349
444
 
350
- \[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; }
445
+ Hide codedrawOpen in CodeSandboxRefresh
351
446
 
352
447
  <IressLoading pattern\="default" />
353
448
 
354
- Copy
449
+ ```
450
+
451
+ #### Props
452
+
453
+ | Name | Description | Default | Control |
454
+ | --- | --- | --- | --- |
455
+ | children |
456
+ Message to display when the loading time is longer than expected.
457
+
458
+ ReactNode
459
+
460
+
461
+
462
+ |
463
+
464
+ <IressInline />
465
+
466
+ | Set object |
467
+ | pattern |
468
+
469
+ Do not set the `pattern` prop when no other pattern can be applied. It will only show the loading message after a delay, and is intended for use when loading is not expected to take a long time. Example use cases:
470
+
471
+ * Navigating between different routes
472
+ * Calling an API within the page that does not require a loading state
473
+
474
+ literal
475
+
476
+
477
+
478
+ | \- |
479
+
480
+ "default"
481
+
482
+ |
483
+ | screenReaderText |
484
+
485
+ Only screen readers will see this message, it is changed to the `children` message after the delay.
486
+
487
+ ReactNode
488
+
489
+
355
490
 
356
- ### [](#long)`long`
491
+ |
492
+
493
+ 'Loading...'
494
+
495
+ | Set object |
496
+ | timeout |
497
+
498
+ Delay in milliseconds before the message is displayed.
499
+
500
+ number
501
+
502
+
503
+
504
+ |
505
+
506
+ 3000
507
+
508
+ | Set number |
509
+
510
+ ### `long`
357
511
 
358
512
  The `long` loading pattern is used to indicate an expected long loading time, usually longer than 10 seconds to complete. It is typically used when calling multiple third-party APIs, AI generation and other long running tasks.
359
513
 
360
514
  It has a required prop, `messageList`, which is an object map where the key is the time you want the message to be marked as completed and the value is the message to display. The messages will be completed (checked off) as the time elapses.
361
515
 
362
- #### [](#behavior-2)Behavior
516
+ #### Behavior
363
517
 
364
518
  1. When `loaded` is false, a progress bar and check list will be displayed after 500ms (configured using `timeout.message`). This progress bar can be customised using the `renderProgress` prop.
365
519
  2. The messages will rotate until the `loaded` prop is set to true.
@@ -368,7 +522,7 @@ It has a required prop, `messageList`, which is an object map where the key is t
368
522
  3. When `loaded` is true, all items in the checklist are completed and the progress bar and message will begin fading out. To see the fade out, you will need to use the `IressLoading.shouldRender` hook.
369
523
  4. When `error` is true, the error message will be displayed, overriding the progress bar and checklist. This message can be customised using the `error` prop. The error message will be displayed with a red background.
370
524
 
371
- #### [](#adjusting-the-progress-bar)Adjusting the progress bar
525
+ #### Adjusting the progress bar
372
526
 
373
527
  The `long` loading pattern uses a progress bar to indicate that the application is loading alongside an `estimatedFinishTime` prop. This prop is used to indicate the estimated time until the application is fully loaded, and is used to help the user understand how long they will need to wait and assure them something is happening. The progress bar will animate based on the estimated time.
374
528
 
@@ -380,17 +534,17 @@ Once the `loaded` prop is set to true, the progress bar will always be set to 10
380
534
 
381
535
  Beta
382
536
 
383
- New component
537
+ **New component**
538
+
539
+ This component is new, please provide feedback to the Frontend Enablement team if you encounter any issues.
384
540
 
385
- This component is new, please provide feedback to the IDS team if you encounter any issues.
541
+ [](./iframe.html?id=patterns-loading-patterns-long--long)
386
542
 
387
543
  * Finished: Processing transcript
388
544
  * Finished: Noting key information
389
545
  * Finished: Generating summary...
390
546
 
391
- Hide codeRefresh
392
-
393
- \[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; }
547
+ Hide codedrawOpen in CodeSandboxRefresh
394
548
 
395
549
  <IressLoading
396
550
  messageList\={{
@@ -401,19 +555,130 @@ Hide codeRefresh
401
555
  pattern\="long"
402
556
  />
403
557
 
404
- Copy
558
+ ```
559
+
560
+ #### Props
561
+
562
+ | Name | Description | Default | Control |
563
+ | --- | --- | --- | --- |
564
+ | children |
565
+ The children are displayed while loading. This will be displayed above the progress bar and checklist.
566
+
567
+ ReactNode
568
+
569
+
570
+
571
+ | \- | Set object |
572
+ | error |
573
+
574
+ An error to display if the loading fails. This will override the `messageList` and show an error message instead.
575
+
576
+ ReactNode
577
+
405
578
 
406
- ### [](#page)`page`
579
+
580
+ | \- | Set object |
581
+ | estimatedFinishTime |
582
+
583
+ Estimated time in milliseconds for the loading to finish.
584
+
585
+ number
586
+
587
+
588
+
589
+ |
590
+
591
+ 10000
592
+
593
+ | Set number |
594
+ | loaded |
595
+
596
+ If set to `true`, will start hiding the loading indicator. It is recommended to use this prop if you are using the `IressLoading.shouldRender` hook to achieve a smooth loading experience.
597
+
598
+ boolean
599
+
600
+
601
+
602
+ | \- | Set boolean |
603
+ | messageList |
604
+
605
+ A checklist to display while loading. The key is the time when you want the item to be checked.
606
+
607
+ Record<number, ReactNode>
608
+
609
+ | { } |
610
+
611
+ Edit JSON
612
+
613
+ messageList :
614
+
615
+ {
616
+
617
+ * 3000 : "Processing transcript"
618
+ * 5000 : "Noting key information"
619
+ * 7000 : "Generating summary"
620
+
621
+ }
622
+
623
+
624
+
625
+
626
+
627
+
628
+
629
+ |
630
+ | pattern |
631
+
632
+ The long loading pattern will display a checklist of items that are being loaded.
633
+
634
+ Use `pattern="long"` for the following use cases:
635
+
636
+ * Calling multiple slow APIs to load data
637
+ * Loading results from AI
638
+ * Processing a large amount of data as a queue (eg. bulk uploading or large media file uploads)
639
+
640
+ literal
641
+
642
+
643
+
644
+ | \- |
645
+
646
+ "long"
647
+
648
+ |
649
+ | progress |
650
+
651
+ If provided, will use this to set the `value` of the progress bar. If not provided, will use the `estimatedFinishTime` to calculate the progress.
652
+
653
+ IressProgressProps\['value'\]
654
+
655
+ | \- | Set object |
656
+ | renderProgress |
657
+
658
+ This is a render prop that allows you to override the default progress rendering. This is useful if you want to use a different progress component or if you want to add additional props to the progress bar.
659
+
660
+ ( props: Pick< IressProgressProps, 'className' | 'min' | 'max' | 'sectionTitle' | 'value' >, ) => ReactNode
661
+
662
+ | (props) => <IressProgress {...props} /> | \- |
663
+ | timeout |
664
+
665
+ Set the timeouts for showing the progress bar and message.
666
+
667
+ { /\*\* \* The time in milliseconds before this component begins to fade out (if \`loaded\` is set to \`true\`). \* @default 1300 \*/ loaded?: number; /\*\* \* The time in milliseconds before the checklist is displayed. \* @default 500 \*/ message?: number; }
668
+
669
+ | \- | Set object |
670
+
671
+ ### `page`
407
672
 
408
673
  The `page` loading pattern is used to indicate that a page is loading. It is the most common loading pattern, allowing the users to see the entire content at once where possible.
409
674
 
410
- #### [](#behavior-3)Behavior
675
+ #### Behavior
411
676
 
412
677
  1. When `loaded` is false, a skeleton will be displayed after 500ms (configured using `timeout`). This skeleton can be customised using the `template` prop.
413
678
  2. If `critical` is set whilst `loaded` is false, the critical content will be displayed immediately. This is useful for showing critical content while the rest of the page is loading.
414
679
  3. When `loaded` is true, the skeleton will begin fading out. To see the fade out, you will need to use the `IressLoading.shouldRender` hook.
415
680
 
416
- #### [](#custom-skeletons-1)Custom skeletons
681
+ #### Custom skeletons
417
682
 
418
683
  The skeleton does not need to be a perfect representation of the page. It is recommended to follow the guidelines below when creating custom `template` skeletons:
419
684
 
@@ -423,7 +688,7 @@ The skeleton does not need to be a perfect representation of the page. It is rec
423
688
 
424
689
  For your convenience, we have provided a few templates that you can use in the `template` prop, including: `page`, `form` and `dashboard`.
425
690
 
426
- #### [](#critical-content)Critical content
691
+ #### Critical content
427
692
 
428
693
  In some cases it may be useful to show critical content while the rest of the page is loading. This gives the user a preview of what to expect. The example below shows a loading page with critical content by using the `critical` prop.
429
694
 
@@ -431,9 +696,11 @@ In some cases it may be useful to show critical content while the rest of the pa
431
696
 
432
697
  Beta
433
698
 
434
- New component
699
+ **New component**
700
+
701
+ This component is new, please provide feedback to the Frontend Enablement team if you encounter any issues.
435
702
 
436
- This component is new, please provide feedback to the IDS team if you encounter any issues.
703
+ [](./iframe.html?id=patterns-loading-patterns-page--page)
437
704
 
438
705
  Dashboard
439
706
  =========
@@ -448,10 +715,21 @@ Dashboard
448
715
 
449
716
  Loading...
450
717
 
451
- Hide codeRefresh
452
-
453
- \[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; }
454
-
718
+ Hide codedrawOpen in CodeSandboxRefresh
719
+
720
+ import {
721
+ IressCard,
722
+ IressCol,
723
+ IressContainer,
724
+ IressDivider,
725
+ IressInline,
726
+ IressLoading,
727
+ IressRow,
728
+ IressSkeleton,
729
+ IressStack,
730
+ IressText,
731
+ } from '@/main';
732
+ import { type ReactNode, useEffect, useState } from 'react';
455
733
  const API \= {
456
734
  criticalContent: async () \=>
457
735
  new Promise<ReactNode\>((resolve) \=> {
@@ -517,20 +795,94 @@ export const LoadingDashboard \= () \=> {
517
795
  );
518
796
  };
519
797
 
520
- Copy
798
+ ```
799
+
800
+ #### Props
801
+
802
+ | Name | Description | Default | Control |
803
+ | --- | --- | --- | --- |
804
+ | critical |
805
+ If provided, will switch the skeleton to this template. Use when you have critical content that can be displayed while loading to allow the user to see some content while the rest is loading.
806
+
807
+ ReactNode
808
+
809
+
810
+
811
+ | \- | \- |
812
+ | loaded |
813
+
814
+ If set to `true`, will start hiding the loading indicator. It is recommended to use this prop if you are using the `IressLoading.shouldRender` hook to achieve a smooth loading experience.
815
+
816
+ boolean
817
+
818
+
819
+
820
+ | \- | \- |
821
+ | pattern |
822
+
823
+ Use `pattern="page"` for the following use cases:
824
+
825
+ * Detail page for a record
826
+ * Form page
827
+ * Article page
828
+
829
+ literal
830
+
831
+
832
+
833
+ | \- | \- |
834
+ | screenReaderText |
835
+
836
+ Only screen readers will see this message.
837
+
838
+ ReactNode
839
+
840
+
841
+
842
+ |
843
+
844
+ 'Loading...'
845
+
846
+ | \- |
847
+ | template |
848
+
849
+ Which template to use as the skeleton, or you can use a ReactNode to customise the skeleton completely.
850
+
851
+ union
852
+
853
+
854
+
855
+ |
856
+
857
+ 'page'
858
+
859
+ | \- |
860
+ | timeout |
861
+
862
+ Delay in milliseconds before the skeleton is displayed.
863
+
864
+ number
865
+
521
866
 
522
- ### [](#start-up)`start-up`
867
+
868
+ |
869
+
870
+ 500
871
+
872
+ | \- |
873
+
874
+ ### `start-up`
523
875
 
524
876
  The `start-up` loading pattern is used to indicate that the application is loading. It is typically used when the application is first launched. This pattern is used when the application is first launched or when switching from a different application to a new application. It is also used when switching from a client's website to an Iress application or switching themes.
525
877
 
526
- #### [](#behavior-4)Behavior
878
+ #### Behavior
527
879
 
528
880
  1. When `loaded` is false, a progress bar will be displayed after 500ms (configured using `timeout.progress`). This progress bar can be customised using the `renderProgress` prop.
529
881
  2. When `loaded` is false after 2.5 seconds (configured using `timeout.message`), the message will be displayed. This message can be customised using the `children` or `messageList` prop.
530
882
  3. If using `messageList`, the messages will rotate until the `loaded` prop is set to true.
531
883
  4. When `loaded` is true, the progress bar and message will begin fading out. To see the fade out, you will need to use the `IressLoading.shouldRender` hook.
532
884
 
533
- #### [](#adjusting-the-progress-bar-1)Adjusting the progress bar
885
+ #### Adjusting the progress bar
534
886
 
535
887
  The `start-up` loading pattern uses a progress bar to indicate that the application is loading alongside an `estimatedFinishTime` prop. This prop is used to indicate the estimated time until the application is fully loaded, and is used to help the user understand how long they will need to wait and assure them something is happening. The progress bar will animate based on the estimated time.
536
888
 
@@ -538,7 +890,7 @@ If your application is capable of calculating real progress, you can pass the `p
538
890
 
539
891
  Once the `loaded` prop is set to true, the progress bar will always be set to 100% and the loading pattern will fade out.
540
892
 
541
- #### [](#rotating-messages)Rotating messages
893
+ #### Rotating messages
542
894
 
543
895
  The start-up process is often used initialise the application and load any necessary data. This can include loading user preferences, settings, and any other data that is required to make using the application quicker and easier, however this may add burden to the loading time.
544
896
 
@@ -548,13 +900,13 @@ To compensate for this, you can pass multiple messages to the pattern using the
548
900
 
549
901
  Beta
550
902
 
551
- New component
903
+ **New component**
552
904
 
553
- This component is new, please provide feedback to the IDS team if you encounter any issues.
905
+ This component is new, please provide feedback to the Frontend Enablement team if you encounter any issues.
554
906
 
555
- Hide codeRefresh
907
+ [](./iframe.html?id=patterns-loading-patterns-startup--start-up)
556
908
 
557
- \[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; }
909
+ Hide codedrawOpen in CodeSandboxRefresh
558
910
 
559
911
  <IressLoading
560
912
  messageList\={{
@@ -564,19 +916,142 @@ Hide codeRefresh
564
916
  pattern\="start-up"
565
917
  />
566
918
 
567
- Copy
919
+ ```
920
+
921
+ #### Props
922
+
923
+ | Name | Description | Default | Control |
924
+ | --- | --- | --- | --- |
925
+ | children |
926
+ Message to display when the loading time is longer than expected.
927
+
928
+ ReactNode
929
+
930
+
931
+
932
+ |
933
+
934
+ <IressText />
935
+
936
+ | Set object |
937
+ | estimatedFinishTime |
938
+
939
+ Estimated time in milliseconds for the loading to finish.
940
+
941
+ number
942
+
943
+
944
+
945
+ |
946
+
947
+ 3000
948
+
949
+ | Set number |
950
+ | loaded |
951
+
952
+ If set to `true`, will start hiding the loading indicator. It is recommended to use this prop if you are using the `IressLoading.shouldRender` hook to achieve a smooth loading experience.
953
+
954
+ boolean
955
+
956
+
957
+
958
+ | \- | Set boolean |
959
+ | messageList |
960
+
961
+ A message list to display while loading. The key is the time when you want the message to change to this message. If using a message list, the `children` will not be displayed.
962
+
963
+ Record<number, ReactNode>
964
+
965
+ | \- |
966
+
967
+ Edit JSON
968
+
969
+ messageList :
970
+
971
+ {
972
+
973
+ * 0 :
974
+
975
+ {...} 6 keys
976
+
977
+ * 4500 :
978
+
979
+ {...} 6 keys
980
+
981
+
982
+ }
983
+
984
+
985
+
986
+
987
+
988
+
568
989
 
569
- ### [](#validate)`validate`
990
+ |
991
+ | pattern |
992
+
993
+ Use `pattern="start-up"` for the following use cases:
994
+
995
+ * Loading an application for the first time
996
+ * Switching from a different application to a new application
997
+ * Switching from a client's website to an Iress application
998
+ * Switching themes
999
+
1000
+ literal
1001
+
1002
+
1003
+
1004
+ | \- |
1005
+
1006
+ "start-up"
1007
+
1008
+ |
1009
+ | progress |
1010
+
1011
+ If provided, will use this to set the `value` of the progress bar. If not provided, will use the `estimatedFinishTime` to calculate the progress.
1012
+
1013
+ IressProgressProps\['value'\]
1014
+
1015
+ | \- | Set object |
1016
+ | renderProgress |
1017
+
1018
+ This is a render prop that allows you to override the default progress rendering. This is useful if you want to use a different progress component or if you want to add additional props to the progress bar.
1019
+
1020
+ ( props: Pick< IressProgressProps, 'className' | 'min' | 'max' | 'sectionTitle' | 'value' >, ) => ReactNode
1021
+
1022
+ | (props) => <IressProgress {...props} /> | \- |
1023
+ | screenReaderText |
1024
+
1025
+ Only screen readers will see this message, it is changed to the `children` message after the delay.
1026
+
1027
+ ReactNode
1028
+
1029
+
1030
+
1031
+ |
1032
+
1033
+ 'Loading...'
1034
+
1035
+ | Set object |
1036
+ | timeout |
1037
+
1038
+ Set the timeouts for showing the progress bar and message.
1039
+
1040
+ { /\*\* \* The time in milliseconds before this component begins to fade out (if \`loaded\` is set to \`true\`). \* @default 200 \*/ loaded?: number; /\*\* \* The time in milliseconds before the message message is displayed. \* @default 2500 \*/ message?: number; /\*\* \* The time in milliseconds before the progress bar is displayed. \* @default 500 \*/ progress?: number; }
1041
+
1042
+ | \- | Set object |
1043
+
1044
+ ### `validate`
570
1045
 
571
1046
  The `validate` loading pattern is used to indicate that a server-side validation is in progress. It is typically used when the user is submitting a form or performing an action that requires validation and the user is not expected to leave the page.
572
1047
 
573
- #### [](#behavior-5)Behavior
1048
+ #### Behavior
574
1049
 
575
1050
  1. When `loading` is false, the button will be displayed immediately (customised using the `renderButton` prop, or the `children` prop if you do not mind passing in the `loading` prop twice).
576
1051
  2. When `loading` is true, the button will be disabled and a spinner will be displayed.
577
1052
  3. When `loading` is true after 2.5 seconds (configured using `timeout`), the message will be displayed. This message can be customised using the `message` prop. Its placement can be adjusted using the `position` prop.
578
1053
 
579
- #### [](#message-position)Message position
1054
+ #### Message position
580
1055
 
581
1056
  Forms come in all shapes and sizes, and the `IressLoading` component is designed to be flexible enough to work with any form. The `position` prop allows you to adjust the placement of the loading message. The available options are:
582
1057
 
@@ -588,27 +1063,120 @@ Forms come in all shapes and sizes, and the `IressLoading` component is designed
588
1063
 
589
1064
  Beta
590
1065
 
591
- New component
1066
+ **New component**
592
1067
 
593
- This component is new, please provide feedback to the IDS team if you encounter any issues.
1068
+ This component is new, please provide feedback to the Frontend Enablement team if you encounter any issues.
1069
+
1070
+ [](./iframe.html?id=patterns-loading-patterns-validate--validate)
594
1071
 
595
1072
  Submit
596
1073
 
597
1074
  This is taking longer than expected...
598
1075
 
599
- Hide codeRefresh
600
-
601
- \[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; }
1076
+ Hide codedrawOpen in CodeSandboxRefresh
602
1077
 
603
1078
  <IressLoading
604
1079
  loading
605
1080
  pattern\="validate"
606
1081
  />
607
1082
 
608
- Copy
1083
+ ```
1084
+
1085
+ #### Props
1086
+
1087
+ | Name | Description | Default | Control |
1088
+ | --- | --- | --- | --- |
1089
+ | loading |
1090
+ When true, button is in loading state. If provided a string, will be used as the loading text for screen readers.
1091
+
1092
+ IressButtonProps\['loading'\]
1093
+
1094
+ |
1095
+
1096
+ false
1097
+
1098
+ |
1099
+
1100
+ true
1101
+
1102
+ |
1103
+ | message |
1104
+
1105
+ Set the message to be displayed when the button is in the loading state.
1106
+
1107
+ ReactNode
1108
+
1109
+
1110
+
1111
+ |
1112
+
1113
+ 'This is taking longer than expected...'
1114
+
1115
+ | Set object |
1116
+ | pattern |
1117
+
1118
+ Use `pattern="validate"` for the following use cases:
609
1119
 
610
- [](#suspense)Suspense
611
- ---------------------
1120
+ * Submitting a form
1121
+ * Saving a record
1122
+
1123
+ literal
1124
+
1125
+
1126
+
1127
+ |
1128
+
1129
+ 'validate'
1130
+
1131
+ |
1132
+
1133
+ "validate"
1134
+
1135
+ |
1136
+ | position |
1137
+
1138
+ This sets where the loading message will be displayed.
1139
+
1140
+ * `bottom` - The loading message will be displayed below the button. It will be absolute positioned.
1141
+ * `top` - The loading message will be displayed above the button. It will be absolute positioned.
1142
+ * `right` - The loading message will be displayed to the right of the button. It will be inline positioned.
1143
+
1144
+ union
1145
+
1146
+
1147
+
1148
+ |
1149
+
1150
+ 'bottom'
1151
+
1152
+ |
1153
+
1154
+ positionbottomtopright
1155
+
1156
+ |
1157
+ | renderButton |
1158
+
1159
+ This is a render prop that allows you to override the default button rendering. This is useful if you want to use a different button component or if you want to add additional props to the button.
1160
+
1161
+ ( props: Pick<IressButtonProps, 'className' | 'loading'>, ) => ReactNode
1162
+
1163
+ | (props: Pick<IressButtonProps, 'className' | 'loading'>) => ( <IressButton {...props} type="submit"> Submit </IressButton> ) | \- |
1164
+ | timeout |
1165
+
1166
+ The time in milliseconds before the loading message is displayed.
1167
+
1168
+ number
1169
+
1170
+
1171
+
1172
+ |
1173
+
1174
+ 2500
1175
+
1176
+ | Set number |
1177
+
1178
+ Suspense
1179
+ --------
612
1180
 
613
1181
  Since React 18, React has introduced a new way to handle loading states using `Suspense`, allowing you to lazy load components in an efficient manner.
614
1182
 
@@ -621,10 +1189,23 @@ The wizard example can be translated to use `IressLoadingSuspense` as follows (i
621
1189
  * The `IressLoadingSuspense` component will automatically handle the loading state for you, so you do not need to pass the `loaded` prop or use the `IressLoading.shouldRender` hook.
622
1190
  * Nested suspense components will be handled by the highest `IressLoadingSuspense` component. This means that if you have multiple nested `IressLoadingSuspense` components, only the top most one will display a loading state. You can see this in the example when you click the Next button, you no longer see the component loading pattern due to it being nested under the page loading pattern.
623
1191
 
624
- Hide codeRefresh
625
-
626
- \[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; }
627
-
1192
+ [](./iframe.html?id=patterns-loading-suspense--suspense)
1193
+
1194
+ Hide codedrawOpen in CodeSandboxRefresh
1195
+
1196
+ import {
1197
+ IressButton,
1198
+ IressContainer,
1199
+ IressForm,
1200
+ IressFormField,
1201
+ IressInputCurrency,
1202
+ IressPanel,
1203
+ IressStack,
1204
+ IressText,
1205
+ } from '@/main';
1206
+ import { useDeferredValue, useEffect, useState } from 'react';
1207
+ import retirementGraph from './retirement-graph.png';
1208
+ import { IressLoadingSuspense } from '../LoadingSuspense';
628
1209
  interface PageProps {
629
1210
  setPage: (page: number) \=> void;
630
1211
  }
@@ -756,12 +1337,63 @@ export const LoadingSuspenseWizard \= () \=> (
756
1337
  </IressLoadingSuspense\>
757
1338
  );
758
1339
 
759
- Copy
1340
+ ```
1341
+
1342
+ #### Props
1343
+
1344
+ | Name | Description | Default | Control |
1345
+ | --- | --- | --- | --- |
1346
+ | children |
1347
+ The content that will be rendered inside the Suspense boundary. Typically includes lazy-loaded components and components that use the `use` or `IressLoadingSuspense.use` hook.
1348
+
1349
+ ReactNode
1350
+
1351
+
1352
+
1353
+ | \- | \- |
1354
+ | delay |
1355
+
1356
+ Duration (in milliseconds) to delay unmounting the fallback to allow the fade-out animation to complete. By default it uses the default delay of the pattern.
1357
+
1358
+ number
1359
+
1360
+
1361
+
1362
+ | \- | \- |
1363
+ | onLoaded |
760
1364
 
761
- Hide codeRefresh
1365
+ By default it uses the default delay of the pattern.
762
1366
 
763
- \[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; }
1367
+ () => void
764
1368
 
1369
+ | \- | \- |
1370
+ | startFrom |
1371
+
1372
+ Duration (in milliseconds) before showing the loading pattern. Default is 500ms, meaning a user will not even see the loading indicator if the page loads before this time.
1373
+
1374
+ number
1375
+
1376
+
1377
+
1378
+ | \- | \- |
1379
+
1380
+ [](./iframe.html?id=patterns-loading-suspense--fast-suspense)
1381
+
1382
+ Hide codedrawOpen in CodeSandboxRefresh
1383
+
1384
+ import {
1385
+ IressButton,
1386
+ IressContainer,
1387
+ IressForm,
1388
+ IressFormField,
1389
+ IressInputCurrency,
1390
+ IressPanel,
1391
+ IressStack,
1392
+ IressText,
1393
+ } from '@/main';
1394
+ import { useDeferredValue, useEffect, useState } from 'react';
1395
+ import retirementGraph from './retirement-graph.png';
1396
+ import { IressLoadingSuspense } from '../LoadingSuspense';
765
1397
  interface PageProps {
766
1398
  setPage: (page: number) \=> void;
767
1399
  }
@@ -888,43 +1520,64 @@ export const LoadingSuspenseWizardFast \= () \=> (
888
1520
  </IressLoadingSuspense\>
889
1521
  );
890
1522
 
891
- Copy
1523
+ ```
1524
+
1525
+ #### Props
1526
+
1527
+ | Name | Description | Default | Control |
1528
+ | --- | --- | --- | --- |
1529
+ | children |
1530
+ The content that will be rendered inside the Suspense boundary. Typically includes lazy-loaded components and components that use the `use` or `IressLoadingSuspense.use` hook.
1531
+
1532
+ ReactNode
1533
+
1534
+
1535
+
1536
+ | \- | \- |
1537
+ | delay |
1538
+
1539
+ Duration (in milliseconds) to delay unmounting the fallback to allow the fade-out animation to complete. By default it uses the default delay of the pattern.
1540
+
1541
+ number
1542
+
1543
+
1544
+
1545
+ | \- | \- |
1546
+ | onLoaded |
1547
+
1548
+ By default it uses the default delay of the pattern.
1549
+
1550
+ () => void
892
1551
 
893
- [](#hooks)Hooks
894
- ---------------
1552
+ | \- | \- |
1553
+ | startFrom |
895
1554
 
896
- ### [](#iressloadingshouldrender)`IressLoading.shouldRender`
1555
+ Duration (in milliseconds) before showing the loading pattern. Default is 500ms, meaning a user will not even see the loading indicator if the page loads before this time.
1556
+
1557
+ number
1558
+
1559
+
1560
+
1561
+ | \- | \- |
1562
+
1563
+ Hooks
1564
+ -----
1565
+
1566
+ ### `IressLoading.shouldRender`
897
1567
 
898
1568
  The `IressLoading.shouldRender` hook is used to determine whether the loading pattern should be displayed or not. It is used to control the visibility of the loading pattern based on the `loaded` prop.
899
1569
 
900
1570
  Its main function is to delay the un-mounting of the loading pattern when the `loaded` prop is set to true to allow for a fade out animation.
901
1571
 
902
- \[data-radix-scroll-area-viewport\] {
903
- scrollbar-width: none;
904
- -ms-overflow-style: none;
905
- -webkit-overflow-scrolling: touch;
906
- }
907
- \[data-radix-scroll-area-viewport\]::-webkit-scrollbar {
908
- display: none;
909
- }
910
- :where(\[data-radix-scroll-area-viewport\]) {
911
- display: flex;
912
- flex-direction: column;
913
- align-items: stretch;
914
- }
915
- :where(\[data-radix-scroll-area-content\]) {
916
- flex-grow: 1;
917
- }
918
-
919
1572
  const \[loaded, setLoaded\] \= useState(false);
920
1573
  const renderLoading \= IressLoading.shouldRender(loaded);
921
1574
  // Use renderLoading instead of !loaded for the smooth transition.
922
1575
  if (renderLoading) return <IressLoading pattern\="page" loaded\={loaded} />;
923
1576
  else return <IressText\>Content is loaded</IressText\>;
924
1577
 
925
- Copy
1578
+ ```
926
1579
 
927
- ### [](#iressloadingsuspenseuse)`IressLoadingSuspense.use`
1580
+ ### `IressLoadingSuspense.use`
928
1581
 
929
1582
  The `IressLoadingSuspense.use` hook is a polyfill for the React 19 `use` hook, allowing you to have similar functionality in React 18. It is used to handle loading states when using `IressLoadingSuspense`.
930
1583
 
@@ -935,23 +1588,6 @@ Avoid in React 19
935
1588
 
936
1589
  If you are using React 19, it is recommended to use the built-in `use` hook instead of this one. In future releases, this hook will be deprecated and removed from the library.
937
1590
 
938
- \[data-radix-scroll-area-viewport\] {
939
- scrollbar-width: none;
940
- -ms-overflow-style: none;
941
- -webkit-overflow-scrolling: touch;
942
- }
943
- \[data-radix-scroll-area-viewport\]::-webkit-scrollbar {
944
- display: none;
945
- }
946
- :where(\[data-radix-scroll-area-viewport\]) {
947
- display: flex;
948
- flex-direction: column;
949
- align-items: stretch;
950
- }
951
- :where(\[data-radix-scroll-area-content\]) {
952
- flex-grow: 1;
953
- }
954
-
955
1591
  const HomePage \= () \=> {
956
1592
  const pageData \= IressLoadingSuspense.use(API.fetchPage('home'));
957
1593
  return (
@@ -967,21 +1603,34 @@ export const App \= () \=> (
967
1603
  </IressLoadingSuspense\>
968
1604
  );
969
1605
 
970
- Copy
1606
+ ```
971
1607
 
972
- [](#examples)Examples
973
- ---------------------
1608
+ Examples
1609
+ --------
974
1610
 
975
1611
  Below are some examples of how to use the `IressLoading` component in different scenarios.
976
1612
 
977
- ### [](#wizard)Wizard
1613
+ ### Wizard
978
1614
 
979
1615
  Here you can see how a wizard can use the `IressLoading` component at different stages of the application. The first example shows a `slow` wizard, and the second example shows how the same code looks when the requests are fast. The main difference is you see minimal loading inidicators in the second example, improving the perception that the system is fast.
980
1616
 
981
- Hide codeRefresh
982
-
983
- \[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; }
984
-
1617
+ [](./iframe.html?id=patterns-loading--wizard)
1618
+
1619
+ Hide codedrawOpen in CodeSandboxRefresh
1620
+
1621
+ import {
1622
+ IressButton,
1623
+ IressContainer,
1624
+ IressForm,
1625
+ IressFormField,
1626
+ IressInputCurrency,
1627
+ IressLoading,
1628
+ IressPanel,
1629
+ IressStack,
1630
+ IressText,
1631
+ } from '@/main';
1632
+ import { useDeferredValue, useEffect, useState } from 'react';
1633
+ import retirementGraph from './retirement-graph.png';
985
1634
  interface PageProps {
986
1635
  setPage: (page: number) \=> void;
987
1636
  }
@@ -1127,12 +1776,27 @@ export const LoadingWizard \= () \=> {
1127
1776
  );
1128
1777
  };
1129
1778
 
1130
- Copy
1779
+ ```
1131
1780
 
1132
- Hide codeRefresh
1781
+ #### Props
1133
1782
 
1134
- \[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; }
1783
+ [](./iframe.html?id=patterns-loading--fast-wizard)
1135
1784
 
1785
+ Hide codedrawOpen in CodeSandboxRefresh
1786
+
1787
+ import {
1788
+ IressButton,
1789
+ IressContainer,
1790
+ IressForm,
1791
+ IressFormField,
1792
+ IressInputCurrency,
1793
+ IressLoading,
1794
+ IressPanel,
1795
+ IressStack,
1796
+ IressText,
1797
+ } from '@/main';
1798
+ import { useDeferredValue, useEffect, useState } from 'react';
1799
+ import retirementGraph from './retirement-graph.png';
1136
1800
  interface PageProps {
1137
1801
  setPage: (page: number) \=> void;
1138
1802
  }
@@ -1280,25 +1944,6 @@ export const LoadingWizardFast \= () \=> {
1280
1944
  );
1281
1945
  };
1282
1946
 
1283
- Copy
1284
-
1285
- On this page
1286
-
1287
- * [Overview](#overview)
1288
- * [Props](#props)
1289
- * [Usage](#usage)
1290
- * [Be consistent](#be-consistent)
1291
- * [Behaviour](#behaviour)
1292
- * [Patterns](#patterns)
1293
- * [component](#component)
1294
- * [default](#default)
1295
- * [long](#long)
1296
- * [page](#page)
1297
- * [start-up](#start-up)
1298
- * [validate](#validate)
1299
- * [Suspense](#suspense)
1300
- * [Hooks](#hooks)
1301
- * [IressLoading.shouldRender](#iressloadingshouldrender)
1302
- * [IressLoadingSuspense.use](#iressloadingsuspenseuse)
1303
- * [Examples](#examples)
1304
- * [Wizard](#wizard)
1947
+ ```
1948
+
1949
+ #### Props