@chainberry/ui-components 1.0.7 → 1.0.9

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
@@ -268,7 +268,7 @@ export declare type Column<T> = {
268
268
  /** header label — also the label shown in the Columns menu */
269
269
  header: string;
270
270
  cell: (row: T) => ReactNode;
271
- align?: "start" | "end";
271
+ align?: 'start' | 'end';
272
272
  /** enable click-to-sort on this column (requires `sortValue`) */
273
273
  sortable?: boolean;
274
274
  /** comparable value used for sorting (number sorts numerically) */
@@ -460,43 +460,28 @@ export declare function DailyBalancesTable({ data, pageSize, }: {
460
460
  pageSize?: number;
461
461
  }): JSX.Element;
462
462
 
463
- 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;
464
464
 
465
465
  export declare type DataTableProps<T> = {
466
466
  columns: Column<T>[];
467
467
  data: T[];
468
468
  /** stable unique key per row */
469
469
  getRowId: (row: T) => string;
470
- layout?: "auto" | "fill";
470
+ /** Sort */
471
+ sort?: SortState;
472
+ onSortChange?: (sort: SortState) => void;
473
+ layout?: 'auto' | 'fill';
471
474
  /** row vertical padding: "comfortable" (default) or "compact" (shorter rows) */
472
- density?: "comfortable" | "compact";
475
+ density?: 'comfortable' | 'compact';
473
476
  /** rows per page; omit to show all rows and hide the footer */
474
477
  pageSize?: number;
478
+ totalItems?: number;
479
+ currentPage?: number;
480
+ onPageChange?: (page: number) => void;
475
481
  loading?: boolean;
476
482
  /** skeleton rows to render while loading (default 10) */
477
483
  skeletonRows?: number;
478
- /** render a search input in the toolbar (needs `searchFilter`) */
479
- searchable?: boolean;
480
- searchPlaceholder?: string;
481
- searchFilter?: (row: T, query: string) => boolean;
482
- /** Optional field-scope dropdown at the right of the search box. UI only:
483
- picking a scope swaps the placeholder to "Search by <label>" and notifies
484
- `onSearchScopeChange`; it does NOT filter (that's the backend's job). */
485
- searchScopes?: {
486
- value: string;
487
- label: string;
488
- }[];
489
- defaultSearchScope?: string;
490
- onSearchScopeChange?: (value: string) => void;
491
- /** controlled search query — drives filtering even when the built-in search
492
- input isn't rendered (e.g. when an external toolbar owns it) */
493
- query?: string;
494
- onQueryChange?: (value: string) => void;
495
- /** render the Columns visibility menu in the toolbar */
496
- columnToggle?: boolean;
497
- /** controlled column visibility (else internal state) */
498
484
  columnVisibility?: Record<string, boolean>;
499
- onColumnVisibilityChange?: (id: string, next: boolean) => void;
500
485
  onRowClick?: (row: T) => void;
501
486
  /** leading cell before the first column (e.g. a status dot) */
502
487
  rowLeading?: (row: T) => ReactNode;
@@ -1303,10 +1288,11 @@ export declare function PasswordGate({ children }: {
1303
1288
  children: ReactNode;
1304
1289
  }): JSX.Element;
1305
1290
 
1306
- export declare function PaymentType({ type, label, }: {
1307
- type: "deposit" | "withdraw";
1308
- /** overrides the default capitalized `type` text */
1309
- label?: string;
1291
+ declare type PaymentDirection = "in" | "out" | "neutral";
1292
+
1293
+ export declare function PaymentType({ direction, label, }: {
1294
+ direction: PaymentDirection;
1295
+ label: string;
1310
1296
  }): JSX.Element;
1311
1297
 
1312
1298
  export declare function PeriodPicker({ value, onChange, today, className, }: {
@@ -1668,6 +1654,11 @@ export declare function SortHeader({ label, sort, onSort, align, }: {
1668
1654
  align?: "start" | "end";
1669
1655
  }): JSX.Element;
1670
1656
 
1657
+ declare type SortState = {
1658
+ id: string;
1659
+ dir: 'asc' | 'desc';
1660
+ } | null;
1661
+
1671
1662
  /** Named treasury wallets available as withdrawal sources. */
1672
1663
  declare const SOURCE_WALLETS: SourceWallet[];
1673
1664
 
@@ -1694,7 +1685,8 @@ declare const STATUS_META: Record<TxStatus, {
1694
1685
  tone: BadgeTone;
1695
1686
  }>;
1696
1687
 
1697
- /** Display order (reading order) for status lists. */
1688
+ /** Display order (reading order) for status lists — grouped by lifecycle:
1689
+ intake → in-progress/pending → success → problems. */
1698
1690
  declare const STATUS_ORDER: TxStatus[];
1699
1691
 
1700
1692
  export declare function StatusBadge({ children, tone, className, }: {
@@ -1937,7 +1929,7 @@ export declare namespace transactionsStatuses {
1937
1929
  }
1938
1930
  }
1939
1931
 
1940
- export declare function TransactionsTable({ data, loading, onRowClick, query, columnVisibility, presets, }: TransactionsTableProps): JSX.Element;
1932
+ export declare function TransactionsTable({ data, loading, onRowClick, columnVisibility, presets, pageSize, totalTransactions, currentPage, onPageChange, }: TransactionsTableProps): JSX.Element;
1941
1933
 
1942
1934
  export declare function TransactionsTableOptions({ search, onSearchChange, searchScopes, searchScope, onSearchScopeChange, searchPlaceholder, segment, onSegmentChange, tabs, tabCounts, onFilter, filterCount, columns, columnVisibility, onColumnChange, onRefresh, refreshing, onDownload, show, className, }: {
1943
1935
  search: string;
@@ -1975,12 +1967,15 @@ export declare type TransactionsTableProps = {
1975
1967
  data: Transaction[];
1976
1968
  loading?: boolean;
1977
1969
  onRowClick?: (tx: Transaction) => void;
1978
- /** controlled search query (owned by the page, shared with the toolbar) */
1979
- query?: string;
1980
1970
  /** controlled column visibility (owned by the page, shared with the toolbar) */
1981
1971
  columnVisibility?: Record<string, boolean>;
1982
1972
  /** the SavedPresetsBar row, rendered just above the table */
1983
1973
  presets?: ReactNode;
1974
+ /** pagination */
1975
+ pageSize?: number;
1976
+ totalTransactions?: number;
1977
+ currentPage?: number;
1978
+ onPageChange?: (page: number) => void;
1984
1979
  };
1985
1980
 
1986
1981
  export declare namespace transactionsTypes {
@@ -2015,9 +2010,9 @@ declare type TxFilter = {
2015
2010
  to?: string;
2016
2011
  };
2017
2012
 
2018
- declare type TxStatus = "created" | "confirmed" | "rejected" | "failed" | "pending-approval" | "processing" | "expired" | "cancelled" | "refunded" | "partially-confirmed" | "under-review" | "settled" | "currency-mismatch";
2013
+ declare type TxStatus = "created" | "processing" | "kyt-in-progress" | "pending-approval" | "rejected" | "confirmed" | "failed" | "conversion-in-progress" | "refund-in-progress" | "pending-verification" | "partially-completed" | "currency-mismatch";
2019
2014
 
2020
- declare type TxType = "deposit" | "withdraw";
2015
+ declare type TxType = "unknown" | "deposit" | "withdrawal" | "checkout" | "manual-deposit" | "manual-withdrawal" | "auto-conversion-deposit" | "auto-conversion-withdrawal" | "automatic-withdrawal";
2021
2016
 
2022
2017
  declare const TYPE_OPTIONS: {
2023
2018
  value: TxType;