@verifiedinc-public/shared-ui-elements 3.14.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 (111) hide show
  1. package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplay.d.ts +1 -0
  2. package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayContext.d.ts +36 -0
  3. package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayItem.d.ts +15 -0
  4. package/dist/components/form/OneClickForm/components/CredentialsDisplay/CredentialsDisplayItemContext.d.ts +43 -0
  5. package/dist/components/form/OneClickForm/components/CredentialsDisplay/hooks.d.ts +7 -0
  6. package/dist/components/form/OneClickForm/components/CredentialsDisplay/types.d.ts +66 -0
  7. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/extractTypesFromSchema.d.ts +12 -0
  8. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/filterRepeatedCredentials.d.ts +7 -0
  9. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/findCorrectSchemaProperty.d.ts +7 -0
  10. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/findCredentialsByType.d.ts +8 -0
  11. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getCredentialTypeDisplayInfo.d.ts +8 -0
  12. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getCredentialValues.d.ts +9 -0
  13. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getParentPath.d.ts +6 -0
  14. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/getReferencedSchemaNames.d.ts +8 -0
  15. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/index.d.ts +14 -0
  16. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isNewCredentialAgainstInstance.d.ts +9 -0
  17. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isNewCredentialValues.d.ts +6 -0
  18. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isRequiredCredentialDisplayInfo.d.ts +4 -0
  19. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/isValidInputCredential.d.ts +10 -0
  20. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/makeCredentialDisplayInfoList.d.ts +15 -0
  21. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/sortCredentialsBySchema.d.ts +2 -0
  22. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/transformToFormObject.d.ts +6 -0
  23. package/dist/components/form/OneClickForm/components/CredentialsDisplay/utils/transformToFormSchema.d.ts +8 -0
  24. package/dist/components/form/OneClickForm/components/DataField/DataFieldAtomic.d.ts +5 -0
  25. package/dist/components/form/OneClickForm/components/DataField/DataFieldCheckbox.d.ts +6 -0
  26. package/dist/components/form/OneClickForm/components/DataField/DataFieldClearAdornment.d.ts +5 -0
  27. package/dist/components/form/OneClickForm/components/DataField/DataFieldComposite.d.ts +11 -0
  28. package/dist/components/form/OneClickForm/components/DataField/DataFieldGroup.d.ts +13 -0
  29. package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/index.d.ts +1 -0
  30. package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/styles.d.ts +2 -0
  31. package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/HeaderSelect/utils.d.ts +2 -0
  32. package/dist/components/form/OneClickForm/components/DataField/DataFieldHeader/index.d.ts +11 -0
  33. package/dist/components/form/OneClickForm/components/DataField/DataFieldInputModeHeader.d.ts +10 -0
  34. package/dist/components/form/OneClickForm/components/DataField/DataFieldLabel.d.ts +19 -0
  35. package/dist/components/form/OneClickForm/components/DataField/DataFieldLabelText.d.ts +10 -0
  36. package/dist/components/form/OneClickForm/components/DataField/DataFieldLeftSide.d.ts +6 -0
  37. package/dist/components/form/OneClickForm/components/DataField/DataFieldLegend.d.ts +14 -0
  38. package/dist/components/form/OneClickForm/components/DataField/DataFieldPaper.d.ts +13 -0
  39. package/dist/components/form/OneClickForm/components/DataField/DataFieldStack.d.ts +9 -0
  40. package/dist/components/form/OneClickForm/components/DataField/DataFieldToggleButton.d.ts +9 -0
  41. package/dist/components/form/OneClickForm/components/DataField/DataFieldValue.d.ts +13 -0
  42. package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldImage.d.ts +9 -0
  43. package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputAddress.d.ts +9 -0
  44. package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputSelect.d.ts +9 -0
  45. package/dist/components/form/OneClickForm/components/DataField/formats/DataFieldInputText.d.ts +9 -0
  46. package/dist/components/form/OneClickForm/components/DataField/formats/index.d.ts +3 -0
  47. package/dist/components/form/OneClickForm/components/DataField/index.d.ts +5 -0
  48. package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldDateInput.d.ts +5 -0
  49. package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldImageInput.d.ts +5 -0
  50. package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldPhoneInput.d.ts +1 -0
  51. package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldSSNInput.d.ts +5 -0
  52. package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldSelectInput.d.ts +5 -0
  53. package/dist/components/form/OneClickForm/components/DataField/inputs/DataFieldTextInput.d.ts +5 -0
  54. package/dist/components/form/OneClickForm/components/DataField/inputs/index.d.ts +6 -0
  55. package/dist/components/form/OneClickForm/components/DataField/types.d.ts +19 -0
  56. package/dist/components/form/OneClickForm/components/DataField/utils/defaults.d.ts +4 -0
  57. package/dist/components/form/OneClickForm/components/DataField/utils/getCredentialSeparator.d.ts +1 -0
  58. package/dist/components/form/OneClickForm/components/DataField/utils/hasSomeRequiredEmptyCredential.d.ts +2 -0
  59. package/dist/components/form/OneClickForm/components/DataField/utils/index.d.ts +3 -0
  60. package/dist/components/form/OneClickForm/components/shared/CountrySelector.d.ts +10 -0
  61. package/dist/components/form/OneClickForm/components/shared/DateInput.d.ts +19 -0
  62. package/dist/components/form/OneClickForm/components/shared/DefaultInput.d.ts +6 -0
  63. package/dist/components/form/OneClickForm/components/shared/IMaskInput.d.ts +15 -0
  64. package/dist/components/form/OneClickForm/components/shared/Image.d.ts +16 -0
  65. package/dist/components/form/OneClickForm/components/shared/ImageEncoded.d.ts +14 -0
  66. package/dist/components/form/OneClickForm/components/shared/InputMask.d.ts +26 -0
  67. package/dist/components/form/OneClickForm/components/shared/PhoneInput.d.ts +22 -0
  68. package/dist/components/form/OneClickForm/components/shared/TextInput.d.ts +15 -0
  69. package/dist/components/form/OneClickForm/components/shared/TextMaskCustom.d.ts +15 -0
  70. package/dist/components/form/OneClickForm/components/shared/Textarea.d.ts +14 -0
  71. package/dist/components/form/OneClickForm/components/shared/When.d.ts +17 -0
  72. package/dist/components/form/OneClickForm/components/validations/fragments/birthDate.d.ts +4 -0
  73. package/dist/components/form/OneClickForm/components/validations/fragments/credentials.d.ts +6 -0
  74. package/dist/components/form/OneClickForm/components/validations/fragments/email.d.ts +2 -0
  75. package/dist/components/form/OneClickForm/components/validations/fragments/otp.d.ts +2 -0
  76. package/dist/components/form/OneClickForm/components/validations/fragments/phone.d.ts +3 -0
  77. package/dist/components/form/OneClickForm/components/validations/fragments/uuid.d.ts +2 -0
  78. package/dist/components/form/OneClickForm/components/validations/schemas/date.schema.d.ts +2 -0
  79. package/dist/components/form/OneClickForm/contexts/one-click-form-options.context.d.ts +27 -0
  80. package/dist/components/form/OneClickForm/hooks/useDebounce.d.ts +1 -0
  81. package/dist/components/form/OneClickForm/hooks/useDebounceCallback.d.ts +46 -0
  82. package/dist/components/form/OneClickForm/hooks/usePrevious.d.ts +5 -0
  83. package/dist/components/form/OneClickForm/hooks/useZipCodeLookup.d.ts +11 -0
  84. package/dist/components/form/OneClickForm/index.d.ts +14 -0
  85. package/dist/components/form/OneClickForm/styles/input.d.ts +6 -0
  86. package/dist/components/form/OneClickForm/types/display-format.d.ts +12 -0
  87. package/dist/components/form/OneClickForm/types/input-format.d.ts +9 -0
  88. package/dist/components/form/OneClickForm/types/request.d.ts +16 -0
  89. package/dist/components/form/OneClickForm/utils/addressFormatter.d.ts +12 -0
  90. package/dist/components/form/OneClickForm/utils/calendarDateFormatter.d.ts +6 -0
  91. package/dist/components/form/OneClickForm/utils/compareCredentialData.d.ts +1 -0
  92. package/dist/components/form/OneClickForm/utils/currencyRangeFormatter.d.ts +6 -0
  93. package/dist/components/form/OneClickForm/utils/date.d.ts +32 -0
  94. package/dist/components/form/OneClickForm/utils/formatCredentialValue.d.ts +8 -0
  95. package/dist/components/form/OneClickForm/utils/image.d.ts +2 -0
  96. package/dist/components/form/OneClickForm/utils/isAtomicBySchema.d.ts +1 -0
  97. package/dist/components/form/OneClickForm/utils/isCompositeBySchema.d.ts +1 -0
  98. package/dist/components/form/OneClickForm/utils/masks.d.ts +3 -0
  99. package/dist/components/form/OneClickForm/utils/observers.d.ts +33 -0
  100. package/dist/components/form/OneClickForm/utils/phone.d.ts +31 -0
  101. package/dist/components/form/OneClickForm/utils/phoneNumberFormatter.d.ts +7 -0
  102. package/dist/components/form/OneClickForm/utils/regex.d.ts +1 -0
  103. package/dist/components/form/OneClickForm/utils/ssnFormatter.d.ts +7 -0
  104. package/dist/components/form/OneClickForm/utils/string.d.ts +14 -0
  105. package/dist/components/form/OneClickForm/utils/when.d.ts +10 -0
  106. package/dist/components/form/index.d.ts +1 -0
  107. package/dist/components/index.mjs +1 -1
  108. package/dist/index.mjs +1 -1
  109. package/dist/shared/index-BMcFWkjH.mjs +107 -0
  110. package/package.json +4 -1
  111. package/dist/shared/index-DPBjdrwv.mjs +0 -104
