@usgb/forms 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +128 -142
  2. package/dist/forms-manifest.1.0.3.json +439 -0
  3. package/dist/forms-manifest.json +218 -84
  4. package/dist/index.js +642 -582
  5. package/dist/src/contract/createIdempotencyKey.d.ts +2 -0
  6. package/dist/src/contract/createIdempotencyKey.d.ts.map +1 -0
  7. package/dist/src/contract/createStubAdapter.d.ts.map +1 -1
  8. package/dist/src/contract/types.d.ts +15 -15
  9. package/dist/src/contract/types.d.ts.map +1 -1
  10. package/dist/src/definitions/consents.d.ts +10 -0
  11. package/dist/src/definitions/consents.d.ts.map +1 -1
  12. package/dist/src/definitions/index.d.ts +4 -3
  13. package/dist/src/definitions/index.d.ts.map +1 -1
  14. package/dist/src/definitions/manifest.d.ts +14 -1
  15. package/dist/src/definitions/manifest.d.ts.map +1 -1
  16. package/dist/src/definitions/types.d.ts +35 -5
  17. package/dist/src/definitions/types.d.ts.map +1 -1
  18. package/dist/src/form/FormShell.d.ts +2 -1
  19. package/dist/src/form/FormShell.d.ts.map +1 -1
  20. package/dist/src/form/UsgbForm.d.ts +5 -4
  21. package/dist/src/form/UsgbForm.d.ts.map +1 -1
  22. package/dist/src/form/chunkFields.d.ts +1 -1
  23. package/dist/src/form/kinds/LeadKindForm.d.ts +1 -1
  24. package/dist/src/form/kinds/LeadKindForm.d.ts.map +1 -1
  25. package/dist/src/form/kinds/NewsletterKindForm.d.ts +1 -1
  26. package/dist/src/form/kinds/NewsletterKindForm.d.ts.map +1 -1
  27. package/dist/src/form/kinds/types.d.ts +3 -1
  28. package/dist/src/form/kinds/types.d.ts.map +1 -1
  29. package/dist/src/form/useUsgbFormSession.d.ts +3 -4
  30. package/dist/src/form/useUsgbFormSession.d.ts.map +1 -1
  31. package/dist/src/index.d.ts +5 -5
  32. package/dist/src/index.d.ts.map +1 -1
  33. package/dist/src/ui/Button.d.ts.map +1 -1
  34. package/dist/src/ui/ConsentField.d.ts.map +1 -1
  35. package/dist/usgb-forms.1.0.3.js +44 -0
  36. package/dist/usgb-forms.css +98 -15
  37. package/dist/usgb-forms.js +11 -11
  38. package/forms-manifest.json +218 -84
  39. package/package.json +1 -1
  40. package/dist/forms-manifest.1.0.2.json +0 -305
  41. package/dist/src/contract/collectContext.d.ts +0 -9
  42. package/dist/src/contract/collectContext.d.ts.map +0 -1
  43. package/dist/usgb-forms.1.0.2.js +0 -44
