@iress-oss/ids-mcp-server 0.0.1-dev.4 → 0.0.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 (125) hide show
  1. package/LICENSE +193 -0
  2. package/README.md +159 -29
  3. package/build/componentHandlers.js +205 -0
  4. package/{dist → build}/config.js +5 -5
  5. package/build/index.js +51 -0
  6. package/{dist → build}/iressHandlers.js +46 -52
  7. package/{dist → build}/resourceHandlers.js +22 -23
  8. package/{dist → build}/searchHandlers.js +92 -107
  9. package/{dist → build}/toolHandler.js +13 -13
  10. package/build/tools.js +165 -0
  11. package/{dist → build}/utils.js +15 -11
  12. package/docs/api-reference.md +0 -0
  13. package/docs/best-practices.md +0 -0
  14. package/docs/configuration.md +0 -0
  15. package/docs/examples.md +0 -0
  16. package/docs/guidelines.md +269 -0
  17. package/{generated/docs → docs/ids}/components-autocomplete-docs.md +5 -5
  18. package/{generated/docs → docs/ids}/components-autocomplete-recipes-docs.md +51 -17
  19. package/{generated/docs → docs/ids}/components-card-recipes-docs.md +1 -1
  20. package/{generated/docs → docs/ids}/components-checkbox-docs.md +19 -6
  21. package/{generated/docs → docs/ids}/components-checkboxgroup-docs.md +18 -18
  22. package/{generated/docs → docs/ids}/components-checkboxgroup-recipes-docs.md +9 -9
  23. package/{generated/docs → docs/ids}/components-col-docs.md +1 -1
  24. package/{generated/docs → docs/ids}/components-combobox-docs.md +6 -6
  25. package/{generated/docs → docs/ids}/components-container-docs.md +42 -8
  26. package/{generated/docs → docs/ids}/components-filter-docs.md +66 -13
  27. package/{generated/docs → docs/ids}/components-form-docs.md +368 -342
  28. package/{generated/docs → docs/ids}/components-form-recipes-docs.md +11 -202
  29. package/{generated/docs → docs/ids}/components-hide-docs.md +70 -16
  30. package/{generated/docs → docs/ids}/components-icon-docs.md +4 -4
  31. package/{generated/docs → docs/ids}/components-input-recipes-docs.md +2 -2
  32. package/{generated/docs → docs/ids}/components-inputcurrency-recipes-docs.md +40 -6
  33. package/{generated/docs → docs/ids}/components-modal-docs.md +113 -3
  34. package/docs/ids/components-popover-docs.md +4 -0
  35. package/{generated/docs → docs/ids}/components-radiogroup-docs.md +21 -21
  36. package/{generated/docs → docs/ids}/components-richselect-docs.md +111 -149
  37. package/{generated/docs → docs/ids}/components-row-docs.md +4 -4
  38. package/{generated/docs → docs/ids}/components-skeleton-docs.md +3 -3
  39. package/{generated/docs → docs/ids}/components-skeleton-recipes-docs.md +1 -1
  40. package/{generated/docs → docs/ids}/components-skiplink-docs.md +1 -1
  41. package/{generated/docs → docs/ids}/components-slideout-docs.md +113 -3
  42. package/docs/ids/components-table-ag-grid-docs.md +2694 -0
  43. package/{generated/docs → docs/ids}/components-table-docs.md +597 -92
  44. package/{generated/docs → docs/ids}/components-tabset-docs.md +2 -2
  45. package/{generated/docs → docs/ids}/components-tag-docs.md +1 -1
  46. package/{generated/docs → docs/ids}/components-toaster-docs.md +5 -56
  47. package/{generated/docs → docs/ids}/extensions-editor-docs.md +5 -5
  48. package/{generated/docs → docs/ids}/foundations-colours-docs.md +1 -1
  49. package/{generated/docs → docs/ids}/foundations-typography-docs.md +2 -7
  50. package/docs/ids/get-started-develop-docs.md +48 -0
  51. package/{generated/docs → docs/ids}/introduction-docs.md +4 -4
  52. package/{generated/docs → docs/ids}/patterns-loading-docs.md +2 -332
  53. package/docs/ids/resources-migration-guides-from-v4-to-v5-docs.md +639 -0
  54. package/docs/ids/themes-available-themes-docs.md +74 -0
  55. package/docs/ids/themes-tokens-docs.md +4580 -0
  56. package/docs/ids/versions-docs.md +27 -0
  57. package/docs/tutorials/basic-integration.md +0 -0
  58. package/package.json +15 -44
  59. package/LICENSE.txt +0 -201
  60. package/dist/componentHandlers.js +0 -241
  61. package/dist/componentHandlers.test.js +0 -380
  62. package/dist/index.js +0 -53
  63. package/dist/iressHandlers.test.js +0 -316
  64. package/dist/resourceHandlers.test.js +0 -352
  65. package/dist/searchHandlers.test.js +0 -524
  66. package/dist/toolHandler.test.js +0 -369
  67. package/dist/tools.js +0 -165
  68. package/dist/utils.test.js +0 -286
  69. package/generated/docs/components-popover-docs.md +0 -464
  70. package/generated/docs/components-provider-docs.md +0 -105
  71. package/generated/docs/components-table-ag-grid-docs.md +0 -1074
  72. package/generated/docs/foundations-accessibility-docs.md +0 -62
  73. package/generated/docs/foundations-consistency-docs.md +0 -52
  74. package/generated/docs/foundations-content-docs.md +0 -23
  75. package/generated/docs/foundations-introduction-docs.md +0 -17
  76. package/generated/docs/foundations-principles-docs.md +0 -70
  77. package/generated/docs/foundations-user-experience-docs.md +0 -63
  78. package/generated/docs/foundations-visual-design-docs.md +0 -46
  79. package/generated/docs/get-started-develop-docs.md +0 -209
  80. package/generated/docs/guidelines.md +0 -812
  81. package/generated/docs/resources-migration-guides-from-v4-to-v5-docs.md +0 -437
  82. package/generated/docs/themes-available-themes-docs.md +0 -66
  83. package/generated/docs/themes-tokens-docs.md +0 -1200
  84. package/generated/docs/versions-docs.md +0 -17
  85. /package/{dist → build}/types.js +0 -0
  86. /package/{generated/docs → docs/ids}/components-alert-docs.md +0 -0
  87. /package/{generated/docs → docs/ids}/components-badge-docs.md +0 -0
  88. /package/{generated/docs → docs/ids}/components-button-docs.md +0 -0
  89. /package/{generated/docs → docs/ids}/components-button-recipes-docs.md +0 -0
  90. /package/{generated/docs → docs/ids}/components-buttongroup-docs.md +0 -0
  91. /package/{generated/docs → docs/ids}/components-card-docs.md +0 -0
  92. /package/{generated/docs → docs/ids}/components-divider-docs.md +0 -0
  93. /package/{generated/docs → docs/ids}/components-expander-docs.md +0 -0
  94. /package/{generated/docs → docs/ids}/components-field-docs.md +0 -0
  95. /package/{generated/docs → docs/ids}/components-inline-docs.md +0 -0
  96. /package/{generated/docs → docs/ids}/components-input-docs.md +0 -0
  97. /package/{generated/docs → docs/ids}/components-inputcurrency-docs.md +0 -0
  98. /package/{generated/docs → docs/ids}/components-label-docs.md +0 -0
  99. /package/{generated/docs → docs/ids}/components-menu-docs.md +0 -0
  100. /package/{generated/docs → docs/ids}/components-menu-menuitem-docs.md +0 -0
  101. /package/{generated/docs → docs/ids}/components-navbar-docs.md +0 -0
  102. /package/{generated/docs → docs/ids}/components-navbar-recipes-docs.md +0 -0
  103. /package/{generated/docs → docs/ids}/components-panel-docs.md +0 -0
  104. /package/{generated/docs → docs/ids}/components-placeholder-docs.md +0 -0
  105. /package/{generated/docs → docs/ids}/components-popover-recipes-docs.md +0 -0
  106. /package/{generated/docs → docs/ids}/components-progress-docs.md +0 -0
  107. /package/{generated/docs → docs/ids}/components-radio-docs.md +0 -0
  108. /package/{generated/docs → docs/ids}/components-readonly-docs.md +0 -0
  109. /package/{generated/docs → docs/ids}/components-select-docs.md +0 -0
  110. /package/{generated/docs → docs/ids}/components-slider-docs.md +0 -0
  111. /package/{generated/docs → docs/ids}/components-spinner-docs.md +0 -0
  112. /package/{generated/docs → docs/ids}/components-stack-docs.md +0 -0
  113. /package/{generated/docs → docs/ids}/components-tabset-tab-docs.md +0 -0
  114. /package/{generated/docs → docs/ids}/components-text-docs.md +0 -0
  115. /package/{generated/docs → docs/ids}/components-toaster-toast-docs.md +0 -0
  116. /package/{generated/docs → docs/ids}/components-toggle-docs.md +0 -0
  117. /package/{generated/docs → docs/ids}/components-tooltip-docs.md +0 -0
  118. /package/{generated/docs → docs/ids}/components-validationmessage-docs.md +0 -0
  119. /package/{generated/docs → docs/ids}/contact-us-docs.md +0 -0
  120. /package/{generated/docs → docs/ids}/extensions-editor-recipes-docs.md +0 -0
  121. /package/{generated/docs → docs/ids}/frequently-asked-questions-docs.md +0 -0
  122. /package/{generated/docs → docs/ids}/get-started-using-storybook-docs.md +0 -0
  123. /package/{generated/docs → docs/ids}/resources-changelog-docs.md +0 -0
  124. /package/{generated/docs → docs/ids}/resources-code-katas-docs.md +0 -0
  125. /package/{generated/docs → docs/ids}/themes-introduction-docs.md +0 -0
