@asteby/storefront-react 0.12.0 → 0.13.0

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.
@@ -0,0 +1,226 @@
1
+ import { useRef, useState, useEffect } from 'react';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+
4
+ // src/checkout/fields.tsx
5
+ var ES = {
6
+ valueMissing: "Completa este campo.",
7
+ choiceMissing: "Elige una opci\xF3n.",
8
+ email: "Escribe un correo v\xE1lido, por ejemplo nombre@correo.com.",
9
+ tel: "Escribe un tel\xE9fono v\xE1lido.",
10
+ pattern: "Revisa el formato.",
11
+ tooShort: "Escribe al menos {n} caracteres.",
12
+ server: "Revisa este campo.",
13
+ summaryOne: "Revisa 1 campo para continuar",
14
+ summaryMany: "Revisa {n} campos para continuar",
15
+ optional: "(opcional)"
16
+ };
17
+ var EN = {
18
+ valueMissing: "Fill in this field.",
19
+ choiceMissing: "Choose an option.",
20
+ email: "Enter a valid email, like name@example.com.",
21
+ tel: "Enter a valid phone number.",
22
+ pattern: "Check the format.",
23
+ tooShort: "Enter at least {n} characters.",
24
+ server: "Check this field.",
25
+ summaryOne: "Check 1 field to continue",
26
+ summaryMany: "Check {n} fields to continue",
27
+ optional: "(optional)"
28
+ };
29
+ function fieldMessages(locale, overrides) {
30
+ const base = (locale ?? "es-MX").toLowerCase().startsWith("en") ? EN : ES;
31
+ return overrides ? { ...base, ...overrides } : base;
32
+ }
33
+ var isControl = (el) => !!el && typeof el.tagName === "string" && ["INPUT", "SELECT", "TEXTAREA"].includes(el.tagName) && !!el.name;
34
+ function validationMessage(el, m = ES) {
35
+ const v = el.validity;
36
+ if (!v || v.valid) return null;
37
+ const own = el.getAttribute("data-sf-error");
38
+ if (own) return own;
39
+ if (v.valueMissing) return el instanceof HTMLInputElement && (el.type === "radio" || el.type === "checkbox") ? m.choiceMissing : m.valueMissing;
40
+ if (v.typeMismatch && el instanceof HTMLInputElement) return el.type === "email" ? m.email : el.type === "tel" ? m.tel : m.pattern;
41
+ if (v.patternMismatch) return el.getAttribute("title") || (el instanceof HTMLInputElement && el.type === "tel" ? m.tel : m.pattern);
42
+ if (v.tooShort && el instanceof HTMLInputElement) return m.tooShort.replace("{n}", String(el.minLength));
43
+ return el.validationMessage || m.pattern;
44
+ }
45
+ function labelOf(el) {
46
+ if (el instanceof HTMLInputElement && el.type === "radio") {
47
+ const legend = el.closest("fieldset")?.querySelector("legend");
48
+ if (legend?.textContent) return legend.textContent.trim();
49
+ }
50
+ const text = el.labels?.[0]?.getAttribute("data-sf-label") ?? el.labels?.[0]?.textContent ?? el.getAttribute("aria-label") ?? el.name;
51
+ return text.trim();
52
+ }
53
+ function useFieldErrors(formRef, options = {}) {
54
+ const m = fieldMessages(options.locale, options.messages);
55
+ const live = useRef(m);
56
+ live.current = m;
57
+ const server = [...options.serverFields ?? []];
58
+ const serverKey = server.join("|");
59
+ const [errors, setErrors] = useState(() => Object.fromEntries(server.map((n) => [n, options.serverMessages?.[n] ?? m.server])));
60
+ const [summary, setSummary] = useState(null);
61
+ const [summaryKey, setSummaryKey] = useState(0);
62
+ useEffect(() => {
63
+ if (!server.length) return;
64
+ const form = formRef.current;
65
+ const items = [];
66
+ const next = {};
67
+ for (const name of server) {
68
+ const msg = options.serverMessages?.[name] ?? live.current.server;
69
+ next[name] = msg;
70
+ const el = form?.elements.namedItem(name);
71
+ const ctl = el && "length" in el && !(el instanceof HTMLSelectElement) ? el[0] : el;
72
+ if (ctl) items.push({ name, id: ctl.id || name, label: labelOf(ctl), message: msg });
73
+ }
74
+ setErrors((e) => ({ ...e, ...next }));
75
+ if (items.length) {
76
+ setSummary(items);
77
+ setSummaryKey((k) => k + 1);
78
+ }
79
+ }, [serverKey]);
80
+ useEffect(() => {
81
+ const form = formRef.current;
82
+ if (!form) return;
83
+ let batch = null;
84
+ const set = (name, msg) => setErrors((e) => {
85
+ if (msg === null) {
86
+ if (!(name in e)) return e;
87
+ const { [name]: _gone, ...rest } = e;
88
+ return rest;
89
+ }
90
+ return e[name] === msg ? e : { ...e, [name]: msg };
91
+ });
92
+ const onBlur = (ev) => {
93
+ const el = ev.target;
94
+ if (!isControl(el) || el instanceof HTMLInputElement && (el.type === "radio" || el.type === "checkbox" || el.type === "hidden")) return;
95
+ if (!el.value) return;
96
+ set(el.name, validationMessage(el, live.current));
97
+ };
98
+ const onInput = (ev) => {
99
+ const el = ev.target;
100
+ if (!isControl(el)) return;
101
+ setErrors((e) => {
102
+ if (!(el.name in e)) return e;
103
+ const msg = el.validity.valid ? null : validationMessage(el, live.current);
104
+ if (msg !== null) return e;
105
+ const { [el.name]: _gone, ...rest } = e;
106
+ return rest;
107
+ });
108
+ };
109
+ const onInvalid = (ev) => {
110
+ const el = ev.target;
111
+ if (!isControl(el)) return;
112
+ ev.preventDefault();
113
+ if (!batch) {
114
+ batch = [];
115
+ queueMicrotask(() => {
116
+ const list = batch ?? [];
117
+ batch = null;
118
+ const seen = /* @__PURE__ */ new Set();
119
+ const items = [];
120
+ const next = {};
121
+ for (const c of list) {
122
+ if (seen.has(c.name)) continue;
123
+ seen.add(c.name);
124
+ const msg = validationMessage(c, live.current) ?? live.current.valueMissing;
125
+ next[c.name] = msg;
126
+ items.push({ name: c.name, id: c.id || c.name, label: labelOf(c), message: msg });
127
+ }
128
+ setErrors((e) => ({ ...e, ...next }));
129
+ setSummary(items);
130
+ setSummaryKey((k) => k + 1);
131
+ });
132
+ }
133
+ batch.push(el);
134
+ };
135
+ form.addEventListener("focusout", onBlur);
136
+ form.addEventListener("input", onInput);
137
+ form.addEventListener("change", onInput);
138
+ form.addEventListener("invalid", onInvalid, true);
139
+ return () => {
140
+ form.removeEventListener("focusout", onBlur);
141
+ form.removeEventListener("input", onInput);
142
+ form.removeEventListener("change", onInput);
143
+ form.removeEventListener("invalid", onInvalid, true);
144
+ };
145
+ }, [formRef]);
146
+ const shown = summary ? summary.filter((s) => s.name in errors).map((s) => ({ ...s, message: errors[s.name] })) : null;
147
+ return {
148
+ errors,
149
+ summary: shown && shown.length ? shown : null,
150
+ summaryKey,
151
+ clear: () => {
152
+ setErrors({});
153
+ setSummary(null);
154
+ }
155
+ };
156
+ }
157
+ function ErrorSummary({ items, focusKey, locale, messages, title, className, classNames: cx = {} }) {
158
+ const ref = useRef(null);
159
+ const m = fieldMessages(locale, messages);
160
+ const has = !!items && items.length > 0;
161
+ useEffect(() => {
162
+ if (has) ref.current?.focus();
163
+ }, [focusKey]);
164
+ if (!has) return null;
165
+ const n = items.length;
166
+ return /* @__PURE__ */ jsxs("div", { ref, role: "alert", tabIndex: -1, className, "data-sf-error-summary": true, "aria-labelledby": "sf-error-summary-title", children: [
167
+ /* @__PURE__ */ jsx("p", { id: "sf-error-summary-title", className: cx.title, "data-sf-error-summary-title": true, children: title ?? (n === 1 ? m.summaryOne : m.summaryMany.replace("{n}", String(n))) }),
168
+ /* @__PURE__ */ jsx("ul", { className: cx.list, children: items.map((it) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
169
+ "a",
170
+ {
171
+ href: `#${it.id}`,
172
+ className: cx.link,
173
+ onClick: (e) => {
174
+ const el = document.getElementById(it.id);
175
+ if (!el) return;
176
+ e.preventDefault();
177
+ el.focus();
178
+ el.scrollIntoView?.({ block: "center" });
179
+ },
180
+ children: [
181
+ it.label,
182
+ ": ",
183
+ it.message
184
+ ]
185
+ }
186
+ ) }, it.name)) })
187
+ ] });
188
+ }
189
+ function CheckoutField(props) {
190
+ const { name, label, id = name, error, hint, optional = false, classNames: cx = {}, locale, messages, ...rest } = props;
191
+ const m = fieldMessages(locale, messages);
192
+ const hintId = hint ? `${id}-hint` : void 0;
193
+ const errorId = `${id}-error`;
194
+ const describedBy = [hintId, error ? errorId : void 0].filter(Boolean).join(" ") || void 0;
195
+ const common = {
196
+ id,
197
+ name,
198
+ required: !optional,
199
+ "aria-invalid": error ? true : void 0,
200
+ "aria-describedby": describedBy,
201
+ className: cx.input,
202
+ "data-sf-field-control": ""
203
+ };
204
+ return /* @__PURE__ */ jsxs("div", { className: cx.root, "data-sf-field": true, "data-invalid": error ? "" : void 0, children: [
205
+ /* @__PURE__ */ jsxs("label", { htmlFor: id, className: cx.label, "data-sf-label": label, children: [
206
+ label,
207
+ optional ? /* @__PURE__ */ jsxs("span", { className: cx.optional, "data-sf-field-optional": true, children: [
208
+ " ",
209
+ m.optional
210
+ ] }) : null
211
+ ] }),
212
+ hint ? /* @__PURE__ */ jsx("p", { id: hintId, className: cx.hint, "data-sf-field-hint": true, children: hint }) : null,
213
+ rest.as === "select" ? (() => {
214
+ const { as: _as, children, ...select } = rest;
215
+ return /* @__PURE__ */ jsx("select", { ...select, ...common, children });
216
+ })() : (() => {
217
+ const { as: _as, ...input } = rest;
218
+ return /* @__PURE__ */ jsx("input", { ...input, ...common });
219
+ })(),
220
+ error ? /* @__PURE__ */ jsx("p", { id: errorId, className: cx.error, "data-sf-field-error": true, children: error }) : null
221
+ ] });
222
+ }
223
+
224
+ export { CheckoutField, ErrorSummary, fieldMessages, useFieldErrors, validationMessage };
225
+ //# sourceMappingURL=chunk-DFGLCIEG.js.map
226
+ //# sourceMappingURL=chunk-DFGLCIEG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/checkout/fields.tsx"],"names":[],"mappings":";;;;AA6BA,IAAM,EAAA,GAAoB;AAAA,EACxB,YAAA,EAAc,sBAAA;AAAA,EACd,aAAA,EAAe,sBAAA;AAAA,EACf,KAAA,EAAO,6DAAA;AAAA,EACP,GAAA,EAAK,mCAAA;AAAA,EACL,OAAA,EAAS,oBAAA;AAAA,EACT,QAAA,EAAU,kCAAA;AAAA,EACV,MAAA,EAAQ,oBAAA;AAAA,EACR,UAAA,EAAY,+BAAA;AAAA,EACZ,WAAA,EAAa,kCAAA;AAAA,EACb,QAAA,EAAU;AACZ,CAAA;AAEA,IAAM,EAAA,GAAoB;AAAA,EACxB,YAAA,EAAc,qBAAA;AAAA,EACd,aAAA,EAAe,mBAAA;AAAA,EACf,KAAA,EAAO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AAA,EAAK,WAAW,EAAA,CAAG,QAAA,EAAU,0BAAsB,IAAA,EACjD,QAAA,EAAA;AAAA,QAAA,GAAA;AAAA,QACA,CAAA,CAAE;AAAA,OAAA,EACL,CAAA,GACE;AAAA,KAAA,EACN,CAAA;AAAA,IACC,IAAA,mBACC,GAAA,CAAC,GAAA,EAAA,EAAE,EAAA,EAAI,MAAA,EAAQ,SAAA,EAAW,EAAA,CAAG,IAAA,EAAM,oBAAA,EAAkB,IAAA,EAClD,QAAA,EAAA,IAAA,EACH,CAAA,GACE,IAAA;AAAA,IACH,IAAA,CAAK,EAAA,KAAO,QAAA,GAAA,CACV,MAAM;AACL,MAAA,MAAM,EAAE,EAAA,EAAI,GAAA,EAAK,QAAA,EAAU,GAAG,QAAO,GAAI,IAAA;AACzC,MAAA,2BACG,QAAA,EAAA,EAAQ,GAAG,MAAA,EAAS,GAAG,QACrB,QAAA,EACH,CAAA;AAAA,IAEJ,CAAA,OAEC,MAAM;AACL,MAAA,MAAM,EAAE,EAAA,EAAI,GAAA,EAAK,GAAG,OAAM,GAAI,IAAA;AAC9B,MAAA,uBAAO,GAAA,CAAC,OAAA,EAAA,EAAO,GAAG,KAAA,EAAQ,GAAG,MAAA,EAAQ,CAAA;AAAA,IACvC,CAAA,GAAG;AAAA,IAGJ,KAAA,mBACC,GAAA,CAAC,GAAA,EAAA,EAAE,EAAA,EAAI,OAAA,EAAS,SAAA,EAAW,EAAA,CAAG,KAAA,EAAO,qBAAA,EAAmB,IAAA,EACrD,QAAA,EAAA,KAAA,EACH,CAAA,GACE;AAAA,GAAA,EACN,CAAA;AAEJ","file":"chunk-DFGLCIEG.js","sourcesContent":["/**\n * Form fields of a checkout with inline validation: a labelled field that shows its own error under it, a focusable\n * error summary for the submit, and one hook that reads the browser's own constraint validation (`required`, `type`,\n * `pattern`, `minLength`...) so the rules stay in the HTML and the page keeps working without JavaScript (then the\n * browser explains the errors itself).\n *\n * WCAG 2.2: errors are identified in text next to the field (3.3.1), linked with `aria-describedby` and `aria-invalid`,\n * and the summary takes focus and links to every field (3.3.1 / 2.4.3). Validation runs when the buyer leaves a field\n * that has a value, and clears as soon as it is fixed: it never nags while typing.\n */\nimport { useEffect, useRef, useState, type InputHTMLAttributes, type ReactNode, type RefObject, type SelectHTMLAttributes } from 'react'\n\nexport type FieldMessages = {\n valueMissing: string\n /** Required radio group (delivery, payment). */\n choiceMissing: string\n email: string\n tel: string\n pattern: string\n /** `{n}` = minimum length. */\n tooShort: string\n /** A field the server rejected. */\n server: string\n /** Error summary title, `{n}` = number of fields. */\n summaryOne: string\n summaryMany: string\n optional: string\n}\n\nconst ES: FieldMessages = {\n valueMissing: 'Completa este campo.',\n choiceMissing: 'Elige una opción.',\n email: 'Escribe un correo válido, por ejemplo nombre@correo.com.',\n tel: 'Escribe un teléfono válido.',\n pattern: 'Revisa el formato.',\n tooShort: 'Escribe al menos {n} caracteres.',\n server: 'Revisa este campo.',\n summaryOne: 'Revisa 1 campo para continuar',\n summaryMany: 'Revisa {n} campos para continuar',\n optional: '(opcional)',\n}\n\nconst EN: FieldMessages = {\n valueMissing: 'Fill in this field.',\n choiceMissing: 'Choose an option.',\n email: 'Enter a valid email, like name@example.com.',\n tel: 'Enter a valid phone number.',\n pattern: 'Check the format.',\n tooShort: 'Enter at least {n} characters.',\n server: 'Check this field.',\n summaryOne: 'Check 1 field to continue',\n summaryMany: 'Check {n} fields to continue',\n optional: '(optional)',\n}\n\n/** Messages for a locale (`es*` default, `en*`), with optional overrides. */\nexport function fieldMessages(locale?: string | null, overrides?: Partial<FieldMessages> | null): FieldMessages {\n const base = (locale ?? 'es-MX').toLowerCase().startsWith('en') ? EN : ES\n return overrides ? { ...base, ...overrides } : base\n}\n\n/** Field name -> error text. */\nexport type FieldErrors = Record<string, string>\n\nexport type ErrorSummaryItem = { name: string; id: string; label: string; message: string }\n\ntype Control = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement\n\nconst isControl = (el: EventTarget | null): el is Control =>\n !!el && typeof (el as Element).tagName === 'string' && ['INPUT', 'SELECT', 'TEXTAREA'].includes((el as Element).tagName) && !!(el as Control).name\n\n/**\n * The error text for a control, from its validity. A control can bring its own text with `data-sf-error` (any\n * failure) or `title` (pattern mismatch, the HTML convention).\n */\nexport function validationMessage(el: Control, m: FieldMessages = ES): string | null {\n const v = el.validity\n if (!v || v.valid) return null\n const own = el.getAttribute('data-sf-error')\n if (own) return own\n if (v.valueMissing) return el instanceof HTMLInputElement && (el.type === 'radio' || el.type === 'checkbox') ? m.choiceMissing : m.valueMissing\n if (v.typeMismatch && el instanceof HTMLInputElement) return el.type === 'email' ? m.email : el.type === 'tel' ? m.tel : m.pattern\n if (v.patternMismatch) return el.getAttribute('title') || (el instanceof HTMLInputElement && el.type === 'tel' ? m.tel : m.pattern)\n if (v.tooShort && el instanceof HTMLInputElement) return m.tooShort.replace('{n}', String(el.minLength))\n return el.validationMessage || m.pattern\n}\n\n/** Visible name of a control: its `<label>`, `aria-label`, or the legend of its group (radios). */\nfunction labelOf(el: Control): string {\n if (el instanceof HTMLInputElement && el.type === 'radio') {\n const legend = el.closest('fieldset')?.querySelector('legend')\n if (legend?.textContent) return legend.textContent.trim()\n }\n const text = el.labels?.[0]?.getAttribute('data-sf-label') ?? el.labels?.[0]?.textContent ?? el.getAttribute('aria-label') ?? el.name\n return text.trim()\n}\n\nexport type UseFieldErrorsOptions = {\n locale?: string\n messages?: Partial<FieldMessages>\n /** Fields the server rejected (e.g. from the action), shown with `serverMessages[name]` or the generic text. */\n serverFields?: Iterable<string> | null\n serverMessages?: Record<string, string> | null\n}\n\nexport type FieldErrorsState = {\n errors: FieldErrors\n /** Non-null after a submit with problems (or with server errors): render it in `<ErrorSummary>`. */\n summary: ErrorSummaryItem[] | null\n /** Changes every time a new summary appears, so `<ErrorSummary>` focuses it again. */\n summaryKey: number\n clear: () => void\n}\n\n/**\n * Inline validation for the page `<form>`. Listens to the form (no wrapping component): leaving a field with a value\n * checks it; typing in a field with an error clears it when fixed; a submit or `reportValidity()` with problems\n * collects them (the browser's bubbles are replaced by the inline texts) for the summary.\n */\nexport function useFieldErrors(formRef: RefObject<HTMLFormElement | null>, options: UseFieldErrorsOptions = {}): FieldErrorsState {\n const m = fieldMessages(options.locale, options.messages)\n const live = useRef(m)\n live.current = m\n const server = [...(options.serverFields ?? [])]\n const serverKey = server.join('|')\n const [errors, setErrors] = useState<FieldErrors>(() => Object.fromEntries(server.map((n) => [n, options.serverMessages?.[n] ?? m.server])))\n const [summary, setSummary] = useState<ErrorSummaryItem[] | null>(null)\n const [summaryKey, setSummaryKey] = useState(0)\n\n // Server errors (a new action result): inline texts plus a summary.\n useEffect(() => {\n if (!server.length) return\n const form = formRef.current\n const items: ErrorSummaryItem[] = []\n const next: FieldErrors = {}\n for (const name of server) {\n const msg = options.serverMessages?.[name] ?? live.current.server\n next[name] = msg\n const el = form?.elements.namedItem(name)\n const ctl = el && 'length' in el && !(el instanceof HTMLSelectElement) ? ((el as RadioNodeList)[0] as Control | undefined) : (el as Control | null)\n if (ctl) items.push({ name, id: ctl.id || name, label: labelOf(ctl), message: msg })\n }\n setErrors((e) => ({ ...e, ...next }))\n if (items.length) {\n setSummary(items)\n setSummaryKey((k) => k + 1)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [serverKey])\n\n useEffect(() => {\n const form = formRef.current\n if (!form) return\n let batch: Control[] | null = null\n const set = (name: string, msg: string | null) =>\n setErrors((e) => {\n if (msg === null) {\n if (!(name in e)) return e\n const { [name]: _gone, ...rest } = e\n return rest\n }\n return e[name] === msg ? e : { ...e, [name]: msg }\n })\n const onBlur = (ev: FocusEvent) => {\n const el = ev.target\n if (!isControl(el) || (el instanceof HTMLInputElement && (el.type === 'radio' || el.type === 'checkbox' || el.type === 'hidden'))) return\n // Leaving an empty field you only tabbed through is not an error yet; it is at submit.\n if (!el.value) return\n set(el.name, validationMessage(el, live.current))\n }\n const onInput = (ev: Event) => {\n const el = ev.target\n if (!isControl(el)) return\n setErrors((e) => {\n if (!(el.name in e)) return e\n const msg = el.validity.valid ? null : validationMessage(el, live.current)\n if (msg !== null) return e // keep the text until the field is fixed (no flicker while typing)\n const { [el.name]: _gone, ...rest } = e\n return rest\n })\n }\n const onInvalid = (ev: Event) => {\n const el = ev.target\n if (!isControl(el)) return\n ev.preventDefault() // the inline text replaces the browser bubble\n if (!batch) {\n batch = []\n queueMicrotask(() => {\n const list = batch ?? []\n batch = null\n const seen = new Set<string>()\n const items: ErrorSummaryItem[] = []\n const next: FieldErrors = {}\n for (const c of list) {\n if (seen.has(c.name)) continue\n seen.add(c.name)\n const msg = validationMessage(c, live.current) ?? live.current.valueMissing\n next[c.name] = msg\n items.push({ name: c.name, id: c.id || c.name, label: labelOf(c), message: msg })\n }\n setErrors((e) => ({ ...e, ...next }))\n setSummary(items)\n setSummaryKey((k) => k + 1)\n })\n }\n batch.push(el)\n }\n form.addEventListener('focusout', onBlur)\n form.addEventListener('input', onInput)\n form.addEventListener('change', onInput)\n form.addEventListener('invalid', onInvalid, true)\n return () => {\n form.removeEventListener('focusout', onBlur)\n form.removeEventListener('input', onInput)\n form.removeEventListener('change', onInput)\n form.removeEventListener('invalid', onInvalid, true)\n }\n }, [formRef])\n\n // The summary follows the fixes: a field fixed after the submit leaves the list.\n const shown = summary ? summary.filter((s) => s.name in errors).map((s) => ({ ...s, message: errors[s.name]! })) : null\n return {\n errors,\n summary: shown && shown.length ? shown : null,\n summaryKey,\n clear: () => {\n setErrors({})\n setSummary(null)\n },\n }\n}\n\nexport type ErrorSummaryProps = {\n items: readonly ErrorSummaryItem[] | null\n /** Changes when a new summary must take focus (`useFieldErrors().summaryKey`). */\n focusKey?: number\n locale?: string\n messages?: Partial<FieldMessages>\n title?: ReactNode\n className?: string\n classNames?: Partial<Record<'title' | 'list' | 'link', string>>\n}\n\n/**\n * The list of problems after a submit, above the form: `role=\"alert\"`, takes focus, one link per field (moves the\n * focus to it). Renders nothing without items.\n */\nexport function ErrorSummary({ items, focusKey, locale, messages, title, className, classNames: cx = {} }: ErrorSummaryProps) {\n const ref = useRef<HTMLDivElement>(null)\n const m = fieldMessages(locale, messages)\n const has = !!items && items.length > 0\n useEffect(() => {\n if (has) ref.current?.focus()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [focusKey])\n if (!has) return null\n const n = items!.length\n return (\n <div ref={ref} role=\"alert\" tabIndex={-1} className={className} data-sf-error-summary aria-labelledby=\"sf-error-summary-title\">\n <p id=\"sf-error-summary-title\" className={cx.title} data-sf-error-summary-title>\n {title ?? (n === 1 ? m.summaryOne : m.summaryMany.replace('{n}', String(n)))}\n </p>\n <ul className={cx.list}>\n {items!.map((it) => (\n <li key={it.name}>\n <a\n href={`#${it.id}`}\n className={cx.link}\n onClick={(e) => {\n const el = document.getElementById(it.id)\n if (!el) return\n e.preventDefault()\n el.focus()\n el.scrollIntoView?.({ block: 'center' })\n }}\n >\n {it.label}: {it.message}\n </a>\n </li>\n ))}\n </ul>\n </div>\n )\n}\n\nexport type CheckoutFieldClassNames = Partial<Record<'root' | 'label' | 'optional' | 'input' | 'hint' | 'error', string>>\n\ntype BaseFieldProps = {\n name: string\n label: string\n /** Field id. Default: the name. */\n id?: string\n /** Error text (from `useFieldErrors().errors[name]` or the server). */\n error?: string | null\n /** Help under the label (\"we only use it for the delivery\"). */\n hint?: ReactNode\n /** Marks the label \"(optional)\" and drops `required`. */\n optional?: boolean\n classNames?: CheckoutFieldClassNames\n locale?: string\n messages?: Partial<FieldMessages>\n}\n\nexport type CheckoutFieldProps = BaseFieldProps & Omit<InputHTMLAttributes<HTMLInputElement>, 'name' | 'id'> & { as?: 'input' }\nexport type CheckoutSelectProps = BaseFieldProps & Omit<SelectHTMLAttributes<HTMLSelectElement>, 'name' | 'id'> & { as: 'select'; children: ReactNode }\n\n/**\n * One labelled field: label (with \"(optional)\"), hint, the control and its error text, wired with `aria-describedby`\n * and `aria-invalid`. Required unless `optional`. `as=\"select\"` renders a `<select>` with the given options.\n */\nexport function CheckoutField(props: CheckoutFieldProps | CheckoutSelectProps) {\n const { name, label, id = name, error, hint, optional = false, classNames: cx = {}, locale, messages, ...rest } = props\n const m = fieldMessages(locale, messages)\n const hintId = hint ? `${id}-hint` : undefined\n const errorId = `${id}-error`\n const describedBy = [hintId, error ? errorId : undefined].filter(Boolean).join(' ') || undefined\n const common = {\n id,\n name,\n required: !optional,\n 'aria-invalid': error ? true : undefined,\n 'aria-describedby': describedBy,\n className: cx.input,\n 'data-sf-field-control': '',\n } as const\n return (\n <div className={cx.root} data-sf-field data-invalid={error ? '' : undefined}>\n <label htmlFor={id} className={cx.label} data-sf-label={label}>\n {label}\n {optional ? (\n <span className={cx.optional} data-sf-field-optional>\n {' '}\n {m.optional}\n </span>\n ) : null}\n </label>\n {hint ? (\n <p id={hintId} className={cx.hint} data-sf-field-hint>\n {hint}\n </p>\n ) : null}\n {rest.as === 'select' ? (\n (() => {\n const { as: _as, children, ...select } = rest\n return (\n <select {...select} {...common}>\n {children}\n </select>\n )\n })()\n ) : (\n (() => {\n const { as: _as, ...input } = rest as CheckoutFieldProps\n return <input {...input} {...common} />\n })()\n )}\n {/* Reserved only when there is an error: the text sits right under its field. */}\n {error ? (\n <p id={errorId} className={cx.error} data-sf-field-error>\n {error}\n </p>\n ) : null}\n </div>\n )\n}\n"]}
@@ -0,0 +1,101 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, InputHTMLAttributes, SelectHTMLAttributes, RefObject } from 'react';
3
+
4
+ type FieldMessages = {
5
+ valueMissing: string;
6
+ /** Required radio group (delivery, payment). */
7
+ choiceMissing: string;
8
+ email: string;
9
+ tel: string;
10
+ pattern: string;
11
+ /** `{n}` = minimum length. */
12
+ tooShort: string;
13
+ /** A field the server rejected. */
14
+ server: string;
15
+ /** Error summary title, `{n}` = number of fields. */
16
+ summaryOne: string;
17
+ summaryMany: string;
18
+ optional: string;
19
+ };
20
+ /** Messages for a locale (`es*` default, `en*`), with optional overrides. */
21
+ declare function fieldMessages(locale?: string | null, overrides?: Partial<FieldMessages> | null): FieldMessages;
22
+ /** Field name -> error text. */
23
+ type FieldErrors = Record<string, string>;
24
+ type ErrorSummaryItem = {
25
+ name: string;
26
+ id: string;
27
+ label: string;
28
+ message: string;
29
+ };
30
+ type Control = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
31
+ /**
32
+ * The error text for a control, from its validity. A control can bring its own text with `data-sf-error` (any
33
+ * failure) or `title` (pattern mismatch, the HTML convention).
34
+ */
35
+ declare function validationMessage(el: Control, m?: FieldMessages): string | null;
36
+ type UseFieldErrorsOptions = {
37
+ locale?: string;
38
+ messages?: Partial<FieldMessages>;
39
+ /** Fields the server rejected (e.g. from the action), shown with `serverMessages[name]` or the generic text. */
40
+ serverFields?: Iterable<string> | null;
41
+ serverMessages?: Record<string, string> | null;
42
+ };
43
+ type FieldErrorsState = {
44
+ errors: FieldErrors;
45
+ /** Non-null after a submit with problems (or with server errors): render it in `<ErrorSummary>`. */
46
+ summary: ErrorSummaryItem[] | null;
47
+ /** Changes every time a new summary appears, so `<ErrorSummary>` focuses it again. */
48
+ summaryKey: number;
49
+ clear: () => void;
50
+ };
51
+ /**
52
+ * Inline validation for the page `<form>`. Listens to the form (no wrapping component): leaving a field with a value
53
+ * checks it; typing in a field with an error clears it when fixed; a submit or `reportValidity()` with problems
54
+ * collects them (the browser's bubbles are replaced by the inline texts) for the summary.
55
+ */
56
+ declare function useFieldErrors(formRef: RefObject<HTMLFormElement | null>, options?: UseFieldErrorsOptions): FieldErrorsState;
57
+ type ErrorSummaryProps = {
58
+ items: readonly ErrorSummaryItem[] | null;
59
+ /** Changes when a new summary must take focus (`useFieldErrors().summaryKey`). */
60
+ focusKey?: number;
61
+ locale?: string;
62
+ messages?: Partial<FieldMessages>;
63
+ title?: ReactNode;
64
+ className?: string;
65
+ classNames?: Partial<Record<'title' | 'list' | 'link', string>>;
66
+ };
67
+ /**
68
+ * The list of problems after a submit, above the form: `role="alert"`, takes focus, one link per field (moves the
69
+ * focus to it). Renders nothing without items.
70
+ */
71
+ declare function ErrorSummary({ items, focusKey, locale, messages, title, className, classNames: cx }: ErrorSummaryProps): react.JSX.Element | null;
72
+ type CheckoutFieldClassNames = Partial<Record<'root' | 'label' | 'optional' | 'input' | 'hint' | 'error', string>>;
73
+ type BaseFieldProps = {
74
+ name: string;
75
+ label: string;
76
+ /** Field id. Default: the name. */
77
+ id?: string;
78
+ /** Error text (from `useFieldErrors().errors[name]` or the server). */
79
+ error?: string | null;
80
+ /** Help under the label ("we only use it for the delivery"). */
81
+ hint?: ReactNode;
82
+ /** Marks the label "(optional)" and drops `required`. */
83
+ optional?: boolean;
84
+ classNames?: CheckoutFieldClassNames;
85
+ locale?: string;
86
+ messages?: Partial<FieldMessages>;
87
+ };
88
+ type CheckoutFieldProps = BaseFieldProps & Omit<InputHTMLAttributes<HTMLInputElement>, 'name' | 'id'> & {
89
+ as?: 'input';
90
+ };
91
+ type CheckoutSelectProps = BaseFieldProps & Omit<SelectHTMLAttributes<HTMLSelectElement>, 'name' | 'id'> & {
92
+ as: 'select';
93
+ children: ReactNode;
94
+ };
95
+ /**
96
+ * One labelled field: label (with "(optional)"), hint, the control and its error text, wired with `aria-describedby`
97
+ * and `aria-invalid`. Required unless `optional`. `as="select"` renders a `<select>` with the given options.
98
+ */
99
+ declare function CheckoutField(props: CheckoutFieldProps | CheckoutSelectProps): react.JSX.Element;
100
+
101
+ export { CheckoutField as C, ErrorSummary as E, type FieldErrors as F, type UseFieldErrorsOptions as U, type CheckoutFieldClassNames as a, type CheckoutFieldProps as b, type CheckoutSelectProps as c, type ErrorSummaryItem as d, type ErrorSummaryProps as e, type FieldErrorsState as f, type FieldMessages as g, fieldMessages as h, useFieldErrors as u, validationMessage as v };
@@ -0,0 +1,101 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, InputHTMLAttributes, SelectHTMLAttributes, RefObject } from 'react';
3
+
4
+ type FieldMessages = {
5
+ valueMissing: string;
6
+ /** Required radio group (delivery, payment). */
7
+ choiceMissing: string;
8
+ email: string;
9
+ tel: string;
10
+ pattern: string;
11
+ /** `{n}` = minimum length. */
12
+ tooShort: string;
13
+ /** A field the server rejected. */
14
+ server: string;
15
+ /** Error summary title, `{n}` = number of fields. */
16
+ summaryOne: string;
17
+ summaryMany: string;
18
+ optional: string;
19
+ };
20
+ /** Messages for a locale (`es*` default, `en*`), with optional overrides. */
21
+ declare function fieldMessages(locale?: string | null, overrides?: Partial<FieldMessages> | null): FieldMessages;
22
+ /** Field name -> error text. */
23
+ type FieldErrors = Record<string, string>;
24
+ type ErrorSummaryItem = {
25
+ name: string;
26
+ id: string;
27
+ label: string;
28
+ message: string;
29
+ };
30
+ type Control = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
31
+ /**
32
+ * The error text for a control, from its validity. A control can bring its own text with `data-sf-error` (any
33
+ * failure) or `title` (pattern mismatch, the HTML convention).
34
+ */
35
+ declare function validationMessage(el: Control, m?: FieldMessages): string | null;
36
+ type UseFieldErrorsOptions = {
37
+ locale?: string;
38
+ messages?: Partial<FieldMessages>;
39
+ /** Fields the server rejected (e.g. from the action), shown with `serverMessages[name]` or the generic text. */
40
+ serverFields?: Iterable<string> | null;
41
+ serverMessages?: Record<string, string> | null;
42
+ };
43
+ type FieldErrorsState = {
44
+ errors: FieldErrors;
45
+ /** Non-null after a submit with problems (or with server errors): render it in `<ErrorSummary>`. */
46
+ summary: ErrorSummaryItem[] | null;
47
+ /** Changes every time a new summary appears, so `<ErrorSummary>` focuses it again. */
48
+ summaryKey: number;
49
+ clear: () => void;
50
+ };
51
+ /**
52
+ * Inline validation for the page `<form>`. Listens to the form (no wrapping component): leaving a field with a value
53
+ * checks it; typing in a field with an error clears it when fixed; a submit or `reportValidity()` with problems
54
+ * collects them (the browser's bubbles are replaced by the inline texts) for the summary.
55
+ */
56
+ declare function useFieldErrors(formRef: RefObject<HTMLFormElement | null>, options?: UseFieldErrorsOptions): FieldErrorsState;
57
+ type ErrorSummaryProps = {
58
+ items: readonly ErrorSummaryItem[] | null;
59
+ /** Changes when a new summary must take focus (`useFieldErrors().summaryKey`). */
60
+ focusKey?: number;
61
+ locale?: string;
62
+ messages?: Partial<FieldMessages>;
63
+ title?: ReactNode;
64
+ className?: string;
65
+ classNames?: Partial<Record<'title' | 'list' | 'link', string>>;
66
+ };
67
+ /**
68
+ * The list of problems after a submit, above the form: `role="alert"`, takes focus, one link per field (moves the
69
+ * focus to it). Renders nothing without items.
70
+ */
71
+ declare function ErrorSummary({ items, focusKey, locale, messages, title, className, classNames: cx }: ErrorSummaryProps): react.JSX.Element | null;
72
+ type CheckoutFieldClassNames = Partial<Record<'root' | 'label' | 'optional' | 'input' | 'hint' | 'error', string>>;
73
+ type BaseFieldProps = {
74
+ name: string;
75
+ label: string;
76
+ /** Field id. Default: the name. */
77
+ id?: string;
78
+ /** Error text (from `useFieldErrors().errors[name]` or the server). */
79
+ error?: string | null;
80
+ /** Help under the label ("we only use it for the delivery"). */
81
+ hint?: ReactNode;
82
+ /** Marks the label "(optional)" and drops `required`. */
83
+ optional?: boolean;
84
+ classNames?: CheckoutFieldClassNames;
85
+ locale?: string;
86
+ messages?: Partial<FieldMessages>;
87
+ };
88
+ type CheckoutFieldProps = BaseFieldProps & Omit<InputHTMLAttributes<HTMLInputElement>, 'name' | 'id'> & {
89
+ as?: 'input';
90
+ };
91
+ type CheckoutSelectProps = BaseFieldProps & Omit<SelectHTMLAttributes<HTMLSelectElement>, 'name' | 'id'> & {
92
+ as: 'select';
93
+ children: ReactNode;
94
+ };
95
+ /**
96
+ * One labelled field: label (with "(optional)"), hint, the control and its error text, wired with `aria-describedby`
97
+ * and `aria-invalid`. Required unless `optional`. `as="select"` renders a `<select>` with the given options.
98
+ */
99
+ declare function CheckoutField(props: CheckoutFieldProps | CheckoutSelectProps): react.JSX.Element;
100
+
101
+ export { CheckoutField as C, ErrorSummary as E, type FieldErrors as F, type UseFieldErrorsOptions as U, type CheckoutFieldClassNames as a, type CheckoutFieldProps as b, type CheckoutSelectProps as c, type ErrorSummaryItem as d, type ErrorSummaryProps as e, type FieldErrorsState as f, type FieldMessages as g, fieldMessages as h, useFieldErrors as u, validationMessage as v };
package/dist/payments.cjs CHANGED
@@ -884,6 +884,7 @@ var LOGOS = {
884
884
  "mastercard": { src: "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 1000 618%22%3E%3Cpath fill=%22%23EB001B%22 d=%22M308 0a309 309 0 1 0 2 0z%22/%3E%3Cpath fill=%22%23F79E1B%22 d=%22M690 0a309 309 0 1 0 2 0z%22/%3E%3Cpath fill=%22%23FF5F00%22 d=%22M500 66a309 309 0 0 0 0 486 309 309 0 0 0 0-486%22/%3E%3C/svg%3E", ar: 1.618, mono: false },
885
885
  "mercadopago": { src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARwAAABKCAMAAABeihuMAAAAdVBMVEVMaXEJAIAJAIAHAIEJAH8JAH8JAIALAIMJAH8JAH8JAH8KAIAKAH8JAH8JAH8JAH8KAID///8AvP8PEIomKZdESafp6PQIJZkGP6sBnOoCh9x/gMEFVrvW1ev29vsAtfthZbUDdtC+u96WlcypqNQEZ8YBq/T2IV9RAAAAEHRSTlMAPcQdoLJNDnWO1Cz44u5ezseTAgAAAAlwSFlzAAALEgAACxIB0t1+/AAADNNJREFUeJztXNeSozoQJZlom/YCTjin///EW1J3C0kI7Amerbm152XKjMDoqLNa9rx/+Ic3I0nCMCwQYRgmiferERbFd8wg8cssmEEf8yBK49D7jYjnAOB/8SFJnOVERbVar3e73e5+3+126/WqouuzqPx1BIVT+Co5RYrErNb37eb4p4fH9rxbIUHZV1fhZ5HKt/78O4coMqvd1kGLjs15LYRoHv0ifrIvkRNPhCKtnxGjCJISlKfJ/5+cJBXmd719jRjFTwUwzcL/NzlJOgdYnV+UGR3b9Ufo8bPJZMK2qkijySSLTclL4jSKoqxv78Myy6KSPhRlFkVZat6bxFkkHm/eW6TicYlNTphGQZ4HLziWcgaw+pjQaOIj6HlJuWJ2grnveeGEg4NUm18m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ixblJFA8Vz1o4dR8i+QTJykvP7Kk/YtXG/BVQsGDsWcsbNli3WmQea17nXXb57Mvpd1PiBpjcyyaEeFLYydFyDEqpctdKkLrbfx86Y8BzPuzvuKTw2rgOxiMf6WRGBv2qW+j6dbBCKg7ELlikoo1IyPc1iP+aKhgj21KGFJPEpQX9DgNx75RGReAFkvEfkxnXYRdLASXmp9rRjR92GyOmfgpm/9QRld1rr0/Q85LEHXMfhoAPJmdsT4/MaCtRuYQxkcnotJVwEexe0E3Prz5zW25AdfmYcyXfP7fNxVnw86b8W5lyYQ5nsvJsb7aylMLxDh6menMaSGD+LRjEMHyeCoHAUlvOudhXS9XmpgkD7bSc/cSqZ7aPEylWhcavTma2wxJNTjCp9iLNJoA4ICxRZkM9msyBKzR2bkI71JqYH52O9XOd4N3iVCKvd8GlFFhl1sKa3QTAAK7f6AMqR0PJHwCeMFUQbiVuExPEqkxitzex7yAkjAT5wlr+rWPw6tLPaHVar9e5+P5+32+35fL7rv4OiYfbKofIPSY5WQ6adKmcy+4Pwu666j6A74P595HCncJTySfq/qFWEhCuVL2OevWpFkJxXjaj9Hn9bcBBFd8j4KT70AzrZh4J9s3N2+FT8jyPpfnhphJiPutI0CCYfyKDpRDXJzduDvQ8h8dPI+ZNdP/ajXfiTNVJsxn+J468hScRPvckDX74vf/DtJ3VfNO34/o9+5T94Y/gPvUlwdceZIU0AAAAASUVORK5CYII=", ar: 3.838, mono: false },
886
886
  "oxxo": { src: "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 version=%221.0%22 viewBox=%2235.43 35.45 885.83 448.9%22%3E%3Cpath d=%22M-792.46-878.05c0-29.6 23.78-53.62 53.13-53.62H40.12c29.33 0 53.13 24.02 53.13 53.62v339.17c0 29.6-23.8 53.6-53.13 53.6h-779.45c-29.35 0-53.13-24-53.13-53.6z%22 style=%22fill:%23fff;fill-opacity:1;fill-rule:nonzero;stroke:none%22 transform=%22translate(827.89 968.22)%22/%3E%3Cpath d=%22M-791.84-883.46c0-27.22 21.88-49.3 48.86-49.3h787.5c26.99 0 48.85 22.08 48.85 49.3v1.57h-885.21zM93.37-534.4v1.22c0 27.23-21.86 49.31-48.84 49.31h-787.5c-26.99 0-48.87-22.08-48.87-49.3v-1.23z%22 style=%22fill:%23fbb110;fill-opacity:1;fill-rule:nonzero;stroke:none%22 transform=%22translate(827.89 968.22)%22/%3E%3Cpath d=%22M-179.2-708.84c0 68.92 55.35 124.79 123.66 124.79 68.29 0 123.67-55.87 123.67-124.8s-55.38-124.8-123.67-124.8c-68.3 0-123.66 55.87-123.66 124.82m-589.6 0c0 68.92 55.37 124.79 123.68 124.79 68.29 0 123.67-55.87 123.67-124.8s-55.38-124.81-123.67-124.81c-68.3 0-123.69 55.87-123.69 124.82m862.17 150.8h-609.75c10.99-7.78 21.22-18.43 32.39-32.8l62.11-80 27.13 34.6 30.19-40.52-26.4-33.9 63.22-81.44c20.07-25.83-18.31-56.19-38.4-30.36L-422-750.47l-56.8-72.93c-20.1-25.76-58.42 4.67-38.32 30.46l64.2 82.3-69.46 89.44c-24.68 31.78-49.31 60.92-98.2 63.17h-171.26v-300.24h606.54c-10.43 7.7-20.27 18-30.94 31.76l-62.1 79.96-27.15-34.57-30.16 40.52 26.4 33.89-63.25 81.43c-20.05 25.83 18.34 56.19 38.4 30.36l55.89-71.96 56.8 72.91c20.1 25.78 58.42-4.65 38.32-30.43l-64.2-82.34 69.46-89.41c22.67-29.23 45.32-56.22 86.8-62.12h184.4zm-222.94-150.81c0-41.28 33.15-74.73 74.03-74.73s74.02 33.45 74.02 74.73c0 41.25-33.13 74.7-74.02 74.7s-74.03-33.45-74.03-74.7m-589.58 0c0-41.28 33.15-74.73 74.03-74.73 40.87 0 74.02 33.45 74.02 74.73 0 41.25-33.15 74.7-74.02 74.7-40.88 0-74.03-33.45-74.03-74.7%22 style=%22fill:%23e70020;fill-opacity:1;fill-rule:nonzero;stroke:none%22 transform=%22translate(827.89 968.22)%22/%3E%3C/svg%3E", ar: 1.973, mono: false },
887
+ "paquetexpress": { src: "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%2217 27 155 34%22%3E%3Crect x=%2217%22 y=%2227%22 width=%22155%22 height=%2234%22 rx=%223%22 fill=%22%23002a52%22/%3E%3Cg fill=%22%23FFF%22 fill-rule=%22evenodd%22%3E%3Cpath d=%22M35.6 46.8V30.3h3.3c1.7 0 3 .4 3.9 1.2.8.8 1.3 2 1.3 3.6s-.4 2.8-1.3 3.6c-.8.9-1.9 1.3-3.4 1.3h-.7l-.1 6.8h-3zm3-9.3h.4c.7 0 1.2-.2 1.5-.6.4-.4.6-1 .6-1.7 0-.8-.2-1.4-.5-1.8-.4-.4-.9-.5-1.6-.5h-.4v4.6zm26.6 9L63.5 48 62 46.3c-.3.2-.7.4-1.1.5-.4.1-.9.2-1.4.2-1.8 0-3.2-.8-4.2-2.3-.9-1.5-1.4-3.6-1.4-6.4 0-2.5.5-4.5 1.5-6s2.3-2.2 4.1-2.2c1.8 0 3.1.7 4.1 2.3 1 1.5 1.5 3.6 1.5 6.4 0 1.3-.1 2.5-.4 3.5-.2.9-.6 1.7-1.1 2.3l1.6 1.9zm-5.2-6l1.5 1.7c.1-.4.2-1 .3-1.5.1-.6.1-1.3.1-2.1 0-1.8-.2-3.1-.6-4-.4-.9-1-1.4-1.8-1.4-.9 0-1.5.5-1.9 1.4-.4.9-.6 2.4-.6 4.3 0 1.6.2 2.9.6 3.8.5.8 1.1 1.3 1.8 1.3.1 0 .2 0 .3-.1h.2L58.3 42l1.7-1.5zm16.5-10.2v10.4c0 1.3 0 2.2-.1 2.7s-.2 1-.4 1.3c-.4.8-.9 1.4-1.7 1.8-.7.3-1.6.5-2.8.5-1.1 0-2.1-.2-2.8-.5-.8-.4-1.3-1-1.7-1.8-.2-.4-.3-.8-.4-1.3 0-.6-.1-1.5-.1-2.7V30.3h3.2v10.6c0 1.4.1 2.3.4 2.7.3.3.7.5 1.4.5s1.2-.2 1.4-.6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.6 46.8h.5v-.5h-.5zM168.1 45.3h.8c.1 0 .2-.1.2-.1V45v-.2c-.1-.1-.1-.1-.2-.1-.1-.1-.2-.1-.4-.1h-.4v.7zm-.5 1.5v-2.6h1.1c.2 0 .4 0 .6.1.1 0 .2.1.3.2 0 .1.1.3.1.4 0 .2-.1.4-.2.5-.1.2-.3.2-.5.3.1 0 .2.1.3.2 0 .1.1.2.3.4l.3.5h-.6l-.4-.5c-.1-.2-.2-.4-.3-.4 0-.1-.1-.1-.1-.1-.1-.1-.2-.1-.3-.1h-.1v1.1h-.5zM170.2 46.8h.4v-.5h-.4z%22%3E%3C/path%3E%3C/g%3E%3C/svg%3E", ar: 4.559, mono: false },
887
888
  "paypal": { src: "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 1310 439.6%22%3E%3Cpath d=%22M1310 0v328.3h-74.7V0zm-102.2 110.8v218.1h-66.4v-18.8c-8.4 8.2-18 14.4-28.6 18.8a87 87 0 0 1-34.7 7c-15.6 0-30.1-2.9-43.4-8.7-13.3-6.1-24.9-14.4-34.7-24.8-9.9-10.5-17.7-22.7-23.5-36.6-5.5-14.2-8.2-29.5-8.2-45.8s2.7-31.4 8.2-45.3c5.8-14.2 13.6-26.6 23.5-37.1a104.5 104.5 0 0 1 34.7-24.4c13.3-6.1 27.8-9.2 43.4-9.2 12.4 0 24 2.3 34.7 7a88 88 0 0 1 28.6 18.8V111h66.4zm-117.7 158.7c13.6 0 24.7-4.6 33.4-14q13.5-13.95 13.5-35.7c0-21.75-4.5-26.5-13.5-35.7-8.7-9.3-19.9-14-33.4-14s-24.9 4.6-33.9 14c-8.7 9.3-13 21.2-13 35.7s4.4 26.5 13 35.7c9 9.3 20.3 14 33.9 14M861.7 0c19.7 0 36.5 2.8 50.4 8.3s25.6 13.2 35.2 23.1c9.8 10.2 17.5 21.8 23 34.9s8.2 27.2 8.2 42.3-2.7 29.2-8.2 42.3a112 112 0 0 1-23 34.9c-9.5 9.9-21.3 17.6-35.2 23.1s-30.7 8.3-50.4 8.3h-36v111.6h-76V0zm-10.9 149.6c10.2 0 17.9-1 23.5-3.1 5.8-2.3 10.6-5.3 14.3-8.7 7.8-7.3 11.7-17 11.7-29.2s-3.9-21.9-11.7-29.2c-3.8-3.5-8.5-6.3-14.3-8.3-5.5-2.3-13.3-3.5-23.5-3.5h-25.2v82zm-381.1-38.8h82.5l56 104.6h.9L659 110.8h76.4L571.7 439.6h-76l74.7-150.4zm-14.7 0v218.1h-66.4v-18.8c-8.4 8.2-18 14.4-28.6 18.8a87 87 0 0 1-34.7 7c-15.6 0-30.1-2.9-43.4-8.7-13.3-6.1-24.9-14.4-34.7-24.8-9.8-10.5-17.7-22.7-23.5-36.6-5.5-14.2-8.2-29.5-8.2-45.8s2.7-31.4 8.2-45.3c5.8-14.2 13.6-26.6 23.5-37.1a103.5 103.5 0 0 1 34.7-24.4c13.3-6.1 27.8-9.2 43.4-9.2 12.4 0 24 2.3 34.7 7a88 88 0 0 1 28.6 18.8V111H455zM337.3 269.5c13.6 0 24.7-4.6 33.5-14q13.5-13.95 13.5-35.7c0-21.75-4.5-26.5-13.5-35.7-8.7-9.3-19.9-14-33.5-14s-24.9 4.6-33.9 14c-8.7 9.3-13 21.2-13 35.7s4.4 26.5 13 35.7c9 9.3 20.3 14 33.9 14M112 0c19.7 0 36.5 2.8 50.4 8.3s25.6 13.2 35.2 23.1c9.8 10.2 17.5 21.8 23 34.9s8.2 27.2 8.2 42.3-2.7 29.2-8.2 42.3a112 112 0 0 1-23 34.9c-9.5 9.9-21.3 17.6-35.2 23.1s-30.7 8.3-50.4 8.3H76v111.6H0V0zm-10.8 149.6c10.2 0 17.9-1 23.5-3.1 5.8-2.3 10.6-5.3 14.3-8.7 7.8-7.3 11.7-17 11.7-29.2s-3.9-21.9-11.7-29.2c-3.8-3.5-8.5-6.3-14.3-8.3-5.5-2.3-13.3-3.5-23.5-3.5H76v82z%22/%3E%3C/svg%3E", ar: 2.98, mono: true },
888
889
  "santander": { src: "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 version=%221.0%22 viewBox=%224 3.75 391.5 79%22%3E%3Cpath d=%22M-137.26 287.82a17.5 17.5 0 0 0 .55 7.23c.95 2.87 2.27 4.94 7.12 11.25 5.12 6.66 6.76 9.08 7.98 12.53 1 2.83 1.02 4.46.59 7.02 4.49.86 11.84 3.24 16.77 6.2 4.57 2.81 7.9 6.46 9.11 10 .72 2.09.7 5.33-.07 7.36a16 16 0 0 1-3.22 5.2c-5.9 6.46-17.6 11.1-31.67 12.59-3.11.32-10.74.56-13.36.4-18.8-1.1-33.92-7.59-38.22-16.42-1.8-3.67-1.75-6.83.14-10.46 1.55-3 5.82-6.7 10.83-9.4a85 85 0 0 1 14.2-5.43c.24 3.17 6.4 10.74 8.45 13.42 4.46 5.84 6.22 8.62 7.48 10.85.76 1.33 1.18 2.19.97 4.74 0 0 1.72-1.56 2.36-2.87.84-1.71 1.14-3.44.98-5.67-.2-2.68-.65-4.32-1.93-6.94-1.25-2.55-3.03-5.13-6.43-9.3-4.79-5.88-6.56-9.1-7.3-13.3-.8-4.66.5-9.6 3.18-12.02a10 10 0 0 1 1.53-1.04s-.08 1.2-.08 2.57c0 2.88.33 4.38 1.43 6.58 1.38 2.73 3.28 5.28 9.11 12.22 5.16 6.14 6.76 9.26 6.76 13.16v1.88s1.37-1.04 2-2c2-3.01 2.32-7.72.8-11.9-1.05-2.86-2.74-5.46-7.74-11.75-5.1-6.4-7.23-11.53-7.23-15.8s.92-8.35 4.91-10.9%22 style=%22fill:%23fe001e;fill-opacity:1;display:inline%22 transform=%22translate(184.65 -280.17)scale(.98661)%22/%3E%3Cg style=%22fill:%23fe001e;fill-opacity:1%22%3E%3Cpath d=%22M-41.6 350.75c.12-1.43.02-2.84-.14-3.59-.61-2.94-2.79-5.9-5.93-8.08a64 64 0 0 0-6.79-3.51c-5.94-2.75-7.6-3.74-9.09-5.4a7.2 7.2 0 0 1-2-5.38c0-1.55.08-2.01.58-3.1 1.62-3.52 5.65-5.4 10.35-4.8 2.76.35 4.21.97 5.84 2.5 1.7 1.59 2.57 3.43 3.04 6.46l.14 1.71h2.57l-.22-11.75-.85-.21c-.65-.16-4.9-.97-7.16-1.26-3.37-.42-4.73-.47-6.71-.24-3.84.44-7.01 1.9-9.4 4.31a12.2 12.2 0 0 0-3.81 8.4c-.2 3.42.9 6.25 3.34 8.67 2.04 2.03 2.92 2.56 9.24 5.57 8.1 3.85 9.93 4.99 11.16 7.88 1.06 2.51 1.14 5.33.04 7.59-2.82 5.76-11.7 7.26-17.22 2.92a11.4 11.4 0 0 1-4.06-6.61l-.26-1.34h-2.19l.39 11.26s4.2 1.13 6.17 1.33c1.48.16 2.95.45 4.44.45 3 0 4.38.39 7.48-.64 3.2-1.07 10.26-3.2 11.06-13.14m19.71-18.49c3.42 0 6.4 1.5 7.83 3.7a8.6 8.6 0 0 1 1.36 5.06v16.24c0 1.93 1.39 2.55 3.4 1.87l1.51-.58v2.13l-7.48 3.27c-.87.39-1.46-.5-1.88-2.13l-.47-1.57-1.24.98a11.7 11.7 0 0 1-7.52 2.66c-3.23.01-5.34-.43-7.44-3.78a8 8 0 0 1-.26-6.4c.96-2.18 2.86-3.3 10.85-6.39l5.4-2.02v-1.5c0-5.55-1.5-7.26-3.42-8.33-1.55-.86-3.6-.64-5.56.64-1.61 1.06-2.1 2.84-1.27 4.67.64 1.41.42.97.42 1.02l-4.39 2.31s-.76-1.3-.97-2c-1.01-3.3.28-5.17 5.24-7.9 2.59-1.42 4.11-1.95 5.89-1.95m4.06 15.39s-7.03 2.97-8.38 3.65c-1.08.55-2.32 1.53-2.73 2.33a5 5 0 0 0 .21 4.06 5.4 5.4 0 0 0 2.35 2.35c.35.15 1.53.42 2.35.43q2.52.02 5.22-2.18l.98-.81zm22.01-15.39v5.75l1.46-1.39c3.19-3 6.23-4.36 8.58-4.36 5.34 0 10.25 4.7 10.04 11.33v15.38c0 1.71.43 2.78 2.14 2.78h2.77v2.14H14.44v-2.14h2.14c1.7 0 2.35-1.07 2.35-2.78V343.6c0-3.2-1.18-4.8-2.14-5.77-1.28-1.28-2.84-1.64-5.13-1.5-1.77.12-3.6 1.06-5.68 2.75l-1.37 1.1v19.87c0 1.07.43 1.71 1.5 1.71h2.78v2.14H-5.64v-2.14h1.92c1.7 0 3-1.07 3-2.78v-16.45c0-4.27-1.3-5.55-4.92-3.63v-2.29c2.35-.7 6.62-2.84 8.97-4.34zm41.23 31.63c1.93 0 2.38-.22 4.17-1.73l3.52-2.97-.85-1.5-1.57.84c-2.35 1.25-4.2 1.51-6.55.44-2-.9-3.2-4.06-3.2-5.77v-17.3h9.82l1.07-3h-10.9v-9.82h-1.06c-2.57 4.7-6.41 9.18-11.11 11.96v.86h6.83v17.3c0 4.06 1.5 7.05 3.85 8.76a8.6 8.6 0 0 0 5.98 1.93m22.65-31.63c3.42 0 6.41 1.5 7.83 3.7a8.6 8.6 0 0 1 1.36 5.06v16.24c0 1.93 1.4 2.55 3.4 1.87l1.51-.58v2.13l-7.48 3.27c-.87.39-1.46-.5-1.87-2.13l-.48-1.57-1.24.98a11.7 11.7 0 0 1-7.52 2.66c-3.22.01-5.34-.43-7.44-3.78a8 8 0 0 1-.26-6.4c.96-2.18 2.87-3.3 10.85-6.39l5.4-2.02v-1.5c0-5.55-1.5-7.26-3.42-8.33-1.54-.86-3.6-.64-5.55.64-1.62 1.06-2.11 2.84-1.28 4.67.64 1.41.42.97.42 1.02l-4.39 2.31s-.75-1.3-.97-2c-1-3.3.28-5.17 5.24-7.9 2.6-1.42 4.11-1.95 5.9-1.95m4.06 15.39s-7.03 2.97-8.38 3.65c-1.08.55-2.32 1.53-2.73 2.33a5 5 0 0 0 .21 4.06 5.4 5.4 0 0 0 2.35 2.35c.36.15 1.53.42 2.35.43q2.52.02 5.22-2.18l.98-.81zm22-15.39v5.75l1.47-1.39c3.18-3 6.22-4.36 8.57-4.36 5.34 0 10.26 4.7 10.04 11.33v15.38c0 1.71.43 2.78 2.14 2.78h2.78v2.14h-14.75v-2.14h2.14c1.7 0 2.35-1.07 2.35-2.78V343.6c0-3.2-1.18-4.8-2.14-5.77-1.28-1.28-2.84-1.64-5.12-1.5-1.78.12-3.6 1.06-5.7 2.75l-1.36 1.1v19.87c0 1.07.43 1.71 1.5 1.71h2.78v2.14H84.3v-2.14h1.92c1.71 0 3-1.07 3-2.78v-16.45c0-4.27-1.29-5.55-4.92-3.63v-2.29c2.35-.7 6.62-2.84 8.97-4.34zm63.46 27.99v-2.13c-2.35 1.07-3.42 1.07-4.23.52-1.15-.78-1.12-2.23-1.12-2.23v-47h-.64a49 49 0 0 1-10.04 4.9v2.36c1.71-.64 2.99-.98 4.06-.43.7.39 1.07.85 1.07 1.92v15.98l-1.26-.5c-2.51-1.03-3.81-1.26-6.86-1.26-2.55 0-3.08.08-4.6.58-7.02 2.35-11.52 9.21-11.15 17.03.21 4.47 1.5 7.98 4.43 10.48 2.99 2.56 5.55 3.42 8.54 3.42 4.06 0 6.41-.81 9.36-2.81.9-.61 1.75-1.25 1.75-1.25a8.7 8.7 0 0 0 1.5 4.48zm-22.15-.38c-4-1.42-6.9-6.35-7.27-12.33-.47-7.48 3.67-12.71 10.06-12.71 2.69 0 4.75.73 7.23 2.58l1.23.91-.1 19.2-1.38.83a10.4 10.4 0 0 1-6.21 1.83c-2 .07-2.67.01-3.56-.3m45.11 3.69a26 26 0 0 0 6.95-3.1v-2.14c-2.35 1.71-6.08 2.77-9.4 2.78q-5.43 0-8.34-3.2c-2.83-3.16-3.63-5.77-4.12-12.18h22.5s0-3.21-1.28-6.2c-.88-2.05-1.71-3.63-4.06-5.13-2.2-1.4-5.17-2-7.7-2-2.62-.03-3.02.02-4.45.54-6.65 2.43-11.17 9.32-10.62 16.17.54 6.63 4.4 11.94 10.25 14.07 2.59.95 7.47 1.13 10.27.39m-12.28-26.4c1.5-1.49 3.2-2.34 5.98-2.34 2.56 0 4.27.64 5.98 2.35 1.29 1.28 1.93 2.35 2.2 5.98h-16.78c.27-2.56 1.12-4.49 2.62-5.98m32.48-4.92v7.06a23 23 0 0 1 4.05-5.13 7 7 0 0 1 4.92-1.93c1.07 0 3.84.86 3.84.86v6.4h-1.06c-.43-1.7-1.93-2.55-4.06-2.55-2.78 0-4.6 1.12-5.72 2.8s-1.55 2.54-1.55 6.17v14.1c0 1.07.43 1.71 1.5 1.71h2.78v2.14h-14.53v-2.14h1.92c1.7 0 3-1.07 3-2.78v-16.45c0-4.7-1.72-4.49-4.71-3.2v-2.14c2.78-1.07 6.2-2.57 8.76-4.92z%22 style=%22fill:%23fe001e;fill-opacity:1;display:inline%22 transform=%22translate(184.65 -280.17)scale(.98661)%22/%3E%3C/g%3E%3C/svg%3E", ar: 4.956, mono: false },
889
890
  "scotiabank": { src: "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220.14 0.09 71.91 10.28%22%3E%3Cpath d=%22M6.73 8.37q.24-.6.23-1.25c.02-.63-.2-1.24-.6-1.72a5 5 0 0 0-2.31-1.23q-.3-.09-.6-.22-.27-.13-.46-.33a.8.8 0 0 1-.2-.55c.01-.3.18-.57.44-.7a2 2 0 0 1 1.68 0q.36.12.69.32l.9-1.8A5 5 0 0 0 3.77.13q-.7 0-1.36.23A3 3 0 0 0 .7 2.06q-.24.6-.23 1.25c.02.68.31 1.32.8 1.8q.7.6 1.6.9l.8.27q.3.12.57.3a1 1 0 0 1 .31.36q.1.2.07.43a1 1 0 0 1-.3.58q-.44.31-.98.27-.61 0-1.18-.28a9 9 0 0 1-.95-.53L.13 9.27a4.8 4.8 0 0 0 4.62.84q.66-.23 1.21-.68.5-.46.77-1.06m5.82-.58a1.57 1.57 0 1 1 0-1.96l1.4-1.41a3.5 3.5 0 0 0-2.62-1.17c-1.96 0-3.65 1.4-3.65 3.55 0 2.16 1.7 3.56 3.66 3.56 1 0 1.96-.42 2.63-1.16zm0 0%22 style=%22fill:%23eb0f19;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:.352778%22/%3E%3Cpath d=%22M17.6 3.25a3.56 3.56 0 1 0-.01 7.11 3.56 3.56 0 0 0 0-7.11m0 5.12a1.57 1.57 0 1 1 .02-3.14 1.57 1.57 0 0 1-.02 3.14m8.09-4.95h-.97v-2.1h-2.13v2.1h-.97v1.92h.97v4.85h2.13V5.34h.97zM27.72.13a1.19 1.19 0 1 0 0 2.38 1.19 1.19 0 0 0 0-2.38m-1.06 3.29h2.12v6.77h-2.12zM37.1 10.2V3.42h-2.08v.71l-.2-.16a2.6 2.6 0 0 0-1.79-.72c-1.83 0-3.37 1.63-3.37 3.55 0 1.93 1.55 3.56 3.37 3.56.67 0 1.31-.25 1.8-.72l.2-.17v.72Zm-3.72-1.8a1.6 1.6 0 1 1 .02-3.2 1.6 1.6 0 0 1-.02 3.2m6.88 1.8v-.72l.2.17a2.6 2.6 0 0 0 1.8.72c1.82 0 3.37-1.63 3.37-3.56s-1.55-3.56-3.38-3.56c-.67 0-1.31.26-1.8.72l-.19.17V.3H38.2v9.9Zm.05-3.39a1.6 1.6 0 1 1 1.6 1.6 1.6 1.6 0 0 1-1.6-1.6m13.47 3.39V3.42h-2.07v.71l-.2-.16a2.6 2.6 0 0 0-1.79-.72c-1.83 0-3.37 1.63-3.37 3.55 0 1.93 1.55 3.56 3.37 3.56.67 0 1.32-.25 1.8-.72l.2-.17v.72Zm-3.7-1.8a1.6 1.6 0 1 1 0-3.2 1.6 1.6 0 0 1 0 3.2m8.12-3.16c.69 0 1.26.57 1.26 1.27v3.7h2.12V6.24c0-1.8-1.04-2.97-2.68-2.97-.68 0-1.39.3-1.97 1.24V3.44H54.8v6.76h2.11V6.5a1.27 1.27 0 0 1 1.28-1.26m11.13 4.96-2.6-3.4 2.42-3.38h-2.48L64.7 6.16V.3h-2.13v9.9h2.13V7.4l2.14 2.8zm1.5-2.37a1.19 1.19 0 1 0-.01 2.37 1.19 1.19 0 0 0 .01-2.37m0 2.13a.95.95 0 1 1 0-1.9.95.95 0 0 1 0 1.9m0 0%22 style=%22fill:%23eb0f19;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:.352778%22/%3E%3Cpath d=%22M70.82 9.2h-.19v.46h-.23v-1.3h.5c.23 0 .42.2.42.43q-.02.27-.24.38l.27.49h-.28Zm-.19-.2h.27q.18-.02.2-.2a.2.2 0 0 0-.2-.2h-.27zm0 0%22 style=%22fill:%23eb0f19;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:.352778%22/%3E%3C/svg%3E", ar: 6.995, mono: false },
@@ -936,8 +937,8 @@ var LIST = [
936
937
  B("googlepay", "Google Pay", "wallet", "#FFFFFF", "#3C4043", "G Pay"),
937
938
  // Cash points and transfers (Mexico).
938
939
  B("oxxo", "OXXO", "cash", "#E21E26", "#FFE600"),
939
- B("spei", "SPEI", "bank", "#14365F", "#FFFFFF"),
940
- B("stp", "STP", "bank", "#14365F", "#FFFFFF", "SPEI"),
940
+ B("spei", "SPEI", "bank", "#14365F", "#FFFFFF", void 0, "transfer"),
941
+ B("stp", "STP", "bank", "#14365F", "#FFFFFF", "SPEI", "transfer"),
941
942
  B("7eleven", "7-Eleven", "cash", "#00704A", "#FFFFFF", "7-11"),
942
943
  B("circlek", "Circle K", "cash", "#DA291C", "#FFFFFF", "K"),
943
944
  B("soriana", "Soriana", "cash", "#C8102E", "#FFFFFF"),
@@ -1098,6 +1099,14 @@ function BrandMark({ brand, logoUrl, size = 24, title, className }) {
1098
1099
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M24 8.52a9 9 0 0 1 0 14.96a9 9 0 0 1 0-14.96z", fill: "#FF5F00" })
1099
1100
  ] });
1100
1101
  }
1102
+ if (found?.shape === "transfer") {
1103
+ const label = (found.mark ?? found.name).split("\n")[0];
1104
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 48 32", width, height, className, style, "data-sf-brand-mark": key, "data-sf-brand-source": "badge", focusable: "false", ...a11y, children: [
1105
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "0.5", y: "0.5", width: "47", height: "31", rx: "5", fill: found.bg, stroke: ring }),
1106
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 12h11m0 0-3-3m3 3-3 3M17 20H6m0 0 3-3m-3 3 3 3", fill: "none", stroke: found.fg, strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }),
1107
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: "33", y: "16.5", dominantBaseline: "central", textAnchor: "middle", fill: found.fg, fontFamily: "system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif", fontWeight: 800, fontSize: 11, textLength: 22, lengthAdjust: "spacingAndGlyphs", children: label })
1108
+ ] });
1109
+ }
1101
1110
  const text = found ? found.mark ?? found.name : monogram(brand ?? "");
1102
1111
  const bg = found?.bg ?? "var(--sf-brand-mark-bg, #E7E9EE)";
1103
1112
  const fg = found?.fg ?? "var(--sf-brand-mark-fg, #2B2F38)";