@web-site-utilities/feedback 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.
- package/LICENSE +551 -0
- package/README.md +3 -0
- package/dist/common/components/Button.d.ts +7 -0
- package/dist/common/components/Checkbox.d.ts +50 -0
- package/dist/common/components/ErrorMessage.d.ts +9 -0
- package/dist/common/components/Modal.d.ts +23 -0
- package/dist/common/components/QuestionMatrix.d.ts +40 -0
- package/dist/common/components/Radio.d.ts +51 -0
- package/dist/common/components/RangeSlide.d.ts +39 -0
- package/dist/common/components/Rating.d.ts +35 -0
- package/dist/common/components/Select.d.ts +39 -0
- package/dist/common/components/Step.d.ts +15 -0
- package/dist/common/components/StepsProgress.d.ts +17 -0
- package/dist/common/components/TextInput.d.ts +30 -0
- package/dist/common/components/Textarea.d.ts +27 -0
- package/dist/common/components/Typography.d.ts +13 -0
- package/dist/common/hooks/useForm.d.ts +21 -0
- package/dist/common/hooks/useStepper.d.ts +17 -0
- package/dist/common/theme/ThemeProvider.d.ts +114 -0
- package/dist/common/types/CommonFieldProps.d.ts +6 -0
- package/dist/common/types/FormConfig.d.ts +129 -0
- package/dist/common/types/FormError.d.ts +4 -0
- package/dist/common/types/Locale.d.ts +1 -0
- package/dist/common/types/Nullable.d.ts +1 -0
- package/dist/common/types/Option.d.ts +5 -0
- package/dist/common/types/ValidationPerStep.d.ts +6 -0
- package/dist/common/types/isNil.d.ts +2 -0
- package/dist/fields/Field/Field.d.ts +65 -0
- package/dist/form/App.d.ts +12 -0
- package/dist/form/api/baseApi.d.ts +8 -0
- package/dist/form/api/getFormConf.d.ts +8 -0
- package/dist/form/api/saveForm.d.ts +2 -0
- package/dist/form/api/useRequest.d.ts +7 -0
- package/dist/form/components/FeedbackInput/FeedbackInput.d.ts +12 -0
- package/dist/form/features/InPlaceForm/InPlaceForm.d.ts +31 -0
- package/dist/form/features/PopupForm/PopupForm.d.ts +10 -0
- package/dist/form/index.d.ts +10 -0
- package/dist/form/index.dev.d.ts +1 -0
- package/dist/form/types/InitiateFeedbackModuleOptions.d.ts +8 -0
- package/dist/index.cjs.js +148 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.es.js +3207 -0
- package/dist/index.iife.js +148 -0
- package/package.json +71 -0
- package/tsconfig.json +29 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Variants } from '../theme/ThemeProvider';
|
|
3
|
+
import { CommonFieldProps } from '../types/CommonFieldProps';
|
|
4
|
+
import { Nullable } from '../types/Nullable';
|
|
5
|
+
type QuestionMatrixItemProps = {
|
|
6
|
+
onChange: () => void;
|
|
7
|
+
colorVariant?: Variants;
|
|
8
|
+
label: string;
|
|
9
|
+
selected: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const QuestionMatrixItem: (props: QuestionMatrixItemProps) => React.DOMElement<{
|
|
12
|
+
onClick: () => void;
|
|
13
|
+
$outlined: boolean;
|
|
14
|
+
children: string;
|
|
15
|
+
}, Element>;
|
|
16
|
+
type QuestionMatrixProps = {
|
|
17
|
+
value: Nullable<number>;
|
|
18
|
+
minText?: string;
|
|
19
|
+
colorVariant?: Variants;
|
|
20
|
+
maxText?: string;
|
|
21
|
+
onChange: (value: number) => void;
|
|
22
|
+
label: string;
|
|
23
|
+
max: number;
|
|
24
|
+
} & CommonFieldProps;
|
|
25
|
+
export declare const QuestionMatrix: (props: QuestionMatrixProps) => React.DetailedReactHTMLElement<{
|
|
26
|
+
children: (React.FunctionComponentElement<{
|
|
27
|
+
variant?: "title" | "section" | "subtitle" | "subsection" | "paragraph";
|
|
28
|
+
linear?: boolean;
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
}> | React.FunctionComponentElement<{
|
|
31
|
+
errors?: import("../types/FormError").FormError[];
|
|
32
|
+
}> | React.DOMElement<{
|
|
33
|
+
withText: string | undefined;
|
|
34
|
+
children: (React.DOMElement<{
|
|
35
|
+
min: boolean;
|
|
36
|
+
children: string;
|
|
37
|
+
}, Element> | React.FunctionComponentElement<QuestionMatrixItemProps>[] | null)[];
|
|
38
|
+
}, Element>)[];
|
|
39
|
+
}, HTMLElement>;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Variants } from '../theme/ThemeProvider';
|
|
3
|
+
import { CommonFieldProps } from '../types/CommonFieldProps';
|
|
4
|
+
import { Nullable } from '../types/Nullable';
|
|
5
|
+
import { Options } from '../types/Option';
|
|
6
|
+
type RadioProps = {
|
|
7
|
+
label: string;
|
|
8
|
+
onSelect: (value: string) => void;
|
|
9
|
+
colorVariant?: Variants | undefined;
|
|
10
|
+
value: Nullable<string>;
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const Radio: (props: RadioProps) => React.DOMElement<{
|
|
15
|
+
selected: boolean;
|
|
16
|
+
htmlFor: string;
|
|
17
|
+
children: (React.FunctionComponentElement<{
|
|
18
|
+
variant?: "title" | "section" | "subtitle" | "subsection" | "paragraph";
|
|
19
|
+
linear?: boolean;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
}> | React.DOMElement<{
|
|
22
|
+
id: string;
|
|
23
|
+
type: string;
|
|
24
|
+
variant: Variants | undefined;
|
|
25
|
+
selected: boolean;
|
|
26
|
+
onChange: () => void;
|
|
27
|
+
name: string;
|
|
28
|
+
}, Element>)[];
|
|
29
|
+
}, Element>;
|
|
30
|
+
type CheckboxGroupProps = {
|
|
31
|
+
options: Options;
|
|
32
|
+
onChange: (value: string) => void;
|
|
33
|
+
value: Nullable<string>;
|
|
34
|
+
elementsPerCol?: number;
|
|
35
|
+
colorVariant?: Variants;
|
|
36
|
+
label: string;
|
|
37
|
+
} & CommonFieldProps;
|
|
38
|
+
export declare const RadioGroup: (props: CheckboxGroupProps) => React.DetailedReactHTMLElement<{
|
|
39
|
+
children: (React.FunctionComponentElement<{
|
|
40
|
+
variant?: "title" | "section" | "subtitle" | "subsection" | "paragraph";
|
|
41
|
+
linear?: boolean;
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
}> | React.FunctionComponentElement<{
|
|
44
|
+
errors?: import("../types/FormError").FormError[];
|
|
45
|
+
}> | React.DOMElement<{
|
|
46
|
+
children: React.DOMElement<{
|
|
47
|
+
children: React.FunctionComponentElement<RadioProps>[];
|
|
48
|
+
}, Element>[];
|
|
49
|
+
}, Element>)[];
|
|
50
|
+
}, HTMLElement>;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { ChangeEvent } from 'react';
|
|
2
|
+
import { Variants } from '../theme/ThemeProvider';
|
|
3
|
+
import { CommonFieldProps } from '../types/CommonFieldProps';
|
|
4
|
+
import { Nullable } from '../types/Nullable';
|
|
5
|
+
type RangeSlideProps = {
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
value: Nullable<number>;
|
|
9
|
+
initialValue?: number;
|
|
10
|
+
colorVariant?: Variants;
|
|
11
|
+
label: string;
|
|
12
|
+
onChange: (value: number) => void;
|
|
13
|
+
} & CommonFieldProps;
|
|
14
|
+
export declare const RangeSlide: (props: RangeSlideProps) => React.DOMElement<{
|
|
15
|
+
children: (React.FunctionComponentElement<{
|
|
16
|
+
variant?: "title" | "section" | "subtitle" | "subsection" | "paragraph";
|
|
17
|
+
linear?: boolean;
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
}> | React.FunctionComponentElement<{
|
|
20
|
+
errors?: import("../types/FormError").FormError[];
|
|
21
|
+
}> | React.DOMElement<{
|
|
22
|
+
children: (React.DOMElement<{
|
|
23
|
+
type: string;
|
|
24
|
+
min: number;
|
|
25
|
+
max: number;
|
|
26
|
+
useThemeColors: Variants | undefined;
|
|
27
|
+
value: Nullable<number>;
|
|
28
|
+
onChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
29
|
+
}, Element> | React.DOMElement<{
|
|
30
|
+
type: string;
|
|
31
|
+
value: string;
|
|
32
|
+
max: number;
|
|
33
|
+
min: number;
|
|
34
|
+
colorVariant: Variants | undefined;
|
|
35
|
+
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
36
|
+
}, Element>)[];
|
|
37
|
+
}, Element>)[];
|
|
38
|
+
}, Element>;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Variants } from '../theme/ThemeProvider';
|
|
3
|
+
import { CommonFieldProps } from '../types/CommonFieldProps';
|
|
4
|
+
type Sizes = 'small' | 'medium' | 'large';
|
|
5
|
+
type RatingItemProps = {
|
|
6
|
+
colorVariant?: Variants;
|
|
7
|
+
selected: boolean;
|
|
8
|
+
size?: Sizes;
|
|
9
|
+
icon?: 'star' | 'star2' | 'heart';
|
|
10
|
+
};
|
|
11
|
+
export declare const RatingItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, RatingItemProps>> & string;
|
|
12
|
+
type RatingProps = {
|
|
13
|
+
value: number;
|
|
14
|
+
label: string;
|
|
15
|
+
onChange: (value: number) => void;
|
|
16
|
+
max: number;
|
|
17
|
+
} & Omit<RatingItemProps, 'selected'> & CommonFieldProps;
|
|
18
|
+
export declare const Rating: ({ value, max, errors, label, onChange }: RatingProps) => React.DOMElement<{
|
|
19
|
+
value: number;
|
|
20
|
+
max: number;
|
|
21
|
+
children: (React.FunctionComponentElement<{
|
|
22
|
+
variant?: "title" | "section" | "subtitle" | "subsection" | "paragraph";
|
|
23
|
+
linear?: boolean;
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
}> | React.FunctionComponentElement<{
|
|
26
|
+
errors?: import("../types/FormError").FormError[];
|
|
27
|
+
}> | React.DOMElement<{
|
|
28
|
+
selected: boolean;
|
|
29
|
+
name: string;
|
|
30
|
+
key: string;
|
|
31
|
+
onChange: () => void;
|
|
32
|
+
type: string;
|
|
33
|
+
}, Element>[])[];
|
|
34
|
+
}, Element>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Variants } from '../theme/ThemeProvider';
|
|
3
|
+
import { CommonFieldProps } from '../types/CommonFieldProps';
|
|
4
|
+
import { Nullable } from '../types/Nullable';
|
|
5
|
+
import { Options } from '../types/Option';
|
|
6
|
+
type SelectProps = {
|
|
7
|
+
label: string;
|
|
8
|
+
value: Nullable<string>;
|
|
9
|
+
colorVariant?: Variants;
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
options: Options;
|
|
12
|
+
} & CommonFieldProps;
|
|
13
|
+
export declare const Select: (props: SelectProps) => React.DetailedReactHTMLElement<{
|
|
14
|
+
children: (React.FunctionComponentElement<{
|
|
15
|
+
variant?: "title" | "section" | "subtitle" | "subsection" | "paragraph";
|
|
16
|
+
linear?: boolean;
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
}> | React.FunctionComponentElement<{
|
|
19
|
+
errors?: import("../types/FormError").FormError[];
|
|
20
|
+
}> | React.DOMElement<{
|
|
21
|
+
colorVariant: Variants | undefined;
|
|
22
|
+
value: string | null;
|
|
23
|
+
defaultChecked: boolean;
|
|
24
|
+
defaultValue: null;
|
|
25
|
+
onChange: React.ChangeEventHandler<HTMLSelectElement>;
|
|
26
|
+
children: (React.DOMElement<{
|
|
27
|
+
value: string;
|
|
28
|
+
selected: boolean;
|
|
29
|
+
children: string;
|
|
30
|
+
key: string;
|
|
31
|
+
}, Element> | React.DOMElement<{
|
|
32
|
+
value: string;
|
|
33
|
+
selected: boolean;
|
|
34
|
+
children: string;
|
|
35
|
+
key: string;
|
|
36
|
+
}, Element>[])[];
|
|
37
|
+
}, Element>)[];
|
|
38
|
+
}, HTMLElement>;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Nullable } from '../types/Nullable';
|
|
3
|
+
type StepProps = {
|
|
4
|
+
isVisible: boolean;
|
|
5
|
+
height: Nullable<number>;
|
|
6
|
+
onSetMaxHeight: (height: number) => void;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export declare const Step: (props: StepProps) => React.DOMElement<{
|
|
10
|
+
ref: React.RefObject<HTMLDivElement | null>;
|
|
11
|
+
$height: Nullable<number>;
|
|
12
|
+
$isVisible: boolean;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}, HTMLDivElement>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Variants } from '../theme/ThemeProvider';
|
|
3
|
+
import { Step } from '../types/FormConfig';
|
|
4
|
+
type CheckboxGroupProps = {
|
|
5
|
+
steps: Array<Step>;
|
|
6
|
+
currentStepIndex: number;
|
|
7
|
+
colorVariant?: Variants;
|
|
8
|
+
};
|
|
9
|
+
export declare const StepsProgress: (props: CheckboxGroupProps) => React.DOMElement<{
|
|
10
|
+
children: React.DOMElement<{
|
|
11
|
+
key: string;
|
|
12
|
+
colorVariant: Variants | undefined;
|
|
13
|
+
shouldBeFilled: boolean;
|
|
14
|
+
children: string;
|
|
15
|
+
}, Element>[][];
|
|
16
|
+
}, Element>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Variants } from '../theme/ThemeProvider';
|
|
3
|
+
import { CommonFieldProps } from '../types/CommonFieldProps';
|
|
4
|
+
import { Nullable } from '../types/Nullable';
|
|
5
|
+
type TextInputStyledProps = {
|
|
6
|
+
colorVariant?: Variants;
|
|
7
|
+
};
|
|
8
|
+
export declare const TextInputStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, TextInputStyledProps>> & string;
|
|
9
|
+
export type TextInputProps = {
|
|
10
|
+
colorVariant?: Variants;
|
|
11
|
+
value: Nullable<string>;
|
|
12
|
+
type?: HTMLInputElement['type'];
|
|
13
|
+
onChange: (value: string) => void;
|
|
14
|
+
label?: string;
|
|
15
|
+
} & CommonFieldProps;
|
|
16
|
+
export declare const TextInput: (props: TextInputProps) => React.DetailedReactHTMLElement<{
|
|
17
|
+
children: ("" | React.FunctionComponentElement<{
|
|
18
|
+
variant?: "title" | "section" | "subtitle" | "subsection" | "paragraph";
|
|
19
|
+
linear?: boolean;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
}> | React.FunctionComponentElement<{
|
|
22
|
+
errors?: import("../types/FormError").FormError[];
|
|
23
|
+
}> | React.DOMElement<{
|
|
24
|
+
value: string;
|
|
25
|
+
type: string;
|
|
26
|
+
useThemeColors: Variants | undefined;
|
|
27
|
+
onChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
28
|
+
}, Element>)[];
|
|
29
|
+
}, HTMLElement>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Variants } from '../theme/ThemeProvider';
|
|
3
|
+
import { CommonFieldProps } from '../types/CommonFieldProps';
|
|
4
|
+
import { Nullable } from '../types/Nullable';
|
|
5
|
+
type TextareaProps = {
|
|
6
|
+
value: Nullable<string>;
|
|
7
|
+
onChange: (value: string) => void;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
colorVariant?: Variants;
|
|
10
|
+
rows?: number;
|
|
11
|
+
label: string;
|
|
12
|
+
} & CommonFieldProps;
|
|
13
|
+
export declare const Textarea: (props: TextareaProps) => React.DOMElement<{
|
|
14
|
+
children: (React.FunctionComponentElement<{
|
|
15
|
+
variant?: "title" | "section" | "subtitle" | "subsection" | "paragraph";
|
|
16
|
+
linear?: boolean;
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
}> | React.FunctionComponentElement<{
|
|
19
|
+
errors?: import("../types/FormError").FormError[];
|
|
20
|
+
}> | React.DOMElement<{
|
|
21
|
+
value: string;
|
|
22
|
+
useThemeColors: Variants | undefined;
|
|
23
|
+
rows: number;
|
|
24
|
+
onChange: React.ChangeEventHandler<HTMLTextAreaElement>;
|
|
25
|
+
}, Element>)[];
|
|
26
|
+
}, Element>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Variants = 'title' | 'subtitle' | 'section' | 'subsection' | 'paragraph';
|
|
3
|
+
type Props = {
|
|
4
|
+
variant?: Variants;
|
|
5
|
+
linear?: boolean;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare const Typography: (props: Props) => React.DOMElement<{
|
|
9
|
+
$variant: Variants | undefined;
|
|
10
|
+
$linear: boolean | undefined;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}, Element>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AllFields, Form, Step } from '../types/FormConfig';
|
|
2
|
+
import { Nullable } from '../types/Nullable';
|
|
3
|
+
import { ValidationPerStep } from '../types/ValidationPerStep';
|
|
4
|
+
type DataField = string;
|
|
5
|
+
type UseFormProps = {
|
|
6
|
+
formId: string;
|
|
7
|
+
domainId: string;
|
|
8
|
+
form: Form;
|
|
9
|
+
};
|
|
10
|
+
export declare const useForm: (props: UseFormProps) => {
|
|
11
|
+
steps: ({
|
|
12
|
+
fields: Array<{
|
|
13
|
+
dataField: Nullable<DataField>;
|
|
14
|
+
} & AllFields>;
|
|
15
|
+
} & Step)[];
|
|
16
|
+
validationsPerStep: ValidationPerStep;
|
|
17
|
+
state: Record<string, any>;
|
|
18
|
+
setStateByKey: (key: Nullable<string>, value: any) => void;
|
|
19
|
+
getStateByKey: (key: Nullable<string>) => any;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FormError } from '../types/FormError';
|
|
2
|
+
import { ValidationPerStep } from '../types/ValidationPerStep';
|
|
3
|
+
type UseStepperProps = {
|
|
4
|
+
state: Record<string, any>;
|
|
5
|
+
formId: string;
|
|
6
|
+
stepsCount: number;
|
|
7
|
+
formType: string;
|
|
8
|
+
validationsPerStep: ValidationPerStep;
|
|
9
|
+
domainId: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const useStepper: (props: UseStepperProps) => {
|
|
12
|
+
step: number;
|
|
13
|
+
errors: FormError[];
|
|
14
|
+
onContinue: () => void;
|
|
15
|
+
onBack: () => void;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type Variants = 'primary' | 'secondary' | 'neutral';
|
|
3
|
+
export declare const theme: {
|
|
4
|
+
primary: string;
|
|
5
|
+
primaryContent: string;
|
|
6
|
+
secondary: string;
|
|
7
|
+
secondaryContent: string;
|
|
8
|
+
accent: string;
|
|
9
|
+
accentContent: string;
|
|
10
|
+
neutral: string;
|
|
11
|
+
neutralContent: string;
|
|
12
|
+
base100: string;
|
|
13
|
+
base200: string;
|
|
14
|
+
base300: string;
|
|
15
|
+
baseContent: string;
|
|
16
|
+
info: string;
|
|
17
|
+
infoContent: string;
|
|
18
|
+
success: string;
|
|
19
|
+
successContent: string;
|
|
20
|
+
warning: string;
|
|
21
|
+
warningContent: string;
|
|
22
|
+
error: string;
|
|
23
|
+
errorContent: string;
|
|
24
|
+
radiusSelectors: string;
|
|
25
|
+
radiusField: string;
|
|
26
|
+
radiusBox: string;
|
|
27
|
+
borderWidth: string;
|
|
28
|
+
fontSize: string;
|
|
29
|
+
sizeField: string;
|
|
30
|
+
sizeSelector: string;
|
|
31
|
+
allFieldsSize: string;
|
|
32
|
+
spacing: string;
|
|
33
|
+
depth: number;
|
|
34
|
+
};
|
|
35
|
+
export declare const ThemeContext: React.Context<{
|
|
36
|
+
selectedVariant: Variants;
|
|
37
|
+
getDefaultVariantOrSelected: () => Variants;
|
|
38
|
+
primary: string;
|
|
39
|
+
primaryContent: string;
|
|
40
|
+
secondary: string;
|
|
41
|
+
secondaryContent: string;
|
|
42
|
+
accent: string;
|
|
43
|
+
accentContent: string;
|
|
44
|
+
neutral: string;
|
|
45
|
+
neutralContent: string;
|
|
46
|
+
base100: string;
|
|
47
|
+
base200: string;
|
|
48
|
+
base300: string;
|
|
49
|
+
baseContent: string;
|
|
50
|
+
info: string;
|
|
51
|
+
infoContent: string;
|
|
52
|
+
success: string;
|
|
53
|
+
successContent: string;
|
|
54
|
+
warning: string;
|
|
55
|
+
warningContent: string;
|
|
56
|
+
error: string;
|
|
57
|
+
errorContent: string;
|
|
58
|
+
radiusSelectors: string;
|
|
59
|
+
radiusField: string;
|
|
60
|
+
radiusBox: string;
|
|
61
|
+
borderWidth: string;
|
|
62
|
+
fontSize: string;
|
|
63
|
+
sizeField: string;
|
|
64
|
+
sizeSelector: string;
|
|
65
|
+
allFieldsSize: string;
|
|
66
|
+
spacing: string;
|
|
67
|
+
depth: number;
|
|
68
|
+
}>;
|
|
69
|
+
type ThemeProviderProps = {
|
|
70
|
+
theme: typeof theme;
|
|
71
|
+
selectedVariant?: Variants;
|
|
72
|
+
children: React.ReactNode;
|
|
73
|
+
};
|
|
74
|
+
export declare const ThemeProvider: (props: ThemeProviderProps) => React.FunctionComponentElement<{
|
|
75
|
+
children?: React.ReactNode;
|
|
76
|
+
theme: import("styled-components").DefaultTheme | ((outerTheme?: import("styled-components").DefaultTheme | undefined) => import("styled-components").DefaultTheme);
|
|
77
|
+
}>;
|
|
78
|
+
export declare const useThemeContext: () => {
|
|
79
|
+
selectedVariant: Variants;
|
|
80
|
+
getDefaultVariantOrSelected: () => Variants;
|
|
81
|
+
primary: string;
|
|
82
|
+
primaryContent: string;
|
|
83
|
+
secondary: string;
|
|
84
|
+
secondaryContent: string;
|
|
85
|
+
accent: string;
|
|
86
|
+
accentContent: string;
|
|
87
|
+
neutral: string;
|
|
88
|
+
neutralContent: string;
|
|
89
|
+
base100: string;
|
|
90
|
+
base200: string;
|
|
91
|
+
base300: string;
|
|
92
|
+
baseContent: string;
|
|
93
|
+
info: string;
|
|
94
|
+
infoContent: string;
|
|
95
|
+
success: string;
|
|
96
|
+
successContent: string;
|
|
97
|
+
warning: string;
|
|
98
|
+
warningContent: string;
|
|
99
|
+
error: string;
|
|
100
|
+
errorContent: string;
|
|
101
|
+
radiusSelectors: string;
|
|
102
|
+
radiusField: string;
|
|
103
|
+
radiusBox: string;
|
|
104
|
+
borderWidth: string;
|
|
105
|
+
fontSize: string;
|
|
106
|
+
sizeField: string;
|
|
107
|
+
sizeSelector: string;
|
|
108
|
+
allFieldsSize: string;
|
|
109
|
+
spacing: string;
|
|
110
|
+
depth: number;
|
|
111
|
+
};
|
|
112
|
+
export declare const useDefaultVariantColor: (override?: Variants) => string;
|
|
113
|
+
export declare const useDefaultVariantContentColor: (override?: Variants) => string;
|
|
114
|
+
export {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { theme, Variants } from '../theme/ThemeProvider';
|
|
2
|
+
import { Nullable } from './Nullable';
|
|
3
|
+
export interface Validation {
|
|
4
|
+
required?: boolean;
|
|
5
|
+
basicEmailValidation?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type ConditionalFieldValueCondition = {
|
|
8
|
+
fieldName: string;
|
|
9
|
+
eq?: number;
|
|
10
|
+
moreThan?: number;
|
|
11
|
+
lessThan?: number;
|
|
12
|
+
};
|
|
13
|
+
export type ConditionalFieldValue<T = string> = {
|
|
14
|
+
conditions: ConditionalFieldValueCondition[];
|
|
15
|
+
value: T;
|
|
16
|
+
};
|
|
17
|
+
export type ConditionalField<T = string> = {
|
|
18
|
+
values?: ConditionalFieldValue<T>[];
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
interface Field {
|
|
22
|
+
meta: Meta;
|
|
23
|
+
type: string;
|
|
24
|
+
colorVariant?: Variants;
|
|
25
|
+
label: ConditionalField;
|
|
26
|
+
validations?: Validation;
|
|
27
|
+
}
|
|
28
|
+
interface Meta {
|
|
29
|
+
name: string;
|
|
30
|
+
fieldKey?: string;
|
|
31
|
+
comment?: string;
|
|
32
|
+
}
|
|
33
|
+
interface DTOOption {
|
|
34
|
+
label: string;
|
|
35
|
+
id: string;
|
|
36
|
+
}
|
|
37
|
+
export type AllFields = FieldQuestionMatrix | FieldRating | FieldCheckboxGroup | FieldRangeSlide | FieldRadioGroup | FieldSelect | FieldTextarea;
|
|
38
|
+
export interface Step {
|
|
39
|
+
meta: Meta;
|
|
40
|
+
title: string;
|
|
41
|
+
fields: Array<AllFields>;
|
|
42
|
+
}
|
|
43
|
+
export interface FieldQuestionMatrix extends Field {
|
|
44
|
+
type: 'matrix';
|
|
45
|
+
max?: number;
|
|
46
|
+
min?: number;
|
|
47
|
+
maxText?: string;
|
|
48
|
+
minText?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface FieldRadioGroup extends Field {
|
|
51
|
+
type: 'radio-group';
|
|
52
|
+
options: Array<DTOOption>;
|
|
53
|
+
}
|
|
54
|
+
export interface FieldCheckboxGroup extends Field {
|
|
55
|
+
type: 'checkbox-group';
|
|
56
|
+
options: Array<DTOOption>;
|
|
57
|
+
}
|
|
58
|
+
export interface FieldRangeSlide extends Field {
|
|
59
|
+
type: 'range-slide';
|
|
60
|
+
defaultValue?: number;
|
|
61
|
+
min?: number;
|
|
62
|
+
max?: number;
|
|
63
|
+
}
|
|
64
|
+
export interface FieldRating extends Field {
|
|
65
|
+
type: 'rating';
|
|
66
|
+
colorVariant?: Variants;
|
|
67
|
+
max: number;
|
|
68
|
+
size?: 'small' | 'medium' | 'large';
|
|
69
|
+
icon?: 'star' | 'star2' | 'heart';
|
|
70
|
+
}
|
|
71
|
+
export interface FieldSelect extends Field {
|
|
72
|
+
type: 'select';
|
|
73
|
+
options: Array<DTOOption>;
|
|
74
|
+
}
|
|
75
|
+
export interface FieldTextarea extends Field {
|
|
76
|
+
type: 'textarea';
|
|
77
|
+
rows?: number;
|
|
78
|
+
}
|
|
79
|
+
export interface Form {
|
|
80
|
+
meta: Meta;
|
|
81
|
+
steps: Array<Step>;
|
|
82
|
+
}
|
|
83
|
+
type InlineFormConfig = {
|
|
84
|
+
canReturnToPreviousStep: boolean;
|
|
85
|
+
nextButtonText: string;
|
|
86
|
+
previousButtonText: string;
|
|
87
|
+
submitButtonText: string;
|
|
88
|
+
formTitle: string;
|
|
89
|
+
};
|
|
90
|
+
export type InlineForm = {
|
|
91
|
+
meta: Meta;
|
|
92
|
+
config: InlineFormConfig;
|
|
93
|
+
form: Form;
|
|
94
|
+
};
|
|
95
|
+
export type PopupFormStyles = {
|
|
96
|
+
left: Nullable<number>;
|
|
97
|
+
top: Nullable<number>;
|
|
98
|
+
bottom: Nullable<number>;
|
|
99
|
+
right: Nullable<number>;
|
|
100
|
+
variant?: Variants;
|
|
101
|
+
margin?: string;
|
|
102
|
+
};
|
|
103
|
+
type PopupFormConfig = {
|
|
104
|
+
canReturnToPreviousStep: boolean;
|
|
105
|
+
nextButtonText: string;
|
|
106
|
+
previousButtonText: string;
|
|
107
|
+
submitButtonText: string;
|
|
108
|
+
formTitle: string;
|
|
109
|
+
buttonText: string;
|
|
110
|
+
};
|
|
111
|
+
export type PopupForm = {
|
|
112
|
+
meta: Meta;
|
|
113
|
+
config: PopupFormConfig;
|
|
114
|
+
styles: PopupFormStyles;
|
|
115
|
+
form: Form;
|
|
116
|
+
};
|
|
117
|
+
export type FormConfig = {
|
|
118
|
+
id: string;
|
|
119
|
+
domainId: string;
|
|
120
|
+
inlineForm: Nullable<InlineForm>;
|
|
121
|
+
popupForm: Nullable<PopupForm>;
|
|
122
|
+
attributes: {
|
|
123
|
+
theme: typeof theme;
|
|
124
|
+
darkTheme?: typeof theme;
|
|
125
|
+
variant: Variants;
|
|
126
|
+
useSystemTheme: true;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Locale = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Nullable<T> = T | null;
|