@explorer02/cfm-survey-sdk 0.3.1 → 0.3.2
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/cli/index.js +94 -83
- package/dist/cli/index.mjs +94 -83
- package/package.json +1 -1
- package/templates/docs/templates/CsatMatrixScale.tsx +18 -24
- package/templates/docs/templates/CustomSliderTrack.tsx +5 -3
- package/templates/docs/templates/FileUploadScale.tsx +143 -18
- package/templates/docs/templates/HeatmapScale.tsx +11 -2
- package/templates/docs/templates/LanguageSelector.tsx +42 -19
- package/templates/docs/templates/LikertMatrixScale.tsx +43 -33
- package/templates/docs/templates/MatrixDropdown.tsx +12 -11
- package/templates/docs/templates/Question.tsx +109 -44
- package/templates/docs/templates/RankOrderScale.tsx +22 -5
- package/templates/docs/templates/RatingScale.tsx +5 -3
- package/templates/docs/templates/SliderMatrixScale.tsx +44 -16
- package/templates/docs/templates/selectionStyles.ts +88 -1
- package/templates/docs/templates/surveyUiIcons.tsx +2 -2
- package/templates/docs/templates/surveyUiScaleUtils.ts +38 -5
- package/templates/docs/templates/uiConfig.ts +56 -0
- package/templates/preview-harness/previewPages.js +4 -7
- package/templates/preview-harness/previewPages.ts +7 -34
- package/templates/preview-harness/vite-app/src/PreviewConfigContext.tsx +7 -0
- package/templates/preview-harness/vite-app/src/QuestionPreview.tsx +59 -30
- package/templates/preview-harness/vite-app/src/SurveyPagePreview.tsx +36 -8
- package/templates/preview-harness/vite-app/src/fixtures/questions.ts +182 -82
- package/templates/survey-theme.css +13 -4
- package/templates/wizard-dist/assets/{PreviewMock-Bax7oRAL.js → PreviewMock-DbbLpHdF.js} +1 -1
- package/templates/wizard-dist/assets/TypePanel-DQbV2iCf.js +1 -0
- package/templates/wizard-dist/assets/index-CY7WMJ93.js +34 -0
- package/templates/wizard-dist/index.html +1 -1
- package/templates/wizard-dist/assets/TypePanel-D2t4FPSd.js +0 -1
- package/templates/wizard-dist/assets/index-c5lka74l.js +0 -34
|
@@ -4,22 +4,34 @@ import type { SpecialPage, SurveyQuestion } from '@explorer02/cfm-survey-sdk';
|
|
|
4
4
|
const base = (partial: Partial<SurveyQuestion> & { type: SurveyQuestion['type'] }): SurveyQuestion =>
|
|
5
5
|
({
|
|
6
6
|
id: 'preview-q',
|
|
7
|
-
questionText: '
|
|
7
|
+
questionText: 'Question',
|
|
8
8
|
required: true,
|
|
9
9
|
questionNumber: 1,
|
|
10
10
|
options: [],
|
|
11
11
|
...partial,
|
|
12
12
|
}) as SurveyQuestion;
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
{ id: '
|
|
14
|
+
const LIKERT_COLUMNS = [
|
|
15
|
+
{ id: 'c1', label: 'Strongly Disagree' },
|
|
16
|
+
{ id: 'c2', label: 'Disagree' },
|
|
17
|
+
{ id: 'c3', label: 'Neutral' },
|
|
18
|
+
{ id: 'c4', label: 'Agree' },
|
|
19
|
+
{ id: 'c5', label: 'Strongly Agree' },
|
|
16
20
|
];
|
|
17
21
|
|
|
22
|
+
const MATRIX_ROW_SINGLE = [{ id: 'r1', statementText: 'Statement Item 1' }];
|
|
23
|
+
|
|
18
24
|
const MATRIX_ROWS_MULTI = [
|
|
19
|
-
{ id: 'r1', statementText: '
|
|
20
|
-
{ id: 'r2', statementText: '
|
|
25
|
+
{ id: 'r1', statementText: 'Statement Item 1' },
|
|
26
|
+
{ id: 'r2', statementText: 'Statement Item 2' },
|
|
27
|
+
{ id: 'r3', statementText: 'Statement Item 3' },
|
|
21
28
|
];
|
|
22
29
|
|
|
30
|
+
const SLIDER_TICKS = Array.from({ length: 11 }, (_, i) => ({
|
|
31
|
+
tickPosition: i,
|
|
32
|
+
tickLabel: String(i),
|
|
33
|
+
}));
|
|
34
|
+
|
|
23
35
|
export const FIXTURE_INTRO: SpecialPage = {
|
|
24
36
|
id: 'preview-intro',
|
|
25
37
|
header: 'Welcome to our survey',
|
|
@@ -35,39 +47,60 @@ export const FIXTURE_END: SpecialPage = {
|
|
|
35
47
|
|
|
36
48
|
export const FIXTURE_MCQ_SINGLE = base({
|
|
37
49
|
type: 'MCQ',
|
|
50
|
+
questionText: 'Select one option',
|
|
38
51
|
selectionMode: 'single',
|
|
39
52
|
options: [
|
|
40
|
-
{ id: 'a', optionLabel: '
|
|
41
|
-
{ id: 'b', optionLabel: '
|
|
42
|
-
{ id: 'c', optionLabel: '
|
|
53
|
+
{ id: 'a', optionLabel: 'Option 1', value: 'a' },
|
|
54
|
+
{ id: 'b', optionLabel: 'Option 2', value: 'b' },
|
|
55
|
+
{ id: 'c', optionLabel: 'Option 3', value: 'c' },
|
|
56
|
+
{ id: 'd', optionLabel: 'Option 4', value: 'd' },
|
|
43
57
|
],
|
|
44
|
-
defaultOptionIds: ['a'],
|
|
45
58
|
});
|
|
46
59
|
|
|
47
60
|
export const FIXTURE_MCQ_MULTIPLE = base({
|
|
48
61
|
type: 'MCQ',
|
|
62
|
+
questionText: 'Select all that apply',
|
|
49
63
|
selectionMode: 'multiple',
|
|
50
64
|
minSelections: 1,
|
|
51
65
|
maxSelections: 2,
|
|
52
66
|
options: [
|
|
53
|
-
{ id: 'a', optionLabel: '
|
|
54
|
-
{ id: 'b', optionLabel: '
|
|
55
|
-
{ id: 'c', optionLabel: '
|
|
67
|
+
{ id: 'a', optionLabel: 'Option 1', value: 'a' },
|
|
68
|
+
{ id: 'b', optionLabel: 'Option 2', value: 'b' },
|
|
69
|
+
{ id: 'c', optionLabel: 'Option 3', value: 'c' },
|
|
56
70
|
],
|
|
57
71
|
});
|
|
58
72
|
|
|
73
|
+
export const PREVIEW_LANGUAGES = [
|
|
74
|
+
{ code: 'en', name: 'English' },
|
|
75
|
+
{ code: 'de', name: 'Deutsch' },
|
|
76
|
+
];
|
|
77
|
+
|
|
59
78
|
export const FIXTURE_NPS = base({
|
|
60
79
|
type: 'NPS_SCALE',
|
|
80
|
+
questionText:
|
|
81
|
+
'Based on your experience, how likely are you to recommend [Company/Product/Service] to your friends and family?',
|
|
61
82
|
buttonStyle: 'standard',
|
|
62
|
-
minLabel: 'Not
|
|
63
|
-
maxLabel: 'Extremely
|
|
83
|
+
minLabel: 'Not Likely At All',
|
|
84
|
+
maxLabel: 'Extremely Likely',
|
|
64
85
|
options: Array.from({ length: 11 }, (_, i) => ({
|
|
65
86
|
id: `nps-${i}`,
|
|
66
87
|
optionLabel: String(i),
|
|
67
|
-
value: i,
|
|
68
88
|
})),
|
|
69
89
|
});
|
|
70
90
|
|
|
91
|
+
export const FIXTURE_SURVEY_PAGE_MCQ = base({
|
|
92
|
+
id: 'preview-survey-mcq',
|
|
93
|
+
type: 'MCQ',
|
|
94
|
+
questionNumber: 1,
|
|
95
|
+
questionText: 'Which option best describes your experience?',
|
|
96
|
+
selectionMode: 'single',
|
|
97
|
+
options: [
|
|
98
|
+
{ id: 'a', optionLabel: 'Excellent — exceeded expectations', value: 'a' },
|
|
99
|
+
{ id: 'b', optionLabel: 'Good — met expectations', value: 'b' },
|
|
100
|
+
{ id: 'c', optionLabel: 'Fair — room for improvement', value: 'c' },
|
|
101
|
+
],
|
|
102
|
+
});
|
|
103
|
+
|
|
71
104
|
export const FIXTURE_SURVEY_PAGE_NPS = base({
|
|
72
105
|
id: 'preview-survey-nps',
|
|
73
106
|
type: 'NPS_SCALE',
|
|
@@ -80,43 +113,47 @@ export const FIXTURE_SURVEY_PAGE_NPS = base({
|
|
|
80
113
|
options: Array.from({ length: 11 }, (_, i) => ({
|
|
81
114
|
id: `nps-${i}`,
|
|
82
115
|
optionLabel: String(i),
|
|
83
|
-
value: i,
|
|
84
116
|
})),
|
|
85
117
|
});
|
|
86
118
|
|
|
87
|
-
export const PREVIEW_LANGUAGES = [
|
|
88
|
-
{ code: 'en', name: 'English' },
|
|
89
|
-
{ code: 'de', name: 'Deutsch' },
|
|
90
|
-
];
|
|
91
|
-
|
|
92
119
|
export const FIXTURE_TEXT_SHORT = base({
|
|
93
120
|
type: 'TEXTFIELD',
|
|
94
|
-
|
|
95
|
-
|
|
121
|
+
questionText: 'Question',
|
|
122
|
+
inputVariant: 'short',
|
|
123
|
+
placeholder: 'Enter Text',
|
|
124
|
+
maxCharacterCount: 1000,
|
|
96
125
|
});
|
|
97
126
|
|
|
98
127
|
export const FIXTURE_TEXT_LONG = base({
|
|
99
128
|
type: 'TEXTFIELD',
|
|
100
|
-
|
|
101
|
-
|
|
129
|
+
questionText: 'Question',
|
|
130
|
+
inputVariant: 'long',
|
|
131
|
+
placeholder: 'Type your response here...',
|
|
132
|
+
maxCharacterCount: 1000,
|
|
102
133
|
});
|
|
103
134
|
|
|
104
135
|
export const FIXTURE_CFM_LIKERT = base({
|
|
105
136
|
type: 'CFM_MATRIX',
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
137
|
+
statementLayout: 'likert',
|
|
138
|
+
gridLayout: 'standard',
|
|
139
|
+
transposeTable: false,
|
|
140
|
+
selectionMode: 'single',
|
|
141
|
+
showColumnHeaders: true,
|
|
142
|
+
repeatColumnHeaders: false,
|
|
143
|
+
hasNotApplicableOption: false,
|
|
144
|
+
statementRows: MATRIX_ROWS_MULTI,
|
|
145
|
+
scaleColumns: LIKERT_COLUMNS,
|
|
114
146
|
});
|
|
115
147
|
|
|
116
148
|
export const FIXTURE_CFM_BIPOLAR = base({
|
|
117
149
|
type: 'CFM_MATRIX',
|
|
118
150
|
statementLayout: 'bipolar',
|
|
151
|
+
gridLayout: 'standard',
|
|
152
|
+
transposeTable: false,
|
|
153
|
+
selectionMode: 'single',
|
|
119
154
|
showColumnHeaders: false,
|
|
155
|
+
repeatColumnHeaders: false,
|
|
156
|
+
hasNotApplicableOption: false,
|
|
120
157
|
statementRows: [
|
|
121
158
|
{
|
|
122
159
|
id: 'r1',
|
|
@@ -128,43 +165,77 @@ export const FIXTURE_CFM_BIPOLAR = base({
|
|
|
128
165
|
scaleAnchorLabels: ['Hard', '', '', '', 'Easy'],
|
|
129
166
|
});
|
|
130
167
|
|
|
168
|
+
export const FIXTURE_CFM_TRANSPOSE = base({
|
|
169
|
+
type: 'CFM_MATRIX',
|
|
170
|
+
statementLayout: 'likert',
|
|
171
|
+
gridLayout: 'standard',
|
|
172
|
+
transposeTable: true,
|
|
173
|
+
selectionMode: 'single',
|
|
174
|
+
showColumnHeaders: true,
|
|
175
|
+
repeatColumnHeaders: false,
|
|
176
|
+
hasNotApplicableOption: false,
|
|
177
|
+
statementRows: MATRIX_ROW_SINGLE,
|
|
178
|
+
scaleColumns: Array.from({ length: 5 }, (_, i) => ({ id: `c${i}`, label: String(i + 1) })),
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
export const FIXTURE_CFM_CAROUSEL = base({
|
|
182
|
+
type: 'CFM_MATRIX',
|
|
183
|
+
statementLayout: 'likert',
|
|
184
|
+
gridLayout: 'carousel',
|
|
185
|
+
transposeTable: false,
|
|
186
|
+
selectionMode: 'single',
|
|
187
|
+
showColumnHeaders: true,
|
|
188
|
+
repeatColumnHeaders: false,
|
|
189
|
+
hasNotApplicableOption: false,
|
|
190
|
+
statementRows: MATRIX_ROWS_MULTI,
|
|
191
|
+
scaleColumns: LIKERT_COLUMNS,
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
export const FIXTURE_CFM_DROPDOWN = base({
|
|
195
|
+
type: 'CFM_MATRIX',
|
|
196
|
+
statementLayout: 'likert',
|
|
197
|
+
gridLayout: 'dropdown',
|
|
198
|
+
transposeTable: false,
|
|
199
|
+
selectionMode: 'single',
|
|
200
|
+
showColumnHeaders: true,
|
|
201
|
+
repeatColumnHeaders: false,
|
|
202
|
+
hasNotApplicableOption: false,
|
|
203
|
+
statementRows: MATRIX_ROW_SINGLE,
|
|
204
|
+
scaleColumns: LIKERT_COLUMNS,
|
|
205
|
+
});
|
|
206
|
+
|
|
131
207
|
export const FIXTURE_CSAT_EMOJI = base({
|
|
132
208
|
type: 'CSAT_MATRIX',
|
|
133
209
|
displayStyle: 'emoji',
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
{ id: 'c2', label: '😐' },
|
|
138
|
-
{ id: 'c3', label: '🙂' },
|
|
139
|
-
{ id: 'c4', label: '😊' },
|
|
140
|
-
{ id: 'c5', label: '🤩' },
|
|
141
|
-
],
|
|
210
|
+
gridLayout: 'standard',
|
|
211
|
+
statementRows: MATRIX_ROW_SINGLE,
|
|
212
|
+
scaleColumns: Array.from({ length: 10 }, (_, i) => ({ id: `c${i}`, label: String(i + 1) })),
|
|
142
213
|
scaleAnchorLabels: ['Very unhappy', '', '', '', 'Very happy'],
|
|
143
214
|
});
|
|
144
215
|
|
|
145
216
|
export const FIXTURE_CSAT_STAR = base({
|
|
146
217
|
type: 'CSAT_MATRIX',
|
|
147
218
|
displayStyle: 'star',
|
|
148
|
-
|
|
149
|
-
|
|
219
|
+
gridLayout: 'standard',
|
|
220
|
+
statementRows: MATRIX_ROW_SINGLE,
|
|
221
|
+
scaleColumns: Array.from({ length: 10 }, (_, i) => ({ id: `c${i}`, label: String(i + 1) })),
|
|
150
222
|
});
|
|
151
223
|
|
|
152
224
|
export const FIXTURE_CSAT_NUMBERED = base({
|
|
153
225
|
type: 'CSAT_MATRIX',
|
|
154
226
|
displayStyle: 'numbered',
|
|
155
|
-
|
|
227
|
+
gridLayout: 'standard',
|
|
228
|
+
statementRows: MATRIX_ROWS_MULTI,
|
|
156
229
|
scaleColumns: Array.from({ length: 10 }, (_, i) => ({ id: `c${i}`, label: String(i + 1) })),
|
|
157
230
|
});
|
|
158
231
|
|
|
159
232
|
export const FIXTURE_CSAT_GRAPHICS = base({
|
|
160
233
|
type: 'CSAT_MATRIX',
|
|
161
234
|
displayStyle: 'graphics',
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
{ id: 'c3', label: 'High' },
|
|
167
|
-
],
|
|
235
|
+
gridLayout: 'standard',
|
|
236
|
+
statementRows: MATRIX_ROW_SINGLE,
|
|
237
|
+
scaleColumns: Array.from({ length: 10 }, (_, i) => ({ id: `c${i}`, label: String(i + 1) })),
|
|
238
|
+
scaleAnchorLabels: ['Label 1', 'Label 2'],
|
|
168
239
|
});
|
|
169
240
|
|
|
170
241
|
export const FIXTURE_CSAT_CAROUSEL = base({
|
|
@@ -178,7 +249,8 @@ export const FIXTURE_CSAT_CAROUSEL = base({
|
|
|
178
249
|
export const FIXTURE_CSAT_DROPDOWN = base({
|
|
179
250
|
type: 'CSAT_MATRIX',
|
|
180
251
|
displayStyle: 'dropdown',
|
|
181
|
-
|
|
252
|
+
gridLayout: 'standard',
|
|
253
|
+
statementRows: MATRIX_ROW_SINGLE,
|
|
182
254
|
scaleColumns: [
|
|
183
255
|
{ id: 'c1', label: 'Poor' },
|
|
184
256
|
{ id: 'c2', label: 'Fair' },
|
|
@@ -190,99 +262,123 @@ export const FIXTURE_CSAT_DROPDOWN = base({
|
|
|
190
262
|
export const FIXTURE_RATING_STAR = base({
|
|
191
263
|
type: 'RATING_MATRIX',
|
|
192
264
|
displayStyle: 'star',
|
|
193
|
-
|
|
194
|
-
|
|
265
|
+
gridLayout: 'standard',
|
|
266
|
+
showColumnHeaders: true,
|
|
267
|
+
statementRows: MATRIX_ROWS_MULTI,
|
|
268
|
+
scaleColumns: LIKERT_COLUMNS,
|
|
195
269
|
});
|
|
196
270
|
|
|
197
271
|
export const FIXTURE_RATING_NUMBERED = base({
|
|
198
272
|
type: 'RATING_MATRIX',
|
|
199
273
|
displayStyle: 'numbered',
|
|
200
|
-
|
|
274
|
+
gridLayout: 'standard',
|
|
275
|
+
statementRows: MATRIX_ROWS_MULTI,
|
|
201
276
|
scaleColumns: Array.from({ length: 10 }, (_, i) => ({ id: `c${i}`, label: String(i + 1) })),
|
|
202
277
|
});
|
|
203
278
|
|
|
204
279
|
export const FIXTURE_RATING_RADIO = base({
|
|
205
280
|
type: 'RATING_MATRIX',
|
|
206
281
|
displayStyle: 'standard',
|
|
207
|
-
|
|
208
|
-
|
|
282
|
+
gridLayout: 'standard',
|
|
283
|
+
statementRows: MATRIX_ROW_SINGLE,
|
|
284
|
+
scaleColumns: LIKERT_COLUMNS,
|
|
209
285
|
});
|
|
210
286
|
|
|
211
287
|
export const FIXTURE_RATING_EMOJI = base({
|
|
212
288
|
type: 'RATING_MATRIX',
|
|
213
289
|
displayStyle: 'emoji',
|
|
214
|
-
|
|
215
|
-
|
|
290
|
+
gridLayout: 'standard',
|
|
291
|
+
statementRows: MATRIX_ROW_SINGLE,
|
|
292
|
+
scaleColumns: Array.from({ length: 10 }, (_, i) => ({ id: `c${i}`, label: String(i + 1) })),
|
|
216
293
|
});
|
|
217
294
|
|
|
218
295
|
export const FIXTURE_RATING_GRAPHICS = base({
|
|
219
296
|
type: 'RATING_MATRIX',
|
|
220
297
|
displayStyle: 'graphics',
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
{ id: 'c3', label: 'High' },
|
|
226
|
-
],
|
|
298
|
+
gridLayout: 'standard',
|
|
299
|
+
statementRows: MATRIX_ROW_SINGLE,
|
|
300
|
+
scaleColumns: Array.from({ length: 10 }, (_, i) => ({ id: `c${i}`, label: String(i + 1) })),
|
|
301
|
+
scaleAnchorLabels: ['Label 1', 'Label 2', 'Label 3', 'Label 4', 'Label 5'],
|
|
227
302
|
});
|
|
228
303
|
|
|
229
304
|
export const FIXTURE_RATING_SLIDER = base({
|
|
230
305
|
type: 'RATING_MATRIX',
|
|
231
306
|
displayStyle: 'graphics',
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
307
|
+
gridLayout: 'standard',
|
|
308
|
+
statementRows: [
|
|
309
|
+
{ id: 'r1', statementText: 'Statement Item 1' },
|
|
310
|
+
{ id: 'r2', statementText: 'Statement Item 2' },
|
|
311
|
+
],
|
|
312
|
+
scaleColumns: [
|
|
313
|
+
{ id: 'c1', label: 'Likely' },
|
|
314
|
+
{ id: 'c2', label: 'Unlikely' },
|
|
315
|
+
{ id: 'c3', label: 'Option 3' },
|
|
316
|
+
{ id: 'c4', label: 'Option 4' },
|
|
317
|
+
],
|
|
318
|
+
scaleAnchorLabels: ['Likely', 'Unlikely', 'Option 3', 'Option 4'],
|
|
235
319
|
});
|
|
236
320
|
|
|
237
321
|
export const FIXTURE_SLIDER = base({
|
|
238
322
|
type: 'SLIDER_MATRIX',
|
|
239
323
|
statementRows: [
|
|
240
|
-
{ id: 'r1', statementText: '
|
|
324
|
+
{ id: 'r1', statementText: 'Statement Item 1', min: 0, max: 10, step: 1 },
|
|
325
|
+
{ id: 'r2', statementText: 'Statement Item 2', min: 0, max: 10, step: 1 },
|
|
241
326
|
],
|
|
242
|
-
scaleAnchorLabels: ['
|
|
327
|
+
scaleAnchorLabels: ['Label 1', 'Label 2'],
|
|
243
328
|
ticks: {
|
|
244
329
|
count: 11,
|
|
245
|
-
marks:
|
|
246
|
-
tickPosition: i,
|
|
247
|
-
tickLabel: String(i),
|
|
248
|
-
})),
|
|
330
|
+
marks: SLIDER_TICKS,
|
|
249
331
|
},
|
|
250
332
|
enableInputBox: false,
|
|
251
|
-
displayValues:
|
|
333
|
+
displayValues: true,
|
|
252
334
|
hasNotApplicableOption: false,
|
|
253
335
|
sliderStyle: 'standard',
|
|
254
336
|
});
|
|
255
337
|
|
|
256
338
|
export const FIXTURE_FILE_UPLOAD = base({
|
|
257
339
|
type: 'FILE_UPLOAD',
|
|
340
|
+
questionText: 'Question',
|
|
341
|
+
uploadMessage: 'Drag attachments here or browse',
|
|
258
342
|
maxFileCount: 1,
|
|
259
343
|
});
|
|
260
344
|
|
|
261
345
|
export const FIXTURE_HEATMAP = base({
|
|
262
346
|
type: 'HEATMAP',
|
|
347
|
+
questionText: 'Question',
|
|
348
|
+
questionDescription: 'Please click on the region of the image which you like the most',
|
|
263
349
|
maxClicksAllowed: 3,
|
|
264
350
|
imageUrl: 'https://placehold.co/600x400/e5e7eb/6b7280?text=Heatmap+Image',
|
|
265
351
|
});
|
|
266
352
|
|
|
353
|
+
export const FIXTURE_TEXT_AND_MEDIA = base({
|
|
354
|
+
type: 'TEXT_AND_MEDIA',
|
|
355
|
+
questionText: 'Question',
|
|
356
|
+
media: {
|
|
357
|
+
url: 'https://placehold.co/600x300/e5e7eb/6b7280?text=Media',
|
|
358
|
+
mimeType: 'IMAGE',
|
|
359
|
+
alignment: 'TOP_CENTER',
|
|
360
|
+
title: 'Caption text',
|
|
361
|
+
size: 80,
|
|
362
|
+
},
|
|
363
|
+
});
|
|
364
|
+
|
|
267
365
|
export const FIXTURE_RANK_DRAG = base({
|
|
268
366
|
type: 'RANK_ORDER',
|
|
269
367
|
interactionMode: 'dragAndDrop',
|
|
270
|
-
optionDisplay: '
|
|
368
|
+
optionDisplay: 'textAndImage',
|
|
271
369
|
options: [
|
|
272
|
-
{ id: 'o1', optionLabel: '
|
|
273
|
-
{ id: 'o2', optionLabel: '
|
|
274
|
-
{ id: 'o3', optionLabel: 'Quality' },
|
|
370
|
+
{ id: 'o1', optionLabel: 'Option 1' },
|
|
371
|
+
{ id: 'o2', optionLabel: 'Option 2' },
|
|
275
372
|
],
|
|
276
373
|
});
|
|
277
374
|
|
|
278
375
|
export const FIXTURE_RANK_DROPDOWN = base({
|
|
279
376
|
type: 'RANK_ORDER',
|
|
280
377
|
interactionMode: 'dropdown',
|
|
281
|
-
optionDisplay: '
|
|
378
|
+
optionDisplay: 'textAndImage',
|
|
282
379
|
options: [
|
|
283
|
-
{ id: 'o1', optionLabel: '
|
|
284
|
-
{ id: 'o2', optionLabel: '
|
|
285
|
-
{ id: 'o3', optionLabel: 'Feature C' },
|
|
380
|
+
{ id: 'o1', optionLabel: 'Option 1' },
|
|
381
|
+
{ id: 'o2', optionLabel: 'Option 2' },
|
|
286
382
|
],
|
|
287
383
|
});
|
|
288
384
|
|
|
@@ -294,6 +390,9 @@ export const PREVIEW_FIXTURES: Record<string, SurveyQuestion | null> = {
|
|
|
294
390
|
NPS_SCALE: FIXTURE_NPS,
|
|
295
391
|
CFM_likert: FIXTURE_CFM_LIKERT,
|
|
296
392
|
CFM_bipolar: FIXTURE_CFM_BIPOLAR,
|
|
393
|
+
CFM_transpose: FIXTURE_CFM_TRANSPOSE,
|
|
394
|
+
CFM_carousel: FIXTURE_CFM_CAROUSEL,
|
|
395
|
+
CFM_dropdown: FIXTURE_CFM_DROPDOWN,
|
|
297
396
|
CSAT_emoji: FIXTURE_CSAT_EMOJI,
|
|
298
397
|
CSAT_star: FIXTURE_CSAT_STAR,
|
|
299
398
|
CSAT_numbered: FIXTURE_CSAT_NUMBERED,
|
|
@@ -308,6 +407,7 @@ export const PREVIEW_FIXTURES: Record<string, SurveyQuestion | null> = {
|
|
|
308
407
|
RATING_slider: FIXTURE_RATING_SLIDER,
|
|
309
408
|
SLIDER_matrix: FIXTURE_SLIDER,
|
|
310
409
|
FILE_UPLOAD: FIXTURE_FILE_UPLOAD,
|
|
410
|
+
TEXT_AND_MEDIA: FIXTURE_TEXT_AND_MEDIA,
|
|
311
411
|
HEATMAP: FIXTURE_HEATMAP,
|
|
312
412
|
RANK_drag: FIXTURE_RANK_DRAG,
|
|
313
413
|
RANK_dropdown: FIXTURE_RANK_DROPDOWN,
|
|
@@ -73,10 +73,12 @@
|
|
|
73
73
|
--cfm-mcq-selected-accent: var(--cfm-accent);
|
|
74
74
|
--cfm-mcq-border-radius: 8px;
|
|
75
75
|
--cfm-mcq-option-gap: 8px;
|
|
76
|
-
--cfm-mcq-card-padding:
|
|
76
|
+
--cfm-mcq-card-padding: 16px 20px;
|
|
77
77
|
--cfm-mcq-selected-bg: var(--cfm-secondary);
|
|
78
78
|
--cfm-mcq-hover-border: var(--cfm-accent);
|
|
79
79
|
|
|
80
|
+
--cfm-input-focus-glow: rgba(226, 0, 116, 0.1);
|
|
81
|
+
|
|
80
82
|
--cfm-input-radius: 8px;
|
|
81
83
|
--cfm-input-focus-ring: var(--cfm-accent);
|
|
82
84
|
--cfm-input-border: #e5e7eb;
|
|
@@ -115,8 +117,9 @@
|
|
|
115
117
|
|
|
116
118
|
--cfm-upload-accent: var(--cfm-accent);
|
|
117
119
|
--cfm-upload-border-color: #d1d5db;
|
|
118
|
-
--cfm-upload-fill:
|
|
119
|
-
--cfm-upload-padding: 24px;
|
|
120
|
+
--cfm-upload-fill: #f9fafb;
|
|
121
|
+
--cfm-upload-padding: 40px 24px;
|
|
122
|
+
--cfm-upload-icon-color: #9ca3af;
|
|
120
123
|
|
|
121
124
|
--cfm-media-max-width: 100%;
|
|
122
125
|
--cfm-media-radius: 8px;
|
|
@@ -124,7 +127,9 @@
|
|
|
124
127
|
--cfm-heatmap-pin: var(--cfm-accent);
|
|
125
128
|
--cfm-heatmap-pin-size: 12px;
|
|
126
129
|
|
|
127
|
-
--cfm-rank-item-bg: #
|
|
130
|
+
--cfm-rank-item-bg: #ffffff;
|
|
131
|
+
--cfm-rank-badge-bg: var(--cfm-mcq-selected-bg);
|
|
132
|
+
--cfm-rank-badge-text: var(--cfm-mcq-selected-accent);
|
|
128
133
|
--cfm-rank-badge: var(--cfm-primary);
|
|
129
134
|
--cfm-rank-handle: #9ca3af;
|
|
130
135
|
--cfm-rank-item-padding: 12px;
|
|
@@ -289,6 +294,10 @@ body {
|
|
|
289
294
|
box-shadow: none;
|
|
290
295
|
}
|
|
291
296
|
|
|
297
|
+
.cfm-mcq-option:hover {
|
|
298
|
+
border-color: var(--cfm-mcq-hover-border, var(--cfm-accent));
|
|
299
|
+
}
|
|
300
|
+
|
|
292
301
|
[data-cfm-dropzone-style='dashed'] .cfm-dropzone {
|
|
293
302
|
border-style: dashed;
|
|
294
303
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as x,j as e}from"./index-
|
|
1
|
+
import{u as x,j as e}from"./index-CY7WMJ93.js";import{b as t}from"./vendor-BwkXDkd3.js";function p(d=150){const l=x(r=>r.config),[a,s]=t.useState(l);return t.useEffect(()=>{const r=window.setTimeout(()=>s(l),d);return()=>window.clearTimeout(r)},[l,d]),a}const h=t.memo(function(){const l=p(150),a=x(n=>n.logoPreviewDataUrl),{global:s}=l,{layout:r,colorScheme:o,buttons:c}=s,m=t.useMemo(()=>r.borderStyle==="sharp"?"rounded-none":r.borderStyle==="pill"?"rounded-[32px]":"rounded-2xl",[r.borderStyle]),i=t.useMemo(()=>r.fontStyle==="serif"?"Georgia, serif":r.fontStyle==="system"?"system-ui, sans-serif":"Inter, sans-serif",[r.fontStyle]),u=a??s.logo.url,f=t.useMemo(()=>({backgroundColor:o.background,color:o.text,borderColor:o.secondary,fontFamily:i}),[o,i]);return e.jsxs("div",{className:`overflow-hidden border shadow-md ${m}`,style:f,children:[r.showHeader&&e.jsxs("div",{className:"flex items-center gap-3 border-b px-5 py-4",style:{borderColor:o.secondary},children:[u&&e.jsx("img",{src:u,alt:"Logo",className:"max-h-6 w-auto object-contain",loading:"lazy"}),e.jsx("span",{className:"text-xs font-semibold tracking-wider",children:s.companyName})]}),e.jsxs("div",{className:"space-y-6 p-6",children:[r.showProgressBar&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex justify-between text-[10px] font-semibold text-slate-400",children:[e.jsx("span",{children:"Progress"}),e.jsx("span",{children:"35%"})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-slate-100",children:e.jsx("div",{className:"h-full w-[35%] rounded-full",style:{backgroundColor:o.accent}})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h4",{className:"flex items-start gap-1.5 text-sm font-bold leading-snug",children:[r.showQuestionNumbers&&e.jsx("span",{className:"font-medium text-slate-400",children:"Q1."}),e.jsx("span",{children:s.surveyTitle}),r.showRequiredAsterisk&&e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("p",{className:"text-[11px] text-slate-400",children:"How would you rate your overall experience?"}),e.jsx("div",{className:"grid grid-cols-5 gap-2",children:[1,2,3,4,5].map(n=>e.jsx("div",{className:`flex h-9 items-center justify-center border text-xs font-semibold ${r.borderStyle==="pill"?"rounded-full":r.borderStyle==="sharp"?"rounded-none":"rounded-lg"}`,style:n===1?{backgroundColor:o.secondary,borderColor:o.primary,color:o.primary}:{backgroundColor:o.background,borderColor:o.secondary,color:o.text},children:n},n))})]})]}),e.jsxs("div",{className:"flex items-center justify-between border-t bg-slate-50/50 px-6 py-4",children:[r.showBackButton&&e.jsx("span",{className:`border px-3 py-1.5 text-[10px] font-semibold ${r.borderStyle==="pill"?"rounded-full":r.borderStyle==="sharp"?"rounded-none":"rounded-lg"}`,style:{borderColor:o.secondary,color:o.text},children:c.back}),e.jsx("div",{className:"flex-1"}),r.showNextButton&&e.jsx("span",{className:`px-4 py-1.5 text-[10px] font-bold ${r.borderStyle==="pill"?"rounded-full":r.borderStyle==="sharp"?"rounded-none":"rounded-lg"}`,style:{backgroundColor:o.primary,color:o.buttonText},children:c.next})]})]})});export{h as PreviewMock};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as m,j as e,T as P,S as v,R as d,C as i,N as t,a as f,M as L}from"./index-CY7WMJ93.js";import"./vendor-BwkXDkd3.js";function b({values:o,onPatch:s}){return e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(i,{label:"Label text color",value:o.columnLabelColor,onChange:a=>s({columnLabelColor:a})}),e.jsx(i,{label:"Label background",value:o.columnLabelBgColor,onChange:a=>s({columnLabelBgColor:a})})]})}function j({values:o,onPatch:s}){return e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsxs("label",{className:"space-y-1 sm:col-span-2",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-slate-500",children:"Min hint label"}),e.jsx("input",{className:"w-full rounded-lg border border-white/10 bg-slate-950/50 px-3 py-2 text-sm text-white",value:o.hintMinText,onChange:a=>s({hintMinText:a.target.value})})]}),e.jsxs("label",{className:"space-y-1 sm:col-span-2",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-slate-500",children:"Max hint label"}),e.jsx("input",{className:"w-full rounded-lg border border-white/10 bg-slate-950/50 px-3 py-2 text-sm text-white",value:o.hintMaxText,onChange:a=>s({hintMaxText:a.target.value})})]}),e.jsx(i,{label:"Hint text color",value:o.hintLabelColor,onChange:a=>s({hintLabelColor:a})}),e.jsx(i,{label:"Hint label background",value:o.hintLabelBgColor,onChange:a=>s({hintLabelBgColor:a})})]})}function C({values:o,onPatch:s,count:a=11}){return e.jsxs("div",{className:"space-y-3",children:[e.jsx(v,{label:"Number label style",value:o.numberLabelMode,onChange:c=>s({numberLabelMode:c}),options:[{value:"traffic",label:"Traffic light (default)"},{value:"monochrome",label:"Monochrome (one color)"},{value:"individual",label:"Individual per number"}]}),o.numberLabelMode==="monochrome"&&e.jsx(i,{label:"Monochrome color",value:o.monochromeNumberColor,onChange:c=>s({monochromeNumberColor:c})}),o.numberLabelMode==="individual"&&e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:Array.from({length:a},(c,x)=>e.jsx(i,{label:`#${x}`,value:o.individualNumberColors[x]??"#9CA3AF",onChange:N=>{const u=[...o.individualNumberColors];u[x]=N,s({individualNumberColors:u})}},x))})]})}function r({title:o,children:s}){return e.jsxs("div",{className:"space-y-3 rounded-xl border border-white/5 bg-slate-950/20 p-4",children:[e.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-slate-400",children:o}),s]})}function B({type:o,activeFormat:s}){const a=m(l=>l.config.questionTypes[o]),c=m(l=>l.updateQuestionType),x=m(l=>l.previewMultiStatement),N=m(l=>l.setPreviewMultiStatement),u=m(l=>l.heatmapPreviewPin);if(!a)return e.jsx("p",{className:"text-sm text-slate-500",children:"No configuration available for this type."});const n=l=>c(o,l),T=L.includes(o),M=s.includes("star"),h=s.includes("emoji"),g=s.includes("numbered"),S=s.includes("drag"),w=s.includes("dropdown"),k=s.includes("radio"),p=h||M||g||k;return e.jsxs("div",{className:"space-y-4",children:[T&&e.jsx(P,{label:"Preview multiple statements",checked:x,onChange:N}),o==="MCQ"&&"optionGap"in a&&e.jsx(r,{title:"Option style",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(v,{label:"Option style",value:a.optionStyle??a.cardStyle??"outlined",onChange:l=>n({optionStyle:l}),options:[{value:"outlined",label:"Outlined"},{value:"filled",label:"Filled"},{value:"minimal",label:"Minimal"}]}),e.jsx(d,{label:"Option gap",value:a.optionGap,onChange:l=>n({optionGap:l}),min:0,max:32}),e.jsx(d,{label:"Border radius",value:a.borderRadius,onChange:l=>n({borderRadius:l}),min:0,max:24}),e.jsx(d,{label:"Option padding",value:a.optionPadding??12,onChange:l=>n({optionPadding:l}),min:4,max:24}),e.jsx(i,{label:"Hover border",value:a.hoverBorderColor,onChange:l=>n({hoverBorderColor:l})})]})}),o==="TEXTFIELD"&&"defaultPlaceholder"in a&&e.jsx(r,{title:"Text input",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("label",{className:"space-y-1 sm:col-span-2",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-slate-500",children:"Default placeholder"}),e.jsx("input",{className:"w-full rounded-lg border border-white/10 bg-slate-950/50 px-3 py-2 text-sm text-white",value:a.defaultPlaceholder,onChange:l=>n({defaultPlaceholder:l.target.value})})]}),e.jsx(t,{label:"Input radius (px)",value:a.inputRadius,onChange:l=>n({inputRadius:l}),min:0,max:24}),e.jsx(i,{label:"Border color",value:a.borderColor,onChange:l=>n({borderColor:l})}),e.jsx(i,{label:"Placeholder color",value:a.placeholderColor,onChange:l=>n({placeholderColor:l})}),e.jsx(t,{label:"Input height (px)",value:a.inputHeight,onChange:l=>n({inputHeight:l}),min:32,max:64}),e.jsx(t,{label:"Input padding (px)",value:a.inputPadding,onChange:l=>n({inputPadding:l}),min:8,max:24})]})}),o==="NPS_SCALE"&&"buttonStyle"in a&&e.jsxs(e.Fragment,{children:[e.jsxs(r,{title:"NPS buttons",children:[e.jsx(v,{label:"Button style",value:a.buttonStyle,onChange:l=>n({buttonStyle:l}),options:[{value:"standard",label:"Radio"},{value:"numbered",label:"Numbered badges"},{value:"pill",label:"Pill"}]}),e.jsx("p",{className:"text-xs text-slate-500",children:"Selected cell and focus ring come from Theme → Question card."})]}),e.jsx(r,{title:"Hint labels",children:e.jsx(j,{values:a,onPatch:n})}),e.jsx(r,{title:"Number labels",children:e.jsx(C,{values:a,onPatch:n})}),e.jsx(r,{title:"Track & cells",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(t,{label:"Cell size (px)",value:a.cellSize,onChange:l=>n({cellSize:l}),min:24,max:56}),e.jsx(t,{label:"Cell gap (px)",value:a.cellGap,onChange:l=>n({cellGap:l}),min:0,max:16}),e.jsx(i,{label:"Track bar",value:a.trackBarColor,onChange:l=>n({trackBarColor:l})}),e.jsx(i,{label:"Track highlight",value:a.trackHighlightColor,onChange:l=>n({trackHighlightColor:l})})]})})]}),o==="CFM_MATRIX"&&"rowLabelWidth"in a&&e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Matrix layout",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(t,{label:"Row label width (px)",value:a.rowLabelWidth,onChange:l=>n({rowLabelWidth:l}),min:120,max:280}),e.jsx(t,{label:"Bipolar column width (%)",value:a.bipolarColumnWidthPercent,onChange:l=>n({bipolarColumnWidthPercent:l}),min:15,max:40}),e.jsx(t,{label:"Cell padding (px)",value:a.cellPadding,onChange:l=>n({cellPadding:l}),min:4,max:24})]})}),e.jsx(r,{title:"Label items",children:e.jsx(b,{values:a,onPatch:n})})]}),o==="CSAT_MATRIX"&&"emojiSize"in a&&e.jsxs(e.Fragment,{children:[(h||p)&&e.jsxs(r,{title:`${f.CSAT_MATRIX} — ${s.replace("CSAT_","")}`,children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h&&e.jsx(t,{label:"Emoji size (px)",value:a.emojiSize,onChange:l=>n({emojiSize:l}),min:16,max:40}),p&&e.jsx(d,{label:"Unselected opacity",value:Math.round(a.unselectedOpacity*100),onChange:l=>n({unselectedOpacity:l/100}),min:10,max:100})]}),e.jsx("p",{className:"text-xs text-slate-500",children:"Selected cell color and focus ring come from Theme → Question card."})]}),e.jsx(r,{title:"Label items",children:e.jsx(b,{values:a,onPatch:n})}),g&&e.jsx(r,{title:"Number labels",children:e.jsx(C,{values:a,onPatch:n,count:10})}),(g||s.includes("graphics"))&&e.jsx(r,{title:"Hint labels",children:e.jsx(j,{values:a,onPatch:n})})]}),o==="RATING_MATRIX"&&"unselectedStarOpacity"in a&&e.jsxs(e.Fragment,{children:[(h||p)&&e.jsxs(r,{title:`Rating — ${s.replace("RATING_","")}`,children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h&&e.jsx(t,{label:"Emoji size (px)",value:a.emojiSize,onChange:l=>n({emojiSize:l}),min:16,max:40}),p&&e.jsx(d,{label:"Unselected opacity",value:Math.round(a.unselectedStarOpacity*100),onChange:l=>n({unselectedStarOpacity:l/100}),min:10,max:100})]}),e.jsx("p",{className:"text-xs text-slate-500",children:"Selected cell color and focus ring come from Theme → Question card."})]}),e.jsx(r,{title:"Label items",children:e.jsx(b,{values:a,onPatch:n})}),g&&e.jsx(r,{title:"Number labels",children:e.jsx(C,{values:a,onPatch:n,count:10})}),(g||s.includes("graphics")||s.includes("slider"))&&e.jsx(r,{title:"Hint labels",children:e.jsx(j,{values:a,onPatch:n})})]}),o==="SLIDER_MATRIX"&&"trackColor"in a&&e.jsxs(e.Fragment,{children:[e.jsx(r,{title:"Slider track",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(i,{label:"Track",value:a.trackColor,onChange:l=>n({trackColor:l})}),e.jsx(i,{label:"Thumb",value:a.thumbColor,onChange:l=>n({thumbColor:l})}),e.jsx(i,{label:"Tick",value:a.tickColor,onChange:l=>n({tickColor:l})}),e.jsx(t,{label:"Row label width (px)",value:a.rowLabelWidth,onChange:l=>n({rowLabelWidth:l}),min:120,max:280}),e.jsx(i,{label:"Row band",value:a.rowBandColor,onChange:l=>n({rowBandColor:l})}),e.jsx(t,{label:"Tick badge size (px)",value:a.tickBadgeSize,onChange:l=>n({tickBadgeSize:l}),min:20,max:40})]})}),e.jsx(r,{title:"Anchor hint labels",children:e.jsx(j,{values:a,onPatch:n})}),e.jsx(r,{title:"Tick label items",children:e.jsx(b,{values:a,onPatch:n})}),e.jsx(r,{title:"Tick number labels",children:e.jsx(C,{values:a,onPatch:n,count:11})})]}),o==="FILE_UPLOAD"&&"dropzoneStyle"in a&&e.jsx(r,{title:"Dropzone",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(v,{label:"Dropzone border",value:a.dropzoneStyle,onChange:l=>n({dropzoneStyle:l}),options:[{value:"dashed",label:"Dashed"},{value:"solid",label:"Solid"}]}),e.jsx(i,{label:"Border color",value:a.borderColor??a.accentColor,onChange:l=>n({borderColor:l})}),e.jsx(i,{label:"Fill color",value:a.dropzoneFillColor,onChange:l=>n({dropzoneFillColor:l})}),e.jsx(t,{label:"Padding (px)",value:a.dropzonePadding,onChange:l=>n({dropzonePadding:l}),min:12,max:48})]})}),o==="TEXT_AND_MEDIA"&&"mediaMaxWidth"in a&&e.jsx(r,{title:"Text & media",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(d,{label:"Media max width (%)",value:a.mediaMaxWidth,onChange:l=>n({mediaMaxWidth:l}),min:50,max:100}),e.jsx(d,{label:"Media corner radius",value:a.mediaRadius,onChange:l=>n({mediaRadius:l}),min:0,max:24}),e.jsx(i,{label:"Caption color",value:a.captionColor,onChange:l=>n({captionColor:l})}),e.jsx(t,{label:"Caption size (px)",value:a.captionSize,onChange:l=>n({captionSize:l}),min:10,max:24})]})}),o==="HEATMAP"&&"pinColor"in a&&e.jsx(r,{title:"Heatmap pin",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(i,{label:"Pin color",value:a.pinColor,onChange:l=>n({pinColor:l})}),e.jsx(i,{label:"Pin border",value:a.pinBorderColor,onChange:l=>n({pinBorderColor:l})}),e.jsx(d,{label:"Pin size",value:a.pinSize,onChange:l=>n({pinSize:l}),min:8,max:32}),e.jsx(d,{label:"Overlay opacity",value:Math.round(a.overlayOpacity*100),onChange:l=>n({overlayOpacity:l/100}),min:0,max:80}),e.jsxs("p",{className:"text-xs text-slate-500 sm:col-span-2",children:["Click the heatmap image in the preview to place a pin and see styling update live. Pin preview position: ",Math.round(u.x*100),"%, ",Math.round(u.y*100),"%"]})]})}),o==="RANK_ORDER"&&"drag"in a&&e.jsx(r,{title:S?"Drag & drop":w?"Dropdown rank":"Rank order",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[S&&e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"Item background",value:a.drag.itemBg,onChange:l=>n({drag:{...a.drag,itemBg:l}})}),e.jsx(i,{label:"Drag handle",value:a.drag.dragHandleColor,onChange:l=>n({drag:{...a.drag,dragHandleColor:l}})}),e.jsx(i,{label:"Rank badge",value:a.drag.rankBadgeColor,onChange:l=>n({drag:{...a.drag,rankBadgeColor:l}})})]}),w&&e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"Item background",value:a.dropdown.itemBg,onChange:l=>n({dropdown:{...a.dropdown,itemBg:l}})}),e.jsx(i,{label:"Select border",value:a.dropdown.selectBorderColor,onChange:l=>n({dropdown:{...a.dropdown,selectBorderColor:l}})}),e.jsx(i,{label:"Rank badge",value:a.dropdown.rankBadgeColor,onChange:l=>n({dropdown:{...a.dropdown,rankBadgeColor:l}})})]})]})})]})}export{B as TypePanel};
|