@basis-theory/react-elements 1.13.0 → 1.14.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 CHANGED
@@ -1,5 +1,5 @@
1
- var $6ZdRe$react = require("react");
2
1
  var $6ZdRe$basistheorywebelements = require("@basis-theory/web-elements");
2
+ var $6ZdRe$react = require("react");
3
3
  var $6ZdRe$reactjsxruntime = require("react/jsx-runtime");
4
4
 
5
5
 
@@ -27,6 +27,21 @@ function $parcel$export(e, n, v, s) {
27
27
  function $parcel$interopDefault(a) {
28
28
  return a && a.__esModule ? a.default : a;
29
29
  }
30
+
31
+ $parcel$export(module.exports, "DEFAULT_CARD_TYPES", () => $6ZdRe$basistheorywebelements.DEFAULT_CARD_TYPES);
32
+ $parcel$export(module.exports, "AMERICAN_EXPRESS", () => $6ZdRe$basistheorywebelements.AMERICAN_EXPRESS);
33
+ $parcel$export(module.exports, "DINERS_CLUB", () => $6ZdRe$basistheorywebelements.DINERS_CLUB);
34
+ $parcel$export(module.exports, "DISCOVER", () => $6ZdRe$basistheorywebelements.DISCOVER);
35
+ $parcel$export(module.exports, "ELO", () => $6ZdRe$basistheorywebelements.ELO);
36
+ $parcel$export(module.exports, "HIPER", () => $6ZdRe$basistheorywebelements.HIPER);
37
+ $parcel$export(module.exports, "HIPERCARD", () => $6ZdRe$basistheorywebelements.HIPERCARD);
38
+ $parcel$export(module.exports, "JCB", () => $6ZdRe$basistheorywebelements.JCB);
39
+ $parcel$export(module.exports, "MAESTRO", () => $6ZdRe$basistheorywebelements.MAESTRO);
40
+ $parcel$export(module.exports, "MASTERCARD", () => $6ZdRe$basistheorywebelements.MASTERCARD);
41
+ $parcel$export(module.exports, "MIR", () => $6ZdRe$basistheorywebelements.MIR);
42
+ $parcel$export(module.exports, "UNION_PAY", () => $6ZdRe$basistheorywebelements.UNION_PAY);
43
+ $parcel$export(module.exports, "VISA", () => $6ZdRe$basistheorywebelements.VISA);
44
+
30
45
  var $a6b9dd675f852902$exports = {};
31
46
 
32
47
  $parcel$export($a6b9dd675f852902$exports, "useBasisTheory", () => $311cac811dba7e3c$export$8855c0c49ada8fa3);
package/module/module.js CHANGED
@@ -1,11 +1,12 @@
1
+ import {DEFAULT_CARD_TYPES as $8fc858ffa1007a27$re_export$DEFAULT_CARD_TYPES, AMERICAN_EXPRESS as $8fc858ffa1007a27$re_export$AMERICAN_EXPRESS, DINERS_CLUB as $8fc858ffa1007a27$re_export$DINERS_CLUB, DISCOVER as $8fc858ffa1007a27$re_export$DISCOVER, ELO as $8fc858ffa1007a27$re_export$ELO, HIPER as $8fc858ffa1007a27$re_export$HIPER, HIPERCARD as $8fc858ffa1007a27$re_export$HIPERCARD, JCB as $8fc858ffa1007a27$re_export$JCB, MAESTRO as $8fc858ffa1007a27$re_export$MAESTRO, MASTERCARD as $8fc858ffa1007a27$re_export$MASTERCARD, MIR as $8fc858ffa1007a27$re_export$MIR, UNION_PAY as $8fc858ffa1007a27$re_export$UNION_PAY, VISA as $8fc858ffa1007a27$re_export$VISA, basistheory as $gb0K4$basistheory} from "@basis-theory/web-elements";
1
2
  import $gb0K4$react, {useState as $gb0K4$useState, useRef as $gb0K4$useRef, useEffect as $gb0K4$useEffect, createContext as $gb0K4$createContext, useMemo as $gb0K4$useMemo, useContext as $gb0K4$useContext} from "react";
2
- import {basistheory as $gb0K4$basistheory} from "@basis-theory/web-elements";
3
3
  import {jsx as $gb0K4$jsx} from "react/jsx-runtime";
4
4
 
5
5
 
6
6
  function $parcel$export(e, n, v, s) {
7
7
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
8
8
  }
9
+
9
10
  var $6152f9bf0d6dda4d$exports = {};
10
11
 
11
12
  $parcel$export($6152f9bf0d6dda4d$exports, "useBasisTheory", () => $af3ff746464f54fa$export$8855c0c49ada8fa3);
@@ -381,4 +382,4 @@ var $17e03523eeef3efb$exports = {};
381
382
 
382
383
 
383
384
 
384
- export {$af3ff746464f54fa$export$8855c0c49ada8fa3 as useBasisTheory, $45f18da36523d589$export$e61fbf0ee83adc05 as BasisTheoryProvider, $22a85849b67e3ab0$export$642653cabb64aed9 as CardElement, $098244fc1ecf3b22$export$764077542c4bf9bd as TextElement, $c9d0638264a6246e$export$a2311b18160d2f3f as CardNumberElement, $b04bbbda03b8923f$export$d5128efc3cebc889 as CardExpirationDateElement, $6f922196262b492d$export$36d668a024913c87 as CardVerificationCodeElement};
385
+ export {$8fc858ffa1007a27$re_export$DEFAULT_CARD_TYPES as DEFAULT_CARD_TYPES, $8fc858ffa1007a27$re_export$AMERICAN_EXPRESS as AMERICAN_EXPRESS, $8fc858ffa1007a27$re_export$DINERS_CLUB as DINERS_CLUB, $8fc858ffa1007a27$re_export$DISCOVER as DISCOVER, $8fc858ffa1007a27$re_export$ELO as ELO, $8fc858ffa1007a27$re_export$HIPER as HIPER, $8fc858ffa1007a27$re_export$HIPERCARD as HIPERCARD, $8fc858ffa1007a27$re_export$JCB as JCB, $8fc858ffa1007a27$re_export$MAESTRO as MAESTRO, $8fc858ffa1007a27$re_export$MASTERCARD as MASTERCARD, $8fc858ffa1007a27$re_export$MIR as MIR, $8fc858ffa1007a27$re_export$UNION_PAY as UNION_PAY, $8fc858ffa1007a27$re_export$VISA as VISA, $af3ff746464f54fa$export$8855c0c49ada8fa3 as useBasisTheory, $45f18da36523d589$export$e61fbf0ee83adc05 as BasisTheoryProvider, $22a85849b67e3ab0$export$642653cabb64aed9 as CardElement, $098244fc1ecf3b22$export$764077542c4bf9bd as TextElement, $c9d0638264a6246e$export$a2311b18160d2f3f as CardNumberElement, $b04bbbda03b8923f$export$d5128efc3cebc889 as CardExpirationDateElement, $6f922196262b492d$export$36d668a024913c87 as CardVerificationCodeElement};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/react-elements",
3
- "version": "1.13.0",
3
+ "version": "1.14.0",
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.13.0"
33
+ "@basis-theory/web-elements": "1.14.0"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
package/types/index.d.ts CHANGED
@@ -187,6 +187,7 @@ export interface SanitizedElementOptions {
187
187
  skipLuhnValidation?: boolean;
188
188
  style?: ElementStyle;
189
189
  targetId?: string;
190
+ title?: string;
190
191
  transform?: [RegExp, string] | null;
191
192
  validateOnChange?: boolean;
192
193
  validation?: RegExp;
@@ -217,7 +218,13 @@ export interface CardExpirationDateValue<T extends ElementValueType> {
217
218
  month: T extends 'reference' ? DataElementReference : number;
218
219
  year: T extends 'reference' ? DataElementReference : number;
219
220
  }
220
- export type CreateCardElementOptions = CustomizableElementOptions & Pick<ElementOptions, 'cardTypes' | 'skipLuhnValidation'> & {
221
+ export interface CardElementAutoComplete {
222
+ number: AutoCompleteValue;
223
+ expirationDate: AutoCompleteValue;
224
+ csc: AutoCompleteValue;
225
+ }
226
+ export type CreateCardElementOptions = Omit<CustomizableElementOptions, 'autoComplete'> & Pick<ElementOptions, 'cardTypes' | 'skipLuhnValidation'> & {
227
+ autoComplete?: CardElementAutoComplete;
221
228
  placeholder?: CardElementPlaceholder;
222
229
  value?: CardElementValue<'static'>;
223
230
  };
@@ -477,6 +484,7 @@ export interface BaseElement<UpdateOptions, ElementEvents> {
477
484
  mount(selector: string): Promise<void>;
478
485
  mount(element: Element): Promise<void>;
479
486
  update(options: UpdateOptions): Promise<void>;
487
+ validate(): void;
480
488
  clear(): void;
481
489
  focus(): void;
482
490
  blur(): void;
@@ -486,7 +494,6 @@ export interface BaseElement<UpdateOptions, ElementEvents> {
486
494
  export type ICardElement = BaseElement<UpdateCardElementOptions, CardElementEvents> & {
487
495
  readonly cardMetadata?: CardMetadata;
488
496
  setValue(value: CardElementValue<'reference'>): void;
489
- validate(): void;
490
497
  };
491
498
  export type ITextElement = BaseElement<UpdateTextElementOptions, TextElementEvents> & {
492
499
  setValueRef(value: ITextElement): void;