@tuwaio/nova-core 1.0.0-fix-optimization-alpha.3.6c41281 → 1.0.0-fix-migrate-alpha.1.b325018
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/dist/index.cjs +3 -3
- package/dist/index.css +21 -0
- package/dist/index.d.cts +115 -1
- package/dist/index.d.ts +115 -1
- package/dist/index.js +3 -3
- package/package.json +5 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var framerMotion=require('framer-motion'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),l=require('react'),
|
|
1
|
+
'use strict';var framerMotion=require('framer-motion'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),metadata=require('@web3icons/common/metadata'),jsxRuntime=require('react/jsx-runtime'),l=require('react'),i=require('@radix-ui/react-dialog');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var l__namespace=/*#__PURE__*/_interopNamespace(l);var i__namespace=/*#__PURE__*/_interopNamespace(i);var lo="novacore:cursor-pointer novacore:rounded-md novacore:bg-[var(--tuwa-standart-button-bg)] novacore:px-3 novacore:py-2 novacore:flex novacore:items-center novacore:gap-1 novacore:text-sm novacore:font-semibold novacore:text-[var(--tuwa-text-primary)] novacore:transition-colors novacore:hover:bg-[var(--tuwa-standart-button-hover)] novacore:disabled:cursor-not-allowed novacore:disabled:opacity-50";function r(...o){return tailwindMerge.twMerge(clsx.clsx(o))}var f=o=>o&&typeof o=="object"&&!Array.isArray(o);function V(o,e){let t={...o};return f(o)&&f(e)&&Object.keys(e).forEach(n=>{let a=o[n],s=e[n];f(a)&&f(s)?t[n]=V(a,s):t[n]=s;}),t}function g(o){if(typeof o!="string")return false;let e=o.toLowerCase();return e.includes("solana")&&(e.includes("devnet")||e.includes("testnet"))}var k="Unknown";function bo(o){if(typeof o=="number")return metadata.networks.find(a=>a.chainId===o)?.name??k;let[e,t]=o.split(":"),n=metadata.networks.find(a=>a.id===e);if(!n)return k;if(t&&g(o)){let a=t.charAt(0).toUpperCase()+t.slice(1).toLowerCase();return `${n.name} ${a}`}return n.name}function D(o=1200){if(typeof window>"u")return false;let e="ontouchstart"in window,t=navigator.maxTouchPoints>0,n=false;window.matchMedia&&(n=window.matchMedia("(pointer: coarse)").matches);let a=e||t||n,s=window.innerWidth<=o;return a&&s}function No(o,e,t){if(!o)return "";if(o.length<=e+t)return o;let n=o.slice(0,e),a=o.slice(o.length-t);return `${n}...${a}`}function Io({className:o,strokeWidth:e,isOpen:t}){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:e??2,stroke:"currentColor",className:r("novacore:w-4 novacore:h-4 novacore:text-[var(--tuwa-text-secondary)]",o),children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{children:t&&jsxRuntime.jsx(framerMotion.motion.path,{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5",variants:{hidden:{translateY:3,scaleY:.8,opacity:0},visible:{translateY:0,scaleY:1,opacity:1}},initial:"hidden",animate:"visible",transition:{duration:.4}})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:!t&&jsxRuntime.jsx(framerMotion.motion.path,{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5",className:"novacore:relative",variants:{hidden:{translateY:-3,scaleY:.8,opacity:0},visible:{translateY:0,scaleY:1,opacity:1}},initial:"hidden",animate:"visible",transition:{duration:.4}})})]})}var z=l__namespace.forwardRef(({className:o,...e},t)=>jsxRuntime.jsxs("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r("novacore:h-5 novacore:w-5 novacore:text-[var(--tuwa-text-primary)] novacore:transition-colors",o),...e,children:[jsxRuntime.jsx("path",{d:"M18 6 6 18"}),jsxRuntime.jsx("path",{d:"m6 6 12 12"})]}));z.displayName="CloseIcon";var O="flex items-center justify-center novacore:w-full novacore:h-full novacore:rounded-full novacore:text-[var(--tuwa-text-secondary)] novacore:bg-[var(--tuwa-bg-muted)]",d=({animate:o=false,content:e="",className:t})=>jsxRuntime.jsx("div",{className:r(O,t,{"novacore:animate-pulse":o}),children:e});var Ko=i__namespace.Root,Uo=i__namespace.Trigger,H=i__namespace.Portal,_o=i__namespace.Close,Y={initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,transition:{duration:.2}}},$={initial:{opacity:0,y:"100%"},animate:{opacity:1,y:"0%"},exit:{opacity:0,y:"100%",transition:{duration:.2}}},G={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},S=({className:o,backdropAnimation:e})=>(l__namespace.useEffect(()=>(typeof window<"u"&&window.document.body.classList.add("NovaModalOpen"),()=>{typeof window<"u"&&window.document.body.classList.remove("NovaModalOpen");}),[]),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{variants:e??G,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"novacore:relative novacore:rounded-t-2xl novacore:sm:rounded-2xl novacore:overflow-hidden",children:jsxRuntime.jsx("div",{className:r("novacore:fixed novacore:inset-0 novacore:z-50 novacore:bg-black/55 novacore:backdrop-blur-sm novacore:backdrop-saturate-150",o)})})}));S.displayName=i__namespace.Overlay.displayName;var j=l__namespace.forwardRef(({className:o,children:e,modalAnimation:t,backdropAnimation:n,...a},s)=>{let[m,u]=l__namespace.useState(false);l__namespace.useEffect(()=>{u(D());},[]);let p=t??(m?$:Y);return jsxRuntime.jsxs(H,{children:[jsxRuntime.jsx(S,{backdropAnimation:n}),jsxRuntime.jsx(i__namespace.Content,{"aria-describedby":"tuwa:modal-content",ref:s,className:r("NovaNoScrolling novacore:fixed novacore:bottom-0 novacore:left-0 novacore:p-0 novacore:sm:bottom-auto novacore:sm:left-[50%] novacore:sm:top-[50%] novacore:sm:translate-x-[-50%] novacore:sm:translate-y-[-50%] novacore:z-50 novacore:sm:p-4 novacore:outline-none",o),...a,children:jsxRuntime.jsx(framerMotion.motion.div,{layout:true,className:"NovaNoScrolling novacore:relative novacore:overflow-hidden",transition:{layout:{duration:.2,ease:[.1,.1,.2,1]}},children:jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{variants:p,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"NovaNoScrolling novacore:relative novacore:rounded-t-2xl novacore:sm:rounded-2xl novacore:overflow-hidden",children:jsxRuntime.jsx("div",{className:r("NovaNoScrolling novacore:relative novacore:flex novacore:max-h-[98dvh] novacore:w-full novacore:flex-col novacore:gap-3 novacore:overflow-y-auto novacore:rounded-t-2xl novacore:sm:rounded-2xl novacore:shadow-2xl","novacore:border novacore:border-[var(--tuwa-border-primary)] novacore:bg-[var(--tuwa-bg-primary)]"),children:e})})})})})]})});j.displayName=i__namespace.Content.displayName;var K=({className:o,...e})=>jsxRuntime.jsx("div",{"aria-describedby":"tuwa:modal-header",className:r("novacore:sticky novacore:flex novacore:top-0 novacore:z-11 novacore:w-full novacore:flex-row novacore:items-center novacore:justify-between","novacore:border-b novacore:border-[var(--tuwa-border-primary)] novacore:bg-[var(--tuwa-bg-primary)] novacore:p-4",o),...e});K.displayName="DialogHeader";var U=({className:o,...e})=>jsxRuntime.jsx("div",{"aria-describedby":"tuwa:modal-footer",className:r("novacore:flex novacore:flex-col-reverse novacore:sm:flex-row novacore:sm:justify-end novacore:sm:space-x-2",o),...e});U.displayName="DialogFooter";var _=l__namespace.forwardRef(({className:o,...e},t)=>jsxRuntime.jsx(i__namespace.Title,{ref:t,"aria-describedby":"tuwa:modal-title",className:r("novacore:text-lg novacore:font-bold novacore:leading-none novacore:tracking-tight novacore:text-[var(--tuwa-text-primary)] novacore:m-0",o),...e}));_.displayName=i__namespace.Title.displayName;var Q=l__namespace.forwardRef(({className:o,...e},t)=>jsxRuntime.jsx(i__namespace.Description,{"aria-describedby":"tuwa:modal-description",ref:t,className:r("novacore:text-sm novacore:text-[var(--tuwa-text-secondary)]",o),...e}));Q.displayName=i__namespace.Description.displayName;var A=l.lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.NetworkIcon})));function ee({chainId:o,variant:e="background",className:t}){let n=typeof o=="string",a=n?o.split(":")[0].toLowerCase():o,s=n&&g(o),m=r("novacore:w-full novacore:h-full novacore:rounded-full",t,{"novacore:[&_path]:first-of-type:fill-[var(--tuwa-testnet-icons)]":s});return jsxRuntime.jsx(l.Suspense,{fallback:jsxRuntime.jsx(d,{animate:true,className:t}),children:typeof a=="string"?jsxRuntime.jsx(A,{id:a,variant:e,className:m,fallback:jsxRuntime.jsx(d,{content:"?",className:t})}):jsxRuntime.jsx(A,{chainId:a,variant:e,className:m,fallback:jsxRuntime.jsx(d,{content:"?",className:t})})})}function re({starsCount:o}){let[e,t]=l.useState(false);l.useEffect(()=>t(true),[]);let n=l.useMemo(()=>e?Array.from({length:o??200}).map(()=>({x:Math.random()*window.innerWidth,y:Math.random()*window.innerHeight,r:Math.random()*1+.5,isSupernova:Math.random()<.1,delay:Math.random()*10,duration:5+Math.random()*5})):[],[e]);return jsxRuntime.jsx("div",{className:"novacore:absolute novacore:inset-0 novacore:z-1 novacore:h-full novacore:w-full novacore:overflow-hidden",children:jsxRuntime.jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("style",{children:`
|
|
2
2
|
/* Pulse animation now includes scale for a more organic feel. */
|
|
3
3
|
@keyframes pulse {
|
|
4
4
|
0%, 100% {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
transform-origin: center;
|
|
45
45
|
stroke-width: 2;
|
|
46
46
|
}
|
|
47
|
-
`})}),n.map((a,
|
|
48
|
-
exports.ChevronArrowWithAnim=
|
|
47
|
+
`})}),n.map((a,s)=>jsxRuntime.jsx("circle",{cx:a.x,cy:a.y,r:a.r,fill:"rgba(var(--tuwa-bg-primary), 0.7)",className:a.isSupernova?"supernova":"pulsar",style:{animationDelay:`${a.delay}s`,animationDuration:`${a.duration}s`}},s))]})})}function le({closeToast:o}){return jsxRuntime.jsx("button",{type:"button",onClick:o,"aria-label":"Close toast notification",title:"Close toast notification",className:r("novacore:absolute novacore:top-2 novacore:right-2 novacore:cursor-pointer novacore:rounded-full novacore:p-1","novacore:text-[var(--tuwa-text-tertiary)] novacore:transition-colors","novacore:hover:bg-[var(--tuwa-bg-muted)] novacore:hover:text-[var(--tuwa-text-primary)]"),children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"novacore:h-5 novatx:w-5",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})}var ro=l.lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.WalletIcon})));function fe({walletName:o,variant:e="background",className:t}){let n=r("novacore:w-full novacore:h-full novacore:rounded-full",t);return jsxRuntime.jsx(l.Suspense,{fallback:jsxRuntime.jsx(d,{animate:true,className:t}),children:jsxRuntime.jsx(ro,{id:o,variant:e,className:n,fallback:jsxRuntime.jsx(d,{content:"?",className:t})})})}function be(o=2e3){let[e,t]=l.useState(false),[n,a]=l.useState(null),s=l.useCallback(async m=>{if(m)try{await navigator.clipboard.writeText(m),t(!0),a(null),setTimeout(()=>t(!1),o);}catch(u){let p=u instanceof Error?u:new Error("Failed to copy text.");console.error(p),a(p),setTimeout(()=>a(null),o);}},[o]);return {isCopied:e,copy:s,error:n}}function Ne(o){let e=a=>typeof window<"u"?window.matchMedia(a).matches:false,[t,n]=l.useState(e(o));return l.useEffect(()=>{let a=window.matchMedia(o),s=()=>n(a.matches);return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[o]),t}
|
|
48
|
+
exports.ChevronArrowWithAnim=Io;exports.CloseIcon=z;exports.Dialog=Ko;exports.DialogClose=_o;exports.DialogContent=j;exports.DialogDescription=Q;exports.DialogFooter=U;exports.DialogHeader=K;exports.DialogOverlay=S;exports.DialogPortal=H;exports.DialogTitle=_;exports.DialogTrigger=Uo;exports.FallbackIcon=d;exports.NetworkIcon=ee;exports.StarsBackground=re;exports.ToastCloseButton=le;exports.WalletIcon=fe;exports.cn=r;exports.deepMerge=V;exports.getChainName=bo;exports.isSolanaDev=g;exports.isTouchDevice=D;exports.standardButtonClasses=lo;exports.textCenterEllipsis=No;exports.useCopyToClipboard=be;exports.useMediaQuery=Ne;
|
package/dist/index.css
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
--novacore-tracking-tight: -0.025em;
|
|
15
15
|
--novacore-radius-md: 0.375rem;
|
|
16
16
|
--novacore-radius-2xl: 1rem;
|
|
17
|
+
--novacore-animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
17
18
|
--novacore-blur-sm: 8px;
|
|
18
19
|
--novacore-default-transition-duration: 150ms;
|
|
19
20
|
--novacore-default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
@@ -86,6 +87,9 @@
|
|
|
86
87
|
.novacore\:w-full {
|
|
87
88
|
width: 100%;
|
|
88
89
|
}
|
|
90
|
+
.novacore\:animate-pulse {
|
|
91
|
+
animation: var(--novacore-animate-pulse);
|
|
92
|
+
}
|
|
89
93
|
.novacore\:cursor-pointer {
|
|
90
94
|
cursor: pointer;
|
|
91
95
|
}
|
|
@@ -137,6 +141,9 @@
|
|
|
137
141
|
.novacore\:border-\[var\(--tuwa-border-primary\)\] {
|
|
138
142
|
border-color: var(--tuwa-border-primary);
|
|
139
143
|
}
|
|
144
|
+
.novacore\:bg-\[var\(--tuwa-bg-muted\)\] {
|
|
145
|
+
background-color: var(--tuwa-bg-muted);
|
|
146
|
+
}
|
|
140
147
|
.novacore\:bg-\[var\(--tuwa-bg-primary\)\] {
|
|
141
148
|
background-color: var(--tuwa-bg-primary);
|
|
142
149
|
}
|
|
@@ -305,6 +312,13 @@
|
|
|
305
312
|
padding: calc(var(--novacore-spacing) * 4);
|
|
306
313
|
}
|
|
307
314
|
}
|
|
315
|
+
.novacore\:\[\&_path\]\:first-of-type\:fill-\[var\(--tuwa-testnet-icons\)\] {
|
|
316
|
+
& path {
|
|
317
|
+
&:first-of-type {
|
|
318
|
+
fill: var(--tuwa-testnet-icons);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
308
322
|
}
|
|
309
323
|
:root {
|
|
310
324
|
--tuwa-success-bg: oklch(96.2% 0.044 156.743);
|
|
@@ -335,6 +349,7 @@
|
|
|
335
349
|
--tuwa-button-gradient-to-hover: oklch(49.6% 0.265 301.924);
|
|
336
350
|
--tuwa-standart-button-bg: oklch(96.7% 0.003 264.542);
|
|
337
351
|
--tuwa-standart-button-hover: oklch(92.8% 0.006 264.531);
|
|
352
|
+
--tuwa-testnet-icons: #C4BFB8;
|
|
338
353
|
}
|
|
339
354
|
.dark {
|
|
340
355
|
--tuwa-success-bg: oklch(39.3% 0.095 152.535);
|
|
@@ -365,6 +380,7 @@
|
|
|
365
380
|
--tuwa-button-gradient-to-hover: oklch(55.8% 0.288 302.321);
|
|
366
381
|
--tuwa-standart-button-bg: oklch(37.3% 0.034 259.733);
|
|
367
382
|
--tuwa-standart-button-hover: oklch(27.8% 0.033 256.848);
|
|
383
|
+
--tuwa-testnet-icons: #C4BFB8;
|
|
368
384
|
}
|
|
369
385
|
.Toastify {
|
|
370
386
|
pointer-events: auto;
|
|
@@ -552,6 +568,11 @@
|
|
|
552
568
|
inherits: false;
|
|
553
569
|
initial-value: 0;
|
|
554
570
|
}
|
|
571
|
+
@keyframes pulse {
|
|
572
|
+
50% {
|
|
573
|
+
opacity: 0.5;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
555
576
|
@layer properties {
|
|
556
577
|
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
557
578
|
*, ::before, ::after, ::backdrop {
|
package/dist/index.d.cts
CHANGED
|
@@ -15,6 +15,34 @@ declare function ChevronArrowWithAnim({ className, strokeWidth, isOpen, }: {
|
|
|
15
15
|
*/
|
|
16
16
|
declare const CloseIcon: React$1.ForwardRefExoticComponent<React$1.SVGAttributes<SVGSVGElement> & React$1.RefAttributes<SVGSVGElement>>;
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Props for the FallbackIcon component.
|
|
20
|
+
*/
|
|
21
|
+
interface FallbackIconProps {
|
|
22
|
+
/**
|
|
23
|
+
* Whether to show a pulse animation to indicate a loading state.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
animate?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Text content to display inside the fallback circle (e.g., "?", "!", or empty).
|
|
29
|
+
* @default ''
|
|
30
|
+
*/
|
|
31
|
+
content?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Additional CSS class names to apply to the container.
|
|
34
|
+
*/
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A reusable placeholder component used for Suspense fallbacks (loading)
|
|
39
|
+
* or Error fallbacks (when an icon is missing or fails to load).
|
|
40
|
+
*
|
|
41
|
+
* @param props - {@link FallbackIconProps}
|
|
42
|
+
* @returns The rendered fallback element.
|
|
43
|
+
*/
|
|
44
|
+
declare const FallbackIcon: ({ animate, content, className }: FallbackIconProps) => react_jsx_runtime.JSX.Element;
|
|
45
|
+
|
|
18
46
|
declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
|
|
19
47
|
declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
20
48
|
declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
@@ -41,6 +69,37 @@ declare const DialogFooter: {
|
|
|
41
69
|
declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
42
70
|
declare const DialogDescription: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
43
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Props for the NetworkIcon component.
|
|
74
|
+
*/
|
|
75
|
+
interface NetworkIconProps {
|
|
76
|
+
/**
|
|
77
|
+
* Chain identifier.
|
|
78
|
+
* - `number`: For EVM networks (e.g., 1, 137).
|
|
79
|
+
* - `string`: For non-EVM networks (e.g., "solana:mainnet", "solana:devnet").
|
|
80
|
+
*/
|
|
81
|
+
chainId: number | string;
|
|
82
|
+
/**
|
|
83
|
+
* Visual style variant for the icon.
|
|
84
|
+
* @default 'background'
|
|
85
|
+
*/
|
|
86
|
+
variant?: 'background' | 'branded' | 'mono';
|
|
87
|
+
/** Additional CSS class names. */
|
|
88
|
+
className?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Renders a network icon based on the chain ID.
|
|
92
|
+
*
|
|
93
|
+
* It handles logic for:
|
|
94
|
+
* 1. Lazy loading the heavy icon library.
|
|
95
|
+
* 2. Normalizing string IDs (e.g., converts "solana:devnet" -> "solana").
|
|
96
|
+
* 3. Applying specific styling for Testnets/Devnets (e.g., muted colors for Solana Devnet).
|
|
97
|
+
*
|
|
98
|
+
* @param props - {@link NetworkIconProps}
|
|
99
|
+
* @returns The network icon or a fallback UI.
|
|
100
|
+
*/
|
|
101
|
+
declare function NetworkIcon({ chainId, variant, className }: NetworkIconProps): react_jsx_runtime.JSX.Element;
|
|
102
|
+
|
|
44
103
|
declare function StarsBackground({ starsCount }: {
|
|
45
104
|
starsCount?: number;
|
|
46
105
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -64,6 +123,35 @@ type ToastCloseButtonProps = {
|
|
|
64
123
|
*/
|
|
65
124
|
declare function ToastCloseButton({ closeToast }: ToastCloseButtonProps): react_jsx_runtime.JSX.Element;
|
|
66
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Props for the WalletIcon component.
|
|
128
|
+
*/
|
|
129
|
+
interface WalletIconProps {
|
|
130
|
+
/**
|
|
131
|
+
* The unique identifier of the wallet.
|
|
132
|
+
* Examples: 'metamask', 'phantom', 'coinbase', 'walletconnect'.
|
|
133
|
+
*/
|
|
134
|
+
walletName: string;
|
|
135
|
+
/**
|
|
136
|
+
* Visual style variant for the icon.
|
|
137
|
+
* @default 'background'
|
|
138
|
+
*/
|
|
139
|
+
variant?: 'background' | 'branded' | 'mono';
|
|
140
|
+
/** Additional CSS class names to apply to the component. */
|
|
141
|
+
className?: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Renders a wallet icon based on the wallet ID.
|
|
145
|
+
*
|
|
146
|
+
* It handles logic for:
|
|
147
|
+
* 1. Lazy loading the heavy icon library.
|
|
148
|
+
* 2. Displaying a standardized fallback UI while loading or if the icon is missing.
|
|
149
|
+
*
|
|
150
|
+
* @param props - {@link WalletIconProps}
|
|
151
|
+
* @returns The wallet icon or a fallback UI.
|
|
152
|
+
*/
|
|
153
|
+
declare function WalletIcon({ walletName, variant, className }: WalletIconProps): react_jsx_runtime.JSX.Element;
|
|
154
|
+
|
|
67
155
|
/**
|
|
68
156
|
* @file This file contains a custom React hook for copying text to the clipboard.
|
|
69
157
|
*/
|
|
@@ -149,6 +237,32 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
149
237
|
*/
|
|
150
238
|
declare function deepMerge<T extends object>(target: T, source: Partial<T>): T;
|
|
151
239
|
|
|
240
|
+
/**
|
|
241
|
+
* Retrieves the human-readable name of a blockchain network based on its Chain ID.
|
|
242
|
+
*
|
|
243
|
+
* Supports both:
|
|
244
|
+
* - Numeric IDs (EVM): e.g., `1` -> "Ethereum"
|
|
245
|
+
* - String IDs (Non-EVM): e.g., `"solana:devnet"` -> "Solana Devnet"
|
|
246
|
+
*
|
|
247
|
+
* For formatted string IDs (like "solana:devnet"), it capitalizes the suffix
|
|
248
|
+
* if the network is identified as a development environment.
|
|
249
|
+
*
|
|
250
|
+
* @param chainId - The unique identifier of the chain (number for EVM, string for others).
|
|
251
|
+
* @returns The formatted network name or 'Unknown'.
|
|
252
|
+
*/
|
|
253
|
+
declare function getChainName(chainId: number | string): string;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Determines if the current chain is a Solana development or test network.
|
|
257
|
+
*
|
|
258
|
+
* It strictly checks if the ID is a string containing 'solana' AND
|
|
259
|
+
* indicates a non-production environment ('devnet' or 'testnet').
|
|
260
|
+
*
|
|
261
|
+
* @param chainId - The chain identifier (e.g., "solana:devnet", 1, "ethereum").
|
|
262
|
+
* @returns {boolean} True only if it is a Solana dev/test chain.
|
|
263
|
+
*/
|
|
264
|
+
declare function isSolanaDev(chainId: number | string): boolean;
|
|
265
|
+
|
|
152
266
|
/**
|
|
153
267
|
* @fileoverview Utility function to determine if the current environment supports touch input.
|
|
154
268
|
* This is safe to use in Next.js applications as it checks for the `window` object existence.
|
|
@@ -188,4 +302,4 @@ declare function isTouchDevice(maxWidth?: number): boolean;
|
|
|
188
302
|
*/
|
|
189
303
|
declare function textCenterEllipsis(str: string | undefined | null, from: number, to: number): string;
|
|
190
304
|
|
|
191
|
-
export { ChevronArrowWithAnim, CloseIcon, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, StarsBackground, ToastCloseButton, type ToastCloseButtonProps, cn, deepMerge, isTouchDevice, standardButtonClasses, textCenterEllipsis, useCopyToClipboard, useMediaQuery };
|
|
305
|
+
export { ChevronArrowWithAnim, CloseIcon, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, FallbackIcon, type FallbackIconProps, NetworkIcon, StarsBackground, ToastCloseButton, type ToastCloseButtonProps, WalletIcon, cn, deepMerge, getChainName, isSolanaDev, isTouchDevice, standardButtonClasses, textCenterEllipsis, useCopyToClipboard, useMediaQuery };
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,34 @@ declare function ChevronArrowWithAnim({ className, strokeWidth, isOpen, }: {
|
|
|
15
15
|
*/
|
|
16
16
|
declare const CloseIcon: React$1.ForwardRefExoticComponent<React$1.SVGAttributes<SVGSVGElement> & React$1.RefAttributes<SVGSVGElement>>;
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Props for the FallbackIcon component.
|
|
20
|
+
*/
|
|
21
|
+
interface FallbackIconProps {
|
|
22
|
+
/**
|
|
23
|
+
* Whether to show a pulse animation to indicate a loading state.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
animate?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Text content to display inside the fallback circle (e.g., "?", "!", or empty).
|
|
29
|
+
* @default ''
|
|
30
|
+
*/
|
|
31
|
+
content?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Additional CSS class names to apply to the container.
|
|
34
|
+
*/
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A reusable placeholder component used for Suspense fallbacks (loading)
|
|
39
|
+
* or Error fallbacks (when an icon is missing or fails to load).
|
|
40
|
+
*
|
|
41
|
+
* @param props - {@link FallbackIconProps}
|
|
42
|
+
* @returns The rendered fallback element.
|
|
43
|
+
*/
|
|
44
|
+
declare const FallbackIcon: ({ animate, content, className }: FallbackIconProps) => react_jsx_runtime.JSX.Element;
|
|
45
|
+
|
|
18
46
|
declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
|
|
19
47
|
declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
20
48
|
declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
@@ -41,6 +69,37 @@ declare const DialogFooter: {
|
|
|
41
69
|
declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
42
70
|
declare const DialogDescription: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
43
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Props for the NetworkIcon component.
|
|
74
|
+
*/
|
|
75
|
+
interface NetworkIconProps {
|
|
76
|
+
/**
|
|
77
|
+
* Chain identifier.
|
|
78
|
+
* - `number`: For EVM networks (e.g., 1, 137).
|
|
79
|
+
* - `string`: For non-EVM networks (e.g., "solana:mainnet", "solana:devnet").
|
|
80
|
+
*/
|
|
81
|
+
chainId: number | string;
|
|
82
|
+
/**
|
|
83
|
+
* Visual style variant for the icon.
|
|
84
|
+
* @default 'background'
|
|
85
|
+
*/
|
|
86
|
+
variant?: 'background' | 'branded' | 'mono';
|
|
87
|
+
/** Additional CSS class names. */
|
|
88
|
+
className?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Renders a network icon based on the chain ID.
|
|
92
|
+
*
|
|
93
|
+
* It handles logic for:
|
|
94
|
+
* 1. Lazy loading the heavy icon library.
|
|
95
|
+
* 2. Normalizing string IDs (e.g., converts "solana:devnet" -> "solana").
|
|
96
|
+
* 3. Applying specific styling for Testnets/Devnets (e.g., muted colors for Solana Devnet).
|
|
97
|
+
*
|
|
98
|
+
* @param props - {@link NetworkIconProps}
|
|
99
|
+
* @returns The network icon or a fallback UI.
|
|
100
|
+
*/
|
|
101
|
+
declare function NetworkIcon({ chainId, variant, className }: NetworkIconProps): react_jsx_runtime.JSX.Element;
|
|
102
|
+
|
|
44
103
|
declare function StarsBackground({ starsCount }: {
|
|
45
104
|
starsCount?: number;
|
|
46
105
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -64,6 +123,35 @@ type ToastCloseButtonProps = {
|
|
|
64
123
|
*/
|
|
65
124
|
declare function ToastCloseButton({ closeToast }: ToastCloseButtonProps): react_jsx_runtime.JSX.Element;
|
|
66
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Props for the WalletIcon component.
|
|
128
|
+
*/
|
|
129
|
+
interface WalletIconProps {
|
|
130
|
+
/**
|
|
131
|
+
* The unique identifier of the wallet.
|
|
132
|
+
* Examples: 'metamask', 'phantom', 'coinbase', 'walletconnect'.
|
|
133
|
+
*/
|
|
134
|
+
walletName: string;
|
|
135
|
+
/**
|
|
136
|
+
* Visual style variant for the icon.
|
|
137
|
+
* @default 'background'
|
|
138
|
+
*/
|
|
139
|
+
variant?: 'background' | 'branded' | 'mono';
|
|
140
|
+
/** Additional CSS class names to apply to the component. */
|
|
141
|
+
className?: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Renders a wallet icon based on the wallet ID.
|
|
145
|
+
*
|
|
146
|
+
* It handles logic for:
|
|
147
|
+
* 1. Lazy loading the heavy icon library.
|
|
148
|
+
* 2. Displaying a standardized fallback UI while loading or if the icon is missing.
|
|
149
|
+
*
|
|
150
|
+
* @param props - {@link WalletIconProps}
|
|
151
|
+
* @returns The wallet icon or a fallback UI.
|
|
152
|
+
*/
|
|
153
|
+
declare function WalletIcon({ walletName, variant, className }: WalletIconProps): react_jsx_runtime.JSX.Element;
|
|
154
|
+
|
|
67
155
|
/**
|
|
68
156
|
* @file This file contains a custom React hook for copying text to the clipboard.
|
|
69
157
|
*/
|
|
@@ -149,6 +237,32 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
149
237
|
*/
|
|
150
238
|
declare function deepMerge<T extends object>(target: T, source: Partial<T>): T;
|
|
151
239
|
|
|
240
|
+
/**
|
|
241
|
+
* Retrieves the human-readable name of a blockchain network based on its Chain ID.
|
|
242
|
+
*
|
|
243
|
+
* Supports both:
|
|
244
|
+
* - Numeric IDs (EVM): e.g., `1` -> "Ethereum"
|
|
245
|
+
* - String IDs (Non-EVM): e.g., `"solana:devnet"` -> "Solana Devnet"
|
|
246
|
+
*
|
|
247
|
+
* For formatted string IDs (like "solana:devnet"), it capitalizes the suffix
|
|
248
|
+
* if the network is identified as a development environment.
|
|
249
|
+
*
|
|
250
|
+
* @param chainId - The unique identifier of the chain (number for EVM, string for others).
|
|
251
|
+
* @returns The formatted network name or 'Unknown'.
|
|
252
|
+
*/
|
|
253
|
+
declare function getChainName(chainId: number | string): string;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Determines if the current chain is a Solana development or test network.
|
|
257
|
+
*
|
|
258
|
+
* It strictly checks if the ID is a string containing 'solana' AND
|
|
259
|
+
* indicates a non-production environment ('devnet' or 'testnet').
|
|
260
|
+
*
|
|
261
|
+
* @param chainId - The chain identifier (e.g., "solana:devnet", 1, "ethereum").
|
|
262
|
+
* @returns {boolean} True only if it is a Solana dev/test chain.
|
|
263
|
+
*/
|
|
264
|
+
declare function isSolanaDev(chainId: number | string): boolean;
|
|
265
|
+
|
|
152
266
|
/**
|
|
153
267
|
* @fileoverview Utility function to determine if the current environment supports touch input.
|
|
154
268
|
* This is safe to use in Next.js applications as it checks for the `window` object existence.
|
|
@@ -188,4 +302,4 @@ declare function isTouchDevice(maxWidth?: number): boolean;
|
|
|
188
302
|
*/
|
|
189
303
|
declare function textCenterEllipsis(str: string | undefined | null, from: number, to: number): string;
|
|
190
304
|
|
|
191
|
-
export { ChevronArrowWithAnim, CloseIcon, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, StarsBackground, ToastCloseButton, type ToastCloseButtonProps, cn, deepMerge, isTouchDevice, standardButtonClasses, textCenterEllipsis, useCopyToClipboard, useMediaQuery };
|
|
305
|
+
export { ChevronArrowWithAnim, CloseIcon, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, FallbackIcon, type FallbackIconProps, NetworkIcon, StarsBackground, ToastCloseButton, type ToastCloseButtonProps, WalletIcon, cn, deepMerge, getChainName, isSolanaDev, isTouchDevice, standardButtonClasses, textCenterEllipsis, useCopyToClipboard, useMediaQuery };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {motion,AnimatePresence}from'framer-motion';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx}from'react/jsx-runtime';import*as l from'react';import {useState,useEffect,useMemo,useCallback}from'react';import*as
|
|
1
|
+
import {motion,AnimatePresence}from'framer-motion';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {networks}from'@web3icons/common/metadata';import {jsxs,jsx}from'react/jsx-runtime';import*as l from'react';import {lazy,Suspense,useState,useEffect,useMemo,useCallback}from'react';import*as i from'@radix-ui/react-dialog';var lo="novacore:cursor-pointer novacore:rounded-md novacore:bg-[var(--tuwa-standart-button-bg)] novacore:px-3 novacore:py-2 novacore:flex novacore:items-center novacore:gap-1 novacore:text-sm novacore:font-semibold novacore:text-[var(--tuwa-text-primary)] novacore:transition-colors novacore:hover:bg-[var(--tuwa-standart-button-hover)] novacore:disabled:cursor-not-allowed novacore:disabled:opacity-50";function r(...o){return twMerge(clsx(o))}var f=o=>o&&typeof o=="object"&&!Array.isArray(o);function V(o,e){let t={...o};return f(o)&&f(e)&&Object.keys(e).forEach(n=>{let a=o[n],s=e[n];f(a)&&f(s)?t[n]=V(a,s):t[n]=s;}),t}function g(o){if(typeof o!="string")return false;let e=o.toLowerCase();return e.includes("solana")&&(e.includes("devnet")||e.includes("testnet"))}var k="Unknown";function bo(o){if(typeof o=="number")return networks.find(a=>a.chainId===o)?.name??k;let[e,t]=o.split(":"),n=networks.find(a=>a.id===e);if(!n)return k;if(t&&g(o)){let a=t.charAt(0).toUpperCase()+t.slice(1).toLowerCase();return `${n.name} ${a}`}return n.name}function D(o=1200){if(typeof window>"u")return false;let e="ontouchstart"in window,t=navigator.maxTouchPoints>0,n=false;window.matchMedia&&(n=window.matchMedia("(pointer: coarse)").matches);let a=e||t||n,s=window.innerWidth<=o;return a&&s}function No(o,e,t){if(!o)return "";if(o.length<=e+t)return o;let n=o.slice(0,e),a=o.slice(o.length-t);return `${n}...${a}`}function Io({className:o,strokeWidth:e,isOpen:t}){return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:e??2,stroke:"currentColor",className:r("novacore:w-4 novacore:h-4 novacore:text-[var(--tuwa-text-secondary)]",o),children:[jsx(AnimatePresence,{children:t&&jsx(motion.path,{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5",variants:{hidden:{translateY:3,scaleY:.8,opacity:0},visible:{translateY:0,scaleY:1,opacity:1}},initial:"hidden",animate:"visible",transition:{duration:.4}})}),jsx(AnimatePresence,{children:!t&&jsx(motion.path,{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5",className:"novacore:relative",variants:{hidden:{translateY:-3,scaleY:.8,opacity:0},visible:{translateY:0,scaleY:1,opacity:1}},initial:"hidden",animate:"visible",transition:{duration:.4}})})]})}var z=l.forwardRef(({className:o,...e},t)=>jsxs("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r("novacore:h-5 novacore:w-5 novacore:text-[var(--tuwa-text-primary)] novacore:transition-colors",o),...e,children:[jsx("path",{d:"M18 6 6 18"}),jsx("path",{d:"m6 6 12 12"})]}));z.displayName="CloseIcon";var O="flex items-center justify-center novacore:w-full novacore:h-full novacore:rounded-full novacore:text-[var(--tuwa-text-secondary)] novacore:bg-[var(--tuwa-bg-muted)]",d=({animate:o=false,content:e="",className:t})=>jsx("div",{className:r(O,t,{"novacore:animate-pulse":o}),children:e});var Ko=i.Root,Uo=i.Trigger,H=i.Portal,_o=i.Close,Y={initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,transition:{duration:.2}}},$={initial:{opacity:0,y:"100%"},animate:{opacity:1,y:"0%"},exit:{opacity:0,y:"100%",transition:{duration:.2}}},G={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},S=({className:o,backdropAnimation:e})=>(l.useEffect(()=>(typeof window<"u"&&window.document.body.classList.add("NovaModalOpen"),()=>{typeof window<"u"&&window.document.body.classList.remove("NovaModalOpen");}),[]),jsx(AnimatePresence,{children:jsx(motion.div,{variants:e??G,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"novacore:relative novacore:rounded-t-2xl novacore:sm:rounded-2xl novacore:overflow-hidden",children:jsx("div",{className:r("novacore:fixed novacore:inset-0 novacore:z-50 novacore:bg-black/55 novacore:backdrop-blur-sm novacore:backdrop-saturate-150",o)})})}));S.displayName=i.Overlay.displayName;var j=l.forwardRef(({className:o,children:e,modalAnimation:t,backdropAnimation:n,...a},s)=>{let[m,u]=l.useState(false);l.useEffect(()=>{u(D());},[]);let p=t??(m?$:Y);return jsxs(H,{children:[jsx(S,{backdropAnimation:n}),jsx(i.Content,{"aria-describedby":"tuwa:modal-content",ref:s,className:r("NovaNoScrolling novacore:fixed novacore:bottom-0 novacore:left-0 novacore:p-0 novacore:sm:bottom-auto novacore:sm:left-[50%] novacore:sm:top-[50%] novacore:sm:translate-x-[-50%] novacore:sm:translate-y-[-50%] novacore:z-50 novacore:sm:p-4 novacore:outline-none",o),...a,children:jsx(motion.div,{layout:true,className:"NovaNoScrolling novacore:relative novacore:overflow-hidden",transition:{layout:{duration:.2,ease:[.1,.1,.2,1]}},children:jsx(AnimatePresence,{children:jsx(motion.div,{variants:p,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"NovaNoScrolling novacore:relative novacore:rounded-t-2xl novacore:sm:rounded-2xl novacore:overflow-hidden",children:jsx("div",{className:r("NovaNoScrolling novacore:relative novacore:flex novacore:max-h-[98dvh] novacore:w-full novacore:flex-col novacore:gap-3 novacore:overflow-y-auto novacore:rounded-t-2xl novacore:sm:rounded-2xl novacore:shadow-2xl","novacore:border novacore:border-[var(--tuwa-border-primary)] novacore:bg-[var(--tuwa-bg-primary)]"),children:e})})})})})]})});j.displayName=i.Content.displayName;var K=({className:o,...e})=>jsx("div",{"aria-describedby":"tuwa:modal-header",className:r("novacore:sticky novacore:flex novacore:top-0 novacore:z-11 novacore:w-full novacore:flex-row novacore:items-center novacore:justify-between","novacore:border-b novacore:border-[var(--tuwa-border-primary)] novacore:bg-[var(--tuwa-bg-primary)] novacore:p-4",o),...e});K.displayName="DialogHeader";var U=({className:o,...e})=>jsx("div",{"aria-describedby":"tuwa:modal-footer",className:r("novacore:flex novacore:flex-col-reverse novacore:sm:flex-row novacore:sm:justify-end novacore:sm:space-x-2",o),...e});U.displayName="DialogFooter";var _=l.forwardRef(({className:o,...e},t)=>jsx(i.Title,{ref:t,"aria-describedby":"tuwa:modal-title",className:r("novacore:text-lg novacore:font-bold novacore:leading-none novacore:tracking-tight novacore:text-[var(--tuwa-text-primary)] novacore:m-0",o),...e}));_.displayName=i.Title.displayName;var Q=l.forwardRef(({className:o,...e},t)=>jsx(i.Description,{"aria-describedby":"tuwa:modal-description",ref:t,className:r("novacore:text-sm novacore:text-[var(--tuwa-text-secondary)]",o),...e}));Q.displayName=i.Description.displayName;var A=lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.NetworkIcon})));function ee({chainId:o,variant:e="background",className:t}){let n=typeof o=="string",a=n?o.split(":")[0].toLowerCase():o,s=n&&g(o),m=r("novacore:w-full novacore:h-full novacore:rounded-full",t,{"novacore:[&_path]:first-of-type:fill-[var(--tuwa-testnet-icons)]":s});return jsx(Suspense,{fallback:jsx(d,{animate:true,className:t}),children:typeof a=="string"?jsx(A,{id:a,variant:e,className:m,fallback:jsx(d,{content:"?",className:t})}):jsx(A,{chainId:a,variant:e,className:m,fallback:jsx(d,{content:"?",className:t})})})}function re({starsCount:o}){let[e,t]=useState(false);useEffect(()=>t(true),[]);let n=useMemo(()=>e?Array.from({length:o??200}).map(()=>({x:Math.random()*window.innerWidth,y:Math.random()*window.innerHeight,r:Math.random()*1+.5,isSupernova:Math.random()<.1,delay:Math.random()*10,duration:5+Math.random()*5})):[],[e]);return jsx("div",{className:"novacore:absolute novacore:inset-0 novacore:z-1 novacore:h-full novacore:w-full novacore:overflow-hidden",children:jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[jsx("defs",{children:jsx("style",{children:`
|
|
2
2
|
/* Pulse animation now includes scale for a more organic feel. */
|
|
3
3
|
@keyframes pulse {
|
|
4
4
|
0%, 100% {
|
|
@@ -44,5 +44,5 @@ import {motion,AnimatePresence}from'framer-motion';import {clsx}from'clsx';impor
|
|
|
44
44
|
transform-origin: center;
|
|
45
45
|
stroke-width: 2;
|
|
46
46
|
}
|
|
47
|
-
`})}),n.map((a,
|
|
48
|
-
export{
|
|
47
|
+
`})}),n.map((a,s)=>jsx("circle",{cx:a.x,cy:a.y,r:a.r,fill:"rgba(var(--tuwa-bg-primary), 0.7)",className:a.isSupernova?"supernova":"pulsar",style:{animationDelay:`${a.delay}s`,animationDuration:`${a.duration}s`}},s))]})})}function le({closeToast:o}){return jsx("button",{type:"button",onClick:o,"aria-label":"Close toast notification",title:"Close toast notification",className:r("novacore:absolute novacore:top-2 novacore:right-2 novacore:cursor-pointer novacore:rounded-full novacore:p-1","novacore:text-[var(--tuwa-text-tertiary)] novacore:transition-colors","novacore:hover:bg-[var(--tuwa-bg-muted)] novacore:hover:text-[var(--tuwa-text-primary)]"),children:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"novacore:h-5 novatx:w-5",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})}var ro=lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.WalletIcon})));function fe({walletName:o,variant:e="background",className:t}){let n=r("novacore:w-full novacore:h-full novacore:rounded-full",t);return jsx(Suspense,{fallback:jsx(d,{animate:true,className:t}),children:jsx(ro,{id:o,variant:e,className:n,fallback:jsx(d,{content:"?",className:t})})})}function be(o=2e3){let[e,t]=useState(false),[n,a]=useState(null),s=useCallback(async m=>{if(m)try{await navigator.clipboard.writeText(m),t(!0),a(null),setTimeout(()=>t(!1),o);}catch(u){let p=u instanceof Error?u:new Error("Failed to copy text.");console.error(p),a(p),setTimeout(()=>a(null),o);}},[o]);return {isCopied:e,copy:s,error:n}}function Ne(o){let e=a=>typeof window<"u"?window.matchMedia(a).matches:false,[t,n]=useState(e(o));return useEffect(()=>{let a=window.matchMedia(o),s=()=>n(a.matches);return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[o]),t}
|
|
48
|
+
export{Io as ChevronArrowWithAnim,z as CloseIcon,Ko as Dialog,_o as DialogClose,j as DialogContent,Q as DialogDescription,U as DialogFooter,K as DialogHeader,S as DialogOverlay,H as DialogPortal,_ as DialogTitle,Uo as DialogTrigger,d as FallbackIcon,ee as NetworkIcon,re as StarsBackground,le as ToastCloseButton,fe as WalletIcon,r as cn,V as deepMerge,bo as getChainName,g as isSolanaDev,D as isTouchDevice,lo as standardButtonClasses,No as textCenterEllipsis,be as useCopyToClipboard,Ne as useMediaQuery};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuwaio/nova-core",
|
|
3
|
-
"version": "1.0.0-fix-
|
|
3
|
+
"version": "1.0.0-fix-migrate-alpha.1.b325018",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Oleksandr Tkach",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
],
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@radix-ui/react-dialog": "1.x.x",
|
|
52
|
+
"@web3icons/react": ">=4",
|
|
53
|
+
"@web3icons/common": ">=0.11",
|
|
52
54
|
"clsx": "2.x.x",
|
|
53
55
|
"framer-motion": "12.x.x",
|
|
54
56
|
"react": ">=19.2.3",
|
|
@@ -59,6 +61,8 @@
|
|
|
59
61
|
"@tailwindcss/vite": "^4.1.18",
|
|
60
62
|
"@types/react": "^19.2.7",
|
|
61
63
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
64
|
+
"@web3icons/react": "^4.1.12",
|
|
65
|
+
"@web3icons/common": "^0.11.41",
|
|
62
66
|
"autoprefixer": "^10.4.23",
|
|
63
67
|
"clsx": "^2.1.1",
|
|
64
68
|
"framer-motion": "^12.24.8",
|