@navikt/ds-react 8.10.5 → 8.10.6

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.
Files changed (223) hide show
  1. package/cjs/data/data-grid/index.d.ts +2 -0
  2. package/cjs/data/data-grid/index.js +7 -0
  3. package/cjs/data/data-grid/index.js.map +1 -0
  4. package/cjs/data/data-grid/root/DataGridRoot.context.d.ts +11 -0
  5. package/cjs/data/data-grid/root/DataGridRoot.context.js +11 -0
  6. package/cjs/data/data-grid/root/DataGridRoot.context.js.map +1 -0
  7. package/cjs/data/data-grid/root/DataGridRoot.d.ts +38 -0
  8. package/cjs/data/data-grid/root/DataGridRoot.js +68 -0
  9. package/cjs/data/data-grid/root/DataGridRoot.js.map +1 -0
  10. package/cjs/data/drag-and-drop/drag-handler/DragAndDropDragHandler.js +0 -1
  11. package/cjs/data/drag-and-drop/drag-handler/DragAndDropDragHandler.js.map +1 -1
  12. package/cjs/data/drag-and-drop/root/DragAndDropRoot.d.ts +5 -5
  13. package/cjs/data/drag-and-drop/root/DragAndDropRoot.js +4 -27
  14. package/cjs/data/drag-and-drop/root/DragAndDropRoot.js.map +1 -1
  15. package/cjs/data/stories/Data.test-data.d.ts +2 -5
  16. package/cjs/data/stories/Data.test-data.js +30 -38
  17. package/cjs/data/stories/Data.test-data.js.map +1 -1
  18. package/cjs/data/table/base-cell/DataTableBaseCell.d.ts +15 -15
  19. package/cjs/data/table/base-cell/DataTableBaseCell.js +4 -8
  20. package/cjs/data/table/base-cell/DataTableBaseCell.js.map +1 -1
  21. package/cjs/data/table/column-header/DataTableColumnHeader.d.ts +24 -6
  22. package/cjs/data/table/column-header/DataTableColumnHeader.js +22 -27
  23. package/cjs/data/table/column-header/DataTableColumnHeader.js.map +1 -1
  24. package/cjs/data/table/column-header/useTableColumnResize.d.ts +19 -29
  25. package/cjs/data/table/column-header/useTableColumnResize.js +24 -22
  26. package/cjs/data/table/column-header/useTableColumnResize.js.map +1 -1
  27. package/cjs/data/table/details-panel-row/DataTableDetailsPanelRow.d.ts +1 -1
  28. package/cjs/data/table/details-panel-row/DataTableDetailsPanelRow.js +2 -2
  29. package/cjs/data/table/details-panel-row/DataTableDetailsPanelRow.js.map +1 -1
  30. package/cjs/data/table/helpers/collectTableRowEntries.d.ts +2 -2
  31. package/cjs/data/table/helpers/selection/getMultipleSelectProps.d.ts +13 -11
  32. package/cjs/data/table/helpers/selection/getMultipleSelectProps.js +43 -53
  33. package/cjs/data/table/helpers/selection/getMultipleSelectProps.js.map +1 -1
  34. package/cjs/data/table/helpers/selection/getSingleSelectProps.d.ts +9 -8
  35. package/cjs/data/table/helpers/selection/getSingleSelectProps.js +23 -10
  36. package/cjs/data/table/helpers/selection/getSingleSelectProps.js.map +1 -1
  37. package/cjs/data/table/helpers/selection/selection.types.d.ts +19 -19
  38. package/cjs/data/table/helpers/selection/selection.utils.d.ts +21 -0
  39. package/cjs/data/table/helpers/selection/selection.utils.js +46 -0
  40. package/cjs/data/table/helpers/selection/selection.utils.js.map +1 -0
  41. package/cjs/data/table/hooks/useColumnOptions.d.ts +16 -5
  42. package/cjs/data/table/hooks/useColumnOptions.js +26 -8
  43. package/cjs/data/table/hooks/useColumnOptions.js.map +1 -1
  44. package/cjs/data/table/hooks/useTableDetailsPanel.d.ts +10 -13
  45. package/cjs/data/table/hooks/useTableDetailsPanel.js +6 -5
  46. package/cjs/data/table/hooks/useTableDetailsPanel.js.map +1 -1
  47. package/cjs/data/table/hooks/useTableItems.d.ts +29 -15
  48. package/cjs/data/table/hooks/useTableItems.js +2 -12
  49. package/cjs/data/table/hooks/useTableItems.js.map +1 -1
  50. package/cjs/data/table/hooks/useTableKeyboardNav.d.ts +1 -6
  51. package/cjs/data/table/hooks/useTableKeyboardNav.js +1 -4
  52. package/cjs/data/table/hooks/useTableKeyboardNav.js.map +1 -1
  53. package/cjs/data/table/hooks/useTableSelection.d.ts +6 -6
  54. package/cjs/data/table/hooks/useTableSelection.js +13 -13
  55. package/cjs/data/table/hooks/useTableSelection.js.map +1 -1
  56. package/cjs/data/table/hooks/useTableSort.d.ts +2 -2
  57. package/cjs/data/table/hooks/useTableSort.js +4 -5
  58. package/cjs/data/table/hooks/useTableSort.js.map +1 -1
  59. package/cjs/data/table/root/DataTable.types.d.ts +22 -10
  60. package/cjs/data/table/root/DataTableRoot.context.d.ts +13 -7
  61. package/cjs/data/table/root/DataTableRoot.context.js.map +1 -1
  62. package/cjs/data/table/root/DataTableRoot.d.ts +49 -72
  63. package/cjs/data/table/root/DataTableRoot.js +54 -66
  64. package/cjs/data/table/root/DataTableRoot.js.map +1 -1
  65. package/cjs/data/table/root/DataTableRoot.legacy.d.ts +2 -7
  66. package/cjs/data/table/root/DataTableRoot.legacy.js +17 -3
  67. package/cjs/data/table/root/DataTableRoot.legacy.js.map +1 -1
  68. package/cjs/data/table/sub-row-toggle/DataTableSubRowToggle.js +4 -4
  69. package/cjs/data/table/sub-row-toggle/DataTableSubRowToggle.js.map +1 -1
  70. package/cjs/data/table/tbody/DataTableTbody.js +4 -2
  71. package/cjs/data/table/tbody/DataTableTbody.js.map +1 -1
  72. package/cjs/data/table/tr/DataTableTr.d.ts +5 -3
  73. package/cjs/data/table/tr/DataTableTr.js +36 -23
  74. package/cjs/data/table/tr/DataTableTr.js.map +1 -1
  75. package/cjs/table/ColumnHeader.js +2 -1
  76. package/cjs/table/ColumnHeader.js.map +1 -1
  77. package/esm/data/data-grid/index.d.ts +2 -0
  78. package/esm/data/data-grid/index.js +3 -0
  79. package/esm/data/data-grid/index.js.map +1 -0
  80. package/esm/data/data-grid/root/DataGridRoot.context.d.ts +11 -0
  81. package/esm/data/data-grid/root/DataGridRoot.context.js +7 -0
  82. package/esm/data/data-grid/root/DataGridRoot.context.js.map +1 -0
  83. package/esm/data/data-grid/root/DataGridRoot.d.ts +38 -0
  84. package/esm/data/data-grid/root/DataGridRoot.js +32 -0
  85. package/esm/data/data-grid/root/DataGridRoot.js.map +1 -0
  86. package/esm/data/drag-and-drop/drag-handler/DragAndDropDragHandler.js +0 -1
  87. package/esm/data/drag-and-drop/drag-handler/DragAndDropDragHandler.js.map +1 -1
  88. package/esm/data/drag-and-drop/root/DragAndDropRoot.d.ts +5 -5
  89. package/esm/data/drag-and-drop/root/DragAndDropRoot.js +4 -27
  90. package/esm/data/drag-and-drop/root/DragAndDropRoot.js.map +1 -1
  91. package/esm/data/stories/Data.test-data.d.ts +2 -5
  92. package/esm/data/stories/Data.test-data.js +30 -38
  93. package/esm/data/stories/Data.test-data.js.map +1 -1
  94. package/esm/data/table/base-cell/DataTableBaseCell.d.ts +15 -15
  95. package/esm/data/table/base-cell/DataTableBaseCell.js +4 -8
  96. package/esm/data/table/base-cell/DataTableBaseCell.js.map +1 -1
  97. package/esm/data/table/column-header/DataTableColumnHeader.d.ts +24 -6
  98. package/esm/data/table/column-header/DataTableColumnHeader.js +23 -28
  99. package/esm/data/table/column-header/DataTableColumnHeader.js.map +1 -1
  100. package/esm/data/table/column-header/useTableColumnResize.d.ts +19 -29
  101. package/esm/data/table/column-header/useTableColumnResize.js +24 -22
  102. package/esm/data/table/column-header/useTableColumnResize.js.map +1 -1
  103. package/esm/data/table/details-panel-row/DataTableDetailsPanelRow.d.ts +1 -1
  104. package/esm/data/table/details-panel-row/DataTableDetailsPanelRow.js +2 -2
  105. package/esm/data/table/details-panel-row/DataTableDetailsPanelRow.js.map +1 -1
  106. package/esm/data/table/helpers/collectTableRowEntries.d.ts +2 -2
  107. package/esm/data/table/helpers/selection/getMultipleSelectProps.d.ts +13 -11
  108. package/esm/data/table/helpers/selection/getMultipleSelectProps.js +43 -53
  109. package/esm/data/table/helpers/selection/getMultipleSelectProps.js.map +1 -1
  110. package/esm/data/table/helpers/selection/getSingleSelectProps.d.ts +9 -8
  111. package/esm/data/table/helpers/selection/getSingleSelectProps.js +23 -10
  112. package/esm/data/table/helpers/selection/getSingleSelectProps.js.map +1 -1
  113. package/esm/data/table/helpers/selection/selection.types.d.ts +19 -19
  114. package/esm/data/table/helpers/selection/selection.utils.d.ts +21 -0
  115. package/esm/data/table/helpers/selection/selection.utils.js +43 -0
  116. package/esm/data/table/helpers/selection/selection.utils.js.map +1 -0
  117. package/esm/data/table/hooks/useColumnOptions.d.ts +16 -5
  118. package/esm/data/table/hooks/useColumnOptions.js +26 -8
  119. package/esm/data/table/hooks/useColumnOptions.js.map +1 -1
  120. package/esm/data/table/hooks/useTableDetailsPanel.d.ts +10 -13
  121. package/esm/data/table/hooks/useTableDetailsPanel.js +6 -5
  122. package/esm/data/table/hooks/useTableDetailsPanel.js.map +1 -1
  123. package/esm/data/table/hooks/useTableItems.d.ts +29 -15
  124. package/esm/data/table/hooks/useTableItems.js +3 -10
  125. package/esm/data/table/hooks/useTableItems.js.map +1 -1
  126. package/esm/data/table/hooks/useTableKeyboardNav.d.ts +1 -6
  127. package/esm/data/table/hooks/useTableKeyboardNav.js +1 -4
  128. package/esm/data/table/hooks/useTableKeyboardNav.js.map +1 -1
  129. package/esm/data/table/hooks/useTableSelection.d.ts +6 -6
  130. package/esm/data/table/hooks/useTableSelection.js +13 -13
  131. package/esm/data/table/hooks/useTableSelection.js.map +1 -1
  132. package/esm/data/table/hooks/useTableSort.d.ts +2 -2
  133. package/esm/data/table/hooks/useTableSort.js +4 -5
  134. package/esm/data/table/hooks/useTableSort.js.map +1 -1
  135. package/esm/data/table/root/DataTable.types.d.ts +22 -10
  136. package/esm/data/table/root/DataTableRoot.context.d.ts +13 -7
  137. package/esm/data/table/root/DataTableRoot.context.js.map +1 -1
  138. package/esm/data/table/root/DataTableRoot.d.ts +49 -72
  139. package/esm/data/table/root/DataTableRoot.js +56 -68
  140. package/esm/data/table/root/DataTableRoot.js.map +1 -1
  141. package/esm/data/table/root/DataTableRoot.legacy.d.ts +2 -7
  142. package/esm/data/table/root/DataTableRoot.legacy.js +17 -3
  143. package/esm/data/table/root/DataTableRoot.legacy.js.map +1 -1
  144. package/esm/data/table/sub-row-toggle/DataTableSubRowToggle.js +4 -4
  145. package/esm/data/table/sub-row-toggle/DataTableSubRowToggle.js.map +1 -1
  146. package/esm/data/table/tbody/DataTableTbody.js +4 -2
  147. package/esm/data/table/tbody/DataTableTbody.js.map +1 -1
  148. package/esm/data/table/tr/DataTableTr.d.ts +5 -3
  149. package/esm/data/table/tr/DataTableTr.js +35 -23
  150. package/esm/data/table/tr/DataTableTr.js.map +1 -1
  151. package/esm/table/ColumnHeader.js +2 -1
  152. package/esm/table/ColumnHeader.js.map +1 -1
  153. package/package.json +3 -3
  154. package/src/data/data-grid/index.ts +3 -0
  155. package/src/data/data-grid/root/DataGridRoot.context.ts +16 -0
  156. package/src/data/data-grid/root/DataGridRoot.tsx +71 -0
  157. package/src/data/drag-and-drop/drag-handler/DragAndDropDragHandler.tsx +0 -1
  158. package/src/data/drag-and-drop/root/DragAndDropRoot.tsx +15 -49
  159. package/src/data/stories/Data.test-data.tsx +52 -43
  160. package/src/data/table/agent-component-review.md +175 -0
  161. package/src/data/table/base-cell/DataTableBaseCell.tsx +31 -21
  162. package/src/data/table/column-header/DataTableColumnHeader.tsx +61 -58
  163. package/src/data/table/column-header/useTableColumnResize.ts +55 -71
  164. package/src/data/table/details-panel-row/DataTableDetailsPanelRow.tsx +3 -3
  165. package/src/data/table/helpers/collectTableRowEntries.ts +1 -2
  166. package/src/data/table/helpers/selection/getMultipleSelectProps.ts +65 -85
  167. package/src/data/table/helpers/selection/getSingleSelectProps.ts +35 -17
  168. package/src/data/table/helpers/selection/selection.types.ts +19 -19
  169. package/src/data/table/helpers/selection/selection.utils.test.ts +161 -0
  170. package/src/data/table/helpers/selection/selection.utils.ts +73 -0
  171. package/src/data/table/hooks/__tests__/useTableItems.test.ts +2 -1
  172. package/src/data/table/hooks/useColumnOptions.ts +48 -14
  173. package/src/data/table/hooks/useTableDetailsPanel.tsx +22 -25
  174. package/src/data/table/hooks/useTableItems.ts +32 -24
  175. package/src/data/table/hooks/useTableKeyboardNav.ts +1 -13
  176. package/src/data/table/hooks/useTableSelection.ts +26 -31
  177. package/src/data/table/hooks/useTableSort.ts +10 -9
  178. package/src/data/table/root/DataTable.types.ts +30 -22
  179. package/src/data/table/root/DataTableRoot.context.ts +19 -7
  180. package/src/data/table/root/DataTableRoot.legacy.tsx +22 -14
  181. package/src/data/table/root/DataTableRoot.tsx +244 -293
  182. package/src/data/table/sub-row-toggle/DataTableSubRowToggle.tsx +5 -4
  183. package/src/data/table/tbody/DataTableTbody.tsx +6 -2
  184. package/src/data/table/tr/DataTableTr.tsx +98 -35
  185. package/src/table/ColumnHeader.tsx +2 -1
  186. package/cjs/data/drag-and-drop-legacy/drag-handler/DragAndDropDragHandlerLegacy.d.ts +0 -22
  187. package/cjs/data/drag-and-drop-legacy/drag-handler/DragAndDropDragHandlerLegacy.js +0 -35
  188. package/cjs/data/drag-and-drop-legacy/drag-handler/DragAndDropDragHandlerLegacy.js.map +0 -1
  189. package/cjs/data/drag-and-drop-legacy/item/DragAndDropItemLegacy.d.ts +0 -27
  190. package/cjs/data/drag-and-drop-legacy/item/DragAndDropItemLegacy.js +0 -86
  191. package/cjs/data/drag-and-drop-legacy/item/DragAndDropItemLegacy.js.map +0 -1
  192. package/cjs/data/drag-and-drop-legacy/root/DragAndDropLegacy.context.d.ts +0 -5
  193. package/cjs/data/drag-and-drop-legacy/root/DragAndDropLegacy.context.js +0 -6
  194. package/cjs/data/drag-and-drop-legacy/root/DragAndDropLegacy.context.js.map +0 -1
  195. package/cjs/data/drag-and-drop-legacy/root/DragAndDropLegacyRoot.d.ts +0 -24
  196. package/cjs/data/drag-and-drop-legacy/root/DragAndDropLegacyRoot.js +0 -108
  197. package/cjs/data/drag-and-drop-legacy/root/DragAndDropLegacyRoot.js.map +0 -1
  198. package/cjs/data/table/helpers/selection/SelectionSubtreeHelper.d.ts +0 -46
  199. package/cjs/data/table/helpers/selection/SelectionSubtreeHelper.js +0 -112
  200. package/cjs/data/table/helpers/selection/SelectionSubtreeHelper.js.map +0 -1
  201. package/esm/data/drag-and-drop-legacy/drag-handler/DragAndDropDragHandlerLegacy.d.ts +0 -22
  202. package/esm/data/drag-and-drop-legacy/drag-handler/DragAndDropDragHandlerLegacy.js +0 -29
  203. package/esm/data/drag-and-drop-legacy/drag-handler/DragAndDropDragHandlerLegacy.js.map +0 -1
  204. package/esm/data/drag-and-drop-legacy/item/DragAndDropItemLegacy.d.ts +0 -27
  205. package/esm/data/drag-and-drop-legacy/item/DragAndDropItemLegacy.js +0 -50
  206. package/esm/data/drag-and-drop-legacy/item/DragAndDropItemLegacy.js.map +0 -1
  207. package/esm/data/drag-and-drop-legacy/root/DragAndDropLegacy.context.d.ts +0 -5
  208. package/esm/data/drag-and-drop-legacy/root/DragAndDropLegacy.context.js +0 -3
  209. package/esm/data/drag-and-drop-legacy/root/DragAndDropLegacy.context.js.map +0 -1
  210. package/esm/data/drag-and-drop-legacy/root/DragAndDropLegacyRoot.d.ts +0 -24
  211. package/esm/data/drag-and-drop-legacy/root/DragAndDropLegacyRoot.js +0 -68
  212. package/esm/data/drag-and-drop-legacy/root/DragAndDropLegacyRoot.js.map +0 -1
  213. package/esm/data/table/helpers/selection/SelectionSubtreeHelper.d.ts +0 -46
  214. package/esm/data/table/helpers/selection/SelectionSubtreeHelper.js +0 -109
  215. package/esm/data/table/helpers/selection/SelectionSubtreeHelper.js.map +0 -1
  216. package/src/data/drag-and-drop-legacy/drag-handler/DragAndDropDragHandlerLegacy.tsx +0 -104
  217. package/src/data/drag-and-drop-legacy/item/DragAndDropItemLegacy.tsx +0 -74
  218. package/src/data/drag-and-drop-legacy/root/DragAndDropLegacy.context.tsx +0 -11
  219. package/src/data/drag-and-drop-legacy/root/DragAndDropLegacyRoot.tsx +0 -94
  220. package/src/data/table/helpers/selection/SelectionSubtreeHelper.test.ts +0 -66
  221. package/src/data/table/helpers/selection/SelectionSubtreeHelper.ts +0 -162
  222. package/src/data/table/hooks/__tests__/useTableSelection.test.ts +0 -488
  223. package/src/data/table/root/agent-feature-gap.md +0 -96
