@zealicsolutions/web-ui 0.3.1 → 0.3.3-2.2125

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. package/dist/cjs/index.js +26 -31
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/src/atoms/Buttons/Buttons.stories.d.ts +4 -4
  4. package/dist/cjs/src/atoms/Buttons/IconButton.d.ts +1 -1
  5. package/dist/cjs/src/atoms/Circle/Circle.d.ts +1 -0
  6. package/dist/cjs/src/atoms/GoogleMap/GoogleMap.d.ts +2 -13
  7. package/dist/cjs/src/atoms/Input/Input.d.ts +3 -1
  8. package/dist/cjs/src/atoms/Input/Input.stories.d.ts +1 -1
  9. package/dist/cjs/src/atoms/Input/helpers.d.ts +18 -0
  10. package/dist/cjs/src/atoms/RadioButtons/RadioButtons.d.ts +40 -21
  11. package/dist/cjs/src/atoms/RadioButtons/RadioButtons.stories.d.ts +22 -8
  12. package/dist/cjs/src/atoms/RadioButtons/RadioOption.d.ts +6 -3
  13. package/dist/cjs/src/atoms/RadioButtons/helpers.d.ts +9 -3
  14. package/dist/cjs/src/atoms/RadioButtons/styles.d.ts +7 -7
  15. package/dist/cjs/src/atoms/RichTextViewer/types.d.ts +1 -0
  16. package/dist/cjs/src/atoms/Select/Select.d.ts +19 -14
  17. package/dist/cjs/src/atoms/Select/Select.stories.d.ts +14 -1
  18. package/dist/cjs/src/containers/Container.d.ts +38 -2
  19. package/dist/cjs/src/containers/FormStepContainer.d.ts +6 -0
  20. package/dist/cjs/src/containers/MoleculeItem.d.ts +2 -1
  21. package/dist/cjs/src/containers/hooks/index.d.ts +1 -0
  22. package/dist/cjs/src/containers/hooks/useCheckCondition.d.ts +11 -0
  23. package/dist/cjs/src/containers/hooks/useCheckCondition.test.d.ts +1 -0
  24. package/dist/cjs/src/containers/mock-data.d.ts +2 -0
  25. package/dist/cjs/src/containers/styles.d.ts +2 -3
  26. package/dist/cjs/src/containers/types/moleculeTypes.d.ts +98 -39
  27. package/dist/cjs/src/containers/types/types.d.ts +34 -8
  28. package/dist/cjs/src/contexts/ButtonActionsContext/ButtonActionsContext.d.ts +11 -0
  29. package/dist/cjs/src/contexts/ButtonActionsContext/ButtonActionsContextProvider.d.ts +11 -0
  30. package/dist/cjs/src/contexts/FormStepContext/FormStepContext.d.ts +13 -0
  31. package/dist/cjs/src/contexts/FormStepContext/FormStepContextProvider.d.ts +5 -0
  32. package/dist/cjs/src/contexts/FormStepContext/utils.d.ts +2 -0
  33. package/dist/cjs/src/contexts/MlrRichTextViewerContext/types.d.ts +3 -0
  34. package/dist/cjs/src/contexts/OrganismContext/OrganismContext.d.ts +8 -0
  35. package/dist/cjs/src/contexts/OrganismContext/OrganismContextProvider.d.ts +6 -0
  36. package/dist/cjs/src/contexts/OrganismContext/utils.d.ts +5 -0
  37. package/dist/cjs/src/contexts/hooks/index.d.ts +4 -0
  38. package/dist/cjs/src/contexts/hooks/useButtonActionsContext.d.ts +1 -0
  39. package/dist/cjs/src/contexts/hooks/useFormStepContext.d.ts +1 -0
  40. package/dist/cjs/src/contexts/hooks/useOrganismContext.d.ts +1 -0
  41. package/dist/cjs/src/contexts/index.d.ts +5 -0
  42. package/dist/cjs/src/fieldsConfiguration/types.d.ts +1 -1
  43. package/dist/cjs/src/helpers/validations.d.ts +9 -0
  44. package/dist/cjs/src/molecules/Button/Button.d.ts +1 -2
  45. package/dist/cjs/src/molecules/Button/Button.stories.d.ts +2 -2
  46. package/dist/cjs/src/molecules/CheckboxField/CheckboxField.d.ts +5 -3
  47. package/dist/cjs/src/molecules/CheckboxField/CheckboxField.stories.d.ts +21 -3
  48. package/dist/cjs/src/molecules/CheckboxField/CheckboxGroup.d.ts +5 -1
  49. package/dist/cjs/src/molecules/Consent/Consent.d.ts +28 -0
  50. package/dist/cjs/src/molecules/Consent/Consent.stories.d.ts +9 -0
  51. package/dist/cjs/src/{organisms → molecules}/Consent/ConsentCapture.d.ts +2 -1
  52. package/dist/cjs/src/molecules/Consent/ConsentMolecule.d.ts +3 -0
  53. package/dist/cjs/src/{organisms → molecules}/Consent/consentMock.d.ts +2 -2
  54. package/dist/cjs/src/molecules/Drawer/Drawer.stories.d.ts +2 -2
  55. package/dist/cjs/src/molecules/Image/Image.d.ts +3 -2
  56. package/dist/cjs/src/molecules/Image/Image.stories.d.ts +1 -1
  57. package/dist/cjs/src/molecules/InputField/InputField.d.ts +3 -1
  58. package/dist/cjs/src/molecules/InputField/InputField.stories.d.ts +21 -3
  59. package/dist/cjs/src/molecules/PdfDocument/PdfDocument.d.ts +1 -2
  60. package/dist/cjs/src/molecules/RadioButtonField/RadioButtonField.d.ts +45 -17
  61. package/dist/cjs/src/molecules/RadioButtonField/RadioButtonField.stories.d.ts +53 -11
  62. package/dist/cjs/src/molecules/SelectField/SelectField.d.ts +3 -1
  63. package/dist/cjs/src/molecules/SelectField/SelectField.stories.d.ts +35 -4
  64. package/dist/cjs/src/molecules/TabGroup/TabGroup.d.ts +2 -4
  65. package/dist/cjs/src/molecules/TabGroup/styles.d.ts +3 -3
  66. package/dist/cjs/src/molecules/Video/Video.d.ts +3 -1
  67. package/dist/cjs/src/molecules/Video/Video.stories.d.ts +2 -2
  68. package/dist/cjs/src/molecules/ZealUIModal/ZealUIModal.d.ts +20 -0
  69. package/dist/cjs/src/molecules/ZealUIModal/ZealUIModal.stories.d.ts +9 -0
  70. package/dist/cjs/src/molecules/index.d.ts +2 -0
  71. package/dist/cjs/src/organisms/AcquisitionForm/AcquisitionForm.d.ts +1 -1
  72. package/dist/cjs/src/organisms/AcquisitionForm/AcquisitionForm.stories.d.ts +2 -2
  73. package/dist/cjs/src/organisms/FeedContent/styles.d.ts +1 -1
  74. package/dist/cjs/src/organisms/LoginForm/LoginForm.d.ts +1 -1
  75. package/dist/cjs/src/organisms/LoginForm/LoginForm.stories.d.ts +2 -2
  76. package/dist/cjs/src/organisms/index.d.ts +0 -1
  77. package/dist/cjs/src/typescript.d.ts +6 -0
  78. package/dist/esm/index.js +26 -31
  79. package/dist/esm/index.js.map +1 -1
  80. package/dist/esm/src/atoms/Buttons/Buttons.stories.d.ts +4 -4
  81. package/dist/esm/src/atoms/Buttons/IconButton.d.ts +1 -1
  82. package/dist/esm/src/atoms/Circle/Circle.d.ts +1 -0
  83. package/dist/esm/src/atoms/GoogleMap/GoogleMap.d.ts +2 -13
  84. package/dist/esm/src/atoms/Input/Input.d.ts +3 -1
  85. package/dist/esm/src/atoms/Input/Input.stories.d.ts +1 -1
  86. package/dist/esm/src/atoms/Input/helpers.d.ts +18 -0
  87. package/dist/esm/src/atoms/RadioButtons/RadioButtons.d.ts +40 -21
  88. package/dist/esm/src/atoms/RadioButtons/RadioButtons.stories.d.ts +22 -8
  89. package/dist/esm/src/atoms/RadioButtons/RadioOption.d.ts +6 -3
  90. package/dist/esm/src/atoms/RadioButtons/helpers.d.ts +9 -3
  91. package/dist/esm/src/atoms/RadioButtons/styles.d.ts +7 -7
  92. package/dist/esm/src/atoms/RichTextViewer/types.d.ts +1 -0
  93. package/dist/esm/src/atoms/Select/Select.d.ts +19 -14
  94. package/dist/esm/src/atoms/Select/Select.stories.d.ts +14 -1
  95. package/dist/esm/src/containers/Container.d.ts +38 -2
  96. package/dist/esm/src/containers/FormStepContainer.d.ts +6 -0
  97. package/dist/esm/src/containers/MoleculeItem.d.ts +2 -1
  98. package/dist/esm/src/containers/hooks/index.d.ts +1 -0
  99. package/dist/esm/src/containers/hooks/useCheckCondition.d.ts +11 -0
  100. package/dist/esm/src/containers/hooks/useCheckCondition.test.d.ts +1 -0
  101. package/dist/esm/src/containers/mock-data.d.ts +2 -0
  102. package/dist/esm/src/containers/styles.d.ts +2 -3
  103. package/dist/esm/src/containers/types/moleculeTypes.d.ts +98 -39
  104. package/dist/esm/src/containers/types/types.d.ts +34 -8
  105. package/dist/esm/src/contexts/ButtonActionsContext/ButtonActionsContext.d.ts +11 -0
  106. package/dist/esm/src/contexts/ButtonActionsContext/ButtonActionsContextProvider.d.ts +11 -0
  107. package/dist/esm/src/contexts/FormStepContext/FormStepContext.d.ts +13 -0
  108. package/dist/esm/src/contexts/FormStepContext/FormStepContextProvider.d.ts +5 -0
  109. package/dist/esm/src/contexts/FormStepContext/utils.d.ts +2 -0
  110. package/dist/esm/src/contexts/MlrRichTextViewerContext/types.d.ts +3 -0
  111. package/dist/esm/src/contexts/OrganismContext/OrganismContext.d.ts +8 -0
  112. package/dist/esm/src/contexts/OrganismContext/OrganismContextProvider.d.ts +6 -0
  113. package/dist/esm/src/contexts/OrganismContext/utils.d.ts +5 -0
  114. package/dist/esm/src/contexts/hooks/index.d.ts +4 -0
  115. package/dist/esm/src/contexts/hooks/useButtonActionsContext.d.ts +1 -0
  116. package/dist/esm/src/contexts/hooks/useFormStepContext.d.ts +1 -0
  117. package/dist/esm/src/contexts/hooks/useOrganismContext.d.ts +1 -0
  118. package/dist/esm/src/contexts/index.d.ts +5 -0
  119. package/dist/esm/src/fieldsConfiguration/types.d.ts +1 -1
  120. package/dist/esm/src/helpers/validations.d.ts +9 -0
  121. package/dist/esm/src/molecules/Button/Button.d.ts +1 -2
  122. package/dist/esm/src/molecules/Button/Button.stories.d.ts +2 -2
  123. package/dist/esm/src/molecules/CheckboxField/CheckboxField.d.ts +5 -3
  124. package/dist/esm/src/molecules/CheckboxField/CheckboxField.stories.d.ts +21 -3
  125. package/dist/esm/src/molecules/CheckboxField/CheckboxGroup.d.ts +5 -1
  126. package/dist/esm/src/molecules/Consent/Consent.d.ts +28 -0
  127. package/dist/esm/src/molecules/Consent/Consent.stories.d.ts +9 -0
  128. package/dist/esm/src/{organisms → molecules}/Consent/ConsentCapture.d.ts +2 -1
  129. package/dist/esm/src/molecules/Consent/ConsentMolecule.d.ts +3 -0
  130. package/dist/esm/src/{organisms → molecules}/Consent/consentMock.d.ts +2 -2
  131. package/dist/esm/src/molecules/Drawer/Drawer.stories.d.ts +2 -2
  132. package/dist/esm/src/molecules/Image/Image.d.ts +3 -2
  133. package/dist/esm/src/molecules/Image/Image.stories.d.ts +1 -1
  134. package/dist/esm/src/molecules/InputField/InputField.d.ts +3 -1
  135. package/dist/esm/src/molecules/InputField/InputField.stories.d.ts +21 -3
  136. package/dist/esm/src/molecules/PdfDocument/PdfDocument.d.ts +1 -2
  137. package/dist/esm/src/molecules/RadioButtonField/RadioButtonField.d.ts +45 -17
  138. package/dist/esm/src/molecules/RadioButtonField/RadioButtonField.stories.d.ts +53 -11
  139. package/dist/esm/src/molecules/SelectField/SelectField.d.ts +3 -1
  140. package/dist/esm/src/molecules/SelectField/SelectField.stories.d.ts +35 -4
  141. package/dist/esm/src/molecules/TabGroup/TabGroup.d.ts +2 -4
  142. package/dist/esm/src/molecules/TabGroup/styles.d.ts +3 -3
  143. package/dist/esm/src/molecules/Video/Video.d.ts +3 -1
  144. package/dist/esm/src/molecules/Video/Video.stories.d.ts +2 -2
  145. package/dist/esm/src/molecules/ZealUIModal/ZealUIModal.d.ts +20 -0
  146. package/dist/esm/src/molecules/ZealUIModal/ZealUIModal.stories.d.ts +9 -0
  147. package/dist/esm/src/molecules/index.d.ts +2 -0
  148. package/dist/esm/src/organisms/AcquisitionForm/AcquisitionForm.d.ts +1 -1
  149. package/dist/esm/src/organisms/AcquisitionForm/AcquisitionForm.stories.d.ts +2 -2
  150. package/dist/esm/src/organisms/FeedContent/styles.d.ts +1 -1
  151. package/dist/esm/src/organisms/LoginForm/LoginForm.d.ts +1 -1
  152. package/dist/esm/src/organisms/LoginForm/LoginForm.stories.d.ts +2 -2
  153. package/dist/esm/src/organisms/index.d.ts +0 -1
  154. package/dist/esm/src/typescript.d.ts +6 -0
  155. package/dist/index.d.ts +438 -208
  156. package/package.json +10 -5
  157. package/dist/cjs/src/atoms/GoogleMap/GoogleMap.stories.d.ts +0 -12
  158. package/dist/cjs/src/molecules/PdfDocument/PdfDocument.stories.d.ts +0 -9
  159. package/dist/cjs/src/organisms/Consent/Consent.d.ts +0 -11
  160. package/dist/cjs/src/organisms/Consent/Consent.stories.d.ts +0 -9
  161. package/dist/esm/src/atoms/GoogleMap/GoogleMap.stories.d.ts +0 -12
  162. package/dist/esm/src/molecules/PdfDocument/PdfDocument.stories.d.ts +0 -9
  163. package/dist/esm/src/organisms/Consent/Consent.d.ts +0 -11
  164. package/dist/esm/src/organisms/Consent/Consent.stories.d.ts +0 -9
