@explorer02/cfm-survey-sdk 0.3.1 → 0.3.3

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 (33) hide show
  1. package/dist/cli/index.js +94 -83
  2. package/dist/cli/index.mjs +94 -83
  3. package/package.json +1 -1
  4. package/templates/docs/templates/CsatMatrixScale.tsx +22 -27
  5. package/templates/docs/templates/CustomSliderTrack.tsx +5 -3
  6. package/templates/docs/templates/FileUploadScale.tsx +143 -18
  7. package/templates/docs/templates/HeatmapScale.tsx +11 -2
  8. package/templates/docs/templates/LanguageSelector.tsx +42 -19
  9. package/templates/docs/templates/LikertMatrixScale.tsx +45 -34
  10. package/templates/docs/templates/MatrixDropdown.tsx +12 -11
  11. package/templates/docs/templates/Question.tsx +116 -45
  12. package/templates/docs/templates/RankOrderScale.tsx +29 -5
  13. package/templates/docs/templates/RatingScale.tsx +7 -4
  14. package/templates/docs/templates/SliderMatrixScale.tsx +49 -17
  15. package/templates/docs/templates/selectionStyles.ts +103 -1
  16. package/templates/docs/templates/surveyUiIcons.tsx +2 -2
  17. package/templates/docs/templates/surveyUiScaleUtils.ts +38 -5
  18. package/templates/docs/templates/uiConfig.ts +56 -0
  19. package/templates/preview-harness/previewPages.js +4 -7
  20. package/templates/preview-harness/previewPages.ts +7 -34
  21. package/templates/preview-harness/vite-app/src/PreviewConfigContext.tsx +48 -1
  22. package/templates/preview-harness/vite-app/src/QuestionPreview.tsx +61 -31
  23. package/templates/preview-harness/vite-app/src/SurveyPagePreview.tsx +37 -8
  24. package/templates/preview-harness/vite-app/src/fixtures/questions.ts +182 -82
  25. package/templates/survey-theme.css +13 -4
  26. package/templates/wizard-dist/assets/{PreviewMock-Bax7oRAL.js → PreviewMock-_9SsNLwC.js} +1 -1
  27. package/templates/wizard-dist/assets/TypePanel-DyEcZlWP.js +1 -0
  28. package/templates/wizard-dist/assets/index-CVBd54V0.css +1 -0
  29. package/templates/wizard-dist/assets/index-pKQOivEa.js +34 -0
  30. package/templates/wizard-dist/index.html +2 -2
  31. package/templates/wizard-dist/assets/TypePanel-D2t4FPSd.js +0 -1
  32. package/templates/wizard-dist/assets/index-BhWM50Yu.css +0 -1
  33. package/templates/wizard-dist/assets/index-c5lka74l.js +0 -34
@@ -4,11 +4,24 @@ import SurveyStickyChrome from '@/components/SurveyStickyChrome';
4
4
  import LanguageSelector from '@/components/LanguageSelector';
5
5
  import Question from '@/components/Question';
6
6
  import Footer from '@/components/Footer';
7
- import { FIXTURE_SURVEY_PAGE_NPS, PREVIEW_LANGUAGES } from './fixtures/questions';
7
+ import { PreviewConfigProvider, usePreviewConfig } from './PreviewConfigContext';
8
+ import {
9
+ FIXTURE_SURVEY_PAGE_MCQ,
10
+ FIXTURE_SURVEY_PAGE_NPS,
11
+ PREVIEW_LANGUAGES,
12
+ } from './fixtures/questions';
8
13
 
