@basis-theory/basis-theory-js 1.41.1 → 1.42.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.
@@ -4,4 +4,5 @@ declare const ELEMENTS_SCRIPT_LOAD_ERROR_MESSAGE = "BasisTheoryElements did not
4
4
  declare const ELEMENTS_SCRIPT_UNKNOWN_ERROR_MESSAGE = "There was an unknown error when loading BasisTheoryElements";
5
5
  declare const CARD_BRANDS: readonly ["visa", "mastercard", "american-express", "discover", "diners-club", "jcb", "unionpay", "maestro", "elo", "hiper", "hipercard", "mir", "unknown"];
6
6
  declare const CARD_ICON_POSITIONS: readonly ["left", "right", "none"];
7
- export { ELEMENTS_INIT_ERROR_MESSAGE, ELEMENTS_NOM_DOM_ERROR_MESSAGE, ELEMENTS_SCRIPT_LOAD_ERROR_MESSAGE, ELEMENTS_SCRIPT_UNKNOWN_ERROR_MESSAGE, CARD_BRANDS, CARD_ICON_POSITIONS, };
7
+ declare const AUTOCOMPLETE_VALUES: readonly ["off", "on"];
8
+ export { ELEMENTS_INIT_ERROR_MESSAGE, ELEMENTS_NOM_DOM_ERROR_MESSAGE, ELEMENTS_SCRIPT_LOAD_ERROR_MESSAGE, ELEMENTS_SCRIPT_UNKNOWN_ERROR_MESSAGE, CARD_BRANDS, CARD_ICON_POSITIONS, AUTOCOMPLETE_VALUES, };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ELEMENTS_SCRIPT_UNKNOWN_ERROR_MESSAGE = exports.ELEMENTS_SCRIPT_LOAD_ERROR_MESSAGE = exports.ELEMENTS_NOM_DOM_ERROR_MESSAGE = exports.ELEMENTS_INIT_ERROR_MESSAGE = exports.CARD_ICON_POSITIONS = exports.CARD_BRANDS = void 0;
6
+ exports.ELEMENTS_SCRIPT_UNKNOWN_ERROR_MESSAGE = exports.ELEMENTS_SCRIPT_LOAD_ERROR_MESSAGE = exports.ELEMENTS_NOM_DOM_ERROR_MESSAGE = exports.ELEMENTS_INIT_ERROR_MESSAGE = exports.CARD_ICON_POSITIONS = exports.CARD_BRANDS = exports.AUTOCOMPLETE_VALUES = void 0;
7
7
  const ELEMENTS_INIT_ERROR_MESSAGE = 'BasisTheory Elements was not properly initialized.';
8
8
  exports.ELEMENTS_INIT_ERROR_MESSAGE = ELEMENTS_INIT_ERROR_MESSAGE;
9
9
  const ELEMENTS_NOM_DOM_ERROR_MESSAGE = 'Tried to load BasisTheoryElements in a non-DOM environment.';
@@ -15,4 +15,6 @@ exports.ELEMENTS_SCRIPT_UNKNOWN_ERROR_MESSAGE = ELEMENTS_SCRIPT_UNKNOWN_ERROR_ME
15
15
  const CARD_BRANDS = ['visa', 'mastercard', 'american-express', 'discover', 'diners-club', 'jcb', 'unionpay', 'maestro', 'elo', 'hiper', 'hipercard', 'mir', 'unknown'];
16
16
  exports.CARD_BRANDS = CARD_BRANDS;
17
17
  const CARD_ICON_POSITIONS = ['left', 'right', 'none'];
18
- exports.CARD_ICON_POSITIONS = CARD_ICON_POSITIONS;
18
+ exports.CARD_ICON_POSITIONS = CARD_ICON_POSITIONS;
19
+ const AUTOCOMPLETE_VALUES = ['off', 'on'];
20
+ exports.AUTOCOMPLETE_VALUES = AUTOCOMPLETE_VALUES;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/basis-theory-js",
3
- "version": "1.41.1",
3
+ "version": "1.42.0",
4
4
  "repository": "https://github.com/Basis-Theory/basis-theory-js",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -1,3 +1,4 @@
1
+ import { AutoCompleteValue } from './shared';
1
2
  import type { ElementStyle } from './styles';
2
3
  declare const ELEMENTS_TYPES: readonly ["card", "text", "cardNumber", "cardExpirationDate", "cardVerificationCode"];
3
4
  declare type ElementType = typeof ELEMENTS_TYPES[number];
@@ -18,13 +19,17 @@ interface SanitizedElementOptions {
18
19
  ariaLabel?: string;
19
20
  iconPosition?: string;
20
21
  cardBrand?: string;
22
+ autoComplete?: string;
21
23
  }
22
24
  declare type ElementOptions = ElementInternalOptions & SanitizedElementOptions;
23
25
  declare type Transform = RegExp | [RegExp, string?] | null;
24
26
  interface TransformOption {
25
27
  transform?: Transform;
26
28
  }
27
- declare type CustomizableElementOptions = Pick<ElementOptions, 'style' | 'disabled'>;
29
+ interface AutoCompleteOption {
30
+ autoComplete?: AutoCompleteValue;
31
+ }
32
+ declare type CustomizableElementOptions = Pick<ElementOptions, 'style' | 'disabled'> & AutoCompleteOption;
28
33
  declare type CreateCardElementOptions = CustomizableElementOptions;
29
34
  declare type UpdateCardElementOptions = CreateCardElementOptions;
30
35
  declare type CreateTextElementOptions = CustomizableElementOptions & Pick<ElementOptions, 'placeholder' | 'mask' | 'password'> & TransformOption & Required<Pick<ElementOptions, 'targetId'>> & {
@@ -1,4 +1,4 @@
1
- import { CARD_BRANDS, CARD_ICON_POSITIONS } from '@/elements/constants';
1
+ import { AUTOCOMPLETE_VALUES, CARD_BRANDS, CARD_ICON_POSITIONS } from '@/elements/constants';
2
2
  declare type FieldErrorType = 'incomplete' | 'invalid';
3
3
  declare type ConfigErrorType = 'missing-configuration' | 'missing-permission' | 'invalid-configuration';
4
4
  interface ConfigError {
@@ -24,4 +24,8 @@ declare type Brand = typeof CARD_BRANDS[number];
24
24
  * Icon position for card number element
25
25
  */
26
26
  declare type CardIconPosition = typeof CARD_ICON_POSITIONS[number];
27
- export type { FieldErrorType, ConfigErrorType, ConfigError, Targeted, ListenableKey, FieldError, PropertyError, Brand, CardIconPosition, };
27
+ /**
28
+ * Values for the element input autocomplete attribute
29
+ */
30
+ declare type AutoCompleteValue = typeof AUTOCOMPLETE_VALUES[number];
31
+ export type { FieldErrorType, ConfigErrorType, ConfigError, Targeted, ListenableKey, FieldError, PropertyError, Brand, CardIconPosition, AutoCompleteValue, };