kaleido-ui 0.1.46 → 0.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/native/index.cjs +736 -15
- package/dist/native/index.d.cts +274 -2
- package/dist/native/index.d.ts +274 -2
- package/dist/native/index.js +711 -11
- package/dist/tokens/index.cjs +130 -0
- package/dist/tokens/index.d.cts +140 -1
- package/dist/tokens/index.d.ts +140 -1
- package/dist/tokens/index.js +127 -0
- package/package.json +6 -1
package/dist/native/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,20 +17,39 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/native/index.ts
|
|
21
31
|
var native_exports = {};
|
|
22
32
|
__export(native_exports, {
|
|
33
|
+
ActionButton: () => ActionButton,
|
|
23
34
|
AlertBanner: () => AlertBanner,
|
|
24
35
|
AmountInput: () => import_wdk_uikit_react_native2.AmountInput,
|
|
25
36
|
AssetSelector: () => import_wdk_uikit_react_native2.AssetSelector,
|
|
26
37
|
Balance: () => import_wdk_uikit_react_native2.Balance,
|
|
38
|
+
BalanceCard: () => BalanceCard,
|
|
27
39
|
CryptoAddressInput: () => import_wdk_uikit_react_native2.CryptoAddressInput,
|
|
40
|
+
EmptyState: () => EmptyState,
|
|
41
|
+
KButton: () => KButton,
|
|
42
|
+
KCard: () => KCard,
|
|
43
|
+
KScreen: () => KScreen,
|
|
44
|
+
KText: () => KText,
|
|
28
45
|
KaleidoThemeProvider: () => KaleidoThemeProvider,
|
|
46
|
+
KaleidoUIProvider: () => KaleidoUIProvider,
|
|
47
|
+
ModeToggle: () => ModeToggle,
|
|
29
48
|
NetworkBadge: () => NetworkBadge,
|
|
49
|
+
NetworkChip: () => NetworkChip,
|
|
30
50
|
NetworkSelector: () => import_wdk_uikit_react_native2.NetworkSelector,
|
|
31
51
|
QRCode: () => import_wdk_uikit_react_native2.QRCode,
|
|
52
|
+
QrCode: () => QrCode,
|
|
32
53
|
SectionLabel: () => SectionLabel,
|
|
33
54
|
SeedPhrase: () => import_wdk_uikit_react_native2.SeedPhrase,
|
|
34
55
|
StatusBadge: () => StatusBadge,
|
|
@@ -40,10 +61,14 @@ __export(native_exports, {
|
|
|
40
61
|
fontWeight: () => fontWeight,
|
|
41
62
|
kaleidoswapBrandConfig: () => kaleidoswapBrandConfig,
|
|
42
63
|
kaleidoswapTokens: () => kaleidoswapTokens,
|
|
64
|
+
makeTheme: () => makeTheme,
|
|
65
|
+
nativeType: () => nativeType,
|
|
43
66
|
radius: () => radius,
|
|
44
67
|
shadow: () => shadow,
|
|
68
|
+
themes: () => themes,
|
|
45
69
|
transition: () => transition,
|
|
46
70
|
typeScale: () => typeScale,
|
|
71
|
+
useKaleidoTheme: () => useKaleidoTheme,
|
|
47
72
|
useTheme: () => import_wdk_uikit_react_native2.useTheme
|
|
48
73
|
});
|
|
49
74
|
module.exports = __toCommonJS(native_exports);
|
|
@@ -208,9 +233,149 @@ function KaleidoThemeProvider({
|
|
|
208
233
|
// src/native/index.ts
|
|
209
234
|
var import_wdk_uikit_react_native2 = require("@tetherto/wdk-uikit-react-native");
|
|
210
235
|
|
|
211
|
-
// src/native/components/
|
|
236
|
+
// src/native/components/qr-code.tsx
|
|
237
|
+
var import_react = require("react");
|
|
212
238
|
var import_react_native = require("react-native");
|
|
239
|
+
var import_react_native_svg = __toESM(require("react-native-svg"), 1);
|
|
240
|
+
var import_qr = __toESM(require("qr"), 1);
|
|
213
241
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
242
|
+
function isFinderPattern(row, col, size) {
|
|
243
|
+
if (row < 7 && col < 7) return true;
|
|
244
|
+
if (row < 7 && col >= size - 7) return true;
|
|
245
|
+
if (row >= size - 7 && col < 7) return true;
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
function isLogoZone(row, col, size, logoModules) {
|
|
249
|
+
const center = size / 2;
|
|
250
|
+
const half = logoModules / 2;
|
|
251
|
+
return row >= center - half && row < center + half && col >= center - half && col < center + half;
|
|
252
|
+
}
|
|
253
|
+
function renderFinderPattern(originX, originY, moduleSize, fg, bg, key) {
|
|
254
|
+
const r = moduleSize * 0.6;
|
|
255
|
+
return [
|
|
256
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
257
|
+
import_react_native_svg.Rect,
|
|
258
|
+
{
|
|
259
|
+
x: originX,
|
|
260
|
+
y: originY,
|
|
261
|
+
width: moduleSize * 7,
|
|
262
|
+
height: moduleSize * 7,
|
|
263
|
+
rx: r * 2.5,
|
|
264
|
+
ry: r * 2.5,
|
|
265
|
+
fill: fg
|
|
266
|
+
},
|
|
267
|
+
`${key}-o`
|
|
268
|
+
),
|
|
269
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
270
|
+
import_react_native_svg.Rect,
|
|
271
|
+
{
|
|
272
|
+
x: originX + moduleSize,
|
|
273
|
+
y: originY + moduleSize,
|
|
274
|
+
width: moduleSize * 5,
|
|
275
|
+
height: moduleSize * 5,
|
|
276
|
+
rx: r * 1.8,
|
|
277
|
+
ry: r * 1.8,
|
|
278
|
+
fill: bg
|
|
279
|
+
},
|
|
280
|
+
`${key}-i`
|
|
281
|
+
),
|
|
282
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
283
|
+
import_react_native_svg.Rect,
|
|
284
|
+
{
|
|
285
|
+
x: originX + moduleSize * 2,
|
|
286
|
+
y: originY + moduleSize * 2,
|
|
287
|
+
width: moduleSize * 3,
|
|
288
|
+
height: moduleSize * 3,
|
|
289
|
+
rx: r * 1.2,
|
|
290
|
+
ry: r * 1.2,
|
|
291
|
+
fill: fg
|
|
292
|
+
},
|
|
293
|
+
`${key}-c`
|
|
294
|
+
)
|
|
295
|
+
];
|
|
296
|
+
}
|
|
297
|
+
var LOGO_VIEWBOX = 412;
|
|
298
|
+
var LogoPaths = () => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
299
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native_svg.Path, { d: "M137.306 411.865H0.000244141L68.6795 343.29L137.306 411.865Z", fill: "#6F32FF" }),
|
|
300
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native_svg.Path, { d: "M0 0H137.306L68.6267 68.574L0 0Z", fill: "#6F32FF" }),
|
|
301
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native_svg.Path, { d: "M137.148 274.559H274.455L411.708 411.866H274.401L137.148 274.559Z", fill: "#17B581" }),
|
|
302
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
303
|
+
import_react_native_svg.Path,
|
|
304
|
+
{
|
|
305
|
+
d: "M137.149 274.559L68.6274 205.933L137.201 137.306L274.455 137.411L205.776 206.038L274.456 274.559H137.149Z",
|
|
306
|
+
fill: "#15E99A"
|
|
307
|
+
}
|
|
308
|
+
),
|
|
309
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native_svg.Path, { d: "M274.479 0.104797H411.786L274.533 137.411H137.226L274.479 0.104797Z", fill: "#17B581" })
|
|
310
|
+
] });
|
|
311
|
+
function QrCode({
|
|
312
|
+
value,
|
|
313
|
+
size = 160,
|
|
314
|
+
color = "#040404",
|
|
315
|
+
backgroundColor = "#ffffff"
|
|
316
|
+
}) {
|
|
317
|
+
const { elements, svgSize } = (0, import_react.useMemo)(() => {
|
|
318
|
+
if (!value) return { elements: [], svgSize: 0 };
|
|
319
|
+
const matrix = (0, import_qr.default)(value, "raw", { ecc: "medium", border: 0 });
|
|
320
|
+
const n = matrix.length;
|
|
321
|
+
const moduleSize = 10;
|
|
322
|
+
const quietZone = moduleSize * 2;
|
|
323
|
+
const computedSize = n * moduleSize + quietZone * 2;
|
|
324
|
+
const fg = color;
|
|
325
|
+
const bg = backgroundColor;
|
|
326
|
+
const logoModules = Math.ceil(n * 0.2);
|
|
327
|
+
const logoZoneSize = logoModules % 2 === 0 ? logoModules + 1 : logoModules;
|
|
328
|
+
const els = [];
|
|
329
|
+
const dotRadius = moduleSize * 0.42;
|
|
330
|
+
for (let row = 0; row < n; row++) {
|
|
331
|
+
for (let col = 0; col < n; col++) {
|
|
332
|
+
if (isFinderPattern(row, col, n)) continue;
|
|
333
|
+
if (isLogoZone(row, col, n, logoZoneSize)) continue;
|
|
334
|
+
if (!matrix[row][col]) continue;
|
|
335
|
+
const cx = quietZone + col * moduleSize + moduleSize / 2;
|
|
336
|
+
const cy = quietZone + row * moduleSize + moduleSize / 2;
|
|
337
|
+
els.push(/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native_svg.Circle, { cx, cy, r: dotRadius, fill: fg }, `d-${row}-${col}`));
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
const finderPositions = [
|
|
341
|
+
[0, 0],
|
|
342
|
+
[0, n - 7],
|
|
343
|
+
[n - 7, 0]
|
|
344
|
+
];
|
|
345
|
+
for (const [r, c] of finderPositions) {
|
|
346
|
+
els.push(
|
|
347
|
+
...renderFinderPattern(
|
|
348
|
+
quietZone + c * moduleSize,
|
|
349
|
+
quietZone + r * moduleSize,
|
|
350
|
+
moduleSize,
|
|
351
|
+
fg,
|
|
352
|
+
bg,
|
|
353
|
+
`fp-${r}-${c}`
|
|
354
|
+
)
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
const centerX = quietZone + n * moduleSize / 2;
|
|
358
|
+
const centerY = quietZone + n * moduleSize / 2;
|
|
359
|
+
const logoCircleR = logoZoneSize * moduleSize * 0.52;
|
|
360
|
+
els.push(/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native_svg.Circle, { cx: centerX, cy: centerY, r: logoCircleR, fill: bg }, "logo-bg"));
|
|
361
|
+
const logoBox = logoCircleR * 1.35;
|
|
362
|
+
const logoX = centerX - logoBox / 2;
|
|
363
|
+
const logoY = centerY - logoBox / 2;
|
|
364
|
+
const scale = logoBox / LOGO_VIEWBOX;
|
|
365
|
+
els.push(
|
|
366
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native_svg.G, { transform: `translate(${logoX}, ${logoY}) scale(${scale})`, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LogoPaths, {}) }, "logo")
|
|
367
|
+
);
|
|
368
|
+
return { elements: els, svgSize: computedSize };
|
|
369
|
+
}, [value, color, backgroundColor]);
|
|
370
|
+
if (!value || svgSize === 0) {
|
|
371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native.View, { style: { width: size, height: size } });
|
|
372
|
+
}
|
|
373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native.View, { style: { width: size, height: size }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native_svg.default, { width: size, height: size, viewBox: `0 0 ${svgSize} ${svgSize}`, children: elements }) });
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// src/native/components/status-badge.tsx
|
|
377
|
+
var import_react_native2 = require("react-native");
|
|
378
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
214
379
|
var statusConfig = {
|
|
215
380
|
success: { color: colors.primary, bg: `${colors.primary}1A`, borderColor: `${colors.primary}33`, label: "Success" },
|
|
216
381
|
completed: { color: colors.primary, bg: `${colors.primary}1A`, borderColor: `${colors.primary}33`, label: "Completed" },
|
|
@@ -220,9 +385,9 @@ var statusConfig = {
|
|
|
220
385
|
};
|
|
221
386
|
function StatusBadge({ status, style }) {
|
|
222
387
|
const config = statusConfig[status];
|
|
223
|
-
return /* @__PURE__ */ (0,
|
|
388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native2.View, { style: [styles.container, { backgroundColor: config.bg, borderColor: config.borderColor }, style], children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native2.Text, { style: [styles.label, { color: config.color }], children: config.label }) });
|
|
224
389
|
}
|
|
225
|
-
var styles =
|
|
390
|
+
var styles = import_react_native2.StyleSheet.create({
|
|
226
391
|
container: {
|
|
227
392
|
flexDirection: "row",
|
|
228
393
|
alignItems: "center",
|
|
@@ -238,8 +403,8 @@ var styles = import_react_native.StyleSheet.create({
|
|
|
238
403
|
});
|
|
239
404
|
|
|
240
405
|
// src/native/components/network-badge.tsx
|
|
241
|
-
var
|
|
242
|
-
var
|
|
406
|
+
var import_react_native3 = require("react-native");
|
|
407
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
243
408
|
var networkConfig = {
|
|
244
409
|
L1: { color: colors.network.bitcoin, label: "L1" },
|
|
245
410
|
LN: { color: colors.network.lightning, label: "LN" },
|
|
@@ -252,9 +417,9 @@ var networkConfig = {
|
|
|
252
417
|
};
|
|
253
418
|
function NetworkBadge({ network, style }) {
|
|
254
419
|
const config = networkConfig[network];
|
|
255
|
-
return /* @__PURE__ */ (0,
|
|
420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native3.View, { style: [styles2.container, { backgroundColor: `${config.color}1A`, borderColor: `${config.color}33` }, style], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native3.Text, { style: [styles2.label, { color: config.color }], children: config.label }) });
|
|
256
421
|
}
|
|
257
|
-
var styles2 =
|
|
422
|
+
var styles2 = import_react_native3.StyleSheet.create({
|
|
258
423
|
container: {
|
|
259
424
|
flexDirection: "row",
|
|
260
425
|
alignItems: "center",
|
|
@@ -271,8 +436,8 @@ var styles2 = import_react_native2.StyleSheet.create({
|
|
|
271
436
|
});
|
|
272
437
|
|
|
273
438
|
// src/native/components/alert-banner.tsx
|
|
274
|
-
var
|
|
275
|
-
var
|
|
439
|
+
var import_react_native4 = require("react-native");
|
|
440
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
276
441
|
var variantConfig = {
|
|
277
442
|
error: { bg: `${colors.danger}1A`, borderColor: `${colors.danger}33`, iconColor: colors.danger },
|
|
278
443
|
warning: { bg: `${colors.warning}1A`, borderColor: `${colors.warning}33`, iconColor: colors.warning },
|
|
@@ -281,9 +446,9 @@ var variantConfig = {
|
|
|
281
446
|
};
|
|
282
447
|
function AlertBanner({ variant = "info", children, style }) {
|
|
283
448
|
const config = variantConfig[variant];
|
|
284
|
-
return /* @__PURE__ */ (0,
|
|
449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native4.View, { style: [styles3.container, { backgroundColor: config.bg, borderColor: config.borderColor }, style], children: typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native4.Text, { style: styles3.text, children }) : children });
|
|
285
450
|
}
|
|
286
|
-
var styles3 =
|
|
451
|
+
var styles3 = import_react_native4.StyleSheet.create({
|
|
287
452
|
container: {
|
|
288
453
|
borderRadius: 12,
|
|
289
454
|
borderWidth: 1,
|
|
@@ -300,12 +465,12 @@ var styles3 = import_react_native3.StyleSheet.create({
|
|
|
300
465
|
});
|
|
301
466
|
|
|
302
467
|
// src/native/components/section-label.tsx
|
|
303
|
-
var
|
|
304
|
-
var
|
|
468
|
+
var import_react_native5 = require("react-native");
|
|
469
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
305
470
|
function SectionLabel({ children, style }) {
|
|
306
|
-
return /* @__PURE__ */ (0,
|
|
471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native5.Text, { style: [styles4.label, style], children: typeof children === "string" ? children.toUpperCase() : children });
|
|
307
472
|
}
|
|
308
|
-
var styles4 =
|
|
473
|
+
var styles4 = import_react_native5.StyleSheet.create({
|
|
309
474
|
label: {
|
|
310
475
|
fontSize: 10,
|
|
311
476
|
fontWeight: "900",
|
|
@@ -314,6 +479,547 @@ var styles4 = import_react_native4.StyleSheet.create({
|
|
|
314
479
|
}
|
|
315
480
|
});
|
|
316
481
|
|
|
482
|
+
// src/native/theme-context.tsx
|
|
483
|
+
var import_react2 = require("react");
|
|
484
|
+
|
|
485
|
+
// src/tokens/theme.ts
|
|
486
|
+
var nativeType = {
|
|
487
|
+
mini: { size: 9, line: 12 },
|
|
488
|
+
xxs: { size: 10, line: 14 },
|
|
489
|
+
tiny: { size: 11, line: 16 },
|
|
490
|
+
caption: { size: 13, line: 18 },
|
|
491
|
+
body: { size: 15, line: 22 },
|
|
492
|
+
subhead: { size: 17, line: 24 },
|
|
493
|
+
title: { size: 20, line: 28 },
|
|
494
|
+
headline: { size: 28, line: 34 },
|
|
495
|
+
display: { size: 36, line: 40 },
|
|
496
|
+
hero: { size: 44, line: 48 }
|
|
497
|
+
};
|
|
498
|
+
var NETWORK_GLYPH = {
|
|
499
|
+
bitcoin: "#F7931A",
|
|
500
|
+
lightning: "#F6C343",
|
|
501
|
+
spark: "#FF6D00",
|
|
502
|
+
rgb: "#DD352E",
|
|
503
|
+
arkade: "#7C3AED",
|
|
504
|
+
liquid: "#22E1C9"
|
|
505
|
+
};
|
|
506
|
+
var dark = {
|
|
507
|
+
mode: "dark",
|
|
508
|
+
background: "#0D1813",
|
|
509
|
+
card: "#121C16",
|
|
510
|
+
cardElevated: "#17231C",
|
|
511
|
+
primary: "#15E99A",
|
|
512
|
+
primaryFg: "#062318",
|
|
513
|
+
violet: "#8B5CFF",
|
|
514
|
+
violetSurface: "rgba(111, 50, 255, 0.18)",
|
|
515
|
+
success: "#2BEE79",
|
|
516
|
+
warning: "#FACC15",
|
|
517
|
+
danger: "#F94040",
|
|
518
|
+
info: "#4290FF",
|
|
519
|
+
successSurface: "rgba(43, 238, 121, 0.14)",
|
|
520
|
+
warningSurface: "rgba(250, 204, 21, 0.14)",
|
|
521
|
+
dangerSurface: "rgba(249, 64, 64, 0.14)",
|
|
522
|
+
infoSurface: "rgba(66, 144, 255, 0.14)",
|
|
523
|
+
text: {
|
|
524
|
+
primary: "#FFFFFF",
|
|
525
|
+
secondary: "rgba(255, 255, 255, 0.64)",
|
|
526
|
+
muted: "rgba(255, 255, 255, 0.42)",
|
|
527
|
+
disabled: "rgba(255, 255, 255, 0.26)",
|
|
528
|
+
onAccent: "#062318",
|
|
529
|
+
onFill: "#FFFFFF"
|
|
530
|
+
},
|
|
531
|
+
border: {
|
|
532
|
+
subtle: "rgba(255, 255, 255, 0.06)",
|
|
533
|
+
default: "rgba(255, 255, 255, 0.10)",
|
|
534
|
+
strong: "rgba(255, 255, 255, 0.16)"
|
|
535
|
+
},
|
|
536
|
+
surface: {
|
|
537
|
+
base: "rgba(255, 255, 255, 0.03)",
|
|
538
|
+
raised: "rgba(255, 255, 255, 0.06)",
|
|
539
|
+
sunken: "rgba(0, 0, 0, 0.22)",
|
|
540
|
+
overlay: "rgba(0, 0, 0, 0.55)",
|
|
541
|
+
scrim: "rgba(0, 0, 0, 0.70)"
|
|
542
|
+
},
|
|
543
|
+
network: NETWORK_GLYPH,
|
|
544
|
+
networkSurface: {
|
|
545
|
+
bitcoin: "#3A2D18",
|
|
546
|
+
lightning: "#39351A",
|
|
547
|
+
spark: "#3A2A1C",
|
|
548
|
+
rgb: "#3C2422",
|
|
549
|
+
arkade: "#2E2548",
|
|
550
|
+
liquid: "#0E2A2C"
|
|
551
|
+
},
|
|
552
|
+
tx: { sent: "#F94040", receive: "#2BEE79", swap: "#4290FF" },
|
|
553
|
+
gradientBrand: ["#15E99A", "#6F32FF"]
|
|
554
|
+
};
|
|
555
|
+
var light = {
|
|
556
|
+
mode: "light",
|
|
557
|
+
background: "#F4F5F2",
|
|
558
|
+
card: "#FFFFFF",
|
|
559
|
+
cardElevated: "#FFFFFF",
|
|
560
|
+
primary: "#13D88E",
|
|
561
|
+
primaryFg: "#04231A",
|
|
562
|
+
violet: "#6F32FF",
|
|
563
|
+
violetSurface: "rgba(111, 50, 255, 0.12)",
|
|
564
|
+
success: "#0FB67C",
|
|
565
|
+
warning: "#C8881A",
|
|
566
|
+
danger: "#E2403B",
|
|
567
|
+
info: "#2F73E0",
|
|
568
|
+
successSurface: "rgba(15, 182, 124, 0.12)",
|
|
569
|
+
warningSurface: "rgba(200, 136, 26, 0.12)",
|
|
570
|
+
dangerSurface: "rgba(226, 64, 59, 0.12)",
|
|
571
|
+
infoSurface: "rgba(47, 115, 224, 0.12)",
|
|
572
|
+
text: {
|
|
573
|
+
primary: "#0D1813",
|
|
574
|
+
secondary: "rgba(13, 24, 19, 0.62)",
|
|
575
|
+
muted: "rgba(13, 24, 19, 0.44)",
|
|
576
|
+
disabled: "rgba(13, 24, 19, 0.26)",
|
|
577
|
+
onAccent: "#04231A",
|
|
578
|
+
onFill: "#FFFFFF"
|
|
579
|
+
},
|
|
580
|
+
border: {
|
|
581
|
+
subtle: "rgba(13, 24, 19, 0.06)",
|
|
582
|
+
default: "rgba(13, 24, 19, 0.10)",
|
|
583
|
+
strong: "rgba(13, 24, 19, 0.16)"
|
|
584
|
+
},
|
|
585
|
+
surface: {
|
|
586
|
+
base: "rgba(13, 24, 19, 0.02)",
|
|
587
|
+
raised: "rgba(13, 24, 19, 0.04)",
|
|
588
|
+
sunken: "rgba(13, 24, 19, 0.04)",
|
|
589
|
+
overlay: "rgba(13, 24, 19, 0.40)",
|
|
590
|
+
scrim: "rgba(13, 24, 19, 0.55)"
|
|
591
|
+
},
|
|
592
|
+
network: NETWORK_GLYPH,
|
|
593
|
+
networkSurface: {
|
|
594
|
+
bitcoin: "#FBEFD9",
|
|
595
|
+
lightning: "#FCF6D6",
|
|
596
|
+
spark: "#FFE7D6",
|
|
597
|
+
rgb: "#FBE3E1",
|
|
598
|
+
arkade: "#ECE4FF",
|
|
599
|
+
liquid: "#D8F5F1"
|
|
600
|
+
},
|
|
601
|
+
tx: { sent: "#E2403B", receive: "#0FB67C", swap: "#2F73E0" },
|
|
602
|
+
gradientBrand: ["#15E99A", "#6F32FF"]
|
|
603
|
+
};
|
|
604
|
+
var themes = { light, dark };
|
|
605
|
+
function makeTheme(mode) {
|
|
606
|
+
return themes[mode];
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// src/native/theme-context.tsx
|
|
610
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
611
|
+
var KaleidoThemeContext = (0, import_react2.createContext)(null);
|
|
612
|
+
function KaleidoUIProvider({
|
|
613
|
+
children,
|
|
614
|
+
mode: controlledMode,
|
|
615
|
+
defaultMode = "dark",
|
|
616
|
+
onModeChange,
|
|
617
|
+
fontFamily: fontFamily2
|
|
618
|
+
}) {
|
|
619
|
+
const [internalMode, setInternalMode] = (0, import_react2.useState)(defaultMode);
|
|
620
|
+
const activeMode = controlledMode ?? internalMode;
|
|
621
|
+
const setMode = (next) => {
|
|
622
|
+
if (controlledMode === void 0) setInternalMode(next);
|
|
623
|
+
onModeChange?.(next);
|
|
624
|
+
};
|
|
625
|
+
const toggleMode = () => setMode(activeMode === "dark" ? "light" : "dark");
|
|
626
|
+
const value = (0, import_react2.useMemo)(
|
|
627
|
+
() => ({ theme: makeTheme(activeMode), mode: activeMode, fontFamily: fontFamily2, setMode, toggleMode }),
|
|
628
|
+
// setMode/toggleMode are stable enough for this context's purpose
|
|
629
|
+
[activeMode, fontFamily2]
|
|
630
|
+
);
|
|
631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(KaleidoThemeContext.Provider, { value, children });
|
|
632
|
+
}
|
|
633
|
+
function useKaleidoTheme() {
|
|
634
|
+
const ctx = (0, import_react2.useContext)(KaleidoThemeContext);
|
|
635
|
+
if (ctx) return ctx;
|
|
636
|
+
return {
|
|
637
|
+
theme: makeTheme("dark"),
|
|
638
|
+
mode: "dark",
|
|
639
|
+
fontFamily: void 0,
|
|
640
|
+
setMode: () => {
|
|
641
|
+
},
|
|
642
|
+
toggleMode: () => {
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
// src/native/components/k-text.tsx
|
|
648
|
+
var import_react_native6 = require("react-native");
|
|
649
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
650
|
+
var WEIGHT_MAP = {
|
|
651
|
+
normal: "400",
|
|
652
|
+
medium: "500",
|
|
653
|
+
semibold: "600",
|
|
654
|
+
bold: "700"
|
|
655
|
+
};
|
|
656
|
+
function KText({
|
|
657
|
+
variant = "body",
|
|
658
|
+
weight = "normal",
|
|
659
|
+
tone = "primary",
|
|
660
|
+
color,
|
|
661
|
+
eyebrow = false,
|
|
662
|
+
center = false,
|
|
663
|
+
style,
|
|
664
|
+
children,
|
|
665
|
+
...rest
|
|
666
|
+
}) {
|
|
667
|
+
const { theme, fontFamily: fontFamily2 } = useKaleidoTheme();
|
|
668
|
+
const scale = nativeType[variant];
|
|
669
|
+
const toneColor = color ?? (tone === "accent" ? theme.primary : tone === "violet" ? theme.violet : tone === "success" ? theme.success : tone === "warning" ? theme.warning : tone === "danger" ? theme.danger : theme.text[tone]);
|
|
670
|
+
const tracking = eyebrow ? 1.2 : scale.size >= 28 ? -0.5 : 0;
|
|
671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
672
|
+
import_react_native6.Text,
|
|
673
|
+
{
|
|
674
|
+
...rest,
|
|
675
|
+
style: [
|
|
676
|
+
{
|
|
677
|
+
fontFamily: fontFamily2,
|
|
678
|
+
fontSize: scale.size,
|
|
679
|
+
lineHeight: scale.line,
|
|
680
|
+
fontWeight: WEIGHT_MAP[weight],
|
|
681
|
+
color: toneColor,
|
|
682
|
+
letterSpacing: tracking,
|
|
683
|
+
textAlign: center ? "center" : void 0,
|
|
684
|
+
textTransform: eyebrow ? "uppercase" : void 0
|
|
685
|
+
},
|
|
686
|
+
style
|
|
687
|
+
],
|
|
688
|
+
children
|
|
689
|
+
}
|
|
690
|
+
);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
// src/native/components/k-screen.tsx
|
|
694
|
+
var import_react_native7 = require("react-native");
|
|
695
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
696
|
+
function KScreen({ elevated = false, style, children, ...rest }) {
|
|
697
|
+
const { theme, mode } = useKaleidoTheme();
|
|
698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
699
|
+
import_react_native7.View,
|
|
700
|
+
{
|
|
701
|
+
...rest,
|
|
702
|
+
style: [{ flex: 1, backgroundColor: elevated ? theme.card : theme.background }, style],
|
|
703
|
+
children: [
|
|
704
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
705
|
+
import_react_native7.StatusBar,
|
|
706
|
+
{
|
|
707
|
+
barStyle: mode === "dark" ? "light-content" : "dark-content",
|
|
708
|
+
backgroundColor: "transparent",
|
|
709
|
+
translucent: true
|
|
710
|
+
}
|
|
711
|
+
),
|
|
712
|
+
children
|
|
713
|
+
]
|
|
714
|
+
}
|
|
715
|
+
);
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
// src/native/components/k-card.tsx
|
|
719
|
+
var import_react_native8 = require("react-native");
|
|
720
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
721
|
+
function KCard({
|
|
722
|
+
variant = "default",
|
|
723
|
+
padding = 16,
|
|
724
|
+
radius: radius2 = 16,
|
|
725
|
+
bordered = true,
|
|
726
|
+
style,
|
|
727
|
+
children,
|
|
728
|
+
...rest
|
|
729
|
+
}) {
|
|
730
|
+
const { theme } = useKaleidoTheme();
|
|
731
|
+
const backgroundColor = variant === "elevated" ? theme.cardElevated : variant === "inset" ? theme.surface.base : variant === "outline" ? "transparent" : theme.card;
|
|
732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
733
|
+
import_react_native8.View,
|
|
734
|
+
{
|
|
735
|
+
...rest,
|
|
736
|
+
style: [
|
|
737
|
+
{
|
|
738
|
+
backgroundColor,
|
|
739
|
+
borderRadius: radius2,
|
|
740
|
+
padding,
|
|
741
|
+
borderWidth: bordered ? 1 : 0,
|
|
742
|
+
borderColor: theme.border.subtle
|
|
743
|
+
},
|
|
744
|
+
style
|
|
745
|
+
],
|
|
746
|
+
children
|
|
747
|
+
}
|
|
748
|
+
);
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
// src/native/components/k-button.tsx
|
|
752
|
+
var import_react_native9 = require("react-native");
|
|
753
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
754
|
+
var SIZE = {
|
|
755
|
+
sm: { h: 40, px: 16, type: "caption" },
|
|
756
|
+
md: { h: 52, px: 20, type: "body" },
|
|
757
|
+
lg: { h: 58, px: 24, type: "subhead" }
|
|
758
|
+
};
|
|
759
|
+
function KButton({
|
|
760
|
+
label,
|
|
761
|
+
variant = "primary",
|
|
762
|
+
size = "md",
|
|
763
|
+
loading = false,
|
|
764
|
+
fullWidth = false,
|
|
765
|
+
leading,
|
|
766
|
+
disabled,
|
|
767
|
+
style,
|
|
768
|
+
...rest
|
|
769
|
+
}) {
|
|
770
|
+
const { theme } = useKaleidoTheme();
|
|
771
|
+
const s = SIZE[size];
|
|
772
|
+
const isDisabled = disabled || loading;
|
|
773
|
+
const palette = (pressed) => {
|
|
774
|
+
switch (variant) {
|
|
775
|
+
case "secondary":
|
|
776
|
+
return { bg: pressed ? theme.surface.raised : "transparent", border: theme.border.strong, fg: theme.text.primary };
|
|
777
|
+
case "violet":
|
|
778
|
+
return { bg: theme.violet, border: theme.violet, fg: theme.text.onFill };
|
|
779
|
+
case "ghost":
|
|
780
|
+
return { bg: pressed ? theme.surface.base : "transparent", border: "transparent", fg: theme.primary };
|
|
781
|
+
case "danger":
|
|
782
|
+
return { bg: theme.danger, border: theme.danger, fg: theme.text.onFill };
|
|
783
|
+
case "primary":
|
|
784
|
+
default:
|
|
785
|
+
return { bg: theme.primary, border: theme.primary, fg: theme.primaryFg };
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
789
|
+
import_react_native9.Pressable,
|
|
790
|
+
{
|
|
791
|
+
accessibilityRole: "button",
|
|
792
|
+
accessibilityState: { disabled: !!isDisabled, busy: loading },
|
|
793
|
+
disabled: isDisabled,
|
|
794
|
+
style: ({ pressed }) => {
|
|
795
|
+
const p = palette(pressed);
|
|
796
|
+
return {
|
|
797
|
+
height: s.h,
|
|
798
|
+
paddingHorizontal: s.px,
|
|
799
|
+
borderRadius: 14,
|
|
800
|
+
borderWidth: 1,
|
|
801
|
+
borderColor: p.border,
|
|
802
|
+
backgroundColor: p.bg,
|
|
803
|
+
alignItems: "center",
|
|
804
|
+
justifyContent: "center",
|
|
805
|
+
flexDirection: "row",
|
|
806
|
+
alignSelf: fullWidth ? "stretch" : "flex-start",
|
|
807
|
+
opacity: isDisabled ? 0.45 : pressed ? 0.92 : 1,
|
|
808
|
+
...style
|
|
809
|
+
};
|
|
810
|
+
},
|
|
811
|
+
...rest,
|
|
812
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native9.ActivityIndicator, { color: palette(false).fg }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native9.View, { style: { flexDirection: "row", alignItems: "center", gap: 8 }, children: [
|
|
813
|
+
leading,
|
|
814
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(KText, { variant: s.type, weight: "bold", color: palette(false).fg, children: label })
|
|
815
|
+
] })
|
|
816
|
+
}
|
|
817
|
+
);
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
// src/native/components/action-button.tsx
|
|
821
|
+
var import_react_native10 = require("react-native");
|
|
822
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
823
|
+
function ActionButton({
|
|
824
|
+
label,
|
|
825
|
+
icon,
|
|
826
|
+
onPress,
|
|
827
|
+
tone = "neutral",
|
|
828
|
+
filled = false,
|
|
829
|
+
disabled = false,
|
|
830
|
+
size = 56
|
|
831
|
+
}) {
|
|
832
|
+
const { theme } = useKaleidoTheme();
|
|
833
|
+
const accent = tone === "violet" ? theme.violet : tone === "primary" ? theme.primary : theme.text.primary;
|
|
834
|
+
const tileBg = filled ? accent : theme.surface.raised;
|
|
835
|
+
const glyphColor = filled ? tone === "violet" ? theme.text.onFill : theme.primaryFg : accent;
|
|
836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
837
|
+
import_react_native10.Pressable,
|
|
838
|
+
{
|
|
839
|
+
onPress,
|
|
840
|
+
disabled,
|
|
841
|
+
accessibilityRole: "button",
|
|
842
|
+
accessibilityLabel: label,
|
|
843
|
+
style: ({ pressed }) => ({
|
|
844
|
+
alignItems: "center",
|
|
845
|
+
gap: 8,
|
|
846
|
+
opacity: disabled ? 0.4 : pressed ? 0.85 : 1
|
|
847
|
+
}),
|
|
848
|
+
children: [
|
|
849
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
850
|
+
import_react_native10.View,
|
|
851
|
+
{
|
|
852
|
+
style: {
|
|
853
|
+
width: size,
|
|
854
|
+
height: size,
|
|
855
|
+
borderRadius: size / 2,
|
|
856
|
+
backgroundColor: tileBg,
|
|
857
|
+
borderWidth: filled ? 0 : 1,
|
|
858
|
+
borderColor: theme.border.subtle,
|
|
859
|
+
alignItems: "center",
|
|
860
|
+
justifyContent: "center"
|
|
861
|
+
},
|
|
862
|
+
children: icon(glyphColor, Math.round(size * 0.42))
|
|
863
|
+
}
|
|
864
|
+
),
|
|
865
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(KText, { variant: "caption", weight: "medium", tone: "secondary", children: label })
|
|
866
|
+
]
|
|
867
|
+
}
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
// src/native/components/balance-card.tsx
|
|
872
|
+
var import_react_native11 = require("react-native");
|
|
873
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
874
|
+
function BalanceCard({
|
|
875
|
+
label = "Total Balance",
|
|
876
|
+
amount,
|
|
877
|
+
unit,
|
|
878
|
+
fiat,
|
|
879
|
+
footer,
|
|
880
|
+
style,
|
|
881
|
+
...rest
|
|
882
|
+
}) {
|
|
883
|
+
const { theme } = useKaleidoTheme();
|
|
884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native11.View, { ...rest, style: [{ alignItems: "center", gap: 6 }, style], children: [
|
|
885
|
+
!!label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(KText, { variant: "caption", weight: "medium", tone: "muted", eyebrow: true, children: label }),
|
|
886
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native11.View, { style: { flexDirection: "row", alignItems: "baseline", gap: 8 }, children: [
|
|
887
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(KText, { variant: "hero", weight: "bold", tone: "primary", children: amount }),
|
|
888
|
+
!!unit && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(KText, { variant: "title", weight: "medium", tone: "secondary", children: unit })
|
|
889
|
+
] }),
|
|
890
|
+
!!fiat && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(KText, { variant: "body", weight: "medium", color: theme.text.muted, children: fiat }),
|
|
891
|
+
footer
|
|
892
|
+
] });
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
// src/native/components/network-chip.tsx
|
|
896
|
+
var import_react_native12 = require("react-native");
|
|
897
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
898
|
+
function NetworkChip({
|
|
899
|
+
network,
|
|
900
|
+
title,
|
|
901
|
+
subtitle,
|
|
902
|
+
selected = false,
|
|
903
|
+
onPress,
|
|
904
|
+
icon,
|
|
905
|
+
dot = false
|
|
906
|
+
}) {
|
|
907
|
+
const { theme } = useKaleidoTheme();
|
|
908
|
+
const glyph = network ? theme.network[network] : theme.text.secondary;
|
|
909
|
+
const glyphBg = network ? theme.networkSurface[network] : theme.surface.raised;
|
|
910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
911
|
+
import_react_native12.Pressable,
|
|
912
|
+
{
|
|
913
|
+
onPress,
|
|
914
|
+
accessibilityRole: "button",
|
|
915
|
+
accessibilityState: { selected },
|
|
916
|
+
style: ({ pressed }) => ({
|
|
917
|
+
flexDirection: "row",
|
|
918
|
+
alignItems: "center",
|
|
919
|
+
gap: 10,
|
|
920
|
+
paddingVertical: 10,
|
|
921
|
+
paddingHorizontal: 12,
|
|
922
|
+
borderRadius: 14,
|
|
923
|
+
backgroundColor: selected ? theme.violetSurface : theme.surface.base,
|
|
924
|
+
borderWidth: 1.5,
|
|
925
|
+
borderColor: selected ? theme.violet : theme.border.subtle,
|
|
926
|
+
opacity: pressed ? 0.9 : 1
|
|
927
|
+
}),
|
|
928
|
+
children: [
|
|
929
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
930
|
+
import_react_native12.View,
|
|
931
|
+
{
|
|
932
|
+
style: {
|
|
933
|
+
width: 30,
|
|
934
|
+
height: 30,
|
|
935
|
+
borderRadius: 15,
|
|
936
|
+
backgroundColor: glyphBg,
|
|
937
|
+
alignItems: "center",
|
|
938
|
+
justifyContent: "center"
|
|
939
|
+
},
|
|
940
|
+
children: icon(glyph, 16)
|
|
941
|
+
}
|
|
942
|
+
),
|
|
943
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native12.View, { style: { gap: 1 }, children: [
|
|
944
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(KText, { variant: "caption", weight: "bold", color: selected ? theme.violet : theme.text.primary, children: title }),
|
|
945
|
+
!!subtitle && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(KText, { variant: "mini", weight: "medium", tone: "muted", children: subtitle })
|
|
946
|
+
] }),
|
|
947
|
+
dot && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
948
|
+
import_react_native12.View,
|
|
949
|
+
{
|
|
950
|
+
style: {
|
|
951
|
+
width: 7,
|
|
952
|
+
height: 7,
|
|
953
|
+
borderRadius: 4,
|
|
954
|
+
backgroundColor: theme.primary,
|
|
955
|
+
marginLeft: 2
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
)
|
|
959
|
+
]
|
|
960
|
+
}
|
|
961
|
+
);
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
// src/native/components/empty-state.tsx
|
|
965
|
+
var import_react_native13 = require("react-native");
|
|
966
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
967
|
+
function EmptyState({ title, description, icon, action, style, ...rest }) {
|
|
968
|
+
const { theme } = useKaleidoTheme();
|
|
969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { ...rest, style: [{ alignItems: "center", paddingVertical: 36, gap: 12 }, style], children: [
|
|
970
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
971
|
+
import_react_native13.View,
|
|
972
|
+
{
|
|
973
|
+
style: {
|
|
974
|
+
width: 64,
|
|
975
|
+
height: 64,
|
|
976
|
+
borderRadius: 32,
|
|
977
|
+
backgroundColor: theme.surface.raised,
|
|
978
|
+
alignItems: "center",
|
|
979
|
+
justifyContent: "center"
|
|
980
|
+
},
|
|
981
|
+
children: icon(theme.text.muted, 28)
|
|
982
|
+
}
|
|
983
|
+
),
|
|
984
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: { alignItems: "center", gap: 4 }, children: [
|
|
985
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(KText, { variant: "subhead", weight: "bold", tone: "primary", center: true, children: title }),
|
|
986
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(KText, { variant: "caption", tone: "muted", center: true, children: description })
|
|
987
|
+
] }),
|
|
988
|
+
action
|
|
989
|
+
] });
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
// src/native/components/mode-toggle.tsx
|
|
993
|
+
var import_react_native14 = require("react-native");
|
|
994
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
995
|
+
function ModeToggle({ icon, size = 40, onToggle }) {
|
|
996
|
+
const { theme, mode, toggleMode } = useKaleidoTheme();
|
|
997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
998
|
+
import_react_native14.Pressable,
|
|
999
|
+
{
|
|
1000
|
+
accessibilityRole: "switch",
|
|
1001
|
+
accessibilityState: { checked: mode === "dark" },
|
|
1002
|
+
accessibilityLabel: mode === "dark" ? "Switch to light mode" : "Switch to dark mode",
|
|
1003
|
+
onPress: () => {
|
|
1004
|
+
toggleMode();
|
|
1005
|
+
onToggle?.(mode === "dark" ? "light" : "dark");
|
|
1006
|
+
},
|
|
1007
|
+
style: ({ pressed }) => ({
|
|
1008
|
+
width: size,
|
|
1009
|
+
height: size,
|
|
1010
|
+
borderRadius: size / 2,
|
|
1011
|
+
backgroundColor: theme.surface.raised,
|
|
1012
|
+
borderWidth: 1,
|
|
1013
|
+
borderColor: theme.border.subtle,
|
|
1014
|
+
alignItems: "center",
|
|
1015
|
+
justifyContent: "center",
|
|
1016
|
+
opacity: pressed ? 0.85 : 1
|
|
1017
|
+
}),
|
|
1018
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.View, { children: icon(mode, theme.text.primary, Math.round(size * 0.5)) })
|
|
1019
|
+
}
|
|
1020
|
+
);
|
|
1021
|
+
}
|
|
1022
|
+
|
|
317
1023
|
// src/tokens/typography.ts
|
|
318
1024
|
var fontFamily = {
|
|
319
1025
|
display: "'Satoshi', system-ui, -apple-system, sans-serif",
|
|
@@ -382,15 +1088,26 @@ var transition = {
|
|
|
382
1088
|
};
|
|
383
1089
|
// Annotate the CommonJS export names for ESM import in node:
|
|
384
1090
|
0 && (module.exports = {
|
|
1091
|
+
ActionButton,
|
|
385
1092
|
AlertBanner,
|
|
386
1093
|
AmountInput,
|
|
387
1094
|
AssetSelector,
|
|
388
1095
|
Balance,
|
|
1096
|
+
BalanceCard,
|
|
389
1097
|
CryptoAddressInput,
|
|
1098
|
+
EmptyState,
|
|
1099
|
+
KButton,
|
|
1100
|
+
KCard,
|
|
1101
|
+
KScreen,
|
|
1102
|
+
KText,
|
|
390
1103
|
KaleidoThemeProvider,
|
|
1104
|
+
KaleidoUIProvider,
|
|
1105
|
+
ModeToggle,
|
|
391
1106
|
NetworkBadge,
|
|
1107
|
+
NetworkChip,
|
|
392
1108
|
NetworkSelector,
|
|
393
1109
|
QRCode,
|
|
1110
|
+
QrCode,
|
|
394
1111
|
SectionLabel,
|
|
395
1112
|
SeedPhrase,
|
|
396
1113
|
StatusBadge,
|
|
@@ -402,9 +1119,13 @@ var transition = {
|
|
|
402
1119
|
fontWeight,
|
|
403
1120
|
kaleidoswapBrandConfig,
|
|
404
1121
|
kaleidoswapTokens,
|
|
1122
|
+
makeTheme,
|
|
1123
|
+
nativeType,
|
|
405
1124
|
radius,
|
|
406
1125
|
shadow,
|
|
1126
|
+
themes,
|
|
407
1127
|
transition,
|
|
408
1128
|
typeScale,
|
|
1129
|
+
useKaleidoTheme,
|
|
409
1130
|
useTheme
|
|
410
1131
|
});
|