@product7/feedback-sdk 1.5.3 → 1.5.7

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.
@@ -21,10 +21,11 @@ export const surveyStyles = `
21
21
  .feedback-survey {
22
22
  position: fixed;
23
23
  z-index: var(--z-modal);
24
- background: var(--color-white);
25
- border-radius: var(--radius-2xl);
26
- box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
27
- padding: var(--spacing-6);
24
+ background: var(--color-neutral-50);
25
+ border: 1px solid var(--color-neutral-300);
26
+ border-radius: 10px;
27
+ box-shadow: var(--shadow-lg);
28
+ padding: var(--spacing-8);
28
29
  min-width: 320px;
29
30
  max-width: 400px;
30
31
  font-family: inherit;
@@ -44,56 +45,77 @@ export const surveyStyles = `
44
45
  top: 50%;
45
46
  left: 50%;
46
47
  transform: translate(-50%, -50%);
48
+ width: min(680px, calc(100vw - 24px));
49
+ max-width: 680px;
47
50
  }
48
51
 
49
52
  .feedback-survey-bottom {
50
53
  bottom: 0;
51
54
  left: 0;
52
55
  right: 0;
53
- border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
56
+ border-radius: 10px 10px 0 0;
54
57
  max-width: none;
55
58
  }
56
59
 
57
60
  .feedback-survey-close {
58
61
  position: absolute;
59
- top: var(--spacing-3);
60
- right: var(--spacing-3);
62
+ top: var(--spacing-4);
63
+ right: var(--spacing-4);
61
64
  background: none;
62
65
  border: none;
63
66
  cursor: pointer;
64
67
  color: var(--color-neutral-500);
65
68
  padding: 0;
66
- width: 28px;
67
- height: 28px;
69
+ width: 20px;
70
+ height: 20px;
68
71
  display: flex;
69
72
  align-items: center;
70
73
  justify-content: center;
71
- border-radius: var(--radius-md);
74
+ border-radius: 8px;
72
75
  transition: all var(--transition-base);
73
76
  }
74
77
 
78
+ .feedback-survey-close svg {
79
+ width: 18px;
80
+ height: 18px;
81
+ }
82
+
75
83
  .feedback-survey-close:hover {
76
84
  background: var(--color-neutral-100);
77
85
  color: var(--color-neutral-900);
78
86
  }
79
87
 
88
+ .feedback-survey-close:focus-visible {
89
+ outline: none;
90
+ box-shadow: 0 0 0 3px var(--color-primary-light);
91
+ }
92
+
80
93
  .feedback-survey-title {
81
94
  margin: 0 0 var(--spacing-2) 0;
82
95
  font-size: var(--font-size-xl);
83
- font-weight: var(--font-weight-bold);
84
- padding-right: var(--spacing-6);
96
+ font-weight: var(--font-weight-semibold);
97
+ line-height: var(--line-height-snug);
98
+ padding-right: var(--spacing-12);
85
99
  color: var(--color-text-primary);
86
100
  }
87
101
 
88
102
  .feedback-survey-description {
89
103
  color: var(--color-text-secondary);
90
- margin: 0 0 var(--spacing-5) 0;
91
- font-size: var(--font-size-base);
104
+ margin: 0 0 var(--spacing-4) 0;
105
+ font-size: var(--font-size-md);
92
106
  line-height: var(--line-height-relaxed);
93
107
  }
94
108
 
109
+ .feedback-survey-description-primary .feedback-survey-description {
110
+ color: var(--color-text-primary);
111
+ font-size: var(--font-size-lg);
112
+ font-weight: var(--font-weight-semibold);
113
+ line-height: var(--line-height-snug);
114
+ padding-right: var(--spacing-12);
115
+ }
116
+
95
117
  .feedback-survey-content {
96
- margin-bottom: var(--spacing-4);
118
+ margin-bottom: var(--spacing-3);
97
119
  }
98
120
 
