@chainberry/ui-components 1.0.6 → 1.0.8

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.d.ts CHANGED
@@ -27,6 +27,30 @@ export declare function ActionFooter({ actions, bleed, className, ...props }: {
27
27
  className?: string;
28
28
  } & Omit<ComponentProps<"div">, "className">): JSX.Element;
29
29
 
30
+ export declare function AmountField({ id, label, value, onChange,
31
+ /** trailing unit, e.g. the coin code */
32
+ suffix,
33
+ /** right-aligned note beside the label, e.g. "Available: 1.2 BTC" */
34
+ hint,
35
+ /** helper / error line under the input, e.g. a fiat estimate */
36
+ helper,
37
+ /** show a "Max" button when provided */
38
+ onMax, maxDisabled, disabled, invalid, placeholder, className, }: {
39
+ id?: string;
40
+ label?: ReactNode;
41
+ value: string;
42
+ onChange: (value: string) => void;
43
+ suffix?: ReactNode;
44
+ hint?: ReactNode;
45
+ helper?: ReactNode;
46
+ onMax?: () => void;
47
+ maxDisabled?: boolean;
48
+ disabled?: boolean;
49
+ invalid?: boolean;
50
+ placeholder?: string;
51
+ className?: string;
52
+ }): JSX.Element;
53
+
30
54
  export declare function AppHeaderV1({ user, navMode, onNavModeChange, headerMode, onHeaderModeChange, onAccount, onLogout, onTakeTour, onResetDemo, }: {
31
55
  user?: HeaderUser;
32
56
  navMode?: NavPreset;
@@ -244,7 +268,7 @@ export declare type Column<T> = {
244
268
  /** header label — also the label shown in the Columns menu */
245
269
  header: string;
246
270
  cell: (row: T) => ReactNode;
247
- align?: "start" | "end";
271
+ align?: 'start' | 'end';
248
272
  /** enable click-to-sort on this column (requires `sortValue`) */
249
273
  sortable?: boolean;
250
274
  /** comparable value used for sorting (number sorts numerically) */
@@ -339,31 +363,6 @@ export declare function ConvertPanel({ currentUser, onSubmit, className, }: {
339
363
  className?: string;
340
364
  }): JSX.Element;
341
365
 
342
- export declare function ConvertPickerField({ id, label, value, options, onChange, placeholder, emptyMessage, disabled, className, }: {
343
- id?: string;
344
- label?: ReactNode;
345
- value: string | null;
346
- options: ConvertPickerOption[];
347
- onChange: (value: string) => void;
348
- placeholder?: ReactNode;
349
- emptyMessage?: ReactNode;
350
- disabled?: boolean;
351
- className?: string;
352
- }): JSX.Element;
353
-
354
- export declare type ConvertPickerOption = {
355
- value: string;
356
- /** primary line — shown both in the list and in the closed trigger */
357
- label: ReactNode;
358
- /** muted secondary line */
359
- sublabel?: ReactNode;
360
- /** leading visual, e.g. <CoinLogo /> or <CurrencyNetwork /> */
361
- leading?: ReactNode;
362
- /** right-aligned trailing content, e.g. an available balance */
363
- meta?: ReactNode;
364
- disabled?: boolean;
365
- };
366
-
367
366
  export declare function ConvertSummary({ fromCoin, toCoin, payAmount, payFiat, receiveAmount, receiveFiat, rateLabel, rateCountdown, rateTtl, rateVersion, feeLabel, fromWalletName, fromWalletAddress, toWalletName, toWalletAddress, footer, className, }: {
368
367
  fromCoin: string | null;
369
368
  toCoin: string | null;
@@ -461,43 +460,28 @@ export declare function DailyBalancesTable({ data, pageSize, }: {
461
460
  pageSize?: number;
462
461
  }): JSX.Element;
463
462
 
464
- export declare function DataTable<T>({ columns, data, getRowId, layout, density, pageSize, loading, skeletonRows, searchable, searchPlaceholder, searchFilter, searchScopes, defaultSearchScope, onSearchScopeChange, query: queryProp, onQueryChange, columnToggle, columnVisibility: columnVisibilityProp, onColumnVisibilityChange, onRowClick, rowLeading, emptyMessage, toolbarFilters, toolbarActions, toolbarBelow, }: DataTableProps<T>): JSX.Element;
463
+ export declare function DataTable<T>({ columns, data, getRowId, layout, density, pageSize, totalItems, currentPage, onPageChange, loading, skeletonRows, columnVisibility: columnVisibilityProp, onRowClick, rowLeading, emptyMessage, toolbarBelow, sort, onSortChange, }: DataTableProps<T>): JSX.Element;
465
464
 
466
465
  export declare type DataTableProps<T> = {
467
466
  columns: Column<T>[];
468
467
  data: T[];
469
468
  /** stable unique key per row */
470
469
  getRowId: (row: T) => string;
471
- layout?: "auto" | "fill";
470
+ /** Sort */
471
+ sort?: SortState;
472
+ onSortChange?: (sort: SortState) => void;
473
+ layout?: 'auto' | 'fill';
472
474
  /** row vertical padding: "comfortable" (default) or "compact" (shorter rows) */
473
- density?: "comfortable" | "compact";
475
+ density?: 'comfortable' | 'compact';
474
476
  /** rows per page; omit to show all rows and hide the footer */
475
477
  pageSize?: number;
478
+ totalItems?: number;
479
+ currentPage?: number;
480
+ onPageChange?: (page: number) => void;
476
481
  loading?: boolean;
477
482
  /** skeleton rows to render while loading (default 10) */
478
483
  skeletonRows?: number;
479
- /** render a search input in the toolbar (needs `searchFilter`) */
480
- searchable?: boolean;
481
- searchPlaceholder?: string;
482
- searchFilter?: (row: T, query: string) => boolean;
483
- /** Optional field-scope dropdown at the right of the search box. UI only:
484
- picking a scope swaps the placeholder to "Search by <label>" and notifies
485
- `onSearchScopeChange`; it does NOT filter (that's the backend's job). */
486
- searchScopes?: {
487
- value: string;
488
- label: string;
489
- }[];
490
- defaultSearchScope?: string;
491
- onSearchScopeChange?: (value: string) => void;
492
- /** controlled search query — drives filtering even when the built-in search
493
- input isn't rendered (e.g. when an external toolbar owns it) */
494
- query?: string;
495
- onQueryChange?: (value: string) => void;
496
- /** render the Columns visibility menu in the toolbar */
497
- columnToggle?: boolean;
498
- /** controlled column visibility (else internal state) */
499
484
  columnVisibility?: Record<string, boolean>;
500
- onColumnVisibilityChange?: (id: string, next: boolean) => void;
501
485
  onRowClick?: (row: T) => void;
502
486
  /** leading cell before the first column (e.g. a status dot) */
503
487
  rowLeading?: (row: T) => ReactNode;
@@ -538,31 +522,6 @@ export declare function DepositPanel({ className }: {
538
522
  className?: string;
539
523
  }): JSX.Element;
540
524
 
541
- export declare function DepositPickerField({ id, label, value, options, onChange, placeholder, emptyMessage, disabled, className, }: {
542
- id?: string;
543
- label?: ReactNode;
544
- value: string | null;
545
- options: DepositPickerOption[];
546
- onChange: (value: string) => void;
547
- placeholder?: ReactNode;
548
- emptyMessage?: ReactNode;
549
- disabled?: boolean;
550
- className?: string;
551
- }): JSX.Element;
552
-
553
- export declare type DepositPickerOption = {
554
- value: string;
555
- /** primary line — shown both in the list and in the closed trigger */
556
- label: ReactNode;
557
- /** muted secondary line */
558
- sublabel?: ReactNode;
559
- /** leading visual, e.g. <CoinLogo /> or <CurrencyNetwork /> */
560
- leading?: ReactNode;
561
- /** right-aligned trailing content, e.g. an available balance */
562
- meta?: ReactNode;
563
- disabled?: boolean;
564
- };
565
-
566
525
  export declare function DepositReceiveCard({ wallet, coin, network, networkName, className, }: {
567
526
  wallet: DepositWallet | null;
568
527
  coin: string | null;
@@ -1356,6 +1315,39 @@ declare type PeriodSelection = {
1356
1315
  label?: string;
1357
1316
  };
1358
1317
 
1318
+ declare function PickerField({ id, label, value, options, onChange, placeholder, emptyMessage, disabled, className, }: {
1319
+ id?: string;
1320
+ label?: ReactNode;
1321
+ value: string | null;
1322
+ options: PickerOption[];
1323
+ onChange: (value: string) => void;
1324
+ placeholder?: ReactNode;
1325
+ emptyMessage?: ReactNode;
1326
+ disabled?: boolean;
1327
+ className?: string;
1328
+ }): JSX.Element;
1329
+ export { PickerField as ConvertPickerField }
1330
+ export { PickerField as DepositPickerField }
1331
+ export { PickerField }
1332
+ export { PickerField as WithdrawPickerField }
1333
+
1334
+ declare type PickerOption = {
1335
+ value: string;
1336
+ /** primary line — shown both in the list and in the closed trigger */
1337
+ label: ReactNode;
1338
+ /** muted secondary line */
1339
+ sublabel?: ReactNode;
1340
+ /** leading visual, e.g. <CoinLogo /> or <CurrencyNetwork /> */
1341
+ leading?: ReactNode;
1342
+ /** right-aligned trailing content, e.g. an available balance */
1343
+ meta?: ReactNode;
1344
+ disabled?: boolean;
1345
+ };
1346
+ export { PickerOption as ConvertPickerOption }
1347
+ export { PickerOption as DepositPickerOption }
1348
+ export { PickerOption }
1349
+ export { PickerOption as WithdrawPickerOption }
1350
+
1359
1351
  export declare function Popover(props: ComponentProps<typeof PopoverPrimitive.Root>): JSX.Element;
1360
1352
 
1361
1353
  export declare function PopoverAnchor(props: ComponentProps<typeof PopoverPrimitive.Anchor>): JSX.Element;
@@ -1661,6 +1653,11 @@ export declare function SortHeader({ label, sort, onSort, align, }: {
1661
1653
  align?: "start" | "end";
1662
1654
  }): JSX.Element;
1663
1655
 
1656
+ declare type SortState = {
1657
+ id: string;
1658
+ dir: 'asc' | 'desc';
1659
+ } | null;
1660
+
1664
1661
  /** Named treasury wallets available as withdrawal sources. */
1665
1662
  declare const SOURCE_WALLETS: SourceWallet[];
1666
1663
 
@@ -1726,6 +1723,30 @@ export declare const tabsListVariants: (props?: ({
1726
1723
 
1727
1724
  export declare function TabsTrigger({ className, ...props }: React_2.ComponentProps<typeof Tabs_2.Trigger>): React_2.JSX.Element;
1728
1725
 
1726
+ export declare function TextField({ id, label, value, onChange, placeholder,
1727
+ /** right-aligned note beside the label */
1728
+ hint,
1729
+ /** helper / error line under the input */
1730
+ helper, disabled, invalid, inputMode, spellCheck, autoComplete, maxLength,
1731
+ /** extra classes on the <input> itself (e.g. font-mono, height) */
1732
+ inputClassName, className, }: {
1733
+ id?: string;
1734
+ label?: ReactNode;
1735
+ value: string;
1736
+ onChange: (value: string) => void;
1737
+ placeholder?: string;
1738
+ hint?: ReactNode;
1739
+ helper?: ReactNode;
1740
+ disabled?: boolean;
1741
+ invalid?: boolean;
1742
+ inputMode?: React.ComponentProps<"input">["inputMode"];
1743
+ spellCheck?: boolean;
1744
+ autoComplete?: string;
1745
+ maxLength?: number;
1746
+ inputClassName?: string;
1747
+ className?: string;
1748
+ }): JSX.Element;
1749
+
1729
1750
  export declare function TextLink({ href, className, children, ...props }: ComponentProps<"a">): JSX.Element;
1730
1751
 
1731
1752
  export declare function TextStack({ primary, secondary, align, tabularNums, primaryClassName, secondaryClassName, className, }: {
@@ -1906,7 +1927,7 @@ export declare namespace transactionsStatuses {
1906
1927
  }
1907
1928
  }
1908
1929
 
1909
- export declare function TransactionsTable({ data, loading, onRowClick, query, columnVisibility, presets, }: TransactionsTableProps): JSX.Element;
1930
+ export declare function TransactionsTable({ data, loading, onRowClick, columnVisibility, presets, }: TransactionsTableProps): JSX.Element;
1910
1931
 
1911
1932
  export declare function TransactionsTableOptions({ search, onSearchChange, searchScopes, searchScope, onSearchScopeChange, searchPlaceholder, segment, onSegmentChange, tabs, tabCounts, onFilter, filterCount, columns, columnVisibility, onColumnChange, onRefresh, refreshing, onDownload, show, className, }: {
1912
1933
  search: string;
@@ -1944,8 +1965,6 @@ export declare type TransactionsTableProps = {
1944
1965
  data: Transaction[];
1945
1966
  loading?: boolean;
1946
1967
  onRowClick?: (tx: Transaction) => void;
1947
- /** controlled search query (owned by the page, shared with the toolbar) */
1948
- query?: string;
1949
1968
  /** controlled column visibility (owned by the page, shared with the toolbar) */
1950
1969
  columnVisibility?: Record<string, boolean>;
1951
1970
  /** the SavedPresetsBar row, rendered just above the table */
@@ -2048,6 +2067,34 @@ export declare function WalletBalancesTable({ balances, actionsVariant, classNam
2048
2067
  className?: string;
2049
2068
  }): JSX.Element;
2050
2069
 
2070
+ export declare function WalletField({ id, label, placeholder, value, onChange, wallets, emptyMessage, variant, disabled, className, }: {
2071
+ id?: string;
2072
+ label?: ReactNode;
2073
+ placeholder?: ReactNode;
2074
+ value: string | null;
2075
+ onChange: (value: string) => void;
2076
+ wallets: WalletOption[];
2077
+ emptyMessage?: ReactNode;
2078
+ /** "detailed" shows badge + address + balance; "simple" shows only the name */
2079
+ variant?: "detailed" | "simple";
2080
+ disabled?: boolean;
2081
+ className?: string;
2082
+ }): JSX.Element;
2083
+
2084
+ export declare type WalletOption = {
2085
+ id: string;
2086
+ /** primary line — the wallet name */
2087
+ name: string;
2088
+ /** detailed: short address / secondary line */
2089
+ address?: string;
2090
+ /** detailed: coin + network for the leading badge and balance unit */
2091
+ coin?: string;
2092
+ network?: string;
2093
+ /** detailed: right-aligned balance */
2094
+ amount?: string;
2095
+ amountFiat?: string;
2096
+ };
2097
+
2051
2098
  /** One end of a movement — a named treasury wallet or an on-chain address. */
2052
2099
  declare type WalletRef = {
2053
2100
  /** what's shown, e.g. "Low Risk Wallet" or a truncated address */
@@ -2118,31 +2165,6 @@ export declare function WithdrawPanel({ currentUser, onSubmit, className, }: {
2118
2165
  className?: string;
2119
2166
  }): JSX.Element;
2120
2167
 
2121
- export declare function WithdrawPickerField({ id, label, value, options, onChange, placeholder, emptyMessage, disabled, className, }: {
2122
- id?: string;
2123
- label?: ReactNode;
2124
- value: string | null;
2125
- options: WithdrawPickerOption[];
2126
- onChange: (value: string) => void;
2127
- placeholder?: ReactNode;
2128
- emptyMessage?: ReactNode;
2129
- disabled?: boolean;
2130
- className?: string;
2131
- }): JSX.Element;
2132
-
2133
- export declare type WithdrawPickerOption = {
2134
- value: string;
2135
- /** primary line — shown both in the list and in the closed trigger */
2136
- label: ReactNode;
2137
- /** muted secondary line */
2138
- sublabel?: ReactNode;
2139
- /** leading visual, e.g. <CoinLogo /> or <CurrencyNetwork /> */
2140
- leading?: ReactNode;
2141
- /** right-aligned trailing content, e.g. an available balance */
2142
- meta?: ReactNode;
2143
- disabled?: boolean;
2144
- };
2145
-
2146
2168
  export declare function WithdrawSummary({ coin, network, networkName, amount, amountFiat, from, to, footer, className, }: {
2147
2169
  coin: string | null;
2148
2170
  network: string | null;