@basis-theory/react-elements 1.11.2 → 1.11.4
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/{dist/main → main}/index.js +6 -17
- package/{dist/module → module}/module.js +6 -3
- package/package.json +9 -51
- package/types/index.d.ts +682 -0
- package/CHANGELOG.md +0 -151
- package/dist/LICENSE +0 -202
- package/dist/README.md +0 -126
- package/dist/package.json +0 -40
- package/dist/types/core/BasisTheoryProvider.d.ts +0 -11
- package/dist/types/core/index.d.ts +0 -2
- package/dist/types/core/useBasisTheory.d.ts +0 -9
- package/dist/types/elements/CardElement.d.ts +0 -25
- package/dist/types/elements/CardExpirationDateElement.d.ts +0 -25
- package/dist/types/elements/CardNumberElement.d.ts +0 -28
- package/dist/types/elements/CardVerificationCodeElement.d.ts +0 -26
- package/dist/types/elements/TextElement.d.ts +0 -34
- package/dist/types/elements/index.d.ts +0 -10
- package/dist/types/elements/useBasisTheoryValue.d.ts +0 -10
- package/dist/types/elements/useElement.d.ts +0 -15
- package/dist/types/elements/useListener.d.ts +0 -3
- package/dist/types/index.d.ts +0 -4
- package/dist/types/types.d.ts +0 -1
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React, { MutableRefObject } from 'react';
|
|
2
|
-
import type { BasisTheoryElements, CreateTextElementOptions, ElementEventListener, ElementStyle, InputMode, TextElement as ITextElement, TextElementEvents } from '@basis-theory/web-elements';
|
|
3
|
-
interface BaseTextElementProps {
|
|
4
|
-
'aria-label'?: string;
|
|
5
|
-
autoComplete?: CreateTextElementOptions['autoComplete'];
|
|
6
|
-
bt?: BasisTheoryElements;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
id: string;
|
|
9
|
-
inputMode?: `${InputMode}`;
|
|
10
|
-
maxLength?: HTMLInputElement['maxLength'];
|
|
11
|
-
onBlur?: ElementEventListener<TextElementEvents, 'blur'>;
|
|
12
|
-
onChange?: ElementEventListener<TextElementEvents, 'change'>;
|
|
13
|
-
onFocus?: ElementEventListener<TextElementEvents, 'focus'>;
|
|
14
|
-
onKeyDown?: ElementEventListener<TextElementEvents, 'keydown'>;
|
|
15
|
-
onReady?: ElementEventListener<TextElementEvents, 'ready'>;
|
|
16
|
-
placeholder?: string;
|
|
17
|
-
readOnly?: boolean;
|
|
18
|
-
style?: ElementStyle;
|
|
19
|
-
transform?: RegExp | [RegExp, string?];
|
|
20
|
-
validation?: RegExp;
|
|
21
|
-
value?: string;
|
|
22
|
-
valueRef?: MutableRefObject<ITextElement | null>;
|
|
23
|
-
}
|
|
24
|
-
interface MaskedTextElementProps extends BaseTextElementProps {
|
|
25
|
-
mask?: (RegExp | string)[];
|
|
26
|
-
password?: false;
|
|
27
|
-
}
|
|
28
|
-
interface PasswordTextElementProps extends BaseTextElementProps {
|
|
29
|
-
mask?: never;
|
|
30
|
-
password: true;
|
|
31
|
-
}
|
|
32
|
-
type TextElementProps = MaskedTextElementProps | PasswordTextElementProps;
|
|
33
|
-
export declare const TextElement: React.ForwardRefExoticComponent<TextElementProps & React.RefAttributes<ITextElement>>;
|
|
34
|
-
export type { TextElementProps };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { CardElement } from './CardElement';
|
|
2
|
-
export type { CardElementProps } from './CardElement';
|
|
3
|
-
export { TextElement } from './TextElement';
|
|
4
|
-
export type { TextElementProps } from './TextElement';
|
|
5
|
-
export { CardNumberElement } from './CardNumberElement';
|
|
6
|
-
export type { CardNumberElementProps } from './CardNumberElement';
|
|
7
|
-
export { CardExpirationDateElement } from './CardExpirationDateElement';
|
|
8
|
-
export type { CardExpirationDateElementProps } from './CardExpirationDateElement';
|
|
9
|
-
export { CardVerificationCodeElement } from './CardVerificationCodeElement';
|
|
10
|
-
export type { CardVerificationCodeElementProps } from './CardVerificationCodeElement';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { BasisTheoryElements } from '@basis-theory/web-elements';
|
|
2
|
-
/**
|
|
3
|
-
* Resolves which BasisTheoryReact instance to use,
|
|
4
|
-
* by favoring the optional parameter.
|
|
5
|
-
* For internal use only.
|
|
6
|
-
* @param bt
|
|
7
|
-
* @returns parameter if it exists; instance from Context otherwise
|
|
8
|
-
*/
|
|
9
|
-
declare const useBasisTheoryValue: (bt?: BasisTheoryElements) => BasisTheoryElements | undefined;
|
|
10
|
-
export { useBasisTheoryValue };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React, { ForwardedRef, MutableRefObject } from 'react';
|
|
2
|
-
import type { BaseElement, BasisTheoryElements, ElementType } from '@basis-theory/web-elements';
|
|
3
|
-
/**
|
|
4
|
-
* Creates, mounts and indexes an Element
|
|
5
|
-
* with React lifecycle
|
|
6
|
-
* @param id
|
|
7
|
-
* @param type
|
|
8
|
-
* @param options
|
|
9
|
-
* @param wrapperRef
|
|
10
|
-
* @param btFromProps
|
|
11
|
-
* @param ref optional ref to set the underlying element
|
|
12
|
-
* @returns created element and initial options used for mounting
|
|
13
|
-
*/
|
|
14
|
-
declare const useElement: <Element extends BaseElement<any, any>, Options extends unknown>(id: string, type: ElementType, wrapperRef: React.RefObject<HTMLDivElement>, options: Options, btFromProps?: BasisTheoryElements, ref?: ForwardedRef<Element>, targetValueRef?: MutableRefObject<Element | null>) => Element | undefined;
|
|
15
|
-
export { useElement };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { BaseElement, ElementEventListener, EventType } from '@basis-theory/web-elements';
|
|
2
|
-
declare const useListener: <T extends EventType, Ev, E extends BaseElement<unknown, Ev>>(eventType: T, element?: E, listener?: ElementEventListener<Ev, T>) => void;
|
|
3
|
-
export { useListener };
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export * from './core';
|
|
2
|
-
export * from './elements';
|
|
3
|
-
export type { BasisTheoryElements } from '@basis-theory/web-elements';
|
|
4
|
-
export { AMERICAN_EXPRESS, DEFAULT_CARD_TYPES, DINERS_CLUB, DISCOVER, ELO, HIPER, HIPERCARD, JCB, MAESTRO, MASTERCARD, MIR, UNION_PAY, VISA, CARD_BRANDS, } from '@basis-theory/web-elements';
|
package/dist/types/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from '@basis-theory/web-elements';
|