@basis-theory/react-elements 2.3.0 → 2.6.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/main/index.js +4 -2
- package/module/module.js +4 -2
- package/package.json +6 -3
- package/types/index.d.ts +11 -2
package/main/index.js
CHANGED
|
@@ -216,7 +216,7 @@ const $75e7ef6fe5d73b5f$export$b6487193f4d880e0 = (eventType, element, listener)
|
|
|
216
216
|
]);
|
|
217
217
|
|
|
218
218
|
|
|
219
|
-
const $b68de9bc89cba8c8$var$CardElementC = ({ autoComplete: autoComplete, binLookup: binLookup, bt: bt, cardTypes: cardTypes, coBadgedSupport: coBadgedSupport, copyIconStyles: copyIconStyles, disabled: disabled, elementRef: elementRef, enableCopy: enableCopy, id: id, inputMode: inputMode, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onReady: onReady, placeholder: placeholder, readOnly: readOnly, skipLuhnValidation: skipLuhnValidation, style: style, title: title, validateOnChange: validateOnChange, value: value })=>{
|
|
219
|
+
const $b68de9bc89cba8c8$var$CardElementC = ({ autoComplete: autoComplete, binLookup: binLookup, bt: bt, cardTypes: cardTypes, coBadgedSupport: coBadgedSupport, copyIconStyles: copyIconStyles, disabled: disabled, elementRef: elementRef, enableCopy: enableCopy, id: id, inputMode: inputMode, maxElapsedExpirationYear: maxElapsedExpirationYear, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onReady: onReady, placeholder: placeholder, readOnly: readOnly, skipLuhnValidation: skipLuhnValidation, style: style, title: title, validateOnChange: validateOnChange, value: value })=>{
|
|
220
220
|
const wrapperRef = (0, $6ZdRe$react.useRef)(null);
|
|
221
221
|
const element = (0, $515e46363124517b$export$93e1bc7222cfbdc8)(id, 'card', wrapperRef, {
|
|
222
222
|
autoComplete: autoComplete,
|
|
@@ -227,6 +227,7 @@ const $b68de9bc89cba8c8$var$CardElementC = ({ autoComplete: autoComplete, binLoo
|
|
|
227
227
|
binLookup: binLookup,
|
|
228
228
|
coBadgedSupport: coBadgedSupport,
|
|
229
229
|
inputMode: inputMode,
|
|
230
|
+
maxElapsedExpirationYear: maxElapsedExpirationYear,
|
|
230
231
|
placeholder: placeholder,
|
|
231
232
|
readOnly: readOnly,
|
|
232
233
|
skipLuhnValidation: skipLuhnValidation,
|
|
@@ -258,7 +259,7 @@ function CardElement(props, ref) {
|
|
|
258
259
|
|
|
259
260
|
|
|
260
261
|
|
|
261
|
-
const $a598ed1fc49faa5f$var$CardExpirationDateElementC = ({ 'aria-label': ariaLabel, autoComplete: autoComplete, bt: bt, copyIconStyles: copyIconStyles, disabled: disabled, elementRef: elementRef, enableCopy: enableCopy, id: id, inputMode: inputMode, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onReady: onReady, placeholder: placeholder, readOnly: readOnly, style: style, title: title, validateOnChange: validateOnChange, value: value, valueRef: valueRef })=>{
|
|
262
|
+
const $a598ed1fc49faa5f$var$CardExpirationDateElementC = ({ 'aria-label': ariaLabel, autoComplete: autoComplete, bt: bt, copyIconStyles: copyIconStyles, disabled: disabled, elementRef: elementRef, enableCopy: enableCopy, id: id, inputMode: inputMode, maxElapsedExpirationYear: maxElapsedExpirationYear, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onReady: onReady, placeholder: placeholder, readOnly: readOnly, style: style, title: title, validateOnChange: validateOnChange, value: value, valueRef: valueRef })=>{
|
|
262
263
|
const wrapperRef = (0, $6ZdRe$react.useRef)(null);
|
|
263
264
|
const element = (0, $515e46363124517b$export$93e1bc7222cfbdc8)(id, 'cardExpirationDate', wrapperRef, {
|
|
264
265
|
'aria-label': ariaLabel,
|
|
@@ -267,6 +268,7 @@ const $a598ed1fc49faa5f$var$CardExpirationDateElementC = ({ 'aria-label': ariaLa
|
|
|
267
268
|
disabled: disabled,
|
|
268
269
|
enableCopy: enableCopy,
|
|
269
270
|
inputMode: inputMode,
|
|
271
|
+
maxElapsedExpirationYear: maxElapsedExpirationYear,
|
|
270
272
|
placeholder: placeholder,
|
|
271
273
|
readOnly: readOnly,
|
|
272
274
|
style: style,
|
package/module/module.js
CHANGED
|
@@ -181,7 +181,7 @@ const $1b6d06f13820d117$export$b6487193f4d880e0 = (eventType, element, listener)
|
|
|
181
181
|
]);
|
|
182
182
|
|
|
183
183
|
|
|
184
|
-
const $22a85849b67e3ab0$var$CardElementC = ({ autoComplete: autoComplete, binLookup: binLookup, bt: bt, cardTypes: cardTypes, coBadgedSupport: coBadgedSupport, copyIconStyles: copyIconStyles, disabled: disabled, elementRef: elementRef, enableCopy: enableCopy, id: id, inputMode: inputMode, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onReady: onReady, placeholder: placeholder, readOnly: readOnly, skipLuhnValidation: skipLuhnValidation, style: style, title: title, validateOnChange: validateOnChange, value: value })=>{
|
|
184
|
+
const $22a85849b67e3ab0$var$CardElementC = ({ autoComplete: autoComplete, binLookup: binLookup, bt: bt, cardTypes: cardTypes, coBadgedSupport: coBadgedSupport, copyIconStyles: copyIconStyles, disabled: disabled, elementRef: elementRef, enableCopy: enableCopy, id: id, inputMode: inputMode, maxElapsedExpirationYear: maxElapsedExpirationYear, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onReady: onReady, placeholder: placeholder, readOnly: readOnly, skipLuhnValidation: skipLuhnValidation, style: style, title: title, validateOnChange: validateOnChange, value: value })=>{
|
|
185
185
|
const wrapperRef = (0, $gb0K4$useRef)(null);
|
|
186
186
|
const element = (0, $001f9ef7a572da43$export$93e1bc7222cfbdc8)(id, 'card', wrapperRef, {
|
|
187
187
|
autoComplete: autoComplete,
|
|
@@ -192,6 +192,7 @@ const $22a85849b67e3ab0$var$CardElementC = ({ autoComplete: autoComplete, binLoo
|
|
|
192
192
|
binLookup: binLookup,
|
|
193
193
|
coBadgedSupport: coBadgedSupport,
|
|
194
194
|
inputMode: inputMode,
|
|
195
|
+
maxElapsedExpirationYear: maxElapsedExpirationYear,
|
|
195
196
|
placeholder: placeholder,
|
|
196
197
|
readOnly: readOnly,
|
|
197
198
|
skipLuhnValidation: skipLuhnValidation,
|
|
@@ -223,7 +224,7 @@ function CardElement(props, ref) {
|
|
|
223
224
|
|
|
224
225
|
|
|
225
226
|
|
|
226
|
-
const $b04bbbda03b8923f$var$CardExpirationDateElementC = ({ 'aria-label': ariaLabel, autoComplete: autoComplete, bt: bt, copyIconStyles: copyIconStyles, disabled: disabled, elementRef: elementRef, enableCopy: enableCopy, id: id, inputMode: inputMode, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onReady: onReady, placeholder: placeholder, readOnly: readOnly, style: style, title: title, validateOnChange: validateOnChange, value: value, valueRef: valueRef })=>{
|
|
227
|
+
const $b04bbbda03b8923f$var$CardExpirationDateElementC = ({ 'aria-label': ariaLabel, autoComplete: autoComplete, bt: bt, copyIconStyles: copyIconStyles, disabled: disabled, elementRef: elementRef, enableCopy: enableCopy, id: id, inputMode: inputMode, maxElapsedExpirationYear: maxElapsedExpirationYear, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onReady: onReady, placeholder: placeholder, readOnly: readOnly, style: style, title: title, validateOnChange: validateOnChange, value: value, valueRef: valueRef })=>{
|
|
227
228
|
const wrapperRef = (0, $gb0K4$useRef)(null);
|
|
228
229
|
const element = (0, $001f9ef7a572da43$export$93e1bc7222cfbdc8)(id, 'cardExpirationDate', wrapperRef, {
|
|
229
230
|
'aria-label': ariaLabel,
|
|
@@ -232,6 +233,7 @@ const $b04bbbda03b8923f$var$CardExpirationDateElementC = ({ 'aria-label': ariaLa
|
|
|
232
233
|
disabled: disabled,
|
|
233
234
|
enableCopy: enableCopy,
|
|
234
235
|
inputMode: inputMode,
|
|
236
|
+
maxElapsedExpirationYear: maxElapsedExpirationYear,
|
|
235
237
|
placeholder: placeholder,
|
|
236
238
|
readOnly: readOnly,
|
|
237
239
|
style: style,
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basis-theory/react-elements",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"repository":
|
|
3
|
+
"version": "2.6.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/basis-theory/react-elements.git"
|
|
7
|
+
},
|
|
5
8
|
"license": "Apache-2.0",
|
|
6
9
|
"author": {
|
|
7
10
|
"name": "Basis Theory",
|
|
@@ -30,7 +33,7 @@
|
|
|
30
33
|
"tag": "latest"
|
|
31
34
|
},
|
|
32
35
|
"dependencies": {
|
|
33
|
-
"@basis-theory/web-elements": "2.
|
|
36
|
+
"@basis-theory/web-elements": "2.6.0"
|
|
34
37
|
},
|
|
35
38
|
"peerDependencies": {
|
|
36
39
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
package/types/index.d.ts
CHANGED
|
@@ -261,6 +261,7 @@ export interface SanitizedElementOptions {
|
|
|
261
261
|
validateOnChange?: boolean;
|
|
262
262
|
validation?: RegExp;
|
|
263
263
|
value?: CardElementValue<'static'> | CardExpirationDateValue<'static'> | string;
|
|
264
|
+
maxElapsedExpirationYear?: number;
|
|
264
265
|
}
|
|
265
266
|
export type ElementOptions = ElementInternalOptions & SanitizedElementOptions;
|
|
266
267
|
export type Transform = RegExp | [RegExp, string?] | null;
|
|
@@ -300,6 +301,7 @@ export type CreateCardElementOptions = CardCustomizableElementOptions & Pick<Ele
|
|
|
300
301
|
coBadgedSupport?: CoBadgedSupport[];
|
|
301
302
|
placeholder?: CardElementPlaceholder;
|
|
302
303
|
value?: CardElementValue<'static'>;
|
|
304
|
+
maxElapsedExpirationYear?: number;
|
|
303
305
|
};
|
|
304
306
|
export type UpdateCardElementOptions = Omit<CreateCardElementOptions, 'validateOnChange' | 'enableCopy'>;
|
|
305
307
|
export type CreateTextElementOptions = CustomizableElementOptions & Pick<ElementOptions, 'placeholder' | 'mask' | 'maxLength' | 'password' | 'validation' | 'title'> & TransformOption & Required<Pick<ElementOptions, 'targetId'>> & {
|
|
@@ -316,6 +318,7 @@ export type UpdateCardNumberElementOptions = Omit<CreateCardNumberElementOptions
|
|
|
316
318
|
export type CreateCardExpirationDateElementOptions = CustomizableElementOptions & Pick<ElementOptions, 'title' | 'placeholder'> & Required<Pick<ElementOptions, 'targetId'>> & {
|
|
317
319
|
'aria-label'?: string;
|
|
318
320
|
value?: CardExpirationDateValue<'static'> | string;
|
|
321
|
+
maxElapsedExpirationYear?: number;
|
|
319
322
|
};
|
|
320
323
|
export type UpdateCardExpirationDateElementOptions = Omit<CreateCardExpirationDateElementOptions, 'targetId' | 'validateOnChange' | 'enableCopy'>;
|
|
321
324
|
export type CreateCardVerificationCodeElementOptions = CustomizableElementOptions & Pick<ElementOptions, 'placeholder' | 'title' | 'cardBrand'> & Required<Pick<ElementOptions, 'targetId'>> & {
|
|
@@ -456,8 +459,8 @@ export type EncryptTokenModel<DataType = Primitive> = {
|
|
|
456
459
|
tokenRequests: {
|
|
457
460
|
[key: string]: Pick<CreateTokenModel<DataType>, 'data' | 'type'>;
|
|
458
461
|
} | Pick<CreateTokenModel<DataType>, 'data' | 'type'>;
|
|
459
|
-
|
|
460
|
-
|
|
462
|
+
publicKeyPem: string;
|
|
463
|
+
keyId: string;
|
|
461
464
|
};
|
|
462
465
|
type EncryptedSingleToken = {
|
|
463
466
|
encrypted: string;
|
|
@@ -706,6 +709,10 @@ export class BasisTheoryApiError extends Error {
|
|
|
706
709
|
readonly _debug?: Record<string, unknown> | undefined;
|
|
707
710
|
constructor(message: string, status: number, data?: unknown | undefined, _debug?: Record<string, unknown> | undefined);
|
|
708
711
|
}
|
|
712
|
+
export class BasisTheoryConfigurationError<Details = Record<string, unknown>> extends Error {
|
|
713
|
+
readonly details: Details;
|
|
714
|
+
constructor(message: string, details: Details);
|
|
715
|
+
}
|
|
709
716
|
export class HttpClientError extends Error {
|
|
710
717
|
readonly status: number;
|
|
711
718
|
readonly data?: unknown;
|
|
@@ -739,6 +746,7 @@ export interface CardElementProps {
|
|
|
739
746
|
enableCopy?: boolean;
|
|
740
747
|
id: string;
|
|
741
748
|
inputMode?: `${InputMode}`;
|
|
749
|
+
maxElapsedExpirationYear?: number;
|
|
742
750
|
onBlur?: ElementEventListener<CardElementEvents, 'blur'>;
|
|
743
751
|
onChange?: ElementEventListener<CardElementEvents, 'change'>;
|
|
744
752
|
onFocus?: ElementEventListener<CardElementEvents, 'focus'>;
|
|
@@ -762,6 +770,7 @@ export interface CardExpirationDateElementProps {
|
|
|
762
770
|
enableCopy?: boolean;
|
|
763
771
|
id: string;
|
|
764
772
|
inputMode?: `${InputMode}`;
|
|
773
|
+
maxElapsedExpirationYear?: number;
|
|
765
774
|
onBlur?: ElementEventListener<CardExpirationDateElementEvents, 'blur'>;
|
|
766
775
|
onChange?: ElementEventListener<CardExpirationDateElementEvents, 'change'>;
|
|
767
776
|
onFocus?: ElementEventListener<CardExpirationDateElementEvents, 'focus'>;
|