@cognior/iap-sdk 0.1.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.

Potentially problematic release.


This version of @cognior/iap-sdk might be problematic. Click here for more details.

Files changed (60) hide show
  1. package/.github/copilot-instructions.md +95 -0
  2. package/README.md +79 -0
  3. package/TRACKING.md +105 -0
  4. package/USER_CONTEXT_README.md +284 -0
  5. package/package.json +154 -0
  6. package/src/config.ts +25 -0
  7. package/src/core/flowEngine.ts +1833 -0
  8. package/src/core/triggerManager.ts +1011 -0
  9. package/src/experiences/banner.ts +366 -0
  10. package/src/experiences/beacon.ts +668 -0
  11. package/src/experiences/hotspotTour.ts +654 -0
  12. package/src/experiences/hotspots.ts +566 -0
  13. package/src/experiences/modal.ts +1337 -0
  14. package/src/experiences/modalSequence.ts +1247 -0
  15. package/src/experiences/popover.ts +652 -0
  16. package/src/experiences/registry.ts +21 -0
  17. package/src/experiences/survey.ts +1639 -0
  18. package/src/experiences/taskList.ts +625 -0
  19. package/src/experiences/tooltip.ts +740 -0
  20. package/src/experiences/types.ts +395 -0
  21. package/src/experiences/walkthrough.ts +670 -0
  22. package/src/flow-sequence.ts +177 -0
  23. package/src/flows.ts +512 -0
  24. package/src/http.ts +61 -0
  25. package/src/index.ts +355 -0
  26. package/src/services/flowManager.ts +905 -0
  27. package/src/services/flowNormalizer.ts +74 -0
  28. package/src/services/locationContextService.ts +189 -0
  29. package/src/services/pageContextService.ts +221 -0
  30. package/src/services/userContextService.ts +286 -0
  31. package/src/state/appState.ts +0 -0
  32. package/src/state/hooks.ts +0 -0
  33. package/src/state/index.ts +0 -0
  34. package/src/state/migration.ts +0 -0
  35. package/src/state/store.ts +0 -0
  36. package/src/styles/banner.css.ts +0 -0
  37. package/src/styles/hotspot.css.ts +0 -0
  38. package/src/styles/hotspotTour.css.ts +0 -0
  39. package/src/styles/modal.css.ts +564 -0
  40. package/src/styles/survey.css.ts +1013 -0
  41. package/src/styles/taskList.css.ts +0 -0
  42. package/src/styles/tooltip.css.ts +149 -0
  43. package/src/styles/walkthrough.css.ts +0 -0
  44. package/src/tourUtils.ts +0 -0
  45. package/src/tracking.ts +223 -0
  46. package/src/utils/debounce.ts +66 -0
  47. package/src/utils/eventSequenceValidator.ts +124 -0
  48. package/src/utils/flowTrackingSystem.ts +524 -0
  49. package/src/utils/idGenerator.ts +155 -0
  50. package/src/utils/immediateValidationPrevention.ts +184 -0
  51. package/src/utils/normalize.ts +50 -0
  52. package/src/utils/privacyManager.ts +166 -0
  53. package/src/utils/ruleEvaluator.ts +199 -0
  54. package/src/utils/sanitize.ts +79 -0
  55. package/src/utils/selectors.ts +107 -0
  56. package/src/utils/stepExecutor.ts +345 -0
  57. package/src/utils/triggerNormalizer.ts +149 -0
  58. package/src/utils/validationInterceptor.ts +650 -0
  59. package/tsconfig.json +13 -0
  60. package/tsup.config.ts +13 -0
