@evervault/js 2.23.0 → 2.24.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.
- package/dist/evervault-js.js +1 -1
- package/dist/evervault-js.umd.cjs +1 -1
- package/dist/evervault.d.ts +77 -40
- package/package.json +4 -4
package/dist/evervault-js.js
CHANGED
|
@@ -285,7 +285,7 @@ function a(e, r) {
|
|
|
285
285
|
borderBottomLeftRadius: "var(--ev-roundness, 6px)"
|
|
286
286
|
} }
|
|
287
287
|
},
|
|
288
|
-
"[ev-component=card][ev-fields*=cvc][ev-fields*=expiry]": {
|
|
288
|
+
"[ev-component=card][ev-layout=auto][ev-fields*=cvc][ev-fields*=expiry]": {
|
|
289
289
|
"& .field[ev-name=expiry]": { "& input": { borderBottomLeftRadius: "var(--ev-roundness, 6px)" } },
|
|
290
290
|
"& .field[ev-name=cvc]": {
|
|
291
291
|
marginLeft: "-1px",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Evervault={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t={primary:`--ev-color-primary`,greyTone:`--ev-grey-tone`,roundness:`--ev-roundness`,font:`--ev-font-family`};function n(e,n){if(!n)return e;let{selectors:r}=n,i={...e[`:root`]};for(let[e,r]of Object.entries(t)){let t=n[e];t&&(i[r]=t)}return{...e,...r??{},":root":{...i,...r?.[`:root`]??{}}}}function r(e,n){let r=typeof e==`function`||e!=null&&(`styles`in e||`fonts`in e||`fontFaces`in e);return r&&typeof e==`object`&&[...Object.keys(t),`selectors`].some(t=>t in e)&&console.warn(`Evervault: the first argument looks like a theme but also has preset config keys, which are ignored. Pass the config as the second argument, for example clean(theme, { primary }).`),r||e==null?[e??void 0,n]:[void 0,e]}function i(e,t){let[i,a]=r(e,t);return e=>({styles:{...n({":root":{"--icon-offset":`1.9rem`},body:{paddingBottom:2,fontFamily:`var(--ev-font-family, inherit)`},label:{fontSize:14,marginBottom:4,display:`block`,color:`#0a2540`},input:{height:40,fontSize:16,borderRadius:`var(--ev-roundness, 6px)`,color:`#0a2540`,padding:`0 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`,boxShadow:`0px 1px 1px rgba(0, 0, 0, .03), 0px 3px 6px rgba(0, 0, 0, .02)`,"&::placeholder":{color:`var(--ev-grey-tone, #717f96)`},"&:focus":{outline:`none`,borderColor:`var(--ev-color-primary, #63e)`}},textarea:{height:40,fontSize:16,borderRadius:`var(--ev-roundness, 6px)`,color:`#0a2540`,padding:`6px 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`,boxShadow:`0px 1px 1px rgba(0, 0, 0, .03), 0px 3px 6px rgba(0, 0, 0, .02)`,"&::placeholder":{color:`var(--ev-grey-tone, #717f96)`},"&:focus":{outline:`none`,borderColor:`var(--ev-color-primary, #63e)`}},select:{height:40,fontSize:16,borderRadius:`var(--ev-roundness, 6px)`,color:`#0a2540`,padding:`6px 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`},button:{fontSize:16,height:40,border:`1px solid #e6ebf1`,padding:`0 12px`},".field[ev-valid=false] input":{color:`#df1c41`,borderColor:`#df1c41`},".error":{color:`#df1c41`,fontSize:`0.75rem`,padding:`0.25rem 0`},"[ev-component=card]":{gap:16},"[ev-component=pin] input":{height:80,fontSize:20,caretColor:`transparent`},"[ev-component=card]:has(.icon)":{"& .field[ev-name=number]":{position:`relative`},"& .icon":{left:10,height:20,position:`absolute`,top:`var(--icon-offset)`},"& .field[ev-name=number] input":{paddingLeft:48}}},a),...i?e.extend(i):{}}})}function a(e,t){let[i,a]=r(e,t);return e=>({styles:{...n({body:{paddingTop:4,fontFamily:`var(--ev-font-family, inherit)`},".field":{position:`relative`},label:{top:10,left:8,zIndex:3,fontSize:14,lineHeight:1,height:`20px`,display:`flex`,color:`var(--ev-grey-tone, #717f96)`,padding:`0 4px`,alignItems:`center`,position:`absolute`,pointerEvents:`none`,transformOrigin:`center left`,transition:`transform 150ms, background 150ms`},input:{height:40,fontSize:16,borderRadius:`var(--ev-roundness, 6px)`,color:`#0a2540`,padding:`0 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`,"&::placeholder":{color:`transparent`},"&:focus":{outline:`none`,borderColor:`var(--ev-color-primary, #63e)`}},textarea:{height:40,fontSize:16,borderRadius:`var(--ev-roundness, 6px)`,color:`#0a2540`,padding:`6 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`,"&::placeholder":{color:`transparent`},"&:focus":{outline:`none`,borderColor:`var(--ev-color-primary, #63e)`}},".field[ev-valid=false] input":{color:`#df1c41`,borderColor:`#df1c41`},".field:focus-within label, .field:not([ev-has-value=false]) label":{background:`white`,transform:`translateY(-100%) scale(0.8)`},".error":{color:`#df1c41`,fontSize:`0.75rem`,padding:`0.25rem 0`},".field:not([ev-valid=false]):focus-within label":{color:`var(--ev-color-primary, #63e)`},".field[ev-valid=false] label":{color:`#df1c41`},".field[ev-has-value=true][ev-valid=true]:not(:focus-within) label":{color:`#0a2540`},"[ev-component=card]":{gap:16},"[ev-component=card]:has(.icon)":{"& .icon":{left:10,height:20,position:`absolute`,top:10,opacity:0},"& .field[ev-name=number]:focus-within, & .field[ev-name=number]:not([ev-has-value=false])":{"& .icon":{opacity:1},"& input":{paddingLeft:45}}}},a),...i?e.extend(i):{}}})}function o(e,t){let[i,a]=r(e,t);return e=>({styles:{...n({":root":{"--icon-offset":`34px`},body:{paddingBottom:2,fontFamily:`var(--ev-font-family, inherit)`},label:{fontSize:14,marginBottom:`0.5rem`,color:`#0a2540`,display:`none`},".field:first-child label":{display:`block`},"fieldset[ev-valid=false]":{paddingBottom:`1.5rem`},input:{height:40,fontSize:16,borderRadius:0,color:`#0a2540`,padding:`0 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`,boxShadow:`0px 1px 1px rgba(0, 0, 0, .03), 0px 3px 6px rgba(0, 0, 0, .02)`,"&::placeholder":{color:`var(--ev-grey-tone, #717f96)`},"&:focus":{outline:`none`,borderColor:`var(--ev-color-primary, #63e)`}},textarea:{height:40,fontSize:16,borderRadius:0,color:`#0a2540`,padding:`6 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`,boxShadow:`0px 1px 1px rgba(0, 0, 0, .03), 0px 3px 6px rgba(0, 0, 0, .02)`,"&::placeholder":{color:`var(--ev-grey-tone, #717f96)`},"&:focus":{outline:`none`,borderColor:`var(--ev-color-primary, #63e)`}},".field[ev-valid=false] input":{color:`#df1c41`,borderColor:`#df1c41`},".error":{color:`#df1c41`,fontSize:`0.75rem`,padding:`0.25rem 0`,position:`absolute`,left:0,bottom:0,display:`none`},".field[ev-valid=false]":{zIndex:4},".field:focus-within":{zIndex:5},"[ev-component=card]":{gap:0,"& .field[ev-valid=false]:nth-child(1) .error":{display:`block`},"& [ev-valid=true]:nth-child(1) + [ev-valid=false] .error":{display:`block`},"& [ev-valid=true]:nth-child(1) + [ev-valid=true]:nth-child(2) + [ev-valid=false] .error":{display:`block`},"& [ev-valid=true]:nth-child(1) + [ev-valid=true]:nth-child(2) + [ev-valid=true]:nth-child(3) + [ev-valid=false] .error":{display:`block`},"& .field:not(:last-child)":{marginBottom:`-1px`},"& .field:first-child":{"& input":{borderTopLeftRadius:`var(--ev-roundness, 6px)`,borderTopRightRadius:`var(--ev-roundness, 6px)`}},"& .field:last-child":{"& input":{borderBottomRightRadius:`var(--ev-roundness, 6px)`,borderBottomLeftRadius:`var(--ev-roundness, 6px)`}}},"[ev-component=card][ev-fields*=cvc][ev-fields*=expiry]":{"& .field[ev-name=expiry]":{"& input":{borderBottomLeftRadius:`var(--ev-roundness, 6px)`}},"& .field[ev-name=cvc]":{marginLeft:`-1px`,"& input":{borderBottomLeftRadius:0}}},"[ev-component=pin]":{gap:0,"& input":{height:60},"& .field:not(:first-child)":{marginLeft:`-1px`},"& .field:first-child input":{borderTopLeftRadius:`var(--ev-roundness, 6px)`,borderBottomLeftRadius:`var(--ev-roundness, 6px)`},"& .field:last-child input":{borderTopRightRadius:`var(--ev-roundness, 6px)`,borderBottomRightRadius:`var(--ev-roundness, 6px)`}},"[ev-component=card]:has(.icon)":{"& .icon":{left:10,height:20,position:`absolute`,top:`var(--icon-offset)`},"& .field[ev-name=number] input":{paddingLeft:48}}},a),...i?e.extend(i):{}}})}function s(e){return typeof window>`u`?``:window.getComputedStyle(document.documentElement).getPropertyValue(e).trim()}var c=null;async function l(){return c||(c=new Promise((e,t)=>{let n=document.createElement(`script`);if(n.src=`https://js.evervault.com/v2`,n.onload=()=>e(),n.onerror=()=>{c=null,t()},!document.head)throw Error(`Expected document.head not to be null. Evervault.js requires a <head> element.`);document.head.appendChild(n)}),c)}async function u(){if(window.Evervault)return window.Evervault;try{return await l(),window.Evervault}catch{throw Error(`Failed to load Evervault.js`)}}async function d(e,t,n){return new(await(u()))(e,t,n)}Promise.resolve().then(()=>{u()}),e.clean=i,e.cssVar=s,e.loadEvervault=d,e.material=a,e.minimal=o});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Evervault={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t={primary:`--ev-color-primary`,greyTone:`--ev-grey-tone`,roundness:`--ev-roundness`,font:`--ev-font-family`};function n(e,n){if(!n)return e;let{selectors:r}=n,i={...e[`:root`]};for(let[e,r]of Object.entries(t)){let t=n[e];t&&(i[r]=t)}return{...e,...r??{},":root":{...i,...r?.[`:root`]??{}}}}function r(e,n){let r=typeof e==`function`||e!=null&&(`styles`in e||`fonts`in e||`fontFaces`in e);return r&&typeof e==`object`&&[...Object.keys(t),`selectors`].some(t=>t in e)&&console.warn(`Evervault: the first argument looks like a theme but also has preset config keys, which are ignored. Pass the config as the second argument, for example clean(theme, { primary }).`),r||e==null?[e??void 0,n]:[void 0,e]}function i(e,t){let[i,a]=r(e,t);return e=>({styles:{...n({":root":{"--icon-offset":`1.9rem`},body:{paddingBottom:2,fontFamily:`var(--ev-font-family, inherit)`},label:{fontSize:14,marginBottom:4,display:`block`,color:`#0a2540`},input:{height:40,fontSize:16,borderRadius:`var(--ev-roundness, 6px)`,color:`#0a2540`,padding:`0 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`,boxShadow:`0px 1px 1px rgba(0, 0, 0, .03), 0px 3px 6px rgba(0, 0, 0, .02)`,"&::placeholder":{color:`var(--ev-grey-tone, #717f96)`},"&:focus":{outline:`none`,borderColor:`var(--ev-color-primary, #63e)`}},textarea:{height:40,fontSize:16,borderRadius:`var(--ev-roundness, 6px)`,color:`#0a2540`,padding:`6px 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`,boxShadow:`0px 1px 1px rgba(0, 0, 0, .03), 0px 3px 6px rgba(0, 0, 0, .02)`,"&::placeholder":{color:`var(--ev-grey-tone, #717f96)`},"&:focus":{outline:`none`,borderColor:`var(--ev-color-primary, #63e)`}},select:{height:40,fontSize:16,borderRadius:`var(--ev-roundness, 6px)`,color:`#0a2540`,padding:`6px 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`},button:{fontSize:16,height:40,border:`1px solid #e6ebf1`,padding:`0 12px`},".field[ev-valid=false] input":{color:`#df1c41`,borderColor:`#df1c41`},".error":{color:`#df1c41`,fontSize:`0.75rem`,padding:`0.25rem 0`},"[ev-component=card]":{gap:16},"[ev-component=pin] input":{height:80,fontSize:20,caretColor:`transparent`},"[ev-component=card]:has(.icon)":{"& .field[ev-name=number]":{position:`relative`},"& .icon":{left:10,height:20,position:`absolute`,top:`var(--icon-offset)`},"& .field[ev-name=number] input":{paddingLeft:48}}},a),...i?e.extend(i):{}}})}function a(e,t){let[i,a]=r(e,t);return e=>({styles:{...n({body:{paddingTop:4,fontFamily:`var(--ev-font-family, inherit)`},".field":{position:`relative`},label:{top:10,left:8,zIndex:3,fontSize:14,lineHeight:1,height:`20px`,display:`flex`,color:`var(--ev-grey-tone, #717f96)`,padding:`0 4px`,alignItems:`center`,position:`absolute`,pointerEvents:`none`,transformOrigin:`center left`,transition:`transform 150ms, background 150ms`},input:{height:40,fontSize:16,borderRadius:`var(--ev-roundness, 6px)`,color:`#0a2540`,padding:`0 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`,"&::placeholder":{color:`transparent`},"&:focus":{outline:`none`,borderColor:`var(--ev-color-primary, #63e)`}},textarea:{height:40,fontSize:16,borderRadius:`var(--ev-roundness, 6px)`,color:`#0a2540`,padding:`6 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`,"&::placeholder":{color:`transparent`},"&:focus":{outline:`none`,borderColor:`var(--ev-color-primary, #63e)`}},".field[ev-valid=false] input":{color:`#df1c41`,borderColor:`#df1c41`},".field:focus-within label, .field:not([ev-has-value=false]) label":{background:`white`,transform:`translateY(-100%) scale(0.8)`},".error":{color:`#df1c41`,fontSize:`0.75rem`,padding:`0.25rem 0`},".field:not([ev-valid=false]):focus-within label":{color:`var(--ev-color-primary, #63e)`},".field[ev-valid=false] label":{color:`#df1c41`},".field[ev-has-value=true][ev-valid=true]:not(:focus-within) label":{color:`#0a2540`},"[ev-component=card]":{gap:16},"[ev-component=card]:has(.icon)":{"& .icon":{left:10,height:20,position:`absolute`,top:10,opacity:0},"& .field[ev-name=number]:focus-within, & .field[ev-name=number]:not([ev-has-value=false])":{"& .icon":{opacity:1},"& input":{paddingLeft:45}}}},a),...i?e.extend(i):{}}})}function o(e,t){let[i,a]=r(e,t);return e=>({styles:{...n({":root":{"--icon-offset":`34px`},body:{paddingBottom:2,fontFamily:`var(--ev-font-family, inherit)`},label:{fontSize:14,marginBottom:`0.5rem`,color:`#0a2540`,display:`none`},".field:first-child label":{display:`block`},"fieldset[ev-valid=false]":{paddingBottom:`1.5rem`},input:{height:40,fontSize:16,borderRadius:0,color:`#0a2540`,padding:`0 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`,boxShadow:`0px 1px 1px rgba(0, 0, 0, .03), 0px 3px 6px rgba(0, 0, 0, .02)`,"&::placeholder":{color:`var(--ev-grey-tone, #717f96)`},"&:focus":{outline:`none`,borderColor:`var(--ev-color-primary, #63e)`}},textarea:{height:40,fontSize:16,borderRadius:0,color:`#0a2540`,padding:`6 12px`,backgroundColor:`#fff`,border:`1px solid #e6ebf1`,boxShadow:`0px 1px 1px rgba(0, 0, 0, .03), 0px 3px 6px rgba(0, 0, 0, .02)`,"&::placeholder":{color:`var(--ev-grey-tone, #717f96)`},"&:focus":{outline:`none`,borderColor:`var(--ev-color-primary, #63e)`}},".field[ev-valid=false] input":{color:`#df1c41`,borderColor:`#df1c41`},".error":{color:`#df1c41`,fontSize:`0.75rem`,padding:`0.25rem 0`,position:`absolute`,left:0,bottom:0,display:`none`},".field[ev-valid=false]":{zIndex:4},".field:focus-within":{zIndex:5},"[ev-component=card]":{gap:0,"& .field[ev-valid=false]:nth-child(1) .error":{display:`block`},"& [ev-valid=true]:nth-child(1) + [ev-valid=false] .error":{display:`block`},"& [ev-valid=true]:nth-child(1) + [ev-valid=true]:nth-child(2) + [ev-valid=false] .error":{display:`block`},"& [ev-valid=true]:nth-child(1) + [ev-valid=true]:nth-child(2) + [ev-valid=true]:nth-child(3) + [ev-valid=false] .error":{display:`block`},"& .field:not(:last-child)":{marginBottom:`-1px`},"& .field:first-child":{"& input":{borderTopLeftRadius:`var(--ev-roundness, 6px)`,borderTopRightRadius:`var(--ev-roundness, 6px)`}},"& .field:last-child":{"& input":{borderBottomRightRadius:`var(--ev-roundness, 6px)`,borderBottomLeftRadius:`var(--ev-roundness, 6px)`}}},"[ev-component=card][ev-layout=auto][ev-fields*=cvc][ev-fields*=expiry]":{"& .field[ev-name=expiry]":{"& input":{borderBottomLeftRadius:`var(--ev-roundness, 6px)`}},"& .field[ev-name=cvc]":{marginLeft:`-1px`,"& input":{borderBottomLeftRadius:0}}},"[ev-component=pin]":{gap:0,"& input":{height:60},"& .field:not(:first-child)":{marginLeft:`-1px`},"& .field:first-child input":{borderTopLeftRadius:`var(--ev-roundness, 6px)`,borderBottomLeftRadius:`var(--ev-roundness, 6px)`},"& .field:last-child input":{borderTopRightRadius:`var(--ev-roundness, 6px)`,borderBottomRightRadius:`var(--ev-roundness, 6px)`}},"[ev-component=card]:has(.icon)":{"& .icon":{left:10,height:20,position:`absolute`,top:`var(--icon-offset)`},"& .field[ev-name=number] input":{paddingLeft:48}}},a),...i?e.extend(i):{}}})}function s(e){return typeof window>`u`?``:window.getComputedStyle(document.documentElement).getPropertyValue(e).trim()}var c=null;async function l(){return c||(c=new Promise((e,t)=>{let n=document.createElement(`script`);if(n.src=`https://js.evervault.com/v2`,n.onload=()=>e(),n.onerror=()=>{c=null,t()},!document.head)throw Error(`Expected document.head not to be null. Evervault.js requires a <head> element.`);document.head.appendChild(n)}),c)}async function u(){if(window.Evervault)return window.Evervault;try{return await l(),window.Evervault}catch{throw Error(`Failed to load Evervault.js`)}}async function d(e,t,n){return new(await(u()))(e,t,n)}Promise.resolve().then(()=>{u()}),e.clean=i,e.cssVar=s,e.loadEvervault=d,e.material=a,e.minimal=o});
|
package/dist/evervault.d.ts
CHANGED
|
@@ -287,6 +287,12 @@ declare type CardBrandName =
|
|
|
287
287
|
| "uatp"
|
|
288
288
|
| "rupay";
|
|
289
289
|
|
|
290
|
+
declare interface CardDefaultValues {
|
|
291
|
+
name?: string;
|
|
292
|
+
// Each <ev-field> by its name.
|
|
293
|
+
fields?: Record<string, string>;
|
|
294
|
+
}
|
|
295
|
+
|
|
290
296
|
declare interface CardEvents {
|
|
291
297
|
ready: () => void;
|
|
292
298
|
error: () => void;
|
|
@@ -307,6 +313,16 @@ declare interface CardExpiry {
|
|
|
307
313
|
|
|
308
314
|
declare type CardField = "name" | "number" | "expiry" | "cvc";
|
|
309
315
|
|
|
316
|
+
declare interface CardFieldMap<T> {
|
|
317
|
+
name?: T;
|
|
318
|
+
number?: T;
|
|
319
|
+
expiry?: T;
|
|
320
|
+
expiryMonth?: T;
|
|
321
|
+
expiryYear?: T;
|
|
322
|
+
cvc?: T;
|
|
323
|
+
fields?: T | Record<string, T>;
|
|
324
|
+
}
|
|
325
|
+
|
|
310
326
|
declare interface CardFieldTranslations<E extends TranslationsObject>
|
|
311
327
|
extends TranslationsObject {
|
|
312
328
|
label?: string;
|
|
@@ -323,26 +339,12 @@ declare interface CardFrameConfig {
|
|
|
323
339
|
acceptedBrands?: CardBrandName[];
|
|
324
340
|
customBrands?: CustomBrand[];
|
|
325
341
|
translations?: Partial<CardTranslations>;
|
|
326
|
-
autoProgress?: boolean
|
|
342
|
+
autoProgress?: boolean | CardFieldMap<boolean>;
|
|
327
343
|
redactCVC?: boolean;
|
|
328
344
|
allow3DigitAmexCVC?: boolean;
|
|
329
|
-
defaultValues?:
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
autoComplete?: {
|
|
333
|
-
name?: boolean;
|
|
334
|
-
number?: boolean;
|
|
335
|
-
expiry?: boolean;
|
|
336
|
-
cvc?: boolean;
|
|
337
|
-
};
|
|
338
|
-
validation?: {
|
|
339
|
-
name?: {
|
|
340
|
-
regex?: RegExp;
|
|
341
|
-
};
|
|
342
|
-
cvc?: {
|
|
343
|
-
optional?: boolean;
|
|
344
|
-
};
|
|
345
|
-
};
|
|
345
|
+
defaultValues?: CardDefaultValues;
|
|
346
|
+
autoComplete?: boolean | CardFieldMap<boolean>;
|
|
347
|
+
validation?: CardValidation;
|
|
346
348
|
agentTools?: AgentToolsFrameConfig;
|
|
347
349
|
}
|
|
348
350
|
|
|
@@ -353,6 +355,11 @@ declare interface CardHostConfiguration {
|
|
|
353
355
|
|
|
354
356
|
declare type CardIcons = Record<CardBrandName | "default", string>;
|
|
355
357
|
|
|
358
|
+
declare interface CardLabelTranslations extends TranslationsObject {
|
|
359
|
+
label?: string;
|
|
360
|
+
placeholder?: string;
|
|
361
|
+
}
|
|
362
|
+
|
|
356
363
|
declare interface CardOptions {
|
|
357
364
|
colorScheme?: ColorScheme;
|
|
358
365
|
icons?: boolean | Partial<CardIcons>;
|
|
@@ -363,26 +370,12 @@ declare interface CardOptions {
|
|
|
363
370
|
acceptedBrands?: CardBrandName[];
|
|
364
371
|
customBrands?: CustomBrand[];
|
|
365
372
|
translations?: Partial<CardTranslations>;
|
|
366
|
-
autoProgress?: boolean
|
|
373
|
+
autoProgress?: boolean | CardFieldMap<boolean>;
|
|
367
374
|
redactCVC?: boolean;
|
|
368
375
|
allow3DigitAmexCVC?: boolean;
|
|
369
|
-
defaultValues?:
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
autoComplete?: {
|
|
373
|
-
name?: boolean;
|
|
374
|
-
number?: boolean;
|
|
375
|
-
expiry?: boolean;
|
|
376
|
-
cvc?: boolean;
|
|
377
|
-
};
|
|
378
|
-
validation?: {
|
|
379
|
-
name?: {
|
|
380
|
-
regex?: RegExp;
|
|
381
|
-
};
|
|
382
|
-
cvc?: {
|
|
383
|
-
optional?: boolean;
|
|
384
|
-
};
|
|
385
|
-
};
|
|
376
|
+
defaultValues?: CardDefaultValues;
|
|
377
|
+
autoComplete?: boolean | CardFieldMap<boolean>;
|
|
378
|
+
validation?: CardValidation;
|
|
386
379
|
agentTools?: AgentToolsConfig;
|
|
387
380
|
}
|
|
388
381
|
|
|
@@ -397,12 +390,15 @@ declare interface CardPayload {
|
|
|
397
390
|
expiry: CardExpiry;
|
|
398
391
|
cvc: string | null;
|
|
399
392
|
};
|
|
393
|
+
// Each value encrypted; null when empty or invalid.
|
|
394
|
+
fields: Record<string, string | null>;
|
|
400
395
|
isValid: boolean;
|
|
401
396
|
isComplete: boolean;
|
|
402
397
|
errors: null | Partial<{
|
|
403
398
|
number?: string;
|
|
404
399
|
cvc?: string;
|
|
405
400
|
expiry?: string;
|
|
401
|
+
fields?: Record<string, string>;
|
|
406
402
|
}>;
|
|
407
403
|
}
|
|
408
404
|
|
|
@@ -413,7 +409,7 @@ declare interface CardSpecNode {
|
|
|
413
409
|
children?: CardSpecNode[];
|
|
414
410
|
}
|
|
415
411
|
|
|
416
|
-
declare type CardSpecNodeType = "row" | CardField;
|
|
412
|
+
declare type CardSpecNodeType = "row" | CardField | ExpiryHalf | "field";
|
|
417
413
|
|
|
418
414
|
declare interface CardTranslations extends TranslationsObject {
|
|
419
415
|
number: CardFieldTranslations<{
|
|
@@ -421,7 +417,25 @@ declare interface CardTranslations extends TranslationsObject {
|
|
|
421
417
|
unsupportedBrand?: string;
|
|
422
418
|
}>;
|
|
423
419
|
expiry: CardFieldTranslations<{ invalid?: string }>;
|
|
420
|
+
// The halves of a split expiry; an invalid date is reported as `expiry`.
|
|
421
|
+
expiryMonth?: CardLabelTranslations;
|
|
422
|
+
expiryYear?: CardLabelTranslations;
|
|
424
423
|
cvc: CardFieldTranslations<{ invalid?: string }>;
|
|
424
|
+
// For an <ev-field> without an `errormessage`.
|
|
425
|
+
field?: { errors?: { required?: string; invalid?: string } };
|
|
426
|
+
// Each <ev-field> by its name, ahead of `field`.
|
|
427
|
+
fields?: Record<string, CustomFieldTranslations>;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
declare interface CardValidation {
|
|
431
|
+
name?: {
|
|
432
|
+
regex?: RegExp;
|
|
433
|
+
};
|
|
434
|
+
cvc?: {
|
|
435
|
+
optional?: boolean;
|
|
436
|
+
};
|
|
437
|
+
// Each <ev-field> by its name.
|
|
438
|
+
fields?: Record<string, CustomFieldValidation>;
|
|
425
439
|
}
|
|
426
440
|
|
|
427
441
|
export declare function clean(config?: PresetConfig): ThemeDefinition;
|
|
@@ -510,6 +524,27 @@ declare interface CustomConfig {
|
|
|
510
524
|
appKey?: CageKey;
|
|
511
525
|
}
|
|
512
526
|
|
|
527
|
+
declare interface CustomFieldTarget {
|
|
528
|
+
field: "field";
|
|
529
|
+
name: string;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
declare interface CustomFieldTranslations extends TranslationsObject {
|
|
533
|
+
label?: string;
|
|
534
|
+
placeholder?: string;
|
|
535
|
+
errors?: { required?: string; invalid?: string };
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
declare interface CustomFieldValidation {
|
|
539
|
+
required?: boolean;
|
|
540
|
+
pattern?: string;
|
|
541
|
+
minLength?: number;
|
|
542
|
+
maxLength?: number;
|
|
543
|
+
min?: string;
|
|
544
|
+
max?: string;
|
|
545
|
+
step?: string;
|
|
546
|
+
}
|
|
547
|
+
|
|
513
548
|
declare interface CustomStyles {
|
|
514
549
|
cardNumberText?: CSSStyleDeclaration;
|
|
515
550
|
cardNumberLabel?: CSSStyleDeclaration;
|
|
@@ -1255,10 +1290,11 @@ declare interface EvervaultRequestProps {
|
|
|
1255
1290
|
url?: string;
|
|
1256
1291
|
}
|
|
1257
1292
|
|
|
1258
|
-
declare
|
|
1259
|
-
|
|
1293
|
+
declare type ExpiryHalf = "expiryMonth" | "expiryYear";
|
|
1294
|
+
|
|
1295
|
+
declare type FieldEvent = ({ field: CardField } | CustomFieldTarget) & {
|
|
1260
1296
|
data: CardPayload;
|
|
1261
|
-
}
|
|
1297
|
+
};
|
|
1262
1298
|
|
|
1263
1299
|
declare class Form {
|
|
1264
1300
|
#private;
|
|
@@ -1420,6 +1456,7 @@ declare interface GooglePayEvents {
|
|
|
1420
1456
|
success: () => void;
|
|
1421
1457
|
error: (error: string) => void;
|
|
1422
1458
|
cancel: () => void;
|
|
1459
|
+
unavailable: () => void;
|
|
1423
1460
|
}
|
|
1424
1461
|
|
|
1425
1462
|
declare interface GooglePayOptions {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@evervault/js",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.24.0",
|
|
5
5
|
"description": "Evervault.js loader for client-side browser applications",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"vite": "^8.1.4",
|
|
22
22
|
"vite-plugin-dts": "^5.0.2",
|
|
23
23
|
"themes": "0.1.24",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
24
|
+
"@evervault/browser": "2.71.0",
|
|
25
|
+
"tsconfig": "0.1.0",
|
|
26
|
+
"types": "0.23.1"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "vite build",
|