99
121
  /* ========================================
@@ -110,7 +132,7 @@ export const surveyStyles = `
110
132
  width: 28px;
111
133
  height: 36px;
112
134
  border: 1px solid var(--color-border);
113
- border-radius: var(--radius-md);
135
+ border-radius: 8px;
114
136
  background: var(--color-surface);
115
137
  cursor: pointer;
116
138
  font-size: var(--font-size-sm);
@@ -121,8 +143,8 @@ export const surveyStyles = `
121
143
  }
122
144
 
123
145
  .feedback-survey-nps-btn:hover {
124
- border-color: var(--color-primary);
125
- background: var(--color-white);
146
+ background: var(--color-neutral-100);
147
+ border-color: var(--color-border);
126
148
  }
127
149
 
128
150
  .feedback-survey-nps-btn.selected {
@@ -145,7 +167,7 @@ export const surveyStyles = `
145
167
  background: none;
146
168
  border: none;
147
169
  cursor: pointer;
148
- font-size: 36px;
170
+ font-size: 28px;
149
171
  transition: transform var(--transition-fast);
150
172
  padding: var(--spacing-2);
151
173
  }
@@ -184,8 +206,8 @@ export const surveyStyles = `
184
206
  }
185
207
 
186
208
  .feedback-survey-ces-btn:hover {
187
- border-color: var(--color-primary);
188
- background: var(--color-white);
209
+ background: var(--color-neutral-100);
210
+ border-color: var(--color-border);
189
211
  }
190
212
 
191
213
  .feedback-survey-ces-btn.selected {
@@ -194,6 +216,56 @@ export const surveyStyles = `
194
216
  color: var(--color-white);
195
217
  }
196
218
 
219
+ .feedback-survey-rating-scale {
220
+ display: flex;
221
+ gap: 0;
222
+ border: 1px solid var(--color-neutral-300);
223
+ border-radius: 8px;
224
+ overflow: hidden;
225
+ background: var(--color-white);
226
+ }
227
+
228
+ .feedback-survey-rating-scale-btn {
229
+ flex: 1;
230
+ width: auto;
231
+ height: auto;
232
+ min-height: 64px;
233
+ padding: 0;
234
+ border: 0;
235
+ border-right: 1px solid var(--color-neutral-300);
236
+ border-radius: 0;
237
+ background: var(--color-white);
238
+ cursor: pointer;
239
+ font-size: clamp(16px, 3vw, 22px);
240
+ font-weight: var(--font-weight-medium);
241
+ color: var(--color-black);
242
+ transition:
243
+ background var(--transition-fast),
244
+ color var(--transition-fast),
245
+ box-shadow var(--transition-fast);
246
+ position: relative;
247
+ }
248
+
249
+ .feedback-survey-rating-scale-btn:last-child {
250
+ border-right: none;
251
+ }
252
+
253
+ .feedback-survey-rating-scale-btn:hover {
254
+ background: var(--color-neutral-100);
255
+ }
256
+
257
+ .feedback-survey-rating-scale-btn:focus-visible {
258
+ outline: none;
259
+ z-index: 1;
260
+ box-shadow: inset 0 0 0 3px var(--color-primary);
261
+ }
262
+
263
+ .feedback-survey-rating-scale-btn.selected {
264
+ background: var(--color-primary-light);
265
+ color: var(--color-primary-active);
266
+ box-shadow: inset 0 0 0 2px var(--color-primary);
267
+ }
268
+
197
269
  .feedback-survey-labels {
198
270
  display: flex;
199
271
  justify-content: space-between;
@@ -202,6 +274,14 @@ export const surveyStyles = `
202
274
  color: var(--color-text-tertiary);
203
275
  }
204
276
 
277
+ .feedback-survey-rating-scale + .feedback-survey-labels {
278
+ margin-top: var(--spacing-3);
279
+ padding: 0 var(--spacing-1);
280
+ font-size: var(--font-size-sm);
281
+ font-weight: var(--font-weight-normal);
282
+ color: var(--color-text-tertiary);
283
+ }
284
+
205
285
  /* ========================================
206
286
  FREQUENCY
207
287
  ======================================== */
@@ -226,8 +306,8 @@ export const surveyStyles = `
226
306
  }
227
307
 
228
308
  .feedback-survey-freq-btn:hover {
229
- border-color: var(--color-primary);
230
- background: var(--color-white);
309
+ background: var(--color-neutral-100);
310
+ border-color: var(--color-border);
231
311
  }
232
312
 
233
313
  .feedback-survey-freq-btn.selected {
@@ -384,7 +464,7 @@ export const surveyStyles = `
384
464
  border: 1px solid var(--color-primary);
385
465
  border-radius: var(--radius-md);
386
466
  font-size: var(--font-size-base);
387
- font-weight: var(--font-weight-semibold);
467
+ font-weight: var(--font-weight-medium);
388
468
  cursor: pointer;
389
469
  font-family: inherit;
390
470
  transition: all var(--transition-base);
