@thenamespace/ens-components 0.37.0 → 1.1.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 (29) hide show
  1. package/README.md +200 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.css.map +1 -1
  4. package/dist/index.d.ts +86 -10
  5. package/dist/index.js +90524 -66487
  6. package/dist/index.js.map +1 -1
  7. package/dist/styles.js.map +1 -1
  8. package/dist/types/components/atoms/icon/Icon.d.ts +1 -1
  9. package/dist/types/components/ens-name-registration/ENSNameRegistrationForm.d.ts +6 -0
  10. package/dist/types/components/ens-name-registration/RegistrationSummary.d.ts +6 -0
  11. package/dist/types/components/ens-records-form/EnsRecordsForm.d.ts +2 -1
  12. package/dist/types/components/ens-records-form/EnsUpdateRecordsForm.d.ts +3 -1
  13. package/dist/types/components/molecules/modal/Modal.d.ts +9 -0
  14. package/dist/types/components/offchain-subname-form/OffchainSubnameForm.d.ts +2 -1
  15. package/dist/types/components/select-records-form/SelectRecordsForm.d.ts +7 -1
  16. package/dist/types/components/select-records-form/avatar-upload/AvatarUploadModal.d.ts +12 -0
  17. package/dist/types/components/select-records-form/avatar-upload/cropImage.d.ts +2 -0
  18. package/dist/types/components/select-records-form/header-upload/HeaderUploadModal.d.ts +12 -0
  19. package/dist/types/components/select-records-form/image-records/ImageRecords.d.ts +5 -1
  20. package/dist/types/components/select-records-form/image-upload/ImageUploadModal.d.ts +16 -0
  21. package/dist/types/components/select-records-form/text-records/TextRecords.d.ts +3 -1
  22. package/dist/types/components/subname-mint-form/MintFormActions.d.ts +3 -1
  23. package/dist/types/components/subname-mint-form/SetSubnameRecords.d.ts +2 -0
  24. package/dist/types/components/subname-mint-form/SubnameMintForm.d.ts +2 -1
  25. package/dist/types/hooks/index.d.ts +1 -0
  26. package/dist/types/hooks/useAvatarClient.d.ts +19 -0
  27. package/dist/types/web3/index.d.ts +0 -1
  28. package/package.json +3 -21
  29. package/dist/types/web3/wallet-connect.d.ts +0 -2
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { Address, Hash, ContractFunctionExecutionError, TransactionReceipt } from 'viem';
3
3
  import * as React$1 from 'react';
4
- import React__default, { ReactNode, PropsWithChildren } from 'react';
4
+ import React__default, { ReactNode } from 'react';
5
5
 
