kaleido-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +188 -0
- package/dist/css/kaleido-ui.css +197 -0
- package/dist/native/index.cjs +322 -0
- package/dist/native/index.d.cts +212 -0
- package/dist/native/index.d.ts +212 -0
- package/dist/native/index.js +283 -0
- package/dist/tailwind/index.cjs +235 -0
- package/dist/tailwind/index.d.cts +182 -0
- package/dist/tailwind/index.d.ts +182 -0
- package/dist/tailwind/index.js +212 -0
- package/dist/tokens/index.cjs +132 -0
- package/dist/tokens/index.d.cts +107 -0
- package/dist/tokens/index.d.ts +107 -0
- package/dist/tokens/index.js +99 -0
- package/dist/web/index.cjs +1276 -0
- package/dist/web/index.d.cts +308 -0
- package/dist/web/index.d.ts +308 -0
- package/dist/web/index.js +1191 -0
- package/native/index.d.ts +1 -0
- package/native/index.js +1 -0
- package/package.json +124 -0
- package/tailwind/index.d.ts +1 -0
- package/tailwind/index.js +1 -0
- package/tokens/index.d.ts +1 -0
- package/tokens/index.js +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# kaleido-ui
|
|
2
|
+
|
|
3
|
+
Shared UI library for KaleidoSwap — design tokens, web components (Tailwind + Radix), and React Native components extending [WDK UI Kit](https://docs.wdk.tether.io/ui-kits/react-native-ui-kit).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install kaleido-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Entry Points
|
|
12
|
+
|
|
13
|
+
| Import | Description |
|
|
14
|
+
|--------|-------------|
|
|
15
|
+
| `kaleido-ui` | Web components (Tailwind CSS + Radix UI) |
|
|
16
|
+
| `kaleido-ui/tokens` | Platform-agnostic design tokens (zero deps) |
|
|
17
|
+
| `kaleido-ui/native` | React Native components (WDK + custom) |
|
|
18
|
+
| `kaleido-ui/tailwind` | Tailwind CSS preset |
|
|
19
|
+
| `kaleido-ui/css` | CSS custom properties, glass effects, animations |
|
|
20
|
+
|
|
21
|
+
## Quick Start — Web
|
|
22
|
+
|
|
23
|
+
### 1. Configure Tailwind
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
// tailwind.config.js
|
|
27
|
+
module.exports = {
|
|
28
|
+
content: [
|
|
29
|
+
'./src/**/*.{ts,tsx}',
|
|
30
|
+
'./node_modules/kaleido-ui/dist/web/*.js',
|
|
31
|
+
],
|
|
32
|
+
presets: [require('kaleido-ui/tailwind')],
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Import CSS
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
// main.tsx
|
|
40
|
+
import 'kaleido-ui/css'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 3. Use Components
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
import { Button, Card, CardContent, StatusBadge, AssetCard } from 'kaleido-ui'
|
|
47
|
+
|
|
48
|
+
function App() {
|
|
49
|
+
return (
|
|
50
|
+
<Card>
|
|
51
|
+
<CardContent>
|
|
52
|
+
<AssetCard
|
|
53
|
+
ticker="BTC"
|
|
54
|
+
name="Bitcoin"
|
|
55
|
+
displayBalance="0.00142000"
|
|
56
|
+
networks={['L1', 'LN', 'Spark']}
|
|
57
|
+
/>
|
|
58
|
+
<StatusBadge status="completed" />
|
|
59
|
+
<Button variant="cta" size="cta">Swap Now</Button>
|
|
60
|
+
</CardContent>
|
|
61
|
+
</Card>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Quick Start — React Native
|
|
67
|
+
|
|
68
|
+
### 1. Install peer dependencies
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm install @tetherto/wdk-uikit-react-native react-native
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 2. Wrap with theme provider
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
import { KaleidoThemeProvider } from 'kaleido-ui/native'
|
|
78
|
+
|
|
79
|
+
export default function App() {
|
|
80
|
+
return (
|
|
81
|
+
<KaleidoThemeProvider>
|
|
82
|
+
{/* Your app */}
|
|
83
|
+
</KaleidoThemeProvider>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 3. Use Components
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import {
|
|
92
|
+
Balance,
|
|
93
|
+
AmountInput,
|
|
94
|
+
AssetSelector,
|
|
95
|
+
StatusBadge,
|
|
96
|
+
NetworkBadge,
|
|
97
|
+
} from 'kaleido-ui/native'
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Quick Start — Tokens Only
|
|
101
|
+
|
|
102
|
+
Works in any JS runtime (Node.js, React Native, web) with zero dependencies.
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import { colors, typeScale, radius, shadow } from 'kaleido-ui/tokens'
|
|
106
|
+
|
|
107
|
+
console.log(colors.primary) // '#2BEE79'
|
|
108
|
+
console.log(colors.network.bitcoin) // '#F7931A'
|
|
109
|
+
console.log(typeScale.body) // ['15px', '22px']
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Web Components
|
|
113
|
+
|
|
114
|
+
### Primitives
|
|
115
|
+
|
|
116
|
+
| Component | Description |
|
|
117
|
+
|-----------|-------------|
|
|
118
|
+
| `Button` | 11 variants (default, destructive, outline, secondary, ghost, link, glow, surface, cta, cta-gradient, danger-subtle), 9 sizes |
|
|
119
|
+
| `Card` | Compositional: Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter |
|
|
120
|
+
| `Input` | Form text input with focus ring |
|
|
121
|
+
| `Dialog` | Modal dialog (Radix): Dialog, DialogContent, DialogHeader, DialogTitle, etc. |
|
|
122
|
+
| `Tabs` | Tab navigation (Radix): Tabs, TabsList, TabsTrigger, TabsContent |
|
|
123
|
+
| `Label` | Form label (Radix) |
|
|
124
|
+
| `Toast` | Toast notifications (Radix): Toast, ToastProvider, Toaster |
|
|
125
|
+
| `Icon` | Material Symbols wrapper with size variants (xs-2xl) |
|
|
126
|
+
| `Icons` | Named icon shortcuts (Icons.Send, Icons.Receive, Icons.Swap, etc.) |
|
|
127
|
+
|
|
128
|
+
### Shared Components
|
|
129
|
+
|
|
130
|
+
| Component | Description |
|
|
131
|
+
|-----------|-------------|
|
|
132
|
+
| `StatusBadge` | Status indicator (success, pending, failed, completed, error) |
|
|
133
|
+
| `NetworkBadge` | Network/layer badge (L1, LN, RGB20, RGB21, Spark, Arkade) |
|
|
134
|
+
| `AssetIcon` | Circular asset icon with CDN + fallback chain |
|
|
135
|
+
| `AssetCard` | Asset display with icon, name, networks, balance |
|
|
136
|
+
| `TransactionCard` | Transaction row with direction, status, amount |
|
|
137
|
+
| `PageHeader` | Sticky header with left/center/right slots |
|
|
138
|
+
| `SettingItem` | Settings row with icon, title, description, chevron |
|
|
139
|
+
| `SectionLabel` | Uppercase section heading |
|
|
140
|
+
| `AlertBanner` | Alert box (error, warning, info, success variants) |
|
|
141
|
+
| `ErrorBoundary` | React error boundary with retry UI |
|
|
142
|
+
|
|
143
|
+
### Hooks
|
|
144
|
+
|
|
145
|
+
| Hook | Description |
|
|
146
|
+
|------|-------------|
|
|
147
|
+
| `useToast` | Toast state management + `toast()` function |
|
|
148
|
+
| `useAssetIcon` | Resolves asset ticker to CDN icon URL |
|
|
149
|
+
|
|
150
|
+
### Utilities
|
|
151
|
+
|
|
152
|
+
| Export | Description |
|
|
153
|
+
|--------|-------------|
|
|
154
|
+
| `cn()` | `clsx` + `tailwind-merge` utility |
|
|
155
|
+
|
|
156
|
+
## Native Components
|
|
157
|
+
|
|
158
|
+
### From WDK UI Kit (re-exported, themed)
|
|
159
|
+
|
|
160
|
+
AmountInput, AssetSelector, NetworkSelector, Balance, CryptoAddressInput, QRCode, TransactionItem, TransactionList, SeedPhrase
|
|
161
|
+
|
|
162
|
+
### Custom
|
|
163
|
+
|
|
164
|
+
StatusBadge, NetworkBadge, AlertBanner, SectionLabel
|
|
165
|
+
|
|
166
|
+
## Design Tokens
|
|
167
|
+
|
|
168
|
+
| Token | Values |
|
|
169
|
+
|-------|--------|
|
|
170
|
+
| `colors` | primary (#2BEE79), surfaces, text, semantic, network, transaction |
|
|
171
|
+
| `typeScale` | xxs (10px) through display (36px) |
|
|
172
|
+
| `fontFamily` | Geist Sans, Geist Mono |
|
|
173
|
+
| `fontWeight` | normal (400) through bold (700) |
|
|
174
|
+
| `radius` | sm (8px) through full (9999px) |
|
|
175
|
+
| `shadow` | glow, glowStrong, glowSubtle, glowAccent |
|
|
176
|
+
| `transition` | fast (150ms), default (200ms), slow (300ms) |
|
|
177
|
+
|
|
178
|
+
## Development
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
npm install --legacy-peer-deps
|
|
182
|
+
npm run build # Build all entry points
|
|
183
|
+
npm run dev # Watch mode
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
MIT
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* KaleidoSwap UI — CSS Custom Properties, Glass Effects & Animations
|
|
3
|
+
*
|
|
4
|
+
* Import in your entry point:
|
|
5
|
+
* import 'kaleido-ui/css'
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This file does NOT include Tailwind directives (@tailwind base/components/utilities).
|
|
8
|
+
* Your consumer app must have its own Tailwind setup with the kaleido-ui preset.
|
|
9
|
+
* Font imports (@fontsource/geist-sans, @fontsource/geist-mono, material-symbols)
|
|
10
|
+
* must also be done in the consumer app.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/* ------------------------------------------------------------------ */
|
|
14
|
+
/* Material Symbols */
|
|
15
|
+
/* ------------------------------------------------------------------ */
|
|
16
|
+
|
|
17
|
+
.material-symbols-outlined {
|
|
18
|
+
font-variation-settings:
|
|
19
|
+
'FILL' 0,
|
|
20
|
+
'wght' 400,
|
|
21
|
+
'GRAD' 0,
|
|
22
|
+
'opsz' 24;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.material-symbols-outlined.filled {
|
|
26
|
+
font-variation-settings:
|
|
27
|
+
'FILL' 1,
|
|
28
|
+
'wght' 400,
|
|
29
|
+
'GRAD' 0,
|
|
30
|
+
'opsz' 24;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* ------------------------------------------------------------------ */
|
|
34
|
+
/* CSS Custom Properties (Light Theme — :root) */
|
|
35
|
+
/* ------------------------------------------------------------------ */
|
|
36
|
+
|
|
37
|
+
:root {
|
|
38
|
+
--background: 150 7% 97%;
|
|
39
|
+
--foreground: 144 53% 8%;
|
|
40
|
+
--card: 0 0% 100%;
|
|
41
|
+
--card-foreground: 144 53% 8%;
|
|
42
|
+
--popover: 0 0% 100%;
|
|
43
|
+
--popover-foreground: 144 53% 8%;
|
|
44
|
+
--primary: 151 88% 52%;
|
|
45
|
+
--primary-foreground: 144 53% 8%;
|
|
46
|
+
--secondary: 150 10% 90%;
|
|
47
|
+
--secondary-foreground: 144 53% 8%;
|
|
48
|
+
--muted: 150 10% 90%;
|
|
49
|
+
--muted-foreground: 150 10% 40%;
|
|
50
|
+
--accent: 150 10% 90%;
|
|
51
|
+
--accent-foreground: 144 53% 8%;
|
|
52
|
+
--destructive: 0 84% 60%;
|
|
53
|
+
--destructive-foreground: 0 0% 100%;
|
|
54
|
+
--border: 150 10% 85%;
|
|
55
|
+
--input: 150 10% 85%;
|
|
56
|
+
--ring: 151 88% 52%;
|
|
57
|
+
--radius: 0.75rem;
|
|
58
|
+
|
|
59
|
+
--surface: 0 0% 100%;
|
|
60
|
+
--surface-foreground: 144 53% 8%;
|
|
61
|
+
--text-secondary: 151 30% 68%;
|
|
62
|
+
--warning: 45 93% 47%;
|
|
63
|
+
--warning-foreground: 0 0% 0%;
|
|
64
|
+
--success: 151 88% 52%;
|
|
65
|
+
--success-foreground: 144 53% 8%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* ------------------------------------------------------------------ */
|
|
69
|
+
/* CSS Custom Properties (Dark Theme) */
|
|
70
|
+
/* ------------------------------------------------------------------ */
|
|
71
|
+
|
|
72
|
+
.dark {
|
|
73
|
+
--background: 144 53% 8%;
|
|
74
|
+
--foreground: 0 0% 100%;
|
|
75
|
+
--card: 146 36% 13%;
|
|
76
|
+
--card-foreground: 0 0% 100%;
|
|
77
|
+
--popover: 146 36% 13%;
|
|
78
|
+
--popover-foreground: 0 0% 100%;
|
|
79
|
+
--primary: 151 88% 52%;
|
|
80
|
+
--primary-foreground: 144 53% 8%;
|
|
81
|
+
--secondary: 146 30% 18%;
|
|
82
|
+
--secondary-foreground: 0 0% 98%;
|
|
83
|
+
--muted: 146 30% 18%;
|
|
84
|
+
--muted-foreground: 150 15% 60%;
|
|
85
|
+
--accent: 146 30% 20%;
|
|
86
|
+
--accent-foreground: 0 0% 98%;
|
|
87
|
+
--destructive: 0 62% 50%;
|
|
88
|
+
--destructive-foreground: 0 0% 100%;
|
|
89
|
+
--border: 146 25% 20%;
|
|
90
|
+
--input: 146 30% 15%;
|
|
91
|
+
--ring: 151 88% 52%;
|
|
92
|
+
|
|
93
|
+
--surface: 146 36% 13%;
|
|
94
|
+
--surface-foreground: 0 0% 100%;
|
|
95
|
+
--text-secondary: 151 30% 68%;
|
|
96
|
+
--warning: 45 93% 47%;
|
|
97
|
+
--warning-foreground: 0 0% 0%;
|
|
98
|
+
--success: 151 88% 52%;
|
|
99
|
+
--success-foreground: 144 53% 8%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* ------------------------------------------------------------------ */
|
|
103
|
+
/* Glass Effects */
|
|
104
|
+
/* ------------------------------------------------------------------ */
|
|
105
|
+
|
|
106
|
+
.glass-panel {
|
|
107
|
+
background: rgba(255, 255, 255, 0.03);
|
|
108
|
+
backdrop-filter: blur(16px);
|
|
109
|
+
-webkit-backdrop-filter: blur(16px);
|
|
110
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.glass-panel-heavy {
|
|
114
|
+
background: rgba(14, 30, 20, 0.78);
|
|
115
|
+
backdrop-filter: blur(28px);
|
|
116
|
+
-webkit-backdrop-filter: blur(28px);
|
|
117
|
+
border: 1px solid rgba(43, 238, 121, 0.12);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.glass-card {
|
|
121
|
+
background: rgba(26, 46, 33, 0.65);
|
|
122
|
+
backdrop-filter: blur(12px);
|
|
123
|
+
-webkit-backdrop-filter: blur(12px);
|
|
124
|
+
border: 1px solid rgba(255, 255, 255, 0.09);
|
|
125
|
+
transition: all 0.2s ease-out;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.glass-card:active {
|
|
129
|
+
transform: scale(0.98);
|
|
130
|
+
background: rgba(26, 46, 33, 0.8);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* ------------------------------------------------------------------ */
|
|
134
|
+
/* Glow Utilities */
|
|
135
|
+
/* ------------------------------------------------------------------ */
|
|
136
|
+
|
|
137
|
+
.shadow-glow-subtle {
|
|
138
|
+
box-shadow: 0 0 10px rgba(43, 238, 121, 0.1);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.shadow-glow {
|
|
142
|
+
box-shadow: 0 0 20px rgba(43, 238, 121, 0.2);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.shadow-glow-strong {
|
|
146
|
+
box-shadow: 0 0 30px rgba(43, 238, 121, 0.3);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.shadow-glow-accent {
|
|
150
|
+
box-shadow: 0 4px 30px rgba(43, 238, 121, 0.25);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* ------------------------------------------------------------------ */
|
|
154
|
+
/* Utility Classes */
|
|
155
|
+
/* ------------------------------------------------------------------ */
|
|
156
|
+
|
|
157
|
+
.no-scrollbar::-webkit-scrollbar {
|
|
158
|
+
display: none;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.no-scrollbar {
|
|
162
|
+
-ms-overflow-style: none;
|
|
163
|
+
scrollbar-width: none;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.pb-safe {
|
|
167
|
+
padding-bottom: max(1rem, env(safe-area-inset-bottom));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* ------------------------------------------------------------------ */
|
|
171
|
+
/* Animations */
|
|
172
|
+
/* ------------------------------------------------------------------ */
|
|
173
|
+
|
|
174
|
+
@keyframes pulse-glow {
|
|
175
|
+
0%, 100% { box-shadow: 0 0 20px rgba(43, 238, 121, 0.2); }
|
|
176
|
+
50% { box-shadow: 0 0 30px rgba(43, 238, 121, 0.4); }
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@keyframes fade-in {
|
|
180
|
+
from { opacity: 0; }
|
|
181
|
+
to { opacity: 1; }
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@keyframes slide-up {
|
|
185
|
+
from { opacity: 0; transform: translateY(10px); }
|
|
186
|
+
to { opacity: 1; transform: translateY(0); }
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
@keyframes slide-in-from-bottom {
|
|
190
|
+
from { opacity: 0; transform: translateY(20px); }
|
|
191
|
+
to { opacity: 1; transform: translateY(0); }
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
|
|
195
|
+
.animate-fade-in { animation: fade-in 0.3s ease-out; }
|
|
196
|
+
.animate-slide-up { animation: slide-up 0.3s ease-out; }
|
|
197
|
+
.animate-slide-in-from-bottom { animation: slide-in-from-bottom 0.4s ease-out; }
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/native/index.ts
|
|
21
|
+
var native_exports = {};
|
|
22
|
+
__export(native_exports, {
|
|
23
|
+
AlertBanner: () => AlertBanner,
|
|
24
|
+
AmountInput: () => import_wdk_uikit_react_native2.AmountInput,
|
|
25
|
+
AssetSelector: () => import_wdk_uikit_react_native2.AssetSelector,
|
|
26
|
+
Balance: () => import_wdk_uikit_react_native2.Balance,
|
|
27
|
+
CryptoAddressInput: () => import_wdk_uikit_react_native2.CryptoAddressInput,
|
|
28
|
+
KaleidoThemeProvider: () => KaleidoThemeProvider,
|
|
29
|
+
NetworkBadge: () => NetworkBadge,
|
|
30
|
+
NetworkSelector: () => import_wdk_uikit_react_native2.NetworkSelector,
|
|
31
|
+
QRCode: () => import_wdk_uikit_react_native2.QRCode,
|
|
32
|
+
SectionLabel: () => SectionLabel,
|
|
33
|
+
SeedPhrase: () => import_wdk_uikit_react_native2.SeedPhrase,
|
|
34
|
+
StatusBadge: () => StatusBadge,
|
|
35
|
+
ThemeProvider: () => import_wdk_uikit_react_native2.ThemeProvider,
|
|
36
|
+
TransactionItem: () => import_wdk_uikit_react_native2.TransactionItem,
|
|
37
|
+
TransactionList: () => import_wdk_uikit_react_native2.TransactionList,
|
|
38
|
+
colors: () => colors,
|
|
39
|
+
fontFamily: () => fontFamily,
|
|
40
|
+
fontWeight: () => fontWeight,
|
|
41
|
+
kaleidoswapBrandConfig: () => kaleidoswapBrandConfig,
|
|
42
|
+
kaleidoswapTokens: () => kaleidoswapTokens,
|
|
43
|
+
radius: () => radius,
|
|
44
|
+
shadow: () => shadow,
|
|
45
|
+
transition: () => transition,
|
|
46
|
+
typeScale: () => typeScale,
|
|
47
|
+
useTheme: () => import_wdk_uikit_react_native2.useTheme
|
|
48
|
+
});
|
|
49
|
+
module.exports = __toCommonJS(native_exports);
|
|
50
|
+
|
|
51
|
+
// src/native/provider.tsx
|
|
52
|
+
var import_wdk_uikit_react_native = require("@tetherto/wdk-uikit-react-native");
|
|
53
|
+
|
|
54
|
+
// src/tokens/colors.ts
|
|
55
|
+
var colors = {
|
|
56
|
+
/** Brand */
|
|
57
|
+
primary: "#2BEE79",
|
|
58
|
+
primaryDark: "#1FA855",
|
|
59
|
+
primaryFg: "#102217",
|
|
60
|
+
/** Surfaces (dark theme — the default) */
|
|
61
|
+
bgDark: "#102217",
|
|
62
|
+
surfaceDark: "#162E21",
|
|
63
|
+
surfaceHighlight: "#243E30",
|
|
64
|
+
surfaceBorder: "#244A35",
|
|
65
|
+
surfaceDarker: "#0B1810",
|
|
66
|
+
/** Surfaces (light theme) */
|
|
67
|
+
bgLight: "#F6F8F7",
|
|
68
|
+
surfaceLight: "#FFFFFF",
|
|
69
|
+
/** Text */
|
|
70
|
+
textPrimary: "#FFFFFF",
|
|
71
|
+
textSecondary: "#92C9A8",
|
|
72
|
+
textMuted: "rgba(255,255,255,0.5)",
|
|
73
|
+
textDimmed: "rgba(255,255,255,0.35)",
|
|
74
|
+
/** Semantic */
|
|
75
|
+
success: "#2BEE79",
|
|
76
|
+
warning: "#F59E0B",
|
|
77
|
+
error: "#F94040",
|
|
78
|
+
info: "#4290FF",
|
|
79
|
+
/** Network / Layer */
|
|
80
|
+
network: {
|
|
81
|
+
bitcoin: "#F7931A",
|
|
82
|
+
rgb: "#DD352E",
|
|
83
|
+
arkade: "#7C3AED",
|
|
84
|
+
spark: "#FF6D00",
|
|
85
|
+
lightning: "#F6C343"
|
|
86
|
+
},
|
|
87
|
+
/** Transaction direction */
|
|
88
|
+
tx: {
|
|
89
|
+
sent: "#F94040",
|
|
90
|
+
receive: "#2BEE79",
|
|
91
|
+
swap: "#4290FF"
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// src/native/theme.ts
|
|
96
|
+
var kaleidoswapBrandConfig = {
|
|
97
|
+
primaryColor: colors.primary,
|
|
98
|
+
secondaryColor: colors.primaryDark
|
|
99
|
+
};
|
|
100
|
+
var kaleidoswapTokens = {
|
|
101
|
+
colors: {
|
|
102
|
+
primary: colors.primary,
|
|
103
|
+
primaryDark: colors.primaryDark,
|
|
104
|
+
primaryFg: colors.primaryFg,
|
|
105
|
+
background: colors.bgDark,
|
|
106
|
+
surface: colors.surfaceDark,
|
|
107
|
+
surfaceHighlight: colors.surfaceHighlight,
|
|
108
|
+
border: colors.surfaceBorder,
|
|
109
|
+
textPrimary: colors.textPrimary,
|
|
110
|
+
textSecondary: colors.textSecondary,
|
|
111
|
+
success: colors.success,
|
|
112
|
+
warning: colors.warning,
|
|
113
|
+
error: colors.error,
|
|
114
|
+
info: colors.info,
|
|
115
|
+
network: colors.network,
|
|
116
|
+
tx: colors.tx
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// src/native/provider.tsx
|
|
121
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
122
|
+
function KaleidoThemeProvider({
|
|
123
|
+
children,
|
|
124
|
+
brandConfig,
|
|
125
|
+
defaultMode = "dark"
|
|
126
|
+
}) {
|
|
127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
128
|
+
import_wdk_uikit_react_native.ThemeProvider,
|
|
129
|
+
{
|
|
130
|
+
brandConfig: brandConfig ?? kaleidoswapBrandConfig,
|
|
131
|
+
defaultMode,
|
|
132
|
+
children
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// src/native/index.ts
|
|
138
|
+
var import_wdk_uikit_react_native2 = require("@tetherto/wdk-uikit-react-native");
|
|
139
|
+
|
|
140
|
+
// src/native/components/status-badge.tsx
|
|
141
|
+
var import_react_native = require("react-native");
|
|
142
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
143
|
+
var statusConfig = {
|
|
144
|
+
success: { color: colors.primary, bg: `${colors.primary}1A`, borderColor: `${colors.primary}33`, label: "Success" },
|
|
145
|
+
completed: { color: colors.primary, bg: `${colors.primary}1A`, borderColor: `${colors.primary}33`, label: "Completed" },
|
|
146
|
+
pending: { color: "#EAB308", bg: "#EAB3081A", borderColor: "#EAB30833", label: "Pending" },
|
|
147
|
+
failed: { color: "#EF4444", bg: "#EF44441A", borderColor: "#EF444433", label: "Failed" },
|
|
148
|
+
error: { color: "#EF4444", bg: "#EF44441A", borderColor: "#EF444433", label: "Error" }
|
|
149
|
+
};
|
|
150
|
+
function StatusBadge({ status, style }) {
|
|
151
|
+
const config = statusConfig[status];
|
|
152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native.View, { style: [styles.container, { backgroundColor: config.bg, borderColor: config.borderColor }, style], children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native.Text, { style: [styles.label, { color: config.color }], children: config.label }) });
|
|
153
|
+
}
|
|
154
|
+
var styles = import_react_native.StyleSheet.create({
|
|
155
|
+
container: {
|
|
156
|
+
flexDirection: "row",
|
|
157
|
+
alignItems: "center",
|
|
158
|
+
paddingHorizontal: 10,
|
|
159
|
+
paddingVertical: 4,
|
|
160
|
+
borderRadius: 9999,
|
|
161
|
+
borderWidth: 1
|
|
162
|
+
},
|
|
163
|
+
label: {
|
|
164
|
+
fontSize: 12,
|
|
165
|
+
fontWeight: "600"
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// src/native/components/network-badge.tsx
|
|
170
|
+
var import_react_native2 = require("react-native");
|
|
171
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
172
|
+
var networkConfig = {
|
|
173
|
+
L1: { color: colors.network.bitcoin, label: "L1" },
|
|
174
|
+
LN: { color: colors.network.lightning, label: "LN" },
|
|
175
|
+
RGB20: { color: colors.network.rgb, label: "RGB" },
|
|
176
|
+
RGB21: { color: colors.network.rgb, label: "RGB21" },
|
|
177
|
+
"RGB-L1": { color: colors.network.rgb, label: "RGB L1" },
|
|
178
|
+
"RGB-LN": { color: colors.network.rgb, label: "RGB LN" },
|
|
179
|
+
Spark: { color: colors.network.spark, label: "Spark" },
|
|
180
|
+
Arkade: { color: colors.network.arkade, label: "Arkade" }
|
|
181
|
+
};
|
|
182
|
+
function NetworkBadge({ network, style }) {
|
|
183
|
+
const config = networkConfig[network];
|
|
184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native2.View, { style: [styles2.container, { backgroundColor: `${config.color}1A`, borderColor: `${config.color}33` }, style], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native2.Text, { style: [styles2.label, { color: config.color }], children: config.label }) });
|
|
185
|
+
}
|
|
186
|
+
var styles2 = import_react_native2.StyleSheet.create({
|
|
187
|
+
container: {
|
|
188
|
+
flexDirection: "row",
|
|
189
|
+
alignItems: "center",
|
|
190
|
+
justifyContent: "center",
|
|
191
|
+
paddingHorizontal: 8,
|
|
192
|
+
paddingVertical: 2,
|
|
193
|
+
borderRadius: 9999,
|
|
194
|
+
borderWidth: 1
|
|
195
|
+
},
|
|
196
|
+
label: {
|
|
197
|
+
fontSize: 10,
|
|
198
|
+
fontWeight: "700"
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// src/native/components/alert-banner.tsx
|
|
203
|
+
var import_react_native3 = require("react-native");
|
|
204
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
205
|
+
var variantConfig = {
|
|
206
|
+
error: { bg: "#EF44441A", borderColor: "#EF444433", iconColor: "#F87171" },
|
|
207
|
+
warning: { bg: "#F59E0B1A", borderColor: "#F59E0B33", iconColor: "#FBBF24" },
|
|
208
|
+
info: { bg: "#3B82F61A", borderColor: "#3B82F633", iconColor: "#60A5FA" },
|
|
209
|
+
success: { bg: `${colors.primary}1A`, borderColor: `${colors.primary}33`, iconColor: colors.primary }
|
|
210
|
+
};
|
|
211
|
+
function AlertBanner({ variant = "info", children, style }) {
|
|
212
|
+
const config = variantConfig[variant];
|
|
213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native3.View, { style: [styles3.container, { backgroundColor: config.bg, borderColor: config.borderColor }, style], children: typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native3.Text, { style: styles3.text, children }) : children });
|
|
214
|
+
}
|
|
215
|
+
var styles3 = import_react_native3.StyleSheet.create({
|
|
216
|
+
container: {
|
|
217
|
+
borderRadius: 12,
|
|
218
|
+
borderWidth: 1,
|
|
219
|
+
padding: 12,
|
|
220
|
+
flexDirection: "row",
|
|
221
|
+
alignItems: "flex-start",
|
|
222
|
+
gap: 8
|
|
223
|
+
},
|
|
224
|
+
text: {
|
|
225
|
+
fontSize: 14,
|
|
226
|
+
color: "#FFFFFF",
|
|
227
|
+
flex: 1
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
// src/native/components/section-label.tsx
|
|
232
|
+
var import_react_native4 = require("react-native");
|
|
233
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
234
|
+
function SectionLabel({ children, style }) {
|
|
235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native4.Text, { style: [styles4.label, style], children: typeof children === "string" ? children.toUpperCase() : children });
|
|
236
|
+
}
|
|
237
|
+
var styles4 = import_react_native4.StyleSheet.create({
|
|
238
|
+
label: {
|
|
239
|
+
fontSize: 10,
|
|
240
|
+
fontWeight: "900",
|
|
241
|
+
letterSpacing: 2.2,
|
|
242
|
+
color: "rgba(255, 255, 255, 0.3)"
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
// src/tokens/typography.ts
|
|
247
|
+
var fontFamily = {
|
|
248
|
+
display: "'Geist Sans', system-ui, -apple-system, sans-serif",
|
|
249
|
+
mono: "'Geist Mono', monospace"
|
|
250
|
+
};
|
|
251
|
+
var typeScale = {
|
|
252
|
+
xxs: ["10px", "14px"],
|
|
253
|
+
tiny: ["11px", "16px"],
|
|
254
|
+
caption: ["13px", "18px"],
|
|
255
|
+
body: ["15px", "22px"],
|
|
256
|
+
subhead: ["17px", "24px"],
|
|
257
|
+
title: ["20px", "28px"],
|
|
258
|
+
headline: ["28px", "34px"],
|
|
259
|
+
display: ["36px", "40px"]
|
|
260
|
+
};
|
|
261
|
+
var fontWeight = {
|
|
262
|
+
normal: "400",
|
|
263
|
+
medium: "500",
|
|
264
|
+
semibold: "600",
|
|
265
|
+
bold: "700"
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
// src/tokens/radius.ts
|
|
269
|
+
var radius = {
|
|
270
|
+
sm: "8px",
|
|
271
|
+
md: "12px",
|
|
272
|
+
lg: "16px",
|
|
273
|
+
xl: "20px",
|
|
274
|
+
card: "20px",
|
|
275
|
+
panel: "22px",
|
|
276
|
+
pill: "24px",
|
|
277
|
+
nav: "14px",
|
|
278
|
+
full: "9999px"
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
// src/tokens/shadows.ts
|
|
282
|
+
var shadow = {
|
|
283
|
+
glow: "0 0 20px rgba(43, 238, 121, 0.15)",
|
|
284
|
+
glowStrong: "0 0 30px rgba(43, 238, 121, 0.3)",
|
|
285
|
+
glowSubtle: "0 0 15px rgba(43, 238, 121, 0.15)",
|
|
286
|
+
glowAccent: "0 4px 30px rgba(43, 238, 121, 0.25)"
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
// src/tokens/transitions.ts
|
|
290
|
+
var transition = {
|
|
291
|
+
fast: "150ms ease-out",
|
|
292
|
+
default: "200ms ease-out",
|
|
293
|
+
slow: "300ms ease-out"
|
|
294
|
+
};
|
|
295
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
296
|
+
0 && (module.exports = {
|
|
297
|
+
AlertBanner,
|
|
298
|
+
AmountInput,
|
|
299
|
+
AssetSelector,
|
|
300
|
+
Balance,
|
|
301
|
+
CryptoAddressInput,
|
|
302
|
+
KaleidoThemeProvider,
|
|
303
|
+
NetworkBadge,
|
|
304
|
+
NetworkSelector,
|
|
305
|
+
QRCode,
|
|
306
|
+
SectionLabel,
|
|
307
|
+
SeedPhrase,
|
|
308
|
+
StatusBadge,
|
|
309
|
+
ThemeProvider,
|
|
310
|
+
TransactionItem,
|
|
311
|
+
TransactionList,
|
|
312
|
+
colors,
|
|
313
|
+
fontFamily,
|
|
314
|
+
fontWeight,
|
|
315
|
+
kaleidoswapBrandConfig,
|
|
316
|
+
kaleidoswapTokens,
|
|
317
|
+
radius,
|
|
318
|
+
shadow,
|
|
319
|
+
transition,
|
|
320
|
+
typeScale,
|
|
321
|
+
useTheme
|
|
322
|
+
});
|