@explorer02/cfm-survey-sdk 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +45 -45
- package/dist/cli/index.mjs +45 -45
- package/package.json +1 -1
- package/templates/docs/00-integration/agent-execution-flow.md +18 -6
- package/templates/docs/00-integration/agent-operating-contract.md +2 -0
- package/templates/docs/00-integration/apply-ui-config.md +15 -2
- package/templates/docs/00-integration/component-checklist.md +5 -3
- package/templates/docs/00-integration/ui-customization-wizard.md +1 -1
- package/templates/docs/00-integration/wizard-chrome-contract.md +284 -0
- package/templates/docs/00-integration/wizard-config-handoff.md +7 -1
- package/templates/docs/00-integration/wizard-customization-catalog.md +391 -0
- package/templates/docs/00-integration/wizard-post-customize-build.md +405 -0
- package/templates/docs/00-integration/wizard-preview-build-guide.md +20 -4
- package/templates/docs/00-integration/wizard-question-type-styling.md +27 -6
- package/templates/docs/01-components/19-survey-sticky-chrome.md +16 -55
- package/templates/docs/03-ui-specs/README.md +1 -1
- package/templates/docs/MANIFEST.json +10 -1
- package/templates/docs/index.md +10 -7
- package/templates/docs/templates/Footer.tsx +72 -0
- package/templates/docs/templates/Header.tsx +110 -0
- package/templates/docs/templates/LanguageSelector.tsx +40 -0
- package/templates/docs/templates/PreviewBridgeInit.tsx +13 -0
- package/templates/docs/templates/ProgressBar.tsx +33 -0
- package/templates/docs/templates/Question.tsx +51 -7
- package/templates/docs/templates/RatingScale.tsx +66 -59
- package/templates/docs/templates/SurveyStickyChrome.tsx +19 -5
- package/templates/docs/templates/uiConfig.ts +33 -0
- package/templates/docs/templates/verify-agent-build.sh +31 -1
- package/templates/preview-harness/preview-bridge.inline.js +18 -4
- package/templates/preview-harness/vite-app/src/preview-live-overrides.css +7 -0
- package/templates/previewBridge.ts +144 -39
- package/templates/survey-theme.css +7 -0
- package/templates/wizard-dist/assets/{PreviewMock-AoZdAEPZ.js → PreviewMock-tTMvwuEy.js} +1 -1
- package/templates/wizard-dist/assets/{TypePanel-39FnbtvG.js → TypePanel-B9Ls7BSq.js} +1 -1
- package/templates/wizard-dist/assets/index-CjkIlOUI.css +1 -0
- package/templates/wizard-dist/assets/index-CoCrnnxt.js +34 -0
- package/templates/wizard-dist/index.html +2 -2
- package/templates/wizard-dist/assets/index-BhWM50Yu.css +0 -1
- package/templates/wizard-dist/assets/index-CWKdsJOp.js +0 -34
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
# Wizard Customization Catalog — All Steps, Types & Formats
|
|
2
|
+
|
|
3
|
+
> **Phase 5 (BUILD) — read with [`wizard-preview-build-guide.md`](wizard-preview-build-guide.md).** This is the authoritative map of every wizard control → config path → CSS variable → component.
|
|
4
|
+
> **After client saves:** [`wizard-post-customize-build.md`](wizard-post-customize-build.md) for apply + build gate.
|
|
5
|
+
> **Source of truth in code:** `survey-wizard/src/lib/cssVars.ts` (`configToCssVars`) + `TypePanel.tsx`.
|
|
6
|
+
|
|
7
|
+
Agents wire components to this catalog **before** opening the wizard so live preview updates smoothly for every picker, toggle, and format tab.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## How live preview applies changes
|
|
12
|
+
|
|
13
|
+
| Layer | Mechanism | Agent responsibility |
|
|
14
|
+
|-------|-----------|---------------------|
|
|
15
|
+
| **CSS variables** | Wizard sends `CFM_UI_CONFIG_SNAPSHOT` / `DELTA` with `--cfm-*` on `:root` | Components use `var(--cfm-*)` — no hardcoded brand hex for wizard tokens |
|
|
16
|
+
| **Content patches** | Bridge sets text on `data-cfm-*` elements | Header, Footer, Intro, End, button labels |
|
|
17
|
+
| **Layout flags** | Bridge shows/hides chrome | `SurveyPage` conditionals match `global.layout.*` |
|
|
18
|
+
| **DOM attributes** | `data-cfm-mcq-style`, `data-cfm-nps-button-style`, `data-cfm-dropzone-style` | Read from `:root` or survey wrapper in CSS |
|
|
19
|
+
| **Preview state** | Multi-statement rows, placeholder text, heatmap pin, rank variant | Matrix scales map all `statementRows`; rank branches on `interactionMode` |
|
|
20
|
+
|
|
21
|
+
**Smooth preview rule:** If a wizard control does not update the iframe, find the missing row in this catalog and add the hook — do not change `Question.tsx` dispatch.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Wizard steps — global controls
|
|
26
|
+
|
|
27
|
+
### 1. Branding & Header (`branding` → preview `header`)
|
|
28
|
+
|
|
29
|
+
| Wizard control | Config path | CSS variable / DOM | Wire in |
|
|
30
|
+
|----------------|-------------|-------------------|---------|
|
|
31
|
+
| Survey title | `global.surveyTitle` | `data-cfm-survey-title` | Intro / SurveyPage |
|
|
32
|
+
| Company name | `global.companyName` | `data-cfm-company` | `Header.tsx` brand row after logo |
|
|
33
|
+
| Browser tab title | `global.browserTabTitle` | `document.title` | `layout.tsx` metadata |
|
|
34
|
+
| Thank-you message | `global.thankYouMessage` | `data-cfm-thank-you` | End page |
|
|
35
|
+
| Logo upload | `global.logo.fileName`, `logo.url` (preview only) | `data-cfm-logo` src | `uiConfig.getLogoSrc()` → `./fileName` |
|
|
36
|
+
| Logo width / height / padding | `global.header.logoBoxWidth` etc. | `--cfm-header-logo-width`, `--cfm-header-logo-height`, `--cfm-header-logo-padding` | Header img styles |
|
|
37
|
+
| Header height, padding X | `global.header.height`, `contentPaddingX` | `--cfm-header-height`, `--cfm-header-padding-x` | `.cfm-header` |
|
|
38
|
+
| Logo placement templates | `global.header.logoPlacement`, `companyNamePlacement` | `--cfm-header-logo-col`, `--cfm-header-company-col`, margin vars | `headerLayoutVars` in theme CSS |
|
|
39
|
+
| Header background, border | `global.header.backgroundColor`, `borderBottomColor` | `--cfm-header-bg`, `--cfm-header-border` | Header |
|
|
40
|
+
| Header shadow | `global.header.shadowEnabled` | `--cfm-header-shadow` | Header |
|
|
41
|
+
| Show company name | `global.header.showCompanyName` | `--cfm-header-show-company` + bridge layout flag | Header visibility |
|
|
42
|
+
| Company font size/weight/color | `global.header.companyNameFontSize` etc. | `--cfm-header-company-size`, `--cfm-header-company-weight`, `--cfm-header-company-color` | `data-cfm-company` |
|
|
43
|
+
| Progress track height/color/fill | `global.theme.progressTrackHeight` etc. | `--cfm-progress-height`, `--cfm-progress-track`, `--cfm-progress-fill` | `data-cfm-progress` + `.cfm-progress` |
|
|
44
|
+
|
|
45
|
+
### 2. Footer (`footer` → preview `footer`)
|
|
46
|
+
|
|
47
|
+
| Wizard control | Config path | CSS variable / DOM |
|
|
48
|
+
|----------------|-------------|-------------------|
|
|
49
|
+
| Background, text, links | `global.footer.backgroundColor`, `textColor`, `linkColor`, `linkHoverColor` | `--cfm-footer-bg`, `--cfm-footer-text`, `--cfm-footer-link`, `--cfm-footer-link-hover` |
|
|
50
|
+
| Copyright | `global.footer.copyrightText` | `data-cfm-copyright` |
|
|
51
|
+
| Footer links | `global.footer.links[]` | `data-cfm-footer-links` |
|
|
52
|
+
| Padding X/Y | `global.footer.paddingY`, `paddingX` | `--cfm-footer-padding-y`, `--cfm-footer-padding-x` |
|
|
53
|
+
| Show footer logo | `global.footer.showLogo` | layout flag + footer logo slot |
|
|
54
|
+
| Footer logo size | `global.footer.logoWidth`, `logoHeight` | `--cfm-footer-logo-width`, `--cfm-footer-logo-height` |
|
|
55
|
+
|
|
56
|
+
### 3. Theme & Colors (`theme` → preview `survey_page`)
|
|
57
|
+
|
|
58
|
+
| Section | Config paths | CSS variables |
|
|
59
|
+
|---------|--------------|---------------|
|
|
60
|
+
| Brand colors | `colorScheme.primary`, `buttonText`; `theme.pageBackground`; `colorScheme.text` | `--cfm-primary`, `--cfm-button-text`, `--cfm-background`, `--cfm-text` |
|
|
61
|
+
| Header colors | `header.backgroundColor`, `borderBottomColor`, `companyNameColor` | `--cfm-header-*` |
|
|
62
|
+
| Progress colors | `theme.progressTrackColor`, `progressFillColor`, `progressTrackHeight` | `--cfm-progress-*` |
|
|
63
|
+
| Footer colors | `footer.backgroundColor`, `textColor`, `linkColor`, `linkHoverColor` | `--cfm-footer-*` |
|
|
64
|
+
| Language selector | `theme.languageSelectorBackground`, `languageSelectorTextColor` | `--cfm-language-bg`, `--cfm-language-text`, `--cfm-language-border` |
|
|
65
|
+
| **Question card** | `theme.cardBackground`, `cardBorderColor`, `cardPadding`, `cardShadowEnabled` | `--cfm-card-bg`, `--cfm-card-border-color`, `--cfm-card-padding`, `--cfm-card-shadow` |
|
|
66
|
+
| **Cell selected** | `theme.cellSelectedColor` | `--cfm-matrix-selected`, `--cfm-mcq-selected-accent`, `--cfm-csat-ring-color` |
|
|
67
|
+
| **Focus ring** | `theme.focusRingColor` | `--cfm-input-focus-ring` |
|
|
68
|
+
| Selected background | `theme.selectedBackground` | `--cfm-selected-bg`, `--cfm-mcq-selected-bg` |
|
|
69
|
+
| Zebra / row band | `theme.zebraRowColor`, `rowBandColor` | `--cfm-zebra-row`, `--cfm-row-band` |
|
|
70
|
+
|
|
71
|
+
**Question card tokens drive selection UI on every scale type** — radio annulus, numbered badge fill, star/emoji ring, slider thumb, carousel dots.
|
|
72
|
+
|
|
73
|
+
### 4. Layout & Chrome (`layout` → preview `survey_page`)
|
|
74
|
+
|
|
75
|
+
| Wizard control | Config path | Apply in |
|
|
76
|
+
|----------------|-------------|----------|
|
|
77
|
+
| Width (narrow/standard/wide) | `global.layout.width` | `--cfm-max-width` |
|
|
78
|
+
| Corners (sharp/rounded/pill) | `global.layout.borderStyle` | `--cfm-border-radius` |
|
|
79
|
+
| Font family | `global.layout.fontStyle` | `--cfm-font-family` |
|
|
80
|
+
| Show header / footer / progress | `global.layout.showHeader` etc. | `SurveyPage` conditionals + bridge `layoutFlags` |
|
|
81
|
+
| Show language switcher | `global.layout.showLanguageSwitcher` | `LanguageSelector` |
|
|
82
|
+
| Show next / back + labels | `global.layout.showNextButton`, `buttons.next` etc. | Nav buttons + `data-cfm-btn-next` |
|
|
83
|
+
| Question numbers | `global.layout.showQuestionNumbers` | `data-cfm-question-number` |
|
|
84
|
+
| Required asterisk | `global.layout.showRequiredAsterisk` | `data-cfm-required` |
|
|
85
|
+
| Animations | `global.motion.enabled`, `durationMs` | `--cfm-motion-duration` |
|
|
86
|
+
|
|
87
|
+
### 5. Testing & Tokens (`tokens` → preview `survey_page`)
|
|
88
|
+
|
|
89
|
+
| Wizard control | Config path | Wire in |
|
|
90
|
+
|----------------|-------------|---------|
|
|
91
|
+
| Placeholders | `placeholders.*` | `useSurveySDK({ options: { placeholders } })` |
|
|
92
|
+
| Custom fields | `customFields.*` | `customFieldValues.ts` + SurveyPage |
|
|
93
|
+
| Debug mode | `debug.enabled` | hook `debug: true` |
|
|
94
|
+
|
|
95
|
+
### 6. Deploy & Build (`deploy`)
|
|
96
|
+
|
|
97
|
+
Informational — `deploy.target`, `deploy.autoDeploy`. Phase 7 routing only; no live preview tokens.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Question Types step — format tabs & controls
|
|
102
|
+
|
|
103
|
+
The wizard lists types from `surveyTypes[]` in `survey-ui-config.json`. **Seed all types present in the fetched survey** (plus any type you want the client to style) so every relevant tab appears.
|
|
104
|
+
|
|
105
|
+
**Shared toggle (matrix types):** **Preview multiple statements** — harness injects 2nd `statementRow`; components must `map` all `statementRows`.
|
|
106
|
+
|
|
107
|
+
**Shared selection (all scale formats):** Theme → Question card → cell selected + focus ring. Use [`selectionStyles.ts`](../templates/selectionStyles.ts).
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### MCQ — `questionTypes.MCQ`
|
|
112
|
+
|
|
113
|
+
| Format tab | Preview key | Controls in panel | Component |
|
|
114
|
+
|------------|-------------|-------------------|-----------|
|
|
115
|
+
| Single | `MCQ_single` | Option style, gap, radius, padding | `Question.tsx` MCQ + radio |
|
|
116
|
+
| Multiple | `MCQ_multiple` | Same | Checkbox variant |
|
|
117
|
+
|
|
118
|
+
| Config field | CSS / DOM |
|
|
119
|
+
|--------------|-----------|
|
|
120
|
+
| `optionStyle` | `data-cfm-mcq-style` (`outlined` / `filled` / `minimal`) |
|
|
121
|
+
| `optionGap` | `--cfm-mcq-option-gap` |
|
|
122
|
+
| `borderRadius` | `--cfm-mcq-border-radius` |
|
|
123
|
+
| `optionPadding` | `--cfm-mcq-card-padding` |
|
|
124
|
+
| `hoverBorderColor` | `--cfm-mcq-hover-border` |
|
|
125
|
+
| Selection | `--cfm-input-focus-ring` (border + dot), `--cfm-matrix-selected` (annulus), `--cfm-mcq-selected-bg` |
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### TEXTFIELD — `questionTypes.TEXTFIELD`
|
|
130
|
+
|
|
131
|
+
| Format tab | Preview key | Controls | Component |
|
|
132
|
+
|------------|-------------|----------|-----------|
|
|
133
|
+
| Short | `TEXTFIELD_short` | Placeholder text, radius, border, placeholder color | `Question.tsx` + `data-cfm-textfield` |
|
|
134
|
+
| Long | `TEXTFIELD_long` | Same | `textarea` |
|
|
135
|
+
|
|
136
|
+
| Config field | CSS / DOM |
|
|
137
|
+
|--------------|-----------|
|
|
138
|
+
| `defaultPlaceholder` | placeholder text (bridge `previewState.textfieldPlaceholder`) |
|
|
139
|
+
| `inputRadius` | `--cfm-input-radius` |
|
|
140
|
+
| `borderColor` | `--cfm-input-border` |
|
|
141
|
+
| `inputPadding`, `inputHeight` | `--cfm-input-padding`, `--cfm-input-height` |
|
|
142
|
+
| `placeholderColor` | `--cfm-input-placeholder` + `[data-cfm-textfield]::placeholder` rule |
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
### NPS_SCALE — `questionTypes.NPS_SCALE`
|
|
147
|
+
|
|
148
|
+
| Format tab | Preview key | Controls | Component |
|
|
149
|
+
|------------|-------------|----------|-----------|
|
|
150
|
+
| NPS | `NPS_SCALE` | Button style, track colors, hint labels, number labels | `RatingScale.tsx` |
|
|
151
|
+
|
|
152
|
+
| Config field | CSS / DOM |
|
|
153
|
+
|--------------|-----------|
|
|
154
|
+
| `buttonStyle` | `data-cfm-nps-button-style` (`standard` / `numbered` / `pill`) |
|
|
155
|
+
| `selectedFill`, `trackBarColor`, `trackHighlightColor` | `--cfm-nps-selected-fill`, `--cfm-nps-track-bar`, `--cfm-nps-track-highlight` |
|
|
156
|
+
| `cellSize`, `cellGap` | `--cfm-nps-cell-size`, `--cfm-nps-cell-gap` |
|
|
157
|
+
| `hintMinText`, `hintMaxText`, hint colors | `hintLabelStyle()` → `--cfm-hint-label-*` |
|
|
158
|
+
| `numberLabelMode`, mono/individual colors | `--cfm-number-*`; unselected via `resolveNumberLabelColor()` |
|
|
159
|
+
| Selection | `scaleRadioRingStyle`, `scaleRadioDotStyle` |
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
### CFM_MATRIX — `questionTypes.CFM_MATRIX`
|
|
164
|
+
|
|
165
|
+
| Format tab | Preview key | Controls | Component |
|
|
166
|
+
|------------|-------------|----------|-----------|
|
|
167
|
+
| Likert | `CFM_likert` | Row width, bipolar %, label items | `LikertMatrixScale.tsx` |
|
|
168
|
+
| Bipolar | `CFM_bipolar` | Same | Bipolar anchor column |
|
|
169
|
+
| *(harness only)* Transpose | `CFM_transpose` | Same config block | Matrix transpose branch |
|
|
170
|
+
| *(harness only)* Carousel | `CFM_carousel` | Same | Carousel dots = cell selected |
|
|
171
|
+
| *(harness only)* Dropdown | `CFM_dropdown` | Same | `MatrixDropdown.tsx` |
|
|
172
|
+
|
|
173
|
+
| Config field | CSS / DOM |
|
|
174
|
+
|--------------|-----------|
|
|
175
|
+
| `rowLabelWidth` | `--cfm-matrix-row-width` |
|
|
176
|
+
| `bipolarColumnWidthPercent` | `--cfm-matrix-bipolar-width` |
|
|
177
|
+
| `cellPadding` | `--cfm-matrix-cell-padding` |
|
|
178
|
+
| `columnLabelColor`, `columnLabelBgColor` | `matrixColumnLabelStyle()` |
|
|
179
|
+
| Selection | `matrixRadioRingStyle`, `matrixRadioDotStyle` |
|
|
180
|
+
|
|
181
|
+
**No** per-format accent overrides — Question card tokens only.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
### CSAT_MATRIX — `questionTypes.CSAT_MATRIX`
|
|
186
|
+
|
|
187
|
+
| Format tab | Preview key | Controls shown | Component |
|
|
188
|
+
|------------|-------------|----------------|-----------|
|
|
189
|
+
| Emoji | `CSAT_emoji` | Emoji size, unselected opacity, label items | `CsatMatrixScale.tsx` emoji |
|
|
190
|
+
| Star | `CSAT_star` | Unselected opacity, label items | Star row |
|
|
191
|
+
| Numbered | `CSAT_numbered` | Opacity, label items, **number labels** | Number badges |
|
|
192
|
+
| Graphics | `CSAT_graphics` | Label items only | `CustomSliderTrack.tsx` per row |
|
|
193
|
+
| Carousel | `CSAT_carousel` | Label items | Dot indicators |
|
|
194
|
+
| Dropdown | `CSAT_dropdown` | Label items | `MatrixDropdown.tsx` |
|
|
195
|
+
|
|
196
|
+
| Config field | CSS / DOM |
|
|
197
|
+
|--------------|-----------|
|
|
198
|
+
| `emojiSize` | `--cfm-csat-emoji-size` |
|
|
199
|
+
| `unselectedOpacity` | `--cfm-csat-unselected-opacity` |
|
|
200
|
+
| `cellSize`, `tooltipBg`, `rowLabelWidth` | `--cfm-csat-cell-size`, `--cfm-csat-tooltip-bg`, `--cfm-matrix-row-width` |
|
|
201
|
+
| Label items | `csatColumnLabelStyle()` → `--cfm-csat-column-label-*` |
|
|
202
|
+
| Number labels (numbered tab) | `--cfm-number-*` |
|
|
203
|
+
| Selection | theme cell selected + focus ring |
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
### RATING_MATRIX — `questionTypes.RATING_MATRIX`
|
|
208
|
+
|
|
209
|
+
| Format tab | Preview key | Controls shown | Component |
|
|
210
|
+
|------------|-------------|----------------|-----------|
|
|
211
|
+
| Star | `RATING_star` | Unselected opacity, label items | `CsatMatrixScale.tsx` (shared) |
|
|
212
|
+
| Numbered | `RATING_numbered` | Opacity, label items, number labels | Number badges |
|
|
213
|
+
| Radio | `RATING_radio` | Opacity, label items | **Horizontal** radio grid |
|
|
214
|
+
| Emoji | `RATING_emoji` | Emoji size, opacity, label items | Emoji cells |
|
|
215
|
+
| Graphics | `RATING_graphics` | Opacity, label items | `CustomSliderTrack` |
|
|
216
|
+
| Slider | `RATING_slider` | Label items | Slider thumb pattern |
|
|
217
|
+
|
|
218
|
+
Uses `unselectedStarOpacity` in JSON (maps to `--cfm-csat-unselected-opacity`). Same label/number patterns as CSAT.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
### SLIDER_MATRIX — `questionTypes.SLIDER_MATRIX`
|
|
223
|
+
|
|
224
|
+
| Format tab | Preview key | Controls | Component |
|
|
225
|
+
|------------|-------------|----------|-----------|
|
|
226
|
+
| Slider | `SLIDER_matrix` | Track, thumb, tick, row width, tick label items, tick number labels | `SliderMatrixScale.tsx`, `CustomSliderTrack.tsx` |
|
|
227
|
+
|
|
228
|
+
| Config field | CSS / DOM |
|
|
229
|
+
|--------------|-----------|
|
|
230
|
+
| `trackColor`, `thumbColor`, `tickColor` | `--cfm-slider-track`, `--cfm-slider-thumb`, `--cfm-slider-tick` |
|
|
231
|
+
| `rowLabelWidth` | `--cfm-matrix-row-width` |
|
|
232
|
+
| `rowBandColor` | `--cfm-slider-row-band` |
|
|
233
|
+
| `tickBadgeSize` | `--cfm-slider-tick-size` |
|
|
234
|
+
| Tick label items | `sliderTickLabelStyle()` |
|
|
235
|
+
| Tick number labels | `--cfm-number-*` |
|
|
236
|
+
| Thumb selection | focus ring border + cell selected annulus + center dot |
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
### FILE_UPLOAD — `questionTypes.FILE_UPLOAD`
|
|
241
|
+
|
|
242
|
+
| Format tab | Preview key | Controls | Component |
|
|
243
|
+
|------------|-------------|----------|-----------|
|
|
244
|
+
| Upload | `FILE_UPLOAD` | Border style, border color, fill, padding | `FileUploadScale.tsx` |
|
|
245
|
+
|
|
246
|
+
| Config field | CSS / DOM |
|
|
247
|
+
|--------------|-----------|
|
|
248
|
+
| `dropzoneStyle` | `data-cfm-dropzone-style` (`dashed` / `solid`) |
|
|
249
|
+
| `borderColor` | `--cfm-upload-border-color` |
|
|
250
|
+
| `dropzoneFillColor`, `dropzonePadding` | `--cfm-upload-fill`, `--cfm-upload-padding` |
|
|
251
|
+
| Focus / drag-active | `--cfm-input-focus-ring`, `--cfm-mcq-selected-bg` |
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
### HEATMAP — `questionTypes.HEATMAP`
|
|
256
|
+
|
|
257
|
+
| Format tab | Preview key | Controls | Component |
|
|
258
|
+
|------------|-------------|----------|-----------|
|
|
259
|
+
| Heatmap | `HEATMAP` | Pin color, border, size | `HeatmapScale.tsx` |
|
|
260
|
+
|
|
261
|
+
| Config field | CSS / DOM |
|
|
262
|
+
|--------------|-----------|
|
|
263
|
+
| `pinColor` | `--cfm-heatmap-pin` |
|
|
264
|
+
| `pinBorderColor` | `--cfm-heatmap-pin-border` |
|
|
265
|
+
| `pinSize` | `--cfm-heatmap-pin-size` |
|
|
266
|
+
| `overlayOpacity` | `--cfm-heatmap-overlay-opacity` |
|
|
267
|
+
|
|
268
|
+
Click preview image to place pin — bridge sends `heatmapPreviewPin`.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
### RANK_ORDER — `questionTypes.RANK_ORDER`
|
|
273
|
+
|
|
274
|
+
| Format tab | Preview key | Controls | Component |
|
|
275
|
+
|------------|-------------|----------|-----------|
|
|
276
|
+
| Drag | `RANK_drag` | Item bg, handle, badge | `RankOrderScale.tsx` + `@dnd-kit` |
|
|
277
|
+
| Dropdown | `RANK_dropdown` | Item bg, select border, badge | Dropdown rank UI |
|
|
278
|
+
|
|
279
|
+
| Config path | CSS var |
|
|
280
|
+
|-------------|---------|
|
|
281
|
+
| `drag.itemBg` / `dropdown.itemBg` | `--cfm-rank-item-bg` |
|
|
282
|
+
| `drag.dragHandleColor` | `--cfm-rank-handle` |
|
|
283
|
+
| `drag.rankBadgeColor` / `dropdown.rankBadgeColor` | `--cfm-rank-badge` |
|
|
284
|
+
| `drag.itemPadding`, `itemGap` | `--cfm-rank-item-padding`, `--cfm-rank-item-gap` |
|
|
285
|
+
| `dropdown.selectBorderColor` | `--cfm-rank-select-border` |
|
|
286
|
+
|
|
287
|
+
Bridge sets `rankVariant` from active preview key — do not change answer shapes.
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
### TEXT_AND_MEDIA — `questionTypes.TEXT_AND_MEDIA`
|
|
292
|
+
|
|
293
|
+
| Preview key | Wizard step | Tokens |
|
|
294
|
+
|-------------|-------------|--------|
|
|
295
|
+
| `TEXT_AND_MEDIA` | Theme (media section in defaults) | `--cfm-media-max-width`, `--cfm-media-radius`, `--cfm-media-caption-color`, `--cfm-media-caption-size` |
|
|
296
|
+
|
|
297
|
+
No Question Types panel — wire in `Question.tsx` TEXT_AND_MEDIA branch.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Complete preview key index (27 pages)
|
|
302
|
+
|
|
303
|
+
| Preview key | Wizard step | Notes |
|
|
304
|
+
|-------------|-------------|-------|
|
|
305
|
+
| `header` | Branding | Logo + company |
|
|
306
|
+
| `footer` | Footer | Links + copyright |
|
|
307
|
+
| `survey_page` | Theme, Layout, Tokens | Full chrome |
|
|
308
|
+
| `intro` | — | `data-cfm-survey-title` |
|
|
309
|
+
| `end` | — | `data-cfm-thank-you` |
|
|
310
|
+
| `MCQ_single` / `MCQ_multiple` | Question Types | MCQ |
|
|
311
|
+
| `TEXTFIELD_short` / `TEXTFIELD_long` | Question Types | Text |
|
|
312
|
+
| `NPS_SCALE` | Question Types | NPS |
|
|
313
|
+
| `CFM_likert` / `CFM_bipolar` | Question Types | CFM wizard tabs |
|
|
314
|
+
| `CFM_transpose` / `CFM_carousel` / `CFM_dropdown` | — | Harness; same `CFM_MATRIX` config |
|
|
315
|
+
| `CSAT_emoji` … `CSAT_dropdown` | Question Types | 6 CSAT formats |
|
|
316
|
+
| `RATING_star` … `RATING_slider` | Question Types | 6 Rating formats |
|
|
317
|
+
| `SLIDER_matrix` | Question Types | Slider matrix |
|
|
318
|
+
| `FILE_UPLOAD` | Question Types | Upload |
|
|
319
|
+
| `HEATMAP` | Question Types | Heatmap |
|
|
320
|
+
| `RANK_drag` / `RANK_dropdown` | Question Types | Rank |
|
|
321
|
+
| `TEXT_AND_MEDIA` | Theme vars | Media block |
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Phase 5 — smooth wiring order
|
|
326
|
+
|
|
327
|
+
Do this **once** before `npx cfm-sdk customize` so every catalog row works in live preview:
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
# 1. Chrome + bridge (wizard-chrome-contract.md)
|
|
331
|
+
cp templates/docs/templates/Header.tsx Footer.tsx ProgressBar.tsx SurveyStickyChrome.tsx \
|
|
332
|
+
LanguageSelector.tsx PreviewBridgeInit.tsx uiConfig.ts → src/
|
|
333
|
+
cp templates/previewBridge.ts src/lib/
|
|
334
|
+
cp templates/survey-theme.css src/styles/
|
|
335
|
+
|
|
336
|
+
# 2. Selection + label helpers
|
|
337
|
+
cp templates/docs/templates/selectionStyles.ts labelStyles.ts → src/lib/surveyUi/
|
|
338
|
+
|
|
339
|
+
# 3. Scale components per survey inventory (+ shared primitives)
|
|
340
|
+
# RatingScale, LikertMatrixScale, CsatMatrixScale, SliderMatrixScale,
|
|
341
|
+
# FileUploadScale, HeatmapScale, RankOrderScale, MatrixDropdown, CustomSliderTrack
|
|
342
|
+
|
|
343
|
+
# 4. Seed config with all survey types
|
|
344
|
+
# survey-ui-config.json → surveyTypes: [every type from fetched survey]
|
|
345
|
+
|
|
346
|
+
# 5. Export previews from real components
|
|
347
|
+
npx cfm-sdk export-previews
|
|
348
|
+
|
|
349
|
+
# 6. Verify
|
|
350
|
+
bash templates/verify-agent-build.sh
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
**Per-format checklist** while wiring each scale:
|
|
354
|
+
|
|
355
|
+
1. Every wizard-exposed token uses `var(--cfm-*)` from this catalog
|
|
356
|
+
2. Radio/scale cells use `selectionStyles.ts` (focus ring + cell selected)
|
|
357
|
+
3. Matrix column headers use `labelStyles.ts` (label items — not hint labels on CFM)
|
|
358
|
+
4. NPS/numbered unselected badges use `resolveNumberLabelColor()` only when unselected
|
|
359
|
+
5. Question wrapper uses `var(--cfm-card-*)` on `.cfm-question-card`
|
|
360
|
+
6. `data-cfm-question-number` + `data-cfm-required` on question shell
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Symptom → catalog lookup
|
|
365
|
+
|
|
366
|
+
| Preview does not update when client changes… | Check catalog section |
|
|
367
|
+
|---------------------------------------------|----------------------|
|
|
368
|
+
| Logo / company | Branding & Header |
|
|
369
|
+
| Progress bar (separate from header) | `data-cfm-progress` — not on sticky wrapper |
|
|
370
|
+
| Question card padding/shadow | Theme → Question card + `.cfm-question-card` |
|
|
371
|
+
| MCQ option spacing | MCQ → `--cfm-mcq-*` |
|
|
372
|
+
| NPS number badge colors | NPS → `--cfm-number-*` + `resolveNumberLabelColor` |
|
|
373
|
+
| Matrix 2nd row | CFM/CSAT/Rating/Slider + multi-statement toggle |
|
|
374
|
+
| CSAT emoji size | CSAT emoji → `--cfm-csat-emoji-size` |
|
|
375
|
+
| Slider thumb colors | SLIDER_MATRIX + `CustomSliderTrack` |
|
|
376
|
+
| Dropzone border | FILE_UPLOAD → `--cfm-upload-border-color` |
|
|
377
|
+
| Rank handle color | RANK drag → `--cfm-rank-handle` |
|
|
378
|
+
|
|
379
|
+
Full symptom table: [`wizard-chrome-contract.md`](wizard-chrome-contract.md).
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## Related
|
|
384
|
+
|
|
385
|
+
| Doc | Role |
|
|
386
|
+
|-----|------|
|
|
387
|
+
| [`wizard-preview-build-guide.md`](wizard-preview-build-guide.md) | export-previews + bridge protocol |
|
|
388
|
+
| [`wizard-question-type-styling.md`](wizard-question-type-styling.md) | Selection patterns + code snippets |
|
|
389
|
+
| [`wizard-post-customize-build.md`](wizard-post-customize-build.md) | After save — apply + build |
|
|
390
|
+
| [`apply-ui-config.md`](apply-ui-config.md) | Config path → CSS tables |
|
|
391
|
+
| [`03-ui-specs/README.md`](../03-ui-specs/README.md) | Per-type layout anatomy |
|