kaleido-ui 0.1.48 → 0.1.50
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 +13 -6
- package/dist/native/index.d.cts +2 -1
- package/dist/native/index.d.ts +2 -1
- package/dist/native/index.js +13 -6
- package/dist/web/index.cjs +5 -2
- package/dist/web/index.d.cts +4 -1
- package/dist/web/index.d.ts +4 -1
- package/dist/web/index.js +5 -2
- package/package.json +1 -1
package/dist/native/index.cjs
CHANGED
|
@@ -234,7 +234,7 @@ function KaleidoThemeProvider({
|
|
|
234
234
|
var import_wdk_uikit_react_native2 = require("@tetherto/wdk-uikit-react-native");
|
|
235
235
|
|
|
236
236
|
// src/native/components/qr-code.tsx
|
|
237
|
-
var import_react = require("react");
|
|
237
|
+
var import_react = __toESM(require("react"), 1);
|
|
238
238
|
var import_react_native = require("react-native");
|
|
239
239
|
var import_react_native_svg = __toESM(require("react-native-svg"), 1);
|
|
240
240
|
var import_qr = __toESM(require("qr"), 1);
|
|
@@ -308,7 +308,7 @@ var LogoPaths = () => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_r
|
|
|
308
308
|
),
|
|
309
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
310
|
] });
|
|
311
|
-
function
|
|
311
|
+
function QrCodeImpl({
|
|
312
312
|
value,
|
|
313
313
|
size = 160,
|
|
314
314
|
color = "#040404",
|
|
@@ -327,6 +327,9 @@ function QrCode({
|
|
|
327
327
|
const logoZoneSize = logoModules % 2 === 0 ? logoModules + 1 : logoModules;
|
|
328
328
|
const els = [];
|
|
329
329
|
const dotRadius = moduleSize * 0.42;
|
|
330
|
+
const r = Math.round(dotRadius * 100) / 100;
|
|
331
|
+
const d2r = r * 2;
|
|
332
|
+
let dataPath = "";
|
|
330
333
|
for (let row = 0; row < n; row++) {
|
|
331
334
|
for (let col = 0; col < n; col++) {
|
|
332
335
|
if (isFinderPattern(row, col, n)) continue;
|
|
@@ -334,23 +337,26 @@ function QrCode({
|
|
|
334
337
|
if (!matrix[row][col]) continue;
|
|
335
338
|
const cx = quietZone + col * moduleSize + moduleSize / 2;
|
|
336
339
|
const cy = quietZone + row * moduleSize + moduleSize / 2;
|
|
337
|
-
|
|
340
|
+
dataPath += `M${cx - r} ${cy}a${r} ${r} 0 1 0 ${d2r} 0a${r} ${r} 0 1 0 ${-d2r} 0Z`;
|
|
338
341
|
}
|
|
339
342
|
}
|
|
343
|
+
if (dataPath) {
|
|
344
|
+
els.push(/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native_svg.Path, { d: dataPath, fill: fg }, "data"));
|
|
345
|
+
}
|
|
340
346
|
const finderPositions = [
|
|
341
347
|
[0, 0],
|
|
342
348
|
[0, n - 7],
|
|
343
349
|
[n - 7, 0]
|
|
344
350
|
];
|
|
345
|
-
for (const [
|
|
351
|
+
for (const [r2, c] of finderPositions) {
|
|
346
352
|
els.push(
|
|
347
353
|
...renderFinderPattern(
|
|
348
354
|
quietZone + c * moduleSize,
|
|
349
|
-
quietZone +
|
|
355
|
+
quietZone + r2 * moduleSize,
|
|
350
356
|
moduleSize,
|
|
351
357
|
fg,
|
|
352
358
|
bg,
|
|
353
|
-
`fp-${
|
|
359
|
+
`fp-${r2}-${c}`
|
|
354
360
|
)
|
|
355
361
|
);
|
|
356
362
|
}
|
|
@@ -372,6 +378,7 @@ function QrCode({
|
|
|
372
378
|
}
|
|
373
379
|
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
380
|
}
|
|
381
|
+
var QrCode = import_react.default.memo(QrCodeImpl);
|
|
375
382
|
|
|
376
383
|
// src/native/components/status-badge.tsx
|
|
377
384
|
var import_react_native2 = require("react-native");
|
package/dist/native/index.d.cts
CHANGED
|
@@ -65,7 +65,8 @@ interface QrCodeProps {
|
|
|
65
65
|
/** Background color used for finder eyes + logo disc. Default white. */
|
|
66
66
|
backgroundColor?: string;
|
|
67
67
|
}
|
|
68
|
-
declare function
|
|
68
|
+
declare function QrCodeImpl({ value, size, color, backgroundColor, }: QrCodeProps): react_jsx_runtime.JSX.Element;
|
|
69
|
+
declare const QrCode: React.MemoExoticComponent<typeof QrCodeImpl>;
|
|
69
70
|
|
|
70
71
|
type StatusType = 'success' | 'pending' | 'failed' | 'completed' | 'error';
|
|
71
72
|
interface StatusBadgeProps {
|
package/dist/native/index.d.ts
CHANGED
|
@@ -65,7 +65,8 @@ interface QrCodeProps {
|
|
|
65
65
|
/** Background color used for finder eyes + logo disc. Default white. */
|
|
66
66
|
backgroundColor?: string;
|
|
67
67
|
}
|
|
68
|
-
declare function
|
|
68
|
+
declare function QrCodeImpl({ value, size, color, backgroundColor, }: QrCodeProps): react_jsx_runtime.JSX.Element;
|
|
69
|
+
declare const QrCode: React.MemoExoticComponent<typeof QrCodeImpl>;
|
|
69
70
|
|
|
70
71
|
type StatusType = 'success' | 'pending' | 'failed' | 'completed' | 'error';
|
|
71
72
|
interface StatusBadgeProps {
|
package/dist/native/index.js
CHANGED
|
@@ -171,7 +171,7 @@ import {
|
|
|
171
171
|
} from "@tetherto/wdk-uikit-react-native";
|
|
172
172
|
|
|
173
173
|
// src/native/components/qr-code.tsx
|
|
174
|
-
import { useMemo } from "react";
|
|
174
|
+
import React, { useMemo } from "react";
|
|
175
175
|
import { View } from "react-native";
|
|
176
176
|
import Svg, { Rect, Circle, G, Path } from "react-native-svg";
|
|
177
177
|
import encodeQR from "qr";
|
|
@@ -245,7 +245,7 @@ var LogoPaths = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
|
245
245
|
),
|
|
246
246
|
/* @__PURE__ */ jsx2(Path, { d: "M274.479 0.104797H411.786L274.533 137.411H137.226L274.479 0.104797Z", fill: "#17B581" })
|
|
247
247
|
] });
|
|
248
|
-
function
|
|
248
|
+
function QrCodeImpl({
|
|
249
249
|
value,
|
|
250
250
|
size = 160,
|
|
251
251
|
color = "#040404",
|
|
@@ -264,6 +264,9 @@ function QrCode({
|
|
|
264
264
|
const logoZoneSize = logoModules % 2 === 0 ? logoModules + 1 : logoModules;
|
|
265
265
|
const els = [];
|
|
266
266
|
const dotRadius = moduleSize * 0.42;
|
|
267
|
+
const r = Math.round(dotRadius * 100) / 100;
|
|
268
|
+
const d2r = r * 2;
|
|
269
|
+
let dataPath = "";
|
|
267
270
|
for (let row = 0; row < n; row++) {
|
|
268
271
|
for (let col = 0; col < n; col++) {
|
|
269
272
|
if (isFinderPattern(row, col, n)) continue;
|
|
@@ -271,23 +274,26 @@ function QrCode({
|
|
|
271
274
|
if (!matrix[row][col]) continue;
|
|
272
275
|
const cx = quietZone + col * moduleSize + moduleSize / 2;
|
|
273
276
|
const cy = quietZone + row * moduleSize + moduleSize / 2;
|
|
274
|
-
|
|
277
|
+
dataPath += `M${cx - r} ${cy}a${r} ${r} 0 1 0 ${d2r} 0a${r} ${r} 0 1 0 ${-d2r} 0Z`;
|
|
275
278
|
}
|
|
276
279
|
}
|
|
280
|
+
if (dataPath) {
|
|
281
|
+
els.push(/* @__PURE__ */ jsx2(Path, { d: dataPath, fill: fg }, "data"));
|
|
282
|
+
}
|
|
277
283
|
const finderPositions = [
|
|
278
284
|
[0, 0],
|
|
279
285
|
[0, n - 7],
|
|
280
286
|
[n - 7, 0]
|
|
281
287
|
];
|
|
282
|
-
for (const [
|
|
288
|
+
for (const [r2, c] of finderPositions) {
|
|
283
289
|
els.push(
|
|
284
290
|
...renderFinderPattern(
|
|
285
291
|
quietZone + c * moduleSize,
|
|
286
|
-
quietZone +
|
|
292
|
+
quietZone + r2 * moduleSize,
|
|
287
293
|
moduleSize,
|
|
288
294
|
fg,
|
|
289
295
|
bg,
|
|
290
|
-
`fp-${
|
|
296
|
+
`fp-${r2}-${c}`
|
|
291
297
|
)
|
|
292
298
|
);
|
|
293
299
|
}
|
|
@@ -309,6 +315,7 @@ function QrCode({
|
|
|
309
315
|
}
|
|
310
316
|
return /* @__PURE__ */ jsx2(View, { style: { width: size, height: size }, children: /* @__PURE__ */ jsx2(Svg, { width: size, height: size, viewBox: `0 0 ${svgSize} ${svgSize}`, children: elements }) });
|
|
311
317
|
}
|
|
318
|
+
var QrCode = React.memo(QrCodeImpl);
|
|
312
319
|
|
|
313
320
|
// src/native/components/status-badge.tsx
|
|
314
321
|
import { View as View2, Text, StyleSheet } from "react-native";
|
package/dist/web/index.cjs
CHANGED
|
@@ -1805,6 +1805,7 @@ function AssetCard({
|
|
|
1805
1805
|
logoUri,
|
|
1806
1806
|
balanceVisible = true,
|
|
1807
1807
|
accentColor,
|
|
1808
|
+
status,
|
|
1808
1809
|
onClick,
|
|
1809
1810
|
className
|
|
1810
1811
|
}) {
|
|
@@ -1853,7 +1854,7 @@ function AssetCard({
|
|
|
1853
1854
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex flex-nowrap gap-1 mt-1", children: networks.map((network) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(NetworkBadge, { network, size: "sm" }, network)) })
|
|
1854
1855
|
] })
|
|
1855
1856
|
] }),
|
|
1856
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "min-w-0 max-w-[45%] text-right", children: [
|
|
1857
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex min-w-0 max-w-[45%] flex-col items-end text-right", children: [
|
|
1857
1858
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1858
1859
|
"p",
|
|
1859
1860
|
{
|
|
@@ -1862,7 +1863,8 @@ function AssetCard({
|
|
|
1862
1863
|
children: displayShown
|
|
1863
1864
|
}
|
|
1864
1865
|
),
|
|
1865
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "mt-0.5 truncate text-tiny font-medium uppercase tracking-wide text-muted-foreground", children: ticker })
|
|
1866
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "mt-0.5 truncate text-tiny font-medium uppercase tracking-wide text-muted-foreground", children: ticker }),
|
|
1867
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(StatusBadge, { status, className: "mt-2" })
|
|
1866
1868
|
] })
|
|
1867
1869
|
] })
|
|
1868
1870
|
]
|
|
@@ -3323,6 +3325,7 @@ function WalletAssetList({
|
|
|
3323
3325
|
logoUri: item.logoUri,
|
|
3324
3326
|
balanceVisible: item.balanceVisible,
|
|
3325
3327
|
accentColor: item.accentColor,
|
|
3328
|
+
status: item.status,
|
|
3326
3329
|
onClick: item.onClick
|
|
3327
3330
|
},
|
|
3328
3331
|
item.id
|
package/dist/web/index.d.cts
CHANGED
|
@@ -228,10 +228,12 @@ interface AssetCardProps {
|
|
|
228
228
|
balanceVisible?: boolean;
|
|
229
229
|
/** Accent color hex for the card gradient. Pass a token from `kaleido-ui/tokens` (e.g. `colors.network.bitcoin`). */
|
|
230
230
|
accentColor?: string;
|
|
231
|
+
/** Optional state badge for assets that are present but not currently spendable. */
|
|
232
|
+
status?: StatusType;
|
|
231
233
|
onClick?: () => void;
|
|
232
234
|
className?: string;
|
|
233
235
|
}
|
|
234
|
-
declare function AssetCard({ ticker, name, displayBalance, networks, logoUri, balanceVisible, accentColor, onClick, className, }: AssetCardProps): react_jsx_runtime.JSX.Element;
|
|
236
|
+
declare function AssetCard({ ticker, name, displayBalance, networks, logoUri, balanceVisible, accentColor, status, onClick, className, }: AssetCardProps): react_jsx_runtime.JSX.Element;
|
|
235
237
|
|
|
236
238
|
interface TransactionCardProps {
|
|
237
239
|
/** Direction of the transaction */
|
|
@@ -580,6 +582,7 @@ interface WalletAssetListItem {
|
|
|
580
582
|
logoUri?: string;
|
|
581
583
|
balanceVisible?: boolean;
|
|
582
584
|
accentColor?: string;
|
|
585
|
+
status?: StatusType;
|
|
583
586
|
onClick?: () => void;
|
|
584
587
|
}
|
|
585
588
|
interface WalletAssetListEmptyState {
|
package/dist/web/index.d.ts
CHANGED
|
@@ -228,10 +228,12 @@ interface AssetCardProps {
|
|
|
228
228
|
balanceVisible?: boolean;
|
|
229
229
|
/** Accent color hex for the card gradient. Pass a token from `kaleido-ui/tokens` (e.g. `colors.network.bitcoin`). */
|
|
230
230
|
accentColor?: string;
|
|
231
|
+
/** Optional state badge for assets that are present but not currently spendable. */
|
|
232
|
+
status?: StatusType;
|
|
231
233
|
onClick?: () => void;
|
|
232
234
|
className?: string;
|
|
233
235
|
}
|
|
234
|
-
declare function AssetCard({ ticker, name, displayBalance, networks, logoUri, balanceVisible, accentColor, onClick, className, }: AssetCardProps): react_jsx_runtime.JSX.Element;
|
|
236
|
+
declare function AssetCard({ ticker, name, displayBalance, networks, logoUri, balanceVisible, accentColor, status, onClick, className, }: AssetCardProps): react_jsx_runtime.JSX.Element;
|
|
235
237
|
|
|
236
238
|
interface TransactionCardProps {
|
|
237
239
|
/** Direction of the transaction */
|
|
@@ -580,6 +582,7 @@ interface WalletAssetListItem {
|
|
|
580
582
|
logoUri?: string;
|
|
581
583
|
balanceVisible?: boolean;
|
|
582
584
|
accentColor?: string;
|
|
585
|
+
status?: StatusType;
|
|
583
586
|
onClick?: () => void;
|
|
584
587
|
}
|
|
585
588
|
interface WalletAssetListEmptyState {
|
package/dist/web/index.js
CHANGED
|
@@ -1638,6 +1638,7 @@ function AssetCard({
|
|
|
1638
1638
|
logoUri,
|
|
1639
1639
|
balanceVisible = true,
|
|
1640
1640
|
accentColor,
|
|
1641
|
+
status,
|
|
1641
1642
|
onClick,
|
|
1642
1643
|
className
|
|
1643
1644
|
}) {
|
|
@@ -1686,7 +1687,7 @@ function AssetCard({
|
|
|
1686
1687
|
/* @__PURE__ */ jsx19("div", { className: "flex flex-nowrap gap-1 mt-1", children: networks.map((network) => /* @__PURE__ */ jsx19(NetworkBadge, { network, size: "sm" }, network)) })
|
|
1687
1688
|
] })
|
|
1688
1689
|
] }),
|
|
1689
|
-
/* @__PURE__ */ jsxs8("div", { className: "min-w-0 max-w-[45%] text-right", children: [
|
|
1690
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 max-w-[45%] flex-col items-end text-right", children: [
|
|
1690
1691
|
/* @__PURE__ */ jsx19(
|
|
1691
1692
|
"p",
|
|
1692
1693
|
{
|
|
@@ -1695,7 +1696,8 @@ function AssetCard({
|
|
|
1695
1696
|
children: displayShown
|
|
1696
1697
|
}
|
|
1697
1698
|
),
|
|
1698
|
-
/* @__PURE__ */ jsx19("p", { className: "mt-0.5 truncate text-tiny font-medium uppercase tracking-wide text-muted-foreground", children: ticker })
|
|
1699
|
+
/* @__PURE__ */ jsx19("p", { className: "mt-0.5 truncate text-tiny font-medium uppercase tracking-wide text-muted-foreground", children: ticker }),
|
|
1700
|
+
status && /* @__PURE__ */ jsx19(StatusBadge, { status, className: "mt-2" })
|
|
1699
1701
|
] })
|
|
1700
1702
|
] })
|
|
1701
1703
|
]
|
|
@@ -3162,6 +3164,7 @@ function WalletAssetList({
|
|
|
3162
3164
|
logoUri: item.logoUri,
|
|
3163
3165
|
balanceVisible: item.balanceVisible,
|
|
3164
3166
|
accentColor: item.accentColor,
|
|
3167
|
+
status: item.status,
|
|
3165
3168
|
onClick: item.onClick
|
|
3166
3169
|
},
|
|
3167
3170
|
item.id
|
package/package.json
CHANGED