freemium-survey-components 0.5.0 → 0.5.1-beta.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/README.md +2 -2
- package/dist/declarations/lib/types/components/button/index.d.ts +24 -0
- package/dist/declarations/lib/types/components/checkbox/index.d.ts +13 -0
- package/{lib → dist/declarations/lib}/types/components/index.d.ts +0 -0
- package/dist/declarations/lib/types/components/nps/index.d.ts +22 -0
- package/dist/declarations/lib/types/components/progressbar/index.d.ts +7 -0
- package/dist/declarations/lib/types/components/radio-button/index.d.ts +26 -0
- package/dist/declarations/lib/types/components/text-input/index.d.ts +51 -0
- package/dist/declarations/lib/types/index.d.ts +1 -0
- package/dist/declarations/lib/types/survey/index.d.ts +11 -0
- package/{lib → dist/declarations/lib}/types/survey/question.d.ts +0 -0
- package/{lib → dist/declarations/lib}/types/utils.d.ts +1 -1
- package/dist/freemium-survey-components.cjs.d.ts +1 -0
- package/dist/freemium-survey-components.cjs.dev.js +683 -0
- package/dist/freemium-survey-components.cjs.js +1 -0
- package/dist/freemium-survey-components.cjs.prod.js +683 -0
- package/dist/freemium-survey-components.esm.js +1 -0
- package/package.json +14 -4
- package/lib/index.cjs.js +0 -1
- package/lib/index.esm.js +0 -1
- package/lib/types/components/button/button.stories.d.ts +0 -1
- package/lib/types/components/button/index.d.ts +0 -2392
- package/lib/types/components/checkbox/checkbox.stories.d.ts +0 -1
- package/lib/types/components/checkbox/index.d.ts +0 -50
- package/lib/types/components/nps/index.d.ts +0 -59
- package/lib/types/components/nps/nps.stories.d.ts +0 -1
- package/lib/types/components/progressbar/index.d.ts +0 -35
- package/lib/types/components/progressbar/progressbar.stories.d.ts +0 -1
- package/lib/types/components/radio-button/index.d.ts +0 -72
- package/lib/types/components/radio-button/radio.stories.d.ts +0 -1
- package/lib/types/components/text-input/index.d.ts +0 -52
- package/lib/types/components/text-input/text-input.stories.d.ts +0 -1
- package/lib/types/mock.d.ts +0 -2
- package/lib/types/survey/index.d.ts +0 -12
- package/lib/types/survey/survey.stories.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Freemium-survey-components(https://www.npmjs.com/package/freemium-survey-components)
|
|
1
|
+
# [Freemium-survey-components](https://www.npmjs.com/package/freemium-survey-components)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
⚠️ **Not ready for public usage yet!**
|
|
4
4
|
|
|
5
5
|
Freemium-survey-components is a react package that renders the survey collection form given the survey object from the survey-serv platform service.
|
|
6
6
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const BUTTON_SIZE_VARIANTS: {
|
|
3
|
+
LARGE: string;
|
|
4
|
+
MINI: string;
|
|
5
|
+
NORMAL: string;
|
|
6
|
+
};
|
|
7
|
+
export declare type ButtonSizeKey = 'large' | 'mini' | 'normal' | undefined;
|
|
8
|
+
export declare type buttonHTMLType = 'button' | 'reset' | 'submit' | undefined;
|
|
9
|
+
export declare type buttonType = 'primary' | 'secondary' | 'danger' | 'link';
|
|
10
|
+
export declare type ButtonProps = {
|
|
11
|
+
type?: buttonType;
|
|
12
|
+
htmlType?: buttonHTMLType;
|
|
13
|
+
size?: ButtonSizeKey;
|
|
14
|
+
inline?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
large?: boolean;
|
|
17
|
+
className?: string;
|
|
18
|
+
ref?: any;
|
|
19
|
+
onClick?: any;
|
|
20
|
+
overrideStyleClassName?: string;
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
children: any;
|
|
23
|
+
};
|
|
24
|
+
export declare const Button: (props: ButtonProps & React.HTMLAttributes<HTMLButtonElement>) => JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Option = {
|
|
3
|
+
id: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
interface CheckboxGroupInterface {
|
|
8
|
+
options: Array<Option>;
|
|
9
|
+
values: string[];
|
|
10
|
+
onChangeHandler: (newValues: string[]) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const CheckboxGroup: ({ values, options, onChangeHandler, }: CheckboxGroupInterface) => JSX.Element;
|
|
13
|
+
export { CheckboxGroup };
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type ButtonShapeType = 'rounded' | 'square' | 'curved';
|
|
3
|
+
declare type NPSProps = {
|
|
4
|
+
type_info: {
|
|
5
|
+
linear_scale: {
|
|
6
|
+
button_shape: ButtonShapeType;
|
|
7
|
+
button_style: any;
|
|
8
|
+
};
|
|
9
|
+
validation: {
|
|
10
|
+
min: number;
|
|
11
|
+
};
|
|
12
|
+
score_presets: {
|
|
13
|
+
start: string;
|
|
14
|
+
end: string;
|
|
15
|
+
};
|
|
16
|
+
footer_text: string;
|
|
17
|
+
};
|
|
18
|
+
onChangeHandler: (value: number) => void;
|
|
19
|
+
npsValue: number;
|
|
20
|
+
};
|
|
21
|
+
declare const NPS: (props: NPSProps) => JSX.Element;
|
|
22
|
+
export { NPS };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface RadioButtonProps {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
children: string;
|
|
5
|
+
value: string | number;
|
|
6
|
+
name: string;
|
|
7
|
+
onChange: (e: any) => void;
|
|
8
|
+
id?: string;
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface RadioGroupInterface {
|
|
12
|
+
options: Array<{
|
|
13
|
+
id: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}>;
|
|
17
|
+
value: string;
|
|
18
|
+
name: string;
|
|
19
|
+
onChangeHandler: (newValue: string) => void;
|
|
20
|
+
}
|
|
21
|
+
declare const RadioGroup: ({ name, options, value, onChangeHandler, }: RadioGroupInterface) => JSX.Element;
|
|
22
|
+
declare const Radio: React.ComponentType<Partial<{
|
|
23
|
+
checked: boolean;
|
|
24
|
+
autoFocus: boolean;
|
|
25
|
+
}> & Omit<RadioButtonProps & React.RefAttributes<HTMLInputElement>, "autoFocus" | "checked">>;
|
|
26
|
+
export { Radio, RadioGroup };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface InputProps extends React.HTMLAttributes<HTMLInputElement> {
|
|
3
|
+
isErrored?: boolean;
|
|
4
|
+
showCount?: boolean;
|
|
5
|
+
errorText?: string;
|
|
6
|
+
maxLength?: any;
|
|
7
|
+
type?: string;
|
|
8
|
+
label: string;
|
|
9
|
+
style?: any;
|
|
10
|
+
value?: any;
|
|
11
|
+
inputStyle?: any;
|
|
12
|
+
className?: string;
|
|
13
|
+
startLabel?: React.ReactNode | any;
|
|
14
|
+
endLabel?: React.ReactNode | any;
|
|
15
|
+
isRequired?: boolean;
|
|
16
|
+
inline?: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface TextAreaProps extends React.HTMLAttributes<HTMLTextAreaElement> {
|
|
19
|
+
isErrored: boolean;
|
|
20
|
+
showCount?: boolean;
|
|
21
|
+
maxLength?: any;
|
|
22
|
+
errorText?: string;
|
|
23
|
+
style?: any;
|
|
24
|
+
value?: any;
|
|
25
|
+
inputStyle?: any;
|
|
26
|
+
className?: string;
|
|
27
|
+
label: string;
|
|
28
|
+
startLabel?: React.ReactNode | any;
|
|
29
|
+
startAdornment?: React.ReactNode | any;
|
|
30
|
+
endLabel?: React.ReactNode | any;
|
|
31
|
+
endAdornment?: React.ReactNode | any;
|
|
32
|
+
isRequired?: boolean;
|
|
33
|
+
inline?: boolean;
|
|
34
|
+
}
|
|
35
|
+
declare const Input: React.ComponentType<Partial<{
|
|
36
|
+
isRequired: boolean;
|
|
37
|
+
showCount: boolean;
|
|
38
|
+
isErrored: boolean;
|
|
39
|
+
inline: boolean;
|
|
40
|
+
spellCheck: boolean;
|
|
41
|
+
autoFocus: boolean;
|
|
42
|
+
}> & Omit<InputProps & React.RefAttributes<HTMLInputElement>, "isErrored" | "showCount" | "isRequired" | "inline" | "spellCheck" | "autoFocus">>;
|
|
43
|
+
declare const TextArea: React.ComponentType<Partial<{
|
|
44
|
+
isRequired: boolean;
|
|
45
|
+
showCount: boolean;
|
|
46
|
+
isErrored: boolean;
|
|
47
|
+
inline: boolean;
|
|
48
|
+
spellCheck: boolean;
|
|
49
|
+
autoFocus: boolean;
|
|
50
|
+
}> & Omit<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>, "isErrored" | "showCount" | "isRequired" | "inline" | "spellCheck" | "autoFocus">>;
|
|
51
|
+
export { Input, TextArea };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './survey';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface SurveyProps {
|
|
3
|
+
survey: {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
};
|
|
6
|
+
onSubmit: (data: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const Survey: ({ survey, onSubmit }: SurveyProps) => JSX.Element | null;
|
|
11
|
+
export { Survey };
|
|
File without changes
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const withDefaults: <P, DP>(component: React.ComponentType<P>, defaultProps: DP) => React.ComponentType<Partial<DP> &
|
|
2
|
+
declare const withDefaults: <P, DP>(component: React.ComponentType<P>, defaultProps: DP) => React.ComponentType<Partial<DP> & Omit<P, keyof DP>>;
|
|
3
3
|
export { withDefaults };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./declarations/lib/types/index";
|