@basis-theory/react-elements 1.19.0 → 1.21.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/types/index.d.ts +12 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/react-elements",
3
- "version": "1.19.0",
3
+ "version": "1.21.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.19.0"
33
+ "@basis-theory/web-elements": "1.21.0"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
package/types/index.d.ts CHANGED
@@ -155,8 +155,12 @@ export interface ElementInternalOptions {
155
155
  apiKey: string | undefined;
156
156
  baseUrl: string;
157
157
  type: ElementType;
158
+ debug: boolean | undefined;
159
+ disableTelemetry: boolean | undefined;
158
160
  useNgApi: boolean | undefined;
159
161
  useSameOriginApi: boolean | undefined;
162
+ useUat: boolean | undefined;
163
+ useNetworkCheck: boolean | undefined;
160
164
  }
161
165
  export enum InputMode {
162
166
  DECIMAL = "decimal",
@@ -201,7 +205,11 @@ interface TransformOption {
201
205
  interface AutoCompleteOption {
202
206
  autoComplete?: AutoCompleteValue;
203
207
  }
208
+ interface CardAutoCompleteOption {
209
+ autoComplete?: CardElementAutoComplete;
210
+ }
204
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;
205
213
  type ElementValueType = 'static' | 'reference';
206
214
  export interface CardElementValue<T extends ElementValueType> {
207
215
  cvc?: T extends 'reference' ? DataElementReference : string;
@@ -223,8 +231,7 @@ export interface CardElementAutoComplete {
223
231
  expirationDate: AutoCompleteValue;
224
232
  csc: AutoCompleteValue;
225
233
  }
226
- export type CreateCardElementOptions = Omit<CustomizableElementOptions, 'autoComplete'> & Pick<ElementOptions, 'cardTypes' | 'skipLuhnValidation' | 'title'> & {
227
- autoComplete?: CardElementAutoComplete;
234
+ export type CreateCardElementOptions = CardCustomizableElementOptions & Pick<ElementOptions, 'cardTypes' | 'skipLuhnValidation' | 'title'> & {
228
235
  placeholder?: CardElementPlaceholder;
229
236
  value?: CardElementValue<'static'>;
230
237
  };
@@ -560,7 +567,7 @@ export interface BasisTheoryElements {
560
567
  createElement(type: 'cardVerificationCode', options: CreateCardVerificationCodeElementOptions): ICardVerificationCodeElement;
561
568
  }
562
569
  export interface BasisTheoryElementsInternal extends BasisTheoryElements {
563
- init: (apiKey: string | undefined, elementsBaseUrl: string, elementsUseNgApi: boolean | undefined, elementsUseSameOriginApi: boolean | undefined, disableTelemetry: boolean | undefined, debug: boolean | undefined) => Promise<BasisTheoryElements>;
570
+ init: (apiKey: string | undefined, elementsBaseUrl: string, elementsUseNgApi: boolean | undefined, elementsUseSameOriginApi: boolean | undefined, disableTelemetry: boolean | undefined, debug: boolean | undefined, useUat: boolean | undefined, useNetworkCheck: boolean | undefined) => Promise<BasisTheoryElements>;
564
571
  hasElement: (payload: unknown) => boolean;
565
572
  }
566
573
  declare global {
@@ -572,7 +579,9 @@ export interface BasisTheoryInitOptions {
572
579
  _devMode?: boolean;
573
580
  disableTelemetry?: boolean;
574
581
  useSameOriginApi?: boolean;
582
+ useUat?: boolean;
575
583
  debug?: boolean;
584
+ useNetworkCheck?: boolean;
576
585
  }
577
586
  export const basistheory: (apiKey: string, options?: BasisTheoryInitOptions) => Promise<BasisTheoryElements | undefined>;
578
587
  export class BasisTheoryApiError extends Error {