freemium-survey-components 0.2.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.
Files changed (38) hide show
  1. package/README.md +4 -2
  2. package/dist/declarations/lib/types/components/button/index.d.ts +24 -0
  3. package/dist/declarations/lib/types/components/checkbox/index.d.ts +13 -0
  4. package/{lib → dist/declarations/lib}/types/components/index.d.ts +0 -0
  5. package/dist/declarations/lib/types/components/nps/index.d.ts +22 -0
  6. package/dist/declarations/lib/types/components/progressbar/index.d.ts +7 -0
  7. package/dist/declarations/lib/types/components/radio-button/index.d.ts +26 -0
  8. package/dist/declarations/lib/types/components/text-input/index.d.ts +51 -0
  9. package/dist/declarations/lib/types/index.d.ts +1 -0
  10. package/dist/declarations/lib/types/survey/index.d.ts +11 -0
  11. package/{lib → dist/declarations/lib}/types/survey/question.d.ts +0 -0
  12. package/{lib → dist/declarations/lib}/types/utils.d.ts +1 -1
  13. package/dist/freemium-survey-components.cjs.d.ts +1 -0
  14. package/dist/freemium-survey-components.cjs.dev.js +683 -0
  15. package/dist/freemium-survey-components.cjs.js +1 -0
  16. package/dist/freemium-survey-components.cjs.prod.js +683 -0
  17. package/dist/freemium-survey-components.esm.js +1 -0
  18. package/package.json +18 -5
  19. package/yarn-error.log +15014 -0
  20. package/lib/index.cjs.js +0 -1
  21. package/lib/index.esm.js +0 -1
  22. package/lib/types/components/button/button.stories.d.ts +0 -1
  23. package/lib/types/components/button/index.d.ts +0 -2393
  24. package/lib/types/components/checkbox/checkbox.stories.d.ts +0 -1
  25. package/lib/types/components/checkbox/index.d.ts +0 -50
  26. package/lib/types/components/nps/index.d.ts +0 -59
  27. package/lib/types/components/nps/nps.stories.d.ts +0 -1
  28. package/lib/types/components/progressbar/index.d.ts +0 -35
  29. package/lib/types/components/progressbar/progressbar.stories.d.ts +0 -1
  30. package/lib/types/components/radio-button/index.d.ts +0 -70
  31. package/lib/types/components/radio-button/radio.stories.d.ts +0 -1
  32. package/lib/types/components/text-input/index.d.ts +0 -52
  33. package/lib/types/components/text-input/text-input.stories.d.ts +0 -1
  34. package/lib/types/mock.d.ts +0 -215
  35. package/lib/types/survey/index.d.ts +0 -12
  36. package/lib/types/survey/survey.stories.d.ts +0 -1
  37. package/lib/types/survey/widget.d.ts +0 -4
  38. package/postcss.config.js +0 -4
package/README.md CHANGED
@@ -1,4 +1,6 @@
1
- # Freemium-survey-components [npm](https://www.npmjs.com/package/freemium-survey-components)
1
+ # [Freemium-survey-components](https://www.npmjs.com/package/freemium-survey-components)
2
+
3
+ ⚠️ **Not ready for public usage yet!**
2
4
 
3
5
  Freemium-survey-components is a react package that renders the survey collection form given the survey object from the survey-serv platform service.
4
6
 
@@ -52,7 +54,7 @@ Of the below components the parent app would only need to interact with the Surv
52
54
  ## Using SURVEY
53
55
 
54
56
  ```sh
55
- import Survey from 'freemium-survey-components'
57
+ import {Survey} from 'freemium-survey-components'
56
58
  ...
57
59
  <Survey survey={surveyObjectFromDb} onSubmit ={(data : surveyFormData) => {....}/>
58
60
  ```
@@ -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 };
@@ -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,7 @@
1
+ /// <reference types="react" />
2
+ interface ProgressBarProps {
3
+ totalSteps: number;
4
+ completedSteps: number;
5
+ }
6
+ declare const ProgressBar: (props: ProgressBarProps) => JSX.Element;
7
+ export { ProgressBar };
@@ -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 };
@@ -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> & Pick<P, Exclude<keyof P, keyof 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";