kaleido-ui 0.2.2 → 0.2.5
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 +80 -18
- package/dist/icon-AvUL0Cws.d.cts +135 -0
- package/dist/icon-AvUL0Cws.d.ts +135 -0
- package/dist/native/index.cjs +0 -126
- package/dist/native/index.js +0 -126
- package/dist/web/assets/kaleidoswap-brand.js +11 -0
- package/dist/web/assets/protocol-icons.js +7 -0
- package/dist/web/chunk-25RRZDZ2.js +269 -0
- package/dist/web/chunk-2Q5SSNFO.js +63 -0
- package/dist/web/chunk-2VKFRAX3.js +39 -0
- package/dist/web/chunk-3CHDKHXW.js +150 -0
- package/dist/web/chunk-4BTXTIE6.js +126 -0
- package/dist/web/chunk-4L55ANVR.js +330 -0
- package/dist/web/chunk-4UMKXXAK.js +33 -0
- package/dist/web/chunk-536NL4X2.js +89 -0
- package/dist/web/chunk-563GMWFT.js +32 -0
- package/dist/web/chunk-5GBURTY4.js +33 -0
- package/dist/web/chunk-5INE4WNW.js +291 -0
- package/dist/web/chunk-5MM5YGGG.js +43 -0
- package/dist/web/chunk-5NCVH6N5.js +81 -0
- package/dist/web/chunk-5V2KMO56.js +55 -0
- package/dist/web/chunk-5WBAFYPH.js +62 -0
- package/dist/web/chunk-6PNGSAJB.js +55 -0
- package/dist/web/chunk-7L35JISL.js +106 -0
- package/dist/web/chunk-7L7DQFHJ.js +85 -0
- package/dist/web/chunk-7OE6AXLY.js +27 -0
- package/dist/web/chunk-7Y7FEBKK.js +85 -0
- package/dist/web/chunk-A6MSV4MA.js +83 -0
- package/dist/web/chunk-A7MPRLJL.js +169 -0
- package/dist/web/chunk-AMIAAHZM.js +232 -0
- package/dist/web/chunk-ASHU5XNR.js +21 -0
- package/dist/web/chunk-AU5ZGWGA.js +247 -0
- package/dist/web/chunk-AVJ56TMD.js +107 -0
- package/dist/web/chunk-AWKCO62W.js +191 -0
- package/dist/web/chunk-BGUBHWIO.js +41 -0
- package/dist/web/chunk-BYHIH2LP.js +56 -0
- package/dist/web/chunk-CBE7BT3M.js +87 -0
- package/dist/web/chunk-CJATW6EO.js +108 -0
- package/dist/web/chunk-CPIM2QKZ.js +666 -0
- package/dist/web/chunk-CRMLYZIX.js +35 -0
- package/dist/web/chunk-CXLGQSHM.js +417 -0
- package/dist/web/chunk-CXMCWSWC.js +20 -0
- package/dist/web/chunk-CXPYTWEC.js +43 -0
- package/dist/web/chunk-CZGN7SQH.js +41 -0
- package/dist/web/chunk-CZPNI33A.js +31 -0
- package/dist/web/chunk-D2ZG6TZM.js +96 -0
- package/dist/web/chunk-D5CPIS6B.js +169 -0
- package/dist/web/chunk-DCUAE6PX.js +202 -0
- package/dist/web/chunk-DUAFJ3CX.js +179 -0
- package/dist/web/chunk-DV66AZXI.js +368 -0
- package/dist/web/chunk-DY72P3EE.js +86 -0
- package/dist/web/chunk-DZMOH67F.js +43 -0
- package/dist/web/chunk-EBQ35SOM.js +177 -0
- package/dist/web/chunk-EXWE5KM6.js +48 -0
- package/dist/web/chunk-F2LIZX5K.js +140 -0
- package/dist/web/chunk-FSQV54O4.js +61 -0
- package/dist/web/chunk-G26YNXL3.js +82 -0
- package/dist/web/chunk-G2MJL3VP.js +54 -0
- package/dist/web/chunk-G2ZYNR3W.js +28 -0
- package/dist/web/chunk-GEXPB5CG.js +63 -0
- package/dist/web/chunk-GX5URFML.js +375 -0
- package/dist/web/chunk-GZZ5KVON.js +70 -0
- package/dist/web/chunk-H3GYLFHP.js +30 -0
- package/dist/web/chunk-HKF7IPXV.js +146 -0
- package/dist/web/chunk-HKIYPISK.js +175 -0
- package/dist/web/chunk-HLPL5AHD.js +54 -0
- package/dist/web/chunk-HO65ENYH.js +99 -0
- package/dist/web/chunk-HP25HN7Q.js +69 -0
- package/dist/web/chunk-HVKSBEZN.js +98 -0
- package/dist/web/chunk-HWKXZNBN.js +74 -0
- package/dist/web/chunk-HY3VMT27.js +64 -0
- package/dist/web/chunk-I2N3HZ4M.js +60 -0
- package/dist/web/chunk-I7KNV2UC.js +109 -0
- package/dist/web/chunk-INKE5FS6.js +128 -0
- package/dist/web/chunk-IWDBETXQ.js +254 -0
- package/dist/web/chunk-IZCLPO4E.js +42 -0
- package/dist/web/chunk-JY3H7ZAI.js +41 -0
- package/dist/web/chunk-JYM5NHBA.js +80 -0
- package/dist/web/chunk-K7JVP24O.js +89 -0
- package/dist/web/chunk-KDNYIMGR.js +197 -0
- package/dist/web/chunk-KMQN66HU.js +27 -0
- package/dist/web/chunk-LOGZGZWN.js +1 -0
- package/dist/web/chunk-LPDB7EHH.js +65 -0
- package/dist/web/chunk-LSY4DY2I.js +72 -0
- package/dist/web/chunk-LYLWGJ4R.js +66 -0
- package/dist/web/chunk-MKMZH4XD.js +98 -0
- package/dist/web/chunk-MTQ22SKE.js +39 -0
- package/dist/web/chunk-MTQOAMDW.js +8 -0
- package/dist/web/chunk-NEXA6VGG.js +91 -0
- package/dist/web/chunk-NHOCTXPF.js +151 -0
- package/dist/web/chunk-NNGVB3US.js +176 -0
- package/dist/web/chunk-NXPVF5WX.js +74 -0
- package/dist/web/chunk-O2TTO5FS.js +24 -0
- package/dist/web/chunk-O4IIYGDL.js +70 -0
- package/dist/web/chunk-OI7WX7NE.js +17 -0
- package/dist/web/chunk-OWSKP527.js +80 -0
- package/dist/web/chunk-OX3J3FYX.js +64 -0
- package/dist/web/chunk-OZXDXNMR.js +110 -0
- package/dist/web/chunk-PIXLIWSO.js +62 -0
- package/dist/web/chunk-PMGIJMRO.js +207 -0
- package/dist/web/chunk-Q2IXLUSM.js +56 -0
- package/dist/web/chunk-QGWVZ5NG.js +73 -0
- package/dist/web/chunk-QLUUM53Z.js +90 -0
- package/dist/web/chunk-QRFFLA3N.js +84 -0
- package/dist/web/chunk-QTZT7QMI.js +83 -0
- package/dist/web/chunk-QXZ2WY3B.js +38 -0
- package/dist/web/chunk-R2MV4S4U.js +50 -0
- package/dist/web/chunk-RA5YGBRB.js +106 -0
- package/dist/web/chunk-RIOY4LFJ.js +141 -0
- package/dist/web/chunk-RULT57JR.js +85 -0
- package/dist/web/chunk-RWJHJMVJ.js +67 -0
- package/dist/web/chunk-RXXYUYBP.js +25 -0
- package/dist/web/chunk-SGXLWU4V.js +96 -0
- package/dist/web/chunk-SIE2FP2T.js +62 -0
- package/dist/web/chunk-STMNX3QT.js +109 -0
- package/dist/web/chunk-SUOATMIA.js +113 -0
- package/dist/web/chunk-SVYDLG2C.js +558 -0
- package/dist/web/chunk-T2NBG4KF.js +276 -0
- package/dist/web/chunk-T7CEJV6P.js +66 -0
- package/dist/web/chunk-TAA6PO5V.js +63 -0
- package/dist/web/chunk-TI7NWMEQ.js +34 -0
- package/dist/web/chunk-TJGHAD5O.js +40 -0
- package/dist/web/chunk-TKRMGN7J.js +8 -0
- package/dist/web/chunk-TS4UYWJJ.js +105 -0
- package/dist/web/chunk-TY6SGZC7.js +94 -0
- package/dist/web/chunk-U2UWLSDG.js +86 -0
- package/dist/web/chunk-UHXOPILM.js +101 -0
- package/dist/web/chunk-UXLWWQ4J.js +20 -0
- package/dist/web/chunk-UZ4LWR4X.js +26 -0
- package/dist/web/chunk-V3UI2XX7.js +444 -0
- package/dist/web/chunk-VAMCLWLF.js +403 -0
- package/dist/web/chunk-VLZMX43R.js +45 -0
- package/dist/web/chunk-VM6AGMYO.js +46 -0
- package/dist/web/chunk-VNL2QI5B.js +43 -0
- package/dist/web/chunk-VYQHGSK6.js +244 -0
- package/dist/web/chunk-W4E2N3UN.js +58 -0
- package/dist/web/chunk-W4G74KFZ.js +362 -0
- package/dist/web/chunk-WBW5E6LC.js +101 -0
- package/dist/web/chunk-WEPSTI3Z.js +83 -0
- package/dist/web/chunk-WOAWUXER.js +139 -0
- package/dist/web/chunk-X2RA4EG3.js +86 -0
- package/dist/web/chunk-X3MYWPNO.js +230 -0
- package/dist/web/chunk-XDSOOOYL.js +35 -0
- package/dist/web/chunk-XIMTRQZ3.js +220 -0
- package/dist/web/chunk-XMUXOKIP.js +159 -0
- package/dist/web/chunk-XXH4TYKZ.js +276 -0
- package/dist/web/chunk-XYNURYMC.js +129 -0
- package/dist/web/chunk-XZQUQOR3.js +48 -0
- package/dist/web/chunk-Y2W5YG6Y.js +57 -0
- package/dist/web/chunk-YFYAMVTL.js +383 -0
- package/dist/web/chunk-YLP46BJK.js +50 -0
- package/dist/web/chunk-YMM73FLL.js +84 -0
- package/dist/web/chunk-YQDCU7ZL.js +49 -0
- package/dist/web/chunk-YQQ7GDLZ.js +30 -0
- package/dist/web/chunk-YRRZ22OK.js +139 -0
- package/dist/web/chunk-YXVOFEDT.js +85 -0
- package/dist/web/chunk-Z3H2FQVX.js +120 -0
- package/dist/web/chunk-ZDCKYQKS.js +108 -0
- package/dist/web/chunk-ZR32WYJA.js +55 -0
- package/dist/web/chunk-ZTVV4KBT.js +28 -0
- package/dist/web/components/account-capabilities-card.js +21 -0
- package/dist/web/components/account-menu.js +18 -0
- package/dist/web/components/account-settings-shared.js +50 -0
- package/dist/web/components/account-status-tabs.js +20 -0
- package/dist/web/components/action-tile.js +8 -0
- package/dist/web/components/activity-detail-row.js +22 -0
- package/dist/web/components/activity-filter-bar.js +22 -0
- package/dist/web/components/activity-list.js +23 -0
- package/dist/web/components/activity-network-filters.js +19 -0
- package/dist/web/components/activity-row.js +15 -0
- package/dist/web/components/activity-type-tabs.js +17 -0
- package/dist/web/components/alert-banner.js +13 -0
- package/dist/web/components/amount.js +8 -0
- package/dist/web/components/app-icon.js +15 -0
- package/dist/web/components/asset-card.js +21 -0
- package/dist/web/components/asset-icon.js +10 -0
- package/dist/web/components/asset-selector.js +24 -0
- package/dist/web/components/balance-breakdown.js +18 -0
- package/dist/web/components/basic-collapsible.js +11 -0
- package/dist/web/components/bottom-nav.js +13 -0
- package/dist/web/components/bottom-sheet.js +15 -0
- package/dist/web/components/btc-unified-receive.js +28 -0
- package/dist/web/components/charts/bar-chart.js +24 -0
- package/dist/web/components/charts/bar-list.js +24 -0
- package/dist/web/components/charts/core.js +63 -0
- package/dist/web/components/charts/donut-chart.js +26 -0
- package/dist/web/components/charts/index.js +72 -0
- package/dist/web/components/charts/line-chart.js +26 -0
- package/dist/web/components/charts/meter.js +24 -0
- package/dist/web/components/charts/mixed-chart.js +24 -0
- package/dist/web/components/charts/scatter-chart.js +24 -0
- package/dist/web/components/charts/sparkline.js +8 -0
- package/dist/web/components/choice-group.js +11 -0
- package/dist/web/components/code-block.js +21 -0
- package/dist/web/components/confirm-dialog.js +15 -0
- package/dist/web/components/copy-button.js +21 -0
- package/dist/web/components/copyable.js +20 -0
- package/dist/web/components/date-range-filter.js +16 -0
- package/dist/web/components/deposit-asset-selection.js +24 -0
- package/dist/web/components/deposit-generated-view.js +23 -0
- package/dist/web/components/deposit-invoice-generation.js +35 -0
- package/dist/web/components/deposit-network-default-modal.js +13 -0
- package/dist/web/components/deposit-pre-generation.js +17 -0
- package/dist/web/components/deposit-success-screen.js +20 -0
- package/dist/web/components/deposit-ui-shared.js +28 -0
- package/dist/web/components/disclosure-card.js +11 -0
- package/dist/web/components/dotted-leader.js +8 -0
- package/dist/web/components/empty-state.js +8 -0
- package/dist/web/components/environment-indicator.js +9 -0
- package/dist/web/components/error-boundary.js +10 -0
- package/dist/web/components/event-timeline.js +8 -0
- package/dist/web/components/extension-page-frame.js +15 -0
- package/dist/web/components/filter-bar.js +15 -0
- package/dist/web/components/filter-chip-group.js +8 -0
- package/dist/web/components/filter-dropdown.js +12 -0
- package/dist/web/components/floating-notice.js +12 -0
- package/dist/web/components/form-field.js +10 -0
- package/dist/web/components/halo-backdrop.js +8 -0
- package/dist/web/components/info-chip.js +24 -0
- package/dist/web/components/info-panel.js +13 -0
- package/dist/web/components/inline-selector.js +11 -0
- package/dist/web/components/instants-statement.js +20 -0
- package/dist/web/components/kaleidoscope-hero-animation.js +11 -0
- package/dist/web/components/kaleidoswap-logo.js +12 -0
- package/dist/web/components/list-field.js +14 -0
- package/dist/web/components/list-summary.js +8 -0
- package/dist/web/components/metric-card.js +14 -0
- package/dist/web/components/mobile-hero-animation.js +8 -0
- package/dist/web/components/network-badge.js +14 -0
- package/dist/web/components/network-icon.js +21 -0
- package/dist/web/components/network-status-chip.js +11 -0
- package/dist/web/components/notice-bar.js +8 -0
- package/dist/web/components/one-time-secret-dialog.js +18 -0
- package/dist/web/components/option-selector.js +12 -0
- package/dist/web/components/page-header.js +12 -0
- package/dist/web/components/page-shell.js +18 -0
- package/dist/web/components/pager.js +11 -0
- package/dist/web/components/period-select.js +20 -0
- package/dist/web/components/qr-code.js +10 -0
- package/dist/web/components/query-state.js +19 -0
- package/dist/web/components/read-status.js +15 -0
- package/dist/web/components/record-list.js +17 -0
- package/dist/web/components/recovery-phrase-card.js +20 -0
- package/dist/web/components/restricted.js +9 -0
- package/dist/web/components/secret-reveal-card.js +20 -0
- package/dist/web/components/section-header.js +9 -0
- package/dist/web/components/section-label.js +8 -0
- package/dist/web/components/selectable-card.js +8 -0
- package/dist/web/components/setting-item.js +13 -0
- package/dist/web/components/settings-section-card.js +11 -0
- package/dist/web/components/settings-selector-row.js +8 -0
- package/dist/web/components/settings-tile.js +21 -0
- package/dist/web/components/skeleton.js +10 -0
- package/dist/web/components/status-badge.js +13 -0
- package/dist/web/components/status-icon-badge.js +15 -0
- package/dist/web/components/stepper-number-input.js +10 -0
- package/dist/web/components/summary-rows.js +9 -0
- package/dist/web/components/swap-badge.js +11 -0
- package/dist/web/components/swap-input-card.js +28 -0
- package/dist/web/components/swap-step-list.js +10 -0
- package/dist/web/components/switch-row.js +9 -0
- package/dist/web/components/theme-toggle.js +12 -0
- package/dist/web/components/transaction-card.js +14 -0
- package/dist/web/components/trend-chart.js +28 -0
- package/dist/web/components/value-list.js +20 -0
- package/dist/web/components/wallet-asset-list.js +22 -0
- package/dist/web/components/withdraw-amount-input.js +13 -0
- package/dist/web/components/withdraw-confirmation.js +17 -0
- package/dist/web/components/withdraw-destination-input.js +14 -0
- package/dist/web/components/withdraw-invoice-info.js +10 -0
- package/dist/web/components/withdraw-route-selector.js +9 -0
- package/dist/web/components/withdraw-success.js +12 -0
- package/dist/web/hooks/use-asset-icon.js +11 -0
- package/dist/web/hooks/use-copy-to-clipboard.js +7 -0
- package/dist/web/hooks/use-media-query.js +9 -0
- package/dist/web/hooks/use-theme-mode.js +9 -0
- package/dist/web/hooks/use-toast.js +11 -0
- package/dist/web/icons/filled.js +15 -0
- package/dist/web/icons/index.js +13 -0
- package/dist/web/icons/outlined.js +221 -0
- package/dist/web/icons/public.js +248 -0
- package/dist/web/icons.cjs +776 -0
- package/dist/web/icons.d.cts +123 -0
- package/dist/web/icons.d.ts +123 -0
- package/dist/web/index.cjs +2573 -2507
- package/dist/web/index.d.cts +32 -110
- package/dist/web/index.d.ts +32 -110
- package/dist/web/index.js +592 -14464
- package/dist/web/primitives/avatar.js +10 -0
- package/dist/web/primitives/button.js +10 -0
- package/dist/web/primitives/card.js +20 -0
- package/dist/web/primitives/collapsible.js +16 -0
- package/dist/web/primitives/dialog.js +30 -0
- package/dist/web/primitives/dot-pagination.js +8 -0
- package/dist/web/primitives/drawer.js +43 -0
- package/dist/web/primitives/dropdown-menu.js +28 -0
- package/dist/web/primitives/glyph-button.js +10 -0
- package/dist/web/primitives/icon-button.js +15 -0
- package/dist/web/primitives/icon-glyph.js +8 -0
- package/dist/web/primitives/icon.js +16 -0
- package/dist/web/primitives/input.js +9 -0
- package/dist/web/primitives/label.js +9 -0
- package/dist/web/primitives/menu-search.js +20 -0
- package/dist/web/primitives/number-input.js +11 -0
- package/dist/web/primitives/popover.js +18 -0
- package/dist/web/primitives/scroll-area.js +12 -0
- package/dist/web/primitives/select.js +27 -0
- package/dist/web/primitives/switch.js +8 -0
- package/dist/web/primitives/table.js +27 -0
- package/dist/web/primitives/tabs.js +14 -0
- package/dist/web/primitives/toast.js +24 -0
- package/dist/web/primitives/toaster.js +15 -0
- package/dist/web/primitives/tooltip.js +10 -0
- package/dist/web/utils/amount-display.js +13 -0
- package/dist/web/utils/cn.js +7 -0
- package/dist/web/utils/field-styles.js +7 -0
- package/dist/web/utils/type-roles.js +7 -0
- package/package.json +9 -1
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
ChartDataTable,
|
|
4
|
+
ChartHeader,
|
|
5
|
+
ChartLegend,
|
|
6
|
+
ChartLegendRow,
|
|
7
|
+
ChartTooltip,
|
|
8
|
+
tooltipText,
|
|
9
|
+
useSeriesVisibility
|
|
10
|
+
} from "./chunk-CXLGQSHM.js";
|
|
11
|
+
import {
|
|
12
|
+
formatAmount
|
|
13
|
+
} from "./chunk-VM6AGMYO.js";
|
|
14
|
+
import {
|
|
15
|
+
cn
|
|
16
|
+
} from "./chunk-PMGIJMRO.js";
|
|
17
|
+
|
|
18
|
+
// src/web/components/trend-chart.tsx
|
|
19
|
+
import {
|
|
20
|
+
useCallback,
|
|
21
|
+
useEffect,
|
|
22
|
+
useId,
|
|
23
|
+
useLayoutEffect,
|
|
24
|
+
useRef,
|
|
25
|
+
useState
|
|
26
|
+
} from "react";
|
|
27
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
28
|
+
var toneFill = {
|
|
29
|
+
// The charts' green, so every chart draws the same one.
|
|
30
|
+
primary: "var(--series-1)",
|
|
31
|
+
danger: "var(--destructive)",
|
|
32
|
+
info: "var(--chart-4)",
|
|
33
|
+
warning: "var(--chart-2)",
|
|
34
|
+
muted: "var(--muted-foreground)"
|
|
35
|
+
};
|
|
36
|
+
var defaultFormat = (value) => formatAmount(value);
|
|
37
|
+
var MARGIN = { top: 8, right: 8, bottom: 24, left: 8 };
|
|
38
|
+
var TICK_FONT = 11;
|
|
39
|
+
var X_LABEL_SPACING = 64;
|
|
40
|
+
var FALLBACK_WIDTH = 640;
|
|
41
|
+
var MAX_BAR_WIDTH = 40;
|
|
42
|
+
function trendChartTicks(max) {
|
|
43
|
+
if (!Number.isFinite(max) || max <= 0) return [0];
|
|
44
|
+
const rough = max / 4;
|
|
45
|
+
const magnitude = 10 ** Math.floor(Math.log10(rough));
|
|
46
|
+
const step = [1, 2, 5, 10].map((m) => m * magnitude).find((s) => s >= rough) ?? 10 * magnitude;
|
|
47
|
+
const wholeStep = Math.max(1, Math.round(step));
|
|
48
|
+
const ticks = [0];
|
|
49
|
+
for (let value = wholeStep; value < max - max * 0.15; value += wholeStep) ticks.push(value);
|
|
50
|
+
ticks.push(max);
|
|
51
|
+
return ticks;
|
|
52
|
+
}
|
|
53
|
+
function trendChartLabelIndices(count, maxLabels) {
|
|
54
|
+
if (count <= 0) return [];
|
|
55
|
+
if (count === 1) return [0];
|
|
56
|
+
const slots = Math.max(2, Math.min(count, Math.floor(maxLabels)));
|
|
57
|
+
const indices = /* @__PURE__ */ new Set();
|
|
58
|
+
for (let slot = 0; slot < slots; slot += 1) {
|
|
59
|
+
indices.add(Math.round(slot * (count - 1) / (slots - 1)));
|
|
60
|
+
}
|
|
61
|
+
return [...indices].sort((a, b) => a - b);
|
|
62
|
+
}
|
|
63
|
+
var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
64
|
+
function useElementWidth() {
|
|
65
|
+
const ref = useRef(null);
|
|
66
|
+
const [width, setWidth] = useState(FALLBACK_WIDTH);
|
|
67
|
+
useIsomorphicLayoutEffect(() => {
|
|
68
|
+
const element = ref.current;
|
|
69
|
+
if (!element) return;
|
|
70
|
+
const measured = Math.round(element.getBoundingClientRect().width);
|
|
71
|
+
if (measured > 0) setWidth(measured);
|
|
72
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
73
|
+
const observer = new ResizeObserver(([entry]) => {
|
|
74
|
+
const next = Math.round(entry.contentRect.width);
|
|
75
|
+
if (next > 0) setWidth(next);
|
|
76
|
+
});
|
|
77
|
+
observer.observe(element);
|
|
78
|
+
return () => observer.disconnect();
|
|
79
|
+
}, []);
|
|
80
|
+
return [ref, width];
|
|
81
|
+
}
|
|
82
|
+
function TrendChart({
|
|
83
|
+
points,
|
|
84
|
+
series: allSeries,
|
|
85
|
+
scaleLabel,
|
|
86
|
+
label,
|
|
87
|
+
empty,
|
|
88
|
+
formatValue = defaultFormat,
|
|
89
|
+
height = 220,
|
|
90
|
+
view: controlledView,
|
|
91
|
+
onViewChange,
|
|
92
|
+
className,
|
|
93
|
+
...head
|
|
94
|
+
}) {
|
|
95
|
+
const [containerRef, width] = useElementWidth();
|
|
96
|
+
const [active, setActive] = useState(null);
|
|
97
|
+
const [ownView, setOwnView] = useState("chart");
|
|
98
|
+
const view = controlledView ?? ownView;
|
|
99
|
+
const setView = (next) => {
|
|
100
|
+
if (controlledView === void 0) setOwnView(next);
|
|
101
|
+
onViewChange?.(next);
|
|
102
|
+
};
|
|
103
|
+
const styledSeries = allSeries.map((s, index) => ({ ...s, texture: s.texture ?? (index === 0 ? "solid" : "hatch") }));
|
|
104
|
+
const visibility = useSeriesVisibility(allSeries.map((s) => s.id));
|
|
105
|
+
const series = styledSeries.filter((s) => visibility.isVisible(s.id));
|
|
106
|
+
const idBase = `trend-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;
|
|
107
|
+
const count = points.length;
|
|
108
|
+
const moveActive = useCallback(
|
|
109
|
+
(event) => {
|
|
110
|
+
if (count === 0) return;
|
|
111
|
+
const current = active ?? -1;
|
|
112
|
+
let next;
|
|
113
|
+
switch (event.key) {
|
|
114
|
+
case "ArrowRight":
|
|
115
|
+
next = Math.min(count - 1, current + 1);
|
|
116
|
+
break;
|
|
117
|
+
case "ArrowLeft":
|
|
118
|
+
next = current < 0 ? count - 1 : Math.max(0, current - 1);
|
|
119
|
+
break;
|
|
120
|
+
case "Home":
|
|
121
|
+
next = 0;
|
|
122
|
+
break;
|
|
123
|
+
case "End":
|
|
124
|
+
next = count - 1;
|
|
125
|
+
break;
|
|
126
|
+
case "Escape":
|
|
127
|
+
next = null;
|
|
128
|
+
break;
|
|
129
|
+
default:
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
setActive(next);
|
|
134
|
+
},
|
|
135
|
+
[active, count]
|
|
136
|
+
);
|
|
137
|
+
if (count === 0) return /* @__PURE__ */ jsx(Fragment, { children: empty ?? null });
|
|
138
|
+
const textures = series.map((s) => s.texture);
|
|
139
|
+
const totals = points.map(
|
|
140
|
+
(point) => series.reduce((sum, s) => sum + Math.max(0, point.values[s.id] ?? 0), 0)
|
|
141
|
+
);
|
|
142
|
+
const max = Math.max(0, ...totals);
|
|
143
|
+
const ticks = trendChartTicks(max);
|
|
144
|
+
const tickLabels = ticks.map(formatValue);
|
|
145
|
+
const axisWidth = Math.max(...tickLabels.map((t) => t.length)) * TICK_FONT * 0.62 + 8;
|
|
146
|
+
const plotLeft = MARGIN.left + axisWidth;
|
|
147
|
+
const plotRight = width - MARGIN.right;
|
|
148
|
+
const plotTop = MARGIN.top;
|
|
149
|
+
const plotBottom = height - MARGIN.bottom;
|
|
150
|
+
const plotWidth = Math.max(1, plotRight - plotLeft);
|
|
151
|
+
const plotHeight = Math.max(1, plotBottom - plotTop);
|
|
152
|
+
const domainTop = max > 0 ? max : 1;
|
|
153
|
+
const y = (value) => plotBottom - value / domainTop * plotHeight;
|
|
154
|
+
const band = plotWidth / count;
|
|
155
|
+
const barWidth = band >= 4 ? Math.min(band * 0.72, MAX_BAR_WIDTH) : Math.max(1, band - 0.75);
|
|
156
|
+
const barOffset = (band - barWidth) / 2;
|
|
157
|
+
const labelIndices = trendChartLabelIndices(count, plotWidth / X_LABEL_SPACING);
|
|
158
|
+
const fillFor = (index) => textures[index] === "hatch" ? `url(#${idBase}-hatch-${index})` : toneFill[series[index].tone];
|
|
159
|
+
const activePoint = active === null ? null : points[active];
|
|
160
|
+
const readoutId = `${idBase}-readout`;
|
|
161
|
+
const activeRows = activePoint ? series.map((s) => ({
|
|
162
|
+
id: s.id,
|
|
163
|
+
label: s.label,
|
|
164
|
+
value: formatValue(activePoint.values[s.id] ?? 0),
|
|
165
|
+
color: toneFill[s.tone]
|
|
166
|
+
})) : [];
|
|
167
|
+
const activeTitle = activePoint ? activePoint.detail ?? activePoint.label : "";
|
|
168
|
+
const containerWidth = containerRef.current?.clientWidth ?? width;
|
|
169
|
+
const toContainer = width > 0 ? containerWidth / width : 1;
|
|
170
|
+
return /* @__PURE__ */ jsxs(
|
|
171
|
+
"figure",
|
|
172
|
+
{
|
|
173
|
+
"data-slot": "trend-chart",
|
|
174
|
+
"aria-label": label,
|
|
175
|
+
className: cn("m-0 min-w-0 space-y-2", className),
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ jsx(ChartHeader, { ...head, view, onViewChange: setView }),
|
|
178
|
+
view === "table" && /* @__PURE__ */ jsx(
|
|
179
|
+
ChartDataTable,
|
|
180
|
+
{
|
|
181
|
+
label,
|
|
182
|
+
table: {
|
|
183
|
+
columns: ["Period", ...series.map((s) => s.label), "Total"],
|
|
184
|
+
rows: points.map((point, index) => [
|
|
185
|
+
point.detail ?? point.label,
|
|
186
|
+
...series.map((s) => formatValue(point.values[s.id] ?? 0)),
|
|
187
|
+
formatValue(totals[index])
|
|
188
|
+
])
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
/* @__PURE__ */ jsx("p", { id: readoutId, "data-slot": "trend-chart-readout", "aria-live": "polite", className: "sr-only", children: activePoint ? tooltipText(activeTitle, activeRows) : "" }),
|
|
193
|
+
/* @__PURE__ */ jsxs(
|
|
194
|
+
"div",
|
|
195
|
+
{
|
|
196
|
+
ref: containerRef,
|
|
197
|
+
hidden: view === "table",
|
|
198
|
+
role: "group",
|
|
199
|
+
"aria-roledescription": "chart",
|
|
200
|
+
tabIndex: 0,
|
|
201
|
+
"aria-describedby": readoutId,
|
|
202
|
+
"aria-keyshortcuts": "ArrowLeft ArrowRight Home End Escape",
|
|
203
|
+
"aria-label": `${label}: ${count} periods. Arrow keys move between them.`,
|
|
204
|
+
onKeyDown: moveActive,
|
|
205
|
+
onBlur: () => setActive(null),
|
|
206
|
+
className: "relative mt-5 w-full min-w-0 rounded-xl outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:shadow-glow-primary-soft",
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ jsxs(
|
|
209
|
+
"svg",
|
|
210
|
+
{
|
|
211
|
+
width: "100%",
|
|
212
|
+
height,
|
|
213
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
214
|
+
preserveAspectRatio: "none",
|
|
215
|
+
className: "block overflow-visible",
|
|
216
|
+
onPointerLeave: () => setActive(null),
|
|
217
|
+
"aria-hidden": "true",
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ jsx("defs", { children: series.map(
|
|
220
|
+
(s, index) => textures[index] === "hatch" ? /* @__PURE__ */ jsx(Texture, { id: `${idBase}-hatch-${index}`, tone: s.tone, texture: "hatch" }, s.id) : null
|
|
221
|
+
) }),
|
|
222
|
+
/* @__PURE__ */ jsx("g", { "data-slot": "trend-chart-y-axis", children: ticks.map((tick, index) => /* @__PURE__ */ jsxs("g", { children: [
|
|
223
|
+
/* @__PURE__ */ jsx(
|
|
224
|
+
"line",
|
|
225
|
+
{
|
|
226
|
+
x1: plotLeft,
|
|
227
|
+
x2: plotRight,
|
|
228
|
+
y1: y(tick),
|
|
229
|
+
y2: y(tick),
|
|
230
|
+
stroke: "var(--border)",
|
|
231
|
+
strokeDasharray: tick === 0 ? void 0 : "2 3"
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
/* @__PURE__ */ jsx(
|
|
235
|
+
"text",
|
|
236
|
+
{
|
|
237
|
+
x: plotLeft - 6,
|
|
238
|
+
y: y(tick),
|
|
239
|
+
dy: "0.32em",
|
|
240
|
+
textAnchor: "end",
|
|
241
|
+
fontSize: TICK_FONT,
|
|
242
|
+
fill: "var(--muted-foreground)",
|
|
243
|
+
style: { fontVariantNumeric: "tabular-nums" },
|
|
244
|
+
children: tickLabels[index]
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
] }, tick)) }),
|
|
248
|
+
active !== null && /* @__PURE__ */ jsx(
|
|
249
|
+
"rect",
|
|
250
|
+
{
|
|
251
|
+
"data-slot": "trend-chart-active",
|
|
252
|
+
x: plotLeft + active * band,
|
|
253
|
+
y: plotTop,
|
|
254
|
+
width: band,
|
|
255
|
+
height: plotHeight,
|
|
256
|
+
fill: "var(--chart-4)",
|
|
257
|
+
opacity: 0.14
|
|
258
|
+
}
|
|
259
|
+
),
|
|
260
|
+
/* @__PURE__ */ jsx("g", { "data-slot": "trend-chart-bars", children: points.map((point, pointIndex) => {
|
|
261
|
+
let base = 0;
|
|
262
|
+
return /* @__PURE__ */ jsxs("g", { "data-period": point.key, children: [
|
|
263
|
+
series.map((s, seriesIndex) => {
|
|
264
|
+
const value = point.values[s.id] ?? 0;
|
|
265
|
+
if (value <= 0) return null;
|
|
266
|
+
const top = y(base + value);
|
|
267
|
+
const bottom = y(base);
|
|
268
|
+
base += value;
|
|
269
|
+
const hatched = textures[seriesIndex] === "hatch";
|
|
270
|
+
return /* @__PURE__ */ jsx(
|
|
271
|
+
"rect",
|
|
272
|
+
{
|
|
273
|
+
"data-series": s.id,
|
|
274
|
+
x: plotLeft + pointIndex * band + barOffset,
|
|
275
|
+
y: top,
|
|
276
|
+
width: barWidth,
|
|
277
|
+
height: Math.max(0.5, bottom - top - (seriesIndex > 0 ? 1 : 0)),
|
|
278
|
+
fill: fillFor(seriesIndex),
|
|
279
|
+
stroke: hatched ? toneFill[s.tone] : void 0,
|
|
280
|
+
strokeWidth: hatched && barWidth >= 4 ? 1 : 0
|
|
281
|
+
},
|
|
282
|
+
s.id
|
|
283
|
+
);
|
|
284
|
+
}),
|
|
285
|
+
/* @__PURE__ */ jsx(
|
|
286
|
+
"rect",
|
|
287
|
+
{
|
|
288
|
+
x: plotLeft + pointIndex * band,
|
|
289
|
+
y: plotTop,
|
|
290
|
+
width: band,
|
|
291
|
+
height: plotHeight,
|
|
292
|
+
fill: "transparent",
|
|
293
|
+
onPointerEnter: () => setActive(pointIndex)
|
|
294
|
+
}
|
|
295
|
+
)
|
|
296
|
+
] }, point.key);
|
|
297
|
+
}) }),
|
|
298
|
+
/* @__PURE__ */ jsx("g", { "data-slot": "trend-chart-x-axis", children: labelIndices.map((index) => /* @__PURE__ */ jsx(
|
|
299
|
+
"text",
|
|
300
|
+
{
|
|
301
|
+
x: plotLeft + index * band + band / 2,
|
|
302
|
+
y: plotBottom + 16,
|
|
303
|
+
textAnchor: index === 0 && count > 1 ? "start" : index === count - 1 && count > 1 ? "end" : "middle",
|
|
304
|
+
fontSize: TICK_FONT,
|
|
305
|
+
fill: "var(--muted-foreground)",
|
|
306
|
+
children: points[index].label
|
|
307
|
+
},
|
|
308
|
+
points[index].key
|
|
309
|
+
)) })
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
),
|
|
313
|
+
activePoint && /* @__PURE__ */ jsx(
|
|
314
|
+
ChartTooltip,
|
|
315
|
+
{
|
|
316
|
+
title: activeTitle,
|
|
317
|
+
rows: activeRows,
|
|
318
|
+
swatch: "rect",
|
|
319
|
+
x: (plotLeft + active * band + band / 2) * toContainer,
|
|
320
|
+
y: plotTop,
|
|
321
|
+
width: containerWidth
|
|
322
|
+
}
|
|
323
|
+
)
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
),
|
|
327
|
+
view === "chart" && /* @__PURE__ */ jsx(ChartLegendRow, { children: /* @__PURE__ */ jsx(
|
|
328
|
+
ChartLegend,
|
|
329
|
+
{
|
|
330
|
+
items: styledSeries.map((s, index) => ({
|
|
331
|
+
id: s.id,
|
|
332
|
+
label: s.label,
|
|
333
|
+
color: toneFill[s.tone],
|
|
334
|
+
swatch: /* @__PURE__ */ jsxs("svg", { width: "12", height: "12", "aria-hidden": "true", className: "shrink-0", children: [
|
|
335
|
+
/* @__PURE__ */ jsx(Texture, { id: `${idBase}-legend-${index}`, tone: s.tone, texture: s.texture }),
|
|
336
|
+
/* @__PURE__ */ jsx(
|
|
337
|
+
"rect",
|
|
338
|
+
{
|
|
339
|
+
width: "12",
|
|
340
|
+
height: "12",
|
|
341
|
+
rx: "2",
|
|
342
|
+
fill: s.texture === "hatch" ? `url(#${idBase}-legend-${index})` : toneFill[s.tone],
|
|
343
|
+
stroke: toneFill[s.tone]
|
|
344
|
+
}
|
|
345
|
+
)
|
|
346
|
+
] })
|
|
347
|
+
})),
|
|
348
|
+
...visibility.legend
|
|
349
|
+
}
|
|
350
|
+
) }),
|
|
351
|
+
/* @__PURE__ */ jsxs("p", { "data-slot": "trend-chart-scale", className: "sr-only", children: [
|
|
352
|
+
scaleLabel,
|
|
353
|
+
" \xB7 linear, from 0"
|
|
354
|
+
] })
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
function Texture({
|
|
360
|
+
id,
|
|
361
|
+
tone,
|
|
362
|
+
texture
|
|
363
|
+
}) {
|
|
364
|
+
if (texture !== "hatch") return null;
|
|
365
|
+
return /* @__PURE__ */ jsxs("pattern", { id, width: "4", height: "4", patternUnits: "userSpaceOnUse", patternTransform: "rotate(45)", children: [
|
|
366
|
+
/* @__PURE__ */ jsx("rect", { width: "4", height: "4", fill: toneFill[tone], opacity: 0.25 }),
|
|
367
|
+
/* @__PURE__ */ jsx("rect", { width: "2", height: "4", fill: toneFill[tone] })
|
|
368
|
+
] });
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export {
|
|
372
|
+
trendChartTicks,
|
|
373
|
+
trendChartLabelIndices,
|
|
374
|
+
TrendChart
|
|
375
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-PMGIJMRO.js";
|
|
5
|
+
|
|
6
|
+
// src/web/primitives/card.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var cardSurface = {
|
|
10
|
+
primary: "rounded-2xl bg-card/55 backdrop-blur-xl backdrop-saturate-150 bg-gradient-card shadow-card",
|
|
11
|
+
secondary: "rounded-2xl bg-card/55 backdrop-blur-xl backdrop-saturate-150 bg-gradient-card shadow-card-secondary"
|
|
12
|
+
};
|
|
13
|
+
var Card = React.forwardRef(
|
|
14
|
+
({ className, variant = "primary", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
ref,
|
|
18
|
+
"data-variant": variant,
|
|
19
|
+
className: cn(
|
|
20
|
+
cardSurface[variant],
|
|
21
|
+
// A column, so CardFooter can sit on the bottom edge when the card is
|
|
22
|
+
// taller than its content (a grid row of cards stretches them all).
|
|
23
|
+
"flex flex-col text-card-foreground transition-[color,background-color,box-shadow] duration-300",
|
|
24
|
+
className
|
|
25
|
+
),
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
);
|
|
30
|
+
Card.displayName = "Card";
|
|
31
|
+
var CardHeader = React.forwardRef(
|
|
32
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })
|
|
33
|
+
);
|
|
34
|
+
CardHeader.displayName = "CardHeader";
|
|
35
|
+
var CardTitle = React.forwardRef(
|
|
36
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
37
|
+
"h3",
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
className: cn("text-title font-semibold leading-none tracking-tight", className),
|
|
41
|
+
...props
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
CardTitle.displayName = "CardTitle";
|
|
46
|
+
var CardDescription = React.forwardRef(
|
|
47
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: cn("text-caption text-muted-foreground", className), ...props })
|
|
48
|
+
);
|
|
49
|
+
CardDescription.displayName = "CardDescription";
|
|
50
|
+
var CardContent = React.forwardRef(
|
|
51
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6 pt-0", className), ...props })
|
|
52
|
+
);
|
|
53
|
+
CardContent.displayName = "CardContent";
|
|
54
|
+
var CardFooter = React.forwardRef(
|
|
55
|
+
({ className, ...props }, ref) => (
|
|
56
|
+
// mt-auto: the card's actions stay on its bottom edge, however tall it is.
|
|
57
|
+
/* @__PURE__ */ jsx("div", { ref, className: cn("mt-auto flex items-center p-6 pt-0", className), ...props })
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
CardFooter.displayName = "CardFooter";
|
|
61
|
+
|
|
62
|
+
export {
|
|
63
|
+
cardSurface,
|
|
64
|
+
Card,
|
|
65
|
+
CardHeader,
|
|
66
|
+
CardTitle,
|
|
67
|
+
CardDescription,
|
|
68
|
+
CardContent,
|
|
69
|
+
CardFooter
|
|
70
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
eyebrow
|
|
4
|
+
} from "./chunk-MTQOAMDW.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "./chunk-PMGIJMRO.js";
|
|
8
|
+
|
|
9
|
+
// src/web/primitives/label.tsx
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
14
|
+
LabelPrimitive.Root,
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
className: cn(
|
|
18
|
+
"mb-1 inline-block leading-none",
|
|
19
|
+
eyebrow,
|
|
20
|
+
"text-secondary-content peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
...props
|
|
24
|
+
}
|
|
25
|
+
));
|
|
26
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
Label
|
|
30
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
eyebrow
|
|
4
|
+
} from "./chunk-MTQOAMDW.js";
|
|
5
|
+
import {
|
|
6
|
+
LiquidNetworkIcon,
|
|
7
|
+
OnchainNetworkIcon
|
|
8
|
+
} from "./chunk-WBW5E6LC.js";
|
|
9
|
+
import {
|
|
10
|
+
IconGlyph
|
|
11
|
+
} from "./chunk-YQQ7GDLZ.js";
|
|
12
|
+
import {
|
|
13
|
+
cn
|
|
14
|
+
} from "./chunk-PMGIJMRO.js";
|
|
15
|
+
import {
|
|
16
|
+
ChevronRight
|
|
17
|
+
} from "./chunk-XXH4TYKZ.js";
|
|
18
|
+
|
|
19
|
+
// src/web/components/deposit-network-default-modal.tsx
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
var NETWORK_OPTIONS = {
|
|
22
|
+
RGB: {
|
|
23
|
+
network: "onchain",
|
|
24
|
+
account: "RGB",
|
|
25
|
+
label: "On-chain / Lightning",
|
|
26
|
+
description: "Classic Bitcoin address or Lightning invoice via the RLN node.",
|
|
27
|
+
icon: /* @__PURE__ */ jsx(OnchainNetworkIcon, { className: "size-5" }),
|
|
28
|
+
accentBg: "bg-network-bitcoin/10",
|
|
29
|
+
accentBorder: "border-network-bitcoin/30",
|
|
30
|
+
accentText: "text-network-bitcoin-fg"
|
|
31
|
+
},
|
|
32
|
+
SPARK: {
|
|
33
|
+
network: "spark",
|
|
34
|
+
account: "SPARK",
|
|
35
|
+
label: "Spark",
|
|
36
|
+
description: "Receive directly into your Spark account. Fast and free.",
|
|
37
|
+
icon: /* @__PURE__ */ jsx("img", { src: "/icons/spark/Asterisk/Spark Asterisk White.svg", alt: "", className: "kui-mono-icon h-[18px]" }),
|
|
38
|
+
accentBg: "bg-info/10",
|
|
39
|
+
accentBorder: "border-info/30",
|
|
40
|
+
accentText: "text-info-fg"
|
|
41
|
+
},
|
|
42
|
+
ARKADE: {
|
|
43
|
+
network: "arkade",
|
|
44
|
+
account: "ARKADE",
|
|
45
|
+
label: "Arkade",
|
|
46
|
+
description: "Receive directly into your Arkade account. Low fees, near-instant settlement.",
|
|
47
|
+
icon: /* @__PURE__ */ jsx("img", { src: "/icons/arkade/arkade-icon.svg", alt: "", className: "h-[18px]" }),
|
|
48
|
+
accentBg: "bg-network-arkade/10",
|
|
49
|
+
accentBorder: "border-network-arkade/30",
|
|
50
|
+
accentText: "text-network-arkade-fg"
|
|
51
|
+
},
|
|
52
|
+
LIQUID: {
|
|
53
|
+
// Liquid is its own chain; reuse the "onchain" network key for the modal's
|
|
54
|
+
// network callback (there's no dedicated Liquid DepositNetworkKey).
|
|
55
|
+
network: "onchain",
|
|
56
|
+
account: "LIQUID",
|
|
57
|
+
label: "Liquid",
|
|
58
|
+
description: "Receive L-BTC or a Liquid asset (USDt) via a confidential Liquid address.",
|
|
59
|
+
icon: /* @__PURE__ */ jsx(LiquidNetworkIcon, { className: "h-[18px] w-[18px]" }),
|
|
60
|
+
accentBg: "bg-network-liquid/10",
|
|
61
|
+
accentBorder: "border-network-liquid/30",
|
|
62
|
+
accentText: "text-network-liquid-fg"
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
function DepositNetworkDefaultModal({
|
|
66
|
+
open,
|
|
67
|
+
assetTicker,
|
|
68
|
+
availableAccounts,
|
|
69
|
+
suggestedAccount,
|
|
70
|
+
onSelect
|
|
71
|
+
}) {
|
|
72
|
+
if (!open) return null;
|
|
73
|
+
const options = availableAccounts.map((id) => NETWORK_OPTIONS[id]).filter(Boolean);
|
|
74
|
+
return /* @__PURE__ */ jsx("div", { className: "fixed inset-0 z-50 flex items-end justify-center bg-background/80 backdrop-blur-lg", children: /* @__PURE__ */ jsxs("div", { className: "w-full space-y-4 rounded-t-2xl bg-card/55 backdrop-blur-xl backdrop-saturate-150 bg-gradient-card-hero px-4 pb-7 pt-5 shadow-popover animate-in slide-in-from-bottom-4 duration-200", children: [
|
|
75
|
+
/* @__PURE__ */ jsx("div", { className: "-mt-1 mb-1 flex justify-center", children: /* @__PURE__ */ jsx("div", { className: "h-1 w-10 rounded-full bg-secondary/40" }) }),
|
|
76
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
77
|
+
/* @__PURE__ */ jsx("p", { className: "text-body font-bold text-foreground", children: "Choose your default network" }),
|
|
78
|
+
/* @__PURE__ */ jsxs("p", { className: "mt-0.5 text-tiny text-foreground/55", children: [
|
|
79
|
+
"Pick how you would like to receive",
|
|
80
|
+
" ",
|
|
81
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold text-muted-foreground", children: assetTicker }),
|
|
82
|
+
" by default. You can always switch in the deposit screen."
|
|
83
|
+
] })
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-2", children: options.map((option) => {
|
|
86
|
+
const isSuggested = option.account === suggestedAccount;
|
|
87
|
+
return /* @__PURE__ */ jsxs(
|
|
88
|
+
"button",
|
|
89
|
+
{
|
|
90
|
+
type: "button",
|
|
91
|
+
onClick: () => onSelect(option.network),
|
|
92
|
+
className: cn(
|
|
93
|
+
"flex w-full items-center gap-3 rounded-xl p-3 text-left transition-all",
|
|
94
|
+
isSuggested ? cn(option.accentBg, "shadow-glow-violet-soft ring-1 ring-inset ring-secondary/50") : "bg-muted/40 shadow-raised hover-gradient-violet"
|
|
95
|
+
),
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsx(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
className: cn(
|
|
101
|
+
"flex size-8 flex-shrink-0 items-center justify-center rounded-lg",
|
|
102
|
+
isSuggested ? cn(option.accentBg, "shadow-raised") : "bg-secondary/15",
|
|
103
|
+
isSuggested ? option.accentText : "text-secondary-content"
|
|
104
|
+
),
|
|
105
|
+
children: option.icon
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
109
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
110
|
+
/* @__PURE__ */ jsx("span", { className: cn("text-caption font-bold", isSuggested ? option.accentText : "text-foreground"), children: option.label }),
|
|
111
|
+
isSuggested && /* @__PURE__ */ jsx(
|
|
112
|
+
"span",
|
|
113
|
+
{
|
|
114
|
+
className: cn(
|
|
115
|
+
"rounded-full px-1.5 py-0.5",
|
|
116
|
+
eyebrow,
|
|
117
|
+
option.accentBg,
|
|
118
|
+
option.accentText
|
|
119
|
+
),
|
|
120
|
+
children: "recommended"
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xxs leading-snug text-foreground/55", children: option.description })
|
|
125
|
+
] }),
|
|
126
|
+
/* @__PURE__ */ jsx(
|
|
127
|
+
IconGlyph,
|
|
128
|
+
{
|
|
129
|
+
glyph: ChevronRight,
|
|
130
|
+
className: cn(
|
|
131
|
+
"flex-shrink-0 text-icon-lg",
|
|
132
|
+
isSuggested ? option.accentText : "text-foreground/25"
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
option.account
|
|
139
|
+
);
|
|
140
|
+
}) })
|
|
141
|
+
] }) });
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export {
|
|
145
|
+
DepositNetworkDefaultModal
|
|
146
|
+
};
|