@usgb/forms 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,28 +2,28 @@
2
2
 
3
3
  Shared lead and newsletter forms for the **PWA** (React) and **WordPress** (Web Component) hosts.
4
4
 
5
- You pick a predefined `formId`. The package owns fields, validation, consent copy, tracking keys, and layout. You own the submit endpoint, legal-document URLs, heading/CTA copy, and thank-you behavior.
5
+ You pick a predefined `formId`. The package owns fields, validation, consent copy, tracking keys, and layout. You own the submit endpoint, legal-document URLs, heading/subheading/CTA copy, and thank-you behavior.
6
6
 
7
7
  ## What you get
8
8
 
9
- | Artifact | Path / export | Who uses it |
10
- | ------------- | --------------------------------------------------------------- | ----------------------------------- |
11
- | React package | `@usgb/forms` → `dist/index.js` | PWA / any React host |
12
- | Stylesheet | `@usgb/forms/usgb-forms.css` | **Required** for React hosts |
13
- | Web Component | `dist/usgb-forms.js` (also versioned `usgb-forms.<version>.js`) | WordPress and other non-React hosts |
14
- | Catalog | `@usgb/forms/manifest` → `forms-manifest.json` | CMS pickers, docs, tooling |
9
+ | Artifact | Path / export | Who uses it |
10
+ | ------------- | ---------------------------------------------------------------------------------------------------------- | ----------------------------------- |
11
+ | React package | `@usgb/forms` → `dist/index.js` | PWA / any React host |
12
+ | Stylesheet | `@usgb/forms/usgb-forms.css` | **Required** for React hosts |
13
+ | Web Component | `dist/usgb-forms.js` (also versioned `usgb-forms.<version>.js`) | WordPress and other non-React hosts |
14
+ | Catalog | `@usgb/forms/manifest` → `forms-manifest.json` (also versioned `forms-manifest.<version>.json` in `dist/`) | CMS pickers, Gutenberg, tooling |
15
15
 
16
16
  The Web Component script injects the same CSS once on load. React hosts must import the stylesheet themselves.
17
17
 
18
18
  ## Mental model
19
19
 
20
- | You pass | Package already decided |
21
- | -------------------------------- | ------------------------------------------------------------------------------------- |
22
- | `formId` | Fields, required/optional rules, consent bundle, tracking set, layout family (`kind`) |
23
- | `adapter.submit` | Where the payload goes (never an attribute or hardcoded URL) |
24
- | `legalUrls` / `*-url` | Hrefs for package-owned consent copy |
25
- | `heading`, `body`, `ctaLabel` | Marketing copy around the form |
26
- | `successMessage` or `successUrl` | Thank-you UX after accept |
20
+ | You pass | Package already decided |
21
+ | ----------------------------------- | ----------------------------------------------------------------------------------- |
22
+ | `formId` | Fields, required/optional rules, consent pins, tracking set, layout family (`kind`) |
23
+ | `adapter.submit` | Where the payload goes (never an attribute or hardcoded URL) |
24
+ | `legalUrls` / `*-url` | Hrefs for package-owned consent copy |
25
+ | `heading`, `subheading`, `ctaLabel` | Marketing copy around the form |
26
+ | `successMessage` or `successUrl` | Thank-you UX after accept |
27
27
 
28
28
  Hosts **must not** invent field lists, consent wording, or tracking keys. New forms are new catalog entries in this package, not host-built schemas.
29
29
 
@@ -31,12 +31,13 @@ Use `listFormDefinitions()` (or the manifest) when a CMS needs a picker of avail
31
31
 
32
32
  ## Available forms
33
33
 