@@ -0,0 +1,1013 @@
1
+ // src/styles/survey.css.ts
2
+ // Styles for the survey component
3
+
4
+ export const surveyCssText = `
5
+ /* Survey specific styles */
6
+ .dap-modal-wrap {
7
+ position: fixed;
8
+ top: 0;
9
+ right: 0;
10
+ bottom: 0;
11
+ left: 0;
12
+ background-color: rgba(15, 23, 42, 0.6); /* Improved overlay color */
13
+ z-index: 2147483647;
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ pointer-events: auto;
18
+ padding: 24px; /* Better padding */
19
+ box-sizing: border-box;
20
+ width: 100vw;
21
+ height: 100vh;
22
+ margin: 0;
23
+ animation: fadeIn 0.3s ease-out;
24
+ backdrop-filter: blur(4px); /* Enhanced blur effect */
25
+ }
26
+
27
+ @keyframes fadeIn {
28
+ from { opacity: 0; }
29
+ to { opacity: 1; }
30
+ }
31
+
32
+ @keyframes slideUp {
33
+ from { opacity: 0; transform: translate(-50%, -40%); }
34
+ to { opacity: 1; transform: translate(-50%, -50%); }
35
+ }
36
+
37
+ .dap-survey-modal {
38
+ position: absolute;
39
+ max-width: 680px;
40
+ max-height: 85vh;
41
+ width: 92%;
42
+ overflow: hidden;
43
+ display: flex;
44
+ flex-direction: column;
45
+ background: white;
46
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
47
+ border-radius: 12px;
48
+ z-index: 2147483648;
49
+ top: 50%;
50
+ left: 50%;
51
+ transform: translate(-50%, -50%);
52
+ color: #333;
53
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
54
+ animation: slideUp 0.35s ease-out;
55
+ }
56
+
57
+ /* Content-adaptive sizing for survey modals */
58
+ .dap-survey-modal.dap-size-small {
59
+ max-width: min(92vw, 450px);
60
+ max-height: min(85vh, 500px);
61
+ }
62
+
63
+ .dap-survey-modal.dap-size-medium {
64
+ max-width: min(92vw, 680px);
65
+ max-height: min(85vh, 650px);
66
+ }
67
+
68
+ .dap-survey-modal.dap-size-large {
69
+ max-width: min(92vw, 950px);
70
+ max-height: min(85vh, 800px);
71
+ }
72
+
73
+ /* Improved scrollable handling */
74
+ .dap-survey-modal.dap-scrollable .dap-survey-body {
75
+ overflow-y: auto;
76
+ overflow-x: auto;
77
+ }
78
+
79
+ .dap-survey-modal .dap-survey-body {
80
+ overflow: visible; /* Default: no scroll unless needed */
81
+ }
82
+
83
+ .dap-survey-body {
84
+ max-height: calc(85vh - 140px);
85
+ overflow: visible; /* Let adaptive sizing handle overflow */
86
+ padding: 32px;
87
+ flex: 1;
88
+ }
89
+
90
+ .dap-survey-content {
91
+ display: flex;
92
+ flex-direction: column;
93
+ gap: 24px; /* Increased gap for better spacing */
94
+ width: 100%;
95
+ }
96
+
97
+ /* Two column layout for larger screens */
98
+ @media (min-width: 650px) {
99
+ .dap-survey-content {
100
+ display: grid;
101
+ grid-template-columns: repeat(2, 1fr);
102
+ gap: 24px; /* Consistent gap in grid layout */
103
+ }
104
+
105
+ /* Certain question types should still span full width */
106
+ .dap-survey-question.dap-full-width {
107
+ grid-column: 1 / -1;
108
+ }
109
+ }
110
+
111
+ .dap-header-bar {
112
+ display: flex;
113
+ justify-content: space-between;
114
+ align-items: center;
115
+ padding: 20px 24px;
116
+ border-bottom: 1px solid rgba(0, 0, 0, 0.06);
117
+ background-color: #fff;
118
+ border-top-left-radius: 12px;
119
+ border-top-right-radius: 12px;
120
+ }
121
+
122
+ .dap-modal-header {
123
+ margin: 0;
124
+ font-size: 22px;
125
+ font-weight: 600;
126
+ color: #111;
127
+ }
128
+
129
+ /* Progress bar similar to React version */
130
+ .dap-progress-container {
131
+ height: 4px;
132
+ width: 100%;
133
+ background-color: #f0f2f5;
134
+ border-radius: 2px;
135
+ overflow: hidden;
136
+ margin-top: 12px;
137
+ }
138
+
139
+ .dap-progress-bar {
140
+ height: 100%;
141
+ background-color: #4361ee;
142
+ transition: width 0.3s ease;
143
+ }
144
+
145
+ .dap-progress-text {
146
+ font-size: 12px;
147
+ color: #666;
148
+ text-align: right;
149
+ margin-top: 4px;
150
+ }
151
+
152
+ .dap-close {
153
+ background: transparent;
154
+ border: none;
155
+ cursor: pointer;
156
+ display: flex;
157
+ align-items: center;
158
+ justify-content: center;
159
+ padding: 8px;
160
+ color: #666;
161
+ font-size: 22px;
162
+ line-height: 1;
163
+ border-radius: 9999px;
164
+ transition: background-color 0.2s ease, color 0.2s ease;
165
+ }
166
+
167
+ .dap-close:hover {
168
+ background-color: rgba(0, 0, 0, 0.05);
169
+ color: #333;
170
+ }
171
+
172
+ .dap-close:focus {
173
+ outline: none;
174
+ box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
175
+ }
176
+ border-radius: 50%;
177
+ transition: all 0.2s;
178
+ width: 32px;
179
+ height: 32px;
180
+ }
181
+
182
+ .dap-close:hover {
183
+ background-color: rgba(0, 0, 0, 0.05);
184
+ color: #333;
185
+ }
186
+
187
+ .dap-survey-intro {
188
+ margin: 0;
189
+ padding: 24px 24px 0;
190
+ line-height: 1.5;
191
+ color: #555;
192
+ font-size: 15px;
193
+ }
194
+
195
+ .dap-survey-form {
196
+ display: flex;
197
+ flex-direction: column;
198
+ gap: 0;
199
+ width: 100%;
200
+ padding: 20px 24px 24px;
201
+ }
202
+
203
+ .dap-survey-error {
204
+ background-color: #fff0f0;
205
+ color: #e53935;
206
+ padding: 12px 16px;
207
+ border-radius: 8px;
208
+ margin-bottom: 16px;
209
+ font-weight: 500;
210
+ font-size: 14px;
211
+ border-left: 3px solid #e53935;
212
+ }
213
+
214
+ .dap-survey-question {
215
+ padding: 20px;
216
+ width: 100%;
217
+ border: 1px solid #eaeef2;
218
+ border-radius: 12px;
219
+ margin-bottom: 16px;
220
+ background-color: white;
221
+ transition: box-shadow 0.2s ease, border-color 0.2s ease;
222
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
223
+ }
224
+
225
+ .dap-survey-question:hover {
226
+ box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
227
+ border-color: #dbe1e8;
228
+ }
229
+
230
+ .dap-survey-question:last-child {
231
+ margin-bottom: 0;
232
+ }
233
+
234
+ .dap-question-label {
235
+ display: block;
236
+ font-weight: 600;
237
+ margin-bottom: 14px;
238
+ color: #222;
239
+ font-size: 16px;
240
+ line-height: 1.4;
241
+ }
242
+
243
+ .dap-question-input {
244
+ display: flex;
245
+ flex-direction: column;
246
+ gap: 12px;
247
+ width: 100%;
248
+ }
249
+
250
+ /* Radio and Checkbox */
251
+ .dap-radio-wrapper,
252
+ .dap-checkbox-wrapper {
253
+ display: flex;
254
+ align-items: center;
255
+ gap: 12px;
256
+ margin: 4px 0;
257
+ padding: 10px 14px;
258
+ border-radius: 6px;
259
+ transition: all 0.2s ease;
260
+ border: 1px solid #eaeef2;
261
+ background-color: #fafbfd;
262
+ }
263
+
264
+ .dap-radio-wrapper:hover,
265
+ .dap-checkbox-wrapper:hover {
266
+ background-color: #f0f4f8;
267
+ border-color: #dbe1e8;
268
+ transform: translateY(-1px);
269
+ }
270
+
271
+ .dap-radio-wrapper input,
272
+ .dap-checkbox-wrapper input {
273
+ margin: 0;
274
+ width: 18px;
275
+ height: 18px;
276
+ accent-color: #4361ee;
277
+ }
278
+
279
+ .dap-radio-wrapper label,
280
+ .dap-checkbox-wrapper label {
281
+ cursor: pointer;
282
+ font-size: 15px;
283
+ color: #333;
284
+ flex: 1;
285
+ font-weight: 500;
286
+ }
287
+
288
+ /* Text inputs */
289
+ .dap-question-input input[type="text"],
290
+ .dap-question-input textarea,
291
+ .dap-question-input select {
292
+ padding: 12px 14px;
293
+ border: 1px solid #e2e8f0;
294
+ border-radius: 6px;
295
+ font-family: inherit;
296
+ font-size: 15px;
297
+ width: 100%;
298
+ box-sizing: border-box;
299
+ transition: all 0.2s ease;
300
+ background-color: white;
301
+ color: #333;
302
+ line-height: 1.5;
303
+ }
304
+
305
+ .dap-question-input input[type="text"]:focus,
306
+ .dap-question-input textarea:focus,
307
+ .dap-question-input select:focus {
308
+ outline: none;
309
+ border-color: #4361ee;
310
+ box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.15);
311
+ }
312
+
313
+ .dap-question-input textarea {
314
+ min-height: 120px;
315
+ resize: vertical;
316
+ line-height: 1.6;
317
+ }
318
+ }
319
+
320
+ .dap-question-input textarea {
321
+ resize: vertical;
322
+ min-height: 90px;
323
+ line-height: 1.5;
324
+ }
325
+
326
+ /* Opinion Scale */
327
+ .dap-scale-container {
328
+ display: flex;
329
+ flex-direction: column;
330
+ width: 100%;
331
+ gap: 12px;
332
+ }
333
+
334
+ .dap-scale-options {
335
+ display: flex;
336
+ justify-content: space-between;
337
+ width: 100%;
338
+ }
339
+
340
+ .dap-scale-option {
341
+ display: flex;
342
+ flex-direction: column;
343
+ align-items: center;
344
+ gap: 6px;
345
+ }
346
+
347
+ .dap-scale-option input {
348
+ margin: 0;
349
+ width: 18px;
350
+ height: 18px;
351
+ accent-color: #4361ee;
352
+ }
353
+
354
+ .dap-scale-option label {
355
+ font-size: 14px;
356
+ text-align: center;
357
+ font-weight: 500;
358
+ }
359
+
360
+ .dap-scale-label {
361
+ font-size: 14px;
362
+ color: #555;
363
+ max-width: 120px;
364
+ font-weight: 500;
365
+ }
366
+
367
+ .dap-scale-option input {
368
+ margin: 0;
369
+ width: 18px;
370
+ height: 18px;
371
+ accent-color: #4361ee;
372
+ }
373
+
374
+ .dap-scale-option label {
375
+ font-size: 14px;
376
+ text-align: center;
377
+ font-weight: 500;
378
+ }
379
+
380
+ .dap-scale-label {
381
+ font-size: 14px;
382
+ color: #555;
383
+ max-width: 120px;
384
+ font-weight: 500;
385
+ }
386
+
387
+ /* Opinion Scale Choice (Face Scale) */
388
+ .dap-scale-faces {
389
+ display: flex;
390
+ justify-content: space-between;
391
+ gap: 10px;
392
+ width: 100%;
393
+ margin-top: 12px;
394
+ }
395
+
396
+ .dap-face-option {
397
+ display: flex;
398
+ flex-direction: column;
399
+ align-items: center;
400
+ gap: 8px;
401
+ }
402
+
403
+ .dap-face-radio {
404
+ display: none;
405
+ }
406
+
407
+ .dap-face-label {
408
+ display: flex;
409
+ align-items: center;
410
+ justify-content: center;
411
+ width: 48px;
412
+ height: 48px;
413
+ font-size: 28px;
414
+ border-radius: 50%;
415
+ cursor: pointer;
416
+ transition: all 0.2s ease;
417
+ background-color: #f0f4f8;
418
+ border: 2px solid transparent;
419
+ }
420
+
421
+ .dap-face-radio:checked + .dap-face-label {
422
+ background-color: #e0e7ff;
423
+ border-color: #4361ee;
424
+ transform: scale(1.1);
425
+ }
426
+
427
+ .dap-face-label:hover {
428
+ background-color: #e0e7ff;
429
+ transform: translateY(-2px);
430
+ }
431
+
432
+ /* NPS Scale */
433
+ .dap-nps-container {
434
+ display: flex;
435
+ flex-direction: column;
436
+ width: 100%;
437
+ gap: 12px;
438
+ }
439
+
440
+ .dap-nps-scale {
441
+ display: flex;
442
+ justify-content: space-between;
443
+ width: 100%;
444
+ }
445
+
446
+ .dap-nps-option {
447
+ display: flex;
448
+ flex-direction: column;
449
+ align-items: center;
450
+ gap: 6px;
451
+ }
452
+
453
+ .dap-nps-option input {
454
+ margin: 0;
455
+ width: 18px;
456
+ height: 18px;
457
+ accent-color: #4361ee;
458
+ }
459
+
460
+ .dap-nps-option label {
461
+ font-size: 14px;
462
+ text-align: center;
463
+ font-weight: 500;
464
+ cursor: pointer;
465
+ transition: color 0.2s ease;
466
+ }
467
+
468
+ .dap-nps-labels {
469
+ display: flex;
470
+ justify-content: space-between;
471
+ font-size: 14px;
472
+ color: #555;
473
+ width: 100%;
474
+ margin-top: 4px;
475
+ font-weight: 500;
476
+ }
477
+
478
+ .dap-nps-label-min {
479
+ text-align: left;
480
+ }
481
+
482
+ .dap-nps-label-max {
483
+ text-align: right;
484
+ }
485
+
486
+ /* NPS Options */
487
+ .dap-nps-options {
488
+ display: flex;
489
+ flex-direction: column;
490
+ gap: 10px;
491
+ width: 100%;
492
+ }
493
+
494
+ .dap-nps-category {
495
+ display: flex;
496
+ align-items: center;
497
+ gap: 12px;
498
+ padding: 14px;
499
+ background-color: #f7f9fc;
500
+ border-radius: 8px;
501
+ border: 1px solid #e2e8f0;
502
+ transition: all 0.2s ease;
503
+ }
504
+
505
+ .dap-nps-category:hover {
506
+ background-color: #edf2fc;
507
+ transform: translateY(-2px);
508
+ }
509
+
510
+ .dap-nps-category input {
511
+ accent-color: #4361ee;
512
+ width: 18px;
513
+ height: 18px;
514
+ }
515
+
516
+ .dap-nps-category label {
517
+ font-weight: 500;
518
+ font-size: 15px;
519
+ cursor: pointer;
520
+ }
521
+
522
+ /* Star Rating */
523
+ .dap-star-container {
524
+ display: flex;
525
+ flex-direction: column;
526
+ align-items: flex-start;
527
+ gap: 8px;
528
+ padding: 4px 0;
529
+ transition: all 0.2s ease;
530
+ background: transparent;
531
+ border: none;
532
+ }
533
+
534
+ /* Star Rating Styles */
535
+ .dap-rating-wrapper {
536
+ display: flex;
537
+ align-items: center;
538
+ gap: 10px;
539
+ }
540
+
541
+ .dap-star-rating {
542
+ display: inline-flex;
543
+ direction: rtl; /* This reverses the order for the hover effect */
544
+ unicode-bidi: bidi-override;
545
+ justify-content: center;
546
+ gap: 0;
547
+ margin: 5px 0;
548
+ }
549
+
550
+ /* Clear button */
551
+ .dap-clear-rating {
552
+ font-size: 13px;
553
+ background: transparent;
554
+ border: 1px solid #ddd;
555
+ border-radius: 4px;
556
+ padding: 4px 8px;
557
+ color: #555;
558
+ cursor: pointer;
559
+ transition: all 0.2s ease;
560
+ display: inline-flex;
561
+ align-items: center;
562
+ height: fit-content;
563
+ }
564
+
565
+ .dap-clear-rating:hover {
566
+ background-color: #f5f5f5;
567
+ border-color: #ccc;
568
+ color: #333;
569
+ }
570
+
571
+ /* Rating text only used in StarChoice */
572
+ .dap-rating-text {
573
+ font-size: 14px;
574
+ color: #777;
575
+ margin-top: 8px;
576
+ text-align: center;
577
+ min-height: 20px;
578
+ }
579
+
580
+ .dap-rating-selected {
581
+ font-weight: 500;
582
+ color: #4361ee;
583
+ }
584
+
585
+ /* Hide radio buttons */
586
+ .dap-star-input {
587
+ position: absolute;
588
+ opacity: 0;
589
+ width: 0;
590
+ height: 0;
591
+ }
592
+
593
+ /* Star labels */
594
+ .dap-star-label {
595
+ font-size: 30px;
596
+ color: #e0e0e0;
597
+ cursor: pointer;
598
+ display: inline-block;
599
+ transition: color 0.15s ease;
600
+ padding: 0 2px;
601
+ }
602
+
603
+ /* Create star shape */
604
+ .dap-star-label::before {
605
+ content: "★";
606
+ display: block;
607
+ }
608
+
609
+ /* Unselected color */
610
+ .dap-star-rating .dap-star-label {
611
+ color: #e0e0e0;
612
+ }
613
+
614
+ /* Hover effect */
615
+ .dap-star-label:hover,
616
+ .dap-star-label:hover ~ .dap-star-label,
617
+ .dap-star-input:checked ~ .dap-star-label {
618
+ color: #ffc107;
619
+ }
620
+
621
+ /* Selected stars */
622
+ .dap-star-input:checked ~ .dap-star-label {
623
+ color: #ffc107;
624
+ }
625
+
626
+ /* When focusing on stars */
627
+ .dap-star-input:focus + .dap-star-label {
628
+ outline: 1px dotted #4361ee;
629
+ outline-offset: 2px;
630
+ }
631
+
632
+ /* Focused star for accessibility */
633
+ .dap-star:focus {
634
+ outline: none;
635
+ box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.5);
636
+ border-radius: 50%;
637
+ }
638
+
639
+ /* Star Choice Component */
640
+ .dap-star-ratings-container {
641
+ display: flex;
642
+ flex-direction: column;
643
+ gap: 20px;
644
+ width: 100%;
645
+ }
646
+
647
+ .dap-criterion-card {
648
+ display: flex;
649
+ flex-direction: column;
650
+ gap: 8px;
651
+ padding: 0;
652
+ background-color: transparent;
653
+ border: none;
654
+ border-radius: 0;
655
+ transition: all 0.2s ease;
656
+ }
657
+
658
+ .dap-criterion-card:hover {
659
+ transform: none;
660
+ box-shadow: none;
661
+ }
662
+
663
+ .dap-criterion-label {
664
+ font-weight: 500;
665
+ color: #333;
666
+ font-size: 16px;
667
+ margin-bottom: 2px;
668
+ }
669
+
670
+ /* Tables for multi-rating questions */
671
+ .dap-scale-table,
672
+ .dap-star-table {
673
+ width: 100%;
674
+ border-collapse: separate;
675
+ border-spacing: 0;
676
+ margin-top: 12px;
677
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
678
+ border-radius: 8px;
679
+ overflow: hidden;
680
+ }
681
+
682
+ .dap-scale-table th,
683
+ .dap-scale-table td,
684
+ .dap-star-table th,
685
+ .dap-star-table td {
686
+ padding: 12px 10px;
687
+ text-align: center;
688
+ vertical-align: middle;
689
+ border-bottom: 1px solid #eee;
690
+ }
691
+
692
+ .dap-scale-table tr:last-child td,
693
+ .dap-star-table tr:last-child td {
694
+ border-bottom: none;
695
+ }
696
+
697
+ .dap-scale-table th,
698
+ .dap-star-table th {
699
+ background-color: #f7f9fc;
700
+ color: #444;
701
+ font-weight: 600;
702
+ font-size: 14px;
703
+ text-transform: none;
704
+ }
705
+
706
+ .dap-scale-table td:first-child,
707
+ .dap-star-table td:first-child {
708
+ text-align: left;
709
+ font-weight: 500;
710
+ color: #333;
711
+ padding-left: 16px;
712
+ }
713
+
714
+ .dap-option-name,
715
+ .dap-criterion-name {
716
+ text-align: left !important;
717
+ font-weight: normal;
718
+ min-width: 120px;
719
+ }
720
+
721
+ .dap-scale-min-label {
722
+ text-align: left !important;
723
+ font-size: 13px;
724
+ color: #666;
725
+ }
726
+
727
+ .dap-scale-max-label {
728
+ text-align: right !important;
729
+ font-size: 13px;
730
+ color: #666;
731
+ }
732
+
733
+ .dap-scale-labels td {
734
+ padding-top: 0 !important;
735
+ }
736
+
737
+ /* Footer buttons */
738
+ .dap-footer {
739
+ display: flex;
740
+ justify-content: flex-end;
741
+ gap: 12px;
742
+ padding: 16px 24px;
743
+ border-top: 1px solid rgba(0, 0, 0, 0.08);
744
+ background-color: #fafbfc;
745
+ border-bottom-left-radius: var(--dap-radius, 8px);
746
+ border-bottom-right-radius: var(--dap-radius, 8px);
747
+ width: 100%;
748
+ box-sizing: border-box;
749
+ margin: 0;
750
+ }
751
+
752
+ .dap-footer button {
753
+ padding: 10px 20px;
754
+ border-radius: 6px;
755
+ font-size: 15px;
756
+ cursor: pointer;
757
+ font-weight: 600;
758
+ transition: all 0.2s ease;
759
+ outline: none;
760
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
761
+ }
762
+
763
+ .dap-footer .dap-cta {
764
+ background-color: #4361ee;
765
+ color: white;
766
+ border: none;
767
+ }
768
+
769
+ .dap-footer .dap-secondary {
770
+ background-color: transparent;
771
+ color: #555;
772
+ border: 1px solid #ddd;
773
+ }
774
+
775
+ .dap-footer .dap-cta:hover {
776
+ background-color: #3a56d4;
777
+ transform: translateY(-1px);
778
+ box-shadow: 0 4px 8px rgba(67, 97, 238, 0.15);
779
+ }
780
+
781
+ .dap-footer .dap-secondary:hover {
782
+ background-color: #f0f2f5;
783
+ border-color: #ccc;
784
+ }
785
+
786
+ /* Responsive adjustments */
787
+ @media (max-width: 720px) {
788
+ .dap-survey-modal {
789
+ max-width: 95%;
790
+ }
791
+ }
792
+
793
+ @media (max-width: 480px) {
794
+ .dap-survey-modal {
795
+ width: 100%;
796
+ max-width: 95%;
797
+ max-height: 95vh;
798
+ margin: 0 auto;
799
+ border-radius: 12px;
800
+ }
801
+
802
+ .dap-survey-body {
803
+ padding: 16px;
804
+ max-height: calc(95vh - 110px);
805
+ }
806
+
807
+ .dap-header-bar {
808
+ padding: 14px 16px;
809
+ }
810
+
811
+ .dap-footer {
812
+ padding: 14px 16px;
813
+ }
814
+
815
+ .dap-survey-title {
816
+ font-size: 18px;
817
+ }
818
+
819
+ .dap-question-label {
820
+ font-size: 15px;
821
+ }
822
+
823
+ .dap-radio-wrapper,
824
+ .dap-checkbox-wrapper {
825
+ padding: 8px;
826
+ }
827
+
828
+ .dap-scale-table,
829
+ .dap-star-table {
830
+ font-size: 13px;
831
+ }
832
+
833
+ .dap-scale-option label,
834
+ .dap-nps-option label {
835
+ font-size: 12px;
836
+ }
837
+
838
+ .dap-star {
839
+ font-size: 28px;
840
+ }
841
+
842
+ .dap-footer button {
843
+ padding: 9px 16px;
844
+ font-size: 14px;
845
+ width: 100%;
846
+ }
847
+
848
+ .dap-footer {
849
+ flex-direction: column-reverse;
850
+ gap: 8px;
851
+ }
852
+
853
+ .dap-text-input,
854
+ .dap-textarea {
855
+ font-size: 15px;
856
+ }
857
+
858
+ /* Star rating responsive adjustments */
859
+ .dap-star-label {
860
+ font-size: 28px;
861
+ }
862
+
863
+ .dap-criterion-card {
864
+ padding: 12px;
865
+ }
866
+ }
867
+
868
+ /* Additional star choice styles */
869
+ .dap-criterion-card .dap-star-rating {
870
+ margin: 8px 0;
871
+ }
872
+
873
+ .dap-criterion-card .dap-rating-text {
874
+ text-align: left;
875
+ margin-left: 4px;
876
+ color: #555;
877
+ font-style: italic;
878
+ font-size: 13px;
879
+ min-height: 20px;
880
+ }
881
+
882
+ .dap-criterion-card .dap-rating-selected {
883
+ color: #4361ee;
884
+ font-weight: 500;
885
+ font-style: normal;
886
+ }
887
+
888
+ /* Adjust for survey question spacing */
889
+ .dap-question-input .dap-star-rating {
890
+ padding: 5px 0;
891
+ margin: 5px 0;
892
+ }
893
+
894
+ /* Style for criterion cards */
895
+ .dap-criterion-card {
896
+ margin-bottom: 10px;
897
+ padding-bottom: 10px;
898
+ border-bottom: 1px solid #eee;
899
+ }
900
+
901
+ .dap-criterion-card:last-child {
902
+ border-bottom: none;
903
+ }
904
+
905
+ /* Make clear button smaller for criterion cards */
906
+ .dap-criterion-card .dap-clear-rating {
907
+ font-size: 12px;
908
+ padding: 3px 6px;
909
+ }
910
+
911
+ /* Enhanced Star Choice Styles */
912
+ .dap-star-choice-container {
913
+ display: flex;
914
+ flex-direction: column;
915
+ padding: 10px 0;
916
+ }
917
+
918
+
919
+
920
+ /* Star Choice Specific Styles */
921
+ .dap-star-choice-container {
922
+ padding: 8px 0;
923
+ }
924
+
925
+ .dap-star-choice-options {
926
+ display: flex;
927
+ flex-direction: column;
928
+ gap: 12px;
929
+ }
930
+
931
+ .dap-star-choice-option {
932
+ display: flex;
933
+ align-items: center;
934
+ position: relative;
935
+ }
936
+
937
+ .dap-star-choice-input {
938
+ margin: 0;
939
+ margin-right: 8px;
940
+ }
941
+
942
+ .dap-star-choice-label {
943
+ display: flex;
944
+ align-items: center;
945
+ cursor: pointer;
946
+ gap: 8px;
947
+ }
948
+
949
+ .dap-star-choice-stars {
950
+ display: flex;
951
+ align-items: center;
952
+ }
953
+
954
+ .dap-star-choice-star {
955
+ color: #e0e0e0;
956
+ font-size: 20px;
957
+ line-height: 1;
958
+ }
959
+
960
+ .dap-star-choice-star.filled {
961
+ color: #ffc107;
962
+ }
963
+
964
+ .dap-star-choice-text {
965
+ font-size: 14px;
966
+ color: #333;
967
+ margin-left: 4px;
968
+ }
969
+
970
+ /* Hover effect for the star choice options */
971
+ .dap-star-choice-option:hover .dap-star-choice-label {
972
+ font-weight: 500;
973
+ }
974
+
975
+ /* Selected state */
976
+ .dap-star-choice-input:checked + .dap-star-choice-label .dap-star-choice-text {
977
+ font-weight: 500;
978
+ }
979
+
980
+ /* Accessible focus style */
981
+ .dap-star-choice-input:focus {
982
+ outline: 2px solid #4361ee;
983
+ outline-offset: 2px;
984
+ }
985
+
986
+ /* Focus states for keyboard navigation */
987
+ .dap-star-choice-container .dap-star-input:focus + .dap-star-label {
988
+ outline: 2px solid #4361ee;
989
+ outline-offset: 2px;
990
+ }
991
+
992
+ /* Mobile-friendly adjustments */
993
+ @media (max-width: 768px) {
994
+ .dap-star-choice-star {
995
+ font-size: 18px;
996
+ }
997
+
998
+ .dap-star-choice-text {
999
+ font-size: 13px;
1000
+ }
1001
+ }
1002
+
1003
+ /* Small mobile devices */
1004
+ @media (max-width: 480px) {
1005
+ .dap-star-choice-option {
1006
+ margin-bottom: 4px;
1007
+ }
1008
+
1009
+ .dap-star-choice-star {
1010
+ font-size: 16px;
1011
+ }
1012
+ }
1013
+ `;