@@ -410,7 +490,7 @@ export const surveyStyles = `
410
490
  color: var(--color-white);
411
491
  padding: var(--spacing-3) var(--spacing-5);
412
492
  border-radius: var(--radius-xl);
413
- font-size: var(--font-size-base);
493
+ font-size: var(--font-size-sm);
414
494
  font-weight: var(--font-weight-medium);
415
495
  z-index: var(--z-notification);
416
496
  box-shadow: var(--shadow-lg);
@@ -430,6 +510,7 @@ export const surveyStyles = `
430
510
  @media (max-width: 768px) {
431
511
  .feedback-survey {
432
512
  min-width: 300px;
513
+ padding: var(--spacing-6);
433
514
  }
434
515
 
435
516
  .feedback-survey-bottom {
@@ -443,7 +524,24 @@ export const surveyStyles = `
443
524
  }
444
525
 
445
526
  .feedback-survey-csat-btn {
446
- font-size: 32px;
527
+ font-size: 24px;
528
+ }
529
+
530
+ .feedback-survey-title {
531
+ font-size: var(--font-size-lg);
532
+ }
533
+
534
+ .feedback-survey-description-primary .feedback-survey-description {
535
+ font-size: var(--font-size-md);
536
+ }
537
+
538
+ .feedback-survey-rating-scale-btn {
539
+ min-height: 52px;
540
+ font-size: clamp(14px, 6vw, 18px);
541
+ }
542
+
543
+ .feedback-survey-rating-scale + .feedback-survey-labels {
544
+ font-size: var(--font-size-xs);
447
545
  }
448
546
  }
449
547
  `;
@@ -18,7 +18,7 @@ export class BaseWidget {
18
18
  backgroundColor: options.backgroundColor || '#ffffff',
19
19
  textColor: options.textColor || '#1F2937',
20
20
  autoShow: false,
21
- showBackdrop: true,
21
+ showBackdrop: false,
22
22
  customStyles: {},
23
23
  suppressAfterSubmission: true,
24
24
  suppressionDays: BaseWidget.DEFAULT_COOLDOWN_DAYS,
@@ -358,10 +358,16 @@ export class BaseWidget {
358
358
  _getPanelHTML() {
359
359
  return `
360
360
  <div class="feedback-panel-content">
361
- <div class="feedback-panel-header">
362
- <h3>Send Feedback</h3>
363
- <button class="sdk-close-btn" type="button" aria-label="Close">&times;</button>
364
- </div>
361
+ <div class="feedback-panel-header">
362
+ <h3>Send Feedback</h3>
363
+ <button class="sdk-close-btn" type="button" aria-label="Close">
364
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="18" height="18">
365
+ <rect width="256" height="256" fill="none"/>
366
+ <line x1="200" y1="56" x2="56" y2="200" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
367
+ <line x1="200" y1="200" x2="56" y2="56" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
368
+ </svg>
369
+ </button>
370
+ </div>
365
371
  <div class="feedback-panel-body">
366
372
  <form class="feedback-form">
367
373
  <div class="sdk-form-group">
@@ -96,7 +96,7 @@ export class ChangelogWidget extends BaseWidget {
96
96
  this.modalElement.className = 'changelog-modal';
97
97
  this.modalElement.innerHTML = `
98
98
  <div class="changelog-modal-container">
99
- <button class="changelog-modal-close" type="button" aria-label="Close">&times;</button>
99
+ <button class="changelog-modal-close" type="button" aria-label="Close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><line x1="200" y1="56" x2="56" y2="200" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="200" y1="200" x2="56" y2="56" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg></button>
100
100
  <div class="changelog-modal-content">
101
101
  <div class="changelog-loading">
102
102
  <div class="sdk-spinner"></div>
@@ -243,8 +243,13 @@ export class ChangelogWidget extends BaseWidget {
243
243
  <div class="changelog-list-modal-container">
244
244
  <div class="changelog-list-modal-header">
245
245
  <h2>${this.options.title || "What's New"} 🎉</h2>
246
- <button class="changelog-list-modal-close" type="button" aria-label="Close">&times;</button>
247
- </div>
246
+ <button class="changelog-list-modal-close" type="button" aria-label="Close">
247
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="18" height="18">
248
+ <rect width="256" height="256" fill="none"/>
249
+ <line x1="200" y1="56" x2="56" y2="200" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
250
+ <line x1="200" y1="200" x2="56" y2="56" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
251
+ </svg>
252
+ </button></div>
248
253
  <div class="changelog-list-modal-body">
249
254
  <div class="changelog-loading">
250
255
  <div class="sdk-spinner"></div>