34
- | `formId` | Kind | Fields | Consent | Variants |
35
- | -------------------- | ------------ | --------------------------------------------------------- | ------------------------------ | ------------------------------------------------------- |
36
- | `main-investors-kit` | `lead` | First name, last name, email (required); phone (optional) | TCPA checkbox (`lead-tcpa` v1) | `dense`, `large`, `sidebar`, plus optional `two-column` |
37
- | `newsletter` | `newsletter` | Email only | None | None — omit `variants` / `variant` |
34
+ | `formId` | Kind | Fields | Consent | Variants |
35
+ | --------------------------- | ------------ | --------------------------------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------- |
36
+ | `main-investors-kit` | `lead` | First name, last name, email (required); phone (optional) | Optional TCPA, marketing SMS, and terms/privacy checkboxes | `dense`, `large`, `sidebar`, plus optional `two-column` |
37
+ | `main-investors-kit-notice` | `lead` | Same as kit | Clickwrap notice only (`lead-clickwrap` v1) | `dense`, `large`, `sidebar`, plus optional `two-column` |
38
+ | `newsletter` | `newsletter` | Email only | None | None — omit `variants` / `variant` |
38
39
 
39
- Appearances for both: `light` | `navy`.
40
+ Appearances for every catalog form: `on-light` | `on-dark`. Appearance only recolors the form for readability on a light or dark host background — it never sets a background, padding, or radius. The host container owns those.
40
41
 
41
42
  `kind` is the layout family (lead grid vs inline newsletter row). The root exposes `data-kind` for CSS. Several catalog forms can share one kind (e.g. another lead kit that reuses the lead layout).
42
43
 
@@ -69,9 +70,40 @@ Load the built IIFE (styles inject themselves):
69
70
  <script src="https://cdn.example.com/usgb-forms/usgb-forms.1.0.0.js"></script>
70
71
  ```
71
72
 
72
- Exact CDN hostname, path, and versioning scheme are **TBD**. Prefer a versioned filename (`usgb-forms.<version>.js`) so hosts can pin releases.
73
+ Exact CDN hostname, path, and versioning scheme are **TBD**. Prefer versioned filenames (`usgb-forms.<version>.js` and `forms-manifest.<version>.json`) so hosts can pin the script and the CMS picker to the same release. Gutenberg should load that matching manifest — not an unversioned “latest” file — when listing `formId`s.
73
74
 
74
- Until the package is published, you can still develop against a local checkout (`yarn add file:../usgb-forms` or `yarn link`).
75
+ ### Local development (hosts, unpublished)
76
+
77
+ Hosts consume **built** artifacts (`dist/` and root `forms-manifest.json`), not `src/`. Clone this repo next to the host (or anywhere you can path to), then:
78
+
79
+ ```bash
80
+ cd usgb-forms
81
+ yarn install
82
+ yarn build
83
+ ```
84
+
85
+ Rebuild here whenever you change this package. The Vite playground (`yarn dev`) is only for package maintainers; it is not what PWA or WordPress load.
86
+
87
+ **React / PWA.** Point the host at this repo with Yarn 1 `file:` (preferred — the path lives in the host `package.json`, no global link):
88
+
89
+ ```bash
90
+ # from the PWA / React host, path adjusted to your layout
91
+ yarn add file:../usgb-forms
92
+ ```
93
+
94
+ Or set `"@usgb/forms": "file:../usgb-forms"` by hand and run `yarn install`. Imports stay the same (`@usgb/forms`, `@usgb/forms/usgb-forms.css`, `@usgb/forms/manifest`). After each `yarn build` in this repo, run `yarn install` (or `yarn upgrade @usgb/forms`) in the host so Yarn recopies the pack — `file:` does not live-reload.
95
+
96
+ `yarn link` in this repo and `yarn link @usgb/forms` in the host also works, but it can resolve a second copy of React and break hooks. If that happens, alias `@usgb/forms` to the sibling folder in the host bundler instead of linking.
97
+
98
+ **WordPress / Web Component.** Skip the CDN. After `yarn build`, load files from this repo:
99
+
100
+ | Host need | File in this repo |
101
+ | ------------------------ | --------------------------------------------------------------- |
102
+ | Form script | `dist/usgb-forms.js` |
103
+ | Pinned script (optional) | `dist/usgb-forms.<version>.js` |
104
+ | Gutenberg `formId` list | `forms-manifest.json` (or `dist/forms-manifest.<version>.json`) |
105
+
106
+ Copy those into the plugin on its build, or enqueue them from a local static server. A `file:` npm dependency is not required for the Web Component — only a URL (or filesystem path the plugin can enqueue) to the built JS and catalog JSON.
75
107
 
76
108
  ## React (PWA)
77
109
 
@@ -80,10 +112,10 @@ import { UsgbForm, createStubAdapter, PWA_LEGAL_URLS } from '@usgb/forms'
80
112
  import '@usgb/forms/usgb-forms.css'
81
113
  ;<UsgbForm
82
114
  formId="main-investors-kit"
83
- appearance="navy"
115
+ appearance="on-dark"
84
116
  variants={['large', 'two-column']}
85
117
  heading="Get My Free Guide"
86
- body="Enter your details to receive the Main Investors Kit."
118
+ subheading="Enter your details to receive the Main Investors Kit."
87
119
  ctaLabel="GET MY FREE GUIDE"
88
120
  source="cms-home"
89
121
  campaign="spring-kit"
@@ -104,7 +136,7 @@ Newsletter (no consent, no variants):
104
136
  ```tsx