@@ -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
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Parses a country code into a country name.
3
+ * @param {string} code the country code
4
+ * @returns {string} the country name. If the country code is not found, the country code is returned.
5
+ */
6
+ export declare const parseCountryCode: (code: string) => string;
7
+ /**
8
+ * Formats an address value.
9
+ * @param {string} rawValue the raw address value in the format street, city, ISO 3166-2code postalcode
10
+ * @returns {string} the formatted address value in the format street\n city, region, postalcode\n country
11
+ */
12
+ export declare const addressFormatter: (rawValue: string) => string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Formats a calendar date in a human readable format
3
+ * @param {string} epoch string representation of ms since epoch
4
+ * @returns {string} formatted date
5
+ */
6
+ export declare const calendarDateFormatter: (epoch: string) => string;
@@ -0,0 +1 @@
1
+ export declare const compareCredentialData: (a: any, b: any) => boolean;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Formats a currency range string into a human-readable format.
3
+ * @param {string} rawValue the raw value from the credential, e.g. "USD min100000_max200000"
4
+ * @returns {string} the formatted value, e.g. "USD 100,000 - 200,000"
5
+ */
6
+ export declare const currencyRangeFormatter: (rawValue: string) => string;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Formats a timestamp into a pretty format of DD/MM/YYYY.
3
+ * @param timestamp
4
+ * @param separator
5
+ */
6
+ export declare const formatDateDDMMYYYY: (timestamp?: string) => string;
7
+ /**
8
+ * Formats a timestamp into a pretty format from MMDDYYY to MM/DD/YYYY.
9
+ * @param date
10
+ * @returns
11
+ */
12
+ export declare const formatRawDateMMDDYYYY: (date: string) => string;
13
+ /**
14
+ * Formats a timestamp into a pretty format from MMDD to MM/DD/YYYY always enforcing year to be 1970.
15
+ * @param date
16
+ * @returns
17
+ */
18
+ export declare const formatDateMMDD: (date: string) => string;
19
+ export declare const dateUtils: {
20
+ /**
21
+ * Convert date from MM-DD-YYYY to YYYY-MM-DD
22
+ * @param date
23
+ * @returns
24
+ */
25
+ toYYYYDDMM: (date: string) => string;
26
+ /**
27
+ * Formats a timestamp into a pretty format from MMDD to MM/DD/YYYY always enforcing year to be 1970.
28
+ * @param date
29
+ * @returns
30
+ */
31
+ formatDateMMDD: (date: string) => string;
32
+ };
@@ -0,0 +1,8 @@
1
+ import { DisplayFormatEnum } from '../types/display-format';
2
+ /**
3
+ * Formats a credential value based on its type.
4
+ * @param {string} rawValue the raw value of the credential
5
+ * @param {DisplayFormatEnum | string} type the type of the credential
6
+ * @returns {string} the formatted value
7
+ */
8
+ export declare const formatCredentialValue: (rawValue: string, type: DisplayFormatEnum | string | undefined) => string;
@@ -0,0 +1,2 @@
1
+ import { ChangeEvent } from 'react';
2
+ export declare function handleLoadImageToBase64FromFile(event: ChangeEvent<HTMLInputElement>, sizeLimit?: number): Promise<string | null>;
@@ -0,0 +1 @@
1
+ export declare const isAtomicBySchema: (schema: any | undefined) => boolean;
@@ -0,0 +1 @@
1
+ export declare const isCompositeBySchema: (schema: any | undefined) => boolean;
@@ -0,0 +1,3 @@
1
+ export declare const masks: {
2
+ DOB_MASK: string;
3
+ };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Defines a callback function for observers.
3
+ * @template T - The type of data the observer callback receives.
4
+ */
5
+ type ObserverCallback<T> = (data: T) => void;
6
+ /**
7
+ * Represents an observable object that can be observed by multiple observers.
8
+ * @template T - The type of data the observable holds.
9
+ */
10
+ interface Observable<T> {
11
+ /**
12
+ * Adds an observer to the list of observers.
13
+ * @param observer - The callback function to be invoked when the observable is updated.
14
+ */
15
+ addObserver(observer: ObserverCallback<T>): void;
16
+ /**
17
+ * Removes an observer from the list of observers.
18
+ * @param observer - The callback function to be removed from the list of observers.
19
+ */
20
+ removeObserver(observer: ObserverCallback<T>): void;
21
+ /**
22
+ * Notifies all observers with the provided data.
23
+ * @param data - The data to be sent to all observers.
24
+ */
25
+ notify(data: T): void;
26
+ }
27
+ /**
28
+ * Creates an observable object.
29
+ * @template T - The type of data the observable will hold.
30
+ * @returns An object with methods to manage observers for the created observable.
31
+ */
32
+ export declare function createObservable<T>(): Observable<T>;
33
+ export {};
@@ -0,0 +1,31 @@
1
+ type CountryData = {
2
+ countryName: string;
3
+ countryCode: string;
4
+ emoji: string;
5
+ mask: string;
6
+ };
7
+ export declare const countries: CountryData[];
8
+ export declare function parseToPhoneNational(internationalPhone: string): string;
9
+ /**
10
+ * Get phone data by the international phone string.
11
+ * @param internationalPhone
12
+ */
13
+ export declare function getPhoneData(internationalPhone: string): CountryData | undefined;
14
+ /**
15
+ * Get phone data by property and value match.
16
+ * @param fieldName
17
+ * @param value
18
+ */
19
+ export declare function getPhoneDataByFieldName(fieldName: keyof CountryData, value: string): CountryData | undefined;
20
+ /**
21
+ * Helper to sort countries by country name.
22
+ * @param a
23
+ * @param b
24
+ */
25
+ export declare const sortByCountryName: (a: CountryData, b: CountryData) => number;
26
+ /**
27
+ * Validate phone when it is valid and contains a country.
28
+ * @param internationalPhone
29
+ */
30
+ export declare const validatePhone: (internationalPhone: string) => boolean;
31
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A helper function to format phone number - currently only works on 10 digit phone numbers
3
+ * @param phoneNum string representation of a phone number
4
+ * @returns {string} formatted 10 digit phone number
5
+ */
6
+ declare const phoneNumberFormatter: (phoneNum: string) => string;
7
+ export default phoneNumberFormatter;
@@ -0,0 +1 @@
1
+ export declare const uuidV4Regex: RegExp;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Formats a SSN to the following format: •••-••-3333
3
+ * accepts SSNs with or without dashes (e.g. '111-22-3333' or '11223333')
4
+ * @param {string} rawValue the raw value of the ssncredential
5
+ * @returns {string} the formatted value
6
+ */
7
+ export declare const ssnFormatter: (rawValue: string) => string;