@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.
Files changed (114) hide show
  1. package/dist/components/chart/ReasonCodesChart/index.d.ts +42 -0
  2. package/dist/components/chart/index.d.ts +1 -0
  3. package/dist/components/chart/index.mjs +1 -1
  4. package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplay.d.ts +1 -0
  5. package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayContext.d.ts +36 -0
  6. package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayItem.d.ts +15 -0
  7. package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayItemContext.d.ts +43 -0
  8. package/dist/components/form/OneClickForm/components/CredentialsDisplay/hooks.d.ts +7 -0
  9. package/dist/components/form/OneClickForm/components/CredentialsDisplay/types.d.ts +66 -0
  10. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/extractTypesFromSchema.d.ts +12 -0
  11. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/filterRepeatedCredentials.d.ts +7 -0
  12. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/findCorrectSchemaProperty.d.ts +7 -0
  13. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/findCredentialsByType.d.ts +8 -0
  14. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getCredentialTypeDisplayInfo.d.ts +8 -0
  15. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getCredentialValues.d.ts +9 -0
  16. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getParentPath.d.ts +6 -0
  17. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getReferencedSchemaNames.d.ts +8 -0
  18. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/index.d.ts +14 -0
  19. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isNewCredentialAgainstInstance.d.ts +9 -0
  20. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isNewCredentialValues.d.ts +6 -0
  21. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isRequiredCredentialDisplayInfo.d.ts +4 -0
  22. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isValidInputCredential.d.ts +10 -0
  23. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/makeCredentialDisplayInfoList.d.ts +15 -0
  24. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/sortCredentialsBySchema.d.ts +2 -0
  25. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/transformToFormObject.d.ts +6 -0
  26. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/transformToFormSchema.d.ts +8 -0
  27. package/dist/components/form/OneClickForm/components/DataField/DataFieldAtomic.d.ts +5 -0
  28. package/dist/components/form/OneClickForm/components/DataField/DataFieldCheckbox.d.ts +6 -0
  29. package/dist/components/form/OneClickForm/components/DataField/DataFieldClearAdornment.d.ts +5 -0
  30. package/dist/components/form/OneClickForm/components/DataField/DataFieldComposite.d.ts +11 -0
  31. package/dist/components/form/OneClickForm/components/DataField/DataFieldGroup.d.ts +13 -0
  32. package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/index.d.ts +1 -0
  33. package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/styles.d.ts +2 -0
  34. package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/utils.d.ts +2 -0
  35. package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/index.d.ts +11 -0
  36. package/dist/components/form/OneClickForm/components/DataField/DataFieldInputModeHeader.d.ts +10 -0
  37. package/dist/components/form/OneClickForm/components/DataField/DataFieldLabel.d.ts +19 -0
  38. package/dist/components/form/OneClickForm/components/DataField/DataFieldLabelText.d.ts +10 -0
  39. package/dist/components/form/OneClickForm/components/DataField/DataFieldLeftSide.d.ts +6 -0
  40. package/dist/components/form/OneClickForm/components/DataField/DataFieldLegend.d.ts +14 -0
  41. package/dist/components/form/OneClickForm/components/DataField/DataFieldPaper.d.ts +13 -0
  42. package/dist/components/form/OneClickForm/components/DataField/DataFieldStack.d.ts +9 -0
  43. package/dist/components/form/OneClickForm/components/DataField/DataFieldToggleButton.d.ts +9 -0
  44. package/dist/components/form/OneClickForm/components/DataField/DataFieldValue.d.ts +13 -0
  45. package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldImage.d.ts +9 -0
  46. package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputAddress.d.ts +9 -0
  47. package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputSelect.d.ts +9 -0
  48. package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputText.d.ts +9 -0
  49. package/dist/components/form/OneClickForm/components/DataField/formats/index.d.ts +3 -0
  50. package/dist/components/form/OneClickForm/components/DataField/index.d.ts +5 -0
  51. package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldDateInput.d.ts +5 -0
  52. package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldImageInput.d.ts +5 -0
  53. package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldPhoneInput.d.ts +1 -0
  54. package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldSSNInput.d.ts +5 -0
  55. package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldSelectInput.d.ts +5 -0
  56. package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldTextInput.d.ts +5 -0
  57. package/dist/components/form/OneClickForm/components/DataField/inputs/index.d.ts +6 -0
  58. package/dist/components/form/OneClickForm/components/DataField/types.d.ts +19 -0
  59. package/dist/components/form/OneClickForm/components/DataField/utils/defaults.d.ts +4 -0
  60. package/dist/components/form/OneClickForm/components/DataField/utils/getCredentialSeparator.d.ts +1 -0
  61. package/dist/components/form/OneClickForm/components/DataField/utils/hasSomeRequiredEmptyCredential.d.ts +2 -0
  62. package/dist/components/form/OneClickForm/components/DataField/utils/index.d.ts +3 -0
  63. package/dist/components/form/OneClickForm/components/shared/CountrySelector.d.ts +10 -0
  64. package/dist/components/form/OneClickForm/components/shared/DateInput.d.ts +19 -0
  65. package/dist/components/form/OneClickForm/components/shared/DefaultInput.d.ts +6 -0
  66. package/dist/components/form/OneClickForm/components/shared/IMaskInput.d.ts +15 -0
  67. package/dist/components/form/OneClickForm/components/shared/Image.d.ts +16 -0
  68. package/dist/components/form/OneClickForm/components/shared/ImageEncoded.d.ts +14 -0
  69. package/dist/components/form/OneClickForm/components/shared/InputMask.d.ts +26 -0
  70. package/dist/components/form/OneClickForm/components/shared/PhoneInput.d.ts +22 -0
  71. package/dist/components/form/OneClickForm/components/shared/TextInput.d.ts +15 -0
  72. package/dist/components/form/OneClickForm/components/shared/TextMaskCustom.d.ts +15 -0
  73. package/dist/components/form/OneClickForm/components/shared/Textarea.d.ts +14 -0
  74. package/dist/components/form/OneClickForm/components/shared/When.d.ts +17 -0
  75. package/dist/components/form/OneClickForm/components/validations/fragments/birthDate.d.ts +4 -0
  76. package/dist/components/form/OneClickForm/components/validations/fragments/credentials.d.ts +6 -0
  77. package/dist/components/form/OneClickForm/components/validations/fragments/email.d.ts +2 -0
  78. package/dist/components/form/OneClickForm/components/validations/fragments/otp.d.ts +2 -0
  79. package/dist/components/form/OneClickForm/components/validations/fragments/phone.d.ts +3 -0
  80. package/dist/components/form/OneClickForm/components/validations/fragments/uuid.d.ts +2 -0
  81. package/dist/components/form/OneClickForm/components/validations/schemas/date.schema.d.ts +2 -0
  82. package/dist/components/form/OneClickForm/contexts/one-click-form-options.context.d.ts +27 -0
  83. package/dist/components/form/OneClickForm/hooks/useDebounce.d.ts +1 -0
  84. package/dist/components/form/OneClickForm/hooks/useDebounceCallback.d.ts +46 -0
  85. package/dist/components/form/OneClickForm/hooks/usePrevious.d.ts +5 -0
  86. package/dist/components/form/OneClickForm/hooks/useZipCodeLookup.d.ts +11 -0
  87. package/dist/components/form/OneClickForm/index.d.ts +14 -0
  88. package/dist/components/form/OneClickForm/styles/input.d.ts +6 -0
  89. package/dist/components/form/OneClickForm/types/display-format.d.ts +12 -0
  90. package/dist/components/form/OneClickForm/types/input-format.d.ts +9 -0
  91. package/dist/components/form/OneClickForm/types/request.d.ts +16 -0
  92. package/dist/components/form/OneClickForm/utils/addressFormatter.d.ts +12 -0
  93. package/dist/components/form/OneClickForm/utils/calendarDateFormatter.d.ts +6 -0
  94. package/dist/components/form/OneClickForm/utils/compareCredentialData.d.ts +1 -0
  95. package/dist/components/form/OneClickForm/utils/currencyRangeFormatter.d.ts +6 -0
  96. package/dist/components/form/OneClickForm/utils/date.d.ts +32 -0
  97. package/dist/components/form/OneClickForm/utils/formatCredentialValue.d.ts +8 -0
  98. package/dist/components/form/OneClickForm/utils/image.d.ts +2 -0
  99. package/dist/components/form/OneClickForm/utils/isAtomicBySchema.d.ts +1 -0
  100. package/dist/components/form/OneClickForm/utils/isCompositeBySchema.d.ts +1 -0
  101. package/dist/components/form/OneClickForm/utils/masks.d.ts +3 -0
  102. package/dist/components/form/OneClickForm/utils/observers.d.ts +33 -0
  103. package/dist/components/form/OneClickForm/utils/phone.d.ts +31 -0
  104. package/dist/components/form/OneClickForm/utils/phoneNumberFormatter.d.ts +7 -0
  105. package/dist/components/form/OneClickForm/utils/regex.d.ts +1 -0
  106. package/dist/components/form/OneClickForm/utils/ssnFormatter.d.ts +7 -0
  107. package/dist/components/form/OneClickForm/utils/string.d.ts +14 -0
  108. package/dist/components/form/OneClickForm/utils/when.d.ts +10 -0
  109. package/dist/components/form/index.d.ts +1 -0
  110. package/dist/components/index.mjs +1 -1
  111. package/dist/index.mjs +1 -1
  112. package/dist/shared/index-BMcFWkjH.mjs +107 -0
  113. package/package.json +4 -1
  114. 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,6 @@
