@ebitex/forms-sdk 1.0.241 → 1.1.284

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 (42) hide show
  1. package/README.md +59 -0
  2. package/dist/client.d.ts +14 -0
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +15 -0
  5. package/dist/client.js.map +1 -1
  6. package/dist/index.d.ts +2 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +2 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/labels.d.ts +48 -0
  11. package/dist/labels.d.ts.map +1 -0
  12. package/dist/labels.js +27 -0
  13. package/dist/labels.js.map +1 -0
  14. package/dist/react/EbitexForm.d.ts +14 -1
  15. package/dist/react/EbitexForm.d.ts.map +1 -1
  16. package/dist/react/EbitexForm.js +62 -10
  17. package/dist/react/EbitexForm.js.map +1 -1
  18. package/dist/react/LookupField.d.ts +1 -1
  19. package/dist/react/LookupField.d.ts.map +1 -1
  20. package/dist/react/LookupField.js +6 -4
  21. package/dist/react/LookupField.js.map +1 -1
  22. package/dist/react/NodeList.d.ts +6 -2
  23. package/dist/react/NodeList.d.ts.map +1 -1
  24. package/dist/react/NodeList.js +8 -6
  25. package/dist/react/NodeList.js.map +1 -1
  26. package/dist/react/fields.d.ts +3 -0
  27. package/dist/react/fields.d.ts.map +1 -1
  28. package/dist/react/fields.js +11 -5
  29. package/dist/react/fields.js.map +1 -1
  30. package/dist/react/index.d.ts +2 -0
  31. package/dist/react/index.d.ts.map +1 -1
  32. package/dist/react/index.js +2 -0
  33. package/dist/react/index.js.map +1 -1
  34. package/dist/react/inputAttributes.d.ts +22 -0
  35. package/dist/react/inputAttributes.d.ts.map +1 -0
  36. package/dist/react/inputAttributes.js +58 -0
  37. package/dist/react/inputAttributes.js.map +1 -0
  38. package/dist/react/styles.css +66 -0
  39. package/dist/types.d.ts +15 -0
  40. package/dist/types.d.ts.map +1 -1
  41. package/dist/types.js.map +1 -1
  42. package/package.json +1 -1
package/README.md CHANGED
@@ -50,6 +50,63 @@ Multi-step forms save progress as the respondent advances.
50
50
  `500`'s body (`null` when a proxy answered and the request never reached ebitex). The message ends
51
51
  `[request <id>]` when there is one. Log it, and quote it to support.
52
52
 
53
+ ## Accessibility, errors and your own wording
54
+
55
+ `<EbitexForm>` looks after what happens around an error, so a keyboard or screen-reader visitor is never left
56
+ wondering why nothing happened.
57
+
58
+ - **Focus goes to the first problem.** After a step or a submit fails validation, focus moves to the first
59
+ field that needs fixing, so its label and its error are read out. Server-side `validation_failed` errors
60
+ behave the same way. Pass `focusOnError={false}` if your page manages focus itself.
61
+ - **An error summary for two or more.** When more than one field on the step needs fixing, a summary above the
62
+ step says how many and lists each as a link that focuses it. With one, focus on the field is enough.
63
+ - **A visible message when sending fails.** A network failure or a server error shows "Your answers could not be
64
+ sent. Check your connection and try again." and keeps what was entered. `onError` is still called. Pass
65
+ `showErrorMessage={false}` if you render your own from `onError`.
66
+ - **Steps.** Progress is a `progressbar` with its value, range and text ("Step 2 of 3: Your details"), and that
67
+ text takes focus when the step changes.
68
+ - **Keypads and autofill.** Email, phone and URL fields set `autocomplete` and `inputMode`, and a number field
69
+ sets `inputMode` (`numeric`, or `decimal` when it takes fractions). A field definition may carry an
70
+ `autocompletePurpose` to say what a plain text field holds (`given-name`, `family-name`, `organization`,
71
+ `postal-code`, and the other [HTML autofill tokens](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill)
72
+ for names and addresses), or `off` to turn autofill off. A value that is not an autofill token is ignored.
73
+
74
+ Nothing in the form animates except the lookup spinner, and that stops under `prefers-reduced-motion`.
75
+
76
+ ### Your own wording
77
+
78
+ Every string the package writes itself can be replaced with the `labels` prop. Anything you leave out stays
79
+ English. A value may use `{n}`, `{total}`, `{count}`, `{status}` or `{text}` where the table says so.
80
+
81
+ ```tsx
82
+ <EbitexForm
83
+ form={form}
84
+ labels={{
85
+ back: 'Retour',
86
+ next: 'Suivant',
87
+ required: 'Ce champ est obligatoire.',
88
+ errorSummary: 'Veuillez corriger {count} champs',
89
+ stepIndicator: 'Étape {n} sur {total}',
90
+ }}
91
+ />
92
+ ```
93
+
94
+ | Label | Default | Where |
95
+ |---|---|---|
96
+ | `back`, `next`, `submit` | Back, Next, Submit | The step buttons. `submit` is used only when the form defines no button of its own. |
97
+ | `complete` | Thanks — your response has been submitted. | Replaces the form after a successful submission. |
98
+ | `required` | This field is required. | Under a required field left empty. |
99
+ | `requiredHint` | (required) | Read aloud after a required group's label. |
100
+ | `select` | Select… | The empty first option of a drop-down. |
101
+ | `errorSummary` | Please fix {count} fields | The summary heading. |
102
+ | `failure` | Your answers could not be sent. Check your connection and try again. | When sending fails. |
103
+ | `progress`, `stepIndicator` | Form progress, Step {n} of {total} | The progress indicator. |
104
+ | `preview` | This form is {status} and isn't accepting responses yet. It's shown here for preview only. | Above a form that is not live. |
105
+ | `lookupUnavailable`, `lookupFound`, `lookupNew`, `lookupUseNew` | | The type-ahead field. |
106
+
107
+ The form's own field labels, option labels and button labels come from the form, and the server's error
108
+ messages are the server's. The type is exported as `FormsLabels` from both entry points.
109
+
53
110
  ## Theming