@@ -510,6 +510,8 @@ Hide code
510
510
 
511
511
  \[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; }
512
512
 
513
+ /\* eslint-disable @typescript-eslint/no-misused-promises \*/
514
+
513
515
  interface Client {
514
516
  name: string | undefined;
515
517
  salary: number | undefined;
@@ -636,7 +638,7 @@ export const FormGroups \= () \=> {
636
638
  defaultValues: defaultValues,
637
639
  mode: 'onBlur',
638
640
  });
639
- const { control, getValues } \= form;
641
+ const { control, handleSubmit, getValues } \= form;
640
642
  const { fields, append, update, remove } \= useFieldArray({
641
643
  name: 'dependants',
642
644
  control,
@@ -647,8 +649,7 @@ export const FormGroups \= () \=> {
647
649
  <IressText element\="h1"\>Form groups</IressText\>
648
650
  <IressText element\="p"\>
649
651
  This is one form with child sections (not nested forms). Play around to add/edit/delete child form sections: </IressText\>
650
- <IressHookForm<FormValues> gutter="md" form={form}
651
- onSubmit={onSubmit}
652
+ <IressHookForm<FormValues> id="mainForm" gutter="md" form={form}
652
653
  errorSummaryHeading="Please correct the following errors found for the form:" > <IressStack gutter\="md"\>
653
654
  <ClientSection control\={control} />
654
655
  {fields.map((field, index) \=> (
@@ -671,7 +672,12 @@ export const FormGroups \= () \=> {
671
672
  Add Dependant </IressButton\>
672
673
  </IressStack\>
673
674
  <IressDivider />
674
- <IressButton type\="submit" mode\="primary"\>
675
+ <IressButton
676
+ type\="submit"
677
+ mode\="primary"
678
+ form\="mainForm"
679
+ onClick\={handleSubmit(onSubmit)}
680
+ \>
675
681
  Submit All </IressButton\>
676
682
  </IressHookForm\>
677
683
  </IressStack\>
@@ -680,207 +686,10 @@ export const FormGroups \= () \=> {
680
686
 
681
687
  Copy
682
688
 
683
- [](#hidden-inputs)Hidden inputs
684
- -------------------------------
685
-
686
- 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.
687
-
688
- Warning
689
- -------
690
-
691
- 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.
692
-
693
- Visible Input
694
-
695
- Submit
696
-
697
- Hide code
698
-
699
- \[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; }
700
-
701
- export const HiddenInputsForm \= () \=> {
702
- const form \= IressForm.useForm();
703
- const { register } \= form;
704
- // This is a hidden input field that the user cannot see or interact with.
705
- // This is the recommended way to handle hidden inputs in Iress forms.
706
- const hiddenInputStoredInVariable \= 'hiddenValue';
707
- return (
708
- <IressHookForm
709
- form\={form}
710
- onSubmit\={(data) \=> {
711
- console.log('Form submitted with data:', {
712
- ...data,
713
- hiddenInputStoredInVariable,
714
- });
715
- }}
716
- \>
717
- <IressStack gutter\="md"\>
718
- <IressFormField
719
- label\="Visible Input"
720
- name\="visibleInput"
721
- render\={(controlledProps) \=> <IressInput {...controlledProps} />}
722
- />
723
- {/\* Hidden field - NOT RECOMMENDED \*/}
724
- <input
725
- type\="hidden"
726
- {...register('hiddenField')} // Manually register the hidden field with react-hook-form
727
- value\="hiddenValue"
728
- />
729
- <IressButton type\="submit"\>Submit</IressButton\>
730
- </IressStack\>
731
- </IressHookForm\>
732
- );
733
- };
734
-
735
- Copy
736
-
737
- [](#validation-depend-on-other-fields)Validation depend on other fields
738
- -----------------------------------------------------------------------
739
-
740
- This example shows how to validate one field based on another field's value.
741
-
742
- The budget amount input validates against the selected budget range using the custom `validateBudgetInput` rules.
743
-
744
- Validation depend on other fields
745
- =================================
746
-
747
- 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.
748
-
749
- \*Required Monthly investment budget
750
-
751
- Select your budget rangeLess than $499Between $500 to $999More than $1000
752
-
753
- \*Required Enter your budget amount ($)
754
-
755
- AUD
756
-
757
- Submit
758
-
759
- * * *
760
-
761
- Hide code
762
-
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; }
764
-
765
- interface FormData {
766
- primaryField: string;
767
- dependentField: string;
768
- }
769
- const budgetOptions \= \[
770
- { value: 'less-than-499', label: 'Less than $499' },
771
- { value: 'between-500-999', label: 'Between $500 to $999' },
772
- { value: 'more-than-1000', label: 'More than $1000' },
773
- \];
774
- const validateBudgetInput \= (
775
- value: string,
776
- selectedBudget: string,
777
- ): string | true \=> {
778
- if (!selectedBudget) return 'Select budget range first';
779
- const numericValue \= parseFloat(value);
780
- if (isNaN(numericValue)) return 'Enter a valid number';
781
- switch (selectedBudget) {
782
- case 'less-than-499':
783
- return numericValue < 499 || 'Must be less than $499';
784
- case 'between-500-999':
785
- return (
786
- (numericValue \>= 500 && numericValue <= 999) ||
787
- 'Must be between $500-$999'
788
- );
789
- case 'more-than-1000':
790
- return numericValue \> 1000 || 'Must be more than $1000';
791
- default:
792
- return true;
793
- }
794
- };
795
- export const ValidationDependOnOtherFields \= () \=> {
796
- const \[submitted, setSubmitted\] \= useState<FormData | undefined\>(undefined);
797
- const form \= IressForm.useForm<FormData\>({
798
- defaultValues: {
799
- primaryField: '',
800
- dependentField: '',
801
- },
802
- });
803
- const onSubmit \= (data: FormData) \=> {
804
- console.log(data);
805
- setSubmitted(data);
806
- };
807
- const onError \= (errors: Record<string, unknown\>) \=> {
808
- console.log('Form validation errors:', errors);
809
- };
810
- return (
811
- <\>
812
- <IressText element\="h1"\>Validation depend on other fields</IressText\>
813
- <IressText element\="p"\>
814
- 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\>
815
- <IressHookForm form\={form} onSubmit\={onSubmit} onError\={onError}\>
816
- <IressStack gutter\="md"\>
817
- <IressRow\>
818
- <IressCol\>
819
- <IressFormField
820
- name\="primaryField"
821
- label\="Monthly investment budget"
822
- rules\={{
823
- required: 'Budget range is required',
824
- }}
825
- render\={(field) \=> (
826
- <IressSelect
827
- {...field}
828
- placeholder\="Select your budget range"
829
- \>
830
- {budgetOptions.map((option) \=> (
831
- <option key\={option.value} value\={option.value}\>
832
- {option.label}
833
- </option\>
834
- ))}
835
- </IressSelect\>
836
- )}
837
- />
838
- </IressCol\>
839
- </IressRow\>
840
- <IressRow\>
841
- <IressCol\>
842
- <IressFormField
843
- name\="dependentField"
844
- label\="Enter your budget amount ($)"
845
- rules\={{
846
- required: 'Budget amount is required',
847
- validate: (value: string, formValues: FormData) \=>
848
- validateBudgetInput(value, formValues.primaryField),
849
- }}
850
- render\={(field) \=> (
851
- <IressInputCurrency {...field} type\="number" />
852
- )}
853
- />
854
- </IressCol\>
855
- </IressRow\>
856
- <IressButton type\="submit"\>Submit</IressButton\>
857
- </IressStack\>
858
- </IressHookForm\>
859
- <IressDivider />
860
- {submitted && (
861
- <IressStack gutter\="md"\>
862
- <IressText variant\="bold"\>Submitted Values:</IressText\>
863
- <IressText\>
864
- Budget Range:{' '}
865
- {budgetOptions.find(
866
- (option) \=> option.value \=== submitted.primaryField,
867
- )?.label ?? submitted.primaryField}
868
- </IressText\>
869
- <IressText\>Budget Amount: ${submitted.dependentField}</IressText\>
870
- </IressStack\>
871
- )}
872
- </\>
873
- );
874
- };
875
-
876
- Copy
877
-
878
689
  On this page
879
690
 
880
691
  * [With readonly data](#with-readonly-data)
881
692
  * [Switching between readonly and edit modes](#switching-between-readonly-and-edit-modes)
882
693
  * [Alternative form validation](#alternative-form-validation)
883
694
  * [Nested forms](#nested-forms)
884
- * [Form Groups](#form-groups)
885
- * [Hidden inputs](#hidden-inputs)
886
- * [Validation depend on other fields](#validation-depend-on-other-fields)
695
+ * [Form Groups](#form-groups)
@@ -33,14 +33,34 @@ 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
- | 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) |
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)
44
64
 
45
65
  [](#behaviour)Behaviour
46
66
  -----------------------
@@ -241,14 +261,48 @@ To make it easier for developers to hide content, we've exposed the classes we u
241
261
  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:
242
262
 
243
263
  Hide breakpoints
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 |
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
252
306
 
253
307
  If you use `iress-hidden` or `iress-sr-only` without the breakpoint suffix, it will apply to all screen sizes.
254
308
 
@@ -467,13 +467,13 @@ Hide code
467
467
  \>
468
468
  Default width </IressText\>
469
469
  <IressIcon
470
- className\="ids-styles--alt-background-v5150"
470
+ className\="ids-styles--alt-background-v5130"
471
471
  name\="space-shuttle"
472
472
  size\="3x"
473
473
  />
474
474
  <br />
475
475
  <IressIcon
476
- className\="ids-styles--alt-background-v5150"
476
+ className\="ids-styles--alt-background-v5130"
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-v5150"
488
+ className\="ids-styles--alt-background-v5130"
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-v5150"
495
+ className\="ids-styles--alt-background-v5130"
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-oss/ids-components';
15
+ import { IressInput } from '@iress/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-oss/ids-components';
64
+ } from '@iress/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,12 +7,46 @@
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
- | 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 |
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
16
50
 
17
51
  Hide code
18
52
 
@@ -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-oss/ids-components';
67
+ import { IressButton, IressModal, IressModalProps } from '@iress/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-oss/ids-components';
107
+ } from '@iress/ids-components';
108
108
  const MODAL\_ID \= 'storybook-modal';
109
109
  export const App \= (modalProps: IressModalProps) \=> (
110
110
  <IressModalProvider\>
@@ -525,7 +525,117 @@ Mode
525
525
 
526
526
  DiffOldNew
527
527
 
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>
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
+ });
529
639
 
530
640
  ### [](#speed-up-tests)Speed up tests
531
641
 
@@ -0,0 +1,4 @@
1
+ <!-- Error extracting markdown: page.goto: Timeout 30000ms exceeded.
2
+ Call log:
3
+  - navigating to "http://localhost:6006/iframe.html?viewMode=docs&id=components-popover--docs", waiting until "networkidle"
4
+ -->