@verifiedinc-public/shared-ui-elements 3.13.0 → 3.15.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/dist/components/chart/ReasonCodesChart/index.d.ts +42 -0
- package/dist/components/chart/index.d.ts +1 -0
- package/dist/components/chart/index.mjs +1 -1
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplay.d.ts +1 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayContext.d.ts +36 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayItem.d.ts +15 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayItemContext.d.ts +43 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/hooks.d.ts +7 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/types.d.ts +66 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/extractTypesFromSchema.d.ts +12 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/filterRepeatedCredentials.d.ts +7 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/findCorrectSchemaProperty.d.ts +7 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/findCredentialsByType.d.ts +8 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getCredentialTypeDisplayInfo.d.ts +8 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getCredentialValues.d.ts +9 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getParentPath.d.ts +6 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getReferencedSchemaNames.d.ts +8 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/index.d.ts +14 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isNewCredentialAgainstInstance.d.ts +9 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isNewCredentialValues.d.ts +6 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isRequiredCredentialDisplayInfo.d.ts +4 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isValidInputCredential.d.ts +10 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/makeCredentialDisplayInfoList.d.ts +15 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/sortCredentialsBySchema.d.ts +2 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/transformToFormObject.d.ts +6 -0
- package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/transformToFormSchema.d.ts +8 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldAtomic.d.ts +5 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldCheckbox.d.ts +6 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldClearAdornment.d.ts +5 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldComposite.d.ts +11 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldGroup.d.ts +13 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/index.d.ts +1 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/styles.d.ts +2 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/utils.d.ts +2 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/index.d.ts +11 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldInputModeHeader.d.ts +10 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldLabel.d.ts +19 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldLabelText.d.ts +10 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldLeftSide.d.ts +6 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldLegend.d.ts +14 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldPaper.d.ts +13 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldStack.d.ts +9 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldToggleButton.d.ts +9 -0
- package/dist/components/form/OneClickForm/components/DataField/DataFieldValue.d.ts +13 -0
- package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldImage.d.ts +9 -0
- package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputAddress.d.ts +9 -0
- package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputSelect.d.ts +9 -0
- package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputText.d.ts +9 -0
- package/dist/components/form/OneClickForm/components/DataField/formats/index.d.ts +3 -0
- package/dist/components/form/OneClickForm/components/DataField/index.d.ts +5 -0
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldDateInput.d.ts +5 -0
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldImageInput.d.ts +5 -0
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldPhoneInput.d.ts +1 -0
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldSSNInput.d.ts +5 -0
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldSelectInput.d.ts +5 -0
- package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldTextInput.d.ts +5 -0
- package/dist/components/form/OneClickForm/components/DataField/inputs/index.d.ts +6 -0
- package/dist/components/form/OneClickForm/components/DataField/types.d.ts +19 -0
- package/dist/components/form/OneClickForm/components/DataField/utils/defaults.d.ts +4 -0
- package/dist/components/form/OneClickForm/components/DataField/utils/getCredentialSeparator.d.ts +1 -0
- package/dist/components/form/OneClickForm/components/DataField/utils/hasSomeRequiredEmptyCredential.d.ts +2 -0
- package/dist/components/form/OneClickForm/components/DataField/utils/index.d.ts +3 -0
- package/dist/components/form/OneClickForm/components/shared/CountrySelector.d.ts +10 -0
- package/dist/components/form/OneClickForm/components/shared/DateInput.d.ts +19 -0
- package/dist/components/form/OneClickForm/components/shared/DefaultInput.d.ts +6 -0
- package/dist/components/form/OneClickForm/components/shared/IMaskInput.d.ts +15 -0
- package/dist/components/form/OneClickForm/components/shared/Image.d.ts +16 -0
- package/dist/components/form/OneClickForm/components/shared/ImageEncoded.d.ts +14 -0
- package/dist/components/form/OneClickForm/components/shared/InputMask.d.ts +26 -0
- package/dist/components/form/OneClickForm/components/shared/PhoneInput.d.ts +22 -0
- package/dist/components/form/OneClickForm/components/shared/TextInput.d.ts +15 -0
- package/dist/components/form/OneClickForm/components/shared/TextMaskCustom.d.ts +15 -0
- package/dist/components/form/OneClickForm/components/shared/Textarea.d.ts +14 -0
- package/dist/components/form/OneClickForm/components/shared/When.d.ts +17 -0
- package/dist/components/form/OneClickForm/components/validations/fragments/birthDate.d.ts +4 -0
- package/dist/components/form/OneClickForm/components/validations/fragments/credentials.d.ts +6 -0
- package/dist/components/form/OneClickForm/components/validations/fragments/email.d.ts +2 -0
- package/dist/components/form/OneClickForm/components/validations/fragments/otp.d.ts +2 -0
- package/dist/components/form/OneClickForm/components/validations/fragments/phone.d.ts +3 -0
- package/dist/components/form/OneClickForm/components/validations/fragments/uuid.d.ts +2 -0
- package/dist/components/form/OneClickForm/components/validations/schemas/date.schema.d.ts +2 -0
- package/dist/components/form/OneClickForm/contexts/one-click-form-options.context.d.ts +27 -0
- package/dist/components/form/OneClickForm/hooks/useDebounce.d.ts +1 -0
- package/dist/components/form/OneClickForm/hooks/useDebounceCallback.d.ts +46 -0
- package/dist/components/form/OneClickForm/hooks/usePrevious.d.ts +5 -0
- package/dist/components/form/OneClickForm/hooks/useZipCodeLookup.d.ts +11 -0
- package/dist/components/form/OneClickForm/index.d.ts +14 -0
- package/dist/components/form/OneClickForm/styles/input.d.ts +6 -0
- package/dist/components/form/OneClickForm/types/display-format.d.ts +12 -0
- package/dist/components/form/OneClickForm/types/input-format.d.ts +9 -0
- package/dist/components/form/OneClickForm/types/request.d.ts +16 -0
- package/dist/components/form/OneClickForm/utils/addressFormatter.d.ts +12 -0
- package/dist/components/form/OneClickForm/utils/calendarDateFormatter.d.ts +6 -0
- package/dist/components/form/OneClickForm/utils/compareCredentialData.d.ts +1 -0
- package/dist/components/form/OneClickForm/utils/currencyRangeFormatter.d.ts +6 -0
- package/dist/components/form/OneClickForm/utils/date.d.ts +32 -0
- package/dist/components/form/OneClickForm/utils/formatCredentialValue.d.ts +8 -0
- package/dist/components/form/OneClickForm/utils/image.d.ts +2 -0
- package/dist/components/form/OneClickForm/utils/isAtomicBySchema.d.ts +1 -0
- package/dist/components/form/OneClickForm/utils/isCompositeBySchema.d.ts +1 -0
- package/dist/components/form/OneClickForm/utils/masks.d.ts +3 -0
- package/dist/components/form/OneClickForm/utils/observers.d.ts +33 -0
- package/dist/components/form/OneClickForm/utils/phone.d.ts +31 -0
- package/dist/components/form/OneClickForm/utils/phoneNumberFormatter.d.ts +7 -0
- package/dist/components/form/OneClickForm/utils/regex.d.ts +1 -0
- package/dist/components/form/OneClickForm/utils/ssnFormatter.d.ts +7 -0
- package/dist/components/form/OneClickForm/utils/string.d.ts +14 -0
- package/dist/components/form/OneClickForm/utils/when.d.ts +10 -0
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/index-BMcFWkjH.mjs +107 -0
- package/package.json +4 -1
- package/dist/shared/index-DPBjdrwv.mjs +0 -104
@@ -0,0 +1,10 @@
|
|
1
|
+
type DataFieldLabelTextProps = {
|
2
|
+
prefix?: string;
|
3
|
+
hideRequired?: boolean;
|
4
|
+
};
|
5
|
+
/**
|
6
|
+
* Component to display a credential label text, when required it renders an asterisk.
|
7
|
+
* @constructor
|
8
|
+
*/
|
9
|
+
export declare function DataFieldLabelText(props: DataFieldLabelTextProps): import("react").JSX.Element;
|
10
|
+
export {};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
2
|
+
import { SxProps } from '@mui/material';
|
3
|
+
type DataFieldLegendProps = PropsWithChildren & {
|
4
|
+
sx?: SxProps;
|
5
|
+
error?: boolean;
|
6
|
+
};
|
7
|
+
/**
|
8
|
+
* Component to display a credential legend.
|
9
|
+
* @param children
|
10
|
+
* @param sx
|
11
|
+
* @constructor
|
12
|
+
*/
|
13
|
+
export declare function DataFieldLegend({ children, sx, ...props }: DataFieldLegendProps): import("react").JSX.Element;
|
14
|
+
export {};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
2
|
+
import { SxProps } from '@mui/material';
|
3
|
+
type DataFieldPaperProps = PropsWithChildren & {
|
4
|
+
sx?: SxProps;
|
5
|
+
};
|
6
|
+
/**
|
7
|
+
* Component used to wrap data field types.
|
8
|
+
* @param children
|
9
|
+
* @param sx
|
10
|
+
* @constructor
|
11
|
+
*/
|
12
|
+
export declare function DataFieldPaper({ children, sx }: DataFieldPaperProps): import("react").JSX.Element;
|
13
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { StackProps } from '@mui/material';
|
2
|
+
type DataFieldStackProps = StackProps;
|
3
|
+
/**
|
4
|
+
* This component renders a sequence of data field atomic/composite credentials and spaces them.
|
5
|
+
* @param props
|
6
|
+
* @constructor
|
7
|
+
*/
|
8
|
+
export declare function DataFieldStack(props: DataFieldStackProps): import("react").JSX.Element;
|
9
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { IconButtonProps } from '@mui/material';
|
2
|
+
type DataFieldToggleButtonProps = IconButtonProps;
|
3
|
+
/**
|
4
|
+
* This component renders and manages the expand/collapse of composite credentials.
|
5
|
+
* @param props
|
6
|
+
* @constructor
|
7
|
+
*/
|
8
|
+
export declare function DataFieldToggleButton(props: DataFieldToggleButtonProps): import("react").JSX.Element;
|
9
|
+
export {};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
2
|
+
import { SxProps } from '@mui/material';
|
3
|
+
type DataFieldValueProps = PropsWithChildren & {
|
4
|
+
sx?: SxProps;
|
5
|
+
};
|
6
|
+
/**
|
7
|
+
* Component to display a credential value of display type Text.
|
8
|
+
* @param children
|
9
|
+
* @param sx
|
10
|
+
* @constructor
|
11
|
+
*/
|
12
|
+
export declare function DataFieldValue({ children, sx }: DataFieldValueProps): import("react").JSX.Element;
|
13
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
type DataFieldImageProps = {
|
2
|
+
hasMultipleInstances: boolean;
|
3
|
+
};
|
4
|
+
/**
|
5
|
+
* This component is responsible to render the credential of type Image.
|
6
|
+
* @constructor
|
7
|
+
*/
|
8
|
+
export declare function DataFieldImage(props: DataFieldImageProps): import("react").JSX.Element;
|
9
|
+
export {};
|
package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputAddress.d.ts
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
type DataFieldInputAddressProps = {
|
2
|
+
hasMultipleInstances: boolean;
|
3
|
+
};
|
4
|
+
/**
|
5
|
+
* This component renders and manages display format Address.
|
6
|
+
* @constructor
|
7
|
+
*/
|
8
|
+
export declare function DataFieldInputAddress(props: DataFieldInputAddressProps): import("react").JSX.Element;
|
9
|
+
export {};
|
package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputSelect.d.ts
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
type DataFieldInputSelectProps = {
|
2
|
+
hasMultipleInstances?: boolean;
|
3
|
+
};
|
4
|
+
/**
|
5
|
+
* This component manages the input of type Select.
|
6
|
+
* @constructor
|
7
|
+
*/
|
8
|
+
export declare function DataFieldInputSelect(props: DataFieldInputSelectProps): import("react").JSX.Element;
|
9
|
+
export {};
|
package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputText.d.ts
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
type DataFieldInputTextProps = {
|
2
|
+
hasMultipleInstances?: boolean;
|
3
|
+
};
|
4
|
+
/**
|
5
|
+
* This component renders and manages the input value for display format Text or to strings.
|
6
|
+
* @constructor
|
7
|
+
*/
|
8
|
+
export declare function DataFieldInputText(props: DataFieldInputTextProps): import("react").JSX.Element;
|
9
|
+
export {};
|
package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldPhoneInput.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export declare function DataFieldPhoneInput(): import("react").JSX.Element;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export type Address = {
|
2
|
+
line1?: string;
|
3
|
+
city?: string;
|
4
|
+
state?: string;
|
5
|
+
country?: string;
|
6
|
+
postcode?: string;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Possible input format that user can provide.
|
10
|
+
*/
|
11
|
+
export declare enum InputFormatEnum {
|
12
|
+
Text = "Text",
|
13
|
+
Date = "Date",
|
14
|
+
Select = "Select",
|
15
|
+
Email = "Email",
|
16
|
+
Phone = "Phone",
|
17
|
+
SSN = "SSN",
|
18
|
+
Image = "Image"
|
19
|
+
}
|
package/dist/components/form/OneClickForm/components/DataField/utils/getCredentialSeparator.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export declare const getCredentialSeparator: (type: string | undefined) => string | undefined;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
type CountrySelectorProps = {
|
2
|
+
value: string;
|
3
|
+
onChange(value: string): void;
|
4
|
+
};
|
5
|
+
/**
|
6
|
+
* Component that renders and allows to manage the desired phone country format.
|
7
|
+
* @constructor
|
8
|
+
*/
|
9
|
+
export default function CountrySelector(props: Readonly<CountrySelectorProps>): import("react").JSX.Element;
|
10
|
+
export {};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
import { InputProps } from '@mui/material';
|
3
|
+
type DateInputProps = {
|
4
|
+
name?: string;
|
5
|
+
value?: string;
|
6
|
+
label?: ReactNode;
|
7
|
+
error?: boolean;
|
8
|
+
helperText?: string;
|
9
|
+
onChange?(event: {
|
10
|
+
target: {
|
11
|
+
value: string;
|
12
|
+
};
|
13
|
+
}): void;
|
14
|
+
disabled?: boolean;
|
15
|
+
allowFutureDates?: boolean;
|
16
|
+
InputProps?: InputProps;
|
17
|
+
};
|
18
|
+
export declare const DateInput: import('react').ForwardRefExoticComponent<Readonly<DateInputProps> & import('react').RefAttributes<unknown>>;
|
19
|
+
export {};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export type ChangeEvent = (event: {
|
2
|
+
target: {
|
3
|
+
name: string;
|
4
|
+
value: string;
|
5
|
+
};
|
6
|
+
}, nativeEvent?: InputEvent) => void;
|
7
|
+
interface InputMaskProps {
|
8
|
+
onChange: ChangeEvent;
|
9
|
+
name: string;
|
10
|
+
mask: string;
|
11
|
+
definitions?: Record<string, RegExp>;
|
12
|
+
useOnComplete?: boolean;
|
13
|
+
}
|
14
|
+
export declare const IMaskInput: import('react').ForwardRefExoticComponent<InputMaskProps & import('react').RefAttributes<HTMLInputElement>>;
|
15
|
+
export {};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { FC } from 'react';
|
2
|
+
import { BoxProps } from '@mui/material';
|
3
|
+
export interface ImageProps extends BoxProps {
|
4
|
+
src: string;
|
5
|
+
alt: string;
|
6
|
+
}
|
7
|
+
/**
|
8
|
+
* Displays an image.
|
9
|
+
*
|
10
|
+
* Wraps an HTML `img` element with MUI's `Box` component
|
11
|
+
* so that styles can easily be set (including leveraging our theme) with the `sx` prop.
|
12
|
+
*
|
13
|
+
* As recommended by the MUI docs https://mui.com/system/basics/
|
14
|
+
*/
|
15
|
+
declare const Image: FC<ImageProps>;
|
16
|
+
export default Image;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { SxProps } from '@mui/material';
|
2
|
+
type ImageEncodedProps = {
|
3
|
+
servicePath: string;
|
4
|
+
src: string;
|
5
|
+
alt?: string;
|
6
|
+
sx?: SxProps;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Image component that decodes the same by extracting our
|
10
|
+
* @param props
|
11
|
+
* @constructor
|
12
|
+
*/
|
13
|
+
export declare function ImageEncoded(props: ImageEncodedProps): import("react").JSX.Element;
|
14
|
+
export {};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { ChangeEventHandler, ReactNode } from 'react';
|
2
|
+
type Selection = {
|
3
|
+
start: string;
|
4
|
+
end: string;
|
5
|
+
};
|
6
|
+
type State = {
|
7
|
+
value: string;
|
8
|
+
selection: Selection;
|
9
|
+
};
|
10
|
+
type BeforeMaskedStateChangeOptions = {
|
11
|
+
previousState: State;
|
12
|
+
currentState: State;
|
13
|
+
nextState: State;
|
14
|
+
};
|
15
|
+
type InputMaskProps = {
|
16
|
+
children: ReactNode;
|
17
|
+
mask: string | (RegExp | string)[];
|
18
|
+
value: string;
|
19
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
20
|
+
beforeMaskedStateChange?: (options: BeforeMaskedStateChangeOptions) => void;
|
21
|
+
maskPlaceholder?: string | null;
|
22
|
+
alwaysShowMask?: boolean;
|
23
|
+
disabled?: boolean;
|
24
|
+
};
|
25
|
+
export declare function InputMask(props: Readonly<InputMaskProps>): import("react").JSX.Element;
|
26
|
+
export {};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { InputBaseProps, InputProps, SxProps, TextFieldProps } from '@mui/material';
|
2
|
+
export type PhoneInputProps = {
|
3
|
+
label?: string;
|
4
|
+
name?: string;
|
5
|
+
helperText?: string;
|
6
|
+
initialValue?: string;
|
7
|
+
onChange?(value: string): void;
|
8
|
+
error?: boolean;
|
9
|
+
handleChangeCountry?(newCountry: string): void;
|
10
|
+
value?: string;
|
11
|
+
variant?: TextFieldProps['variant'];
|
12
|
+
autoFocus?: boolean;
|
13
|
+
disabled?: boolean;
|
14
|
+
inputProps?: InputBaseProps['inputProps'];
|
15
|
+
InputProps?: InputProps;
|
16
|
+
sx?: SxProps;
|
17
|
+
};
|
18
|
+
/**
|
19
|
+
* Renders a phone input component with country selector and masking.
|
20
|
+
*/
|
21
|
+
declare function PhoneInput({ name, label, helperText, onChange, initialValue, error, value: valueProp, handleChangeCountry, inputProps: _inputProps, InputProps, }: Readonly<PhoneInputProps>): import("react").JSX.Element;
|
22
|
+
export default PhoneInput;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { FC } from 'react';
|
2
|
+
import { TextFieldProps } from '@mui/material';
|
3
|
+
/**
|
4
|
+
* A somewhat generic input for text
|
5
|
+
*
|
6
|
+
* TextInput is an abstraction over the MUI TextField component
|
7
|
+
* encapsulating props shared by inputs of this type.
|
8
|
+
* See the TextField component docs for additional props, options, etc. https://mui.com/components/text-fields/
|
9
|
+
*
|
10
|
+
* @param {TextFieldProps} props TextInput takes the same props as the MUI TextField component
|
11
|
+
* with a default values for type ('text') and id and label defaulting to the value of the name prop
|
12
|
+
* and the name prop (capitalized)
|
13
|
+
*/
|
14
|
+
declare const TextInput: FC<TextFieldProps>;
|
15
|
+
export default TextInput;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export type ChangeEvent = (event: {
|
2
|
+
target: {
|
3
|
+
name: string;
|
4
|
+
value: string;
|
5
|
+
};
|
6
|
+
}, nativeEvent?: InputEvent) => void;
|
7
|
+
interface TextMaskCustomProps {
|
8
|
+
onChange: ChangeEvent;
|
9
|
+
name: string;
|
10
|
+
mask: string;
|
11
|
+
definitions?: Record<string, RegExp>;
|
12
|
+
useOnComplete?: boolean;
|
13
|
+
}
|
14
|
+
export declare const TextMaskCustom: import('react').ForwardRefExoticComponent<TextMaskCustomProps & import('react').RefAttributes<HTMLInputElement>>;
|
15
|
+
export {};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { TextFieldProps } from '@mui/material';
|
2
|
+
import { FC } from 'react';
|
3
|
+
/**
|
4
|
+
* A multiline textarea input
|
5
|
+
*
|
6
|
+
* Textarea is an abstraction over the MUI TextField component
|
7
|
+
* encapsulating props shared by inputs of this type
|
8
|
+
* see the TextField component docs for additional props, options, etc https://mui.com/components/text-fields/
|
9
|
+
*
|
10
|
+
* @param {TextFieldProps} props Textarea takes the same props as the MUI TextField component
|
11
|
+
* with multiline always set to true.
|
12
|
+
*/
|
13
|
+
declare const Textarea: FC<TextFieldProps>;
|
14
|
+
export default Textarea;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
export type WhenProps<T = unknown> = {
|
3
|
+
value: T;
|
4
|
+
children: ReactNode | ((condition: NonNullable<T>) => ReactNode);
|
5
|
+
};
|
6
|
+
/**
|
7
|
+
* This component can be used when using value is truthy to render some other component,
|
8
|
+
* instead of using ternary operators you can use this.
|
9
|
+
*
|
10
|
+
* This is particularly useful when you have nested conditional rendering. Also, it allows for safer falsy conditions
|
11
|
+
* while in a ternary you can risk rendering falsy values in the react tree if you use `&&`.
|
12
|
+
* @param value
|
13
|
+
* @param children Children can be direct ReactNode or a function returning ReactNode, when a function,
|
14
|
+
* the value is being passed as param and is guarantee to be non-nullable excluding undefined and null from the inferred type.
|
15
|
+
* @constructor
|
16
|
+
*/
|
17
|
+
export declare function When<T>({ value, children }: WhenProps<T>): import("react").JSX.Element | null;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import * as zod from 'zod';
|
2
|
+
export declare const birthDateSchema: zod.ZodEffects<zod.ZodString, string, string>;
|
3
|
+
export declare const simpleBirthDateSchema: zod.ZodEffects<zod.ZodString, string, string>;
|
4
|
+
export declare const shortenBirthDateSchema: zod.ZodEffects<zod.ZodString, string, string>;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import * as zod from 'zod';
|
2
|
+
export declare const SSNSchema: zod.ZodString;
|
3
|
+
export declare const timestampSchema: zod.ZodEffects<zod.ZodString, string, string>;
|
4
|
+
export declare const emailSchema: zod.ZodString;
|
5
|
+
export declare const phoneSchema: zod.ZodEffects<zod.ZodString, string, string>;
|
6
|
+
export declare const defaultTextSchema: zod.ZodString;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
type OneClickOptionFeatures = {
|
3
|
+
phoneCredentialWhitelist?: string[];
|
4
|
+
phoneCredentialRegexWhitelist?: string;
|
5
|
+
};
|
6
|
+
type OneClickOptionServicePaths = {
|
7
|
+
credentialImagePath: string;
|
8
|
+
};
|
9
|
+
export type OneClickFormOptions = {
|
10
|
+
features: OneClickOptionFeatures;
|
11
|
+
servicePaths: OneClickOptionServicePaths;
|
12
|
+
};
|
13
|
+
type OneClickFormOptionsContext = {
|
14
|
+
options: OneClickFormOptions;
|
15
|
+
};
|
16
|
+
type OneClickFormOptionsProviderProps = {
|
17
|
+
children: ReactNode;
|
18
|
+
options: OneClickFormOptions;
|
19
|
+
};
|
20
|
+
export declare function useOneClickFormOptions(): OneClickFormOptionsContext;
|
21
|
+
/**
|
22
|
+
* Provider for 1-click form that should provide options to be accessed by deep react modules.
|
23
|
+
* @param props
|
24
|
+
* @constructor
|
25
|
+
*/
|
26
|
+
export declare function OneClickFormOptionsProvider(props: OneClickFormOptionsProviderProps): import("react").JSX.Element;
|
27
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function useDebounce<T>(value: T, delay?: number): T;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
/** Configuration options for controlling the behavior of the debounced function. */
|
2
|
+
type DebounceOptions = {
|
3
|
+
/**
|
4
|
+
* Determines whether the function should be invoked on the leading edge of the timeout.
|
5
|
+
* @default false
|
6
|
+
*/
|
7
|
+
leading?: boolean;
|
8
|
+
/**
|
9
|
+
* Determines whether the function should be invoked on the trailing edge of the timeout.
|
10
|
+
* @default false
|
11
|
+
*/
|
12
|
+
trailing?: boolean;
|
13
|
+
/**
|
14
|
+
* The maximum time the specified function is allowed to be delayed before it is invoked.
|
15
|
+
*/
|
16
|
+
maxWait?: number;
|
17
|
+
};
|
18
|
+
/** Functions to manage a debounced callback. */
|
19
|
+
type ControlFunctions = {
|
20
|
+
/** Cancels pending function invocations. */
|
21
|
+
cancel: () => void;
|
22
|
+
/** Immediately invokes pending function invocations. */
|
23
|
+
flush: () => void;
|
24
|
+
/**
|
25
|
+
* Checks if there are any pending function invocations.
|
26
|
+
* @returns `true` if there are pending invocations, otherwise `false`.
|
27
|
+
*/
|
28
|
+
isPending: () => boolean;
|
29
|
+
};
|
30
|
+
/**
|
31
|
+
* Represents the state and control functions of a debounced callback.
|
32
|
+
* Subsequent calls to the debounced function return the result of the last invocation.
|
33
|
+
* Note: If there are no previous invocations, the result will be undefined.
|
34
|
+
* Ensure proper handling in your code.
|
35
|
+
*/
|
36
|
+
export type DebouncedState<T extends (...args: any) => ReturnType<T>> = ((...args: Parameters<T>) => ReturnType<T> | undefined) & ControlFunctions;
|
37
|
+
/**
|
38
|
+
* Custom hook that creates a debounced version of a callback function.
|
39
|
+
* @template T - Type of the original callback function.
|
40
|
+
* @param {T} func - The callback function to be debounced.
|
41
|
+
* @param {number} delay - The delay in milliseconds before the callback is invoked (default is `500` milliseconds).
|
42
|
+
* @param {DebounceOptions} [options] - Options to control the behavior of the debounced function.
|
43
|
+
* @returns {DebouncedState<T>} A debounced version of the original callback along with control functions.
|
44
|
+
*/
|
45
|
+
export declare function useDebounceCallback<T extends (...args: any) => ReturnType<T>>(func: T, delay?: number, options?: DebounceOptions): DebouncedState<T>;
|
46
|
+
export {};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
type Request = {
|
2
|
+
zipcode: string;
|
3
|
+
};
|
4
|
+
type Response = {
|
5
|
+
state: string;
|
6
|
+
city: string;
|
7
|
+
country: string;
|
8
|
+
zipcode: string;
|
9
|
+
};
|
10
|
+
export declare function useZipCodeLookup(): import('@tanstack/react-query').UseMutationResult<Response, Error, Request, unknown>;
|
11
|
+
export {};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
import { QueryClient } from '@tanstack/react-query';
|
3
|
+
import { OneClickFormOptions } from './contexts/one-click-form-options.context';
|
4
|
+
import { CredentialRequests, Credentials, CredentialSchemas } from './types/request';
|
5
|
+
type OneClickFormProps = {
|
6
|
+
credentialRequests?: CredentialRequests[];
|
7
|
+
credentials: Credentials[];
|
8
|
+
schema: CredentialSchemas['schemas'];
|
9
|
+
options: OneClickFormOptions;
|
10
|
+
renderExtra?: ReactNode;
|
11
|
+
queryClient?: QueryClient;
|
12
|
+
};
|
13
|
+
export declare function OneClickForm({ credentialRequests, credentials, schema, options, renderExtra, queryClient: _queryClient, }: OneClickFormProps): import("react").JSX.Element;
|
14
|
+
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export declare enum DisplayFormatEnum {
|
2
|
+
Image = "Image",
|
3
|
+
Phone = "Phone",
|
4
|
+
Ssn = "SSN",
|
5
|
+
Date = "Date",
|
6
|
+
Address = "Address",
|
7
|
+
CurrencyRange = "CurrencyRange",
|
8
|
+
String = "String",
|
9
|
+
State = "State",
|
10
|
+
Number = "Number",
|
11
|
+
CurrencyAmount = "CurrencyAmount"
|
12
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export type Credentials = Record<string, any>;
|
2
|
+
export type CredentialRequests = {
|
3
|
+
type: string;
|
4
|
+
issuers?: string[];
|
5
|
+
required?: boolean;
|
6
|
+
mandatory?: 'yes' | 'no' | 'if_available';
|
7
|
+
description?: string;
|
8
|
+
allowUserInput?: boolean;
|
9
|
+
children?: CredentialRequests[];
|
10
|
+
};
|
11
|
+
export type CredentialSchemas = Record<string, any>;
|
12
|
+
export declare enum MandatoryEnum {
|
13
|
+
YES = "yes",
|
14
|
+
NO = "no",
|
15
|
+
IF_AVAILABLE = "if_available"
|
16
|
+
}
|