54
111
 
55
112
  `styles.css` is one custom property per concern, targeting `.ebitex-forms`:
@@ -80,6 +137,8 @@ convention [`@ebitex/theme-core`](../theme-core) uses, and what ebitex's own hos
80
137
  embed run on). Add `data-ebitex-theme="light"` to `.ebitex-forms` (or an ancestor) to opt out of both
81
138
  and force light regardless of OS preference or a `.dark` class above it.
82
139
 
140
+ In dark mode the default accent is lighter, so the text on it (`--ebitex-forms-accent-contrast`) is near-black rather than white, which keeps the button label above the 4.5:1 AA ratio. If you set your own accent, set the contrast colour that suits it too.
141
+
83
142
  If you set your own `--ebitex-forms-accent`/`--ebitex-forms-surface`/etc. and want a distinct dark
84
143
  variant rather than the same value in both modes, set it again under your own `.dark` (or
85
144
  `prefers-color-scheme: dark`) rule — the shipped dark values only apply to whichever properties
package/dist/client.d.ts CHANGED
@@ -13,7 +13,16 @@ export interface FormsClientOptions {
13
13
  baseUrl?: string;
14
14
  /** Injectable for testing or for a runtime with a non-global fetch. */
15
15
  fetch?: typeof globalThis.fetch;
16
+ /**
17
+ * Called when the mode the API reports for this organization changes: `development` or `cutover` while it is a sandbox an agency is building for a client, `null` once it is an
18
+ * ordinary organization. Read off any response, including a refusal.
19
+ */
20
+ onSandbox?: (mode: SandboxMode | null) => void;
16
21
  }
22
+ /** The mode a sandbox organization is in. `development` is the build; `cutover` is the short window to test against the real domain. */
23
+ export type SandboxMode = 'development' | 'cutover';
24
+ /** The response header that names the mode. Absent for an ordinary organization and for a sandbox that has gone live. */
25
+ export declare const SANDBOX_HEADER = "X-Ebitex-Sandbox";
17
26
  /**
18
27
  * A non-2xx response from the Forms API. `status` and `body` are exposed so callers can branch on
19
28
  * the specific failure rather than parsing a message: 401 (bad or revoked key), 402 (the
@@ -34,6 +43,11 @@ export declare class FormsApiError extends Error {
34
43
  }
35
44
  export interface FormsClient {
36
45
  getForm(externalId: string): Promise<SdkForm>;
46
+ /**
47
+ * The sandbox mode the most recent response reported, or `null`. A sandbox organization's forms are real but its mail and webhooks reach only its own team, so a page that embeds one
48
+ * can say so. Reflects the last response this client read, so it is `null` until the first call.
49
+ */
50
+ readonly sandbox: SandboxMode | null;
37
51
  }
38
52
  export declare function createFormsClient(options: FormsClientOptions): FormsClient;
