@basis-theory/react-elements 1.22.2 → 1.23.1
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 +2 -2
- package/types/index.d.ts +23 -4
package/main/index.js
CHANGED
|
@@ -215,7 +215,7 @@ const $75e7ef6fe5d73b5f$export$b6487193f4d880e0 = (eventType, element, listener)
|
|
|
215
215
|
]);
|
|
216
216
|
|
|
217
217
|
|
|
218
|
-
const $b68de9bc89cba8c8$var$CardElementC = ({ autoComplete: autoComplete, bt: bt, cardTypes: cardTypes, 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 })=>{
|
|
218
|
+
const $b68de9bc89cba8c8$var$CardElementC = ({ autoComplete: autoComplete, binLookup: binLookup, bt: bt, cardTypes: cardTypes, 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
219
|
const wrapperRef = (0, $6ZdRe$react.useRef)(null);
|
|
220
220
|
const element = (0, $515e46363124517b$export$93e1bc7222cfbdc8)(id, 'card', wrapperRef, {
|
|
221
221
|
autoComplete: autoComplete,
|
|
@@ -223,6 +223,7 @@ const $b68de9bc89cba8c8$var$CardElementC = ({ autoComplete: autoComplete, bt: bt
|
|
|
223
223
|
copyIconStyles: copyIconStyles,
|
|
224
224
|
disabled: disabled,
|
|
225
225
|
enableCopy: enableCopy,
|
|
226
|
+
binLookup: binLookup,
|
|
226
227
|
inputMode: inputMode,
|
|
227
228
|
placeholder: placeholder,
|
|
228
229
|
readOnly: readOnly,
|
|
@@ -298,11 +299,12 @@ function TextElement(props, ref) {
|
|
|
298
299
|
|
|
299
300
|
|
|
300
301
|
|
|
301
|
-
const $89a8c5992dc7cf9a$var$CardNumberElementC = ({ 'aria-label': ariaLabel, autoComplete: autoComplete, bt: bt, cardTypes: cardTypes, copyIconStyles: copyIconStyles, disabled: disabled, elementRef: elementRef, enableCopy: enableCopy, iconPosition: iconPosition, 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, valueRef: valueRef })=>{
|
|
302
|
+
const $89a8c5992dc7cf9a$var$CardNumberElementC = ({ 'aria-label': ariaLabel, autoComplete: autoComplete, binLookup: binLookup, bt: bt, cardTypes: cardTypes, copyIconStyles: copyIconStyles, disabled: disabled, elementRef: elementRef, enableCopy: enableCopy, iconPosition: iconPosition, 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, valueRef: valueRef })=>{
|
|
302
303
|
const wrapperRef = (0, $6ZdRe$react.useRef)(null);
|
|
303
304
|
const element = (0, $515e46363124517b$export$93e1bc7222cfbdc8)(id, 'cardNumber', wrapperRef, {
|
|
304
305
|
'aria-label': ariaLabel,
|
|
305
306
|
autoComplete: autoComplete,
|
|
307
|
+
binLookup: binLookup,
|
|
306
308
|
cardTypes: cardTypes,
|
|
307
309
|
copyIconStyles: copyIconStyles,
|
|
308
310
|
disabled: disabled,
|
package/module/module.js
CHANGED
|
@@ -180,7 +180,7 @@ const $1b6d06f13820d117$export$b6487193f4d880e0 = (eventType, element, listener)
|
|
|
180
180
|
]);
|
|
181
181
|
|
|
182
182
|
|
|
183
|
-
const $22a85849b67e3ab0$var$CardElementC = ({ autoComplete: autoComplete, bt: bt, cardTypes: cardTypes, 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 })=>{
|
|
183
|
+
const $22a85849b67e3ab0$var$CardElementC = ({ autoComplete: autoComplete, binLookup: binLookup, bt: bt, cardTypes: cardTypes, 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
184
|
const wrapperRef = (0, $gb0K4$useRef)(null);
|
|
185
185
|
const element = (0, $001f9ef7a572da43$export$93e1bc7222cfbdc8)(id, 'card', wrapperRef, {
|
|
186
186
|
autoComplete: autoComplete,
|
|
@@ -188,6 +188,7 @@ const $22a85849b67e3ab0$var$CardElementC = ({ autoComplete: autoComplete, bt: bt
|
|
|
188
188
|
copyIconStyles: copyIconStyles,
|
|
189
189
|
disabled: disabled,
|
|
190
190
|
enableCopy: enableCopy,
|
|
191
|
+
binLookup: binLookup,
|
|
191
192
|
inputMode: inputMode,
|
|
192
193
|
placeholder: placeholder,
|
|
193
194
|
readOnly: readOnly,
|
|
@@ -263,11 +264,12 @@ function TextElement(props, ref) {
|
|
|
263
264
|
|
|
264
265
|
|
|
265
266
|
|
|
266
|
-
const $c9d0638264a6246e$var$CardNumberElementC = ({ 'aria-label': ariaLabel, autoComplete: autoComplete, bt: bt, cardTypes: cardTypes, copyIconStyles: copyIconStyles, disabled: disabled, elementRef: elementRef, enableCopy: enableCopy, iconPosition: iconPosition, 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, valueRef: valueRef })=>{
|
|
267
|
+
const $c9d0638264a6246e$var$CardNumberElementC = ({ 'aria-label': ariaLabel, autoComplete: autoComplete, binLookup: binLookup, bt: bt, cardTypes: cardTypes, copyIconStyles: copyIconStyles, disabled: disabled, elementRef: elementRef, enableCopy: enableCopy, iconPosition: iconPosition, 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, valueRef: valueRef })=>{
|
|
267
268
|
const wrapperRef = (0, $gb0K4$useRef)(null);
|
|
268
269
|
const element = (0, $001f9ef7a572da43$export$93e1bc7222cfbdc8)(id, 'cardNumber', wrapperRef, {
|
|
269
270
|
'aria-label': ariaLabel,
|
|
270
271
|
autoComplete: autoComplete,
|
|
272
|
+
binLookup: binLookup,
|
|
271
273
|
cardTypes: cardTypes,
|
|
272
274
|
copyIconStyles: copyIconStyles,
|
|
273
275
|
disabled: disabled,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basis-theory/react-elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.1",
|
|
4
4
|
"repository": "https://github.com/basis-theory/react-elements",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tag": "latest"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@basis-theory/web-elements": "1.
|
|
33
|
+
"@basis-theory/web-elements": "1.23.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
package/types/index.d.ts
CHANGED
|
@@ -176,6 +176,7 @@ export interface SanitizedElementOptions {
|
|
|
176
176
|
ariaDescription?: string;
|
|
177
177
|
ariaLabel?: string;
|
|
178
178
|
autoComplete?: AutoCompleteValue;
|
|
179
|
+
binLookup?: boolean;
|
|
179
180
|
cardBrand?: string;
|
|
180
181
|
cardTypes?: CreditCardType[];
|
|
181
182
|
copyIconStyles?: CopyIconStyles;
|
|
@@ -208,8 +209,8 @@ interface AutoCompleteOption {
|
|
|
208
209
|
interface CardAutoCompleteOption {
|
|
209
210
|
autoComplete?: CardElementAutoComplete;
|
|
210
211
|
}
|
|
211
|
-
export type CustomizableElementOptions = Pick<ElementOptions, 'cardTypes' | 'copyIconStyles' | 'disabled' | 'enableCopy' | 'inputMode' | 'readOnly' | 'skipLuhnValidation' | 'style' | 'validateOnChange'> & AutoCompleteOption;
|
|
212
|
-
export type CardCustomizableElementOptions = Pick<ElementOptions, 'cardTypes' | 'copyIconStyles' | 'disabled' | 'enableCopy' | 'inputMode' | 'readOnly' | 'skipLuhnValidation' | 'style' | 'validateOnChange'> & CardAutoCompleteOption;
|
|
212
|
+
export type CustomizableElementOptions = Pick<ElementOptions, 'binLookup' | 'cardTypes' | 'copyIconStyles' | 'disabled' | 'enableCopy' | 'inputMode' | 'readOnly' | 'skipLuhnValidation' | 'style' | 'validateOnChange'> & AutoCompleteOption;
|
|
213
|
+
export type CardCustomizableElementOptions = Pick<ElementOptions, 'binLookup' | 'cardTypes' | 'copyIconStyles' | 'disabled' | 'enableCopy' | 'inputMode' | 'readOnly' | 'skipLuhnValidation' | 'style' | 'validateOnChange'> & CardAutoCompleteOption;
|
|
213
214
|
type ElementValueType = 'static' | 'reference';
|
|
214
215
|
export interface CardElementValue<T extends ElementValueType> {
|
|
215
216
|
cvc?: T extends 'reference' ? DataElementReference : string;
|
|
@@ -231,7 +232,7 @@ export interface CardElementAutoComplete {
|
|
|
231
232
|
expirationDate: AutoCompleteValue;
|
|
232
233
|
csc: AutoCompleteValue;
|
|
233
234
|
}
|
|
234
|
-
export type CreateCardElementOptions = CardCustomizableElementOptions & Pick<ElementOptions, 'cardTypes' | 'skipLuhnValidation' | 'title'> & {
|
|
235
|
+
export type CreateCardElementOptions = CardCustomizableElementOptions & Pick<ElementOptions, 'binLookup' | 'cardTypes' | 'skipLuhnValidation' | 'title'> & {
|
|
235
236
|
placeholder?: CardElementPlaceholder;
|
|
236
237
|
value?: CardElementValue<'static'>;
|
|
237
238
|
};
|
|
@@ -241,7 +242,7 @@ export type CreateTextElementOptions = CustomizableElementOptions & Pick<Element
|
|
|
241
242
|
value?: string;
|
|
242
243
|
};
|
|
243
244
|
export type UpdateTextElementOptions = Omit<CreateTextElementOptions, 'targetId' | 'mask' | 'validateOnChange'>;
|
|
244
|
-
export type CreateCardNumberElementOptions = CustomizableElementOptions & Pick<ElementOptions, 'placeholder' | 'iconPosition' | 'cardTypes' | 'skipLuhnValidation' | 'title'> & Required<Pick<ElementOptions, 'targetId'>> & {
|
|
245
|
+
export type CreateCardNumberElementOptions = CustomizableElementOptions & Pick<ElementOptions, 'binLookup' | 'placeholder' | 'iconPosition' | 'cardTypes' | 'skipLuhnValidation' | 'title'> & Required<Pick<ElementOptions, 'targetId'>> & {
|
|
245
246
|
'aria-label'?: string;
|
|
246
247
|
value?: string;
|
|
247
248
|
};
|
|
@@ -402,6 +403,22 @@ export interface IssuerCountry {
|
|
|
402
403
|
name: string;
|
|
403
404
|
numeric: string;
|
|
404
405
|
}
|
|
406
|
+
interface CardIssuerDetails {
|
|
407
|
+
country: string;
|
|
408
|
+
name: string;
|
|
409
|
+
}
|
|
410
|
+
interface CardInfo {
|
|
411
|
+
brand: string;
|
|
412
|
+
funding: string;
|
|
413
|
+
issuer: CardIssuerDetails;
|
|
414
|
+
}
|
|
415
|
+
export interface BinInfo {
|
|
416
|
+
brand: string;
|
|
417
|
+
funding: string;
|
|
418
|
+
issuer: CardIssuerDetails;
|
|
419
|
+
segment: string;
|
|
420
|
+
additional?: CardInfo[];
|
|
421
|
+
}
|
|
405
422
|
/**
|
|
406
423
|
* Make all properties in T nullable
|
|
407
424
|
*/
|
|
@@ -626,6 +643,7 @@ export const useBasisTheory: (apiKey?: string, options?: BasisTheoryInitOptions)
|
|
|
626
643
|
};
|
|
627
644
|
export interface CardElementProps {
|
|
628
645
|
autoComplete?: CreateCardElementOptions['autoComplete'];
|
|
646
|
+
binLookup?: boolean;
|
|
629
647
|
bt?: BasisTheoryElements;
|
|
630
648
|
cardTypes?: CreditCardType[];
|
|
631
649
|
copyIconStyles?: CopyIconStyles;
|
|
@@ -683,6 +701,7 @@ export const TextElement: React.ForwardRefExoticComponent<TextElementProps & Rea
|
|
|
683
701
|
export interface CardNumberElementProps {
|
|
684
702
|
'aria-label'?: string;
|
|
685
703
|
autoComplete?: CreateCardNumberElementOptions['autoComplete'];
|
|
704
|
+
binLookup?: boolean;
|
|
686
705
|
bt?: BasisTheoryElements;
|
|
687
706
|
cardTypes?: CreditCardType[];
|
|
688
707
|
copyIconStyles?: CopyIconStyles;
|