@dloizides/ui-tables 1.25.0 → 1.26.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/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/DataTable/constants.ts","../src/StatCard/StatCard.tsx","../src/minTarget.ts","../src/DataTable/styles.ts","../src/DataTable/cells.tsx","../src/DataTable/RowCells.tsx","../src/DataTable/rowPressContext.ts","../src/DataTable/SelectionCheckbox.tsx","../src/DataTable/TableRow.tsx","../src/DataTable/DataTableRow.tsx","../src/DataTable/SelectAllBanner.tsx","../src/DataTable/TableHeader.tsx","../src/DataTable/rowNav.ts","../src/DataTable/useRovingFocus.ts","../src/DataTable/selection.ts","../src/DataTable/useTableSelection.ts","../src/DataTable/DataTable.tsx","../src/DataTable/FilterBar.tsx","../src/accessibleName.ts","../src/DataTable/SizeDropdown.tsx","../src/DataTable/PagerNav.tsx","../src/DataTable/Pager.tsx","../src/Filters/styles.ts","../src/Filters/components/ActionButton.tsx","../src/Filters/constants.ts","../src/Filters/fields/BooleanField.tsx","../src/Filters/fields/DateRangeField.tsx","../src/Filters/fields/SelectField.tsx","../src/Filters/fields/TextField.tsx","../src/Filters/fields/TypeaheadField.tsx","../src/Filters/utils/clampedMinWidth.ts","../src/Filters/fields/FilterFieldView.tsx","../src/Filters/Filters.tsx","../src/Filters/hooks/useFilterDraft.ts","../src/Pagination/usePagedRows.ts","../src/StatusLedger/StatusTone.ts","../src/StatusLedger/constants.ts","../src/StatusLedger/components/StatusPill.tsx","../src/StatusLedger/SortDirection.ts","../src/StatusLedger/utils/ledgerLogic.ts","../src/StatusLedger/hooks/useLedgerView.tsx","../src/StatusLedger/LedgerLayout.ts","../src/StatusLedger/StatusLedger.tsx","../src/StatusLedger/utils/relativeTime.ts","../src/StatusLedger/components/RelativeTime.tsx","../src/MonthStatusGrid/MonthGridColumns.ts","../src/MonthStatusGrid/monthGridLayout.ts","../src/MonthStatusGrid/MonthStatusGrid.tsx"],"names":["StyleSheet","jsx","Text","View","rowTestID","jsxs","Pressable","useUi","Fragment","TAB_INDEX_INACTIVE","Platform","useCallback","useState","useMemo","React","IS_WEB","MENU_TOP_GAP","useRef","TRANSPARENT","FIRST_PAGE","useWindowDimensions","DISABLED_OPACITY","FULL_OPACITY","useEffect","StatusTone","PILL_RADIUS","styles","SortDirection","LedgerLayout","MonthGridColumns"],"mappings":";;;;;;;;;;;;;AAgBO,IAAM,qBAAA,GAAwB;AAG9B,IAAM,yBAAA,GAA+C,CAAC,EAAA,EAAI,EAAA,EAAI,KAAK,GAAG;AAYtE,IAAM,wBAAA,GAA2B,EAAA;AACjC,IAAM,4BAAA,GAA+B,EAAA;AAOrC,IAAM,qBAAqB,CAAC,KAAA,KACjC,KAAK,GAAA,CAAI,KAAA,EAAO,wBAAwB,CAAA,GAAI,4BAAA;AAGvC,IAAM,cAAA,GAAiB;AAAA,EAC5B,IAAA,EAAM,eAAA;AAAA,EACN,IAAA,EAAM,oBAAA;AAAA;AAAA,EAEN,QAAA,EAAU,KAAA;AAAA;AAAA,EAEV,cAAA,EAAgB,YAAA;AAAA;AAAA,EAEhB,cAAA,EAAgB,QAAA;AAAA;AAAA,EAEhB,YAAA,EAAc,MAAA;AAAA;AAAA,EAEd,eAAA,EAAiB,YAAA;AAAA;AAAA,EAEjB,kBAAA,EAAoB,eAAA;AAAA;AAAA,EAEpB,wBAAA,EAA0B,sBAAA;AAAA,EAC1B,SAAA,EAAW,YAAA;AAAA,EACX,OAAA,EAAS,YAAA;AAAA,EACT,KAAA,EAAO,UAAA;AAAA,EACP,SAAA,EAAW,eAAA;AAAA,EACX,UAAA,EAAY,gBAAA;AAAA,EACZ,SAAA,EAAW,eAA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AAA,OAAA;AAAA,MAFlC,IAAA,CAAK;AAAA,KAIb,CAAA;AAAA,IACA,MAAM,IAAA,CAAK,EAAE,QAAQ,MAAA,GAAS,GAAA,CAAI,QAAO,EAAG,CAAC,GAAG,KAAA,qBAC/CA,IAACE,IAAAA,EAAA,EAAiB,OAAOuB,OAAAA,CAAO,MAAA,EAAA,EAArB,KAA6B,CACzC;AAAA,GAAA,EAAA,EAbQ,GAAA,CAAI,CAAC,CAAA,EAAG,EAcnB,CACD,CAAA,EACH,CAAA;AAEJ","file":"index.mjs","sourcesContent":["/**\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/**\n * Default breakpoint (px): below this a row collapses to a label:value card.\n *\n * Aligned with `@dloizides/ui-layout`'s `MENU_BREAKPOINT` (768) — the kit's single\n * \"this is a phone / narrow tablet\" threshold, already the collapse point for the nav\n * menu (`ModalDropdown`) and the tabs bar (`TABS_COLLAPSE_BREAKPOINT`). Kept as a plain\n * literal rather than an import so a table has no runtime dependency on the layout kit\n * for one number; the value is what is shared, and it is documented here as such. A table\n * that never wants the card-stack still opts out with `stackBreakpoint={0}`.\n */\nexport const CARD_STACK_BREAKPOINT = 768;\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/**\n * Row-entrance stagger (the Ant-design-like list fade-in via `@dloizides/ui-motion`'s\n * `<FadeIn>`): only the first `ROW_ENTRANCE_STAGGER_CAP` rows fade in one-after-another,\n * each `ROW_ENTRANCE_STAGGER_STEP_MS` behind the last. Every row past the cap shares the\n * capped delay so the entrance settles in a fixed ~`cap * step` ms no matter the page size.\n *\n * The cap is the whole point: without it a 200-row page schedules 200 escalating delays\n * (and a 5,000-row list would take minutes to finish appearing while pinning the main\n * thread) — exactly the jank this animation is supposed to add polish over, not create.\n */\nexport const ROW_ENTRANCE_STAGGER_CAP = 10;\nexport const ROW_ENTRANCE_STAGGER_STEP_MS = 30;\n\n/**\n * The entrance delay (ms) for the row at `index`, capped at `ROW_ENTRANCE_STAGGER_CAP`\n * rows: rows 0..cap stagger; every row beyond the cap gets the same (capped) delay, so a\n * long page never animates row-by-row. Pure + exported for direct unit testing.\n */\nexport const rowEntranceDelayMs = (index: number): number =>\n Math.min(index, ROW_ENTRANCE_STAGGER_CAP) * ROW_ENTRANCE_STAGGER_STEP_MS;\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 /** Infix of a row's select checkbox: `${tableTestID}-select-${key}`. */\n rowSelectInfix: 'select',\n /** Infix of a row's entrance-fade wrapper: `${tableTestID}-fade-${key}`. */\n rowFadeInfix: 'fade',\n /** Suffix of the header (select-all-on-page) checkbox: `${tableTestID}-select-all`. */\n selectAllSuffix: 'select-all',\n /** Suffix of the select-all-matching banner: `${tableTestID}-select-banner`. */\n selectBannerSuffix: 'select-banner',\n /** Suffix of the banner's action: `${tableTestID}-select-banner-action`. */\n selectBannerActionSuffix: 'select-banner-action',\n filterBar: 'ui-filters',\n results: 'ui-results',\n pager: 'ui-pager',\n pagerInfo: 'ui-pager-info',\n pagerFirst: 'ui-pager-first',\n pagerPrev: 'ui-pager-prev',\n pagerNext: 'ui-pager-next',\n pagerLast: 'ui-pager-last',\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 * The test id of a row's select checkbox: `${tableTestID}-select-${key}` (key from\n * `keyExtractor`). Exported so consumers and e2e specs target a row's checkbox without\n * re-deriving the shape.\n */\nexport const rowSelectTestID = (tableTestID: string, key: string): string =>\n `${tableTestID}-${TABLE_TEST_IDS.rowSelectInfix}-${key}`;\n\n/** The test id of the header (select-all-on-page) checkbox: `${tableTestID}-select-all`. */\nexport const selectAllTestID = (tableTestID: string): string =>\n `${tableTestID}-${TABLE_TEST_IDS.selectAllSuffix}`;\n\n/**\n * The test id of a row's entrance-fade wrapper: `${tableTestID}-fade-${key}` (key from\n * `keyExtractor`). Only present while `animateRows` is on and reduced-motion is off.\n * Exported so consumers/e2e can target (or assert the absence of) the animation wrapper.\n */\nexport const rowFadeTestID = (tableTestID: string, key: string): string =>\n `${tableTestID}-${TABLE_TEST_IDS.rowFadeInfix}-${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 /** Accessible name of a row's select checkbox. */\n selectRow: 'uiTables.select.row',\n selectRowHint: 'uiTables.select.rowHint',\n /** Accessible name of the header (select-all-on-page) checkbox. */\n selectAll: 'uiTables.select.all',\n selectAllHint: 'uiTables.select.allHint',\n /** Banner, offer state: \"All {{p1}} rows on this page are selected.\" */\n selectPageSelected: 'uiTables.select.pageSelected',\n /** Banner, offer action: \"Select all {{p1}} matching this filter\". */\n selectAllMatching: 'uiTables.select.allMatching',\n selectAllMatchingHint: 'uiTables.select.allMatchingHint',\n /** Banner, active state: \"All {{p1}} rows matching this filter are selected.\" */\n selectMatchingSelected: 'uiTables.select.matchingSelected',\n /** Banner, active action: \"Clear selection\". */\n selectClear: 'uiTables.select.clear',\n selectClearHint: 'uiTables.select.clearHint',\n results: 'uiTables.results',\n pagerInfo: 'uiTables.pager.info',\n pagerFirst: 'uiTables.pager.first',\n pagerPrev: 'uiTables.pager.prev',\n pagerNext: 'uiTables.pager.next',\n pagerLast: 'uiTables.pager.last',\n pagerFirstHint: 'uiTables.pager.firstHint',\n pagerPrevHint: 'uiTables.pager.prevHint',\n pagerNextHint: 'uiTables.pager.nextHint',\n pagerLastHint: 'uiTables.pager.lastHint',\n pagerRows: 'uiTables.pager.rows',\n pagerRowsOptionHint: 'uiTables.pager.rowsOptionHint',\n /** Accessible hint for the dropdown-variant rows-per-page trigger button. */\n pagerRowsTriggerHint: 'uiTables.pager.rowsTriggerHint',\n /**\n * Accessible NAME of the rows-per-page control, e.g. \"Rows per page, currently {{p1}}\".\n * Without it the control is announced as the bare number (\"50\"), which says nothing about\n * what it does. Untranslated it degrades to that bare number — never to the raw key.\n */\n pagerRowsTriggerLabel: 'uiTables.pager.rowsTriggerLabel',\n /**\n * Accessible NAME of ONE rows-per-page choice, e.g. \"Show {{p1}} rows per page\". Used by\n * BOTH the `dropdown` options and the default `pills`. Untranslated it degrades to the\n * bare number — never to the raw key.\n */\n pagerRowsOptionLabel: 'uiTables.pager.rowsOptionLabel',\n /**\n * StatCard's accessible name, e.g. \"{{p1}}: {{p2}}\". Note the `analytics.` prefix: these\n * two keys predate this map and were only ever inlined in StatCard.tsx, so apps deriving\n * their required-key list from TABLE_I18N could not see them. Registered here UNCHANGED\n * (renaming them would break every app that already defines them).\n */\n statCardLabel: 'analytics.statCardLabel',\n statHint: 'analytics.statHint',\n} as const;\n","/**\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\nimport { TABLE_I18N } from '../DataTable/constants';\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(TABLE_I18N.statHint, label)}\n accessibilityLabel={t(TABLE_I18N.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 * The smallest hit box any pressable in this package may render: 44x44 CSS px\n * (BaseClient/docs/code-standards/mobile-first.md, WCAG 2.5.5).\n *\n * The RENDERED box is the target. `hitSlop` is inert on react-native-web's `Pressable`, so it\n * cannot stand in for this — measured on ui.dloizides.com/tables, the switches rendered 40x20\n * and the pager buttons 31px tall with hitSlop set. Mirrors `@dloizides/ui-layout`'s\n * `MIN_TARGET_PX`; ui-tables does not depend on ui-layout, so the value is restated here.\n */\nexport const MIN_TARGET_PX = 44;\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 { Z_INDEX } from '@dloizides/design-tokens';\nimport { Platform, StyleSheet, type ViewStyle } from 'react-native';\n\nimport { MIN_TARGET_PX } from '../minTarget';\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 = 5;\n/** Gap between a card line's label and the value stacked beneath it. */\nconst CARD_LABEL_GAP = 3;\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 CHEVRON_FONT = 10;\nconst MENU_TOP_GAP = 4;\nconst MENU_PAD_V = 4;\nconst MENU_MIN_WIDTH = 80;\nconst MENU_OPT_PAD_V = 7;\n/** Body-portalled on web, so it must clear an open RN-web Modal (9999): the shared popover layer. */\nconst MENU_Z_INDEX = Z_INDEX.popover;\nconst MENU_ELEVATION = 8;\n/** Soft drop shadow so the rows-per-page popover reads as floating above the page (mirrors ui-layout's InlineMenu). */\nconst MENU_BOX_SHADOW = '0px 2px 8px rgba(0, 0, 0, 0.15)';\nconst RESULTS_FONT = 13;\nconst HEAD_LETTER_SPACING = 0.4;\nconst LABEL_LETTER_SPACING = 0.3;\nconst STICKY_Z = Z_INDEX.sticky;\nconst FULL_WIDTH = '100%' as const;\n/** The checkbox column's width — a fixed gutter, so header and rows line up exactly. */\nconst SELECT_COL_WIDTH = MIN_TARGET_PX;\nconst CHECKBOX_SIZE = 18;\nconst CHECKBOX_RADIUS = 4;\nconst CHECKBOX_GLYPH_FONT = 11;\nconst CHECKBOX_GLYPH_LINE = 13;\nconst BANNER_PAD_V = 8;\nconst BANNER_FONT = 13;\nconst BANNER_GAP = 6;\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 *\n * This is a KNOWN, deliberate web-only escape hatch — but it must never reach a\n * native renderer: RN's style parser maps `position` onto a Yoga enum and an\n * unrecognised value is a hard error on the native side (it is NOT silently\n * ignored the way an unknown web CSS value is). So we emit it on web ONLY and\n * degrade to a normal, non-sticky header on iOS/Android.\n */\nconst STICKY_WEB_STYLE = {\n position: 'sticky',\n top: 0,\n zIndex: STICKY_Z,\n} as unknown as ViewStyle;\n\n/**\n * The sticky-header style for a platform: the web-only `position: 'sticky'`\n * block on web, `null` (no sticky, no invalid enum) everywhere else.\n * `platformOs` is injectable purely so both branches are unit-testable — the\n * Jest suite runs on react-native-web, where `Platform.OS` is always `'web'`.\n */\nexport function resolveStickyHeaderStyle(platformOs: string): ViewStyle | null {\n return platformOs === 'web' ? STICKY_WEB_STYLE : null;\n}\n\nexport const STICKY_HEADER_STYLE: ViewStyle | null = resolveStickyHeaderStyle(Platform.OS);\n\n/** Alpha suffix (~12%) for the soft brand row-hover tint, mirroring the v1 `--brand-soft` fill. */\nconst HOVER_TINT_ALPHA = '1f';\nconst HEX_RGB = /^#[0-9a-f]{6}$/i;\n\n/**\n * The soft brand tint used for the web row-hover highlight on clickable rows — the\n * theme's `palette.primary['500']` at low alpha, so it re-themes per tenant (v1's\n * `.ui-table--zebra tbody tr.clickable:hover` used `--brand-soft`). Returns `undefined`\n * when `primary` is not a plain `#rrggbb` so the caller can fall back to a surface tint.\n */\nexport function softBrandTint(primary: string): string | undefined {\n return HEX_RGB.test(primary) ? `${primary}${HOVER_TINT_ALPHA}` : undefined;\n}\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 /**\n * A card line is a VERTICAL label:value pair — the header sits ABOVE its value, both\n * left-aligned, so a narrow phone column never cramps the value against the label the\n * way the old `space-between` row did (an Actions cell of buttons or a long text value\n * now gets the full card width). `paddingVertical` gives the stacked lines their rhythm.\n */\n cardLine: { flexDirection: 'column', alignItems: 'stretch', paddingVertical: CARD_LINE_PAD_V, gap: CARD_LABEL_GAP },\n cardLabel: { fontSize: HEAD_FONT, fontWeight: '600', textTransform: 'uppercase', letterSpacing: LABEL_LETTER_SPACING },\n cardValue: { alignItems: 'flex-start' },\n /**\n * A zero-footprint carrier for the `ui-data-table-head` test id in the card-stack layout\n * (which has no visible header row). `display: 'none'` keeps it out of layout AND the\n * accessibility tree, while the `data-testid` stays queryable — so an E2E selector that\n * targets the head survives at every viewport width.\n */\n headSentinel: { display: 'none' },\n});\n\n/**\n * Bulk-select slots. Separate from `tableStyles` so a consumer that never selects anything\n * pays for none of it, and so the checkbox gutter's width lives in exactly one place —\n * header and body read the SAME `selectCell`, which is what keeps the columns aligned.\n */\nexport const selectionStyles = StyleSheet.create({\n /** The fixed-width gutter holding the checkbox, in both the header and every row. */\n selectCell: { width: SELECT_COL_WIDTH, alignItems: 'flex-start', justifyContent: 'center' },\n /** The checkbox's pressable area — a full 44x44 box around the 18px visual square. */\n checkboxHit: { minWidth: MIN_TARGET_PX, minHeight: MIN_TARGET_PX, alignItems: 'center', justifyContent: 'center' },\n checkbox: {\n width: CHECKBOX_SIZE,\n height: CHECKBOX_SIZE,\n borderRadius: CHECKBOX_RADIUS,\n borderWidth: BORDER_WIDTH,\n alignItems: 'center',\n justifyContent: 'center',\n },\n checkboxGlyph: { fontSize: CHECKBOX_GLYPH_FONT, lineHeight: CHECKBOX_GLYPH_LINE, fontWeight: '700' },\n /**\n * The cells of a SELECTABLE row, wrapped so the checkbox can sit OUTSIDE the pressable\n * area. `flex: 1` so the cells still claim the row minus the checkbox gutter.\n */\n rowContent: { flex: 1, flexDirection: 'row', columnGap: COLUMN_GAP, alignItems: 'center' },\n /** The same, for the card-stack: a card's lines are a column, not a row. */\n cardContent: { flex: 1 },\n /** The select-all-matching banner, spanning the table above the header. */\n banner: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: 'center',\n gap: BANNER_GAP,\n paddingHorizontal: ROW_PAD_H,\n paddingVertical: BANNER_PAD_V,\n },\n bannerText: { fontSize: BANNER_FONT },\n bannerHit: { minHeight: MIN_TARGET_PX, justifyContent: 'center' },\n bannerAction: { fontSize: BANNER_FONT, fontWeight: '700', textDecorationLine: 'underline' },\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 /**\n * The actions cluster WRAPS and is capped at the bar's width (TABLES-MOBILE-1 \"Filter bar and\n * pager overflow at 360\"). A nowrap row is one unbreakable flex item: at 360 on aml-v2 Leaders\n * it measured 431px inside a 255px bar and pushed Apply off-screen. `maxWidth: 100%` +\n * `flexShrink` fit the cluster to its line; its own `flexWrap` then breaks the buttons onto\n * further lines instead of overflowing (flex-shrink alone cannot: it never wraps a line).\n */\n filtersActions: { flexDirection: 'row', flexWrap: 'wrap', flexShrink: 1, maxWidth: '100%', rowGap: PAGER_GAP, columnGap: PAGER_SIZE_GAP, alignItems: 'center' },\n /**\n * The pager and its nav may SHRINK to their container (TABLES-MOBILE-1). Placed beside a title\n * in a wrapping row (aml-v2 /app/cases), a `flex-shrink: 0` pager measured 328px in a 255px slot\n * and Next was clipped. `minWidth: 0` + `maxWidth: 100%` let the line fit, then `flexWrap`\n * breaks the info / nav / buttons onto further lines instead of overflowing.\n */\n pager: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'space-between', gap: PAGER_GAP, flexShrink: 1, minWidth: 0, maxWidth: '100%' },\n pagerInfo: { fontSize: CONTROL_FONT, fontVariant: ['tabular-nums'] },\n pagerNav: { flexDirection: 'row', alignItems: 'center', gap: PAGER_SIZE_GAP, flexWrap: 'wrap', flexShrink: 1, minWidth: 0, maxWidth: '100%' },\n pagerRowsLabel: { fontSize: HEAD_FONT, textTransform: 'uppercase', letterSpacing: LABEL_LETTER_SPACING },\n /** Mixed-case \"Rows\" caption for the dropdown variant (v1's muted `.hint` label — no uppercase transform). */\n pagerRowsLabelPlain: { fontSize: HEAD_FONT, letterSpacing: LABEL_LETTER_SPACING },\n sizeGroup: { flexDirection: 'row', gap: PAGER_SIZE_GAP, alignItems: 'center' },\n control: { minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, alignItems: 'center', justifyContent: 'center', paddingHorizontal: CONTROL_PAD_H, paddingVertical: CONTROL_PAD_V, borderRadius: BORDER_RADIUS, borderWidth: BORDER_WIDTH },\n controlText: { fontSize: CONTROL_FONT, fontWeight: '600' },\n sizePill: { minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, alignItems: 'center', justifyContent: 'center', 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 /** Dropdown variant: relatively-positioned wrapper holding the trigger + the anchored popover. */\n sizeAnchor: { position: 'relative' },\n /** Dropdown variant: the compact `<select>`-like trigger (bordered ghost look, height-matched to Prev/Next) + chevron. */\n sizeTrigger: { minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: PAGER_SIZE_GAP, paddingHorizontal: CONTROL_PAD_H, paddingVertical: CONTROL_PAD_V, borderRadius: BORDER_RADIUS, borderWidth: BORDER_WIDTH },\n sizeTriggerText: { fontSize: CONTROL_FONT, fontWeight: '600', fontVariant: ['tabular-nums'] },\n sizeChevron: { fontSize: CHEVRON_FONT },\n /** Dropdown variant: the anchored popover listing the rows-per-page options. */\n sizeMenu: { position: 'absolute', top: '100%', right: 0, marginTop: MENU_TOP_GAP, minWidth: MENU_MIN_WIDTH, borderWidth: BORDER_WIDTH, borderRadius: BORDER_RADIUS, paddingVertical: MENU_PAD_V, zIndex: MENU_Z_INDEX, boxShadow: MENU_BOX_SHADOW, elevation: MENU_ELEVATION },\n sizeOption: { minHeight: MIN_TARGET_PX, justifyContent: 'center', paddingHorizontal: CONTROL_PAD_H, paddingVertical: MENU_OPT_PAD_V },\n sizeOptionText: { fontSize: CONTROL_FONT, fontVariant: ['tabular-nums'] },\n});\n","/**\n * The DataTable's cell renderers, shared by BOTH branches (desktop grid + card-stack).\n *\n * Every style array here ends with the consumer's `styleOverrides` slot so an override\n * beats the base StyleSheet AND the inline theme colour (colours are never in the\n * StyleSheet in this kit — they are applied inline at render time).\n */\nimport React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { tableStyles as s } from './styles';\nimport type { DataTableColumn, DataTableStyleOverrides } from './types';\n\n/** The subset of the override slots a cell can consume. */\nexport type CellStyleOverrides = Pick<DataTableStyleOverrides, 'cell' | 'numCell' | 'cellWrap'>;\n\n/**\n * A column's rendered content, safe to place inside a `<View>`.\n *\n * A bare string/number child of a `<View>` warns on RN-web (\"Unexpected text node\")\n * and THROWS on real React Native — and these apps ship as native, so raw text must\n * always be wrapped in `<Text>`. Used by BOTH the desktop cell and the card-stack\n * value (the stacked branch previously rendered `col.render(row)` unwrapped).\n */\nexport function cellContent<T>(\n column: DataTableColumn<T>,\n row: T,\n textColor: string,\n overrides?: CellStyleOverrides,\n): React.ReactNode {\n const content = column.render(row);\n if (typeof content === 'string' || typeof content === 'number') {\n return (\n <Text\n style={[\n s.cell,\n column.numeric ? s.numCell : null,\n { color: textColor },\n overrides?.cell,\n column.numeric ? overrides?.numCell : null,\n ]}\n >\n {content}\n </Text>\n );\n }\n return content;\n}\n\ninterface DesktopCellProps<T> {\n column: DataTableColumn<T>;\n row: T;\n textColor: string;\n testID: string;\n styleOverrides?: CellStyleOverrides;\n /**\n * Give the cell its ARIA `cell` role. Set only when the table opted into keyboard\n * navigation, where it really is a grid: a `role=\"row\"` with structureless children is a\n * broken grid, and promising a structure you do not deliver is worse for a screen-reader\n * user than claiming none. A plain table keeps the roles it has always had.\n *\n * `cell` rather than `gridcell` on purpose. `gridcell` advertises a cell that\n * participates in grid navigation, and these do not: focus roves at the ROW level (see\n * `useRovingFocus`), so a gridcell would promise a tab stop that does not exist. ARIA 1.2\n * lists `cell` among `row`'s required owned elements, so this is a valid grid — and it is\n * also the only one of the two that React Native types (`Role` has `cell`, not\n * `gridcell`), which keeps this off the web-only escape hatch entirely.\n */\n inGrid?: boolean;\n}\n\n/**\n * A single desktop cell — renders `col.render(row)` exactly ONCE (POC bug fix).\n *\n * The cell's wrapping `View` is overridable via the `cellWrap` slot. That matters:\n * `cell` is a TextStyle and so only reaches cells whose `render` returns a string —\n * `cellWrap` reaches EVERY cell, including ones rendering a custom node (a badge, a\n * link, an action menu), which is what a consumer needs for true pixel-parity.\n */\nexport function DesktopCell<T>({ column, row, textColor, testID, styleOverrides, inGrid }: DesktopCellProps<T>): React.ReactElement {\n return (\n <View\n style={[\n { flex: column.weight ?? 1, minWidth: column.minWidth, alignItems: column.numeric ? 'flex-end' : 'flex-start' },\n styleOverrides?.cellWrap,\n ]}\n testID={testID}\n {...(inGrid === true ? { role: 'cell' as const } : null)}\n >\n {cellContent(column, row, textColor, styleOverrides)}\n </View>\n );\n}\n","/**\n * A row's contents, in whichever layout the table is in: the desktop cells, or the\n * label:value lines of the responsive card-stack.\n *\n * Split out of `DataTable` purely to keep that component within the size budget; the\n * markup and the style slots are unchanged from when both branches were inlined.\n */\nimport React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { DesktopCell, cellContent } from './cells';\nimport { tableStyles as s } from './styles';\nimport type { DataTableColumn, DataTableStyleOverrides } from './types';\n\ninterface RowCellsProps<T> {\n columns: ReadonlyArray<DataTableColumn<T>>;\n row: T;\n /** Card-stack (label:value lines) rather than the desktop grid. */\n stacked: boolean;\n /** The table opted into keyboard navigation ⇒ cells take their ARIA `cell` role. */\n inGrid: boolean;\n /** The row's test id — each cell derives `${rowTestID}-${column.key}` from it. */\n rowTestID: string;\n textColor: string;\n labelColor: string;\n styleOverrides?: DataTableStyleOverrides;\n}\n\nexport function RowCells<T>({\n columns,\n row,\n stacked,\n inGrid,\n rowTestID,\n textColor,\n labelColor,\n styleOverrides: o,\n}: RowCellsProps<T>): React.ReactElement {\n if (stacked) {\n return (\n <>\n {columns.map((col) => (\n // The SAME per-cell test id the desktop cell carries (`${rowTestID}-${col.key}`),\n // so an E2E selector like `${rowTestID}-${col.key}` resolves in BOTH layouts — the\n // card-stack must not silently drop the hooks a wide-viewport test relies on.\n <View key={col.key} style={[s.cardLine, o?.cardLine]} testID={`${rowTestID}-${col.key}`}>\n <Text style={[s.cardLabel, { color: labelColor }, o?.cardLabel]}>{col.header}</Text>\n <View style={[s.cardValue, o?.cardValue]}>{cellContent(col, row, textColor, o)}</View>\n </View>\n ))}\n </>\n );\n }\n\n return (\n <>\n {columns.map((col) => (\n <DesktopCell\n key={col.key}\n column={col}\n inGrid={inGrid}\n row={row}\n styleOverrides={o}\n testID={`${rowTestID}-${col.key}`}\n textColor={textColor}\n />\n ))}\n </>\n );\n}\n","import { createContext, useContext } from 'react';\n\nconst RowPressContext = createContext<(() => void) | undefined>(undefined);\n\nexport const RowPressProvider = RowPressContext.Provider;\n\n/** The enclosing interactive row's press handler, so a pressable cell can also open its row. */\nexport const useRowPress = (): (() => void) | undefined => useContext(RowPressContext);\n","/**\n * The DataTable's select checkbox — used for BOTH a row and the tri-state header box.\n *\n * RN has no native checkbox, so this is a `Pressable` box drawn from the theme, exactly\n * like the Pager draws its size pills. It carries the real checkbox semantics rather than\n * miming them: `accessibilityRole=\"checkbox\"` plus the checked state in BOTH spellings —\n * `accessibilityState` (RN native) and `aria-checked` (react-native-web ≥ 0.19 stopped\n * mapping the legacy prop), which is the same two-spelling rule the row's `aria-expanded`\n * already follows.\n *\n * `'mixed'` is the indeterminate state, and it is a real ARIA value, not a visual trick: a\n * screen reader announces \"partially checked\" for a header box over a part-selected page.\n */\nimport React from 'react';\nimport { Pressable, Text, View } from 'react-native';\n\nimport { HeaderCheckboxState } from './headerCheckboxState';\nimport { selectionStyles as sel } from './styles';\n\n/** The tick glyph. A text mark keeps this native-safe — no SVG, no icon peer dependency. */\nconst CHECK_GLYPH = '✓';\n/** The indeterminate mark: a dash, the conventional \"some but not all\". */\nconst MIXED_GLYPH = '–';\nconst TRANSPARENT = 'transparent';\n\ninterface SelectionCheckboxProps {\n /** `All` = checked, `Some` = indeterminate, `None` = unchecked. */\n state: HeaderCheckboxState;\n /** Already-translated accessible name (e.g. the row's label, or \"select all on page\"). */\n label: string;\n /** Already-translated accessible hint. */\n hint: string;\n onToggle: () => void;\n brandColor: string;\n borderColor: string;\n surfaceColor: string;\n testID: string;\n}\n\n/** ARIA's tri-state: `true` | `false` | `'mixed'`. */\nfunction toCheckedValue(state: HeaderCheckboxState): boolean | 'mixed' {\n if (state === HeaderCheckboxState.All) return true;\n return state === HeaderCheckboxState.Some ? 'mixed' : false;\n}\n\nfunction toGlyph(state: HeaderCheckboxState): string | undefined {\n if (state === HeaderCheckboxState.All) return CHECK_GLYPH;\n return state === HeaderCheckboxState.Some ? MIXED_GLYPH : undefined;\n}\n\nexport function SelectionCheckbox({\n state,\n label,\n hint,\n onToggle,\n brandColor,\n borderColor,\n surfaceColor,\n testID,\n}: SelectionCheckboxProps): React.ReactElement {\n const checked = toCheckedValue(state);\n const glyph = toGlyph(state);\n const filled = state !== HeaderCheckboxState.None;\n\n return (\n <Pressable\n accessibilityHint={hint}\n accessibilityLabel={label}\n accessibilityRole=\"checkbox\"\n accessibilityState={{ checked }}\n aria-checked={checked}\n style={sel.checkboxHit}\n testID={testID}\n onPress={onToggle}\n >\n <View\n style={[\n sel.checkbox,\n { borderColor: filled ? brandColor : borderColor, backgroundColor: filled ? brandColor : TRANSPARENT },\n ]}\n >\n {glyph === undefined ? null : <Text style={[sel.checkboxGlyph, { color: surfaceColor }]}>{glyph}</Text>}\n </View>\n </Pressable>\n );\n}\n","/**\n * A DataTable row container.\n *\n * A module-level component ON PURPOSE: defining this inside `DataTable`'s render body would\n * give it a fresh identity every render and remount the whole row subtree on each hover or\n * selection change. (It replaces the `rowContainer` closure for exactly that reason — the\n * closure returned elements rather than being a component, which was correct but no longer\n * fits now that a row has three shapes.)\n *\n * ## The three shapes, and why\n *\n * 1. **Static** (no `onRowPress`) → a plain `<View>`. NOT a `Pressable`: on react-native-web\n * a `Pressable` installs pointer responders on the row container that CAPTURE a real\n * pointer gesture and cancel the press of any interactive child, so an Edit/Delete button\n * in a cell would look clickable and silently do nothing (the 1.9.2 fix).\n * 2. **Interactive** (`onRowPress`) → a `<Pressable>`. Unchanged from 1.9.2.\n * 3. **Selectable** (`selectionSlot`) → a plain `<View>` FRAME holding the checkbox and a\n * separate pressable content area.\n *\n * Shape 3 exists *because of* the 1.9.2 bug. A checkbox nested inside an interactive row's\n * `Pressable` is precisely the shape that fix identified as broken: the row would capture\n * the gesture and the checkbox would do nothing on a real click while passing a synthetic\n * `element.click()` test. So on a selectable row the checkbox is a SIBLING of the pressable\n * area, never a descendant of it — the gesture it receives is its own.\n */\nimport React from 'react';\nimport { Pressable, View, type StyleProp, type ViewProps, type ViewStyle } from 'react-native';\n\nimport { selectionStyles as sel } from './styles';\nimport type { RowKeyEvent } from './useRovingFocus';\n\n/** Focusable programmatically but skipped by Tab — see `keyboard` below. */\nconst TAB_INDEX_INACTIVE = -1;\n\n/**\n * The a11y props spread onto a row. The expanded state is emitted only when the table is\n * expandable, and via BOTH spellings: `accessibilityState` (RN native) and `aria-expanded`\n * (react-native-web ≥ 0.19 no longer maps the legacy prop). `aria-selected` follows the\n * same two-spelling rule and appears only when the table is selectable.\n */\nexport interface RowA11y {\n accessibilityLabel: string;\n accessibilityHint: string;\n accessibilityRole: 'button' | 'text';\n accessibilityState?: { expanded?: boolean; selected?: boolean };\n 'aria-expanded'?: boolean;\n 'aria-selected'?: boolean;\n role?: 'row';\n}\n\n/** The roving-tabindex wiring for one row. Absent when keyboard navigation is off. */\nexport interface RowKeyboard {\n /** `0` for the single tabbable row, `-1` for the rest. */\n tabIndex: 0 | -1;\n /** Web-only; `useRovingFocus` returns `undefined` off web. */\n onKeyDown?: (event: RowKeyEvent) => void;\n onFocus: () => void;\n registerNode: (node: unknown) => void;\n}\n\nexport interface TableRowProps {\n testID: string;\n /** The row frame: border, tint, padding. */\n style: StyleProp<ViewStyle>;\n children: React.ReactNode;\n a11y: RowA11y;\n /** Present ⇒ the row is interactive. */\n onPress?: () => void;\n onHoverIn?: () => void;\n onHoverOut?: () => void;\n /** The checkbox element. Present ⇒ the selectable frame shape. */\n selectionSlot?: React.ReactNode;\n /** Card-stack rows lay their content out as a column, not a row. */\n stacked?: boolean;\n keyboard?: RowKeyboard;\n}\n\n/**\n * `onKeyDown` is a **react-native-web-only** prop: RNW forwards it (its `keyboardProps`\n * list) but RN's `ViewProps` does not type it, because native has no key events. Cast at\n * this ONE boundary, through `unknown` and never `any` — the same documented escape hatch,\n * for the same reason, as `resolveStickyHeaderStyle`'s `position: 'sticky'` in `styles.ts`.\n *\n * Safe by construction on native: `useRovingFocus` hands back no handler off web, so this\n * returns an empty object and nothing web-only reaches the native renderer.\n */\nfunction webKeyProps(onKeyDown: ((event: RowKeyEvent) => void) | undefined): ViewProps {\n return (onKeyDown === undefined ? {} : { onKeyDown }) as unknown as ViewProps;\n}\n\n/** The focus/keyboard props shared by every row shape. Empty when navigation is off. */\nfunction focusProps(keyboard: RowKeyboard | undefined): ViewProps {\n if (keyboard === undefined) return {};\n return {\n tabIndex: keyboard.tabIndex,\n onFocus: keyboard.onFocus,\n ref: (node: unknown) => keyboard.registerNode(node),\n ...webKeyProps(keyboard.onKeyDown),\n } as unknown as ViewProps;\n}\n\nexport function TableRow({\n testID,\n style,\n children,\n a11y,\n onPress,\n onHoverIn,\n onHoverOut,\n selectionSlot,\n stacked,\n keyboard,\n}: TableRowProps): React.ReactElement {\n const interactive = onPress !== undefined;\n const hover = interactive ? { onHoverIn, onHoverOut } : null;\n\n // --- shapes 1 + 2: unchanged from 1.9.2 (plus the optional roving tabindex) ---\n if (selectionSlot === undefined) {\n return interactive ? (\n <Pressable style={style} testID={testID} onPress={onPress} {...hover} {...a11y} {...focusProps(keyboard)}>\n {children}\n </Pressable>\n ) : (\n <View style={style} testID={testID} {...a11y} {...focusProps(keyboard)}>\n {children}\n </View>\n );\n }\n\n // --- shape 3: the checkbox is a SIBLING of the pressable area, never inside it ---\n //\n // The FRAME owns identity + semantics (testID, label, role, aria-selected, roving\n // tabindex): it is the row, and it is the thing a keyboard operator lands on.\n //\n // The inner pressable is an anonymous gesture target for the CELLS only. Its tabIndex is\n // forced to -1 ONLY when keyboard navigation is on, because then the frame is the focus\n // stop and two tab stops per row would be one too many. With navigation OFF it keeps\n // RNW's default focusability, so a selectable-but-not-navigable table stays exactly as\n // reachable by Tab as an interactive row is today.\n const contentStyle = stacked ? sel.cardContent : sel.rowContent;\n const content = interactive ? (\n <Pressable\n style={contentStyle}\n tabIndex={keyboard === undefined ? undefined : TAB_INDEX_INACTIVE}\n onPress={onPress}\n {...hover}\n >\n {children}\n </Pressable>\n ) : (\n <View style={contentStyle}>{children}</View>\n );\n\n return (\n <View style={style} testID={testID} {...a11y} {...focusProps(keyboard)}>\n <View style={sel.selectCell}>{selectionSlot}</View>\n {content}\n </View>\n );\n}\n","/**\n * One row of the DataTable, in either layout: its a11y contract, its optional select\n * checkbox, its optional roving-tabindex wiring, its cells, and — when expanded — the\n * full-width detail panel that follows it.\n *\n * A module-level component ON PURPOSE. Defining it inside `DataTable`'s render body would\n * give it a fresh identity on every render and remount the whole row subtree on each hover\n * or selection change; that is why the previous inline `rowContainer` was a plain function\n * returning elements rather than a component. Lifted here, it gets a stable identity AND\n * `DataTable` gets to be an orchestrator instead of a pile of closures.\n *\n * The detail panel is returned as a SIBLING (via a Fragment, which adds no DOM node), so an\n * expanded row and its panel stay adjacent children of the table frame — i.e. the panel\n * still spans every column.\n */\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { TABLE_I18N, rowDetailTestID, rowSelectTestID, rowTestID } from './constants';\nimport { HeaderCheckboxState } from './headerCheckboxState';\nimport { RowCells } from './RowCells';\nimport { RowPressProvider } from './rowPressContext';\nimport { SelectionCheckbox } from './SelectionCheckbox';\nimport { tableStyles as s } from './styles';\nimport { TableRow, type RowA11y } from './TableRow';\nimport type { RovingFocus } from './useRovingFocus';\nimport type { TableSelection } from './useTableSelection';\nimport type { DataTableColumn, DataTableStyleOverrides } from './types';\n\nexport interface DataTableRowProps<T> {\n row: T;\n rowKey: string;\n /** The row frame's style, already composed by `DataTable` (zebra / tint / hover). */\n style: React.ComponentProps<typeof TableRow>['style'];\n columns: ReadonlyArray<DataTableColumn<T>>;\n /** Card-stack rather than the desktop grid. */\n stacked: boolean;\n /** The TABLE's test id; the row's and the checkbox's are derived from it. */\n tableTestID: string;\n selection: TableSelection;\n keyboardNavigation: boolean;\n roving: RovingFocus;\n onRowPress?: (row: T) => void;\n getRowAccessibilityLabel?: (row: T) => string;\n renderRowDetail?: (row: T) => React.ReactNode;\n getRowDetailAccessibilityLabel?: (row: T) => string;\n /** This row is currently expanded (computed by the parent from `expandedRowKeys`). */\n expanded: boolean;\n onHoverIn: () => void;\n onHoverOut: () => void;\n styleOverrides?: DataTableStyleOverrides;\n}\n\nexport function DataTableRow<T>({\n row,\n rowKey,\n style,\n columns,\n stacked,\n tableTestID,\n selection,\n keyboardNavigation,\n roving,\n onRowPress,\n getRowAccessibilityLabel,\n renderRowDetail,\n getRowDetailAccessibilityLabel,\n expanded,\n onHoverIn,\n onHoverOut,\n styleOverrides: o,\n}: DataTableRowProps<T>): React.ReactElement {\n const { theme, t } = useUi();\n const { colors } = theme;\n const rowID = rowTestID(tableTestID, rowKey);\n const isExpandable = renderRowDetail !== undefined;\n const { selectable } = selection;\n const isSelected = selectable && selection.isSelected(rowKey);\n const pressRow = onRowPress === undefined ? undefined : () => onRowPress(row);\n\n /**\n * Each block is additive and gated on the feature that earns it, so a table that opted\n * into nothing carries exactly the props it did before any of this existed. Both states\n * are emitted in BOTH spellings: `accessibilityState` (RN native) and the `aria-*` prop\n * (react-native-web ≥ 0.19 dropped the legacy mapping).\n */\n const a11y: RowA11y = {\n accessibilityLabel: getRowAccessibilityLabel?.(row) ?? t(TABLE_I18N.rowLabel),\n accessibilityHint: t(TABLE_I18N.rowHint),\n accessibilityRole: onRowPress ? 'button' : 'text',\n ...(isExpandable || selectable\n ? { accessibilityState: { ...(isExpandable ? { expanded } : null), ...(selectable ? { selected: isSelected } : null) } }\n : null),\n ...(isExpandable ? { 'aria-expanded': expanded } : null),\n ...(selectable ? { 'aria-selected': isSelected } : null),\n // A navigable table is a real grid, so its rows are grid rows — selectable or not.\n // `role` wins over `accessibilityRole` on RNW.\n ...(keyboardNavigation ? { role: 'row' as const } : null),\n };\n\n const rowNode = (\n <TableRow\n a11y={a11y}\n keyboard={\n keyboardNavigation\n ? {\n tabIndex: roving.tabIndexFor(rowKey),\n onKeyDown: roving.keyDownFor(rowKey),\n onFocus: () => roving.onRowFocus(rowKey),\n registerNode: (node: unknown) => roving.registerRow(rowKey, node),\n }\n : undefined\n }\n selectionSlot={\n selectable ? (\n <SelectionCheckbox\n borderColor={colors.border}\n brandColor={theme.palette.primary['500']}\n hint={t(TABLE_I18N.selectRowHint)}\n // Labelled with the ROW's name, so it announces \"Instruction ABC, checkbox\"\n // rather than an anonymous \"checkbox\" repeated down the page.\n label={getRowAccessibilityLabel?.(row) ?? t(TABLE_I18N.selectRow)}\n state={isSelected ? HeaderCheckboxState.All : HeaderCheckboxState.None}\n surfaceColor={colors.surface}\n testID={rowSelectTestID(tableTestID, rowKey)}\n onToggle={() => selection.toggleRow(rowKey)}\n />\n ) : undefined\n }\n stacked={stacked}\n style={style}\n testID={rowID}\n onHoverIn={onHoverIn}\n onHoverOut={onHoverOut}\n onPress={pressRow}\n >\n <RowPressProvider value={pressRow}>\n <RowCells\n columns={columns}\n inGrid={keyboardNavigation}\n labelColor={colors.textSecondary}\n row={row}\n rowTestID={rowID}\n stacked={stacked}\n styleOverrides={o}\n textColor={colors.text}\n />\n </RowPressProvider>\n </TableRow>\n );\n\n // Omitting `renderRowDetail` is a no-op on the output: no wrapper, no extra node.\n if (!isExpandable || !expanded) return rowNode;\n return (\n <>\n {rowNode}\n <View\n accessibilityLabel={getRowDetailAccessibilityLabel?.(row) ?? t(TABLE_I18N.rowDetail)}\n accessibilityRole=\"summary\"\n style={[s.rowDetail, { borderTopColor: colors.border, backgroundColor: colors.background }, o?.rowDetail]}\n testID={rowDetailTestID(tableTestID, rowKey)}\n >\n {renderRowDetail(row)}\n </View>\n </>\n );\n}\n","/**\n * The select-all-matching banner — **the flag, never the ids.**\n *\n * This is the only place the table admits rows exist beyond the current page, and it says\n * so in the only terms it honestly can: a COUNT the server reported, and a FLAG the\n * consumer resolves server-side against the same filter the list endpoint took.\n *\n * It deliberately does NOT enumerate the matching rows. It cannot — they are on pages that\n * were never fetched — and it must not: the ZY-02 spike measured this grid at ~2–3 ms and\n * ~16 DOM nodes per row, so \"select all 5,000\" as a DOM/id operation is indistinguishable\n * from an outage. `onAction()` carries no payload at all; the flag is the whole message.\n *\n * Reads `useUi()` directly (like `DataTable` and `Pager` do) rather than being handed a\n * dozen already-translated strings: it renders once per table, so the context read is free,\n * and it keeps the four count-dependent sentences next to the states that choose them.\n */\nimport React from 'react';\nimport { Pressable, Text, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { TABLE_I18N } from './constants';\nimport { SelectAllBannerMode } from './selectAllBannerMode';\nimport { selectionStyles as sel } from './styles';\n\ninterface SelectAllBannerProps {\n mode: SelectAllBannerMode;\n /** Rows on the current page. */\n pageCount: number;\n /** Rows matching the filter across every page (server-reported). */\n matchingCount: number;\n /** Emits the FLAG: select all matching, or clear. */\n onAction: () => void;\n testID: string;\n actionTestID: string;\n styleOverride?: StyleProp<ViewStyle>;\n}\n\nexport function SelectAllBanner({\n mode,\n pageCount,\n matchingCount,\n onAction,\n testID,\n actionTestID,\n styleOverride,\n}: SelectAllBannerProps): React.ReactElement | null {\n const { theme, t } = useUi();\n const { colors, palette } = theme;\n\n if (mode === SelectAllBannerMode.Hidden) return null;\n\n const active = mode === SelectAllBannerMode.Active;\n const message = active\n ? t(TABLE_I18N.selectMatchingSelected, matchingCount.toLocaleString())\n : t(TABLE_I18N.selectPageSelected, pageCount.toLocaleString());\n const actionLabel = active\n ? t(TABLE_I18N.selectClear)\n : t(TABLE_I18N.selectAllMatching, matchingCount.toLocaleString());\n const actionHint = active ? t(TABLE_I18N.selectClearHint) : t(TABLE_I18N.selectAllMatchingHint);\n\n return (\n <View\n // `polite`, not `assertive`: this follows the operator's own click, so it should be\n // announced after what they did rather than interrupting them mid-action.\n accessibilityLiveRegion=\"polite\"\n style={[sel.banner, { backgroundColor: colors.background }, styleOverride]}\n testID={testID}\n >\n <Text style={[sel.bannerText, { color: colors.textSecondary }]}>{message}</Text>\n <Pressable\n accessibilityHint={actionHint}\n accessibilityLabel={actionLabel}\n accessibilityRole=\"button\"\n testID={actionTestID}\n onPress={onAction}\n style={sel.bannerHit}\n >\n <Text style={[sel.bannerAction, { color: palette.primary['500'] }]}>{actionLabel}</Text>\n </Pressable>\n </View>\n );\n}\n","/**\n * The DataTable's desktop header row: the optional select-all checkbox gutter, then one\n * cell per column.\n *\n * The gutter reads the SAME `selectCell` style every row uses — that shared width is the\n * only thing keeping the header aligned with the body once a checkbox column exists, so it\n * must never be duplicated with a local copy.\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 { HeaderCheckboxState } from './headerCheckboxState';\nimport { SelectionCheckbox } from './SelectionCheckbox';\nimport { STICKY_HEADER_STYLE, selectionStyles as sel, tableStyles as s } from './styles';\nimport type { DataTableColumn, DataTableStyleOverrides } from './types';\n\n/** The select-all wiring. Absent ⇒ the table is not selectable: no gutter, no node. */\nexport interface HeaderSelection {\n state: HeaderCheckboxState;\n onToggleAll: () => void;\n /** The checkbox's test id (derived from the table's, by `selectAllTestID`). */\n testID: string;\n}\n\ninterface TableHeaderProps<T> {\n columns: ReadonlyArray<DataTableColumn<T>>;\n stickyHeader?: boolean;\n selection?: HeaderSelection;\n /** The table opted into keyboard navigation ⇒ it is a real ARIA grid. */\n inGrid: boolean;\n styleOverrides?: DataTableStyleOverrides;\n}\n\nexport function TableHeader<T>({ columns, stickyHeader, selection, inGrid, styleOverrides: o }: TableHeaderProps<T>): React.ReactElement {\n const { theme, t } = useUi();\n const { colors } = theme;\n\n return (\n <View\n style={[s.headRow, { backgroundColor: colors.background }, stickyHeader ? STICKY_HEADER_STYLE : null, o?.headRow]}\n testID={TABLE_TEST_IDS.head}\n {...(inGrid ? { role: 'row' as const } : null)}\n >\n {selection === undefined ? null : (\n <View style={[sel.selectCell, o?.selectCell]}>\n <SelectionCheckbox\n borderColor={colors.border}\n brandColor={theme.palette.primary['500']}\n hint={t(TABLE_I18N.selectAllHint)}\n label={t(TABLE_I18N.selectAll)}\n state={selection.state}\n surfaceColor={colors.surface}\n testID={selection.testID}\n onToggle={selection.onToggleAll}\n />\n </View>\n )}\n {columns.map((col) => (\n <Text\n key={col.key}\n style={[s.headCell, { color: colors.textSecondary, flex: col.weight ?? 1, minWidth: col.minWidth, textAlign: col.numeric ? 'right' : 'left' }, o?.headCell]}\n {...(inGrid ? { role: 'columnheader' as const } : null)}\n >\n {col.header}\n </Text>\n ))}\n </View>\n );\n}\n","/**\n * Keyboard navigation — the pure parts: decoding a key press into an intent, and moving an\n * index. Split from the hook so the rules are testable as LOGIC, without a DOM.\n *\n * The ARIA grid pattern (roving tabindex) is what this implements: arrows MOVE FOCUS\n * between rows, they do not scroll and they do not wrap. Wrapping from the last row to the\n * first reads as \"the page changed\" to someone who cannot see the screen, which is exactly\n * the illusion a paged table must not create.\n */\nimport { RowNavAction } from './rowNavAction';\n\n/** The first row's index. */\nconst FIRST_INDEX = 0;\n/** Offset to the adjacent row. */\nconst ONE_ROW = 1;\n/** `indexOf` miss. */\nconst NOT_FOUND = -1;\n\n/**\n * Decode a `KeyboardEvent.key` into a row-grid intent, or `undefined` for a key this table\n * has no opinion about (which the caller must then leave alone — never `preventDefault` a\n * key you are not handling, or you break Tab, typeahead and browser shortcuts).\n *\n * `'Spacebar'` is the legacy (IE/old-Edge) `key` value for the space bar; both spellings\n * are accepted so the space key behaves the same everywhere.\n */\nexport function toRowNavAction(key: string): RowNavAction | undefined {\n switch (key) {\n case 'ArrowDown':\n return RowNavAction.Next;\n case 'ArrowUp':\n return RowNavAction.Prev;\n case 'Home':\n return RowNavAction.First;\n case 'End':\n return RowNavAction.Last;\n case ' ':\n case 'Spacebar':\n return RowNavAction.Toggle;\n case 'Enter':\n return RowNavAction.Activate;\n default:\n return undefined;\n }\n}\n\n/**\n * The index a movement action lands on — CLAMPED at both ends, never wrapping.\n *\n * Returns `undefined` for the non-movement actions (Toggle/Activate) and for an empty\n * page, so the caller can tell \"no movement\" from \"move to row 0\".\n */\nexport function nextRowIndex(\n currentIndex: number,\n action: RowNavAction,\n rowCount: number,\n): number | undefined {\n if (rowCount === FIRST_INDEX) return undefined;\n const lastIndex = rowCount - ONE_ROW;\n switch (action) {\n case RowNavAction.Next:\n return Math.min(currentIndex + ONE_ROW, lastIndex);\n case RowNavAction.Prev:\n return Math.max(currentIndex - ONE_ROW, FIRST_INDEX);\n case RowNavAction.First:\n return FIRST_INDEX;\n case RowNavAction.Last:\n return lastIndex;\n default:\n return undefined;\n }\n}\n\n/**\n * 🔴 The roving-tabindex invariant: **exactly one row is tabbable at any time.**\n *\n * The subtle case is a PAGE CHANGE. `focusedKey` is remembered across renders, but paging\n * replaces every row — so the remembered key belongs to rows that no longer exist. Falling\n * back to the first row is what keeps the table reachable: without this, after paging no\n * row would match, no row would carry `tabIndex=0`, and a keyboard operator would be\n * unable to get back into the grid at all (Tab would skip straight past it). Same for the\n * very first render, where nothing has been focused yet.\n *\n * Returns `undefined` only for an empty page, where there is genuinely nothing to focus.\n */\nexport function resolveTabbableKey(\n rowKeys: readonly string[],\n focusedKey: string | undefined,\n): string | undefined {\n if (rowKeys.length === FIRST_INDEX) return undefined;\n if (focusedKey !== undefined && rowKeys.includes(focusedKey)) return focusedKey;\n return rowKeys[FIRST_INDEX];\n}\n\n/**\n * The index the roving focus is currently on. Falls back to the first row when the\n * remembered key is gone (see `resolveTabbableKey`), so a movement after a page change\n * steps from the top of the new page rather than from nowhere.\n */\nexport function focusedRowIndex(rowKeys: readonly string[], focusedKey: string | undefined): number {\n const index = focusedKey === undefined ? NOT_FOUND : rowKeys.indexOf(focusedKey);\n return index === NOT_FOUND ? FIRST_INDEX : index;\n}\n","/**\n * Roving tabindex for the DataTable's rows — the ARIA grid keyboard pattern.\n *\n * Exactly ONE row carries `tabIndex=0`; the rest carry `-1`. So Tab moves INTO and OUT OF\n * the grid in one hop (rather than through 100 rows), and the arrow keys move within it.\n * That is the whole point of the pattern and the reason this is not a keydown hack.\n *\n * ## Web-only, deliberately\n *\n * Moving focus means calling `.focus()` on a host node, and `onKeyDown` is a DOM event.\n * Neither exists on real React Native, where there are no arrow keys to begin with. So the\n * keyboard wiring is emitted on WEB only and is inert on native — the same deliberate\n * split as `resolveStickyHeaderStyle` in `styles.ts`, and for the same reason: a web-only\n * escape hatch must never reach the native renderer.\n */\nimport { useCallback, useRef, useState } from 'react';\nimport { Platform } from 'react-native';\n\nimport { focusedRowIndex, nextRowIndex, resolveTabbableKey, toRowNavAction } from './rowNav';\nimport { RowNavAction } from './rowNavAction';\n\n/** Tabbable: the single row the roving tabindex currently rests on. */\nconst TAB_INDEX_ACTIVE = 0;\n/** Focusable programmatically, but skipped by Tab — every other row. */\nconst TAB_INDEX_INACTIVE = -1;\n\n/**\n * The host node a row ref resolves to on web. react-native-web hands the underlying DOM\n * element to the ref while typing it as a `View`, so this is cast through `unknown` at the\n * boundary (never `any`) — the same documented shape as the sticky-header cast.\n */\ninterface FocusableNode {\n focus?: () => void;\n}\n\n/** What the DataTable needs back to wire a row up. */\nexport interface RovingFocus {\n /** `0` for the one tabbable row, `-1` for the rest. */\n tabIndexFor: (key: string) => 0 | -1;\n /** Registers a row's host node so focus can be moved to it. */\n registerRow: (key: string, node: unknown) => void;\n /** Keeps the roving index in step when focus arrives by click or Tab. */\n onRowFocus: (key: string) => void;\n /** The row's keydown handler, or `undefined` when navigation is off / not on web. */\n keyDownFor: (key: string) => ((event: RowKeyEvent) => void) | undefined;\n}\n\n/**\n * The slice of a DOM `KeyboardEvent` this hook uses. Declared locally because RN's `View`\n * types carry no `onKeyDown` at all — it is a react-native-web-only prop (RNW forwards it\n * via its `keyboardProps` list). Typing just what we read keeps `no-explicit-any` clean.\n */\nexport interface RowKeyEvent {\n key: string;\n preventDefault: () => void;\n}\n\ninterface RovingFocusOptions {\n /** The current page's row keys, in render order. */\n rowKeys: readonly string[];\n /** Off → no tabIndex, no key handlers: the table behaves exactly as it did before. */\n enabled: boolean;\n /** Space on the focused row. Omitted when the table is not selectable. */\n onToggleKey?: (key: string) => void;\n /** Enter on the focused row. Omitted when the table has no `onRowPress`. */\n onActivateKey?: (key: string) => void;\n}\n\n/** Keyboard focus movement is a DOM affair — never emitted on native. */\nconst IS_WEB = Platform.OS === 'web';\n\nexport function useRovingFocus({ rowKeys, enabled, onToggleKey, onActivateKey }: RovingFocusOptions): RovingFocus {\n const [focusedKey, setFocusedKey] = useState<string | undefined>(undefined);\n const nodes = useRef<Map<string, FocusableNode>>(new Map());\n\n // The one tabbable row. Recomputed every render from the CURRENT keys, so a page change\n // (which replaces every key) re-homes the tabindex on the new first row rather than\n // leaving the grid with no way in. See `resolveTabbableKey`.\n const tabbableKey = enabled ? resolveTabbableKey(rowKeys, focusedKey) : undefined;\n\n const registerRow = useCallback((key: string, node: unknown): void => {\n if (node === null || node === undefined) {\n nodes.current.delete(key);\n return;\n }\n nodes.current.set(key, node as FocusableNode);\n }, []);\n\n const focusRow = useCallback((key: string): void => {\n setFocusedKey(key);\n nodes.current.get(key)?.focus?.();\n }, []);\n\n const handleKey = useCallback(\n (event: RowKeyEvent, key: string): void => {\n const action = toRowNavAction(event.key);\n // A key we have no opinion on must pass straight through — swallowing it would break\n // Tab, browser shortcuts and screen-reader keys.\n if (action === undefined) return;\n\n if (action === RowNavAction.Toggle) {\n if (onToggleKey === undefined) return;\n // Space would otherwise scroll the page out from under the operator.\n event.preventDefault();\n onToggleKey(key);\n return;\n }\n if (action === RowNavAction.Activate) {\n if (onActivateKey === undefined) return;\n event.preventDefault();\n onActivateKey(key);\n return;\n }\n\n const target = nextRowIndex(focusedRowIndex(rowKeys, key), action, rowKeys.length);\n if (target === undefined) return;\n const targetKey = rowKeys[target];\n if (targetKey === undefined) return;\n // Arrows would otherwise scroll the container as well as move focus.\n event.preventDefault();\n focusRow(targetKey);\n },\n [rowKeys, onToggleKey, onActivateKey, focusRow],\n );\n\n const keyDownFor = useCallback(\n (key: string) => {\n if (!enabled || !IS_WEB) return undefined;\n return (event: RowKeyEvent): void => handleKey(event, key);\n },\n [enabled, handleKey],\n );\n\n const tabIndexFor = useCallback(\n (key: string): 0 | -1 => (key === tabbableKey ? TAB_INDEX_ACTIVE : TAB_INDEX_INACTIVE),\n [tabbableKey],\n );\n\n const onRowFocus = useCallback((key: string): void => setFocusedKey(key), []);\n\n return { tabIndexFor, registerRow, onRowFocus, keyDownFor };\n}\n","/**\n * Bulk-select — the pure logic, kept out of the component so it is testable as LOGIC\n * (the platform's testing philosophy) rather than through the DOM.\n *\n * ## The shape is the design\n *\n * The ZY-02 grid spike (`zygos/docs/03-zy02-grid-spike.md`) measured this table at ~2–3 ms\n * and ~16 DOM nodes per row, with no virtualization *by design* — it is a server-paged\n * table. So **\"select all N matching the filter\" is a FLAG plus a COUNT, never an id list**:\n * the rows on other pages are not in the DOM, the table cannot enumerate them, and it must\n * not try. The consumer resolves the flag server-side against the same filter the list\n * endpoint took, which is a better design anyway — the work survives a closed tab.\n *\n * Everything here is domain-neutral: rows have keys, a page has some of them, a filter\n * matches a count. Nothing knows what a row *is*.\n */\nimport { HeaderCheckboxState } from './headerCheckboxState';\nimport { SelectAllBannerMode } from './selectAllBannerMode';\n\n/** No rows selected / no rows on the page — the empty count. */\nconst NONE = 0;\n\n/**\n * Toggle one row's selection, returning the NEXT selection array.\n *\n * Pure: never mutates the input (the caller owns that array as React state).\n */\nexport function toggleSelectedKey(selectedKeys: readonly string[], key: string): string[] {\n return selectedKeys.includes(key)\n ? selectedKeys.filter((selected) => selected !== key)\n : [...selectedKeys, key];\n}\n\n/** How many of THIS page's rows are currently selected. */\nfunction countSelectedOnPage(selectedKeys: readonly string[], pageKeys: readonly string[]): number {\n return pageKeys.filter((key) => selectedKeys.includes(key)).length;\n}\n\n/**\n * The header checkbox's tri-state, derived from the selection ∩ this page.\n *\n * Scoped to the PAGE, not to the whole selection: a header checkbox says \"is this page\n * selected?\", and off-page keys (which the caller may legitimately hold) must not make an\n * empty page look partially selected.\n */\nexport function resolveHeaderCheckboxState(\n selectedKeys: readonly string[],\n pageKeys: readonly string[],\n): HeaderCheckboxState {\n if (pageKeys.length === NONE) return HeaderCheckboxState.None;\n const selectedOnPage = countSelectedOnPage(selectedKeys, pageKeys);\n if (selectedOnPage === NONE) return HeaderCheckboxState.None;\n return selectedOnPage === pageKeys.length ? HeaderCheckboxState.All : HeaderCheckboxState.Some;\n}\n\n/**\n * The header checkbox toggle: select every row on this page, or clear them.\n *\n * From `Some` (indeterminate) this selects the REST of the page rather than clearing —\n * the conventional behaviour, and the one that matches what the tri-state box looks like\n * it will do.\n *\n * Only ever adds/removes keys that are ON THIS PAGE. Any off-page keys the caller holds\n * survive untouched: the table only knows about the rows it was given, so it must not\n * silently drop a selection it cannot see.\n */\nexport function toggleAllOnPage(selectedKeys: readonly string[], pageKeys: readonly string[]): string[] {\n const state = resolveHeaderCheckboxState(selectedKeys, pageKeys);\n if (state === HeaderCheckboxState.All) return selectedKeys.filter((key) => !pageKeys.includes(key));\n const merged = [...selectedKeys];\n pageKeys.forEach((key) => {\n if (!merged.includes(key)) merged.push(key);\n });\n return merged;\n}\n\n/**\n * What the select-all-matching banner should say.\n *\n * `Active` wins over everything: once the flag is set, the selection IS \"the filter\", and\n * the per-page arithmetic stops being the truth on screen.\n *\n * `Offer` only appears when the whole page is selected AND the filter matches more rows\n * than this page holds — otherwise \"select all matching\" would either be premature or a\n * no-op that just re-states the page.\n */\nexport function resolveSelectAllBannerMode(\n headerState: HeaderCheckboxState,\n allMatchingSelected: boolean,\n pageCount: number,\n matchingCount: number,\n): SelectAllBannerMode {\n if (allMatchingSelected) return SelectAllBannerMode.Active;\n const pageFullySelected = headerState === HeaderCheckboxState.All && pageCount > NONE;\n const moreBeyondThisPage = matchingCount > pageCount;\n return pageFullySelected && moreBeyondThisPage ? SelectAllBannerMode.Offer : SelectAllBannerMode.Hidden;\n}\n\n/**\n * Whether a row reads as selected.\n *\n * When the select-all-matching FLAG is set every row matching the filter is selected —\n * including this one, and including rows on pages the operator never opened. So the flag\n * short-circuits the id lookup rather than the table back-filling 5,000 ids to make the\n * checkboxes look right. That back-filling is exactly what the spike ruled out.\n */\nexport function isRowSelected(\n selectedKeys: readonly string[],\n key: string,\n allMatchingSelected: boolean,\n): boolean {\n return allMatchingSelected || selectedKeys.includes(key);\n}\n","/**\n * Binds the pure bulk-select rules in `selection.ts` to the DataTable's props.\n *\n * Holds NO state of its own: selection is CONTROLLED by the consumer (the same contract as\n * `expandedRowKeys`). This hook only derives — which is why every rule it uses is a pure\n * function that can be tested without a component.\n */\nimport { useCallback, useMemo } from 'react';\n\nimport {\n isRowSelected,\n resolveHeaderCheckboxState,\n resolveSelectAllBannerMode,\n toggleAllOnPage,\n toggleSelectedKey,\n} from './selection';\nimport { HeaderCheckboxState } from './headerCheckboxState';\nimport { SelectAllBannerMode } from './selectAllBannerMode';\n\ninterface TableSelectionOptions {\n /** The current page's row keys, in render order. */\n pageKeys: readonly string[];\n selectedRowKeys?: readonly string[];\n /** The enabler: absent ⇒ no checkboxes at all. */\n onSelectionChange?: (selectedRowKeys: readonly string[]) => void;\n matchingCount?: number;\n allMatchingSelected?: boolean;\n onSelectAllMatchingChange?: (allMatching: boolean) => void;\n}\n\nexport interface TableSelection {\n /** Whether to render the checkbox gutter at all. */\n selectable: boolean;\n /** The header checkbox's tri-state. */\n headerState: HeaderCheckboxState;\n /** What the select-all-matching banner should say (`Hidden` ⇒ render nothing). */\n bannerMode: SelectAllBannerMode;\n isSelected: (key: string) => boolean;\n toggleRow: (key: string) => void;\n /** The header checkbox: select or clear THIS page. */\n toggleAll: () => void;\n /** The banner's action: emits the FLAG, never ids. */\n toggleAllMatching: () => void;\n /** Total matching the filter across all pages (0 when the consumer did not say). */\n matchingCount: number;\n}\n\nconst NO_KEYS: readonly string[] = [];\nconst NO_MATCHES = 0;\n\nexport function useTableSelection({\n pageKeys,\n selectedRowKeys,\n onSelectionChange,\n matchingCount,\n allMatchingSelected,\n onSelectAllMatchingChange,\n}: TableSelectionOptions): TableSelection {\n const selectable = onSelectionChange !== undefined;\n const selected = selectedRowKeys ?? NO_KEYS;\n const allMatching = allMatchingSelected ?? false;\n const matching = matchingCount ?? NO_MATCHES;\n\n // While the select-all-matching flag is set the header is fully checked by definition —\n // every row matching the filter is selected, so asking the page's ids is the wrong\n // question (and on a page the operator never opened they would all be absent).\n const pageHeaderState = useMemo(\n () => resolveHeaderCheckboxState(selected, pageKeys),\n [selected, pageKeys],\n );\n const headerState = allMatching ? HeaderCheckboxState.All : pageHeaderState;\n\n const bannerMode = useMemo(\n () =>\n onSelectAllMatchingChange === undefined\n ? SelectAllBannerMode.Hidden\n : resolveSelectAllBannerMode(pageHeaderState, allMatching, pageKeys.length, matching),\n [onSelectAllMatchingChange, pageHeaderState, allMatching, pageKeys.length, matching],\n );\n\n const isSelected = useCallback(\n (key: string): boolean => isRowSelected(selected, key, allMatching),\n [selected, allMatching],\n );\n\n /**\n * Touching one row while \"all matching\" is set contradicts the flag — the operator is no\n * longer approving *the filter*, they are approving a set. So the flag drops and the\n * selection becomes the honest thing it now is: this page, minus the row they just\n * unticked. Leaving the flag set would silently act on rows they had just excluded.\n */\n const toggleRow = useCallback(\n (key: string): void => {\n if (allMatching) {\n onSelectAllMatchingChange?.(false);\n onSelectionChange?.(toggleSelectedKey(pageKeys, key));\n return;\n }\n onSelectionChange?.(toggleSelectedKey(selected, key));\n },\n [allMatching, onSelectAllMatchingChange, onSelectionChange, pageKeys, selected],\n );\n\n const toggleAll = useCallback((): void => {\n if (allMatching) {\n // Un-ticking a fully-checked header clears everything, flag included.\n onSelectAllMatchingChange?.(false);\n onSelectionChange?.(NO_KEYS);\n return;\n }\n onSelectionChange?.(toggleAllOnPage(selected, pageKeys));\n }, [allMatching, onSelectAllMatchingChange, onSelectionChange, selected, pageKeys]);\n\n const toggleAllMatching = useCallback((): void => {\n const next = !allMatching;\n onSelectAllMatchingChange?.(next);\n // Clearing the flag leaves nothing selected: the ids were never enumerated, so there is\n // no page-shaped remnant to fall back to, and silently keeping this page ticked would\n // be a different set than the one the operator just cleared.\n if (!next) onSelectionChange?.(NO_KEYS);\n }, [allMatching, onSelectAllMatchingChange, onSelectionChange]);\n\n return { selectable, headerState, bannerMode, isSelected, toggleRow, toggleAll, toggleAllMatching, matchingCount: matching };\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 * Pass `stackBreakpoint={0}` to keep the desktop grid at every width.\n * - per-row `testID` + `accessibilityLabel`/`accessibilityHint` (kit standard).\n * - optional CONTROLLED expandable rows: `renderRowDetail` + `expandedRowKeys`.\n * - optional CONTROLLED **bulk-select**: `selectedRowKeys` + `onSelectionChange` add a\n * checkbox gutter; `matchingCount` + `onSelectAllMatchingChange` add the \"select all N\n * matching this filter\" banner, which emits a **FLAG, never an id list**.\n * - optional **keyboard navigation** (`keyboardNavigation`): the ARIA grid roving-tabindex\n * pattern — one tab stop for the whole grid, arrows to move, Space to select, Enter to\n * activate. Off by default: giving rows a `tabIndex` changes a page's tab order.\n * - optional per-slot `styleOverrides`, merged LAST so a consumer that needs to be\n * pixel-perfect beats both the base StyleSheet and the inline theme colour.\n * - every colour from `useUi().theme`; every component-authored string via `t`.\n *\n * **Omit the optional props and the table renders exactly as it always has** — that is the\n * contract every feature here is built to, and what keeps this a MINOR bump.\n *\n * **No virtualization, deliberately** (`zygos/docs/03-zy02-grid-spike.md`): this is a\n * server-paged table — that is what `Pager` and `FilterBar` are for — and paging already\n * buys everything virtualization would, without the surface area.\n *\n * This component is the ORCHESTRATOR: the frame, the state views, the header and the two\n * layout branches. A row's own behaviour lives in `DataTableRow`.\n */\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { Text, View, useWindowDimensions } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\nimport { FadeIn, useReducedMotion } from '@dloizides/ui-motion';\n\nimport {\n CARD_STACK_BREAKPOINT,\n TABLE_I18N,\n TABLE_TEST_IDS,\n rowEntranceDelayMs,\n rowFadeTestID,\n selectAllTestID,\n} from './constants';\nimport { DataTableRow } from './DataTableRow';\nimport { SelectAllBanner } from './SelectAllBanner';\nimport { selectionStyles as sel, softBrandTint, tableStyles as s } from './styles';\nimport { TableHeader } from './TableHeader';\nimport { useRovingFocus } from './useRovingFocus';\nimport { useTableSelection } from './useTableSelection';\nimport type { DataTableProps } from './types';\n\nconst FIRST_ROW_INDEX = 0;\nconst EVEN = 0;\nconst ZEBRA_MODULUS = 2;\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, getRowDetailAccessibilityLabel, expandedRowKeys, styleOverrides: o,\n selectedRowKeys, onSelectionChange, matchingCount, allMatchingSelected, onSelectAllMatchingChange,\n keyboardNavigation = false, animateRows = true,\n stackBreakpoint = CARD_STACK_BREAKPOINT, testID = TABLE_TEST_IDS.root,\n } = props;\n\n const { theme, t } = useUi();\n // Row entrance: on by default, but collapse to instant (no wrapper, no delay) under\n // reduced-motion — the FadeIn gates too, but skipping the wrapper entirely keeps the\n // reduced-motion DOM byte-for-byte identical to the un-animated table.\n const reducedMotion = useReducedMotion();\n const animateRowEntrance = animateRows && !reducedMotion;\n const { colors } = theme;\n const { width } = useWindowDimensions();\n const stacked = width < stackBreakpoint;\n const frame = { backgroundColor: colors.surface, borderColor: colors.border };\n\n // Web row-hover highlight (v1 `.ui-table tr.clickable:hover`): only interactive rows\n // (those with `onRowPress`) tint on hover, so static rows never light up. The tint is\n // the theme's soft brand fill (re-themes per tenant), falling back to a subtle surface\n // tint. `onHoverIn`/`onHoverOut` are no-ops on native, so this is native-safe.\n const interactive = onRowPress !== undefined;\n const [hoveredKey, setHoveredKey] = useState<string | undefined>(undefined);\n const hoverTint = softBrandTint(theme.palette.primary['500']) ?? colors.background;\n\n // Computed ONCE per render and indexed into by both branches: `keyExtractor` is the\n // caller's function, and calling it twice per row (once for the key, once for selection\n // or focus) would double a cost the spike measured as linear in the row count.\n const rowKeys = useMemo(() => rows.map(keyExtractor), [rows, keyExtractor]);\n\n const selection = useTableSelection({\n pageKeys: rowKeys,\n selectedRowKeys,\n onSelectionChange,\n matchingCount,\n allMatchingSelected,\n onSelectAllMatchingChange,\n });\n\n const activateKey = useCallback(\n (key: string): void => {\n const row = rows[rowKeys.indexOf(key)];\n if (row !== undefined) onRowPress?.(row);\n },\n [rowKeys, rows, onRowPress],\n );\n\n const roving = useRovingFocus({\n rowKeys,\n enabled: keyboardNavigation,\n onToggleKey: selection.selectable ? selection.toggleRow : undefined,\n onActivateKey: interactive ? activateKey : undefined,\n });\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 % ZEBRA_MODULUS !== EVEN ? colors.background : undefined;\n },\n [rowTint, zebra, colors.background],\n );\n\n /**\n * A row's background: the hover tint when this interactive row is hovered (wins over\n * zebra/rowTint, matching v1's `:hover td { background }`), otherwise the base tint.\n */\n const rowBg = (row: T, index: number, key: string): string | undefined =>\n interactive && hoveredKey === key ? hoverTint : rowBackground(row, index);\n\n /** Loading / empty share the frame + centred state block. */\n const stateView = (label: string): React.ReactElement => (\n <View style={[s.wrap, frame, o?.wrap]} testID={testID}>\n <View style={[s.state, o?.state]}>\n <Text style={[s.stateText, { color: colors.textSecondary }, o?.stateText]}>{label}</Text>\n </View>\n </View>\n );\n\n /**\n * A REFETCH MUST NOT BLANK THE GRID.\n *\n * This used to be an unconditional `if (loading) return stateView(...)`, which threw away the\n * rows the user was already looking at for the duration of every re-fetch. On a server-paged\n * grid that is not a cosmetic flicker — it is the paging bug: clicking \"Next\" replaced the table\n * with \"Loading…\", so the grid visibly EMPTIED and only later refilled. To an observer (and to a\n * Playwright assertion that samples the rows after the click) the page appeared to render no\n * rows at all, which reads as \"Next paged to nothing\" rather than \"the next page is on its way\".\n * The same applied to re-filtering and to any `reload()`.\n *\n * So the full-bleed state view is now reserved for when there is genuinely NOTHING to show:\n * the first load (loading, no rows yet) and a resolved empty result (not loading, no rows).\n * Once rows exist they stay on screen — stale for a moment — and swap when the new page\n * resolves. `aria-busy` below carries the in-flight fetch to assistive tech, which\n * the discarded-rows approach communicated only by destroying the content.\n */\n if (rows.length === 0) {\n return stateView(loading ? loadingLabel ?? t(TABLE_I18N.loading) : emptyLabel ?? t(TABLE_I18N.empty));\n }\n\n /**\n * One row, in whichever layout — `DataTableRow` owns everything below the frame style.\n *\n * When `animateRowEntrance` is on, the row (and its expanded detail panel, if any) is\n * wrapped in a `<FadeIn>` **keyed by the row key**. That key is what keeps the entrance\n * honest: React reuses the same `<FadeIn>` instance across unrelated parent re-renders\n * (hover, a re-fetch that resolves to the SAME keys), so it fades exactly once — on the\n * mount of that key. Only a real change to the row set (sort / filter / page) mounts new\n * keys, which is the one time a re-fade is wanted. The stagger delay is capped, so a long\n * page settles in a fixed time rather than animating row-by-row.\n *\n * When off (opt-out or reduced-motion), the row renders with no wrapper node at all — a\n * keyed `Fragment` adds nothing to the DOM — so the un-animated table is unchanged.\n */\n const renderRow = (\n row: T,\n key: string,\n index: number,\n style: React.ComponentProps<typeof DataTableRow>['style'],\n ): React.ReactElement => {\n const node = (\n <DataTableRow\n columns={columns}\n expanded={expandedRowKeys?.includes(key) ?? false}\n getRowAccessibilityLabel={getRowAccessibilityLabel}\n getRowDetailAccessibilityLabel={getRowDetailAccessibilityLabel}\n keyboardNavigation={keyboardNavigation}\n renderRowDetail={renderRowDetail}\n roving={roving}\n row={row}\n rowKey={key}\n selection={selection}\n stacked={stacked}\n style={style}\n styleOverrides={o}\n tableTestID={testID}\n onHoverIn={() => setHoveredKey(key)}\n onHoverOut={() => setHoveredKey((current) => (current === key ? undefined : current))}\n onRowPress={onRowPress}\n />\n );\n if (!animateRowEntrance) return <React.Fragment key={key}>{node}</React.Fragment>;\n return (\n <FadeIn key={key} delay={rowEntranceDelayMs(index)} testID={rowFadeTestID(testID, key)}>\n {node}\n </FadeIn>\n );\n };\n\n /** The select-all-matching banner. Renders nothing unless the consumer opted in. */\n const banner = (\n <SelectAllBanner\n actionTestID={`${testID}-${TABLE_TEST_IDS.selectBannerActionSuffix}`}\n matchingCount={selection.matchingCount}\n mode={selection.bannerMode}\n pageCount={rows.length}\n styleOverride={o?.selectBanner}\n testID={`${testID}-${TABLE_TEST_IDS.selectBannerSuffix}`}\n onAction={selection.toggleAllMatching}\n />\n );\n\n // --- mobile: label:value card-stack (GRID.md). Disabled by `stackBreakpoint={0}`. ---\n if (stacked) {\n return (\n <View style={[s.wrap, frame, o?.wrap]} testID={testID} aria-busy={loading}>\n {banner}\n {/* The card-stack has no visible header, but E2E selectors that target the head must\n still resolve at phone width — a hidden, a11y-inert carrier keeps `ui-data-table-head`\n queryable in BOTH layouts (see `headSentinel` in styles.ts). */}\n <View style={s.headSentinel} testID={TABLE_TEST_IDS.head} aria-hidden />\n {rows.map((row, i) => {\n const key = rowKeys[i] ?? keyExtractor(row);\n const bg = rowBg(row, i, key);\n return renderRow(row, key, i, [\n s.card,\n { borderTopColor: colors.border },\n i === FIRST_ROW_INDEX ? { borderTopWidth: 0 } : null,\n // A selectable card puts the checkbox beside its lines, so the card becomes a row.\n selection.selectable ? sel.rowContent : null,\n bg ? { backgroundColor: bg } : null,\n o?.card,\n ]);\n })}\n </View>\n );\n }\n\n // --- desktop: header + rows ---\n return (\n <View\n style={[s.wrap, frame, o?.wrap]}\n testID={testID}\n // Rows now survive a re-fetch (see the `rows.length === 0` guard above), so the in-flight\n // state has to be announced rather than implied by the content vanishing.\n aria-busy={loading}\n // A navigable table is a real ARIA grid; a plain one keeps the roles it always had.\n {...(keyboardNavigation ? { role: 'grid' as const } : null)}\n >\n {banner}\n <TableHeader\n columns={columns}\n inGrid={keyboardNavigation}\n selection={\n selection.selectable\n ? { state: selection.headerState, onToggleAll: selection.toggleAll, testID: selectAllTestID(testID) }\n : undefined\n }\n stickyHeader={stickyHeader}\n styleOverrides={o}\n />\n {rows.map((row, i) => {\n const key = rowKeys[i] ?? keyExtractor(row);\n const bg = rowBg(row, i, key);\n return renderRow(row, key, i, [s.row, { borderTopColor: colors.border }, bg ? { backgroundColor: bg } : null, o?.row]);\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, type StyleProp, type TextStyle, type ViewStyle } 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\nconst RESULTS_COUNT_WEIGHT = '700' as const;\n\n/**\n * Per-slot style overrides for the FilterBar, merged **LAST** into each slot's style\n * array so the consumer always wins — over the base StyleSheet AND over the inline\n * colours taken from `useUi().theme`. Omit for the shared defaults (nothing changes).\n */\nexport interface FilterBarStyleOverrides {\n /** The bordered, rounded filter shell. */\n filters?: StyleProp<ViewStyle>;\n /** The flex spacer that pushes the count + actions right. */\n filtersSpacer?: StyleProp<ViewStyle>;\n /** The `<b>N</b> results` count line. */\n results?: StyleProp<TextStyle>;\n /** The right-aligned actions cluster. */\n filtersActions?: StyleProp<ViewStyle>;\n}\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 /**\n * Per-slot style overrides, merged LAST so the consumer always wins — including over\n * the inline theme colours. Omit for the shared defaults.\n */\n styleOverrides?: FilterBarStyleOverrides;\n testID?: string;\n}\n\nexport function FilterBar({\n children,\n resultsCount,\n resultsLabel,\n actions,\n styleOverrides: o,\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 }, o?.filters]} testID={testID}>\n {children}\n <View style={[c.filtersSpacer, o?.filtersSpacer]} />\n {typeof resultsCount === 'number' && (\n // Live region: announce the new count when filters change the result set (WCAG 4.1.3).\n <Text\n accessibilityLiveRegion=\"polite\"\n role=\"status\"\n style={[c.results, { color: colors.textSecondary }, o?.results]}\n testID={TABLE_TEST_IDS.results}\n >\n <Text style={{ color: colors.text, fontWeight: RESULTS_COUNT_WEIGHT }}>{resultsCount.toLocaleString()}</Text>\n {` ${word}`}\n </Text>\n )}\n {!!actions && <View style={[c.filtersActions, o?.filtersActions]}>{actions}</View>}\n </View>\n );\n}\n\nexport default FilterBar;\n","/**\n * Accessible-name resolution for keys this package introduces AFTER a host app has adopted it.\n *\n * The kit's i18n contract (see TABLE_I18N / FILTERS_I18N) is deliberately fallback-free: the\n * neutral `t` returns the KEY, and a host's `FM` has no fallback either, so a key the host has\n * not defined renders as its literal dotted name. That is the right default for VISIBLE copy —\n * it is loud, and it gets noticed and fixed.\n *\n * It is the WRONG default for an ACCESSIBLE NAME. An aria-label is invisible to sighted\n * reviewers, so an undefined key ships silently and the only people affected are screen-reader\n * users — who then hear \"ui tables pager rows trigger label\" instead of the bare number they\n * used to hear. That is a REGRESSION, and it is exactly the failure Zygos hit (44 undefined\n * keys rendering raw, e.g. `uiTables.filters.apply` shown literally).\n *\n * So a newly-introduced accessible-name key degrades to the value it REPLACED — the page-size\n * number, the field's own label. Those are locale-neutral data the caller already has, not\n * hardcoded English, so this does not smuggle a translation into the kit: an app that adopts\n * the key gets the good name, and an app that has not yet is no worse off than before.\n *\n * This is a MIGRATION affordance, not a licence to skip translations. Every key is still listed\n * in the exported *_I18N maps and documented in the README as required.\n */\n\n/**\n * The translated accessible name, or `fallback` when the host has not defined `key`.\n *\n * A host that has not mapped `key` gets the key back verbatim from `t` — that, and the empty\n * string, are the two \"not translated\" signals.\n */\nexport function accessibleName(translated: string, key: string, fallback: string): string {\n const isUntranslated = translated === key || translated === '';\n return isUntranslated ? fallback : translated;\n}\n","/**\n * SizeDropdown — the compact rows-per-page control for the Pager's `dropdown` variant.\n *\n * Matches the v1 console's `<select class=\"ui-select ui-btn--sm\">`: a compact bordered\n * trigger (height-matched to the Prev/Next ghost buttons) showing the current page size\n * plus a chevron, which opens an anchored popover of the page-size options. Selecting one\n * fires `onPageSizeChange` and closes; it also closes on outside-click / Escape.\n *\n * STACKING (the bug this fixes): react-native-web gives every `View` `position: relative;\n * z-index: 0`, so every View is its OWN stacking context. An absolutely-positioned popover\n * therefore has its `zIndex` trapped inside the anchor's `z-index: 0` context and paints\n * UNDER later-painting siblings (the results table / cards below). To escape that, on WEB the\n * open menu is rendered in a PORTAL to `document.body` with `position: fixed` at the trigger's\n * measured viewport rect and a high `zIndex` — clipped by nothing, above everything. The rect is\n * re-measured on scroll/resize so the menu stays glued to its trigger. On native the menu stays\n * in-tree (`position: absolute` + `elevation`). This mirrors `@dloizides/ui-layout`'s InlineMenu.\n *\n * `react-dom` is an OPTIONAL peer (only touched on web, behind `Platform.OS === 'web'`); every\n * RN-web consumer already has it. ui-tables stays a low-level table primitive with no runtime\n * dependency on the higher-level ui-layout ModalDropdown (whose trigger cannot match v1's compact\n * select), so this minimal anchored menu is kept in-tree.\n */\nimport React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { Platform, Pressable, Text, View, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';\n\nimport { chromeStyles as c } from './styles';\n\nconst CHEVRON_DOWN = '▾';\nconst CHEVRON_UP = '▴';\nconst IS_WEB = Platform.OS === 'web';\n/** Gap between the trigger's bottom edge and the popover's top edge (mirrors styles.ts MENU_TOP_GAP). */\nconst MENU_TOP_GAP = 4;\nconst VIEWPORT_EDGE = 0;\n\n/** The trigger's viewport-space corner needed to place the fixed, right-aligned web menu. */\ninterface TriggerRect {\n bottom: number;\n right: number;\n}\n\n/** Read the trigger's viewport rect (web only). Returns null when unavailable (native / no node). */\nfunction readTriggerRect(anchorRef: React.RefObject<View | null>): TriggerRect | null {\n if (!IS_WEB) return null;\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web ref is an HTMLElement at runtime\n const node = anchorRef.current as unknown as HTMLElement | null;\n if (node === null || typeof node.getBoundingClientRect !== 'function') return null;\n const r = node.getBoundingClientRect();\n return { bottom: r.bottom, right: r.right };\n}\n\n/**\n * Web-only fixed-position style: `position: fixed` under the trigger, right-aligned to it (v1's\n * menu hangs off the trigger's right edge). Merged OVER `chromeStyles.sizeMenu`, so it only needs\n * to override position/top/right — border, radius, padding, min-width, shadow and zIndex are kept.\n */\nfunction buildWebFixedStyle(rect: TriggerRect, viewportWidth: number): ViewStyle {\n return {\n // RN's ViewStyle union omits 'fixed', but react-native-web honours it at runtime.\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- web-only position value\n position: 'fixed' as unknown as ViewStyle['position'],\n top: rect.bottom + MENU_TOP_GAP,\n right: Math.max(VIEWPORT_EDGE, viewportWidth - rect.right),\n };\n}\n\n/**\n * Keep the fixed web menu glued to its trigger: measure before paint, then re-measure on scroll\n * (capture, so nested scrollers count) and resize while open. No-op on native / while closed.\n */\nfunction useTriggerRect(anchorRef: React.RefObject<View | null>, isOpen: boolean): TriggerRect | null {\n const [rect, setRect] = useState<TriggerRect | null>(null);\n\n useLayoutEffect(() => {\n if (!IS_WEB || !isOpen) return undefined;\n const measure = (): void => { setRect(readTriggerRect(anchorRef)); };\n measure();\n window.addEventListener('scroll', measure, true);\n window.addEventListener('resize', measure);\n return () => {\n window.removeEventListener('scroll', measure, true);\n window.removeEventListener('resize', measure);\n };\n }, [anchorRef, isOpen]);\n\n return rect;\n}\n\n/**\n * Web-only outside-click + Escape dismissal. Because the open menu is portalled OUT of the anchor\n * on web, a click is \"inside\" if it lands in EITHER the anchor or the portalled menu node. No-op on\n * native.\n */\nfunction useDismissOnOutside(\n anchorRef: React.RefObject<View | null>,\n menuRef: React.RefObject<View | null>,\n isOpen: boolean,\n onClose: () => void,\n): void {\n useEffect(() => {\n if (!IS_WEB || !isOpen) return undefined;\n\n const onMouseDown = (event: MouseEvent): void => {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web refs are HTMLElements at runtime\n const anchorNode = anchorRef.current as unknown as HTMLElement | null;\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web refs are HTMLElements at runtime\n const menuNode = menuRef.current as unknown as HTMLElement | null;\n const target = event.target instanceof Node ? event.target : null;\n const insideAnchor = anchorNode !== null && target !== null && anchorNode.contains(target);\n const insideMenu = menuNode !== null && target !== null && menuNode.contains(target);\n if (!insideAnchor && !insideMenu) onClose();\n };\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') onClose();\n };\n\n document.addEventListener('mousedown', onMouseDown);\n document.addEventListener('keydown', onKeyDown);\n return () => {\n document.removeEventListener('mousedown', onMouseDown);\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [anchorRef, menuRef, isOpen, onClose]);\n}\n\nexport interface SizeDropdownProps {\n pageSize: number;\n pageSizeOptions: readonly number[];\n onPageSizeChange: (pageSize: number) => void;\n /** Base pager test id; the trigger is `${testID}-size-trigger`, each option `${testID}-size-${size}`. */\n testID: string;\n /**\n * Already-translated accessible NAME for the trigger, e.g. \"Rows per page, currently 50\".\n * The bare page-size number is NOT an acceptable name: it tells a screen-reader user the\n * value but never what the control is.\n */\n triggerLabel: string;\n /** Already-translated accessible NAME for one option, e.g. \"Show 100 rows per page\". */\n getOptionLabel: (size: number) => string;\n /** Already-translated accessible hint for the trigger. */\n triggerHint: string;\n /** Already-translated accessible hint for each option. */\n optionHint: string;\n /** Theme colours from the Pager (kept flat so this stays a pure presentational unit). */\n textColor: string;\n mutedColor: string;\n borderColor: string;\n surfaceColor: string;\n brandColor: string;\n triggerStyle?: StyleProp<ViewStyle>;\n triggerTextStyle?: StyleProp<TextStyle>;\n}\n\nexport function SizeDropdown({\n pageSize,\n pageSizeOptions,\n onPageSizeChange,\n testID,\n triggerLabel,\n getOptionLabel,\n triggerHint,\n optionHint,\n textColor,\n mutedColor,\n borderColor,\n surfaceColor,\n brandColor,\n triggerStyle,\n triggerTextStyle,\n}: SizeDropdownProps): React.ReactElement {\n const anchorRef = useRef<View>(null);\n const menuRef = useRef<View>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n const close = useCallback(() => { setIsOpen(false); }, []);\n const toggle = useCallback(() => { setIsOpen((prev) => !prev); }, []);\n const select = useCallback(\n (size: number) => {\n onPageSizeChange(size);\n setIsOpen(false);\n },\n [onPageSizeChange],\n );\n\n const rect = useTriggerRect(anchorRef, isOpen);\n useDismissOnOutside(anchorRef, menuRef, isOpen, close);\n\n // Web: fixed-positioned in a portal at the measured trigger rect (escapes stacking + clipping).\n // Native: keep the in-tree absolute popover from chromeStyles.sizeMenu.\n const webFixedStyle = IS_WEB && rect !== null ? buildWebFixedStyle(rect, window.innerWidth) : null;\n\n const menu = (\n <View\n ref={menuRef}\n accessibilityRole=\"menu\"\n style={[c.sizeMenu, { borderColor, backgroundColor: surfaceColor }, webFixedStyle]}\n testID={`${testID}-size-menu`}\n >\n {pageSizeOptions.map((size) => {\n const active = size === pageSize;\n return (\n <Pressable\n key={size}\n testID={`${testID}-size-${size}`}\n accessibilityRole=\"menuitem\"\n accessibilityLabel={getOptionLabel(size)}\n accessibilityHint={optionHint}\n accessibilityState={{ selected: active }}\n onPress={() => select(size)}\n style={c.sizeOption}\n >\n <Text style={[c.sizeOptionText, { color: active ? brandColor : textColor, fontWeight: active ? '700' : '400' }]}>{size}</Text>\n </Pressable>\n );\n })}\n </View>\n );\n\n return (\n <View ref={anchorRef} style={c.sizeAnchor}>\n <Pressable\n testID={`${testID}-size-trigger`}\n accessibilityRole=\"button\"\n accessibilityLabel={triggerLabel}\n accessibilityHint={triggerHint}\n accessibilityState={{ expanded: isOpen }}\n aria-expanded={isOpen}\n onPress={toggle}\n style={[c.sizeTrigger, { borderColor, backgroundColor: surfaceColor }, triggerStyle]}\n >\n <Text style={[c.sizeTriggerText, { color: textColor }, triggerTextStyle]}>{pageSize}</Text>\n <Text style={[c.sizeChevron, { color: mutedColor }]} aria-hidden>{isOpen ? CHEVRON_UP : CHEVRON_DOWN}</Text>\n </Pressable>\n\n {/* Portal to document.body on web so no ancestor stacking context / overflow can trap or clip it. */}\n {isOpen ? (IS_WEB ? createPortal(menu, document.body) : menu) : null}\n </View>\n );\n}\n\nexport default SizeDropdown;\n","/**\n * PagerNav — the Pager's right-hand navigation cluster (rows-per-page control + First / Prev /\n * Next / Last). Split out of Pager.tsx so each file stays small and the page-math component\n * reads cleanly; purely presentational, driven by the resolved page bounds passed in.\n */\nimport React from 'react';\nimport { Pressable, Text, View } from 'react-native';\n\nimport { useUi, type UiTranslate } from '@dloizides/ui-feedback';\n\nimport { accessibleName } from '../accessibleName';\nimport { TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { SizeDropdown } from './SizeDropdown';\nimport { chromeStyles as c } from './styles';\nimport type { PagerStyleOverrides } from './Pager';\n\nconst FIRST_PAGE = 1;\nconst DISABLED_OPACITY = 0.4;\nconst FULL_OPACITY = 1;\nconst TRANSPARENT = 'transparent';\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 styleOverrides?: Pick<PagerStyleOverrides, 'control' | 'controlText'>;\n}\n\nfunction NavButton({ label, hint, disabled, onPress, color, border, testID, styleOverrides: o }: NavButtonProps): React.ReactElement {\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 : FULL_OPACITY }, o?.control]}\n >\n <Text style={[c.controlText, { color }, o?.controlText]}>{label}</Text>\n </Pressable>\n );\n}\n\nexport interface PagerNavProps {\n pageSize: number;\n pageSizeOptions: readonly number[];\n onPageSizeChange: (pageSize: number) => void;\n onPageChange: (page: number) => void;\n safePage: number;\n lastPage: number;\n isCompact: boolean;\n isDropdown: boolean;\n showFirstLast: boolean;\n testID: string;\n styleOverrides?: PagerStyleOverrides;\n}\n\n/**\n * Accessible NAME of the rows-per-page control — \"Rows per page, currently 50\", never the\n * bare \"50\" it used to be, which announces the value but never says what the control is.\n */\nfunction rowsTriggerLabel(t: UiTranslate, pageSize: number): string {\n const size = String(pageSize);\n return accessibleName(t(TABLE_I18N.pagerRowsTriggerLabel, size), TABLE_I18N.pagerRowsTriggerLabel, size);\n}\n\n/**\n * Accessible NAME of ONE rows-per-page choice — \"Show 100 rows per page\". Shared by the\n * `dropdown` options AND the default `pills`, which carried the identical bare-number defect.\n */\nfunction rowsOptionLabel(t: UiTranslate, optionSize: number): string {\n const size = String(optionSize);\n return accessibleName(t(TABLE_I18N.pagerRowsOptionLabel, size), TABLE_I18N.pagerRowsOptionLabel, size);\n}\n\n/** The rows-per-page control (hidden when compact): a dropdown or a row of size pills. */\nfunction RowsControl({ pageSize, pageSizeOptions, onPageSizeChange, isDropdown, testID, styleOverrides: o }: Pick<PagerNavProps, 'pageSize' | 'pageSizeOptions' | 'onPageSizeChange' | 'isDropdown' | 'testID' | 'styleOverrides'>): React.ReactElement {\n const { theme, t } = useUi();\n const { colors, palette } = theme;\n const brand = palette.primary['500'];\n\n return (\n <>\n <Text style={[isDropdown ? c.pagerRowsLabelPlain : c.pagerRowsLabel, { color: colors.textSecondary }, o?.pagerRowsLabel]}>\n {t(TABLE_I18N.pagerRows)}\n </Text>\n {isDropdown ? (\n <SizeDropdown\n pageSize={pageSize}\n pageSizeOptions={pageSizeOptions}\n onPageSizeChange={onPageSizeChange}\n testID={testID}\n triggerLabel={rowsTriggerLabel(t, pageSize)}\n getOptionLabel={(size) => rowsOptionLabel(t, size)}\n triggerHint={t(TABLE_I18N.pagerRowsTriggerHint)}\n optionHint={t(TABLE_I18N.pagerRowsOptionHint)}\n textColor={colors.text}\n mutedColor={colors.textSecondary}\n borderColor={colors.border}\n surfaceColor={colors.surface}\n brandColor={brand}\n triggerStyle={o?.sizePill}\n triggerTextStyle={o?.sizePillText}\n />\n ) : (\n <View style={[c.sizeGroup, o?.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={rowsOptionLabel(t, 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 }, o?.sizePill]}\n >\n <Text style={[c.sizePillText, { color: active ? colors.surface : colors.textSecondary }, o?.sizePillText]}>{size}</Text>\n </Pressable>\n );\n })}\n </View>\n )}\n </>\n );\n}\n\nexport function PagerNav({\n pageSize,\n pageSizeOptions,\n onPageSizeChange,\n onPageChange,\n safePage,\n lastPage,\n isCompact,\n isDropdown,\n showFirstLast,\n testID,\n styleOverrides: o,\n}: PagerNavProps): React.ReactElement {\n const { theme, t } = useUi();\n const { colors } = theme;\n const atFirst = safePage <= FIRST_PAGE;\n const atLast = safePage >= lastPage;\n const showJumps = showFirstLast && !isCompact;\n\n return (\n <View style={[c.pagerNav, o?.pagerNav]}>\n {!isCompact && (\n <RowsControl\n pageSize={pageSize}\n pageSizeOptions={pageSizeOptions}\n onPageSizeChange={onPageSizeChange}\n isDropdown={isDropdown}\n testID={testID}\n styleOverrides={o}\n />\n )}\n {showJumps && (\n <NavButton\n label={t(TABLE_I18N.pagerFirst)}\n hint={t(TABLE_I18N.pagerFirstHint)}\n disabled={atFirst}\n onPress={() => onPageChange(FIRST_PAGE)}\n color={colors.text}\n border={colors.border}\n styleOverrides={o}\n testID={TABLE_TEST_IDS.pagerFirst}\n />\n )}\n <NavButton\n label={t(TABLE_I18N.pagerPrev)}\n hint={t(TABLE_I18N.pagerPrevHint)}\n disabled={atFirst}\n onPress={() => onPageChange(safePage - 1)}\n color={colors.text}\n border={colors.border}\n styleOverrides={o}\n testID={TABLE_TEST_IDS.pagerPrev}\n />\n <NavButton\n label={t(TABLE_I18N.pagerNext)}\n hint={t(TABLE_I18N.pagerNextHint)}\n disabled={atLast}\n onPress={() => onPageChange(safePage + 1)}\n color={colors.text}\n border={colors.border}\n styleOverrides={o}\n testID={TABLE_TEST_IDS.pagerNext}\n />\n {showJumps && (\n <NavButton\n label={t(TABLE_I18N.pagerLast)}\n hint={t(TABLE_I18N.pagerLastHint)}\n disabled={atLast}\n onPress={() => onPageChange(lastPage)}\n color={colors.text}\n border={colors.border}\n styleOverrides={o}\n testID={TABLE_TEST_IDS.pagerLast}\n />\n )}\n </View>\n );\n}\n\nexport default PagerNav;\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 { Text, View, useWindowDimensions, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE_OPTIONS, TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { PagerNav } from './PagerNav';\nimport { chromeStyles as c } from './styles';\n\nconst FIRST_PAGE = 1;\nconst EN_DASH = '–';\nconst BOLD = '700' as const;\n\n/**\n * Per-slot style overrides for the Pager, merged **LAST** into each slot's style array\n * so the consumer always wins — over the base StyleSheet AND over the inline colours\n * taken from `useUi().theme`. Omit for the shared defaults (nothing changes).\n */\nexport interface PagerStyleOverrides {\n /** The outer pager row. */\n pager?: StyleProp<ViewStyle>;\n /** The `from–to of N` count line. */\n pagerInfo?: StyleProp<TextStyle>;\n /** The right-hand nav cluster (rows-per-page + Prev/Next). */\n pagerNav?: StyleProp<ViewStyle>;\n /** The \"Rows\" caption before the size pills. */\n pagerRowsLabel?: StyleProp<TextStyle>;\n /** The rows-per-page pill group. */\n sizeGroup?: StyleProp<ViewStyle>;\n /** A Prev/Next button. */\n control?: StyleProp<ViewStyle>;\n /** A Prev/Next button's label. */\n controlText?: StyleProp<TextStyle>;\n /** A rows-per-page pill. */\n sizePill?: StyleProp<ViewStyle>;\n /** A rows-per-page pill's label. */\n sizePillText?: StyleProp<TextStyle>;\n}\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 * How the rows-per-page control renders. `'pills'` (default) keeps the RN-idiom row of\n * pressable size pills — byte-identical for every existing consumer. `'dropdown'` swaps in\n * a compact `<select>`-like anchored dropdown matching the v1 console's \"Rows\" select\n * (compact trigger + chevron, popover of options, close on outside-click / Escape) and a\n * mixed-case \"Rows\" caption.\n */\n rowsVariant?: 'pills' | 'dropdown';\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 /**\n * Optional, already-translated SINGULAR unit noun, used in place of `unitLabel` when\n * `total === 1` (e.g. `unitLabel=\"results\"` + `unitLabelSingular=\"result\"` → `1–1 of 1 result`).\n * Ignored unless `unitLabel` is also set; when omitted, `unitLabel` is used at every count.\n */\n unitLabelSingular?: string;\n /**\n * Render First / Last jump buttons flanking Prev / Next (reconciling erevna's\n * `PaginationControls`). Off by default (byte-identical to prior behaviour) — the two\n * buttons only appear when explicitly enabled.\n */\n showFirstLast?: boolean;\n /**\n * Collapse to a compact, mobile-friendly nav below `stackBreakpoint`: the rows-per-page\n * control and the First/Last jumps are hidden, leaving Prev / Next + the count line. Off by\n * default (byte-identical). Auto-driven by the window width, mirroring the DataTable card-stack.\n */\n responsive?: boolean;\n /** Width (px) below which `responsive` collapses to the compact nav. Default 640 (shared with DataTable). */\n stackBreakpoint?: number;\n /**\n * Optional, already-translated word prefixed to the count line, e.g. `\"Showing\"` renders\n * `Showing 1–50 of 3,023 leadership terms`. Omit for the bare `from–to of N` line\n * (byte-identical to prior behaviour).\n */\n infoPrefix?: string;\n /**\n * Render the three counts (from / to / total) in bold `colors.text` — matching the v1\n * console's `.ui-pager__info b`. Off by default (the whole line stays `textSecondary`,\n * byte-identical to prior behaviour); the concatenated text is unchanged either way.\n */\n boldNumbers?: boolean;\n /**\n * Per-slot style overrides, merged LAST so the consumer always wins — including over\n * the inline theme colours. Omit for the shared defaults.\n */\n styleOverrides?: PagerStyleOverrides;\n testID?: string;\n}\n\nexport function Pager({\n page,\n pageSize,\n total,\n onPageChange,\n onPageSizeChange,\n pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS,\n rowsVariant = 'pills',\n unitLabel,\n unitLabelSingular,\n showFirstLast = false,\n responsive = false,\n stackBreakpoint = CARD_STACK_BREAKPOINT,\n infoPrefix,\n boldNumbers = false,\n styleOverrides: o,\n testID = TABLE_TEST_IDS.pager,\n}: PagerProps): React.ReactElement {\n const { theme, t } = useUi();\n const { colors } = theme;\n const { width } = useWindowDimensions();\n const isDropdown = rowsVariant === 'dropdown';\n // Below the breakpoint (opt-in) collapse to Prev/Next + count only — drop the rows-per-page\n // control and the First/Last jumps, mirroring the DataTable's card-stack behaviour.\n const isCompact = responsive && width < stackBreakpoint;\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 hasUnit = unitLabel !== undefined && unitLabel !== '';\n // Singularise the unit noun when exactly one row matches (needs both a base unit AND a singular).\n const resolvedUnit = total === 1 && unitLabelSingular !== undefined && unitLabelSingular !== '' ? unitLabelSingular : unitLabel;\n const hasPrefix = infoPrefix !== undefined && infoPrefix !== '';\n const prefix = hasPrefix ? `${infoPrefix} ` : '';\n const ofWord = t(TABLE_I18N.pagerInfo);\n const unitSuffix = hasUnit ? ` ${resolvedUnit}` : '';\n const count = `${from.toLocaleString()}${EN_DASH}${to.toLocaleString()} ${ofWord} ${total.toLocaleString()}`;\n const info = `${prefix}${count}${unitSuffix}`;\n const boldStyle = { color: colors.text, fontWeight: BOLD };\n\n return (\n <View style={[c.pager, o?.pager]} testID={testID}>\n <Text style={[c.pagerInfo, { color: colors.textSecondary }, o?.pagerInfo]} testID={TABLE_TEST_IDS.pagerInfo}>\n {boldNumbers ? (\n <>\n {prefix}\n <Text style={boldStyle}>{from.toLocaleString()}</Text>\n {EN_DASH}\n <Text style={boldStyle}>{to.toLocaleString()}</Text>\n {` ${ofWord} `}\n <Text style={boldStyle}>{total.toLocaleString()}</Text>\n {unitSuffix}\n </>\n ) : (\n info\n )}\n </Text>\n <PagerNav\n pageSize={pageSize}\n pageSizeOptions={pageSizeOptions}\n onPageSizeChange={onPageSizeChange}\n onPageChange={onPageChange}\n safePage={safePage}\n lastPage={lastPage}\n isCompact={isCompact}\n isDropdown={isDropdown}\n showFirstLast={showFirstLast}\n testID={testID}\n styleOverrides={o}\n />\n </View>\n );\n}\n\nexport default Pager;\n","/**\n * Shared StyleSheet for the declarative Filters bar — the BAR's own chrome only.\n *\n * F2: the field/label/input/menu metrics that used to live here moved to\n * `@dloizides/ui-forms`' `controlStyles`, and this file imports them back rather than keeping a\n * copy. That matters: this file's previous header noted it had \"reconcile[d] the per-field styles\n * that were copy-pasted across aml-v2's filter files into one shared source\" — and then locked the\n * reconciliation inside one bar. Re-forking them here would recreate exactly the split the move\n * set out to close, this time between two packages instead of two apps.\n *\n * Colours are applied inline from `useUi().theme` at render — nothing here carries a colour literal.\n */\nimport { StyleSheet } from 'react-native';\n\nimport { controlStyles } from '@dloizides/ui-forms';\n\nimport { MIN_TARGET_PX } from '../minTarget';\n\nconst FIELD_GAP = 4;\nconst SWITCH_ROW_GAP = 8;\nconst ACTION_PAD_H = 14;\nconst ACTION_PAD_V = 8;\nconst ACTION_RADIUS = 8;\nconst ACTION_FONT = 13;\nconst ACTION_BORDER = 1;\n/** `Field` carries the 16px vertical form rhythm; a filter bar spaces via FilterBar's own gap. */\nconst NO_FORM_RHYTHM = 0;\n\nexport const filterStyles = StyleSheet.create({\n /**\n * Merged onto `Field`'s container inside the bar. Zeroes the 16px bottom margin `Field` gives\n * a stacked form row: the bar is a flex ROW whose spacing comes from FilterBar's `gap`, so\n * inheriting the form rhythm would add a phantom gap under every field — a pixel change for\n * six live portals, which this wave must not make.\n */\n fieldInBar: { marginBottom: NO_FORM_RHYTHM },\n switchRow: { minHeight: MIN_TARGET_PX, flexDirection: 'row', alignItems: 'center', gap: SWITCH_ROW_GAP, paddingVertical: FIELD_GAP },\n /** A 44x44 pressable around the switch: RN-web draws the Switch at 40x20 and that box IS its hit target. */\n switchHit: { minWidth: MIN_TARGET_PX, minHeight: MIN_TARGET_PX, alignItems: 'center', justifyContent: 'center' },\n /** The inner Switch takes no pointer events, so one tap toggles once (via `switchHit`), not twice. */\n switchInert: { pointerEvents: 'none' },\n action: { minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, alignItems: 'center', justifyContent: 'center', paddingHorizontal: ACTION_PAD_H, paddingVertical: ACTION_PAD_V, borderRadius: ACTION_RADIUS, borderWidth: ACTION_BORDER },\n actionText: { fontSize: ACTION_FONT, fontWeight: '600' },\n});\n\n/**\n * The dense-control metrics, re-exported from `@dloizides/ui-forms` so the bar's remaining\n * in-tree fields (`TextField`, `BooleanField`) use the SAME `input` / `subLabel` boxes as the\n * promoted controls rather than a second copy.\n */\nexport { controlStyles };\n","/**\n * ActionButton — the themed Apply / Clear button the declarative bar renders in its actions\n * slot. A bordered pill (primary = brand fill, ghost = bordered) kept in-tree so ui-tables\n * needs no ui-buttons dependency; richer buttons (Export with a spinner) go in the caller's\n * own `actions` slot.\n */\nimport React from 'react';\nimport { Pressable, Text } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { filterStyles as s } from '../styles';\n\nconst DISABLED_OPACITY = 0.4;\nconst FULL_OPACITY = 1;\nconst TRANSPARENT = 'transparent';\n\nexport interface ActionButtonProps {\n label: string;\n hint: string;\n tone: 'primary' | 'ghost';\n disabled?: boolean;\n onPress: () => void;\n testID: string;\n}\n\nexport function ActionButton({ label, hint, tone, disabled = false, onPress, testID }: ActionButtonProps): React.ReactElement {\n const { theme } = useUi();\n const { colors, palette } = theme;\n const isPrimary = tone === 'primary';\n const brand = palette.primary['500'];\n\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityHint={hint}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n style={[\n s.action,\n {\n borderColor: isPrimary ? brand : colors.border,\n backgroundColor: isPrimary ? brand : TRANSPARENT,\n opacity: disabled ? DISABLED_OPACITY : FULL_OPACITY,\n },\n ]}\n testID={testID}\n >\n <Text style={[s.actionText, { color: isPrimary ? colors.surface : colors.text }]}>{label}</Text>\n </Pressable>\n );\n}\n\nexport default ActionButton;\n","/**\n * Constants for the declarative Filters bar — every test id, i18n key and layout number in\n * one place so the components carry no magic numbers and no ad-hoc strings.\n */\nimport type { FilterFieldKind } from './types';\n\n/** Root testID of the declarative filter bar. */\nexport const FILTERS_TEST_ID = 'ui-filters-declarative';\n\n/** Default minimum widths (px) per field kind before it wraps. */\nexport const FIELD_MIN_WIDTH: Record<FilterFieldKind, number> = {\n select: 150,\n text: 200,\n number: 130,\n dateRange: 260,\n typeahead: 200,\n boolean: 150,\n};\n\n/**\n * Typeahead defaults. F2: these are RE-EXPORTED from `@dloizides/ui-forms`, which now owns the\n * control they configure — a second copy here could drift from the behaviour it claims to\n * describe. The public names are unchanged, so consumers importing them from `ui-tables` are\n * unaffected.\n */\nexport {\n DEFAULT_TYPEAHEAD_MIN_CHARS,\n DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS,\n} from '@dloizides/ui-forms';\n\n/** Derived testIDs for the declarative bar. */\nexport const fieldTestID = (barTestID: string, key: string): string => `${barTestID}-field-${key}`;\nexport const applyTestID = (barTestID: string): string => `${barTestID}-apply`;\nexport const clearTestID = (barTestID: string): string => `${barTestID}-clear`;\n\n/**\n * Translation keys for the bar's own controls. Apps map these in their UiProvider `t`; the\n * neutral default `t` returns the key, so a forgotten key degrades to the key, never a literal.\n * A caller may also override any of them with a pre-localized string prop on {@link Filters}.\n */\nexport const FILTERS_I18N = {\n apply: 'uiTables.filters.apply',\n applyHint: 'uiTables.filters.applyHint',\n clear: 'uiTables.filters.clear',\n clearHint: 'uiTables.filters.clearHint',\n selectPlaceholder: 'uiTables.filters.selectPlaceholder',\n dropdownHint: 'uiTables.filters.dropdownHint',\n optionHint: 'uiTables.filters.optionHint',\n /**\n * Accessible NAME of a select trigger, e.g. \"{{p1}}: {{p2}}\" → \"Status: Active\". The\n * trigger's `accessibilityLabel` REPLACES its visible text for a screen reader, so labelling\n * it with the field name alone silently hides the current selection. Untranslated it\n * degrades to the field label alone (prior behaviour) — never to the raw key.\n */\n selectTriggerLabel: 'uiTables.filters.selectTriggerLabel',\n from: 'uiTables.filters.from',\n to: 'uiTables.filters.to',\n} as const;\n","/**\n * BooleanField — a themed RN `Switch` for a boolean filter (aml's `includeRelatives` /\n * `prioritize`). The label sits inline to the LEFT of the switch (switch-row idiom), not\n * above it, so it reads as a toggle rather than an input.\n *\n * F2 — why this did NOT move to `ui-forms` with its siblings: `ui-forms` already ships\n * `FormSwitch`, the same idea at different metrics (`space-between` + 12px bottom margin +\n * a 600-weight label, versus this row's 8px gap and 11px micro-caption). Promoting this would\n * put two switch rows in one package; converging onto `FormSwitch` moves pixels. Both belong in\n * the visual-QA-gated wave. It shares `controlStyles.subLabel`, so no metric is forked.\n */\nimport React from 'react';\nimport { Pressable, Switch, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { fieldTestID } from '../constants';\nimport { controlStyles, filterStyles as s } from '../styles';\nimport type { BooleanFilterField } from '../types';\n\nexport interface BooleanFieldProps {\n field: BooleanFilterField;\n barTestID: string;\n value: boolean;\n onChange: (value: boolean) => void;\n}\n\nexport function BooleanField({ field, barTestID, value, onChange }: BooleanFieldProps): React.ReactElement {\n const { theme } = useUi();\n const { colors, palette } = theme;\n const testID = field.testID ?? fieldTestID(barTestID, field.key);\n\n return (\n <View style={s.switchRow} testID={testID}>\n <Text style={[controlStyles.subLabel, { color: colors.text }]}>{field.label}</Text>\n {/* The Pressable is the 44x44 pointer target; the Switch keeps its visual size, its focus and\n its a11y role. `accessible={false}` + `focusable={false}` keep the wrapper out of the\n a11y tree and the tab order, so assistive tech still meets exactly one switch. */}\n <Pressable\n accessible={false}\n focusable={false}\n onPress={() => onChange(!value)}\n style={s.switchHit}\n testID={`${testID}-switch-hit`}\n >\n <Switch\n accessibilityLabel={field.label}\n accessibilityHint={field.accessibilityHint}\n accessibilityRole=\"switch\"\n accessibilityState={{ checked: value }}\n trackColor={{ false: colors.border, true: palette.primary['500'] }}\n thumbColor={colors.surface}\n value={value}\n onValueChange={onChange}\n style={s.switchInert}\n testID={`${testID}-switch`}\n />\n </Pressable>\n </View>\n );\n}\n\nexport default BooleanField;\n","/**\n * DateRangeField — the ADAPTER binding this bar's {@link DateRangeFilterField} schema to\n * `@dloizides/ui-forms`' `DateRangeControl`.\n *\n * The from/to pair (web `type=\"date\"`, one-sided patching) moved to ui-forms in F2. What stays is\n * the schema binding, the derived testID, and the per-field sub-label override — `field.fromLabel`\n * beats the bar's default, which the bar resolved from `FILTERS_I18N.from` / `.to`. Those keys\n * stay owned by this package, so the manifest is untouched.\n */\nimport React from 'react';\n\nimport { DateRangeControl } from '@dloizides/ui-forms';\n\nimport { fieldTestID } from '../constants';\nimport type { DateRangeFilterField, DateRangeValue } from '../types';\n\nexport interface DateRangeFieldProps {\n field: DateRangeFilterField;\n barTestID: string;\n value: DateRangeValue;\n onChange: (value: DateRangeValue) => void;\n onSubmit: () => void;\n fromLabel: string;\n toLabel: string;\n}\n\nexport function DateRangeField({ field, barTestID, value, onChange, onSubmit, fromLabel, toLabel }: DateRangeFieldProps): React.ReactElement {\n return (\n <DateRangeControl\n accessibilityHint={field.accessibilityHint}\n fromLabel={field.fromLabel ?? fromLabel}\n fromPlaceholder={field.fromPlaceholder}\n testID={field.testID ?? fieldTestID(barTestID, field.key)}\n toLabel={field.toLabel ?? toLabel}\n toPlaceholder={field.toPlaceholder}\n value={value}\n onChange={onChange}\n onSubmit={onSubmit}\n />\n );\n}\n\nexport default DateRangeField;\n","/**\n * SelectField — the ADAPTER binding this bar's declarative {@link SelectFilterField} schema to\n * `@dloizides/ui-forms`' `SelectControl`.\n *\n * The control itself (trigger, chevron, anchored menu, dismissal) moved to ui-forms in F2, where\n * every portal can reach it — six of them had reimplemented it because they could not. What stays\n * here is exactly what is FILTER-BAR-shaped and must not migrate:\n *\n * - the schema binding (`field.options` / `field.placeholder` / `field.testID` → plain props);\n * - the derived testID (`${barTestID}-field-${key}`);\n * - the i18n. `ui-forms` never calls `t`, so the trigger's accessible NAME is composed HERE\n * through `useUi().t` against `FILTERS_I18N.selectTriggerLabel`. That keeps the exported\n * FILTERS_I18N manifest — which every portal's guard binds to LIVE — working untouched.\n *\n * Apps that need ui-layout's responsive modal/bottom-sheet select still inject it via\n * `Filters.renderSelect`; `SelectControl` is the dependency-free default.\n */\nimport React from 'react';\n\nimport { useUi } from '@dloizides/ui-feedback';\nimport { SelectControl } from '@dloizides/ui-forms';\n\nimport { accessibleName } from '../../accessibleName';\nimport { FILTERS_I18N, fieldTestID } from '../constants';\nimport type { SelectFilterField } from '../types';\n\nexport interface SelectFieldProps {\n field: SelectFilterField;\n barTestID: string;\n value: string;\n onChange: (value: string) => void;\n /** Pre-localized fallback placeholder when the field supplies none and the value is unset. */\n placeholder: string;\n /** Pre-localized accessibility hint for the trigger + options. */\n dropdownHint: string;\n optionHint: string;\n}\n\nexport function SelectField({ field, barTestID, value, onChange, placeholder, dropdownHint, optionHint }: SelectFieldProps): React.ReactElement {\n const { t } = useUi();\n const testID = field.testID ?? fieldTestID(barTestID, field.key);\n const resolvedPlaceholder = field.placeholder ?? placeholder;\n\n // The label the control will DISPLAY — resolved here too, because the accessible name must\n // carry it. That name REPLACES the trigger's visible text for a screen reader, so labelling\n // it with the field name alone silently hides the current selection.\n const selectedLabel = field.options.find((o) => o.value === value)?.label ?? resolvedPlaceholder;\n\n const triggerLabel = accessibleName(\n t(FILTERS_I18N.selectTriggerLabel, field.label, selectedLabel),\n FILTERS_I18N.selectTriggerLabel,\n field.label,\n );\n\n return (\n <SelectControl\n accessibilityHint={field.accessibilityHint ?? dropdownHint}\n accessibilityLabel={triggerLabel}\n options={field.options}\n optionHint={optionHint}\n placeholder={resolvedPlaceholder}\n testID={testID}\n value={value}\n onChange={onChange}\n />\n );\n}\n\nexport default SelectField;\n","/**\n * TextField — renders both the `text` (free search) and `number` (numeric) field kinds; the\n * only difference is the keyboard. Enter/submit calls the bar's `onSubmit` (Apply) so a\n * keyboard user commits a draft without reaching for the mouse (aml's `onSubmitEditing`).\n *\n * F2 — why this did NOT move to `ui-forms` with its siblings: `ui-forms` already ships TWO text\n * inputs (`ThemedTextInput` and `FormField`). Promoting a third would ADD a duplicate to the very\n * package this campaign is de-duplicating. The right convergence is to render this on\n * `ThemedTextInput`, but that swaps in the focus ring, the hover border and the\n * `surfaceElevated` rest background — a visible change for six live portals, so it belongs in the\n * visual-QA-gated wave, not here. It uses the shared `controlStyles.input` box meanwhile, so\n * there is no forked metric.\n */\nimport React from 'react';\nimport { TextInput } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { fieldTestID } from '../constants';\nimport { controlStyles as s } from '../styles';\nimport type { NumberFilterField, TextFilterField } from '../types';\n\nexport interface TextFieldProps {\n field: TextFilterField | NumberFilterField;\n barTestID: string;\n value: string;\n onChange: (value: string) => void;\n onSubmit: () => void;\n}\n\nexport function TextField({ field, barTestID, value, onChange, onSubmit }: TextFieldProps): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n const isNumber = field.kind === 'number';\n\n return (\n <TextInput\n accessibilityLabel={field.label}\n accessibilityHint={field.accessibilityHint}\n keyboardType={isNumber ? 'numeric' : 'default'}\n placeholder={field.placeholder}\n placeholderTextColor={colors.textSecondary}\n value={value}\n onChangeText={onChange}\n onSubmitEditing={onSubmit}\n style={[s.input, { borderColor: colors.border, backgroundColor: colors.surface, color: colors.text }]}\n testID={`${field.testID ?? fieldTestID(barTestID, field.key)}-input`}\n />\n );\n}\n\nexport default TextField;\n","/**\n * TypeaheadField — the ADAPTER binding this bar's {@link TypeaheadFilterField} schema to\n * `@dloizides/ui-forms`' `TypeaheadControl`.\n *\n * The combobox itself (ranked suggestions, blur-delay, canonical-label fill, error banner) moved\n * to ui-forms in F2. What stays is the schema binding and the derived testID. This field carries\n * NO i18n keys of its own — its strings arrive pre-resolved from the bar — so nothing here\n * touches the FILTERS_I18N manifest.\n */\nimport React from 'react';\n\nimport { TypeaheadControl } from '@dloizides/ui-forms';\n\nimport { DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, fieldTestID } from '../constants';\nimport type { TypeaheadFilterField } from '../types';\n\nexport interface TypeaheadFieldProps {\n field: TypeaheadFilterField;\n barTestID: string;\n value: string;\n onChange: (value: string) => void;\n onSubmit: () => void;\n optionHint: string;\n}\n\nexport function TypeaheadField({ field, barTestID, value, onChange, onSubmit, optionHint }: TypeaheadFieldProps): React.ReactElement {\n return (\n <TypeaheadControl\n accessibilityHint={field.accessibilityHint}\n accessibilityLabel={field.label}\n error={field.error}\n maxSuggestions={field.maxSuggestions ?? DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS}\n minChars={field.minChars ?? DEFAULT_TYPEAHEAD_MIN_CHARS}\n options={field.options}\n optionHint={optionHint}\n placeholder={field.placeholder}\n testID={field.testID ?? fieldTestID(barTestID, field.key)}\n value={value}\n onChange={onChange}\n onSubmit={onSubmit}\n />\n );\n}\n\nexport default TypeaheadField;\n","import { Platform, type ViewStyle } from 'react-native';\n\n/**\n * A filter field's minimum width, never wider than its container.\n *\n * `minWidth` beats `maxWidth` in both CSS and Yoga, so a 260px date-range floor inside a ~330px phone\n * card still overflowed with `maxWidth: '100%'` alone. On web `min(Npx, 100%)` keeps the exact floor\n * at desktop widths (the bar wraps fields at the same breakpoints as before) and yields to the\n * container below it. Native keeps the plain number: Yoga has no `min()`.\n */\nexport function clampedMinWidth(minWidth: number): ViewStyle['minWidth'] {\n if (Platform.OS !== 'web') return minWidth;\n return `min(${minWidth}px, 100%)` as unknown as ViewStyle['minWidth'];\n}\n","/**\n * FilterFieldView — dispatches one {@link FilterField} to its renderer, wired to the value map.\n * Reads the field's typed value out of {@link FilterValues} (coercing a missing/mismatched\n * entry to that kind's empty value) and writes edits back via `setField`. `boolean` renders its\n * own inline switch-row; every other kind is wrapped in `@dloizides/ui-forms`' `Field`.\n *\n * F2: the label wrapper used to be a PRIVATE `FieldShell` fork, which existed only because\n * `Field` hard-coded the 13/600 `field` label voice and offered no way out. `Field` now names\n * both contract voices, so the fork is deleted and the bar asks for `labelVariant=\"control\"`\n * (11/700/uppercase) — the exact metrics `FieldShell` carried. One label implementation, and the\n * label-metric split that caused several defects this campaign is gone.\n */\nimport React from 'react';\n\nimport { Field } from '@dloizides/ui-forms';\n\nimport { BooleanField } from './BooleanField';\nimport { DateRangeField } from './DateRangeField';\nimport { SelectField } from './SelectField';\nimport { TextField } from './TextField';\nimport { TypeaheadField } from './TypeaheadField';\nimport { FIELD_MIN_WIDTH, fieldTestID } from '../constants';\nimport { clampedMinWidth } from '../utils/clampedMinWidth';\nimport { filterStyles as s } from '../styles';\nimport type { DateRangeValue, FilterField, FilterValue, FilterValues, SelectFilterField } from '../types';\n\nconst EMPTY_RANGE: DateRangeValue = { from: '', to: '' };\nconst GROW_FLEX = 1;\n\n/** Resolved, pre-localized strings the bar passes down to every field. */\nexport interface FieldStrings {\n selectPlaceholder: string;\n dropdownHint: string;\n optionHint: string;\n fromLabel: string;\n toLabel: string;\n}\n\n/**\n * Args for a custom select renderer — the injection point apps use to swap the built-in\n * in-tree dropdown for `@dloizides/ui-layout`'s responsive ModalDropdown (modal on mobile /\n * native, inline menu on desktop). The label wrapper is still supplied by the bar.\n */\nexport interface RenderSelectArgs {\n field: SelectFilterField;\n value: string;\n onChange: (value: string) => void;\n /** The field's canonical testID (`${barTestID}-field-${key}` unless overridden). */\n testID: string;\n}\n\nexport interface FilterFieldViewProps {\n field: FilterField;\n barTestID: string;\n values: FilterValues;\n setField: (key: string, value: FilterValue) => void;\n onSubmit: () => void;\n strings: FieldStrings;\n /** Optional custom select renderer (e.g. inject ui-layout's ModalDropdown). */\n renderSelect?: (args: RenderSelectArgs) => React.ReactNode;\n}\n\nfunction asString(value: FilterValue | undefined): string {\n return typeof value === 'string' ? value : '';\n}\nfunction asBool(value: FilterValue | undefined): boolean {\n return value === true;\n}\nfunction asRange(value: FilterValue | undefined): DateRangeValue {\n if (typeof value === 'object' && value !== null && 'from' in value && 'to' in value) return value;\n return EMPTY_RANGE;\n}\n\nexport function FilterFieldView({ field, barTestID, values, setField, onSubmit, strings, renderSelect }: FilterFieldViewProps): React.ReactElement {\n const raw = values[field.key];\n\n if (field.kind === 'boolean') {\n return <BooleanField field={field} barTestID={barTestID} value={asBool(raw)} onChange={(v) => setField(field.key, v)} />;\n }\n\n const body = ((): React.ReactNode => {\n switch (field.kind) {\n case 'select':\n if (renderSelect !== undefined) {\n return renderSelect({\n field,\n value: asString(raw),\n onChange: (v) => setField(field.key, v),\n testID: field.testID ?? fieldTestID(barTestID, field.key),\n });\n }\n return (\n <SelectField\n field={field}\n barTestID={barTestID}\n value={asString(raw)}\n onChange={(v) => setField(field.key, v)}\n placeholder={strings.selectPlaceholder}\n dropdownHint={strings.dropdownHint}\n optionHint={strings.optionHint}\n />\n );\n case 'typeahead':\n return (\n <TypeaheadField\n field={field}\n barTestID={barTestID}\n value={asString(raw)}\n onChange={(v) => setField(field.key, v)}\n onSubmit={onSubmit}\n optionHint={strings.optionHint}\n />\n );\n case 'dateRange':\n return (\n <DateRangeField\n field={field}\n barTestID={barTestID}\n value={asRange(raw)}\n onChange={(v) => setField(field.key, v)}\n onSubmit={onSubmit}\n fromLabel={strings.fromLabel}\n toLabel={strings.toLabel}\n />\n );\n default:\n return (\n <TextField\n field={field}\n barTestID={barTestID}\n value={asString(raw)}\n onChange={(v) => setField(field.key, v)}\n onSubmit={onSubmit}\n />\n );\n }\n })();\n\n // The per-field width/grow reflow rules (fields wrap to new lines as the bar narrows) and the\n // caller's own override, applied LAST. `s.fieldInBar` zeroes `Field`'s 16px form rhythm — see\n // its comment; inheriting it would add a phantom gap under every field in six live portals.\n const minWidth = field.minWidth ?? FIELD_MIN_WIDTH[field.kind];\n const grow = field.grow === true ? { flexGrow: GROW_FLEX } : null;\n\n return (\n <Field\n containerStyle={[s.fieldInBar, { minWidth: clampedMinWidth(minWidth), maxWidth: '100%' as const }, grow, field.style]}\n label={field.label}\n labelVariant=\"control\"\n testID={field.testID ?? fieldTestID(barTestID, field.key)}\n >\n {body}\n </Field>\n );\n}\n\nexport default FilterFieldView;\n","/**\n * Filters — the declarative, configurable filter bar every portal shares. A caller passes a\n * `fields` schema + a `values` map + `onChange`; the bar renders the same structure + behaviour\n * everywhere, themed per app. It builds ON the existing {@link FilterBar} shell (so its live\n * results count + WCAG live region + actions slot are reused unchanged).\n *\n * Two value models, selected by whether `onApply` is passed:\n * - LIVE (no `onApply`): each edit calls `onChange` immediately (agora, zygos). No Apply button.\n * - DRAFT/APPLY (`onApply` set): edits accumulate in the caller's draft (see {@link useFilterDraft});\n * an Apply button + Enter-in-a-field commit it (aml, kefi audit). Pass `onClear` for a Reset.\n *\n * Contract discipline: every user-facing string is a pre-localized value — supplied per-field, via\n * the `*Label`/`*Placeholder` props, or resolved through the UiProvider `t` (which defaults to the\n * i18n KEY, never a hardcoded literal). No FM/router/store; customisation is style + slots only.\n */\nimport React, { useCallback, useMemo } from 'react';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { FilterBar, type FilterBarStyleOverrides } from '../DataTable/FilterBar';\nimport { ActionButton } from './components/ActionButton';\nimport { FILTERS_I18N, FILTERS_TEST_ID, applyTestID, clearTestID } from './constants';\nimport { FilterFieldView, type FieldStrings, type RenderSelectArgs } from './fields/FilterFieldView';\nimport type { FilterField, FilterValue, FilterValues } from './types';\n\nexport interface FiltersProps {\n /** The declarative field schema — the SUPERSET of every portal's filters, as data. */\n fields: readonly FilterField[];\n /** The current value map (applied values in live mode, or the draft in draft/apply mode). */\n values: FilterValues;\n /** Called with the next full value map on every edit. */\n onChange: (next: FilterValues) => void;\n /** Live results count shown by the FilterBar (WCAG live region). Omit to hide. */\n resultsCount?: number;\n /** Pre-localized noun for the count (already singularised by the caller if needed). */\n resultsLabel?: string;\n /** When set, shows an Apply button + commits on Enter — the draft/apply model. Omit for live. */\n onApply?: () => void;\n /** Pre-localized Apply label / hint (default via UiProvider `t`). */\n applyLabel?: string;\n applyHint?: string;\n /** Disable Apply (e.g. while busy or when a date field is invalid — aml's gate). */\n applyDisabled?: boolean;\n /** When set, shows a Clear/Reset button. */\n onClear?: () => void;\n clearLabel?: string;\n clearHint?: string;\n /** Extra actions (Export CSV/PDF, bulk bar) rendered BEFORE the built-in Apply/Clear. */\n actions?: React.ReactNode;\n /** Pre-localized fallback placeholder for an unset select (default via `t`). */\n selectPlaceholder?: string;\n /** Pre-localized default sub-labels for date-range fields (default via `t`). */\n fromLabel?: string;\n toLabel?: string;\n /**\n * Optional custom renderer for `select` fields — the injection point for\n * `@dloizides/ui-layout`'s responsive `ModalDropdown` (or any other select). When omitted, the\n * dependency-free in-tree dropdown is used. The label wrapper stays supplied by the bar.\n */\n renderSelect?: (args: RenderSelectArgs) => React.ReactNode;\n /** FilterBar per-slot style overrides — merged LAST, so a consumer always wins. */\n styleOverrides?: FilterBarStyleOverrides;\n testID?: string;\n}\n\nexport function Filters({\n fields,\n values,\n onChange,\n resultsCount,\n resultsLabel,\n onApply,\n applyLabel,\n applyHint,\n applyDisabled = false,\n onClear,\n clearLabel,\n clearHint,\n actions,\n selectPlaceholder,\n fromLabel,\n toLabel,\n renderSelect,\n styleOverrides,\n testID = FILTERS_TEST_ID,\n}: FiltersProps): React.ReactElement {\n const { t } = useUi();\n\n const setField = useCallback(\n (key: string, value: FilterValue) => {\n onChange({ ...values, [key]: value });\n },\n [onChange, values],\n );\n\n // Enter in a text/number/date/typeahead field commits the draft (draft/apply); no-op when live.\n const onSubmit = useCallback(() => {\n if (onApply !== undefined && !applyDisabled) onApply();\n }, [onApply, applyDisabled]);\n\n const strings = useMemo<FieldStrings>(\n () => ({\n selectPlaceholder: selectPlaceholder ?? t(FILTERS_I18N.selectPlaceholder),\n dropdownHint: t(FILTERS_I18N.dropdownHint),\n optionHint: t(FILTERS_I18N.optionHint),\n fromLabel: fromLabel ?? t(FILTERS_I18N.from),\n toLabel: toLabel ?? t(FILTERS_I18N.to),\n }),\n [selectPlaceholder, fromLabel, toLabel, t],\n );\n\n const barActions = (\n <>\n {actions}\n {onClear !== undefined && (\n <ActionButton\n label={clearLabel ?? t(FILTERS_I18N.clear)}\n hint={clearHint ?? t(FILTERS_I18N.clearHint)}\n tone=\"ghost\"\n onPress={onClear}\n testID={clearTestID(testID)}\n />\n )}\n {onApply !== undefined && (\n <ActionButton\n label={applyLabel ?? t(FILTERS_I18N.apply)}\n hint={applyHint ?? t(FILTERS_I18N.applyHint)}\n tone=\"primary\"\n disabled={applyDisabled}\n onPress={onApply}\n testID={applyTestID(testID)}\n />\n )}\n </>\n );\n\n const hasActions = actions !== undefined || onClear !== undefined || onApply !== undefined;\n\n return (\n <FilterBar\n resultsCount={resultsCount}\n resultsLabel={resultsLabel}\n actions={hasActions ? barActions : undefined}\n styleOverrides={styleOverrides}\n testID={testID}\n >\n {fields.map((field) => (\n <FilterFieldView\n key={field.key}\n field={field}\n barTestID={testID}\n values={values}\n setField={setField}\n onSubmit={onSubmit}\n strings={strings}\n renderSelect={renderSelect}\n />\n ))}\n </FilterBar>\n );\n}\n\nexport default Filters;\n","/**\n * useFilterDraft — the draft-vs-applied state model harvested from aml-v2 (cases/leaders/peps)\n * and kefi's audit log: the bar edits a `draft`; nothing hits the query until `apply` commits it\n * to `committed`. `reset` returns both to the initial value. This is the reusable state engine\n * behind `Filters` in `mode=\"apply\"`; a screen can also drive it directly.\n *\n * The page-reset-to-1 invariant (universal across every portal's query hook — any narrowing or\n * reorder returns to page 1) is surfaced as `onApply`/`onReset` callbacks the caller wires to its\n * `setPage(1)`, so this hook stays free of any pagination coupling.\n */\nimport { useCallback, useMemo, useState } from 'react';\n\nimport type { FilterValue, FilterValues } from '../types';\n\nexport interface UseFilterDraftOptions<V extends FilterValues> {\n /** The initial (and reset target) value — the \"all filters cleared\" state. */\n initial: V;\n /** Fired when a draft is committed. Wire your `setPage(1)` + query refresh here. */\n onApply?: (committed: V) => void;\n /** Fired when the draft + committed are reset to `initial` (e.g. clear an inline error). */\n onReset?: () => void;\n}\n\nexport interface FilterDraft<V extends FilterValues> {\n /** The live, uncommitted value the bar edits. */\n draft: V;\n /** The committed value the query reads. */\n committed: V;\n /** Patch one field of the draft (merge, like aml's per-bar `set`). */\n setField: (key: string, value: FilterValue) => void;\n /** Replace the whole draft (the bar's `onChange`). */\n setDraft: (next: V) => void;\n /** Commit the draft → committed and fire `onApply`. */\n apply: () => void;\n /** Reset draft + committed to `initial` and fire `onReset`. */\n reset: () => void;\n /** True when the draft differs from the committed value (an Apply would change the result). */\n dirty: boolean;\n}\n\nfunction shallowEqual(a: FilterValues, b: FilterValues): boolean {\n return JSON.stringify(a) === JSON.stringify(b);\n}\n\nexport function useFilterDraft<V extends FilterValues>({ initial, onApply, onReset }: UseFilterDraftOptions<V>): FilterDraft<V> {\n const [draft, setDraft] = useState<V>(initial);\n const [committed, setCommitted] = useState<V>(initial);\n\n const setField = useCallback((key: string, value: FilterValue) => {\n setDraft((prev) => ({ ...prev, [key]: value }));\n }, []);\n\n const apply = useCallback(() => {\n setCommitted(draft);\n onApply?.(draft);\n }, [draft, onApply]);\n\n const reset = useCallback(() => {\n setDraft(initial);\n setCommitted(initial);\n onReset?.();\n }, [initial, onReset]);\n\n const dirty = useMemo(() => !shallowEqual(draft, committed), [draft, committed]);\n\n return { draft, committed, setField, setDraft, apply, reset, dirty };\n}\n\nexport default useFilterDraft;\n","/**\n * `usePagedRows` — client-side pagination state for an already-materialised array.\n *\n * WHY A HOOK AND NOT A COMPONENT: this logic was promoted from the byte-identical\n * `PaginatedList` twins in erevna-web and katalogos-web. That component hard-bound\n * three things a shared package must not own — a `FlatList`, an app-specific\n * `EmptyListState`, and an app-specific `LoadingFallback`. Only the *paging maths*\n * is genuinely shared, so only the paging maths moved. Callers keep their own list\n * renderer, empty state, and loading state.\n *\n * For server-side paging use `DataTable`'s pager instead — this hook assumes every\n * row is already in memory.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\n/** Rows to show per page when the caller does not specify. */\nexport const DEFAULT_PAGE_SIZE = 10;\n\nexport interface UsePagedRowsOptions {\n /** Rows per page. Values < 1 are treated as 1 — a 0 page size would divide by zero. */\n pageSize?: number;\n}\n\nexport interface PagedRows<T> {\n /** The slice of `rows` belonging to the current page. */\n pageRows: T[];\n /** Zero-based index of the current page. */\n currentPage: number;\n /** Total number of pages; 0 when there are no rows. */\n totalPages: number;\n /** Jump to a page. Out-of-range values are clamped into `[0, totalPages - 1]`. */\n setPage: (page: number) => void;\n /** Whether a pager is worth rendering at all (more than one page exists). */\n hasPages: boolean;\n /** Effective page size after the `< 1` guard. */\n pageSize: number;\n}\n\n/**\n * Slice `rows` into pages and track the current one.\n *\n * The current page is kept valid as `rows` changes: if rows are removed while the\n * user is on the last page, the page index clamps down rather than leaving the\n * caller rendering an empty slice of a non-empty list.\n */\nexport function usePagedRows<T>(rows: readonly T[], options: UsePagedRowsOptions = {}): PagedRows<T> {\n const pageSize = Math.max(1, options.pageSize ?? DEFAULT_PAGE_SIZE);\n const [currentPage, setCurrentPage] = useState(0);\n\n const totalPages = Math.ceil(rows.length / pageSize);\n\n /**\n * Keep `currentPage` in range when `rows` shrinks.\n *\n * The app-side original only clamped when `totalPages > 0`, so emptying the list\n * entirely left a stale non-zero page index behind; the next non-empty render\n * then started on the wrong page. Clamping to 0 in that case fixes it.\n */\n useEffect(() => {\n const lastValidPage = totalPages > 0 ? totalPages - 1 : 0;\n if (currentPage > lastValidPage) setCurrentPage(lastValidPage);\n }, [currentPage, totalPages]);\n\n const pageRows = useMemo(() => {\n const start = currentPage * pageSize;\n return rows.slice(start, start + pageSize);\n }, [rows, currentPage, pageSize]);\n\n const setPage = useCallback(\n (page: number) => {\n const lastValidPage = totalPages > 0 ? totalPages - 1 : 0;\n const clamped = Math.min(Math.max(0, page), lastValidPage);\n setCurrentPage(clamped);\n },\n [totalPages],\n );\n\n return {\n pageRows: pageRows as T[],\n currentPage,\n totalPages,\n setPage,\n hasPages: totalPages > 1,\n pageSize,\n };\n}\n","/** Visual tone a status maps to; drives colour, glyph and \"needs a look\" ordering. */\nexport const enum StatusTone {\n Bad = 'bad',\n Warn = 'warn',\n Active = 'active',\n Good = 'good',\n Neutral = 'neutral',\n}\n","import { StatusTone } from './StatusTone';\n\nexport const STATUS_LEDGER_TEST_ID = 'ui-status-ledger';\nexport const STATUS_COLUMN_KEY = 'status';\nexport const ACTIONS_COLUMN_KEY = 'actions';\nexport const ALL_VALUE = '';\nexport const STATUS_MIN_WIDTH = 120;\nexport const ACTIONS_MIN_WIDTH = 136;\n\nexport const TONE_RANK: Readonly<Record<StatusTone, number>> = {\n [StatusTone.Bad]: 0,\n [StatusTone.Warn]: 1,\n [StatusTone.Active]: 2,\n [StatusTone.Neutral]: 3,\n [StatusTone.Good]: 4,\n};\n\nexport const TONE_GLYPH: Readonly<Record<StatusTone, string>> = {\n [StatusTone.Bad]: '✕',\n [StatusTone.Warn]: '!',\n [StatusTone.Active]: '▸',\n [StatusTone.Neutral]: '–',\n [StatusTone.Good]: '✓',\n};\n\nexport const ledgerSectionTestID = (testID: string, section: string): string => `${testID}-section-${section}`;\nexport const ledgerSortDirectionTestID = (testID: string): string => `${testID}-sort-direction`;\n","import React from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { TONE_GLYPH } from '../constants';\nimport type { StatusTone } from '../StatusTone';\n\nconst PILL_RADIUS = 999;\nconst PILL_BORDER = 1;\nconst PILL_PAD_H = 8;\nconst PILL_PAD_V = 2;\nconst PILL_GAP = 6;\nconst PILL_FONT = 13;\nconst PILL_WEIGHT = '600' as const;\n\nconst styles = StyleSheet.create({\n pill: {\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: 'flex-start',\n gap: PILL_GAP,\n borderWidth: PILL_BORDER,\n borderRadius: PILL_RADIUS,\n paddingHorizontal: PILL_PAD_H,\n paddingVertical: PILL_PAD_V,\n },\n text: { fontSize: PILL_FONT, fontWeight: PILL_WEIGHT },\n});\n\nexport interface StatusPillProps {\n label: string;\n tone: StatusTone;\n color: string;\n testID?: string;\n}\n\n/** A status label with a tone glyph, so the tone never relies on colour alone. */\nexport function StatusPill({ label, tone, color, testID }: StatusPillProps): React.ReactElement {\n return (\n <View accessibilityLabel={label} accessibilityRole=\"text\" style={[styles.pill, { borderColor: color }]} testID={testID}>\n <Text aria-hidden style={[styles.text, { color }]}>\n {TONE_GLYPH[tone]}\n </Text>\n <Text style={[styles.text, { color }]}>{label}</Text>\n </View>\n );\n}\n","/** Sort direction of a ledger column. */\nexport const enum SortDirection {\n Asc = 'asc',\n Desc = 'desc',\n}\n","import { ALL_VALUE, TONE_RANK } from '../constants';\nimport { SortDirection } from '../SortDirection';\nimport { StatusTone } from '../StatusTone';\nimport type { LedgerAccessors, LedgerFilter, SortValue } from '../types';\n\nconst BEFORE = -1;\nconst AFTER = 1;\nconst SAME = 0;\n\nconst isMissing = (value: SortValue): value is null | undefined | '' =>\n value === null || value === undefined || value === '';\n\nconst compareValues = (a: string | number, b: string | number): number => {\n if (typeof a === 'number' && typeof b === 'number') return a - b;\n return String(a).localeCompare(String(b), undefined, { numeric: true, sensitivity: 'base' });\n};\n\n/** Keeps rows matching the status, group and free-text filter; an empty value matches all. */\nexport function filterLedgerRows<T>(rows: readonly T[], filter: LedgerFilter, accessors: LedgerAccessors<T>): T[] {\n const needle = filter.text.trim().toLocaleLowerCase();\n return rows.filter((row) => {\n const statusOk = filter.status === ALL_VALUE || accessors.getStatus(row) === filter.status;\n const groupOk = filter.group === ALL_VALUE || accessors.getGroup?.(row) === filter.group;\n const haystack = accessors.getSearchText?.(row) ?? '';\n const textOk = needle === '' || haystack.toLocaleLowerCase().includes(needle);\n return statusOk && groupOk && textOk;\n });\n}\n\n/** Stable sort by `sortValue`; missing values always sort last, whatever the direction. */\nexport function sortLedgerRows<T>(rows: readonly T[], sortValue: (row: T) => SortValue, direction: SortDirection): T[] {\n const sign = direction === SortDirection.Asc ? AFTER : BEFORE;\n return [...rows].sort((left, right) => {\n const a = sortValue(left);\n const b = sortValue(right);\n if (isMissing(a) && isMissing(b)) return SAME;\n if (isMissing(a)) return AFTER;\n if (isMissing(b)) return BEFORE;\n return sign * compareValues(a, b);\n });\n}\n\nexport const toneRank = (tone: StatusTone): number => TONE_RANK[tone];\n\nexport const isAttentionTone = (tone: StatusTone): boolean => tone === StatusTone.Bad || tone === StatusTone.Warn;\n\n/** Splits rows into \"needs a look\" (worst tone first, input order kept within a tone) and the rest. */\nexport function splitNeedsLook<T>(\n rows: readonly T[],\n needsLook: (row: T) => boolean,\n toneOf: (row: T) => StatusTone,\n): { attention: T[]; rest: T[] } {\n const attention = rows.filter(needsLook);\n const rest = rows.filter((row) => !needsLook(row));\n return { attention: sortLedgerRows(attention, (row) => toneRank(toneOf(row)), SortDirection.Asc), rest };\n}\n\n/** Distinct non-empty values in first-seen order. */\nexport function distinctValues<T>(rows: readonly T[], pick: (row: T) => string | undefined): string[] {\n const seen = new Set<string>();\n rows.forEach((row) => {\n const value = pick(row);\n if (value !== undefined && value !== '') seen.add(value);\n });\n return [...seen];\n}\n","import { useCallback, useMemo, useState } from 'react';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport type { DataTableColumn } from '../../DataTable/types';\nimport type { FilterField, FilterValues } from '../../Filters/types';\nimport { StatusPill } from '../components/StatusPill';\nimport { ACTIONS_COLUMN_KEY, ACTIONS_MIN_WIDTH, ALL_VALUE, STATUS_COLUMN_KEY, STATUS_MIN_WIDTH } from '../constants';\nimport { LedgerFilterKey } from '../LedgerFilterKey';\nimport { SortDirection } from '../SortDirection';\nimport { StatusTone } from '../StatusTone';\nimport type { SortValue, StatusLedgerProps } from '../types';\nimport { distinctValues, filterLedgerRows, isAttentionTone, sortLedgerRows, splitNeedsLook, toneRank } from '../utils/ledgerLogic';\n\nconst readText = (values: FilterValues, key: LedgerFilterKey): string => {\n const value = values[key];\n return typeof value === 'string' ? value : ALL_VALUE;\n};\n\nfunction useToneColor(toneColors: StatusLedgerProps<unknown>['toneColors']): (tone: StatusTone) => string {\n const { theme } = useUi();\n return useCallback(\n (tone: StatusTone) => {\n const override = toneColors?.[tone];\n if (override !== undefined) return override;\n if (tone === StatusTone.Bad) return theme.semantic.error['500'];\n if (tone === StatusTone.Active) return theme.palette.primary['500'];\n return tone === StatusTone.Good ? theme.colors.textSecondary : theme.colors.text;\n },\n [toneColors, theme],\n );\n}\n\n/** Filter, sort and column state behind `StatusLedger`. */\nexport function useLedgerView<T>(props: StatusLedgerProps<T>) {\n const { rows, columns, getStatus, statusLabel, statusTone, labels, getGroup, groupLabel, getSearchText, needsLook, renderActions, toneColors } = props;\n const [values, setValues] = useState<FilterValues>({});\n const [direction, setDirection] = useState<SortDirection>(SortDirection.Asc);\n const toneColor = useToneColor(toneColors);\n const toneOf = useCallback((row: T) => statusTone(getStatus(row)), [statusTone, getStatus]);\n\n const allColumns = useMemo(() => {\n const status = {\n key: STATUS_COLUMN_KEY,\n header: labels.status,\n minWidth: STATUS_MIN_WIDTH,\n sortValue: (row: T): SortValue => toneRank(toneOf(row)),\n render: (row: T) => <StatusPill color={toneColor(toneOf(row))} label={statusLabel(getStatus(row))} tone={toneOf(row)} />,\n };\n const actions = renderActions === undefined ? [] : [{ key: ACTIONS_COLUMN_KEY, header: labels.actions, minWidth: ACTIONS_MIN_WIDTH, render: renderActions }];\n return [columns[0], status, ...columns.slice(1), ...actions].filter((c) => c !== undefined);\n }, [columns, labels, toneOf, toneColor, statusLabel, getStatus, renderActions]);\n\n const fields = useMemo<FilterField[]>(() => {\n const all = { value: ALL_VALUE, label: labels.all };\n const statuses = distinctValues(rows, getStatus).map((s) => ({ value: s, label: statusLabel(s) }));\n const groups = getGroup === undefined ? [] : distinctValues(rows, getGroup).map((g) => ({ value: g, label: groupLabel?.(g) ?? g }));\n const sortable = allColumns.filter((c) => 'sortValue' in c && c.sortValue !== undefined).map((c) => ({ value: c.key, label: c.header }));\n const groupField: FilterField[] = groups.length === 0 ? [] : [{ kind: 'select', key: LedgerFilterKey.Group, label: labels.group, options: [all, ...groups] }];\n return [\n { kind: 'text', key: LedgerFilterKey.Search, label: labels.search, grow: true },\n { kind: 'select', key: LedgerFilterKey.Status, label: labels.status, options: [all, ...statuses] },\n ...groupField,\n { kind: 'select', key: LedgerFilterKey.Sort, label: labels.sortBy, options: sortable },\n ];\n }, [rows, getStatus, statusLabel, getGroup, groupLabel, labels, allColumns]);\n\n const visible = useMemo(() => {\n const filter = { status: readText(values, LedgerFilterKey.Status), group: readText(values, LedgerFilterKey.Group), text: readText(values, LedgerFilterKey.Search) };\n const filtered = filterLedgerRows(rows, filter, { getStatus, getGroup, getSearchText });\n const sortColumn = allColumns.find((c) => c.key === readText(values, LedgerFilterKey.Sort)) as { sortValue?: (row: T) => SortValue } | undefined;\n return sortColumn?.sortValue === undefined ? filtered : sortLedgerRows(filtered, sortColumn.sortValue, direction);\n }, [rows, values, getStatus, getGroup, getSearchText, allColumns, direction]);\n\n const split = useMemo(() => splitNeedsLook(visible, needsLook ?? ((row: T) => isAttentionTone(toneOf(row))), toneOf), [visible, needsLook, toneOf]);\n const toggleDirection = useCallback(() => setDirection((d) => (d === SortDirection.Asc ? SortDirection.Desc : SortDirection.Asc)), []);\n const clear = useCallback(() => setValues({}), []);\n const tableColumns: ReadonlyArray<DataTableColumn<T>> = allColumns;\n\n return { values, setValues, direction, toggleDirection, clear, fields, visible, split, tableColumns };\n}\n","/** Ledger layout: `Auto` picks `Table` at or above the breakpoint and `Feed` below it. */\nexport const enum LedgerLayout {\n Auto = 'auto',\n Table = 'table',\n Feed = 'feed',\n}\n","import React from 'react';\nimport { StyleSheet, Text, View, useWindowDimensions } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { CARD_STACK_BREAKPOINT } from '../DataTable/constants';\nimport { DataTable } from '../DataTable/DataTable';\nimport type { DataTableColumn } from '../DataTable/types';\nimport { ActionButton } from '../Filters/components/ActionButton';\nimport { Filters } from '../Filters/Filters';\nimport { ledgerSectionTestID, ledgerSortDirectionTestID, STATUS_LEDGER_TEST_ID } from './constants';\nimport { useLedgerView } from './hooks/useLedgerView';\nimport { LedgerLayout } from './LedgerLayout';\nimport { SortDirection } from './SortDirection';\nimport type { StatusLedgerProps } from './types';\n\nconst GAP = 12;\nconst HEADING_FONT = 15;\nconst HEADING_WEIGHT = '700' as const;\n\nconst expandedKeys = (key: string | null | undefined): readonly string[] | undefined => (key === null || key === undefined ? undefined : [key]);\n\nconst styles = StyleSheet.create({\n root: { gap: GAP },\n heading: { fontSize: HEADING_FONT, fontWeight: HEADING_WEIGHT },\n note: { paddingVertical: GAP },\n});\n\ninterface SectionProps<T> {\n title: string;\n rows: readonly T[];\n columns: ReadonlyArray<DataTableColumn<T>>;\n emptyLabel: string;\n testID: string;\n ledger: StatusLedgerProps<T>;\n}\n\nfunction LedgerSection<T>({ title, rows, columns, emptyLabel, testID, ledger }: SectionProps<T>): React.ReactElement {\n const { theme } = useUi();\n return (\n <View style={styles.root} testID={testID}>\n <Text accessibilityRole=\"header\" style={[styles.heading, { color: theme.colors.text }]}>{`${title} · ${rows.length}`}</Text>\n {rows.length === 0 ? (\n <Text style={[styles.note, { color: theme.colors.textSecondary }]}>{emptyLabel}</Text>\n ) : (\n <DataTable\n columns={columns}\n expandedRowKeys={expandedKeys(ledger.expandedRowKey)}\n getRowAccessibilityLabel={ledger.getRowAccessibilityLabel}\n getRowDetailAccessibilityLabel={ledger.getRowAccessibilityLabel}\n keyExtractor={ledger.keyExtractor}\n onRowPress={ledger.onRowPress}\n renderRowDetail={ledger.renderRowDetail}\n rows={rows}\n stackBreakpoint={ledger.breakpoint ?? CARD_STACK_BREAKPOINT}\n testID={`${testID}-table`}\n />\n )}\n </View>\n );\n}\n\n/** Status-first ledger: one sortable, filterable table on wide screens, \"needs a look first\" on narrow ones. */\nexport function StatusLedger<T>(props: StatusLedgerProps<T>): React.ReactElement {\n const { labels, layout = LedgerLayout.Auto, breakpoint = CARD_STACK_BREAKPOINT, loading, testID = STATUS_LEDGER_TEST_ID } = props;\n const { width } = useWindowDimensions();\n const view = useLedgerView(props);\n const feed = layout === LedgerLayout.Feed || (layout === LedgerLayout.Auto && width < breakpoint);\n const ascending = view.direction === SortDirection.Asc;\n\n const directionButton = (\n <ActionButton\n hint={labels.sortDirectionHint}\n label={ascending ? labels.sortAscending : labels.sortDescending}\n onPress={view.toggleDirection}\n testID={ledgerSortDirectionTestID(testID)}\n tone=\"ghost\"\n />\n );\n\n return (\n <View style={styles.root} testID={testID}>\n <Filters\n actions={directionButton}\n clearHint={labels.clearHint}\n clearLabel={labels.clear}\n fields={view.fields}\n onChange={view.setValues}\n onClear={view.clear}\n resultsCount={view.visible.length}\n resultsLabel={labels.results}\n testID={`${testID}-filters`}\n values={view.values}\n />\n {feed && !loading ? (\n <>\n <LedgerSection columns={view.tableColumns} emptyLabel={labels.allClear} ledger={props} rows={view.split.attention} testID={ledgerSectionTestID(testID, 'attention')} title={labels.needsLook} />\n <LedgerSection columns={view.tableColumns} emptyLabel={labels.empty} ledger={props} rows={view.split.rest} testID={ledgerSectionTestID(testID, 'rest')} title={labels.everythingElse} />\n </>\n ) : (\n <DataTable\n columns={view.tableColumns}\n emptyLabel={labels.empty}\n expandedRowKeys={expandedKeys(props.expandedRowKey)}\n getRowAccessibilityLabel={props.getRowAccessibilityLabel}\n getRowDetailAccessibilityLabel={props.getRowAccessibilityLabel}\n keyExtractor={props.keyExtractor}\n loading={loading}\n onRowPress={props.onRowPress}\n renderRowDetail={props.renderRowDetail}\n rows={view.visible}\n stackBreakpoint={feed ? breakpoint : 0}\n testID={`${testID}-table`}\n />\n )}\n </View>\n );\n}\n","const MS_PER_SECOND = 1000;\nconst SECONDS_PER_MINUTE = 60;\nconst MINUTES_PER_HOUR = 60;\nconst HOURS_PER_DAY = 24;\nconst MS_PER_MINUTE = MS_PER_SECOND * SECONDS_PER_MINUTE;\nconst MS_PER_HOUR = MS_PER_MINUTE * MINUTES_PER_HOUR;\nconst MS_PER_DAY = MS_PER_HOUR * HOURS_PER_DAY;\nconst COUNT_TOKEN = /\\{\\{n\\}\\}/g;\n\nexport type TimeInput = string | number | Date | null | undefined;\n\nexport interface RelativeUnitStrings {\n minutes: string;\n hours: string;\n days: string;\n}\n\n/** Caller-translated templates; `{{n}}` is replaced by the count, e.g. \"{{n}} min ago\". */\nexport interface RelativeTimeStrings extends RelativeUnitStrings {\n justNow: string;\n never: string;\n future?: RelativeUnitStrings;\n}\n\n/** Parses a time input to epoch ms; `null` when absent or unparseable. */\nexport function toEpochMs(value: TimeInput): number | null {\n if (value === null || value === undefined || value === '') return null;\n const ms = value instanceof Date ? value.getTime() : typeof value === 'number' ? value : Date.parse(value);\n return Number.isFinite(ms) ? ms : null;\n}\n\nconst fill = (template: string, count: number): string => template.replace(COUNT_TOKEN, String(count));\n\n/** One relative-time format for every ledger: just now, then minutes, hours, days. */\nexport function formatRelativeTime(value: TimeInput, nowMs: number, strings: RelativeTimeStrings): string {\n const ms = toEpochMs(value);\n if (ms === null) return strings.never;\n const delta = nowMs - ms;\n const units: RelativeUnitStrings = delta < 0 && strings.future !== undefined ? strings.future : strings;\n const distance = Math.abs(delta);\n if (distance < MS_PER_MINUTE) return strings.justNow;\n if (distance < MS_PER_HOUR) return fill(units.minutes, Math.floor(distance / MS_PER_MINUTE));\n if (distance < MS_PER_DAY) return fill(units.hours, Math.floor(distance / MS_PER_HOUR));\n return fill(units.days, Math.floor(distance / MS_PER_DAY));\n}\n","import React, { useState } from 'react';\nimport { Pressable, StyleSheet, Text } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { useRowPress } from '../../DataTable/rowPressContext';\nimport { MIN_TARGET_PX } from '../../minTarget';\nimport { formatRelativeTime, toEpochMs, type RelativeTimeStrings, type TimeInput } from '../utils/relativeTime';\n\nconst styles = StyleSheet.create({\n target: { minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, justifyContent: 'center' },\n});\n\nconst defaultAbsolute = (ms: number): string => new Date(ms).toLocaleString();\n\nexport interface RelativeTimeProps {\n value: TimeInput;\n nowMs: number;\n strings: RelativeTimeStrings;\n hint: string;\n formatAbsolute?: (epochMs: number) => string;\n testID?: string;\n}\n\n/** Shows \"5 min ago\"; a tap or click swaps to the absolute time, which is also the accessible name. */\nexport function RelativeTime({ value, nowMs, strings, hint, formatAbsolute = defaultAbsolute, testID }: RelativeTimeProps): React.ReactElement {\n const { theme } = useUi();\n const [showAbsolute, setShowAbsolute] = useState(false);\n const pressRow = useRowPress();\n const ms = toEpochMs(value);\n const relative = formatRelativeTime(value, nowMs, strings);\n const absolute = ms === null ? relative : formatAbsolute(ms);\n\n return (\n <Pressable\n accessibilityHint={hint}\n accessibilityLabel={absolute}\n accessibilityRole=\"button\"\n disabled={ms === null}\n onPress={() => {\n setShowAbsolute((current) => !current);\n pressRow?.();\n }}\n style={styles.target}\n testID={testID}\n >\n <Text style={{ color: theme.colors.text }}>{showAbsolute ? absolute : relative}</Text>\n </Pressable>\n );\n}\n","export const enum MonthGridColumns {\n Twelve = 12,\n Six = 6,\n Four = 4,\n}\n","import { MIN_TARGET_PX } from '../minTarget';\nimport { MonthGridColumns } from './MonthGridColumns';\n\nconst COLUMN_OPTIONS = [MonthGridColumns.Twelve, MonthGridColumns.Six, MonthGridColumns.Four];\n\n/** The widest allowed column count, up to `requested`, whose cells stay at least 44 px wide. */\nexport function fitMonthGridColumns(requested: MonthGridColumns, width: number, gap: number): MonthGridColumns {\n const fits = (columns: MonthGridColumns): boolean => (width - gap * (columns - 1)) / columns >= MIN_TARGET_PX;\n return COLUMN_OPTIONS.find((columns) => columns <= requested && fits(columns)) ?? MonthGridColumns.Four;\n}\n\n/** Splits cells into rows of `columns`. */\nexport function chunkIntoRows<T>(cells: readonly T[], columns: number): T[][] {\n const rows: T[][] = [];\n for (let start = 0; start < cells.length; start += columns) rows.push(cells.slice(start, start + columns));\n return rows;\n}\n","import React, { useMemo, useState } from 'react';\n\nimport { Pressable, StyleSheet, Text, View, useWindowDimensions } from 'react-native';\nimport type { LayoutChangeEvent } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { MIN_TARGET_PX } from '../minTarget';\nimport { MonthGridColumns } from './MonthGridColumns';\nimport { chunkIntoRows, fitMonthGridColumns } from './monthGridLayout';\n\nexport const MONTH_STATUS_GRID_TEST_ID = 'month-status-grid';\n\n/** The testID of one cell. */\nexport function monthCellTestID(gridTestID: string, cellId: string): string {\n return `${gridTestID}-cell-${cellId}`;\n}\n\nconst GRID_GAP = 6;\nconst CELL_MIN_HEIGHT = 56;\nconst CELL_RADIUS = 8;\nconst CELL_PADDING_V = 6;\nconst CELL_INNER_GAP = 4;\nconst LABEL_SIZE = 14;\nconst SELECTED_BORDER = 2;\nconst COLOR_STEP = '500';\n\nconst styles = StyleSheet.create({\n grid: { gap: GRID_GAP },\n row: { flexDirection: 'row', gap: GRID_GAP },\n filler: { flex: 1 },\n cell: {\n flex: 1,\n minWidth: MIN_TARGET_PX,\n minHeight: CELL_MIN_HEIGHT,\n borderRadius: CELL_RADIUS,\n borderWidth: 1,\n paddingVertical: CELL_PADDING_V,\n alignItems: 'center',\n justifyContent: 'center',\n gap: CELL_INNER_GAP,\n },\n dashed: { borderStyle: 'dashed' },\n selected: { borderWidth: SELECTED_BORDER },\n label: { fontSize: LABEL_SIZE, fontWeight: '600', textAlign: 'center' },\n});\n\nexport interface MonthStatusCell {\n id: string;\n label: string;\n icon?: React.ReactNode;\n statusLabel?: string;\n dashed?: boolean;\n}\n\nexport interface MonthStatusGridProps {\n cells: readonly MonthStatusCell[];\n onSelect: (id: string) => void;\n selectedId?: string | null;\n columns?: MonthGridColumns;\n accessibilityLabel: string;\n cellHint: string;\n testID?: string;\n}\n\ninterface CellProps {\n cell: MonthStatusCell;\n isSelected: boolean;\n onSelect: (id: string) => void;\n hint: string;\n testID: string;\n}\n\nconst GridCell = ({ cell, isSelected, onSelect, hint, testID }: CellProps): React.ReactElement => {\n const { theme } = useUi();\n const { colors } = theme;\n const hasStatus = cell.statusLabel !== undefined && cell.statusLabel !== '';\n\n return (\n <Pressable\n accessibilityHint={hint}\n accessibilityLabel={hasStatus ? `${cell.label}, ${String(cell.statusLabel)}` : cell.label}\n accessibilityRole=\"button\"\n aria-pressed={isSelected}\n onPress={() => onSelect(cell.id)}\n style={[\n styles.cell,\n { backgroundColor: isSelected ? colors.background : colors.surface, borderColor: colors.border },\n cell.dashed === true && styles.dashed,\n isSelected && styles.selected,\n isSelected && { borderColor: theme.palette.primary[COLOR_STEP] },\n ]}\n testID={testID}\n >\n {cell.icon !== undefined && cell.icon !== null ? <View aria-hidden>{cell.icon}</View> : null}\n <Text style={[styles.label, { color: colors.text }]}>{cell.label}</Text>\n </Pressable>\n );\n};\n\n/** One selectable status cell per period, in 12, 6 or 4 columns, narrowing when a cell would drop below 44 px. */\nexport const MonthStatusGrid = ({\n cells,\n onSelect,\n selectedId = null,\n columns = MonthGridColumns.Twelve,\n accessibilityLabel,\n cellHint,\n testID = MONTH_STATUS_GRID_TEST_ID,\n}: MonthStatusGridProps): React.ReactElement => {\n const { width: windowWidth } = useWindowDimensions();\n const [measuredWidth, setMeasuredWidth] = useState<number | null>(null);\n const fitted = fitMonthGridColumns(columns, measuredWidth ?? windowWidth, GRID_GAP);\n const rows = useMemo(() => chunkIntoRows(cells, fitted), [cells, fitted]);\n const onLayout = (event: LayoutChangeEvent): void => setMeasuredWidth(event.nativeEvent.layout.width);\n\n return (\n <View accessibilityLabel={accessibilityLabel} onLayout={onLayout} role=\"group\" style={styles.grid} testID={testID}>\n {rows.map((row) => (\n <View key={row[0]?.id} style={styles.row} testID={`${testID}-row`}>\n {row.map((cell) => (\n <GridCell\n cell={cell}\n hint={cellHint}\n isSelected={cell.id === selectedId}\n key={cell.id}\n onSelect={onSelect}\n testID={monthCellTestID(testID, cell.id)}\n />\n ))}\n {Array.from({ length: fitted - row.length }, (_, index) => (\n <View key={index} style={styles.filler} />\n ))}\n </View>\n ))}\n </View>\n );\n};\n\nexport default MonthStatusGrid;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/DataTable/constants.ts","../src/StatCard/StatCard.tsx","../src/minTarget.ts","../src/DataTable/styles.ts","../src/DataTable/cells.tsx","../src/DataTable/RowCells.tsx","../src/DataTable/rowPressContext.ts","../src/DataTable/SelectionCheckbox.tsx","../src/DataTable/TableRow.tsx","../src/DataTable/DataTableRow.tsx","../src/DataTable/SelectAllBanner.tsx","../src/DataTable/TableHeader.tsx","../src/DataTable/rowNav.ts","../src/DataTable/useRovingFocus.ts","../src/DataTable/selection.ts","../src/DataTable/useTableSelection.ts","../src/DataTable/DataTable.tsx","../src/DataTable/FilterBar.tsx","../src/accessibleName.ts","../src/DataTable/SizeDropdown.tsx","../src/DataTable/PagerNav.tsx","../src/DataTable/Pager.tsx","../src/Filters/styles.ts","../src/Filters/components/ActionButton.tsx","../src/Filters/constants.ts","../src/Filters/fields/BooleanField.tsx","../src/Filters/fields/DateRangeField.tsx","../src/Filters/fields/SelectField.tsx","../src/Filters/fields/TextField.tsx","../src/Filters/fields/TypeaheadField.tsx","../src/Filters/utils/clampedMinWidth.ts","../src/Filters/fields/FilterFieldView.tsx","../src/Filters/Filters.tsx","../src/Filters/hooks/useFilterDraft.ts","../src/Pagination/usePagedRows.ts","../src/StatusLedger/StatusTone.ts","../src/StatusLedger/constants.ts","../src/StatusLedger/components/StatusPill.tsx","../src/StatusLedger/SortDirection.ts","../src/StatusLedger/utils/ledgerLogic.ts","../src/StatusLedger/hooks/useLedgerView.tsx","../src/StatusLedger/LedgerLayout.ts","../src/StatusLedger/StatusLedger.tsx","../src/StatusLedger/utils/relativeTime.ts","../src/StatusLedger/components/RelativeTime.tsx","../src/MonthStatusGrid/MonthGridColumns.ts","../src/MonthStatusGrid/monthGridLayout.ts","../src/MonthStatusGrid/MonthStatusGrid.tsx"],"names":["StyleSheet","jsx","Text","View","rowTestID","jsxs","Pressable","useUi","Fragment","TAB_INDEX_INACTIVE","Platform","useCallback","useState","useMemo","React","IS_WEB","MENU_TOP_GAP","useRef","TRANSPARENT","FIRST_PAGE","useWindowDimensions","DISABLED_OPACITY","FULL_OPACITY","useEffect","StatusTone","PILL_RADIUS","styles","SortDirection","LedgerLayout","MonthGridColumns"],"mappings":";;;;;;;;;;;;;AAgBO,IAAM,qBAAA,GAAwB;AAG9B,IAAM,yBAAA,GAA+C,CAAC,EAAA,EAAI,EAAA,EAAI,KAAK,GAAG;AAYtE,IAAM,wBAAA,GAA2B,EAAA;AACjC,IAAM,4BAAA,GAA+B,EAAA;AAOrC,IAAM,qBAAqB,CAAC,KAAA,KACjC,KAAK,GAAA,CAAI,KAAA,EAAO,wBAAwB,CAAA,GAAI,4BAAA;AAGvC,IAAM,cAAA,GAAiB;AAAA,EAC5B,IAAA,EAAM,eAAA;AAAA,EACN,IAAA,EAAM,oBAAA;AAAA;AAAA,EAEN,QAAA,EAAU,KAAA;AAAA;AAAA,EAEV,cAAA,EAAgB,YAAA;AAAA;AAAA,EAEhB,cAAA,EAAgB,QAAA;AAAA;AAAA,EAEhB,YAAA,EAAc,MAAA;AAAA;AAAA,EAEd,eAAA,EAAiB,YAAA;AAAA;AAAA,EAEjB,kBAAA,EAAoB,eAAA;AAAA;AAAA,EAEpB,wBAAA,EAA0B,sBAAA;AAAA,EAC1B,SAAA,EAAW,YAAA;AAAA,EACX,OAAA,EAAS,YAAA;AAAA,EACT,KAAA,EAAO,UAAA;AAAA,EACP,SAAA,EAAW,eAAA;AAAA,EACX,UAAA,EAAY,gBAAA;AAAA,EACZ,SAAA,EAAW,eAAA;AAAA,EACX,SAAA,EAAW,eAAA;AAAA,EACX,SAAA,EAAW;AACb;AAGO,IAAM,SAAA,GAAY,CAAC,WAAA,EAAqB,GAAA,KAC7C,CAAA,EAAG,WAAW,CAAA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A,GAAS,GAAA,CAAI,QAAO,EAAG,CAAC,GAAG,KAAA,qBAC/CA,IAACE,IAAAA,EAAA,EAAiB,OAAOuB,OAAAA,CAAO,MAAA,EAAA,EAArB,KAA6B,CACzC;AAAA,GAAA,EAAA,EAbQ,GAAA,CAAI,CAAC,CAAA,EAAG,EAcnB,CACD,CAAA,EACH,CAAA;AAEJ","file":"index.mjs","sourcesContent":["/**\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/**\n * Default breakpoint (px): below this a row collapses to a label:value card.\n *\n * Aligned with `@dloizides/ui-layout`'s `MENU_BREAKPOINT` (768) — the kit's single\n * \"this is a phone / narrow tablet\" threshold, already the collapse point for the nav\n * menu (`ModalDropdown`) and the tabs bar (`TABS_COLLAPSE_BREAKPOINT`). Kept as a plain\n * literal rather than an import so a table has no runtime dependency on the layout kit\n * for one number; the value is what is shared, and it is documented here as such. A table\n * that never wants the card-stack still opts out with `stackBreakpoint={0}`.\n */\nexport const CARD_STACK_BREAKPOINT = 768;\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/**\n * Row-entrance stagger (the Ant-design-like list fade-in via `@dloizides/ui-motion`'s\n * `<FadeIn>`): only the first `ROW_ENTRANCE_STAGGER_CAP` rows fade in one-after-another,\n * each `ROW_ENTRANCE_STAGGER_STEP_MS` behind the last. Every row past the cap shares the\n * capped delay so the entrance settles in a fixed ~`cap * step` ms no matter the page size.\n *\n * The cap is the whole point: without it a 200-row page schedules 200 escalating delays\n * (and a 5,000-row list would take minutes to finish appearing while pinning the main\n * thread) — exactly the jank this animation is supposed to add polish over, not create.\n */\nexport const ROW_ENTRANCE_STAGGER_CAP = 10;\nexport const ROW_ENTRANCE_STAGGER_STEP_MS = 30;\n\n/**\n * The entrance delay (ms) for the row at `index`, capped at `ROW_ENTRANCE_STAGGER_CAP`\n * rows: rows 0..cap stagger; every row beyond the cap gets the same (capped) delay, so a\n * long page never animates row-by-row. Pure + exported for direct unit testing.\n */\nexport const rowEntranceDelayMs = (index: number): number =>\n Math.min(index, ROW_ENTRANCE_STAGGER_CAP) * ROW_ENTRANCE_STAGGER_STEP_MS;\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 /** Infix of a row's select checkbox: `${tableTestID}-select-${key}`. */\n rowSelectInfix: 'select',\n /** Infix of a row's entrance-fade wrapper: `${tableTestID}-fade-${key}`. */\n rowFadeInfix: 'fade',\n /** Suffix of the header (select-all-on-page) checkbox: `${tableTestID}-select-all`. */\n selectAllSuffix: 'select-all',\n /** Suffix of the select-all-matching banner: `${tableTestID}-select-banner`. */\n selectBannerSuffix: 'select-banner',\n /** Suffix of the banner's action: `${tableTestID}-select-banner-action`. */\n selectBannerActionSuffix: 'select-banner-action',\n filterBar: 'ui-filters',\n results: 'ui-results',\n pager: 'ui-pager',\n pagerInfo: 'ui-pager-info',\n pagerFirst: 'ui-pager-first',\n pagerPrev: 'ui-pager-prev',\n pagerNext: 'ui-pager-next',\n pagerLast: 'ui-pager-last',\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 * The test id of a row's select checkbox: `${tableTestID}-select-${key}` (key from\n * `keyExtractor`). Exported so consumers and e2e specs target a row's checkbox without\n * re-deriving the shape.\n */\nexport const rowSelectTestID = (tableTestID: string, key: string): string =>\n `${tableTestID}-${TABLE_TEST_IDS.rowSelectInfix}-${key}`;\n\n/** The test id of the header (select-all-on-page) checkbox: `${tableTestID}-select-all`. */\nexport const selectAllTestID = (tableTestID: string): string =>\n `${tableTestID}-${TABLE_TEST_IDS.selectAllSuffix}`;\n\n/**\n * The test id of a row's entrance-fade wrapper: `${tableTestID}-fade-${key}` (key from\n * `keyExtractor`). Only present while `animateRows` is on and reduced-motion is off.\n * Exported so consumers/e2e can target (or assert the absence of) the animation wrapper.\n */\nexport const rowFadeTestID = (tableTestID: string, key: string): string =>\n `${tableTestID}-${TABLE_TEST_IDS.rowFadeInfix}-${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 /** Accessible name of a row's select checkbox. */\n selectRow: 'uiTables.select.row',\n selectRowHint: 'uiTables.select.rowHint',\n /** Accessible name of the header (select-all-on-page) checkbox. */\n selectAll: 'uiTables.select.all',\n selectAllHint: 'uiTables.select.allHint',\n /** Banner, offer state: \"All {{p1}} rows on this page are selected.\" */\n selectPageSelected: 'uiTables.select.pageSelected',\n /** Banner, offer action: \"Select all {{p1}} matching this filter\". */\n selectAllMatching: 'uiTables.select.allMatching',\n selectAllMatchingHint: 'uiTables.select.allMatchingHint',\n /** Banner, active state: \"All {{p1}} rows matching this filter are selected.\" */\n selectMatchingSelected: 'uiTables.select.matchingSelected',\n /** Banner, active action: \"Clear selection\". */\n selectClear: 'uiTables.select.clear',\n selectClearHint: 'uiTables.select.clearHint',\n results: 'uiTables.results',\n pagerInfo: 'uiTables.pager.info',\n pagerFirst: 'uiTables.pager.first',\n pagerPrev: 'uiTables.pager.prev',\n pagerNext: 'uiTables.pager.next',\n pagerLast: 'uiTables.pager.last',\n pagerFirstHint: 'uiTables.pager.firstHint',\n pagerPrevHint: 'uiTables.pager.prevHint',\n pagerNextHint: 'uiTables.pager.nextHint',\n pagerLastHint: 'uiTables.pager.lastHint',\n pagerRows: 'uiTables.pager.rows',\n pagerRowsOptionHint: 'uiTables.pager.rowsOptionHint',\n /** Accessible hint for the dropdown-variant rows-per-page trigger button. */\n pagerRowsTriggerHint: 'uiTables.pager.rowsTriggerHint',\n /**\n * Accessible NAME of the rows-per-page control, e.g. \"Rows per page, currently {{p1}}\".\n * Without it the control is announced as the bare number (\"50\"), which says nothing about\n * what it does. Untranslated it degrades to that bare number — never to the raw key.\n */\n pagerRowsTriggerLabel: 'uiTables.pager.rowsTriggerLabel',\n /**\n * Accessible NAME of ONE rows-per-page choice, e.g. \"Show {{p1}} rows per page\". Used by\n * BOTH the `dropdown` options and the default `pills`. Untranslated it degrades to the\n * bare number — never to the raw key.\n */\n pagerRowsOptionLabel: 'uiTables.pager.rowsOptionLabel',\n /**\n * StatCard's accessible name, e.g. \"{{p1}}: {{p2}}\". Note the `analytics.` prefix: these\n * two keys predate this map and were only ever inlined in StatCard.tsx, so apps deriving\n * their required-key list from TABLE_I18N could not see them. Registered here UNCHANGED\n * (renaming them would break every app that already defines them).\n */\n statCardLabel: 'analytics.statCardLabel',\n statHint: 'analytics.statHint',\n} as const;\n","/**\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\nimport { TABLE_I18N } from '../DataTable/constants';\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(TABLE_I18N.statHint, label)}\n accessibilityLabel={t(TABLE_I18N.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 * The smallest hit box any pressable in this package may render: 44x44 CSS px\n * (BaseClient/docs/code-standards/mobile-first.md, WCAG 2.5.5).\n *\n * The RENDERED box is the target. `hitSlop` is inert on react-native-web's `Pressable`, so it\n * cannot stand in for this — measured on ui.dloizides.com/tables, the switches rendered 40x20\n * and the pager buttons 31px tall with hitSlop set. Mirrors `@dloizides/ui-layout`'s\n * `MIN_TARGET_PX`; ui-tables does not depend on ui-layout, so the value is restated here.\n */\nexport const MIN_TARGET_PX = 44;\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 { Z_INDEX } from '@dloizides/design-tokens';\nimport { Platform, StyleSheet, type ViewStyle } from 'react-native';\n\nimport { MIN_TARGET_PX } from '../minTarget';\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 = 5;\n/** Gap between a card line's label and the value stacked beneath it. */\nconst CARD_LABEL_GAP = 3;\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 CHEVRON_FONT = 10;\nconst MENU_TOP_GAP = 4;\nconst MENU_PAD_V = 4;\nconst MENU_MIN_WIDTH = 80;\nconst MENU_OPT_PAD_V = 7;\n/** Body-portalled on web, so it must clear an open RN-web Modal (9999): the shared popover layer. */\nconst MENU_Z_INDEX = Z_INDEX.popover;\nconst MENU_ELEVATION = 8;\n/** Soft drop shadow so the rows-per-page popover reads as floating above the page (mirrors ui-layout's InlineMenu). */\nconst MENU_BOX_SHADOW = '0px 2px 8px rgba(0, 0, 0, 0.15)';\nconst RESULTS_FONT = 13;\nconst HEAD_LETTER_SPACING = 0.4;\nconst LABEL_LETTER_SPACING = 0.3;\nconst STICKY_Z = Z_INDEX.sticky;\nconst FULL_WIDTH = '100%' as const;\n/** The checkbox column's width — a fixed gutter, so header and rows line up exactly. */\nconst SELECT_COL_WIDTH = MIN_TARGET_PX;\nconst CHECKBOX_SIZE = 18;\nconst CHECKBOX_RADIUS = 4;\nconst CHECKBOX_GLYPH_FONT = 11;\nconst CHECKBOX_GLYPH_LINE = 13;\nconst BANNER_PAD_V = 8;\nconst BANNER_FONT = 13;\nconst BANNER_GAP = 6;\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 *\n * This is a KNOWN, deliberate web-only escape hatch — but it must never reach a\n * native renderer: RN's style parser maps `position` onto a Yoga enum and an\n * unrecognised value is a hard error on the native side (it is NOT silently\n * ignored the way an unknown web CSS value is). So we emit it on web ONLY and\n * degrade to a normal, non-sticky header on iOS/Android.\n */\nconst STICKY_WEB_STYLE = {\n position: 'sticky',\n top: 0,\n zIndex: STICKY_Z,\n} as unknown as ViewStyle;\n\n/**\n * The sticky-header style for a platform: the web-only `position: 'sticky'`\n * block on web, `null` (no sticky, no invalid enum) everywhere else.\n * `platformOs` is injectable purely so both branches are unit-testable — the\n * Jest suite runs on react-native-web, where `Platform.OS` is always `'web'`.\n */\nexport function resolveStickyHeaderStyle(platformOs: string): ViewStyle | null {\n return platformOs === 'web' ? STICKY_WEB_STYLE : null;\n}\n\nexport const STICKY_HEADER_STYLE: ViewStyle | null = resolveStickyHeaderStyle(Platform.OS);\n\n/** Alpha suffix (~12%) for the soft brand row-hover tint, mirroring the v1 `--brand-soft` fill. */\nconst HOVER_TINT_ALPHA = '1f';\nconst HEX_RGB = /^#[0-9a-f]{6}$/i;\n\n/**\n * The soft brand tint used for the web row-hover highlight on clickable rows — the\n * theme's `palette.primary['500']` at low alpha, so it re-themes per tenant (v1's\n * `.ui-table--zebra tbody tr.clickable:hover` used `--brand-soft`). Returns `undefined`\n * when `primary` is not a plain `#rrggbb` so the caller can fall back to a surface tint.\n */\nexport function softBrandTint(primary: string): string | undefined {\n return HEX_RGB.test(primary) ? `${primary}${HOVER_TINT_ALPHA}` : undefined;\n}\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 /**\n * A card line is a VERTICAL label:value pair — the header sits ABOVE its value, both\n * left-aligned, so a narrow phone column never cramps the value against the label the\n * way the old `space-between` row did (an Actions cell of buttons or a long text value\n * now gets the full card width). `paddingVertical` gives the stacked lines their rhythm.\n */\n cardLine: { flexDirection: 'column', alignItems: 'stretch', paddingVertical: CARD_LINE_PAD_V, gap: CARD_LABEL_GAP },\n cardLabel: { fontSize: HEAD_FONT, fontWeight: '600', textTransform: 'uppercase', letterSpacing: LABEL_LETTER_SPACING },\n cardValue: { alignItems: 'flex-start' },\n /**\n * A zero-footprint carrier for the `ui-data-table-head` test id in the card-stack layout\n * (which has no visible header row). `display: 'none'` keeps it out of layout AND the\n * accessibility tree, while the `data-testid` stays queryable — so an E2E selector that\n * targets the head survives at every viewport width.\n */\n headSentinel: { display: 'none' },\n});\n\n/**\n * Bulk-select slots. Separate from `tableStyles` so a consumer that never selects anything\n * pays for none of it, and so the checkbox gutter's width lives in exactly one place —\n * header and body read the SAME `selectCell`, which is what keeps the columns aligned.\n */\nexport const selectionStyles = StyleSheet.create({\n /** The fixed-width gutter holding the checkbox, in both the header and every row. */\n selectCell: { width: SELECT_COL_WIDTH, alignItems: 'flex-start', justifyContent: 'center' },\n /** The checkbox's pressable area — a full 44x44 box around the 18px visual square. */\n checkboxHit: { minWidth: MIN_TARGET_PX, minHeight: MIN_TARGET_PX, alignItems: 'center', justifyContent: 'center' },\n checkbox: {\n width: CHECKBOX_SIZE,\n height: CHECKBOX_SIZE,\n borderRadius: CHECKBOX_RADIUS,\n borderWidth: BORDER_WIDTH,\n alignItems: 'center',\n justifyContent: 'center',\n },\n checkboxGlyph: { fontSize: CHECKBOX_GLYPH_FONT, lineHeight: CHECKBOX_GLYPH_LINE, fontWeight: '700' },\n /**\n * The cells of a SELECTABLE row, wrapped so the checkbox can sit OUTSIDE the pressable\n * area. `flex: 1` so the cells still claim the row minus the checkbox gutter.\n */\n rowContent: { flex: 1, flexDirection: 'row', columnGap: COLUMN_GAP, alignItems: 'center' },\n /** The same, for the card-stack: a card's lines are a column, not a row. */\n cardContent: { flex: 1 },\n /** The select-all-matching banner, spanning the table above the header. */\n banner: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: 'center',\n gap: BANNER_GAP,\n paddingHorizontal: ROW_PAD_H,\n paddingVertical: BANNER_PAD_V,\n },\n bannerText: { fontSize: BANNER_FONT },\n bannerHit: { minHeight: MIN_TARGET_PX, justifyContent: 'center' },\n bannerAction: { fontSize: BANNER_FONT, fontWeight: '700', textDecorationLine: 'underline' },\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 /**\n * The actions cluster WRAPS and is capped at the bar's width (TABLES-MOBILE-1 \"Filter bar and\n * pager overflow at 360\"). A nowrap row is one unbreakable flex item: at 360 on aml-v2 Leaders\n * it measured 431px inside a 255px bar and pushed Apply off-screen. `maxWidth: 100%` +\n * `flexShrink` fit the cluster to its line; its own `flexWrap` then breaks the buttons onto\n * further lines instead of overflowing (flex-shrink alone cannot: it never wraps a line).\n */\n filtersActions: { flexDirection: 'row', flexWrap: 'wrap', flexShrink: 1, maxWidth: '100%', rowGap: PAGER_GAP, columnGap: PAGER_SIZE_GAP, alignItems: 'center' },\n /**\n * The pager and its nav may SHRINK to their container (TABLES-MOBILE-1). Placed beside a title\n * in a wrapping row (aml-v2 /app/cases), a `flex-shrink: 0` pager measured 328px in a 255px slot\n * and Next was clipped. `minWidth: 0` + `maxWidth: 100%` let the line fit, then `flexWrap`\n * breaks the info / nav / buttons onto further lines instead of overflowing.\n */\n pager: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'space-between', gap: PAGER_GAP, flexShrink: 1, minWidth: 0, maxWidth: '100%' },\n pagerInfo: { fontSize: CONTROL_FONT, fontVariant: ['tabular-nums'] },\n pagerNav: { flexDirection: 'row', alignItems: 'center', gap: PAGER_SIZE_GAP, flexWrap: 'wrap', flexShrink: 1, minWidth: 0, maxWidth: '100%' },\n pagerRowsLabel: { fontSize: HEAD_FONT, textTransform: 'uppercase', letterSpacing: LABEL_LETTER_SPACING },\n /** Mixed-case \"Rows\" caption for the dropdown variant (v1's muted `.hint` label — no uppercase transform). */\n pagerRowsLabelPlain: { fontSize: HEAD_FONT, letterSpacing: LABEL_LETTER_SPACING },\n sizeGroup: { flexDirection: 'row', gap: PAGER_SIZE_GAP, alignItems: 'center' },\n control: { minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, alignItems: 'center', justifyContent: 'center', paddingHorizontal: CONTROL_PAD_H, paddingVertical: CONTROL_PAD_V, borderRadius: BORDER_RADIUS, borderWidth: BORDER_WIDTH },\n controlText: { fontSize: CONTROL_FONT, fontWeight: '600' },\n sizePill: { minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, alignItems: 'center', justifyContent: 'center', 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 /** Dropdown variant: relatively-positioned wrapper holding the trigger + the anchored popover. */\n sizeAnchor: { position: 'relative' },\n /** Dropdown variant: the compact `<select>`-like trigger (bordered ghost look, height-matched to Prev/Next) + chevron. */\n sizeTrigger: { minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: PAGER_SIZE_GAP, paddingHorizontal: CONTROL_PAD_H, paddingVertical: CONTROL_PAD_V, borderRadius: BORDER_RADIUS, borderWidth: BORDER_WIDTH },\n sizeTriggerText: { fontSize: CONTROL_FONT, fontWeight: '600', fontVariant: ['tabular-nums'] },\n sizeChevron: { fontSize: CHEVRON_FONT },\n /** Dropdown variant: the anchored popover listing the rows-per-page options. */\n sizeMenu: { position: 'absolute', top: '100%', right: 0, marginTop: MENU_TOP_GAP, minWidth: MENU_MIN_WIDTH, borderWidth: BORDER_WIDTH, borderRadius: BORDER_RADIUS, paddingVertical: MENU_PAD_V, zIndex: MENU_Z_INDEX, boxShadow: MENU_BOX_SHADOW, elevation: MENU_ELEVATION },\n sizeOption: { minHeight: MIN_TARGET_PX, justifyContent: 'center', paddingHorizontal: CONTROL_PAD_H, paddingVertical: MENU_OPT_PAD_V },\n sizeOptionText: { fontSize: CONTROL_FONT, fontVariant: ['tabular-nums'] },\n});\n","/**\n * The DataTable's cell renderers, shared by BOTH branches (desktop grid + card-stack).\n *\n * Every style array here ends with the consumer's `styleOverrides` slot so an override\n * beats the base StyleSheet AND the inline theme colour (colours are never in the\n * StyleSheet in this kit — they are applied inline at render time).\n */\nimport React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { tableStyles as s } from './styles';\nimport type { DataTableColumn, DataTableStyleOverrides } from './types';\n\n/** The subset of the override slots a cell can consume. */\nexport type CellStyleOverrides = Pick<DataTableStyleOverrides, 'cell' | 'numCell' | 'cellWrap'>;\n\n/**\n * A column's rendered content, safe to place inside a `<View>`.\n *\n * A bare string/number child of a `<View>` warns on RN-web (\"Unexpected text node\")\n * and THROWS on real React Native — and these apps ship as native, so raw text must\n * always be wrapped in `<Text>`. Used by BOTH the desktop cell and the card-stack\n * value (the stacked branch previously rendered `col.render(row)` unwrapped).\n */\nexport function cellContent<T>(\n column: DataTableColumn<T>,\n row: T,\n textColor: string,\n overrides?: CellStyleOverrides,\n): React.ReactNode {\n const content = column.render(row);\n if (typeof content === 'string' || typeof content === 'number') {\n return (\n <Text\n style={[\n s.cell,\n column.numeric ? s.numCell : null,\n { color: textColor },\n overrides?.cell,\n column.numeric ? overrides?.numCell : null,\n ]}\n >\n {content}\n </Text>\n );\n }\n return content;\n}\n\ninterface DesktopCellProps<T> {\n column: DataTableColumn<T>;\n row: T;\n textColor: string;\n testID: string;\n styleOverrides?: CellStyleOverrides;\n /**\n * Give the cell its ARIA `cell` role. Set only when the table opted into keyboard\n * navigation, where it really is a grid: a `role=\"row\"` with structureless children is a\n * broken grid, and promising a structure you do not deliver is worse for a screen-reader\n * user than claiming none. A plain table keeps the roles it has always had.\n *\n * `cell` rather than `gridcell` on purpose. `gridcell` advertises a cell that\n * participates in grid navigation, and these do not: focus roves at the ROW level (see\n * `useRovingFocus`), so a gridcell would promise a tab stop that does not exist. ARIA 1.2\n * lists `cell` among `row`'s required owned elements, so this is a valid grid — and it is\n * also the only one of the two that React Native types (`Role` has `cell`, not\n * `gridcell`), which keeps this off the web-only escape hatch entirely.\n */\n inGrid?: boolean;\n}\n\n/**\n * A single desktop cell — renders `col.render(row)` exactly ONCE (POC bug fix).\n *\n * The cell's wrapping `View` is overridable via the `cellWrap` slot. That matters:\n * `cell` is a TextStyle and so only reaches cells whose `render` returns a string —\n * `cellWrap` reaches EVERY cell, including ones rendering a custom node (a badge, a\n * link, an action menu), which is what a consumer needs for true pixel-parity.\n */\nexport function DesktopCell<T>({ column, row, textColor, testID, styleOverrides, inGrid }: DesktopCellProps<T>): React.ReactElement {\n return (\n <View\n style={[\n { flex: column.weight ?? 1, minWidth: column.minWidth, alignItems: column.numeric ? 'flex-end' : 'flex-start' },\n styleOverrides?.cellWrap,\n ]}\n testID={testID}\n {...(inGrid === true ? { role: 'cell' as const } : null)}\n >\n {cellContent(column, row, textColor, styleOverrides)}\n </View>\n );\n}\n","/**\n * A row's contents, in whichever layout the table is in: the desktop cells, or the\n * label:value lines of the responsive card-stack.\n *\n * Split out of `DataTable` purely to keep that component within the size budget; the\n * markup and the style slots are unchanged from when both branches were inlined.\n */\nimport React from 'react';\nimport { Text, View } from 'react-native';\n\nimport { DesktopCell, cellContent } from './cells';\nimport { tableStyles as s } from './styles';\nimport type { DataTableColumn, DataTableStyleOverrides } from './types';\n\ninterface RowCellsProps<T> {\n columns: ReadonlyArray<DataTableColumn<T>>;\n row: T;\n /** Card-stack (label:value lines) rather than the desktop grid. */\n stacked: boolean;\n /** The table opted into keyboard navigation ⇒ cells take their ARIA `cell` role. */\n inGrid: boolean;\n /** The row's test id — each cell derives `${rowTestID}-${column.key}` from it. */\n rowTestID: string;\n textColor: string;\n labelColor: string;\n styleOverrides?: DataTableStyleOverrides;\n}\n\nexport function RowCells<T>({\n columns,\n row,\n stacked,\n inGrid,\n rowTestID,\n textColor,\n labelColor,\n styleOverrides: o,\n}: RowCellsProps<T>): React.ReactElement {\n if (stacked) {\n return (\n <>\n {columns.map((col) => (\n // The SAME per-cell test id the desktop cell carries (`${rowTestID}-${col.key}`),\n // so an E2E selector like `${rowTestID}-${col.key}` resolves in BOTH layouts — the\n // card-stack must not silently drop the hooks a wide-viewport test relies on.\n <View key={col.key} style={[s.cardLine, o?.cardLine]} testID={`${rowTestID}-${col.key}`}>\n <Text style={[s.cardLabel, { color: labelColor }, o?.cardLabel]}>{col.header}</Text>\n <View style={[s.cardValue, o?.cardValue]}>{cellContent(col, row, textColor, o)}</View>\n </View>\n ))}\n </>\n );\n }\n\n return (\n <>\n {columns.map((col) => (\n <DesktopCell\n key={col.key}\n column={col}\n inGrid={inGrid}\n row={row}\n styleOverrides={o}\n testID={`${rowTestID}-${col.key}`}\n textColor={textColor}\n />\n ))}\n </>\n );\n}\n","import { createContext, useContext } from 'react';\n\nconst RowPressContext = createContext<(() => void) | undefined>(undefined);\n\nexport const RowPressProvider = RowPressContext.Provider;\n\n/** The enclosing interactive row's press handler, so a pressable cell can also open its row. */\nexport const useRowPress = (): (() => void) | undefined => useContext(RowPressContext);\n","/**\n * The DataTable's select checkbox — used for BOTH a row and the tri-state header box.\n *\n * RN has no native checkbox, so this is a `Pressable` box drawn from the theme, exactly\n * like the Pager draws its size pills. It carries the real checkbox semantics rather than\n * miming them: `accessibilityRole=\"checkbox\"` plus the checked state in BOTH spellings —\n * `accessibilityState` (RN native) and `aria-checked` (react-native-web ≥ 0.19 stopped\n * mapping the legacy prop), which is the same two-spelling rule the row's `aria-expanded`\n * already follows.\n *\n * `'mixed'` is the indeterminate state, and it is a real ARIA value, not a visual trick: a\n * screen reader announces \"partially checked\" for a header box over a part-selected page.\n */\nimport React from 'react';\nimport { Pressable, Text, View } from 'react-native';\n\nimport { HeaderCheckboxState } from './headerCheckboxState';\nimport { selectionStyles as sel } from './styles';\n\n/** The tick glyph. A text mark keeps this native-safe — no SVG, no icon peer dependency. */\nconst CHECK_GLYPH = '✓';\n/** The indeterminate mark: a dash, the conventional \"some but not all\". */\nconst MIXED_GLYPH = '–';\nconst TRANSPARENT = 'transparent';\n\ninterface SelectionCheckboxProps {\n /** `All` = checked, `Some` = indeterminate, `None` = unchecked. */\n state: HeaderCheckboxState;\n /** Already-translated accessible name (e.g. the row's label, or \"select all on page\"). */\n label: string;\n /** Already-translated accessible hint. */\n hint: string;\n onToggle: () => void;\n brandColor: string;\n borderColor: string;\n surfaceColor: string;\n testID: string;\n}\n\n/** ARIA's tri-state: `true` | `false` | `'mixed'`. */\nfunction toCheckedValue(state: HeaderCheckboxState): boolean | 'mixed' {\n if (state === HeaderCheckboxState.All) return true;\n return state === HeaderCheckboxState.Some ? 'mixed' : false;\n}\n\nfunction toGlyph(state: HeaderCheckboxState): string | undefined {\n if (state === HeaderCheckboxState.All) return CHECK_GLYPH;\n return state === HeaderCheckboxState.Some ? MIXED_GLYPH : undefined;\n}\n\nexport function SelectionCheckbox({\n state,\n label,\n hint,\n onToggle,\n brandColor,\n borderColor,\n surfaceColor,\n testID,\n}: SelectionCheckboxProps): React.ReactElement {\n const checked = toCheckedValue(state);\n const glyph = toGlyph(state);\n const filled = state !== HeaderCheckboxState.None;\n\n return (\n <Pressable\n accessibilityHint={hint}\n accessibilityLabel={label}\n accessibilityRole=\"checkbox\"\n accessibilityState={{ checked }}\n aria-checked={checked}\n style={sel.checkboxHit}\n testID={testID}\n onPress={onToggle}\n >\n <View\n style={[\n sel.checkbox,\n { borderColor: filled ? brandColor : borderColor, backgroundColor: filled ? brandColor : TRANSPARENT },\n ]}\n >\n {glyph === undefined ? null : <Text style={[sel.checkboxGlyph, { color: surfaceColor }]}>{glyph}</Text>}\n </View>\n </Pressable>\n );\n}\n","/**\n * A DataTable row container.\n *\n * A module-level component ON PURPOSE: defining this inside `DataTable`'s render body would\n * give it a fresh identity every render and remount the whole row subtree on each hover or\n * selection change. (It replaces the `rowContainer` closure for exactly that reason — the\n * closure returned elements rather than being a component, which was correct but no longer\n * fits now that a row has three shapes.)\n *\n * ## The three shapes, and why\n *\n * 1. **Static** (no `onRowPress`) → a plain `<View>`. NOT a `Pressable`: on react-native-web\n * a `Pressable` installs pointer responders on the row container that CAPTURE a real\n * pointer gesture and cancel the press of any interactive child, so an Edit/Delete button\n * in a cell would look clickable and silently do nothing (the 1.9.2 fix).\n * 2. **Interactive** (`onRowPress`) → a `<Pressable>`. Unchanged from 1.9.2.\n * 3. **Selectable** (`selectionSlot`) → a plain `<View>` FRAME holding the checkbox and a\n * separate pressable content area.\n *\n * Shape 3 exists *because of* the 1.9.2 bug. A checkbox nested inside an interactive row's\n * `Pressable` is precisely the shape that fix identified as broken: the row would capture\n * the gesture and the checkbox would do nothing on a real click while passing a synthetic\n * `element.click()` test. So on a selectable row the checkbox is a SIBLING of the pressable\n * area, never a descendant of it — the gesture it receives is its own.\n */\nimport React from 'react';\nimport { Pressable, View, type StyleProp, type ViewProps, type ViewStyle } from 'react-native';\n\nimport { selectionStyles as sel } from './styles';\nimport type { RowKeyEvent } from './useRovingFocus';\n\n/** Focusable programmatically but skipped by Tab — see `keyboard` below. */\nconst TAB_INDEX_INACTIVE = -1;\n\n/**\n * The a11y props spread onto a row. The expanded state is emitted only when the table is\n * expandable, and via BOTH spellings: `accessibilityState` (RN native) and `aria-expanded`\n * (react-native-web ≥ 0.19 no longer maps the legacy prop). `aria-selected` follows the\n * same two-spelling rule and appears only when the table is selectable.\n */\nexport interface RowA11y {\n accessibilityLabel: string;\n accessibilityHint: string;\n accessibilityRole: 'button' | 'text';\n accessibilityState?: { expanded?: boolean; selected?: boolean };\n 'aria-expanded'?: boolean;\n 'aria-selected'?: boolean;\n role?: 'row';\n}\n\n/** The roving-tabindex wiring for one row. Absent when keyboard navigation is off. */\nexport interface RowKeyboard {\n /** `0` for the single tabbable row, `-1` for the rest. */\n tabIndex: 0 | -1;\n /** Web-only; `useRovingFocus` returns `undefined` off web. */\n onKeyDown?: (event: RowKeyEvent) => void;\n onFocus: () => void;\n registerNode: (node: unknown) => void;\n}\n\nexport interface TableRowProps {\n testID: string;\n /** The row frame: border, tint, padding. */\n style: StyleProp<ViewStyle>;\n children: React.ReactNode;\n a11y: RowA11y;\n /** Present ⇒ the row is interactive. */\n onPress?: () => void;\n onHoverIn?: () => void;\n onHoverOut?: () => void;\n /** The checkbox element. Present ⇒ the selectable frame shape. */\n selectionSlot?: React.ReactNode;\n /** Card-stack rows lay their content out as a column, not a row. */\n stacked?: boolean;\n keyboard?: RowKeyboard;\n}\n\n/**\n * `onKeyDown` is a **react-native-web-only** prop: RNW forwards it (its `keyboardProps`\n * list) but RN's `ViewProps` does not type it, because native has no key events. Cast at\n * this ONE boundary, through `unknown` and never `any` — the same documented escape hatch,\n * for the same reason, as `resolveStickyHeaderStyle`'s `position: 'sticky'` in `styles.ts`.\n *\n * Safe by construction on native: `useRovingFocus` hands back no handler off web, so this\n * returns an empty object and nothing web-only reaches the native renderer.\n */\nfunction webKeyProps(onKeyDown: ((event: RowKeyEvent) => void) | undefined): ViewProps {\n return (onKeyDown === undefined ? {} : { onKeyDown }) as unknown as ViewProps;\n}\n\n/** The focus/keyboard props shared by every row shape. Empty when navigation is off. */\nfunction focusProps(keyboard: RowKeyboard | undefined): ViewProps {\n if (keyboard === undefined) return {};\n return {\n tabIndex: keyboard.tabIndex,\n onFocus: keyboard.onFocus,\n ref: (node: unknown) => keyboard.registerNode(node),\n ...webKeyProps(keyboard.onKeyDown),\n } as unknown as ViewProps;\n}\n\nexport function TableRow({\n testID,\n style,\n children,\n a11y,\n onPress,\n onHoverIn,\n onHoverOut,\n selectionSlot,\n stacked,\n keyboard,\n}: TableRowProps): React.ReactElement {\n const interactive = onPress !== undefined;\n const hover = interactive ? { onHoverIn, onHoverOut } : null;\n\n // --- shapes 1 + 2: unchanged from 1.9.2 (plus the optional roving tabindex) ---\n if (selectionSlot === undefined) {\n return interactive ? (\n <Pressable style={style} testID={testID} onPress={onPress} {...hover} {...a11y} {...focusProps(keyboard)}>\n {children}\n </Pressable>\n ) : (\n <View style={style} testID={testID} {...a11y} {...focusProps(keyboard)}>\n {children}\n </View>\n );\n }\n\n // --- shape 3: the checkbox is a SIBLING of the pressable area, never inside it ---\n //\n // The FRAME owns identity + semantics (testID, label, role, aria-selected, roving\n // tabindex): it is the row, and it is the thing a keyboard operator lands on.\n //\n // The inner pressable is an anonymous gesture target for the CELLS only. Its tabIndex is\n // forced to -1 ONLY when keyboard navigation is on, because then the frame is the focus\n // stop and two tab stops per row would be one too many. With navigation OFF it keeps\n // RNW's default focusability, so a selectable-but-not-navigable table stays exactly as\n // reachable by Tab as an interactive row is today.\n const contentStyle = stacked ? sel.cardContent : sel.rowContent;\n const content = interactive ? (\n <Pressable\n style={contentStyle}\n tabIndex={keyboard === undefined ? undefined : TAB_INDEX_INACTIVE}\n onPress={onPress}\n {...hover}\n >\n {children}\n </Pressable>\n ) : (\n <View style={contentStyle}>{children}</View>\n );\n\n return (\n <View style={style} testID={testID} {...a11y} {...focusProps(keyboard)}>\n <View style={sel.selectCell}>{selectionSlot}</View>\n {content}\n </View>\n );\n}\n","/**\n * One row of the DataTable, in either layout: its a11y contract, its optional select\n * checkbox, its optional roving-tabindex wiring, its cells, and — when expanded — the\n * full-width detail panel that follows it.\n *\n * A module-level component ON PURPOSE. Defining it inside `DataTable`'s render body would\n * give it a fresh identity on every render and remount the whole row subtree on each hover\n * or selection change; that is why the previous inline `rowContainer` was a plain function\n * returning elements rather than a component. Lifted here, it gets a stable identity AND\n * `DataTable` gets to be an orchestrator instead of a pile of closures.\n *\n * The detail panel is returned as a SIBLING (via a Fragment, which adds no DOM node), so an\n * expanded row and its panel stay adjacent children of the table frame — i.e. the panel\n * still spans every column.\n */\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { TABLE_I18N, rowDetailTestID, rowSelectTestID, rowTestID } from './constants';\nimport { HeaderCheckboxState } from './headerCheckboxState';\nimport { RowCells } from './RowCells';\nimport { RowPressProvider } from './rowPressContext';\nimport { SelectionCheckbox } from './SelectionCheckbox';\nimport { tableStyles as s } from './styles';\nimport { TableRow, type RowA11y } from './TableRow';\nimport type { RovingFocus } from './useRovingFocus';\nimport type { TableSelection } from './useTableSelection';\nimport type { DataTableColumn, DataTableStyleOverrides } from './types';\n\nexport interface DataTableRowProps<T> {\n row: T;\n rowKey: string;\n /** The row frame's style, already composed by `DataTable` (zebra / tint / hover). */\n style: React.ComponentProps<typeof TableRow>['style'];\n columns: ReadonlyArray<DataTableColumn<T>>;\n /** Card-stack rather than the desktop grid. */\n stacked: boolean;\n /** The TABLE's test id; the row's and the checkbox's are derived from it. */\n tableTestID: string;\n selection: TableSelection;\n keyboardNavigation: boolean;\n roving: RovingFocus;\n onRowPress?: (row: T) => void;\n getRowAccessibilityLabel?: (row: T) => string;\n renderRowDetail?: (row: T) => React.ReactNode;\n getRowDetailAccessibilityLabel?: (row: T) => string;\n /** This row is currently expanded (computed by the parent from `expandedRowKeys`). */\n expanded: boolean;\n onHoverIn: () => void;\n onHoverOut: () => void;\n styleOverrides?: DataTableStyleOverrides;\n}\n\nexport function DataTableRow<T>({\n row,\n rowKey,\n style,\n columns,\n stacked,\n tableTestID,\n selection,\n keyboardNavigation,\n roving,\n onRowPress,\n getRowAccessibilityLabel,\n renderRowDetail,\n getRowDetailAccessibilityLabel,\n expanded,\n onHoverIn,\n onHoverOut,\n styleOverrides: o,\n}: DataTableRowProps<T>): React.ReactElement {\n const { theme, t } = useUi();\n const { colors } = theme;\n const rowID = rowTestID(tableTestID, rowKey);\n const isExpandable = renderRowDetail !== undefined;\n const { selectable } = selection;\n const isSelected = selectable && selection.isSelected(rowKey);\n const pressRow = onRowPress === undefined ? undefined : () => onRowPress(row);\n\n /**\n * Each block is additive and gated on the feature that earns it, so a table that opted\n * into nothing carries exactly the props it did before any of this existed. Both states\n * are emitted in BOTH spellings: `accessibilityState` (RN native) and the `aria-*` prop\n * (react-native-web ≥ 0.19 dropped the legacy mapping).\n */\n const a11y: RowA11y = {\n accessibilityLabel: getRowAccessibilityLabel?.(row) ?? t(TABLE_I18N.rowLabel),\n accessibilityHint: t(TABLE_I18N.rowHint),\n accessibilityRole: onRowPress ? 'button' : 'text',\n ...(isExpandable || selectable\n ? { accessibilityState: { ...(isExpandable ? { expanded } : null), ...(selectable ? { selected: isSelected } : null) } }\n : null),\n ...(isExpandable ? { 'aria-expanded': expanded } : null),\n ...(selectable ? { 'aria-selected': isSelected } : null),\n // A navigable table is a real grid, so its rows are grid rows — selectable or not.\n // `role` wins over `accessibilityRole` on RNW.\n ...(keyboardNavigation ? { role: 'row' as const } : null),\n };\n\n const rowNode = (\n <TableRow\n a11y={a11y}\n keyboard={\n keyboardNavigation\n ? {\n tabIndex: roving.tabIndexFor(rowKey),\n onKeyDown: roving.keyDownFor(rowKey),\n onFocus: () => roving.onRowFocus(rowKey),\n registerNode: (node: unknown) => roving.registerRow(rowKey, node),\n }\n : undefined\n }\n selectionSlot={\n selectable ? (\n <SelectionCheckbox\n borderColor={colors.border}\n brandColor={theme.palette.primary['500']}\n hint={t(TABLE_I18N.selectRowHint)}\n // Labelled with the ROW's name, so it announces \"Instruction ABC, checkbox\"\n // rather than an anonymous \"checkbox\" repeated down the page.\n label={getRowAccessibilityLabel?.(row) ?? t(TABLE_I18N.selectRow)}\n state={isSelected ? HeaderCheckboxState.All : HeaderCheckboxState.None}\n surfaceColor={colors.surface}\n testID={rowSelectTestID(tableTestID, rowKey)}\n onToggle={() => selection.toggleRow(rowKey)}\n />\n ) : undefined\n }\n stacked={stacked}\n style={style}\n testID={rowID}\n onHoverIn={onHoverIn}\n onHoverOut={onHoverOut}\n onPress={pressRow}\n >\n <RowPressProvider value={pressRow}>\n <RowCells\n columns={columns}\n inGrid={keyboardNavigation}\n labelColor={colors.textSecondary}\n row={row}\n rowTestID={rowID}\n stacked={stacked}\n styleOverrides={o}\n textColor={colors.text}\n />\n </RowPressProvider>\n </TableRow>\n );\n\n // Omitting `renderRowDetail` is a no-op on the output: no wrapper, no extra node.\n if (!isExpandable || !expanded) return rowNode;\n return (\n <>\n {rowNode}\n <View\n accessibilityLabel={getRowDetailAccessibilityLabel?.(row) ?? t(TABLE_I18N.rowDetail)}\n accessibilityRole=\"summary\"\n style={[s.rowDetail, { borderTopColor: colors.border, backgroundColor: colors.background }, o?.rowDetail]}\n testID={rowDetailTestID(tableTestID, rowKey)}\n >\n {renderRowDetail(row)}\n </View>\n </>\n );\n}\n","/**\n * The select-all-matching banner — **the flag, never the ids.**\n *\n * This is the only place the table admits rows exist beyond the current page, and it says\n * so in the only terms it honestly can: a COUNT the server reported, and a FLAG the\n * consumer resolves server-side against the same filter the list endpoint took.\n *\n * It deliberately does NOT enumerate the matching rows. It cannot — they are on pages that\n * were never fetched — and it must not: the ZY-02 spike measured this grid at ~2–3 ms and\n * ~16 DOM nodes per row, so \"select all 5,000\" as a DOM/id operation is indistinguishable\n * from an outage. `onAction()` carries no payload at all; the flag is the whole message.\n *\n * Reads `useUi()` directly (like `DataTable` and `Pager` do) rather than being handed a\n * dozen already-translated strings: it renders once per table, so the context read is free,\n * and it keeps the four count-dependent sentences next to the states that choose them.\n */\nimport React from 'react';\nimport { Pressable, Text, View, type StyleProp, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { TABLE_I18N } from './constants';\nimport { SelectAllBannerMode } from './selectAllBannerMode';\nimport { selectionStyles as sel } from './styles';\n\ninterface SelectAllBannerProps {\n mode: SelectAllBannerMode;\n /** Rows on the current page. */\n pageCount: number;\n /** Rows matching the filter across every page (server-reported). */\n matchingCount: number;\n /** Emits the FLAG: select all matching, or clear. */\n onAction: () => void;\n testID: string;\n actionTestID: string;\n styleOverride?: StyleProp<ViewStyle>;\n}\n\nexport function SelectAllBanner({\n mode,\n pageCount,\n matchingCount,\n onAction,\n testID,\n actionTestID,\n styleOverride,\n}: SelectAllBannerProps): React.ReactElement | null {\n const { theme, t } = useUi();\n const { colors, palette } = theme;\n\n if (mode === SelectAllBannerMode.Hidden) return null;\n\n const active = mode === SelectAllBannerMode.Active;\n const message = active\n ? t(TABLE_I18N.selectMatchingSelected, matchingCount.toLocaleString())\n : t(TABLE_I18N.selectPageSelected, pageCount.toLocaleString());\n const actionLabel = active\n ? t(TABLE_I18N.selectClear)\n : t(TABLE_I18N.selectAllMatching, matchingCount.toLocaleString());\n const actionHint = active ? t(TABLE_I18N.selectClearHint) : t(TABLE_I18N.selectAllMatchingHint);\n\n return (\n <View\n // `polite`, not `assertive`: this follows the operator's own click, so it should be\n // announced after what they did rather than interrupting them mid-action.\n accessibilityLiveRegion=\"polite\"\n style={[sel.banner, { backgroundColor: colors.background }, styleOverride]}\n testID={testID}\n >\n <Text style={[sel.bannerText, { color: colors.textSecondary }]}>{message}</Text>\n <Pressable\n accessibilityHint={actionHint}\n accessibilityLabel={actionLabel}\n accessibilityRole=\"button\"\n testID={actionTestID}\n onPress={onAction}\n style={sel.bannerHit}\n >\n <Text style={[sel.bannerAction, { color: palette.primary['500'] }]}>{actionLabel}</Text>\n </Pressable>\n </View>\n );\n}\n","/**\n * The DataTable's desktop header row: the optional select-all checkbox gutter, then one\n * cell per column.\n *\n * The gutter reads the SAME `selectCell` style every row uses — that shared width is the\n * only thing keeping the header aligned with the body once a checkbox column exists, so it\n * must never be duplicated with a local copy.\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 { HeaderCheckboxState } from './headerCheckboxState';\nimport { SelectionCheckbox } from './SelectionCheckbox';\nimport { STICKY_HEADER_STYLE, selectionStyles as sel, tableStyles as s } from './styles';\nimport type { DataTableColumn, DataTableStyleOverrides } from './types';\n\n/** The select-all wiring. Absent ⇒ the table is not selectable: no gutter, no node. */\nexport interface HeaderSelection {\n state: HeaderCheckboxState;\n onToggleAll: () => void;\n /** The checkbox's test id (derived from the table's, by `selectAllTestID`). */\n testID: string;\n}\n\ninterface TableHeaderProps<T> {\n columns: ReadonlyArray<DataTableColumn<T>>;\n stickyHeader?: boolean;\n selection?: HeaderSelection;\n /** The table opted into keyboard navigation ⇒ it is a real ARIA grid. */\n inGrid: boolean;\n styleOverrides?: DataTableStyleOverrides;\n}\n\nexport function TableHeader<T>({ columns, stickyHeader, selection, inGrid, styleOverrides: o }: TableHeaderProps<T>): React.ReactElement {\n const { theme, t } = useUi();\n const { colors } = theme;\n\n return (\n <View\n style={[s.headRow, { backgroundColor: colors.background }, stickyHeader ? STICKY_HEADER_STYLE : null, o?.headRow]}\n testID={TABLE_TEST_IDS.head}\n {...(inGrid ? { role: 'row' as const } : null)}\n >\n {selection === undefined ? null : (\n <View style={[sel.selectCell, o?.selectCell]}>\n <SelectionCheckbox\n borderColor={colors.border}\n brandColor={theme.palette.primary['500']}\n hint={t(TABLE_I18N.selectAllHint)}\n label={t(TABLE_I18N.selectAll)}\n state={selection.state}\n surfaceColor={colors.surface}\n testID={selection.testID}\n onToggle={selection.onToggleAll}\n />\n </View>\n )}\n {columns.map((col) => (\n <Text\n key={col.key}\n style={[s.headCell, { color: colors.textSecondary, flex: col.weight ?? 1, minWidth: col.minWidth, textAlign: col.numeric ? 'right' : 'left' }, o?.headCell]}\n {...(inGrid ? { role: 'columnheader' as const } : null)}\n >\n {col.header}\n </Text>\n ))}\n </View>\n );\n}\n","/**\n * Keyboard navigation — the pure parts: decoding a key press into an intent, and moving an\n * index. Split from the hook so the rules are testable as LOGIC, without a DOM.\n *\n * The ARIA grid pattern (roving tabindex) is what this implements: arrows MOVE FOCUS\n * between rows, they do not scroll and they do not wrap. Wrapping from the last row to the\n * first reads as \"the page changed\" to someone who cannot see the screen, which is exactly\n * the illusion a paged table must not create.\n */\nimport { RowNavAction } from './rowNavAction';\n\n/** The first row's index. */\nconst FIRST_INDEX = 0;\n/** Offset to the adjacent row. */\nconst ONE_ROW = 1;\n/** `indexOf` miss. */\nconst NOT_FOUND = -1;\n\n/**\n * Decode a `KeyboardEvent.key` into a row-grid intent, or `undefined` for a key this table\n * has no opinion about (which the caller must then leave alone — never `preventDefault` a\n * key you are not handling, or you break Tab, typeahead and browser shortcuts).\n *\n * `'Spacebar'` is the legacy (IE/old-Edge) `key` value for the space bar; both spellings\n * are accepted so the space key behaves the same everywhere.\n */\nexport function toRowNavAction(key: string): RowNavAction | undefined {\n switch (key) {\n case 'ArrowDown':\n return RowNavAction.Next;\n case 'ArrowUp':\n return RowNavAction.Prev;\n case 'Home':\n return RowNavAction.First;\n case 'End':\n return RowNavAction.Last;\n case ' ':\n case 'Spacebar':\n return RowNavAction.Toggle;\n case 'Enter':\n return RowNavAction.Activate;\n default:\n return undefined;\n }\n}\n\n/**\n * The index a movement action lands on — CLAMPED at both ends, never wrapping.\n *\n * Returns `undefined` for the non-movement actions (Toggle/Activate) and for an empty\n * page, so the caller can tell \"no movement\" from \"move to row 0\".\n */\nexport function nextRowIndex(\n currentIndex: number,\n action: RowNavAction,\n rowCount: number,\n): number | undefined {\n if (rowCount === FIRST_INDEX) return undefined;\n const lastIndex = rowCount - ONE_ROW;\n switch (action) {\n case RowNavAction.Next:\n return Math.min(currentIndex + ONE_ROW, lastIndex);\n case RowNavAction.Prev:\n return Math.max(currentIndex - ONE_ROW, FIRST_INDEX);\n case RowNavAction.First:\n return FIRST_INDEX;\n case RowNavAction.Last:\n return lastIndex;\n default:\n return undefined;\n }\n}\n\n/**\n * 🔴 The roving-tabindex invariant: **exactly one row is tabbable at any time.**\n *\n * The subtle case is a PAGE CHANGE. `focusedKey` is remembered across renders, but paging\n * replaces every row — so the remembered key belongs to rows that no longer exist. Falling\n * back to the first row is what keeps the table reachable: without this, after paging no\n * row would match, no row would carry `tabIndex=0`, and a keyboard operator would be\n * unable to get back into the grid at all (Tab would skip straight past it). Same for the\n * very first render, where nothing has been focused yet.\n *\n * Returns `undefined` only for an empty page, where there is genuinely nothing to focus.\n */\nexport function resolveTabbableKey(\n rowKeys: readonly string[],\n focusedKey: string | undefined,\n): string | undefined {\n if (rowKeys.length === FIRST_INDEX) return undefined;\n if (focusedKey !== undefined && rowKeys.includes(focusedKey)) return focusedKey;\n return rowKeys[FIRST_INDEX];\n}\n\n/**\n * The index the roving focus is currently on. Falls back to the first row when the\n * remembered key is gone (see `resolveTabbableKey`), so a movement after a page change\n * steps from the top of the new page rather than from nowhere.\n */\nexport function focusedRowIndex(rowKeys: readonly string[], focusedKey: string | undefined): number {\n const index = focusedKey === undefined ? NOT_FOUND : rowKeys.indexOf(focusedKey);\n return index === NOT_FOUND ? FIRST_INDEX : index;\n}\n","/**\n * Roving tabindex for the DataTable's rows — the ARIA grid keyboard pattern.\n *\n * Exactly ONE row carries `tabIndex=0`; the rest carry `-1`. So Tab moves INTO and OUT OF\n * the grid in one hop (rather than through 100 rows), and the arrow keys move within it.\n * That is the whole point of the pattern and the reason this is not a keydown hack.\n *\n * ## Web-only, deliberately\n *\n * Moving focus means calling `.focus()` on a host node, and `onKeyDown` is a DOM event.\n * Neither exists on real React Native, where there are no arrow keys to begin with. So the\n * keyboard wiring is emitted on WEB only and is inert on native — the same deliberate\n * split as `resolveStickyHeaderStyle` in `styles.ts`, and for the same reason: a web-only\n * escape hatch must never reach the native renderer.\n */\nimport { useCallback, useRef, useState } from 'react';\nimport { Platform } from 'react-native';\n\nimport { focusedRowIndex, nextRowIndex, resolveTabbableKey, toRowNavAction } from './rowNav';\nimport { RowNavAction } from './rowNavAction';\n\n/** Tabbable: the single row the roving tabindex currently rests on. */\nconst TAB_INDEX_ACTIVE = 0;\n/** Focusable programmatically, but skipped by Tab — every other row. */\nconst TAB_INDEX_INACTIVE = -1;\n\n/**\n * The host node a row ref resolves to on web. react-native-web hands the underlying DOM\n * element to the ref while typing it as a `View`, so this is cast through `unknown` at the\n * boundary (never `any`) — the same documented shape as the sticky-header cast.\n */\ninterface FocusableNode {\n focus?: () => void;\n}\n\n/** What the DataTable needs back to wire a row up. */\nexport interface RovingFocus {\n /** `0` for the one tabbable row, `-1` for the rest. */\n tabIndexFor: (key: string) => 0 | -1;\n /** Registers a row's host node so focus can be moved to it. */\n registerRow: (key: string, node: unknown) => void;\n /** Keeps the roving index in step when focus arrives by click or Tab. */\n onRowFocus: (key: string) => void;\n /** The row's keydown handler, or `undefined` when navigation is off / not on web. */\n keyDownFor: (key: string) => ((event: RowKeyEvent) => void) | undefined;\n}\n\n/**\n * The slice of a DOM `KeyboardEvent` this hook uses. Declared locally because RN's `View`\n * types carry no `onKeyDown` at all — it is a react-native-web-only prop (RNW forwards it\n * via its `keyboardProps` list). Typing just what we read keeps `no-explicit-any` clean.\n */\nexport interface RowKeyEvent {\n key: string;\n preventDefault: () => void;\n}\n\ninterface RovingFocusOptions {\n /** The current page's row keys, in render order. */\n rowKeys: readonly string[];\n /** Off → no tabIndex, no key handlers: the table behaves exactly as it did before. */\n enabled: boolean;\n /** Space on the focused row. Omitted when the table is not selectable. */\n onToggleKey?: (key: string) => void;\n /** Enter on the focused row. Omitted when the table has no `onRowPress`. */\n onActivateKey?: (key: string) => void;\n}\n\n/** Keyboard focus movement is a DOM affair — never emitted on native. */\nconst IS_WEB = Platform.OS === 'web';\n\nexport function useRovingFocus({ rowKeys, enabled, onToggleKey, onActivateKey }: RovingFocusOptions): RovingFocus {\n const [focusedKey, setFocusedKey] = useState<string | undefined>(undefined);\n const nodes = useRef<Map<string, FocusableNode>>(new Map());\n\n // The one tabbable row. Recomputed every render from the CURRENT keys, so a page change\n // (which replaces every key) re-homes the tabindex on the new first row rather than\n // leaving the grid with no way in. See `resolveTabbableKey`.\n const tabbableKey = enabled ? resolveTabbableKey(rowKeys, focusedKey) : undefined;\n\n const registerRow = useCallback((key: string, node: unknown): void => {\n if (node === null || node === undefined) {\n nodes.current.delete(key);\n return;\n }\n nodes.current.set(key, node as FocusableNode);\n }, []);\n\n const focusRow = useCallback((key: string): void => {\n setFocusedKey(key);\n nodes.current.get(key)?.focus?.();\n }, []);\n\n const handleKey = useCallback(\n (event: RowKeyEvent, key: string): void => {\n const action = toRowNavAction(event.key);\n // A key we have no opinion on must pass straight through — swallowing it would break\n // Tab, browser shortcuts and screen-reader keys.\n if (action === undefined) return;\n\n if (action === RowNavAction.Toggle) {\n if (onToggleKey === undefined) return;\n // Space would otherwise scroll the page out from under the operator.\n event.preventDefault();\n onToggleKey(key);\n return;\n }\n if (action === RowNavAction.Activate) {\n if (onActivateKey === undefined) return;\n event.preventDefault();\n onActivateKey(key);\n return;\n }\n\n const target = nextRowIndex(focusedRowIndex(rowKeys, key), action, rowKeys.length);\n if (target === undefined) return;\n const targetKey = rowKeys[target];\n if (targetKey === undefined) return;\n // Arrows would otherwise scroll the container as well as move focus.\n event.preventDefault();\n focusRow(targetKey);\n },\n [rowKeys, onToggleKey, onActivateKey, focusRow],\n );\n\n const keyDownFor = useCallback(\n (key: string) => {\n if (!enabled || !IS_WEB) return undefined;\n return (event: RowKeyEvent): void => handleKey(event, key);\n },\n [enabled, handleKey],\n );\n\n const tabIndexFor = useCallback(\n (key: string): 0 | -1 => (key === tabbableKey ? TAB_INDEX_ACTIVE : TAB_INDEX_INACTIVE),\n [tabbableKey],\n );\n\n const onRowFocus = useCallback((key: string): void => setFocusedKey(key), []);\n\n return { tabIndexFor, registerRow, onRowFocus, keyDownFor };\n}\n","/**\n * Bulk-select — the pure logic, kept out of the component so it is testable as LOGIC\n * (the platform's testing philosophy) rather than through the DOM.\n *\n * ## The shape is the design\n *\n * The ZY-02 grid spike (`zygos/docs/03-zy02-grid-spike.md`) measured this table at ~2–3 ms\n * and ~16 DOM nodes per row, with no virtualization *by design* — it is a server-paged\n * table. So **\"select all N matching the filter\" is a FLAG plus a COUNT, never an id list**:\n * the rows on other pages are not in the DOM, the table cannot enumerate them, and it must\n * not try. The consumer resolves the flag server-side against the same filter the list\n * endpoint took, which is a better design anyway — the work survives a closed tab.\n *\n * Everything here is domain-neutral: rows have keys, a page has some of them, a filter\n * matches a count. Nothing knows what a row *is*.\n */\nimport { HeaderCheckboxState } from './headerCheckboxState';\nimport { SelectAllBannerMode } from './selectAllBannerMode';\n\n/** No rows selected / no rows on the page — the empty count. */\nconst NONE = 0;\n\n/**\n * Toggle one row's selection, returning the NEXT selection array.\n *\n * Pure: never mutates the input (the caller owns that array as React state).\n */\nexport function toggleSelectedKey(selectedKeys: readonly string[], key: string): string[] {\n return selectedKeys.includes(key)\n ? selectedKeys.filter((selected) => selected !== key)\n : [...selectedKeys, key];\n}\n\n/** How many of THIS page's rows are currently selected. */\nfunction countSelectedOnPage(selectedKeys: readonly string[], pageKeys: readonly string[]): number {\n return pageKeys.filter((key) => selectedKeys.includes(key)).length;\n}\n\n/**\n * The header checkbox's tri-state, derived from the selection ∩ this page.\n *\n * Scoped to the PAGE, not to the whole selection: a header checkbox says \"is this page\n * selected?\", and off-page keys (which the caller may legitimately hold) must not make an\n * empty page look partially selected.\n */\nexport function resolveHeaderCheckboxState(\n selectedKeys: readonly string[],\n pageKeys: readonly string[],\n): HeaderCheckboxState {\n if (pageKeys.length === NONE) return HeaderCheckboxState.None;\n const selectedOnPage = countSelectedOnPage(selectedKeys, pageKeys);\n if (selectedOnPage === NONE) return HeaderCheckboxState.None;\n return selectedOnPage === pageKeys.length ? HeaderCheckboxState.All : HeaderCheckboxState.Some;\n}\n\n/**\n * The header checkbox toggle: select every row on this page, or clear them.\n *\n * From `Some` (indeterminate) this selects the REST of the page rather than clearing —\n * the conventional behaviour, and the one that matches what the tri-state box looks like\n * it will do.\n *\n * Only ever adds/removes keys that are ON THIS PAGE. Any off-page keys the caller holds\n * survive untouched: the table only knows about the rows it was given, so it must not\n * silently drop a selection it cannot see.\n */\nexport function toggleAllOnPage(selectedKeys: readonly string[], pageKeys: readonly string[]): string[] {\n const state = resolveHeaderCheckboxState(selectedKeys, pageKeys);\n if (state === HeaderCheckboxState.All) return selectedKeys.filter((key) => !pageKeys.includes(key));\n const merged = [...selectedKeys];\n pageKeys.forEach((key) => {\n if (!merged.includes(key)) merged.push(key);\n });\n return merged;\n}\n\n/**\n * What the select-all-matching banner should say.\n *\n * `Active` wins over everything: once the flag is set, the selection IS \"the filter\", and\n * the per-page arithmetic stops being the truth on screen.\n *\n * `Offer` only appears when the whole page is selected AND the filter matches more rows\n * than this page holds — otherwise \"select all matching\" would either be premature or a\n * no-op that just re-states the page.\n */\nexport function resolveSelectAllBannerMode(\n headerState: HeaderCheckboxState,\n allMatchingSelected: boolean,\n pageCount: number,\n matchingCount: number,\n): SelectAllBannerMode {\n if (allMatchingSelected) return SelectAllBannerMode.Active;\n const pageFullySelected = headerState === HeaderCheckboxState.All && pageCount > NONE;\n const moreBeyondThisPage = matchingCount > pageCount;\n return pageFullySelected && moreBeyondThisPage ? SelectAllBannerMode.Offer : SelectAllBannerMode.Hidden;\n}\n\n/**\n * Whether a row reads as selected.\n *\n * When the select-all-matching FLAG is set every row matching the filter is selected —\n * including this one, and including rows on pages the operator never opened. So the flag\n * short-circuits the id lookup rather than the table back-filling 5,000 ids to make the\n * checkboxes look right. That back-filling is exactly what the spike ruled out.\n */\nexport function isRowSelected(\n selectedKeys: readonly string[],\n key: string,\n allMatchingSelected: boolean,\n): boolean {\n return allMatchingSelected || selectedKeys.includes(key);\n}\n","/**\n * Binds the pure bulk-select rules in `selection.ts` to the DataTable's props.\n *\n * Holds NO state of its own: selection is CONTROLLED by the consumer (the same contract as\n * `expandedRowKeys`). This hook only derives — which is why every rule it uses is a pure\n * function that can be tested without a component.\n */\nimport { useCallback, useMemo } from 'react';\n\nimport {\n isRowSelected,\n resolveHeaderCheckboxState,\n resolveSelectAllBannerMode,\n toggleAllOnPage,\n toggleSelectedKey,\n} from './selection';\nimport { HeaderCheckboxState } from './headerCheckboxState';\nimport { SelectAllBannerMode } from './selectAllBannerMode';\n\ninterface TableSelectionOptions {\n /** The current page's row keys, in render order. */\n pageKeys: readonly string[];\n selectedRowKeys?: readonly string[];\n /** The enabler: absent ⇒ no checkboxes at all. */\n onSelectionChange?: (selectedRowKeys: readonly string[]) => void;\n matchingCount?: number;\n allMatchingSelected?: boolean;\n onSelectAllMatchingChange?: (allMatching: boolean) => void;\n}\n\nexport interface TableSelection {\n /** Whether to render the checkbox gutter at all. */\n selectable: boolean;\n /** The header checkbox's tri-state. */\n headerState: HeaderCheckboxState;\n /** What the select-all-matching banner should say (`Hidden` ⇒ render nothing). */\n bannerMode: SelectAllBannerMode;\n isSelected: (key: string) => boolean;\n toggleRow: (key: string) => void;\n /** The header checkbox: select or clear THIS page. */\n toggleAll: () => void;\n /** The banner's action: emits the FLAG, never ids. */\n toggleAllMatching: () => void;\n /** Total matching the filter across all pages (0 when the consumer did not say). */\n matchingCount: number;\n}\n\nconst NO_KEYS: readonly string[] = [];\nconst NO_MATCHES = 0;\n\nexport function useTableSelection({\n pageKeys,\n selectedRowKeys,\n onSelectionChange,\n matchingCount,\n allMatchingSelected,\n onSelectAllMatchingChange,\n}: TableSelectionOptions): TableSelection {\n const selectable = onSelectionChange !== undefined;\n const selected = selectedRowKeys ?? NO_KEYS;\n const allMatching = allMatchingSelected ?? false;\n const matching = matchingCount ?? NO_MATCHES;\n\n // While the select-all-matching flag is set the header is fully checked by definition —\n // every row matching the filter is selected, so asking the page's ids is the wrong\n // question (and on a page the operator never opened they would all be absent).\n const pageHeaderState = useMemo(\n () => resolveHeaderCheckboxState(selected, pageKeys),\n [selected, pageKeys],\n );\n const headerState = allMatching ? HeaderCheckboxState.All : pageHeaderState;\n\n const bannerMode = useMemo(\n () =>\n onSelectAllMatchingChange === undefined\n ? SelectAllBannerMode.Hidden\n : resolveSelectAllBannerMode(pageHeaderState, allMatching, pageKeys.length, matching),\n [onSelectAllMatchingChange, pageHeaderState, allMatching, pageKeys.length, matching],\n );\n\n const isSelected = useCallback(\n (key: string): boolean => isRowSelected(selected, key, allMatching),\n [selected, allMatching],\n );\n\n /**\n * Touching one row while \"all matching\" is set contradicts the flag — the operator is no\n * longer approving *the filter*, they are approving a set. So the flag drops and the\n * selection becomes the honest thing it now is: this page, minus the row they just\n * unticked. Leaving the flag set would silently act on rows they had just excluded.\n */\n const toggleRow = useCallback(\n (key: string): void => {\n if (allMatching) {\n onSelectAllMatchingChange?.(false);\n onSelectionChange?.(toggleSelectedKey(pageKeys, key));\n return;\n }\n onSelectionChange?.(toggleSelectedKey(selected, key));\n },\n [allMatching, onSelectAllMatchingChange, onSelectionChange, pageKeys, selected],\n );\n\n const toggleAll = useCallback((): void => {\n if (allMatching) {\n // Un-ticking a fully-checked header clears everything, flag included.\n onSelectAllMatchingChange?.(false);\n onSelectionChange?.(NO_KEYS);\n return;\n }\n onSelectionChange?.(toggleAllOnPage(selected, pageKeys));\n }, [allMatching, onSelectAllMatchingChange, onSelectionChange, selected, pageKeys]);\n\n const toggleAllMatching = useCallback((): void => {\n const next = !allMatching;\n onSelectAllMatchingChange?.(next);\n // Clearing the flag leaves nothing selected: the ids were never enumerated, so there is\n // no page-shaped remnant to fall back to, and silently keeping this page ticked would\n // be a different set than the one the operator just cleared.\n if (!next) onSelectionChange?.(NO_KEYS);\n }, [allMatching, onSelectAllMatchingChange, onSelectionChange]);\n\n return { selectable, headerState, bannerMode, isSelected, toggleRow, toggleAll, toggleAllMatching, matchingCount: matching };\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 * Pass `stackBreakpoint={0}` to keep the desktop grid at every width.\n * - per-row `testID` + `accessibilityLabel`/`accessibilityHint` (kit standard).\n * - optional CONTROLLED expandable rows: `renderRowDetail` + `expandedRowKeys`.\n * - optional CONTROLLED **bulk-select**: `selectedRowKeys` + `onSelectionChange` add a\n * checkbox gutter; `matchingCount` + `onSelectAllMatchingChange` add the \"select all N\n * matching this filter\" banner, which emits a **FLAG, never an id list**.\n * - optional **keyboard navigation** (`keyboardNavigation`): the ARIA grid roving-tabindex\n * pattern — one tab stop for the whole grid, arrows to move, Space to select, Enter to\n * activate. Off by default: giving rows a `tabIndex` changes a page's tab order.\n * - optional per-slot `styleOverrides`, merged LAST so a consumer that needs to be\n * pixel-perfect beats both the base StyleSheet and the inline theme colour.\n * - every colour from `useUi().theme`; every component-authored string via `t`.\n *\n * **Omit the optional props and the table renders exactly as it always has** — that is the\n * contract every feature here is built to, and what keeps this a MINOR bump.\n *\n * **No virtualization, deliberately** (`zygos/docs/03-zy02-grid-spike.md`): this is a\n * server-paged table — that is what `Pager` and `FilterBar` are for — and paging already\n * buys everything virtualization would, without the surface area.\n *\n * This component is the ORCHESTRATOR: the frame, the state views, the header and the two\n * layout branches. A row's own behaviour lives in `DataTableRow`.\n */\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { Text, View, useWindowDimensions } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\nimport { FadeIn, useReducedMotion } from '@dloizides/ui-motion';\n\nimport {\n CARD_STACK_BREAKPOINT,\n TABLE_I18N,\n TABLE_TEST_IDS,\n rowEntranceDelayMs,\n rowFadeTestID,\n selectAllTestID,\n} from './constants';\nimport { DataTableRow } from './DataTableRow';\nimport { SelectAllBanner } from './SelectAllBanner';\nimport { selectionStyles as sel, softBrandTint, tableStyles as s } from './styles';\nimport { TableHeader } from './TableHeader';\nimport { useRovingFocus } from './useRovingFocus';\nimport { useTableSelection } from './useTableSelection';\nimport type { DataTableProps } from './types';\n\nconst FIRST_ROW_INDEX = 0;\nconst EVEN = 0;\nconst ZEBRA_MODULUS = 2;\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, getRowDetailAccessibilityLabel, expandedRowKeys, styleOverrides: o,\n selectedRowKeys, onSelectionChange, matchingCount, allMatchingSelected, onSelectAllMatchingChange,\n keyboardNavigation = false, animateRows = true,\n stackBreakpoint = CARD_STACK_BREAKPOINT, testID = TABLE_TEST_IDS.root,\n } = props;\n\n const { theme, t } = useUi();\n // Row entrance: on by default, but collapse to instant (no wrapper, no delay) under\n // reduced-motion — the FadeIn gates too, but skipping the wrapper entirely keeps the\n // reduced-motion DOM byte-for-byte identical to the un-animated table.\n const reducedMotion = useReducedMotion();\n const animateRowEntrance = animateRows && !reducedMotion;\n const { colors } = theme;\n const { width } = useWindowDimensions();\n const stacked = width < stackBreakpoint;\n const frame = { backgroundColor: colors.surface, borderColor: colors.border };\n\n // Web row-hover highlight (v1 `.ui-table tr.clickable:hover`): only interactive rows\n // (those with `onRowPress`) tint on hover, so static rows never light up. The tint is\n // the theme's soft brand fill (re-themes per tenant), falling back to a subtle surface\n // tint. `onHoverIn`/`onHoverOut` are no-ops on native, so this is native-safe.\n const interactive = onRowPress !== undefined;\n const [hoveredKey, setHoveredKey] = useState<string | undefined>(undefined);\n const hoverTint = softBrandTint(theme.palette.primary['500']) ?? colors.background;\n\n // Computed ONCE per render and indexed into by both branches: `keyExtractor` is the\n // caller's function, and calling it twice per row (once for the key, once for selection\n // or focus) would double a cost the spike measured as linear in the row count.\n const rowKeys = useMemo(() => rows.map(keyExtractor), [rows, keyExtractor]);\n\n const selection = useTableSelection({\n pageKeys: rowKeys,\n selectedRowKeys,\n onSelectionChange,\n matchingCount,\n allMatchingSelected,\n onSelectAllMatchingChange,\n });\n\n const activateKey = useCallback(\n (key: string): void => {\n const row = rows[rowKeys.indexOf(key)];\n if (row !== undefined) onRowPress?.(row);\n },\n [rowKeys, rows, onRowPress],\n );\n\n const roving = useRovingFocus({\n rowKeys,\n enabled: keyboardNavigation,\n onToggleKey: selection.selectable ? selection.toggleRow : undefined,\n onActivateKey: interactive ? activateKey : undefined,\n });\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 % ZEBRA_MODULUS !== EVEN ? colors.background : undefined;\n },\n [rowTint, zebra, colors.background],\n );\n\n /**\n * A row's background: the hover tint when this interactive row is hovered (wins over\n * zebra/rowTint, matching v1's `:hover td { background }`), otherwise the base tint.\n */\n const rowBg = (row: T, index: number, key: string): string | undefined =>\n interactive && hoveredKey === key ? hoverTint : rowBackground(row, index);\n\n /** Loading / empty share the frame + centred state block. */\n const stateView = (label: string): React.ReactElement => (\n <View style={[s.wrap, frame, o?.wrap]} testID={testID}>\n <View style={[s.state, o?.state]}>\n <Text style={[s.stateText, { color: colors.textSecondary }, o?.stateText]}>{label}</Text>\n </View>\n </View>\n );\n\n /**\n * A REFETCH MUST NOT BLANK THE GRID.\n *\n * This used to be an unconditional `if (loading) return stateView(...)`, which threw away the\n * rows the user was already looking at for the duration of every re-fetch. On a server-paged\n * grid that is not a cosmetic flicker — it is the paging bug: clicking \"Next\" replaced the table\n * with \"Loading…\", so the grid visibly EMPTIED and only later refilled. To an observer (and to a\n * Playwright assertion that samples the rows after the click) the page appeared to render no\n * rows at all, which reads as \"Next paged to nothing\" rather than \"the next page is on its way\".\n * The same applied to re-filtering and to any `reload()`.\n *\n * So the full-bleed state view is now reserved for when there is genuinely NOTHING to show:\n * the first load (loading, no rows yet) and a resolved empty result (not loading, no rows).\n * Once rows exist they stay on screen — stale for a moment — and swap when the new page\n * resolves. `aria-busy` below carries the in-flight fetch to assistive tech, which\n * the discarded-rows approach communicated only by destroying the content.\n */\n if (rows.length === 0) {\n return stateView(loading ? loadingLabel ?? t(TABLE_I18N.loading) : emptyLabel ?? t(TABLE_I18N.empty));\n }\n\n /**\n * One row, in whichever layout — `DataTableRow` owns everything below the frame style.\n *\n * When `animateRowEntrance` is on, the row (and its expanded detail panel, if any) is\n * wrapped in a `<FadeIn>` **keyed by the row key**. That key is what keeps the entrance\n * honest: React reuses the same `<FadeIn>` instance across unrelated parent re-renders\n * (hover, a re-fetch that resolves to the SAME keys), so it fades exactly once — on the\n * mount of that key. Only a real change to the row set (sort / filter / page) mounts new\n * keys, which is the one time a re-fade is wanted. The stagger delay is capped, so a long\n * page settles in a fixed time rather than animating row-by-row.\n *\n * When off (opt-out or reduced-motion), the row renders with no wrapper node at all — a\n * keyed `Fragment` adds nothing to the DOM — so the un-animated table is unchanged.\n */\n const renderRow = (\n row: T,\n key: string,\n index: number,\n style: React.ComponentProps<typeof DataTableRow>['style'],\n ): React.ReactElement => {\n const node = (\n <DataTableRow\n columns={columns}\n expanded={expandedRowKeys?.includes(key) ?? false}\n getRowAccessibilityLabel={getRowAccessibilityLabel}\n getRowDetailAccessibilityLabel={getRowDetailAccessibilityLabel}\n keyboardNavigation={keyboardNavigation}\n renderRowDetail={renderRowDetail}\n roving={roving}\n row={row}\n rowKey={key}\n selection={selection}\n stacked={stacked}\n style={style}\n styleOverrides={o}\n tableTestID={testID}\n onHoverIn={() => setHoveredKey(key)}\n onHoverOut={() => setHoveredKey((current) => (current === key ? undefined : current))}\n onRowPress={onRowPress}\n />\n );\n if (!animateRowEntrance) return <React.Fragment key={key}>{node}</React.Fragment>;\n return (\n <FadeIn key={key} delay={rowEntranceDelayMs(index)} testID={rowFadeTestID(testID, key)}>\n {node}\n </FadeIn>\n );\n };\n\n /** The select-all-matching banner. Renders nothing unless the consumer opted in. */\n const banner = (\n <SelectAllBanner\n actionTestID={`${testID}-${TABLE_TEST_IDS.selectBannerActionSuffix}`}\n matchingCount={selection.matchingCount}\n mode={selection.bannerMode}\n pageCount={rows.length}\n styleOverride={o?.selectBanner}\n testID={`${testID}-${TABLE_TEST_IDS.selectBannerSuffix}`}\n onAction={selection.toggleAllMatching}\n />\n );\n\n // --- mobile: label:value card-stack (GRID.md). Disabled by `stackBreakpoint={0}`. ---\n if (stacked) {\n return (\n <View style={[s.wrap, frame, o?.wrap]} testID={testID} aria-busy={loading}>\n {banner}\n {/* The card-stack has no visible header, but E2E selectors that target the head must\n still resolve at phone width — a hidden, a11y-inert carrier keeps `ui-data-table-head`\n queryable in BOTH layouts (see `headSentinel` in styles.ts). */}\n <View style={s.headSentinel} testID={TABLE_TEST_IDS.head} aria-hidden />\n {rows.map((row, i) => {\n const key = rowKeys[i] ?? keyExtractor(row);\n const bg = rowBg(row, i, key);\n return renderRow(row, key, i, [\n s.card,\n { borderTopColor: colors.border },\n i === FIRST_ROW_INDEX ? { borderTopWidth: 0 } : null,\n // A selectable card puts the checkbox beside its lines, so the card becomes a row.\n selection.selectable ? sel.rowContent : null,\n bg ? { backgroundColor: bg } : null,\n o?.card,\n ]);\n })}\n </View>\n );\n }\n\n // --- desktop: header + rows ---\n return (\n <View\n style={[s.wrap, frame, o?.wrap]}\n testID={testID}\n // Rows now survive a re-fetch (see the `rows.length === 0` guard above), so the in-flight\n // state has to be announced rather than implied by the content vanishing.\n aria-busy={loading}\n // A navigable table is a real ARIA grid; a plain one keeps the roles it always had.\n {...(keyboardNavigation ? { role: 'grid' as const } : null)}\n >\n {banner}\n <TableHeader\n columns={columns}\n inGrid={keyboardNavigation}\n selection={\n selection.selectable\n ? { state: selection.headerState, onToggleAll: selection.toggleAll, testID: selectAllTestID(testID) }\n : undefined\n }\n stickyHeader={stickyHeader}\n styleOverrides={o}\n />\n {rows.map((row, i) => {\n const key = rowKeys[i] ?? keyExtractor(row);\n const bg = rowBg(row, i, key);\n return renderRow(row, key, i, [s.row, { borderTopColor: colors.border }, bg ? { backgroundColor: bg } : null, o?.row]);\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, type StyleProp, type TextStyle, type ViewStyle } 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\nconst RESULTS_COUNT_WEIGHT = '700' as const;\n\n/**\n * Per-slot style overrides for the FilterBar, merged **LAST** into each slot's style\n * array so the consumer always wins — over the base StyleSheet AND over the inline\n * colours taken from `useUi().theme`. Omit for the shared defaults (nothing changes).\n */\nexport interface FilterBarStyleOverrides {\n /** The bordered, rounded filter shell. */\n filters?: StyleProp<ViewStyle>;\n /** The flex spacer that pushes the count + actions right. */\n filtersSpacer?: StyleProp<ViewStyle>;\n /** The `<b>N</b> results` count line. */\n results?: StyleProp<TextStyle>;\n /** The right-aligned actions cluster. */\n filtersActions?: StyleProp<ViewStyle>;\n}\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 /**\n * Per-slot style overrides, merged LAST so the consumer always wins — including over\n * the inline theme colours. Omit for the shared defaults.\n */\n styleOverrides?: FilterBarStyleOverrides;\n testID?: string;\n}\n\nexport function FilterBar({\n children,\n resultsCount,\n resultsLabel,\n actions,\n styleOverrides: o,\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 }, o?.filters]} testID={testID}>\n {children}\n <View style={[c.filtersSpacer, o?.filtersSpacer]} />\n {typeof resultsCount === 'number' && (\n // Live region: announce the new count when filters change the result set (WCAG 4.1.3).\n <Text\n accessibilityLiveRegion=\"polite\"\n role=\"status\"\n style={[c.results, { color: colors.textSecondary }, o?.results]}\n testID={TABLE_TEST_IDS.results}\n >\n <Text style={{ color: colors.text, fontWeight: RESULTS_COUNT_WEIGHT }}>{resultsCount.toLocaleString()}</Text>\n {` ${word}`}\n </Text>\n )}\n {!!actions && <View style={[c.filtersActions, o?.filtersActions]}>{actions}</View>}\n </View>\n );\n}\n\nexport default FilterBar;\n","/**\n * Accessible-name resolution for keys this package introduces AFTER a host app has adopted it.\n *\n * The kit's i18n contract (see TABLE_I18N / FILTERS_I18N) is deliberately fallback-free: the\n * neutral `t` returns the KEY, and a host's `FM` has no fallback either, so a key the host has\n * not defined renders as its literal dotted name. That is the right default for VISIBLE copy —\n * it is loud, and it gets noticed and fixed.\n *\n * It is the WRONG default for an ACCESSIBLE NAME. An aria-label is invisible to sighted\n * reviewers, so an undefined key ships silently and the only people affected are screen-reader\n * users — who then hear \"ui tables pager rows trigger label\" instead of the bare number they\n * used to hear. That is a REGRESSION, and it is exactly the failure Zygos hit (44 undefined\n * keys rendering raw, e.g. `uiTables.filters.apply` shown literally).\n *\n * So a newly-introduced accessible-name key degrades to the value it REPLACED — the page-size\n * number, the field's own label. Those are locale-neutral data the caller already has, not\n * hardcoded English, so this does not smuggle a translation into the kit: an app that adopts\n * the key gets the good name, and an app that has not yet is no worse off than before.\n *\n * This is a MIGRATION affordance, not a licence to skip translations. Every key is still listed\n * in the exported *_I18N maps and documented in the README as required.\n */\n\n/**\n * The translated accessible name, or `fallback` when the host has not defined `key`.\n *\n * A host that has not mapped `key` gets the key back verbatim from `t` — that, and the empty\n * string, are the two \"not translated\" signals.\n */\nexport function accessibleName(translated: string, key: string, fallback: string): string {\n const isUntranslated = translated === key || translated === '';\n return isUntranslated ? fallback : translated;\n}\n","/**\n * SizeDropdown — the compact rows-per-page control for the Pager's `dropdown` variant.\n *\n * Matches the v1 console's `<select class=\"ui-select ui-btn--sm\">`: a compact bordered\n * trigger (height-matched to the Prev/Next ghost buttons) showing the current page size\n * plus a chevron, which opens an anchored popover of the page-size options. Selecting one\n * fires `onPageSizeChange` and closes; it also closes on outside-click / Escape.\n *\n * STACKING (the bug this fixes): react-native-web gives every `View` `position: relative;\n * z-index: 0`, so every View is its OWN stacking context. An absolutely-positioned popover\n * therefore has its `zIndex` trapped inside the anchor's `z-index: 0` context and paints\n * UNDER later-painting siblings (the results table / cards below). To escape that, on WEB the\n * open menu is rendered in a PORTAL to `document.body` with `position: fixed` at the trigger's\n * measured viewport rect and a high `zIndex` — clipped by nothing, above everything. The rect is\n * re-measured on scroll/resize so the menu stays glued to its trigger. On native the menu stays\n * in-tree (`position: absolute` + `elevation`). This mirrors `@dloizides/ui-layout`'s InlineMenu.\n *\n * `react-dom` is an OPTIONAL peer (only touched on web, behind `Platform.OS === 'web'`); every\n * RN-web consumer already has it. ui-tables stays a low-level table primitive with no runtime\n * dependency on the higher-level ui-layout ModalDropdown (whose trigger cannot match v1's compact\n * select), so this minimal anchored menu is kept in-tree.\n */\nimport React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { Platform, Pressable, Text, View, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';\n\nimport { chromeStyles as c } from './styles';\n\nconst CHEVRON_DOWN = '▾';\nconst CHEVRON_UP = '▴';\nconst IS_WEB = Platform.OS === 'web';\n/** Gap between the trigger's bottom edge and the popover's top edge (mirrors styles.ts MENU_TOP_GAP). */\nconst MENU_TOP_GAP = 4;\nconst VIEWPORT_EDGE = 0;\n\n/** The trigger's viewport-space corner needed to place the fixed, right-aligned web menu. */\ninterface TriggerRect {\n bottom: number;\n right: number;\n}\n\n/** Read the trigger's viewport rect (web only). Returns null when unavailable (native / no node). */\nfunction readTriggerRect(anchorRef: React.RefObject<View | null>): TriggerRect | null {\n if (!IS_WEB) return null;\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web ref is an HTMLElement at runtime\n const node = anchorRef.current as unknown as HTMLElement | null;\n if (node === null || typeof node.getBoundingClientRect !== 'function') return null;\n const r = node.getBoundingClientRect();\n return { bottom: r.bottom, right: r.right };\n}\n\n/**\n * Web-only fixed-position style: `position: fixed` under the trigger, right-aligned to it (v1's\n * menu hangs off the trigger's right edge). Merged OVER `chromeStyles.sizeMenu`, so it only needs\n * to override position/top/right — border, radius, padding, min-width, shadow and zIndex are kept.\n */\nfunction buildWebFixedStyle(rect: TriggerRect, viewportWidth: number): ViewStyle {\n return {\n // RN's ViewStyle union omits 'fixed', but react-native-web honours it at runtime.\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- web-only position value\n position: 'fixed' as unknown as ViewStyle['position'],\n top: rect.bottom + MENU_TOP_GAP,\n right: Math.max(VIEWPORT_EDGE, viewportWidth - rect.right),\n };\n}\n\n/**\n * Keep the fixed web menu glued to its trigger: measure before paint, then re-measure on scroll\n * (capture, so nested scrollers count) and resize while open. No-op on native / while closed.\n */\nfunction useTriggerRect(anchorRef: React.RefObject<View | null>, isOpen: boolean): TriggerRect | null {\n const [rect, setRect] = useState<TriggerRect | null>(null);\n\n useLayoutEffect(() => {\n if (!IS_WEB || !isOpen) return undefined;\n const measure = (): void => { setRect(readTriggerRect(anchorRef)); };\n measure();\n window.addEventListener('scroll', measure, true);\n window.addEventListener('resize', measure);\n return () => {\n window.removeEventListener('scroll', measure, true);\n window.removeEventListener('resize', measure);\n };\n }, [anchorRef, isOpen]);\n\n return rect;\n}\n\n/**\n * Web-only outside-click + Escape dismissal. Because the open menu is portalled OUT of the anchor\n * on web, a click is \"inside\" if it lands in EITHER the anchor or the portalled menu node. No-op on\n * native.\n */\nfunction useDismissOnOutside(\n anchorRef: React.RefObject<View | null>,\n menuRef: React.RefObject<View | null>,\n isOpen: boolean,\n onClose: () => void,\n): void {\n useEffect(() => {\n if (!IS_WEB || !isOpen) return undefined;\n\n const onMouseDown = (event: MouseEvent): void => {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web refs are HTMLElements at runtime\n const anchorNode = anchorRef.current as unknown as HTMLElement | null;\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- RN web refs are HTMLElements at runtime\n const menuNode = menuRef.current as unknown as HTMLElement | null;\n const target = event.target instanceof Node ? event.target : null;\n const insideAnchor = anchorNode !== null && target !== null && anchorNode.contains(target);\n const insideMenu = menuNode !== null && target !== null && menuNode.contains(target);\n if (!insideAnchor && !insideMenu) onClose();\n };\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') onClose();\n };\n\n document.addEventListener('mousedown', onMouseDown);\n document.addEventListener('keydown', onKeyDown);\n return () => {\n document.removeEventListener('mousedown', onMouseDown);\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [anchorRef, menuRef, isOpen, onClose]);\n}\n\nexport interface SizeDropdownProps {\n pageSize: number;\n pageSizeOptions: readonly number[];\n onPageSizeChange: (pageSize: number) => void;\n /** Base pager test id; the trigger is `${testID}-size-trigger`, each option `${testID}-size-${size}`. */\n testID: string;\n /**\n * Already-translated accessible NAME for the trigger, e.g. \"Rows per page, currently 50\".\n * The bare page-size number is NOT an acceptable name: it tells a screen-reader user the\n * value but never what the control is.\n */\n triggerLabel: string;\n /** Already-translated accessible NAME for one option, e.g. \"Show 100 rows per page\". */\n getOptionLabel: (size: number) => string;\n /** Already-translated accessible hint for the trigger. */\n triggerHint: string;\n /** Already-translated accessible hint for each option. */\n optionHint: string;\n /** Theme colours from the Pager (kept flat so this stays a pure presentational unit). */\n textColor: string;\n mutedColor: string;\n borderColor: string;\n surfaceColor: string;\n brandColor: string;\n triggerStyle?: StyleProp<ViewStyle>;\n triggerTextStyle?: StyleProp<TextStyle>;\n}\n\nexport function SizeDropdown({\n pageSize,\n pageSizeOptions,\n onPageSizeChange,\n testID,\n triggerLabel,\n getOptionLabel,\n triggerHint,\n optionHint,\n textColor,\n mutedColor,\n borderColor,\n surfaceColor,\n brandColor,\n triggerStyle,\n triggerTextStyle,\n}: SizeDropdownProps): React.ReactElement {\n const anchorRef = useRef<View>(null);\n const menuRef = useRef<View>(null);\n const [isOpen, setIsOpen] = useState(false);\n\n const close = useCallback(() => { setIsOpen(false); }, []);\n const toggle = useCallback(() => { setIsOpen((prev) => !prev); }, []);\n const select = useCallback(\n (size: number) => {\n onPageSizeChange(size);\n setIsOpen(false);\n },\n [onPageSizeChange],\n );\n\n const rect = useTriggerRect(anchorRef, isOpen);\n useDismissOnOutside(anchorRef, menuRef, isOpen, close);\n\n // Web: fixed-positioned in a portal at the measured trigger rect (escapes stacking + clipping).\n // Native: keep the in-tree absolute popover from chromeStyles.sizeMenu.\n const webFixedStyle = IS_WEB && rect !== null ? buildWebFixedStyle(rect, window.innerWidth) : null;\n\n const menu = (\n <View\n ref={menuRef}\n accessibilityRole=\"menu\"\n style={[c.sizeMenu, { borderColor, backgroundColor: surfaceColor }, webFixedStyle]}\n testID={`${testID}-size-menu`}\n >\n {pageSizeOptions.map((size) => {\n const active = size === pageSize;\n return (\n <Pressable\n key={size}\n testID={`${testID}-size-${size}`}\n accessibilityRole=\"menuitem\"\n accessibilityLabel={getOptionLabel(size)}\n accessibilityHint={optionHint}\n accessibilityState={{ selected: active }}\n onPress={() => select(size)}\n style={c.sizeOption}\n >\n <Text style={[c.sizeOptionText, { color: active ? brandColor : textColor, fontWeight: active ? '700' : '400' }]}>{size}</Text>\n </Pressable>\n );\n })}\n </View>\n );\n\n return (\n <View ref={anchorRef} style={c.sizeAnchor}>\n <Pressable\n testID={`${testID}-size-trigger`}\n accessibilityRole=\"button\"\n accessibilityLabel={triggerLabel}\n accessibilityHint={triggerHint}\n accessibilityState={{ expanded: isOpen }}\n aria-expanded={isOpen}\n onPress={toggle}\n style={[c.sizeTrigger, { borderColor, backgroundColor: surfaceColor }, triggerStyle]}\n >\n <Text style={[c.sizeTriggerText, { color: textColor }, triggerTextStyle]}>{pageSize}</Text>\n <Text style={[c.sizeChevron, { color: mutedColor }]} aria-hidden>{isOpen ? CHEVRON_UP : CHEVRON_DOWN}</Text>\n </Pressable>\n\n {/* Portal to document.body on web so no ancestor stacking context / overflow can trap or clip it. */}\n {isOpen ? (IS_WEB ? createPortal(menu, document.body) : menu) : null}\n </View>\n );\n}\n\nexport default SizeDropdown;\n","/**\n * PagerNav — the Pager's right-hand navigation cluster (rows-per-page control + First / Prev /\n * Next / Last). Split out of Pager.tsx so each file stays small and the page-math component\n * reads cleanly; purely presentational, driven by the resolved page bounds passed in.\n */\nimport React from 'react';\nimport { Pressable, Text, View } from 'react-native';\n\nimport { useUi, type UiTranslate } from '@dloizides/ui-feedback';\n\nimport { accessibleName } from '../accessibleName';\nimport { TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { SizeDropdown } from './SizeDropdown';\nimport { chromeStyles as c } from './styles';\nimport type { PagerStyleOverrides } from './Pager';\n\nconst FIRST_PAGE = 1;\nconst DISABLED_OPACITY = 0.4;\nconst FULL_OPACITY = 1;\nconst TRANSPARENT = 'transparent';\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 styleOverrides?: Pick<PagerStyleOverrides, 'control' | 'controlText'>;\n}\n\nfunction NavButton({ label, hint, disabled, onPress, color, border, testID, styleOverrides: o }: NavButtonProps): React.ReactElement {\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 : FULL_OPACITY }, o?.control]}\n >\n <Text style={[c.controlText, { color }, o?.controlText]}>{label}</Text>\n </Pressable>\n );\n}\n\nexport interface PagerNavProps {\n pageSize: number;\n pageSizeOptions: readonly number[];\n onPageSizeChange: (pageSize: number) => void;\n onPageChange: (page: number) => void;\n safePage: number;\n lastPage: number;\n isCompact: boolean;\n isDropdown: boolean;\n showFirstLast: boolean;\n testID: string;\n styleOverrides?: PagerStyleOverrides;\n}\n\n/**\n * Accessible NAME of the rows-per-page control — \"Rows per page, currently 50\", never the\n * bare \"50\" it used to be, which announces the value but never says what the control is.\n */\nfunction rowsTriggerLabel(t: UiTranslate, pageSize: number): string {\n const size = String(pageSize);\n return accessibleName(t(TABLE_I18N.pagerRowsTriggerLabel, size), TABLE_I18N.pagerRowsTriggerLabel, size);\n}\n\n/**\n * Accessible NAME of ONE rows-per-page choice — \"Show 100 rows per page\". Shared by the\n * `dropdown` options AND the default `pills`, which carried the identical bare-number defect.\n */\nfunction rowsOptionLabel(t: UiTranslate, optionSize: number): string {\n const size = String(optionSize);\n return accessibleName(t(TABLE_I18N.pagerRowsOptionLabel, size), TABLE_I18N.pagerRowsOptionLabel, size);\n}\n\n/** The rows-per-page control (hidden when compact): a dropdown or a row of size pills. */\nfunction RowsControl({ pageSize, pageSizeOptions, onPageSizeChange, isDropdown, testID, styleOverrides: o }: Pick<PagerNavProps, 'pageSize' | 'pageSizeOptions' | 'onPageSizeChange' | 'isDropdown' | 'testID' | 'styleOverrides'>): React.ReactElement {\n const { theme, t } = useUi();\n const { colors, palette } = theme;\n const brand = palette.primary['500'];\n\n return (\n <>\n <Text style={[isDropdown ? c.pagerRowsLabelPlain : c.pagerRowsLabel, { color: colors.textSecondary }, o?.pagerRowsLabel]}>\n {t(TABLE_I18N.pagerRows)}\n </Text>\n {isDropdown ? (\n <SizeDropdown\n pageSize={pageSize}\n pageSizeOptions={pageSizeOptions}\n onPageSizeChange={onPageSizeChange}\n testID={testID}\n triggerLabel={rowsTriggerLabel(t, pageSize)}\n getOptionLabel={(size) => rowsOptionLabel(t, size)}\n triggerHint={t(TABLE_I18N.pagerRowsTriggerHint)}\n optionHint={t(TABLE_I18N.pagerRowsOptionHint)}\n textColor={colors.text}\n mutedColor={colors.textSecondary}\n borderColor={colors.border}\n surfaceColor={colors.surface}\n brandColor={brand}\n triggerStyle={o?.sizePill}\n triggerTextStyle={o?.sizePillText}\n />\n ) : (\n <View style={[c.sizeGroup, o?.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={rowsOptionLabel(t, 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 }, o?.sizePill]}\n >\n <Text style={[c.sizePillText, { color: active ? colors.surface : colors.textSecondary }, o?.sizePillText]}>{size}</Text>\n </Pressable>\n );\n })}\n </View>\n )}\n </>\n );\n}\n\nexport function PagerNav({\n pageSize,\n pageSizeOptions,\n onPageSizeChange,\n onPageChange,\n safePage,\n lastPage,\n isCompact,\n isDropdown,\n showFirstLast,\n testID,\n styleOverrides: o,\n}: PagerNavProps): React.ReactElement {\n const { theme, t } = useUi();\n const { colors } = theme;\n const atFirst = safePage <= FIRST_PAGE;\n const atLast = safePage >= lastPage;\n const showJumps = showFirstLast && !isCompact;\n\n return (\n <View style={[c.pagerNav, o?.pagerNav]}>\n {!isCompact && (\n <RowsControl\n pageSize={pageSize}\n pageSizeOptions={pageSizeOptions}\n onPageSizeChange={onPageSizeChange}\n isDropdown={isDropdown}\n testID={testID}\n styleOverrides={o}\n />\n )}\n {showJumps && (\n <NavButton\n label={t(TABLE_I18N.pagerFirst)}\n hint={t(TABLE_I18N.pagerFirstHint)}\n disabled={atFirst}\n onPress={() => onPageChange(FIRST_PAGE)}\n color={colors.text}\n border={colors.border}\n styleOverrides={o}\n testID={TABLE_TEST_IDS.pagerFirst}\n />\n )}\n <NavButton\n label={t(TABLE_I18N.pagerPrev)}\n hint={t(TABLE_I18N.pagerPrevHint)}\n disabled={atFirst}\n onPress={() => onPageChange(safePage - 1)}\n color={colors.text}\n border={colors.border}\n styleOverrides={o}\n testID={TABLE_TEST_IDS.pagerPrev}\n />\n <NavButton\n label={t(TABLE_I18N.pagerNext)}\n hint={t(TABLE_I18N.pagerNextHint)}\n disabled={atLast}\n onPress={() => onPageChange(safePage + 1)}\n color={colors.text}\n border={colors.border}\n styleOverrides={o}\n testID={TABLE_TEST_IDS.pagerNext}\n />\n {showJumps && (\n <NavButton\n label={t(TABLE_I18N.pagerLast)}\n hint={t(TABLE_I18N.pagerLastHint)}\n disabled={atLast}\n onPress={() => onPageChange(lastPage)}\n color={colors.text}\n border={colors.border}\n styleOverrides={o}\n testID={TABLE_TEST_IDS.pagerLast}\n />\n )}\n </View>\n );\n}\n\nexport default PagerNav;\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 { Text, View, useWindowDimensions, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE_OPTIONS, TABLE_I18N, TABLE_TEST_IDS } from './constants';\nimport { PagerNav } from './PagerNav';\nimport { chromeStyles as c } from './styles';\n\nconst FIRST_PAGE = 1;\nconst EN_DASH = '–';\nconst BOLD = '700' as const;\n\n/**\n * Per-slot style overrides for the Pager, merged **LAST** into each slot's style array\n * so the consumer always wins — over the base StyleSheet AND over the inline colours\n * taken from `useUi().theme`. Omit for the shared defaults (nothing changes).\n */\nexport interface PagerStyleOverrides {\n /** The outer pager row. */\n pager?: StyleProp<ViewStyle>;\n /** The `from–to of N` count line. */\n pagerInfo?: StyleProp<TextStyle>;\n /** The right-hand nav cluster (rows-per-page + Prev/Next). */\n pagerNav?: StyleProp<ViewStyle>;\n /** The \"Rows\" caption before the size pills. */\n pagerRowsLabel?: StyleProp<TextStyle>;\n /** The rows-per-page pill group. */\n sizeGroup?: StyleProp<ViewStyle>;\n /** A Prev/Next button. */\n control?: StyleProp<ViewStyle>;\n /** A Prev/Next button's label. */\n controlText?: StyleProp<TextStyle>;\n /** A rows-per-page pill. */\n sizePill?: StyleProp<ViewStyle>;\n /** A rows-per-page pill's label. */\n sizePillText?: StyleProp<TextStyle>;\n}\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 * How the rows-per-page control renders. `'pills'` (default) keeps the RN-idiom row of\n * pressable size pills — byte-identical for every existing consumer. `'dropdown'` swaps in\n * a compact `<select>`-like anchored dropdown matching the v1 console's \"Rows\" select\n * (compact trigger + chevron, popover of options, close on outside-click / Escape) and a\n * mixed-case \"Rows\" caption.\n */\n rowsVariant?: 'pills' | 'dropdown';\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 /**\n * Optional, already-translated SINGULAR unit noun, used in place of `unitLabel` when\n * `total === 1` (e.g. `unitLabel=\"results\"` + `unitLabelSingular=\"result\"` → `1–1 of 1 result`).\n * Ignored unless `unitLabel` is also set; when omitted, `unitLabel` is used at every count.\n */\n unitLabelSingular?: string;\n /**\n * Render First / Last jump buttons flanking Prev / Next (reconciling erevna's\n * `PaginationControls`). Off by default (byte-identical to prior behaviour) — the two\n * buttons only appear when explicitly enabled.\n */\n showFirstLast?: boolean;\n /**\n * Collapse to a compact, mobile-friendly nav below `stackBreakpoint`: the rows-per-page\n * control and the First/Last jumps are hidden, leaving Prev / Next + the count line. Off by\n * default (byte-identical). Auto-driven by the window width, mirroring the DataTable card-stack.\n */\n responsive?: boolean;\n /** Width (px) below which `responsive` collapses to the compact nav. Default 640 (shared with DataTable). */\n stackBreakpoint?: number;\n /**\n * Optional, already-translated word prefixed to the count line, e.g. `\"Showing\"` renders\n * `Showing 1–50 of 3,023 leadership terms`. Omit for the bare `from–to of N` line\n * (byte-identical to prior behaviour).\n */\n infoPrefix?: string;\n /**\n * Render the three counts (from / to / total) in bold `colors.text` — matching the v1\n * console's `.ui-pager__info b`. Off by default (the whole line stays `textSecondary`,\n * byte-identical to prior behaviour); the concatenated text is unchanged either way.\n */\n boldNumbers?: boolean;\n /**\n * Per-slot style overrides, merged LAST so the consumer always wins — including over\n * the inline theme colours. Omit for the shared defaults.\n */\n styleOverrides?: PagerStyleOverrides;\n testID?: string;\n}\n\nexport function Pager({\n page,\n pageSize,\n total,\n onPageChange,\n onPageSizeChange,\n pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS,\n rowsVariant = 'pills',\n unitLabel,\n unitLabelSingular,\n showFirstLast = false,\n responsive = false,\n stackBreakpoint = CARD_STACK_BREAKPOINT,\n infoPrefix,\n boldNumbers = false,\n styleOverrides: o,\n testID = TABLE_TEST_IDS.pager,\n}: PagerProps): React.ReactElement {\n const { theme, t } = useUi();\n const { colors } = theme;\n const { width } = useWindowDimensions();\n const isDropdown = rowsVariant === 'dropdown';\n // Below the breakpoint (opt-in) collapse to Prev/Next + count only — drop the rows-per-page\n // control and the First/Last jumps, mirroring the DataTable's card-stack behaviour.\n const isCompact = responsive && width < stackBreakpoint;\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 hasUnit = unitLabel !== undefined && unitLabel !== '';\n // Singularise the unit noun when exactly one row matches (needs both a base unit AND a singular).\n const resolvedUnit = total === 1 && unitLabelSingular !== undefined && unitLabelSingular !== '' ? unitLabelSingular : unitLabel;\n const hasPrefix = infoPrefix !== undefined && infoPrefix !== '';\n const prefix = hasPrefix ? `${infoPrefix} ` : '';\n const ofWord = t(TABLE_I18N.pagerInfo);\n const unitSuffix = hasUnit ? ` ${resolvedUnit}` : '';\n const count = `${from.toLocaleString()}${EN_DASH}${to.toLocaleString()} ${ofWord} ${total.toLocaleString()}`;\n const info = `${prefix}${count}${unitSuffix}`;\n const boldStyle = { color: colors.text, fontWeight: BOLD };\n\n return (\n <View style={[c.pager, o?.pager]} testID={testID}>\n <Text style={[c.pagerInfo, { color: colors.textSecondary }, o?.pagerInfo]} testID={TABLE_TEST_IDS.pagerInfo}>\n {boldNumbers ? (\n <>\n {prefix}\n <Text style={boldStyle}>{from.toLocaleString()}</Text>\n {EN_DASH}\n <Text style={boldStyle}>{to.toLocaleString()}</Text>\n {` ${ofWord} `}\n <Text style={boldStyle}>{total.toLocaleString()}</Text>\n {unitSuffix}\n </>\n ) : (\n info\n )}\n </Text>\n <PagerNav\n pageSize={pageSize}\n pageSizeOptions={pageSizeOptions}\n onPageSizeChange={onPageSizeChange}\n onPageChange={onPageChange}\n safePage={safePage}\n lastPage={lastPage}\n isCompact={isCompact}\n isDropdown={isDropdown}\n showFirstLast={showFirstLast}\n testID={testID}\n styleOverrides={o}\n />\n </View>\n );\n}\n\nexport default Pager;\n","/**\n * Shared StyleSheet for the declarative Filters bar — the BAR's own chrome only.\n *\n * F2: the field/label/input/menu metrics that used to live here moved to\n * `@dloizides/ui-forms`' `controlStyles`, and this file imports them back rather than keeping a\n * copy. That matters: this file's previous header noted it had \"reconcile[d] the per-field styles\n * that were copy-pasted across aml-v2's filter files into one shared source\" — and then locked the\n * reconciliation inside one bar. Re-forking them here would recreate exactly the split the move\n * set out to close, this time between two packages instead of two apps.\n *\n * Colours are applied inline from `useUi().theme` at render — nothing here carries a colour literal.\n */\nimport { StyleSheet } from 'react-native';\n\nimport { controlStyles } from '@dloizides/ui-forms';\n\nimport { MIN_TARGET_PX } from '../minTarget';\n\nconst FIELD_GAP = 4;\nconst SWITCH_ROW_GAP = 8;\nconst ACTION_PAD_H = 14;\nconst ACTION_PAD_V = 8;\nconst ACTION_RADIUS = 8;\nconst ACTION_FONT = 13;\nconst ACTION_BORDER = 1;\n/** `Field` carries the 16px vertical form rhythm; a filter bar spaces via FilterBar's own gap. */\nconst NO_FORM_RHYTHM = 0;\n\nexport const filterStyles = StyleSheet.create({\n /**\n * Merged onto `Field`'s container inside the bar. Zeroes the 16px bottom margin `Field` gives\n * a stacked form row: the bar is a flex ROW whose spacing comes from FilterBar's `gap`, so\n * inheriting the form rhythm would add a phantom gap under every field — a pixel change for\n * six live portals, which this wave must not make.\n */\n fieldInBar: { marginBottom: NO_FORM_RHYTHM },\n switchRow: { minHeight: MIN_TARGET_PX, flexDirection: 'row', alignItems: 'center', gap: SWITCH_ROW_GAP, paddingVertical: FIELD_GAP },\n /** A 44x44 pressable around the switch: RN-web draws the Switch at 40x20 and that box IS its hit target. */\n switchHit: { minWidth: MIN_TARGET_PX, minHeight: MIN_TARGET_PX, alignItems: 'center', justifyContent: 'center' },\n /** The inner Switch takes no pointer events, so one tap toggles once (via `switchHit`), not twice. */\n switchInert: { pointerEvents: 'none' },\n action: { minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, alignItems: 'center', justifyContent: 'center', paddingHorizontal: ACTION_PAD_H, paddingVertical: ACTION_PAD_V, borderRadius: ACTION_RADIUS, borderWidth: ACTION_BORDER },\n actionText: { fontSize: ACTION_FONT, fontWeight: '600' },\n});\n\n/**\n * The dense-control metrics, re-exported from `@dloizides/ui-forms` so the bar's remaining\n * in-tree fields (`TextField`, `BooleanField`) use the SAME `input` / `subLabel` boxes as the\n * promoted controls rather than a second copy.\n */\nexport { controlStyles };\n","/**\n * ActionButton — the themed Apply / Clear button the declarative bar renders in its actions\n * slot. A bordered pill (primary = brand fill, ghost = bordered) kept in-tree so ui-tables\n * needs no ui-buttons dependency; richer buttons (Export with a spinner) go in the caller's\n * own `actions` slot.\n */\nimport React from 'react';\nimport { Pressable, Text } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { filterStyles as s } from '../styles';\n\nconst DISABLED_OPACITY = 0.4;\nconst FULL_OPACITY = 1;\nconst TRANSPARENT = 'transparent';\n\nexport interface ActionButtonProps {\n label: string;\n hint: string;\n tone: 'primary' | 'ghost';\n disabled?: boolean;\n onPress: () => void;\n testID: string;\n}\n\nexport function ActionButton({ label, hint, tone, disabled = false, onPress, testID }: ActionButtonProps): React.ReactElement {\n const { theme } = useUi();\n const { colors, palette } = theme;\n const isPrimary = tone === 'primary';\n const brand = palette.primary['500'];\n\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityHint={hint}\n accessibilityState={{ disabled }}\n disabled={disabled}\n onPress={onPress}\n style={[\n s.action,\n {\n borderColor: isPrimary ? brand : colors.border,\n backgroundColor: isPrimary ? brand : TRANSPARENT,\n opacity: disabled ? DISABLED_OPACITY : FULL_OPACITY,\n },\n ]}\n testID={testID}\n >\n <Text style={[s.actionText, { color: isPrimary ? colors.surface : colors.text }]}>{label}</Text>\n </Pressable>\n );\n}\n\nexport default ActionButton;\n","/**\n * Constants for the declarative Filters bar — every test id, i18n key and layout number in\n * one place so the components carry no magic numbers and no ad-hoc strings.\n */\nimport type { FilterFieldKind } from './types';\n\n/** Root testID of the declarative filter bar. */\nexport const FILTERS_TEST_ID = 'ui-filters-declarative';\n\n/** Default minimum widths (px) per field kind before it wraps. */\nexport const FIELD_MIN_WIDTH: Record<FilterFieldKind, number> = {\n select: 150,\n text: 200,\n number: 130,\n dateRange: 260,\n typeahead: 200,\n boolean: 150,\n};\n\n/**\n * Typeahead defaults. F2: these are RE-EXPORTED from `@dloizides/ui-forms`, which now owns the\n * control they configure — a second copy here could drift from the behaviour it claims to\n * describe. The public names are unchanged, so consumers importing them from `ui-tables` are\n * unaffected.\n */\nexport {\n DEFAULT_TYPEAHEAD_MIN_CHARS,\n DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS,\n} from '@dloizides/ui-forms';\n\n/** Derived testIDs for the declarative bar. */\nexport const fieldTestID = (barTestID: string, key: string): string => `${barTestID}-field-${key}`;\nexport const applyTestID = (barTestID: string): string => `${barTestID}-apply`;\nexport const clearTestID = (barTestID: string): string => `${barTestID}-clear`;\n\n/**\n * Translation keys for the bar's own controls. Apps map these in their UiProvider `t`; the\n * neutral default `t` returns the key, so a forgotten key degrades to the key, never a literal.\n * A caller may also override any of them with a pre-localized string prop on {@link Filters}.\n */\nexport const FILTERS_I18N = {\n apply: 'uiTables.filters.apply',\n applyHint: 'uiTables.filters.applyHint',\n clear: 'uiTables.filters.clear',\n clearHint: 'uiTables.filters.clearHint',\n selectPlaceholder: 'uiTables.filters.selectPlaceholder',\n dropdownHint: 'uiTables.filters.dropdownHint',\n optionHint: 'uiTables.filters.optionHint',\n /**\n * Accessible NAME of a select trigger, e.g. \"{{p1}}: {{p2}}\" → \"Status: Active\". The\n * trigger's `accessibilityLabel` REPLACES its visible text for a screen reader, so labelling\n * it with the field name alone silently hides the current selection. Untranslated it\n * degrades to the field label alone (prior behaviour) — never to the raw key.\n */\n selectTriggerLabel: 'uiTables.filters.selectTriggerLabel',\n from: 'uiTables.filters.from',\n to: 'uiTables.filters.to',\n} as const;\n","/**\n * BooleanField — a themed RN `Switch` for a boolean filter (aml's `includeRelatives` /\n * `prioritize`). The label sits inline to the LEFT of the switch (switch-row idiom), not\n * above it, so it reads as a toggle rather than an input.\n *\n * F2 — why this did NOT move to `ui-forms` with its siblings: `ui-forms` already ships\n * `FormSwitch`, the same idea at different metrics (`space-between` + 12px bottom margin +\n * a 600-weight label, versus this row's 8px gap and 11px micro-caption). Promoting this would\n * put two switch rows in one package; converging onto `FormSwitch` moves pixels. Both belong in\n * the visual-QA-gated wave. It shares `controlStyles.subLabel`, so no metric is forked.\n */\nimport React from 'react';\nimport { Pressable, Switch, Text, View } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { fieldTestID } from '../constants';\nimport { controlStyles, filterStyles as s } from '../styles';\nimport type { BooleanFilterField } from '../types';\n\nexport interface BooleanFieldProps {\n field: BooleanFilterField;\n barTestID: string;\n value: boolean;\n onChange: (value: boolean) => void;\n}\n\nexport function BooleanField({ field, barTestID, value, onChange }: BooleanFieldProps): React.ReactElement {\n const { theme } = useUi();\n const { colors, palette } = theme;\n const testID = field.testID ?? fieldTestID(barTestID, field.key);\n\n return (\n <View style={s.switchRow} testID={testID}>\n <Text style={[controlStyles.subLabel, { color: colors.text }]}>{field.label}</Text>\n {/* The Pressable is the 44x44 pointer target; the Switch keeps its visual size, its focus and\n its a11y role. `accessible={false}` + `focusable={false}` keep the wrapper out of the\n a11y tree and the tab order, so assistive tech still meets exactly one switch. */}\n <Pressable\n accessible={false}\n focusable={false}\n onPress={() => onChange(!value)}\n style={s.switchHit}\n testID={`${testID}-switch-hit`}\n >\n <Switch\n accessibilityLabel={field.label}\n accessibilityHint={field.accessibilityHint}\n accessibilityRole=\"switch\"\n accessibilityState={{ checked: value }}\n trackColor={{ false: colors.border, true: palette.primary['500'] }}\n thumbColor={colors.surface}\n value={value}\n onValueChange={onChange}\n style={s.switchInert}\n testID={`${testID}-switch`}\n />\n </Pressable>\n </View>\n );\n}\n\nexport default BooleanField;\n","/**\n * DateRangeField — the ADAPTER binding this bar's {@link DateRangeFilterField} schema to\n * `@dloizides/ui-forms`' `DateRangeControl`.\n *\n * The from/to pair (web `type=\"date\"`, one-sided patching) moved to ui-forms in F2. What stays is\n * the schema binding, the derived testID, and the per-field sub-label override — `field.fromLabel`\n * beats the bar's default, which the bar resolved from `FILTERS_I18N.from` / `.to`. Those keys\n * stay owned by this package, so the manifest is untouched.\n */\nimport React from 'react';\n\nimport { DateRangeControl } from '@dloizides/ui-forms';\n\nimport { fieldTestID } from '../constants';\nimport type { DateRangeFilterField, DateRangeValue } from '../types';\n\nexport interface DateRangeFieldProps {\n field: DateRangeFilterField;\n barTestID: string;\n value: DateRangeValue;\n onChange: (value: DateRangeValue) => void;\n onSubmit: () => void;\n fromLabel: string;\n toLabel: string;\n}\n\nexport function DateRangeField({ field, barTestID, value, onChange, onSubmit, fromLabel, toLabel }: DateRangeFieldProps): React.ReactElement {\n return (\n <DateRangeControl\n accessibilityHint={field.accessibilityHint}\n fromLabel={field.fromLabel ?? fromLabel}\n fromPlaceholder={field.fromPlaceholder}\n testID={field.testID ?? fieldTestID(barTestID, field.key)}\n toLabel={field.toLabel ?? toLabel}\n toPlaceholder={field.toPlaceholder}\n value={value}\n onChange={onChange}\n onSubmit={onSubmit}\n />\n );\n}\n\nexport default DateRangeField;\n","/**\n * SelectField — the ADAPTER binding this bar's declarative {@link SelectFilterField} schema to\n * `@dloizides/ui-forms`' `SelectControl`.\n *\n * The control itself (trigger, chevron, anchored menu, dismissal) moved to ui-forms in F2, where\n * every portal can reach it — six of them had reimplemented it because they could not. What stays\n * here is exactly what is FILTER-BAR-shaped and must not migrate:\n *\n * - the schema binding (`field.options` / `field.placeholder` / `field.testID` → plain props);\n * - the derived testID (`${barTestID}-field-${key}`);\n * - the i18n. `ui-forms` never calls `t`, so the trigger's accessible NAME is composed HERE\n * through `useUi().t` against `FILTERS_I18N.selectTriggerLabel`. That keeps the exported\n * FILTERS_I18N manifest — which every portal's guard binds to LIVE — working untouched.\n *\n * Apps that need ui-layout's responsive modal/bottom-sheet select still inject it via\n * `Filters.renderSelect`; `SelectControl` is the dependency-free default.\n */\nimport React from 'react';\n\nimport { useUi } from '@dloizides/ui-feedback';\nimport { SelectControl } from '@dloizides/ui-forms';\n\nimport { accessibleName } from '../../accessibleName';\nimport { FILTERS_I18N, fieldTestID } from '../constants';\nimport type { SelectFilterField } from '../types';\n\nexport interface SelectFieldProps {\n field: SelectFilterField;\n barTestID: string;\n value: string;\n onChange: (value: string) => void;\n /** Pre-localized fallback placeholder when the field supplies none and the value is unset. */\n placeholder: string;\n /** Pre-localized accessibility hint for the trigger + options. */\n dropdownHint: string;\n optionHint: string;\n}\n\nexport function SelectField({ field, barTestID, value, onChange, placeholder, dropdownHint, optionHint }: SelectFieldProps): React.ReactElement {\n const { t } = useUi();\n const testID = field.testID ?? fieldTestID(barTestID, field.key);\n const resolvedPlaceholder = field.placeholder ?? placeholder;\n\n // The label the control will DISPLAY — resolved here too, because the accessible name must\n // carry it. That name REPLACES the trigger's visible text for a screen reader, so labelling\n // it with the field name alone silently hides the current selection.\n const selectedLabel = field.options.find((o) => o.value === value)?.label ?? resolvedPlaceholder;\n\n const triggerLabel = accessibleName(\n t(FILTERS_I18N.selectTriggerLabel, field.label, selectedLabel),\n FILTERS_I18N.selectTriggerLabel,\n field.label,\n );\n\n return (\n <SelectControl\n accessibilityHint={field.accessibilityHint ?? dropdownHint}\n accessibilityLabel={triggerLabel}\n options={field.options}\n optionHint={optionHint}\n placeholder={resolvedPlaceholder}\n testID={testID}\n value={value}\n onChange={onChange}\n />\n );\n}\n\nexport default SelectField;\n","/**\n * TextField — renders both the `text` (free search) and `number` (numeric) field kinds; the\n * only difference is the keyboard. Enter/submit calls the bar's `onSubmit` (Apply) so a\n * keyboard user commits a draft without reaching for the mouse (aml's `onSubmitEditing`).\n *\n * F2 — why this did NOT move to `ui-forms` with its siblings: `ui-forms` already ships TWO text\n * inputs (`ThemedTextInput` and `FormField`). Promoting a third would ADD a duplicate to the very\n * package this campaign is de-duplicating. The right convergence is to render this on\n * `ThemedTextInput`, but that swaps in the focus ring, the hover border and the\n * `surfaceElevated` rest background — a visible change for six live portals, so it belongs in the\n * visual-QA-gated wave, not here. It uses the shared `controlStyles.input` box meanwhile, so\n * there is no forked metric.\n */\nimport React from 'react';\nimport { TextInput } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { fieldTestID } from '../constants';\nimport { controlStyles as s } from '../styles';\nimport type { NumberFilterField, TextFilterField } from '../types';\n\nexport interface TextFieldProps {\n field: TextFilterField | NumberFilterField;\n barTestID: string;\n value: string;\n onChange: (value: string) => void;\n onSubmit: () => void;\n}\n\nexport function TextField({ field, barTestID, value, onChange, onSubmit }: TextFieldProps): React.ReactElement {\n const { theme } = useUi();\n const { colors } = theme;\n const isNumber = field.kind === 'number';\n\n return (\n <TextInput\n accessibilityLabel={field.label}\n accessibilityHint={field.accessibilityHint}\n keyboardType={isNumber ? 'numeric' : 'default'}\n placeholder={field.placeholder}\n placeholderTextColor={colors.textSecondary}\n value={value}\n onChangeText={onChange}\n onSubmitEditing={onSubmit}\n style={[s.input, { borderColor: colors.border, backgroundColor: colors.surface, color: colors.text }]}\n testID={`${field.testID ?? fieldTestID(barTestID, field.key)}-input`}\n />\n );\n}\n\nexport default TextField;\n","/**\n * TypeaheadField — the ADAPTER binding this bar's {@link TypeaheadFilterField} schema to\n * `@dloizides/ui-forms`' `TypeaheadControl`.\n *\n * The combobox itself (ranked suggestions, blur-delay, canonical-label fill, error banner) moved\n * to ui-forms in F2. What stays is the schema binding and the derived testID. This field carries\n * NO i18n keys of its own — its strings arrive pre-resolved from the bar — so nothing here\n * touches the FILTERS_I18N manifest.\n */\nimport React from 'react';\n\nimport { TypeaheadControl } from '@dloizides/ui-forms';\n\nimport { DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, fieldTestID } from '../constants';\nimport type { TypeaheadFilterField } from '../types';\n\nexport interface TypeaheadFieldProps {\n field: TypeaheadFilterField;\n barTestID: string;\n value: string;\n onChange: (value: string) => void;\n onSubmit: () => void;\n optionHint: string;\n}\n\nexport function TypeaheadField({ field, barTestID, value, onChange, onSubmit, optionHint }: TypeaheadFieldProps): React.ReactElement {\n return (\n <TypeaheadControl\n accessibilityHint={field.accessibilityHint}\n accessibilityLabel={field.label}\n error={field.error}\n maxSuggestions={field.maxSuggestions ?? DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS}\n minChars={field.minChars ?? DEFAULT_TYPEAHEAD_MIN_CHARS}\n options={field.options}\n optionHint={optionHint}\n placeholder={field.placeholder}\n testID={field.testID ?? fieldTestID(barTestID, field.key)}\n value={value}\n onChange={onChange}\n onSubmit={onSubmit}\n />\n );\n}\n\nexport default TypeaheadField;\n","import { Platform, type ViewStyle } from 'react-native';\n\n/**\n * A filter field's minimum width, never wider than its container.\n *\n * `minWidth` beats `maxWidth` in both CSS and Yoga, so a 260px date-range floor inside a ~330px phone\n * card still overflowed with `maxWidth: '100%'` alone. On web `min(Npx, 100%)` keeps the exact floor\n * at desktop widths (the bar wraps fields at the same breakpoints as before) and yields to the\n * container below it. Native keeps the plain number: Yoga has no `min()`.\n */\nexport function clampedMinWidth(minWidth: number): ViewStyle['minWidth'] {\n if (Platform.OS !== 'web') return minWidth;\n return `min(${minWidth}px, 100%)` as unknown as ViewStyle['minWidth'];\n}\n","/**\n * FilterFieldView — dispatches one {@link FilterField} to its renderer, wired to the value map.\n * Reads the field's typed value out of {@link FilterValues} (coercing a missing/mismatched\n * entry to that kind's empty value) and writes edits back via `setField`. `boolean` renders its\n * own inline switch-row; every other kind is wrapped in `@dloizides/ui-forms`' `Field`.\n *\n * F2: the label wrapper used to be a PRIVATE `FieldShell` fork, which existed only because\n * `Field` hard-coded the 13/600 `field` label voice and offered no way out. `Field` now names\n * both contract voices, so the fork is deleted and the bar asks for `labelVariant=\"control\"`\n * (11/700/uppercase) — the exact metrics `FieldShell` carried. One label implementation, and the\n * label-metric split that caused several defects this campaign is gone.\n */\nimport React from 'react';\n\nimport { Field } from '@dloizides/ui-forms';\n\nimport { BooleanField } from './BooleanField';\nimport { DateRangeField } from './DateRangeField';\nimport { SelectField } from './SelectField';\nimport { TextField } from './TextField';\nimport { TypeaheadField } from './TypeaheadField';\nimport { FIELD_MIN_WIDTH, fieldTestID } from '../constants';\nimport { clampedMinWidth } from '../utils/clampedMinWidth';\nimport { filterStyles as s } from '../styles';\nimport type { DateRangeValue, FilterField, FilterValue, FilterValues, SelectFilterField } from '../types';\n\nconst EMPTY_RANGE: DateRangeValue = { from: '', to: '' };\nconst GROW_FLEX = 1;\n\n/** Resolved, pre-localized strings the bar passes down to every field. */\nexport interface FieldStrings {\n selectPlaceholder: string;\n dropdownHint: string;\n optionHint: string;\n fromLabel: string;\n toLabel: string;\n}\n\n/**\n * Args for a custom select renderer — the injection point apps use to swap the built-in\n * in-tree dropdown for `@dloizides/ui-layout`'s responsive ModalDropdown (modal on mobile /\n * native, inline menu on desktop). The label wrapper is still supplied by the bar.\n */\nexport interface RenderSelectArgs {\n field: SelectFilterField;\n value: string;\n onChange: (value: string) => void;\n /** The field's canonical testID (`${barTestID}-field-${key}` unless overridden). */\n testID: string;\n}\n\nexport interface FilterFieldViewProps {\n field: FilterField;\n barTestID: string;\n values: FilterValues;\n setField: (key: string, value: FilterValue) => void;\n onSubmit: () => void;\n strings: FieldStrings;\n /** Optional custom select renderer (e.g. inject ui-layout's ModalDropdown). */\n renderSelect?: (args: RenderSelectArgs) => React.ReactNode;\n}\n\nfunction asString(value: FilterValue | undefined): string {\n return typeof value === 'string' ? value : '';\n}\nfunction asBool(value: FilterValue | undefined): boolean {\n return value === true;\n}\nfunction asRange(value: FilterValue | undefined): DateRangeValue {\n if (typeof value === 'object' && value !== null && 'from' in value && 'to' in value) return value;\n return EMPTY_RANGE;\n}\n\nexport function FilterFieldView({ field, barTestID, values, setField, onSubmit, strings, renderSelect }: FilterFieldViewProps): React.ReactElement {\n const raw = values[field.key];\n\n if (field.kind === 'boolean') {\n return <BooleanField field={field} barTestID={barTestID} value={asBool(raw)} onChange={(v) => setField(field.key, v)} />;\n }\n\n const body = ((): React.ReactNode => {\n switch (field.kind) {\n case 'select':\n if (renderSelect !== undefined) {\n return renderSelect({\n field,\n value: asString(raw),\n onChange: (v) => setField(field.key, v),\n testID: field.testID ?? fieldTestID(barTestID, field.key),\n });\n }\n return (\n <SelectField\n field={field}\n barTestID={barTestID}\n value={asString(raw)}\n onChange={(v) => setField(field.key, v)}\n placeholder={strings.selectPlaceholder}\n dropdownHint={strings.dropdownHint}\n optionHint={strings.optionHint}\n />\n );\n case 'typeahead':\n return (\n <TypeaheadField\n field={field}\n barTestID={barTestID}\n value={asString(raw)}\n onChange={(v) => setField(field.key, v)}\n onSubmit={onSubmit}\n optionHint={strings.optionHint}\n />\n );\n case 'dateRange':\n return (\n <DateRangeField\n field={field}\n barTestID={barTestID}\n value={asRange(raw)}\n onChange={(v) => setField(field.key, v)}\n onSubmit={onSubmit}\n fromLabel={strings.fromLabel}\n toLabel={strings.toLabel}\n />\n );\n default:\n return (\n <TextField\n field={field}\n barTestID={barTestID}\n value={asString(raw)}\n onChange={(v) => setField(field.key, v)}\n onSubmit={onSubmit}\n />\n );\n }\n })();\n\n // The per-field width/grow reflow rules (fields wrap to new lines as the bar narrows) and the\n // caller's own override, applied LAST. `s.fieldInBar` zeroes `Field`'s 16px form rhythm — see\n // its comment; inheriting it would add a phantom gap under every field in six live portals.\n const minWidth = field.minWidth ?? FIELD_MIN_WIDTH[field.kind];\n const grow = field.grow === true ? { flexGrow: GROW_FLEX } : null;\n\n return (\n <Field\n containerStyle={[s.fieldInBar, { minWidth: clampedMinWidth(minWidth), maxWidth: '100%' as const }, grow, field.style]}\n label={field.label}\n labelVariant=\"control\"\n testID={field.testID ?? fieldTestID(barTestID, field.key)}\n >\n {body}\n </Field>\n );\n}\n\nexport default FilterFieldView;\n","/**\n * Filters — the declarative, configurable filter bar every portal shares. A caller passes a\n * `fields` schema + a `values` map + `onChange`; the bar renders the same structure + behaviour\n * everywhere, themed per app. It builds ON the existing {@link FilterBar} shell (so its live\n * results count + WCAG live region + actions slot are reused unchanged).\n *\n * Two value models, selected by whether `onApply` is passed:\n * - LIVE (no `onApply`): each edit calls `onChange` immediately (agora, zygos). No Apply button.\n * - DRAFT/APPLY (`onApply` set): edits accumulate in the caller's draft (see {@link useFilterDraft});\n * an Apply button + Enter-in-a-field commit it (aml, kefi audit). Pass `onClear` for a Reset.\n *\n * Contract discipline: every user-facing string is a pre-localized value — supplied per-field, via\n * the `*Label`/`*Placeholder` props, or resolved through the UiProvider `t` (which defaults to the\n * i18n KEY, never a hardcoded literal). No FM/router/store; customisation is style + slots only.\n */\nimport React, { useCallback, useMemo } from 'react';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { FilterBar, type FilterBarStyleOverrides } from '../DataTable/FilterBar';\nimport { ActionButton } from './components/ActionButton';\nimport { FILTERS_I18N, FILTERS_TEST_ID, applyTestID, clearTestID } from './constants';\nimport { FilterFieldView, type FieldStrings, type RenderSelectArgs } from './fields/FilterFieldView';\nimport type { FilterField, FilterValue, FilterValues } from './types';\n\nexport interface FiltersProps {\n /** The declarative field schema — the SUPERSET of every portal's filters, as data. */\n fields: readonly FilterField[];\n /** The current value map (applied values in live mode, or the draft in draft/apply mode). */\n values: FilterValues;\n /** Called with the next full value map on every edit. */\n onChange: (next: FilterValues) => void;\n /** Live results count shown by the FilterBar (WCAG live region). Omit to hide. */\n resultsCount?: number;\n /** Pre-localized noun for the count (already singularised by the caller if needed). */\n resultsLabel?: string;\n /** When set, shows an Apply button + commits on Enter — the draft/apply model. Omit for live. */\n onApply?: () => void;\n /** Pre-localized Apply label / hint (default via UiProvider `t`). */\n applyLabel?: string;\n applyHint?: string;\n /** Disable Apply (e.g. while busy or when a date field is invalid — aml's gate). */\n applyDisabled?: boolean;\n /** When set, shows a Clear/Reset button. */\n onClear?: () => void;\n clearLabel?: string;\n clearHint?: string;\n /** Extra actions (Export CSV/PDF, bulk bar) rendered BEFORE the built-in Apply/Clear. */\n actions?: React.ReactNode;\n /** Pre-localized fallback placeholder for an unset select (default via `t`). */\n selectPlaceholder?: string;\n /** Pre-localized default sub-labels for date-range fields (default via `t`). */\n fromLabel?: string;\n toLabel?: string;\n /**\n * Optional custom renderer for `select` fields — the injection point for\n * `@dloizides/ui-layout`'s responsive `ModalDropdown` (or any other select). When omitted, the\n * dependency-free in-tree dropdown is used. The label wrapper stays supplied by the bar.\n */\n renderSelect?: (args: RenderSelectArgs) => React.ReactNode;\n /** FilterBar per-slot style overrides — merged LAST, so a consumer always wins. */\n styleOverrides?: FilterBarStyleOverrides;\n testID?: string;\n}\n\nexport function Filters({\n fields,\n values,\n onChange,\n resultsCount,\n resultsLabel,\n onApply,\n applyLabel,\n applyHint,\n applyDisabled = false,\n onClear,\n clearLabel,\n clearHint,\n actions,\n selectPlaceholder,\n fromLabel,\n toLabel,\n renderSelect,\n styleOverrides,\n testID = FILTERS_TEST_ID,\n}: FiltersProps): React.ReactElement {\n const { t } = useUi();\n\n const setField = useCallback(\n (key: string, value: FilterValue) => {\n onChange({ ...values, [key]: value });\n },\n [onChange, values],\n );\n\n // Enter in a text/number/date/typeahead field commits the draft (draft/apply); no-op when live.\n const onSubmit = useCallback(() => {\n if (onApply !== undefined && !applyDisabled) onApply();\n }, [onApply, applyDisabled]);\n\n const strings = useMemo<FieldStrings>(\n () => ({\n selectPlaceholder: selectPlaceholder ?? t(FILTERS_I18N.selectPlaceholder),\n dropdownHint: t(FILTERS_I18N.dropdownHint),\n optionHint: t(FILTERS_I18N.optionHint),\n fromLabel: fromLabel ?? t(FILTERS_I18N.from),\n toLabel: toLabel ?? t(FILTERS_I18N.to),\n }),\n [selectPlaceholder, fromLabel, toLabel, t],\n );\n\n const barActions = (\n <>\n {actions}\n {onClear !== undefined && (\n <ActionButton\n label={clearLabel ?? t(FILTERS_I18N.clear)}\n hint={clearHint ?? t(FILTERS_I18N.clearHint)}\n tone=\"ghost\"\n onPress={onClear}\n testID={clearTestID(testID)}\n />\n )}\n {onApply !== undefined && (\n <ActionButton\n label={applyLabel ?? t(FILTERS_I18N.apply)}\n hint={applyHint ?? t(FILTERS_I18N.applyHint)}\n tone=\"primary\"\n disabled={applyDisabled}\n onPress={onApply}\n testID={applyTestID(testID)}\n />\n )}\n </>\n );\n\n const hasActions = actions !== undefined || onClear !== undefined || onApply !== undefined;\n\n return (\n <FilterBar\n resultsCount={resultsCount}\n resultsLabel={resultsLabel}\n actions={hasActions ? barActions : undefined}\n styleOverrides={styleOverrides}\n testID={testID}\n >\n {fields.map((field) => (\n <FilterFieldView\n key={field.key}\n field={field}\n barTestID={testID}\n values={values}\n setField={setField}\n onSubmit={onSubmit}\n strings={strings}\n renderSelect={renderSelect}\n />\n ))}\n </FilterBar>\n );\n}\n\nexport default Filters;\n","/**\n * useFilterDraft — the draft-vs-applied state model harvested from aml-v2 (cases/leaders/peps)\n * and kefi's audit log: the bar edits a `draft`; nothing hits the query until `apply` commits it\n * to `committed`. `reset` returns both to the initial value. This is the reusable state engine\n * behind `Filters` in `mode=\"apply\"`; a screen can also drive it directly.\n *\n * The page-reset-to-1 invariant (universal across every portal's query hook — any narrowing or\n * reorder returns to page 1) is surfaced as `onApply`/`onReset` callbacks the caller wires to its\n * `setPage(1)`, so this hook stays free of any pagination coupling.\n */\nimport { useCallback, useMemo, useState } from 'react';\n\nimport type { FilterValue, FilterValues } from '../types';\n\nexport interface UseFilterDraftOptions<V extends FilterValues> {\n /** The initial (and reset target) value — the \"all filters cleared\" state. */\n initial: V;\n /** Fired when a draft is committed. Wire your `setPage(1)` + query refresh here. */\n onApply?: (committed: V) => void;\n /** Fired when the draft + committed are reset to `initial` (e.g. clear an inline error). */\n onReset?: () => void;\n}\n\nexport interface FilterDraft<V extends FilterValues> {\n /** The live, uncommitted value the bar edits. */\n draft: V;\n /** The committed value the query reads. */\n committed: V;\n /** Patch one field of the draft (merge, like aml's per-bar `set`). */\n setField: (key: string, value: FilterValue) => void;\n /** Replace the whole draft (the bar's `onChange`). */\n setDraft: (next: V) => void;\n /** Commit the draft → committed and fire `onApply`. */\n apply: () => void;\n /** Reset draft + committed to `initial` and fire `onReset`. */\n reset: () => void;\n /** True when the draft differs from the committed value (an Apply would change the result). */\n dirty: boolean;\n}\n\nfunction shallowEqual(a: FilterValues, b: FilterValues): boolean {\n return JSON.stringify(a) === JSON.stringify(b);\n}\n\nexport function useFilterDraft<V extends FilterValues>({ initial, onApply, onReset }: UseFilterDraftOptions<V>): FilterDraft<V> {\n const [draft, setDraft] = useState<V>(initial);\n const [committed, setCommitted] = useState<V>(initial);\n\n const setField = useCallback((key: string, value: FilterValue) => {\n setDraft((prev) => ({ ...prev, [key]: value }));\n }, []);\n\n const apply = useCallback(() => {\n setCommitted(draft);\n onApply?.(draft);\n }, [draft, onApply]);\n\n const reset = useCallback(() => {\n setDraft(initial);\n setCommitted(initial);\n onReset?.();\n }, [initial, onReset]);\n\n const dirty = useMemo(() => !shallowEqual(draft, committed), [draft, committed]);\n\n return { draft, committed, setField, setDraft, apply, reset, dirty };\n}\n\nexport default useFilterDraft;\n","/**\n * `usePagedRows` — client-side pagination state for an already-materialised array.\n *\n * WHY A HOOK AND NOT A COMPONENT: this logic was promoted from the byte-identical\n * `PaginatedList` twins in erevna-web and katalogos-web. That component hard-bound\n * three things a shared package must not own — a `FlatList`, an app-specific\n * `EmptyListState`, and an app-specific `LoadingFallback`. Only the *paging maths*\n * is genuinely shared, so only the paging maths moved. Callers keep their own list\n * renderer, empty state, and loading state.\n *\n * For server-side paging use `DataTable`'s pager instead — this hook assumes every\n * row is already in memory.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\n/** Rows to show per page when the caller does not specify. */\nexport const DEFAULT_PAGE_SIZE = 10;\n\nexport interface UsePagedRowsOptions {\n /** Rows per page. Values < 1 are treated as 1 — a 0 page size would divide by zero. */\n pageSize?: number;\n}\n\nexport interface PagedRows<T> {\n /** The slice of `rows` belonging to the current page. */\n pageRows: T[];\n /** Zero-based index of the current page. */\n currentPage: number;\n /** Total number of pages; 0 when there are no rows. */\n totalPages: number;\n /** Jump to a page. Out-of-range values are clamped into `[0, totalPages - 1]`. */\n setPage: (page: number) => void;\n /** Whether a pager is worth rendering at all (more than one page exists). */\n hasPages: boolean;\n /** Effective page size after the `< 1` guard. */\n pageSize: number;\n}\n\n/**\n * Slice `rows` into pages and track the current one.\n *\n * The current page is kept valid as `rows` changes: if rows are removed while the\n * user is on the last page, the page index clamps down rather than leaving the\n * caller rendering an empty slice of a non-empty list.\n */\nexport function usePagedRows<T>(rows: readonly T[], options: UsePagedRowsOptions = {}): PagedRows<T> {\n const pageSize = Math.max(1, options.pageSize ?? DEFAULT_PAGE_SIZE);\n const [currentPage, setCurrentPage] = useState(0);\n\n const totalPages = Math.ceil(rows.length / pageSize);\n\n /**\n * Keep `currentPage` in range when `rows` shrinks.\n *\n * The app-side original only clamped when `totalPages > 0`, so emptying the list\n * entirely left a stale non-zero page index behind; the next non-empty render\n * then started on the wrong page. Clamping to 0 in that case fixes it.\n */\n useEffect(() => {\n const lastValidPage = totalPages > 0 ? totalPages - 1 : 0;\n if (currentPage > lastValidPage) setCurrentPage(lastValidPage);\n }, [currentPage, totalPages]);\n\n const pageRows = useMemo(() => {\n const start = currentPage * pageSize;\n return rows.slice(start, start + pageSize);\n }, [rows, currentPage, pageSize]);\n\n const setPage = useCallback(\n (page: number) => {\n const lastValidPage = totalPages > 0 ? totalPages - 1 : 0;\n const clamped = Math.min(Math.max(0, page), lastValidPage);\n setCurrentPage(clamped);\n },\n [totalPages],\n );\n\n return {\n pageRows: pageRows as T[],\n currentPage,\n totalPages,\n setPage,\n hasPages: totalPages > 1,\n pageSize,\n };\n}\n","/** Visual tone a status maps to; drives colour, glyph and \"needs a look\" ordering. */\nexport const enum StatusTone {\n Bad = 'bad',\n Warn = 'warn',\n Active = 'active',\n Good = 'good',\n Neutral = 'neutral',\n}\n","import { StatusTone } from './StatusTone';\n\nexport const STATUS_LEDGER_TEST_ID = 'ui-status-ledger';\nexport const STATUS_COLUMN_KEY = 'status';\nexport const ACTIONS_COLUMN_KEY = 'actions';\nexport const ALL_VALUE = '';\nexport const STATUS_MIN_WIDTH = 120;\nexport const ACTIONS_MIN_WIDTH = 136;\n\nexport const TONE_RANK: Readonly<Record<StatusTone, number>> = {\n [StatusTone.Bad]: 0,\n [StatusTone.Warn]: 1,\n [StatusTone.Active]: 2,\n [StatusTone.Neutral]: 3,\n [StatusTone.Good]: 4,\n};\n\nexport const TONE_GLYPH: Readonly<Record<StatusTone, string>> = {\n [StatusTone.Bad]: '✕',\n [StatusTone.Warn]: '!',\n [StatusTone.Active]: '▸',\n [StatusTone.Neutral]: '–',\n [StatusTone.Good]: '✓',\n};\n\nexport const ledgerSectionTestID = (testID: string, section: string): string => `${testID}-section-${section}`;\nexport const ledgerSortDirectionTestID = (testID: string): string => `${testID}-sort-direction`;\n","import React from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { TONE_GLYPH } from '../constants';\nimport type { StatusTone } from '../StatusTone';\n\nconst PILL_RADIUS = 999;\nconst PILL_BORDER = 1;\nconst PILL_PAD_H = 8;\nconst PILL_PAD_V = 2;\nconst PILL_GAP = 6;\nconst PILL_FONT = 13;\nconst PILL_WEIGHT = '600' as const;\n\nconst styles = StyleSheet.create({\n pill: {\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: 'flex-start',\n gap: PILL_GAP,\n borderWidth: PILL_BORDER,\n borderRadius: PILL_RADIUS,\n paddingHorizontal: PILL_PAD_H,\n paddingVertical: PILL_PAD_V,\n },\n text: { fontSize: PILL_FONT, fontWeight: PILL_WEIGHT },\n});\n\nexport interface StatusPillProps {\n label: string;\n tone: StatusTone;\n color: string;\n testID?: string;\n}\n\n/** A status label with a tone glyph, so the tone never relies on colour alone. */\nexport function StatusPill({ label, tone, color, testID }: StatusPillProps): React.ReactElement {\n return (\n <View accessibilityLabel={label} accessibilityRole=\"text\" style={[styles.pill, { borderColor: color }]} testID={testID}>\n <Text aria-hidden style={[styles.text, { color }]}>\n {TONE_GLYPH[tone]}\n </Text>\n <Text style={[styles.text, { color }]}>{label}</Text>\n </View>\n );\n}\n","/** Sort direction of a ledger column. */\nexport const enum SortDirection {\n Asc = 'asc',\n Desc = 'desc',\n}\n","import { ALL_VALUE, TONE_RANK } from '../constants';\nimport { SortDirection } from '../SortDirection';\nimport { StatusTone } from '../StatusTone';\nimport type { LedgerAccessors, LedgerFilter, SortValue } from '../types';\n\nconst BEFORE = -1;\nconst AFTER = 1;\nconst SAME = 0;\n\nconst isMissing = (value: SortValue): value is null | undefined | '' =>\n value === null || value === undefined || value === '';\n\nconst compareValues = (a: string | number, b: string | number): number => {\n if (typeof a === 'number' && typeof b === 'number') return a - b;\n return String(a).localeCompare(String(b), undefined, { numeric: true, sensitivity: 'base' });\n};\n\n/** Keeps rows matching the status, group and free-text filter; an empty value matches all. */\nexport function filterLedgerRows<T>(rows: readonly T[], filter: LedgerFilter, accessors: LedgerAccessors<T>): T[] {\n const needle = filter.text.trim().toLocaleLowerCase();\n return rows.filter((row) => {\n const statusOk = filter.status === ALL_VALUE || accessors.getStatus(row) === filter.status;\n const groupOk = filter.group === ALL_VALUE || accessors.getGroup?.(row) === filter.group;\n const haystack = accessors.getSearchText?.(row) ?? '';\n const textOk = needle === '' || haystack.toLocaleLowerCase().includes(needle);\n return statusOk && groupOk && textOk;\n });\n}\n\n/** Stable sort by `sortValue`; missing values always sort last, whatever the direction. */\nexport function sortLedgerRows<T>(rows: readonly T[], sortValue: (row: T) => SortValue, direction: SortDirection): T[] {\n const sign = direction === SortDirection.Asc ? AFTER : BEFORE;\n return [...rows].sort((left, right) => {\n const a = sortValue(left);\n const b = sortValue(right);\n if (isMissing(a) && isMissing(b)) return SAME;\n if (isMissing(a)) return AFTER;\n if (isMissing(b)) return BEFORE;\n return sign * compareValues(a, b);\n });\n}\n\nexport const toneRank = (tone: StatusTone): number => TONE_RANK[tone];\n\nexport const isAttentionTone = (tone: StatusTone): boolean => tone === StatusTone.Bad || tone === StatusTone.Warn;\n\n/** Splits rows into \"needs a look\" (worst tone first, input order kept within a tone) and the rest. */\nexport function splitNeedsLook<T>(\n rows: readonly T[],\n needsLook: (row: T) => boolean,\n toneOf: (row: T) => StatusTone,\n): { attention: T[]; rest: T[] } {\n const attention = rows.filter(needsLook);\n const rest = rows.filter((row) => !needsLook(row));\n return { attention: sortLedgerRows(attention, (row) => toneRank(toneOf(row)), SortDirection.Asc), rest };\n}\n\n/** Distinct non-empty values in first-seen order. */\nexport function distinctValues<T>(rows: readonly T[], pick: (row: T) => string | undefined): string[] {\n const seen = new Set<string>();\n rows.forEach((row) => {\n const value = pick(row);\n if (value !== undefined && value !== '') seen.add(value);\n });\n return [...seen];\n}\n","import { useCallback, useMemo, useState } from 'react';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport type { DataTableColumn } from '../../DataTable/types';\nimport type { FilterField, FilterValues } from '../../Filters/types';\nimport { StatusPill } from '../components/StatusPill';\nimport { ACTIONS_COLUMN_KEY, ACTIONS_MIN_WIDTH, ALL_VALUE, STATUS_COLUMN_KEY, STATUS_MIN_WIDTH } from '../constants';\nimport { LedgerFilterKey } from '../LedgerFilterKey';\nimport { SortDirection } from '../SortDirection';\nimport { StatusTone } from '../StatusTone';\nimport type { SortValue, StatusLedgerProps } from '../types';\nimport { distinctValues, filterLedgerRows, isAttentionTone, sortLedgerRows, splitNeedsLook, toneRank } from '../utils/ledgerLogic';\n\nconst readText = (values: FilterValues, key: LedgerFilterKey): string => {\n const value = values[key];\n return typeof value === 'string' ? value : ALL_VALUE;\n};\n\nfunction useToneColor(toneColors: StatusLedgerProps<unknown>['toneColors']): (tone: StatusTone) => string {\n const { theme } = useUi();\n return useCallback(\n (tone: StatusTone) => {\n const override = toneColors?.[tone];\n if (override !== undefined) return override;\n if (tone === StatusTone.Bad) return theme.semantic.error['500'];\n if (tone === StatusTone.Active) return theme.palette.primary['500'];\n return tone === StatusTone.Good ? theme.colors.textSecondary : theme.colors.text;\n },\n [toneColors, theme],\n );\n}\n\n/** Filter, sort and column state behind `StatusLedger`. */\nexport function useLedgerView<T>(props: StatusLedgerProps<T>) {\n const { rows, columns, getStatus, statusLabel, statusTone, labels, getGroup, groupLabel, getSearchText, needsLook, renderActions, toneColors } = props;\n const [values, setValues] = useState<FilterValues>({});\n const [direction, setDirection] = useState<SortDirection>(SortDirection.Asc);\n const toneColor = useToneColor(toneColors);\n const toneOf = useCallback((row: T) => statusTone(getStatus(row)), [statusTone, getStatus]);\n\n const allColumns = useMemo(() => {\n const status = {\n key: STATUS_COLUMN_KEY,\n header: labels.status,\n minWidth: STATUS_MIN_WIDTH,\n sortValue: (row: T): SortValue => toneRank(toneOf(row)),\n render: (row: T) => <StatusPill color={toneColor(toneOf(row))} label={statusLabel(getStatus(row))} tone={toneOf(row)} />,\n };\n const actions = renderActions === undefined ? [] : [{ key: ACTIONS_COLUMN_KEY, header: labels.actions, minWidth: ACTIONS_MIN_WIDTH, render: renderActions }];\n return [columns[0], status, ...columns.slice(1), ...actions].filter((c) => c !== undefined);\n }, [columns, labels, toneOf, toneColor, statusLabel, getStatus, renderActions]);\n\n const fields = useMemo<FilterField[]>(() => {\n const all = { value: ALL_VALUE, label: labels.all };\n const statuses = distinctValues(rows, getStatus).map((s) => ({ value: s, label: statusLabel(s) }));\n const groups = getGroup === undefined ? [] : distinctValues(rows, getGroup).map((g) => ({ value: g, label: groupLabel?.(g) ?? g }));\n const sortable = allColumns.filter((c) => 'sortValue' in c && c.sortValue !== undefined).map((c) => ({ value: c.key, label: c.header }));\n const groupField: FilterField[] = groups.length === 0 ? [] : [{ kind: 'select', key: LedgerFilterKey.Group, label: labels.group, options: [all, ...groups] }];\n return [\n { kind: 'text', key: LedgerFilterKey.Search, label: labels.search, grow: true },\n { kind: 'select', key: LedgerFilterKey.Status, label: labels.status, options: [all, ...statuses] },\n ...groupField,\n { kind: 'select', key: LedgerFilterKey.Sort, label: labels.sortBy, options: sortable },\n ];\n }, [rows, getStatus, statusLabel, getGroup, groupLabel, labels, allColumns]);\n\n const visible = useMemo(() => {\n const filter = { status: readText(values, LedgerFilterKey.Status), group: readText(values, LedgerFilterKey.Group), text: readText(values, LedgerFilterKey.Search) };\n const filtered = filterLedgerRows(rows, filter, { getStatus, getGroup, getSearchText });\n const sortColumn = allColumns.find((c) => c.key === readText(values, LedgerFilterKey.Sort)) as { sortValue?: (row: T) => SortValue } | undefined;\n return sortColumn?.sortValue === undefined ? filtered : sortLedgerRows(filtered, sortColumn.sortValue, direction);\n }, [rows, values, getStatus, getGroup, getSearchText, allColumns, direction]);\n\n const split = useMemo(() => splitNeedsLook(visible, needsLook ?? ((row: T) => isAttentionTone(toneOf(row))), toneOf), [visible, needsLook, toneOf]);\n const toggleDirection = useCallback(() => setDirection((d) => (d === SortDirection.Asc ? SortDirection.Desc : SortDirection.Asc)), []);\n const clear = useCallback(() => setValues({}), []);\n const tableColumns: ReadonlyArray<DataTableColumn<T>> = allColumns;\n\n return { values, setValues, direction, toggleDirection, clear, fields, visible, split, tableColumns };\n}\n","/** Ledger layout: `Auto` picks `Table` at or above the breakpoint and `Feed` below it. */\nexport const enum LedgerLayout {\n Auto = 'auto',\n Table = 'table',\n Feed = 'feed',\n}\n","import React from 'react';\nimport { StyleSheet, Text, View, useWindowDimensions } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { CARD_STACK_BREAKPOINT } from '../DataTable/constants';\nimport { DataTable } from '../DataTable/DataTable';\nimport type { DataTableColumn } from '../DataTable/types';\nimport { ActionButton } from '../Filters/components/ActionButton';\nimport { Filters } from '../Filters/Filters';\nimport { ledgerSectionTestID, ledgerSortDirectionTestID, STATUS_LEDGER_TEST_ID } from './constants';\nimport { useLedgerView } from './hooks/useLedgerView';\nimport { LedgerLayout } from './LedgerLayout';\nimport { SortDirection } from './SortDirection';\nimport type { StatusLedgerProps } from './types';\n\nconst GAP = 12;\nconst HEADING_FONT = 15;\nconst HEADING_WEIGHT = '700' as const;\n\nconst expandedKeys = (key: string | null | undefined): readonly string[] | undefined => (key === null || key === undefined ? undefined : [key]);\n\nconst styles = StyleSheet.create({\n root: { gap: GAP },\n heading: { fontSize: HEADING_FONT, fontWeight: HEADING_WEIGHT },\n note: { paddingVertical: GAP },\n});\n\ninterface SectionProps<T> {\n title: string;\n rows: readonly T[];\n columns: ReadonlyArray<DataTableColumn<T>>;\n emptyLabel: string;\n testID: string;\n ledger: StatusLedgerProps<T>;\n}\n\nfunction LedgerSection<T>({ title, rows, columns, emptyLabel, testID, ledger }: SectionProps<T>): React.ReactElement {\n const { theme } = useUi();\n return (\n <View style={styles.root} testID={testID}>\n <Text accessibilityRole=\"header\" style={[styles.heading, { color: theme.colors.text }]}>{`${title} · ${rows.length}`}</Text>\n {rows.length === 0 ? (\n <Text style={[styles.note, { color: theme.colors.textSecondary }]}>{emptyLabel}</Text>\n ) : (\n <DataTable\n columns={columns}\n expandedRowKeys={expandedKeys(ledger.expandedRowKey)}\n getRowAccessibilityLabel={ledger.getRowAccessibilityLabel}\n getRowDetailAccessibilityLabel={ledger.getRowAccessibilityLabel}\n keyExtractor={ledger.keyExtractor}\n onRowPress={ledger.onRowPress}\n renderRowDetail={ledger.renderRowDetail}\n rows={rows}\n stackBreakpoint={ledger.breakpoint ?? CARD_STACK_BREAKPOINT}\n testID={`${testID}-table`}\n />\n )}\n </View>\n );\n}\n\n/** Status-first ledger: one sortable, filterable table on wide screens, \"needs a look first\" on narrow ones. */\nexport function StatusLedger<T>(props: StatusLedgerProps<T>): React.ReactElement {\n const { labels, layout = LedgerLayout.Auto, breakpoint = CARD_STACK_BREAKPOINT, loading, testID = STATUS_LEDGER_TEST_ID } = props;\n const { width } = useWindowDimensions();\n const view = useLedgerView(props);\n const feed = layout === LedgerLayout.Feed || (layout === LedgerLayout.Auto && width < breakpoint);\n const ascending = view.direction === SortDirection.Asc;\n\n const directionButton = (\n <ActionButton\n hint={labels.sortDirectionHint}\n label={ascending ? labels.sortAscending : labels.sortDescending}\n onPress={view.toggleDirection}\n testID={ledgerSortDirectionTestID(testID)}\n tone=\"ghost\"\n />\n );\n\n return (\n <View style={styles.root} testID={testID}>\n <Filters\n actions={directionButton}\n clearHint={labels.clearHint}\n clearLabel={labels.clear}\n fields={view.fields}\n onChange={view.setValues}\n onClear={view.clear}\n resultsCount={view.visible.length}\n resultsLabel={labels.results}\n testID={`${testID}-filters`}\n values={view.values}\n />\n {feed && !loading ? (\n <>\n <LedgerSection columns={view.tableColumns} emptyLabel={labels.allClear} ledger={props} rows={view.split.attention} testID={ledgerSectionTestID(testID, 'attention')} title={labels.needsLook} />\n <LedgerSection columns={view.tableColumns} emptyLabel={labels.empty} ledger={props} rows={view.split.rest} testID={ledgerSectionTestID(testID, 'rest')} title={labels.everythingElse} />\n </>\n ) : (\n <DataTable\n columns={view.tableColumns}\n emptyLabel={labels.empty}\n expandedRowKeys={expandedKeys(props.expandedRowKey)}\n getRowAccessibilityLabel={props.getRowAccessibilityLabel}\n getRowDetailAccessibilityLabel={props.getRowAccessibilityLabel}\n keyExtractor={props.keyExtractor}\n loading={loading}\n onRowPress={props.onRowPress}\n renderRowDetail={props.renderRowDetail}\n rows={view.visible}\n stackBreakpoint={feed ? breakpoint : 0}\n testID={`${testID}-table`}\n />\n )}\n </View>\n );\n}\n","const MS_PER_SECOND = 1000;\nconst SECONDS_PER_MINUTE = 60;\nconst MINUTES_PER_HOUR = 60;\nconst HOURS_PER_DAY = 24;\nconst MS_PER_MINUTE = MS_PER_SECOND * SECONDS_PER_MINUTE;\nconst MS_PER_HOUR = MS_PER_MINUTE * MINUTES_PER_HOUR;\nconst MS_PER_DAY = MS_PER_HOUR * HOURS_PER_DAY;\nconst COUNT_TOKEN = /\\{\\{n\\}\\}/g;\n\nexport type TimeInput = string | number | Date | null | undefined;\n\nexport interface RelativeUnitStrings {\n minutes: string;\n hours: string;\n days: string;\n}\n\n/** Caller-translated templates; `{{n}}` is replaced by the count, e.g. \"{{n}} min ago\". */\nexport interface RelativeTimeStrings extends RelativeUnitStrings {\n justNow: string;\n never: string;\n future?: RelativeUnitStrings;\n}\n\n/** Parses a time input to epoch ms; `null` when absent or unparseable. */\nexport function toEpochMs(value: TimeInput): number | null {\n if (value === null || value === undefined || value === '') return null;\n const ms = value instanceof Date ? value.getTime() : typeof value === 'number' ? value : Date.parse(value);\n return Number.isFinite(ms) ? ms : null;\n}\n\nconst fill = (template: string, count: number): string => template.replace(COUNT_TOKEN, String(count));\n\n/** One relative-time format for every ledger: just now, then minutes, hours, days. */\nexport function formatRelativeTime(value: TimeInput, nowMs: number, strings: RelativeTimeStrings): string {\n const ms = toEpochMs(value);\n if (ms === null) return strings.never;\n const delta = nowMs - ms;\n const units: RelativeUnitStrings = delta < 0 && strings.future !== undefined ? strings.future : strings;\n const distance = Math.abs(delta);\n if (distance < MS_PER_MINUTE) return strings.justNow;\n if (distance < MS_PER_HOUR) return fill(units.minutes, Math.floor(distance / MS_PER_MINUTE));\n if (distance < MS_PER_DAY) return fill(units.hours, Math.floor(distance / MS_PER_HOUR));\n return fill(units.days, Math.floor(distance / MS_PER_DAY));\n}\n","import React, { useState } from 'react';\nimport { Pressable, StyleSheet, Text } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { useRowPress } from '../../DataTable/rowPressContext';\nimport { MIN_TARGET_PX } from '../../minTarget';\nimport { formatRelativeTime, toEpochMs, type RelativeTimeStrings, type TimeInput } from '../utils/relativeTime';\n\nconst styles = StyleSheet.create({\n target: { minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, justifyContent: 'center' },\n});\n\nconst defaultAbsolute = (ms: number): string => new Date(ms).toLocaleString();\n\nexport interface RelativeTimeProps {\n value: TimeInput;\n nowMs: number;\n strings: RelativeTimeStrings;\n hint: string;\n formatAbsolute?: (epochMs: number) => string;\n testID?: string;\n}\n\n/** Shows \"5 min ago\"; a tap or click swaps to the absolute time, which is also the accessible name. */\nexport function RelativeTime({ value, nowMs, strings, hint, formatAbsolute = defaultAbsolute, testID }: RelativeTimeProps): React.ReactElement {\n const { theme } = useUi();\n const [showAbsolute, setShowAbsolute] = useState(false);\n const pressRow = useRowPress();\n const ms = toEpochMs(value);\n const relative = formatRelativeTime(value, nowMs, strings);\n const absolute = ms === null ? relative : formatAbsolute(ms);\n\n return (\n <Pressable\n accessibilityHint={hint}\n accessibilityLabel={absolute}\n accessibilityRole=\"button\"\n disabled={ms === null}\n onPress={() => {\n setShowAbsolute((current) => !current);\n pressRow?.();\n }}\n style={styles.target}\n testID={testID}\n >\n <Text style={{ color: theme.colors.text }}>{showAbsolute ? absolute : relative}</Text>\n </Pressable>\n );\n}\n","export const enum MonthGridColumns {\n Twelve = 12,\n Six = 6,\n Four = 4,\n}\n","import { MIN_TARGET_PX } from '../minTarget';\nimport { MonthGridColumns } from './MonthGridColumns';\n\nconst COLUMN_OPTIONS = [MonthGridColumns.Twelve, MonthGridColumns.Six, MonthGridColumns.Four];\n\n/** The widest allowed column count, up to `requested`, whose cells stay at least 44 px wide. */\nexport function fitMonthGridColumns(requested: MonthGridColumns, width: number, gap: number): MonthGridColumns {\n const fits = (columns: MonthGridColumns): boolean => (width - gap * (columns - 1)) / columns >= MIN_TARGET_PX;\n return COLUMN_OPTIONS.find((columns) => columns <= requested && fits(columns)) ?? MonthGridColumns.Four;\n}\n\n/** Splits cells into rows of `columns`. */\nexport function chunkIntoRows<T>(cells: readonly T[], columns: number): T[][] {\n const rows: T[][] = [];\n for (let start = 0; start < cells.length; start += columns) rows.push(cells.slice(start, start + columns));\n return rows;\n}\n","import React, { useMemo, useState } from 'react';\n\nimport { Pressable, StyleSheet, Text, View, useWindowDimensions } from 'react-native';\nimport type { LayoutChangeEvent } from 'react-native';\n\nimport { useUi } from '@dloizides/ui-feedback';\n\nimport { MIN_TARGET_PX } from '../minTarget';\nimport { MonthGridColumns } from './MonthGridColumns';\nimport { chunkIntoRows, fitMonthGridColumns } from './monthGridLayout';\n\nexport const MONTH_STATUS_GRID_TEST_ID = 'month-status-grid';\n\n/** The testID of one cell. */\nexport function monthCellTestID(gridTestID: string, cellId: string): string {\n return `${gridTestID}-cell-${cellId}`;\n}\n\nconst GRID_GAP = 6;\nconst CELL_MIN_HEIGHT = 56;\nconst CELL_RADIUS = 8;\nconst CELL_PADDING_V = 6;\nconst CELL_INNER_GAP = 4;\nconst LABEL_SIZE = 14;\nconst SELECTED_BORDER = 2;\nconst COLOR_STEP = '500';\n\nconst styles = StyleSheet.create({\n grid: { gap: GRID_GAP },\n row: { flexDirection: 'row', gap: GRID_GAP },\n filler: { flex: 1 },\n cell: {\n flex: 1,\n minWidth: MIN_TARGET_PX,\n minHeight: CELL_MIN_HEIGHT,\n borderRadius: CELL_RADIUS,\n borderWidth: 1,\n paddingVertical: CELL_PADDING_V,\n alignItems: 'center',\n justifyContent: 'center',\n gap: CELL_INNER_GAP,\n },\n dashed: { borderStyle: 'dashed' },\n selected: { borderWidth: SELECTED_BORDER },\n label: { fontSize: LABEL_SIZE, fontWeight: '600', textAlign: 'center' },\n});\n\nexport interface MonthStatusCell {\n id: string;\n label: string;\n icon?: React.ReactNode;\n statusLabel?: string;\n dashed?: boolean;\n}\n\nexport interface MonthStatusGridProps {\n cells: readonly MonthStatusCell[];\n onSelect: (id: string) => void;\n selectedId?: string | null;\n columns?: MonthGridColumns;\n accessibilityLabel: string;\n accessibilityHint?: string;\n cellHint: string;\n testID?: string;\n}\n\ninterface CellProps {\n cell: MonthStatusCell;\n isSelected: boolean;\n onSelect: (id: string) => void;\n hint: string;\n testID: string;\n}\n\nconst GridCell = ({ cell, isSelected, onSelect, hint, testID }: CellProps): React.ReactElement => {\n const { theme } = useUi();\n const { colors } = theme;\n const hasStatus = cell.statusLabel !== undefined && cell.statusLabel !== '';\n\n return (\n <Pressable\n accessibilityHint={hint}\n accessibilityLabel={hasStatus ? `${cell.label}, ${String(cell.statusLabel)}` : cell.label}\n accessibilityRole=\"button\"\n aria-pressed={isSelected}\n onPress={() => onSelect(cell.id)}\n style={[\n styles.cell,\n { backgroundColor: isSelected ? colors.background : colors.surface, borderColor: colors.border },\n cell.dashed === true && styles.dashed,\n isSelected && styles.selected,\n isSelected && { borderColor: theme.palette.primary[COLOR_STEP] },\n ]}\n testID={testID}\n >\n {cell.icon !== undefined && cell.icon !== null ? <View aria-hidden>{cell.icon}</View> : null}\n <Text style={[styles.label, { color: colors.text }]}>{cell.label}</Text>\n </Pressable>\n );\n};\n\n/** One selectable status cell per period, in 12, 6 or 4 columns, narrowing when a cell would drop below 44 px. */\nexport const MonthStatusGrid = ({\n cells,\n onSelect,\n selectedId = null,\n columns = MonthGridColumns.Twelve,\n accessibilityLabel,\n accessibilityHint,\n cellHint,\n testID = MONTH_STATUS_GRID_TEST_ID,\n}: MonthStatusGridProps): React.ReactElement => {\n const { width: windowWidth } = useWindowDimensions();\n const [measuredWidth, setMeasuredWidth] = useState<number | null>(null);\n const fitted = fitMonthGridColumns(columns, measuredWidth ?? windowWidth, GRID_GAP);\n const rows = useMemo(() => chunkIntoRows(cells, fitted), [cells, fitted]);\n const onLayout = (event: LayoutChangeEvent): void => setMeasuredWidth(event.nativeEvent.layout.width);\n\n return (\n <View accessibilityHint={accessibilityHint} accessibilityLabel={accessibilityLabel} onLayout={onLayout} role=\"group\" style={styles.grid} testID={testID}>\n {rows.map((row) => (\n <View key={row[0]?.id} style={styles.row} testID={`${testID}-row`}>\n {row.map((cell) => (\n <GridCell\n cell={cell}\n hint={cellHint}\n isSelected={cell.id === selectedId}\n key={cell.id}\n onSelect={onSelect}\n testID={monthCellTestID(testID, cell.id)}\n />\n ))}\n {Array.from({ length: fitted - row.length }, (_, index) => (\n <View key={index} style={styles.filler} />\n ))}\n </View>\n ))}\n </View>\n );\n};\n\nexport default MonthStatusGrid;\n"]}
|