39
53
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,MAAM,WAAW,kBAAkB;IACjC;;;;;;;OAOG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,uEAAuE;IACvE,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;CAChC;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,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MAAM,GAAG,IAAW;CAO3E;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE7C;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;CACrC;AAID,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW,CAwC1E"}
package/dist/client.js CHANGED
@@ -1,3 +1,9 @@
1
+ /** The response header that names the mode. Absent for an ordinary organization and for a sandbox that has gone live. */
2
+ export const SANDBOX_HEADER = 'X-Ebitex-Sandbox';
3
+ function readSandboxMode(response) {
4
+ const value = response.headers.get(SANDBOX_HEADER);
5
+ return value === 'development' || value === 'cutover' ? value : null;
6
+ }
1
7
  /**
2
8
  * A non-2xx response from the Forms API. `status` and `body` are exposed so callers can branch on
3
9
  * the specific failure rather than parsing a message: 401 (bad or revoked key), 402 (the
@@ -30,7 +36,11 @@ export function createFormsClient(options) {
30
36
  }
31
37
  const baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, '');
32
38
  const doFetch = options.fetch ?? globalThis.fetch;
39
+ let sandbox = null;
33
40
  return {
41
+ get sandbox() {
42
+ return sandbox;
43
+ },
34
44
  async getForm(externalId) {
35
45
  const response = await doFetch(`${baseUrl}/forms/v1/sdk/forms/${encodeURIComponent(externalId)}`, {
36
46
  headers: {
@@ -38,6 +48,11 @@ export function createFormsClient(options) {
38
48
  Accept: 'application/json',
39
49
  },
40
50
  });
51
+ const mode = readSandboxMode(response);
52
+ if (mode !== sandbox) {
53
+ sandbox = mode;
54
+ options.onSandbox?.(mode);
55
+ }
41
56
  if (!response.ok) {
42
57
  const body = await readBody(response);
43
58
  throw new FormsApiError(response.status, body, readRequestId(response, body));
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;;GAWG;AACH,MAAM,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AC;IAED,OAAO,IAAI,CAAA;AACb,CAAC"}
package/dist/index.d.ts CHANGED
@@ -8,13 +8,14 @@
8
8
  * never receive one. Expressing the boundary in the import graph makes a mistake visible in review.
9
9
  */
10
10
  export type { Attribution } from './attribution.js';
11
- export { createFormsClient, FormsApiError, type FormsClient, type FormsClientOptions, } from './client.js';
11
+ export { createFormsClient, FormsApiError, type FormsClient, type FormsClientOptions, type SandboxMode, SANDBOX_HEADER, } from './client.js';
12
12
  export { validateSubmission, type ValidateOptions } from './validators.js';
13
13
  export { isAllOfSatisfied, isFieldComparisonSatisfied, isSatisfied } from './predicates.js';
14
14
  export { deriveDarkVariant } from './theme.js';
15
15
  export { adjacentVisibleStepSlot, collectDataFields, defaultChoiceValues, isDataField, collectSubmissionKeys, isFormField, resolveSteps, resolveVariant, resolveVisibleStepSlot, } from './nodes.js';
16
16
  export { type AllOfPredicate, type ButtonField, type ButtonType, type ChoiceField, type ChoiceOption, type ChoiceType, type ConsentMessages, type ConsentOptions, type ConsentState, type FieldComparisonOperator, type FieldComparisonPredicate, type FieldsetNode, type FormField, type FormNode, type FormStep, type InputField, type InputVariant, type LookupSource, type NumberField, type RowNode, type SdkForm, type SubmissionData, type TextareaField, type ValidationErrors, type VariantBranch, type VariantNode, type VariantPredicate, type VisitorStorage, } from './types.js';
17
17
  export { LOOKUP_COMPANION_SUFFIX, MAX_LOOKUP_VALUE_LENGTH } from './types.js';
18
+ export { DEFAULT_FORMS_LABELS, fillLabel, resolveLabels, type FormsLabels } from './labels.js';
18
19
  export { createPublicLookupSource, lookupUrlFromSubmissionUrl } from './lookup.js';
19
20
  export { createVisitorSession, forgetUrlFromSubmissionUrl, type VisitorSession, type VisitorSessionOptions, } from './visitor.js';
20
21
  export { sharedVisitorSession, type SharedVisitors } from './shared.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EAAE,WAAW,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AgB,EACrB,KAAK,cAAc,GACpB,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAE7E,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9F,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAElF,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,KAAK,cAAc,EACnB,KAAK,qBAAqB,GAC3B,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAA"}
package/dist/index.js CHANGED
@@ -7,13 +7,14 @@
7
7
  * must only ever run server-side, while the components render in a respondent's browser and must
8
8
  * never receive one. Expressing the boundary in the import graph makes a mistake visible in review.
9
9
  */
10
- export { createFormsClient, FormsApiError, } from './client.js';
10
+ export { createFormsClient, FormsApiError, SANDBOX_HEADER, } from './client.js';
11
11
  export { validateSubmission } from './validators.js';
12
12
  export { isAllOfSatisfied, isFieldComparisonSatisfied, isSatisfied } from './predicates.js';
13
13
  export { deriveDarkVariant } from './theme.js';
14
14
  export { adjacentVisibleStepSlot, collectDataFields, defaultChoiceValues, isDataField, collectSubmissionKeys, isFormField, resolveSteps, resolveVariant, resolveVisibleStepSlot, } from './nodes.js';
15
15
  export {} from './types.js';
16
16
  export { LOOKUP_COMPANION_SUFFIX, MAX_LOOKUP_VALUE_LENGTH } from './types.js';
17
+ export { DEFAULT_FORMS_LABELS, fillLabel, resolveLabels } from './labels.js';
17
18
  export { createPublicLookupSource, lookupUrlFromSubmissionUrl } from './lookup.js';
