@dloizides/ui-tables 1.2.0 → 1.3.0
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/CHANGELOG.md +18 -0
- package/README.md +30 -1
- package/dist/index.d.mts +33 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +77 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +70 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- `DataTable` — **expandable rows** (additive, backward-compatible). Two new optional props:
|
|
6
|
+
- `renderRowDetail?: (row: T) => React.ReactNode` — renders a full-width detail panel
|
|
7
|
+
(spanning every column) directly beneath a row, between it and the next row. Works in
|
|
8
|
+
the desktop grid *and* in the responsive card-stack.
|
|
9
|
+
- `expandedRowKeys?: readonly string[]` — the `keyExtractor` keys of the rows currently
|
|
10
|
+
expanded. Expansion is **controlled by the caller** (own the state, toggle from
|
|
11
|
+
`onRowPress`); the table keeps no internal expand state and adds no chevron.
|
|
12
|
+
- The panel gets a stable test id `${testID}-row-detail-${key}` (new helpers
|
|
13
|
+
`rowDetailTestID(tableTestID, key)` / `rowTestID(tableTestID, key)`), is exposed to
|
|
14
|
+
assistive tech as a labelled region (`accessibilityRole="summary"` +
|
|
15
|
+
the new `uiTables.rowDetail` translation key), and the row it belongs to reports
|
|
16
|
+
`aria-expanded` / `accessibilityState.expanded`.
|
|
17
|
+
- Omit both props and the table renders exactly as before: no extra DOM node, no extra
|
|
18
|
+
row props, no behaviour change for existing consumers.
|
|
19
|
+
- Unblocks kefi-web's audit log (before/after JSON snapshot panel) adopting `DataTable`.
|
|
20
|
+
|
|
3
21
|
## 1.2.0
|
|
4
22
|
|
|
5
23
|
- `Pager` — new optional `unitLabel?: string` prop. When supplied it appends an
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ portfolio. Reads theme + translations from the shared `@dloizides/ui-feedback` U
|
|
|
8
8
|
| Component | Status |
|
|
9
9
|
|-----------|--------|
|
|
10
10
|
| `StatCard` | ✅ Available — labelled metric tile (label + locale-formatted value). |
|
|
11
|
-
| `DataTable` | ✅ Available — the shared, tokenized RN-web grid (the `GRID.md` contract): `columns + rows` API, sticky header, zebra striping, per-row tint, pressable rows, per-row `testID` + a11y, and a responsive label:value **card-stack** below `stackBreakpoint`. |
|
|
11
|
+
| `DataTable` | ✅ Available — the shared, tokenized RN-web grid (the `GRID.md` contract): `columns + rows` API, sticky header, zebra striping, per-row tint, pressable rows, per-row `testID` + a11y, optional **expandable rows**, and a responsive label:value **card-stack** below `stackBreakpoint`. |
|
|
12
12
|
| `FilterBar` | ✅ Available — the `.ui-filters` shell: wrapping field row + live results count + actions slot. |
|
|
13
13
|
| `Pager` | ✅ Available — the `.ui-pager` control: `from–to of N` page-info + rows-per-page pills + Prev/Next. Pass an optional, already-translated `unitLabel` (e.g. `"leadership terms"`) to render `1–50 of 3,023 leadership terms`. |
|
|
14
14
|
| `StatGrid` | ⏳ Deferred — exists only in kefi-web (n=1); moves in when a 2nd consumer appears. |
|
|
@@ -28,6 +28,35 @@ const columns: DataTableColumn<Row>[] = [
|
|
|
28
28
|
<Pager page={page} pageSize={size} total={total} onPageChange={setPage} onPageSizeChange={setSize} />
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
#### Expandable rows (optional)
|
|
32
|
+
|
|
33
|
+
For surfaces that open a full-width detail panel under a row (e.g. an audit log's
|
|
34
|
+
before/after JSON snapshots), pass `renderRowDetail` + `expandedRowKeys`. The panel renders
|
|
35
|
+
between that row and the next — spanning all columns on desktop, and full-width beneath the
|
|
36
|
+
card in the card-stack mode. **Expansion is controlled by you**: the table keeps no internal
|
|
37
|
+
expand state and renders no chevron; toggle from the existing `onRowPress`.
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
const [expanded, setExpanded] = useState<readonly string[]>([]);
|
|
41
|
+
const toggle = (r: Row) =>
|
|
42
|
+
setExpanded((keys) => (keys.includes(r.id) ? keys.filter((k) => k !== r.id) : [...keys, r.id]));
|
|
43
|
+
|
|
44
|
+
<DataTable
|
|
45
|
+
columns={columns}
|
|
46
|
+
rows={rows}
|
|
47
|
+
keyExtractor={(r) => r.id} // the SAME key is matched against expandedRowKeys
|
|
48
|
+
onRowPress={toggle}
|
|
49
|
+
expandedRowKeys={expanded}
|
|
50
|
+
renderRowDetail={(r) => <AuditDetail entry={r} />}
|
|
51
|
+
testID="audit"
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The panel's test id is `` `${testID}-row-detail-${key}` `` (e.g. `audit-row-detail-42`) — build it
|
|
56
|
+
with the exported `rowDetailTestID(tableTestID, key)` (rows: `rowTestID(tableTestID, key)`). It is
|
|
57
|
+
exposed to assistive tech as a labelled region (provide the `uiTables.rowDetail` key), and the row
|
|
58
|
+
reports `aria-expanded`. Omit both props and nothing about the table changes.
|
|
59
|
+
|
|
31
60
|
Colours come entirely from `useUi().theme` (drive it with `@dloizides/design-tokens` via `tokensToUiTheme`), so the grid re-themes per tenant. Every component-authored string is routed through the UiProvider `t` — provide the `uiTables.*` keys (see `TABLE_I18N`) in your locale files; a caller may also pass already-translated `loadingLabel` / `emptyLabel` / `resultsLabel` directly.
|
|
32
61
|
|
|
33
62
|
## Install
|
package/dist/index.d.mts
CHANGED
|
@@ -43,6 +43,20 @@ interface DataTableProps<T> {
|
|
|
43
43
|
onRowPress?: (row: T) => void;
|
|
44
44
|
/** Per-row accessibility label. Falls back to the kit's `rowLabel` translation. */
|
|
45
45
|
getRowAccessibilityLabel?: (row: T) => string;
|
|
46
|
+
/**
|
|
47
|
+
* Render a full-width detail panel beneath a row (spanning every column), for
|
|
48
|
+
* expandable-row surfaces (e.g. an audit log's before/after snapshots). The
|
|
49
|
+
* panel renders only for rows whose `keyExtractor` key is in `expandedRowKeys`,
|
|
50
|
+
* and sits between that row and the next — in the card-stack mode too.
|
|
51
|
+
* Omit for a plain table (nothing about the row rendering changes).
|
|
52
|
+
*/
|
|
53
|
+
renderRowDetail?: (row: T) => React.ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Keys (as produced by `keyExtractor`) of the rows currently expanded. Expansion
|
|
56
|
+
* is CONTROLLED by the caller: own the state, toggle it from `onRowPress`. The
|
|
57
|
+
* table adds no chevron and keeps no internal expand state.
|
|
58
|
+
*/
|
|
59
|
+
expandedRowKeys?: readonly string[];
|
|
46
60
|
loading?: boolean;
|
|
47
61
|
/** Loading text (already translated). Falls back to the kit's `loading` translation. */
|
|
48
62
|
loadingLabel?: string;
|
|
@@ -63,6 +77,10 @@ interface DataTableProps<T> {
|
|
|
63
77
|
* - a responsive label:value **card-stack** below `stackBreakpoint` via
|
|
64
78
|
* `useWindowDimensions` (the CSS `data-label` card-stack does not port).
|
|
65
79
|
* - per-row `testID` + `accessibilityLabel`/`accessibilityHint` (kit standard).
|
|
80
|
+
* - optional CONTROLLED expandable rows: `renderRowDetail` + `expandedRowKeys`
|
|
81
|
+
* render a full-width detail panel between an expanded row and the next
|
|
82
|
+
* (desktop and card-stack alike). Omit both and the table renders exactly as
|
|
83
|
+
* it did before the feature existed.
|
|
66
84
|
* - every colour from `useUi().theme`; every component-authored string via `t`.
|
|
67
85
|
*/
|
|
68
86
|
|
|
@@ -131,6 +149,10 @@ declare const DEFAULT_PAGE_SIZE_OPTIONS: readonly number[];
|
|
|
131
149
|
declare const TABLE_TEST_IDS: {
|
|
132
150
|
readonly root: "ui-data-table";
|
|
133
151
|
readonly head: "ui-data-table-head";
|
|
152
|
+
/** Infix of a row's test id: `${tableTestID}-row-${key}`. */
|
|
153
|
+
readonly rowInfix: "row";
|
|
154
|
+
/** Infix of an expanded row's detail panel: `${tableTestID}-row-detail-${key}`. */
|
|
155
|
+
readonly rowDetailInfix: "row-detail";
|
|
134
156
|
readonly filterBar: "ui-filters";
|
|
135
157
|
readonly results: "ui-results";
|
|
136
158
|
readonly pager: "ui-pager";
|
|
@@ -138,6 +160,14 @@ declare const TABLE_TEST_IDS: {
|
|
|
138
160
|
readonly pagerPrev: "ui-pager-prev";
|
|
139
161
|
readonly pagerNext: "ui-pager-next";
|
|
140
162
|
};
|
|
163
|
+
/** The test id of a row: `${tableTestID}-row-${key}` (key from `keyExtractor`). */
|
|
164
|
+
declare const rowTestID: (tableTestID: string, key: string) => string;
|
|
165
|
+
/**
|
|
166
|
+
* The test id of an expanded row's full-width detail panel:
|
|
167
|
+
* `${tableTestID}-row-detail-${key}` (key from `keyExtractor`). Exported so
|
|
168
|
+
* consumers and e2e specs target the panel without re-deriving the shape.
|
|
169
|
+
*/
|
|
170
|
+
declare const rowDetailTestID: (tableTestID: string, key: string) => string;
|
|
141
171
|
/**
|
|
142
172
|
* Translation keys for every component-authored, user-facing string. Apps map
|
|
143
173
|
* these in their UiProvider `t` (FM); the neutral default `t` returns the key, so
|
|
@@ -148,6 +178,8 @@ declare const TABLE_I18N: {
|
|
|
148
178
|
readonly empty: "uiTables.empty";
|
|
149
179
|
readonly rowLabel: "uiTables.rowLabel";
|
|
150
180
|
readonly rowHint: "uiTables.rowHint";
|
|
181
|
+
/** Accessible name of the full-width detail panel under an expanded row. */
|
|
182
|
+
readonly rowDetail: "uiTables.rowDetail";
|
|
151
183
|
readonly results: "uiTables.results";
|
|
152
184
|
readonly pagerInfo: "uiTables.pager.info";
|
|
153
185
|
readonly pagerPrev: "uiTables.pager.prev";
|
|
@@ -158,4 +190,4 @@ declare const TABLE_I18N: {
|
|
|
158
190
|
readonly pagerRowsOptionHint: "uiTables.pager.rowsOptionHint";
|
|
159
191
|
};
|
|
160
192
|
|
|
161
|
-
export { CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE_OPTIONS, DataTable, type DataTableColumn, type DataTableProps, FilterBar, type FilterBarProps, Pager, type PagerProps, StatCard, type StatCardProps, TABLE_I18N, TABLE_TEST_IDS };
|
|
193
|
+
export { CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE_OPTIONS, DataTable, type DataTableColumn, type DataTableProps, FilterBar, type FilterBarProps, Pager, type PagerProps, StatCard, type StatCardProps, TABLE_I18N, TABLE_TEST_IDS, rowDetailTestID, rowTestID };
|
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,20 @@ interface DataTableProps<T> {
|
|
|
43
43
|
onRowPress?: (row: T) => void;
|
|
44
44
|
/** Per-row accessibility label. Falls back to the kit's `rowLabel` translation. */
|
|
45
45
|
getRowAccessibilityLabel?: (row: T) => string;
|
|
46
|
+
/**
|
|
47
|
+
* Render a full-width detail panel beneath a row (spanning every column), for
|
|
48
|
+
* expandable-row surfaces (e.g. an audit log's before/after snapshots). The
|
|
49
|
+
* panel renders only for rows whose `keyExtractor` key is in `expandedRowKeys`,
|
|
50
|
+
* and sits between that row and the next — in the card-stack mode too.
|
|
51
|
+
* Omit for a plain table (nothing about the row rendering changes).
|
|
52
|
+
*/
|
|
53
|
+
renderRowDetail?: (row: T) => React.ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Keys (as produced by `keyExtractor`) of the rows currently expanded. Expansion
|
|
56
|
+
* is CONTROLLED by the caller: own the state, toggle it from `onRowPress`. The
|
|
57
|
+
* table adds no chevron and keeps no internal expand state.
|
|
58
|
+
*/
|
|
59
|
+
expandedRowKeys?: readonly string[];
|
|
46
60
|
loading?: boolean;
|
|
47
61
|
/** Loading text (already translated). Falls back to the kit's `loading` translation. */
|
|
48
62
|
loadingLabel?: string;
|
|
@@ -63,6 +77,10 @@ interface DataTableProps<T> {
|
|
|
63
77
|
* - a responsive label:value **card-stack** below `stackBreakpoint` via
|
|
64
78
|
* `useWindowDimensions` (the CSS `data-label` card-stack does not port).
|
|
65
79
|
* - per-row `testID` + `accessibilityLabel`/`accessibilityHint` (kit standard).
|
|
80
|
+
* - optional CONTROLLED expandable rows: `renderRowDetail` + `expandedRowKeys`
|
|
81
|
+
* render a full-width detail panel between an expanded row and the next
|
|
82
|
+
* (desktop and card-stack alike). Omit both and the table renders exactly as
|
|
83
|
+
* it did before the feature existed.
|
|
66
84
|
* - every colour from `useUi().theme`; every component-authored string via `t`.
|
|
67
85
|
*/
|
|
68
86
|
|
|
@@ -131,6 +149,10 @@ declare const DEFAULT_PAGE_SIZE_OPTIONS: readonly number[];
|
|
|
131
149
|
declare const TABLE_TEST_IDS: {
|
|
132
150
|
readonly root: "ui-data-table";
|
|
133
151
|
readonly head: "ui-data-table-head";
|
|
152
|
+
/** Infix of a row's test id: `${tableTestID}-row-${key}`. */
|
|
153
|
+
readonly rowInfix: "row";
|
|
154
|
+
/** Infix of an expanded row's detail panel: `${tableTestID}-row-detail-${key}`. */
|
|
155
|
+
readonly rowDetailInfix: "row-detail";
|
|
134
156
|
readonly filterBar: "ui-filters";
|
|
135
157
|
readonly results: "ui-results";
|
|
136
158
|
readonly pager: "ui-pager";
|
|
@@ -138,6 +160,14 @@ declare const TABLE_TEST_IDS: {
|
|
|
138
160
|
readonly pagerPrev: "ui-pager-prev";
|
|
139
161
|
readonly pagerNext: "ui-pager-next";
|
|
140
162
|
};
|
|
163
|
+
/** The test id of a row: `${tableTestID}-row-${key}` (key from `keyExtractor`). */
|
|
164
|
+
declare const rowTestID: (tableTestID: string, key: string) => string;
|
|
165
|
+
/**
|
|
166
|
+
* The test id of an expanded row's full-width detail panel:
|
|
167
|
+
* `${tableTestID}-row-detail-${key}` (key from `keyExtractor`). Exported so
|
|
168
|
+
* consumers and e2e specs target the panel without re-deriving the shape.
|
|
169
|
+
*/
|
|
170
|
+
declare const rowDetailTestID: (tableTestID: string, key: string) => string;
|
|
141
171
|
/**
|
|
142
172
|
* Translation keys for every component-authored, user-facing string. Apps map
|
|
143
173
|
* these in their UiProvider `t` (FM); the neutral default `t` returns the key, so
|
|
@@ -148,6 +178,8 @@ declare const TABLE_I18N: {
|
|
|
148
178
|
readonly empty: "uiTables.empty";
|
|
149
179
|
readonly rowLabel: "uiTables.rowLabel";
|
|
150
180
|
readonly rowHint: "uiTables.rowHint";
|
|
181
|
+
/** Accessible name of the full-width detail panel under an expanded row. */
|
|
182
|
+
readonly rowDetail: "uiTables.rowDetail";
|
|
151
183
|
readonly results: "uiTables.results";
|
|
152
184
|
readonly pagerInfo: "uiTables.pager.info";
|
|
153
185
|
readonly pagerPrev: "uiTables.pager.prev";
|
|
@@ -158,4 +190,4 @@ declare const TABLE_I18N: {
|
|
|
158
190
|
readonly pagerRowsOptionHint: "uiTables.pager.rowsOptionHint";
|
|
159
191
|
};
|
|
160
192
|
|
|
161
|
-
export { CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE_OPTIONS, DataTable, type DataTableColumn, type DataTableProps, FilterBar, type FilterBarProps, Pager, type PagerProps, StatCard, type StatCardProps, TABLE_I18N, TABLE_TEST_IDS };
|
|
193
|
+
export { CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE_OPTIONS, DataTable, type DataTableColumn, type DataTableProps, FilterBar, type FilterBarProps, Pager, type PagerProps, StatCard, type StatCardProps, TABLE_I18N, TABLE_TEST_IDS, rowDetailTestID, rowTestID };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React2 = require('react');
|
|
4
4
|
var reactNative = require('react-native');
|
|
5
5
|
var uiFeedback = require('@dloizides/ui-feedback');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
var React2__default = /*#__PURE__*/_interopDefault(React2);
|
|
11
|
+
|
|
8
12
|
// src/StatCard/StatCard.tsx
|
|
9
13
|
var CARD_PADDING = 16;
|
|
10
14
|
var CARD_BORDER_RADIUS = 12;
|
|
@@ -28,7 +32,7 @@ var styles = reactNative.StyleSheet.create({
|
|
|
28
32
|
lineHeight: VALUE_LINE_HEIGHT
|
|
29
33
|
}
|
|
30
34
|
});
|
|
31
|
-
var StatCard =
|
|
35
|
+
var StatCard = React2.memo(({ label, value, testID }) => {
|
|
32
36
|
const { theme, t } = uiFeedback.useUi();
|
|
33
37
|
const { colors } = theme;
|
|
34
38
|
const formattedValue = value.toLocaleString();
|
|
@@ -55,6 +59,10 @@ var DEFAULT_PAGE_SIZE_OPTIONS = [25, 50, 100, 200];
|
|
|
55
59
|
var TABLE_TEST_IDS = {
|
|
56
60
|
root: "ui-data-table",
|
|
57
61
|
head: "ui-data-table-head",
|
|
62
|
+
/** Infix of a row's test id: `${tableTestID}-row-${key}`. */
|
|
63
|
+
rowInfix: "row",
|
|
64
|
+
/** Infix of an expanded row's detail panel: `${tableTestID}-row-detail-${key}`. */
|
|
65
|
+
rowDetailInfix: "row-detail",
|
|
58
66
|
filterBar: "ui-filters",
|
|
59
67
|
results: "ui-results",
|
|
60
68
|
pager: "ui-pager",
|
|
@@ -62,11 +70,15 @@ var TABLE_TEST_IDS = {
|
|
|
62
70
|
pagerPrev: "ui-pager-prev",
|
|
63
71
|
pagerNext: "ui-pager-next"
|
|
64
72
|
};
|
|
73
|
+
var rowTestID = (tableTestID, key) => `${tableTestID}-${TABLE_TEST_IDS.rowInfix}-${key}`;
|
|
74
|
+
var rowDetailTestID = (tableTestID, key) => `${tableTestID}-${TABLE_TEST_IDS.rowDetailInfix}-${key}`;
|
|
65
75
|
var TABLE_I18N = {
|
|
66
76
|
loading: "uiTables.loading",
|
|
67
77
|
empty: "uiTables.empty",
|
|
68
78
|
rowLabel: "uiTables.rowLabel",
|
|
69
79
|
rowHint: "uiTables.rowHint",
|
|
80
|
+
/** Accessible name of the full-width detail panel under an expanded row. */
|
|
81
|
+
rowDetail: "uiTables.rowDetail",
|
|
70
82
|
results: "uiTables.results",
|
|
71
83
|
pagerInfo: "uiTables.pager.info",
|
|
72
84
|
pagerPrev: "uiTables.pager.prev",
|
|
@@ -98,6 +110,7 @@ var RESULTS_FONT = 13;
|
|
|
98
110
|
var HEAD_LETTER_SPACING = 0.4;
|
|
99
111
|
var LABEL_LETTER_SPACING = 0.3;
|
|
100
112
|
var STICKY_Z = 2;
|
|
113
|
+
var FULL_WIDTH = "100%";
|
|
101
114
|
var STICKY_HEADER_STYLE = {
|
|
102
115
|
position: "sticky",
|
|
103
116
|
top: 0,
|
|
@@ -112,6 +125,8 @@ var tableStyles = reactNative.StyleSheet.create({
|
|
|
112
125
|
numCell: { fontVariant: ["tabular-nums"], textAlign: "right" },
|
|
113
126
|
state: { paddingVertical: STATE_PAD_V, alignItems: "center" },
|
|
114
127
|
stateText: { fontSize: STATE_FONT },
|
|
128
|
+
/** Full-width panel under an expanded row — spans every column (the wrap is a column flexbox). */
|
|
129
|
+
rowDetail: { width: FULL_WIDTH, paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },
|
|
115
130
|
card: { paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },
|
|
116
131
|
cardLine: { flexDirection: "row", justifyContent: "space-between", alignItems: "baseline", paddingVertical: CARD_LINE_PAD_V, gap: CARD_LINE_GAP },
|
|
117
132
|
cardLabel: { fontSize: HEAD_FONT, fontWeight: "600", textTransform: "uppercase", letterSpacing: LABEL_LETTER_SPACING },
|
|
@@ -150,6 +165,8 @@ function DataTable(props) {
|
|
|
150
165
|
loading,
|
|
151
166
|
loadingLabel,
|
|
152
167
|
emptyLabel,
|
|
168
|
+
renderRowDetail,
|
|
169
|
+
expandedRowKeys,
|
|
153
170
|
stackBreakpoint = CARD_STACK_BREAKPOINT,
|
|
154
171
|
testID = TABLE_TEST_IDS.root
|
|
155
172
|
} = props;
|
|
@@ -158,7 +175,7 @@ function DataTable(props) {
|
|
|
158
175
|
const { width } = reactNative.useWindowDimensions();
|
|
159
176
|
const stacked = width < stackBreakpoint;
|
|
160
177
|
const frame = { backgroundColor: colors.surface, borderColor: colors.border };
|
|
161
|
-
const rowBackground =
|
|
178
|
+
const rowBackground = React2.useCallback(
|
|
162
179
|
(row, index) => {
|
|
163
180
|
const tint = rowTint?.(row);
|
|
164
181
|
if (tint) return tint;
|
|
@@ -172,29 +189,54 @@ function DataTable(props) {
|
|
|
172
189
|
if (rows.length === 0) {
|
|
173
190
|
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [tableStyles.wrap, frame], testID, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: tableStyles.state, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [tableStyles.stateText, { color: colors.textSecondary }], children: emptyLabel ?? t(TABLE_I18N.empty) }) }) });
|
|
174
191
|
}
|
|
175
|
-
const
|
|
176
|
-
const
|
|
192
|
+
const rowID = (key) => rowTestID(testID, key);
|
|
193
|
+
const isExpandable = renderRowDetail !== void 0;
|
|
194
|
+
const isExpanded = (key) => isExpandable && (expandedRowKeys?.includes(key) ?? false);
|
|
195
|
+
const rowA11y = (row, key) => ({
|
|
177
196
|
accessibilityLabel: getRowAccessibilityLabel?.(row) ?? t(TABLE_I18N.rowLabel),
|
|
178
197
|
accessibilityHint: t(TABLE_I18N.rowHint),
|
|
179
|
-
accessibilityRole: onRowPress ? "button" : "text"
|
|
198
|
+
accessibilityRole: onRowPress ? "button" : "text",
|
|
199
|
+
// Only an expandable table announces expanded/collapsed — a plain table's rows
|
|
200
|
+
// keep exactly the props they had before this feature existed.
|
|
201
|
+
...isExpandable ? { accessibilityState: { expanded: isExpanded(key) }, "aria-expanded": isExpanded(key) } : null
|
|
180
202
|
});
|
|
203
|
+
const withRowDetail = (rowNode, row, key) => {
|
|
204
|
+
if (!isExpandable || !isExpanded(key)) return rowNode;
|
|
205
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React2__default.default.Fragment, { children: [
|
|
206
|
+
rowNode,
|
|
207
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
208
|
+
reactNative.View,
|
|
209
|
+
{
|
|
210
|
+
accessibilityLabel: t(TABLE_I18N.rowDetail),
|
|
211
|
+
accessibilityRole: "summary",
|
|
212
|
+
style: [tableStyles.rowDetail, { borderTopColor: colors.border, backgroundColor: colors.background }],
|
|
213
|
+
testID: rowDetailTestID(testID, key),
|
|
214
|
+
children: renderRowDetail(row)
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
] }, key);
|
|
218
|
+
};
|
|
181
219
|
if (stacked) {
|
|
182
220
|
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [tableStyles.wrap, frame], testID, children: rows.map((row, i) => {
|
|
183
221
|
const key = keyExtractor(row);
|
|
184
222
|
const bg = rowBackground(row, i);
|
|
185
|
-
return
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
/* @__PURE__ */ jsxRuntime.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
223
|
+
return withRowDetail(
|
|
224
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
225
|
+
reactNative.Pressable,
|
|
226
|
+
{
|
|
227
|
+
testID: rowID(key),
|
|
228
|
+
disabled: !onRowPress,
|
|
229
|
+
onPress: onRowPress ? () => onRowPress(row) : void 0,
|
|
230
|
+
...rowA11y(row, key),
|
|
231
|
+
style: [tableStyles.card, { borderTopColor: colors.border }, i === FIRST_ROW_INDEX ? { borderTopWidth: 0 } : null, bg ? { backgroundColor: bg } : null],
|
|
232
|
+
children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: tableStyles.cardLine, children: [
|
|
233
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [tableStyles.cardLabel, { color: colors.textSecondary }], children: col.header }),
|
|
234
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: tableStyles.cardValue, children: col.render(row) })
|
|
235
|
+
] }, col.key))
|
|
236
|
+
},
|
|
237
|
+
key
|
|
238
|
+
),
|
|
239
|
+
row,
|
|
198
240
|
key
|
|
199
241
|
);
|
|
200
242
|
}) });
|
|
@@ -218,16 +260,20 @@ function DataTable(props) {
|
|
|
218
260
|
rows.map((row, i) => {
|
|
219
261
|
const key = keyExtractor(row);
|
|
220
262
|
const bg = rowBackground(row, i);
|
|
221
|
-
return
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
263
|
+
return withRowDetail(
|
|
264
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
265
|
+
reactNative.Pressable,
|
|
266
|
+
{
|
|
267
|
+
testID: rowID(key),
|
|
268
|
+
disabled: !onRowPress,
|
|
269
|
+
onPress: onRowPress ? () => onRowPress(row) : void 0,
|
|
270
|
+
...rowA11y(row, key),
|
|
271
|
+
style: [tableStyles.row, { borderTopColor: colors.border }, bg ? { backgroundColor: bg } : null],
|
|
272
|
+
children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx(DesktopCell, { column: col, row, textColor: colors.text, testID: `${rowID(key)}-${col.key}` }, col.key))
|
|
273
|
+
},
|
|
274
|
+
key
|
|
275
|
+
),
|
|
276
|
+
row,
|
|
231
277
|
key
|
|
232
278
|
);
|
|
233
279
|
})
|
|
@@ -349,5 +395,7 @@ exports.Pager = Pager;
|
|
|
349
395
|
exports.StatCard = StatCard;
|
|
350
396
|
exports.TABLE_I18N = TABLE_I18N;
|
|
351
397
|
exports.TABLE_TEST_IDS = TABLE_TEST_IDS;
|
|
398
|
+
exports.rowDetailTestID = rowDetailTestID;
|
|
399
|
+
exports.rowTestID = rowTestID;
|
|
352
400
|
//# sourceMappingURL=index.js.map
|
|
353
401
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/StatCard/StatCard.tsx","../src/DataTable/constants.ts","../src/DataTable/styles.ts","../src/DataTable/DataTable.tsx","../src/DataTable/FilterBar.tsx","../src/DataTable/Pager.tsx"],"names":["StyleSheet","memo","useUi","jsxs","View","jsx","Text","useWindowDimensions","useCallback","Pressable"],"mappings":";;;;;;;;AASA,IAAM,YAAA,GAAe,EAAA;AACrB,IAAM,kBAAA,GAAqB,EAAA;AAC3B,IAAM,iBAAA,GAAoB,CAAA;AAC1B,IAAM,eAAA,GAAkB,EAAA;AACxB,IAAM,eAAA,GAAkB,EAAA;AACxB,IAAM,iBAAA,GAAoB,EAAA;AAE1B,IAAM,MAAA,GAASA,uBAAW,MAAA,CAAO;AAAA,EAC/B,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,YAAA;AAAA,IACT,YAAA,EAAc,kBAAA;AAAA,IACd,WAAA,EAAa;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,UAAA,EAAY;AAAA,GACd;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,UAAA,EAAY,KAAA;AAAA,IACZ,UAAA,EAAY;AAAA;AAEhB,CAAC,CAAA;AAQM,IAAM,WAAWC,UAAA,CAAK,CAAC,EAAE,KAAA,EAAO,KAAA,EAAO,QAAO,KAAyC;AAC5F,EAAA,MAAM,EAAE,KAAA,EAAO,CAAA,EAAE,GAAIC,gBAAA,EAAM;AAC3B,EAAA,MAAM,EAAE,QAAO,GAAI,KAAA;AAEnB,EAAA,MAAM,cAAA,GAAiB,MAAM,cAAA,EAAe;AAE5C,EAAA,uBACEC,eAAA;AAAA,IAACC,gBAAA;AAAA,IAAA;AAAA,MACC,iBAAA,EAAmB,CAAA,CAAE,oBAAA,EAAsB,KAAK,CAAA;AAAA,MAChD,kBAAA,EAAoB,CAAA,CAAE,yBAAA,EAA2B,KAAA,EAAO,cAAc,CAAA;AAAA,MACtE,iBAAA,EAAkB,MAAA;AAAA,MAClB,KAAA,EAAO,CAAC,MAAA,CAAO,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,SAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,CAAA,CAAE,UAAA,CAAW,SAAS,CAAA;AAAA,UAC7B,IAAA,EAAM,CAAA,CAAE,UAAA,CAAW,aAAa,CAAA;AAAA,UAChC,UAAU,QAAA,IAAY,QAAA;AAAA,UACtB,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,GAAW,CAAC,CAAA;AAAA,UACxC,OAAO,MAAA,CAAO,IAAA;AAAA,UACd,QAAQ,MAAA,CAAO,MAAA;AAAA,UACf,QAAQ,cAAA,CAAe;AAAA;AAAA;AACzB,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"index.js","sourcesContent":["/**\n * StatCard — a single labelled metric tile (label + formatted numeric value).\n */\nimport React, { memo } from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst CARD_PADDING = 16;\nconst CARD_BORDER_RADIUS = 12;\nconst CARD_BORDER_WIDTH = 1;\nconst LABEL_FONT_SIZE = 14;\nconst VALUE_FONT_SIZE = 28;\nconst VALUE_LINE_HEIGHT = 36;\n\nconst styles = StyleSheet.create({\n card: {\n padding: CARD_PADDING,\n borderRadius: CARD_BORDER_RADIUS,\n borderWidth: CARD_BORDER_WIDTH,\n },\n label: {\n fontSize: LABEL_FONT_SIZE,\n fontWeight: '500',\n },\n value: {\n fontSize: VALUE_FONT_SIZE,\n fontWeight: '700',\n lineHeight: VALUE_LINE_HEIGHT,\n },\n});\n\nexport interface StatCardProps {\n label: string;\n value: number;\n testID: string;\n}\n\nexport const StatCard = memo(({ label, value, testID }: StatCardProps): React.ReactElement => {\n const { theme, t } = useUi();\n const { colors } = theme;\n\n const formattedValue = value.toLocaleString();\n\n return (\n <View\n accessibilityHint={t('analytics.statHint', label)}\n accessibilityLabel={t('analytics.statCardLabel', label, formattedValue)}\n accessibilityRole=\"text\"\n style={[styles.card, { backgroundColor: colors.surface, borderColor: colors.border }]}\n testID={testID}\n >\n <Text style={[styles.label, { color: colors.textSecondary }]}>\n {label}\n </Text>\n <Text style={[styles.value, { color: colors.text }]}>\n {formattedValue}\n </Text>\n </View>\n );\n});\n\nStatCard.displayName = 'StatCard';\n\nexport default StatCard;\n","/**\n * Shared constants for the DataTable family (DataTable / FilterBar / Pager).\n * Keeps every literal (test ids, i18n keys, layout numbers) in one place so the\n * components hold no magic numbers and no ad-hoc strings.\n */\n\n/** Default breakpoint (px): below this a row collapses to a label:value card. */\nexport const CARD_STACK_BREAKPOINT = 640;\n\n/** Default rows-per-page choices, matching the vanilla console's GRID.md pager. */\nexport const DEFAULT_PAGE_SIZE_OPTIONS: readonly number[] = [25, 50, 100, 200];\n\n/** Stable test ids so consumers/e2e can target the shared chrome. */\nexport const TABLE_TEST_IDS = {\n root: 'ui-data-table',\n head: 'ui-data-table-head',\n filterBar: 'ui-filters',\n results: 'ui-results',\n pager: 'ui-pager',\n pagerInfo: 'ui-pager-info',\n pagerPrev: 'ui-pager-prev',\n pagerNext: 'ui-pager-next',\n} as const;\n\n/**\n * Translation keys for every component-authored, user-facing string. Apps map\n * these in their UiProvider `t` (FM); the neutral default `t` returns the key, so\n * a host that forgets a key degrades to the key rather than a hardcoded literal.\n */\nexport const TABLE_I18N = {\n loading: 'uiTables.loading',\n empty: 'uiTables.empty',\n rowLabel: 'uiTables.rowLabel',\n rowHint: 'uiTables.rowHint',\n results: 'uiTables.results',\n pagerInfo: 'uiTables.pager.info',\n pagerPrev: 'uiTables.pager.prev',\n pagerNext: 'uiTables.pager.next',\n pagerPrevHint: 'uiTables.pager.prevHint',\n pagerNextHint: 'uiTables.pager.nextHint',\n pagerRows: 'uiTables.pager.rows',\n pagerRowsOptionHint: 'uiTables.pager.rowsOptionHint',\n} as const;\n","/**\n * Shared StyleSheet for the DataTable family. All colours are applied inline from\n * `useUi().theme` at render time — nothing here carries a colour literal.\n */\nimport { StyleSheet, type ViewStyle } from 'react-native';\n\nconst BORDER_WIDTH = 1;\nconst BORDER_RADIUS = 12;\nconst COLUMN_GAP = 16;\nconst ROW_PAD_H = 14;\nconst ROW_PAD_V = 12;\nconst HEAD_PAD_V = 11;\nconst STATE_PAD_V = 34;\nconst HEAD_FONT = 12;\nconst CELL_FONT = 14;\nconst STATE_FONT = 14;\nconst CARD_LINE_PAD_V = 3;\nconst CARD_LINE_GAP = 12;\nconst PILL_RADIUS = 999;\nconst PAGER_GAP = 8;\nconst PAGER_SIZE_GAP = 6;\nconst CONTROL_PAD_H = 12;\nconst CONTROL_PAD_V = 6;\nconst CONTROL_FONT = 13;\nconst RESULTS_FONT = 13;\nconst HEAD_LETTER_SPACING = 0.4;\nconst LABEL_LETTER_SPACING = 0.3;\nconst STICKY_Z = 2;\n\n/**\n * `position: 'sticky'` is a react-native-web-only value that RN's `ViewStyle`\n * type does not enumerate. Cast through `unknown` (never `any`) so the sticky\n * header stays typed without an eslint `no-explicit-any` violation.\n */\nexport const STICKY_HEADER_STYLE = {\n position: 'sticky',\n top: 0,\n zIndex: STICKY_Z,\n} as unknown as ViewStyle;\n\nexport const tableStyles = StyleSheet.create({\n wrap: { borderWidth: BORDER_WIDTH, borderRadius: BORDER_RADIUS, overflow: 'hidden' },\n headRow: { flexDirection: 'row', columnGap: COLUMN_GAP, paddingHorizontal: ROW_PAD_H, paddingVertical: HEAD_PAD_V },\n headCell: { fontSize: HEAD_FONT, fontWeight: '600', letterSpacing: HEAD_LETTER_SPACING, textTransform: 'uppercase' },\n row: { flexDirection: 'row', columnGap: COLUMN_GAP, alignItems: 'center', paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },\n cell: { fontSize: CELL_FONT, fontWeight: '400' },\n numCell: { fontVariant: ['tabular-nums'], textAlign: 'right' },\n state: { paddingVertical: STATE_PAD_V, alignItems: 'center' },\n stateText: { fontSize: STATE_FONT },\n card: { paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },\n cardLine: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'baseline', paddingVertical: CARD_LINE_PAD_V, gap: CARD_LINE_GAP },\n cardLabel: { fontSize: HEAD_FONT, fontWeight: '600', textTransform: 'uppercase', letterSpacing: LABEL_LETTER_SPACING },\n cardValue: { flexShrink: 1, alignItems: 'flex-end' },\n});\n\nexport const chromeStyles = StyleSheet.create({\n filters: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'flex-end', columnGap: COLUMN_GAP, rowGap: PAGER_GAP, borderWidth: BORDER_WIDTH, borderRadius: BORDER_RADIUS, paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V },\n filtersSpacer: { flexGrow: 1 },\n results: { fontSize: RESULTS_FONT },\n filtersActions: { flexDirection: 'row', gap: PAGER_SIZE_GAP, alignItems: 'center' },\n pager: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'space-between', gap: PAGER_GAP },\n pagerInfo: { fontSize: CONTROL_FONT, fontVariant: ['tabular-nums'] },\n pagerNav: { flexDirection: 'row', alignItems: 'center', gap: PAGER_SIZE_GAP, flexWrap: 'wrap' },\n pagerRowsLabel: { fontSize: HEAD_FONT, textTransform: 'uppercase', letterSpacing: LABEL_LETTER_SPACING },\n sizeGroup: { flexDirection: 'row', gap: PAGER_SIZE_GAP, alignItems: 'center' },\n control: { paddingHorizontal: CONTROL_PAD_H, paddingVertical: CONTROL_PAD_V, borderRadius: BORDER_RADIUS, borderWidth: BORDER_WIDTH },\n controlText: { fontSize: CONTROL_FONT, fontWeight: '600' },\n sizePill: { paddingHorizontal: CONTROL_PAD_H, paddingVertical: CONTROL_PAD_V, borderRadius: PILL_RADIUS, borderWidth: BORDER_WIDTH },\n sizePillText: { fontSize: HEAD_FONT, fontWeight: '600', fontVariant: ['tabular-nums'] },\n});\n","/**\n * DataTable — the shared, tokenized RN-web grid for every dloizides.com surface\n * (and the future AML v2 portal). Promoted from the POC draft; completes the\n * `wwwroot/shared/GRID.md` behavioural contract in the RN idiom:\n *\n * - columns + rows API (unchanged from the POC — it is the right shape).\n * - sticky header (`stickyHeader`), zebra striping (`zebra`), per-row tint.\n * - a responsive label:value **card-stack** below `stackBreakpoint` via\n * `useWindowDimensions` (the CSS `data-label` card-stack does not port).\n * - per-row `testID` + `accessibilityLabel`/`accessibilityHint` (kit standard).\n * - every colour from `useUi().theme`; every component-authored string via `t`.\n */\nimport React, { useCallback } from 'react';\nimport { Pressable, Text, View, useWindowDimensions } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { CARD_STACK_BREAKPOINT, TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { STICKY_HEADER_STYLE, tableStyles as s } from './styles';\nimport type { DataTableColumn, DataTableProps } from './types';\n\nconst FIRST_ROW_INDEX = 0;\n\n/** A single desktop cell — renders `col.render(row)` exactly ONCE (POC bug fix). */\nfunction DesktopCell<T>({ column, row, textColor, testID }: { column: DataTableColumn<T>; row: T; textColor: string; testID: string }): React.ReactElement {\n const content = column.render(row);\n return (\n <View style={{ flex: column.weight ?? 1, alignItems: column.numeric ? 'flex-end' : 'flex-start' }} testID={testID}>\n {typeof content === 'string' ? (\n <Text style={[s.cell, column.numeric ? s.numCell : null, { color: textColor }]}>{content}</Text>\n ) : (\n content\n )}\n </View>\n );\n}\n\nexport function DataTable<T>(props: DataTableProps<T>): React.ReactElement {\n const {\n columns, rows, keyExtractor, rowTint, zebra, stickyHeader, onRowPress,\n getRowAccessibilityLabel, loading, loadingLabel, emptyLabel,\n stackBreakpoint = CARD_STACK_BREAKPOINT, testID = TABLE_TEST_IDS.root,\n } = props;\n\n const { theme, t } = useUi();\n const { colors } = theme;\n const { width } = useWindowDimensions();\n const stacked = width < stackBreakpoint;\n const frame = { backgroundColor: colors.surface, borderColor: colors.border };\n\n const rowBackground = useCallback(\n (row: T, index: number): string | undefined => {\n const tint = rowTint?.(row);\n if (tint) return tint;\n return zebra && index % 2 === 1 ? colors.background : undefined;\n },\n [rowTint, zebra, colors.background],\n );\n\n if (loading) {\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n <View style={s.state}>\n <Text style={[s.stateText, { color: colors.textSecondary }]}>{loadingLabel ?? t(TABLE_I18N.loading)}</Text>\n </View>\n </View>\n );\n }\n if (rows.length === 0) {\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n <View style={s.state}>\n <Text style={[s.stateText, { color: colors.textSecondary }]}>{emptyLabel ?? t(TABLE_I18N.empty)}</Text>\n </View>\n </View>\n );\n }\n\n const rowTestID = (key: string): string => `${testID}-row-${key}`;\n const rowA11y = (row: T): { accessibilityLabel: string; accessibilityHint: string; accessibilityRole: 'button' | 'text' } => ({\n accessibilityLabel: getRowAccessibilityLabel?.(row) ?? t(TABLE_I18N.rowLabel),\n accessibilityHint: t(TABLE_I18N.rowHint),\n accessibilityRole: onRowPress ? 'button' : 'text',\n });\n\n // --- mobile: label:value card-stack (GRID.md) ---\n if (stacked) {\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n {rows.map((row, i) => {\n const key = keyExtractor(row);\n const bg = rowBackground(row, i);\n return (\n <Pressable\n key={key}\n testID={rowTestID(key)}\n disabled={!onRowPress}\n onPress={onRowPress ? () => onRowPress(row) : undefined}\n {...rowA11y(row)}\n style={[s.card, { borderTopColor: colors.border }, i === FIRST_ROW_INDEX ? { borderTopWidth: 0 } : null, bg ? { backgroundColor: bg } : null]}\n >\n {columns.map((col) => (\n <View key={col.key} style={s.cardLine}>\n <Text style={[s.cardLabel, { color: colors.textSecondary }]}>{col.header}</Text>\n <View style={s.cardValue}>{col.render(row)}</View>\n </View>\n ))}\n </Pressable>\n );\n })}\n </View>\n );\n }\n\n // --- desktop: header + rows ---\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n <View\n testID={TABLE_TEST_IDS.head}\n style={[s.headRow, { backgroundColor: colors.background }, stickyHeader ? STICKY_HEADER_STYLE : null]}\n >\n {columns.map((col) => (\n <Text\n key={col.key}\n style={[s.headCell, { color: colors.textSecondary, flex: col.weight ?? 1, textAlign: col.numeric ? 'right' : 'left' }]}\n >\n {col.header}\n </Text>\n ))}\n </View>\n {rows.map((row, i) => {\n const key = keyExtractor(row);\n const bg = rowBackground(row, i);\n return (\n <Pressable\n key={key}\n testID={rowTestID(key)}\n disabled={!onRowPress}\n onPress={onRowPress ? () => onRowPress(row) : undefined}\n {...rowA11y(row)}\n style={[s.row, { borderTopColor: colors.border }, bg ? { backgroundColor: bg } : null]}\n >\n {columns.map((col) => (\n <DesktopCell key={col.key} column={col} row={row} textColor={colors.text} testID={`${rowTestID(key)}-${col.key}`} />\n ))}\n </Pressable>\n );\n })}\n </View>\n );\n}\n\nexport default DataTable;\n","/**\n * FilterBar — the shared filter-bar shell from GRID.md (`.ui-filters`): a themed,\n * wrapping row that holds the caller's filter fields, an optional live results\n * count (`<b>N</b> results`) and an optional actions slot (Apply / Export …).\n * Layout + theming only — the fields themselves come from the app (or @dloizides/\n * ui-forms), keeping this reusable across every grid rather than coverage-specific.\n */\nimport React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { chromeStyles as c } from './styles';\n\nexport interface FilterBarProps {\n /** The filter fields (labels + inputs), supplied by the app / ui-forms. */\n children?: React.ReactNode;\n /** Live count shown as `<b>{resultsCount}</b> {results}`. Omit to hide. */\n resultsCount?: number;\n /** Overrides the kit's translated \"results\" word (pass an app-translated string). */\n resultsLabel?: string;\n /** Right-aligned action buttons (Apply, Export CSV, …). */\n actions?: React.ReactNode;\n testID?: string;\n}\n\nexport function FilterBar({\n children,\n resultsCount,\n resultsLabel,\n actions,\n testID = TABLE_TEST_IDS.filterBar,\n}: FilterBarProps): React.ReactElement {\n const { theme, t } = useUi();\n const { colors } = theme;\n const word = resultsLabel ?? t(TABLE_I18N.results);\n\n return (\n <View style={[c.filters, { backgroundColor: colors.surface, borderColor: colors.border }]} testID={testID}>\n {children}\n <View style={c.filtersSpacer} />\n {typeof resultsCount === 'number' && (\n <Text style={[c.results, { color: colors.textSecondary }]} testID={TABLE_TEST_IDS.results}>\n <Text style={{ color: colors.text, fontWeight: '700' }}>{resultsCount.toLocaleString()}</Text>\n {` ${word}`}\n </Text>\n )}\n {!!actions && <View style={c.filtersActions}>{actions}</View>}\n </View>\n );\n}\n\nexport default FilterBar;\n","/**\n * Pager — the shared pagination control from GRID.md (`.ui-pager`): page-info on\n * the left (`from–to of N`), nav on the right (rows-per-page + Prev/Next). Sits ON\n * TOP of the grid (in the section header row), so every paged grid looks the same.\n * RN idiom: rows-per-page is a row of pressable pills (RN has no native `<select>`);\n * everything is themed from `useUi().theme` and labelled via the UiProvider `t`.\n */\nimport React from 'react';\nimport { Pressable, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { DEFAULT_PAGE_SIZE_OPTIONS, TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { chromeStyles as c } from './styles';\n\nconst FIRST_PAGE = 1;\nconst EN_DASH = '–';\n\nexport interface PagerProps {\n /** 1-based current page. */\n page: number;\n /** Rows per page. */\n pageSize: number;\n /** Total row count across all pages. */\n total: number;\n onPageChange: (page: number) => void;\n onPageSizeChange: (pageSize: number) => void;\n /** Rows-per-page choices. Default 25 / 50 / 100 / 200. */\n pageSizeOptions?: readonly number[];\n /**\n * Optional, already-translated unit noun appended to the count line, e.g.\n * `\"leadership terms\"` renders `1–50 of 3,023 leadership terms`. When omitted the\n * count line stays the generic `from–to of N` (byte-identical to prior behaviour).\n */\n unitLabel?: string;\n testID?: string;\n}\n\ninterface NavButtonProps {\n label: string;\n hint: string;\n disabled: boolean;\n onPress: () => void;\n color: string;\n border: string;\n testID: string;\n}\n\nfunction NavButton({ label, hint, disabled, onPress, color, border, testID }: NavButtonProps): React.ReactElement {\n const DISABLED_OPACITY = 0.4;\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityHint={hint}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n style={[c.control, { borderColor: border, opacity: disabled ? DISABLED_OPACITY : 1 }]}\n >\n <Text style={[c.controlText, { color }]}>{label}</Text>\n </Pressable>\n );\n}\n\nexport function Pager({\n page,\n pageSize,\n total,\n onPageChange,\n onPageSizeChange,\n pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS,\n unitLabel,\n testID = TABLE_TEST_IDS.pager,\n}: PagerProps): React.ReactElement {\n const { theme, t } = useUi();\n const { colors, palette } = theme;\n const brand = palette.primary['500'];\n\n const lastPage = Math.max(FIRST_PAGE, Math.ceil(total / pageSize));\n const safePage = Math.min(Math.max(page, FIRST_PAGE), lastPage);\n const from = total === 0 ? 0 : (safePage - 1) * pageSize + 1;\n const to = Math.min(safePage * pageSize, total);\n const count = `${from.toLocaleString()}${EN_DASH}${to.toLocaleString()} ${t(TABLE_I18N.pagerInfo)} ${total.toLocaleString()}`;\n const hasUnit = unitLabel !== undefined && unitLabel !== '';\n const info = hasUnit ? `${count} ${unitLabel}` : count;\n\n return (\n <View style={c.pager} testID={testID}>\n <Text style={[c.pagerInfo, { color: colors.textSecondary }]} testID={TABLE_TEST_IDS.pagerInfo}>{info}</Text>\n <View style={c.pagerNav}>\n <Text style={[c.pagerRowsLabel, { color: colors.textSecondary }]}>{t(TABLE_I18N.pagerRows)}</Text>\n <View style={c.sizeGroup}>\n {pageSizeOptions.map((size) => {\n const active = size === pageSize;\n return (\n <Pressable\n key={size}\n testID={`${testID}-size-${size}`}\n accessibilityRole=\"button\"\n accessibilityLabel={String(size)}\n accessibilityHint={t(TABLE_I18N.pagerRowsOptionHint)}\n accessibilityState={{ selected: active }}\n onPress={() => onPageSizeChange(size)}\n style={[c.sizePill, { borderColor: active ? brand : colors.border, backgroundColor: active ? brand : 'transparent' }]}\n >\n <Text style={[c.sizePillText, { color: active ? colors.surface : colors.textSecondary }]}>{size}</Text>\n </Pressable>\n );\n })}\n </View>\n <NavButton\n label={t(TABLE_I18N.pagerPrev)}\n hint={t(TABLE_I18N.pagerPrevHint)}\n disabled={safePage <= FIRST_PAGE}\n onPress={() => onPageChange(safePage - 1)}\n color={colors.text}\n border={colors.border}\n testID={TABLE_TEST_IDS.pagerPrev}\n />\n <NavButton\n label={t(TABLE_I18N.pagerNext)}\n hint={t(TABLE_I18N.pagerNextHint)}\n disabled={safePage >= lastPage}\n onPress={() => onPageChange(safePage + 1)}\n color={colors.text}\n border={colors.border}\n testID={TABLE_TEST_IDS.pagerNext}\n />\n </View>\n </View>\n );\n}\n\nexport default Pager;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/StatCard/StatCard.tsx","../src/DataTable/constants.ts","../src/DataTable/styles.ts","../src/DataTable/DataTable.tsx","../src/DataTable/FilterBar.tsx","../src/DataTable/Pager.tsx"],"names":["StyleSheet","memo","useUi","jsxs","View","jsx","Text","useWindowDimensions","useCallback","React","Pressable"],"mappings":";;;;;;;;;;;;AASA,IAAM,YAAA,GAAe,EAAA;AACrB,IAAM,kBAAA,GAAqB,EAAA;AAC3B,IAAM,iBAAA,GAAoB,CAAA;AAC1B,IAAM,eAAA,GAAkB,EAAA;AACxB,IAAM,eAAA,GAAkB,EAAA;AACxB,IAAM,iBAAA,GAAoB,EAAA;AAE1B,IAAM,MAAA,GAASA,uBAAW,MAAA,CAAO;AAAA,EAC/B,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,YAAA;AAAA,IACT,YAAA,EAAc,kBAAA;AAAA,IACd,WAAA,EAAa;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,UAAA,EAAY;AAAA,GACd;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,UAAA,EAAY,KAAA;AAAA,IACZ,UAAA,EAAY;AAAA;AAEhB,CAAC,CAAA;AAQM,IAAM,WAAWC,WAAA,CAAK,CAAC,EAAE,KAAA,EAAO,KAAA,EAAO,QAAO,KAAyC;AAC5F,EAAA,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CAAO,IAAA;AAAA,UACd,QAAQ,MAAA,CAAO,MAAA;AAAA,UACf,QAAQ,cAAA,CAAe;AAAA;AAAA;AACzB,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"index.js","sourcesContent":["/**\n * StatCard — a single labelled metric tile (label + formatted numeric value).\n */\nimport React, { memo } from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst CARD_PADDING = 16;\nconst CARD_BORDER_RADIUS = 12;\nconst CARD_BORDER_WIDTH = 1;\nconst LABEL_FONT_SIZE = 14;\nconst VALUE_FONT_SIZE = 28;\nconst VALUE_LINE_HEIGHT = 36;\n\nconst styles = StyleSheet.create({\n card: {\n padding: CARD_PADDING,\n borderRadius: CARD_BORDER_RADIUS,\n borderWidth: CARD_BORDER_WIDTH,\n },\n label: {\n fontSize: LABEL_FONT_SIZE,\n fontWeight: '500',\n },\n value: {\n fontSize: VALUE_FONT_SIZE,\n fontWeight: '700',\n lineHeight: VALUE_LINE_HEIGHT,\n },\n});\n\nexport interface StatCardProps {\n label: string;\n value: number;\n testID: string;\n}\n\nexport const StatCard = memo(({ label, value, testID }: StatCardProps): React.ReactElement => {\n const { theme, t } = useUi();\n const { colors } = theme;\n\n const formattedValue = value.toLocaleString();\n\n return (\n <View\n accessibilityHint={t('analytics.statHint', label)}\n accessibilityLabel={t('analytics.statCardLabel', label, formattedValue)}\n accessibilityRole=\"text\"\n style={[styles.card, { backgroundColor: colors.surface, borderColor: colors.border }]}\n testID={testID}\n >\n <Text style={[styles.label, { color: colors.textSecondary }]}>\n {label}\n </Text>\n <Text style={[styles.value, { color: colors.text }]}>\n {formattedValue}\n </Text>\n </View>\n );\n});\n\nStatCard.displayName = 'StatCard';\n\nexport default StatCard;\n","/**\n * Shared constants for the DataTable family (DataTable / FilterBar / Pager).\n * Keeps every literal (test ids, i18n keys, layout numbers) in one place so the\n * components hold no magic numbers and no ad-hoc strings.\n */\n\n/** Default breakpoint (px): below this a row collapses to a label:value card. */\nexport const CARD_STACK_BREAKPOINT = 640;\n\n/** Default rows-per-page choices, matching the vanilla console's GRID.md pager. */\nexport const DEFAULT_PAGE_SIZE_OPTIONS: readonly number[] = [25, 50, 100, 200];\n\n/** Stable test ids so consumers/e2e can target the shared chrome. */\nexport const TABLE_TEST_IDS = {\n root: 'ui-data-table',\n head: 'ui-data-table-head',\n /** Infix of a row's test id: `${tableTestID}-row-${key}`. */\n rowInfix: 'row',\n /** Infix of an expanded row's detail panel: `${tableTestID}-row-detail-${key}`. */\n rowDetailInfix: 'row-detail',\n filterBar: 'ui-filters',\n results: 'ui-results',\n pager: 'ui-pager',\n pagerInfo: 'ui-pager-info',\n pagerPrev: 'ui-pager-prev',\n pagerNext: 'ui-pager-next',\n} as const;\n\n/** The test id of a row: `${tableTestID}-row-${key}` (key from `keyExtractor`). */\nexport const rowTestID = (tableTestID: string, key: string): string =>\n `${tableTestID}-${TABLE_TEST_IDS.rowInfix}-${key}`;\n\n/**\n * The test id of an expanded row's full-width detail panel:\n * `${tableTestID}-row-detail-${key}` (key from `keyExtractor`). Exported so\n * consumers and e2e specs target the panel without re-deriving the shape.\n */\nexport const rowDetailTestID = (tableTestID: string, key: string): string =>\n `${tableTestID}-${TABLE_TEST_IDS.rowDetailInfix}-${key}`;\n\n/**\n * Translation keys for every component-authored, user-facing string. Apps map\n * these in their UiProvider `t` (FM); the neutral default `t` returns the key, so\n * a host that forgets a key degrades to the key rather than a hardcoded literal.\n */\nexport const TABLE_I18N = {\n loading: 'uiTables.loading',\n empty: 'uiTables.empty',\n rowLabel: 'uiTables.rowLabel',\n rowHint: 'uiTables.rowHint',\n /** Accessible name of the full-width detail panel under an expanded row. */\n rowDetail: 'uiTables.rowDetail',\n results: 'uiTables.results',\n pagerInfo: 'uiTables.pager.info',\n pagerPrev: 'uiTables.pager.prev',\n pagerNext: 'uiTables.pager.next',\n pagerPrevHint: 'uiTables.pager.prevHint',\n pagerNextHint: 'uiTables.pager.nextHint',\n pagerRows: 'uiTables.pager.rows',\n pagerRowsOptionHint: 'uiTables.pager.rowsOptionHint',\n} as const;\n","/**\n * Shared StyleSheet for the DataTable family. All colours are applied inline from\n * `useUi().theme` at render time — nothing here carries a colour literal.\n */\nimport { StyleSheet, type ViewStyle } from 'react-native';\n\nconst BORDER_WIDTH = 1;\nconst BORDER_RADIUS = 12;\nconst COLUMN_GAP = 16;\nconst ROW_PAD_H = 14;\nconst ROW_PAD_V = 12;\nconst HEAD_PAD_V = 11;\nconst STATE_PAD_V = 34;\nconst HEAD_FONT = 12;\nconst CELL_FONT = 14;\nconst STATE_FONT = 14;\nconst CARD_LINE_PAD_V = 3;\nconst CARD_LINE_GAP = 12;\nconst PILL_RADIUS = 999;\nconst PAGER_GAP = 8;\nconst PAGER_SIZE_GAP = 6;\nconst CONTROL_PAD_H = 12;\nconst CONTROL_PAD_V = 6;\nconst CONTROL_FONT = 13;\nconst RESULTS_FONT = 13;\nconst HEAD_LETTER_SPACING = 0.4;\nconst LABEL_LETTER_SPACING = 0.3;\nconst STICKY_Z = 2;\nconst FULL_WIDTH = '100%' as const;\n\n/**\n * `position: 'sticky'` is a react-native-web-only value that RN's `ViewStyle`\n * type does not enumerate. Cast through `unknown` (never `any`) so the sticky\n * header stays typed without an eslint `no-explicit-any` violation.\n */\nexport const STICKY_HEADER_STYLE = {\n position: 'sticky',\n top: 0,\n zIndex: STICKY_Z,\n} as unknown as ViewStyle;\n\nexport const tableStyles = StyleSheet.create({\n wrap: { borderWidth: BORDER_WIDTH, borderRadius: BORDER_RADIUS, overflow: 'hidden' },\n headRow: { flexDirection: 'row', columnGap: COLUMN_GAP, paddingHorizontal: ROW_PAD_H, paddingVertical: HEAD_PAD_V },\n headCell: { fontSize: HEAD_FONT, fontWeight: '600', letterSpacing: HEAD_LETTER_SPACING, textTransform: 'uppercase' },\n row: { flexDirection: 'row', columnGap: COLUMN_GAP, alignItems: 'center', paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },\n cell: { fontSize: CELL_FONT, fontWeight: '400' },\n numCell: { fontVariant: ['tabular-nums'], textAlign: 'right' },\n state: { paddingVertical: STATE_PAD_V, alignItems: 'center' },\n stateText: { fontSize: STATE_FONT },\n /** Full-width panel under an expanded row — spans every column (the wrap is a column flexbox). */\n rowDetail: { width: FULL_WIDTH, paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },\n card: { paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },\n cardLine: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'baseline', paddingVertical: CARD_LINE_PAD_V, gap: CARD_LINE_GAP },\n cardLabel: { fontSize: HEAD_FONT, fontWeight: '600', textTransform: 'uppercase', letterSpacing: LABEL_LETTER_SPACING },\n cardValue: { flexShrink: 1, alignItems: 'flex-end' },\n});\n\nexport const chromeStyles = StyleSheet.create({\n filters: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'flex-end', columnGap: COLUMN_GAP, rowGap: PAGER_GAP, borderWidth: BORDER_WIDTH, borderRadius: BORDER_RADIUS, paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V },\n filtersSpacer: { flexGrow: 1 },\n results: { fontSize: RESULTS_FONT },\n filtersActions: { flexDirection: 'row', gap: PAGER_SIZE_GAP, alignItems: 'center' },\n pager: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'space-between', gap: PAGER_GAP },\n pagerInfo: { fontSize: CONTROL_FONT, fontVariant: ['tabular-nums'] },\n pagerNav: { flexDirection: 'row', alignItems: 'center', gap: PAGER_SIZE_GAP, flexWrap: 'wrap' },\n pagerRowsLabel: { fontSize: HEAD_FONT, textTransform: 'uppercase', letterSpacing: LABEL_LETTER_SPACING },\n sizeGroup: { flexDirection: 'row', gap: PAGER_SIZE_GAP, alignItems: 'center' },\n control: { paddingHorizontal: CONTROL_PAD_H, paddingVertical: CONTROL_PAD_V, borderRadius: BORDER_RADIUS, borderWidth: BORDER_WIDTH },\n controlText: { fontSize: CONTROL_FONT, fontWeight: '600' },\n sizePill: { paddingHorizontal: CONTROL_PAD_H, paddingVertical: CONTROL_PAD_V, borderRadius: PILL_RADIUS, borderWidth: BORDER_WIDTH },\n sizePillText: { fontSize: HEAD_FONT, fontWeight: '600', fontVariant: ['tabular-nums'] },\n});\n","/**\n * DataTable — the shared, tokenized RN-web grid for every dloizides.com surface\n * (and the future AML v2 portal). Promoted from the POC draft; completes the\n * `wwwroot/shared/GRID.md` behavioural contract in the RN idiom:\n *\n * - columns + rows API (unchanged from the POC — it is the right shape).\n * - sticky header (`stickyHeader`), zebra striping (`zebra`), per-row tint.\n * - a responsive label:value **card-stack** below `stackBreakpoint` via\n * `useWindowDimensions` (the CSS `data-label` card-stack does not port).\n * - per-row `testID` + `accessibilityLabel`/`accessibilityHint` (kit standard).\n * - optional CONTROLLED expandable rows: `renderRowDetail` + `expandedRowKeys`\n * render a full-width detail panel between an expanded row and the next\n * (desktop and card-stack alike). Omit both and the table renders exactly as\n * it did before the feature existed.\n * - every colour from `useUi().theme`; every component-authored string via `t`.\n */\nimport React, { useCallback } from 'react';\nimport { Pressable, Text, View, useWindowDimensions } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { CARD_STACK_BREAKPOINT, TABLE_I18N, TABLE_TEST_IDS, rowDetailTestID, rowTestID } from './constants';\nimport { STICKY_HEADER_STYLE, tableStyles as s } from './styles';\nimport type { DataTableColumn, DataTableProps } from './types';\n\nconst FIRST_ROW_INDEX = 0;\n\n/**\n * The a11y props spread onto a row. The expanded state is emitted only when the\n * table is expandable, and via BOTH spellings: `accessibilityState` (RN native)\n * and `aria-expanded` (react-native-web ≥ 0.19 no longer maps the legacy prop).\n */\ninterface RowA11y {\n accessibilityLabel: string;\n accessibilityHint: string;\n accessibilityRole: 'button' | 'text';\n accessibilityState?: { expanded: boolean };\n 'aria-expanded'?: boolean;\n}\n\n/** A single desktop cell — renders `col.render(row)` exactly ONCE (POC bug fix). */\nfunction DesktopCell<T>({ column, row, textColor, testID }: { column: DataTableColumn<T>; row: T; textColor: string; testID: string }): React.ReactElement {\n const content = column.render(row);\n return (\n <View style={{ flex: column.weight ?? 1, alignItems: column.numeric ? 'flex-end' : 'flex-start' }} testID={testID}>\n {typeof content === 'string' ? (\n <Text style={[s.cell, column.numeric ? s.numCell : null, { color: textColor }]}>{content}</Text>\n ) : (\n content\n )}\n </View>\n );\n}\n\nexport function DataTable<T>(props: DataTableProps<T>): React.ReactElement {\n const {\n columns, rows, keyExtractor, rowTint, zebra, stickyHeader, onRowPress,\n getRowAccessibilityLabel, loading, loadingLabel, emptyLabel,\n renderRowDetail, expandedRowKeys,\n stackBreakpoint = CARD_STACK_BREAKPOINT, testID = TABLE_TEST_IDS.root,\n } = props;\n\n const { theme, t } = useUi();\n const { colors } = theme;\n const { width } = useWindowDimensions();\n const stacked = width < stackBreakpoint;\n const frame = { backgroundColor: colors.surface, borderColor: colors.border };\n\n const rowBackground = useCallback(\n (row: T, index: number): string | undefined => {\n const tint = rowTint?.(row);\n if (tint) return tint;\n return zebra && index % 2 === 1 ? colors.background : undefined;\n },\n [rowTint, zebra, colors.background],\n );\n\n if (loading) {\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n <View style={s.state}>\n <Text style={[s.stateText, { color: colors.textSecondary }]}>{loadingLabel ?? t(TABLE_I18N.loading)}</Text>\n </View>\n </View>\n );\n }\n if (rows.length === 0) {\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n <View style={s.state}>\n <Text style={[s.stateText, { color: colors.textSecondary }]}>{emptyLabel ?? t(TABLE_I18N.empty)}</Text>\n </View>\n </View>\n );\n }\n\n const rowID = (key: string): string => rowTestID(testID, key);\n const isExpandable = renderRowDetail !== undefined;\n const isExpanded = (key: string): boolean => isExpandable && (expandedRowKeys?.includes(key) ?? false);\n\n const rowA11y = (row: T, key: string): RowA11y => ({\n accessibilityLabel: getRowAccessibilityLabel?.(row) ?? t(TABLE_I18N.rowLabel),\n accessibilityHint: t(TABLE_I18N.rowHint),\n accessibilityRole: onRowPress ? 'button' : 'text',\n // Only an expandable table announces expanded/collapsed — a plain table's rows\n // keep exactly the props they had before this feature existed.\n ...(isExpandable ? { accessibilityState: { expanded: isExpanded(key) }, 'aria-expanded': isExpanded(key) } : null),\n });\n\n /**\n * Pairs a rendered row with its detail panel when that row is expanded. When\n * `renderRowDetail` is omitted the row element is returned untouched (no extra\n * wrapper, no extra node) — omitting the props is a no-op on the output.\n */\n const withRowDetail = (rowNode: React.ReactElement, row: T, key: string): React.ReactElement => {\n if (!isExpandable || !isExpanded(key)) return rowNode;\n return (\n <React.Fragment key={key}>\n {rowNode}\n <View\n accessibilityLabel={t(TABLE_I18N.rowDetail)}\n accessibilityRole=\"summary\"\n style={[s.rowDetail, { borderTopColor: colors.border, backgroundColor: colors.background }]}\n testID={rowDetailTestID(testID, key)}\n >\n {renderRowDetail(row)}\n </View>\n </React.Fragment>\n );\n };\n\n // --- mobile: label:value card-stack (GRID.md) ---\n if (stacked) {\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n {rows.map((row, i) => {\n const key = keyExtractor(row);\n const bg = rowBackground(row, i);\n return withRowDetail(\n <Pressable\n key={key}\n testID={rowID(key)}\n disabled={!onRowPress}\n onPress={onRowPress ? () => onRowPress(row) : undefined}\n {...rowA11y(row, key)}\n style={[s.card, { borderTopColor: colors.border }, i === FIRST_ROW_INDEX ? { borderTopWidth: 0 } : null, bg ? { backgroundColor: bg } : null]}\n >\n {columns.map((col) => (\n <View key={col.key} style={s.cardLine}>\n <Text style={[s.cardLabel, { color: colors.textSecondary }]}>{col.header}</Text>\n <View style={s.cardValue}>{col.render(row)}</View>\n </View>\n ))}\n </Pressable>,\n row,\n key,\n );\n })}\n </View>\n );\n }\n\n // --- desktop: header + rows ---\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n <View\n testID={TABLE_TEST_IDS.head}\n style={[s.headRow, { backgroundColor: colors.background }, stickyHeader ? STICKY_HEADER_STYLE : null]}\n >\n {columns.map((col) => (\n <Text\n key={col.key}\n style={[s.headCell, { color: colors.textSecondary, flex: col.weight ?? 1, textAlign: col.numeric ? 'right' : 'left' }]}\n >\n {col.header}\n </Text>\n ))}\n </View>\n {rows.map((row, i) => {\n const key = keyExtractor(row);\n const bg = rowBackground(row, i);\n return withRowDetail(\n <Pressable\n key={key}\n testID={rowID(key)}\n disabled={!onRowPress}\n onPress={onRowPress ? () => onRowPress(row) : undefined}\n {...rowA11y(row, key)}\n style={[s.row, { borderTopColor: colors.border }, bg ? { backgroundColor: bg } : null]}\n >\n {columns.map((col) => (\n <DesktopCell key={col.key} column={col} row={row} textColor={colors.text} testID={`${rowID(key)}-${col.key}`} />\n ))}\n </Pressable>,\n row,\n key,\n );\n })}\n </View>\n );\n}\n\nexport default DataTable;\n","/**\n * FilterBar — the shared filter-bar shell from GRID.md (`.ui-filters`): a themed,\n * wrapping row that holds the caller's filter fields, an optional live results\n * count (`<b>N</b> results`) and an optional actions slot (Apply / Export …).\n * Layout + theming only — the fields themselves come from the app (or @dloizides/\n * ui-forms), keeping this reusable across every grid rather than coverage-specific.\n */\nimport React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { chromeStyles as c } from './styles';\n\nexport interface FilterBarProps {\n /** The filter fields (labels + inputs), supplied by the app / ui-forms. */\n children?: React.ReactNode;\n /** Live count shown as `<b>{resultsCount}</b> {results}`. Omit to hide. */\n resultsCount?: number;\n /** Overrides the kit's translated \"results\" word (pass an app-translated string). */\n resultsLabel?: string;\n /** Right-aligned action buttons (Apply, Export CSV, …). */\n actions?: React.ReactNode;\n testID?: string;\n}\n\nexport function FilterBar({\n children,\n resultsCount,\n resultsLabel,\n actions,\n testID = TABLE_TEST_IDS.filterBar,\n}: FilterBarProps): React.ReactElement {\n const { theme, t } = useUi();\n const { colors } = theme;\n const word = resultsLabel ?? t(TABLE_I18N.results);\n\n return (\n <View style={[c.filters, { backgroundColor: colors.surface, borderColor: colors.border }]} testID={testID}>\n {children}\n <View style={c.filtersSpacer} />\n {typeof resultsCount === 'number' && (\n <Text style={[c.results, { color: colors.textSecondary }]} testID={TABLE_TEST_IDS.results}>\n <Text style={{ color: colors.text, fontWeight: '700' }}>{resultsCount.toLocaleString()}</Text>\n {` ${word}`}\n </Text>\n )}\n {!!actions && <View style={c.filtersActions}>{actions}</View>}\n </View>\n );\n}\n\nexport default FilterBar;\n","/**\n * Pager — the shared pagination control from GRID.md (`.ui-pager`): page-info on\n * the left (`from–to of N`), nav on the right (rows-per-page + Prev/Next). Sits ON\n * TOP of the grid (in the section header row), so every paged grid looks the same.\n * RN idiom: rows-per-page is a row of pressable pills (RN has no native `<select>`);\n * everything is themed from `useUi().theme` and labelled via the UiProvider `t`.\n */\nimport React from 'react';\nimport { Pressable, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { DEFAULT_PAGE_SIZE_OPTIONS, TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { chromeStyles as c } from './styles';\n\nconst FIRST_PAGE = 1;\nconst EN_DASH = '–';\n\nexport interface PagerProps {\n /** 1-based current page. */\n page: number;\n /** Rows per page. */\n pageSize: number;\n /** Total row count across all pages. */\n total: number;\n onPageChange: (page: number) => void;\n onPageSizeChange: (pageSize: number) => void;\n /** Rows-per-page choices. Default 25 / 50 / 100 / 200. */\n pageSizeOptions?: readonly number[];\n /**\n * Optional, already-translated unit noun appended to the count line, e.g.\n * `\"leadership terms\"` renders `1–50 of 3,023 leadership terms`. When omitted the\n * count line stays the generic `from–to of N` (byte-identical to prior behaviour).\n */\n unitLabel?: string;\n testID?: string;\n}\n\ninterface NavButtonProps {\n label: string;\n hint: string;\n disabled: boolean;\n onPress: () => void;\n color: string;\n border: string;\n testID: string;\n}\n\nfunction NavButton({ label, hint, disabled, onPress, color, border, testID }: NavButtonProps): React.ReactElement {\n const DISABLED_OPACITY = 0.4;\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityHint={hint}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n style={[c.control, { borderColor: border, opacity: disabled ? DISABLED_OPACITY : 1 }]}\n >\n <Text style={[c.controlText, { color }]}>{label}</Text>\n </Pressable>\n );\n}\n\nexport function Pager({\n page,\n pageSize,\n total,\n onPageChange,\n onPageSizeChange,\n pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS,\n unitLabel,\n testID = TABLE_TEST_IDS.pager,\n}: PagerProps): React.ReactElement {\n const { theme, t } = useUi();\n const { colors, palette } = theme;\n const brand = palette.primary['500'];\n\n const lastPage = Math.max(FIRST_PAGE, Math.ceil(total / pageSize));\n const safePage = Math.min(Math.max(page, FIRST_PAGE), lastPage);\n const from = total === 0 ? 0 : (safePage - 1) * pageSize + 1;\n const to = Math.min(safePage * pageSize, total);\n const count = `${from.toLocaleString()}${EN_DASH}${to.toLocaleString()} ${t(TABLE_I18N.pagerInfo)} ${total.toLocaleString()}`;\n const hasUnit = unitLabel !== undefined && unitLabel !== '';\n const info = hasUnit ? `${count} ${unitLabel}` : count;\n\n return (\n <View style={c.pager} testID={testID}>\n <Text style={[c.pagerInfo, { color: colors.textSecondary }]} testID={TABLE_TEST_IDS.pagerInfo}>{info}</Text>\n <View style={c.pagerNav}>\n <Text style={[c.pagerRowsLabel, { color: colors.textSecondary }]}>{t(TABLE_I18N.pagerRows)}</Text>\n <View style={c.sizeGroup}>\n {pageSizeOptions.map((size) => {\n const active = size === pageSize;\n return (\n <Pressable\n key={size}\n testID={`${testID}-size-${size}`}\n accessibilityRole=\"button\"\n accessibilityLabel={String(size)}\n accessibilityHint={t(TABLE_I18N.pagerRowsOptionHint)}\n accessibilityState={{ selected: active }}\n onPress={() => onPageSizeChange(size)}\n style={[c.sizePill, { borderColor: active ? brand : colors.border, backgroundColor: active ? brand : 'transparent' }]}\n >\n <Text style={[c.sizePillText, { color: active ? colors.surface : colors.textSecondary }]}>{size}</Text>\n </Pressable>\n );\n })}\n </View>\n <NavButton\n label={t(TABLE_I18N.pagerPrev)}\n hint={t(TABLE_I18N.pagerPrevHint)}\n disabled={safePage <= FIRST_PAGE}\n onPress={() => onPageChange(safePage - 1)}\n color={colors.text}\n border={colors.border}\n testID={TABLE_TEST_IDS.pagerPrev}\n />\n <NavButton\n label={t(TABLE_I18N.pagerNext)}\n hint={t(TABLE_I18N.pagerNextHint)}\n disabled={safePage >= lastPage}\n onPress={() => onPageChange(safePage + 1)}\n color={colors.text}\n border={colors.border}\n testID={TABLE_TEST_IDS.pagerNext}\n />\n </View>\n </View>\n );\n}\n\nexport default Pager;\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { memo, useCallback } from 'react';
|
|
1
|
+
import React2, { memo, useCallback } from 'react';
|
|
2
2
|
import { StyleSheet, View, Text, useWindowDimensions, Pressable } from 'react-native';
|
|
3
3
|
import { useUi } from '@dloizides/ui-feedback';
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -53,6 +53,10 @@ var DEFAULT_PAGE_SIZE_OPTIONS = [25, 50, 100, 200];
|
|
|
53
53
|
var TABLE_TEST_IDS = {
|
|
54
54
|
root: "ui-data-table",
|
|
55
55
|
head: "ui-data-table-head",
|
|
56
|
+
/** Infix of a row's test id: `${tableTestID}-row-${key}`. */
|
|
57
|
+
rowInfix: "row",
|
|
58
|
+
/** Infix of an expanded row's detail panel: `${tableTestID}-row-detail-${key}`. */
|
|
59
|
+
rowDetailInfix: "row-detail",
|
|
56
60
|
filterBar: "ui-filters",
|
|
57
61
|
results: "ui-results",
|
|
58
62
|
pager: "ui-pager",
|
|
@@ -60,11 +64,15 @@ var TABLE_TEST_IDS = {
|
|
|
60
64
|
pagerPrev: "ui-pager-prev",
|
|
61
65
|
pagerNext: "ui-pager-next"
|
|
62
66
|
};
|
|
67
|
+
var rowTestID = (tableTestID, key) => `${tableTestID}-${TABLE_TEST_IDS.rowInfix}-${key}`;
|
|
68
|
+
var rowDetailTestID = (tableTestID, key) => `${tableTestID}-${TABLE_TEST_IDS.rowDetailInfix}-${key}`;
|
|
63
69
|
var TABLE_I18N = {
|
|
64
70
|
loading: "uiTables.loading",
|
|
65
71
|
empty: "uiTables.empty",
|
|
66
72
|
rowLabel: "uiTables.rowLabel",
|
|
67
73
|
rowHint: "uiTables.rowHint",
|
|
74
|
+
/** Accessible name of the full-width detail panel under an expanded row. */
|
|
75
|
+
rowDetail: "uiTables.rowDetail",
|
|
68
76
|
results: "uiTables.results",
|
|
69
77
|
pagerInfo: "uiTables.pager.info",
|
|
70
78
|
pagerPrev: "uiTables.pager.prev",
|
|
@@ -96,6 +104,7 @@ var RESULTS_FONT = 13;
|
|
|
96
104
|
var HEAD_LETTER_SPACING = 0.4;
|
|
97
105
|
var LABEL_LETTER_SPACING = 0.3;
|
|
98
106
|
var STICKY_Z = 2;
|
|
107
|
+
var FULL_WIDTH = "100%";
|
|
99
108
|
var STICKY_HEADER_STYLE = {
|
|
100
109
|
position: "sticky",
|
|
101
110
|
top: 0,
|
|
@@ -110,6 +119,8 @@ var tableStyles = StyleSheet.create({
|
|
|
110
119
|
numCell: { fontVariant: ["tabular-nums"], textAlign: "right" },
|
|
111
120
|
state: { paddingVertical: STATE_PAD_V, alignItems: "center" },
|
|
112
121
|
stateText: { fontSize: STATE_FONT },
|
|
122
|
+
/** Full-width panel under an expanded row — spans every column (the wrap is a column flexbox). */
|
|
123
|
+
rowDetail: { width: FULL_WIDTH, paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },
|
|
113
124
|
card: { paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },
|
|
114
125
|
cardLine: { flexDirection: "row", justifyContent: "space-between", alignItems: "baseline", paddingVertical: CARD_LINE_PAD_V, gap: CARD_LINE_GAP },
|
|
115
126
|
cardLabel: { fontSize: HEAD_FONT, fontWeight: "600", textTransform: "uppercase", letterSpacing: LABEL_LETTER_SPACING },
|
|
@@ -148,6 +159,8 @@ function DataTable(props) {
|
|
|
148
159
|
loading,
|
|
149
160
|
loadingLabel,
|
|
150
161
|
emptyLabel,
|
|
162
|
+
renderRowDetail,
|
|
163
|
+
expandedRowKeys,
|
|
151
164
|
stackBreakpoint = CARD_STACK_BREAKPOINT,
|
|
152
165
|
testID = TABLE_TEST_IDS.root
|
|
153
166
|
} = props;
|
|
@@ -170,29 +183,54 @@ function DataTable(props) {
|
|
|
170
183
|
if (rows.length === 0) {
|
|
171
184
|
return /* @__PURE__ */ jsx(View, { style: [tableStyles.wrap, frame], testID, children: /* @__PURE__ */ jsx(View, { style: tableStyles.state, children: /* @__PURE__ */ jsx(Text, { style: [tableStyles.stateText, { color: colors.textSecondary }], children: emptyLabel ?? t(TABLE_I18N.empty) }) }) });
|
|
172
185
|
}
|
|
173
|
-
const
|
|
174
|
-
const
|
|
186
|
+
const rowID = (key) => rowTestID(testID, key);
|
|
187
|
+
const isExpandable = renderRowDetail !== void 0;
|
|
188
|
+
const isExpanded = (key) => isExpandable && (expandedRowKeys?.includes(key) ?? false);
|
|
189
|
+
const rowA11y = (row, key) => ({
|
|
175
190
|
accessibilityLabel: getRowAccessibilityLabel?.(row) ?? t(TABLE_I18N.rowLabel),
|
|
176
191
|
accessibilityHint: t(TABLE_I18N.rowHint),
|
|
177
|
-
accessibilityRole: onRowPress ? "button" : "text"
|
|
192
|
+
accessibilityRole: onRowPress ? "button" : "text",
|
|
193
|
+
// Only an expandable table announces expanded/collapsed — a plain table's rows
|
|
194
|
+
// keep exactly the props they had before this feature existed.
|
|
195
|
+
...isExpandable ? { accessibilityState: { expanded: isExpanded(key) }, "aria-expanded": isExpanded(key) } : null
|
|
178
196
|
});
|
|
197
|
+
const withRowDetail = (rowNode, row, key) => {
|
|
198
|
+
if (!isExpandable || !isExpanded(key)) return rowNode;
|
|
199
|
+
return /* @__PURE__ */ jsxs(React2.Fragment, { children: [
|
|
200
|
+
rowNode,
|
|
201
|
+
/* @__PURE__ */ jsx(
|
|
202
|
+
View,
|
|
203
|
+
{
|
|
204
|
+
accessibilityLabel: t(TABLE_I18N.rowDetail),
|
|
205
|
+
accessibilityRole: "summary",
|
|
206
|
+
style: [tableStyles.rowDetail, { borderTopColor: colors.border, backgroundColor: colors.background }],
|
|
207
|
+
testID: rowDetailTestID(testID, key),
|
|
208
|
+
children: renderRowDetail(row)
|
|
209
|
+
}
|
|
210
|
+
)
|
|
211
|
+
] }, key);
|
|
212
|
+
};
|
|
179
213
|
if (stacked) {
|
|
180
214
|
return /* @__PURE__ */ jsx(View, { style: [tableStyles.wrap, frame], testID, children: rows.map((row, i) => {
|
|
181
215
|
const key = keyExtractor(row);
|
|
182
216
|
const bg = rowBackground(row, i);
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
217
|
+
return withRowDetail(
|
|
218
|
+
/* @__PURE__ */ jsx(
|
|
219
|
+
Pressable,
|
|
220
|
+
{
|
|
221
|
+
testID: rowID(key),
|
|
222
|
+
disabled: !onRowPress,
|
|
223
|
+
onPress: onRowPress ? () => onRowPress(row) : void 0,
|
|
224
|
+
...rowA11y(row, key),
|
|
225
|
+
style: [tableStyles.card, { borderTopColor: colors.border }, i === FIRST_ROW_INDEX ? { borderTopWidth: 0 } : null, bg ? { backgroundColor: bg } : null],
|
|
226
|
+
children: columns.map((col) => /* @__PURE__ */ jsxs(View, { style: tableStyles.cardLine, children: [
|
|
227
|
+
/* @__PURE__ */ jsx(Text, { style: [tableStyles.cardLabel, { color: colors.textSecondary }], children: col.header }),
|
|
228
|
+
/* @__PURE__ */ jsx(View, { style: tableStyles.cardValue, children: col.render(row) })
|
|
229
|
+
] }, col.key))
|
|
230
|
+
},
|
|
231
|
+
key
|
|
232
|
+
),
|
|
233
|
+
row,
|
|
196
234
|
key
|
|
197
235
|
);
|
|
198
236
|
}) });
|
|
@@ -216,16 +254,20 @@ function DataTable(props) {
|
|
|
216
254
|
rows.map((row, i) => {
|
|
217
255
|
const key = keyExtractor(row);
|
|
218
256
|
const bg = rowBackground(row, i);
|
|
219
|
-
return
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
257
|
+
return withRowDetail(
|
|
258
|
+
/* @__PURE__ */ jsx(
|
|
259
|
+
Pressable,
|
|
260
|
+
{
|
|
261
|
+
testID: rowID(key),
|
|
262
|
+
disabled: !onRowPress,
|
|
263
|
+
onPress: onRowPress ? () => onRowPress(row) : void 0,
|
|
264
|
+
...rowA11y(row, key),
|
|
265
|
+
style: [tableStyles.row, { borderTopColor: colors.border }, bg ? { backgroundColor: bg } : null],
|
|
266
|
+
children: columns.map((col) => /* @__PURE__ */ jsx(DesktopCell, { column: col, row, textColor: colors.text, testID: `${rowID(key)}-${col.key}` }, col.key))
|
|
267
|
+
},
|
|
268
|
+
key
|
|
269
|
+
),
|
|
270
|
+
row,
|
|
229
271
|
key
|
|
230
272
|
);
|
|
231
273
|
})
|
|
@@ -339,6 +381,6 @@ function Pager({
|
|
|
339
381
|
] });
|
|
340
382
|
}
|
|
341
383
|
|
|
342
|
-
export { CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE_OPTIONS, DataTable, FilterBar, Pager, StatCard, TABLE_I18N, TABLE_TEST_IDS };
|
|
384
|
+
export { CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE_OPTIONS, DataTable, FilterBar, Pager, StatCard, TABLE_I18N, TABLE_TEST_IDS, rowDetailTestID, rowTestID };
|
|
343
385
|
//# sourceMappingURL=index.mjs.map
|
|
344
386
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/StatCard/StatCard.tsx","../src/DataTable/constants.ts","../src/DataTable/styles.ts","../src/DataTable/DataTable.tsx","../src/DataTable/FilterBar.tsx","../src/DataTable/Pager.tsx"],"names":["StyleSheet","jsx","View","Text","useUi","jsxs","Pressable"],"mappings":";;;;;;AASA,IAAM,YAAA,GAAe,EAAA;AACrB,IAAM,kBAAA,GAAqB,EAAA;AAC3B,IAAM,iBAAA,GAAoB,CAAA;AAC1B,IAAM,eAAA,GAAkB,EAAA;AACxB,IAAM,eAAA,GAAkB,EAAA;AACxB,IAAM,iBAAA,GAAoB,EAAA;AAE1B,IAAM,MAAA,GAAS,WAAW,MAAA,CAAO;AAAA,EAC/B,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,YAAA;AAAA,IACT,YAAA,EAAc,kBAAA;AAAA,IACd,WAAA,EAAa;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,UAAA,EAAY;AAAA,GACd;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,UAAA,EAAY,KAAA;AAAA,IACZ,UAAA,EAAY;AAAA;AAEhB,CAAC,CAAA;AAQM,IAAM,WAAW,IAAA,CAAK,CAAC,EAAE,KAAA,EAAO,KAAA,EAAO,QAAO,KAAyC;AAC5F,EAAA,MAAM,EAAE,KAAA,EAAO,CAAA,EAAE,GAAI,KAAA,EAAM;AAC3B,EAAA,MAAM,EAAE,QAAO,GAAI,KAAA;AAEnB,EAAA,MAAM,cAAA,GAAiB,MAAM,cAAA,EAAe;AAE5C,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,iBAAA,EAAmB,CAAA,CAAE,oBAAA,EAAsB,K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,QAAQ,MAAA,CAAO,MAAA;AAAA,UACf,QAAQ,cAAA,CAAe;AAAA;AAAA,OACzB;AAAA,sBACAA,GAAAA;AAAA,QAAC,SAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,CAAA,CAAE,UAAA,CAAW,SAAS,CAAA;AAAA,UAC7B,IAAA,EAAM,CAAA,CAAE,UAAA,CAAW,aAAa,CAAA;AAAA,UAChC,UAAU,QAAA,IAAY,QAAA;AAAA,UACtB,OAAA,EAAS,MAAM,YAAA,CAAa,QAAA,GAAW,CAAC,CAAA;AAAA,UACxC,OAAO,MAAA,CAAO,IAAA;AAAA,UACd,QAAQ,MAAA,CAAO,MAAA;AAAA,UACf,QAAQ,cAAA,CAAe;AAAA;AAAA;AACzB,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"index.mjs","sourcesContent":["/**\n * StatCard — a single labelled metric tile (label + formatted numeric value).\n */\nimport React, { memo } from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst CARD_PADDING = 16;\nconst CARD_BORDER_RADIUS = 12;\nconst CARD_BORDER_WIDTH = 1;\nconst LABEL_FONT_SIZE = 14;\nconst VALUE_FONT_SIZE = 28;\nconst VALUE_LINE_HEIGHT = 36;\n\nconst styles = StyleSheet.create({\n card: {\n padding: CARD_PADDING,\n borderRadius: CARD_BORDER_RADIUS,\n borderWidth: CARD_BORDER_WIDTH,\n },\n label: {\n fontSize: LABEL_FONT_SIZE,\n fontWeight: '500',\n },\n value: {\n fontSize: VALUE_FONT_SIZE,\n fontWeight: '700',\n lineHeight: VALUE_LINE_HEIGHT,\n },\n});\n\nexport interface StatCardProps {\n label: string;\n value: number;\n testID: string;\n}\n\nexport const StatCard = memo(({ label, value, testID }: StatCardProps): React.ReactElement => {\n const { theme, t } = useUi();\n const { colors } = theme;\n\n const formattedValue = value.toLocaleString();\n\n return (\n <View\n accessibilityHint={t('analytics.statHint', label)}\n accessibilityLabel={t('analytics.statCardLabel', label, formattedValue)}\n accessibilityRole=\"text\"\n style={[styles.card, { backgroundColor: colors.surface, borderColor: colors.border }]}\n testID={testID}\n >\n <Text style={[styles.label, { color: colors.textSecondary }]}>\n {label}\n </Text>\n <Text style={[styles.value, { color: colors.text }]}>\n {formattedValue}\n </Text>\n </View>\n );\n});\n\nStatCard.displayName = 'StatCard';\n\nexport default StatCard;\n","/**\n * Shared constants for the DataTable family (DataTable / FilterBar / Pager).\n * Keeps every literal (test ids, i18n keys, layout numbers) in one place so the\n * components hold no magic numbers and no ad-hoc strings.\n */\n\n/** Default breakpoint (px): below this a row collapses to a label:value card. */\nexport const CARD_STACK_BREAKPOINT = 640;\n\n/** Default rows-per-page choices, matching the vanilla console's GRID.md pager. */\nexport const DEFAULT_PAGE_SIZE_OPTIONS: readonly number[] = [25, 50, 100, 200];\n\n/** Stable test ids so consumers/e2e can target the shared chrome. */\nexport const TABLE_TEST_IDS = {\n root: 'ui-data-table',\n head: 'ui-data-table-head',\n filterBar: 'ui-filters',\n results: 'ui-results',\n pager: 'ui-pager',\n pagerInfo: 'ui-pager-info',\n pagerPrev: 'ui-pager-prev',\n pagerNext: 'ui-pager-next',\n} as const;\n\n/**\n * Translation keys for every component-authored, user-facing string. Apps map\n * these in their UiProvider `t` (FM); the neutral default `t` returns the key, so\n * a host that forgets a key degrades to the key rather than a hardcoded literal.\n */\nexport const TABLE_I18N = {\n loading: 'uiTables.loading',\n empty: 'uiTables.empty',\n rowLabel: 'uiTables.rowLabel',\n rowHint: 'uiTables.rowHint',\n results: 'uiTables.results',\n pagerInfo: 'uiTables.pager.info',\n pagerPrev: 'uiTables.pager.prev',\n pagerNext: 'uiTables.pager.next',\n pagerPrevHint: 'uiTables.pager.prevHint',\n pagerNextHint: 'uiTables.pager.nextHint',\n pagerRows: 'uiTables.pager.rows',\n pagerRowsOptionHint: 'uiTables.pager.rowsOptionHint',\n} as const;\n","/**\n * Shared StyleSheet for the DataTable family. All colours are applied inline from\n * `useUi().theme` at render time — nothing here carries a colour literal.\n */\nimport { StyleSheet, type ViewStyle } from 'react-native';\n\nconst BORDER_WIDTH = 1;\nconst BORDER_RADIUS = 12;\nconst COLUMN_GAP = 16;\nconst ROW_PAD_H = 14;\nconst ROW_PAD_V = 12;\nconst HEAD_PAD_V = 11;\nconst STATE_PAD_V = 34;\nconst HEAD_FONT = 12;\nconst CELL_FONT = 14;\nconst STATE_FONT = 14;\nconst CARD_LINE_PAD_V = 3;\nconst CARD_LINE_GAP = 12;\nconst PILL_RADIUS = 999;\nconst PAGER_GAP = 8;\nconst PAGER_SIZE_GAP = 6;\nconst CONTROL_PAD_H = 12;\nconst CONTROL_PAD_V = 6;\nconst CONTROL_FONT = 13;\nconst RESULTS_FONT = 13;\nconst HEAD_LETTER_SPACING = 0.4;\nconst LABEL_LETTER_SPACING = 0.3;\nconst STICKY_Z = 2;\n\n/**\n * `position: 'sticky'` is a react-native-web-only value that RN's `ViewStyle`\n * type does not enumerate. Cast through `unknown` (never `any`) so the sticky\n * header stays typed without an eslint `no-explicit-any` violation.\n */\nexport const STICKY_HEADER_STYLE = {\n position: 'sticky',\n top: 0,\n zIndex: STICKY_Z,\n} as unknown as ViewStyle;\n\nexport const tableStyles = StyleSheet.create({\n wrap: { borderWidth: BORDER_WIDTH, borderRadius: BORDER_RADIUS, overflow: 'hidden' },\n headRow: { flexDirection: 'row', columnGap: COLUMN_GAP, paddingHorizontal: ROW_PAD_H, paddingVertical: HEAD_PAD_V },\n headCell: { fontSize: HEAD_FONT, fontWeight: '600', letterSpacing: HEAD_LETTER_SPACING, textTransform: 'uppercase' },\n row: { flexDirection: 'row', columnGap: COLUMN_GAP, alignItems: 'center', paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },\n cell: { fontSize: CELL_FONT, fontWeight: '400' },\n numCell: { fontVariant: ['tabular-nums'], textAlign: 'right' },\n state: { paddingVertical: STATE_PAD_V, alignItems: 'center' },\n stateText: { fontSize: STATE_FONT },\n card: { paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },\n cardLine: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'baseline', paddingVertical: CARD_LINE_PAD_V, gap: CARD_LINE_GAP },\n cardLabel: { fontSize: HEAD_FONT, fontWeight: '600', textTransform: 'uppercase', letterSpacing: LABEL_LETTER_SPACING },\n cardValue: { flexShrink: 1, alignItems: 'flex-end' },\n});\n\nexport const chromeStyles = StyleSheet.create({\n filters: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'flex-end', columnGap: COLUMN_GAP, rowGap: PAGER_GAP, borderWidth: BORDER_WIDTH, borderRadius: BORDER_RADIUS, paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V },\n filtersSpacer: { flexGrow: 1 },\n results: { fontSize: RESULTS_FONT },\n filtersActions: { flexDirection: 'row', gap: PAGER_SIZE_GAP, alignItems: 'center' },\n pager: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'space-between', gap: PAGER_GAP },\n pagerInfo: { fontSize: CONTROL_FONT, fontVariant: ['tabular-nums'] },\n pagerNav: { flexDirection: 'row', alignItems: 'center', gap: PAGER_SIZE_GAP, flexWrap: 'wrap' },\n pagerRowsLabel: { fontSize: HEAD_FONT, textTransform: 'uppercase', letterSpacing: LABEL_LETTER_SPACING },\n sizeGroup: { flexDirection: 'row', gap: PAGER_SIZE_GAP, alignItems: 'center' },\n control: { paddingHorizontal: CONTROL_PAD_H, paddingVertical: CONTROL_PAD_V, borderRadius: BORDER_RADIUS, borderWidth: BORDER_WIDTH },\n controlText: { fontSize: CONTROL_FONT, fontWeight: '600' },\n sizePill: { paddingHorizontal: CONTROL_PAD_H, paddingVertical: CONTROL_PAD_V, borderRadius: PILL_RADIUS, borderWidth: BORDER_WIDTH },\n sizePillText: { fontSize: HEAD_FONT, fontWeight: '600', fontVariant: ['tabular-nums'] },\n});\n","/**\n * DataTable — the shared, tokenized RN-web grid for every dloizides.com surface\n * (and the future AML v2 portal). Promoted from the POC draft; completes the\n * `wwwroot/shared/GRID.md` behavioural contract in the RN idiom:\n *\n * - columns + rows API (unchanged from the POC — it is the right shape).\n * - sticky header (`stickyHeader`), zebra striping (`zebra`), per-row tint.\n * - a responsive label:value **card-stack** below `stackBreakpoint` via\n * `useWindowDimensions` (the CSS `data-label` card-stack does not port).\n * - per-row `testID` + `accessibilityLabel`/`accessibilityHint` (kit standard).\n * - every colour from `useUi().theme`; every component-authored string via `t`.\n */\nimport React, { useCallback } from 'react';\nimport { Pressable, Text, View, useWindowDimensions } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { CARD_STACK_BREAKPOINT, TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { STICKY_HEADER_STYLE, tableStyles as s } from './styles';\nimport type { DataTableColumn, DataTableProps } from './types';\n\nconst FIRST_ROW_INDEX = 0;\n\n/** A single desktop cell — renders `col.render(row)` exactly ONCE (POC bug fix). */\nfunction DesktopCell<T>({ column, row, textColor, testID }: { column: DataTableColumn<T>; row: T; textColor: string; testID: string }): React.ReactElement {\n const content = column.render(row);\n return (\n <View style={{ flex: column.weight ?? 1, alignItems: column.numeric ? 'flex-end' : 'flex-start' }} testID={testID}>\n {typeof content === 'string' ? (\n <Text style={[s.cell, column.numeric ? s.numCell : null, { color: textColor }]}>{content}</Text>\n ) : (\n content\n )}\n </View>\n );\n}\n\nexport function DataTable<T>(props: DataTableProps<T>): React.ReactElement {\n const {\n columns, rows, keyExtractor, rowTint, zebra, stickyHeader, onRowPress,\n getRowAccessibilityLabel, loading, loadingLabel, emptyLabel,\n stackBreakpoint = CARD_STACK_BREAKPOINT, testID = TABLE_TEST_IDS.root,\n } = props;\n\n const { theme, t } = useUi();\n const { colors } = theme;\n const { width } = useWindowDimensions();\n const stacked = width < stackBreakpoint;\n const frame = { backgroundColor: colors.surface, borderColor: colors.border };\n\n const rowBackground = useCallback(\n (row: T, index: number): string | undefined => {\n const tint = rowTint?.(row);\n if (tint) return tint;\n return zebra && index % 2 === 1 ? colors.background : undefined;\n },\n [rowTint, zebra, colors.background],\n );\n\n if (loading) {\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n <View style={s.state}>\n <Text style={[s.stateText, { color: colors.textSecondary }]}>{loadingLabel ?? t(TABLE_I18N.loading)}</Text>\n </View>\n </View>\n );\n }\n if (rows.length === 0) {\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n <View style={s.state}>\n <Text style={[s.stateText, { color: colors.textSecondary }]}>{emptyLabel ?? t(TABLE_I18N.empty)}</Text>\n </View>\n </View>\n );\n }\n\n const rowTestID = (key: string): string => `${testID}-row-${key}`;\n const rowA11y = (row: T): { accessibilityLabel: string; accessibilityHint: string; accessibilityRole: 'button' | 'text' } => ({\n accessibilityLabel: getRowAccessibilityLabel?.(row) ?? t(TABLE_I18N.rowLabel),\n accessibilityHint: t(TABLE_I18N.rowHint),\n accessibilityRole: onRowPress ? 'button' : 'text',\n });\n\n // --- mobile: label:value card-stack (GRID.md) ---\n if (stacked) {\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n {rows.map((row, i) => {\n const key = keyExtractor(row);\n const bg = rowBackground(row, i);\n return (\n <Pressable\n key={key}\n testID={rowTestID(key)}\n disabled={!onRowPress}\n onPress={onRowPress ? () => onRowPress(row) : undefined}\n {...rowA11y(row)}\n style={[s.card, { borderTopColor: colors.border }, i === FIRST_ROW_INDEX ? { borderTopWidth: 0 } : null, bg ? { backgroundColor: bg } : null]}\n >\n {columns.map((col) => (\n <View key={col.key} style={s.cardLine}>\n <Text style={[s.cardLabel, { color: colors.textSecondary }]}>{col.header}</Text>\n <View style={s.cardValue}>{col.render(row)}</View>\n </View>\n ))}\n </Pressable>\n );\n })}\n </View>\n );\n }\n\n // --- desktop: header + rows ---\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n <View\n testID={TABLE_TEST_IDS.head}\n style={[s.headRow, { backgroundColor: colors.background }, stickyHeader ? STICKY_HEADER_STYLE : null]}\n >\n {columns.map((col) => (\n <Text\n key={col.key}\n style={[s.headCell, { color: colors.textSecondary, flex: col.weight ?? 1, textAlign: col.numeric ? 'right' : 'left' }]}\n >\n {col.header}\n </Text>\n ))}\n </View>\n {rows.map((row, i) => {\n const key = keyExtractor(row);\n const bg = rowBackground(row, i);\n return (\n <Pressable\n key={key}\n testID={rowTestID(key)}\n disabled={!onRowPress}\n onPress={onRowPress ? () => onRowPress(row) : undefined}\n {...rowA11y(row)}\n style={[s.row, { borderTopColor: colors.border }, bg ? { backgroundColor: bg } : null]}\n >\n {columns.map((col) => (\n <DesktopCell key={col.key} column={col} row={row} textColor={colors.text} testID={`${rowTestID(key)}-${col.key}`} />\n ))}\n </Pressable>\n );\n })}\n </View>\n );\n}\n\nexport default DataTable;\n","/**\n * FilterBar — the shared filter-bar shell from GRID.md (`.ui-filters`): a themed,\n * wrapping row that holds the caller's filter fields, an optional live results\n * count (`<b>N</b> results`) and an optional actions slot (Apply / Export …).\n * Layout + theming only — the fields themselves come from the app (or @dloizides/\n * ui-forms), keeping this reusable across every grid rather than coverage-specific.\n */\nimport React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { chromeStyles as c } from './styles';\n\nexport interface FilterBarProps {\n /** The filter fields (labels + inputs), supplied by the app / ui-forms. */\n children?: React.ReactNode;\n /** Live count shown as `<b>{resultsCount}</b> {results}`. Omit to hide. */\n resultsCount?: number;\n /** Overrides the kit's translated \"results\" word (pass an app-translated string). */\n resultsLabel?: string;\n /** Right-aligned action buttons (Apply, Export CSV, …). */\n actions?: React.ReactNode;\n testID?: string;\n}\n\nexport function FilterBar({\n children,\n resultsCount,\n resultsLabel,\n actions,\n testID = TABLE_TEST_IDS.filterBar,\n}: FilterBarProps): React.ReactElement {\n const { theme, t } = useUi();\n const { colors } = theme;\n const word = resultsLabel ?? t(TABLE_I18N.results);\n\n return (\n <View style={[c.filters, { backgroundColor: colors.surface, borderColor: colors.border }]} testID={testID}>\n {children}\n <View style={c.filtersSpacer} />\n {typeof resultsCount === 'number' && (\n <Text style={[c.results, { color: colors.textSecondary }]} testID={TABLE_TEST_IDS.results}>\n <Text style={{ color: colors.text, fontWeight: '700' }}>{resultsCount.toLocaleString()}</Text>\n {` ${word}`}\n </Text>\n )}\n {!!actions && <View style={c.filtersActions}>{actions}</View>}\n </View>\n );\n}\n\nexport default FilterBar;\n","/**\n * Pager — the shared pagination control from GRID.md (`.ui-pager`): page-info on\n * the left (`from–to of N`), nav on the right (rows-per-page + Prev/Next). Sits ON\n * TOP of the grid (in the section header row), so every paged grid looks the same.\n * RN idiom: rows-per-page is a row of pressable pills (RN has no native `<select>`);\n * everything is themed from `useUi().theme` and labelled via the UiProvider `t`.\n */\nimport React from 'react';\nimport { Pressable, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { DEFAULT_PAGE_SIZE_OPTIONS, TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { chromeStyles as c } from './styles';\n\nconst FIRST_PAGE = 1;\nconst EN_DASH = '–';\n\nexport interface PagerProps {\n /** 1-based current page. */\n page: number;\n /** Rows per page. */\n pageSize: number;\n /** Total row count across all pages. */\n total: number;\n onPageChange: (page: number) => void;\n onPageSizeChange: (pageSize: number) => void;\n /** Rows-per-page choices. Default 25 / 50 / 100 / 200. */\n pageSizeOptions?: readonly number[];\n /**\n * Optional, already-translated unit noun appended to the count line, e.g.\n * `\"leadership terms\"` renders `1–50 of 3,023 leadership terms`. When omitted the\n * count line stays the generic `from–to of N` (byte-identical to prior behaviour).\n */\n unitLabel?: string;\n testID?: string;\n}\n\ninterface NavButtonProps {\n label: string;\n hint: string;\n disabled: boolean;\n onPress: () => void;\n color: string;\n border: string;\n testID: string;\n}\n\nfunction NavButton({ label, hint, disabled, onPress, color, border, testID }: NavButtonProps): React.ReactElement {\n const DISABLED_OPACITY = 0.4;\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityHint={hint}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n style={[c.control, { borderColor: border, opacity: disabled ? DISABLED_OPACITY : 1 }]}\n >\n <Text style={[c.controlText, { color }]}>{label}</Text>\n </Pressable>\n );\n}\n\nexport function Pager({\n page,\n pageSize,\n total,\n onPageChange,\n onPageSizeChange,\n pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS,\n unitLabel,\n testID = TABLE_TEST_IDS.pager,\n}: PagerProps): React.ReactElement {\n const { theme, t } = useUi();\n const { colors, palette } = theme;\n const brand = palette.primary['500'];\n\n const lastPage = Math.max(FIRST_PAGE, Math.ceil(total / pageSize));\n const safePage = Math.min(Math.max(page, FIRST_PAGE), lastPage);\n const from = total === 0 ? 0 : (safePage - 1) * pageSize + 1;\n const to = Math.min(safePage * pageSize, total);\n const count = `${from.toLocaleString()}${EN_DASH}${to.toLocaleString()} ${t(TABLE_I18N.pagerInfo)} ${total.toLocaleString()}`;\n const hasUnit = unitLabel !== undefined && unitLabel !== '';\n const info = hasUnit ? `${count} ${unitLabel}` : count;\n\n return (\n <View style={c.pager} testID={testID}>\n <Text style={[c.pagerInfo, { color: colors.textSecondary }]} testID={TABLE_TEST_IDS.pagerInfo}>{info}</Text>\n <View style={c.pagerNav}>\n <Text style={[c.pagerRowsLabel, { color: colors.textSecondary }]}>{t(TABLE_I18N.pagerRows)}</Text>\n <View style={c.sizeGroup}>\n {pageSizeOptions.map((size) => {\n const active = size === pageSize;\n return (\n <Pressable\n key={size}\n testID={`${testID}-size-${size}`}\n accessibilityRole=\"button\"\n accessibilityLabel={String(size)}\n accessibilityHint={t(TABLE_I18N.pagerRowsOptionHint)}\n accessibilityState={{ selected: active }}\n onPress={() => onPageSizeChange(size)}\n style={[c.sizePill, { borderColor: active ? brand : colors.border, backgroundColor: active ? brand : 'transparent' }]}\n >\n <Text style={[c.sizePillText, { color: active ? colors.surface : colors.textSecondary }]}>{size}</Text>\n </Pressable>\n );\n })}\n </View>\n <NavButton\n label={t(TABLE_I18N.pagerPrev)}\n hint={t(TABLE_I18N.pagerPrevHint)}\n disabled={safePage <= FIRST_PAGE}\n onPress={() => onPageChange(safePage - 1)}\n color={colors.text}\n border={colors.border}\n testID={TABLE_TEST_IDS.pagerPrev}\n />\n <NavButton\n label={t(TABLE_I18N.pagerNext)}\n hint={t(TABLE_I18N.pagerNextHint)}\n disabled={safePage >= lastPage}\n onPress={() => onPageChange(safePage + 1)}\n color={colors.text}\n border={colors.border}\n testID={TABLE_TEST_IDS.pagerNext}\n />\n </View>\n </View>\n );\n}\n\nexport default Pager;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/StatCard/StatCard.tsx","../src/DataTable/constants.ts","../src/DataTable/styles.ts","../src/DataTable/DataTable.tsx","../src/DataTable/FilterBar.tsx","../src/DataTable/Pager.tsx"],"names":["StyleSheet","jsx","View","Text","useUi","jsxs","React","Pressable"],"mappings":";;;;;;AASA,IAAM,YAAA,GAAe,EAAA;AACrB,IAAM,kBAAA,GAAqB,EAAA;AAC3B,IAAM,iBAAA,GAAoB,CAAA;AAC1B,IAAM,eAAA,GAAkB,EAAA;AACxB,IAAM,eAAA,GAAkB,EAAA;AACxB,IAAM,iBAAA,GAAoB,EAAA;AAE1B,IAAM,MAAA,GAAS,WAAW,MAAA,CAAO;AAAA,EAC/B,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,YAAA;AAAA,IACT,YAAA,EAAc,kBAAA;AAAA,IACd,WAAA,EAAa;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,UAAA,EAAY;AAAA,GACd;AAAA,EACA,KAAA,EAAO;AAAA,IACL,QAAA,EAAU,eAAA;AAAA,IACV,UAAA,EAAY,KAAA;AAAA,IACZ,UAAA,EAAY;AAAA;AAEhB,CAAC,CAAA;AAQM,IAAM,WA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C,OAAO,MAAA,CAAO,IAAA;AAAA,UACd,QAAQ,MAAA,CAAO,MAAA;AAAA,UACf,QAAQ,cAAA,CAAe;AAAA;AAAA;AACzB,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"index.mjs","sourcesContent":["/**\n * StatCard — a single labelled metric tile (label + formatted numeric value).\n */\nimport React, { memo } from 'react';\n\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nconst CARD_PADDING = 16;\nconst CARD_BORDER_RADIUS = 12;\nconst CARD_BORDER_WIDTH = 1;\nconst LABEL_FONT_SIZE = 14;\nconst VALUE_FONT_SIZE = 28;\nconst VALUE_LINE_HEIGHT = 36;\n\nconst styles = StyleSheet.create({\n card: {\n padding: CARD_PADDING,\n borderRadius: CARD_BORDER_RADIUS,\n borderWidth: CARD_BORDER_WIDTH,\n },\n label: {\n fontSize: LABEL_FONT_SIZE,\n fontWeight: '500',\n },\n value: {\n fontSize: VALUE_FONT_SIZE,\n fontWeight: '700',\n lineHeight: VALUE_LINE_HEIGHT,\n },\n});\n\nexport interface StatCardProps {\n label: string;\n value: number;\n testID: string;\n}\n\nexport const StatCard = memo(({ label, value, testID }: StatCardProps): React.ReactElement => {\n const { theme, t } = useUi();\n const { colors } = theme;\n\n const formattedValue = value.toLocaleString();\n\n return (\n <View\n accessibilityHint={t('analytics.statHint', label)}\n accessibilityLabel={t('analytics.statCardLabel', label, formattedValue)}\n accessibilityRole=\"text\"\n style={[styles.card, { backgroundColor: colors.surface, borderColor: colors.border }]}\n testID={testID}\n >\n <Text style={[styles.label, { color: colors.textSecondary }]}>\n {label}\n </Text>\n <Text style={[styles.value, { color: colors.text }]}>\n {formattedValue}\n </Text>\n </View>\n );\n});\n\nStatCard.displayName = 'StatCard';\n\nexport default StatCard;\n","/**\n * Shared constants for the DataTable family (DataTable / FilterBar / Pager).\n * Keeps every literal (test ids, i18n keys, layout numbers) in one place so the\n * components hold no magic numbers and no ad-hoc strings.\n */\n\n/** Default breakpoint (px): below this a row collapses to a label:value card. */\nexport const CARD_STACK_BREAKPOINT = 640;\n\n/** Default rows-per-page choices, matching the vanilla console's GRID.md pager. */\nexport const DEFAULT_PAGE_SIZE_OPTIONS: readonly number[] = [25, 50, 100, 200];\n\n/** Stable test ids so consumers/e2e can target the shared chrome. */\nexport const TABLE_TEST_IDS = {\n root: 'ui-data-table',\n head: 'ui-data-table-head',\n /** Infix of a row's test id: `${tableTestID}-row-${key}`. */\n rowInfix: 'row',\n /** Infix of an expanded row's detail panel: `${tableTestID}-row-detail-${key}`. */\n rowDetailInfix: 'row-detail',\n filterBar: 'ui-filters',\n results: 'ui-results',\n pager: 'ui-pager',\n pagerInfo: 'ui-pager-info',\n pagerPrev: 'ui-pager-prev',\n pagerNext: 'ui-pager-next',\n} as const;\n\n/** The test id of a row: `${tableTestID}-row-${key}` (key from `keyExtractor`). */\nexport const rowTestID = (tableTestID: string, key: string): string =>\n `${tableTestID}-${TABLE_TEST_IDS.rowInfix}-${key}`;\n\n/**\n * The test id of an expanded row's full-width detail panel:\n * `${tableTestID}-row-detail-${key}` (key from `keyExtractor`). Exported so\n * consumers and e2e specs target the panel without re-deriving the shape.\n */\nexport const rowDetailTestID = (tableTestID: string, key: string): string =>\n `${tableTestID}-${TABLE_TEST_IDS.rowDetailInfix}-${key}`;\n\n/**\n * Translation keys for every component-authored, user-facing string. Apps map\n * these in their UiProvider `t` (FM); the neutral default `t` returns the key, so\n * a host that forgets a key degrades to the key rather than a hardcoded literal.\n */\nexport const TABLE_I18N = {\n loading: 'uiTables.loading',\n empty: 'uiTables.empty',\n rowLabel: 'uiTables.rowLabel',\n rowHint: 'uiTables.rowHint',\n /** Accessible name of the full-width detail panel under an expanded row. */\n rowDetail: 'uiTables.rowDetail',\n results: 'uiTables.results',\n pagerInfo: 'uiTables.pager.info',\n pagerPrev: 'uiTables.pager.prev',\n pagerNext: 'uiTables.pager.next',\n pagerPrevHint: 'uiTables.pager.prevHint',\n pagerNextHint: 'uiTables.pager.nextHint',\n pagerRows: 'uiTables.pager.rows',\n pagerRowsOptionHint: 'uiTables.pager.rowsOptionHint',\n} as const;\n","/**\n * Shared StyleSheet for the DataTable family. All colours are applied inline from\n * `useUi().theme` at render time — nothing here carries a colour literal.\n */\nimport { StyleSheet, type ViewStyle } from 'react-native';\n\nconst BORDER_WIDTH = 1;\nconst BORDER_RADIUS = 12;\nconst COLUMN_GAP = 16;\nconst ROW_PAD_H = 14;\nconst ROW_PAD_V = 12;\nconst HEAD_PAD_V = 11;\nconst STATE_PAD_V = 34;\nconst HEAD_FONT = 12;\nconst CELL_FONT = 14;\nconst STATE_FONT = 14;\nconst CARD_LINE_PAD_V = 3;\nconst CARD_LINE_GAP = 12;\nconst PILL_RADIUS = 999;\nconst PAGER_GAP = 8;\nconst PAGER_SIZE_GAP = 6;\nconst CONTROL_PAD_H = 12;\nconst CONTROL_PAD_V = 6;\nconst CONTROL_FONT = 13;\nconst RESULTS_FONT = 13;\nconst HEAD_LETTER_SPACING = 0.4;\nconst LABEL_LETTER_SPACING = 0.3;\nconst STICKY_Z = 2;\nconst FULL_WIDTH = '100%' as const;\n\n/**\n * `position: 'sticky'` is a react-native-web-only value that RN's `ViewStyle`\n * type does not enumerate. Cast through `unknown` (never `any`) so the sticky\n * header stays typed without an eslint `no-explicit-any` violation.\n */\nexport const STICKY_HEADER_STYLE = {\n position: 'sticky',\n top: 0,\n zIndex: STICKY_Z,\n} as unknown as ViewStyle;\n\nexport const tableStyles = StyleSheet.create({\n wrap: { borderWidth: BORDER_WIDTH, borderRadius: BORDER_RADIUS, overflow: 'hidden' },\n headRow: { flexDirection: 'row', columnGap: COLUMN_GAP, paddingHorizontal: ROW_PAD_H, paddingVertical: HEAD_PAD_V },\n headCell: { fontSize: HEAD_FONT, fontWeight: '600', letterSpacing: HEAD_LETTER_SPACING, textTransform: 'uppercase' },\n row: { flexDirection: 'row', columnGap: COLUMN_GAP, alignItems: 'center', paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },\n cell: { fontSize: CELL_FONT, fontWeight: '400' },\n numCell: { fontVariant: ['tabular-nums'], textAlign: 'right' },\n state: { paddingVertical: STATE_PAD_V, alignItems: 'center' },\n stateText: { fontSize: STATE_FONT },\n /** Full-width panel under an expanded row — spans every column (the wrap is a column flexbox). */\n rowDetail: { width: FULL_WIDTH, paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },\n card: { paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V, borderTopWidth: BORDER_WIDTH },\n cardLine: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'baseline', paddingVertical: CARD_LINE_PAD_V, gap: CARD_LINE_GAP },\n cardLabel: { fontSize: HEAD_FONT, fontWeight: '600', textTransform: 'uppercase', letterSpacing: LABEL_LETTER_SPACING },\n cardValue: { flexShrink: 1, alignItems: 'flex-end' },\n});\n\nexport const chromeStyles = StyleSheet.create({\n filters: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'flex-end', columnGap: COLUMN_GAP, rowGap: PAGER_GAP, borderWidth: BORDER_WIDTH, borderRadius: BORDER_RADIUS, paddingHorizontal: ROW_PAD_H, paddingVertical: ROW_PAD_V },\n filtersSpacer: { flexGrow: 1 },\n results: { fontSize: RESULTS_FONT },\n filtersActions: { flexDirection: 'row', gap: PAGER_SIZE_GAP, alignItems: 'center' },\n pager: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'space-between', gap: PAGER_GAP },\n pagerInfo: { fontSize: CONTROL_FONT, fontVariant: ['tabular-nums'] },\n pagerNav: { flexDirection: 'row', alignItems: 'center', gap: PAGER_SIZE_GAP, flexWrap: 'wrap' },\n pagerRowsLabel: { fontSize: HEAD_FONT, textTransform: 'uppercase', letterSpacing: LABEL_LETTER_SPACING },\n sizeGroup: { flexDirection: 'row', gap: PAGER_SIZE_GAP, alignItems: 'center' },\n control: { paddingHorizontal: CONTROL_PAD_H, paddingVertical: CONTROL_PAD_V, borderRadius: BORDER_RADIUS, borderWidth: BORDER_WIDTH },\n controlText: { fontSize: CONTROL_FONT, fontWeight: '600' },\n sizePill: { paddingHorizontal: CONTROL_PAD_H, paddingVertical: CONTROL_PAD_V, borderRadius: PILL_RADIUS, borderWidth: BORDER_WIDTH },\n sizePillText: { fontSize: HEAD_FONT, fontWeight: '600', fontVariant: ['tabular-nums'] },\n});\n","/**\n * DataTable — the shared, tokenized RN-web grid for every dloizides.com surface\n * (and the future AML v2 portal). Promoted from the POC draft; completes the\n * `wwwroot/shared/GRID.md` behavioural contract in the RN idiom:\n *\n * - columns + rows API (unchanged from the POC — it is the right shape).\n * - sticky header (`stickyHeader`), zebra striping (`zebra`), per-row tint.\n * - a responsive label:value **card-stack** below `stackBreakpoint` via\n * `useWindowDimensions` (the CSS `data-label` card-stack does not port).\n * - per-row `testID` + `accessibilityLabel`/`accessibilityHint` (kit standard).\n * - optional CONTROLLED expandable rows: `renderRowDetail` + `expandedRowKeys`\n * render a full-width detail panel between an expanded row and the next\n * (desktop and card-stack alike). Omit both and the table renders exactly as\n * it did before the feature existed.\n * - every colour from `useUi().theme`; every component-authored string via `t`.\n */\nimport React, { useCallback } from 'react';\nimport { Pressable, Text, View, useWindowDimensions } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { CARD_STACK_BREAKPOINT, TABLE_I18N, TABLE_TEST_IDS, rowDetailTestID, rowTestID } from './constants';\nimport { STICKY_HEADER_STYLE, tableStyles as s } from './styles';\nimport type { DataTableColumn, DataTableProps } from './types';\n\nconst FIRST_ROW_INDEX = 0;\n\n/**\n * The a11y props spread onto a row. The expanded state is emitted only when the\n * table is expandable, and via BOTH spellings: `accessibilityState` (RN native)\n * and `aria-expanded` (react-native-web ≥ 0.19 no longer maps the legacy prop).\n */\ninterface RowA11y {\n accessibilityLabel: string;\n accessibilityHint: string;\n accessibilityRole: 'button' | 'text';\n accessibilityState?: { expanded: boolean };\n 'aria-expanded'?: boolean;\n}\n\n/** A single desktop cell — renders `col.render(row)` exactly ONCE (POC bug fix). */\nfunction DesktopCell<T>({ column, row, textColor, testID }: { column: DataTableColumn<T>; row: T; textColor: string; testID: string }): React.ReactElement {\n const content = column.render(row);\n return (\n <View style={{ flex: column.weight ?? 1, alignItems: column.numeric ? 'flex-end' : 'flex-start' }} testID={testID}>\n {typeof content === 'string' ? (\n <Text style={[s.cell, column.numeric ? s.numCell : null, { color: textColor }]}>{content}</Text>\n ) : (\n content\n )}\n </View>\n );\n}\n\nexport function DataTable<T>(props: DataTableProps<T>): React.ReactElement {\n const {\n columns, rows, keyExtractor, rowTint, zebra, stickyHeader, onRowPress,\n getRowAccessibilityLabel, loading, loadingLabel, emptyLabel,\n renderRowDetail, expandedRowKeys,\n stackBreakpoint = CARD_STACK_BREAKPOINT, testID = TABLE_TEST_IDS.root,\n } = props;\n\n const { theme, t } = useUi();\n const { colors } = theme;\n const { width } = useWindowDimensions();\n const stacked = width < stackBreakpoint;\n const frame = { backgroundColor: colors.surface, borderColor: colors.border };\n\n const rowBackground = useCallback(\n (row: T, index: number): string | undefined => {\n const tint = rowTint?.(row);\n if (tint) return tint;\n return zebra && index % 2 === 1 ? colors.background : undefined;\n },\n [rowTint, zebra, colors.background],\n );\n\n if (loading) {\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n <View style={s.state}>\n <Text style={[s.stateText, { color: colors.textSecondary }]}>{loadingLabel ?? t(TABLE_I18N.loading)}</Text>\n </View>\n </View>\n );\n }\n if (rows.length === 0) {\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n <View style={s.state}>\n <Text style={[s.stateText, { color: colors.textSecondary }]}>{emptyLabel ?? t(TABLE_I18N.empty)}</Text>\n </View>\n </View>\n );\n }\n\n const rowID = (key: string): string => rowTestID(testID, key);\n const isExpandable = renderRowDetail !== undefined;\n const isExpanded = (key: string): boolean => isExpandable && (expandedRowKeys?.includes(key) ?? false);\n\n const rowA11y = (row: T, key: string): RowA11y => ({\n accessibilityLabel: getRowAccessibilityLabel?.(row) ?? t(TABLE_I18N.rowLabel),\n accessibilityHint: t(TABLE_I18N.rowHint),\n accessibilityRole: onRowPress ? 'button' : 'text',\n // Only an expandable table announces expanded/collapsed — a plain table's rows\n // keep exactly the props they had before this feature existed.\n ...(isExpandable ? { accessibilityState: { expanded: isExpanded(key) }, 'aria-expanded': isExpanded(key) } : null),\n });\n\n /**\n * Pairs a rendered row with its detail panel when that row is expanded. When\n * `renderRowDetail` is omitted the row element is returned untouched (no extra\n * wrapper, no extra node) — omitting the props is a no-op on the output.\n */\n const withRowDetail = (rowNode: React.ReactElement, row: T, key: string): React.ReactElement => {\n if (!isExpandable || !isExpanded(key)) return rowNode;\n return (\n <React.Fragment key={key}>\n {rowNode}\n <View\n accessibilityLabel={t(TABLE_I18N.rowDetail)}\n accessibilityRole=\"summary\"\n style={[s.rowDetail, { borderTopColor: colors.border, backgroundColor: colors.background }]}\n testID={rowDetailTestID(testID, key)}\n >\n {renderRowDetail(row)}\n </View>\n </React.Fragment>\n );\n };\n\n // --- mobile: label:value card-stack (GRID.md) ---\n if (stacked) {\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n {rows.map((row, i) => {\n const key = keyExtractor(row);\n const bg = rowBackground(row, i);\n return withRowDetail(\n <Pressable\n key={key}\n testID={rowID(key)}\n disabled={!onRowPress}\n onPress={onRowPress ? () => onRowPress(row) : undefined}\n {...rowA11y(row, key)}\n style={[s.card, { borderTopColor: colors.border }, i === FIRST_ROW_INDEX ? { borderTopWidth: 0 } : null, bg ? { backgroundColor: bg } : null]}\n >\n {columns.map((col) => (\n <View key={col.key} style={s.cardLine}>\n <Text style={[s.cardLabel, { color: colors.textSecondary }]}>{col.header}</Text>\n <View style={s.cardValue}>{col.render(row)}</View>\n </View>\n ))}\n </Pressable>,\n row,\n key,\n );\n })}\n </View>\n );\n }\n\n // --- desktop: header + rows ---\n return (\n <View style={[s.wrap, frame]} testID={testID}>\n <View\n testID={TABLE_TEST_IDS.head}\n style={[s.headRow, { backgroundColor: colors.background }, stickyHeader ? STICKY_HEADER_STYLE : null]}\n >\n {columns.map((col) => (\n <Text\n key={col.key}\n style={[s.headCell, { color: colors.textSecondary, flex: col.weight ?? 1, textAlign: col.numeric ? 'right' : 'left' }]}\n >\n {col.header}\n </Text>\n ))}\n </View>\n {rows.map((row, i) => {\n const key = keyExtractor(row);\n const bg = rowBackground(row, i);\n return withRowDetail(\n <Pressable\n key={key}\n testID={rowID(key)}\n disabled={!onRowPress}\n onPress={onRowPress ? () => onRowPress(row) : undefined}\n {...rowA11y(row, key)}\n style={[s.row, { borderTopColor: colors.border }, bg ? { backgroundColor: bg } : null]}\n >\n {columns.map((col) => (\n <DesktopCell key={col.key} column={col} row={row} textColor={colors.text} testID={`${rowID(key)}-${col.key}`} />\n ))}\n </Pressable>,\n row,\n key,\n );\n })}\n </View>\n );\n}\n\nexport default DataTable;\n","/**\n * FilterBar — the shared filter-bar shell from GRID.md (`.ui-filters`): a themed,\n * wrapping row that holds the caller's filter fields, an optional live results\n * count (`<b>N</b> results`) and an optional actions slot (Apply / Export …).\n * Layout + theming only — the fields themselves come from the app (or @dloizides/\n * ui-forms), keeping this reusable across every grid rather than coverage-specific.\n */\nimport React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { chromeStyles as c } from './styles';\n\nexport interface FilterBarProps {\n /** The filter fields (labels + inputs), supplied by the app / ui-forms. */\n children?: React.ReactNode;\n /** Live count shown as `<b>{resultsCount}</b> {results}`. Omit to hide. */\n resultsCount?: number;\n /** Overrides the kit's translated \"results\" word (pass an app-translated string). */\n resultsLabel?: string;\n /** Right-aligned action buttons (Apply, Export CSV, …). */\n actions?: React.ReactNode;\n testID?: string;\n}\n\nexport function FilterBar({\n children,\n resultsCount,\n resultsLabel,\n actions,\n testID = TABLE_TEST_IDS.filterBar,\n}: FilterBarProps): React.ReactElement {\n const { theme, t } = useUi();\n const { colors } = theme;\n const word = resultsLabel ?? t(TABLE_I18N.results);\n\n return (\n <View style={[c.filters, { backgroundColor: colors.surface, borderColor: colors.border }]} testID={testID}>\n {children}\n <View style={c.filtersSpacer} />\n {typeof resultsCount === 'number' && (\n <Text style={[c.results, { color: colors.textSecondary }]} testID={TABLE_TEST_IDS.results}>\n <Text style={{ color: colors.text, fontWeight: '700' }}>{resultsCount.toLocaleString()}</Text>\n {` ${word}`}\n </Text>\n )}\n {!!actions && <View style={c.filtersActions}>{actions}</View>}\n </View>\n );\n}\n\nexport default FilterBar;\n","/**\n * Pager — the shared pagination control from GRID.md (`.ui-pager`): page-info on\n * the left (`from–to of N`), nav on the right (rows-per-page + Prev/Next). Sits ON\n * TOP of the grid (in the section header row), so every paged grid looks the same.\n * RN idiom: rows-per-page is a row of pressable pills (RN has no native `<select>`);\n * everything is themed from `useUi().theme` and labelled via the UiProvider `t`.\n */\nimport React from 'react';\nimport { Pressable, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { DEFAULT_PAGE_SIZE_OPTIONS, TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { chromeStyles as c } from './styles';\n\nconst FIRST_PAGE = 1;\nconst EN_DASH = '–';\n\nexport interface PagerProps {\n /** 1-based current page. */\n page: number;\n /** Rows per page. */\n pageSize: number;\n /** Total row count across all pages. */\n total: number;\n onPageChange: (page: number) => void;\n onPageSizeChange: (pageSize: number) => void;\n /** Rows-per-page choices. Default 25 / 50 / 100 / 200. */\n pageSizeOptions?: readonly number[];\n /**\n * Optional, already-translated unit noun appended to the count line, e.g.\n * `\"leadership terms\"` renders `1–50 of 3,023 leadership terms`. When omitted the\n * count line stays the generic `from–to of N` (byte-identical to prior behaviour).\n */\n unitLabel?: string;\n testID?: string;\n}\n\ninterface NavButtonProps {\n label: string;\n hint: string;\n disabled: boolean;\n onPress: () => void;\n color: string;\n border: string;\n testID: string;\n}\n\nfunction NavButton({ label, hint, disabled, onPress, color, border, testID }: NavButtonProps): React.ReactElement {\n const DISABLED_OPACITY = 0.4;\n return (\n <Pressable\n testID={testID}\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityHint={hint}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n style={[c.control, { borderColor: border, opacity: disabled ? DISABLED_OPACITY : 1 }]}\n >\n <Text style={[c.controlText, { color }]}>{label}</Text>\n </Pressable>\n );\n}\n\nexport function Pager({\n page,\n pageSize,\n total,\n onPageChange,\n onPageSizeChange,\n pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS,\n unitLabel,\n testID = TABLE_TEST_IDS.pager,\n}: PagerProps): React.ReactElement {\n const { theme, t } = useUi();\n const { colors, palette } = theme;\n const brand = palette.primary['500'];\n\n const lastPage = Math.max(FIRST_PAGE, Math.ceil(total / pageSize));\n const safePage = Math.min(Math.max(page, FIRST_PAGE), lastPage);\n const from = total === 0 ? 0 : (safePage - 1) * pageSize + 1;\n const to = Math.min(safePage * pageSize, total);\n const count = `${from.toLocaleString()}${EN_DASH}${to.toLocaleString()} ${t(TABLE_I18N.pagerInfo)} ${total.toLocaleString()}`;\n const hasUnit = unitLabel !== undefined && unitLabel !== '';\n const info = hasUnit ? `${count} ${unitLabel}` : count;\n\n return (\n <View style={c.pager} testID={testID}>\n <Text style={[c.pagerInfo, { color: colors.textSecondary }]} testID={TABLE_TEST_IDS.pagerInfo}>{info}</Text>\n <View style={c.pagerNav}>\n <Text style={[c.pagerRowsLabel, { color: colors.textSecondary }]}>{t(TABLE_I18N.pagerRows)}</Text>\n <View style={c.sizeGroup}>\n {pageSizeOptions.map((size) => {\n const active = size === pageSize;\n return (\n <Pressable\n key={size}\n testID={`${testID}-size-${size}`}\n accessibilityRole=\"button\"\n accessibilityLabel={String(size)}\n accessibilityHint={t(TABLE_I18N.pagerRowsOptionHint)}\n accessibilityState={{ selected: active }}\n onPress={() => onPageSizeChange(size)}\n style={[c.sizePill, { borderColor: active ? brand : colors.border, backgroundColor: active ? brand : 'transparent' }]}\n >\n <Text style={[c.sizePillText, { color: active ? colors.surface : colors.textSecondary }]}>{size}</Text>\n </Pressable>\n );\n })}\n </View>\n <NavButton\n label={t(TABLE_I18N.pagerPrev)}\n hint={t(TABLE_I18N.pagerPrevHint)}\n disabled={safePage <= FIRST_PAGE}\n onPress={() => onPageChange(safePage - 1)}\n color={colors.text}\n border={colors.border}\n testID={TABLE_TEST_IDS.pagerPrev}\n />\n <NavButton\n label={t(TABLE_I18N.pagerNext)}\n hint={t(TABLE_I18N.pagerNextHint)}\n disabled={safePage >= lastPage}\n onPress={() => onPageChange(safePage + 1)}\n color={colors.text}\n border={colors.border}\n testID={TABLE_TEST_IDS.pagerNext}\n />\n </View>\n </View>\n );\n}\n\nexport default Pager;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dloizides/ui-tables",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Themable, brand-agnostic React Native (RN-web) table/stat components for the dloizides.com portfolio. Starts with StatCard; DataTable/StatGrid join when a 2nd consumer appears. Shares the @dloizides/ui-feedback UI context.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|