@thenamespace/ens-components 0.0.1-alpha
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 +201 -0
- package/dist/index.css +2 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +8642 -0
- package/dist/index.js +30966 -0
- package/dist/index.js.map +1 -0
- package/dist/types/components/atoms/button/Button.d.ts +13 -0
- package/dist/types/components/atoms/chain-icon/ChainIcon.d.ts +9 -0
- package/dist/types/components/atoms/icon/Icon.d.ts +12 -0
- package/dist/types/components/atoms/icon/custom/DiscordIcon.d.ts +6 -0
- package/dist/types/components/atoms/icon/custom/GithubIcon.d.ts +6 -0
- package/dist/types/components/atoms/icon/custom/TelegramIcon.d.ts +6 -0
- package/dist/types/components/atoms/icon/custom/XIcon.d.ts +6 -0
- package/dist/types/components/atoms/icon/custom/YoutubeIcon.d.ts +6 -0
- package/dist/types/components/atoms/icon/custom/index.d.ts +5 -0
- package/dist/types/components/atoms/index.d.ts +6 -0
- package/dist/types/components/atoms/input/Input.d.ts +15 -0
- package/dist/types/components/atoms/text/Text.d.ts +14 -0
- package/dist/types/components/atoms/tooltip/Tooltip.d.ts +17 -0
- package/dist/types/components/ens-records-form/EnsRecordsForm.d.ts +13 -0
- package/dist/types/components/ens-records-form/record-diff/RecordDiff.d.ts +6 -0
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/components/molecules/alert/Alert.d.ts +13 -0
- package/dist/types/components/molecules/contenthash/ContenthashIcon.d.ts +7 -0
- package/dist/types/components/molecules/contenthash/icons/ArweaveIcon.d.ts +5 -0
- package/dist/types/components/molecules/contenthash/icons/IpfsIcon.d.ts +5 -0
- package/dist/types/components/molecules/contenthash/icons/OnionIcon.d.ts +5 -0
- package/dist/types/components/molecules/contenthash/icons/SkynetIcon.d.ts +5 -0
- package/dist/types/components/molecules/contenthash/icons/SwarmIcon.d.ts +5 -0
- package/dist/types/components/molecules/dropdown/Dropdown.d.ts +13 -0
- package/dist/types/components/molecules/index.d.ts +4 -0
- package/dist/types/components/molecules/modal/Modal.d.ts +23 -0
- package/dist/types/components/pending-transaction/PendingTransaction.d.ts +14 -0
- package/dist/types/components/select-records-form/SelectRecordsForm.d.ts +7 -0
- package/dist/types/components/select-records-form/address-record/AddressRecords.d.ts +9 -0
- package/dist/types/components/select-records-form/contenthash-records/ContenthashRecord.d.ts +10 -0
- package/dist/types/components/select-records-form/image-records/ImageRecords.d.ts +9 -0
- package/dist/types/components/select-records-form/records-selector/RecordsSelector.d.ts +18 -0
- package/dist/types/components/select-records-form/text-records/TextRecords.d.ts +11 -0
- package/dist/types/constants/index.d.ts +3 -0
- package/dist/types/constants/records/addressConstants.d.ts +14 -0
- package/dist/types/constants/records/contenthashConstants.d.ts +8 -0
- package/dist/types/constants/records/textConstants.d.ts +16 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/useWaitForTransaction.d.ts +3 -0
- package/dist/types/hooks/useWeb3Clients.d.ts +8041 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/providers/TransactionProvider.d.ts +1 -0
- package/dist/types/styles.d.ts +1 -0
- package/dist/types/theme/ThemeProvider.d.ts +15 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/records.d.ts +24 -0
- package/dist/types/utils/coins.d.ts +1 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/records.d.ts +13 -0
- package/dist/types/utils/resolver.d.ts +2 -0
- package/dist/types/utils/strings.d.ts +3 -0
- package/dist/types/web3/index.d.ts +1 -0
- package/dist/types/web3/resolver-abi.d.ts +56 -0
- package/package.json +91 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "./Button.css";
|
|
3
|
+
export type ButtonVariant = "solid" | "outline" | "ghost";
|
|
4
|
+
export type ButtonSize = "sm" | "md" | "lg";
|
|
5
|
+
export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'prefix'> {
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
prefix?: ReactNode;
|
|
10
|
+
dataTestId?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Button: React.FC<ButtonProps>;
|
|
13
|
+
export default Button;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./ChainIcon.css";
|
|
3
|
+
export type ChainName = "eth" | "arb" | "base" | "bitcoin" | "matic" | "op" | "sol" | "zora";
|
|
4
|
+
interface ChainIconProps extends React.SVGProps<SVGSVGElement> {
|
|
5
|
+
chain: ChainName;
|
|
6
|
+
size?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const ChainIcon: React.FC<ChainIconProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Icon.css";
|
|
3
|
+
export type IconName = "person" | "x" | "search" | "square-user" | "globe" | "pin" | "box" | "book" | "map-pin" | "mail" | "discord" | "github" | "telegram" | "youtube" | "image" | "circle-person" | "twitter" | "circle-alert" | "check-circle" | "alert-triangle" | "info" | "x-circle" | "rotate-circle";
|
|
4
|
+
export interface IconProps {
|
|
5
|
+
name: IconName;
|
|
6
|
+
color?: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
dataTestId?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const Icon: React.FC<IconProps>;
|
|
12
|
+
export default Icon;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Input.css";
|
|
3
|
+
export type InputType = "text" | "number";
|
|
4
|
+
export type InputSize = "sm" | "md" | "lg";
|
|
5
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> {
|
|
6
|
+
type?: InputType;
|
|
7
|
+
size?: InputSize;
|
|
8
|
+
prefix?: React.ReactNode;
|
|
9
|
+
suffix?: React.ReactNode;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
error?: boolean;
|
|
12
|
+
dataTestId?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
15
|
+
export default Input;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Text.css";
|
|
3
|
+
export type TextSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
export type TextWeight = "light" | "regular" | "medium" | "bold";
|
|
5
|
+
export type TextColor = "primary" | "white" | "grey" | "danger";
|
|
6
|
+
export interface TextProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
size?: TextSize;
|
|
9
|
+
weight?: TextWeight;
|
|
10
|
+
color?: TextColor;
|
|
11
|
+
dataTestId?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const Text: React.FC<TextProps>;
|
|
14
|
+
export default Text;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import './Tooltip.css';
|
|
3
|
+
export type TooltipPosition = 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
4
|
+
export interface TooltipProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
content: ReactNode;
|
|
7
|
+
position?: TooltipPosition;
|
|
8
|
+
delay?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
contentClassName?: string;
|
|
12
|
+
trigger?: 'hover' | 'click' | 'focus';
|
|
13
|
+
maxWidth?: number;
|
|
14
|
+
offset?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const Tooltip: React.FC<TooltipProps>;
|
|
17
|
+
export default Tooltip;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EnsRecords } from "@/types";
|
|
2
|
+
import "./EnsRecordsForm.css";
|
|
3
|
+
import { Address, Hash } from "viem";
|
|
4
|
+
interface EditRecordsFormProps {
|
|
5
|
+
initialRecords?: EnsRecords;
|
|
6
|
+
resolverAddress: Address;
|
|
7
|
+
name: string;
|
|
8
|
+
chainId?: number;
|
|
9
|
+
onCancel?: () => void;
|
|
10
|
+
onSuccess?: (txHash: Hash) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const EnsRecordsForm: ({ name, initialRecords, chainId, resolverAddress, onCancel, onSuccess, }: EditRecordsFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Alert.css";
|
|
3
|
+
export type AlertVariant = "error" | "warning" | "info" | "success";
|
|
4
|
+
export interface AlertProps {
|
|
5
|
+
variant?: AlertVariant;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
dismissible?: boolean;
|
|
10
|
+
title?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Alert: React.FC<AlertProps>;
|
|
13
|
+
export default Alert;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ContenthashProtocol } from "@/types";
|
|
2
|
+
interface ContenthashIconProps extends React.SVGProps<SVGSVGElement> {
|
|
3
|
+
protocol: ContenthashProtocol;
|
|
4
|
+
size?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const ContenthashIcon: (props: ContenthashIconProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Dropdown.css";
|
|
3
|
+
export interface DropdownProps {
|
|
4
|
+
trigger: React.ReactNode;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
placement?: "top" | "bottom" | "left" | "right";
|
|
7
|
+
align?: "start" | "center" | "end";
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
dataTestId?: string;
|
|
10
|
+
closeCallback?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const Dropdown: React.FC<DropdownProps>;
|
|
13
|
+
export default Dropdown;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Modal.css";
|
|
3
|
+
export type ModalSize = "sm" | "md" | "lg";
|
|
4
|
+
export interface ModalProps {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
title?: React.ReactNode;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** Optional footer content. If not provided, a default Close button is shown. */
|
|
10
|
+
footer?: React.ReactNode;
|
|
11
|
+
/** Width preset for the dialog */
|
|
12
|
+
size?: ModalSize;
|
|
13
|
+
/** Disable closing on overlay click and Escape */
|
|
14
|
+
isDismissDisabled?: boolean;
|
|
15
|
+
/** Optional id for the title element to improve accessibility */
|
|
16
|
+
titleId?: string;
|
|
17
|
+
/** Additional className for the container */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Optional styles for the dialog container */
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
export declare const Modal: React.FC<ModalProps>;
|
|
23
|
+
export default Modal;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./PendingTransaction.css";
|
|
2
|
+
export declare enum TransactionState {
|
|
3
|
+
InProgress = "In Progress",
|
|
4
|
+
Completed = "Completed",
|
|
5
|
+
Failed = "Failed"
|
|
6
|
+
}
|
|
7
|
+
interface PendingTransactionProps {
|
|
8
|
+
state: TransactionState;
|
|
9
|
+
blockExplorerUrl: string;
|
|
10
|
+
transactionHash?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const PendingTransaction: ({ state, blockExplorerUrl, transactionHash, className, }: PendingTransactionProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EnsRecords } from "@/types";
|
|
2
|
+
import "./SelectRecordsForm.css";
|
|
3
|
+
export interface SelectRecordsFormProps {
|
|
4
|
+
records: EnsRecords;
|
|
5
|
+
onRecordsUpdated: (records: EnsRecords) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const SelectRecordsForm: ({ records, onRecordsUpdated, }: SelectRecordsFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EnsAddressRecord } from "@/types";
|
|
2
|
+
interface AddressRecordProps {
|
|
3
|
+
initialAddresses: EnsAddressRecord[];
|
|
4
|
+
addresses: EnsAddressRecord[];
|
|
5
|
+
onAddressesChanged: (addresses: EnsAddressRecord[]) => void;
|
|
6
|
+
searchFilter?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const AddressRecords: ({ addresses, onAddressesChanged, initialAddresses, searchFilter, }: AddressRecordProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ContenthashProtocol, EnsContenthashRecord } from "@/types";
|
|
2
|
+
interface ContenthashRecordProps {
|
|
3
|
+
contenthash?: EnsContenthashRecord;
|
|
4
|
+
onContenthashChanged: (value: EnsContenthashRecord) => void;
|
|
5
|
+
onContenthashRemoved: () => void;
|
|
6
|
+
onContenthashAdded: (protocol: ContenthashProtocol) => void;
|
|
7
|
+
searchFilter?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const ContenthashRecord: ({ contenthash, onContenthashChanged, onContenthashRemoved, onContenthashAdded, searchFilter, }: ContenthashRecordProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./ImageRecords.css";
|
|
2
|
+
interface ImageRecordProps {
|
|
3
|
+
avatar?: string;
|
|
4
|
+
header?: string;
|
|
5
|
+
onAvatarAdded: (value: string) => void;
|
|
6
|
+
onHeaderAdded: (value: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const ImageRecords: ({ avatar, header, onAvatarAdded, onHeaderAdded, }: ImageRecordProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EnsContenthashRecord, EnsAddressRecord, EnsTextRecord } from "@/types";
|
|
2
|
+
import "./RecordsSelector.css";
|
|
3
|
+
export type ScrollToRecordSegment = "texts" | "addresses" | "website";
|
|
4
|
+
export interface RecordsAddedParams {
|
|
5
|
+
keys: string[];
|
|
6
|
+
coins: number[];
|
|
7
|
+
contenthash?: EnsContenthashRecord;
|
|
8
|
+
}
|
|
9
|
+
interface RecordsSelectorProps {
|
|
10
|
+
texts: EnsTextRecord[];
|
|
11
|
+
addresses: EnsAddressRecord[];
|
|
12
|
+
contenthash?: EnsContenthashRecord;
|
|
13
|
+
segment?: ScrollToRecordSegment;
|
|
14
|
+
onRecordsAdded: (params: RecordsAddedParams) => void;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const RecordsSelector: ({ onClose, texts, addresses, contenthash, segment, onRecordsAdded }: RecordsSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EnsTextRecord } from "@/types";
|
|
2
|
+
import { TextRecordCategory } from "@/constants";
|
|
3
|
+
interface TextRecordsProps {
|
|
4
|
+
initialTexts: EnsTextRecord[];
|
|
5
|
+
texts: EnsTextRecord[];
|
|
6
|
+
onTextsChanged: (texts: EnsTextRecord[]) => void;
|
|
7
|
+
category: TextRecordCategory;
|
|
8
|
+
searchFilter?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const TextRecords: ({ texts, onTextsChanged, category, initialTexts, searchFilter, }: TextRecordsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChainName } from "@/components";
|
|
2
|
+
export interface SupportedEnsAddress {
|
|
3
|
+
validateFunc?: (value: string) => boolean;
|
|
4
|
+
isEMV?: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
coinType: number;
|
|
7
|
+
chainId?: number;
|
|
8
|
+
chainName: ChainName;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const supportedAddresses: SupportedEnsAddress[];
|
|
12
|
+
export declare const getSupportedAddressMap: () => Record<number, SupportedEnsAddress>;
|
|
13
|
+
export declare const getSupportedAddressByCoin: (coin: number) => SupportedEnsAddress | undefined;
|
|
14
|
+
export declare const getSupportedAddressByName: (name: ChainName) => SupportedEnsAddress | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ContenthashProtocol } from "@/types";
|
|
2
|
+
export interface SupportedContenthashRecord {
|
|
3
|
+
protocol: ContenthashProtocol;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const supportedContenthashRecords: SupportedContenthashRecord[];
|
|
7
|
+
export declare const getSupportedChashByProtocol: (protocol: ContenthashProtocol) => SupportedContenthashRecord | undefined;
|
|
8
|
+
export declare const isContenthashValid: (protocol: ContenthashProtocol, value: string) => boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IconName } from "@/components";
|
|
2
|
+
export declare enum TextRecordCategory {
|
|
3
|
+
Image = "image",
|
|
4
|
+
General = "general",
|
|
5
|
+
Social = "social"
|
|
6
|
+
}
|
|
7
|
+
export interface SupportedTextRecord {
|
|
8
|
+
icon: IconName;
|
|
9
|
+
key: string;
|
|
10
|
+
category: TextRecordCategory;
|
|
11
|
+
label?: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const supportedTexts: SupportedTextRecord[];
|
|
15
|
+
export declare const getSupportedTextMap: () => Record<string, SupportedTextRecord>;
|
|
16
|
+
export declare const getSupportedText: (key: string) => SupportedTextRecord | undefined;
|