@starasia/admin 8.17.1 → 8.18.1

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.
@@ -1,4 +1,4 @@
1
1
  import { default as React } from 'react';
2
2
  import { TableLayoutProps } from './types';
3
3
 
4
- export declare const TableLayout: <T>({ columns, data, getRowKey, size, resizable, layout, widthStorageKey, columnState, onColumnStateChange, columnMenu, sort, defaultSort, onSortChange, height, mobileLayout, mobileBreakpoint, groupSeparator, summary, emptyState, loading, loadingRows, rowActions, }: TableLayoutProps<T>) => React.JSX.Element;
4
+ export declare const TableLayout: <T>({ columns, data, getRowKey, rowBg, size, resizable, layout, widthStorageKey, columnState, onColumnStateChange, columnMenu, sort, defaultSort, onSortChange, height, mobileLayout, mobileBreakpoint, groupSeparator, summary, emptyState, loading, loadingRows, rowActions, }: TableLayoutProps<T>) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
1
  export { TableLayout } from './TableLayout';
2
2
  export { ColumnMenu } from './ColumnMenu';
3
3
  export { useTableSortApiParams, type UseTableSortApiParamsOptions, type TableSortApiParams } from './hooks/useTableSortApiParams';
4
- export type { TableLayoutProps, TableLayoutColumn, TableLayoutAlign, TableLayoutColumnState, TableLayoutCellProps, TableLayoutSort, TableLayoutSortDirection, TableLayoutRowAction } from './types';
4
+ export type { TableLayoutProps, TableLayoutColumn, TableLayoutColor, TableLayoutAlign, TableLayoutColumnState, TableLayoutCellProps, TableLayoutSort, TableLayoutSortDirection, TableLayoutRowAction } from './types';
@@ -28,6 +28,12 @@ export interface TableLayoutRowAction<T> {
28
28
  tone?: 'brand' | 'error' | 'success' | 'info' | 'neutral' | 'warning';
29
29
  }
30
30
  export type TableLayoutAlign = 'left' | 'center' | 'right';
31
+ /**
32
+ * Warna background tint untuk row/kolom/sel TableLayout.
33
+ * Token semantik (otomatis adaptif dark-mode) ATAU string CSS mentah
34
+ * (`#hex` | `rgb(...)` | `hsl(...)` | `var(...)`) sebagai escape hatch.
35
+ */
36
+ export type TableLayoutColor = 'brand-subtle' | 'brand-subtlest' | 'success-subtle' | 'success-subtlest' | 'error-subtle' | 'error-subtlest' | 'warning-subtle' | 'warning-subtlest' | 'info-subtle' | 'info-subtlest' | 'neutral' | (string & {});
31
37
  export type TableLayoutSortDirection = 'asc' | 'desc';
32
38
  export interface TableLayoutSort {
33
39
  /** key kolom yang di-sort */
@@ -60,6 +66,13 @@ export interface TableLayoutColumn<T> {
60
66
  render?: (row: T, rowIndex: number, data: T[]) => ReactNode;
61
67
  /** perataan header + cell (default 'left') */
62
68
  align?: TableLayoutAlign;
69
+ /**
70
+ * Warnai kolom ini (background tint). Token statis → SELURUH kolom bertint.
71
+ * Fungsi `(row, rowIndex, data) => warna | undefined` → pewarnaan kondisional
72
+ * per-sel. Menang atas `rowBg` (row-level). Desktop-table only — di layout
73
+ * mobile (cards/expand) hanya `rowBg` yang berlaku.
74
+ */
75
+ bg?: TableLayoutColor | ((row: T, rowIndex: number, data: T[]) => TableLayoutColor | undefined);
63
76
  /** lebar awal kolom, mis. '200px' | 160 */
64
77
  width?: string | number;
65
78
  /** lebar minimum saat di-resize (px) */
@@ -138,6 +151,13 @@ export interface TableLayoutProps<T> {
138
151
  rowActions?: TableLayoutRowAction<T>[];
139
152
  /** key unik per row; default pakai index */
140
153
  getRowKey?: (row: T, index: number) => string | number;
154
+ /**
155
+ * Warnai SELURUH row berdasarkan data; return token/undefined. Diterapkan
156
+ * sebagai background tint pada semua sel row (lewat CSS variable `--sa-tl-bg`,
157
+ * sehingga tint tetap terlihat saat hover & pada frozen column). Di-override
158
+ * per-sel oleh `column.bg`. Berlaku juga di layout mobile (cards/expand).
159
+ */
160
+ rowBg?: (row: T, index: number) => TableLayoutColor | undefined;
141
161
  /** padding scale, diteruskan ke primitif Table (default 'md') */
142
162
  size?: 'sm' | 'md' | 'lg' | 'xl';
143
163
  /** aktifkan drag-resize lebar kolom (default false) */