@@ -0,0 +1,175 @@
1
+ # DataTable Beta Readiness Review
2
+
3
+ ## Summary
4
+
5
+ The DataTable is a well-architected component with thoughtful separation of concerns (hooks, helpers, sub-components). The keyboard navigation, selection cascading, and sort state management are solid. However, there are several a11y gaps, API inconsistencies, and edge cases that should be addressed before a public beta.
6
+
7
+ ---
8
+
9
+ ## Findings
10
+
11
+ | # | Category | Finding | Severity | Recommendation |
12
+ | --- | --------------- | ------------------------------------------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
13
+ | 2 | A11y | No `aria-selected` on selected rows | 🔴 | Add `aria-selected="true"` on `<tr>` for selected rows (required by grid/table selection pattern per ARIA APG). |
14
+ | 3 | A11y | No `aria-label`/`aria-labelledby` on the table element | 🟡 | Expose a `label` or `aria-label` prop. Without it, screen readers announce the table generically. React Aria requires a label on every table. |
15
+ | 4 | A11y | Hardcoded Norwegian strings without i18n support | 🟡 | All aria-labels ("Vis under-rader", "Skjul detaljer", "Velg alle synlige rader", "Laster innhold", resize labels) are Norwegian-only. Expose a `labels`/`translations` prop or accept them via column definitions for i18n. |
16
+ | 5 | A11y | Sub-rows should use `role="treegrid"` | 🟡 | When `subRows` is provided, the table should use `role="treegrid"` with `aria-level`, `aria-setsize`, `aria-posinset` on rows. Already flagged as TODO in code. |
17
+ | 7 | API | `disableRowSelection` signature inconsistency with stories | 🔴 | Type declares `({ row, id }) => boolean` but stories pass `({ id }) => id === 2`. The prop name is confusing: "disable" + returns `true` to disable = double negative. Consider `isRowSelectable` (positive predicate) like React Aria's `disabledKeys` pattern. |
18
+ | 8 | API | `stickyColumns` type is overly restrictive | 🟡 | `first?: "1"` and `last?: "1"` prevent future extension to 2+ sticky columns. Use `number` instead. |
19
+ | 9 | API | `sort` and `onSortChange` mixed into `DataTableProps` via `TableSortOptions` | 🟡 | Spreading sort props at root level makes the API flat but could collide with native HTML attributes or future features. Consider grouping into a `sort={{ state, onChange, defaultState }}` pattern. However, this is a style preference — the flat API is also valid. |
20
+ | 10 | API | `children?: never` prevents slot-based composition | 🟢 | The data-driven API is good for beta, but consider a path to compositional usage (render props or slot API) for GA. MUI and TanStack offer both modes. |
21
+ | 11 | API | Missing `aria-rowcount`/`aria-colcount` for virtualized/paginated tables | 🟡 | When data is paginated (as in `SelectionPagination` story), ATs cannot know total row count. Expose `totalRowCount` prop that maps to `aria-rowcount`. |
22
+ | 12 | Code Quality | `selectableIdsSet` in `getMultipleSelectProps` iterates all rows including sub-rows | 🟡 | "Select all" selects ALL rows in `itemDetails` including hidden sub-rows. The `selectableIdsSet` should filter by `visibleRowIds` for the "select all" checkbox, while still cascading to children when selecting individual parent rows. Variable naming is misleading. |
23
+ | 13 | Code Quality | `useTableSelection` passes `tableItems` (full object) to `getMultipleSelectProps` | 🟡 | This couples selection logic to the full table items shape. Consider passing only what's needed (`visibleRowIds`, `childRowIdsById`, `itemDetails`). |
24
+ | 14 | Performance | `columns.map()` inside render creates new objects on each render | 🟢 | `useColumnOptions` is memoized — this is fine. The `columns.map()` inside `DataTableTBodyContent` render loop is acceptable for normal table sizes. |
25
+ | 15 | Performance | No virtualization support | 🟢 | For beta, this is acceptable. Document the performance ceiling (recommended max ~500-1000 rows without virtualization). For GA, consider integrating with `@tanstack/react-virtual`. |
26
+ | 16 | Potential Issue | `fullWidthColSpan` may be wrong when `subRows` adds the expansion column | 🔴 | `fullWidthColSpan` counts `columns.length + layout filler + selection + detailsPanel`. The `RowExpansionCell` renders a separate `<td>` for detailsPanel. If both `subRows` AND `detailsPanel` are used together, verify `fullWidthColSpan` is correct. Check with `NestedRowsWithMasterDetail` story. |
27
+ | 17 | Potential Issue | Selection row-click fires AND toggles selection simultaneously | 🟡 | When `onRowClick` and `selection` are both enabled and `disableRowSelectionOnClick` is false (default), clicking a row both selects it and fires `onRowClick`. The default should probably be `disableRowSelectionOnClick: true` when `onRowClick` is also provided. |
28
+ | 18 | Potential Issue | `getRowId` fallback uses index — breaks selection on reorder/filter | 🟡 | If users don't provide `getRowId` and data changes (filter, sort, paginate), selection state becomes stale because index-based IDs shift. Consider logging a dev warning when `selection` is used without `getRowId`. |
29
+ | 19 | API | `loading.loadingLabel` only applies to skeleton/overlay mode | 🟢 | When `loadingState` is a custom ReactNode, there's no mechanism to announce loading to ATs. The `aria-busy` on the table partially covers this but `aria-live` region would be more robust. |
30
+ | 20 | API | `detailsPanel.getHeight` returns `number \| "auto"` — inconsistent with CSS patterns | 🟢 | Consider accepting a CSS value string (`"200px"`, `"auto"`) or always `number` (pixels). The mixed type works but requires the consumer to handle units. |
31
+ | 21 | A11y | Details panel row `aria-controls` relationship from toggle to content | 🟢 | The expansion button has `aria-controls={expansionId}` and the panel `<td>` has the matching `id`. Correctly implemented. ✓ No issue. |
32
+ | 22 | Code Quality | `@ts-expect-error` for Slot ref in `TableElementWrapper` | 🟢 | Minor tech debt. Consider typing the Slot component to accept ref properly. |
33
+ | 23 | API | No `onRowDoubleClick` or `onCellClick` callbacks | 🟢 | Common in MUI DataGrid. Not needed for beta but worth considering for GA. |
34
+ | 24 | Potential Issue | Sort `onSortChange` may double-fire in controlled mode | 🟡 | In `useTableSort`, `setSort(next)` is called and then `onSortChange?.(next, detail)` separately. If `useControllableState` invokes `onChange` internally, `onSortChange` fires twice in controlled mode. Verify. |
35
+ | 25 | API | `selection` prop type accepts partial object with no `selectionMode` | 🟡 | `SelectionProps` has `selectionMode?: "none" \| "single" \| "multiple"` defaulting to `"none"`. Passing `selection={{}}` without `selectionMode` silently does nothing. Consider requiring `selectionMode` when `selection` is provided (discriminated union). |
36
+ | 26 | Potential Issue | Keyboard nav `focusInitialTableTarget` always focuses first cell (including header) | 🟢 | Initial focus can go to the first data cell. Currently goes to first `td`/`th` which may be the selection header cell. Minor UX concern. |
37
+ | 27 | A11y | Resize handle uses `role="slider"` without `aria-valuemin`/`aria-valuemax` | 🟡 | ARIA slider requires `aria-valuemin` and `aria-valuemax`. Currently only `aria-valuenow` is set. Screen readers may not announce the range correctly. |
38
+
39
+ ---
40
+
41
+ ## Details
42
+
43
+ ### Finding #2 — Missing `aria-selected`
44
+
45
+ ```tsx
46
+ // In DataTableTr, add:
47
+ <tr
48
+ {...rest}
49
+ aria-selected={selected || undefined}
50
+ // ...existing props
51
+ >
52
+ ```
53
+
54
+ ### Finding #7 — `disableRowSelection` API
55
+
56
+ Current signature:
57
+
58
+ ```ts
59
+ disableRowSelection?: (({ row, id }: { row: T; id: string | number }) => boolean) | boolean;
60
+ ```
61
+
62
+ Stories use:
63
+
64
+ ```tsx
65
+ disableRowSelection: ({ id }) => id === 2 || id === 1;
66
+ ```
67
+
68
+ Recommended rename for clarity (breaking but pre-beta):
69
+
70
+ ```ts
71
+ isRowSelectionDisabled?: (row: T, id: string | number) => boolean;
72
+ // OR (React Aria style):
73
+ disabledKeys?: (string | number)[];
74
+ ```
75
+
76
+ ### Finding #24 — Possible double-fire of `onSortChange`
77
+
78
+ In `useTableSort`:
79
+
80
+ ```ts
81
+ const handleSortClick = useCallback((id, event) => {
82
+ // ...
83
+ setSort(next); // If controlled, useControllableState calls onChange
84
+ onSortChange?.(next, detail); // Also called explicitly
85
+ }, [...]);
86
+ ```
87
+
88
+ If `useControllableState` invokes `onChange` when the `value` prop changes, `onSortChange` is called twice. Verify by checking if `useControllableState` has its own `onChange` invocation path. If it does, remove the explicit `onSortChange` call and pass it as `onChange` to `useControllableState`.
89
+
90
+ ---
91
+
92
+ ## API & Developer Experience Analysis
93
+
94
+ ### Overall API shape
95
+
96
+ The top-level API uses a **data-driven pattern** — you pass `data` + `columnDefinitions` and the component renders everything. This is the right choice for a "batteries included" table. The prop surface splits into:
97
+
98
+ - **Core:** `data`, `columnDefinitions`, `getRowId`
99
+ - **Features (objects):** `selection`, `loading`, `detailsPanel`, `subRows`, `stickyColumns`
100
+ - **Features (flat):** `sort`, `defaultSort`, `onSortChange`, `onRowClick`, `withKeyboardNav`
101
+ - **Appearance:** `rowDensity`, `zebraStripes`, `truncateContent`, `textSize`, `layout`
102
+
103
+ This is generally good — feature-objects group related props, and appearance props are flat. However there are some inconsistencies.
104
+
105
+ ### Findings: API & DX
106
+
107
+ | # | Category | Finding | Severity | Recommendation |
108
+ | --- | -------- | -------------------------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
109
+ | 28 | DX | `header` vs `label` in ColumnDefinition is confusing | 🟡 | Both exist on every column. `label` is required and used for a11y/sort button labels. `header` is optional and overrides what's rendered. Developers will ask "which one is my header text?" Consider: `header` (required, replaces current `label`) + `headerContent` or just always use `header` for rendering and `aria-label` when the header is non-textual. |
110
+ | 29 | DX | `selection` vs sort props use different grouping patterns | 🟡 | Selection is grouped: `selection={{ selectionMode, onSelectionChange, ... }}`. Sort is flat: `sort`, `defaultSort`, `onSortChange`. This inconsistency will confuse devs. Either group sort (`sort={{ state, defaultState, onChange }}`) or flatten selection. Since sort also uses `detail` parameter, the flat pattern is defensible, but be consistent — pick one and apply it everywhere. |
111
+ | 30 | DX | `ColumnDefinition` mixes rendering, behavior, and sizing concerns | 🟢 | A single column def contains `cell`, `header`, `label`, `sortable`, `align`, `resizable`, `width`, `defaultWidth`, `autoWidth`, `minWidth`, `maxWidth`, `onWidthChange`, `isRowHeader`, `details`. That's 14+ properties. For beta this is fine (flat = discoverable), but for GA consider splitting into `column.sizing` or using separate configuration layers for power users. |
112
+ | 31 | DX | `detailsPanel` and `subRows` both have `expandedRowIds`/`defaultExpandedRowIds`/`onExpandedRowIdsChange` | 🟡 | Same prop names exist in both objects. When both features are used together (`NestedRowsWithMasterDetail`), developers must understand these are independent expansion states. The naming collision makes this unclear. Consider `detailsPanel.expandedRowIds` staying as-is but subRows using `expandedSubRowIds` or documenting clearly that they're independent. |
113
+ | 32 | DX | Resize props pollute column definition for non-resizable tables | 🟢 | When `layout="auto"`, resize props (`resizable`, `width`, `defaultWidth`, `autoWidth`, `minWidth`, `maxWidth`, `onWidthChange`) are all ignored. Developers may set them without realizing they have no effect. The JSDoc on `resizable` mentions this, but it's easy to miss. |
114
+ | 33 | DX | `getRowId` return type `string \| number` makes controlled selection awkward | 🟡 | `selectedKeys` is `(string \| number)[]`. If `getRowId` returns a number (like `row.id`), the consumer can pass `selectedKeys: [1, 2]` fine. But if they later compare with `===`, `string` vs `number` mismatches bite. TanStack Table uses `string` only for row IDs. Consider normalizing to `string` internally (with automatic `String()` coercion) or staying `number` only — pick one. |
115
+ | 34 | DX | No way to hide/show columns dynamically | 🟡 | Consumers must filter `columnDefinitions` array externally to toggle column visibility. This is fine API-wise (keep it data-driven), but should be documented as the expected pattern. The `Data.settings.stories.tsx` likely shows this but it's not obvious from the types alone. |
116
+ | 35 | DX | `loading` object has confusing interaction between its props | 🟡 | Three modes: (1) `isLoading + loadingState` → custom content, (2) `isLoading + loadingRows` → skeletons, (3) `isLoading` alone → overlay on existing data. These modes are implicit from which subset of props you pass. A discriminated union would make intent explicit, but adds verbosity. At minimum, JSDoc should clearly document "if you pass X, Y is ignored." |
117
+ | 36 | DX | `withKeyboardNav` defaults to `true` — unexpected for simple tables | 🟢 | Most table components default keyboard nav to off. When devs use DataTable for a simple read-only table, the `tabIndex=0` and arrow-key behavior is unexpected. Consider defaulting to `false` or auto-enabling only when interactive features (selection, sorting) are present. |
118
+ | 37 | DX | `onRowClick` doesn't convey which row data was clicked | 🟡 | Signature is `(rowId, event) => void`. Consumers must look up `rowId` in their own data array to get the row object. Consider `(rowData: T, rowId, event) => void` — this is what MUI and TanStack expose. Avoids forcing an O(n) lookup. |
119
+ | 38 | DX | `isRowHeader` on ColumnDefinition has no enforcement or guidance | 🟢 | JSDoc says "each row should have one rowheader" but nothing prevents 0 or many. This is a documentation issue, not a code issue. Consider a dev-mode warning if no column has `isRowHeader: true`. |
120
+
121
+ ### What's working well (keep as-is)
122
+
123
+ - **Controlled/uncontrolled pattern** is consistent across selection, sort, sub-rows expansion, and details panel expansion. All use `value`/`defaultValue`/`onChange` semantics.
124
+ - **`getRowId`** — good that it's optional with a sensible fallback, and the JSDoc warns about the tradeoff.
125
+ - **`columnDefinitions` as a typed array** — gives excellent autocomplete and catches typos at compile time.
126
+ - **`selection.selectionMode`** driving the UI (checkbox vs radio) automatically — reduces decision surface.
127
+ - **Sort cycling** (none → asc → desc → none) with shift-click for multi-sort is well thought out.
128
+ - **Feature-as-object pattern** (`loading`, `selection`, `detailsPanel`, `subRows`) — good discoverability, scales well for adding future options.
129
+
130
+ ---
131
+
132
+ ## Priority Summary
133
+
134
+ ### 🔴 Beta Blockers (must fix)
135
+
136
+ 1. **#2** — Add `aria-selected` on selected rows
137
+ 2. **#7** — Resolve `disableRowSelection` API inconsistency (breaking change is OK pre-beta)
138
+ 3. **#16** — Verify `fullWidthColSpan` correctness with combined subRows + detailsPanel
139
+
140
+ ### 🟡 Should Fix Before Beta
141
+
142
+ 5. **#3** — Require/encourage table label
143
+ 6. **#4** — Externalize hardcoded Norwegian strings
144
+ 7. **#5** — `role="treegrid"` for sub-rows
145
+ 8. **#8** — `stickyColumns` type to `number`
146
+ 9. **#11** — `aria-rowcount` for paginated tables
147
+ 10. **#12** — Verify "select all" behavior with pagination
148
+ 11. **#17** — Default `disableRowSelectionOnClick: true` when `onRowClick` is set
149
+ 12. **#18** — Dev warning for selection without `getRowId`
150
+ 13. **#24** — Verify sort `onSortChange` double-fire
151
+ 14. **#25** — Make `selectionMode` required when `selection` is provided
152
+ 15. **#27** — Add `aria-valuemin`/`aria-valuemax` to resize slider
153
+ 16. **#28** — Clarify `header` vs `label` in ColumnDefinition
154
+ 17. **#29** — Decide on consistent grouping pattern (flat vs object) for features
155
+ 18. **#31** — Disambiguate `expandedRowIds` between subRows and detailsPanel
156
+ 19. **#33** — Normalize row ID type (string-only or document clearly)
157
+ 20. **#35** — Document loading prop interactions or use discriminated union
158
+ 21. **#37** — Add `rowData` to `onRowClick` callback signature
159
+
160
+ ### 🟢 Post-Beta / GA
161
+
162
+ 22. **#9** — Consider grouping sort props
163
+ 23. **#10** — Compositional/slot API
164
+ 24. **#15** — Virtualization
165
+ 25. **#19** — `aria-live` for loading announcements
166
+ 26. **#20** — `getHeight` type cleanup
167
+ 27. **#22** — Fix `@ts-expect-error` tech debt
168
+ 28. **#23** — `onRowDoubleClick`/`onCellClick`
169
+ 29. **#26** — Initial focus target
170
+ 30. **#14** — Performance for large tables (acceptable for beta)
171
+ 31. **#30** — Split ColumnDefinition into layers for power users
172
+ 32. **#32** — Warn when resize props used with `layout="auto"`
173
+ 33. **#34** — Document column visibility pattern
174
+ 34. **#36** — Consider `withKeyboardNav` default
175
+ 35. **#38** — Dev warning for missing `isRowHeader`
@@ -2,21 +2,23 @@ import React, { forwardRef } from "react";
2
2
  import { cl } from "../../../utils/helpers";
