@verifiedinc-public/shared-ui-elements 0.11.6
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/README.md +31 -0
- package/dist/components/Alert/Alert.d.ts +3 -0
- package/dist/components/Alert/FullWidthAlert.d.ts +5 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/CredentialRequestsEditor/CredentialRequestsEditor.context.d.ts +31 -0
- package/dist/components/CredentialRequestsEditor/components/CredentialRequestsField.d.ts +2 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldAccordion.d.ts +6 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldDeleteModal.d.ts +7 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldDescription.d.ts +1 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldMandatory.d.ts +1 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldMulti.d.ts +1 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldOptionType.d.ts +1 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldSection.d.ts +11 -0
- package/dist/components/CredentialRequestsEditor/components/DataFieldUserInput.d.ts +1 -0
- package/dist/components/CredentialRequestsEditor/components/RadioOption.d.ts +11 -0
- package/dist/components/CredentialRequestsEditor/contexts/CredentialRequestFieldContext.d.ts +14 -0
- package/dist/components/CredentialRequestsEditor/index.d.ts +2 -0
- package/dist/components/CredentialRequestsEditor/types/compositeCredentialSchema.d.ts +1 -0
- package/dist/components/CredentialRequestsEditor/types/credentialSchemasDto.d.ts +3 -0
- package/dist/components/CredentialRequestsEditor/types/form.d.ts +25 -0
- package/dist/components/CredentialRequestsEditor/types/mandatoryEnum.d.ts +5 -0
- package/dist/components/CredentialRequestsEditor/utils/buildDataFieldValue.d.ts +3 -0
- package/dist/components/CredentialRequestsEditor/utils/prettyField.d.ts +1 -0
- package/dist/components/Image.d.ts +6 -0
- package/dist/components/QRCodeDisplay/index.d.ts +8 -0
- package/dist/components/RequiredLabel/index.d.ts +2 -0
- package/dist/components/TextField/index.d.ts +3 -0
- package/dist/components/Tip/index.d.ts +2 -0
- package/dist/components/Typography/index.d.ts +3 -0
- package/dist/components/When.d.ts +17 -0
- package/dist/components/form/CountrySelector.d.ts +11 -0
- package/dist/components/form/DataFieldClearAdornment.d.ts +6 -0
- package/dist/components/form/DateInput.d.ts +18 -0
- package/dist/components/form/DefaultInput.d.ts +2 -0
- package/dist/components/form/InputMask.d.ts +27 -0
- package/dist/components/form/OTPInput.d.ts +21 -0
- package/dist/components/form/PhoneInput.d.ts +30 -0
- package/dist/components/form/SSNInput.d.ts +18 -0
- package/dist/components/form/SelectInput.d.ts +21 -0
- package/dist/components/form/TextMaskCustom.d.ts +15 -0
- package/dist/components/form/index.d.ts +5 -0
- package/dist/components/form/styles/input.d.ts +6 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/terms/AcceptTermsNotice.d.ts +5 -0
- package/dist/components/terms/LegalLink.d.ts +7 -0
- package/dist/components/verified/VerifiedImage.d.ts +11 -0
- package/dist/components/verified/VerifiedIncLogo.d.ts +2 -0
- package/dist/components/verified/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/useCallbackRef.d.ts +5 -0
- package/dist/hooks/useCopyToClipboard.d.ts +20 -0
- package/dist/hooks/useDisclosure.d.ts +26 -0
- package/dist/hooks/useLocalStorage.d.ts +5 -0
- package/dist/hooks/usePrevious.d.ts +5 -0
- package/dist/hooks/useQRCode.d.ts +8 -0
- package/dist/index.d.ts +5 -0
- package/dist/shared-ui-elements.mjs +19938 -0
- package/dist/styles/colors.d.ts +23 -0
- package/dist/styles/index.d.ts +2 -0
- package/dist/styles/theme.d.ts +25 -0
- package/dist/utils/date.d.ts +8 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/masks/index.d.ts +3 -0
- package/dist/utils/omitProperty.d.ts +1 -0
- package/dist/utils/phone.d.ts +31 -0
- package/dist/utils/wrapPromise.d.ts +8 -0
- package/dist/validations/birthDate.schema.d.ts +4 -0
- package/dist/validations/date.schema.d.ts +2 -0
- package/dist/validations/description.schema.d.ts +2 -0
- package/dist/validations/email.schema.d.ts +2 -0
- package/dist/validations/field.schema.d.ts +2 -0
- package/dist/validations/index.d.ts +9 -0
- package/dist/validations/phone.schema.d.ts +2 -0
- package/dist/validations/ssn.schema.d.ts +2 -0
- package/dist/validations/state.schema.d.ts +2 -0
- package/dist/validations/unix.schema.d.ts +2 -0
- package/package.json +130 -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,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 @@
|
|
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 @@
|
|
1
|
+
export type CompositeCredentialSchema = Record<string, any>;
|
@@ -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 @@
|
|
1
|
+
export declare const prettyField: (field: string) => string;
|
@@ -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,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,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,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,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,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 {};
|