@@ -1,21 +1,50 @@
1
1
  import { SelectOption } from 'atoms';
2
- import { ButtonProps, CheckboxFieldProps, ImageProps, InputFieldProps, RadioButtonFieldProps, SelectFieldProps, TabGroupProps, TextMoleculeProps } from 'molecules';
2
+ import { AdditionalTabContainerProps, ButtonProps, CheckboxFieldProps, Consent, ImageProps, InputFieldProps, RadioButtonFieldProps, SelectFieldProps, TabGroupProps, TextMoleculeProps } from 'molecules';
3
3
  import { UseFormReturn } from 'react-hook-form';
4
- import { CSSProperties } from 'styled-components';
5
- import type { Nullable, StrictUnion } from 'typescript';
4
+ import type { AnyObject, Nullable, StrictUnion, StylesType } from 'typescript';
5
+ import { ConditionConfig, ContainerComponentProps } from './types';
6
+ export declare type ActionTypes = 'link' | 'popup' | 'drawer' | 'download' | 'submit' | 'reset' | 'destroy';
7
+ export declare type DownloadFile = {
8
+ url: string;
9
+ name: string;
10
+ };
11
+ declare type LinkAction = LinkAttributes;
12
+ declare type PopupDrawerAction = ContainerComponentProps;
13
+ declare type DownloadAction = DownloadFile;
14
+ declare type SubmitAction = AnyObject;
15
+ declare type CancelAction = AnyObject;
16
+ declare type ResetAction = AnyObject;
17
+ declare type DestroyAction = AnyObject;
18
+ declare type Action = {
19
+ type: ActionTypes;
20
+ } & Partial<{
21
+ link: LinkAction;
22
+ popup: PopupDrawerAction;
23
+ drawer: PopupDrawerAction;
24
+ download: DownloadAction;
25
+ submit: SubmitAction;
26
+ cancel: CancelAction;
27
+ reset: ResetAction;
28
+ destroy: DestroyAction;
29
+ }>;
6
30
  export declare type ImageAttributes = {
7
31
  attributeType: 'image';
8
32
  imageSource: string;
9
33
  };
