@chainberry/ui-components 1.0.24 → 1.0.26
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/index.cjs +1 -1
- package/dist/index.d.ts +114 -29
- package/dist/index.mjs +20188 -19456
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,8 @@ export declare function ActionFooter({ actions, bleed, className, ...props }: {
|
|
|
30
30
|
className?: string;
|
|
31
31
|
} & Omit<ComponentProps<"div">, "className">): JSX.Element;
|
|
32
32
|
|
|
33
|
+
declare type ActionKey = 'approve' | 'reject' | 'refund' | 'verify';
|
|
34
|
+
|
|
33
35
|
/** Fields every activity row carries, regardless of kind. */
|
|
34
36
|
declare type ActivityBase = {
|
|
35
37
|
/** stable id + React key */
|
|
@@ -49,25 +51,11 @@ export declare namespace activityData {
|
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
|
|
52
|
-
export declare function ActivityDetailPanel({ record, open, onOpenChange,
|
|
54
|
+
export declare function ActivityDetailPanel({ record, open, onOpenChange, }: {
|
|
53
55
|
record: TreasuryActivityRecord | null;
|
|
54
56
|
open: boolean;
|
|
55
57
|
onOpenChange: (open: boolean) => void;
|
|
56
|
-
|
|
57
|
-
show?: ActivityDetailVisibility;
|
|
58
|
-
onApprove?: () => void;
|
|
59
|
-
onReject?: () => void;
|
|
60
|
-
}): JSX.Element;
|
|
61
|
-
|
|
62
|
-
/** Per-section visibility — every section defaults to shown. Lets a caller (or a
|
|
63
|
-
story) trim sections without touching the panel. */
|
|
64
|
-
declare type ActivityDetailVisibility = {
|
|
65
|
-
timeline?: boolean;
|
|
66
|
-
approvals?: boolean;
|
|
67
|
-
compliance?: boolean;
|
|
68
|
-
onchain?: boolean;
|
|
69
|
-
notes?: boolean;
|
|
70
|
-
};
|
|
58
|
+
}): JSX.Element;
|
|
71
59
|
|
|
72
60
|
declare type ActivityFilter = {
|
|
73
61
|
kinds: ActivityKind[];
|
|
@@ -280,10 +268,23 @@ export declare namespace balancesData {
|
|
|
280
268
|
}
|
|
281
269
|
}
|
|
282
270
|
|
|
271
|
+
export declare namespace balancesDataV3 {
|
|
272
|
+
export {
|
|
273
|
+
vaultTotalFiat,
|
|
274
|
+
vaultsTotals,
|
|
275
|
+
VaultKind,
|
|
276
|
+
VaultRow,
|
|
277
|
+
Vault,
|
|
278
|
+
VAULTS
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
283
282
|
export declare function BalancesPage(): JSX.Element;
|
|
284
283
|
|
|
285
284
|
export declare function BalancesPageV2(): JSX.Element;
|
|
286
285
|
|
|
286
|
+
export declare function BalancesPageV3(): JSX.Element;
|
|
287
|
+
|
|
287
288
|
export declare namespace balancesRecentTransactions {
|
|
288
289
|
export {
|
|
289
290
|
RecentTxDirection,
|
|
@@ -683,6 +684,12 @@ declare type DateField = 'createdAt' | 'confirmedAt';
|
|
|
683
684
|
/** Default (English) tier column headers; override via the `tierLabels` prop. */
|
|
684
685
|
export declare const DEFAULT_TIER_LABELS: Record<WalletTier, string>;
|
|
685
686
|
|
|
687
|
+
/** Default (English) copy; override any subset via the `labels` prop. */
|
|
688
|
+
export declare const DEFAULT_V3_LABELS: WalletBalancesTableV3Labels;
|
|
689
|
+
|
|
690
|
+
/** Default (English) action labels; override via the `labels` prop. */
|
|
691
|
+
export declare const DEFAULT_WALLET_ACTION_LABELS: Record<WalletActionId, string>;
|
|
692
|
+
|
|
686
693
|
/** Past incoming deposits — the audit trail of received funds. Mixed senders,
|
|
687
694
|
receiving wallets, chains and statuses (confirmed / processing / pending). */
|
|
688
695
|
declare const DEPOSIT_HISTORY: DepositRecord[];
|
|
@@ -892,8 +899,11 @@ declare const EXPORT_HISTORY: ExportEntry[];
|
|
|
892
899
|
declare type ExportEntry = {
|
|
893
900
|
id: string;
|
|
894
901
|
file: string;
|
|
902
|
+
/** human period label shown in the row, e.g. "Jun 2026" */
|
|
895
903
|
period: string;
|
|
896
904
|
generatedBy: string;
|
|
905
|
+
/** the period this export covered — lets a re-download regenerate its data */
|
|
906
|
+
selection?: PeriodSelection;
|
|
897
907
|
};
|
|
898
908
|
|
|
899
909
|
export declare function ExportHistoryList({ entries, onDownload, }: {
|
|
@@ -1400,7 +1410,9 @@ export declare function NavSection({ label, icon, expanded, onToggle, controls,
|
|
|
1400
1410
|
controls?: string;
|
|
1401
1411
|
}): JSX.Element;
|
|
1402
1412
|
|
|
1403
|
-
/** A row "needs action" —
|
|
1413
|
+
/** A row "needs action" — the operator review queue. Exactly three cases:
|
|
1414
|
+
* Deposit · Pending Approval, Withdrawal · Pending Approval, and
|
|
1415
|
+
* Deposit · Currency Mismatch. Nothing else enters the queue. */
|
|
1404
1416
|
declare function needsAction(tx: Transaction): boolean;
|
|
1405
1417
|
|
|
1406
1418
|
/** A blockchain a coin can arrive over, e.g. { code: "ETH", name: "Ethereum" }. */
|
|
@@ -2060,21 +2072,17 @@ declare type TransactionDetail = {
|
|
|
2060
2072
|
blockchainDetails: BlockchainDetails_2[];
|
|
2061
2073
|
};
|
|
2062
2074
|
|
|
2063
|
-
export declare function TransactionDetailPanel({ detail, open, actionRequired, onOpenChange, show, onApprove, onReject,
|
|
2075
|
+
export declare function TransactionDetailPanel({ detail, open, actionRequired, onOpenChange, show, onApprove, onReject, }: {
|
|
2064
2076
|
detail: TransactionDetail | undefined;
|
|
2065
2077
|
open: boolean;
|
|
2066
2078
|
actionRequired?: boolean;
|
|
2067
2079
|
onOpenChange: (open: boolean) => void;
|
|
2068
2080
|
/** per-section, per-field visibility — every value defaults to shown */
|
|
2069
2081
|
show?: TransactionDetailVisibility;
|
|
2070
|
-
/**
|
|
2071
|
-
onApprove?: (
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
approveActionTitle?: string;
|
|
2075
|
-
rejectActionTitle?: string;
|
|
2076
|
-
approveActionDescription?: string;
|
|
2077
|
-
rejectActionDescription?: string;
|
|
2082
|
+
/** fired when an approve/verify flow is confirmed (after 2FA) */
|
|
2083
|
+
onApprove?: (key: ActionKey) => void;
|
|
2084
|
+
/** fired when a reject/refund flow is confirmed (after 2FA) */
|
|
2085
|
+
onReject?: (key: ActionKey) => void;
|
|
2078
2086
|
}): JSX.Element;
|
|
2079
2087
|
|
|
2080
2088
|
export declare type TransactionDetailVisibility = {
|
|
@@ -2104,7 +2112,8 @@ export declare function TransactionReference({ detail, show, className, }: {
|
|
|
2104
2112
|
|
|
2105
2113
|
export declare type TransactionReferenceField = 'transactionUid' | 'partnerPaymentId';
|
|
2106
2114
|
|
|
2107
|
-
/** Full ledger — the hand-written sample
|
|
2115
|
+
/** Full ledger — the curated Action-Required seed, the hand-written sample and
|
|
2116
|
+
243 generated test rows. */
|
|
2108
2117
|
declare const TRANSACTIONS: Transaction[];
|
|
2109
2118
|
|
|
2110
2119
|
export declare namespace transactionsData {
|
|
@@ -2310,6 +2319,49 @@ export declare function UserMenu({ name, avatarSrc, navMode, onNavModeChange, he
|
|
|
2310
2319
|
fullWidth?: boolean;
|
|
2311
2320
|
}): JSX.Element;
|
|
2312
2321
|
|
|
2322
|
+
/** A vault and the currency/network rows it holds. */
|
|
2323
|
+
declare type Vault = {
|
|
2324
|
+
kind: VaultKind;
|
|
2325
|
+
label: string;
|
|
2326
|
+
/** Short description under the vault name. */
|
|
2327
|
+
description: string;
|
|
2328
|
+
rows: VaultRow[];
|
|
2329
|
+
};
|
|
2330
|
+
|
|
2331
|
+
/** The two treasury vaults. */
|
|
2332
|
+
declare type VaultKind = "operation" | "treasury";
|
|
2333
|
+
|
|
2334
|
+
/** One currency/network holding inside a vault — a single table row. */
|
|
2335
|
+
declare type VaultRow = {
|
|
2336
|
+
id: string;
|
|
2337
|
+
/** Asset ticker, e.g. "USDT". */
|
|
2338
|
+
code: string;
|
|
2339
|
+
/** Full currency name, e.g. "Tether". */
|
|
2340
|
+
name: string;
|
|
2341
|
+
/** Network code for the badge (resolved via coinSrc), e.g. "TRON". */
|
|
2342
|
+
network: string;
|
|
2343
|
+
/** Network label shown under the code, e.g. "Tron". */
|
|
2344
|
+
networkName: string;
|
|
2345
|
+
amount: string;
|
|
2346
|
+
amountFiat: string;
|
|
2347
|
+
/** Pending crypto figure; omit when the row holds no pending funds. */
|
|
2348
|
+
pending?: string;
|
|
2349
|
+
pendingFiat?: string;
|
|
2350
|
+
};
|
|
2351
|
+
|
|
2352
|
+
declare const VAULTS: Vault[];
|
|
2353
|
+
|
|
2354
|
+
/** Roll-up shown in the summary card at the top of the Balances V3 screen. */
|
|
2355
|
+
declare function vaultsTotals(vaults: Vault[]): {
|
|
2356
|
+
totalAssets: string;
|
|
2357
|
+
totalPending: string;
|
|
2358
|
+
activeWallets: number;
|
|
2359
|
+
totalWallets: number;
|
|
2360
|
+
};
|
|
2361
|
+
|
|
2362
|
+
/** Fiat subtotal for a single vault. */
|
|
2363
|
+
declare function vaultTotalFiat(vault: Vault): string;
|
|
2364
|
+
|
|
2313
2365
|
/** A named wallet within a currency, on a specific network. */
|
|
2314
2366
|
declare type Wallet = {
|
|
2315
2367
|
id: string;
|
|
@@ -2357,6 +2409,35 @@ export declare function WalletBalancesTableV2({ balances, actionsVariant, tierLa
|
|
|
2357
2409
|
className?: string;
|
|
2358
2410
|
}): JSX.Element;
|
|
2359
2411
|
|
|
2412
|
+
export declare function WalletBalancesTableV3({ vaults, actionsVariant, onRowAction, rowActions, labels, className, }: {
|
|
2413
|
+
vaults: Vault[];
|
|
2414
|
+
actionsVariant?: "icons" | "menu";
|
|
2415
|
+
/** Fired when a row's action is chosen. Without it the menu still renders
|
|
2416
|
+
but does nothing — pass `rowActions={[]}` to drop it entirely. */
|
|
2417
|
+
onRowAction?: (action: WalletActionId, row: VaultRow, vault: Vault) => void;
|
|
2418
|
+
/** Which actions each row offers, in order. Defaults to all three; `[]`
|
|
2419
|
+
renders no actions column content (read-only view). */
|
|
2420
|
+
rowActions?: WalletActionId[];
|
|
2421
|
+
/** Translated copy; unset keys fall back to English. */
|
|
2422
|
+
labels?: Partial<WalletBalancesTableV3Labels>;
|
|
2423
|
+
className?: string;
|
|
2424
|
+
}): JSX.Element;
|
|
2425
|
+
|
|
2426
|
+
/** Translatable strings the table renders itself. Everything else — vault
|
|
2427
|
+
labels and descriptions, the figures — comes in through `vaults`. */
|
|
2428
|
+
export declare type WalletBalancesTableV3Labels = {
|
|
2429
|
+
/** Left column header. */
|
|
2430
|
+
currencyNetwork: string;
|
|
2431
|
+
/** Right column header. */
|
|
2432
|
+
balance: string;
|
|
2433
|
+
/** Trailing word on a row's amber pending line, e.g. "+1,500.00 pending". */
|
|
2434
|
+
pending: string;
|
|
2435
|
+
/** A vault's asset count, e.g. (3) => "3 assets". */
|
|
2436
|
+
assets: (count: number) => string;
|
|
2437
|
+
/** Row action menu items. */
|
|
2438
|
+
actions: Partial<Record<WalletActionId, string>>;
|
|
2439
|
+
};
|
|
2440
|
+
|
|
2360
2441
|
export declare function WalletField({ id, label, placeholder, value, onChange, wallets, emptyMessage, variant, disabled, className, }: {
|
|
2361
2442
|
id?: string;
|
|
2362
2443
|
label?: ReactNode;
|
|
@@ -2397,11 +2478,15 @@ declare type WalletRef = {
|
|
|
2397
2478
|
|
|
2398
2479
|
export declare function WalletRowActions({ variant,
|
|
2399
2480
|
/** context for accessible labels, e.g. the wallet name */
|
|
2400
|
-
label, onAction, }: {
|
|
2481
|
+
label, onAction, actions, labels, }: {
|
|
2401
2482
|
variant?: "icons" | "menu";
|
|
2402
2483
|
label?: string;
|
|
2403
2484
|
onAction?: (id: WalletActionId) => void;
|
|
2404
|
-
|
|
2485
|
+
/** Which actions to offer, in order. Defaults to all three. */
|
|
2486
|
+
actions?: WalletActionId[];
|
|
2487
|
+
/** Translated action labels; unset keys fall back to English. */
|
|
2488
|
+
labels?: Partial<Record<WalletActionId, string>>;
|
|
2489
|
+
}): JSX.Element | null;
|
|
2405
2490
|
|
|
2406
2491
|
/** The risk tier a wallet belongs to in the V2 (four-tier) treasury split.
|
|
2407
2492
|
Machine-readable and locale-independent — `name` is display text and must
|