105
137
  <UsgbForm
106
138
  formId="newsletter"
107
- appearance="light"
139
+ appearance="on-light"
108
140
  heading="Subscribe"
109
141
  ctaLabel="SUBSCRIBE"
110
142
  adapter={yourHostAdapter}
@@ -117,10 +149,10 @@ Newsletter (no consent, no variants):
117
149
  | ------------------------- | -------------------------- | --------------------------------------------------------------------------------------------------- |
118
150
  | `formId` | yes | Catalog key (`main-investors-kit`, `newsletter`, …) |
119
151
  | `adapter` | yes | `HostAdapter` with `host`, `getTrackingHints()`, `submit()` |
120
- | `appearance` | no | `light` (default) or `navy` |
152
+ | `appearance` | no | `on-light` (default) or `on-dark` |
121
153
  | `variants` | no | Lead only. Default `['dense']`. One of `dense` \| `large` \| `sidebar`, optionally add `two-column` |
122
- | `heading` / `body` | no | Title and supporting copy |
123
- | `ctaLabel` | no | Submit button label |
154
+ | `heading` / `subheading` | no | Title and supporting copy |
155
+ | `ctaLabel` | no | Submit button label. Falls back to the catalog `ctaLabel` for that `formId` |
124
156
  | `source` / `campaign` | no | Placement / campaign context in the payload |
125
157
  | `legalUrls` | when consent requires them | Host CMS paths for legal links in consent copy |
126
158
  | `successMessage` | no | Inline thank-you when `successUrl` is omitted |
@@ -138,9 +170,10 @@ Load one script. Styles are injected automatically.
138
170
  <usgb-form
