@tuwaio/nova-core 0.2.6 → 0.3.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.
- package/README.md +25 -39
- package/dist/index.cjs +3 -3
- package/dist/index.css +13 -100
- package/dist/index.d.cts +169 -34
- package/dist/index.d.ts +169 -34
- package/dist/index.js +3 -3
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -4,24 +4,18 @@
|
|
|
4
4
|
[](./LICENSE)
|
|
5
5
|
[](https://github.com/TuwaIO/nova-uikit/actions)
|
|
6
6
|
|
|
7
|
-
The foundational package for the
|
|
7
|
+
The foundational package for the **TUWA ecosystem**, Nova Core serves as the shared foundation that powers all other Nova packages (`@tuwaio/nova-connect`, `@tuwaio/nova-transactions`).
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
`@tuwaio/nova-core` is the **foundational engine** of the Nova UI Kit design system. It is **not** a component library—instead, it provides the low-level tools, design tokens, and utilities necessary to build consistent, high-quality user interfaces across all TUWA products.
|
|
14
|
-
|
|
15
|
-
Built for the **TUWA ecosystem**, Nova Core serves as the shared foundation that powers all other Nova packages (`@tuwaio/nova-connect`, `@tuwaio/nova-transactions`) and ensures design consistency across multi-chain Web3 applications.
|
|
16
|
-
|
|
17
|
-
**Why Nova Core?**
|
|
11
|
+
## Why Nova Core??
|
|
18
12
|
|
|
19
13
|
Building design systems requires consistent foundations: colors, spacing, typography, and utility functions. Without a shared core, different packages end up with conflicting styles, duplicated code, and inconsistent user experiences.
|
|
20
14
|
|
|
21
15
|
Nova Core solves this by:
|
|
22
16
|
|
|
23
17
|
1. **Offering Smart Utilities:** Battle-tested helper functions like the `cn` utility that combines `clsx` and `tailwind-merge` for conflict-free styling.
|
|
24
|
-
2. **Supplying Common Hooks:** A collection of reusable React hooks for common
|
|
18
|
+
2. **Supplying Common Hooks:** A collection of reusable React hooks for common UI patterns.
|
|
25
19
|
3. **Ensuring Tailwind CSS v4 Integration:** Seamless compatibility with modern Tailwind CSS workflows.
|
|
26
20
|
|
|
27
21
|
---
|
|
@@ -30,7 +24,6 @@ Nova Core solves this by:
|
|
|
30
24
|
|
|
31
25
|
- **🎨 Complete Design Token System:** Comprehensive CSS variables for colors, spacing, typography, shadows, and animations
|
|
32
26
|
- **🛠️ Smart Utility Functions:** Advanced `cn` utility that merges Tailwind classes intelligently, preventing style conflicts
|
|
33
|
-
- **🎣 Common React Hooks:** Collection of reusable hooks for Web3 UI patterns like wallet state, transaction status, and theme management
|
|
34
27
|
- **⚡ Tailwind CSS v4 Ready:** Full compatibility with modern Tailwind CSS workflows and arbitrary value usage
|
|
35
28
|
- **🌓 Dark Mode Support:** Built-in dark mode theming with CSS variable-based switching
|
|
36
29
|
- **♿ Accessibility First:** ARIA-compliant design tokens and utilities for building accessible interfaces
|
|
@@ -43,7 +36,7 @@ Nova Core solves this by:
|
|
|
43
36
|
### Requirements
|
|
44
37
|
|
|
45
38
|
- **React:** 19+
|
|
46
|
-
- **Node.js:** 20
|
|
39
|
+
- **Node.js:** 20-24
|
|
47
40
|
- **TypeScript:** 5.9+ (recommended)
|
|
48
41
|
|
|
49
42
|
### Package Installation
|
|
@@ -51,14 +44,8 @@ Nova Core solves this by:
|
|
|
51
44
|
Install the package using your preferred package manager:
|
|
52
45
|
|
|
53
46
|
```bash
|
|
54
|
-
# Using pnpm (recommended)
|
|
47
|
+
# Using pnpm (recommended), but you can use npm, yarn or bun as well
|
|
55
48
|
pnpm add @tuwaio/nova-core
|
|
56
|
-
|
|
57
|
-
# Using npm
|
|
58
|
-
npm install @tuwaio/nova-core
|
|
59
|
-
|
|
60
|
-
# Using yarn
|
|
61
|
-
yarn add @tuwaio/nova-core
|
|
62
49
|
```
|
|
63
50
|
|
|
64
51
|
### CSS Setup
|
|
@@ -80,15 +67,15 @@ Nova Core is designed to work seamlessly with Tailwind CSS v4. You can use the C
|
|
|
80
67
|
|
|
81
68
|
```tsx
|
|
82
69
|
// Using Nova design tokens in Tailwind classes
|
|
83
|
-
<button className="bg-[var(--tuwa-
|
|
70
|
+
<button className="bg-[var(--tuwa-text-accent)] text-[var(--tuwa-text-on-accent)]">
|
|
84
71
|
Connect Wallet
|
|
85
72
|
</button>
|
|
86
73
|
|
|
87
74
|
// With hover states and transitions
|
|
88
75
|
<div className="
|
|
89
|
-
p-
|
|
76
|
+
p-4
|
|
90
77
|
bg-[var(--tuwa-bg-secondary)]
|
|
91
|
-
hover:bg-[var(--tuwa-bg-
|
|
78
|
+
hover:bg-[var(--tuwa-bg-muted)]
|
|
92
79
|
transition-colors
|
|
93
80
|
">
|
|
94
81
|
Card Content
|
|
@@ -120,16 +107,16 @@ const mergedClasses = cn(
|
|
|
120
107
|
|
|
121
108
|
### Common React Hooks
|
|
122
109
|
|
|
123
|
-
Nova Core provides several utility hooks for common
|
|
110
|
+
Nova Core provides several utility hooks for common UI patterns:
|
|
124
111
|
|
|
125
112
|
```tsx
|
|
126
|
-
import { useCopyToClipboard } from '@tuwaio/nova-core';
|
|
113
|
+
import { cn, useCopyToClipboard } from '@tuwaio/nova-core';
|
|
127
114
|
|
|
128
115
|
function WalletAddress({ address }: { address: string }) {
|
|
129
116
|
const [copied, copy] = useCopyToClipboard();
|
|
130
117
|
|
|
131
118
|
return (
|
|
132
|
-
<div className={cn('transition-all',
|
|
119
|
+
<div className={cn('transition-all', { 'w-12': isCollapsed })}>
|
|
133
120
|
<button onClick={() => copy(address)} className="font-mono text-sm hover:bg-[var(--tuwa-bg-hover)]">
|
|
134
121
|
{address.slice(0, 6)}
|
|
135
122
|
{copied && ' ✓'}
|
|
@@ -153,19 +140,17 @@ Override design tokens in your CSS to match your brand:
|
|
|
153
140
|
|
|
154
141
|
/* Your custom theme overrides */
|
|
155
142
|
:root {
|
|
156
|
-
/*
|
|
157
|
-
--tuwa-
|
|
158
|
-
--tuwa-
|
|
143
|
+
/* Text Colors */
|
|
144
|
+
--tuwa-text-primary: #0f172a;
|
|
145
|
+
--tuwa-text-secondary: #64748b;
|
|
146
|
+
--tuwa-text-tertiary: #94a3b8;
|
|
147
|
+
--tuwa-text-accent: #3b82f6;
|
|
148
|
+
--tuwa-text-on-accent: #ffffff;
|
|
159
149
|
|
|
160
150
|
/* Background System */
|
|
161
151
|
--tuwa-bg-primary: #ffffff;
|
|
162
152
|
--tuwa-bg-secondary: #f8fafc;
|
|
163
|
-
--tuwa-bg-
|
|
164
|
-
|
|
165
|
-
/* Text Colors */
|
|
166
|
-
--tuwa-text-primary: #0f172a;
|
|
167
|
-
--tuwa-text-secondary: #64748b;
|
|
168
|
-
--tuwa-text-muted: #94a3b8;
|
|
153
|
+
--tuwa-bg-muted: #f1f5f9;
|
|
169
154
|
|
|
170
155
|
/* Border System */
|
|
171
156
|
--tuwa-border-primary: #e2e8f0;
|
|
@@ -180,12 +165,13 @@ Nova Core includes built-in dark mode support:
|
|
|
180
165
|
```css
|
|
181
166
|
/* Dark mode overrides */
|
|
182
167
|
.dark {
|
|
183
|
-
--tuwa-
|
|
184
|
-
--tuwa-
|
|
185
|
-
--tuwa-
|
|
186
|
-
--tuwa-
|
|
187
|
-
--tuwa-
|
|
188
|
-
--tuwa-
|
|
168
|
+
--tuwa-text-primary: #f1f5f9;
|
|
169
|
+
--tuwa-text-secondary: #9ca3af;
|
|
170
|
+
--tuwa-text-accent: #60a5fa;
|
|
171
|
+
--tuwa-bg-primary: #0f172a;
|
|
172
|
+
--tuwa-bg-secondary: #1e293b;
|
|
173
|
+
--tuwa-bg-muted: #334155;
|
|
174
|
+
--tuwa-border-primary: #374151;
|
|
189
175
|
}
|
|
190
176
|
```
|
|
191
177
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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'),s=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 s__namespace=/*#__PURE__*/_interopNamespace(s);var po="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 i(...o){return tailwindMerge.twMerge(clsx.clsx(o))}var g=o=>o&&typeof o=="object"&&!Array.isArray(o);function z(o,e){let t={...o};return g(o)&&g(e)&&Object.keys(e).forEach(n=>{let a=o[n],r=e[n];g(a)&&g(r)?t[n]=z(a,r):t[n]=r;}),t}function w(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 C(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&&w(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,r=window.innerWidth<=o;return a&&r}function Do(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 Vo({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:i("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 B=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:i("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"})]}));B.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:i(O,"Nova_Web3_Icon",t,{"novacore:animate-pulse":o}),children:e});var Uo=s__namespace.Root,Qo=s__namespace.Trigger,_=s__namespace.Portal,Jo=s__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}}},q={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},L=({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??q,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"novacore:relative novacore:overflow-hidden",children:jsxRuntime.jsx("div",{className:i("novacore:fixed novacore:inset-0 novacore:z-50 novacore:bg-black/55 novacore:backdrop-blur-sm novacore:backdrop-saturate-150",o)})})}));L.displayName=s__namespace.Overlay.displayName;var G=l__namespace.forwardRef(({className:o,children:e,modalAnimation:t,backdropAnimation:n,...a},r)=>{let[u,m]=l__namespace.useState(false);l__namespace.useEffect(()=>{m(D());},[]);let f=t??(u?$:Y);return jsxRuntime.jsxs(_,{children:[jsxRuntime.jsx(L,{backdropAnimation:n}),jsxRuntime.jsx(s__namespace.Content,{"aria-describedby":"tuwa:modal-content",ref:r,className:i("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:f,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"NovaNoScrolling novacore:relative novacore:overflow-hidden",children:jsxRuntime.jsx("div",{className:i("NovaNoScrolling NovaDialogContent__elements 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})})})})})]})});G.displayName=s__namespace.Content.displayName;var j=({className:o,...e})=>jsxRuntime.jsx("div",{"aria-describedby":"tuwa:modal-header",className:i("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});j.displayName="DialogHeader";var K=({className:o,...e})=>jsxRuntime.jsx("div",{"aria-describedby":"tuwa:modal-footer",className:i("novacore:flex novacore:flex-col-reverse novacore:sm:flex-row novacore:sm:justify-end novacore:sm:space-x-2",o),...e});K.displayName="DialogFooter";var U=l__namespace.forwardRef(({className:o,...e},t)=>jsxRuntime.jsx(s__namespace.Title,{ref:t,"aria-describedby":"tuwa:modal-title",className:i("novacore:text-lg novacore:font-bold novacore:leading-none novacore:tracking-tight novacore:text-[var(--tuwa-text-primary)] novacore:m-0",o),...e}));U.displayName=s__namespace.Title.displayName;var Q=l__namespace.forwardRef(({className:o,...e},t)=>jsxRuntime.jsx(s__namespace.Description,{"aria-describedby":"tuwa:modal-description",ref:t,className:i("novacore:text-sm novacore:text-[var(--tuwa-text-secondary)]",o),...e}));Q.displayName=s__namespace.Description.displayName;var A=l.lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.NetworkIcon})));function ne({chainId:o,variant:e="background",className:t}){let n=C(o),a=typeof o=="string",r=a?o.split(":")[0].toLowerCase():o,u=a&&w(o),m=i("novacore:w-full novacore:h-full novacore:rounded-full",t,{"novacore:[&_path]:first-of-type:fill-[var(--tuwa-testnet-icons)]":u||n.toLowerCase().includes("testnet")});return jsxRuntime.jsx(l.Suspense,{fallback:jsxRuntime.jsx(d,{animate:true,className:t}),children:typeof r=="string"?jsxRuntime.jsx(A,{id:r,variant:e,className:m,fallback:jsxRuntime.jsx(d,{content:"?",className:t})}):jsxRuntime.jsx(A,{chainId:r,variant:e,className:m,fallback:jsxRuntime.jsx(d,{content:"?",className:t})})})}function ce({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:`
|
|
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'),u=require('react'),c=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 u__namespace=/*#__PURE__*/_interopNamespace(u);var c__namespace=/*#__PURE__*/_interopNamespace(c);var Vo="novacore:cursor-pointer novacore:rounded-[var(--tuwa-rounded-corners)] 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 s(...o){return tailwindMerge.twMerge(clsx.clsx(o))}var y=o=>o&&typeof o=="object"&&!Array.isArray(o);function K(o,e){let t={...o};return y(o)&&y(e)&&Object.keys(e).forEach(a=>{let r=o[a],n=e[a];y(r)&&y(n)?t[a]=K(r,n):t[a]=n;}),t}function x(o){if(typeof o!="string")return false;let e=o.toLowerCase();return e.includes("solana")&&(e.includes("devnet")||e.includes("testnet"))}var T="Unknown";function Q(o){return o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}function E(o){let e={name:T,id:T.toLowerCase(),filePath:T.toLowerCase(),chainId:o};if(typeof o=="number"){let i=metadata.networks.find(l=>l.chainId===o);return i?{name:i.name,id:i.id,filePath:i.filePath.split(":")[1],chainId:o}:e}let[t,a]=o.split(":"),r=metadata.networks.find(i=>i.id===t);return r?{name:a&&x(o)?`${r.name} ${Q(a)}`:r.name,id:r.id,filePath:r.filePath.split(":")[1],chainId:o}:e}function A(o=1200){if(typeof window>"u")return false;let e="ontouchstart"in window,t=navigator.maxTouchPoints>0,a=false;window.matchMedia&&(a=window.matchMedia("(pointer: coarse)").matches);let r=e||t||a,n=window.innerWidth<=o;return r&&n}function X(o){if(!o.startsWith("var("))return o;let e=o.match(/var\(\s*(--[\w-]+)/);if(!e)return o;let t=e[1];return getComputedStyle(document.documentElement).getPropertyValue(t).trim()||o}function j(o,e){let t=X(e),r=new DOMParser().parseFromString(o,"image/svg+xml");if(r.querySelector("parsererror"))return console.warn("SVG parse error, returning original"),o;let i=r.querySelector("path");return i&&i.setAttribute("fill",t),new XMLSerializer().serializeToString(r.documentElement)}function N(o,e){let t=o;return e&&(t=j(t,e)),`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(t)))}`}var S=o=>`${o.replace(/\s+/g,"-").toLowerCase()}.svg`;function Ko(o,e,t){if(!o)return "";if(o.length<=e+t)return o;let a=o.slice(0,e),r=o.slice(o.length-t);return `${a}...${r}`}function se({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:s("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=u__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:s("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 eo="novacore:flex novacore:items-center novacore:justify-center novacore:w-full novacore:h-full novacore:rounded-full novacore:text-[var(--tuwa-text-secondary)] novacore:bg-[var(--tuwa-bg-muted)]",v=({animate:o=false,content:e="",className:t})=>jsxRuntime.jsx("div",{className:s(eo,"Nova_Web3_Icon",t,{"novacore:animate-pulse":o}),children:e});function k({src:o,alt:e,...t}){return jsxRuntime.jsx("img",{...t,src:o,alt:e??"",draggable:false,onDragStart:a=>a.preventDefault(),style:{outline:"none",pointerEvents:"none"}})}var no="https://raw.githubusercontent.com/0xa3k5/web3icons/refs/heads/main/raw-svgs";function b({githubSrc:o,className:e,alt:t,firstPathFill:a,...r}){let[n,i]=u.useState(null),[l,m]=u.useState("idle");return u.useEffect(()=>{let f=true;return (async()=>{m("loading");try{let w=await fetch(`${no}/${o}`);if(!w.ok)throw new Error(`Failed to load icon: ${w.status}`);let Y=await w.text();f&&(i(N(Y,a)),m("success"));}catch{f&&m("error");}})(),()=>{f=false;}},[o,a]),l==="loading"||l==="idle"?jsxRuntime.jsx(v,{animate:true,className:e}):l==="success"&&n?jsxRuntime.jsx(k,{...r,src:n,alt:t,className:e}):jsxRuntime.jsx(v,{content:"?",className:e})}var Te=c__namespace.Root,De=c__namespace.Trigger,io=c__namespace.Portal,Re=c__namespace.Close,so={initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,transition:{duration:.2}}},co={initial:{opacity:0,y:"100%"},animate:{opacity:1,y:"0%"},exit:{opacity:0,y:"100%",transition:{duration:.2}}},lo={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},B=({className:o,backdropAnimation:e})=>(u__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??lo,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"novacore:relative novacore:overflow-hidden",children:jsxRuntime.jsx("div",{className:s("novacore:fixed novacore:inset-0 novacore:z-50 novacore:bg-black/55 novacore:backdrop-blur-sm novacore:backdrop-saturate-150",o)})})}));B.displayName=c__namespace.Overlay.displayName;var mo=u__namespace.forwardRef(({className:o,children:e,modalAnimation:t,backdropAnimation:a,...r},n)=>{let[i,l]=u__namespace.useState(false);u__namespace.useEffect(()=>{l(A());},[]);let m=t??(i?co:so);return jsxRuntime.jsxs(io,{children:[jsxRuntime.jsx(B,{backdropAnimation:a}),jsxRuntime.jsx(c__namespace.Content,{"aria-describedby":"tuwa:modal-content",ref:n,className:s("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),...r,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:m,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"NovaNoScrolling novacore:relative novacore:overflow-hidden",children:jsxRuntime.jsx("div",{className:s("NovaNoScrolling NovaDialogContent__elements novacore:relative novacore:flex novacore:max-h-[98dvh] novacore:w-full novacore:flex-col novacore:gap-3 novacore:overflow-y-auto novacore:rounded-t-[var(--tuwa-rounded-corners)] novacore:sm:rounded-[var(--tuwa-rounded-corners)]","novacore:border novacore:border-[var(--tuwa-border-primary)] novacore:bg-[var(--tuwa-bg-primary)]"),children:e})})})})})]})});mo.displayName=c__namespace.Content.displayName;var uo=({className:o,...e})=>jsxRuntime.jsx("div",{"aria-describedby":"tuwa:modal-header",className:s("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});uo.displayName="DialogHeader";var po=({className:o,...e})=>jsxRuntime.jsx("div",{"aria-describedby":"tuwa:modal-footer",className:s("novacore:flex novacore:flex-col-reverse novacore:sm:flex-row novacore:sm:justify-end novacore:sm:space-x-2",o),...e});po.displayName="DialogFooter";var fo=u__namespace.forwardRef(({className:o,...e},t)=>jsxRuntime.jsx(c__namespace.Title,{ref:t,"aria-describedby":"tuwa:modal-title",className:s("novacore:text-lg novacore:font-bold novacore:leading-none novacore:tracking-tight novacore:text-[var(--tuwa-text-primary)] novacore:m-0",o),...e}));fo.displayName=c__namespace.Title.displayName;var vo=u__namespace.forwardRef(({className:o,...e},t)=>jsxRuntime.jsx(c__namespace.Description,{"aria-describedby":"tuwa:modal-description",ref:t,className:s("novacore:text-sm novacore:text-[var(--tuwa-text-secondary)]",o),...e}));vo.displayName=c__namespace.Description.displayName;function h({children:o,iconId:e,alt:t,firstPathFill:a,...r}){let[n,i]=u.useState(null),l=u.useCallback(m=>{if(m){let f=N(m.outerHTML,a);i({id:e,src:f});}},[e,a]);return n&&n.id===e?jsxRuntime.jsx(k,{...r,src:n.src,alt:t}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:o(l)})}var H=u.lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.NetworkIcon}))),No="var(--tuwa-testnet-icons)";function Ye({chainId:o,variant:e="background",className:t}){let a=E(o),r=typeof o=="string",n=r?o.split(":")[0].toLowerCase():o,l=r&&x(o)||a.name.toLowerCase().includes("testnet")?No:void 0,m=s("novacore:w-full novacore:h-full novacore:rounded-full",t),f=typeof n=="string"?n:a.filePath,I=`networks/${e}/${S(f)}`;return jsxRuntime.jsx(u.Suspense,{fallback:jsxRuntime.jsx(v,{animate:true,className:t}),children:jsxRuntime.jsx(h,{iconId:`${o}-${e}`,className:m,firstPathFill:l,children:w=>typeof n=="string"?jsxRuntime.jsx(H,{ref:w,id:n,variant:e,fallback:jsxRuntime.jsx(b,{githubSrc:I,className:m,firstPathFill:l})}):jsxRuntime.jsx(H,{ref:w,chainId:n,variant:e,fallback:jsxRuntime.jsx(b,{githubSrc:I,className:m,firstPathFill:l})})})})}function Qe({starsCount:o}){let[e,t]=u.useState(false);u.useEffect(()=>t(true),[]);let a=u.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
|
-
`})}),
|
|
48
|
-
exports.ChevronArrowWithAnim=
|
|
47
|
+
`})}),a.map((r,n)=>jsxRuntime.jsx("circle",{cx:r.x,cy:r.y,r:r.r,fill:"rgba(var(--tuwa-bg-primary), 0.7)",className:r.isSupernova?"supernova":"pulsar",style:{animationDelay:`${r.delay}s`,animationDuration:`${r.duration}s`}},n))]})})}function Ze({closeToast:o,ariaLabel:e="Close toast notification",title:t="Close toast notification",className:a,iconClassName:r}){return jsxRuntime.jsx("button",{type:"button",onClick:o,"aria-label":e,title:t,className:s("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)]",a),children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:s("novacore:h-5 novacore:w-5",r),children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})}var Do=u.lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.WalletIcon}))),Ro={walletconnect:"wallet-connect"},Mo=({className:o,ref:e})=>jsxRuntime.jsxs("svg",{ref:e,className:o,fill:"none",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16 0c8.84 0 16 7.16 16 16s-7.16 16-16 16S0 24.84 0 16 7.16 0 16 0",clipRule:"evenodd"}),jsxRuntime.jsx("path",{fill:"#000",fillRule:"evenodd",d:"M16.54 2.01h1.53c.5.09.99.23 1.48.42.21.25.19.48-.05.69q-.195.045-.39 0c-1.86-.65-3.55-.35-5.07.89 2.39.7 3.84 2.27 4.36 4.7.12.85.08 1.68-.12 2.51.87 0 1.74 0 2.61-.02.39-.4.7-.85.94-1.35-.45-.45-.65-.99-.59-1.63-1.15.08-1.79-.44-1.92-1.58.14-1.12.78-1.67 1.92-1.63a.7.7 0 0 0-.12-.49l-.89-.89c-.02-.45.19-.6.62-.47.24.19.46.39.66.62.71-.79 1.5-.89 2.39-.32.44.42.62.94.54 1.55 1.49.02 2.11.76 1.85 2.22-.08.17-.17.34-.27.49.53.59.87 1.28 1.01 2.07.08 4.6.1 9.19.05 13.79-.19 1.58-1 2.71-2.44 3.37-.29.1-.59.2-.89.27H7.2c-1.31-.33-2.05-1.17-2.24-2.51-.03-5.24-.03-10.47 0-15.71.3-1.62 1.28-2.46 2.93-2.54 1.26-1.77 2.98-2.64 5.17-2.61.96-1.01 2.13-1.62 3.5-1.85zm6.11 1.87c.39-.03.7.12.91.44.06.39.09.79.1 1.18.02.12.07.21.17.27.41 0 .82.04 1.23.1.49.26.63.65.42 1.16-.07.14-.18.25-.32.32-.39.06-.79.09-1.18.1-.12.02-.21.07-.27.17l-.15 1.33c-.32.46-.72.55-1.21.27a.76.76 0 0 1-.27-.37c-.06-.41-.09-.82-.1-1.23a.35.35 0 0 0-.27-.17l-1.08-.05c-.46-.24-.62-.61-.47-1.11.14-.27.36-.43.66-.47l.99-.05s.09-.04.12-.07l.15-1.28q.18-.39.57-.54m-10.49.79c2.41-.09 4.12.94 5.15 3.1.44 1.12.48 2.25.12 3.4-.84.06-1.67.07-2.51.02.56-.68.52-1.32-.1-1.92-.26-.13-.54-.19-.84-.17.02-.95 0-1.91-.07-2.86-.21-.41-.55-.58-1.01-.52-.17.03-.31.09-.44.2-.72.92-1.43 1.85-2.14 2.78-.28.45-.29.91-.05 1.38q.225.3.57.42c.34.02.69.03 1.03.02v.69c-1.3.02-2.59 0-3.89-.05-.58-2.1-.08-3.88 1.53-5.34.79-.62 1.68-1 2.66-1.16zm.83 1.82c.07 0 .13.03.17.1l.05 3.05c.04.09.1.16.17.22l.89.05c.22.08.3.24.22.47q-.27.42-.57.81c-.43.02-.85.03-1.28.02 0-.41 0-.82-.02-1.23a.46.46 0 0 0-.17-.17l-1.28-.05c-.3-.1-.37-.29-.22-.57.7-.89 1.39-1.79 2.04-2.71zm-5.81.84h.2a6.1 6.1 0 0 0-.25 3.77c-.59-.13-1.01-.49-1.26-1.06-.36-1.29.08-2.19 1.31-2.71m17.98.83c.05 0 .1 0 .15.02q.825.855.96 2.04.045 1.305 0 2.61a3.76 3.76 0 0 0-2.54-1.55c-.61-.05-1.21-.08-1.82-.1.26-.31.48-.66.64-1.03 1.31.02 1.94-.62 1.87-1.95.26.02.5 0 .74-.05zM5.7 11.22c.41.4.91.65 1.48.76l16.06.05c1.42.13 2.38.87 2.88 2.19.07.24.12.49.15.74.03 2.86.03 5.71 0 8.57-.21 1.44-1 2.38-2.39 2.83-.24.05-.49.08-.74.1-1.26.02-2.53.03-3.79.02 0-1.33 0-2.66.02-3.99l1.55-1.55c1.42-.04 2.09-.78 1.99-2.19-.24-.88-.81-1.34-1.72-1.38-1.2.12-1.81.8-1.82 2.02l-1.92 1.92c-.08.11-.14.22-.2.34-.07 1.61-.1 3.22-.07 4.83h-.44c0-2.28 0-4.56-.02-6.85a1.8 1.8 0 0 0-.15-.34l-1.13-1.13c0-1.23-.61-1.92-1.82-2.07-1.29.17-1.87.91-1.72 2.22q.465 1.395 1.95 1.35l.71.71c0 .3.04.6.1.89.25.21.48.19.69-.05.03-.39.03-.79 0-1.18-.2-.25-.43-.49-.66-.71.15-.1.29-.22.39-.37.3.27.58.55.86.84.02 2.23.03 4.47.02 6.7h-.59c0-1.38 0-2.76-.02-4.14-.15-.25-.35-.31-.62-.17a1 1 0 0 0-.12.22c-.02 1.36-.03 2.73-.02 4.09h-.44c0-.99 0-1.97-.02-2.96-.02-.09-.06-.17-.1-.25-.67-.72-1.36-1.43-2.07-2.12-.06-1.48-.82-2.13-2.29-1.95-1.02.41-1.42 1.16-1.21 2.24q.51 1.32 1.95 1.26l1.55 1.55c.02.74.03 1.48.02 2.22-1.56.02-3.12 0-4.68-.07-.9-.24-1.42-.83-1.55-1.75-.02-4.48-.03-8.96-.02-13.45zm7.79 5.66c.84.06 1.19.5 1.06 1.33-.32.62-.8.79-1.45.52-.46-.37-.56-.82-.32-1.35.18-.26.42-.42.71-.49zm7.43 1.28c.89-.03 1.29.4 1.21 1.28-.33.67-.83.85-1.5.52-.54-.49-.58-1-.1-1.55.12-.11.25-.19.39-.25M9.94 19.94c.84 0 1.22.4 1.16 1.23-.28.68-.76.89-1.45.62-.63-.54-.65-1.09-.05-1.67l.34-.17zm9.75.24c.16.13.3.27.44.42-.53.52-1.05 1.05-1.55 1.6-.02 1.43-.03 2.86-.02 4.28h-.59c0-1.51 0-3.02.02-4.53a71 71 0 0 1 1.7-1.77M11.56 22c.62.53 1.21 1.11 1.75 1.72.02.92.03 1.84.02 2.76h-.59c0-.85 0-1.71-.02-2.56l-1.48-1.48s-.03-.07 0-.1c.12-.11.22-.22.32-.34",clipRule:"evenodd"})]});function st({walletName:o,variant:e="background",className:t}){let a=s("novacore:w-full novacore:h-full novacore:rounded-full",t),r=o.toLowerCase();if(r==="impersonatedwallet")return jsxRuntime.jsx(h,{iconId:"impersonatedwallet",className:a,children:i=>jsxRuntime.jsx(Mo,{ref:i})});let n=Ro[r]??r;return jsxRuntime.jsx(u.Suspense,{fallback:jsxRuntime.jsx(v,{animate:true,className:t}),children:jsxRuntime.jsx(h,{iconId:`${n}-${e}`,className:a,children:i=>jsxRuntime.jsx(Do,{ref:i,id:n,variant:e,fallback:jsxRuntime.jsx(b,{githubSrc:`wallets/${e}/${S(n)}`,className:a})})})})}function dt(o=2e3){let[e,t]=u.useState(false),[a,r]=u.useState(null),n=u.useCallback(async i=>{if(i)try{await navigator.clipboard.writeText(i),t(!0),r(null),setTimeout(()=>t(!1),o);}catch(l){let m=l instanceof Error?l:new Error("Failed to copy text.");console.error(m),r(m),setTimeout(()=>r(null),o);}},[o]);return {isCopied:e,copy:n,error:a}}function ft(o){let e=r=>typeof window<"u"?window.matchMedia(r).matches:false,[t,a]=u.useState(e(o));return u.useEffect(()=>{let r=window.matchMedia(o),n=()=>a(r.matches);return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[o]),t}
|
|
48
|
+
exports.ChevronArrowWithAnim=se;exports.CloseIcon=Z;exports.Dialog=Te;exports.DialogClose=Re;exports.DialogContent=mo;exports.DialogDescription=vo;exports.DialogFooter=po;exports.DialogHeader=uo;exports.DialogOverlay=B;exports.DialogPortal=io;exports.DialogTitle=fo;exports.DialogTrigger=De;exports.FallbackIcon=v;exports.GithubFallbackIcon=b;exports.NetworkIcon=Ye;exports.StarsBackground=Qe;exports.SvgImg=k;exports.SvgToImg=h;exports.ToastCloseButton=Ze;exports.WalletIcon=st;exports.applyFirstPathFill=j;exports.cn=s;exports.deepMerge=K;exports.formatIconNameForGithub=S;exports.getChainName=E;exports.isSolanaDev=x;exports.isTouchDevice=A;exports.resolveCssVariable=X;exports.standardButtonClasses=Vo;exports.svgToBase64=N;exports.textCenterEllipsis=Ko;exports.useCopyToClipboard=dt;exports.useMediaQuery=ft;
|
package/dist/index.css
CHANGED
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
--novacore-font-weight-semibold: 600;
|
|
13
13
|
--novacore-font-weight-bold: 700;
|
|
14
14
|
--novacore-tracking-tight: -0.025em;
|
|
15
|
-
--novacore-radius-md: 0.375rem;
|
|
16
|
-
--novacore-radius-2xl: 1rem;
|
|
17
15
|
--novacore-animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
18
16
|
--novacore-blur-sm: 8px;
|
|
19
17
|
--novacore-default-transition-duration: 150ms;
|
|
@@ -108,6 +106,9 @@
|
|
|
108
106
|
.novacore\:justify-between {
|
|
109
107
|
justify-content: space-between;
|
|
110
108
|
}
|
|
109
|
+
.novacore\:justify-center {
|
|
110
|
+
justify-content: center;
|
|
111
|
+
}
|
|
111
112
|
.novacore\:gap-1 {
|
|
112
113
|
gap: calc(var(--novacore-spacing) * 1);
|
|
113
114
|
}
|
|
@@ -120,15 +121,15 @@
|
|
|
120
121
|
.novacore\:overflow-y-auto {
|
|
121
122
|
overflow-y: auto;
|
|
122
123
|
}
|
|
124
|
+
.novacore\:rounded-\[var\(--tuwa-rounded-corners\)\] {
|
|
125
|
+
border-radius: var(--tuwa-rounded-corners);
|
|
126
|
+
}
|
|
123
127
|
.novacore\:rounded-full {
|
|
124
128
|
border-radius: calc(infinity * 1px);
|
|
125
129
|
}
|
|
126
|
-
.novacore\:rounded-
|
|
127
|
-
border-radius: var(--
|
|
128
|
-
|
|
129
|
-
.novacore\:rounded-t-2xl {
|
|
130
|
-
border-top-left-radius: var(--novacore-radius-2xl);
|
|
131
|
-
border-top-right-radius: var(--novacore-radius-2xl);
|
|
130
|
+
.novacore\:rounded-t-\[var\(--tuwa-rounded-corners\)\] {
|
|
131
|
+
border-top-left-radius: var(--tuwa-rounded-corners);
|
|
132
|
+
border-top-right-radius: var(--tuwa-rounded-corners);
|
|
132
133
|
}
|
|
133
134
|
.novacore\:border {
|
|
134
135
|
border-style: var(--tw-border-style);
|
|
@@ -204,10 +205,6 @@
|
|
|
204
205
|
.novacore\:text-\[var\(--tuwa-text-tertiary\)\] {
|
|
205
206
|
color: var(--tuwa-text-tertiary);
|
|
206
207
|
}
|
|
207
|
-
.novacore\:shadow-2xl {
|
|
208
|
-
--tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, rgb(0 0 0 / 0.25));
|
|
209
|
-
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
210
|
-
}
|
|
211
208
|
.novacore\:backdrop-blur-sm {
|
|
212
209
|
--tw-backdrop-blur: blur(var(--novacore-blur-sm));
|
|
213
210
|
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
@@ -302,9 +299,9 @@
|
|
|
302
299
|
}
|
|
303
300
|
}
|
|
304
301
|
}
|
|
305
|
-
.novacore\:sm\:rounded-
|
|
302
|
+
.novacore\:sm\:rounded-\[var\(--tuwa-rounded-corners\)\] {
|
|
306
303
|
@media (width >= 40rem) {
|
|
307
|
-
border-radius: var(--
|
|
304
|
+
border-radius: var(--tuwa-rounded-corners);
|
|
308
305
|
}
|
|
309
306
|
}
|
|
310
307
|
.novacore\:sm\:p-4 {
|
|
@@ -312,13 +309,6 @@
|
|
|
312
309
|
padding: calc(var(--novacore-spacing) * 4);
|
|
313
310
|
}
|
|
314
311
|
}
|
|
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
|
-
}
|
|
322
312
|
}
|
|
323
313
|
:root {
|
|
324
314
|
--tuwa-success-bg: oklch(96.2% 0.044 156.743);
|
|
@@ -350,6 +340,8 @@
|
|
|
350
340
|
--tuwa-standart-button-bg: oklch(96.7% 0.003 264.542);
|
|
351
341
|
--tuwa-standart-button-hover: oklch(92.8% 0.006 264.531);
|
|
352
342
|
--tuwa-testnet-icons: #c4bfb8;
|
|
343
|
+
--tuwa-rounded-corners: 4px;
|
|
344
|
+
--tuwa-ring-width: 2px;
|
|
353
345
|
}
|
|
354
346
|
.dark {
|
|
355
347
|
--tuwa-success-bg: oklch(39.3% 0.095 152.535);
|
|
@@ -448,71 +440,6 @@
|
|
|
448
440
|
syntax: "*";
|
|
449
441
|
inherits: false;
|
|
450
442
|
}
|
|
451
|
-
@property --tw-shadow {
|
|
452
|
-
syntax: "*";
|
|
453
|
-
inherits: false;
|
|
454
|
-
initial-value: 0 0 #0000;
|
|
455
|
-
}
|
|
456
|
-
@property --tw-shadow-color {
|
|
457
|
-
syntax: "*";
|
|
458
|
-
inherits: false;
|
|
459
|
-
}
|
|
460
|
-
@property --tw-shadow-alpha {
|
|
461
|
-
syntax: "<percentage>";
|
|
462
|
-
inherits: false;
|
|
463
|
-
initial-value: 100%;
|
|
464
|
-
}
|
|
465
|
-
@property --tw-inset-shadow {
|
|
466
|
-
syntax: "*";
|
|
467
|
-
inherits: false;
|
|
468
|
-
initial-value: 0 0 #0000;
|
|
469
|
-
}
|
|
470
|
-
@property --tw-inset-shadow-color {
|
|
471
|
-
syntax: "*";
|
|
472
|
-
inherits: false;
|
|
473
|
-
}
|
|
474
|
-
@property --tw-inset-shadow-alpha {
|
|
475
|
-
syntax: "<percentage>";
|
|
476
|
-
inherits: false;
|
|
477
|
-
initial-value: 100%;
|
|
478
|
-
}
|
|
479
|
-
@property --tw-ring-color {
|
|
480
|
-
syntax: "*";
|
|
481
|
-
inherits: false;
|
|
482
|
-
}
|
|
483
|
-
@property --tw-ring-shadow {
|
|
484
|
-
syntax: "*";
|
|
485
|
-
inherits: false;
|
|
486
|
-
initial-value: 0 0 #0000;
|
|
487
|
-
}
|
|
488
|
-
@property --tw-inset-ring-color {
|
|
489
|
-
syntax: "*";
|
|
490
|
-
inherits: false;
|
|
491
|
-
}
|
|
492
|
-
@property --tw-inset-ring-shadow {
|
|
493
|
-
syntax: "*";
|
|
494
|
-
inherits: false;
|
|
495
|
-
initial-value: 0 0 #0000;
|
|
496
|
-
}
|
|
497
|
-
@property --tw-ring-inset {
|
|
498
|
-
syntax: "*";
|
|
499
|
-
inherits: false;
|
|
500
|
-
}
|
|
501
|
-
@property --tw-ring-offset-width {
|
|
502
|
-
syntax: "<length>";
|
|
503
|
-
inherits: false;
|
|
504
|
-
initial-value: 0px;
|
|
505
|
-
}
|
|
506
|
-
@property --tw-ring-offset-color {
|
|
507
|
-
syntax: "*";
|
|
508
|
-
inherits: false;
|
|
509
|
-
initial-value: #fff;
|
|
510
|
-
}
|
|
511
|
-
@property --tw-ring-offset-shadow {
|
|
512
|
-
syntax: "*";
|
|
513
|
-
inherits: false;
|
|
514
|
-
initial-value: 0 0 #0000;
|
|
515
|
-
}
|
|
516
443
|
@property --tw-backdrop-blur {
|
|
517
444
|
syntax: "*";
|
|
518
445
|
inherits: false;
|
|
@@ -581,20 +508,6 @@
|
|
|
581
508
|
--tw-leading: initial;
|
|
582
509
|
--tw-font-weight: initial;
|
|
583
510
|
--tw-tracking: initial;
|
|
584
|
-
--tw-shadow: 0 0 #0000;
|
|
585
|
-
--tw-shadow-color: initial;
|
|
586
|
-
--tw-shadow-alpha: 100%;
|
|
587
|
-
--tw-inset-shadow: 0 0 #0000;
|
|
588
|
-
--tw-inset-shadow-color: initial;
|
|
589
|
-
--tw-inset-shadow-alpha: 100%;
|
|
590
|
-
--tw-ring-color: initial;
|
|
591
|
-
--tw-ring-shadow: 0 0 #0000;
|
|
592
|
-
--tw-inset-ring-color: initial;
|
|
593
|
-
--tw-inset-ring-shadow: 0 0 #0000;
|
|
594
|
-
--tw-ring-inset: initial;
|
|
595
|
-
--tw-ring-offset-width: 0px;
|
|
596
|
-
--tw-ring-offset-color: #fff;
|
|
597
|
-
--tw-ring-offset-shadow: 0 0 #0000;
|
|
598
511
|
--tw-backdrop-blur: initial;
|
|
599
512
|
--tw-backdrop-brightness: initial;
|
|
600
513
|
--tw-backdrop-contrast: initial;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
3
4
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
5
|
import { Variants } from 'framer-motion';
|
|
5
6
|
import { ClassValue } from 'clsx';
|
|
@@ -43,6 +44,32 @@ interface FallbackIconProps {
|
|
|
43
44
|
*/
|
|
44
45
|
declare const FallbackIcon: ({ animate, content, className }: FallbackIconProps) => react_jsx_runtime.JSX.Element;
|
|
45
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Props for the GithubFallbackIcon component.
|
|
49
|
+
*/
|
|
50
|
+
interface GithubFallbackIconProps extends Omit<ComponentProps<'img'>, 'src'> {
|
|
51
|
+
/**
|
|
52
|
+
* Path to the SVG file within the web3icons repository.
|
|
53
|
+
* @example "networks/background/ethereum.svg"
|
|
54
|
+
*/
|
|
55
|
+
githubSrc: string;
|
|
56
|
+
/**
|
|
57
|
+
* Optional fill color to apply to the first `<path>` element.
|
|
58
|
+
* Used for testnet/devnet visual differentiation.
|
|
59
|
+
*/
|
|
60
|
+
firstPathFill?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Fetches and displays an SVG icon from the web3icons GitHub repository.
|
|
64
|
+
*
|
|
65
|
+
* Used as a fallback when the bundled `@web3icons/react` library
|
|
66
|
+
* doesn't have a specific icon available.
|
|
67
|
+
*
|
|
68
|
+
* @param props - {@link GithubFallbackIconProps}
|
|
69
|
+
* @returns Loading indicator, the fetched icon, or an error fallback
|
|
70
|
+
*/
|
|
71
|
+
declare function GithubFallbackIcon({ githubSrc, className, alt, firstPathFill, ...props }: GithubFallbackIconProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
|
|
46
73
|
declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
|
|
47
74
|
declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
48
75
|
declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
@@ -69,40 +96,71 @@ declare const DialogFooter: {
|
|
|
69
96
|
declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
70
97
|
declare const DialogDescription: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
71
98
|
|
|
99
|
+
interface NetworkIconProps {
|
|
100
|
+
chainId: number | string;
|
|
101
|
+
variant?: 'background' | 'branded' | 'mono';
|
|
102
|
+
className?: string;
|
|
103
|
+
}
|
|
104
|
+
declare function NetworkIcon({ chainId, variant, className }: NetworkIconProps): react_jsx_runtime.JSX.Element;
|
|
105
|
+
|
|
106
|
+
declare function StarsBackground({ starsCount }: {
|
|
107
|
+
starsCount?: number;
|
|
108
|
+
}): react_jsx_runtime.JSX.Element;
|
|
109
|
+
|
|
72
110
|
/**
|
|
73
|
-
* Props for the
|
|
111
|
+
* Props for the SvgImg component.
|
|
74
112
|
*/
|
|
75
|
-
interface
|
|
113
|
+
interface SvgImgProps extends Omit<ComponentProps<'img'>, 'src' | 'draggable'> {
|
|
114
|
+
/** Base64-encoded SVG data URL */
|
|
115
|
+
src: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Renders an SVG as an isolated `<img>` element.
|
|
119
|
+
*
|
|
120
|
+
* Prevents SVG ID conflicts and disables drag/selection behavior.
|
|
121
|
+
*
|
|
122
|
+
* @param props - {@link SvgImgProps}
|
|
123
|
+
*/
|
|
124
|
+
declare function SvgImg({ src, alt, ...props }: SvgImgProps): react_jsx_runtime.JSX.Element;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Props for the SvgToImg component.
|
|
128
|
+
*/
|
|
129
|
+
interface SvgToImgProps extends Omit<ComponentProps<'img'>, 'ref' | 'src' | 'children'> {
|
|
130
|
+
/** Child SVG element to render while converting */
|
|
131
|
+
children: (ref: (node: SVGSVGElement | null) => void) => ReactNode;
|
|
76
132
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* - `string`: For non-EVM networks (e.g., "solana:mainnet", "solana:devnet").
|
|
133
|
+
* Unique identifier for the icon. When this changes, the cached image is reset.
|
|
134
|
+
* Prevents showing stale icons when content changes dynamically.
|
|
80
135
|
*/
|
|
81
|
-
|
|
136
|
+
iconId: string | number;
|
|
82
137
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
138
|
+
* Optional fill color to apply to the first `<path>` element.
|
|
139
|
+
* Used for testnet/devnet visual differentiation.
|
|
140
|
+
* @example "var(--tuwa-testnet-icons)"
|
|
85
141
|
*/
|
|
86
|
-
|
|
87
|
-
/** Additional CSS class names. */
|
|
88
|
-
className?: string;
|
|
142
|
+
firstPathFill?: string;
|
|
89
143
|
}
|
|
90
144
|
/**
|
|
91
|
-
*
|
|
145
|
+
* Converts an SVG element to an `<img>` tag with a base64-encoded data URL.
|
|
92
146
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
147
|
+
* This component solves the problem of duplicate SVG `id` attributes
|
|
148
|
+
* when rendering multiple identical icons on the same page.
|
|
149
|
+
*
|
|
150
|
+
* Uses a render prop pattern to inject a callback ref that captures
|
|
151
|
+
* the SVG immediately when it mounts.
|
|
97
152
|
*
|
|
98
|
-
* @param props - {@link
|
|
99
|
-
* @returns The
|
|
153
|
+
* @param props - {@link SvgToImgProps}
|
|
154
|
+
* @returns The converted image or the original children while loading
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```tsx
|
|
158
|
+
* <SvgToImg iconId={chainId} firstPathFill={TESTNET_FILL}>
|
|
159
|
+
* {(ref) => <NetworkIconLazy ref={ref} chainId={chainId} />}
|
|
160
|
+
* </SvgToImg>
|
|
161
|
+
* ```
|
|
100
162
|
*/
|
|
101
|
-
declare function
|
|
102
|
-
|
|
103
|
-
declare function StarsBackground({ starsCount }: {
|
|
104
|
-
starsCount?: number;
|
|
105
|
-
}): react_jsx_runtime.JSX.Element;
|
|
163
|
+
declare function SvgToImg({ children, iconId, alt, firstPathFill, ...props }: SvgToImgProps): react_jsx_runtime.JSX.Element;
|
|
106
164
|
|
|
107
165
|
/**
|
|
108
166
|
* @file This file contains a reusable close button component, designed primarily for toast notifications.
|
|
@@ -209,7 +267,7 @@ declare function useCopyToClipboard(timeout?: number): {
|
|
|
209
267
|
*/
|
|
210
268
|
declare function useMediaQuery(query: string): boolean;
|
|
211
269
|
|
|
212
|
-
declare const standardButtonClasses = "novacore:cursor-pointer novacore:rounded-
|
|
270
|
+
declare const standardButtonClasses = "novacore:cursor-pointer novacore:rounded-[var(--tuwa-rounded-corners)] 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";
|
|
213
271
|
|
|
214
272
|
/**
|
|
215
273
|
* @file This file contains a utility function for conditionally merging Tailwind CSS classes.
|
|
@@ -255,19 +313,47 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
255
313
|
declare function deepMerge<T extends object>(target: T, source: Partial<T>): T;
|
|
256
314
|
|
|
257
315
|
/**
|
|
258
|
-
*
|
|
316
|
+
* Result of chain name resolution.
|
|
317
|
+
*/
|
|
318
|
+
interface ChainInfo {
|
|
319
|
+
/** Human-readable network name (e.g., "Ethereum", "Solana Devnet") */
|
|
320
|
+
name: string;
|
|
321
|
+
/** Normalized network identifier for icon libraries (e.g., "ethereum", "solana") */
|
|
322
|
+
id: string;
|
|
323
|
+
/** Original chain ID as provided */
|
|
324
|
+
chainId: number | string;
|
|
325
|
+
/** File path for icon resolution */
|
|
326
|
+
filePath: string;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Retrieves blockchain network information based on its chain ID.
|
|
259
330
|
*
|
|
260
|
-
* Supports both:
|
|
261
|
-
* - Numeric IDs (EVM)
|
|
262
|
-
* - String IDs (Non-EVM)
|
|
331
|
+
* Supports both EVM and non-EVM chain identifiers:
|
|
332
|
+
* - **Numeric IDs (EVM):** e.g., `1` → "Ethereum", `137` → "Polygon"
|
|
333
|
+
* - **String IDs (Non-EVM):** e.g., `"solana:devnet"` → "Solana Devnet"
|
|
334
|
+
*
|
|
335
|
+
* For string IDs with environment suffixes (like "solana:devnet"),
|
|
336
|
+
* the suffix is appended to the name if it's a known dev/test environment.
|
|
337
|
+
*
|
|
338
|
+
* @param chainId - Chain identifier (number for EVM, string for non-EVM)
|
|
339
|
+
* @returns Chain information object with name, id, and original chainId
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* ```ts
|
|
343
|
+
* // EVM network
|
|
344
|
+
* getChainName(1)
|
|
345
|
+
* // → { name: "Ethereum", id: "ethereum", chainId: 1 }
|
|
263
346
|
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
347
|
+
* // Solana devnet
|
|
348
|
+
* getChainName("solana:devnet")
|
|
349
|
+
* // → { name: "Solana Devnet", id: "solana", chainId: "solana:devnet" }
|
|
266
350
|
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
351
|
+
* // Unknown network
|
|
352
|
+
* getChainName(999999)
|
|
353
|
+
* // → { name: "Unknown", id: "unknown", chainId: 999999 }
|
|
354
|
+
* ```
|
|
269
355
|
*/
|
|
270
|
-
declare function getChainName(chainId: number | string):
|
|
356
|
+
declare function getChainName(chainId: number | string): ChainInfo;
|
|
271
357
|
|
|
272
358
|
/**
|
|
273
359
|
* Determines if the current chain is a Solana development or test network.
|
|
@@ -299,6 +385,55 @@ declare function isSolanaDev(chainId: number | string): boolean;
|
|
|
299
385
|
*/
|
|
300
386
|
declare function isTouchDevice(maxWidth?: number): boolean;
|
|
301
387
|
|
|
388
|
+
/**
|
|
389
|
+
* Resolves a CSS variable to its computed value.
|
|
390
|
+
* Returns the original value if it's not a CSS variable.
|
|
391
|
+
*
|
|
392
|
+
* @param value - Color value, potentially a CSS variable like `var(--my-color)`
|
|
393
|
+
* @returns Resolved color value (e.g., `#ff0000`) or original if not a variable
|
|
394
|
+
*/
|
|
395
|
+
declare function resolveCssVariable(value: string): string;
|
|
396
|
+
/**
|
|
397
|
+
* Modifies the fill attribute of the first `<path>` element in an SVG string.
|
|
398
|
+
* Uses DOMParser for safe XML manipulation.
|
|
399
|
+
* Automatically resolves CSS variables (e.g., `var(--color)`) to their computed values.
|
|
400
|
+
*
|
|
401
|
+
* @param svgString - The original SVG markup
|
|
402
|
+
* @param fillColor - The color to apply (supports CSS variables)
|
|
403
|
+
* @returns Modified SVG string
|
|
404
|
+
*/
|
|
405
|
+
declare function applyFirstPathFill(svgString: string, fillColor: string): string;
|
|
406
|
+
/**
|
|
407
|
+
* Encodes an SVG string to a base64 data URL.
|
|
408
|
+
*
|
|
409
|
+
* @param svgString - The SVG markup
|
|
410
|
+
* @param firstPathFill - Optional fill color to apply to the first path
|
|
411
|
+
* @returns Base64-encoded data URL
|
|
412
|
+
*/
|
|
413
|
+
declare function svgToBase64(svgString: string, firstPathFill?: string): string;
|
|
414
|
+
/**
|
|
415
|
+
* Formats a name string into a GitHub-compatible SVG filename.
|
|
416
|
+
*
|
|
417
|
+
* Converts spaces to hyphens and lowercases the string,
|
|
418
|
+
* then appends the `.svg` extension.
|
|
419
|
+
*
|
|
420
|
+
* @param name - The name to format (e.g., "Wallet Connect", "MetaMask")
|
|
421
|
+
* @returns Formatted filename (e.g., "wallet-connect.svg", "metamask.svg")
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* ```ts
|
|
425
|
+
* formatIconNameForGithub("Wallet Connect")
|
|
426
|
+
* // → "wallet-connect.svg"
|
|
427
|
+
*
|
|
428
|
+
* formatIconNameForGithub("MetaMask")
|
|
429
|
+
* // → "metamask.svg"
|
|
430
|
+
*
|
|
431
|
+
* formatIconNameForGithub("coinbase")
|
|
432
|
+
* // → "coinbase.svg"
|
|
433
|
+
* ```
|
|
434
|
+
*/
|
|
435
|
+
declare const formatIconNameForGithub: (name: string) => string;
|
|
436
|
+
|
|
302
437
|
/**
|
|
303
438
|
* @file This file contains a utility function for truncating a string with a center ellipsis.
|
|
304
439
|
*/
|
|
@@ -319,4 +454,4 @@ declare function isTouchDevice(maxWidth?: number): boolean;
|
|
|
319
454
|
*/
|
|
320
455
|
declare function textCenterEllipsis(str: string | undefined | null, from: number, to: number): string;
|
|
321
456
|
|
|
322
|
-
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 };
|
|
457
|
+
export { type ChainInfo, ChevronArrowWithAnim, CloseIcon, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, FallbackIcon, type FallbackIconProps, GithubFallbackIcon, NetworkIcon, StarsBackground, SvgImg, type SvgImgProps, SvgToImg, ToastCloseButton, type ToastCloseButtonProps, WalletIcon, applyFirstPathFill, cn, deepMerge, formatIconNameForGithub, getChainName, isSolanaDev, isTouchDevice, resolveCssVariable, standardButtonClasses, svgToBase64, textCenterEllipsis, useCopyToClipboard, useMediaQuery };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
3
4
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
5
|
import { Variants } from 'framer-motion';
|
|
5
6
|
import { ClassValue } from 'clsx';
|
|
@@ -43,6 +44,32 @@ interface FallbackIconProps {
|
|
|
43
44
|
*/
|
|
44
45
|
declare const FallbackIcon: ({ animate, content, className }: FallbackIconProps) => react_jsx_runtime.JSX.Element;
|
|
45
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Props for the GithubFallbackIcon component.
|
|
49
|
+
*/
|
|
50
|
+
interface GithubFallbackIconProps extends Omit<ComponentProps<'img'>, 'src'> {
|
|
51
|
+
/**
|
|
52
|
+
* Path to the SVG file within the web3icons repository.
|
|
53
|
+
* @example "networks/background/ethereum.svg"
|
|
54
|
+
*/
|
|
55
|
+
githubSrc: string;
|
|
56
|
+
/**
|
|
57
|
+
* Optional fill color to apply to the first `<path>` element.
|
|
58
|
+
* Used for testnet/devnet visual differentiation.
|
|
59
|
+
*/
|
|
60
|
+
firstPathFill?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Fetches and displays an SVG icon from the web3icons GitHub repository.
|
|
64
|
+
*
|
|
65
|
+
* Used as a fallback when the bundled `@web3icons/react` library
|
|
66
|
+
* doesn't have a specific icon available.
|
|
67
|
+
*
|
|
68
|
+
* @param props - {@link GithubFallbackIconProps}
|
|
69
|
+
* @returns Loading indicator, the fetched icon, or an error fallback
|
|
70
|
+
*/
|
|
71
|
+
declare function GithubFallbackIcon({ githubSrc, className, alt, firstPathFill, ...props }: GithubFallbackIconProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
|
|
46
73
|
declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
|
|
47
74
|
declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
48
75
|
declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
@@ -69,40 +96,71 @@ declare const DialogFooter: {
|
|
|
69
96
|
declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
70
97
|
declare const DialogDescription: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
71
98
|
|
|
99
|
+
interface NetworkIconProps {
|
|
100
|
+
chainId: number | string;
|
|
101
|
+
variant?: 'background' | 'branded' | 'mono';
|
|
102
|
+
className?: string;
|
|
103
|
+
}
|
|
104
|
+
declare function NetworkIcon({ chainId, variant, className }: NetworkIconProps): react_jsx_runtime.JSX.Element;
|
|
105
|
+
|
|
106
|
+
declare function StarsBackground({ starsCount }: {
|
|
107
|
+
starsCount?: number;
|
|
108
|
+
}): react_jsx_runtime.JSX.Element;
|
|
109
|
+
|
|
72
110
|
/**
|
|
73
|
-
* Props for the
|
|
111
|
+
* Props for the SvgImg component.
|
|
74
112
|
*/
|
|
75
|
-
interface
|
|
113
|
+
interface SvgImgProps extends Omit<ComponentProps<'img'>, 'src' | 'draggable'> {
|
|
114
|
+
/** Base64-encoded SVG data URL */
|
|
115
|
+
src: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Renders an SVG as an isolated `<img>` element.
|
|
119
|
+
*
|
|
120
|
+
* Prevents SVG ID conflicts and disables drag/selection behavior.
|
|
121
|
+
*
|
|
122
|
+
* @param props - {@link SvgImgProps}
|
|
123
|
+
*/
|
|
124
|
+
declare function SvgImg({ src, alt, ...props }: SvgImgProps): react_jsx_runtime.JSX.Element;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Props for the SvgToImg component.
|
|
128
|
+
*/
|
|
129
|
+
interface SvgToImgProps extends Omit<ComponentProps<'img'>, 'ref' | 'src' | 'children'> {
|
|
130
|
+
/** Child SVG element to render while converting */
|
|
131
|
+
children: (ref: (node: SVGSVGElement | null) => void) => ReactNode;
|
|
76
132
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* - `string`: For non-EVM networks (e.g., "solana:mainnet", "solana:devnet").
|
|
133
|
+
* Unique identifier for the icon. When this changes, the cached image is reset.
|
|
134
|
+
* Prevents showing stale icons when content changes dynamically.
|
|
80
135
|
*/
|
|
81
|
-
|
|
136
|
+
iconId: string | number;
|
|
82
137
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
138
|
+
* Optional fill color to apply to the first `<path>` element.
|
|
139
|
+
* Used for testnet/devnet visual differentiation.
|
|
140
|
+
* @example "var(--tuwa-testnet-icons)"
|
|
85
141
|
*/
|
|
86
|
-
|
|
87
|
-
/** Additional CSS class names. */
|
|
88
|
-
className?: string;
|
|
142
|
+
firstPathFill?: string;
|
|
89
143
|
}
|
|
90
144
|
/**
|
|
91
|
-
*
|
|
145
|
+
* Converts an SVG element to an `<img>` tag with a base64-encoded data URL.
|
|
92
146
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
147
|
+
* This component solves the problem of duplicate SVG `id` attributes
|
|
148
|
+
* when rendering multiple identical icons on the same page.
|
|
149
|
+
*
|
|
150
|
+
* Uses a render prop pattern to inject a callback ref that captures
|
|
151
|
+
* the SVG immediately when it mounts.
|
|
97
152
|
*
|
|
98
|
-
* @param props - {@link
|
|
99
|
-
* @returns The
|
|
153
|
+
* @param props - {@link SvgToImgProps}
|
|
154
|
+
* @returns The converted image or the original children while loading
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```tsx
|
|
158
|
+
* <SvgToImg iconId={chainId} firstPathFill={TESTNET_FILL}>
|
|
159
|
+
* {(ref) => <NetworkIconLazy ref={ref} chainId={chainId} />}
|
|
160
|
+
* </SvgToImg>
|
|
161
|
+
* ```
|
|
100
162
|
*/
|
|
101
|
-
declare function
|
|
102
|
-
|
|
103
|
-
declare function StarsBackground({ starsCount }: {
|
|
104
|
-
starsCount?: number;
|
|
105
|
-
}): react_jsx_runtime.JSX.Element;
|
|
163
|
+
declare function SvgToImg({ children, iconId, alt, firstPathFill, ...props }: SvgToImgProps): react_jsx_runtime.JSX.Element;
|
|
106
164
|
|
|
107
165
|
/**
|
|
108
166
|
* @file This file contains a reusable close button component, designed primarily for toast notifications.
|
|
@@ -209,7 +267,7 @@ declare function useCopyToClipboard(timeout?: number): {
|
|
|
209
267
|
*/
|
|
210
268
|
declare function useMediaQuery(query: string): boolean;
|
|
211
269
|
|
|
212
|
-
declare const standardButtonClasses = "novacore:cursor-pointer novacore:rounded-
|
|
270
|
+
declare const standardButtonClasses = "novacore:cursor-pointer novacore:rounded-[var(--tuwa-rounded-corners)] 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";
|
|
213
271
|
|
|
214
272
|
/**
|
|
215
273
|
* @file This file contains a utility function for conditionally merging Tailwind CSS classes.
|
|
@@ -255,19 +313,47 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
255
313
|
declare function deepMerge<T extends object>(target: T, source: Partial<T>): T;
|
|
256
314
|
|
|
257
315
|
/**
|
|
258
|
-
*
|
|
316
|
+
* Result of chain name resolution.
|
|
317
|
+
*/
|
|
318
|
+
interface ChainInfo {
|
|
319
|
+
/** Human-readable network name (e.g., "Ethereum", "Solana Devnet") */
|
|
320
|
+
name: string;
|
|
321
|
+
/** Normalized network identifier for icon libraries (e.g., "ethereum", "solana") */
|
|
322
|
+
id: string;
|
|
323
|
+
/** Original chain ID as provided */
|
|
324
|
+
chainId: number | string;
|
|
325
|
+
/** File path for icon resolution */
|
|
326
|
+
filePath: string;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Retrieves blockchain network information based on its chain ID.
|
|
259
330
|
*
|
|
260
|
-
* Supports both:
|
|
261
|
-
* - Numeric IDs (EVM)
|
|
262
|
-
* - String IDs (Non-EVM)
|
|
331
|
+
* Supports both EVM and non-EVM chain identifiers:
|
|
332
|
+
* - **Numeric IDs (EVM):** e.g., `1` → "Ethereum", `137` → "Polygon"
|
|
333
|
+
* - **String IDs (Non-EVM):** e.g., `"solana:devnet"` → "Solana Devnet"
|
|
334
|
+
*
|
|
335
|
+
* For string IDs with environment suffixes (like "solana:devnet"),
|
|
336
|
+
* the suffix is appended to the name if it's a known dev/test environment.
|
|
337
|
+
*
|
|
338
|
+
* @param chainId - Chain identifier (number for EVM, string for non-EVM)
|
|
339
|
+
* @returns Chain information object with name, id, and original chainId
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* ```ts
|
|
343
|
+
* // EVM network
|
|
344
|
+
* getChainName(1)
|
|
345
|
+
* // → { name: "Ethereum", id: "ethereum", chainId: 1 }
|
|
263
346
|
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
347
|
+
* // Solana devnet
|
|
348
|
+
* getChainName("solana:devnet")
|
|
349
|
+
* // → { name: "Solana Devnet", id: "solana", chainId: "solana:devnet" }
|
|
266
350
|
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
351
|
+
* // Unknown network
|
|
352
|
+
* getChainName(999999)
|
|
353
|
+
* // → { name: "Unknown", id: "unknown", chainId: 999999 }
|
|
354
|
+
* ```
|
|
269
355
|
*/
|
|
270
|
-
declare function getChainName(chainId: number | string):
|
|
356
|
+
declare function getChainName(chainId: number | string): ChainInfo;
|
|
271
357
|
|
|
272
358
|
/**
|
|
273
359
|
* Determines if the current chain is a Solana development or test network.
|
|
@@ -299,6 +385,55 @@ declare function isSolanaDev(chainId: number | string): boolean;
|
|
|
299
385
|
*/
|
|
300
386
|
declare function isTouchDevice(maxWidth?: number): boolean;
|
|
301
387
|
|
|
388
|
+
/**
|
|
389
|
+
* Resolves a CSS variable to its computed value.
|
|
390
|
+
* Returns the original value if it's not a CSS variable.
|
|
391
|
+
*
|
|
392
|
+
* @param value - Color value, potentially a CSS variable like `var(--my-color)`
|
|
393
|
+
* @returns Resolved color value (e.g., `#ff0000`) or original if not a variable
|
|
394
|
+
*/
|
|
395
|
+
declare function resolveCssVariable(value: string): string;
|
|
396
|
+
/**
|
|
397
|
+
* Modifies the fill attribute of the first `<path>` element in an SVG string.
|
|
398
|
+
* Uses DOMParser for safe XML manipulation.
|
|
399
|
+
* Automatically resolves CSS variables (e.g., `var(--color)`) to their computed values.
|
|
400
|
+
*
|
|
401
|
+
* @param svgString - The original SVG markup
|
|
402
|
+
* @param fillColor - The color to apply (supports CSS variables)
|
|
403
|
+
* @returns Modified SVG string
|
|
404
|
+
*/
|
|
405
|
+
declare function applyFirstPathFill(svgString: string, fillColor: string): string;
|
|
406
|
+
/**
|
|
407
|
+
* Encodes an SVG string to a base64 data URL.
|
|
408
|
+
*
|
|
409
|
+
* @param svgString - The SVG markup
|
|
410
|
+
* @param firstPathFill - Optional fill color to apply to the first path
|
|
411
|
+
* @returns Base64-encoded data URL
|
|
412
|
+
*/
|
|
413
|
+
declare function svgToBase64(svgString: string, firstPathFill?: string): string;
|
|
414
|
+
/**
|
|
415
|
+
* Formats a name string into a GitHub-compatible SVG filename.
|
|
416
|
+
*
|
|
417
|
+
* Converts spaces to hyphens and lowercases the string,
|
|
418
|
+
* then appends the `.svg` extension.
|
|
419
|
+
*
|
|
420
|
+
* @param name - The name to format (e.g., "Wallet Connect", "MetaMask")
|
|
421
|
+
* @returns Formatted filename (e.g., "wallet-connect.svg", "metamask.svg")
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* ```ts
|
|
425
|
+
* formatIconNameForGithub("Wallet Connect")
|
|
426
|
+
* // → "wallet-connect.svg"
|
|
427
|
+
*
|
|
428
|
+
* formatIconNameForGithub("MetaMask")
|
|
429
|
+
* // → "metamask.svg"
|
|
430
|
+
*
|
|
431
|
+
* formatIconNameForGithub("coinbase")
|
|
432
|
+
* // → "coinbase.svg"
|
|
433
|
+
* ```
|
|
434
|
+
*/
|
|
435
|
+
declare const formatIconNameForGithub: (name: string) => string;
|
|
436
|
+
|
|
302
437
|
/**
|
|
303
438
|
* @file This file contains a utility function for truncating a string with a center ellipsis.
|
|
304
439
|
*/
|
|
@@ -319,4 +454,4 @@ declare function isTouchDevice(maxWidth?: number): boolean;
|
|
|
319
454
|
*/
|
|
320
455
|
declare function textCenterEllipsis(str: string | undefined | null, from: number, to: number): string;
|
|
321
456
|
|
|
322
|
-
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 };
|
|
457
|
+
export { type ChainInfo, ChevronArrowWithAnim, CloseIcon, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, FallbackIcon, type FallbackIconProps, GithubFallbackIcon, NetworkIcon, StarsBackground, SvgImg, type SvgImgProps, SvgToImg, ToastCloseButton, type ToastCloseButtonProps, WalletIcon, applyFirstPathFill, cn, deepMerge, formatIconNameForGithub, getChainName, isSolanaDev, isTouchDevice, resolveCssVariable, standardButtonClasses, svgToBase64, 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 {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 s from'@radix-ui/react-dialog';var po="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 i(...o){return twMerge(clsx(o))}var g=o=>o&&typeof o=="object"&&!Array.isArray(o);function z(o,e){let t={...o};return g(o)&&g(e)&&Object.keys(e).forEach(n=>{let a=o[n],r=e[n];g(a)&&g(r)?t[n]=z(a,r):t[n]=r;}),t}function w(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 C(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&&w(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,r=window.innerWidth<=o;return a&&r}function Do(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 Vo({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:i("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 B=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:i("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"})]}));B.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:i(O,"Nova_Web3_Icon",t,{"novacore:animate-pulse":o}),children:e});var Uo=s.Root,Qo=s.Trigger,_=s.Portal,Jo=s.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}}},q={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},L=({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??q,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"novacore:relative novacore:overflow-hidden",children:jsx("div",{className:i("novacore:fixed novacore:inset-0 novacore:z-50 novacore:bg-black/55 novacore:backdrop-blur-sm novacore:backdrop-saturate-150",o)})})}));L.displayName=s.Overlay.displayName;var G=l.forwardRef(({className:o,children:e,modalAnimation:t,backdropAnimation:n,...a},r)=>{let[u,m]=l.useState(false);l.useEffect(()=>{m(D());},[]);let f=t??(u?$:Y);return jsxs(_,{children:[jsx(L,{backdropAnimation:n}),jsx(s.Content,{"aria-describedby":"tuwa:modal-content",ref:r,className:i("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:f,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"NovaNoScrolling novacore:relative novacore:overflow-hidden",children:jsx("div",{className:i("NovaNoScrolling NovaDialogContent__elements 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})})})})})]})});G.displayName=s.Content.displayName;var j=({className:o,...e})=>jsx("div",{"aria-describedby":"tuwa:modal-header",className:i("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});j.displayName="DialogHeader";var K=({className:o,...e})=>jsx("div",{"aria-describedby":"tuwa:modal-footer",className:i("novacore:flex novacore:flex-col-reverse novacore:sm:flex-row novacore:sm:justify-end novacore:sm:space-x-2",o),...e});K.displayName="DialogFooter";var U=l.forwardRef(({className:o,...e},t)=>jsx(s.Title,{ref:t,"aria-describedby":"tuwa:modal-title",className:i("novacore:text-lg novacore:font-bold novacore:leading-none novacore:tracking-tight novacore:text-[var(--tuwa-text-primary)] novacore:m-0",o),...e}));U.displayName=s.Title.displayName;var Q=l.forwardRef(({className:o,...e},t)=>jsx(s.Description,{"aria-describedby":"tuwa:modal-description",ref:t,className:i("novacore:text-sm novacore:text-[var(--tuwa-text-secondary)]",o),...e}));Q.displayName=s.Description.displayName;var A=lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.NetworkIcon})));function ne({chainId:o,variant:e="background",className:t}){let n=C(o),a=typeof o=="string",r=a?o.split(":")[0].toLowerCase():o,u=a&&w(o),m=i("novacore:w-full novacore:h-full novacore:rounded-full",t,{"novacore:[&_path]:first-of-type:fill-[var(--tuwa-testnet-icons)]":u||n.toLowerCase().includes("testnet")});return jsx(Suspense,{fallback:jsx(d,{animate:true,className:t}),children:typeof r=="string"?jsx(A,{id:r,variant:e,className:m,fallback:jsx(d,{content:"?",className:t})}):jsx(A,{chainId:r,variant:e,className:m,fallback:jsx(d,{content:"?",className:t})})})}function ce({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:`
|
|
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,Fragment}from'react/jsx-runtime';import*as u from'react';import {lazy,useState,useEffect,useCallback,Suspense,useMemo}from'react';import*as c from'@radix-ui/react-dialog';var Vo="novacore:cursor-pointer novacore:rounded-[var(--tuwa-rounded-corners)] 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 s(...o){return twMerge(clsx(o))}var y=o=>o&&typeof o=="object"&&!Array.isArray(o);function K(o,e){let t={...o};return y(o)&&y(e)&&Object.keys(e).forEach(a=>{let r=o[a],n=e[a];y(r)&&y(n)?t[a]=K(r,n):t[a]=n;}),t}function x(o){if(typeof o!="string")return false;let e=o.toLowerCase();return e.includes("solana")&&(e.includes("devnet")||e.includes("testnet"))}var T="Unknown";function Q(o){return o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}function E(o){let e={name:T,id:T.toLowerCase(),filePath:T.toLowerCase(),chainId:o};if(typeof o=="number"){let i=networks.find(l=>l.chainId===o);return i?{name:i.name,id:i.id,filePath:i.filePath.split(":")[1],chainId:o}:e}let[t,a]=o.split(":"),r=networks.find(i=>i.id===t);return r?{name:a&&x(o)?`${r.name} ${Q(a)}`:r.name,id:r.id,filePath:r.filePath.split(":")[1],chainId:o}:e}function A(o=1200){if(typeof window>"u")return false;let e="ontouchstart"in window,t=navigator.maxTouchPoints>0,a=false;window.matchMedia&&(a=window.matchMedia("(pointer: coarse)").matches);let r=e||t||a,n=window.innerWidth<=o;return r&&n}function X(o){if(!o.startsWith("var("))return o;let e=o.match(/var\(\s*(--[\w-]+)/);if(!e)return o;let t=e[1];return getComputedStyle(document.documentElement).getPropertyValue(t).trim()||o}function j(o,e){let t=X(e),r=new DOMParser().parseFromString(o,"image/svg+xml");if(r.querySelector("parsererror"))return console.warn("SVG parse error, returning original"),o;let i=r.querySelector("path");return i&&i.setAttribute("fill",t),new XMLSerializer().serializeToString(r.documentElement)}function N(o,e){let t=o;return e&&(t=j(t,e)),`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(t)))}`}var S=o=>`${o.replace(/\s+/g,"-").toLowerCase()}.svg`;function Ko(o,e,t){if(!o)return "";if(o.length<=e+t)return o;let a=o.slice(0,e),r=o.slice(o.length-t);return `${a}...${r}`}function se({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:s("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=u.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:s("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 eo="novacore:flex novacore:items-center novacore:justify-center novacore:w-full novacore:h-full novacore:rounded-full novacore:text-[var(--tuwa-text-secondary)] novacore:bg-[var(--tuwa-bg-muted)]",v=({animate:o=false,content:e="",className:t})=>jsx("div",{className:s(eo,"Nova_Web3_Icon",t,{"novacore:animate-pulse":o}),children:e});function k({src:o,alt:e,...t}){return jsx("img",{...t,src:o,alt:e??"",draggable:false,onDragStart:a=>a.preventDefault(),style:{outline:"none",pointerEvents:"none"}})}var no="https://raw.githubusercontent.com/0xa3k5/web3icons/refs/heads/main/raw-svgs";function b({githubSrc:o,className:e,alt:t,firstPathFill:a,...r}){let[n,i]=useState(null),[l,m]=useState("idle");return useEffect(()=>{let f=true;return (async()=>{m("loading");try{let w=await fetch(`${no}/${o}`);if(!w.ok)throw new Error(`Failed to load icon: ${w.status}`);let Y=await w.text();f&&(i(N(Y,a)),m("success"));}catch{f&&m("error");}})(),()=>{f=false;}},[o,a]),l==="loading"||l==="idle"?jsx(v,{animate:true,className:e}):l==="success"&&n?jsx(k,{...r,src:n,alt:t,className:e}):jsx(v,{content:"?",className:e})}var Te=c.Root,De=c.Trigger,io=c.Portal,Re=c.Close,so={initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,transition:{duration:.2}}},co={initial:{opacity:0,y:"100%"},animate:{opacity:1,y:"0%"},exit:{opacity:0,y:"100%",transition:{duration:.2}}},lo={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},B=({className:o,backdropAnimation:e})=>(u.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??lo,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"novacore:relative novacore:overflow-hidden",children:jsx("div",{className:s("novacore:fixed novacore:inset-0 novacore:z-50 novacore:bg-black/55 novacore:backdrop-blur-sm novacore:backdrop-saturate-150",o)})})}));B.displayName=c.Overlay.displayName;var mo=u.forwardRef(({className:o,children:e,modalAnimation:t,backdropAnimation:a,...r},n)=>{let[i,l]=u.useState(false);u.useEffect(()=>{l(A());},[]);let m=t??(i?co:so);return jsxs(io,{children:[jsx(B,{backdropAnimation:a}),jsx(c.Content,{"aria-describedby":"tuwa:modal-content",ref:n,className:s("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),...r,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:m,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"NovaNoScrolling novacore:relative novacore:overflow-hidden",children:jsx("div",{className:s("NovaNoScrolling NovaDialogContent__elements novacore:relative novacore:flex novacore:max-h-[98dvh] novacore:w-full novacore:flex-col novacore:gap-3 novacore:overflow-y-auto novacore:rounded-t-[var(--tuwa-rounded-corners)] novacore:sm:rounded-[var(--tuwa-rounded-corners)]","novacore:border novacore:border-[var(--tuwa-border-primary)] novacore:bg-[var(--tuwa-bg-primary)]"),children:e})})})})})]})});mo.displayName=c.Content.displayName;var uo=({className:o,...e})=>jsx("div",{"aria-describedby":"tuwa:modal-header",className:s("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});uo.displayName="DialogHeader";var po=({className:o,...e})=>jsx("div",{"aria-describedby":"tuwa:modal-footer",className:s("novacore:flex novacore:flex-col-reverse novacore:sm:flex-row novacore:sm:justify-end novacore:sm:space-x-2",o),...e});po.displayName="DialogFooter";var fo=u.forwardRef(({className:o,...e},t)=>jsx(c.Title,{ref:t,"aria-describedby":"tuwa:modal-title",className:s("novacore:text-lg novacore:font-bold novacore:leading-none novacore:tracking-tight novacore:text-[var(--tuwa-text-primary)] novacore:m-0",o),...e}));fo.displayName=c.Title.displayName;var vo=u.forwardRef(({className:o,...e},t)=>jsx(c.Description,{"aria-describedby":"tuwa:modal-description",ref:t,className:s("novacore:text-sm novacore:text-[var(--tuwa-text-secondary)]",o),...e}));vo.displayName=c.Description.displayName;function h({children:o,iconId:e,alt:t,firstPathFill:a,...r}){let[n,i]=useState(null),l=useCallback(m=>{if(m){let f=N(m.outerHTML,a);i({id:e,src:f});}},[e,a]);return n&&n.id===e?jsx(k,{...r,src:n.src,alt:t}):jsx(Fragment,{children:o(l)})}var H=lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.NetworkIcon}))),No="var(--tuwa-testnet-icons)";function Ye({chainId:o,variant:e="background",className:t}){let a=E(o),r=typeof o=="string",n=r?o.split(":")[0].toLowerCase():o,l=r&&x(o)||a.name.toLowerCase().includes("testnet")?No:void 0,m=s("novacore:w-full novacore:h-full novacore:rounded-full",t),f=typeof n=="string"?n:a.filePath,I=`networks/${e}/${S(f)}`;return jsx(Suspense,{fallback:jsx(v,{animate:true,className:t}),children:jsx(h,{iconId:`${o}-${e}`,className:m,firstPathFill:l,children:w=>typeof n=="string"?jsx(H,{ref:w,id:n,variant:e,fallback:jsx(b,{githubSrc:I,className:m,firstPathFill:l})}):jsx(H,{ref:w,chainId:n,variant:e,fallback:jsx(b,{githubSrc:I,className:m,firstPathFill:l})})})})}function Qe({starsCount:o}){let[e,t]=useState(false);useEffect(()=>t(true),[]);let a=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
|
-
`})}),
|
|
48
|
-
export{
|
|
47
|
+
`})}),a.map((r,n)=>jsx("circle",{cx:r.x,cy:r.y,r:r.r,fill:"rgba(var(--tuwa-bg-primary), 0.7)",className:r.isSupernova?"supernova":"pulsar",style:{animationDelay:`${r.delay}s`,animationDuration:`${r.duration}s`}},n))]})})}function Ze({closeToast:o,ariaLabel:e="Close toast notification",title:t="Close toast notification",className:a,iconClassName:r}){return jsx("button",{type:"button",onClick:o,"aria-label":e,title:t,className:s("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)]",a),children:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:s("novacore:h-5 novacore:w-5",r),children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})}var Do=lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.WalletIcon}))),Ro={walletconnect:"wallet-connect"},Mo=({className:o,ref:e})=>jsxs("svg",{ref:e,className:o,fill:"none",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M16 0c8.84 0 16 7.16 16 16s-7.16 16-16 16S0 24.84 0 16 7.16 0 16 0",clipRule:"evenodd"}),jsx("path",{fill:"#000",fillRule:"evenodd",d:"M16.54 2.01h1.53c.5.09.99.23 1.48.42.21.25.19.48-.05.69q-.195.045-.39 0c-1.86-.65-3.55-.35-5.07.89 2.39.7 3.84 2.27 4.36 4.7.12.85.08 1.68-.12 2.51.87 0 1.74 0 2.61-.02.39-.4.7-.85.94-1.35-.45-.45-.65-.99-.59-1.63-1.15.08-1.79-.44-1.92-1.58.14-1.12.78-1.67 1.92-1.63a.7.7 0 0 0-.12-.49l-.89-.89c-.02-.45.19-.6.62-.47.24.19.46.39.66.62.71-.79 1.5-.89 2.39-.32.44.42.62.94.54 1.55 1.49.02 2.11.76 1.85 2.22-.08.17-.17.34-.27.49.53.59.87 1.28 1.01 2.07.08 4.6.1 9.19.05 13.79-.19 1.58-1 2.71-2.44 3.37-.29.1-.59.2-.89.27H7.2c-1.31-.33-2.05-1.17-2.24-2.51-.03-5.24-.03-10.47 0-15.71.3-1.62 1.28-2.46 2.93-2.54 1.26-1.77 2.98-2.64 5.17-2.61.96-1.01 2.13-1.62 3.5-1.85zm6.11 1.87c.39-.03.7.12.91.44.06.39.09.79.1 1.18.02.12.07.21.17.27.41 0 .82.04 1.23.1.49.26.63.65.42 1.16-.07.14-.18.25-.32.32-.39.06-.79.09-1.18.1-.12.02-.21.07-.27.17l-.15 1.33c-.32.46-.72.55-1.21.27a.76.76 0 0 1-.27-.37c-.06-.41-.09-.82-.1-1.23a.35.35 0 0 0-.27-.17l-1.08-.05c-.46-.24-.62-.61-.47-1.11.14-.27.36-.43.66-.47l.99-.05s.09-.04.12-.07l.15-1.28q.18-.39.57-.54m-10.49.79c2.41-.09 4.12.94 5.15 3.1.44 1.12.48 2.25.12 3.4-.84.06-1.67.07-2.51.02.56-.68.52-1.32-.1-1.92-.26-.13-.54-.19-.84-.17.02-.95 0-1.91-.07-2.86-.21-.41-.55-.58-1.01-.52-.17.03-.31.09-.44.2-.72.92-1.43 1.85-2.14 2.78-.28.45-.29.91-.05 1.38q.225.3.57.42c.34.02.69.03 1.03.02v.69c-1.3.02-2.59 0-3.89-.05-.58-2.1-.08-3.88 1.53-5.34.79-.62 1.68-1 2.66-1.16zm.83 1.82c.07 0 .13.03.17.1l.05 3.05c.04.09.1.16.17.22l.89.05c.22.08.3.24.22.47q-.27.42-.57.81c-.43.02-.85.03-1.28.02 0-.41 0-.82-.02-1.23a.46.46 0 0 0-.17-.17l-1.28-.05c-.3-.1-.37-.29-.22-.57.7-.89 1.39-1.79 2.04-2.71zm-5.81.84h.2a6.1 6.1 0 0 0-.25 3.77c-.59-.13-1.01-.49-1.26-1.06-.36-1.29.08-2.19 1.31-2.71m17.98.83c.05 0 .1 0 .15.02q.825.855.96 2.04.045 1.305 0 2.61a3.76 3.76 0 0 0-2.54-1.55c-.61-.05-1.21-.08-1.82-.1.26-.31.48-.66.64-1.03 1.31.02 1.94-.62 1.87-1.95.26.02.5 0 .74-.05zM5.7 11.22c.41.4.91.65 1.48.76l16.06.05c1.42.13 2.38.87 2.88 2.19.07.24.12.49.15.74.03 2.86.03 5.71 0 8.57-.21 1.44-1 2.38-2.39 2.83-.24.05-.49.08-.74.1-1.26.02-2.53.03-3.79.02 0-1.33 0-2.66.02-3.99l1.55-1.55c1.42-.04 2.09-.78 1.99-2.19-.24-.88-.81-1.34-1.72-1.38-1.2.12-1.81.8-1.82 2.02l-1.92 1.92c-.08.11-.14.22-.2.34-.07 1.61-.1 3.22-.07 4.83h-.44c0-2.28 0-4.56-.02-6.85a1.8 1.8 0 0 0-.15-.34l-1.13-1.13c0-1.23-.61-1.92-1.82-2.07-1.29.17-1.87.91-1.72 2.22q.465 1.395 1.95 1.35l.71.71c0 .3.04.6.1.89.25.21.48.19.69-.05.03-.39.03-.79 0-1.18-.2-.25-.43-.49-.66-.71.15-.1.29-.22.39-.37.3.27.58.55.86.84.02 2.23.03 4.47.02 6.7h-.59c0-1.38 0-2.76-.02-4.14-.15-.25-.35-.31-.62-.17a1 1 0 0 0-.12.22c-.02 1.36-.03 2.73-.02 4.09h-.44c0-.99 0-1.97-.02-2.96-.02-.09-.06-.17-.1-.25-.67-.72-1.36-1.43-2.07-2.12-.06-1.48-.82-2.13-2.29-1.95-1.02.41-1.42 1.16-1.21 2.24q.51 1.32 1.95 1.26l1.55 1.55c.02.74.03 1.48.02 2.22-1.56.02-3.12 0-4.68-.07-.9-.24-1.42-.83-1.55-1.75-.02-4.48-.03-8.96-.02-13.45zm7.79 5.66c.84.06 1.19.5 1.06 1.33-.32.62-.8.79-1.45.52-.46-.37-.56-.82-.32-1.35.18-.26.42-.42.71-.49zm7.43 1.28c.89-.03 1.29.4 1.21 1.28-.33.67-.83.85-1.5.52-.54-.49-.58-1-.1-1.55.12-.11.25-.19.39-.25M9.94 19.94c.84 0 1.22.4 1.16 1.23-.28.68-.76.89-1.45.62-.63-.54-.65-1.09-.05-1.67l.34-.17zm9.75.24c.16.13.3.27.44.42-.53.52-1.05 1.05-1.55 1.6-.02 1.43-.03 2.86-.02 4.28h-.59c0-1.51 0-3.02.02-4.53a71 71 0 0 1 1.7-1.77M11.56 22c.62.53 1.21 1.11 1.75 1.72.02.92.03 1.84.02 2.76h-.59c0-.85 0-1.71-.02-2.56l-1.48-1.48s-.03-.07 0-.1c.12-.11.22-.22.32-.34",clipRule:"evenodd"})]});function st({walletName:o,variant:e="background",className:t}){let a=s("novacore:w-full novacore:h-full novacore:rounded-full",t),r=o.toLowerCase();if(r==="impersonatedwallet")return jsx(h,{iconId:"impersonatedwallet",className:a,children:i=>jsx(Mo,{ref:i})});let n=Ro[r]??r;return jsx(Suspense,{fallback:jsx(v,{animate:true,className:t}),children:jsx(h,{iconId:`${n}-${e}`,className:a,children:i=>jsx(Do,{ref:i,id:n,variant:e,fallback:jsx(b,{githubSrc:`wallets/${e}/${S(n)}`,className:a})})})})}function dt(o=2e3){let[e,t]=useState(false),[a,r]=useState(null),n=useCallback(async i=>{if(i)try{await navigator.clipboard.writeText(i),t(!0),r(null),setTimeout(()=>t(!1),o);}catch(l){let m=l instanceof Error?l:new Error("Failed to copy text.");console.error(m),r(m),setTimeout(()=>r(null),o);}},[o]);return {isCopied:e,copy:n,error:a}}function ft(o){let e=r=>typeof window<"u"?window.matchMedia(r).matches:false,[t,a]=useState(e(o));return useEffect(()=>{let r=window.matchMedia(o),n=()=>a(r.matches);return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[o]),t}
|
|
48
|
+
export{se as ChevronArrowWithAnim,Z as CloseIcon,Te as Dialog,Re as DialogClose,mo as DialogContent,vo as DialogDescription,po as DialogFooter,uo as DialogHeader,B as DialogOverlay,io as DialogPortal,fo as DialogTitle,De as DialogTrigger,v as FallbackIcon,b as GithubFallbackIcon,Ye as NetworkIcon,Qe as StarsBackground,k as SvgImg,h as SvgToImg,Ze as ToastCloseButton,st as WalletIcon,j as applyFirstPathFill,s as cn,K as deepMerge,S as formatIconNameForGithub,E as getChainName,x as isSolanaDev,A as isTouchDevice,X as resolveCssVariable,Vo as standardButtonClasses,N as svgToBase64,Ko as textCenterEllipsis,dt as useCopyToClipboard,ft as useMediaQuery};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuwaio/nova-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Oleksandr Tkach",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -59,16 +59,16 @@
|
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@tailwindcss/postcss": "^4.1.18",
|
|
61
61
|
"@tailwindcss/vite": "^4.1.18",
|
|
62
|
-
"@types/react": "^19.2.
|
|
62
|
+
"@types/react": "^19.2.10",
|
|
63
63
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
64
|
-
"@web3icons/react": "^4.1.
|
|
65
|
-
"@web3icons/common": "^0.11.
|
|
66
|
-
"autoprefixer": "^10.4.
|
|
64
|
+
"@web3icons/react": "^4.1.16",
|
|
65
|
+
"@web3icons/common": "^0.11.45",
|
|
66
|
+
"autoprefixer": "^10.4.24",
|
|
67
67
|
"clsx": "^2.1.1",
|
|
68
|
-
"framer-motion": "^12.29.
|
|
68
|
+
"framer-motion": "^12.29.2",
|
|
69
69
|
"postcss": "^8.5.6",
|
|
70
70
|
"postcss-cli": "^11.0.1",
|
|
71
|
-
"react": "^19.2.
|
|
71
|
+
"react": "^19.2.4",
|
|
72
72
|
"tailwindcss": "^4.1.18",
|
|
73
73
|
"tailwind-merge": "^3.4.0",
|
|
74
74
|
"tsup": "^8.5.1",
|