@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.
- package/dist/cjs/index.js +26 -31
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/src/atoms/Buttons/Buttons.stories.d.ts +4 -4
- package/dist/cjs/src/atoms/Buttons/IconButton.d.ts +1 -1
- package/dist/cjs/src/atoms/Circle/Circle.d.ts +1 -0
- package/dist/cjs/src/atoms/GoogleMap/GoogleMap.d.ts +2 -13
- package/dist/cjs/src/atoms/Input/Input.d.ts +3 -1
- package/dist/cjs/src/atoms/Input/Input.stories.d.ts +1 -1
- package/dist/cjs/src/atoms/Input/helpers.d.ts +18 -0
- package/dist/cjs/src/atoms/RadioButtons/RadioButtons.d.ts +40 -21
- package/dist/cjs/src/atoms/RadioButtons/RadioButtons.stories.d.ts +22 -8
- package/dist/cjs/src/atoms/RadioButtons/RadioOption.d.ts +6 -3
- package/dist/cjs/src/atoms/RadioButtons/helpers.d.ts +9 -3
- package/dist/cjs/src/atoms/RadioButtons/styles.d.ts +7 -7
- package/dist/cjs/src/atoms/RichTextViewer/types.d.ts +1 -0
- package/dist/cjs/src/atoms/Select/Select.d.ts +19 -14
- package/dist/cjs/src/atoms/Select/Select.stories.d.ts +14 -1
- package/dist/cjs/src/containers/Container.d.ts +38 -2
- package/dist/cjs/src/containers/FormStepContainer.d.ts +6 -0
- package/dist/cjs/src/containers/MoleculeItem.d.ts +2 -1
- package/dist/cjs/src/containers/hooks/index.d.ts +1 -0
- package/dist/cjs/src/containers/hooks/useCheckCondition.d.ts +11 -0
- package/dist/cjs/src/containers/hooks/useCheckCondition.test.d.ts +1 -0
- package/dist/cjs/src/containers/mock-data.d.ts +2 -0
- package/dist/cjs/src/containers/styles.d.ts +2 -3
- package/dist/cjs/src/containers/types/moleculeTypes.d.ts +98 -39
- package/dist/cjs/src/containers/types/types.d.ts +34 -8
- package/dist/cjs/src/contexts/ButtonActionsContext/ButtonActionsContext.d.ts +11 -0
- package/dist/cjs/src/contexts/ButtonActionsContext/ButtonActionsContextProvider.d.ts +11 -0
- package/dist/cjs/src/contexts/FormStepContext/FormStepContext.d.ts +13 -0
- package/dist/cjs/src/contexts/FormStepContext/FormStepContextProvider.d.ts +5 -0
- package/dist/cjs/src/contexts/FormStepContext/utils.d.ts +2 -0
- package/dist/cjs/src/contexts/MlrRichTextViewerContext/types.d.ts +3 -0
- package/dist/cjs/src/contexts/OrganismContext/OrganismContext.d.ts +8 -0
- package/dist/cjs/src/contexts/OrganismContext/OrganismContextProvider.d.ts +6 -0
- package/dist/cjs/src/contexts/OrganismContext/utils.d.ts +5 -0
- package/dist/cjs/src/contexts/hooks/index.d.ts +4 -0
- package/dist/cjs/src/contexts/hooks/useButtonActionsContext.d.ts +1 -0
- package/dist/cjs/src/contexts/hooks/useFormStepContext.d.ts +1 -0
- package/dist/cjs/src/contexts/hooks/useOrganismContext.d.ts +1 -0
- package/dist/cjs/src/contexts/index.d.ts +5 -0
- package/dist/cjs/src/fieldsConfiguration/types.d.ts +1 -1
- package/dist/cjs/src/helpers/validations.d.ts +9 -0
- package/dist/cjs/src/molecules/Button/Button.d.ts +1 -2
- package/dist/cjs/src/molecules/Button/Button.stories.d.ts +2 -2
- package/dist/cjs/src/molecules/CheckboxField/CheckboxField.d.ts +5 -3
- package/dist/cjs/src/molecules/CheckboxField/CheckboxField.stories.d.ts +21 -3
- package/dist/cjs/src/molecules/CheckboxField/CheckboxGroup.d.ts +5 -1
- package/dist/cjs/src/molecules/Consent/Consent.d.ts +28 -0
- package/dist/cjs/src/molecules/Consent/Consent.stories.d.ts +9 -0
- package/dist/cjs/src/{organisms → molecules}/Consent/ConsentCapture.d.ts +2 -1
- package/dist/cjs/src/molecules/Consent/ConsentMolecule.d.ts +3 -0
- package/dist/cjs/src/{organisms → molecules}/Consent/consentMock.d.ts +2 -2
- package/dist/cjs/src/molecules/Drawer/Drawer.stories.d.ts +2 -2
- package/dist/cjs/src/molecules/Image/Image.d.ts +3 -2
- package/dist/cjs/src/molecules/Image/Image.stories.d.ts +1 -1
- package/dist/cjs/src/molecules/InputField/InputField.d.ts +3 -1
- package/dist/cjs/src/molecules/InputField/InputField.stories.d.ts +21 -3
- package/dist/cjs/src/molecules/PdfDocument/PdfDocument.d.ts +1 -2
- package/dist/cjs/src/molecules/RadioButtonField/RadioButtonField.d.ts +45 -17
- package/dist/cjs/src/molecules/RadioButtonField/RadioButtonField.stories.d.ts +53 -11
- package/dist/cjs/src/molecules/SelectField/SelectField.d.ts +3 -1
- package/dist/cjs/src/molecules/SelectField/SelectField.stories.d.ts +35 -4
- package/dist/cjs/src/molecules/TabGroup/TabGroup.d.ts +2 -4
- package/dist/cjs/src/molecules/TabGroup/styles.d.ts +3 -3
- package/dist/cjs/src/molecules/Video/Video.d.ts +3 -1
- package/dist/cjs/src/molecules/Video/Video.stories.d.ts +2 -2
- package/dist/cjs/src/molecules/ZealUIModal/ZealUIModal.d.ts +20 -0
- package/dist/cjs/src/molecules/ZealUIModal/ZealUIModal.stories.d.ts +9 -0
- package/dist/cjs/src/molecules/index.d.ts +2 -0
- package/dist/cjs/src/organisms/AcquisitionForm/AcquisitionForm.d.ts +1 -1
- package/dist/cjs/src/organisms/AcquisitionForm/AcquisitionForm.stories.d.ts +2 -2
- package/dist/cjs/src/organisms/FeedContent/styles.d.ts +1 -1
- package/dist/cjs/src/organisms/LoginForm/LoginForm.d.ts +1 -1
- package/dist/cjs/src/organisms/LoginForm/LoginForm.stories.d.ts +2 -2
- package/dist/cjs/src/organisms/index.d.ts +0 -1
- package/dist/cjs/src/typescript.d.ts +6 -0
- package/dist/esm/index.js +26 -31
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/src/atoms/Buttons/Buttons.stories.d.ts +4 -4
- package/dist/esm/src/atoms/Buttons/IconButton.d.ts +1 -1
- package/dist/esm/src/atoms/Circle/Circle.d.ts +1 -0
- package/dist/esm/src/atoms/GoogleMap/GoogleMap.d.ts +2 -13
- package/dist/esm/src/atoms/Input/Input.d.ts +3 -1
- package/dist/esm/src/atoms/Input/Input.stories.d.ts +1 -1
- package/dist/esm/src/atoms/Input/helpers.d.ts +18 -0
- package/dist/esm/src/atoms/RadioButtons/RadioButtons.d.ts +40 -21
- package/dist/esm/src/atoms/RadioButtons/RadioButtons.stories.d.ts +22 -8
- package/dist/esm/src/atoms/RadioButtons/RadioOption.d.ts +6 -3
- package/dist/esm/src/atoms/RadioButtons/helpers.d.ts +9 -3
- package/dist/esm/src/atoms/RadioButtons/styles.d.ts +7 -7
- package/dist/esm/src/atoms/RichTextViewer/types.d.ts +1 -0
- package/dist/esm/src/atoms/Select/Select.d.ts +19 -14
- package/dist/esm/src/atoms/Select/Select.stories.d.ts +14 -1
- package/dist/esm/src/containers/Container.d.ts +38 -2
- package/dist/esm/src/containers/FormStepContainer.d.ts +6 -0
- package/dist/esm/src/containers/MoleculeItem.d.ts +2 -1
- package/dist/esm/src/containers/hooks/index.d.ts +1 -0
- package/dist/esm/src/containers/hooks/useCheckCondition.d.ts +11 -0
- package/dist/esm/src/containers/hooks/useCheckCondition.test.d.ts +1 -0
- package/dist/esm/src/containers/mock-data.d.ts +2 -0
- package/dist/esm/src/containers/styles.d.ts +2 -3
- package/dist/esm/src/containers/types/moleculeTypes.d.ts +98 -39
- package/dist/esm/src/containers/types/types.d.ts +34 -8
- package/dist/esm/src/contexts/ButtonActionsContext/ButtonActionsContext.d.ts +11 -0
- package/dist/esm/src/contexts/ButtonActionsContext/ButtonActionsContextProvider.d.ts +11 -0
- package/dist/esm/src/contexts/FormStepContext/FormStepContext.d.ts +13 -0
- package/dist/esm/src/contexts/FormStepContext/FormStepContextProvider.d.ts +5 -0
- package/dist/esm/src/contexts/FormStepContext/utils.d.ts +2 -0
- package/dist/esm/src/contexts/MlrRichTextViewerContext/types.d.ts +3 -0
- package/dist/esm/src/contexts/OrganismContext/OrganismContext.d.ts +8 -0
- package/dist/esm/src/contexts/OrganismContext/OrganismContextProvider.d.ts +6 -0
- package/dist/esm/src/contexts/OrganismContext/utils.d.ts +5 -0
- package/dist/esm/src/contexts/hooks/index.d.ts +4 -0
- package/dist/esm/src/contexts/hooks/useButtonActionsContext.d.ts +1 -0
- package/dist/esm/src/contexts/hooks/useFormStepContext.d.ts +1 -0
- package/dist/esm/src/contexts/hooks/useOrganismContext.d.ts +1 -0
- package/dist/esm/src/contexts/index.d.ts +5 -0
- package/dist/esm/src/fieldsConfiguration/types.d.ts +1 -1
- package/dist/esm/src/helpers/validations.d.ts +9 -0
- package/dist/esm/src/molecules/Button/Button.d.ts +1 -2
- package/dist/esm/src/molecules/Button/Button.stories.d.ts +2 -2
- package/dist/esm/src/molecules/CheckboxField/CheckboxField.d.ts +5 -3
- package/dist/esm/src/molecules/CheckboxField/CheckboxField.stories.d.ts +21 -3
- package/dist/esm/src/molecules/CheckboxField/CheckboxGroup.d.ts +5 -1
- package/dist/esm/src/molecules/Consent/Consent.d.ts +28 -0
- package/dist/esm/src/molecules/Consent/Consent.stories.d.ts +9 -0
- package/dist/esm/src/{organisms → molecules}/Consent/ConsentCapture.d.ts +2 -1
- package/dist/esm/src/molecules/Consent/ConsentMolecule.d.ts +3 -0
- package/dist/esm/src/{organisms → molecules}/Consent/consentMock.d.ts +2 -2
- package/dist/esm/src/molecules/Drawer/Drawer.stories.d.ts +2 -2
- package/dist/esm/src/molecules/Image/Image.d.ts +3 -2
- package/dist/esm/src/molecules/Image/Image.stories.d.ts +1 -1
- package/dist/esm/src/molecules/InputField/InputField.d.ts +3 -1
- package/dist/esm/src/molecules/InputField/InputField.stories.d.ts +21 -3
- package/dist/esm/src/molecules/PdfDocument/PdfDocument.d.ts +1 -2
- package/dist/esm/src/molecules/RadioButtonField/RadioButtonField.d.ts +45 -17
- package/dist/esm/src/molecules/RadioButtonField/RadioButtonField.stories.d.ts +53 -11
- package/dist/esm/src/molecules/SelectField/SelectField.d.ts +3 -1
- package/dist/esm/src/molecules/SelectField/SelectField.stories.d.ts +35 -4
- package/dist/esm/src/molecules/TabGroup/TabGroup.d.ts +2 -4
- package/dist/esm/src/molecules/TabGroup/styles.d.ts +3 -3
- package/dist/esm/src/molecules/Video/Video.d.ts +3 -1
- package/dist/esm/src/molecules/Video/Video.stories.d.ts +2 -2
- package/dist/esm/src/molecules/ZealUIModal/ZealUIModal.d.ts +20 -0
- package/dist/esm/src/molecules/ZealUIModal/ZealUIModal.stories.d.ts +9 -0
- package/dist/esm/src/molecules/index.d.ts +2 -0
- package/dist/esm/src/organisms/AcquisitionForm/AcquisitionForm.d.ts +1 -1
- package/dist/esm/src/organisms/AcquisitionForm/AcquisitionForm.stories.d.ts +2 -2
- package/dist/esm/src/organisms/FeedContent/styles.d.ts +1 -1
- package/dist/esm/src/organisms/LoginForm/LoginForm.d.ts +1 -1
- package/dist/esm/src/organisms/LoginForm/LoginForm.stories.d.ts +2 -2
- package/dist/esm/src/organisms/index.d.ts +0 -1
- package/dist/esm/src/typescript.d.ts +6 -0
- package/dist/index.d.ts +438 -208
- package/package.json +10 -5
- package/dist/cjs/src/atoms/GoogleMap/GoogleMap.stories.d.ts +0 -12
- package/dist/cjs/src/molecules/PdfDocument/PdfDocument.stories.d.ts +0 -9
- package/dist/cjs/src/organisms/Consent/Consent.d.ts +0 -11
- package/dist/cjs/src/organisms/Consent/Consent.stories.d.ts +0 -9
- package/dist/esm/src/atoms/GoogleMap/GoogleMap.stories.d.ts +0 -12
- package/dist/esm/src/molecules/PdfDocument/PdfDocument.stories.d.ts +0 -9
- package/dist/esm/src/organisms/Consent/Consent.d.ts +0 -11
- 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 {
|
5
|
-
import
|
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
|
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
|
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
|
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
|
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
|
-
|
72
|
-
}
|
117
|
+
action: ActionAttributes;
|
118
|
+
}>;
|
73
119
|
config: {
|
74
|
-
props
|
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:
|
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
|
-
|
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
|
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
|
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
|
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
|
202
|
+
props?: Partial<{
|
155
203
|
state: 'default' | 'error';
|
156
204
|
} & CheckboxFieldProps>;
|
157
205
|
};
|
158
206
|
}
|
159
|
-
export
|
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
|
-
|
8
|
-
export declare type
|
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
|
-
|
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,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 @@
|
|
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 = '
|
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
|
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
|
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<
|
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
|
-
|
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: (
|
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;
|