139
171
  ```
140
172
  form-id="main-investors-kit"
141
- appearance="navy"
173
+ appearance="on-dark"
142
174
  variant="large two-column"
143
175
  heading="Get My Free Guide"
176
+ subheading="Enter your details to receive the Main Investors Kit."
144
177
  cta="GET MY FREE GUIDE"
145
178
  source="cms-home"
146
179
  client-agreement-url="/client-agreement/"
@@ -187,7 +220,7 @@ Submit is **not** an attribute. Markup alone uses a stub adapter. Assign a real
187
220
  | `form-id` | `formId` |
188
221
  | `appearance` | `appearance` |
189
222
  | `variant` | `variants` (space-separated) |
190
- | `heading` / `body` | `heading` / `body` |
223
+ | `heading` / `subheading` | `heading` / `subheading` |
191
224
  | `cta` | `ctaLabel` |
192
225
  | `source` / `campaign` | `source` / `campaign` |
193
226
  | `success-message` / `success-url` | `successMessage` / `successUrl` |
@@ -211,19 +244,19 @@ interface HostAdapter {
211
244
 
212
245
  ### Payload shape (summary)
213
246
 
214
- Successful submits send a nested envelope: `formId`, `definitionVersion`, `submissionContractVersion`, `idempotencyKey`, `data` (field values), optional `consent`, and `context` (`host`, `source`, `campaign`, `page`, `tracking`). Exact field and tracking sets come from the form’s catalog entry.
247
+ Successful submits send a nested envelope: `formId`, `definitionVersion`, `submissionContractVersion`, `idempotencyKey`, `data` (field values), optional `consents` (grant booleans, opt-in dates, and `*_consent_language` strings), and `context` (`host`, `source`, `campaign`, `page`, `tracking`). Exact field and tracking sets come from the form’s catalog entry.
215
248
 
216
249
  ## Consent and legal URLs
217
250
 
218
- Consent bundles are versioned and package-owned (checkboxes and/or clickwrap notices). Hosts only supply document **hrefs**.
251
+ Consent policies are versioned and package-owned (checkboxes and/or clickwrap notices). Forms list zero or more pins (`definitionId` + `definitionVersion` + optional `required` for checkboxes). Hosts only supply document **hrefs**.
219
252
 
220
- - `main-investors-kit` uses `lead-tcpa` v1 and requires `clientAgreement` and `privacyPolicy`.
221
- - PWA Magento defaults: `PWA_LEGAL_URLS` → `/content/client-agreement`, `/content/privacy-policy`.
222
- - WordPress must pass every URL required by the selected consent. A consent form with a missing required URL **does not render**.
223
- - Checkbox values land in `consent.values` (and mirrored in `data`). Notices have no boolean field; the payload still records consent definition id/version.
224
- - Distinct legal wording requires a new consent id/version in this package — not freeform copy from the host.
225
-
226
- `LEAD_CLICKWRAP_V1` (“By clicking the button…”) is in the catalog and needs five legal URLs (`privacyPolicy`, `userAgreement`, `marketLossPolicy`, `electronicDisclaimer`, `termsOfSale`). It is not attached to a `formId` until that recipe is chosen.
253
+ - `main-investors-kit` pins `lead-tcpa`, `lead-sms`, and `lead-tospp` (all v1, optional checkboxes). It needs `userAgreement` and `privacyPolicy` for the terms/privacy copy.
254
+ - `main-investors-kit-notice` pins `lead-clickwrap` v1 (notice only). It needs the five clickwrap URLs.
255
+ - PWA Magento defaults (`PWA_LEGAL_URLS`): `/content/client-agreement`, `/content/privacy-policy`, `/content/user-agreement`, `/content/market-loss-policy`, `/content/electronic-disclaimer`, `/content/terms-of-sale`.
256
+ - WordPress must pass every URL required by the selected consents. A form with a missing required URL **does not render**.
257
+ - Checkbox grants land in `consents` only (`tcpa_form_consent_granted`, `sms_form_consent_granted`, `tospp_form_consent_granted`). The exact copy shown is `tcpa_consent_language` (and the matching keys for other policies), even when unchecked.
258
+ - Checking the TCPA box also adds `tcpa_form_opt_in_date` (YYYY-MM-DD). The notice form only sends `clickwrap_consent_language`.
259
+ - Distinct legal wording requires a new consent id/version in this package — not freeform copy from the host. Toggle `consents[].required` on the form recipe when a checkbox must be checked.
227
260
 
228
261
  ## Success behavior
229
262
 
@@ -240,10 +273,10 @@ This package does **not** wait on a returned Promise, add a flush timeout, or ca
240
273
 
241
274
  What is reliable today:
242
275
 
243
- - Inline thank-you (`successMessage` only) — no navigation, so tags usually complete.
244
- - Same-document hash redirects (`#thank-you`) — no unload.
245
- - Host `analytics` that uses `navigator.sendBeacon` or `fetch(..., { keepalive: true })`.
246
- - Conversion measured on the thank-you page itself, not on this `success` event.
276
+ - Inline thank-you (`successMessage` only) — no navigation, so tags usually complete.
277
+ - Same-document hash redirects (`#thank-you`) — no unload.
278
+ - Host `analytics` that uses `navigator.sendBeacon` or `fetch(..., { keepalive: true })`.
279
+ - Conversion measured on the thank-you page itself, not on this `success` event.
247
280
 
