@explorer02/cfm-survey-sdk 0.2.7 → 0.2.8
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/package.json +1 -1
- package/templates/docs/00-integration/agent-execution-flow.md +1 -3
- package/templates/docs/00-integration/wizard-chrome-contract.md +0 -1
- package/templates/docs/00-integration/wizard-post-customize-build.md +2 -2
- package/templates/docs/00-integration/wizard-preview-build-guide.md +0 -2
- package/templates/docs/00-integration/wizard-question-type-styling.md +3 -3
- package/templates/docs/03-ui-specs/README.md +1 -1
- package/templates/docs/MANIFEST.json +0 -3
- package/templates/docs/index.md +3 -5
- package/templates/docs/00-integration/wizard-customization-catalog.md +0 -391
package/package.json
CHANGED
|
@@ -115,7 +115,6 @@ Machine-readable routing: [`MANIFEST.json`](../MANIFEST.json) `phases[]`.
|
|
|
115
115
|
|
|
116
116
|
**Read:**
|
|
117
117
|
- `00-integration/wizard-chrome-contract.md` **(required — copy-first templates)**
|
|
118
|
-
- `00-integration/wizard-customization-catalog.md` **(required — all wizard controls × formats)**
|
|
119
118
|
- `00-integration/constraints.md`
|
|
120
119
|
- `00-integration/component-checklist.md`
|
|
121
120
|
- `00-integration/wizard-preview-build-guide.md` **(required)**
|
|
@@ -296,8 +295,7 @@ Full mapping: [`wizard-question-type-styling.md`](wizard-question-type-styling.m
|
|
|
296
295
|
| Hook / answers | `client-integration-guide.md`, `useSurveySDK.md` |
|
|
297
296
|
| Copy files list | `component-checklist.md`, `client-lib-folder.md` |
|
|
298
297
|
| Matrix labels | `canonical-survey-fixtures.md` |
|
|
299
|
-
| Wizard chrome | `wizard-preview-build-guide.md
|
|
300
|
-
| Wizard controls (all formats) | `wizard-customization-catalog.md` |
|
|
298
|
+
| Wizard chrome | `wizard-preview-build-guide.md` |
|
|
301
299
|
| Wizard per-type | `wizard-question-type-styling.md` |
|
|
302
300
|
| Wait + capture + apply order | `wizard-config-handoff.md` |
|
|
303
301
|
| Apply every config path | `apply-ui-config.md` |
|
|
@@ -276,7 +276,6 @@ EC2 `customize-ui`: quit/save uses disk session GC — see [`wizard-config-hando
|
|
|
276
276
|
|
|
277
277
|
| Doc | Role |
|
|
278
278
|
|-----|------|
|
|
279
|
-
| [`wizard-customization-catalog.md`](wizard-customization-catalog.md) | Every wizard control → CSS var → component |
|
|
280
279
|
| [`wizard-preview-build-guide.md`](wizard-preview-build-guide.md) | Full build guide |
|
|
281
280
|
| [`wizard-post-customize-build.md`](wizard-post-customize-build.md) | After wizard save — apply all formats + build |
|
|
282
281
|
| [`wizard-question-type-styling.md`](wizard-question-type-styling.md) | Per-type CSS vars |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Wizard Post-Customize Build — All Types, All Formats
|
|
2
2
|
|
|
3
3
|
> **Phase 6c runbook.** Read after the client clicks **Review & Build** and the CLI prints `✅ UI configuration saved`.
|
|
4
|
-
> Companion docs: [`wizard-config-handoff.md`](wizard-config-handoff.md) · [`
|
|
4
|
+
> Companion docs: [`wizard-config-handoff.md`](wizard-config-handoff.md) · [`apply-ui-config.md`](apply-ui-config.md) · [`wizard-question-type-styling.md`](wizard-question-type-styling.md) · [`wizard-chrome-contract.md`](wizard-chrome-contract.md)
|
|
5
5
|
|
|
6
6
|
This doc answers two agent questions:
|
|
7
7
|
|
|
@@ -87,7 +87,7 @@ test -z "$LOGO" || test -f "public/$LOGO" || echo "FAIL: logo file missing in pu
|
|
|
87
87
|
|
|
88
88
|
The wizard **Question Types** step exposes **10 type families** (TEXT_AND_MEDIA uses theme vars only). Apply `questionTypes.{TYPE}` for **every** type block in saved JSON — even if the client's survey does not include that type. This keeps `survey-theme.css` complete and future-proof.
|
|
89
89
|
|
|
90
|
-
Use the format matrix below. Detailed token tables: [`wizard-
|
|
90
|
+
Use the format matrix below. Detailed token tables: [`wizard-question-type-styling.md`](wizard-question-type-styling.md) and [`apply-ui-config.md`](apply-ui-config.md).
|
|
91
91
|
|
|
92
92
|
### F. Hook options
|
|
93
93
|
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
> **Read during Phase 5 (BUILD) — mandatory.** Wizard **run** (Phase 6b) is optional; this contract is required for every agent build.
|
|
4
4
|
> **Authoritative hook list + copy commands:** [`wizard-chrome-contract.md`](wizard-chrome-contract.md) — fixes logo, layout toggles, question card, and per-type preview issues.
|
|
5
|
-
> **Complete control catalog (all steps, types, formats):** [`wizard-customization-catalog.md`](wizard-customization-catalog.md).
|
|
6
5
|
> Pipeline: [`agent-execution-flow.md`](agent-execution-flow.md).
|
|
7
6
|
|
|
8
7
|
Related docs:
|
|
9
8
|
|
|
10
|
-
- [`wizard-customization-catalog.md`](wizard-customization-catalog.md) — **every wizard control** → config → CSS var → component
|
|
11
9
|
- [`wizard-chrome-contract.md`](wizard-chrome-contract.md) — **copy-first templates** + symptom → fix table
|
|
12
10
|
|
|
13
11
|
- [`ui-customization-wizard.md`](ui-customization-wizard.md) — wizard flow and CLI
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Wizard Question-Type Styling
|
|
2
2
|
|
|
3
|
-
> **Read during Phase 5 (BUILD) — mandatory.** Alongside [`wizard-
|
|
3
|
+
> **Read during Phase 5 (BUILD) — mandatory.** Alongside [`wizard-preview-build-guide.md`](wizard-preview-build-guide.md) and [`apply-ui-config.md`](apply-ui-config.md).
|
|
4
4
|
> **After client saves wizard:** [`wizard-post-customize-build.md`](wizard-post-customize-build.md) — full format matrix + Phase 6c runbook.
|
|
5
5
|
> Pipeline: [`agent-execution-flow.md`](agent-execution-flow.md).
|
|
6
6
|
|
|
@@ -193,9 +193,9 @@ For production builds after wizard: syncing `survey-theme.css` is sufficient —
|
|
|
193
193
|
|
|
194
194
|
**Wizard customization** exposes all **11** question types regardless of fetched survey inventory. Wire styling for every scale template you copy — not only types in the client's mockup image.
|
|
195
195
|
|
|
196
|
-
**Format-level matrix** (every preview tab → component): [`wizard-
|
|
196
|
+
**Format-level matrix** (every preview tab → component): [`wizard-post-customize-build.md`](wizard-post-customize-build.md) § Question type format matrix.
|
|
197
197
|
|
|
198
|
-
For each type in **wizard export** (all
|
|
198
|
+
For each type in **wizard export** (all 11):
|
|
199
199
|
|
|
200
200
|
- [ ] Scale component uses `var(--cfm-*)` for every wizard-exposed token (no hardcoded brand hex)
|
|
201
201
|
- [ ] Radio/scale selections use `selectionStyles.ts` pattern (focus ring + cell selected)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
> **Shared lib utilities** (NPS colors, custom fields, heatmap coords) live in [`templates/`](../templates/) — see [`client-lib-folder.md`](../00-integration/client-lib-folder.md), not in this ui-specs folder.
|
|
5
5
|
> Read the spec for **each question type present** in the fetched survey before writing React code.
|
|
6
6
|
|
|
7
|
-
> **Wizard customization:** When the client may use the web wizard, hardcoded hex in § Design Tokens below are **defaults only**. Wire `var(--cfm-*)` per [`wizard-question-type-styling.md`](../00-integration/wizard-question-type-styling.md) — especially `--cfm-matrix-selected` (cell annulus) and `--cfm-input-focus-ring` (outer border + inner dot).
|
|
7
|
+
> **Wizard customization:** When the client may use the web wizard, hardcoded hex in § Design Tokens below are **defaults only**. Wire `var(--cfm-*)` per [`wizard-question-type-styling.md`](../00-integration/wizard-question-type-styling.md) — especially `--cfm-matrix-selected` (cell annulus) and `--cfm-input-focus-ring` (outer border + inner dot). Portable scale templates in `docs/templates/` are layout/logic baselines; extend with `selectionStyles.ts` + `labelStyles.ts` for live preview.
|
|
8
8
|
|
|
9
9
|
## How to Read a UI Spec
|
|
10
10
|
|
|
@@ -368,10 +368,8 @@
|
|
|
368
368
|
"00-integration/agent-execution-flow.md",
|
|
369
369
|
"00-integration/constraints.md",
|
|
370
370
|
"00-integration/component-checklist.md",
|
|
371
|
-
"00-integration/wizard-customization-catalog.md",
|
|
372
371
|
"00-integration/wizard-preview-build-guide.md",
|
|
373
372
|
"00-integration/wizard-question-type-styling.md",
|
|
374
|
-
"00-integration/wizard-chrome-contract.md",
|
|
375
373
|
"02-reference/routing-table.md"
|
|
376
374
|
],
|
|
377
375
|
"onDemand": "02-reference/question-types"
|
|
@@ -428,7 +426,6 @@
|
|
|
428
426
|
"read": [
|
|
429
427
|
"00-integration/wizard-config-handoff.md",
|
|
430
428
|
"00-integration/ui-customization-wizard.md",
|
|
431
|
-
"00-integration/wizard-customization-catalog.md",
|
|
432
429
|
"00-integration/wizard-preview-build-guide.md",
|
|
433
430
|
"00-integration/wizard-question-type-styling.md",
|
|
434
431
|
"00-integration/wizard-api.md",
|
package/templates/docs/index.md
CHANGED
|
@@ -29,7 +29,6 @@ templates/docs/
|
|
|
29
29
|
├── 00-integration/
|
|
30
30
|
│ ├── agent-operating-contract.md ← Anti-hallucination — read FIRST
|
|
31
31
|
│ ├── agent-execution-flow.md ← Pipeline, client questions, wizard-ready build
|
|
32
|
-
│ ├── wizard-customization-catalog.md ← All wizard controls × types × formats
|
|
33
32
|
│ ├── wizard-preview-build-guide.md
|
|
34
33
|
│ ├── wizard-post-customize-build.md ← Phase 6c — all formats + build gate
|
|
35
34
|
│ ├── wizard-question-type-styling.md
|
|
@@ -79,7 +78,7 @@ Full step-by-step: [`agent-execution-flow.md`](00-integration/agent-execution-fl
|
|
|
79
78
|
| **2** Instance ID | Get JWT | `useSurveySDK.md` — **ask client** |
|
|
80
79
|
| **3** SDK contract | Hook + logic | `client-integration-guide.md`, `question-type-sdk-matrix.md`, logic docs |
|
|
81
80
|
| **4** Plan | Inventory + copy dispatcher | `component-checklist.md`, per-type MANIFEST docs, `implementation_plan.md` |
|
|
82
|
-
| **5** Build | Wizard-ready UI | `wizard-
|
|
81
|
+
| **5** Build | Wizard-ready UI | `wizard-chrome-contract.md`, `wizard-preview-build-guide.md`, `wizard-question-type-styling.md`, `03-ui-specs/*` |
|
|
83
82
|
| **6** Verify | Build + dev server | `verify-agent-build.sh` — **ask wizard** |
|
|
84
83
|
| **6b** Wizard | Optional customize | **`npx cfm-sdk customize`** (default) — EC2 `customize-ui` only if client on another device |
|
|
85
84
|
| **6c** Apply | Sync final config | `wizard-post-customize-build.md`, `apply-ui-config.md` |
|
|
@@ -154,7 +153,7 @@ Re-run verify script + build.
|
|
|
154
153
|
| **Always first** | `agent-operating-contract.md`, `agent-execution-flow.md`, `mockup-ui-extraction.md`, `index.md`, `client-integration-guide.md`, `constraints.md` |
|
|
155
154
|
| Phase 3 contract | `question-type-sdk-matrix.md`, `useSurveySDK.md`, logic/navigation docs |
|
|
156
155
|
| Phase 4 plan | `mockup-ui-extraction.md`, `placeholders-and-custom-fields-wiring.md`, `component-checklist.md`, per-type `03-ui-specs/*` |
|
|
157
|
-
| Wizard build | `wizard-
|
|
156
|
+
| Wizard build | `wizard-preview-build-guide.md`, `wizard-question-type-styling.md` |
|
|
158
157
|
| Wizard run | `wizard-config-handoff.md`, `ui-customization-wizard.md`, `wizard-api.md`, `wizard-troubleshooting.md` |
|
|
159
158
|
| After wizard (apply all paths) | `wizard-post-customize-build.md`, `apply-ui-config.md` |
|
|
160
159
|
| Deploy | `aws-deploy.md` (§ Logos & local assets), `setup.md#nextjs-aws-static-export` |
|
|
@@ -172,5 +171,4 @@ Re-run verify script + build.
|
|
|
172
171
|
| Hint labels | `--cfm-hint-label-*` | NPS min/max anchors |
|
|
173
172
|
| Number labels | `--cfm-number-*` | Traffic-light badges (unselected only) |
|
|
174
173
|
|
|
175
|
-
Full per-type table: [`wizard-question-type-styling.md`](00-integration/wizard-question-type-styling.md).
|
|
176
|
-
Complete wizard control index (all formats): [`wizard-customization-catalog.md`](00-integration/wizard-customization-catalog.md).
|
|
174
|
+
Full per-type table: [`wizard-question-type-styling.md`](00-integration/wizard-question-type-styling.md).
|
|
@@ -1,391 +0,0 @@
|
|
|
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 |
|