6
6
  interface EnsRecords$1 {
7
7
  addresses: EnsAddressRecord$1[];
@@ -61,12 +61,18 @@ declare enum ListingNetwork {
61
61
  }
62
62
  declare const getChainIdForListingNetwork: (network: ListingNetwork) => number;
63
63
 
64
+ interface AvatarUploadContext {
65
+ ensName: string;
66
+ isTestnet?: boolean;
67
+ siweDomain?: string;
68
+ }
64
69
  interface SelectRecordsFormProps {
65
70
  records: EnsRecords$1;
66
71
  onRecordsUpdated: (records: EnsRecords$1) => void;
67
72
  actionButtons?: React.ReactNode;
73
+ avatarUpload?: AvatarUploadContext;
68
74
  }
69
- declare const SelectRecordsForm: ({ records, onRecordsUpdated, actionButtons, }: SelectRecordsFormProps) => react_jsx_runtime.JSX.Element;
75
+ declare const SelectRecordsForm: ({ records, onRecordsUpdated, actionButtons, avatarUpload, }: SelectRecordsFormProps) => react_jsx_runtime.JSX.Element;
70
76
 
71
77
  interface EnsNameRegistrationFormProps {
72
78
  name?: string;
@@ -74,9 +80,15 @@ interface EnsNameRegistrationFormProps {
74
80
  referrer?: Address;
75
81
  noBorder?: boolean;
76
82
  className?: string;
83
+ title?: string;
84
+ subtitle?: string;
85
+ bannerImage?: string;
86
+ hideBanner?: boolean;
87
+ bannerWidth?: number;
77
88
  onRegistrationSuccess?: (result: RegistrationSuccessData) => void;
78
89
  onClose?: (isSuccess: boolean) => void;
79
90
  onRegistrationStart?: (name: string) => void;
91
+ onConnectWallet?: () => void;
80
92
  }
81
93
  interface RegistrationSuccessData {
82
94
  expiryInYears: number;
@@ -145,13 +157,14 @@ interface EnsRecordsFormProps {
145
157
  existingRecords: EnsRecords$1;
146
158
  noBorder?: boolean;
147
159
  className?: string;
160
+ avatarUploadDomain?: string;
148
161
  onCancel?: () => void;
149
162
  onRecordsUpdated?: (newRecords: EnsRecordsDiff) => void;
150
163
  onGreat?: () => void;
151
164
  onTransactionSent?: (hash: Hash) => void;
152
165
  txConfirmations?: number;
153
166
  }
154
- declare const EnsRecordsForm: ({ name, existingRecords, resolverChainId, isTestnet, resolverAddress, noBorder, className, onCancel, onGreat, onRecordsUpdated, onTransactionSent, txConfirmations }: EnsRecordsFormProps) => react_jsx_runtime.JSX.Element;
167
+ declare const EnsRecordsForm: ({ name, existingRecords, resolverChainId, isTestnet, resolverAddress, noBorder, className, avatarUploadDomain, onCancel, onGreat, onRecordsUpdated, onTransactionSent, txConfirmations }: EnsRecordsFormProps) => react_jsx_runtime.JSX.Element;
155
168
 
156
169
  interface MintSuccessData {
157
170
  fullName: string;
@@ -181,8 +194,9 @@ interface SubnameMintFormProps {
181
194
  onSuccess?: (data: MintSuccessData) => void;
182
195
  onSubnameMinted?: (data: SubnameMintedData) => void;
183
196
  txConfirmations?: number;
197
+ onConnectWallet?: () => void;
184
198
  }
185
- declare const SubnameMintForm: ({ parentName, label, isTestnet, onCancel, onSuccess, onSubnameMinted, txConfirmations }: SubnameMintFormProps) => react_jsx_runtime.JSX.Element;
199
+ declare const SubnameMintForm: ({ parentName, label, isTestnet, onCancel, onSuccess, onSubnameMinted, txConfirmations, onConnectWallet, }: SubnameMintFormProps) => react_jsx_runtime.JSX.Element;
186
200
 
187
201
  interface OffchainSubnameCreatedData {
188
202
  label: string;
@@ -198,9 +212,10 @@ interface OffchainSubnameFormProps {
198
212
  hideTitle?: boolean;
199
213
  onCancel?: () => void;
200
214
  isTestnet?: boolean;
215
+ avatarUploadDomain?: string;
201
216
  onSuccess?: (data: OffchainSubnameCreatedData) => void;
202
217
  }
203
- declare const OffchainSubnameForm: ({ apiKeyOrToken, name, label: propLabel, hideTitle, isTestnet, onCancel, onSuccess, }: OffchainSubnameFormProps) => react_jsx_runtime.JSX.Element;
218
+ declare const OffchainSubnameForm: ({ apiKeyOrToken, name, label: propLabel, hideTitle, isTestnet, avatarUploadDomain, onCancel, onSuccess, }: OffchainSubnameFormProps) => react_jsx_runtime.JSX.Element;
204
219
 
205
220
  type ButtonVariant = "solid" | "outline" | "ghost" | "destructive";
206
221
  type ButtonSize = "sm" | "md" | "lg";
@@ -251,7 +266,7 @@ interface TextProps extends React__default.HTMLAttributes<HTMLSpanElement> {
251
266
  }
252
267
  declare const Text: React__default.FC<TextProps>;
253
268
 
254
- 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" | "check" | "alert-triangle" | "info" | "x-circle" | "rotate-circle" | "logout" | "edit" | "copy" | "clock" | "image" | "xSocial" | "chevron-up" | "chevron-down" | "chevron-left";
269
+ 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" | "check" | "alert-triangle" | "info" | "x-circle" | "rotate-circle" | "logout" | "edit" | "copy" | "clock" | "plus" | "image" | "xSocial" | "chevron-up" | "chevron-down" | "chevron-left";
255
270
  interface IconProps {
256
271
  name: IconName;
257
272
  color?: string;
@@ -324,6 +339,11 @@ interface AlertProps {
324
339
  declare const Alert: React__default.FC<AlertProps>;
325
340
 
326
341
  type ModalSize = "sm" | "md" | "lg";
342
+ type ModalPresentation = "dialog" | "drawer";
343
+ interface ModalResponsivePresentation {
344
+ mobile?: ModalPresentation;
345
+ breakpointPx?: number;
346
+ }
327
347
  interface ModalProps {
328
348
  isOpen: boolean;
329
349
  onClose: () => void;
@@ -341,6 +361,10 @@ interface ModalProps {
341
361
  className?: string;
342
362
  /** Optional styles for the dialog container */
343
363
  style?: React__default.CSSProperties;
364
+ /** Visual presentation mode */
365
+ presentation?: ModalPresentation;
366
+ /** Optional responsive presentation overrides */
367
+ responsivePresentation?: ModalResponsivePresentation;
344
368
  }
345
369
  declare const Modal: React__default.FC<ModalProps>;
346
370
 
@@ -528,8 +552,6 @@ declare const ENS_RESOLVER_ABI: readonly [{
528
552
  readonly outputs: readonly [];
529
553
  }];
530
554
 
531
- declare const WalletConnectProvider: ({ children }: PropsWithChildren) => react_jsx_runtime.JSX.Element;
532
-
533
555
  type ThemeName = "light" | "dark";
534
556
  interface ThemeContextValue {
535
557
  theme: ThemeName;
@@ -1090,6 +1112,24 @@ interface OffchainClient {
1090
1112
  * ```
1091
1113
  */
1092
1114
  setDefaultApiKey(apiKey: string): void;
1115
+ /**
1116
+ * Set custom HTTP headers to be sent with each request.
1117
+ * Useful for tracing, multi-tenant routing, or additional auth metadata.
1118
+ *
1119
+ * WARNING: The API key is sent using the "x-auth-token" header by default.
1120
+ * If you pass a header with the same name here, it will overwrite the
1121
+ * API key value used for authentication.
1122
+ *
1123
+ * @param headers - A record of header keys and values
1124
+ * @example
1125
+ * ```typescript
1126
+ * client.setCustomHeaders({
1127
+ * 'x-trace-id': '123',
1128
+ * 'x-tenant-id': 'my-tenant',
1129
+ * });
1130
+ * ```
1131
+ */
1132
+ setCustomHeaders(headers: Record<string, any>): void;
1093
1133
  /**
1094
1134
  * Create a new ENS subname with optional records.
1095
1135
  * @param request - Subname creation parameters
@@ -1290,5 +1330,41 @@ interface OffchainClient {
1290
1330
 
1291
1331
  declare const useOffchainManager: (name: string, apiKeyOrToken: string, isTestnet?: boolean) => OffchainClient;
1292
1332
 
1293
- export { Accordion, Alert, Button, Card, ChainIcon, ConnectAndSetChain, ContenthashIcon, ContenthashProtocol, ContractErrorLabel, Dropdown, ENS_RESOLVER_ABI, EnsNameRegistrationForm, EnsRecordsForm, Icon, Input, ListingNetwork, ListingType, MULTICALL, Modal, OffchainSubnameForm, PricingDisplay, ProfileHeader, ProgressBar, SET_ADDRESS_FUNC, SET_CONTENTHASH_FUNC, SET_TEXT_FUNC, SelectRecordsForm, ShurikenSpinner, SubnameMintForm, Text, TextRecordCategory, Textarea, ThemeProvider, Tooltip, TxProgress, WalletConnectProvider, capitalize, convertEVMChainIdToCoinType, convertToMulticallResolverData, convertToResolverData, createEnsReferer, debounce, deepCopy, diffToEnsRecords, ensureFloatInput, equalsIgnoreCase, formatFloat, getBlockExplorer, getBlockExplorerAddressUrl, getBlockExplorerName, getBlockExplorerTransactionUrl, getChainIdForListingNetwork, getEnsAppUrl, getEnsRecordsDiff, getSupportedAddressByChainId, getSupportedAddressByCoin, getSupportedAddressByName, getSupportedAddressMap, getSupportedChashByProtocol, getSupportedText, isCommitmentToNewErr, isContenthashValid, isUserDeniedError, supportedAddresses, supportedContenthashRecords, supportedTexts, useENSResolver, useMintManager, useMintSubname, useOffchainManager, useRegisterENS, useTheme, useWaitTransaction, validateEnsRecords, wait };
1294
- export type { AccordionProps, AlertPosition, AlertProps, AlertVariant, ButtonProps, ButtonSize, ButtonVariant, ChainName$2 as ChainName, ConnectAndSetChainProps, ContractErrorLabelProps, DropdownProps, EnsAddressRecord$1 as EnsAddressRecord, EnsContenthashRecord, EnsRecords$1 as EnsRecords, EnsRecordsDiff, EnsTextRecord$1 as EnsTextRecord, EstimatedFees, IconName, IconProps, InputProps, InputSize, InputType, ModalProps, ModalSize, NameListing, PricingDisplayProps, ProfileHeaderProps, RecordValidationError, RegistrationRequest, ShurikenSpinnerProps, SupportedContenthashRecord, SupportedEnsAddress, SupportedText, SupportedTextRecord, TextCategory, TextColor, TextProps, TextSize, TextWeight, TextareaProps, TextareaSize, ThemeContextValue, ThemeName, ThemeProviderProps, TooltipPosition, TooltipProps };
1333
+ /**
1334
+ * Upload result
1335
+ */
1336
+ interface UploadResult {
1337
+ /** URL of the uploaded image */
1338
+ url: string;
1339
+ /** Upload timestamp */
1340
+ uploadedAt: string;
1341
+ /** File size in bytes */
1342
+ fileSize: number;
1343
+ /** Whether this was an update to existing image */
1344
+ isUpdate: boolean;
1345
+ /** Whether the upload is pending (for unregistered names) */
1346
+ pending?: boolean;
1347
+ /** Optional message from the server */
1348
+ message?: string;
1349
+ }
1350
+
1351
+ interface UseAvatarClientParams {
1352
+ isTestnet?: boolean;
1353
+ domain?: string;
1354
+ }
1355
+ interface UploadAvatarParams {
1356
+ ensName: string;
1357
+ file: File;
1358
+ onProgress?: (progress: number) => void;
1359
+ }
1360
+ type UploadImageType = "avatar" | "header";
1361
+ declare const getAvatarUploadErrorMessage: (err: unknown) => string;
1362
+ declare const getImageUploadErrorMessage: (err: unknown, imageType?: UploadImageType) => string;
1363
+ declare const useAvatarClient: ({ isTestnet, domain }: UseAvatarClientParams) => {
1364
+ uploadAvatar: (params: UploadAvatarParams) => Promise<UploadResult>;
1365
+ uploadHeader: (params: UploadAvatarParams) => Promise<UploadResult>;
1366
+ getErrorMessage: (err: unknown, imageType?: UploadImageType) => string;
1367
+ };
1368
+
1369
+ export { Accordion, Alert, Button, Card, ChainIcon, ConnectAndSetChain, ContenthashIcon, ContenthashProtocol, ContractErrorLabel, Dropdown, ENS_RESOLVER_ABI, EnsNameRegistrationForm, EnsRecordsForm, Icon, Input, ListingNetwork, ListingType, MULTICALL, Modal, OffchainSubnameForm, PricingDisplay, ProfileHeader, ProgressBar, SET_ADDRESS_FUNC, SET_CONTENTHASH_FUNC, SET_TEXT_FUNC, SelectRecordsForm, ShurikenSpinner, SubnameMintForm, Text, TextRecordCategory, Textarea, ThemeProvider, Tooltip, TxProgress, capitalize, convertEVMChainIdToCoinType, convertToMulticallResolverData, convertToResolverData, createEnsReferer, debounce, deepCopy, diffToEnsRecords, ensureFloatInput, equalsIgnoreCase, formatFloat, getAvatarUploadErrorMessage, getBlockExplorer, getBlockExplorerAddressUrl, getBlockExplorerName, getBlockExplorerTransactionUrl, getChainIdForListingNetwork, getEnsAppUrl, getEnsRecordsDiff, getImageUploadErrorMessage, getSupportedAddressByChainId, getSupportedAddressByCoin, getSupportedAddressByName, getSupportedAddressMap, getSupportedChashByProtocol, getSupportedText, isCommitmentToNewErr, isContenthashValid, isUserDeniedError, supportedAddresses, supportedContenthashRecords, supportedTexts, useAvatarClient, useENSResolver, useMintManager, useMintSubname, useOffchainManager, useRegisterENS, useTheme, useWaitTransaction, validateEnsRecords, wait };
1370
+ export type { AccordionProps, AlertPosition, AlertProps, AlertVariant, ButtonProps, ButtonSize, ButtonVariant, ChainName$2 as ChainName, ConnectAndSetChainProps, ContractErrorLabelProps, DropdownProps, EnsAddressRecord$1 as EnsAddressRecord, EnsContenthashRecord, EnsRecords$1 as EnsRecords, EnsRecordsDiff, EnsTextRecord$1 as EnsTextRecord, EstimatedFees, IconName, IconProps, InputProps, InputSize, InputType, ModalPresentation, ModalProps, ModalResponsivePresentation, ModalSize, NameListing, PricingDisplayProps, ProfileHeaderProps, RecordValidationError, RegistrationRequest, ShurikenSpinnerProps, SupportedContenthashRecord, SupportedEnsAddress, SupportedText, SupportedTextRecord, TextCategory, TextColor, TextProps, TextSize, TextWeight, TextareaProps, TextareaSize, ThemeContextValue, ThemeName, ThemeProviderProps, TooltipPosition, TooltipProps, UploadAvatarParams, UploadImageType };