3
3
  import { useDataTableContext } from "../root/DataTableRoot.context";
4
4
 
5
- interface DataTableBaseCellProps extends React.HTMLAttributes<HTMLTableCellElement> {
5
+ interface DataTableBaseCellProps extends Omit<
6
+ React.TdHTMLAttributes<HTMLTableCellElement>,
7
+ "width"
8
+ > {
6
9
  /**
7
- * Content alignment inside cell
10
+ * Content alignment inside cell.
11
+ *
12
+ * Quantitative figures like amounts and percentages should be right‑aligned (but not phone numbers, postal codes etc.)
8
13
  * @default "left"
9
14
  */
10
15
  textAlign?: "left" | "center" | "right";
11
16
  /**
12
- * TODO: Shouldnt be needed to declare these here... But getting type-errors if not
17
+ * Internal cell type that controls padding, alignment, row-click prevention, and resize behavior.
18
+ * - `"action"`: Centers content, removes cell padding, prevents row click, and disables column resize.
19
+ * Used for selection (checkbox/radio) and expansion (expand/collapse) cells.
13
20
  */
14
- colSpan?: number;
15
- rowSpan?: number;
16
- /**
17
- * Temp hack to solve overflow and alignment
18
- */
19
- UNSAFE_isSelection?: boolean;
21
+ cellType?: "action";
20
22
  /**
21
23
  * When true, clicking this cell will not trigger `onRowClick` on the row.
22
24
  * Useful for cells that contain their own interactive content or actions
@@ -28,18 +30,13 @@ interface DataTableBaseCellProps extends React.HTMLAttributes<HTMLTableCellEleme
28
30
  * This is only needed when using `layout="auto"` together with
29
31
  * `truncateContent` on `<DataTable>` and you want the cell to be truncated.
30
32
  */
31
- contentMaxWidth?: number | `${number}${string}`;
33
+ contentMaxWidth?: number | string;
32
34
  /**
33
35
  * Makes the cell sticky.
34
36
  */
35
37
  isSticky?: "start" | "end" | false;
36
38
  }
37
39
 
38
- /**
39
- * TODO:
40
- * - Need a "type" or something that centers content instead of relying on isSelection prop.
41
- * - Need a separate prop do disabled resizing instead of relying on isSelection prop.
42
- */
43
40
  const DataTableBaseCell = forwardRef<
44
41
  HTMLTableCellElement,
45
42
  DataTableBaseCellProps & {
@@ -47,6 +44,12 @@ const DataTableBaseCell = forwardRef<
47
44
  * Cell type
48
45
  */
49
46
  as: "th" | "td";
47
+ /**
48
+ * Content to render before the main cell content.
49
+ *
50
+ * **WARNING: Adding content here that takes up space will probably break auto-resizing!**
51
+ */
52
+ beforeContent?: React.ReactNode;
50
53
  }
51
54
  >(
52
55
  (
@@ -54,13 +57,14 @@ const DataTableBaseCell = forwardRef<
54
57
  className,
55
58
  children,
56
59
  as: Component,
60
+ beforeContent,
57
61
  textAlign = "left",
58
- colSpan,
59
- UNSAFE_isSelection,
62
+ cellType,
60
63
  preventRowClick,
61
64
  contentMaxWidth,
62
- rowSpan,
63
65
  isSticky,
66
+ colSpan,
67
+ rowSpan,
64
68
  ...rest
65
69
  },
66
70
  forwardedRef,
@@ -74,15 +78,21 @@ const DataTableBaseCell = forwardRef<
74
78
  className={cl("aksel-data-table__cell", className)}
75
79
  tabIndex={withKeyboardNav ? -1 : undefined}
76
80
  data-align={textAlign}
77
- data-selectable={UNSAFE_isSelection}
81
+ data-cell-type={cellType || undefined}
78
82
  data-prevent-row-click={
79
- preventRowClick || UNSAFE_isSelection || undefined
83
+ preventRowClick || cellType === "action" || undefined
80
84
  }
81
85
  data-sticky={isSticky || undefined}
82
86
  colSpan={colSpan}
83
87
  rowSpan={rowSpan}
84
88
  >
85
- <div style={{ maxWidth: contentMaxWidth }}>{children}</div>
89
+ {beforeContent}
90
+ <div
91
+ className="aksel-data-table__cell-content"
92
+ style={{ maxWidth: contentMaxWidth }}
93
+ >
94
+ {children}
95
+ </div>
86
96
  </Component>
87
97
  );
88
98
  },
