@goodhood-web/nebenan-base 3.4.0-development.47 → 3.4.0-development.49
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.
- package/index.d.ts +2 -1
- package/index.js +101 -102
- package/index.mjs +16645 -13919
- package/lib/Forms/DynamicForm/DynamicForm.d.ts +1 -1
- package/lib/Forms/Fields/CodeField/CodeField.d.ts +3 -0
- package/lib/Forms/Fields/CodeField/CodeField.types.d.ts +9 -0
- package/lib/Forms/Fields/FormButton/FormButtonProps.d.ts +16 -0
- package/lib/Forms/Fields/FormCodeField.d.ts +5 -0
- package/lib/Forms/Fields/FormContentCreatorTile.d.ts +6 -0
- package/lib/Forms/Fields/FormGenderSelector.d.ts +5 -0
- package/lib/Forms/Fields/FormHeader/FormHeader.d.ts +3 -0
- package/lib/Forms/Fields/FormHeader/FormHeader.types.d.ts +10 -0
- package/lib/Forms/Fields/FormHeader/components/PhoneNumber.d.ts +4 -0
- package/lib/Forms/Fields/FormNameAbbreviation.d.ts +7 -0
- package/lib/Forms/Fields/FormPasswordField.d.ts +5 -0
- package/lib/Forms/Fields/FormPhoneInput.d.ts +5 -0
- package/lib/Forms/Fields/FormSelectInput.d.ts +12 -0
- package/lib/Forms/Fields/FormTextInput.d.ts +1 -1
- package/lib/Forms/Fields/GenderSelector/GenderSelector.d.ts +3 -0
- package/lib/Forms/Fields/GenderSelector/GenderSelector.types.d.ts +19 -0
- package/lib/Forms/Fields/GenderSelector/GenderSelector.utils.d.ts +4 -0
- package/lib/Forms/Fields/NameAbbreviation/NameAbbreviation.d.ts +3 -0
- package/lib/Forms/Fields/NameAbbreviation/NameAbbreviation.types.d.ts +11 -0
- package/lib/Forms/Fields/PasswordField/PasswordField.d.ts +3 -0
- package/lib/Forms/Fields/PasswordField/PasswordField.types.d.ts +16 -0
- package/lib/Forms/Fields/PasswordField/utils.d.ts +1 -0
- package/lib/Forms/Fields/PhoneInput/PhoneInput.d.ts +3 -0
- package/lib/Forms/Fields/PhoneInput/PhoneInput.types.d.ts +16 -0
- package/lib/Forms/Fields/PhoneInput/util.d.ts +153 -0
- package/lib/Forms/Fields/SelectInput/SelectInput.d.ts +3 -0
- package/lib/Forms/Fields/SelectInput/SelectInput.types.d.ts +31 -0
- package/lib/Forms/Fields/SelectInput/components/Input/Input.d.ts +3 -0
- package/lib/Forms/Fields/SelectInput/components/Input/Input.type.d.ts +5 -0
- package/lib/Forms/Fields/SelectInput/components/OptionsList/OptionsList.d.ts +3 -0
- package/lib/Forms/Fields/SelectInput/components/OptionsList/OptionsList.types.d.ts +11 -0
- package/lib/Forms/Fields/SelectInput/utils.d.ts +4 -0
- package/lib/Forms/Fields/index.d.ts +3 -1
- package/lib/Forms/Fields/utils.d.ts +1 -0
- package/lib/Forms/Form/Form.d.ts +1 -1
- package/lib/Forms/Form/Form.types.d.ts +12 -3
- package/lib/Forms/Form/utils/parseApiErrors.d.ts +5 -0
- package/lib/Forms/Form/utils/utils.d.ts +4 -0
- package/lib/Forms/Form.store.d.ts +7 -0
- package/lib/Forms/GridForm/GridForm.d.ts +1 -1
- package/lib/Forms/Wizard/Wizard.d.ts +1 -1
- package/lib/Forms/Wizard/Wizard.types.d.ts +70 -4
- package/lib/Forms/Wizard/WizardContext.d.ts +8 -1
- package/lib/Forms/Wizard/useWizard.d.ts +6 -1
- package/lib/Grids/Grid/Grid.types.d.ts +6 -5
- package/lib/Grids/Grid/GridItem/GridItem.d.ts +1 -1
- package/lib/Grids/Grid/GridItem/GridItem.types.d.ts +1 -0
- package/lib/MobileLayout/MobileLayout.types.d.ts +1 -0
- package/lib/Registration/Registration.d.ts +3 -0
- package/lib/Registration/Registration.store.d.ts +4 -0
- package/lib/Registration/Registration.types.d.ts +17 -0
- package/lib/Registration/RegistrationCard/RegistrationCard.d.ts +9 -0
- package/lib/Registration/RegistrationFieldMappings/RegistrationFieldMappings.d.ts +3 -0
- package/lib/Registration/RegistrationForm/FieldMappings/FieldMappings.d.ts +3 -0
- package/lib/Registration/RegistrationForm/RegistrationForm.d.ts +3 -0
- package/lib/Registration/RegistrationForm/RegistrationForm.types.d.ts +5 -0
- package/lib/Registration/RegistrationForm/Steps/Address.d.ts +2 -0
- package/lib/Registration/RegistrationForm/Steps/Email.d.ts +3 -0
- package/lib/Registration/RegistrationForm/Steps/Name.d.ts +2 -0
- package/lib/Registration/RegistrationForm/Steps/index.d.ts +4 -0
- package/lib/Registration/RegistrationForm/network.d.ts +4 -0
- package/lib/Registration/VerificationForm/FieldMappings/FieldMappings.d.ts +3 -0
- package/lib/Registration/VerificationForm/Steps/Gps.d.ts +3 -0
- package/lib/Registration/VerificationForm/Steps/InviteCode.d.ts +3 -0
- package/lib/Registration/VerificationForm/Steps/Methods.d.ts +3 -0
- package/lib/Registration/VerificationForm/Steps/PostalCode.d.ts +3 -0
- package/lib/Registration/VerificationForm/Steps/PostalCodeRequested.d.ts +2 -0
- package/lib/Registration/VerificationForm/Steps/Sms.d.ts +3 -0
- package/lib/Registration/VerificationForm/Steps/SmsCode.d.ts +3 -0
- package/lib/Registration/VerificationForm/Steps/index.d.ts +7 -0
- package/lib/Registration/VerificationForm/VerificationForm.d.ts +3 -0
- package/lib/Registration/VerificationForm/VerificationForm.types.d.ts +10 -0
- package/lib/Registration/VerificationForm/data.d.ts +553 -0
- package/lib/Registration/VerificationForm/network.d.ts +7 -0
- package/lib/Registration/VerificationForm/utils.d.ts +67 -0
- package/lib/Registration/components/MandatoryEmailConfirmation/MandatoryEmailConfirmation.d.ts +3 -0
- package/lib/Registration/components/MandatoryEmailConfirmation/MandatoryEmailConfirmation.types.d.ts +3 -0
- package/lib/Registration/components/MandatoryEmailConfirmation/utils.d.ts +4 -0
- package/lib/Registration/components/SuccessScreen/SuccessScreen.d.ts +2 -0
- package/lib/Registration/utils.d.ts +2 -0
- package/package.json +1 -1
- package/style.css +1 -1
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { TGridSpacing } from '../../Grids/Grid/Grid.types';
|
|
2
3
|
import { GridItemProps } from '../../Grids/Grid/GridItem/GridItem.types';
|
|
4
|
+
import { FormButtonProps } from '../Fields/FormButton/FormButtonProps';
|
|
5
|
+
import { FormCodeInputProps } from '../Fields/FormCodeField';
|
|
6
|
+
import { FormContentCreatorTileProps } from '../Fields/FormContentCreatorTile';
|
|
7
|
+
import { FormGenderSelectorProps } from '../Fields/FormGenderSelector';
|
|
8
|
+
import { FormHeaderProps } from '../Fields/FormHeader/FormHeader.types';
|
|
9
|
+
import { FormNameAbbreviationProps } from '../Fields/FormNameAbbreviation';
|
|
10
|
+
import { FormPasswordFieldProps } from '../Fields/FormPasswordField';
|
|
11
|
+
import { FormPhoneInputProps } from '../Fields/FormPhoneInput';
|
|
12
|
+
import { FormSelectInputProps } from '../Fields/FormSelectInput';
|
|
3
13
|
import { FormTextInputProps } from '../Fields/FormTextInput';
|
|
14
|
+
import { FormToggleInputProps } from '../Fields/FormToggleInput';
|
|
4
15
|
import { FormProps } from '../Form/Form.types';
|
|
5
16
|
export type FieldValueMap = {
|
|
6
17
|
text: string;
|
|
@@ -13,11 +24,12 @@ type OnlyStrictFields<T extends readonly unknown[]> = Extract<T[number], StrictF
|
|
|
13
24
|
export type InferFormData<T extends readonly unknown[]> = {
|
|
14
25
|
[Field in OnlyStrictFields<T> as Field['name']]: FieldValueMap[Field['type']];
|
|
15
26
|
};
|
|
16
|
-
type StepType = 'text' | 'submit' | 'slot';
|
|
27
|
+
type StepType = 'text' | 'submit' | 'slot' | 'selectInput' | 'formHeader' | 'button' | 'password' | 'genderSelector' | 'codeField' | 'tileButton' | 'nameAbbr' | 'toggle' | 'phoneInput';
|
|
17
28
|
export type StepField = {
|
|
18
29
|
id: string;
|
|
19
30
|
layout?: {
|
|
20
31
|
desktop?: GridItemProps['desktop'];
|
|
32
|
+
gapTop?: GridItemProps['gapTop'];
|
|
21
33
|
mobile?: GridItemProps['mobile'];
|
|
22
34
|
};
|
|
23
35
|
type: StepType;
|
|
@@ -25,22 +37,76 @@ export type StepField = {
|
|
|
25
37
|
export type TextField = StepField & FormTextInputProps & {
|
|
26
38
|
type: 'text';
|
|
27
39
|
};
|
|
40
|
+
export type FormHeaderField = StepField & {
|
|
41
|
+
fieldConfig: FormHeaderProps;
|
|
42
|
+
type: 'formHeader';
|
|
43
|
+
};
|
|
44
|
+
export type GenderSelectorField = StepField & FormGenderSelectorProps & {
|
|
45
|
+
type: 'genderSelector';
|
|
46
|
+
};
|
|
47
|
+
export type SelectInputField = StepField & {
|
|
48
|
+
fieldConfig: FormSelectInputProps;
|
|
49
|
+
type: 'selectInput';
|
|
50
|
+
};
|
|
51
|
+
export type PhoneInputField = StepField & {
|
|
52
|
+
fieldConfig: FormPhoneInputProps;
|
|
53
|
+
type: 'phoneInput';
|
|
54
|
+
};
|
|
55
|
+
export type ContentCreatorTileField = StepField & {
|
|
56
|
+
fieldConfig: Omit<FormContentCreatorTileProps, 'selected'>;
|
|
57
|
+
type: 'tileButton';
|
|
58
|
+
};
|
|
59
|
+
export type ToggleField = StepField & FormToggleInputProps & {
|
|
60
|
+
type: 'toggle';
|
|
61
|
+
};
|
|
62
|
+
export type ButtonField = StepField & {
|
|
63
|
+
fieldConfig: Omit<FormButtonProps, 'id'>;
|
|
64
|
+
type: 'button';
|
|
65
|
+
};
|
|
66
|
+
export type PasswordField = StepField & FormPasswordFieldProps & {
|
|
67
|
+
type: 'password';
|
|
68
|
+
};
|
|
69
|
+
export type NameAbbreviationField = StepField & FormNameAbbreviationProps & {
|
|
70
|
+
type: 'nameAbbr';
|
|
71
|
+
};
|
|
28
72
|
export type SubmitField = StepField & {
|
|
73
|
+
fieldConfig?: {
|
|
74
|
+
label?: string;
|
|
75
|
+
};
|
|
29
76
|
type: 'submit';
|
|
30
77
|
};
|
|
78
|
+
export type CodeField = StepField & {
|
|
79
|
+
fieldConfig: FormCodeInputProps;
|
|
80
|
+
type: 'codeField';
|
|
81
|
+
};
|
|
31
82
|
export type SlotField = StepField & {
|
|
32
83
|
render: ({ key }: {
|
|
33
84
|
key: string;
|
|
34
85
|
}) => ReactNode;
|
|
35
86
|
type: 'slot';
|
|
36
87
|
};
|
|
37
|
-
export type FormField = TextField | SubmitField | SlotField;
|
|
88
|
+
export type FormField = TextField | FormHeaderField | GenderSelectorField | SelectInputField | PasswordField | ToggleField | ButtonField | NameAbbreviationField | ContentCreatorTileField | SubmitField | CodeField | SlotField | PhoneInputField;
|
|
38
89
|
export type WizardStepT = {
|
|
90
|
+
canGoBack?: boolean;
|
|
91
|
+
canGoNext?: boolean;
|
|
39
92
|
fields: FormField[];
|
|
40
|
-
|
|
41
|
-
|
|
93
|
+
formError?: WizardProps['formError'];
|
|
94
|
+
formFieldMap?: Record<string, (field: FormField) => ReactNode | JSX.Element>;
|
|
95
|
+
formKey?: string;
|
|
96
|
+
id: string;
|
|
97
|
+
onSubmit?: FormProps<InferFormData<FormField[]>>['onSubmit'];
|
|
98
|
+
spacing?: TGridSpacing;
|
|
99
|
+
validationMode?: FormProps<InferFormData<FormField[]>>['validationMode'];
|
|
100
|
+
validationSchema?: FormProps<InferFormData<FormField[]>>['validationSchema'];
|
|
42
101
|
};
|
|
43
102
|
export type WizardProps = {
|
|
103
|
+
excludedSteps?: WizardStepT['id'][];
|
|
104
|
+
formError?: string | null;
|
|
105
|
+
formFieldMap?: Record<string, (field: FormField) => ReactNode | JSX.Element>;
|
|
106
|
+
formWrapper?: (props: ReactNode) => ReactNode;
|
|
107
|
+
id: string;
|
|
108
|
+
initialStep?: number | WizardStepT['id'];
|
|
109
|
+
onStepChange?: () => void;
|
|
44
110
|
steps: WizardStepT[];
|
|
45
111
|
};
|
|
46
112
|
export {};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import { OnFormSubmitType } from '../Form/Form.types';
|
|
2
|
+
import { FormField, InferFormData, WizardStepT } from './Wizard.types';
|
|
1
3
|
type TWizardContext = {
|
|
4
|
+
currentStep: number;
|
|
5
|
+
currentStepData: WizardStepT;
|
|
6
|
+
goToStep: (stepId: string, prevStepId?: string) => void;
|
|
2
7
|
next: () => void;
|
|
3
|
-
|
|
8
|
+
onSubmitStep: (data: OnFormSubmitType<InferFormData<FormField[]>>) => Promise<boolean | undefined>;
|
|
9
|
+
prevStep: string;
|
|
4
10
|
previous: () => void;
|
|
11
|
+
totalSteps: number;
|
|
5
12
|
};
|
|
6
13
|
export declare const WizardContext: import('react').Context<TWizardContext>;
|
|
7
14
|
export declare const WizardProvider: import('react').Provider<TWizardContext>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export declare const useWizard: () => {
|
|
2
|
+
currentStep: number;
|
|
3
|
+
currentStepData: import('./Wizard.types').WizardStepT;
|
|
4
|
+
goToStep: (stepId: string, prevStepId?: string) => void;
|
|
2
5
|
next: () => void;
|
|
3
|
-
|
|
6
|
+
onSubmitStep: (data: import('../Form/Form.types').OnFormSubmitType<import('./Wizard.types').InferFormData<import('./Wizard.types').FormField[]>>) => Promise<boolean | undefined>;
|
|
7
|
+
prevStep: string;
|
|
4
8
|
previous: () => void;
|
|
9
|
+
totalSteps: number;
|
|
5
10
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export declare const gridSpacing: string[];
|
|
3
|
-
export type
|
|
3
|
+
export type TGridSpacingBase = (typeof gridSpacing)[number];
|
|
4
|
+
export type TGridSpacing = TGridSpacingBase | {
|
|
5
|
+
x: TGridSpacingBase;
|
|
6
|
+
y: TGridSpacingBase;
|
|
7
|
+
};
|
|
4
8
|
export type GridProps = {
|
|
5
9
|
children: ReactNode;
|
|
6
|
-
spacing?: TGridSpacing
|
|
7
|
-
x: TGridSpacing;
|
|
8
|
-
y: TGridSpacing;
|
|
9
|
-
};
|
|
10
|
+
spacing?: TGridSpacing;
|
|
10
11
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GridItemProps } from './GridItem.types';
|
|
2
|
-
export declare const GridItem: ({ children, desktop, mobile }: GridItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const GridItem: ({ children, desktop, gapTop, mobile, }: GridItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default GridItem;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RegistrationProps } from './Registration.types';
|
|
2
|
+
declare const Registration: ({ fetchProfile, initialForm, initialFormStep, onRegistrationSubmit, onVerificationSubmit, registrationToken, status, }: RegistrationProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default Registration;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PrimitiveAtom, WritableAtom } from 'jotai';
|
|
2
|
+
import { RESET } from 'jotai/utils';
|
|
3
|
+
export declare const getAtom: <T>(key: string, storage?: boolean, defaultValue?: T, sessionStorage?: boolean) => PrimitiveAtom<T>;
|
|
4
|
+
export declare function withReset<T>(atom: PrimitiveAtom<T>): WritableAtom<T, [typeof RESET], void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RegistrationResponse, VerificationMethods, VerificationSMSResponse } from '../../../../api/src/lib/core';
|
|
2
|
+
export declare enum State {
|
|
3
|
+
EMAIL_CONFIRMATION = "EMAIL_CONFIRMATION",
|
|
4
|
+
REGISTRATION_FORM = "REGISTRATION_FORM",
|
|
5
|
+
VERIFICATION_FORM = "VERIFICATION_FORM"
|
|
6
|
+
}
|
|
7
|
+
export interface RegistrationProps {
|
|
8
|
+
fetchProfile: () => void;
|
|
9
|
+
initialForm?: keyof typeof State;
|
|
10
|
+
initialFormStep?: string | number;
|
|
11
|
+
onRegistrationSubmit: (data: RegistrationResponse) => void;
|
|
12
|
+
onVerificationSubmit: (data?: VerificationSMSResponse) => void;
|
|
13
|
+
registrationToken: string | null;
|
|
14
|
+
status: {
|
|
15
|
+
verification_methods: VerificationMethods;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
declare const RegistrationCard: ({ children, progressBar, }: {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
progressBar?: {
|
|
5
|
+
currentStep?: number;
|
|
6
|
+
steps?: number;
|
|
7
|
+
};
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default RegistrationCard;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RegistrationResponse } from '../../../../../api/src/lib/core';
|
|
2
|
+
import { FormField, InferFormData } from '../../Forms';
|
|
3
|
+
import { OnFormSubmitType } from '../../Forms/Form/Form.types';
|
|
4
|
+
export declare const handleRegistration: (data: OnFormSubmitType<InferFormData<FormField[]>>, onSubmit: (data: RegistrationResponse) => void, setFormError: (error: string | null) => void, setUserEmail: (value: string) => void) => Promise<boolean | undefined>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getInviteCodeMethod } from './InviteCode';
|
|
2
|
+
import { getMethods } from './Methods';
|
|
3
|
+
import { getPostalCodeMethod } from './PostalCode';
|
|
4
|
+
import { getPostalCodeRequested } from './PostalCodeRequested';
|
|
5
|
+
import { getSmsMethod } from './Sms';
|
|
6
|
+
import { getSmsCodeMethod } from './SmsCode';
|
|
7
|
+
export { getSmsMethod, getSmsCodeMethod, getPostalCodeMethod, getInviteCodeMethod, getMethods, getPostalCodeRequested, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VerificationMethods, VerificationSMSResponse } from '../../../../../api/src/lib/core';
|
|
2
|
+
export interface VerificationFormProps {
|
|
3
|
+
fetchProfile: () => void;
|
|
4
|
+
initialStep?: string | number;
|
|
5
|
+
onSubmit: (data?: VerificationSMSResponse) => void;
|
|
6
|
+
status: {
|
|
7
|
+
verification_methods: VerificationMethods;
|
|
8
|
+
};
|
|
9
|
+
token: string | null;
|
|
10
|
+
}
|