1
+ /**
2
+ * This component will render the left side of a data field,
3
+ * rendering checkbox or nothing depending on the isSelectable field.
4
+ * @constructor
5
+ */
6
+ export declare function DataFieldLeftSide(): import("react").JSX.Element;
@@ -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 {};
@@ -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 {};
@@ -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 {};
@@ -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 {};
@@ -0,0 +1,3 @@
1
+ export * from './DataFieldImage';
2
+ export * from './DataFieldInputAddress';
3
+ export * from './DataFieldInputText';
@@ -0,0 +1,5 @@
1
+ export * from './DataFieldLabel';
2
+ export * from './DataFieldValue';
3
+ export * from './DataFieldGroup';
4
+ export * from './DataFieldLegend';
5
+ export * from './DataFieldLabelText';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This component manages the input of type Date.
3
+ * @constructor
4
+ */
5
+ export declare function DataFieldDateInput(): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This component manages the input of type Image.
3
+ * @constructor
4
+ */
5
+ export declare function DataFieldImageInput(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function DataFieldPhoneInput(): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This component manages the input of type SSN.
3
+ * @constructor
4
+ */
5
+ export declare function DataFieldSSNInput(): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This component manages the input of type Select.
3
+ * @constructor
4
+ */
5
+ export declare function DataFieldSelectInput(): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This component manages the input of type Text.
3
+ * @constructor
4
+ */
5
+ export declare function DataFieldTextInput(): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export * from './DataFieldTextInput';
2
+ export * from './DataFieldSelectInput';
3
+ export * from './DataFieldPhoneInput';
4
+ export * from './DataFieldDateInput';
5
+ export * from './DataFieldSSNInput';
6
+ export * from './DataFieldImageInput';
@@ -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
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Default values for the DataField input components.
3
+ */
4
+ export declare const DEBOUNCE_MS = 150;
@@ -0,0 +1 @@
1
+ export declare const getCredentialSeparator: (type: string | undefined) => string | undefined;
@@ -0,0 +1,2 @@
1
+ import { CredentialDisplayInfo } from '../../CredentialsDisplay/types';
2
+ export declare function hasSomeRequiredEmptyCredential(credentialDisplayInfo: CredentialDisplayInfo): boolean;
@@ -0,0 +1,3 @@
1
+ export * from './hasSomeRequiredEmptyCredential';
2
+ export * from './getCredentialSeparator';
3
+ export * from './defaults';
@@ -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,6 @@
1
+ declare const _default: import('react').ForwardRefExoticComponent<Omit<{
2
+ [x: string]: any;
3
+ variant?: string | undefined;
4
+ margin?: string | undefined;
5
+ }, "ref"> & import('react').RefAttributes<unknown>>;
6
+ export default _default;
@@ -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,2 @@
1
+ import * as zod from 'zod';
2
+ export declare const EmailFragmentSchema: zod.ZodString;
@@ -0,0 +1,2 @@
1
+ import * as zod from 'zod';
2
+ export declare const OTPFragmentSchema: zod.ZodString;
@@ -0,0 +1,3 @@
1
+ import * as zod from 'zod';
2
+ export declare const PhoneFragmentSchema: zod.ZodString;
3
+ export declare const StrictPhoneFragmentSchema: zod.ZodEffects<zod.ZodString, string, string>;
@@ -0,0 +1,2 @@
1
+ import * as zod from 'zod';
2
+ export declare const UUIDFragmentSchema: zod.ZodString;
@@ -0,0 +1,2 @@
1
+ import * as zod from 'zod';
2
+ export declare const USDateSchema: zod.ZodEffects<zod.ZodString, string, string>;
@@ -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,5 @@
1
+ /**
2
+ * Custom React hook for tracking previous values.
3
+ * @param value
4
+ */
5
+ export declare function usePrevious<T>(value: T): T | undefined;
@@ -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,6 @@
1
+ import { TextFieldProps } from '@mui/material';
2
+ /**
3
+ * The base style definition for input fields, it should reflect changes across all inputs.
4
+ */
5
+ export declare const inputStyle: TextFieldProps;
6
+ export declare const readOnlyInputStyle: TextFieldProps;
@@ -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,9 @@
1
+ export declare enum InputFormatEnum {
2
+ Text = "Text",
3
+ Date = "Date",
4
+ Select = "Select",
5
+ Email = "Email",
6
+ Phone = "Phone",
7
+ SSN = "SSN",
8
+ Image = "Image"
9
+ }
@@ -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
+ }