@@ -1,4 +1,4 @@
1
- import React, { forwardRef, useRef } from "react";
1
+ import React, { forwardRef, useMemo, useRef } from "react";
2
2
  import {
3
3
  ArrowsUpDownIcon,
4
4
  CaretLeftCircleFillIcon,
@@ -13,33 +13,51 @@ import {
13
13
  type DataTableBaseCellProps,
14
14
  } from "../base-cell/DataTableBaseCell";
15
15
  import type { SortDirection } from "../root/DataTable.types";
16
+ import { useDataTableContext } from "../root/DataTableRoot.context";
16
17
  import { type ResizeProps, useTableColumnResize } from "./useTableColumnResize";
17
18
 
18
- interface DataTableColumnHeaderProps
19
- extends ResizeProps, DataTableBaseCellProps {
19
+ interface DataTableColumnHeaderProps extends DataTableBaseCellProps {
20
+ /**
21
+ * Unique identifier for the column. Required for sortable columns to identify which column is being sorted.
22
+ */
23
+ id?: string;
20
24
  /**
21
25
  * Accessible name of the column.
22
26
  */
23
27
  label: string;
24
28
  /**
25
- * Makes the column header sortable. The entire header cell content becomes
26
- * a clickable button when true.
29
+ * Makes the column sortable by clicking on the header.
30
+ * The entire header cell content becomes a clickable button when true.
27
31
  */
28
- sortable?: boolean;
32
+ sortable?: boolean; // TODO: Consider merging sortable, sortDirection and onSortClick into a single "sort" object prop
29
33
  /**
30
34
  * Current sort direction. Only relevant when `sortable` is true.
31
- * Uses values matching the `aria-sort` attribute directly.
35
+ * Uses values matching the `aria-sort` attribute directly. // TODO: What does this mean? (Can we just remove it?)
32
36
  * @default "none"
33
37
  */
34
- sortDirection?: SortDirection;
38
+ sortDirection?: SortDirection; // TODO Not in use???
39
+ /**
40
+ * Called when the user clicks the header. Only relevant when `sortable` is true.
41
+ * The consumer is responsible for determining and setting the next sort state. // TODO: We don't use the term "consumer" in JSDoc anywhere else
42
+ */
43
+ onSortClick?: (event: React.MouseEvent<HTMLElement>) => void; // TODO Not in use???
35
44
  /**
36
- * Called when the user clicks the sortable header.
37
- * The consumer is responsible for determining and setting the next sort state.
45
+ * Object with props related to column width and resizing. Summary:
46
+ *
47
+ * - `resizable?: boolean` - Whether the column should be resizable by the user.
48
+ * - `autoResizeOnce?: boolean` - Whether the column should automatically resize to fit its content.
49
+ * - `resizeMin?: number` - Minimum width of the column when resizing.
50
+ * - `resizeMax?: number` - Maximum width of the column when resizing.
51
+ * - `value?: number | string` - Controlled width of the column.
52
+ * - `default?: number | string` - Initial width of the column.
53
+ * - `onChange?: (width: number) => void` - Called when the column width changes.
54
+ *
55
+ * See individual props for details and defaults.
38
56
  */
39
- onSortClick?: (event: React.MouseEvent<HTMLElement>) => void;
57
+ width?: ResizeProps;
40
58
  }
41
59
 
42
- const SORT_ICON: Record<SortDirection, React.ElementType | null> = {
60
+ const SORT_ICON: Record<SortDirection, React.ElementType> = {
43
61
  asc: SortUpIcon,
44
62
  desc: SortDownIcon,
45
63
  none: ArrowsUpDownIcon,
@@ -56,45 +74,37 @@ const DataTableColumnHeader = forwardRef<
56
74
  >(
57
75
  (
58
76
  {
59
- className,
60
- children,
77
+ id,
61
78
  label,
62
79
  sortable = false,
63
- sortDirection = "none",
64
- onSortClick,
65
- resizable = true,
66
- style,
67
80
  width,
68
- defaultWidth,
69
- autoWidth,
70
- minWidth,
71
- maxWidth,
72
- onWidthChange,
73
- colSpan,
74
- rowSpan,
75
- UNSAFE_isSelection,
81
+ cellType,
82
+ className,
83
+ children,
84
+ style,
76
85
  ...rest
77
86
  },
78
87
  forwardedRef,
79
88
  ) => {
80
- const contentRef = React.useRef<HTMLDivElement>(null);
81
89
  const thRef = useRef<HTMLTableCellElement>(null);
82
90
  const mergedRef = useMergeRefs(forwardedRef, thRef);
91
+ const { sortingState } = useDataTableContext();
92
+ const { onSortClick, sortState } = sortingState;
83
93
 
84
94
  const resizeResult = useTableColumnResize({
85
- resizable,
95
+ ...width,
86
96
  thRef,
87
- width,
88
- defaultWidth,
89
- autoWidth,
90
- minWidth,
91
- maxWidth,
92
- onWidthChange,
93
- style,
94
- colSpan,
97
+ colSpan: rest.colSpan,
95
98
  });
96
99
 
97
- const SortIcon = sortable ? SORT_ICON[sortDirection] : null;
100
+ const sortDirection = useMemo(() => {
101
+ const sortEntry = sortState.find((s) => s.columnId === id);
102
+ return sortEntry?.direction ?? "none";
103
+ }, [id, sortState]);
104
+
105
+ const canSort = sortable && id !== undefined;
106
+
107
+ const SortIcon = canSort ? SORT_ICON[sortDirection] : null;
98
108
 
99
109
  return (
100
110
  <DataTableBaseCell
@@ -102,22 +112,18 @@ const DataTableColumnHeader = forwardRef<
102
112
  {...rest}
103
113
  ref={mergedRef}
104
114
  className={cl("aksel-data-table__column-header", className)}
105
- data-sortable={sortable}
106
- style={resizeResult.style}
107
- aria-sort={sortable ? getAriaSort(sortDirection) : undefined}
108
- UNSAFE_isSelection={UNSAFE_isSelection}
109
- colSpan={colSpan}
110
- rowSpan={rowSpan}
115
+ data-sortable={canSort}
116
+ style={{ ...style, width: resizeResult.width }}
117
+ aria-sort={canSort ? getAriaSort(sortDirection) : undefined}
118
+ cellType={cellType}
111
119
  >
112
- {sortable ? (
120
+ {canSort ? (
113
121
  <button
114
122
  type="button"
115
123
  className="aksel-data-table__th-sort-button"
116
- onClick={onSortClick}
124
+ onClick={(event) => onSortClick(id, event)}
117
125
  >
118
- <div ref={contentRef} className="aksel-data-table__th-content">
119
- {children}
120
- </div>
126
+ <div className="aksel-data-table__th-content">{children}</div>
121
127
  {SortIcon && (
122
128
  <SortIcon
123
129
  aria-hidden
@@ -129,16 +135,15 @@ const DataTableColumnHeader = forwardRef<
129
135
  </button>
130
136
  ) : (
131
137
  <div
132
- ref={contentRef}
133
138
  className={cl({
134
- "aksel-data-table__th-content": !UNSAFE_isSelection,
139
+ "aksel-data-table__th-content": cellType !== "action",
135
140
  })}
136
141
  >
137
142
  {children}
138
143
  </div>
139
144
  )}
140
145
 
141
- {resizeResult.enabled && !UNSAFE_isSelection && (
146
+ {resizeResult.enabled && cellType !== "action" && (
142
147
  <button
143
148
  {...resizeResult.resizeHandlerProps}
144
149
  type="button"
@@ -153,23 +158,21 @@ const DataTableColumnHeader = forwardRef<
153
158
  data-block-keyboard-nav
154
159
  role="slider"
155
160
  aria-valuenow={
156
- typeof resizeResult.style.width === "number"
157
- ? resizeResult.style.width
158
- : 0
161
+ typeof resizeResult.width === "number" ? resizeResult.width : 0
159
162
  }
160
163
  aria-valuetext={
161
- typeof resizeResult.style.width === "number" &&
164
+ typeof resizeResult.width === "number" &&
162
165
  resizeResult.isResizingWithKeyboard
163
- ? resizeResult.style.width.toString()
166
+ ? resizeResult.width.toString()
164
167
  : "" // Needs to be blank when not in keyboard resizing mode to avoid NVDA announcing the value as part of the column heading
165
168
  } // Need either this or aria-valuemax to get SR (at least NVDA) to announce the value
166
169
  >
167
170
  {resizeResult.isResizingWithKeyboard && (
168
171
  <>
169
- <span className="aksel-data-table__th-resize-handle-indicator aksel-data-table__th-resize-handle-indicator--start">
172
+ <span className="aksel-data-table__th-resize-handle-indicator">
170
173
  <CaretLeftCircleFillIcon aria-hidden fontSize="1.5rem" />
171
174
  </span>
172
- <span className="aksel-data-table__th-resize-handle-indicator aksel-data-table__th-resize-handle-indicator--end">
175
+ <span className="aksel-data-table__th-resize-handle-indicator">
173
176
  <CaretRightCircleFillIcon aria-hidden fontSize="1.5rem" />
174
177
  </span>
175
178
  </>