18
19
  export { createVisitorSession, forgetUrlFromSubmissionUrl, } from './visitor.js';
19
20
  export { sharedVisitorSession } from './shared.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts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AO,EA6BN,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAE7E,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,aAAa,EAAoB,MAAM,aAAa,CAAA;AAE9F,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAElF,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAG3B,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,oBAAoB,EAAuB,MAAM,aAAa,CAAA"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Every string this package writes itself, so a site in another language can supply its own. Pass any
3
+ * subset as the `labels` prop of `<EbitexForm>`; the rest stay English. A value may hold `{name}` markers,
4
+ * which are filled in where the text says so below.
5
+ *
6
+ * Your field labels, option labels, button labels and the server's own error messages come from the form
7
+ * and are not in this list.
8
+ */
9
+ export interface FormsLabels {
10
+ /** The button that returns to the previous step. */
11
+ back: string;
12
+ /** The button that saves a step and moves on. */
13
+ next: string;
14
+ /** The final button when the form defines none of its own. */
15
+ submit: string;
16
+ /** Shown in place of the form after a successful submission. */
17
+ complete: string;
18
+ /** The message under a required field that was left empty. */
19
+ required: string;
20
+ /** Read aloud after a required field's label, in place of the visual asterisk. */
21
+ requiredHint: string;
22
+ /** The empty first option of a drop-down. */
23
+ select: string;
24
+ /** The heading of the error summary, shown when two or more fields need fixing. `{count}` is how many. */
25
+ errorSummary: string;
26
+ /** Shown when the answers could not be sent at all (a network failure, a server error). */
27
+ failure: string;
28
+ /** The accessible name of the step progress indicator. */
29
+ progress: string;
30
+ /** The step progress text. `{n}` is the current step and `{total}` the number of steps. */
31
+ stepIndicator: string;
32
+ /** Shown above a form that is not accepting responses. `{status}` is the form's status, lower case. */
33
+ preview: string;
34
+ /** A type-ahead field whose suggestions could not be loaded. */
35
+ lookupUnavailable: string;
36
+ /** The note on a type-ahead answer that was picked from the suggestions. */
37
+ lookupFound: string;
38
+ /** The note on a type-ahead answer that was typed. */
39
+ lookupNew: string;
40
+ /** The last suggestion, offering what was typed. `{text}` is what was typed. */
41
+ lookupUseNew: string;
42
+ }
43
+ export declare const DEFAULT_FORMS_LABELS: FormsLabels;
44
+ /** The defaults with any `labels` the host supplied laid over them. */
45
+ export declare function resolveLabels(labels?: Partial<FormsLabels>): FormsLabels;
46
+ /** Replaces each `{name}` in `template` with its value; a marker with no value is left as written. */
47
+ export declare function fillLabel(template: string, values: Record<string, string | number>): string;
48
+ //# sourceMappingURL=labels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../src/labels.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAA;IACZ,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAA;IACd,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAA;IAChB,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAA;IAChB,kFAAkF;IAClF,YAAY,EAAE,MAAM,CAAA;IACpB,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,0GAA0G;IAC1G,YAAY,EAAE,MAAM,CAAA;IACpB,2FAA2F;IAC3F,OAAO,EAAE,MAAM,CAAA;IACf,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAA;IAChB,2FAA2F;IAC3F,aAAa,EAAE,MAAM,CAAA;IACrB,uGAAuG;IACvG,OAAO,EAAE,MAAM,CAAA;IACf,gEAAgE;IAChE,iBAAiB,EAAE,MAAM,CAAA;IACzB,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAA;IACnB,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAA;IACjB,gFAAgF;IAChF,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,oBAAoB,EAAE,WAiBlC,CAAA;AAED,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAExE;AAED,sGAAsG;AACtG,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAE3F"}
package/dist/labels.js ADDED
@@ -0,0 +1,27 @@
1
+ export const DEFAULT_FORMS_LABELS = {
2
+ back: 'Back',
3
+ next: 'Next',
4
+ submit: 'Submit',
5
+ complete: 'Thanks — your response has been submitted.',
6
+ required: 'This field is required.',
7
+ requiredHint: '(required)',
8
+ select: 'Select…',
9
+ errorSummary: 'Please fix {count} fields',
10
+ failure: 'Your answers could not be sent. Check your connection and try again.',
11
+ progress: 'Form progress',
12
+ stepIndicator: 'Step {n} of {total}',
13
+ preview: "This form is {status} and isn't accepting responses yet. It's shown here for preview only.",
14
+ lookupUnavailable: 'Suggestions are not available right now. Type your answer and continue.',
15
+ lookupFound: 'Found in our records',
16
+ lookupNew: 'New entry',
17
+ lookupUseNew: 'Use "{text}" as a new entry',
18
+ };
19
+ /** The defaults with any `labels` the host supplied laid over them. */
20
+ export function resolveLabels(labels) {
21
+ return labels === undefined ? DEFAULT_FORMS_LABELS : { ...DEFAULT_FORMS_LABELS, ...labels };
22
+ }
23
+ /** Replaces each `{name}` in `template` with its value; a marker with no value is left as written. */
24
+ export function fillLabel(template, values) {
25
+ return template.replace(/\{(\w+)\}/g, (marker, name) => (name in values ? String(values[name]) : marker));
26
+ }
27
+ //# sourceMappingURL=labels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labels.js","sourceRoot":"","sources":["../src/labels.ts"],"names":[],"mappings":"AA2CA,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAC/C,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,4CAA4C;IACtD,QAAQ,EAAE,yBAAyB;IACnC,YAAY,EAAE,YAAY;IAC1B,MAAM,EAAE,SAAS;IACjB,YAAY,EAAE,2BAA2B;IACzC,OAAO,EAAE,sEAAsE;IAC/E,QAAQ,EAAE,eAAe;IACzB,aAAa,EAAE,qBAAqB;IACpC,OAAO,EAAE,4FAA4F;IACrG,iBAAiB,EAAE,yEAAyE;IAC5F,WAAW,EAAE,sBAAsB;IACnC,SAAS,EAAE,WAAW;IACtB,YAAY,EAAE,6BAA6B;CAC5C,CAAA;AAED,uEAAuE;AACvE,MAAM,UAAU,aAAa,CAAC,MAA6B;IACzD,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,GAAG,oBAAoB,EAAE,GAAG,MAAM,EAAE,CAAA;AAC7F,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,SAAS,CAAC,QAAgB,EAAE,MAAuC;IACjF,OAAO,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AACnH,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { type CSSProperties } from 'react';
2
+ import { type FormsLabels } from '../labels.js';
2
3
  import { type Attribution } from '../attribution.js';
