react-feedback-surveys 1.6.1 → 1.8.0

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/dist/index.d.ts CHANGED
@@ -1,29 +1,56 @@
1
1
  import { default as default_2 } from 'react';
2
2
 
3
- export declare const CES7Survey: default_2.FC<CES7SurveyProps>;
4
-
5
- export declare interface CES7SurveyProps extends SharedSurveyProps {
3
+ /** Customer Effort Score survey, rated on a fixed 7-point scale */
4
+ export declare interface CesSurveyProps extends SharedSurveyProps {
5
+ /** Survey methodology */
6
+ type: 'ces';
6
7
  /** Visual style for the rating scale */
7
8
  scaleStyle: 'numbers';
8
9
  }
9
10
 
10
- export declare const CSAT2Survey: default_2.FC<CSAT2SurveyProps>;
11
+ /**
12
+ * Callback function for contact submission
13
+ * @param payload - The collected contact data
14
+ * @returns void or Promise<void> for async operations
15
+ */
16
+ export declare type ContactCallback = (payload: ContactSubmitPayload) => void | Promise<void>;
11
17
 
12
- export declare interface CSAT2SurveyProps extends SharedSurveyProps {
18
+ /**
19
+ * Payload sent when submitting collected contact
20
+ */
21
+ export declare interface ContactSubmitPayload {
22
+ /** Selected rating value */
23
+ value?: number;
24
+ /** Submitted feedback text or selected choices */
25
+ text?: string | string[];
26
+ /** Respondent's email address */
27
+ email: string;
28
+ }
29
+
30
+ /** Customer Satisfaction survey, rated on a 2-point scale */
31
+ export declare interface CsatSurveyProps2 extends SharedSurveyProps {
32
+ /** Survey methodology */
33
+ type: 'csat';
34
+ /** Number of points on the rating scale */
35
+ points: 2;
13
36
  /** Visual style for the rating scale */
14
37
  scaleStyle: 'emoji' | 'thumbs';
15
38
  }
16
39
 
17
- export declare const CSAT5Survey: default_2.FC<CSAT5SurveyProps>;
18
-
19
- export declare interface CSAT5SurveyProps extends SharedSurveyProps {
40
+ /** Customer Satisfaction survey, rated on a 5-point scale */
41
+ export declare interface CsatSurveyProps5 extends SharedSurveyProps {
42
+ /** Survey methodology */
43
+ type: 'csat';
44
+ /** Number of points on the rating scale */
45
+ points: 5;
20
46
  /** Visual style for the rating scale */
21
47
  scaleStyle: 'emoji' | 'numbers' | 'stars';
22
48
  }
23
49
 
24
- export declare const NPS10Survey: default_2.FC<NPS10SurveyProps>;
25
-
26
- export declare interface NPS10SurveyProps extends SharedSurveyProps {
50
+ /** Net Promoter Score survey, rated on a fixed 0–10 scale */
51
+ export declare interface NpsSurveyProps extends SharedSurveyProps {
52
+ /** Survey methodology */
53
+ type: 'nps';
27
54
  /** Visual style for the rating scale */
28
55
  scaleStyle: 'numbers';
29
56
  }
@@ -57,6 +84,8 @@ export declare interface RootClassNames {
57
84
  rating?: string;
58
85
  /** Feedback screen wrapper */
59
86
  feedback?: string;
87
+ /** Contact screen wrapper */
88
+ contact?: string;
60
89
  /** Success screen wrapper */
61
90
  success?: string;
62
91
  /** Close button element */
@@ -103,21 +132,39 @@ export declare interface SharedSurveyProps {
103
132
  /** Follow-up feedback question (screen 2) */
104
133
  textQuestion?: string;
105
134
  /** Submit button text */
106
- textButtonLabel?: string;
135
+ textButtonSendLabel?: string;
136
+ /** Skip button text */
137
+ textButtonSkipLabel?: string;
107
138
  /** Optional predefined choices for feedback */
108
139
  choiceOptions?: string[] | null;
109
140
  /** Success message text */
110
141
  thankYouMessage: string;
142
+ /** Enables an optional email collection step before the success screen. Skipped when `userId` is already provided */
143
+ collectContact?: boolean;
144
+ /** Existing user identity, if already known. When provided, the email collection step is skipped */
145
+ userId?: string;
146
+ /** Question shown on the contact collection screen */
147
+ contactQuestion?: string;
148
+ /** Descriptive text shown above the email input */
149
+ contactSubtext?: string;
150
+ /** Submit button text for the contact collection screen */
151
+ contactButtonSendLabel?: string;
152
+ /** Skip button text for the contact collection screen */
153
+ contactButtonSkipLabel?: string;
111
154
  /** Callback when score data is submitted */
112
155
  onScoreSubmit?: SurveyCallback;
113
156
  /** Callback when survey data is submitted */
114
157
  onFeedbackSubmit?: SurveyCallback;
158
+ /** Callback when contact is submitted */
159
+ onContactSubmit?: ContactCallback;
115
160
  }
116
161
 
117
162
  export declare const Surface: React.FC<SurfaceProps>;
118
163
 
119
164
  export declare type SurfaceProps = React.HTMLAttributes<HTMLDivElement>;
120
165
 
166
+ export declare const Survey: default_2.FC<SurveyProps>;
167
+
121
168
  /**
122
169
  * Callback function for survey submission
123
170
  * @param payload - The survey data to submit
@@ -125,16 +172,20 @@ export declare type SurfaceProps = React.HTMLAttributes<HTMLDivElement>;
125
172
  */
126
173
  export declare type SurveyCallback = (payload: SurveySubmitPayload) => void | Promise<void>;
127
174
 
175
+ export declare type SurveyProps = CsatSurveyProps5 | CsatSurveyProps2 | CesSurveyProps | NpsSurveyProps;
176
+
128
177
  /**
129
178
  * Available screens in survey flow
130
179
  */
131
180
  export declare type SurveyScreen =
132
181
  /** Rating screen (first screen) */
133
182
  'rating'
134
- /** Final "thanks" message screen */
135
- | 'success'
136
183
  /** Feedback input screen */
137
- | 'feedback';
184
+ | 'feedback'
185
+ /** Optional email/contact collection screen */
186
+ | 'contact'
187
+ /** Final "thanks" message screen */
188
+ | 'success';
138
189
 
139
190
  /**
140
191
  * Payload sent when submitting survey data