10
34
  export interface TextAttributes {
35
+ id?: string;
11
36
  attributeType: 'text';
12
- isRichText: boolean;
37
+ isRichText?: boolean;
13
38
  text: string;
14
39
  }
15
40
  export interface VideoAttributes {
16
41
  attributeType: 'video';
17
42
  videoSource: string;
18
43
  }
44
+ export interface ActionAttributes {
45
+ attributeType: 'action';
46
+ action: Action;
47
+ }
19
48
  export interface LinkAttributes {
20
49
  id: string;
21
50
  attributeType: 'link';
@@ -25,6 +54,7 @@ export interface LinkAttributes {
25
54
  name: string;
26
55
  }
27
56
  export interface SelectAttributes {
57
+ id?: string;
28
58
  attributeType: 'select';
29
59
  value: string;
30
60
  options: SelectOption[];
@@ -37,56 +67,72 @@ export interface IterableAttributes {
37
67
  attributeType: 'iterable';
38
68
  options: SelectOption[];
39
69
  }
40
- export declare type MoleculeTypes = 'image' | 'text' | 'button' | 'video' | 'header_tab_group' | 'input_field' | 'select_field' | 'radio_button_field' | 'checkbox_field';
70
+ export interface DataConnectionAttributes {
71
+ id: string;
72
+ attributeType: 'data_model_field';
73
+ dataModelField: {
74
+ id: string;
75
+ fieldName: string;
76
+ code: string;
77
+ };
78
+ }
79
+ export interface ConditionConfigAttributes {
80
+ id: string;
81
+ attributeType: 'condition_config';
82
+ conditionConfig: ConditionConfig;
83
+ }
84
+ export declare type MoleculeTypes = 'image' | 'text' | 'button' | 'video' | 'header_tab_group' | 'input_field' | 'select_field' | 'radio_button_field' | 'checkbox_field' | 'consent';
41
85
  export interface BaseMolecule {
42
86
  id: string;
43
87
  instance: 'molecule';
44
88
  type: MoleculeTypes;
89
+ metadata?: AnyObject;
45
90
  }
46
91
  export interface ImageMolecule extends BaseMolecule {
47
92
  type: 'image';
48
- attributes: {
93
+ attributes: Partial<{
49
94
  image: ImageAttributes;
50
95
  altText: Omit<TextAttributes, 'isRichText'>;
51
96
  link: LinkAttributes;
52
- };
97
+ }>;
53
98
  config: {
54
- props: Omit<ImageProps, 'src' | 'link' | 'altText'>;
99
+ props?: Omit<ImageProps, 'src' | 'link' | 'altText'>;
55
100
  };
56
101
  }
57
102
  export interface TextMoleculeType extends BaseMolecule {
58
103
  type: 'text';
59
- attributes: {
104
+ attributes: Partial<{
60
105
  text: TextAttributes;
61
106
  seoStyle: SelectAttributes;
62
- };
107
+ fontVariant: SelectAttributes;
108
+ }>;
63
109
  config: {
64
- props: TextMoleculeProps;
110
+ props?: TextMoleculeProps;
65
111
  };
66
112
  }
67
113
  export interface ButtonMolecule extends BaseMolecule {
68
114
  type: 'button';
69
- attributes: {
115
+ attributes: Partial<{
70
116
  title: TextAttributes;
71
- buttonLink: LinkAttributes;
72
- };
117
+ action: ActionAttributes;
118
+ }>;
73
119
  config: {
74
- props: Partial<Omit<ButtonProps, 'disabled' | 'children' | 'link' | 'text' | 'onClick' | 'elementId'>>;
120
+ props?: Partial<Omit<ButtonProps, 'disabled' | 'children' | 'link' | 'text' | 'onClick' | 'elementId'>>;
75
121
  };
76
122
  }
77
123
  export interface VideoMolecule extends BaseMolecule {
78
124
  type: 'video';
79
- attributes: {
125
+ attributes: Partial<{
80
126
  video: VideoAttributes;
81
127
  altText: Omit<TextAttributes, 'isRichText'>;
82
128
  autoPlayVideo: BooleanAttributes;
83
129
  enableCoverImage: BooleanAttributes;
84
130
  coverImage: ImageAttributes;
85
- };
131
+ }>;
86
132
  config: {
87
133
  props: Partial<{
88
134
  width: number;
89
- styles: CSSProperties;
135
+ styles: StylesType;
90
136
  }>;
91
137
  };
92
138
  }
@@ -94,68 +140,81 @@ export interface TabGroupMolecule extends BaseMolecule {
94
140
  type: 'header_tab_group';
95
141
  config: {
96
142
  props: TabGroupProps;
97
- wide: {
98
- containerStyle?: CSSProperties;
99
- containerProps?: Record<string, unknown>;
100
- };
101
- compact: {
102
- containerStyle?: CSSProperties;
103
- containerProps?: Record<string, unknown>;
104
- };
143
+ wide: AdditionalTabContainerProps;
144
+ compact: AdditionalTabContainerProps;
105
145
  };
106
146
  }
107
147
  export interface TextInputMolecule extends BaseMolecule {
108
148
  type: 'input_field';
109
- attributes: {
149
+ attributes: Partial<{
110
150
  label: TextAttributes;
111
151
  required: BooleanAttributes;
112
152
  inputType: SelectAttributes;
113
- };
153
+ dataModelField: DataConnectionAttributes;
154
+ conditionConfig: ConditionConfigAttributes;
155
+ }>;
114
156
  config: {
115
- props: Partial<{
157
+ props?: Partial<{
116
158
  state: 'default' | 'error';
117
159
  } & InputFieldProps>;
118
160
  };
119
161
  }
120
162
  export interface SelectFieldMolecule extends BaseMolecule {
121
163
  type: 'select_field';
122
- attributes: {
164
+ attributes: Partial<{
123
165
  label: TextAttributes;
124
166
  required: BooleanAttributes;
125
167
  options: IterableAttributes;
126
- };
168
+ dataModelField: DataConnectionAttributes;
169
+ conditionConfig: ConditionConfigAttributes;
170
+ }>;
127
171
  config: {
128
- props: Partial<{
172
+ props?: Partial<{
129
173
  state: 'default' | 'error';
130
174
  } & SelectFieldProps>;
131
175
  };
132
176
  }
133
177
  export interface RadioButtonFieldMolecule extends BaseMolecule {
134
178
  type: 'radio_button_field';
135
- attributes: {
179
+ attributes: Partial<{
136
180
  label: TextAttributes;
137
181
  required: BooleanAttributes;
138
182
  options: IterableAttributes;
139
- };
183
+ dataModelField: DataConnectionAttributes;
184
+ conditionConfig: ConditionConfigAttributes;
185
+ }>;
140
186
  config: {
141
- props: Partial<{
187
+ props?: Partial<{
142
188
  state: 'default' | 'error';
143
189
  } & RadioButtonFieldProps<string>>;
144
190
  };
145
191
  }
146
192
  export interface CheckboxFieldMolecule extends BaseMolecule {
147
193
  type: 'checkbox_field';
148
- attributes: {
194
+ attributes: Partial<{
149
195
  label: TextAttributes;
150
196
  required: BooleanAttributes;
151
197
  options: IterableAttributes;
152
- };
198
+ dataModelField: DataConnectionAttributes;
199
+ conditionConfig: ConditionConfigAttributes;
200
+ }>;
153
201
  config: {
154
- props: Partial<{
202
+ props?: Partial<{
155
203
  state: 'default' | 'error';
156
204
  } & CheckboxFieldProps>;
157
205
  };
158
206
  }
159
- export declare type Molecule = StrictUnion<ImageMolecule | TextMoleculeType | ButtonMolecule | VideoMolecule | TabGroupMolecule | TextInputMolecule | SelectFieldMolecule | RadioButtonFieldMolecule | CheckboxFieldMolecule> & {
207
+ export interface ConsentFieldMolecule extends BaseMolecule {
208
+ type: 'consent';
209
+ attributes: Partial<{
210
+ consent: Partial<{
211
+ attributeType: 'consent';
212
+ consent: Consent;
213
+ required: BooleanAttributes;
214
+ }>;
215
+ }>;
216
+ }
217
+ export declare type Molecule = StrictUnion<ImageMolecule | TextMoleculeType | ButtonMolecule | VideoMolecule | TabGroupMolecule | TextInputMolecule | SelectFieldMolecule | RadioButtonFieldMolecule | CheckboxFieldMolecule | ConsentFieldMolecule> & {
160
218
  form?: UseFormReturn<any>;
161
219
  };
220
+ export {};
@@ -1,20 +1,27 @@
1
1
  import { TabGroupProps } from 'molecules';
2
2
  import { PropsWithChildren } from 'react';
3
3
  import { CSSProperties } from 'styled-components';
4
- import { Molecule } from './moleculeTypes';
5
4
  import { ValidationMode } from 'react-hook-form';
6
- import { StylesType } from 'typescript';
7
- export declare type ContainerType = 'row' | 'column' | 'slider' | 'form';
8
- export declare type ContainerPositionType = 'fixed' | 'sticky' | 'static';
5
+ import type { AnyObject, Nullable, StylesType } from 'typescript';
6
+ import { Molecule } from './moleculeTypes';
7
+ export declare type ContainerType = 'row' | 'column' | 'slider' | 'form' | 'form_step';
8
+ export declare type ContainerPositionType = 'fixed' | 'sticky' | 'static' | 'relative';
9
9
  export declare type ContainerScrollBehaviourType = 'vertical' | 'horizontal' | 'auto' | 'none';
10
+ export declare type FormStepContainerProps = {
11
+ formStepName: string;
12
+ order: number;
13
+ conditionConfig: ConditionConfig;
14
+ };
15
+ export declare type FormContainerProps = {
16
+ mode: keyof ValidationMode;
17
+ };
10
18
  export declare type ContainerPropsType = Partial<{
11
19
  position: ContainerPositionType;
12
20
  scrollBehaviour: ContainerScrollBehaviourType;
13
21
  cornerRadius: number;
14
22
  styles: StylesType;
15
- formProps: {
16
- mode: keyof ValidationMode;
17
- };
23
+ formProps: FormContainerProps;
24
+ formStepProps: FormStepContainerProps;
18
25
  }>;
19
26
  export declare type AdditionalContainerProps = Partial<{
20
27
  containerStyle: CSSProperties;
@@ -30,11 +37,30 @@ export declare type ContainerComponentProps = {
30
37
  id: string;
31
38
  instance: 'container';
32
39
  type: ContainerType;
40
+ items: (ContainerComponentProps | Molecule)[];
33
41
  config: {
34
42
  wide?: AdditionalContainerProps;
35
43
  compact?: AdditionalContainerProps;
36
44
  props?: ContainerPropsType;
37
45
  };
38
- items: (ContainerComponentProps | Molecule)[];
39
46
  tabsProps?: Pick<TabGroupProps, 'tabs' | 'activeTabKey' | 'onTabChange'>;
47
+ metadata?: AnyObject;
48
+ attributes?: AnyObject;
49
+ containerLibraryId?: string;
50
+ };
51
+ export declare type CriteriaType = 'operator' | 'condition';
52
+ export declare type ConditionCriteria = {
53
+ id: string;
54
+ type: CriteriaType;
55
+ operator: string;
56
+ dataFieldId: Nullable<string>;
57
+ dataFieldName: Nullable<string>;
58
+ dataValue: Nullable<string>;
59
+ connectedTo: Nullable<string>;
40
60
  };
61
+ export declare type SegmentationType = 'simple' | 'advanced';
62
+ export declare type ConditionConfig = Nullable<{
63
+ id: string;
64
+ segmentationType: SegmentationType;
65
+ criteriaList: ConditionCriteria[];
66
+ }>;
@@ -0,0 +1,11 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { ContainerComponentProps } from 'containers';
3
+ export declare type ButtonActionsContextType = {
4
+ actionContent?: ContainerComponentProps;
5
+ setActionContent: Dispatch<SetStateAction<ContainerComponentProps>>;
6
+ isModalVisible: boolean;
7
+ setModalVisible: Dispatch<SetStateAction<boolean>>;
8
+ isDrawerVisible: boolean;
9
+ setDrawerVisible: Dispatch<SetStateAction<boolean>>;
10
+ };
11
+ export declare const ButtonActionsContext: import("react").Context<ButtonActionsContextType>;
@@ -0,0 +1,11 @@
1
+ import { Dispatch, PropsWithChildren, SetStateAction } from 'react';
2
+ import { ContainerComponentProps } from 'containers';
3
+ export declare type ButtonActionsProviderProps = PropsWithChildren<Partial<{
4
+ actionContent: ContainerComponentProps;
5
+ setActionContent: Dispatch<SetStateAction<ContainerComponentProps>>;
6
+ isModalVisible: boolean;
7
+ setModalVisible: Dispatch<SetStateAction<boolean>>;
8
+ setDrawerVisible: Dispatch<SetStateAction<boolean>>;
9
+ isDrawerVisible: boolean;
10
+ }>>;
11
+ export declare const ButtonActionsProvider: ({ children }: ButtonActionsProviderProps) => JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ export declare type FormStepContextType = {
3
+ steps: number;
4
+ currentStep: number;
5
+ goToNextStep: () => void;
6
+ goToPrevStep: () => void;
7
+ reset: () => void;
8
+ canGoToNextStep: boolean;
9
+ canGoToPrevStep: boolean;
10
+ setStep: Dispatch<SetStateAction<number>>;
11
+ setInitSteps: Dispatch<SetStateAction<number>>;
12
+ };
13
+ export declare const FormStepContext: import("react").Context<FormStepContextType>;
@@ -0,0 +1,5 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export declare type FormStepContextProviderProps = PropsWithChildren<{
3
+ initialStepsCount?: number;
4
+ }>;
5
+ export declare const FormStepContextProvider: ({ initialStepsCount, children, }: FormStepContextProviderProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ContainerComponentProps } from 'containers';
2
+ export declare const getFormStepContainers: (items: ContainerComponentProps[]) => ContainerComponentProps[];
@@ -2,6 +2,9 @@ export declare type AnnotationsList = {
2
2
  tags: {
3
3
  id: string;
4
4
  label: string;
5
+ entityIds: string[];
6
+ moleculeIds: string[];
7
+ referencedByIds: string[];
5
8
  }[];
6
9
  links: {
7
10
  referencedById: string;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { ContainerComponentProps, Molecule } from 'containers';
3
+ import { GroupedStepItemsByStepContainer } from './utils';
4
+ export declare type OrganismContextType = {
5
+ items: (ContainerComponentProps | Molecule)[];
6
+ groupStepItemsByStepContainer: () => GroupedStepItemsByStepContainer;
7
+ };
8
+ export declare const OrganismContext: import("react").Context<OrganismContextType>;
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { ContainerComponentProps, Molecule } from 'containers';
3
+ export declare type FormStepContextProviderProps = PropsWithChildren<Partial<{
4
+ initItems: (ContainerComponentProps | Molecule)[];
5
+ }>>;
6
+ export declare const OrganismContextProvider: ({ initItems, children, }: FormStepContextProviderProps) => JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ContainerComponentProps, Molecule } from 'containers';
2
+ declare type StepItem = ContainerComponentProps | Molecule;
3
+ export declare type GroupedStepItemsByStepContainer = Map<string, StepItem[]>;
4
+ export declare const groupStepItemsByStepContainer: (items: StepItem[]) => GroupedStepItemsByStepContainer;
5
+ export {};
@@ -0,0 +1,4 @@
1
+ export { useFormStepContext } from './useFormStepContext';
2
+ export { useButtonActionsContext } from './useButtonActionsContext';
3
+ export { useMlrRichTextViewerContext } from './useMlrRichTextViewerContext';
4
+ export { useOrganismContext } from './useOrganismContext';
@@ -0,0 +1 @@
1
+ export declare const useButtonActionsContext: () => import("contexts/ButtonActionsContext/ButtonActionsContext").ButtonActionsContextType;
@@ -0,0 +1 @@
1
+ export declare const useFormStepContext: () => import("contexts/FormStepContext/FormStepContext").FormStepContextType;
@@ -0,0 +1 @@
1
+ export declare const useOrganismContext: () => import("contexts/OrganismContext/OrganismContext").OrganismContextType;
@@ -2,3 +2,8 @@ export * from './MlrRichTextViewerContext/MlrRichTextViewerProvider';
2
2
  export * from './MlrRichTextViewerContext/MlrRichTextViewerContext';
3
3
  export * from './MlrRichTextViewerContext/types';
4
4
  export * from './hooks/useMlrRichTextViewerContext';
5
+ export * from './hooks/useButtonActionsContext';
6
+ export * from './ButtonActionsContext/ButtonActionsContext';
7
+ export * from './ButtonActionsContext/ButtonActionsContextProvider';
8
+ export * from './OrganismContext/OrganismContext';
9
+ export * from './OrganismContext/OrganismContextProvider';
@@ -2,7 +2,7 @@
2
2
  import { ControllerProps } from 'react-hook-form';
3
3
  import { SelectOption } from 'atoms';
4
4
  import { InputFieldProps, SelectFieldProps } from 'molecules';
5
- export declare type InputFieldTypes = 'phone-number' | 'text' | 'email' | 'password' | 'numerical' | 'any';
5
+ export declare type InputFieldTypes = 'phone_number' | 'text' | 'email' | 'password' | 'numerical' | 'month_year_date' | 'day_month_year_date' | 'month_day_year_date' | 'us_zip_code' | 'any';
6
6
  export declare type FieldTypes = 'input' | 'select' | 'checkbox';
7
7
  export declare type UIField<T = string> = (UIInputField & UISelectField & UICheckboxField) & {
8
8
  name: T;
@@ -5,4 +5,13 @@ export declare const phoneNumberValidation: RegExp;
5
5
  export declare const numberValidation: RegExp;
6
6
  export declare const emailValidation: RegExp;
7
7
  export declare const textValidation: RegExp;
8
+ export declare const monthDayYearDateValidation: RegExp;
9
+ export declare const dayMonthYearDateValidation: RegExp;
10
+ export declare const monthYearDateValidation: RegExp;
11
+ export declare const usZipCode: RegExp;
8
12
  export declare const getInputValidation: (type?: InputFieldTypes) => ValidationRule<RegExp> | undefined;
13
+ export declare const postCodeMask: RegExp[];
14
+ export declare const dayMonthYearDateMask: (string | RegExp)[];
15
+ export declare const monthYearDateMask: (string | RegExp)[];
16
+ export declare const phoneNumberMask: (string | RegExp)[];
17
+ export declare const removeMaskFromString: (inputString: string) => string;
@@ -1,7 +1,6 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { FontSizesTypes, SizesTypes, ThemeColors } from 'theme';
3
- import type { Callback } from 'typescript';
4
- import { StylesType } from 'typescript';
3
+ import type { Callback, StylesType } from 'typescript';
5
4
  export declare type ButtonVariant = 'primary' | 'secondary' | 'text' | 'custom';
6
5
  export declare type ButtonType = 'button' | 'submit' | 'reset';
7
6
  export declare type BaseButtonProps = PropsWithChildren<{
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import type { StoryFn } from '@storybook/react';
3
- import { Button as ButtonComponent } from 'molecules/Button/Button';
3
+ import { Button as ButtonComponent } from 'molecules';
4
4
  declare const _default: {
5
5
  title: string;
6
- component: ({ text: textProp, onClick, loading, disabled, variant, isRichText, fullWidth, elementId, link, containerStyle, children, buttonStyle, size, textColor, inactiveTextColor, state, href, ...props }: import("molecules/Button/Button").ButtonProps) => JSX.Element | null;
6
+ component: ({ text: textProp, onClick, loading, disabled, variant, isRichText, fullWidth, elementId, link, containerStyle, children, buttonStyle, size, textColor, inactiveTextColor, state, href, ...props }: import("molecules").ButtonProps) => JSX.Element | null;
7
7
  };
8
8
  export default _default;
9
9
  export declare const Button: StoryFn<typeof ButtonComponent>;
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { Control, ControllerProps } from 'react-hook-form/dist/types';
3
2
  import { SelectOption } from 'atoms';
4
- import type { StylesType } from 'typescript';
5
3
  import { CheckboxInternalConfigProps } from 'atoms/Checkbox/types';
4
+ import { ConditionConfig } from 'containers';
5
+ import { Control, ControllerProps } from 'react-hook-form/dist/types';
6
+ import type { StylesType } from 'typescript';
6
7
  import { FieldLabelsProps } from '../FieldLabels/FieldLabels';
7
8
  export declare type CheckboxesProps = Partial<{
8
9
  checkboxGroupWrapperStyles: StylesType;
@@ -25,5 +26,6 @@ export declare type CheckboxFieldProps = Partial<{
25
26
  required: boolean;
26
27
  optional: boolean;
27
28
  wrapperStyles: StylesType;
29
+ conditionConfig?: ConditionConfig;
28
30
  }>;
29
- export declare const CheckboxField: ({ checkboxesProps, name, rules, control, optional, required, labelsProps, wrapperStyles, }: CheckboxFieldProps) => JSX.Element;
31
+ export declare const CheckboxField: ({ checkboxesProps, name, rules, control, optional, required, labelsProps, wrapperStyles, conditionConfig, }: CheckboxFieldProps) => JSX.Element | null;
@@ -3,7 +3,7 @@ import type { StoryFn } from '@storybook/react';
3
3
  import { CheckboxField as CheckboxFieldComponent } from 'molecules';
4
4
  declare const _default: {
5
5
  title: string;
6
- component: ({ checkboxesProps, name, rules, control, optional, required, labelsProps, wrapperStyles, }: Partial<{
6
+ component: ({ checkboxesProps, name, rules, control, optional, required, labelsProps, wrapperStyles, conditionConfig, }: Partial<{
7
7
  checkboxesProps: Partial<{
8
8
  checkboxGroupWrapperStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<object, import("styled-components").DefaultTheme>>;
9
9
  checkboxFieldWrapperStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<object, import("styled-components").DefaultTheme>>;
@@ -26,12 +26,30 @@ declare const _default: {
26
26
  }>;
27
27
  labelsProps: import("molecules").FieldLabelsProps;
28
28
  name: string;
29
- rules: Omit<import("react-hook-form").RegisterOptions<import("react-hook-form").FieldValues, string>, "disabled" | "valueAsNumber" | "valueAsDate" | "setValueAs"> | undefined;
29
+ rules: Omit<Partial<{
30
+ required: string | import("react-hook-form").ValidationRule<boolean>;
31
+ min: import("react-hook-form").ValidationRule<string | number>;
32
+ max: import("react-hook-form").ValidationRule<string | number>;
33
+ maxLength: import("react-hook-form").ValidationRule<number>;
34
+ minLength: import("react-hook-form").ValidationRule<number>;
35
+ pattern: import("react-hook-form").ValidationRule<RegExp>;
36
+ validate: import("react-hook-form").Validate<any> | Record<string, import("react-hook-form").Validate<any>>;
37
+ valueAsNumber: boolean;
38
+ valueAsDate: boolean;
39
+ value: any;
40
+ setValueAs: (value: any) => any;
41
+ shouldUnregister?: boolean | undefined;
42
+ onChange?: ((event: any) => void) | undefined;
43
+ onBlur?: ((event: any) => void) | undefined;
44
+ disabled: boolean;
45
+ deps: string | string[];
46
+ }>, "disabled" | "valueAsNumber" | "valueAsDate" | "setValueAs"> | undefined;
30
47
  control: import("react-hook-form").Control<any, any>;
31
48
  required: boolean;
32
49
  optional: boolean;
33
50
  wrapperStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<object, import("styled-components").DefaultTheme>>;
34
- }>) => JSX.Element;
51
+ conditionConfig?: import("../..").ConditionConfig | undefined;
52
+ }>) => JSX.Element | null;
35
53
  };
36
54
  export default _default;
37
55
  export declare const CheckboxField: StoryFn<typeof CheckboxFieldComponent>;
@@ -1,7 +1,11 @@
1
1
  /// <reference types="react" />
2
+ import { RefCallBack } from 'react-hook-form/dist/types';
3
+ import type { Callback } from 'typescript';
2
4
  import { CheckboxesProps } from './CheckboxField';
3
5
  export declare type CheckboxGroupProps = Partial<{
6
+ ref: RefCallBack;
7
+ onBlur: Callback;
4
8
  onChange: (checkedIds: string[]) => void;
5
9
  checkboxesProps: CheckboxesProps;
6
10
  }>;
7
- export declare const CheckboxGroup: ({ onChange, checkboxesProps }: CheckboxGroupProps) => JSX.Element;
11
+ export declare const CheckboxGroup: ({ ref, onBlur, onChange, checkboxesProps }: CheckboxGroupProps) => JSX.Element;
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ import { CustomDescendant } from 'atoms/RichTextViewer/types';
3
+ import { ConsentCaptureProps } from 'molecules/Consent/ConsentCapture';
4
+ import { CSSProperties } from 'styled-components';
5
+ export declare type ConsentCaptureMethod = 'button' | 'radioButton' | 'checkbox';
6
+ export declare type DefaultSelectionType = 'confirmation' | 'rejection';
7
+ export declare type Consent = {
8
+ id: string;
9
+ name: string;
10
+ acknowledgment: CustomDescendant[];
11
+ methodOfCapture: ConsentCaptureMethod;
12
+ description: string;
13
+ language: CustomDescendant[];
14
+ expiration: string;
15
+ confirmationButtonText: string;
16
+ rejectionButtonText: string;
17
+ defaultSelection: DefaultSelectionType;
18
+ value?: DefaultSelectionType | boolean;
19
+ isRequired?: boolean;
20
+ };
21
+ export declare type ConsentProps<T extends string = string> = {
22
+ text: string;
23
+ isRequired?: boolean;
24
+ consentCaptureProps: ConsentCaptureProps<T>;
25
+ containerStyles?: CSSProperties;
26
+ clearStyles?: boolean;
27
+ };
28
+ export declare const Consent: <T extends string>({ text, consentCaptureProps, containerStyles, clearStyles, }: ConsentProps<T>) => JSX.Element;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { StoryFn } from '@storybook/react';
3
+ import { Consent as ConsentComponent } from 'molecules/Consent/Consent';
4
+ declare const _default: {
5
+ title: string;
6
+ component: <T extends string>({ text, consentCaptureProps, containerStyles, clearStyles, }: import("molecules/Consent/Consent").ConsentProps<T>) => JSX.Element;
7
+ };
8
+ export default _default;
9
+ export declare const Consent: StoryFn<typeof ConsentComponent>;
@@ -11,10 +11,11 @@ export declare type RadioButtonsCaptureProps<T extends string> = {
11
11
  acceptValue: T;
12
12
  } & RadioButtonsProps<T>;
13
13
  export declare type CheckboxCaptureProps = {
14
+ id: string;
14
15
  type: 'checkbox';
15
16
  label: string;
16
17
  value: boolean;
17
- onChange: (value: boolean) => void;
18
+ onChange: (id: string) => void;
18
19
  };
19
20
  export declare type ConsentCaptureProps<T extends string = string> = ButtonCaptureProps | RadioButtonsCaptureProps<T> | CheckboxCaptureProps;
20
21
  export declare const ConsentCapture: <T extends string>(props: ConsentCaptureProps<T>) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ConsentFieldMolecule } from 'containers';
3
+ export declare const ConsentMolecule: (attributes: ConsentFieldMolecule['attributes']) => JSX.Element | null;