9
- export function SurveyPagePreview() {
14
+ function SurveyPagePreviewInner() {
15
+ const { configRevision } = usePreviewConfig();
10
16
  const [lang, setLang] = useState('en');
11
- const [answer, setAnswer] = useState<AnswerValue | undefined>();
17
+ const [mcqAnswer, setMcqAnswer] = useState<AnswerValue>('a');
18
+ const [npsAnswer, setNpsAnswer] = useState<AnswerValue>(8);
19
+
20
+ const allQuestions = [FIXTURE_SURVEY_PAGE_MCQ, FIXTURE_SURVEY_PAGE_NPS];
21
+ const allAnswers = {
22
+ [FIXTURE_SURVEY_PAGE_MCQ.id]: mcqAnswer,
23
+ [FIXTURE_SURVEY_PAGE_NPS.id]: npsAnswer,
24
+ };
12
25
 
13
26
  return (
14
27
  <div
@@ -30,13 +43,20 @@ export function SurveyPagePreview() {
30
43
  onChange={setLang}
31
44
  />
32
45
 
33
- <div className="space-y-12">
46
+ <div className="space-y-8" key={configRevision}>
47
+ <Question
48
+ question={FIXTURE_SURVEY_PAGE_MCQ}
49
+ selectedValue={mcqAnswer}
50
+ allAnswers={allAnswers}
51
+ allQuestions={allQuestions}
52
+ onSelect={setMcqAnswer}
53
+ />
34
54
  <Question
35
55
  question={FIXTURE_SURVEY_PAGE_NPS}
36
- selectedValue={answer}
37
- allAnswers={answer ? { [FIXTURE_SURVEY_PAGE_NPS.id]: answer } : {}}
38
- allQuestions={[FIXTURE_SURVEY_PAGE_NPS]}
39
- onSelect={setAnswer}
56
+ selectedValue={npsAnswer}
57
+ allAnswers={allAnswers}
58
+ allQuestions={allQuestions}
59
+ onSelect={setNpsAnswer}
40
60
  />
41
61
  </div>
42
62
 
@@ -73,3 +93,12 @@ export function SurveyPagePreview() {
73
93
  </div>
74
94
  );
75
95
  }
96
+
97
+ /** Full survey page mockup for wizard Theme / Layout steps — header, progress, language, cards, footer. */
98
+ export function SurveyPagePreview() {
99
+ return (
100
+ <PreviewConfigProvider>
101
+ <SurveyPagePreviewInner />
102
+ </PreviewConfigProvider>
103
+ );
104
+ }
@@ -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: 'How satisfied are you with our service?',
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 MATRIX_ROW_SINGLE = [
15
- { id: 'r1', statementText: 'The product is easy to use' },
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: 'The product is easy to use' },
20
- { id: 'r2', statementText: 'Support was helpful' },
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: 'Very satisfied', value: 'a' },
41
- { id: 'b', optionLabel: 'Satisfied', value: 'b' },
42
- { id: 'c', optionLabel: 'Neutral', value: 'c' },
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: 'Fast delivery', value: 'a' },
54
- { id: 'b', optionLabel: 'Great support', value: 'b' },
55
- { id: 'c', optionLabel: 'Easy to use', value: 'c' },
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 at all likely',
63
- maxLabel: 'Extremely likely',
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
- textFieldType: 'short',
95
- placeholder: 'Your answer',
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
- textFieldType: 'long',
101
- placeholder: 'Tell us more…',
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
- statementRows: MATRIX_ROW_SINGLE,
107
- scaleColumns: [
108
- { id: 'c1', label: 'Strongly disagree' },
109
- { id: 'c2', label: 'Disagree' },
110
- { id: 'c3', label: 'Neutral' },
111
- { id: 'c4', label: 'Agree' },
112
- { id: 'c5', label: 'Strongly agree' },
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
- statementRows: [{ id: 'r1', statementText: 'How do you feel?' }],
135
- scaleColumns: [
136
- { id: 'c1', label: '😞' },
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
- statementRows: [{ id: 'r1', statementText: 'Rate our app' }],
149
- scaleColumns: Array.from({ length: 5 }, (_, i) => ({ id: `c${i}`, label: String(i + 1) })),
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
- statementRows: [{ id: 'r1', statementText: 'Rate support' }],
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
- statementRows: [{ id: 'r1', statementText: 'Experience quality' }],
163
- scaleColumns: [
164
- { id: 'c1', label: 'Low' },
165
- { id: 'c2', label: 'Mid' },
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
- statementRows: [{ id: 'r1', statementText: 'Select your rating' }],
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
- statementRows: [{ id: 'r1', statementText: 'Overall rating' }],
194
- scaleColumns: Array.from({ length: 5 }, (_, i) => ({ id: `c${i}`, label: String(i + 1) })),
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
- statementRows: [{ id: 'r1', statementText: 'Value for money' }],
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
- statementRows: [{ id: 'r1', statementText: 'Recommend to a friend' }],
208
- scaleColumns: Array.from({ length: 5 }, (_, i) => ({ id: `c${i}`, label: String(i + 1) })),
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
- statementRows: [{ id: 'r1', statementText: 'How do you feel?' }],
215
- scaleColumns: Array.from({ length: 5 }, (_, i) => ({ id: `c${i}`, label: String(i + 1) })),
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
- statementRows: [{ id: 'r1', statementText: 'Experience quality' }],
222
- scaleColumns: [
223
- { id: 'c1', label: 'Low' },
224
- { id: 'c2', label: 'Mid' },
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
- statementRows: [{ id: 'r1', statementText: 'Rate on slider' }],
233
- scaleColumns: Array.from({ length: 5 }, (_, i) => ({ id: `c${i}`, label: String(i + 1) })),
234
- scaleAnchorLabels: ['Low', 'High'],
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: 'Ease of use', min: 0, max: 10, step: 1 },
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: ['Not at all', 'Extremely'],
327
+ scaleAnchorLabels: ['Label 1', 'Label 2'],
243
328
  ticks: {
244
329
  count: 11,
245
- marks: Array.from({ length: 11 }, (_, i) => ({
246
- tickPosition: i,
247
- tickLabel: String(i),
248
- })),
330
+ marks: SLIDER_TICKS,
249
331
  },
250
332
  enableInputBox: false,
251
- displayValues: false,
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: 'textOnly',
368
+ optionDisplay: 'textAndImage',
271
369
  options: [
272
- { id: 'o1', optionLabel: 'Speed' },
273
- { id: 'o2', optionLabel: 'Price' },
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: 'textOnly',
378
+ optionDisplay: 'textAndImage',
282
379
  options: [
283
- { id: 'o1', optionLabel: 'Feature A' },
284
- { id: 'o2', optionLabel: 'Feature B' },
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: 12px;
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: var(--cfm-rank-item-bg);
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: #f9fafb;
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-c5lka74l.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};
1
+ import{u as x,j as e}from"./index-pKQOivEa.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 L,S as j,R as d,C as i,N as s,a as P,M as R}from"./index-pKQOivEa.js";import"./vendor-BwkXDkd3.js";function S({values:o,onPatch:r}){return e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(i,{label:"Label text color",value:o.columnLabelColor,onChange:a=>r({columnLabelColor:a})}),e.jsx(i,{label:"Label background",value:o.columnLabelBgColor,onChange:a=>r({columnLabelBgColor:a})})]})}function z({values:o,onPatch:r}){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=>r({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=>r({hintMaxText:a.target.value})})]}),e.jsx(i,{label:"Hint text color",value:o.hintLabelColor,onChange:a=>r({hintLabelColor:a})}),e.jsx(i,{label:"Hint label background",value:o.hintLabelBgColor,onChange:a=>r({hintLabelBgColor:a})})]})}function b({values:o,onPatch:r,count:a=11}){return e.jsxs("div",{className:"space-y-3",children:[e.jsx(j,{label:"Number label style",value:o.numberLabelMode,onChange:c=>r({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=>r({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:C=>{const u=[...o.individualNumberColors];u[x]=C,r({individualNumberColors:u})}},x))})]})}function t({title:o,children:r}){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}),r]})}function I({type:o,activeFormat:r}){const a=m(l=>l.config.questionTypes[o]),c=m(l=>l.updateQuestionType),x=m(l=>l.previewMultiStatementByType),C=m(l=>l.setPreviewMultiStatementForType),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=R.includes(o),M=!!x[o],h=r.includes("star"),g=r.includes("emoji"),v=r.includes("numbered"),w=r.includes("drag"),N=r.includes("dropdown"),f=r.includes("radio"),y=r==="CFM_bipolar",p=g||h||v||f,B=a.optionStyle??a.cardStyle??"outlined",k=a.buttonStyle??"numbered";return e.jsxs("div",{className:"space-y-4",children:[T&&e.jsx(L,{label:"Preview multiple statements",checked:M,onChange:l=>C(o,l)}),o==="MCQ"&&"optionGap"in a&&e.jsx(t,{title:"Option style",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(j,{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})}),B==="filled"&&e.jsx(i,{label:"Unselected fill color",value:a.filledOptionBg??"#F9FAFB",onChange:l=>n({filledOptionBg:l})})]})}),o==="TEXTFIELD"&&"defaultPlaceholder"in a&&e.jsx(t,{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(s,{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(s,{label:"Input height (px)",value:a.inputHeight,onChange:l=>n({inputHeight:l}),min:32,max:64}),e.jsx(s,{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(t,{title:"NPS buttons",children:[e.jsx(j,{label:"Button style",value:a.buttonStyle,onChange:l=>n({buttonStyle:l}),options:[{value:"standard",label:"Radio"},{value:"numbered",label:"Numbered badges"}]}),e.jsx("p",{className:"text-xs text-slate-500",children:"Selected cell and focus ring come from Theme → Question card."})]}),e.jsx(t,{title:"Hint labels",children:e.jsx(z,{values:a,onPatch:n})}),k==="numbered"&&e.jsx(t,{title:"Number labels",children:e.jsx(b,{values:a,onPatch:n})}),e.jsx(t,{title:"Track & cells",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(s,{label:"Cell size (px)",value:a.cellSize,onChange:l=>n({cellSize:l}),min:24,max:56}),e.jsx(s,{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(t,{title:"Matrix layout",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(s,{label:"Row label width (px)",value:a.rowLabelWidth,onChange:l=>n({rowLabelWidth:l}),min:120,max:280}),y&&e.jsx(s,{label:"Bipolar column width (%)",value:a.bipolarColumnWidthPercent,onChange:l=>n({bipolarColumnWidthPercent:l}),min:15,max:40}),e.jsx(s,{label:"Cell padding (px)",value:a.cellPadding,onChange:l=>n({cellPadding:l}),min:4,max:24})]})}),e.jsx(t,{title:"Label items",children:e.jsx(S,{values:a,onPatch:n})})]}),o==="CSAT_MATRIX"&&"emojiSize"in a&&e.jsxs(e.Fragment,{children:[(g||p||h)&&e.jsxs(t,{title:`${P.CSAT_MATRIX} — ${r.replace("CSAT_","")}`,children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[g&&e.jsx(s,{label:"Emoji size (px)",value:a.emojiSize,onChange:l=>n({emojiSize:l}),min:16,max:40}),h&&e.jsx(i,{label:"Star color",value:a.accentColor,onChange:l=>n({accentColor:l})}),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. Column labels appear above stars in the star format preview."})]}),e.jsx(t,{title:"Label items",children:e.jsx(S,{values:a,onPatch:n})}),v&&e.jsx(t,{title:"Number labels",children:e.jsx(b,{values:a,onPatch:n,count:10})})]}),o==="RATING_MATRIX"&&"unselectedStarOpacity"in a&&e.jsxs(e.Fragment,{children:[(g||p||h)&&e.jsxs(t,{title:`Rating — ${r.replace("RATING_","")}`,children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[g&&e.jsx(s,{label:"Emoji size (px)",value:a.emojiSize,onChange:l=>n({emojiSize:l}),min:16,max:40}),h&&e.jsx(i,{label:"Star color",value:a.starColor,onChange:l=>n({starColor:l})}),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(t,{title:"Label items",children:e.jsx(S,{values:a,onPatch:n})}),v&&e.jsx(t,{title:"Number labels",children:e.jsx(b,{values:a,onPatch:n,count:10})})]}),o==="SLIDER_MATRIX"&&"trackColor"in a&&e.jsxs(e.Fragment,{children:[e.jsx(t,{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(s,{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(s,{label:"Tick badge size (px)",value:a.tickBadgeSize,onChange:l=>n({tickBadgeSize:l}),min:20,max:40})]})}),e.jsxs(t,{title:"Anchor hint labels",children:[e.jsxs("p",{className:"text-xs text-slate-500",children:["Anchor text comes from the slider preview fixture: “",a.hintMinText,"” / “",a.hintMaxText,"”."]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(i,{label:"Hint text color",value:a.hintLabelColor,onChange:l=>n({hintLabelColor:l})}),e.jsx(i,{label:"Hint label background",value:a.hintLabelBgColor,onChange:l=>n({hintLabelBgColor:l})})]})]}),e.jsx(t,{title:"Tick number labels",children:e.jsx(b,{values:a,onPatch:n,count:11})})]}),o==="FILE_UPLOAD"&&"dropzoneStyle"in a&&e.jsx(t,{title:"Dropzone",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(j,{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(s,{label:"Padding (px)",value:a.dropzonePadding,onChange:l=>n({dropzonePadding:l}),min:12,max:48})]})}),o==="TEXT_AND_MEDIA"&&"mediaMaxWidth"in a&&e.jsx(t,{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(s,{label:"Caption size (px)",value:a.captionSize,onChange:l=>n({captionSize:l}),min:10,max:24})]})}),o==="HEATMAP"&&"pinColor"in a&&e.jsx(t,{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(t,{title:w?"Drag & drop":N?"Dropdown rank":"Rank order",children:e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[w&&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}})})]}),N&&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:"List hover background",value:a.dropdown.itemHoverBg??"#F3F4F6",onChange:l=>n({dropdown:{...a.dropdown,itemHoverBg: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{I as TypePanel};