3
4
  import type { ConsentOptions, LookupSource, SdkForm, SubmissionData, VisitorStorage } from '../types.js';
4
5
  import { type VisitorSession } from '../visitor.js';
@@ -54,6 +55,18 @@ export interface EbitexFormProps {
54
55
  * kept from an earlier page (the component stores nothing), or `() => undefined` to send none. The text is untrusted and is cleaned again by the server.
55
56
  */
56
57
  attribution?: Attribution | (() => Attribution | undefined);
58
+ /**
59
+ * Move focus to the first field that needs fixing after a step or a submit fails validation (default `true`). Turn it off if your page
60
+ * manages focus itself.
61
+ */
62
+ focusOnError?: boolean;
63
+ /**
64
+ * Show a message when the answers could not be sent at all (a network failure or a server error), which is otherwise only reported to
65
+ * `onError` (default `true`). Turn it off if you render your own from `onError`.
66
+ */
67
+ showErrorMessage?: boolean;
68
+ /** Replace any of the strings this component writes (Back, Next, the required message, ...). The rest stay English. */
69
+ labels?: Partial<FormsLabels>;
57
70
  /** Injectable for tests and non-standard runtimes. */
58
71
  fetch?: typeof globalThis.fetch;
59
72
  }
@@ -70,5 +83,5 @@ export interface EbitexFormProps {
70
83
  * isn't lost — matching the behaviour of ebitex's own renderer rather than a simplified
71
84
  * client-only notion of steps.
72
85
  */
73
- export declare function EbitexForm({ form, onSubmitted, onError, className, style, fieldComponents, lookup, consent, storage, visitor: injectedVisitor, attribution, fetch: injectedFetch, }: EbitexFormProps): import("react").JSX.Element | null;
86
+ export declare function EbitexForm({ form, onSubmitted, onError, className, style, fieldComponents, lookup, consent, storage, visitor: injectedVisitor, attribution, focusOnError, showErrorMessage, labels, fetch: injectedFetch, }: EbitexFormProps): import("react").JSX.Element | null;
74
87
  //# sourceMappingURL=EbitexForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EbitexForm.d.ts","sourceRoot":"","sources":["../../src/react/EbitexForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,aAAa,EAAE,MAAM,OAAO,CAAA;AAE/E,OAAO,EAAmD,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAErG,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAoB,cAAc,EAAE,MAAM,aAAa,CAAA;AAC1H,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAA;AAEzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAGlD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,0BAA0B,CAAA;AAW3D,MAAM,WAAW,eAAe;IAC9B,4FAA4F;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eAAe,EACf,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EAAE,eAAe,EACxB,WAAW,EACX,YAAmB,EACnB,gBAAuB,EACvB,MAAM,EACN,KAAK,EAAE,aAAa,GACrB,EAAE,eAAe,sCAkUjB"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useId, useMemo, useState } from 'react';
3
- import { adjacentVisibleStepSlot, collectSubmissionKeys, defaultChoiceValues, resolveSteps, resolveVisibleStepSlot } from '../nodes.js';
2
+ import { useEffect, useId, useMemo, useRef, useState } from 'react';
3
+ import { adjacentVisibleStepSlot, collectDataFields, collectSubmissionKeys, defaultChoiceValues, resolveSteps, resolveVisibleStepSlot } from '../nodes.js';
4
+ import { DEFAULT_FORMS_LABELS, fillLabel, resolveLabels } from '../labels.js';
4
5
  import { normalizeAttribution, readAttributionFromSearch } from '../attribution.js';
5
6
  import { createPublicLookupSource, lookupUrlFromSubmissionUrl } from '../lookup.js';
6
7
  import { createVisitorSession } from '../visitor.js';
@@ -22,6 +23,15 @@ function announceSubmission() {
22
23
  // An announcement must never turn a successful submission into an error.
23
24
  }
24
25
  }
