@iress-oss/ids-mcp-server 0.0.1 → 5.14.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 (122) hide show
  1. package/LICENSE.txt +201 -0
  2. package/README.md +29 -159
  3. package/dist/componentHandlers.js +241 -0
  4. package/dist/componentHandlers.test.js +380 -0
  5. package/{build → dist}/config.js +5 -5
  6. package/dist/index.js +53 -0
  7. package/{build → dist}/iressHandlers.js +52 -46
  8. package/dist/iressHandlers.test.js +316 -0
  9. package/{build → dist}/resourceHandlers.js +23 -22
  10. package/dist/resourceHandlers.test.js +352 -0
  11. package/{build → dist}/searchHandlers.js +107 -92
  12. package/dist/searchHandlers.test.js +524 -0
  13. package/{build → dist}/toolHandler.js +13 -13
  14. package/dist/toolHandler.test.js +369 -0
  15. package/dist/tools.js +165 -0
  16. package/{build → dist}/utils.js +11 -15
  17. package/dist/utils.test.js +286 -0
  18. package/{docs/ids → generated/docs}/components-autocomplete-docs.md +3 -3
  19. package/{docs/ids → generated/docs}/components-autocomplete-recipes-docs.md +17 -51
  20. package/{docs/ids → generated/docs}/components-card-recipes-docs.md +1 -1
  21. package/{docs/ids → generated/docs}/components-checkbox-docs.md +6 -19
  22. package/{docs/ids → generated/docs}/components-checkboxgroup-docs.md +18 -18
  23. package/{docs/ids → generated/docs}/components-checkboxgroup-recipes-docs.md +9 -9
  24. package/{docs/ids → generated/docs}/components-col-docs.md +1 -1
  25. package/{docs/ids → generated/docs}/components-combobox-docs.md +4 -4
  26. package/{docs/ids → generated/docs}/components-container-docs.md +8 -42
  27. package/{docs/ids → generated/docs}/components-filter-docs.md +14 -67
  28. package/{docs/ids → generated/docs}/components-form-docs.md +341 -335
  29. package/{docs/ids → generated/docs}/components-form-recipes-docs.md +198 -1
  30. package/{docs/ids → generated/docs}/components-hide-docs.md +16 -70
  31. package/{docs/ids → generated/docs}/components-icon-docs.md +4 -4
  32. package/{docs/ids → generated/docs}/components-input-recipes-docs.md +2 -2
  33. package/{docs/ids → generated/docs}/components-inputcurrency-recipes-docs.md +6 -40
  34. package/{docs/ids → generated/docs}/components-modal-docs.md +3 -113
  35. package/generated/docs/components-popover-docs.md +464 -0
  36. package/{docs/ids → generated/docs}/components-radiogroup-docs.md +21 -21
  37. package/{docs/ids → generated/docs}/components-richselect-docs.md +149 -111
  38. package/{docs/ids → generated/docs}/components-row-docs.md +4 -4
  39. package/{docs/ids → generated/docs}/components-skeleton-docs.md +3 -3
  40. package/{docs/ids → generated/docs}/components-skeleton-recipes-docs.md +1 -1
  41. package/{docs/ids → generated/docs}/components-skiplink-docs.md +1 -1
  42. package/{docs/ids → generated/docs}/components-slideout-docs.md +3 -113
  43. package/{docs/ids → generated/docs}/components-table-ag-grid-docs.md +109 -137
  44. package/{docs/ids → generated/docs}/components-table-docs.md +92 -597
  45. package/{docs/ids → generated/docs}/components-tabset-docs.md +2 -2
  46. package/{docs/ids → generated/docs}/components-tag-docs.md +1 -1
  47. package/{docs/ids → generated/docs}/components-toaster-docs.md +5 -5
  48. package/{docs/ids → generated/docs}/extensions-editor-docs.md +4 -4
  49. package/generated/docs/foundations-accessibility-docs.md +62 -0
  50. package/{docs/ids → generated/docs}/foundations-colours-docs.md +1 -1
  51. package/generated/docs/foundations-consistency-docs.md +52 -0
  52. package/generated/docs/foundations-content-docs.md +23 -0
  53. package/generated/docs/foundations-introduction-docs.md +17 -0
  54. package/generated/docs/foundations-principles-docs.md +70 -0
  55. package/{docs/ids → generated/docs}/foundations-typography-docs.md +7 -2
  56. package/generated/docs/foundations-user-experience-docs.md +63 -0
  57. package/generated/docs/foundations-visual-design-docs.md +46 -0
  58. package/{docs/ids → generated/docs}/get-started-develop-docs.md +3 -3
  59. package/generated/docs/guidelines.md +812 -0
  60. package/{docs/ids → generated/docs}/introduction-docs.md +4 -4
  61. package/{docs/ids → generated/docs}/patterns-loading-docs.md +332 -2
  62. package/generated/docs/resources-migration-guides-from-v4-to-v5-docs.md +437 -0
  63. package/generated/docs/themes-available-themes-docs.md +66 -0
  64. package/generated/docs/themes-tokens-docs.md +1200 -0
  65. package/generated/docs/versions-docs.md +17 -0
  66. package/package.json +42 -14
  67. package/LICENSE +0 -193
  68. package/build/componentHandlers.js +0 -205
  69. package/build/index.js +0 -51
  70. package/build/tools.js +0 -165
  71. package/docs/api-reference.md +0 -0
  72. package/docs/best-practices.md +0 -0
  73. package/docs/configuration.md +0 -0
  74. package/docs/examples.md +0 -0
  75. package/docs/guidelines.md +0 -269
  76. package/docs/ids/components-popover-docs.md +0 -4
  77. package/docs/ids/resources-migration-guides-from-v4-to-v5-docs.md +0 -639
  78. package/docs/ids/themes-available-themes-docs.md +0 -74
  79. package/docs/ids/themes-tokens-docs.md +0 -4580
  80. package/docs/ids/versions-docs.md +0 -27
  81. package/docs/tutorials/basic-integration.md +0 -0
  82. /package/{build → dist}/types.js +0 -0
  83. /package/{docs/ids → generated/docs}/components-alert-docs.md +0 -0
  84. /package/{docs/ids → generated/docs}/components-badge-docs.md +0 -0
  85. /package/{docs/ids → generated/docs}/components-button-docs.md +0 -0
  86. /package/{docs/ids → generated/docs}/components-button-recipes-docs.md +0 -0
  87. /package/{docs/ids → generated/docs}/components-buttongroup-docs.md +0 -0
  88. /package/{docs/ids → generated/docs}/components-card-docs.md +0 -0
  89. /package/{docs/ids → generated/docs}/components-divider-docs.md +0 -0
  90. /package/{docs/ids → generated/docs}/components-expander-docs.md +0 -0
  91. /package/{docs/ids → generated/docs}/components-field-docs.md +0 -0
  92. /package/{docs/ids → generated/docs}/components-inline-docs.md +0 -0
  93. /package/{docs/ids → generated/docs}/components-input-docs.md +0 -0
  94. /package/{docs/ids → generated/docs}/components-inputcurrency-docs.md +0 -0
  95. /package/{docs/ids → generated/docs}/components-label-docs.md +0 -0
  96. /package/{docs/ids → generated/docs}/components-menu-docs.md +0 -0
  97. /package/{docs/ids → generated/docs}/components-menu-menuitem-docs.md +0 -0
  98. /package/{docs/ids → generated/docs}/components-navbar-docs.md +0 -0
  99. /package/{docs/ids → generated/docs}/components-navbar-recipes-docs.md +0 -0
  100. /package/{docs/ids → generated/docs}/components-panel-docs.md +0 -0
  101. /package/{docs/ids → generated/docs}/components-placeholder-docs.md +0 -0
  102. /package/{docs/ids → generated/docs}/components-popover-recipes-docs.md +0 -0
  103. /package/{docs/ids → generated/docs}/components-progress-docs.md +0 -0
  104. /package/{docs/ids → generated/docs}/components-radio-docs.md +0 -0
  105. /package/{docs/ids → generated/docs}/components-readonly-docs.md +0 -0
  106. /package/{docs/ids → generated/docs}/components-select-docs.md +0 -0
  107. /package/{docs/ids → generated/docs}/components-slider-docs.md +0 -0
  108. /package/{docs/ids → generated/docs}/components-spinner-docs.md +0 -0
  109. /package/{docs/ids → generated/docs}/components-stack-docs.md +0 -0
  110. /package/{docs/ids → generated/docs}/components-tabset-tab-docs.md +0 -0
  111. /package/{docs/ids → generated/docs}/components-text-docs.md +0 -0
  112. /package/{docs/ids → generated/docs}/components-toaster-toast-docs.md +0 -0
  113. /package/{docs/ids → generated/docs}/components-toggle-docs.md +0 -0
  114. /package/{docs/ids → generated/docs}/components-tooltip-docs.md +0 -0
  115. /package/{docs/ids → generated/docs}/components-validationmessage-docs.md +0 -0
  116. /package/{docs/ids → generated/docs}/contact-us-docs.md +0 -0
  117. /package/{docs/ids → generated/docs}/extensions-editor-recipes-docs.md +0 -0
  118. /package/{docs/ids → generated/docs}/frequently-asked-questions-docs.md +0 -0
  119. /package/{docs/ids → generated/docs}/get-started-using-storybook-docs.md +0 -0
  120. /package/{docs/ids → generated/docs}/resources-changelog-docs.md +0 -0
  121. /package/{docs/ids → generated/docs}/resources-code-katas-docs.md +0 -0
  122. /package/{docs/ids → generated/docs}/themes-introduction-docs.md +0 -0