248
281
  `submit_attempt` is safer than `success` because it fires before `adapter.submit` and has the round-trip to flush. Prefer the thank-you page (or a beacon) when `successUrl` is a full navigation.
249
282
 
@@ -264,18 +297,43 @@ Prefer **custom properties** on `.usgb-form` for color, type, and spacing:
264
297
  --usgb-field-border: #cccccc;
265
298
  }
266
299
 
267
- .usgb-form[data-appearance='navy'] {
300
+ .usgb-form[data-appearance='on-dark'] {
268
301
  --usgb-button-background: #f4e08e;
269
302
  }
270
303
  ```
271
304
 
272
305
  Use class selectors when a token does not exist (`.usgb-form .usgb-btn { border-radius: 0; }`).
273
306
 
274
- Stable hooks: `.usgb-form` (`data-appearance`, `data-variant`, `data-kind`), `.usgb-form-heading`, `.usgb-form-body`, `.usgb-form-grid`, `.usgb-form-inline`, `.usgb-field-control`, `.usgb-field-error`, `.usgb-consent-*`, `.usgb-btn`, `.usgb-form-status-*`.
307
+ Stable hooks: `.usgb-form` (`data-appearance`, `data-variant`, `data-kind`), `.usgb-form-heading`, `.usgb-form-subheading`, `.usgb-form-grid`, `.usgb-form-inline`, `.usgb-field-control`, `.usgb-field-error`, `.usgb-consent-*`, `.usgb-btn`, `.usgb-form-status-*`.
308
+
309
+ Semantic tokens (`--usgb-field-*`, `--usgb-button-*`, `--usgb-newsletter-underline`, …) are the first place to retheme. Palette vars (`--usgb-blue-1`, …) are a PWA snapshot. Error and checkbox glyphs are inline SVGs that use `currentColor` — override `--usgb-alert-danger` or `--usgb-checkbox-mark` to recolor them.
310
+
311
+ Appearance never paints a card. Put the form on a dark host surface and pass `appearance="on-dark"` (or `on-light` on a light surface):
312
+
313
+ ```html
314
+ <div style="background: #001f3d; padding: 2rem; border-radius: 0.75rem">
315
+ <usgb-form form-id="main-investors-kit" appearance="on-dark" …></usgb-form>
316
+ </div>
317
+ ```
318
+
319
+ Visual styles are a ported snapshot of the PWA form kit. When PWA form styles change, update this package and bump `package.json` `version`.
320
+
321
+ ## Versions
322
+
323
+ Day to day, bump **`package.json` `version`** (and set `compatiblePackageVersions` to `^` that version). Push to `main`: npm publishes only if that version is new; S3 always uploads `dist/`. Skipping a package bump **overwrites** the existing `usgb-forms.<version>.js` pin.
324
+
325
+ Patch is enough while nothing is consuming the package. Use minor/major later for compatible vs breaking host API.
326
+
327
+ Everything else is a different object — leave it alone unless that object actually changed:
275
328
 
276
- Semantic tokens (`--usgb-form-surface`, `--usgb-field-*`, `--usgb-button-*`, `--usgb-newsletter-underline`, …) are the first place to retheme. Palette vars (`--usgb-blue-1`, …) are a PWA snapshot. Error and checkbox glyphs are inline SVGs that use `currentColor` — override `--usgb-alert-danger` or `--usgb-checkbox-mark` to recolor them.
329
+ | Field | Bump when |
330
+ | --------------------------------------------- | -------------------------------------------------------------------- |
331
+ | `forms[formId].definitionVersion` | That form’s fields, consent pins, or tracking change |
332
+ | Consent `definitionVersion` in `consents.tsx` | Legal wording changes (new id/version; do not edit in place) |
333
+ | `submissionContract.version` | Submit JSON shape changes (proxies read `submissionContractVersion`) |
334
+ | `schemaVersion` | Manifest JSON keys/shape change (CMS parsers) |
277
335
 
278
- Visual styles are a ported snapshot of the PWA form kit. When PWA form styles change, update this package and bump the version.
336
+ Form and consent rules: [`src/definitions/context.md`](src/definitions/context.md).
279
337
 
280
338
  ## Develop (package maintainers)
281
339
 
@@ -0,0 +1,305 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "package": {
4
+ "name": "@usgb/forms",
5
+ "compatiblePackageVersions": "^1.0.2"
6
+ },
7
+ "submissionContract": {
8
+ "version": "1.0.0",
9
+ "transport": "server-proxy",
10
+ "payloadShape": "data-and-context"
11
+ },
12
+ "trackingRegistry": {
13
+ "page_url": {
14
+ "destination": "form_submission_url",
15
+ "category": "page",
16
+ "collection": "server",
17
+ "required": true,
18
+ "states": ["collected", "unavailable"],
19
+ "description": "Canonical landing-page URL at submission time"
20
+ },
21
+ "page_title": {
22
+ "destination": "pageName",
23
+ "category": "page",
24
+ "collection": "server",
25
+ "required": false,
26
+ "states": ["collected", "unavailable"]
27
+ },
28
+ "referrer": {
29
+ "destination": "referrer",
30
+ "category": "page",
31
+ "collection": "browser",
32
+ "required": false,
33
+ "states": ["collected", "unavailable"]
34
+ },
35
+ "first_touch_url": {
36
+ "destination": "crossDomain_landing_url",
37
+ "category": "attribution",
38
+ "collection": "host-adapter",
39
+ "required": false,
40
+ "states": ["collected", "unavailable"]
41
+ },
42
+ "utm_source": {
43
+ "destination": "utm_source",
44
+ "category": "attribution",
45
+ "collection": "host-adapter",
46
+ "required": false,
47
+ "states": ["collected", "unavailable"]
48
+ },
49
+ "utm_medium": {
50
+ "destination": "utm_medium",
51
+ "category": "attribution",
52
+ "collection": "host-adapter",
53
+ "required": false,
54
+ "states": ["collected", "unavailable"]
55
+ },
56
+ "utm_campaign": {
57
+ "destination": "utm_campaign",
58
+ "category": "attribution",
59
+ "collection": "host-adapter",
60
+ "required": false,
61
+ "states": ["collected", "unavailable"]
62
+ },
63
+ "utm_term": {
64
+ "destination": "utm_term",
65
+ "category": "attribution",
66
+ "collection": "host-adapter",
67
+ "required": false,
68
+ "states": ["collected", "unavailable"]
69
+ },
70
+ "utm_content": {
71
+ "destination": "utm_content",
72
+ "category": "attribution",
73
+ "collection": "host-adapter",
74
+ "required": false,
75
+ "states": ["collected", "unavailable"]
76
+ },
77
+ "gclid": {
78
+ "destination": "gclid",
79
+ "category": "click-id",
80
+ "collection": "host-adapter",
81
+ "required": false,
82
+ "states": ["collected", "unavailable"]
83
+ },
84
+ "msclkid": {
85
+ "destination": "msclkid",
86
+ "category": "click-id",
87
+ "collection": "host-adapter",
88
+ "required": false,
89
+ "states": ["collected", "unavailable"]
90
+ },
91
+ "gbraid": {
92
+ "destination": "gbraid",
93
+ "category": "click-id",
94
+ "collection": "host-adapter",
95
+ "required": false,
96
+ "states": ["collected", "unavailable"]
97
+ },
98
+ "wbraid": {
99
+ "destination": "wbraid",
100
+ "category": "click-id",
101
+ "collection": "host-adapter",
102
+ "required": false,
103
+ "states": ["collected", "unavailable"]
104
+ },
105
+ "hubspot_utk": {
106
+ "destination": "hubspot_utk",
107
+ "category": "identity",
108
+ "collection": "host-adapter",
109
+ "required": false,
110
+ "states": ["collected", "unavailable", "consent-withheld"]
111
+ },
112
+ "ga_client_id": {
113
+ "destination": "ga_client_id",
114
+ "category": "analytics",
115
+ "collection": "host-adapter",
116
+ "required": false,
117
+ "states": ["collected", "unavailable", "consent-withheld"]
118
+ },
119
+ "ga_session_id": {
120
+ "destination": "session_id_start",
121
+ "category": "analytics",
122
+ "collection": "host-adapter",
123
+ "required": false,
124
+ "states": ["collected", "unavailable", "consent-withheld"]
125
+ },
126
+ "snowplow_id": {
127
+ "destination": "snowplow_id",
128
+ "category": "analytics",
129
+ "collection": "host-adapter",
130
+ "required": false,
131
+ "states": ["collected", "unavailable", "consent-withheld"]
132
+ },
133
+ "vwo_uuid": {
134
+ "destination": "vwo_uuid",
135
+ "category": "experiment",
136
+ "collection": "host-adapter",
137
+ "required": false,
138
+ "states": ["collected", "unavailable", "consent-withheld"]
139
+ },
140
+ "user_agent": {
141
+ "destination": "header_http_client_details",
142
+ "category": "technical",
143
+ "collection": "server",
144
+ "required": false,
145
+ "states": ["collected", "unavailable"]
146
+ },
147
+ "ip_address": {
148
+ "destination": "ipAddress",
149
+ "category": "technical",
150
+ "collection": "server",
151
+ "required": false,
152
+ "states": ["collected", "unavailable"]
153
+ }
154
+ },
155
+ "forms": {
156
+ "main-investors-kit": {
157
+ "definitionVersion": "1",
158
+ "kind": "lead",
159
+ "flow": { "type": "single" },
160
+ "supportedHosts": ["pwa", "wordpress"],
161
+ "fields": [
162
+ { "name": "firstname", "required": true, "group": "name" },
163
+ { "name": "lastname", "required": true, "group": "name" },
164
+ { "name": "email", "required": true },
165
+ { "name": "phone", "required": false }
166
+ ],
167
+ "trackingFields": [
168
+ "page_url",
169
+ "page_title",
170
+ "referrer",
171
+ "first_touch_url",
172
+ "utm_source",
173
+ "utm_medium",
174
+ "utm_campaign",
175
+ "utm_term",
176
+ "utm_content",
177
+ "gclid",
178
+ "msclkid",
179
+ "gbraid",
180
+ "wbraid",
181
+ "hubspot_utk",
182
+ "ga_client_id",
183
+ "ga_session_id",
184
+ "snowplow_id",
185
+ "vwo_uuid",
186
+ "user_agent",
187
+ "ip_address"
188
+ ],
189
+ "ctaLabel": "GET MY FREE GUIDE",
190
+ "consents": [
191
+ {
192
+ "definitionId": "lead-tcpa",
193
+ "definitionVersion": "1",
194
+ "required": false
195
+ },
196
+ {
197
+ "definitionId": "lead-sms",
198
+ "definitionVersion": "1",
199
+ "required": false
200
+ },
201
+ {
202
+ "definitionId": "lead-tospp",
203
+ "definitionVersion": "1",
204
+ "required": false
205
+ }
206
+ ],
207
+ "editor": {
208
+ "label": "Main Investors Kit",
209
+ "description": "Standard lead form: name, email, phone, plus optional TCPA, marketing SMS, and terms/privacy checkboxes. Use on full-width landing pages and PWA kit/sidebar placements.",
210
+ "whenToUse": "Default kit request with optional consent checkboxes. Do not use for affiliate landers or IRA-specific leads.",
211
+ "whenNotToUse": "Affiliate pages (separate definition). IRA kit (separate definition when added). Clickwrap-only kit (`main-investors-kit-notice`).",
212
+ "supportedAppearances": ["on-light", "on-dark"],
213
+ "supportedVariants": ["dense", "large", "sidebar", "two-column"]
214
+ }
215
+ },
216
+ "main-investors-kit-notice": {
217
+ "definitionVersion": "1",
218
+ "kind": "lead",
219
+ "flow": { "type": "single" },
220
+ "supportedHosts": ["pwa", "wordpress"],
221
+ "fields": [
222
+ { "name": "firstname", "required": true, "group": "name" },
223
+ { "name": "lastname", "required": true, "group": "name" },
224
+ { "name": "email", "required": true },
225
+ { "name": "phone", "required": false }
226
+ ],
227
+ "trackingFields": [
228
+ "page_url",
229
+ "page_title",
230
+ "referrer",
231
+ "first_touch_url",
232
+ "utm_source",
233
+ "utm_medium",
234
+ "utm_campaign",
235
+ "utm_term",
236
+ "utm_content",
237
+ "gclid",
238
+ "msclkid",
239
+ "gbraid",
240
+ "wbraid",
241
+ "hubspot_utk",
242
+ "ga_client_id",
243
+ "ga_session_id",
244
+ "snowplow_id",
245
+ "vwo_uuid",
246
+ "user_agent",
247
+ "ip_address"
248
+ ],
249
+ "ctaLabel": "GET MY FREE GUIDE",
250
+ "consents": [
251
+ { "definitionId": "lead-clickwrap", "definitionVersion": "1" }
252
+ ],
253
+ "editor": {
254
+ "label": "Main Investors Kit (clickwrap)",
255
+ "description": "Same fields as Main Investors Kit with a clickwrap notice only — no consent checkboxes.",
256
+ "whenToUse": "Kit request where submit acknowledges legal docs via notice copy instead of checkboxes.",
257
+ "whenNotToUse": "Placements that need TCPA / marketing SMS / terms checkboxes (`main-investors-kit`).",
258
+ "supportedAppearances": ["on-light", "on-dark"],
259
+ "supportedVariants": ["dense", "large", "sidebar", "two-column"]
260
+ }
261
+ },
262
+ "newsletter": {
263
+ "definitionVersion": "1",
264
+ "kind": "newsletter",
265
+ "flow": { "type": "single" },
266
+ "supportedHosts": ["pwa"],
267
+ "fields": [{ "name": "email", "required": true }],
268
+ "trackingFields": [
269
+ "page_url",
270
+ "page_title",
271
+ "referrer",
272
+ "utm_source",
273
+ "utm_medium",
274
+ "utm_campaign",
275
+ "utm_term",
276
+ "utm_content"
277
+ ],
278
+ "ctaLabel": "SUBSCRIBE",
279
+ "editor": {
280
+ "label": "Newsletter",
281
+ "description": "Email-only newsletter signup. No TCPA consent.",
282
+ "whenToUse": "Footer or landing newsletter capture where only an email is required.",
283
+ "whenNotToUse": "Lead kits that need name, phone, or TCPA consent.",
284
+ "supportedAppearances": ["on-light", "on-dark"],
285
+ "supportedVariants": []
286
+ }
287
+ }
288
+ },
289
+ "hostAdapterContract": {
290
+ "hosts": ["pwa", "wordpress"],
291
+ "mayProvide": [
292
+ "browser cookies",
293
+ "URL parameters",
294
+ "page and placement context",
295
+ "host/store identity"
296
+ ],
297
+ "mustNotDefine": [
298
+ "new tracking keys",
299
+ "destination property names",
300
+ "consent definitions",
301
+ "form fields",
302
+ "submission endpoints"
303
+ ]
304
+ }
305
+ }