@@ -0,0 +1,439 @@
1
+ {
2
+ "schemaVersion": "1.1.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
+ },
11
+ "trackingRegistry": {
12
+ "page_url": {
13
+ "destination": "form_submission_url",
14
+ "category": "page",
15
+ "collection": "server",
16
+ "required": true,
17
+ "states": ["collected", "unavailable"],
18
+ "description": "Canonical landing-page URL at submission time"
19
+ },
20
+ "page_title": {
21
+ "destination": "pageName",
22
+ "category": "page",
23
+ "collection": "server",
24
+ "required": false,
25
+ "states": ["collected", "unavailable"]
26
+ },
27
+ "referrer": {
28
+ "destination": "referrer",
29
+ "category": "page",
30
+ "collection": "browser",
31
+ "required": false,
32
+ "states": ["collected", "unavailable"]
33
+ },
34
+ "first_touch_url": {
35
+ "destination": "crossDomain_landing_url",
36
+ "category": "attribution",
37
+ "collection": "host-adapter",
38
+ "required": false,
39
+ "states": ["collected", "unavailable"]
40
+ },
41
+ "utm_source": {
42
+ "destination": "utm_source",
43
+ "category": "attribution",
44
+ "collection": "host-adapter",
45
+ "required": false,
46
+ "states": ["collected", "unavailable"]
47
+ },
48
+ "utm_medium": {
49
+ "destination": "utm_medium",
50
+ "category": "attribution",
51
+ "collection": "host-adapter",
52
+ "required": false,
53
+ "states": ["collected", "unavailable"]
54
+ },
55
+ "utm_campaign": {
56
+ "destination": "utm_campaign",
57
+ "category": "attribution",
58
+ "collection": "host-adapter",
59
+ "required": false,
60
+ "states": ["collected", "unavailable"]
61
+ },
62
+ "utm_term": {
63
+ "destination": "utm_term",
64
+ "category": "attribution",
65
+ "collection": "host-adapter",
66
+ "required": false,
67
+ "states": ["collected", "unavailable"]
68
+ },
69
+ "utm_content": {
70
+ "destination": "utm_content",
71
+ "category": "attribution",
72
+ "collection": "host-adapter",
73
+ "required": false,
74
+ "states": ["collected", "unavailable"]
75
+ },
76
+ "gclid": {
77
+ "destination": "gclid",
78
+ "category": "click-id",
79
+ "collection": "host-adapter",
80
+ "required": false,
81
+ "states": ["collected", "unavailable"]
82
+ },
83
+ "msclkid": {
84
+ "destination": "msclkid",
85
+ "category": "click-id",
86
+ "collection": "host-adapter",
87
+ "required": false,
88
+ "states": ["collected", "unavailable"]
89
+ },
90
+ "gbraid": {
91
+ "destination": "gbraid",
92
+ "category": "click-id",
93
+ "collection": "host-adapter",
94
+ "required": false,
95
+ "states": ["collected", "unavailable"]
96
+ },
97
+ "wbraid": {
98
+ "destination": "wbraid",
99
+ "category": "click-id",
100
+ "collection": "host-adapter",
101
+ "required": false,
102
+ "states": ["collected", "unavailable"]
103
+ },
104
+ "hubspot_utk": {
105
+ "destination": "hubspot_utk",
106
+ "category": "identity",
107
+ "collection": "host-adapter",
108
+ "required": false,
109
+ "states": ["collected", "unavailable", "consent-withheld"]
110
+ },
111
+ "ga_client_id": {
112
+ "destination": "ga_client_id",
113
+ "category": "analytics",
114
+ "collection": "host-adapter",
115
+ "required": false,
116
+ "states": ["collected", "unavailable", "consent-withheld"]
117
+ },
118
+ "ga_session_id": {
119
+ "destination": "session_id_start",
120
+ "category": "analytics",
121
+ "collection": "host-adapter",
122
+ "required": false,
123
+ "states": ["collected", "unavailable", "consent-withheld"]
124
+ },
125
+ "snowplow_id": {
126
+ "destination": "snowplow_id",
127
+ "category": "analytics",
128
+ "collection": "host-adapter",
129
+ "required": false,
130
+ "states": ["collected", "unavailable", "consent-withheld"]
131
+ },
132
+ "vwo_uuid": {
133
+ "destination": "vwo_uuid",
134
+ "category": "experiment",
135
+ "collection": "host-adapter",
136
+ "required": false,
137
+ "states": ["collected", "unavailable", "consent-withheld"]
138
+ },
139
+ "user_agent": {
140
+ "destination": "header_http_client_details",
141
+ "category": "technical",
142
+ "collection": "server",
143
+ "required": false,
144
+ "states": ["collected", "unavailable"]
145
+ },
146
+ "ip_address": {
147
+ "destination": "ipAddress",
148
+ "category": "technical",
149
+ "collection": "server",
150
+ "required": false,
151
+ "states": ["collected", "unavailable"]
152
+ }
153
+ },
154
+ "editorOptions": {
155
+ "appearance": {
156
+ "label": "Appearance",
157
+ "control": "select",
158
+ "reactProp": "appearance",
159
+ "attribute": "appearance",
160
+ "required": false,
161
+ "default": "on-light",
162
+ "valuesFrom": "supportedAppearances",
163
+ "description": "Recolors the form for a light or dark host surface. It never paints a background, padding, or radius — the host container owns those."
164
+ },
165
+ "variant": {
166
+ "label": "Size variant",
167
+ "control": "select",
168
+ "reactProp": "variant",
169
+ "attribute": "variant",
170
+ "required": false,
171
+ "default": "dense",
172
+ "valuesFrom": "supportedVariants",
173
+ "description": "Select exactly one size treatment: `dense`, `large`, or `sidebar`."
174
+ },
175
+ "twoColumn": {
176
+ "label": "Two-column name row",
177
+ "control": "checkbox",
178
+ "reactProp": "twoColumn",
179
+ "attribute": "two-column",
180
+ "required": false,
181
+ "default": false,
182
+ "description": "Places grouped name fields in two columns when the form container is wide enough."
183
+ },
184
+ "heading": {
185
+ "label": "Heading",
186
+ "control": "text",
187
+ "reactProp": "heading",
188
+ "attribute": "heading",
189
+ "required": false,
190
+ "description": "Placement copy above the fields. Omit to render no heading."
191
+ },
192
+ "subheading": {
193
+ "label": "Subheading",
194
+ "control": "text",
195
+ "reactProp": "subheading",
196
+ "attribute": "subheading",
197
+ "required": false,
198
+ "description": "Supporting copy under the heading. Omit to render none."
199
+ },
200
+ "ctaLabel": {
201
+ "label": "Button label",
202
+ "control": "text",
203
+ "reactProp": "ctaLabel",
204
+ "attribute": "cta",
205
+ "required": false,
206
+ "defaultFrom": "ctaLabel",
207
+ "description": "Overrides the catalog submit label for this placement."
208
+ },
209
+ "legalUrls": {
210
+ "label": "Legal document URLs",
211
+ "control": "url-group",
212
+ "reactProp": "legalUrls",
213
+ "attributes": {
214
+ "clientAgreement": "client-agreement-url",
215
+ "privacyPolicy": "privacy-policy-url",
216
+ "userAgreement": "user-agreement-url",
217
+ "marketLossPolicy": "market-loss-policy-url",
218
+ "electronicDisclaimer": "electronic-disclaimer-url",
219
+ "termsOfSale": "terms-of-sale-url"
220
+ },
221
+ "required": true,
222
+ "valuesFrom": "requiredLegalUrls",
223
+ "description": "Host CMS hrefs for the documents named in this form's consent copy. Every key in `requiredLegalUrls` must be a non-empty URL or the form does not render."
224
+ },
225
+ "successMessage": {
226
+ "label": "Thank-you message",
227
+ "control": "text",
228
+ "reactProp": "successMessage",
229
+ "attribute": "success-message",
230
+ "required": false,
231
+ "description": "Inline copy shown after accept. Ignored when a thank-you URL is set; omitted values fall back to a package default line."
232
+ },
233
+ "successUrl": {
234
+ "label": "Thank-you URL",
235
+ "control": "url",
236
+ "reactProp": "successUrl",
237
+ "attribute": "success-url",
238
+ "required": false,
239
+ "description": "Redirect after accept. A full navigation can cut off analytics beacons — prefer measuring the conversion on the thank-you page."
240
+ }
241
+ },
242
+ "forms": {
243
+ "magento-fik": {
244
+ "definitionVersion": "1",
245
+ "kind": "lead",
246
+ "flow": { "type": "single" },
247
+ "fields": [
248
+ { "name": "firstname", "required": true, "group": "name" },
249
+ { "name": "lastname", "required": true, "group": "name" },
250
+ { "name": "email", "required": true },
251
+ { "name": "phone", "required": false }
252
+ ],
253
+ "ctaLabel": "GET MY FREE GUIDE",
254
+ "consents": [
255
+ {
256
+ "definitionId": "lead-tcpa",
257
+ "definitionVersion": "1",
258
+ "required": false
259
+ },
260
+ {
261
+ "definitionId": "lead-sms",
262
+ "definitionVersion": "1",
263
+ "required": false
264
+ },
265
+ {
266
+ "definitionId": "lead-tospp",
267
+ "definitionVersion": "1",
268
+ "required": false
269
+ }
270
+ ],
271
+ "editor": {
272
+ "label": "Magento FIK",
273
+ "description": "First name, last name, and email required; phone optional. Optional checkboxes: transactional SMS (lead-tcpa v1), marketing SMS (lead-sms v1), and terms and privacy (lead-tospp v1).",
274
+ "whenToUse": "TBD",
275
+ "whenNotToUse": "TBD",
276
+ "options": [
277
+ "appearance",
278
+ "variant",
279
+ "twoColumn",
280
+ "heading",
281
+ "subheading",
282
+ "ctaLabel",
283
+ "legalUrls",
284
+ "successMessage",
285
+ "successUrl"
286
+ ],
287
+ "supportedAppearances": ["on-light", "on-dark"],
288
+ "supportedVariants": ["dense", "large", "sidebar"],
289
+ "requiredLegalUrls": ["userAgreement", "privacyPolicy"]
290
+ }
291
+ },
292
+ "magento-ira-kick-article": {
293
+ "definitionVersion": "1",
294
+ "kind": "lead",
295
+ "flow": { "type": "single" },
296
+ "fields": [
297
+ { "name": "firstname", "required": true, "group": "name" },
298
+ { "name": "lastname", "required": true, "group": "name" },
299
+ { "name": "email", "required": true },
300
+ { "name": "phone", "required": true }
301
+ ],
302
+ "ctaLabel": "GET MY FREE GUIDE",
303
+ "consents": [
304
+ {
305
+ "definitionId": "lead-tcpa",
306
+ "definitionVersion": "2",
307
+ "required": false
308
+ }
309
+ ],
310
+ "editor": {
311
+ "label": "Magento IRA Kick Article",
312
+ "description": "First name, last name, email, and phone required. Optional telephone and SMS consent checkbox with linked terms and privacy (lead-tcpa v2).",
313
+ "whenToUse": "TBD",
314
+ "whenNotToUse": "TBD",
315
+ "options": [
316
+ "appearance",
317
+ "variant",
318
+ "twoColumn",
319
+ "heading",
320
+ "subheading",
321
+ "ctaLabel",
322
+ "legalUrls",
323
+ "successMessage",
324
+ "successUrl"
325
+ ],
326
+ "supportedAppearances": ["on-light", "on-dark"],
327
+ "supportedVariants": ["dense", "large", "sidebar"],
328
+ "requiredLegalUrls": ["userAgreement", "privacyPolicy"]
329
+ }
330
+ },
331
+ "magento-fik-blog-rail": {
332
+ "definitionVersion": "1",
333
+ "kind": "lead",
334
+ "flow": { "type": "single" },
335
+ "fields": [
336
+ { "name": "firstname", "required": true, "group": "name" },
337
+ { "name": "lastname", "required": true, "group": "name" },
338
+ { "name": "email", "required": true },
339
+ { "name": "phone", "required": true }
340
+ ],
341
+ "ctaLabel": "GET MY FREE GUIDE",
342
+ "consents": [
343
+ {
344
+ "definitionId": "lead-tcpa",
345
+ "definitionVersion": "2",
346
+ "required": false
347
+ }
348
+ ],
349
+ "editor": {
350
+ "label": "Magento FIK Blog Rail",
351
+ "description": "First name, last name, email, and phone required. Optional telephone and SMS consent checkbox with linked terms and privacy (lead-tcpa v2).",
352
+ "whenToUse": "TBD",
353
+ "whenNotToUse": "TBD",
354
+ "options": [
355
+ "appearance",
356
+ "variant",
357
+ "twoColumn",
358
+ "heading",
359
+ "subheading",
360
+ "ctaLabel",
361
+ "legalUrls",
362
+ "successMessage",
363
+ "successUrl"
364
+ ],
365
+ "supportedAppearances": ["on-light", "on-dark"],
366
+ "supportedVariants": ["dense", "large", "sidebar"],
367
+ "requiredLegalUrls": ["userAgreement", "privacyPolicy"]
368
+ }
369
+ },
370
+ "main-investors-kit-notice": {
371
+ "definitionVersion": "1",
372
+ "kind": "lead",
373
+ "flow": { "type": "single" },
374
+ "fields": [
375
+ { "name": "firstname", "required": true, "group": "name" },
376
+ { "name": "lastname", "required": true, "group": "name" },
377
+ { "name": "email", "required": true },
378
+ { "name": "phone", "required": false }
379
+ ],
380
+ "ctaLabel": "CLAIM YOUR OFFER",
381
+ "consents": [
382
+ { "definitionId": "lead-clickwrap", "definitionVersion": "2" }
383
+ ],
384
+ "editor": {
385
+ "label": "Main Investors Kit (clickwrap)",
386
+ "description": "First name, last name, and email required; phone optional. Clickwrap notice only (lead-clickwrap v2); no consent checkboxes.",
387
+ "whenToUse": "TBD",
388
+ "whenNotToUse": "TBD",
389
+ "options": [
390
+ "appearance",
391
+ "variant",
392
+ "twoColumn",
393
+ "heading",
394
+ "subheading",
395
+ "ctaLabel",
396
+ "legalUrls",
397
+ "successMessage",
398
+ "successUrl"
399
+ ],
400
+ "supportedAppearances": ["on-light", "on-dark"],
401
+ "supportedVariants": ["dense", "large", "sidebar"],
402
+ "requiredLegalUrls": ["privacyPolicy", "userAgreement"]
403
+ }
404
+ },
405
+ "newsletter": {
406
+ "definitionVersion": "1",
407
+ "kind": "newsletter",
408
+ "flow": { "type": "single" },
409
+ "fields": [{ "name": "email", "required": true }],
410
+ "ctaLabel": "SUBSCRIBE",
411
+ "editor": {
412
+ "label": "Newsletter",
413
+ "description": "Email only. No consent.",
414
+ "whenToUse": "TBD",
415
+ "whenNotToUse": "TBD",
416
+ "options": [
417
+ "appearance",
418
+ "heading",
419
+ "subheading",
420
+ "ctaLabel",
421
+ "successMessage",
422
+ "successUrl"
423
+ ],
424
+ "supportedAppearances": ["on-light", "on-dark"],
425
+ "supportedVariants": [],
426
+ "requiredLegalUrls": []
427
+ }
428
+ }
429
+ },
430
+ "hostAdapterContract": {
431
+ "hosts": ["pwa", "wordpress"],
432
+ "mayProvide": ["legal document URLs", "host/store identity"],
433
+ "mustNotDefine": [
434
+ "consent definitions",
435
+ "form fields",
436
+ "submission endpoints"
437
+ ]
438
+ }
439
+ }