@@ -686,10 +686,207 @@ export const FormGroups \= () \=> {
686
686
 
687
687
  Copy
688
688
 
689
+ [](#hidden-inputs)Hidden inputs
690
+ -------------------------------
691
+
692
+ You can use hidden inputs to store data that you do not want to display to the user, but still need to include in the form submission. This is useful for storing metadata or other information that is not editable by the user.
693
+
694
+ Warning
695
+ -------
696
+
697
+ This is not a recommended practice, as it can lead to security issues if sensitive data is stored in hidden inputs. It is better to use a variable to store your data, and include it in the form submission using the `onSubmit` handler.
698
+
699
+ Visible Input
700
+
701
+ Submit
702
+
703
+ Hide code
704
+
705
+ \[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; }
706
+
707
+ export const HiddenInputsForm \= () \=> {
708
+ const form \= IressForm.useForm();
709
+ const { register } \= form;
710
+ // This is a hidden input field that the user cannot see or interact with.
711
+ // This is the recommended way to handle hidden inputs in Iress forms.
712
+ const hiddenInputStoredInVariable \= 'hiddenValue';
713
+ return (
714
+ <IressHookForm
715
+ form\={form}
716
+ onSubmit\={(data) \=> {
717
+ console.log('Form submitted with data:', {
718
+ ...data,
719
+ hiddenInputStoredInVariable,
720
+ });
721
+ }}
722
+ \>
723
+ <IressStack gutter\="md"\>
724
+ <IressFormField
725
+ label\="Visible Input"
726
+ name\="visibleInput"
727
+ render\={(controlledProps) \=> <IressInput {...controlledProps} />}
728
+ />
729
+ {/\* Hidden field - NOT RECOMMENDED \*/}
730
+ <input
731
+ type\="hidden"
732
+ {...register('hiddenField')} // Manually register the hidden field with react-hook-form
733
+ value\="hiddenValue"
734
+ />
735
+ <IressButton type\="submit"\>Submit</IressButton\>
736
+ </IressStack\>
737
+ </IressHookForm\>
738
+ );
739
+ };
740
+
741
+ Copy
742
+
743
+ [](#validation-depend-on-other-fields)Validation depend on other fields
744
+ -----------------------------------------------------------------------
745
+
746
+ This example shows how to validate one field based on another field's value.
747
+
748
+ The budget amount input validates against the selected budget range using the custom `validateBudgetInput` rules.
749
+
750
+ Validation depend on other fields
751
+ =================================
752
+
753
+ This form demonstrates how to validate a field based on the value of another field. The budget amount field is validated against the selected budget range.
754
+
755
+ \*Required Monthly investment budget
756
+
757
+ Select your budget rangeLess than $499Between $500 to $999More than $1000
758
+
759
+ \*Required Enter your budget amount ($)
760
+
761
+ AUD
762
+
763
+ Submit
764
+
765
+ * * *
766
+
767
+ Hide code
768
+
769
+ \[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; }
770
+
771
+ interface FormData {
772
+ primaryField: string;
773
+ dependentField: string;
774
+ }
775
+ const budgetOptions \= \[
776
+ { value: 'less-than-499', label: 'Less than $499' },
777
+ { value: 'between-500-999', label: 'Between $500 to $999' },
778
+ { value: 'more-than-1000', label: 'More than $1000' },
779
+ \];
780
+ const validateBudgetInput \= (
781
+ value: string,
782
+ selectedBudget: string,
783
+ ): string | true \=> {
784
+ if (!selectedBudget) return 'Select budget range first';
785
+ const numericValue \= parseFloat(value);
786
+ if (isNaN(numericValue)) return 'Enter a valid number';
787
+ switch (selectedBudget) {
788
+ case 'less-than-499':
789
+ return numericValue < 499 || 'Must be less than $499';
790
+ case 'between-500-999':
791
+ return (
792
+ (numericValue \>= 500 && numericValue <= 999) ||
793
+ 'Must be between $500-$999'
794
+ );
795
+ case 'more-than-1000':
796
+ return numericValue \> 1000 || 'Must be more than $1000';
797
+ default:
798
+ return true;
799
+ }
800
+ };
801
+ export const ValidationDependOnOtherFields \= () \=> {
802
+ const \[submitted, setSubmitted\] \= useState<FormData | undefined\>(undefined);
803
+ const form \= IressForm.useForm<FormData\>({
804
+ defaultValues: {
805
+ primaryField: '',
806
+ dependentField: '',
807
+ },
808
+ });
809
+ const onSubmit \= (data: FormData) \=> {
810
+ console.log(data);
811
+ setSubmitted(data);
812
+ };
813
+ const onError \= (errors: Record<string, unknown\>) \=> {
814
+ console.log('Form validation errors:', errors);
815
+ };
816
+ return (
817
+ <\>
818
+ <IressText element\="h1"\>Validation depend on other fields</IressText\>
819
+ <IressText element\="p"\>
820
+ This form demonstrates how to validate a field based on the value of another field. The budget amount field is validated against the selected budget range. </IressText\>
821
+ <IressHookForm form\={form} onSubmit\={onSubmit} onError\={onError}\>
822
+ <IressStack gutter\="md"\>
823
+ <IressRow\>
824
+ <IressCol\>
825
+ <IressFormField
826
+ name\="primaryField"
827
+ label\="Monthly investment budget"
828
+ rules\={{
829
+ required: 'Budget range is required',
830
+ }}
831
+ render\={(field) \=> (
832
+ <IressSelect
833
+ {...field}
834
+ placeholder\="Select your budget range"
835
+ \>
836
+ {budgetOptions.map((option) \=> (
837
+ <option key\={option.value} value\={option.value}\>
838
+ {option.label}
839
+ </option\>
840
+ ))}
841
+ </IressSelect\>
842
+ )}
843
+ />
844
+ </IressCol\>
845
+ </IressRow\>
846
+ <IressRow\>
847
+ <IressCol\>
848
+ <IressFormField
849
+ name\="dependentField"
850
+ label\="Enter your budget amount ($)"
851
+ rules\={{
852
+ required: 'Budget amount is required',
853
+ validate: (value: string, formValues: FormData) \=>
854
+ validateBudgetInput(value, formValues.primaryField),
855
+ }}
856
+ render\={(field) \=> (
857
+ <IressInputCurrency {...field} type\="number" />
858
+ )}
859
+ />
860
+ </IressCol\>
861
+ </IressRow\>
862
+ <IressButton type\="submit"\>Submit</IressButton\>
863
+ </IressStack\>
864
+ </IressHookForm\>
865
+ <IressDivider />
866
+ {submitted && (
867
+ <IressStack gutter\="md"\>
868
+ <IressText variant\="bold"\>Submitted Values:</IressText\>
869
+ <IressText\>
870
+ Budget Range:{' '}
871
+ {budgetOptions.find(
872
+ (option) \=> option.value \=== submitted.primaryField,
873
+ )?.label ?? submitted.primaryField}
874
+ </IressText\>
875
+ <IressText\>Budget Amount: ${submitted.dependentField}</IressText\>
876
+ </IressStack\>
877
+ )}
878
+ </\>
879
+ );
880
+ };
881
+
882
+ Copy
883
+
689
884
  On this page
690
885
 
691
886
  * [With readonly data](#with-readonly-data)
692
887
  * [Switching between readonly and edit modes](#switching-between-readonly-and-edit-modes)
693
888
  * [Alternative form validation](#alternative-form-validation)
694
889
  * [Nested forms](#nested-forms)
695
- * [Form Groups](#form-groups)
890
+ * [Form Groups](#form-groups)
891
+ * [Hidden inputs](#hidden-inputs)
892
+ * [Validation depend on other fields](#validation-depend-on-other-fields)
@@ -33,34 +33,14 @@ The `hiddenOn` prop accepts a `ResponsiveSizing<boolean>` object, which is an ob
33
33
  It determines which screen sizes the component's children will be hidden on. It's set up as an object containing the following IDS breakpoints:
34
34
 
35
35
  Hide breakpoints
36
-
37
- Breakpoint
38
-
39
- Screen Widths
40
-
41
- `xs`
42
-
43
- Above 0px (inclusive)
44
-
45
- `sm`
46
-
47
- Above 576px (inclusive)
48
-
49
- `md`
50
-
51
- Above 768px (inclusive)
52
-
53
- `lg`
54
-
55
- Above 1024px (inclusive)
56
-
57
- `xl`
58
-
59
- Above 1200px (inclusive)
60
-
61
- `xxl`
62
-
63
- Above 1500px (inclusive)
36
+ | Breakpoint | Screen Widths |
37
+ | --- | --- |
38
+ | `xs` | Above 0px (inclusive) |
39
+ | `sm` | Above 576px (inclusive) |
40
+ | `md` | Above 768px (inclusive) |
41
+ | `lg` | Above 1024px (inclusive) |
42
+ | `xl` | Above 1200px (inclusive) |
43
+ | `xxl` | Above 1500px (inclusive) |
64
44
 
65
45
  [](#behaviour)Behaviour
66
46
  -----------------------
@@ -261,48 +241,14 @@ To make it easier for developers to hide content, we've exposed the classes we u
261
241
  This means you can use them without having to use the Hide component. Unlike the Hide component, the utility classes only apply to a single breakpoint:
262
242
 
263
243
  Hide breakpoints
264
-
265
- Totally Hidden
266
-
267
- Visually Hidden
268
-
269
- Screen Widths
270
-
271
- `iress-hidden--xs`
272
-
273
- `iress-sr-only--xs`
274
-
275
- 0 - 575px
276
-
277
- `iress-hidden--sm`
278
-
279
- `iress-sr-only--sm`
280
-
281
- 576px - 767px
282
-
283
- `iress-hidden--md`
284
-
285
- `iress-sr-only--md`
286
-
287
- 768px - 1023px
288
-
289
- `iress-hidden--lg`
290
-
291
- `iress-sr-only--lg`
292
-
293
- 1024px - 1199px
294
-
295
- `iress-hidden--xl`
296
-
297
- `iress-sr-only--xl`
298
-
299
- 1200px - 1499px
300
-
301
- `iress-hidden--xxl`
302
-
303
- `iress-sr-only--xxl`
304
-
305
- 1500px and above
244
+ | Totally Hidden | Visually Hidden | Screen Widths |
245
+ | --- | --- | --- |
246
+ | `iress-hidden--xs` | `iress-sr-only--xs` | 0 - 575px |
247
+ | `iress-hidden--sm` | `iress-sr-only--sm` | 576px - 767px |
248
+ | `iress-hidden--md` | `iress-sr-only--md` | 768px - 1023px |
249
+ | `iress-hidden--lg` | `iress-sr-only--lg` | 1024px - 1199px |
250
+ | `iress-hidden--xl` | `iress-sr-only--xl` | 1200px - 1499px |
251
+ | `iress-hidden--xxl` | `iress-sr-only--xxl` | 1500px and above |
306
252
 
307
253
  If you use `iress-hidden` or `iress-sr-only` without the breakpoint suffix, it will apply to all screen sizes.
308
254
 
@@ -467,13 +467,13 @@ Hide code
467
467
  \>
468
468
  Default width </IressText\>
469
469
  <IressIcon
470
- className\="ids-styles--alt-background-v5130"
470
+ className\="ids-styles--alt-background-v5142"
471
471
  name\="space-shuttle"
472
472
  size\="3x"
473
473
  />
474
474
  <br />
475
475
  <IressIcon
476
- className\="ids-styles--alt-background-v5130"
476
+ className\="ids-styles--alt-background-v5142"
477
477
  name\="wine-glass-alt"
478
478
  size\="3x"
479
479
  />
@@ -485,14 +485,14 @@ Hide code
485
485
  \>
486
486
  Fixed width </IressText\>
487
487
  <IressIcon
488
- className\="ids-styles--alt-background-v5130"
488
+ className\="ids-styles--alt-background-v5142"
489
489
  fixedWidth
490
490
  name\="space-shuttle"
491
491
  size\="3x"
492
492
  />
493
493
  <br />
494
494
  <IressIcon
495
- className\="ids-styles--alt-background-v5130"
495
+ className\="ids-styles--alt-background-v5142"
496
496
  fixedWidth
497
497
  name\="wine-glass-alt"
498
498
  size\="3x"
@@ -12,7 +12,7 @@ Hide code
12
12
 
13
13
  \[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; }
14
14
 
15
- import { IressInput } from '@iress/ids-components';
15
+ import { IressInput } from '@iress-oss/ids-components';
16
16
  export const InputPercentage \= () \=> (
17
17
  <IressInput<number | string\>
18
18
  defaultValue\="0.5"
@@ -61,7 +61,7 @@ import {
61
61
  IressModal,
62
62
  IressStack,
63
63
  IressTable,
64
- } from '@iress/ids-components';
64
+ } from '@iress-oss/ids-components';
65
65
  import { useState } from 'react';
66
66
  import { Controller, UseFormRegisterReturn, useForm } from 'react-hook-form';
67
67
  const registerInnerElement \= (register: UseFormRegisterReturn) \=> {
@@ -7,46 +7,12 @@
7
7
  It is not recommended to use the `readOnly` prop for `IressInputCurrency` inside tables, as it was designed for forms. This example shows how to use currency in the table, by using the `format` prop of when defining a column inside `IressTable`. Additionally, when all rows have the same currency, it is recommended to add the currency code on the column `label` and remove the `currencyCode` on all rows.
8
8
 
9
9
  My investments
10
-
11
- Investment Name
12
-
13
- Investment Date
14
-
15
- Total %
16
-
17
- Investment Amount (AUD)
18
-
19
- US Stocks
20
-
21
- 23/09/2019
22
-
23
- 24.8%
24
-
25
- 23,898.00
26
-
27
- US Bonds
28
-
29
- 05/02/2019
30
-
31
- 26.2%
32
-
33
- 26,382.46
34
-
35
- AU Stocks
36
-
37
- 05/02/2019
38
-
39
- 26.2%
40
-
41
- 9,342.16
42
-
43
- UK Stocks
44
-
45
- 28/06/2020
46
-
47
- 49%
48
-
49
- 49,751.40
10
+ | Investment Name | Investment Date | Total % | Investment Amount (AUD) |
11
+ | --- | --- | --- | --- |
12
+ | US Stocks | 23/09/2019 | 24.8% | 23,898.00 |
13
+ | US Bonds | 05/02/2019 | 26.2% | 26,382.46 |
14
+ | AU Stocks | 05/02/2019 | 26.2% | 9,342.16 |
15
+ | UK Stocks | 28/06/2020 | 49% | 49,751.40 |
50
16
 
51
17
  Hide code
52
18
 
@@ -64,7 +64,7 @@ Hide code
64
64
 
65
65
  \[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; }
66
66
 
67
- import { IressButton, IressModal, IressModalProps } from '@iress/ids-components';
67
+ import { IressButton, IressModal, IressModalProps } from '@iress-oss/ids-components';
68
68
  import { useState } from 'react';
69
69
  export const ModalUsingState \= () \=> {
70
70
  const \[show, setShow\] \= useState(false);
@@ -104,7 +104,7 @@ import {
104
104
  IressModalProps,
105
105
  IressModalProvider,
106
106
  useModal,
107
- } from '@iress/ids-components';
107
+ } from '@iress-oss/ids-components';
108
108
  const MODAL\_ID \= 'storybook-modal';
109
109
  export const App \= (modalProps: IressModalProps) \=> (
110
110
  <IressModalProvider\>
@@ -525,117 +525,7 @@ Mode
525
525
 
526
526
  DiffOldNew
527
527
 
528
- \-
529
-
530
- import { render, waitFor, screen } from '@testing-library/react';
531
-
532
- +
533
-
534
- import { render, screen, waitForElementToBeRemoved } from '@testing-library/react';
535
-
536
- \-
537
-
538
- import { idsFireEvent, componentLoad } from '@iress/ids-react-test-utils';
539
-
540
- +
541
-
542
- import { userEvent } from '@testing-library/user-event';
543
-
544
- \-
545
-
546
- test('opening and closing a modal', async () => {
547
-
548
- \-
549
-
550
- await componentLoad(\[
551
-
552
- +
553
-
554
- const trigger = screen.getByRole('button', { name: /open modal/i });
555
-
556
- \-
557
-
558
- 'modal-trigger',
559
-
560
- \-
561
-
562
- 'modal',
563
-
564
- +
565
-
566
- // activate modal
567
-
568
- \-
569
-
570
- \]);
571
-
572
- +
573
-
574
- await userEvent.click(trigger);
575
-
576
- +
577
-
578
- const modal = await screen.findByRole('dialog');
579
-
580
- \-
581
-
582
- const trigger = screen.getByTestId('modal-trigger');
583
-
584
- \-
585
-
586
- const modal = screen.getByTestId('modal');
587
-
588
- +
589
-
590
- // In version 5, you can only interact with the modal once it has been loaded here.
591
-
592
- \-
593
-
594
- // In version 4, you can already interact with the modal here as its in the DOM at this stage.
595
-
596
- \-
597
-
598
- \-
599
-
600
- // activate modal
601
-
602
- \-
603
-
604
- idsFireEvent.click(trigger);
605
-
606
- \-
607
-
608
- await waitFor(() => expect(modal).toBeVisible());
609
-
610
- \-
611
-
612
- // close modal
613
-
614
- \-
615
-
616
- const closeButton = screen.getByTestId('modal\_\_close-button');
617
-
618
- +
619
-
620
- const closeButton = screen.getByRole('button', { name: /close/i });
621
-
622
- \-
623
-
624
- idsFireEvent.click(closeButton);
625
-
626
- +
627
-
628
- await userEvent.click(closeButton);
629
-
630
- \-
631
-
632
- await waitFor(() => expect(modal).not.toBeVisible());
633
-
634
- +
635
-
636
- await waitForElementToBeRemoved(modal);
637
-
638
- });
528
+ <table class="css-1n5o7vh-diff-container"><tbody><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">import { render, waitFor, screen } from '@testing-library/react';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">import { render, screen, waitForElementToBeRemoved } from '@testing-library/react';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">import { idsFireEvent, componentLoad } from '@iress/ids-react-test-utils';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">import { userEvent } from '@testing-library/user-event';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> </pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text">test('opening and closing a modal', async () =&gt; {</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> await componentLoad([</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> const trigger = screen.getByRole('button', { name: /open modal/i });</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> 'modal-trigger',</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> 'modal',</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> // activate modal</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> ]);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> await userEvent.click(trigger);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> const modal = await screen.findByRole('dialog');</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> const trigger = screen.getByTestId('modal-trigger');</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> const modal = screen.getByTestId('modal');</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> // In version 5, you can only interact with the modal once it has been loaded here.</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-10regm7-empty-line"><pre></pre></td><td class="css-vl0irh-content css-10regm7-empty-line"><pre class="css-o1u8iu-content-text"></pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-10regm7-empty-line"><pre></pre></td><td class="css-vl0irh-content css-10regm7-empty-line"><pre class="css-o1u8iu-content-text"></pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> // In version 4, you can already interact with the modal here as its in the DOM at this stage.</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> </pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> // activate modal</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> idsFireEvent.click(trigger);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> await waitFor(() =&gt; expect(modal).toBeVisible());</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> </pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text"> // close modal</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> const closeButton = screen.getByTestId('modal__close-button');</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> const closeButton = screen.getByRole('button', { name: /close/i });</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> idsFireEvent.click(closeButton);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> await userEvent.click(closeButton);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> await waitFor(() =&gt; expect(modal).not.toBeVisible());</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> await waitForElementToBeRemoved(modal);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text">});</pre></td></tr></tbody></table>
639
529
 
640
530
  ### [](#speed-up-tests)Speed up tests
641
531