26
+ /** Moves focus to a field's control. A radio or checkbox group is a `fieldset`, so its first option takes the focus. */
27
+ function focusControl(element) {
28
+ if (!element)
29
+ return;
30
+ if (element.tagName === 'FIELDSET')
31
+ element.querySelector('input')?.focus();
32
+ else
33
+ element.focus();
34
+ }
25
35
  /**
26
36
  * Renders an ebitex Form and submits it.
27
37
  *
@@ -35,8 +45,9 @@ function announceSubmission() {
35
45
  * isn't lost — matching the behaviour of ebitex's own renderer rather than a simplified
36
46
  * client-only notion of steps.
37
47
  */
38
- export function EbitexForm({ form, onSubmitted, onError, className, style, fieldComponents, lookup, consent, storage, visitor: injectedVisitor, attribution, fetch: injectedFetch, }) {
48
+ export function EbitexForm({ form, onSubmitted, onError, className, style, fieldComponents, lookup, consent, storage, visitor: injectedVisitor, attribution, focusOnError = true, showErrorMessage = true, labels, fetch: injectedFetch, }) {
39
49
  const baseId = useId();
50
+ const L = useMemo(() => resolveLabels(labels), [labels]);
40
51
  const doFetch = injectedFetch ?? globalThis.fetch;
41
52
  const lookupSource = useMemo(() => {
42
53
  if (lookup)
@@ -56,6 +67,12 @@ export function EbitexForm({ form, onSubmitted, onError, className, style, field
56
67
  const [errors, setErrors] = useState({});
57
68
  const [submitting, setSubmitting] = useState(false);
58
69
  const [completed, setCompleted] = useState(false);
70
+ // Counts each time validation fails (here or on the server), so focus moves once per failure and not on every later re-render.
71
+ const [errorGeneration, setErrorGeneration] = useState(0);
72
+ // The answers could not be sent at all (not a validation failure).
73
+ const [sendFailed, setSendFailed] = useState(false);
74
+ const formRef = useRef(null);
75
+ const progressRef = useRef(null);
59
76
  const steps = form.steps;
60
77
  const visibleSteps = resolveSteps(steps, data);
61
78
  const currentSlot = resolveVisibleStepSlot(steps, data, stepSlot);
@@ -73,12 +90,34 @@ export function EbitexForm({ form, onSubmitted, onError, className, style, field
73
90
  if (!injectedVisitor && consent)
74
91
  session.setConsent(consent);
75
92
  }, [session, injectedVisitor, consent?.cmp, consent?.cmpString, consent?.gpc, consent?.dnt]);
93
+ // After a failed step or submit, take the respondent to the first field that needs fixing, once the error is on the page.
94
+ useEffect(() => {
95
+ if (errorGeneration === 0 || !focusOnError)
96
+ return;
97
+ focusControl(formRef.current?.querySelector('[aria-invalid="true"]'));
98
+ // eslint-disable-next-line react-hooks/exhaustive-deps
99
+ }, [errorGeneration]);
100
+ // On a step change, move focus to the progress text ("Step 2 of 3: Your details"), so the new step is announced and Tab starts inside it.
101
+ const previousSlot = useRef(currentSlot);
102
+ useEffect(() => {
103
+ if (previousSlot.current === currentSlot)
104
+ return;
105
+ previousSlot.current = currentSlot;
106
+ progressRef.current?.focus();
107
+ }, [currentSlot]);
76
108
  if (completed) {
77
- return (_jsx("div", { className: joinClassNames('ebitex-forms', className), style: style, children: _jsx("p", { className: "ebitex-forms__complete", role: "status", children: "Thanks \u2014 your response has been submitted." }) }));
109
+ return (_jsx("div", { className: joinClassNames('ebitex-forms', className), style: style, children: _jsx("p", { className: "ebitex-forms__complete", role: "status", children: L.complete }) }));
78
110
  }
79
111
  if (!step) {
80
112
  return null;
81
113
  }
114
+ /** Shows `found` and takes focus to the first of them. The validator's own required message is swapped for the host's. */
115
+ function showErrors(found) {
116
+ setErrors(L.required === DEFAULT_FORMS_LABELS.required
117
+ ? found
118
+ : Object.fromEntries(Object.entries(found).map(([key, message]) => [key, message === DEFAULT_FORMS_LABELS.required ? L.required : message])));
119
+ setErrorGeneration((generation) => generation + 1);
120
+ }
82
121
  /**
83
122
  * Validates only the current step's fields. Validating the whole form on a step advance would
84
123
  * report errors for fields the respondent hasn't reached yet.
@@ -118,6 +157,7 @@ export function EbitexForm({ form, onSubmitted, onError, className, style, field
118
157
  }
119
158
  async function save(complete) {
120
159
  setSubmitting(true);
160
+ setSendFailed(false);
121
161
  try {
122
162
  const response = await doFetch(form.submissionUrl, {
123
163
  method: 'POST',
@@ -129,9 +169,10 @@ export function EbitexForm({ form, onSubmitted, onError, className, style, field
129
169
  // thrown, so a respondent can fix it. Anything else is the host app's to handle.
130
170
  const body = (await response.json().catch(() => null));
131
171
  if (body?.error === 'validation_failed' && body.errors) {
132
- setErrors(body.errors);
172
+ showErrors(body.errors);
133
173
  return false;
134
174
  }
175
+ setSendFailed(true);
135
176
  onError?.(new Error(`Submission failed with status ${response.status}`));
136
177
  return false;
137
178
  }
@@ -140,6 +181,7 @@ export function EbitexForm({ form, onSubmitted, onError, className, style, field
140
181
  return true;
141
182
  }
142
183
  catch (error) {
184
+ setSendFailed(true);
143
185
  onError?.(error);
144
186
  return false;
145
187
  }
@@ -150,7 +192,7 @@ export function EbitexForm({ form, onSubmitted, onError, className, style, field
150
192
  async function advance() {
151
193
  const stepErrors = validateCurrentStep(true);
152
194
  if (Object.keys(stepErrors).length > 0) {
153
- setErrors(stepErrors);
195
+ showErrors(stepErrors);
154
196
  return;
155
197
  }
156
198
  setErrors({});
@@ -164,7 +206,7 @@ export function EbitexForm({ form, onSubmitted, onError, className, style, field
164
206
  async function submit() {
165
207
  const allErrors = validateSubmission(form, visiblePayload(), { requireAll: true });
166
208
  if (Object.keys(allErrors).length > 0) {
167
- setErrors(allErrors);
209
+ showErrors(allErrors);
168
210
  return;
169
211
  }
170
212
  setErrors({});
@@ -178,7 +220,10 @@ export function EbitexForm({ form, onSubmitted, onError, className, style, field
178
220
  setData((current) => ({ ...current, [key]: value }));
179
221
  }
180
222
  const disabled = submitting || !form.submittable;
181
- return (_jsxs("div", { className: joinClassNames('ebitex-forms', className), style: style, children: [!form.submittable ? (_jsxs("p", { className: "ebitex-forms__notice", role: "status", children: ["This form is ", form.status.toLowerCase(), " and isn't accepting responses yet. It's shown here for preview only."] })) : null, _jsxs("form", { noValidate: true, onSubmit: (event) => {
223
+ const stepText = fillLabel(L.stepIndicator, { n: visibleStepPosition + 1, total: visibleSteps.length }) + (step.label ? `: ${step.label}` : '');
224
+ // The fields on this step that need fixing, in page order. Two or more get a summary; with one, focus on the field is enough.
225
+ const invalidFields = collectDataFields(step.nodes, data).filter((field) => field.submissionKey !== undefined && errors[field.submissionKey] !== undefined);
226
+ return (_jsxs("div", { className: joinClassNames('ebitex-forms', className), style: style, children: [!form.submittable ? (_jsx("p", { className: "ebitex-forms__notice", role: "status", children: fillLabel(L.preview, { status: form.status.toLowerCase() }) })) : null, _jsxs("form", { ref: formRef, noValidate: true, onSubmit: (event) => {
182
227
  event.preventDefault();
183
228
  if (isLastStep) {
184
229
  void submit();
@@ -186,12 +231,19 @@ export function EbitexForm({ form, onSubmitted, onError, className, style, field
186
231
  else {
187
232
  void advance();
188
233
  }
189
- }, children: [visibleSteps.length > 1 ? (_jsxs("p", { className: "ebitex-forms__step-indicator", role: "status", children: ["Step ", visibleStepPosition + 1, " of ", visibleSteps.length, step.label ? `: ${step.label}` : ''] })) : null, _jsx(NodeList, { nodes: step.nodes, baseId: baseId, data: data, errors: errors, disabled: disabled, fieldComponents: fieldComponents, lookup: lookupSource, onChange: setValue }), _jsxs("div", { className: "ebitex-forms__actions", children: [hasPreviousStep ? (_jsx("button", { type: "button", className: "ebitex-forms__button ebitex-forms__button--secondary", disabled: submitting,
234
+ }, children: [visibleSteps.length > 1 ? (_jsx("p", { ref: progressRef, tabIndex: -1, className: "ebitex-forms__step-indicator", role: "progressbar", "aria-label": L.progress, "aria-valuemin": 1, "aria-valuemax": visibleSteps.length, "aria-valuenow": visibleStepPosition + 1, "aria-valuetext": stepText, children: stepText })) : null, invalidFields.length >= 2 ? (_jsxs("div", { className: "ebitex-forms__summary", role: "alert", children: [_jsx("p", { className: "ebitex-forms__summary-title", children: fillLabel(L.errorSummary, { count: invalidFields.length }) }), _jsx("ul", { children: invalidFields.map((field) => {
235
+ const key = field.submissionKey;
236
+ const id = `${baseId}-${key}`;
237
+ return (_jsxs("li", { children: [_jsx("a", { href: `#${id}`, onClick: (event) => {
238
+ event.preventDefault();
239
+ focusControl(formRef.current?.ownerDocument.getElementById(id));
240
+ }, children: field.label }), ": ", errors[key]] }, key));
241
+ }) })] })) : null, _jsx(NodeList, { nodes: step.nodes, baseId: baseId, data: data, errors: errors, disabled: disabled, fieldComponents: fieldComponents, lookup: lookupSource, labels: L, onChange: setValue }), sendFailed && showErrorMessage ? (_jsx("p", { className: "ebitex-forms__failure", role: "alert", children: L.failure })) : null, _jsxs("div", { className: "ebitex-forms__actions", children: [hasPreviousStep ? (_jsx("button", { type: "button", className: "ebitex-forms__button ebitex-forms__button--secondary", disabled: submitting,
190
242
  // Deliberately does not re-save: going back is navigation, not a change.
191
243
  onClick: () => {
192
244
  const previous = adjacentVisibleStepSlot(steps, data, currentSlot, -1);
193
245
  if (previous >= 0)
194
246
  setStepSlot(previous);
195
- }, children: "Back" })) : null, isLastStep ? (_jsx(ActionButtons, { nodes: form.actions, disabled: disabled })) : (_jsx("button", { type: "submit", className: "ebitex-forms__button", disabled: disabled, children: "Next" }))] })] })] }));
247
+ }, children: L.back })) : null, isLastStep ? (_jsx(ActionButtons, { nodes: form.actions, disabled: disabled, labels: L })) : (_jsx("button", { type: "submit", className: "ebitex-forms__button", disabled: disabled, children: L.next }))] })] })] }));
196
248
  }
197
249
  //# sourceMappingURL=EbitexForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EbitexForm.js","sourceRoot":"","sources":["../../src/react/EbitexForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAA;AAC/E,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACvI,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAoB,MAAM,mBAAmB,CAAA;AACrG,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAEnF,OAAO,EAAE,oBAAoB,EAAuB,MAAM,eAAe,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAErD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEvE;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAA;AAE3D,SAAS,kBAAkB;IACzB,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,aAAa,KAAK,UAAU;QAAE,OAAM;IACvF,IAAI,CAAC;QACH,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAA;IACvD,CAAC;IAAC,MAAM,CAAC;QACP,yEAAyE;IAC3E,CAAC;AACH,CAAC;AA6DD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,IAAI,EACJ,WAAW,EACX,OAAO,EACP,SAAS,EACT,KAAK,EACL,eAAe,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,KAAC,aAAa,IAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,GAAI,CACtE,CAAC,CAAC,CAAC,CACF,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,sBAAsB,EAAC,QAAQ,EAAE,QAAQ,YACtE,CAAC,CAAC,IAAI,GACA,CACV,IACG,IACD,IACH,CACP,CAAA;AACH,CAAC"}
@@ -15,5 +15,5 @@ import type { ChoiceFieldComponentProps } from './fields.js';
15
15
  * text) and `onExistingChange(true | false | null)` for the companion key (`true` picked, `false` typed,
16
16
  * `null` empty). The latter is also written as a hidden input, so a native form submission carries it too.
17
17
  */
18
- export declare function LookupFieldControl({ field, id, name, value, onChange, error, disabled, lookup, existing, onExistingChange, }: ChoiceFieldComponentProps): import("react").JSX.Element;
18
+ export declare function LookupFieldControl({ field, id, name, value, onChange, error, disabled, lookup, existing, onExistingChange, labels: givenLabels, }: ChoiceFieldComponentProps): import("react").JSX.Element;
19
19
  //# sourceMappingURL=LookupField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LookupField.d.ts","sourceRoot":"","sources":["../../src/react/LookupField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAU5D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,EAAE,EACF,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAe,EACf,gBAAgB,GACjB,EAAE,yBAAyB,+BAoS3B"}
1
+ {"version":3,"file":"LookupField.d.ts","sourceRoot":"","sources":["../../src/react/LookupField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAU5D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,EAAE,EACF,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAe,EACf,gBAAgB,EAChB,MAAM,EAAE,WAAW,GACpB,EAAE,yBAAyB,+BAqS3B"}