@wallarm-org/design-system 4.19.2 → 4.19.3-rc-fix-table-header-focus-scroll.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -76,6 +76,9 @@ const StickyGroupParent = ({ tableWidth, headerHeight, windowScrollRoot, headerR
76
76
  stickyRow,
77
77
  containerRef
78
78
  ]);
79
+ useLayoutEffect(()=>{
80
+ for (const el of anchorRef.current?.querySelectorAll('a[href], button, input, select, textarea, [tabindex]') ?? [])el.tabIndex = -1;
81
+ });
79
82
  return /*#__PURE__*/ jsx("div", {
80
83
  ref: anchorRef,
81
84
  className: cn('pointer-events-none', !useWindowScroll && 'sticky z-[21] h-0 overflow-visible'),
@@ -48,8 +48,7 @@ const TableColumnMenuMoveLeftItem = (t0)=>{
48
48
  t3 = ()=>{
49
49
  onSelect?.();
50
50
  const allColumns = ctx.table.getAllLeafColumns();
51
- const columnOrderAtom = ctx.table.atoms.columnOrder.get();
52
- const currentOrder = columnOrderAtom.length ? columnOrderAtom : allColumns.map(_temp);
51
+ const currentOrder = allColumns.map(_temp);
53
52
  const fromIdx = currentOrder.indexOf(column.id);
54
53
  const toIdx = fromIdx - 1;
55
54
  if (toIdx < 0) return;
@@ -49,8 +49,7 @@ const TableColumnMenuMoveRightItem = (t0)=>{
49
49
  t3 = ()=>{
50
50
  onSelect?.();
51
51
  const allColumns = ctx.table.getAllLeafColumns();
52
- const columnOrderAtom = ctx.table.atoms.columnOrder.get();
53
- const currentOrder = columnOrderAtom.length ? columnOrderAtom : allColumns.map(_temp);
52
+ const currentOrder = allColumns.map(_temp);
54
53
  const fromIdx = currentOrder.indexOf(column.id);
55
54
  const toIdx = fromIdx + 1;
56
55
  if (toIdx >= currentOrder.length) return;
@@ -16,7 +16,7 @@ const toTanStackPinning = (p, pinnedLeft)=>({
16
16
  end: p?.right ?? []
17
17
  });
18
18
  const TableProvider = (props)=>{
19
- const $ = compiler_runtime_c(170);
19
+ const $ = compiler_runtime_c(169);
20
20
  const { data, columns, isLoading: t0, isLoadingPrevious: t1, skeletonCount: t2, children, getRowId, sorting: sortingProp, onSortingChange, manualSorting: t3, rowSelection: rowSelectionProp, onRowSelectionChange, enableSelectAllRows: t4, onSelectAllRows, columnSizing: columnSizingProp, onColumnSizingChange, columnPinning: columnPinningProp, onColumnPinningChange, columnOrder: columnOrderProp, onColumnOrderChange, grouping: groupingProp, onGroupingChange, expanded: expandedProp, onExpandedChange, renderGroupRow, groupRowSpan: t5, groupExpandColumn: t6, getSubRows, showEmptyGroups: t7, renderExpandedRow, columnVisibility: columnVisibilityProp, onColumnVisibilityChange, defaultColumnVisibility, defaultColumnOrder, columnGroups, virtualized, stretch: t8, estimateRowHeight, overscan: t9, onEndReached, onEndReachedThreshold, onStartReached, onStartReachedThreshold, initialScrollToRowId, onRowReorder, getRowCanDrag, renderFullWidthRow, onMasterCellClick, activeRowId: activeRowIdProp, onSettingsOpenChange, deferColumnVisibility: t10 } = props;
21
21
  const isLoading = void 0 === t0 ? false : t0;
22
22
  const isLoadingPrevious = void 0 === t1 ? false : t1;
@@ -579,70 +579,68 @@ const TableProvider = (props)=>{
579
579
  } else t55 = $[150];
580
580
  const sensors = useSensors(useSensor(PointerSensor, t54), useSensor(KeyboardSensor, t55));
581
581
  let t56;
582
- if ($[151] !== allLeafColumns || $[152] !== setColumnOrder || $[153] !== table.atoms) {
582
+ if ($[151] !== setColumnOrder || $[152] !== table) {
583
583
  t56 = (event)=>{
584
584
  const { active, over } = event;
585
585
  if (!over || active.id === over.id) return;
586
- const columnOrderAtom = table.atoms.columnOrder.get();
587
- const currentOrder = columnOrderAtom.length ? columnOrderAtom : allLeafColumns.map(_temp2);
586
+ const currentOrder = table.getAllLeafColumns().map(_temp2);
588
587
  const oldIndex = currentOrder.indexOf(String(active.id));
589
588
  const newIndex = currentOrder.indexOf(String(over.id));
590
589
  const newOrder_0 = arrayMove(currentOrder, oldIndex, newIndex);
591
590
  setColumnOrder(newOrder_0);
592
591
  };
593
- $[151] = allLeafColumns;
594
- $[152] = setColumnOrder;
595
- $[153] = table.atoms;
596
- $[154] = t56;
597
- } else t56 = $[154];
592
+ $[151] = setColumnOrder;
593
+ $[152] = table;
594
+ $[153] = t56;
595
+ } else t56 = $[153];
598
596
  const handleDragEnd = t56;
599
597
  let t57;
600
- if ($[155] !== allLeafColumns || $[156] !== alwaysPinnedLeft || $[157] !== columnDndEnabled) {
598
+ if ($[154] !== allLeafColumns || $[155] !== alwaysPinnedLeft || $[156] !== columnDndEnabled) {
601
599
  t57 = columnDndEnabled ? allLeafColumns.filter((c_0)=>!alwaysPinnedLeft.includes(c_0.id)).map(_temp3) : [];
602
- $[155] = allLeafColumns;
603
- $[156] = alwaysPinnedLeft;
604
- $[157] = columnDndEnabled;
605
- $[158] = t57;
606
- } else t57 = $[158];
600
+ $[154] = allLeafColumns;
601
+ $[155] = alwaysPinnedLeft;
602
+ $[156] = columnDndEnabled;
603
+ $[157] = t57;
604
+ } else t57 = $[157];
607
605
  const columnIds = t57;
608
606
  const t58 = columnDndEnabled ? sensors : void 0;
609
607
  const t59 = columnDndEnabled ? closestCenter : void 0;
610
608
  const t60 = columnDndEnabled ? handleDragEnd : void 0;
611
609
  let t61;
612
- if ($[159] !== children || $[160] !== columnIds) {
610
+ if ($[158] !== children || $[159] !== columnIds) {
613
611
  t61 = /*#__PURE__*/ jsx(SortableContext, {
614
612
  items: columnIds,
615
613
  strategy: horizontalListSortingStrategy,
616
614
  children: children
617
615
  });
618
- $[159] = children;
619
- $[160] = columnIds;
620
- $[161] = t61;
621
- } else t61 = $[161];
616
+ $[158] = children;
617
+ $[159] = columnIds;
618
+ $[160] = t61;
619
+ } else t61 = $[160];
622
620
  let t62;
623
- if ($[162] !== t58 || $[163] !== t59 || $[164] !== t60 || $[165] !== t61) {
621
+ if ($[161] !== t58 || $[162] !== t59 || $[163] !== t60 || $[164] !== t61) {
624
622
  t62 = /*#__PURE__*/ jsx(DndContext, {
625
623
  sensors: t58,
626
624
  collisionDetection: t59,
627
625
  onDragEnd: t60,
628
626
  children: t61
629
627
  });
630
- $[162] = t58;
631
- $[163] = t59;
632
- $[164] = t60;
633
- $[165] = t61;
634
- $[166] = t62;
635
- } else t62 = $[166];
628
+ $[161] = t58;
629
+ $[162] = t59;
630
+ $[163] = t60;
631
+ $[164] = t61;
632
+ $[165] = t62;
633
+ } else t62 = $[165];
636
634
  let t63;
637
- if ($[167] !== contextValue || $[168] !== t62) {
635
+ if ($[166] !== contextValue || $[167] !== t62) {
638
636
  t63 = /*#__PURE__*/ jsx(TableContext.Provider, {
639
637
  value: contextValue,
640
638
  children: t62
641
639
  });
642
- $[167] = contextValue;
643
- $[168] = t62;
644
- $[169] = t63;
645
- } else t63 = $[169];
640
+ $[166] = contextValue;
641
+ $[167] = t62;
642
+ $[168] = t63;
643
+ } else t63 = $[168];
646
644
  return t63;
647
645
  };
648
646
  function _temp() {
@@ -297,6 +297,7 @@ const TableHeadCell = (t0)=>{
297
297
  colSpan: header.colSpan,
298
298
  "aria-sort": ariaSort,
299
299
  ...t18,
300
+ role: "columnheader",
300
301
  tabIndex: -1,
301
302
  children: [
302
303
  t19,
@@ -67,10 +67,20 @@ const TableInnerWindow = (t0)=>{
67
67
  if (headerScrollRef.current) headerScrollRef.current.scrollLeft = scrollEl.scrollLeft;
68
68
  if (groupScrollRef.current) groupScrollRef.current.scrollLeft = scrollEl.scrollLeft;
69
69
  };
70
+ const header = headerScrollRef.current;
71
+ const onHeaderScroll = ()=>{
72
+ if (header && scrollEl.scrollLeft !== header.scrollLeft) scrollEl.scrollLeft = header.scrollLeft;
73
+ };
70
74
  scrollEl.addEventListener("scroll", onScroll, {
71
75
  passive: true
72
76
  });
73
- return ()=>scrollEl.removeEventListener("scroll", onScroll);
77
+ header?.addEventListener("scroll", onHeaderScroll, {
78
+ passive: true
79
+ });
80
+ return ()=>{
81
+ scrollEl.removeEventListener("scroll", onScroll);
82
+ header?.removeEventListener("scroll", onHeaderScroll);
83
+ };
74
84
  };
75
85
  t5 = [
76
86
  containerRef,
@@ -137,7 +147,7 @@ const TableInnerWindow = (t0)=>{
137
147
  t12 = /*#__PURE__*/ jsxs("table", {
138
148
  className: "table-fixed border-separate border-spacing-0",
139
149
  style: t9,
140
- "aria-hidden": true,
150
+ role: "presentation",
141
151
  children: [
142
152
  t10,
143
153
  t11
@@ -238,24 +248,23 @@ const TableInnerWindow = (t0)=>{
238
248
  $[56] = t20;
239
249
  } else t20 = $[56];
240
250
  let t21;
241
- if ($[57] !== ariaLabel || $[58] !== t18 || $[59] !== t19 || $[60] !== t20) {
251
+ if ($[57] !== t18 || $[58] !== t19 || $[59] !== t20) {
242
252
  t21 = /*#__PURE__*/ jsxs("table", {
243
253
  className: "table-fixed border-separate border-spacing-0",
244
254
  style: t18,
245
- "aria-label": ariaLabel,
255
+ role: "presentation",
246
256
  children: [
247
257
  t19,
248
258
  t20
249
259
  ]
250
260
  });
251
- $[57] = ariaLabel;
252
- $[58] = t18;
253
- $[59] = t19;
254
- $[60] = t20;
255
- $[61] = t21;
256
- } else t21 = $[61];
261
+ $[57] = t18;
262
+ $[58] = t19;
263
+ $[59] = t20;
264
+ $[60] = t21;
265
+ } else t21 = $[60];
257
266
  let t22;
258
- if ($[62] !== children || $[63] !== containerRef || $[64] !== t21) {
267
+ if ($[61] !== children || $[62] !== containerRef || $[63] !== t21) {
259
268
  t22 = /*#__PURE__*/ jsxs(ScrollAreaViewport, {
260
269
  ref: containerRef,
261
270
  "data-table-scroll-container": true,
@@ -265,20 +274,20 @@ const TableInnerWindow = (t0)=>{
265
274
  children
266
275
  ]
267
276
  });
268
- $[62] = children;
269
- $[63] = containerRef;
270
- $[64] = t21;
271
- $[65] = t22;
272
- } else t22 = $[65];
277
+ $[61] = children;
278
+ $[62] = containerRef;
279
+ $[63] = t21;
280
+ $[64] = t22;
281
+ } else t22 = $[64];
273
282
  let t23;
274
- if ($[66] === Symbol.for("react.memo_cache_sentinel")) {
283
+ if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
275
284
  t23 = /*#__PURE__*/ jsx(ScrollAreaScrollbar, {
276
285
  orientation: "horizontal"
277
286
  });
278
- $[66] = t23;
279
- } else t23 = $[66];
287
+ $[65] = t23;
288
+ } else t23 = $[65];
280
289
  let t24;
281
- if ($[67] !== t16 || $[68] !== t22) {
290
+ if ($[66] !== t16 || $[67] !== t22) {
282
291
  t24 = /*#__PURE__*/ jsxs(ScrollArea, {
283
292
  className: "group/scroll rounded-12 border border-border-primary-light",
284
293
  children: [
@@ -287,18 +296,21 @@ const TableInnerWindow = (t0)=>{
287
296
  t23
288
297
  ]
289
298
  });
290
- $[67] = t16;
291
- $[68] = t22;
292
- $[69] = t24;
293
- } else t24 = $[69];
299
+ $[66] = t16;
300
+ $[67] = t22;
301
+ $[68] = t24;
302
+ } else t24 = $[68];
294
303
  let t25;
295
- if ($[70] !== t24 || $[71] !== testId) {
304
+ if ($[69] !== ariaLabel || $[70] !== t24 || $[71] !== testId) {
296
305
  t25 = /*#__PURE__*/ jsx("div", {
297
306
  ref: rootRef,
298
307
  "data-testid": testId,
308
+ role: "table",
309
+ "aria-label": ariaLabel,
299
310
  className: "group/scroll relative outline-none",
300
311
  children: t24
301
312
  });
313
+ $[69] = ariaLabel;
302
314
  $[70] = t24;
303
315
  $[71] = testId;
304
316
  $[72] = t25;
@@ -136,8 +136,7 @@ const TableSettingsMenu = ({ 'data-testid': testIdProp, children, ...rest })=>{
136
136
  const handleDragEnd = (event)=>{
137
137
  const { active, over } = event;
138
138
  if (!over || active.id === over.id) return;
139
- const columnOrderAtom = table.atoms.columnOrder.get();
140
- const currentOrder = columnOrderAtom.length ? columnOrderAtom : allColumns.map((c)=>c.id);
139
+ const currentOrder = allColumns.map((c)=>c.id);
141
140
  const oldIndex = currentOrder.indexOf(String(active.id));
142
141
  const newIndex = currentOrder.indexOf(String(over.id));
143
142
  const newOrder = arrayMove(currentOrder, oldIndex, newIndex);
@@ -6,7 +6,7 @@ import { Button } from "../../Button/index.js";
6
6
  import { useTableContext } from "../TableContext/index.js";
7
7
  import { resolveVisibilityDraft, useTableSettingsMenuContentContext } from "./TableSettingsMenuContentContext.js";
8
8
  const TableSettingsMenuReset = (t0)=>{
9
- const $ = c(26);
9
+ const $ = c(29);
10
10
  let onClick;
11
11
  let rest;
12
12
  let testIdProp;
@@ -22,7 +22,7 @@ const TableSettingsMenuReset = (t0)=>{
22
22
  testIdProp = $[3];
23
23
  }
24
24
  const testId = useTestId("settings-menu-reset", testIdProp);
25
- const { table, visibilityEnabled, columnDndEnabled, defaultColumnVisibility, defaultColumnOrder, setColumnOrder, deferColumnVisibility } = useTableContext();
25
+ const { table, visibilityEnabled, columnDndEnabled, defaultColumnVisibility, defaultColumnOrder, setColumnOrder, alwaysPinnedLeft, deferColumnVisibility } = useTableContext();
26
26
  const { visibilityDraft, setVisibilityDraft } = useTableSettingsMenuContentContext();
27
27
  let t1;
28
28
  if ($[4] !== columnDndEnabled || $[5] !== defaultColumnOrder || $[6] !== defaultColumnVisibility || $[7] !== deferColumnVisibility || $[8] !== onClick || $[9] !== setColumnOrder || $[10] !== setVisibilityDraft || $[11] !== table || $[12] !== visibilityEnabled) {
@@ -60,17 +60,28 @@ const TableSettingsMenuReset = (t0)=>{
60
60
  } else t2 = $[17];
61
61
  const visibilityMatch = t2;
62
62
  let t3;
63
- if ($[18] !== defaultColumnOrder || $[19] !== effectiveOrder) {
64
- t3 = !defaultColumnOrder || isEqual(effectiveOrder, defaultColumnOrder);
65
- $[18] = defaultColumnOrder;
66
- $[19] = effectiveOrder;
67
- $[20] = t3;
68
- } else t3 = $[20];
69
- const orderMatch = t3;
70
- const isDefaultState = visibilityMatch && orderMatch;
63
+ if ($[18] !== alwaysPinnedLeft) {
64
+ t3 = (t4)=>{
65
+ const order = void 0 === t4 ? [] : t4;
66
+ return order.filter((id)=>!alwaysPinnedLeft.includes(id));
67
+ };
68
+ $[18] = alwaysPinnedLeft;
69
+ $[19] = t3;
70
+ } else t3 = $[19];
71
+ const movable = t3;
71
72
  let t4;
72
- if ($[21] !== handleClick || $[22] !== isDefaultState || $[23] !== rest || $[24] !== testId) {
73
- t4 = /*#__PURE__*/ jsx(Button, {
73
+ if ($[20] !== defaultColumnOrder || $[21] !== effectiveOrder || $[22] !== movable) {
74
+ t4 = !defaultColumnOrder || isEqual(movable(effectiveOrder), movable(defaultColumnOrder));
75
+ $[20] = defaultColumnOrder;
76
+ $[21] = effectiveOrder;
77
+ $[22] = movable;
78
+ $[23] = t4;
79
+ } else t4 = $[23];
80
+ const orderMatch = t4;
81
+ const isDefaultState = visibilityMatch && orderMatch;
82
+ let t5;
83
+ if ($[24] !== handleClick || $[25] !== isDefaultState || $[26] !== rest || $[27] !== testId) {
84
+ t5 = /*#__PURE__*/ jsx(Button, {
74
85
  ...rest,
75
86
  type: "button",
76
87
  "data-testid": testId,
@@ -82,13 +93,13 @@ const TableSettingsMenuReset = (t0)=>{
82
93
  fullWidth: true,
83
94
  children: "Reset to default"
84
95
  });
85
- $[21] = handleClick;
86
- $[22] = isDefaultState;
87
- $[23] = rest;
88
- $[24] = testId;
89
- $[25] = t4;
90
- } else t4 = $[25];
91
- return t4;
96
+ $[24] = handleClick;
97
+ $[25] = isDefaultState;
98
+ $[26] = rest;
99
+ $[27] = testId;
100
+ $[28] = t5;
101
+ } else t5 = $[28];
102
+ return t5;
92
103
  };
93
104
  TableSettingsMenuReset.displayName = "TableSettingsMenuReset";
94
105
  export { TableSettingsMenuReset };
@@ -27,6 +27,7 @@ const TBody = (t0)=>{
27
27
  if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
28
28
  t2 = /*#__PURE__*/ jsx("tbody", {
29
29
  ref: ref,
30
+ role: "rowgroup",
30
31
  className: t1,
31
32
  ...props
32
33
  });
@@ -27,6 +27,7 @@ const THead = (t0)=>{
27
27
  if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
28
28
  t2 = /*#__PURE__*/ jsx("thead", {
29
29
  ref: ref,
30
+ role: "rowgroup",
30
31
  className: t1,
31
32
  ...props
32
33
  });
@@ -51,6 +51,7 @@ const Td = (t0)=>{
51
51
  if ($[15] !== props || $[16] !== ref || $[17] !== t1) {
52
52
  t2 = /*#__PURE__*/ jsx("td", {
53
53
  ref: ref,
54
+ role: "cell",
54
55
  className: t1,
55
56
  ...props
56
57
  });
@@ -60,6 +60,7 @@ const Th = (t0)=>{
60
60
  t2 = /*#__PURE__*/ jsx("th", {
61
61
  ref: ref,
62
62
  scope: "col",
63
+ role: "columnheader",
63
64
  className: t1,
64
65
  ...props
65
66
  });
@@ -28,6 +28,7 @@ const Tr = (t0)=>{
28
28
  if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
29
29
  t2 = /*#__PURE__*/ jsx("tr", {
30
30
  ref: ref,
31
+ role: "row",
31
32
  className: t1,
32
33
  ...props
33
34
  });
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "4.19.1",
3
- "generatedAt": "2026-11-17T08:53:17.637Z",
2
+ "version": "4.19.2",
3
+ "generatedAt": "2026-11-17T10:12:33.379Z",
4
4
  "components": [
5
5
  {
6
6
  "name": "Accordion",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.19.1",
2
+ "version": "4.19.2",
3
3
  "rules": "Every numeric utility is in px, not 4px steps: p-16 is 16px, p-4 is 4px. Translate Tailwind habits (p-4 → p-16, gap-6 → gap-24, w-64 → w-256).\n\nBefore composing a screen, call get_guideline for the pattern (app shell, list page, table, drawer, form, dialog, filters, empty state, settings, auth). Wrong → right:\n\n- p-5, gap-3, p-10 → stay on the scale: 1, 2, 4, 6, 8, 12, 16, 20, 24, 28, 32, 40, 48, 64…\n- space-y-4, margins per child → <VStack gap={16}>, <HStack gap={8}>\n- Padded page wrapper → PageHeader / PageToolbar / PageContent own the 24px gutter\n- p-* on Card, DrawerBody, DialogBody, PageToolbar, Table → none; they own their padding\n- className on Text, Heading, Field, Drawer/Dialog Header/Body/Footer → wrap in your own element\n- Raw <h1>, <p>, <label> → <Heading as=\"h2\" size=\"lg\">, <Text size=\"sm\">, Field\n- <Text> default (16px) for body → size=\"sm\"\n- leading-none (0px), leading-5 (5px) → leading-sm, leading-20\n- weight=\"semibold\" → weight is light|regular|medium|bold (medium = 450)\n- bg-primary, text-muted, bg-card, bg-white → bg-bg-primary, text-text-secondary, bg-bg-surface-1\n- text-error, bg-red-500 → danger tokens; categorical color → Badge color\n- dark: variant, setting data-theme → semantic tokens, useTheme().setTheme()\n- rounded-lg, rounded, rounded-[15px] → rounded-8 (controls), rounded-12 (panels)\n- shadow-* on DS components, z-* on overlays → never; they own both\n- focus:ring → focus-visible:ring-3 ring-focus-primary outline-none\n- size, DIALOG/DRAWER_SIZES → width: Dialog 400 confirm, 560 default, 960 picker; Drawer 640 default, 700 Timeline form\n- Dialog, useToast from the root → @wallarm-org/design-system/Dialog, /Toast\n- Field invalid → error on the control + FieldError\n- Table actions column → meta.renderMenuAction on the master column\n- Hand-built side menu → RemoteShell config={NavConfig}\n- ConfirmDialog, FilterBar, Combobox → compose Dialog parts, PageToolbar + FilterDropdown, Select + useSelectSearch\n- data-slot in tests → data-testid\n",
4
4
  "guidelines": [
5
5
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wallarm-org/design-system",
3
- "version": "4.19.2",
3
+ "version": "4.19.3-rc-fix-table-header-focus-scroll.1",
4
4
  "description": "Core design system library with React components and Storybook documentation",
5
5
  "publishConfig": {
6
6
  "access": "public",