@tuwaio/nova-core 1.0.0-fix-ui-alpha.2.736b1a3 → 1.0.0-fix-docs-alpha.2.061e66e2
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 +71 -157
- package/dist/index.cjs +3 -3
- package/dist/index.css +34 -68
- package/dist/index.d.cts +12 -13
- package/dist/index.d.ts +12 -13
- package/dist/index.js +3 -3
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -1,227 +1,141 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @tuwaio/nova-core
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@tuwaio/nova-core)
|
|
4
4
|
[](./LICENSE)
|
|
5
|
-
[](https://github.com/TuwaIO/nova-uikit/actions)
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
`@tuwaio/nova-core` is the **UI Core (L6)** package of the TUWA Ecosystem design system. It acts as the shared foundation for styling primitives, CSS variable definitions, base React elements, and helper utilities. Fully independent of Web3 logic, it provides the common design boundaries consumed by visual modules like `@tuwaio/nova-connect` and `@tuwaio/nova-transactions` to maintain visual consistency across all TUWA interfaces.
|
|
8
7
|
|
|
9
8
|
---
|
|
10
9
|
|
|
11
|
-
##
|
|
10
|
+
## 🏛️ Core Capabilities
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
2. **Supplying Common Hooks:** A collection of reusable React hooks for common UI patterns.
|
|
19
|
-
3. **Ensuring Tailwind CSS v4 Integration:** Seamless compatibility with modern Tailwind CSS workflows.
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## ✨ Key Features
|
|
24
|
-
|
|
25
|
-
- **🎨 Complete Design Token System:** Comprehensive CSS variables for colors, spacing, typography, shadows, and animations
|
|
26
|
-
- **🛠️ Smart Utility Functions:** Advanced `cn` utility that merges Tailwind classes intelligently, preventing style conflicts
|
|
27
|
-
- **⚡ Tailwind CSS v4 Ready:** Full compatibility with modern Tailwind CSS workflows and arbitrary value usage
|
|
28
|
-
- **🌓 Dark Mode Support:** Built-in dark mode theming with CSS variable-based switching
|
|
29
|
-
- **♿ Accessibility First:** ARIA-compliant design tokens and utilities for building accessible interfaces
|
|
30
|
-
- **📱 Responsive Design:** Mobile-first breakpoints and responsive utility functions
|
|
12
|
+
- **🎨 Design Token System:** Declares variables for colors, typography, borders, animations, and spacing, with built-in switching for light and dark modes.
|
|
13
|
+
- **🛠️ Style Merger (`cn`):** An optimized composition utility blending `clsx` and `tailwind-merge` to resolve style overrides dynamically without class conflicts.
|
|
14
|
+
- **⚡ Tailwind CSS v4 Native:** Configured to map variables into Tailwind's modern engine, allowing arbitrary class declarations.
|
|
15
|
+
- **♿ Base Components & Primitives:** Shared layout modules, dialog nodes, overlays, and common utility indicators.
|
|
16
|
+
- **📱 Shared React Hooks:** Reusable, performance-optimized hooks for clipboards (`useCopyToClipboard`) and responsive layouts (`useMediaQuery`).
|
|
31
17
|
|
|
32
18
|
---
|
|
33
19
|
|
|
34
20
|
## 💾 Installation
|
|
35
21
|
|
|
36
|
-
### Requirements
|
|
37
|
-
|
|
38
|
-
- **React:** 19+
|
|
39
|
-
- **Node.js:** 20-24
|
|
40
|
-
- **TypeScript:** 5.9+ (recommended)
|
|
41
|
-
|
|
42
|
-
### Package Installation
|
|
43
|
-
|
|
44
|
-
Install the package using your preferred package manager:
|
|
45
|
-
|
|
46
22
|
```bash
|
|
47
|
-
# Using pnpm (recommended), but you can use npm, yarn or bun as well
|
|
48
23
|
pnpm add @tuwaio/nova-core
|
|
49
24
|
```
|
|
50
25
|
|
|
51
26
|
### CSS Setup
|
|
52
27
|
|
|
53
|
-
|
|
28
|
+
Import the core CSS styles into the entrypoint of your application (e.g., `main.css` or `globals.css`):
|
|
54
29
|
|
|
55
30
|
```css
|
|
56
|
-
/* src/styles/globals.css or src/styles/app.css */
|
|
57
31
|
@import '@tuwaio/nova-core/dist/index.css';
|
|
58
32
|
```
|
|
59
33
|
|
|
60
34
|
---
|
|
61
35
|
|
|
62
|
-
## 🚀 Usage
|
|
36
|
+
## 🚀 Usage Guide
|
|
63
37
|
|
|
64
|
-
###
|
|
38
|
+
### 1. Tailwind Arbitrary Tokens
|
|
65
39
|
|
|
66
|
-
Nova
|
|
40
|
+
Use Nova custom variables directly in components for consistent styling:
|
|
67
41
|
|
|
68
42
|
```tsx
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
</
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
hover:bg-[var(--tuwa-bg-muted)]
|
|
79
|
-
transition-colors
|
|
80
|
-
">
|
|
81
|
-
Card Content
|
|
82
|
-
</div>
|
|
43
|
+
export function AccentCard() {
|
|
44
|
+
return (
|
|
45
|
+
<div className="p-6 bg-[var(--tuwa-bg-secondary)] border border-[var(--tuwa-border-primary)] rounded-[var(--tuwa-rounded-corners)]">
|
|
46
|
+
<h3 className="text-[var(--tuwa-text-primary)] font-medium">Core Primitive Card</h3>
|
|
47
|
+
<p className="mt-2 text-[var(--tuwa-text-secondary)] text-sm">Styled using central ecosystem design tokens.</p>
|
|
48
|
+
<button className="mt-4 px-4 py-2 bg-[var(--tuwa-text-accent)] text-[var(--tuwa-text-on-accent)]">Action</button>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
83
52
|
```
|
|
84
53
|
|
|
85
|
-
###
|
|
54
|
+
### 2. Styling Composition (`cn`)
|
|
86
55
|
|
|
87
|
-
|
|
56
|
+
Blend default styles with external prop overrides cleanly:
|
|
88
57
|
|
|
89
58
|
```tsx
|
|
90
59
|
import { cn } from '@tuwaio/nova-core';
|
|
91
60
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
61
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
62
|
+
variant?: 'primary' | 'secondary';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function Button({ variant = 'primary', className, ...props }: ButtonProps) {
|
|
66
|
+
return (
|
|
67
|
+
<button
|
|
68
|
+
className={cn(
|
|
69
|
+
'px-4 py-2 font-medium rounded transition-colors',
|
|
70
|
+
variant === 'primary'
|
|
71
|
+
? 'bg-[var(--tuwa-text-accent)] text-[var(--tuwa-text-on-accent)]'
|
|
72
|
+
: 'bg-[var(--tuwa-standart-button-bg)] text-[var(--tuwa-text-primary)] hover:bg-[var(--tuwa-standart-button-hover)]',
|
|
73
|
+
className,
|
|
74
|
+
)}
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
106
79
|
```
|
|
107
80
|
|
|
108
|
-
###
|
|
81
|
+
### 3. Clipboard copy with `useCopyToClipboard`
|
|
109
82
|
|
|
110
|
-
|
|
83
|
+
Easily build wallet address display nodes with copying feedback:
|
|
111
84
|
|
|
112
85
|
```tsx
|
|
113
|
-
import {
|
|
86
|
+
import { useCopyToClipboard } from '@tuwaio/nova-core';
|
|
114
87
|
|
|
115
|
-
function
|
|
88
|
+
export function AddressDisplay({ address }: { address: string }) {
|
|
116
89
|
const [copied, copy] = useCopyToClipboard();
|
|
117
90
|
|
|
118
91
|
return (
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
92
|
+
<button
|
|
93
|
+
onClick={() => copy(address)}
|
|
94
|
+
className="font-mono text-xs text-[var(--tuwa-text-secondary)] hover:text-[var(--tuwa-text-accent)]"
|
|
95
|
+
>
|
|
96
|
+
{address.slice(0, 6)}...{address.slice(-4)}
|
|
97
|
+
{copied ? ' (Copied ✓)' : ' (Copy)'}
|
|
98
|
+
</button>
|
|
125
99
|
);
|
|
126
100
|
}
|
|
127
101
|
```
|
|
128
102
|
|
|
129
103
|
---
|
|
130
104
|
|
|
131
|
-
##
|
|
132
|
-
|
|
133
|
-
### Basic Customization
|
|
105
|
+
## 🎨 Theme Customization
|
|
134
106
|
|
|
135
|
-
Override
|
|
107
|
+
Override default tokens in your global CSS stylesheet to match your brand:
|
|
136
108
|
|
|
137
109
|
```css
|
|
138
|
-
/* src/styles/globals.css */
|
|
139
|
-
@import '@tuwaio/nova-core/dist/index.css';
|
|
140
|
-
|
|
141
|
-
/* Your custom theme overrides */
|
|
142
110
|
:root {
|
|
143
|
-
/*
|
|
144
|
-
--tuwa-text-
|
|
145
|
-
--tuwa-text-secondary: #64748b;
|
|
146
|
-
--tuwa-text-tertiary: #94a3b8;
|
|
147
|
-
--tuwa-text-accent: #3b82f6;
|
|
111
|
+
/* Customize Brand Accent Colors */
|
|
112
|
+
--tuwa-text-accent: #10b981; /* Emerald-500 */
|
|
148
113
|
--tuwa-text-on-accent: #ffffff;
|
|
149
|
-
|
|
150
|
-
/* Background System */
|
|
151
|
-
--tuwa-bg-primary: #ffffff;
|
|
152
|
-
--tuwa-bg-secondary: #f8fafc;
|
|
153
|
-
--tuwa-bg-muted: #f1f5f9;
|
|
154
|
-
|
|
155
|
-
/* Border System */
|
|
156
|
-
--tuwa-border-primary: #e2e8f0;
|
|
157
|
-
--tuwa-border-secondary: #cbd5e1;
|
|
114
|
+
--tuwa-rounded-corners: 8px;
|
|
158
115
|
}
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### Dark Mode Support
|
|
162
116
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
```css
|
|
166
|
-
/* Dark mode overrides */
|
|
117
|
+
/* Customize Dark Mode styling */
|
|
167
118
|
.dark {
|
|
168
|
-
--tuwa-
|
|
169
|
-
--tuwa-
|
|
170
|
-
--tuwa-
|
|
171
|
-
--tuwa-bg-primary: #0f172a;
|
|
172
|
-
--tuwa-bg-secondary: #1e293b;
|
|
173
|
-
--tuwa-bg-muted: #334155;
|
|
174
|
-
--tuwa-border-primary: #374151;
|
|
119
|
+
--tuwa-bg-primary: #050505;
|
|
120
|
+
--tuwa-bg-secondary: #121212;
|
|
121
|
+
--tuwa-border-primary: #222222;
|
|
175
122
|
}
|
|
176
123
|
```
|
|
177
124
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
#### Component Integration
|
|
181
|
-
|
|
182
|
-
Nova Core works seamlessly with other Nova packages:
|
|
183
|
-
|
|
184
|
-
```tsx
|
|
185
|
-
import { cn } from '@tuwaio/nova-core';
|
|
186
|
-
import { ConnectButton } from '@tuwaio/nova-connect/components';
|
|
187
|
-
import { NovaTransactionsProvider } from '@tuwaio/nova-transactions';
|
|
188
|
-
|
|
189
|
-
function App() {
|
|
190
|
-
return (
|
|
191
|
-
<div className={cn('min-h-screen', 'bg-[var(--tuwa-bg-primary)]', 'text-[var(--tuwa-text-primary)]')}>
|
|
192
|
-
<NovaTransactionsProvider {...params} />
|
|
193
|
-
<header className="border-b border-[var(--tuwa-border-primary)]">
|
|
194
|
-
<ConnectButton />
|
|
195
|
-
</header>
|
|
196
|
-
<main>{/* Your app content */}</main>
|
|
197
|
-
</div>
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### API Reference
|
|
203
|
-
|
|
204
|
-
#### Utilities
|
|
205
|
-
|
|
206
|
-
| Function | Description | Usage |
|
|
207
|
-
| :------------------- | :------------------------------------------------------------- | :--------------------------------------------------- |
|
|
208
|
-
| **`cn(...classes)`** | Merges class names intelligently, resolving Tailwind conflicts | `cn('p-4 text-sm', 'p-6', {'hidden': conditional})` |
|
|
209
|
-
|
|
210
|
-
#### Hooks
|
|
211
|
-
|
|
212
|
-
| Hook | Description | Return Type |
|
|
213
|
-
| :------------------------- | :----------------------------------- | :---------------------------------- |
|
|
214
|
-
| **`useCopyToClipboard()`** | Copy text to clipboard with feedback | `[boolean, (text: string) => void]` |
|
|
215
|
-
| **`useMediaQuery(query)`** | Responsive media query hook | `boolean` |
|
|
125
|
+
---
|
|
216
126
|
|
|
217
|
-
##
|
|
127
|
+
## 🔧 API & Module Architecture
|
|
218
128
|
|
|
219
|
-
|
|
129
|
+
`@tuwaio/nova-core` exports the following modules and functions:
|
|
220
130
|
|
|
221
|
-
|
|
131
|
+
- **Style Composition:** `cn`.
|
|
132
|
+
- **React Hooks:** `useCopyToClipboard`, `useMediaQuery`.
|
|
133
|
+
- **UI Dialog Primitives:** `Dialog`, `DialogOverlay`, `DialogContent`, `DialogHeader`, `DialogTitle`, `DialogDescription`, `DialogFooter`.
|
|
134
|
+
- **Utility Indicators:** `StarsBackground`, `FallbackIcon`, `GithubFallbackIcon`, `ChevronArrowWithAnim`, `ToastCloseButton`, `ToastValidationError`, `NetworkIcon`, `WalletIcon`.
|
|
135
|
+
- **Formatters:** `deepMerge`, `svgToBase64`, `isTouchDevice`, `textCenterEllipsis`, `resolveCssVariable`.
|
|
222
136
|
|
|
223
|
-
|
|
137
|
+
---
|
|
224
138
|
|
|
225
139
|
## 📄 License
|
|
226
140
|
|
|
227
|
-
|
|
141
|
+
Licensed under the **Apache-2.0 License**. See the [LICENSE](./LICENSE) file for details.
|
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'),d=require('react'),l=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 d__namespace=/*#__PURE__*/_interopNamespace(d);var l__namespace=/*#__PURE__*/_interopNamespace(l);var Oo="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 J(o,e){let t={...o};return y(o)&&y(e)&&Object.keys(e).forEach(n=>{let r=o[n],a=e[n];y(r)&&y(a)?t[n]=J(r,a):t[n]=a;}),t}function h(o){if(typeof o!="string")return false;let e=o.toLowerCase();return e.includes("solana")&&(e.includes("devnet")||e.includes("testnet"))}var R="Unknown";function Z(o){return o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}function z(o){let e={name:R,id:R.toLowerCase(),filePath:R.toLowerCase(),chainId:o};if(typeof o=="number"){let i=metadata.networks.find(c=>c.chainId===o);return i?{name:i.name,id:i.id,filePath:i.filePath?.split(":")[1],chainId:o}:e}let[t,n]=o?o.split(":"):[o],r=metadata.networks.find(i=>i.id===t);return r?{name:n&&h(o)?`${r.name} ${Z(n)}`:r.name,id:r.id,filePath:r.filePath?.split(":")[1],chainId:o}:e}function F(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 r=e||t||n,a=window.innerWidth<=o;return r&&a}function oo(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 eo(o,e){let t=oo(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 x(o,e){let t=o;return e&&(t=eo(t,e)),`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(t)))}`}var N=o=>`${o.replace(/\s+/g,"-").toLowerCase()}.svg`;function oe(o,e,t){if(!o)return "";if(o.length<=e+t)return o;let n=o.slice(0,e),r=o.slice(o.length-t);return `${n}...${r}`}function pe({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 ro=d__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"})]}));ro.displayName="CloseIcon";var ao="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)]",f=({animate:o=false,content:e="",className:t})=>jsxRuntime.jsx("div",{className:s(ao,"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:n=>n.preventDefault(),style:{outline:"none",pointerEvents:"none"}})}var lo="https://raw.githubusercontent.com/0xa3k5/web3icons/refs/heads/main/raw-svgs",H=new Map;function C({githubSrc:o,className:e,alt:t,firstPathFill:n,...r}){let[a,i]=d.useState(null),[c,m]=d.useState("idle");return d.useEffect(()=>{let v=true,b=`${o}|${n??""}`,I=H.get(b);if(I){i(I),m("success");return}return (async()=>{m("loading");try{let D=await fetch(`${lo}/${o}`);if(!D.ok)throw new Error(`Failed to load icon: ${D.status}`);let Q=await D.text();if(v){let A=x(Q,n);H.set(b,A),i(A),m("success");}}catch{v&&m("error");}})(),()=>{v=false;}},[o,n]),c==="loading"||c==="idle"?jsxRuntime.jsx(f,{animate:true,className:e}):c==="success"&&a?jsxRuntime.jsx(k,{...r,src:a,alt:t,className:e}):jsxRuntime.jsx(f,{content:"?",className:e})}var Ae=l__namespace.Root,Ve=l__namespace.Trigger,mo=l__namespace.Portal,ze=l__namespace.Close,uo={initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,transition:{duration:.2}}},po={initial:{opacity:0,y:"100%"},animate:{opacity:1,y:"0%"},exit:{opacity:0,y:"100%",transition:{duration:.2}}},fo={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},U=({className:o,backdropAnimation:e})=>(d__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??fo,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)})})}));U.displayName=l__namespace.Overlay.displayName;var vo=d__namespace.forwardRef(({className:o,children:e,modalAnimation:t,backdropAnimation:n,...r},a)=>{let[i,c]=d__namespace.useState(false);d__namespace.useEffect(()=>{c(F());},[]);let m=t??(i?po:uo);return jsxRuntime.jsxs(mo,{children:[jsxRuntime.jsx(U,{backdropAnimation:n}),jsxRuntime.jsx(l__namespace.Content,{"aria-describedby":"tuwa:modal-content",ref:a,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})})})})})]})});vo.displayName=l__namespace.Content.displayName;var go=({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});go.displayName="DialogHeader";var wo=({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});wo.displayName="DialogFooter";var bo=d__namespace.forwardRef(({className:o,...e},t)=>jsxRuntime.jsx(l__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}));bo.displayName=l__namespace.Title.displayName;var yo=d__namespace.forwardRef(({className:o,...e},t)=>jsxRuntime.jsx(l__namespace.Description,{"aria-describedby":"tuwa:modal-description",ref:t,className:s("novacore:text-sm novacore:text-[var(--tuwa-text-secondary)]",o),...e}));yo.displayName=l__namespace.Description.displayName;function w({children:o,iconId:e,alt:t,firstPathFill:n,...r}){let[a,i]=d.useState(null),c=d.useCallback(m=>{if(m){let v=x(m.outerHTML,n);i({id:e,src:v});}},[e,n]);return a&&a.id===e?jsxRuntime.jsx(k,{...r,src:a.src,alt:t}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:o(c)})}var q=d.lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.NetworkIcon}))),Po="var(--tuwa-testnet-icons)";function je({chainId:o,variant:e="background",className:t}){let n=z(o),r=typeof o=="string",a=r?o.split(":")[0].toLowerCase():o,c=r&&h(o)||n.name.toLowerCase().includes("testnet")?Po:void 0,m=s("novacore:w-full novacore:h-full novacore:rounded-full",t),v=typeof a=="string"?a:n.filePath,b=`networks/${e}/${N(v)}`;return n.name==="Unknown"?typeof o=="number"?jsxRuntime.jsx(f,{content:"?",className:t}):jsxRuntime.jsx(C,{githubSrc:b,className:m,firstPathFill:c}):jsxRuntime.jsx(d.Suspense,{fallback:jsxRuntime.jsx(f,{animate:true,className:t}),children:jsxRuntime.jsx(w,{iconId:`${o}-${e}`,className:m,firstPathFill:c,children:T=>typeof a=="string"?jsxRuntime.jsx(q,{ref:T,id:a,variant:e}):jsxRuntime.jsx(q,{ref:T,chainId:a,variant:e})})})}function et({starsCount:o}){let[e,t]=d.useState(false);d.useEffect(()=>t(true),[]);let n=d.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'),d=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 d__namespace=/*#__PURE__*/_interopNamespace(d);var c__namespace=/*#__PURE__*/_interopNamespace(c);var _o="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 Z(o,e){let t={...o};return y(o)&&y(e)&&Object.keys(e).forEach(n=>{let r=o[n],a=e[n];y(r)&&y(a)?t[n]=Z(r,a):t[n]=a;}),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 M="Unknown";function oo(o){return o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}function W(o){let e={name:M,id:M.toLowerCase(),filePath:M.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,n]=o?o.split(":"):[o],r=metadata.networks.find(i=>i.id===t);return r?{name:n&&x(o)?`${r.name} ${oo(n)}`:r.name,id:r.id,filePath:r.filePath?.split(":")[1],chainId:o}:e}function G(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 r=e||t||n,a=window.innerWidth<=o;return r&&a}function eo(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 to(o,e){let t=eo(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=to(t,e)),`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(t)))}`}var S=o=>`${o.replace(/\s+/g,"-").toLowerCase()}.svg`;function te(o,e,t){if(!o)return "";if(o.length<=e+t)return o;let n=o.slice(0,e),r=o.slice(o.length-t);return `${n}...${r}`}function ve({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 no=d__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"})]}));no.displayName="CloseIcon";var io="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)]",f=({animate:o=false,content:e="",className:t})=>jsxRuntime.jsx("div",{className:s(io,"Nova_Web3_Icon",t,{"novacore:animate-pulse":o}),children:e});function C({src:o,alt:e,...t}){return jsxRuntime.jsx("img",{...t,src:o,alt:e??"",draggable:false,onDragStart:n=>n.preventDefault(),style:{outline:"none",pointerEvents:"none"}})}var mo="https://raw.githubusercontent.com/0xa3k5/web3icons/refs/heads/main/raw-svgs",L=new Map;function P({githubSrc:o,className:e,alt:t,firstPathFill:n,...r}){let a=`${o}|${n??""}`,i=L.get(a),[l,u]=d.useState(null),[w,b]=d.useState("idle"),T=i||l,g=i?"success":w;return d.useEffect(()=>{let D=true;return L.has(a)?void 0:((async()=>{b("loading");try{let R=await fetch(`${mo}/${o}`);if(!R.ok)throw new Error(`Failed to load icon: ${R.status}`);let X=await R.text();if(D){let V=N(X,n);L.set(a,V),u(V),b("success");}}catch{D&&b("error");}})(),()=>{D=false;})},[o,n,a]),g==="loading"||g==="idle"?jsxRuntime.jsx(f,{animate:true,className:e}):g==="success"&&T?jsxRuntime.jsx(C,{...r,src:T,alt:t,className:e}):jsxRuntime.jsx(f,{content:"?",className:e})}var Ve=c__namespace.Root,ze=c__namespace.Trigger,uo=c__namespace.Portal,We=c__namespace.Close,po={initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,transition:{duration:.2}}},fo={initial:{opacity:0,y:"100%"},animate:{opacity:1,y:"0%"},exit:{opacity:0,y:"100%",transition:{duration:.2}}},vo={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},Y=({className:o,backdropAnimation:e})=>(d__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??vo,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)})})}));Y.displayName=c__namespace.Overlay.displayName;var go=d__namespace.forwardRef(({className:o,children:e,modalAnimation:t,backdropAnimation:n,...r},a)=>{let[i,l]=d__namespace.useState(false);d__namespace.useEffect(()=>{l(G());},[]);let u=t??(i?fo:po);return jsxRuntime.jsxs(uo,{children:[jsxRuntime.jsx(Y,{backdropAnimation:n}),jsxRuntime.jsx(c__namespace.Content,{"aria-describedby":"tuwa:modal-content",ref:a,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:u,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})})})})})]})});go.displayName=c__namespace.Content.displayName;var wo=({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});wo.displayName="DialogHeader";var bo=({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});bo.displayName="DialogFooter";var ho=d__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}));ho.displayName=c__namespace.Title.displayName;var yo=d__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}));yo.displayName=c__namespace.Description.displayName;function h({children:o,iconId:e,alt:t,firstPathFill:n,...r}){let[a,i]=d.useState(null),l=d.useCallback(u=>{if(u){let w=N(u.outerHTML,n);i({id:e,src:w});}},[e,n]);return a&&a.id===e?jsxRuntime.jsx(C,{...r,src:a.src,alt:t}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:o(l)})}var K=d.lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.NetworkIcon}))),Io="var(--tuwa-testnet-icons)";function Ze({chainId:o,variant:e="background",className:t}){let n=W(o),r=typeof o=="string",a=r?o.split(":")[0].toLowerCase():o,l=r&&x(o)||n.name.toLowerCase().includes("testnet")?Io:void 0,u=s("novacore:w-full novacore:h-full novacore:rounded-full",t),w=typeof a=="string"?a:n.filePath,b=`networks/${e}/${S(w)}`;return n.name==="Unknown"?typeof o=="number"?jsxRuntime.jsx(f,{content:"?",className:t}):jsxRuntime.jsx(P,{githubSrc:b,className:u,firstPathFill:l}):jsxRuntime.jsx(d.Suspense,{fallback:jsxRuntime.jsx(f,{animate:true,className:t}),children:jsxRuntime.jsx(h,{iconId:`${o}-${e}`,className:u,firstPathFill:l,children:g=>typeof a=="string"?jsxRuntime.jsx(K,{ref:g,id:a,variant:e}):jsxRuntime.jsx(K,{ref:g,chainId:a,variant:e})})})}function rt({starsCount:o}){let[e,t]=d.useState(false);d.useEffect(()=>t(true),[]);let n=d.useMemo(()=>e?Array.from({length:o??200}).map(()=>({x:Math.random()*window.innerWidth,y:Math.random()*window.innerHeight,r:Math.random()*1+.5,isSupernova:Math.random()<.1,delay:Math.random()*10,duration:5+Math.random()*5})):[],[e]);return jsxRuntime.jsx("div",{className:"novacore:absolute novacore:inset-0 novacore:z-1 novacore:h-full novacore:w-full novacore:overflow-hidden",children:jsxRuntime.jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("style",{children:`
|
|
2
2
|
/* Pulse animation now includes scale for a more organic feel. */
|
|
3
3
|
@keyframes pulse {
|
|
4
4
|
0%, 100% {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
transform-origin: center;
|
|
45
45
|
stroke-width: 2;
|
|
46
46
|
}
|
|
47
|
-
`})}),n.map((r,a)=>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`}},a))]})})}function
|
|
48
|
-
exports.ChevronArrowWithAnim=
|
|
47
|
+
`})}),n.map((r,a)=>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`}},a))]})})}function st({closeToast:o,ariaLabel:e="Close toast notification",title:t="Close toast notification",className:n,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)]",n),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 Fo=d.lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.WalletIcon}))),Vo={walletconnect:"wallet-connect"};function zo(o){return metadata.wallets.some(e=>e.id===o||e.name?.toLowerCase()===o)}var Wo=({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 gt({walletName:o,variant:e="background",className:t}){let n=s("novacore:w-full novacore:h-full novacore:rounded-full",t),r=o.toLowerCase();if(r==="impersonatedwallet")return jsxRuntime.jsx(h,{iconId:"impersonatedwallet",className:n,children:l=>jsxRuntime.jsx(Wo,{ref:l})});let a=Vo[r]??r,i=`wallets/${e}/${S(a)}`;return zo(a)?jsxRuntime.jsx(d.Suspense,{fallback:jsxRuntime.jsx(f,{animate:true,className:t}),children:jsxRuntime.jsx(h,{iconId:`${a}-${e}`,className:n,children:l=>jsxRuntime.jsx(Fo,{ref:l,id:a,variant:e})})}):jsxRuntime.jsx(P,{githubSrc:i,className:n})}function yt(o=2e3){let[e,t]=d.useState(false),[n,r]=d.useState(null),a=d.useCallback(async i=>{if(i)try{await navigator.clipboard.writeText(i),t(!0),r(null),setTimeout(()=>t(!1),o);}catch(l){let u=l instanceof Error?l:new Error("Failed to copy text.");console.error(u),r(u),setTimeout(()=>r(null),o);}},[o]);return {isCopied:e,copy:a,error:n}}function St(o){let e=r=>typeof window<"u"?window.matchMedia(r).matches:false,[t,n]=d.useState(e(o));return d.useEffect(()=>{let r=window.matchMedia(o),a=()=>n(r.matches);return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[o]),t}
|
|
48
|
+
exports.ChevronArrowWithAnim=ve;exports.CloseIcon=no;exports.Dialog=Ve;exports.DialogClose=We;exports.DialogContent=go;exports.DialogDescription=yo;exports.DialogFooter=bo;exports.DialogHeader=wo;exports.DialogOverlay=Y;exports.DialogPortal=uo;exports.DialogTitle=ho;exports.DialogTrigger=ze;exports.FallbackIcon=f;exports.GithubFallbackIcon=P;exports.NetworkIcon=Ze;exports.StarsBackground=rt;exports.SvgImg=C;exports.SvgToImg=h;exports.ToastCloseButton=st;exports.WalletIcon=gt;exports.applyFirstPathFill=to;exports.cn=s;exports.deepMerge=Z;exports.formatIconNameForGithub=S;exports.getChainName=W;exports.isSolanaDev=x;exports.isTouchDevice=G;exports.resolveCssVariable=eo;exports.standardButtonClasses=_o;exports.svgToBase64=N;exports.textCenterEllipsis=te;exports.useCopyToClipboard=yt;exports.useMediaQuery=St;
|
package/dist/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
position: sticky;
|
|
33
33
|
}
|
|
34
34
|
.novacore\:inset-0 {
|
|
35
|
-
inset:
|
|
35
|
+
inset: 0px;
|
|
36
36
|
}
|
|
37
37
|
.novacore\:top-0 {
|
|
38
|
-
top:
|
|
38
|
+
top: 0px;
|
|
39
39
|
}
|
|
40
40
|
.novacore\:top-2 {
|
|
41
41
|
top: calc(var(--novacore-spacing) * 2);
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
right: calc(var(--novacore-spacing) * 2);
|
|
45
45
|
}
|
|
46
46
|
.novacore\:bottom-0 {
|
|
47
|
-
bottom:
|
|
47
|
+
bottom: 0px;
|
|
48
48
|
}
|
|
49
49
|
.novacore\:left-0 {
|
|
50
|
-
left:
|
|
50
|
+
left: 0px;
|
|
51
51
|
}
|
|
52
52
|
.novacore\:z-1 {
|
|
53
53
|
z-index: 1;
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
z-index: 50;
|
|
60
60
|
}
|
|
61
61
|
.novacore\:m-0 {
|
|
62
|
-
margin:
|
|
62
|
+
margin: 0px;
|
|
63
63
|
}
|
|
64
64
|
.novacore\:flex {
|
|
65
65
|
display: flex;
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
justify-content: center;
|
|
111
111
|
}
|
|
112
112
|
.novacore\:gap-1 {
|
|
113
|
-
gap:
|
|
113
|
+
gap: var(--novacore-spacing);
|
|
114
114
|
}
|
|
115
115
|
.novacore\:gap-3 {
|
|
116
116
|
gap: calc(var(--novacore-spacing) * 3);
|
|
@@ -158,10 +158,10 @@
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
.novacore\:p-0 {
|
|
161
|
-
padding:
|
|
161
|
+
padding: 0px;
|
|
162
162
|
}
|
|
163
163
|
.novacore\:p-1 {
|
|
164
|
-
padding:
|
|
164
|
+
padding: var(--novacore-spacing);
|
|
165
165
|
}
|
|
166
166
|
.novacore\:p-4 {
|
|
167
167
|
padding: calc(var(--novacore-spacing) * 4);
|
|
@@ -222,90 +222,56 @@
|
|
|
222
222
|
--tw-outline-style: none;
|
|
223
223
|
outline-style: none;
|
|
224
224
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
background-color: var(--tuwa-bg-muted);
|
|
229
|
-
}
|
|
225
|
+
@media (hover: hover) {
|
|
226
|
+
.novacore\:hover\:bg-\[var\(--tuwa-bg-muted\)\]:hover {
|
|
227
|
+
background-color: var(--tuwa-bg-muted);
|
|
230
228
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
&:hover {
|
|
234
|
-
@media (hover: hover) {
|
|
235
|
-
background-color: var(--tuwa-standart-button-hover);
|
|
236
|
-
}
|
|
229
|
+
.novacore\:hover\:bg-\[var\(--tuwa-standart-button-hover\)\]:hover {
|
|
230
|
+
background-color: var(--tuwa-standart-button-hover);
|
|
237
231
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
&:hover {
|
|
241
|
-
@media (hover: hover) {
|
|
242
|
-
color: var(--tuwa-text-primary);
|
|
243
|
-
}
|
|
232
|
+
.novacore\:hover\:text-\[var\(--tuwa-text-primary\)\]:hover {
|
|
233
|
+
color: var(--tuwa-text-primary);
|
|
244
234
|
}
|
|
245
235
|
}
|
|
246
|
-
.novacore\:disabled\:cursor-not-allowed {
|
|
247
|
-
|
|
248
|
-
cursor: not-allowed;
|
|
249
|
-
}
|
|
236
|
+
.novacore\:disabled\:cursor-not-allowed:disabled {
|
|
237
|
+
cursor: not-allowed;
|
|
250
238
|
}
|
|
251
|
-
.novacore\:disabled\:opacity-50 {
|
|
252
|
-
|
|
253
|
-
opacity: 50%;
|
|
254
|
-
}
|
|
239
|
+
.novacore\:disabled\:opacity-50:disabled {
|
|
240
|
+
opacity: 50%;
|
|
255
241
|
}
|
|
256
|
-
|
|
257
|
-
|
|
242
|
+
@media (width >= 40rem) {
|
|
243
|
+
.novacore\:sm\:top-\[50\%\] {
|
|
258
244
|
top: 50%;
|
|
259
245
|
}
|
|
260
|
-
|
|
261
|
-
.novacore\:sm\:bottom-auto {
|
|
262
|
-
@media (width >= 40rem) {
|
|
246
|
+
.novacore\:sm\:bottom-auto {
|
|
263
247
|
bottom: auto;
|
|
264
248
|
}
|
|
265
|
-
|
|
266
|
-
.novacore\:sm\:left-\[50\%\] {
|
|
267
|
-
@media (width >= 40rem) {
|
|
249
|
+
.novacore\:sm\:left-\[50\%\] {
|
|
268
250
|
left: 50%;
|
|
269
251
|
}
|
|
270
|
-
|
|
271
|
-
.novacore\:sm\:translate-x-\[-50\%\] {
|
|
272
|
-
@media (width >= 40rem) {
|
|
252
|
+
.novacore\:sm\:translate-x-\[-50\%\] {
|
|
273
253
|
--tw-translate-x: -50%;
|
|
274
254
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
275
255
|
}
|
|
276
|
-
|
|
277
|
-
.novacore\:sm\:translate-y-\[-50\%\] {
|
|
278
|
-
@media (width >= 40rem) {
|
|
256
|
+
.novacore\:sm\:translate-y-\[-50\%\] {
|
|
279
257
|
--tw-translate-y: -50%;
|
|
280
258
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
281
259
|
}
|
|
282
|
-
|
|
283
|
-
.novacore\:sm\:flex-row {
|
|
284
|
-
@media (width >= 40rem) {
|
|
260
|
+
.novacore\:sm\:flex-row {
|
|
285
261
|
flex-direction: row;
|
|
286
262
|
}
|
|
287
|
-
|
|
288
|
-
.novacore\:sm\:justify-end {
|
|
289
|
-
@media (width >= 40rem) {
|
|
263
|
+
.novacore\:sm\:justify-end {
|
|
290
264
|
justify-content: flex-end;
|
|
291
265
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
:
|
|
296
|
-
--tw-space-x-reverse: 0;
|
|
297
|
-
margin-inline-start: calc(calc(var(--novacore-spacing) * 2) * var(--tw-space-x-reverse));
|
|
298
|
-
margin-inline-end: calc(calc(var(--novacore-spacing) * 2) * calc(1 - var(--tw-space-x-reverse)));
|
|
299
|
-
}
|
|
266
|
+
:where(.novacore\:sm\:space-x-2 > :not(:last-child)) {
|
|
267
|
+
--tw-space-x-reverse: 0;
|
|
268
|
+
margin-inline-start: calc(calc(var(--novacore-spacing) * 2) * var(--tw-space-x-reverse));
|
|
269
|
+
margin-inline-end: calc(calc(var(--novacore-spacing) * 2) * calc(1 - var(--tw-space-x-reverse)));
|
|
300
270
|
}
|
|
301
|
-
|
|
302
|
-
.novacore\:sm\:rounded-\[var\(--tuwa-rounded-corners\)\] {
|
|
303
|
-
@media (width >= 40rem) {
|
|
271
|
+
.novacore\:sm\:rounded-\[var\(--tuwa-rounded-corners\)\] {
|
|
304
272
|
border-radius: var(--tuwa-rounded-corners);
|
|
305
273
|
}
|
|
306
|
-
|
|
307
|
-
.novacore\:sm\:p-4 {
|
|
308
|
-
@media (width >= 40rem) {
|
|
274
|
+
.novacore\:sm\:p-4 {
|
|
309
275
|
padding: calc(var(--novacore-spacing) * 4);
|
|
310
276
|
}
|
|
311
277
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React$1 from 'react';
|
|
3
2
|
import { ComponentProps, ReactNode } from 'react';
|
|
4
3
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
@@ -9,7 +8,7 @@ declare function ChevronArrowWithAnim({ className, strokeWidth, isOpen, }: {
|
|
|
9
8
|
className?: string;
|
|
10
9
|
strokeWidth?: number;
|
|
11
10
|
isOpen?: boolean;
|
|
12
|
-
}):
|
|
11
|
+
}): React$1.JSX.Element;
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* A reusable close button icon (X mark) styled with TUWA color scheme.
|
|
@@ -42,7 +41,7 @@ interface FallbackIconProps {
|
|
|
42
41
|
* @param props - {@link FallbackIconProps}
|
|
43
42
|
* @returns The rendered fallback element.
|
|
44
43
|
*/
|
|
45
|
-
declare const FallbackIcon: ({ animate, content, className }: FallbackIconProps) =>
|
|
44
|
+
declare const FallbackIcon: ({ animate, content, className }: FallbackIconProps) => React$1.JSX.Element;
|
|
46
45
|
|
|
47
46
|
/**
|
|
48
47
|
* Props for the GithubFallbackIcon component.
|
|
@@ -68,7 +67,7 @@ interface GithubFallbackIconProps extends Omit<ComponentProps<'img'>, 'src'> {
|
|
|
68
67
|
* @param props - {@link GithubFallbackIconProps}
|
|
69
68
|
* @returns Loading indicator, the fetched icon, or an error fallback
|
|
70
69
|
*/
|
|
71
|
-
declare function GithubFallbackIcon({ githubSrc, className, alt, firstPathFill, ...props }: GithubFallbackIconProps):
|
|
70
|
+
declare function GithubFallbackIcon({ githubSrc, className, alt, firstPathFill, ...props }: GithubFallbackIconProps): React$1.JSX.Element;
|
|
72
71
|
|
|
73
72
|
declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
|
|
74
73
|
declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
@@ -78,7 +77,7 @@ declare const DialogOverlay: {
|
|
|
78
77
|
({ className, backdropAnimation }: {
|
|
79
78
|
backdropAnimation?: Variants;
|
|
80
79
|
className?: string;
|
|
81
|
-
}):
|
|
80
|
+
}): React$1.JSX.Element;
|
|
82
81
|
displayName: string | undefined;
|
|
83
82
|
};
|
|
84
83
|
declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
@@ -86,11 +85,11 @@ declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimit
|
|
|
86
85
|
backdropAnimation?: Variants;
|
|
87
86
|
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
88
87
|
declare const DialogHeader: {
|
|
89
|
-
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>):
|
|
88
|
+
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
90
89
|
displayName: string;
|
|
91
90
|
};
|
|
92
91
|
declare const DialogFooter: {
|
|
93
|
-
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>):
|
|
92
|
+
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
94
93
|
displayName: string;
|
|
95
94
|
};
|
|
96
95
|
declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -101,11 +100,11 @@ interface NetworkIconProps {
|
|
|
101
100
|
variant?: 'background' | 'branded' | 'mono';
|
|
102
101
|
className?: string;
|
|
103
102
|
}
|
|
104
|
-
declare function NetworkIcon({ chainId, variant, className }: NetworkIconProps):
|
|
103
|
+
declare function NetworkIcon({ chainId, variant, className }: NetworkIconProps): React$1.JSX.Element;
|
|
105
104
|
|
|
106
105
|
declare function StarsBackground({ starsCount }: {
|
|
107
106
|
starsCount?: number;
|
|
108
|
-
}):
|
|
107
|
+
}): React$1.JSX.Element;
|
|
109
108
|
|
|
110
109
|
/**
|
|
111
110
|
* Props for the SvgImg component.
|
|
@@ -121,7 +120,7 @@ interface SvgImgProps extends Omit<ComponentProps<'img'>, 'src' | 'draggable'> {
|
|
|
121
120
|
*
|
|
122
121
|
* @param props - {@link SvgImgProps}
|
|
123
122
|
*/
|
|
124
|
-
declare function SvgImg({ src, alt, ...props }: SvgImgProps):
|
|
123
|
+
declare function SvgImg({ src, alt, ...props }: SvgImgProps): React$1.JSX.Element;
|
|
125
124
|
|
|
126
125
|
/**
|
|
127
126
|
* Props for the SvgToImg component.
|
|
@@ -160,7 +159,7 @@ interface SvgToImgProps extends Omit<ComponentProps<'img'>, 'ref' | 'src' | 'chi
|
|
|
160
159
|
* </SvgToImg>
|
|
161
160
|
* ```
|
|
162
161
|
*/
|
|
163
|
-
declare function SvgToImg({ children, iconId, alt, firstPathFill, ...props }: SvgToImgProps):
|
|
162
|
+
declare function SvgToImg({ children, iconId, alt, firstPathFill, ...props }: SvgToImgProps): React$1.JSX.Element;
|
|
164
163
|
|
|
165
164
|
/**
|
|
166
165
|
* @file This file contains a reusable close button component, designed primarily for toast notifications.
|
|
@@ -195,7 +194,7 @@ type ToastCloseButtonProps = {
|
|
|
195
194
|
* A simple, styled close button component ('X' icon) intended for use within toast notifications.
|
|
196
195
|
* It uses theme-aware CSS variables for styling and i18n labels for accessibility.
|
|
197
196
|
*/
|
|
198
|
-
declare function ToastCloseButton({ closeToast, ariaLabel, title, className, iconClassName, }: ToastCloseButtonProps):
|
|
197
|
+
declare function ToastCloseButton({ closeToast, ariaLabel, title, className, iconClassName, }: ToastCloseButtonProps): React$1.JSX.Element;
|
|
199
198
|
|
|
200
199
|
/**
|
|
201
200
|
* Props for the WalletIcon component.
|
|
@@ -225,7 +224,7 @@ interface WalletIconProps {
|
|
|
225
224
|
* @param props - {@link WalletIconProps}
|
|
226
225
|
* @returns The wallet icon or a fallback UI.
|
|
227
226
|
*/
|
|
228
|
-
declare function WalletIcon({ walletName, variant, className }: WalletIconProps):
|
|
227
|
+
declare function WalletIcon({ walletName, variant, className }: WalletIconProps): React$1.JSX.Element;
|
|
229
228
|
|
|
230
229
|
/**
|
|
231
230
|
* @file This file contains a custom React hook for copying text to the clipboard.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React$1 from 'react';
|
|
3
2
|
import { ComponentProps, ReactNode } from 'react';
|
|
4
3
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
@@ -9,7 +8,7 @@ declare function ChevronArrowWithAnim({ className, strokeWidth, isOpen, }: {
|
|
|
9
8
|
className?: string;
|
|
10
9
|
strokeWidth?: number;
|
|
11
10
|
isOpen?: boolean;
|
|
12
|
-
}):
|
|
11
|
+
}): React$1.JSX.Element;
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* A reusable close button icon (X mark) styled with TUWA color scheme.
|
|
@@ -42,7 +41,7 @@ interface FallbackIconProps {
|
|
|
42
41
|
* @param props - {@link FallbackIconProps}
|
|
43
42
|
* @returns The rendered fallback element.
|
|
44
43
|
*/
|
|
45
|
-
declare const FallbackIcon: ({ animate, content, className }: FallbackIconProps) =>
|
|
44
|
+
declare const FallbackIcon: ({ animate, content, className }: FallbackIconProps) => React$1.JSX.Element;
|
|
46
45
|
|
|
47
46
|
/**
|
|
48
47
|
* Props for the GithubFallbackIcon component.
|
|
@@ -68,7 +67,7 @@ interface GithubFallbackIconProps extends Omit<ComponentProps<'img'>, 'src'> {
|
|
|
68
67
|
* @param props - {@link GithubFallbackIconProps}
|
|
69
68
|
* @returns Loading indicator, the fetched icon, or an error fallback
|
|
70
69
|
*/
|
|
71
|
-
declare function GithubFallbackIcon({ githubSrc, className, alt, firstPathFill, ...props }: GithubFallbackIconProps):
|
|
70
|
+
declare function GithubFallbackIcon({ githubSrc, className, alt, firstPathFill, ...props }: GithubFallbackIconProps): React$1.JSX.Element;
|
|
72
71
|
|
|
73
72
|
declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
|
|
74
73
|
declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
@@ -78,7 +77,7 @@ declare const DialogOverlay: {
|
|
|
78
77
|
({ className, backdropAnimation }: {
|
|
79
78
|
backdropAnimation?: Variants;
|
|
80
79
|
className?: string;
|
|
81
|
-
}):
|
|
80
|
+
}): React$1.JSX.Element;
|
|
82
81
|
displayName: string | undefined;
|
|
83
82
|
};
|
|
84
83
|
declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
@@ -86,11 +85,11 @@ declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimit
|
|
|
86
85
|
backdropAnimation?: Variants;
|
|
87
86
|
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
88
87
|
declare const DialogHeader: {
|
|
89
|
-
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>):
|
|
88
|
+
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
90
89
|
displayName: string;
|
|
91
90
|
};
|
|
92
91
|
declare const DialogFooter: {
|
|
93
|
-
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>):
|
|
92
|
+
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
94
93
|
displayName: string;
|
|
95
94
|
};
|
|
96
95
|
declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -101,11 +100,11 @@ interface NetworkIconProps {
|
|
|
101
100
|
variant?: 'background' | 'branded' | 'mono';
|
|
102
101
|
className?: string;
|
|
103
102
|
}
|
|
104
|
-
declare function NetworkIcon({ chainId, variant, className }: NetworkIconProps):
|
|
103
|
+
declare function NetworkIcon({ chainId, variant, className }: NetworkIconProps): React$1.JSX.Element;
|
|
105
104
|
|
|
106
105
|
declare function StarsBackground({ starsCount }: {
|
|
107
106
|
starsCount?: number;
|
|
108
|
-
}):
|
|
107
|
+
}): React$1.JSX.Element;
|
|
109
108
|
|
|
110
109
|
/**
|
|
111
110
|
* Props for the SvgImg component.
|
|
@@ -121,7 +120,7 @@ interface SvgImgProps extends Omit<ComponentProps<'img'>, 'src' | 'draggable'> {
|
|
|
121
120
|
*
|
|
122
121
|
* @param props - {@link SvgImgProps}
|
|
123
122
|
*/
|
|
124
|
-
declare function SvgImg({ src, alt, ...props }: SvgImgProps):
|
|
123
|
+
declare function SvgImg({ src, alt, ...props }: SvgImgProps): React$1.JSX.Element;
|
|
125
124
|
|
|
126
125
|
/**
|
|
127
126
|
* Props for the SvgToImg component.
|
|
@@ -160,7 +159,7 @@ interface SvgToImgProps extends Omit<ComponentProps<'img'>, 'ref' | 'src' | 'chi
|
|
|
160
159
|
* </SvgToImg>
|
|
161
160
|
* ```
|
|
162
161
|
*/
|
|
163
|
-
declare function SvgToImg({ children, iconId, alt, firstPathFill, ...props }: SvgToImgProps):
|
|
162
|
+
declare function SvgToImg({ children, iconId, alt, firstPathFill, ...props }: SvgToImgProps): React$1.JSX.Element;
|
|
164
163
|
|
|
165
164
|
/**
|
|
166
165
|
* @file This file contains a reusable close button component, designed primarily for toast notifications.
|
|
@@ -195,7 +194,7 @@ type ToastCloseButtonProps = {
|
|
|
195
194
|
* A simple, styled close button component ('X' icon) intended for use within toast notifications.
|
|
196
195
|
* It uses theme-aware CSS variables for styling and i18n labels for accessibility.
|
|
197
196
|
*/
|
|
198
|
-
declare function ToastCloseButton({ closeToast, ariaLabel, title, className, iconClassName, }: ToastCloseButtonProps):
|
|
197
|
+
declare function ToastCloseButton({ closeToast, ariaLabel, title, className, iconClassName, }: ToastCloseButtonProps): React$1.JSX.Element;
|
|
199
198
|
|
|
200
199
|
/**
|
|
201
200
|
* Props for the WalletIcon component.
|
|
@@ -225,7 +224,7 @@ interface WalletIconProps {
|
|
|
225
224
|
* @param props - {@link WalletIconProps}
|
|
226
225
|
* @returns The wallet icon or a fallback UI.
|
|
227
226
|
*/
|
|
228
|
-
declare function WalletIcon({ walletName, variant, className }: WalletIconProps):
|
|
227
|
+
declare function WalletIcon({ walletName, variant, className }: WalletIconProps): React$1.JSX.Element;
|
|
229
228
|
|
|
230
229
|
/**
|
|
231
230
|
* @file This file contains a custom React hook for copying text to the clipboard.
|
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,wallets}from'@web3icons/common/metadata';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import*as d from'react';import {lazy,useState,useEffect,useCallback,Suspense,useMemo}from'react';import*as l from'@radix-ui/react-dialog';var Oo="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 J(o,e){let t={...o};return y(o)&&y(e)&&Object.keys(e).forEach(n=>{let r=o[n],a=e[n];y(r)&&y(a)?t[n]=J(r,a):t[n]=a;}),t}function h(o){if(typeof o!="string")return false;let e=o.toLowerCase();return e.includes("solana")&&(e.includes("devnet")||e.includes("testnet"))}var R="Unknown";function Z(o){return o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}function z(o){let e={name:R,id:R.toLowerCase(),filePath:R.toLowerCase(),chainId:o};if(typeof o=="number"){let i=networks.find(c=>c.chainId===o);return i?{name:i.name,id:i.id,filePath:i.filePath?.split(":")[1],chainId:o}:e}let[t,n]=o?o.split(":"):[o],r=networks.find(i=>i.id===t);return r?{name:n&&h(o)?`${r.name} ${Z(n)}`:r.name,id:r.id,filePath:r.filePath?.split(":")[1],chainId:o}:e}function F(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 r=e||t||n,a=window.innerWidth<=o;return r&&a}function oo(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 eo(o,e){let t=oo(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 x(o,e){let t=o;return e&&(t=eo(t,e)),`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(t)))}`}var N=o=>`${o.replace(/\s+/g,"-").toLowerCase()}.svg`;function oe(o,e,t){if(!o)return "";if(o.length<=e+t)return o;let n=o.slice(0,e),r=o.slice(o.length-t);return `${n}...${r}`}function pe({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 ro=d.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"})]}));ro.displayName="CloseIcon";var ao="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)]",f=({animate:o=false,content:e="",className:t})=>jsx("div",{className:s(ao,"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:n=>n.preventDefault(),style:{outline:"none",pointerEvents:"none"}})}var lo="https://raw.githubusercontent.com/0xa3k5/web3icons/refs/heads/main/raw-svgs",H=new Map;function C({githubSrc:o,className:e,alt:t,firstPathFill:n,...r}){let[a,i]=useState(null),[c,m]=useState("idle");return useEffect(()=>{let v=true,b=`${o}|${n??""}`,I=H.get(b);if(I){i(I),m("success");return}return (async()=>{m("loading");try{let D=await fetch(`${lo}/${o}`);if(!D.ok)throw new Error(`Failed to load icon: ${D.status}`);let Q=await D.text();if(v){let A=x(Q,n);H.set(b,A),i(A),m("success");}}catch{v&&m("error");}})(),()=>{v=false;}},[o,n]),c==="loading"||c==="idle"?jsx(f,{animate:true,className:e}):c==="success"&&a?jsx(k,{...r,src:a,alt:t,className:e}):jsx(f,{content:"?",className:e})}var Ae=l.Root,Ve=l.Trigger,mo=l.Portal,ze=l.Close,uo={initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,transition:{duration:.2}}},po={initial:{opacity:0,y:"100%"},animate:{opacity:1,y:"0%"},exit:{opacity:0,y:"100%",transition:{duration:.2}}},fo={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},U=({className:o,backdropAnimation:e})=>(d.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??fo,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)})})}));U.displayName=l.Overlay.displayName;var vo=d.forwardRef(({className:o,children:e,modalAnimation:t,backdropAnimation:n,...r},a)=>{let[i,c]=d.useState(false);d.useEffect(()=>{c(F());},[]);let m=t??(i?po:uo);return jsxs(mo,{children:[jsx(U,{backdropAnimation:n}),jsx(l.Content,{"aria-describedby":"tuwa:modal-content",ref:a,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})})})})})]})});vo.displayName=l.Content.displayName;var go=({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});go.displayName="DialogHeader";var wo=({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});wo.displayName="DialogFooter";var bo=d.forwardRef(({className:o,...e},t)=>jsx(l.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}));bo.displayName=l.Title.displayName;var yo=d.forwardRef(({className:o,...e},t)=>jsx(l.Description,{"aria-describedby":"tuwa:modal-description",ref:t,className:s("novacore:text-sm novacore:text-[var(--tuwa-text-secondary)]",o),...e}));yo.displayName=l.Description.displayName;function w({children:o,iconId:e,alt:t,firstPathFill:n,...r}){let[a,i]=useState(null),c=useCallback(m=>{if(m){let v=x(m.outerHTML,n);i({id:e,src:v});}},[e,n]);return a&&a.id===e?jsx(k,{...r,src:a.src,alt:t}):jsx(Fragment,{children:o(c)})}var q=lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.NetworkIcon}))),Po="var(--tuwa-testnet-icons)";function je({chainId:o,variant:e="background",className:t}){let n=z(o),r=typeof o=="string",a=r?o.split(":")[0].toLowerCase():o,c=r&&h(o)||n.name.toLowerCase().includes("testnet")?Po:void 0,m=s("novacore:w-full novacore:h-full novacore:rounded-full",t),v=typeof a=="string"?a:n.filePath,b=`networks/${e}/${N(v)}`;return n.name==="Unknown"?typeof o=="number"?jsx(f,{content:"?",className:t}):jsx(C,{githubSrc:b,className:m,firstPathFill:c}):jsx(Suspense,{fallback:jsx(f,{animate:true,className:t}),children:jsx(w,{iconId:`${o}-${e}`,className:m,firstPathFill:c,children:T=>typeof a=="string"?jsx(q,{ref:T,id:a,variant:e}):jsx(q,{ref:T,chainId:a,variant:e})})})}function et({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,wallets}from'@web3icons/common/metadata';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import*as d from'react';import {lazy,useState,useEffect,useCallback,Suspense,useMemo}from'react';import*as c from'@radix-ui/react-dialog';var _o="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 Z(o,e){let t={...o};return y(o)&&y(e)&&Object.keys(e).forEach(n=>{let r=o[n],a=e[n];y(r)&&y(a)?t[n]=Z(r,a):t[n]=a;}),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 M="Unknown";function oo(o){return o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}function W(o){let e={name:M,id:M.toLowerCase(),filePath:M.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,n]=o?o.split(":"):[o],r=networks.find(i=>i.id===t);return r?{name:n&&x(o)?`${r.name} ${oo(n)}`:r.name,id:r.id,filePath:r.filePath?.split(":")[1],chainId:o}:e}function G(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 r=e||t||n,a=window.innerWidth<=o;return r&&a}function eo(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 to(o,e){let t=eo(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=to(t,e)),`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(t)))}`}var S=o=>`${o.replace(/\s+/g,"-").toLowerCase()}.svg`;function te(o,e,t){if(!o)return "";if(o.length<=e+t)return o;let n=o.slice(0,e),r=o.slice(o.length-t);return `${n}...${r}`}function ve({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 no=d.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"})]}));no.displayName="CloseIcon";var io="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)]",f=({animate:o=false,content:e="",className:t})=>jsx("div",{className:s(io,"Nova_Web3_Icon",t,{"novacore:animate-pulse":o}),children:e});function C({src:o,alt:e,...t}){return jsx("img",{...t,src:o,alt:e??"",draggable:false,onDragStart:n=>n.preventDefault(),style:{outline:"none",pointerEvents:"none"}})}var mo="https://raw.githubusercontent.com/0xa3k5/web3icons/refs/heads/main/raw-svgs",L=new Map;function P({githubSrc:o,className:e,alt:t,firstPathFill:n,...r}){let a=`${o}|${n??""}`,i=L.get(a),[l,u]=useState(null),[w,b]=useState("idle"),T=i||l,g=i?"success":w;return useEffect(()=>{let D=true;return L.has(a)?void 0:((async()=>{b("loading");try{let R=await fetch(`${mo}/${o}`);if(!R.ok)throw new Error(`Failed to load icon: ${R.status}`);let X=await R.text();if(D){let V=N(X,n);L.set(a,V),u(V),b("success");}}catch{D&&b("error");}})(),()=>{D=false;})},[o,n,a]),g==="loading"||g==="idle"?jsx(f,{animate:true,className:e}):g==="success"&&T?jsx(C,{...r,src:T,alt:t,className:e}):jsx(f,{content:"?",className:e})}var Ve=c.Root,ze=c.Trigger,uo=c.Portal,We=c.Close,po={initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,transition:{duration:.2}}},fo={initial:{opacity:0,y:"100%"},animate:{opacity:1,y:"0%"},exit:{opacity:0,y:"100%",transition:{duration:.2}}},vo={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},Y=({className:o,backdropAnimation:e})=>(d.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??vo,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)})})}));Y.displayName=c.Overlay.displayName;var go=d.forwardRef(({className:o,children:e,modalAnimation:t,backdropAnimation:n,...r},a)=>{let[i,l]=d.useState(false);d.useEffect(()=>{l(G());},[]);let u=t??(i?fo:po);return jsxs(uo,{children:[jsx(Y,{backdropAnimation:n}),jsx(c.Content,{"aria-describedby":"tuwa:modal-content",ref:a,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:u,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})})})})})]})});go.displayName=c.Content.displayName;var wo=({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});wo.displayName="DialogHeader";var bo=({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});bo.displayName="DialogFooter";var ho=d.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}));ho.displayName=c.Title.displayName;var yo=d.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}));yo.displayName=c.Description.displayName;function h({children:o,iconId:e,alt:t,firstPathFill:n,...r}){let[a,i]=useState(null),l=useCallback(u=>{if(u){let w=N(u.outerHTML,n);i({id:e,src:w});}},[e,n]);return a&&a.id===e?jsx(C,{...r,src:a.src,alt:t}):jsx(Fragment,{children:o(l)})}var K=lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.NetworkIcon}))),Io="var(--tuwa-testnet-icons)";function Ze({chainId:o,variant:e="background",className:t}){let n=W(o),r=typeof o=="string",a=r?o.split(":")[0].toLowerCase():o,l=r&&x(o)||n.name.toLowerCase().includes("testnet")?Io:void 0,u=s("novacore:w-full novacore:h-full novacore:rounded-full",t),w=typeof a=="string"?a:n.filePath,b=`networks/${e}/${S(w)}`;return n.name==="Unknown"?typeof o=="number"?jsx(f,{content:"?",className:t}):jsx(P,{githubSrc:b,className:u,firstPathFill:l}):jsx(Suspense,{fallback:jsx(f,{animate:true,className:t}),children:jsx(h,{iconId:`${o}-${e}`,className:u,firstPathFill:l,children:g=>typeof a=="string"?jsx(K,{ref:g,id:a,variant:e}):jsx(K,{ref:g,chainId:a,variant:e})})})}function rt({starsCount:o}){let[e,t]=useState(false);useEffect(()=>t(true),[]);let n=useMemo(()=>e?Array.from({length:o??200}).map(()=>({x:Math.random()*window.innerWidth,y:Math.random()*window.innerHeight,r:Math.random()*1+.5,isSupernova:Math.random()<.1,delay:Math.random()*10,duration:5+Math.random()*5})):[],[e]);return jsx("div",{className:"novacore:absolute novacore:inset-0 novacore:z-1 novacore:h-full novacore:w-full novacore:overflow-hidden",children:jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[jsx("defs",{children:jsx("style",{children:`
|
|
2
2
|
/* Pulse animation now includes scale for a more organic feel. */
|
|
3
3
|
@keyframes pulse {
|
|
4
4
|
0%, 100% {
|
|
@@ -44,5 +44,5 @@ import {motion,AnimatePresence}from'framer-motion';import {clsx}from'clsx';impor
|
|
|
44
44
|
transform-origin: center;
|
|
45
45
|
stroke-width: 2;
|
|
46
46
|
}
|
|
47
|
-
`})}),n.map((r,a)=>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`}},a))]})})}function
|
|
48
|
-
export{
|
|
47
|
+
`})}),n.map((r,a)=>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`}},a))]})})}function st({closeToast:o,ariaLabel:e="Close toast notification",title:t="Close toast notification",className:n,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)]",n),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 Fo=lazy(()=>import('@web3icons/react/dynamic').then(o=>({default:o.WalletIcon}))),Vo={walletconnect:"wallet-connect"};function zo(o){return wallets.some(e=>e.id===o||e.name?.toLowerCase()===o)}var Wo=({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 gt({walletName:o,variant:e="background",className:t}){let n=s("novacore:w-full novacore:h-full novacore:rounded-full",t),r=o.toLowerCase();if(r==="impersonatedwallet")return jsx(h,{iconId:"impersonatedwallet",className:n,children:l=>jsx(Wo,{ref:l})});let a=Vo[r]??r,i=`wallets/${e}/${S(a)}`;return zo(a)?jsx(Suspense,{fallback:jsx(f,{animate:true,className:t}),children:jsx(h,{iconId:`${a}-${e}`,className:n,children:l=>jsx(Fo,{ref:l,id:a,variant:e})})}):jsx(P,{githubSrc:i,className:n})}function yt(o=2e3){let[e,t]=useState(false),[n,r]=useState(null),a=useCallback(async i=>{if(i)try{await navigator.clipboard.writeText(i),t(!0),r(null),setTimeout(()=>t(!1),o);}catch(l){let u=l instanceof Error?l:new Error("Failed to copy text.");console.error(u),r(u),setTimeout(()=>r(null),o);}},[o]);return {isCopied:e,copy:a,error:n}}function St(o){let e=r=>typeof window<"u"?window.matchMedia(r).matches:false,[t,n]=useState(e(o));return useEffect(()=>{let r=window.matchMedia(o),a=()=>n(r.matches);return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[o]),t}
|
|
48
|
+
export{ve as ChevronArrowWithAnim,no as CloseIcon,Ve as Dialog,We as DialogClose,go as DialogContent,yo as DialogDescription,bo as DialogFooter,wo as DialogHeader,Y as DialogOverlay,uo as DialogPortal,ho as DialogTitle,ze as DialogTrigger,f as FallbackIcon,P as GithubFallbackIcon,Ze as NetworkIcon,rt as StarsBackground,C as SvgImg,h as SvgToImg,st as ToastCloseButton,gt as WalletIcon,to as applyFirstPathFill,s as cn,Z as deepMerge,S as formatIconNameForGithub,W as getChainName,x as isSolanaDev,G as isTouchDevice,eo as resolveCssVariable,_o as standardButtonClasses,N as svgToBase64,te as textCenterEllipsis,yt as useCopyToClipboard,St as useMediaQuery};
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuwaio/nova-core",
|
|
3
|
-
"version": "1.0.0-fix-
|
|
3
|
+
"version": "1.0.0-fix-docs-alpha.2.061e66e2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Oleksandr Tkach",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
-
"description": "
|
|
7
|
+
"description": "Layer 6 (L6) of the TUWA Ecosystem. Foundational package with styling primitives, CSS variables, base React components, and helper utilities.",
|
|
8
8
|
"main": "./dist/index.cjs",
|
|
9
9
|
"module": "./dist/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
@@ -57,20 +57,20 @@
|
|
|
57
57
|
"tailwind-merge": "3.x.x"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@tailwindcss/postcss": "^4.
|
|
61
|
-
"@tailwindcss/vite": "^4.
|
|
62
|
-
"@types/react": "^19.2.
|
|
63
|
-
"@radix-ui/react-dialog": "^1.1.
|
|
64
|
-
"@web3icons/react": "^4.1.
|
|
65
|
-
"@web3icons/common": "^0.11.
|
|
66
|
-
"autoprefixer": "^10.5.
|
|
60
|
+
"@tailwindcss/postcss": "^4.3.3",
|
|
61
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
62
|
+
"@types/react": "^19.2.17",
|
|
63
|
+
"@radix-ui/react-dialog": "^1.1.19",
|
|
64
|
+
"@web3icons/react": "^4.1.19",
|
|
65
|
+
"@web3icons/common": "^0.11.48",
|
|
66
|
+
"autoprefixer": "^10.5.4",
|
|
67
67
|
"clsx": "^2.1.1",
|
|
68
|
-
"framer-motion": "^12.
|
|
69
|
-
"postcss": "^8.5.
|
|
68
|
+
"framer-motion": "^12.42.2",
|
|
69
|
+
"postcss": "^8.5.19",
|
|
70
70
|
"postcss-cli": "^11.0.1",
|
|
71
|
-
"react": "^19.2.
|
|
72
|
-
"tailwindcss": "^4.
|
|
73
|
-
"tailwind-merge": "^3.
|
|
71
|
+
"react": "^19.2.7",
|
|
72
|
+
"tailwindcss": "^4.3.3",
|
|
73
|
+
"tailwind-merge": "^3.6.0",
|
|
74
74
|
"tsup": "^8.5.1",
|
|
75
75
|
"typescript": "^6.0.3"
|
|
76
76
|
},
|