@verifiedinc-public/shared-ui-elements 0.11.6-beta.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 (79) hide show
  1. package/README.md +31 -0
  2. package/dist/components/Alert/Alert.d.ts +3 -0
  3. package/dist/components/Alert/FullWidthAlert.d.ts +5 -0
  4. package/dist/components/Alert/index.d.ts +2 -0
  5. package/dist/components/Button/index.d.ts +3 -0
  6. package/dist/components/CredentialRequestsEditor/CredentialRequestsEditor.context.d.ts +31 -0
  7. package/dist/components/CredentialRequestsEditor/components/CredentialRequestsField.d.ts +2 -0
  8. package/dist/components/CredentialRequestsEditor/components/DataFieldAccordion.d.ts +6 -0
  9. package/dist/components/CredentialRequestsEditor/components/DataFieldDeleteModal.d.ts +7 -0
  10. package/dist/components/CredentialRequestsEditor/components/DataFieldDescription.d.ts +1 -0
  11. package/dist/components/CredentialRequestsEditor/components/DataFieldMandatory.d.ts +1 -0
  12. package/dist/components/CredentialRequestsEditor/components/DataFieldMulti.d.ts +1 -0
  13. package/dist/components/CredentialRequestsEditor/components/DataFieldOptionType.d.ts +1 -0
  14. package/dist/components/CredentialRequestsEditor/components/DataFieldSection.d.ts +11 -0
  15. package/dist/components/CredentialRequestsEditor/components/DataFieldUserInput.d.ts +1 -0
  16. package/dist/components/CredentialRequestsEditor/components/RadioOption.d.ts +11 -0
  17. package/dist/components/CredentialRequestsEditor/contexts/CredentialRequestFieldContext.d.ts +14 -0
  18. package/dist/components/CredentialRequestsEditor/index.d.ts +2 -0
  19. package/dist/components/CredentialRequestsEditor/types/compositeCredentialSchema.d.ts +1 -0
  20. package/dist/components/CredentialRequestsEditor/types/credentialSchemasDto.d.ts +3 -0
  21. package/dist/components/CredentialRequestsEditor/types/form.d.ts +25 -0
  22. package/dist/components/CredentialRequestsEditor/types/mandatoryEnum.d.ts +5 -0
  23. package/dist/components/CredentialRequestsEditor/utils/buildDataFieldValue.d.ts +3 -0
  24. package/dist/components/CredentialRequestsEditor/utils/prettyField.d.ts +1 -0
  25. package/dist/components/Image.d.ts +6 -0
  26. package/dist/components/QRCodeDisplay/index.d.ts +8 -0
  27. package/dist/components/RequiredLabel/index.d.ts +2 -0
  28. package/dist/components/TextField/index.d.ts +3 -0
  29. package/dist/components/Tip/index.d.ts +2 -0
  30. package/dist/components/Typography/index.d.ts +3 -0
  31. package/dist/components/When.d.ts +17 -0
  32. package/dist/components/form/CountrySelector.d.ts +11 -0
  33. package/dist/components/form/DataFieldClearAdornment.d.ts +6 -0
  34. package/dist/components/form/DateInput.d.ts +18 -0
  35. package/dist/components/form/DefaultInput.d.ts +2 -0
  36. package/dist/components/form/InputMask.d.ts +27 -0
  37. package/dist/components/form/OTPInput.d.ts +21 -0
  38. package/dist/components/form/PhoneInput.d.ts +30 -0
  39. package/dist/components/form/SSNInput.d.ts +18 -0
  40. package/dist/components/form/SelectInput.d.ts +21 -0
  41. package/dist/components/form/TextMaskCustom.d.ts +15 -0
  42. package/dist/components/form/index.d.ts +5 -0
  43. package/dist/components/form/styles/input.d.ts +6 -0
  44. package/dist/components/index.d.ts +10 -0
  45. package/dist/components/terms/AcceptTermsNotice.d.ts +5 -0
  46. package/dist/components/terms/LegalLink.d.ts +7 -0
  47. package/dist/components/verified/VerifiedImage.d.ts +11 -0
  48. package/dist/components/verified/VerifiedIncLogo.d.ts +2 -0
  49. package/dist/components/verified/index.d.ts +2 -0
  50. package/dist/hooks/index.d.ts +5 -0
  51. package/dist/hooks/useCallbackRef.d.ts +5 -0
  52. package/dist/hooks/useCopyToClipboard.d.ts +20 -0
  53. package/dist/hooks/useDisclosure.d.ts +26 -0
  54. package/dist/hooks/useLocalStorage.d.ts +5 -0
  55. package/dist/hooks/usePrevious.d.ts +5 -0
  56. package/dist/hooks/useQRCode.d.ts +8 -0
  57. package/dist/index.d.ts +5 -0
  58. package/dist/shared-ui-elements.js +222 -0
  59. package/dist/shared-ui-elements.mjs +19938 -0
  60. package/dist/styles/colors.d.ts +23 -0
  61. package/dist/styles/index.d.ts +2 -0
  62. package/dist/styles/theme.d.ts +25 -0
  63. package/dist/utils/date.d.ts +8 -0
  64. package/dist/utils/index.d.ts +5 -0
  65. package/dist/utils/masks/index.d.ts +3 -0
  66. package/dist/utils/omitProperty.d.ts +1 -0
  67. package/dist/utils/phone.d.ts +31 -0
  68. package/dist/utils/wrapPromise.d.ts +8 -0
  69. package/dist/validations/birthDate.schema.d.ts +4 -0
  70. package/dist/validations/date.schema.d.ts +2 -0
  71. package/dist/validations/description.schema.d.ts +2 -0
  72. package/dist/validations/email.schema.d.ts +2 -0
  73. package/dist/validations/field.schema.d.ts +2 -0
  74. package/dist/validations/index.d.ts +9 -0
  75. package/dist/validations/phone.schema.d.ts +2 -0
  76. package/dist/validations/ssn.schema.d.ts +2 -0
  77. package/dist/validations/state.schema.d.ts +2 -0
  78. package/dist/validations/unix.schema.d.ts +2 -0
  79. package/package.json +111 -0
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # shared-ui-elements
2
+
3
+ > Set of shared components.
4
+
5
+ ## About
6
+
7
+ This project was created to share the UI, agnostic logics and theme throughout the core apps.
8
+
9
+ ## Getting Started
10
+
11
+ 1. Make sure you have [NodeJS](https://nodejs.org/) and [npm](https://www.npmjs.com/) installed.
12
+ 2. Install your dependencies
13
+
14
+ ```
15
+ cd path/to/shared-ui-elements
16
+ npm install
17
+ ```
18
+
19
+ 3. Start Storybook
20
+
21
+ ```
22
+ npm run storybook # Runs storybook
23
+ ```
24
+
25
+ ## Path import alias
26
+
27
+ This project utilizes alias only for the storybook implementation, the modules to be exposed in the package are not aliased since the package will be consumed by the core apps and they may not have the same alias configuration nor the same folder structure.
28
+
29
+ ## Adding dependencies
30
+
31
+ Ensure that new dependencies are added to both devDependencies and peerDependencies if required in the client's project.
@@ -0,0 +1,3 @@
1
+ import { AlertProps as MUIAlertProps } from '@mui/material/Alert';
2
+ export type AlertProps = MUIAlertProps;
3
+ export declare function Alert(props: AlertProps): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { AlertProps } from '@mui/material';
2
+ interface FullWidthAlertProps extends AlertProps {
3
+ }
4
+ export declare function FullWidthAlert({ children, sx, ...props }: FullWidthAlertProps): React.JSX.Element;
5
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './Alert';
2
+ export * from './FullWidthAlert';
@@ -0,0 +1,3 @@
1
+ import { ButtonProps as MUIButtonProps } from '@mui/material/Button';
2
+ export type ButtonProps = MUIButtonProps;
3
+ export declare function Button(props: ButtonProps): React.JSX.Element;
@@ -0,0 +1,31 @@
1
+ import { ReactNode } from 'react';
2
+ import { CredentialRequests, CredentialRequestsWithNew } from './types/form';
3
+ export interface CredentialRequestsEditorFeatures {
4
+ allowUserInput?: {
5
+ disabled?: boolean;
6
+ };
7
+ description?: {
8
+ disabled?: boolean;
9
+ };
10
+ mandatory?: {
11
+ disabled?: boolean;
12
+ };
13
+ multi?: {
14
+ disabled?: boolean;
15
+ };
16
+ }
17
+ export interface CredentialRequestsEditorProps {
18
+ addButtonText?: string;
19
+ credentialRequests: CredentialRequestsWithNew[];
20
+ schemas: Record<string, any>;
21
+ children: ReactNode;
22
+ onChange: (credentialRequests: CredentialRequests[]) => void;
23
+ features?: CredentialRequestsEditorFeatures;
24
+ }
25
+ export interface CredentialRequestsEditorContext {
26
+ addButtonText?: string;
27
+ schemas: Record<string, any>;
28
+ features?: CredentialRequestsEditorFeatures;
29
+ }
30
+ export declare function useCredentialRequestsEditor(): CredentialRequestsEditorContext;
31
+ export declare function CredentialRequestsEditorProvider(props: CredentialRequestsEditorProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare function CredentialRequestsField(): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ interface DataFieldAccordionProps {
3
+ defaultExpanded?: boolean;
4
+ }
5
+ export declare function DataFieldAccordion(props: DataFieldAccordionProps): React.JSX.Element;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ interface DataFieldDeleteModalProps {
2
+ open: boolean;
3
+ onClose: () => void;
4
+ onConfirm: () => void;
5
+ }
6
+ export declare function DataFieldDeleteModal({ open, onClose, onConfirm, }: DataFieldDeleteModalProps): React.JSX.Element;
7
+ export {};
@@ -0,0 +1 @@
1
+ export declare function DataFieldDescription(): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function DataFieldMandatory(): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function DataFieldMulti(): React.JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare function DataFieldOptionType(): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ import { SxProps } from '@mui/material';
3
+ interface DataFieldSectionProps {
4
+ children: ReactNode;
5
+ title: string;
6
+ description?: string;
7
+ tip?: ReactNode;
8
+ sx?: SxProps;
9
+ }
10
+ export declare function DataFieldSection(props: DataFieldSectionProps): React.JSX.Element;
11
+ export {};
@@ -0,0 +1 @@
1
+ export declare function DataFieldUserInput(): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ import { RadioProps, SxProps } from '@mui/material';
3
+ type RadioOptionProps = RadioProps & {
4
+ isDefault?: boolean;
5
+ title: string;
6
+ description?: string;
7
+ tip?: ReactNode;
8
+ sx?: SxProps;
9
+ };
10
+ export declare function RadioOption(props: RadioOptionProps): React.JSX.Element;
11
+ export {};
@@ -0,0 +1,14 @@
1
+ import { default as React, PropsWithChildren } from 'react';
2
+ import { FieldArrayWithId, UseFieldArrayReturn } from 'react-hook-form';
3
+ import { CredentialRequestsEditorForm } from '../types/form';
4
+ type CredentialRequestFieldContext = PropsWithChildren & {
5
+ path: string | undefined;
6
+ field: FieldArrayWithId<CredentialRequestsEditorForm, 'credentialRequests'>;
7
+ fieldArray: UseFieldArrayReturn<CredentialRequestsEditorForm, 'credentialRequests'>;
8
+ index: number;
9
+ level: number;
10
+ onAllFieldsDelete: () => void;
11
+ };
12
+ export declare const useCredentialRequestField: () => CredentialRequestFieldContext | null;
13
+ export declare function CredentialRequestFieldProvider({ children, ...props }: CredentialRequestFieldContext): React.JSX.Element;
14
+ export {};
@@ -0,0 +1,2 @@
1
+ import { CredentialRequestsEditorProps } from './CredentialRequestsEditor.context';
2
+ export declare function CredentialRequestsEditor(props: Omit<CredentialRequestsEditorProps, 'children'>): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export type CompositeCredentialSchema = Record<string, any>;
@@ -0,0 +1,3 @@
1
+ export interface CredentialSchemaDto {
2
+ schemas: Record<string, any>;
3
+ }
@@ -0,0 +1,25 @@
1
+ import { MandatoryEnum } from './mandatoryEnum';
2
+ export interface CredentialRequests {
3
+ type: string;
4
+ issuers?: string[];
5
+ required?: boolean;
6
+ mandatory?: MandatoryEnum;
7
+ description?: string;
8
+ allowUserInput?: boolean;
9
+ multi?: boolean;
10
+ children?: CredentialRequests[];
11
+ }
12
+ export interface CredentialRequestsWithNew {
13
+ type: string;
14
+ issuers?: string[];
15
+ required?: boolean;
16
+ mandatory?: MandatoryEnum;
17
+ description?: string;
18
+ allowUserInput?: boolean;
19
+ multi?: boolean;
20
+ children?: CredentialRequestsWithNew[];
21
+ isNew?: boolean;
22
+ }
23
+ export interface CredentialRequestsEditorForm {
24
+ credentialRequests: CredentialRequestsWithNew[];
25
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum MandatoryEnum {
2
+ YES = "yes",
3
+ NO = "no",
4
+ IF_AVAILABLE = "if_available"
5
+ }
@@ -0,0 +1,3 @@
1
+ import { CredentialRequests } from '../types/form';
2
+ import { CredentialSchemaDto } from '../types/credentialSchemasDto';
3
+ export declare function buildDataFieldValue(type: string, schema: CredentialSchemaDto['schemas']): CredentialRequests;
@@ -0,0 +1 @@
1
+ export declare const prettyField: (field: string) => string;
@@ -0,0 +1,6 @@
1
+ import { BoxProps } from '@mui/material';
2
+ export interface ImageProps extends BoxProps {
3
+ src: string;
4
+ alt: string;
5
+ }
6
+ export declare const Image: ({ src, alt, ...props }: ImageProps) => JSX.Element;
@@ -0,0 +1,8 @@
1
+ export interface QRCodeDisplayProps {
2
+ data: string;
3
+ asset?: string;
4
+ svgSize?: number;
5
+ logoSize?: number;
6
+ fill?: string;
7
+ }
8
+ export declare function QRCodeDisplay({ data, asset, svgSize, logoSize, fill, }: QRCodeDisplayProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export declare function RequiredLabel(props: Readonly<PropsWithChildren>): React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { TextFieldProps as MUITextFieldProps } from '@mui/material/TextField';
2
+ export type TextFieldProps = MUITextFieldProps;
3
+ export declare function TextField(props: TextFieldProps): JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export declare function Tip({ children }: PropsWithChildren): React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { TypographyProps as MUITypographyProps } from '@mui/material/Typography';
2
+ export type TypographyProps = MUITypographyProps;
3
+ export declare function Typography(props: TypographyProps): JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ export interface 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>): React.JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ interface CountrySelectorProps {
2
+ value: string;
3
+ onChange: (value: string) => void;
4
+ shouldShowOnlyNorthAmericanCountries?: boolean;
5
+ }
6
+ /**
7
+ * Component that renders and allows to manage the desired phone country format.
8
+ * @constructor
9
+ */
10
+ export default function CountrySelector({ shouldShowOnlyNorthAmericanCountries, ...props }: Readonly<CountrySelectorProps>): React.JSX.Element;
11
+ export {};
@@ -0,0 +1,6 @@
1
+ type DataFieldClearAdornmentProps = Readonly<{
2
+ onClick?: () => void;
3
+ handleClear: () => void;
4
+ }>;
5
+ export declare function DataFieldClearAdornment({ onClick, handleClear, }: DataFieldClearAdornmentProps): React.JSX.Element;
6
+ export {};
@@ -0,0 +1,18 @@
1
+ import { ChangeEventHandler } from 'react';
2
+ interface DateInputProps {
3
+ name?: string;
4
+ value?: string;
5
+ label?: string;
6
+ error?: boolean;
7
+ helperText?: string;
8
+ onChange?: (event: {
9
+ target: {
10
+ value: string;
11
+ };
12
+ }) => void;
13
+ onBlur?: ChangeEventHandler<HTMLInputElement>;
14
+ disabled?: boolean;
15
+ allowFutureDates?: boolean;
16
+ }
17
+ export declare const DateInput: import('react').ForwardRefExoticComponent<Readonly<DateInputProps> & import('react').RefAttributes<unknown>>;
18
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const _default: import('react').ForwardRefExoticComponent<(Omit<import('@mui/material').OutlinedTextFieldProps, "ref"> | Omit<import('@mui/material').FilledTextFieldProps, "ref"> | Omit<import('@mui/material').StandardTextFieldProps, "ref">) & import('react').RefAttributes<unknown>>;
2
+ export default _default;
@@ -0,0 +1,27 @@
1
+ import { ChangeEventHandler, ReactNode } from 'react';
2
+ interface Selection {
3
+ start: string;
4
+ end: string;
5
+ }
6
+ interface State {
7
+ value: string;
8
+ selection: Selection;
9
+ }
10
+ interface BeforeMaskedStateChangeOptions {
11
+ previousState: State;
12
+ currentState: State;
13
+ nextState: State;
14
+ }
15
+ interface InputMaskProps {
16
+ children: ReactNode;
17
+ mask: string | Array<RegExp | string>;
18
+ value: string;
19
+ onChange: ChangeEventHandler<HTMLInputElement>;
20
+ onBlur?: ChangeEventHandler<HTMLInputElement>;
21
+ beforeMaskedStateChange?: (options: BeforeMaskedStateChangeOptions) => void;
22
+ maskPlaceholder?: string | null;
23
+ alwaysShowMask?: boolean;
24
+ disabled?: boolean;
25
+ }
26
+ export declare function InputMask(props: Readonly<InputMaskProps>): React.JSX.Element;
27
+ export {};
@@ -0,0 +1,21 @@
1
+ import { SxProps } from '@mui/material';
2
+ interface OTPInputProps {
3
+ name?: string;
4
+ onChange?: (event: {
5
+ target: {
6
+ value: string;
7
+ };
8
+ }) => void;
9
+ disabled?: boolean;
10
+ sx?: SxProps;
11
+ }
12
+ export type OTPInputInstance = Readonly<{
13
+ focus: () => void;
14
+ blur: () => void;
15
+ clear: () => void;
16
+ }> & {
17
+ get value(): string;
18
+ set value(newValue: string);
19
+ };
20
+ export declare const OTPInput: import('react').ForwardRefExoticComponent<OTPInputProps & import('react').RefAttributes<OTPInputInstance>>;
21
+ export {};
@@ -0,0 +1,30 @@
1
+ import { InputProps } from '@mui/material';
2
+ import { TextFieldProps } from '../TextField';
3
+ export interface PhoneInputProps {
4
+ label?: string;
5
+ name?: string;
6
+ helperText?: string;
7
+ initialValue?: string;
8
+ onChange?: (value: string) => void;
9
+ onValidPhone?: (value: string) => void;
10
+ error?: boolean;
11
+ handleChangeCountry?: (newCountry: string) => void;
12
+ value?: string;
13
+ shouldShowOnlyNorthAmericanCountries?: boolean;
14
+ shouldHaveClearButton?: boolean;
15
+ variant?: TextFieldProps['variant'];
16
+ InputProps?: InputProps;
17
+ }
18
+ /**
19
+ * Renders a phone input component with country selector and masking.
20
+ *
21
+ * @param label - The label for the phone input. Defaults to 'Phone'.
22
+ * @param name - The name of the phone input. Defaults to 'phone'.
23
+ * @param helperText - The helper text for the phone input.
24
+ * @param onChange - The callback function to handle the change event of the phone input.
25
+ * @param initialValue - The initial value for the phone input. Defaults to ''.
26
+ * @param error - Whether the phone input has an error. Defaults to false.
27
+ * @param handleChangeCountry - The callback function to handle the change event of the country selector.
28
+ * @param value - The value of the phone input. If passed, it will be used instead of the value from component state.
29
+ */
30
+ export declare function PhoneInput({ label, name, helperText, onChange, onValidPhone, initialValue, error, handleChangeCountry, value: valueProp, InputProps, shouldHaveClearButton, }: Readonly<PhoneInputProps>): React.JSX.Element;
@@ -0,0 +1,18 @@
1
+ export interface SSNInputProps {
2
+ onChange?: (event: {
3
+ target: {
4
+ value: string;
5
+ };
6
+ }) => void;
7
+ name?: string;
8
+ value?: string;
9
+ label?: string;
10
+ error?: boolean;
11
+ helperText?: string;
12
+ shouldHaveCloseAdornment?: boolean;
13
+ }
14
+ /**
15
+ * This component manages the input of type SSN.
16
+ * @constructor
17
+ */
18
+ export declare function SSNInput({ onChange, label, shouldHaveCloseAdornment, ...rest }: SSNInputProps): React.JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { TextFieldProps as InternalFieldProps } from '@mui/material';
2
+ interface TextFieldProps extends Omit<InternalFieldProps, 'onChange'> {
3
+ }
4
+ interface Option {
5
+ label: string;
6
+ id: string;
7
+ }
8
+ interface SelectInputProps {
9
+ name?: string;
10
+ onChange?: (value: Option | null) => void;
11
+ onClear?: () => void;
12
+ options: Option[];
13
+ defaultOption?: Option;
14
+ InputProps?: TextFieldProps;
15
+ }
16
+ /**
17
+ * This component manages the input of type Select.
18
+ * @constructor
19
+ */
20
+ export declare function SelectInput({ options, defaultOption, onChange, onClear, ...props }: SelectInputProps): React.JSX.Element;
21
+ 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 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,5 @@
1
+ export * from './DateInput';
2
+ export * from './SSNInput';
3
+ export * from './SelectInput';
4
+ export * from './PhoneInput';
5
+ export * from './OTPInput';
@@ -0,0 +1,6 @@
1
+ import { TextFieldProps } from '../../../components/TextField';
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,10 @@
1
+ export * from './Button';
2
+ export * from './Typography';
3
+ export * from './CredentialRequestsEditor';
4
+ export * from './terms/AcceptTermsNotice';
5
+ export * from './When';
6
+ export * from './Alert';
7
+ export * from './Image';
8
+ export * from './form/';
9
+ export * from './verified';
10
+ export * from './QRCodeDisplay';
@@ -0,0 +1,5 @@
1
+ interface AcceptTermsNoticeProps {
2
+ legalLinkUrl?: string;
3
+ }
4
+ export declare const AcceptTermsNotice: ({ legalLinkUrl, }: AcceptTermsNoticeProps) => React.JSX.Element;
5
+ export {};
@@ -0,0 +1,7 @@
1
+ import { LinkProps } from '@mui/material';
2
+ /**
3
+ * A component which renders a link syled following advice from our legal counsel for linking to legal documents
4
+ * like terms of use, privacy policy, etc
5
+ */
6
+ declare const LegalLink: ({ sx, ...props }: LinkProps) => import("react").JSX.Element;
7
+ export default LegalLink;
@@ -0,0 +1,11 @@
1
+ import { SxProps } from '@mui/material';
2
+ interface VerifiedImageProps {
3
+ theme: {
4
+ light: string;
5
+ main: string;
6
+ dark: string;
7
+ };
8
+ sx?: SxProps;
9
+ }
10
+ export declare function VerifiedImage(props: VerifiedImageProps): React.JSX.Element;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ import { BoxProps } from '@mui/material';
2
+ export declare function VerifiedIncLogo(props: BoxProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './VerifiedImage';
2
+ export * from './VerifiedIncLogo';
@@ -0,0 +1,5 @@
1
+ export * from './useLocalStorage';
2
+ export * from './useCopyToClipboard';
3
+ export * from './useDisclosure';
4
+ export * from './useCallbackRef';
5
+ export * from './useQRCode';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This hook is user-land implementation of the experimental `useEffectEvent` hook.
3
+ * React docs: https://react.dev/learn/separating-events-from-effects#declaring-an-effect-event
4
+ */
5
+ export declare function useCallbackRef<Args extends unknown[], Return>(callback: ((...args: Args) => Return) | undefined, deps?: React.DependencyList): (...args: Args) => Return | undefined;
@@ -0,0 +1,20 @@
1
+ interface CopyClipboardTextPlainOptions {
2
+ type: 'text/plain';
3
+ }
4
+ interface CopyClipboardTextHtmlOptions {
5
+ type: 'text/html';
6
+ }
7
+ interface CopyClipboardImagePNGOptions {
8
+ type: 'image/png';
9
+ }
10
+ export type CopyToClipboardOptions = CopyClipboardTextHtmlOptions | CopyClipboardTextPlainOptions | CopyClipboardImagePNGOptions;
11
+ type Content<Type> = Type extends CopyClipboardImagePNGOptions['type'] ? Blob : Type extends CopyClipboardTextPlainOptions['type'] ? string : Type extends CopyClipboardTextHtmlOptions['type'] ? string : never;
12
+ interface HookReturnType<Options extends CopyToClipboardOptions> {
13
+ copy: (content: Content<Options['type']>) => Promise<void>;
14
+ }
15
+ /**
16
+ * Method hook to copy content to clipboard, it should copy large type of content.
17
+ * @param options.type MIME type of content to be copied.
18
+ * */
19
+ export declare function useCopyToClipboard<Options extends CopyToClipboardOptions>({ type, }: Options): HookReturnType<Options>;
20
+ export {};
@@ -0,0 +1,26 @@
1
+ import { default as React } from 'react';
2
+ export interface UseDisclosureProps {
3
+ open?: boolean;
4
+ defaultOpen?: boolean;
5
+ onClose?: () => void;
6
+ onOpen?: () => void;
7
+ id?: string;
8
+ }
9
+ type HTMLProps = React.HTMLAttributes<HTMLElement>;
10
+ /**
11
+ * `useDisclosure` is a custom hook used to help handle common open, close, or toggle scenarios.
12
+ * It can be used to control feedback component such as `Modal`, `AlertDialog`, `Drawer`, etc.
13
+ *
14
+ * @see Docs https://chakra-ui.com/docs/hooks/use-disclosure
15
+ */
16
+ export declare function useDisclosure(props?: UseDisclosureProps): {
17
+ open: boolean;
18
+ onOpen: () => void;
19
+ onClose: () => void;
20
+ onToggle: () => void;
21
+ isControlled: boolean;
22
+ getButtonProps: (props?: HTMLProps) => HTMLProps;
23
+ getDisclosureProps: (props?: HTMLProps) => HTMLProps;
24
+ };
25
+ export type UseDisclosureReturn = ReturnType<typeof useDisclosure>;
26
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare function useLocalStorage(key: string): {
2
+ set: (value: any) => void;
3
+ get: () => any;
4
+ remove: () => void;
5
+ };
@@ -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,8 @@
1
+ type QRCodeHookOptions = {
2
+ size: number;
3
+ imageSize: number;
4
+ data: string;
5
+ fill?: string;
6
+ };
7
+ export declare function useQRCode(hookOptions: QRCodeHookOptions): string;
8
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from './components';
2
+ export * from './hooks';
3
+ export * from './styles';
4
+ export * from './utils';
5
+ export * from './validations';