@wallarm-org/design-system 4.19.0 → 4.19.1-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.
- package/dist/components/Table/StickyGroupParent.js +3 -0
- package/dist/components/Table/TableInner/TableInnerWindow.js +37 -25
- package/dist/components/Table/primitives/TBody.js +1 -0
- package/dist/components/Table/primitives/THead.js +1 -0
- package/dist/components/Table/primitives/Td.js +1 -0
- package/dist/components/Table/primitives/Th.js +1 -0
- package/dist/components/Table/primitives/Tr.js +1 -0
- package/dist/metadata/components.json +2 -2
- package/dist/metadata/guidelines.json +1 -1
- package/package.json +1 -1
|
@@ -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'),
|
|
@@ -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
|
-
|
|
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
|
-
"
|
|
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] !==
|
|
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
|
-
"
|
|
255
|
+
role: "presentation",
|
|
246
256
|
children: [
|
|
247
257
|
t19,
|
|
248
258
|
t20
|
|
249
259
|
]
|
|
250
260
|
});
|
|
251
|
-
$[57] =
|
|
252
|
-
$[58] =
|
|
253
|
-
$[59] =
|
|
254
|
-
$[60] =
|
|
255
|
-
|
|
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 ($[
|
|
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
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
} else t22 = $[
|
|
277
|
+
$[61] = children;
|
|
278
|
+
$[62] = containerRef;
|
|
279
|
+
$[63] = t21;
|
|
280
|
+
$[64] = t22;
|
|
281
|
+
} else t22 = $[64];
|
|
273
282
|
let t23;
|
|
274
|
-
if ($[
|
|
283
|
+
if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
|
|
275
284
|
t23 = /*#__PURE__*/ jsx(ScrollAreaScrollbar, {
|
|
276
285
|
orientation: "horizontal"
|
|
277
286
|
});
|
|
278
|
-
$[
|
|
279
|
-
} else t23 = $[
|
|
287
|
+
$[65] = t23;
|
|
288
|
+
} else t23 = $[65];
|
|
280
289
|
let t24;
|
|
281
|
-
if ($[
|
|
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
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
} else t24 = $[
|
|
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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
2
|
+
"version": "4.19.0",
|
|
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