@primer/react 38.43.0 → 38.44.0-rc.0c9e08268
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/DataTable/DataTable.d.ts +20 -0
- package/dist/DataTable/DataTable.js +106 -88
- package/dist/DataTable/Table-0327e248.css +2 -0
- package/dist/DataTable/Table-0327e248.css.map +1 -0
- package/dist/DataTable/Table.js +53 -41
- package/dist/DataTable/Table.module.css.js +6 -5
- package/dist/DataTable/TableGroup.d.ts +25 -1
- package/dist/DataTable/TableGroup.js +195 -119
- package/dist/DataTable/useTable.js +184 -131
- package/generated/components.json +47 -0
- package/package.json +2 -2
- package/dist/DataTable/Table-6ee6a868.css +0 -2
- package/dist/DataTable/Table-6ee6a868.css.map +0 -1
|
@@ -4,51 +4,81 @@ import { DEFAULT_SORT_DIRECTION, SortDirection, strategies, transition } from ".
|
|
|
4
4
|
import { useId, useState } from "react";
|
|
5
5
|
//#region src/DataTable/useTable.ts
|
|
6
6
|
function useTable(t0) {
|
|
7
|
-
const $ = c(
|
|
8
|
-
const { columns, data, initialSortColumn, initialSortDirection, externalSorting, getRowId, rowSelection: t1, selectedRows: controlledSelectedRows, defaultSelectedRows, onSelectionChange, isRowSelectable } = t0;
|
|
7
|
+
const $ = c(77);
|
|
8
|
+
const { columns, data, initialSortColumn, initialSortDirection, externalSorting, getRowId, rowSelection: t1, selectedRows: controlledSelectedRows, defaultSelectedRows, onSelectionChange, isRowSelectable, collapsibleGroups: t2, expandedGroups: controlledExpandedGroups, defaultExpandedGroups, onExpandedGroupsChange } = t0;
|
|
9
9
|
const rowSelection = t1 === void 0 ? false : t1;
|
|
10
|
+
const collapsibleGroups = t2 === void 0 ? false : t2;
|
|
10
11
|
const tableId = useId();
|
|
11
12
|
const [rowOrder, setRowOrder] = useState(data);
|
|
12
13
|
const [prevData, setPrevData] = useState(data);
|
|
13
14
|
const [prevColumns, setPrevColumns] = useState(columns);
|
|
14
|
-
let
|
|
15
|
+
let t3;
|
|
15
16
|
if ($[0] !== columns || $[1] !== initialSortColumn || $[2] !== initialSortDirection) {
|
|
16
|
-
|
|
17
|
+
t3 = () => getInitialSortState(columns, initialSortColumn, initialSortDirection);
|
|
17
18
|
$[0] = columns;
|
|
18
19
|
$[1] = initialSortColumn;
|
|
19
20
|
$[2] = initialSortDirection;
|
|
20
|
-
$[3] =
|
|
21
|
-
} else
|
|
22
|
-
const [sortByColumn, setSortByColumn] = useState(
|
|
23
|
-
let
|
|
21
|
+
$[3] = t3;
|
|
22
|
+
} else t3 = $[3];
|
|
23
|
+
const [sortByColumn, setSortByColumn] = useState(t3);
|
|
24
|
+
let t4;
|
|
24
25
|
if ($[4] !== defaultSelectedRows) {
|
|
25
|
-
|
|
26
|
+
t4 = () => defaultSelectedRows !== null && defaultSelectedRows !== void 0 ? defaultSelectedRows : /* @__PURE__ */ new Set();
|
|
26
27
|
$[4] = defaultSelectedRows;
|
|
27
|
-
$[5] =
|
|
28
|
-
} else
|
|
29
|
-
let
|
|
28
|
+
$[5] = t4;
|
|
29
|
+
} else t4 = $[5];
|
|
30
|
+
let t5;
|
|
30
31
|
if ($[6] !== onSelectionChange) {
|
|
31
|
-
|
|
32
|
+
t5 = (nextSelectedRows) => {
|
|
32
33
|
onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange({ selectedRows: new Set(nextSelectedRows) });
|
|
33
34
|
};
|
|
34
35
|
$[6] = onSelectionChange;
|
|
35
|
-
$[7] =
|
|
36
|
-
} else
|
|
37
|
-
let
|
|
38
|
-
if ($[8] !== controlledSelectedRows || $[9] !==
|
|
39
|
-
|
|
36
|
+
$[7] = t5;
|
|
37
|
+
} else t5 = $[7];
|
|
38
|
+
let t6;
|
|
39
|
+
if ($[8] !== controlledSelectedRows || $[9] !== t4 || $[10] !== t5) {
|
|
40
|
+
t6 = {
|
|
40
41
|
name: "DataTable selectedRows",
|
|
41
42
|
value: controlledSelectedRows,
|
|
42
|
-
defaultValue:
|
|
43
|
-
onChange:
|
|
43
|
+
defaultValue: t4,
|
|
44
|
+
onChange: t5
|
|
44
45
|
};
|
|
45
46
|
$[8] = controlledSelectedRows;
|
|
46
|
-
$[9] =
|
|
47
|
-
$[10] =
|
|
48
|
-
$[11] =
|
|
49
|
-
} else
|
|
50
|
-
const [selectedRows, setSelectedRows] = useControllableState(
|
|
47
|
+
$[9] = t4;
|
|
48
|
+
$[10] = t5;
|
|
49
|
+
$[11] = t6;
|
|
50
|
+
} else t6 = $[11];
|
|
51
|
+
const [selectedRows, setSelectedRows] = useControllableState(t6);
|
|
51
52
|
const { gridTemplateColumns } = useTableLayout(columns, rowSelection);
|
|
53
|
+
let t7;
|
|
54
|
+
if ($[12] !== data || $[13] !== defaultExpandedGroups) {
|
|
55
|
+
t7 = () => defaultExpandedGroups !== null && defaultExpandedGroups !== void 0 ? defaultExpandedGroups : new Set(data.filter(isDataTableRowGroup).map(_temp));
|
|
56
|
+
$[12] = data;
|
|
57
|
+
$[13] = defaultExpandedGroups;
|
|
58
|
+
$[14] = t7;
|
|
59
|
+
} else t7 = $[14];
|
|
60
|
+
let t8;
|
|
61
|
+
if ($[15] !== onExpandedGroupsChange) {
|
|
62
|
+
t8 = (nextExpandedGroups) => {
|
|
63
|
+
onExpandedGroupsChange === null || onExpandedGroupsChange === void 0 || onExpandedGroupsChange({ expandedGroups: new Set(nextExpandedGroups) });
|
|
64
|
+
};
|
|
65
|
+
$[15] = onExpandedGroupsChange;
|
|
66
|
+
$[16] = t8;
|
|
67
|
+
} else t8 = $[16];
|
|
68
|
+
let t9;
|
|
69
|
+
if ($[17] !== controlledExpandedGroups || $[18] !== t7 || $[19] !== t8) {
|
|
70
|
+
t9 = {
|
|
71
|
+
name: "DataTable expandedGroups",
|
|
72
|
+
value: controlledExpandedGroups,
|
|
73
|
+
defaultValue: t7,
|
|
74
|
+
onChange: t8
|
|
75
|
+
};
|
|
76
|
+
$[17] = controlledExpandedGroups;
|
|
77
|
+
$[18] = t7;
|
|
78
|
+
$[19] = t8;
|
|
79
|
+
$[20] = t9;
|
|
80
|
+
} else t9 = $[20];
|
|
81
|
+
const [expandedGroups, setExpandedGroups] = useControllableState(t9);
|
|
52
82
|
if (columns !== prevColumns) {
|
|
53
83
|
setPrevColumns(columns);
|
|
54
84
|
if (sortByColumn) {
|
|
@@ -59,21 +89,21 @@ function useTable(t0) {
|
|
|
59
89
|
})) setSortByColumn(null);
|
|
60
90
|
}
|
|
61
91
|
}
|
|
62
|
-
let
|
|
63
|
-
if ($[
|
|
64
|
-
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
} else
|
|
68
|
-
const hasGroups =
|
|
92
|
+
let t10;
|
|
93
|
+
if ($[21] !== rowOrder) {
|
|
94
|
+
t10 = rowOrder.some(isDataTableRowGroup);
|
|
95
|
+
$[21] = rowOrder;
|
|
96
|
+
$[22] = t10;
|
|
97
|
+
} else t10 = $[22];
|
|
98
|
+
const hasGroups = t10;
|
|
69
99
|
let bodies;
|
|
70
100
|
let headers;
|
|
71
101
|
let sortBy;
|
|
72
|
-
let
|
|
73
|
-
if ($[
|
|
74
|
-
let
|
|
75
|
-
if ($[
|
|
76
|
-
|
|
102
|
+
let t11;
|
|
103
|
+
if ($[23] !== collapsibleGroups || $[24] !== columns || $[25] !== data || $[26] !== expandedGroups || $[27] !== externalSorting || $[28] !== getRowId || $[29] !== hasGroups || $[30] !== isRowSelectable || $[31] !== prevData || $[32] !== rowOrder || $[33] !== rowSelection || $[34] !== selectedRows || $[35] !== sortByColumn || $[36] !== tableId) {
|
|
104
|
+
let t12;
|
|
105
|
+
if ($[41] !== hasGroups || $[42] !== sortByColumn || $[43] !== tableId) {
|
|
106
|
+
t12 = (column_1, index) => {
|
|
77
107
|
var _column_1$id;
|
|
78
108
|
const id_0 = (_column_1$id = column_1.id) !== null && _column_1$id !== void 0 ? _column_1$id : column_1.field;
|
|
79
109
|
if (id_0 === void 0) throw new Error("Expected either an `id` or `field` to be defined for a Column");
|
|
@@ -91,12 +121,12 @@ function useTable(t0) {
|
|
|
91
121
|
}
|
|
92
122
|
};
|
|
93
123
|
};
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
} else
|
|
99
|
-
headers = columns.map(
|
|
124
|
+
$[41] = hasGroups;
|
|
125
|
+
$[42] = sortByColumn;
|
|
126
|
+
$[43] = tableId;
|
|
127
|
+
$[44] = t12;
|
|
128
|
+
} else t12 = $[44];
|
|
129
|
+
headers = columns.map(t12);
|
|
100
130
|
if (data !== prevData) {
|
|
101
131
|
setPrevData(data);
|
|
102
132
|
updateRowOrder(data, sortByColumn);
|
|
@@ -204,16 +234,17 @@ function useTable(t0) {
|
|
|
204
234
|
const groupStartIndex = rowIndex_0;
|
|
205
235
|
bodies.push({
|
|
206
236
|
type: "row-group",
|
|
207
|
-
key: `group:${item_0.groupId}`,
|
|
237
|
+
key: `group:${typeof item_0.groupId}:${item_0.groupId}`,
|
|
208
238
|
id: item_0.groupId,
|
|
209
239
|
label: item_0.label,
|
|
210
240
|
rows: item_0.rows.map((row_1, index_2) => createRow(row_1, groupStartIndex + index_2)),
|
|
241
|
+
expanded: !collapsibleGroups || expandedGroups.has(item_0.groupId),
|
|
211
242
|
"aria-label": item_0["aria-label"]
|
|
212
243
|
});
|
|
213
244
|
rowIndex_0 = rowIndex_0 + item_0.rows.length;
|
|
214
245
|
body = {
|
|
215
246
|
type: "row-body",
|
|
216
|
-
key: `rows:after:${item_0.groupId}`,
|
|
247
|
+
key: `rows:after:${typeof item_0.groupId}:${item_0.groupId}`,
|
|
217
248
|
rows: []
|
|
218
249
|
};
|
|
219
250
|
} else {
|
|
@@ -221,132 +252,154 @@ function useTable(t0) {
|
|
|
221
252
|
rowIndex_0 = rowIndex_0 + 1;
|
|
222
253
|
}
|
|
223
254
|
if (body.rows.length > 0 || bodies.length === 0) bodies.push(body);
|
|
224
|
-
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
255
|
+
t11 = bodies.flatMap(_temp2).filter(_temp3);
|
|
256
|
+
$[23] = collapsibleGroups;
|
|
257
|
+
$[24] = columns;
|
|
258
|
+
$[25] = data;
|
|
259
|
+
$[26] = expandedGroups;
|
|
260
|
+
$[27] = externalSorting;
|
|
261
|
+
$[28] = getRowId;
|
|
262
|
+
$[29] = hasGroups;
|
|
263
|
+
$[30] = isRowSelectable;
|
|
264
|
+
$[31] = prevData;
|
|
265
|
+
$[32] = rowOrder;
|
|
266
|
+
$[33] = rowSelection;
|
|
267
|
+
$[34] = selectedRows;
|
|
268
|
+
$[35] = sortByColumn;
|
|
269
|
+
$[36] = tableId;
|
|
270
|
+
$[37] = bodies;
|
|
271
|
+
$[38] = headers;
|
|
272
|
+
$[39] = sortBy;
|
|
273
|
+
$[40] = t11;
|
|
241
274
|
} else {
|
|
242
|
-
bodies = $[
|
|
243
|
-
headers = $[
|
|
244
|
-
sortBy = $[
|
|
245
|
-
|
|
275
|
+
bodies = $[37];
|
|
276
|
+
headers = $[38];
|
|
277
|
+
sortBy = $[39];
|
|
278
|
+
t11 = $[40];
|
|
246
279
|
}
|
|
247
|
-
const selectableRows =
|
|
248
|
-
let
|
|
249
|
-
if ($[
|
|
250
|
-
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
} else
|
|
254
|
-
const effectiveSelectedRows =
|
|
280
|
+
const selectableRows = t11;
|
|
281
|
+
let t12;
|
|
282
|
+
if ($[45] !== selectableRows) {
|
|
283
|
+
t12 = new Set(selectableRows.filter(_temp4).map(_temp5));
|
|
284
|
+
$[45] = selectableRows;
|
|
285
|
+
$[46] = t12;
|
|
286
|
+
} else t12 = $[46];
|
|
287
|
+
const effectiveSelectedRows = t12;
|
|
255
288
|
const selectedCount = effectiveSelectedRows.size;
|
|
256
289
|
const selectableCount = selectableRows.length;
|
|
257
290
|
const allSelected = selectableCount > 0 && selectedCount === selectableCount;
|
|
258
291
|
const someSelected = selectedCount > 0 && !allSelected;
|
|
259
|
-
let
|
|
260
|
-
if ($[
|
|
261
|
-
|
|
292
|
+
let t13;
|
|
293
|
+
if ($[47] !== selectedRows || $[48] !== setSelectedRows) {
|
|
294
|
+
t13 = function toggleRowSelection(row_5) {
|
|
262
295
|
if (!row_5.selectable) return;
|
|
263
296
|
const nextSelectedRows_0 = new Set(selectedRows);
|
|
264
297
|
if (nextSelectedRows_0.has(row_5.selectionId)) nextSelectedRows_0.delete(row_5.selectionId);
|
|
265
298
|
else nextSelectedRows_0.add(row_5.selectionId);
|
|
266
299
|
setSelectedRows(nextSelectedRows_0);
|
|
267
300
|
};
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
} else
|
|
272
|
-
const toggleRowSelection =
|
|
273
|
-
let
|
|
274
|
-
if ($[
|
|
275
|
-
|
|
301
|
+
$[47] = selectedRows;
|
|
302
|
+
$[48] = setSelectedRows;
|
|
303
|
+
$[49] = t13;
|
|
304
|
+
} else t13 = $[49];
|
|
305
|
+
const toggleRowSelection = t13;
|
|
306
|
+
let t14;
|
|
307
|
+
if ($[50] !== allSelected || $[51] !== selectableRows || $[52] !== selectedRows || $[53] !== setSelectedRows) {
|
|
308
|
+
t14 = function toggleAllRows() {
|
|
276
309
|
if (selectableRows.length === 0) return;
|
|
277
310
|
const nextSelectedRows_1 = new Set(selectedRows);
|
|
278
311
|
for (const row_6 of selectableRows) if (allSelected) nextSelectedRows_1.delete(row_6.selectionId);
|
|
279
312
|
else nextSelectedRows_1.add(row_6.selectionId);
|
|
280
313
|
setSelectedRows(nextSelectedRows_1);
|
|
281
314
|
};
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
} else
|
|
288
|
-
const toggleAllRows =
|
|
289
|
-
let
|
|
290
|
-
if ($[
|
|
291
|
-
|
|
315
|
+
$[50] = allSelected;
|
|
316
|
+
$[51] = selectableRows;
|
|
317
|
+
$[52] = selectedRows;
|
|
318
|
+
$[53] = setSelectedRows;
|
|
319
|
+
$[54] = t14;
|
|
320
|
+
} else t14 = $[54];
|
|
321
|
+
const toggleAllRows = t14;
|
|
322
|
+
let t15;
|
|
323
|
+
if ($[55] !== collapsibleGroups || $[56] !== expandedGroups || $[57] !== setExpandedGroups) {
|
|
324
|
+
t15 = function toggleGroupExpansion(group_0) {
|
|
325
|
+
if (!collapsibleGroups) return;
|
|
326
|
+
const nextExpandedGroups_0 = new Set(expandedGroups);
|
|
327
|
+
if (nextExpandedGroups_0.has(group_0.id)) nextExpandedGroups_0.delete(group_0.id);
|
|
328
|
+
else nextExpandedGroups_0.add(group_0.id);
|
|
329
|
+
setExpandedGroups(nextExpandedGroups_0);
|
|
330
|
+
};
|
|
331
|
+
$[55] = collapsibleGroups;
|
|
332
|
+
$[56] = expandedGroups;
|
|
333
|
+
$[57] = setExpandedGroups;
|
|
334
|
+
$[58] = t15;
|
|
335
|
+
} else t15 = $[58];
|
|
336
|
+
const toggleGroupExpansion = t15;
|
|
337
|
+
let t16;
|
|
338
|
+
if ($[59] !== sortBy || $[60] !== toggleAllRows || $[61] !== toggleGroupExpansion || $[62] !== toggleRowSelection) {
|
|
339
|
+
t16 = {
|
|
292
340
|
sortBy,
|
|
293
341
|
toggleRowSelection,
|
|
294
|
-
toggleAllRows
|
|
342
|
+
toggleAllRows,
|
|
343
|
+
toggleGroupExpansion
|
|
295
344
|
};
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
345
|
+
$[59] = sortBy;
|
|
346
|
+
$[60] = toggleAllRows;
|
|
347
|
+
$[61] = toggleGroupExpansion;
|
|
348
|
+
$[62] = toggleRowSelection;
|
|
349
|
+
$[63] = t16;
|
|
350
|
+
} else t16 = $[63];
|
|
351
|
+
const t17 = `${tableId}-selection-column`;
|
|
352
|
+
let t18;
|
|
353
|
+
if ($[64] !== allSelected || $[65] !== effectiveSelectedRows || $[66] !== selectableCount || $[67] !== selectedCount || $[68] !== someSelected || $[69] !== t17) {
|
|
354
|
+
t18 = {
|
|
355
|
+
headerId: t17,
|
|
306
356
|
selectedRows: effectiveSelectedRows,
|
|
307
357
|
allSelected,
|
|
308
358
|
someSelected,
|
|
309
359
|
selectableCount,
|
|
310
360
|
selectedCount
|
|
311
361
|
};
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
} else
|
|
320
|
-
let
|
|
321
|
-
if ($[
|
|
322
|
-
|
|
362
|
+
$[64] = allSelected;
|
|
363
|
+
$[65] = effectiveSelectedRows;
|
|
364
|
+
$[66] = selectableCount;
|
|
365
|
+
$[67] = selectedCount;
|
|
366
|
+
$[68] = someSelected;
|
|
367
|
+
$[69] = t17;
|
|
368
|
+
$[70] = t18;
|
|
369
|
+
} else t18 = $[70];
|
|
370
|
+
let t19;
|
|
371
|
+
if ($[71] !== bodies || $[72] !== gridTemplateColumns || $[73] !== headers || $[74] !== t16 || $[75] !== t18) {
|
|
372
|
+
t19 = {
|
|
323
373
|
headers,
|
|
324
|
-
actions:
|
|
325
|
-
selection:
|
|
374
|
+
actions: t16,
|
|
375
|
+
selection: t18,
|
|
326
376
|
gridTemplateColumns,
|
|
327
377
|
bodies
|
|
328
378
|
};
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
331
|
-
$[
|
|
332
|
-
$[
|
|
333
|
-
$[
|
|
334
|
-
$[
|
|
335
|
-
} else
|
|
336
|
-
return
|
|
379
|
+
$[71] = bodies;
|
|
380
|
+
$[72] = gridTemplateColumns;
|
|
381
|
+
$[73] = headers;
|
|
382
|
+
$[74] = t16;
|
|
383
|
+
$[75] = t18;
|
|
384
|
+
$[76] = t19;
|
|
385
|
+
} else t19 = $[76];
|
|
386
|
+
return t19;
|
|
337
387
|
}
|
|
338
|
-
function
|
|
388
|
+
function _temp5(row_4) {
|
|
339
389
|
return row_4.selectionId;
|
|
340
390
|
}
|
|
341
|
-
function
|
|
391
|
+
function _temp4(row_3) {
|
|
342
392
|
return row_3.selected;
|
|
343
393
|
}
|
|
344
|
-
function
|
|
394
|
+
function _temp3(row_2) {
|
|
345
395
|
return row_2.selectable;
|
|
346
396
|
}
|
|
347
|
-
function
|
|
397
|
+
function _temp2(body_0) {
|
|
348
398
|
return body_0.rows;
|
|
349
399
|
}
|
|
400
|
+
function _temp(group) {
|
|
401
|
+
return group.groupId;
|
|
402
|
+
}
|
|
350
403
|
function isDataTableRowGroup(item) {
|
|
351
404
|
return "groupId" in item && "rows" in item && Array.isArray(item.rows);
|
|
352
405
|
}
|
|
@@ -2787,6 +2787,10 @@
|
|
|
2787
2787
|
"id": "experimental-components-datatable-features--with-sortable-groups",
|
|
2788
2788
|
"code": "() => (\n <Table.Container>\n <Table.Title as=\"h2\" id=\"sortable-repositories-by-visibility\">\n Sortable repositories by visibility\n </Table.Title>\n <DataTable\n aria-labelledby=\"sortable-repositories-by-visibility\"\n data={repoGroups}\n columns={sortableGroupedColumns}\n />\n </Table.Container>\n)"
|
|
2789
2789
|
},
|
|
2790
|
+
{
|
|
2791
|
+
"id": "experimental-components-datatable-features--with-collapsible-groups",
|
|
2792
|
+
"code": "() => {\n const titleId = React.useId()\n const [expandedGroups, setExpandedGroups] = React.useState<\n ReadonlySet<DataTableRowId>\n >(() => new Set(['internal', 'public']))\n const [selectedRows, setSelectedRows] = React.useState<\n ReadonlySet<DataTableRowId>\n >(() => new Set())\n return (\n <Table.Container>\n <Table.Title as=\"h2\" id={titleId}>\n Collapsible repositories by visibility\n </Table.Title>\n <Table.Actions>\n <Button onClick={() => setExpandedGroups(new Set())}>\n Collapse all groups\n </Button>\n <Button\n onClick={() => setExpandedGroups(new Set(['internal', 'public']))}\n >\n Expand all groups\n </Button>\n </Table.Actions>\n <DataTable\n aria-labelledby={titleId}\n data={repoGroupsWithDisabledRow}\n columns={sortableGroupedColumns}\n collapsibleGroups\n expandedGroups={expandedGroups}\n onExpandedGroupsChange={({ expandedGroups }) =>\n setExpandedGroups(expandedGroups)\n }\n rowSelection\n selectedRows={selectedRows}\n onSelectionChange={({ selectedRows }) => setSelectedRows(selectedRows)}\n isRowSelectable={(repo) => repo.id !== 1}\n />\n </Table.Container>\n )\n}"
|
|
2793
|
+
},
|
|
2790
2794
|
{
|
|
2791
2795
|
"id": "experimental-components-table-features--with-groups",
|
|
2792
2796
|
"code": "() => {\n const titleId = React.useId()\n const [pageIndex, setPageIndex] = React.useState(0)\n const pageSize = 10\n const allRows = paginationData.flatMap((item) =>\n 'rows' in item ? item.rows : [item],\n )\n const pageRows = new Set(\n allRows\n .slice(pageIndex * pageSize, (pageIndex + 1) * pageSize)\n .map((row) => row.id),\n )\n const data = getPageData(paginationData, pageRows)\n return (\n <Table.Container>\n <Table.Title as=\"h2\" id={titleId}>\n Paginated repositories by visibility\n </Table.Title>\n <DataTable\n aria-labelledby={titleId}\n data={data}\n columns={[\n {\n header: 'Name',\n field: 'name',\n rowHeader: true,\n sortBy: true,\n },\n {\n header: 'Visibility',\n field: 'visibility',\n },\n ]}\n />\n <Table.Pagination\n aria-label=\"Pagination for grouped repositories\"\n pageSize={pageSize}\n totalCount={allRows.length}\n onChange={({ pageIndex }) => setPageIndex(pageIndex)}\n />\n </Table.Container>\n )\n}"
|
|
@@ -2848,6 +2852,27 @@
|
|
|
2848
2852
|
"type": "(row: Data) => boolean",
|
|
2849
2853
|
"description": "Determine which rows can be selected and counted by select-all."
|
|
2850
2854
|
},
|
|
2855
|
+
{
|
|
2856
|
+
"name": "collapsibleGroups",
|
|
2857
|
+
"type": "boolean",
|
|
2858
|
+
"defaultValue": "false",
|
|
2859
|
+
"description": "Enable group disclosures. Collapsing only hides members; selection and select-all still include them."
|
|
2860
|
+
},
|
|
2861
|
+
{
|
|
2862
|
+
"name": "expandedGroups",
|
|
2863
|
+
"type": "ReadonlySet<DataTableRowId>",
|
|
2864
|
+
"description": "Control expanded groups by stable groupId. String and numeric IDs remain distinct."
|
|
2865
|
+
},
|
|
2866
|
+
{
|
|
2867
|
+
"name": "defaultExpandedGroups",
|
|
2868
|
+
"type": "ReadonlySet<DataTableRowId>",
|
|
2869
|
+
"description": "Initially expanded group IDs. Defaults to all groups in the initial data; subsequently introduced IDs are collapsed."
|
|
2870
|
+
},
|
|
2871
|
+
{
|
|
2872
|
+
"name": "onExpandedGroupsChange",
|
|
2873
|
+
"type": "({ expandedGroups }: { expandedGroups: Set<DataTableRowId> }) => void",
|
|
2874
|
+
"description": "Receive a new expansion set on a disclosure request. Sorting and data replacement do not emit this callback or clear stored IDs."
|
|
2875
|
+
},
|
|
2851
2876
|
{
|
|
2852
2877
|
"name": "cellPadding",
|
|
2853
2878
|
"type": "'condensed' | 'normal' | 'spacious'",
|
|
@@ -2951,6 +2976,28 @@
|
|
|
2951
2976
|
{
|
|
2952
2977
|
"name": "Table.Group",
|
|
2953
2978
|
"props": [
|
|
2979
|
+
{
|
|
2980
|
+
"name": "collapsible",
|
|
2981
|
+
"type": "boolean",
|
|
2982
|
+
"defaultValue": "false",
|
|
2983
|
+
"description": "Render a disclosure controlling the member body. Without this prop members are always visible."
|
|
2984
|
+
},
|
|
2985
|
+
{
|
|
2986
|
+
"name": "expanded",
|
|
2987
|
+
"type": "boolean",
|
|
2988
|
+
"description": "Control whether the member body is visible."
|
|
2989
|
+
},
|
|
2990
|
+
{
|
|
2991
|
+
"name": "defaultExpanded",
|
|
2992
|
+
"type": "boolean",
|
|
2993
|
+
"defaultValue": "true",
|
|
2994
|
+
"description": "Initial expanded state for an uncontrolled group."
|
|
2995
|
+
},
|
|
2996
|
+
{
|
|
2997
|
+
"name": "onExpandedChange",
|
|
2998
|
+
"type": "({ expanded }: { expanded: boolean }) => void",
|
|
2999
|
+
"description": "Handle a disclosure request. Controlled groups wait for the expanded prop to update."
|
|
3000
|
+
},
|
|
2954
3001
|
{
|
|
2955
3002
|
"name": "id",
|
|
2956
3003
|
"type": "string | number",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "38.
|
|
4
|
+
"version": "38.44.0-rc.0c9e08268",
|
|
5
5
|
"description": "An implementation of GitHub's Primer Design System using React",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"mdast-util-to-string": "4.0.0",
|
|
157
157
|
"micromark-extension-frontmatter": "2.0.0",
|
|
158
158
|
"micromark-extension-mdxjs": "3.0.0",
|
|
159
|
-
"oxc-transform-react": "^0.
|
|
159
|
+
"oxc-transform-react": "^0.154.0",
|
|
160
160
|
"postcss-preset-primer": "^0.0.0",
|
|
161
161
|
"publint": "^0.3.15",
|
|
162
162
|
"react": "18.3.1",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.prc-DataTable-TableContainer-hn0p3{column-gap:var(--base-size-8,.5rem);display:grid;grid-template-areas:"title actions" "divider divider" "subtitle subtitle" "filter filter" "table table" "footer footer";grid-template-columns:1fr 1fr}.prc-DataTable-TableTitle-nM43N{align-self:center;font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-semibold,600);grid-area:title;line-height:20px}.prc-DataTable-TableSubtitle--L6Ho,.prc-DataTable-TableTitle-nM43N{color:var(--fgColor-default,#1f2328);margin:0}.prc-DataTable-TableSubtitle--L6Ho{font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);grid-area:subtitle;line-height:var(--text-title-lineHeight-small,1.5)}.prc-DataTable-TableActions-fkc2b{align-items:center;column-gap:var(--base-size-8,.5rem);display:flex;grid-area:actions;justify-self:end}.prc-DataTable-TableDivider-TRc3b{background-color:var(--borderColor-default,#d1d9e0);grid-area:divider;height:1px;margin-block-end:var(--base-size-8,.5rem);margin-block-start:var(--base-size-16,1rem);width:100%}.prc-DataTable-TableActions-fkc2b+.prc-DataTable-TableOverflowWrapper-bSqT-,.prc-DataTable-TableSubtitle--L6Ho+.prc-DataTable-TableOverflowWrapper-bSqT-,.prc-DataTable-TableTitle-nM43N+.prc-DataTable-TableOverflowWrapper-bSqT-{margin-block-start:var(--base-size-8,.5rem)}.prc-DataTable-Table-7ux1n,.prc-DataTable-TableOverflowWrapper-bSqT-{grid-area:table}.prc-DataTable-Table-7ux1n{--table-border-radius:0.375rem;--table-cell-padding:var(--cell-padding-block,0.5rem) var(--cell-padding-inline,0.75rem);--table-font-size:0.75rem;background-color:var(--bgColor-default,#fff);border-collapse:separate;border-spacing:0;display:grid;font-size:var(--table-font-size);grid-template-columns:var(--grid-template-columns);line-height:1.66667;width:100%}.prc-DataTable-Table-7ux1n:where([data-cell-padding=condensed]){--cell-padding-block:0.25rem;--cell-padding-inline:0.5rem}.prc-DataTable-Table-7ux1n:where([data-cell-padding=normal]){--cell-padding-block:0.5rem;--cell-padding-inline:0.75rem}.prc-DataTable-Table-7ux1n:where([data-cell-padding=spacious]){--cell-padding-block:0.75rem;--cell-padding-inline:1rem}.prc-DataTable-TableCell-Fk4ve:first-child,.prc-DataTable-TableHeader-eyTab:first-child{border-inline-start:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0)}.prc-DataTable-TableCell-Fk4ve:last-child,.prc-DataTable-TableHeader-eyTab:last-child{border-inline-end:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0)}.prc-DataTable-TableCell-Fk4ve,.prc-DataTable-TableHeader-eyTab{align-items:center;border-block-end:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0);display:flex;padding:var(--table-cell-padding);text-align:start}.prc-DataTable-TableCell-Fk4ve:where([data-cell-align=end]),.prc-DataTable-TableHeader-eyTab:where([data-cell-align=end]){display:flex;justify-content:flex-end;text-align:end}.prc-DataTable-TableHeader-eyTab[data-cell-align=end] .prc-DataTable-TableSortButton--aq0y{display:flex;flex-direction:row-reverse}.prc-DataTable-TableHead-4FaBf .prc-DataTable-TableRow-Icc7F:first-of-type .prc-DataTable-TableHeader-eyTab{border-block-start:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0)}.prc-DataTable-TableHead-4FaBf .prc-DataTable-TableRow-Icc7F:first-of-type .prc-DataTable-TableHeader-eyTab:first-child{border-top-left-radius:var(--table-border-radius)}.prc-DataTable-TableHead-4FaBf .prc-DataTable-TableRow-Icc7F:first-of-type .prc-DataTable-TableHeader-eyTab:last-child{border-top-right-radius:var(--table-border-radius)}.prc-DataTable-TableOverflowWrapper-bSqT-:last-child .prc-DataTable-Table-7ux1n .prc-DataTable-TableBody-QKQy2:last-of-type .prc-DataTable-TableRow-Icc7F:last-of-type .prc-DataTable-TableCell-Fk4ve:first-child{border-bottom-left-radius:var(--table-border-radius)}.prc-DataTable-TableOverflowWrapper-bSqT-:last-child .prc-DataTable-Table-7ux1n .prc-DataTable-TableBody-QKQy2:last-of-type .prc-DataTable-TableRow-Icc7F:last-of-type .prc-DataTable-TableCell-Fk4ve:last-child{border-bottom-right-radius:var(--table-border-radius)}.prc-DataTable-TableRow-Icc7F>:first-child .prc-DataTable-TableCellSkeletonItem-bGhwZ,.prc-DataTable-TableRow-Icc7F>:first-child:not(.prc-DataTable-TableCellSkeleton-DMdM5){padding-inline-start:var(--base-size-16,1rem)}.prc-DataTable-TableRow-Icc7F>:last-child .prc-DataTable-TableCellSkeletonItem-bGhwZ,.prc-DataTable-TableRow-Icc7F>:last-child:not(.prc-DataTable-TableCellSkeleton-DMdM5){padding-inline-end:var(--base-size-16,1rem)}.prc-DataTable-TableHeader-eyTab{background-color:var(--bgColor-muted,#f6f8fa);border-block-start:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0);color:var(--fgColor-muted,#59636e);font-weight:var(--base-text-weight-semibold,600)}.prc-DataTable-TableHeader-eyTab:where([aria-sort=ascending]),.prc-DataTable-TableHeader-eyTab:where([aria-sort=descending]){color:var(--fgColor-default,#1f2328)}.prc-DataTable-TableRowSelection-HwyDU,.prc-DataTable-TableSelectionHeader-Op0cK{justify-content:center}.prc-DataTable-TableSortIcon-wHvJw{visibility:hidden}.prc-DataTable-TableHeader-eyTab .prc-DataTable-TableSortButton--aq0y:focus .prc-DataTable-TableSortIcon--ascending-Lpx6z,.prc-DataTable-TableHeader-eyTab:hover .prc-DataTable-TableSortIcon--ascending-Lpx6z,.prc-DataTable-TableHeader-eyTab[aria-sort=ascending] .prc-DataTable-TableSortIcon--ascending-Lpx6z,.prc-DataTable-TableHeader-eyTab[aria-sort=descending] .prc-DataTable-TableSortIcon--descending-hHJGo{visibility:visible}.prc-DataTable-TableRow-Icc7F:hover .prc-DataTable-TableCell-Fk4ve:not(.prc-DataTable-TableCellSkeleton-DMdM5){background-color:var(--control-transparent-bgColor-hover,#818b981a)}.prc-DataTable-TableCell-Fk4ve:where([scope=row]){align-items:center;color:var(--fgColor-default,#1f2328);display:flex;font-weight:var(--base-text-weight-semibold,600)}.prc-DataTable-TableCellSkeleton-DMdM5{padding:0}.prc-DataTable-TableCellSkeletonItems-Ljhq5{display:flex;flex-direction:column;width:100%}.prc-DataTable-TableCellSkeletonItem-bGhwZ{padding:var(--table-cell-padding)}.prc-DataTable-TableCellSkeletonItem-bGhwZ:nth-of-type(5n+1){--skeleton-item-width:85%}.prc-DataTable-TableCellSkeletonItem-bGhwZ:nth-of-type(5n+2){--skeleton-item-width:67.5%}.prc-DataTable-TableCellSkeletonItem-bGhwZ:nth-of-type(5n+3){--skeleton-item-width:80%}.prc-DataTable-TableCellSkeletonItem-bGhwZ:nth-of-type(5n+4){--skeleton-item-width:60%}.prc-DataTable-TableCellSkeletonItem-bGhwZ:nth-of-type(5n+5){--skeleton-item-width:75%}.prc-DataTable-TableCellSkeletonItem-bGhwZ [data-component=SkeletonText]{width:var(--skeleton-item-width)}.prc-DataTable-TableCellSkeletonItem-bGhwZ:not(:last-of-type){border-block-end:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0)}.prc-DataTable-TableSortButton--aq0y{column-gap:.5rem}.prc-DataTable-TableBody-QKQy2,.prc-DataTable-TableGroupHeaderBody-K-YqR,.prc-DataTable-TableHead-4FaBf,.prc-DataTable-TableRow-Icc7F{display:contents}@supports (grid-template-columns:subgrid){.prc-DataTable-TableBody-QKQy2,.prc-DataTable-TableGroupHeaderBody-K-YqR,.prc-DataTable-TableHead-4FaBf,.prc-DataTable-TableRow-Icc7F{display:grid;grid-column:-1/1;grid-template-columns:subgrid}}.prc-DataTable-TableGroupHeaderCell-vnb30{background-color:var(--bgColor-muted,#f6f8fa);border-block-end:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0);border-inline-end:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0);border-inline-start:var(--borderWidth-thin,.0625rem) solid var(--borderColor-default,#d1d9e0);color:var(--fgColor-muted,#59636e);grid-column:1/-1;padding:var(--table-cell-padding);text-align:start}.prc-DataTable-TableGroupHeaderCell-vnb30,.prc-DataTable-TableGroupHeaderContent-H9FbA{align-items:baseline;column-gap:var(--base-size-8,.5rem);display:flex}.prc-DataTable-TableGroupHeaderLabel--c-od{color:var(--fgColor-default,#1f2328);font-weight:var(--base-text-weight-semibold,600)}.prc-DataTable-PlaceholderText-8bHo7,.prc-DataTable-TableGroupHeaderCount-6r8Pj{color:var(--fgColor-muted,#59636e)}
|
|
2
|
-
/*# sourceMappingURL=Table-6ee6a868.css.map */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/DataTable/Table.module.css.js"],"names":[],"mappings":"AACA,oCAUE,mCAA8B,CAT9B,YAAa,CAEb,uHAMiB,CAPjB,6BASF,CAGA,gCAQE,iBAAkB,CANlB,8CAAuC,CACvC,gDAA6C,CAI7C,eAAgB,CAFhB,gBAIF,CAGA,mEANE,oCAA6B,CAL7B,QAkBF,CAPA,mCAEE,4CAAsC,CACtC,8CAA2C,CAG3C,kBAAmB,CAFnB,kDAGF,CAGA,kCAGE,kBAAmB,CADnB,mCAA8B,CAD9B,YAAa,CAGb,iBAAkB,CAClB,gBACF,CAGA,kCAIE,mDAA4C,CAC5C,iBAAkB,CAHlB,UAAW,CAKX,yCAAoC,CADpC,2CAAuC,CALvC,UAOF,CAGA,mOAGE,2CACF,CAOA,qEAJE,eAsCF,CAlCA,2BAEE,8BAA+B,CAC/B,wFAA2F,CAC3F,yBAA0B,CAW1B,4CAAwC,CADxC,wBAAyB,CAFzB,gBAAiB,CANjB,YAAa,CAGb,gCAAiC,CAQjC,kDAAmD,CANnD,mBAA0B,CAJ1B,UA2BF,CAdE,gEACE,4BAA6B,CAC7B,4BACF,CAEA,6DACE,2BAA4B,CAC5B,6BACF,CAEA,+DACE,4BAA6B,CAC7B,0BACF,CAIF,wFAEE,6FACF,CAEA,sFAEE,2FACF,CAEA,gEAME,kBAAmB,CACnB,0FAA0E,CAL1E,YAAa,CAEb,iCAAkC,CAClC,gBAGF,CAEA,0HAEE,YAAa,CAEb,wBAAyB,CADzB,cAEF,CAEA,2FACE,YAAa,CACb,0BACF,CAEA,4GACE,4FACF,CAIA,wHAEE,iDACF,CAGA,uHAEE,kDACF,CAGA,kNAEE,oDACF,CAGA,iNAEE,qDACF,CAMA,6KAEE,6CACF,CAEA,2KAEE,2CACF,CAGA,iCAGE,6CAAsC,CACtC,4FAA4E,CAF5E,kCAA2B,CAD3B,gDAIF,CAEA,6HAEE,oCACF,CAEA,iFAEE,sBACF,CAGA,mCACE,iBACF,CASA,yZAEE,kBACF,CAGA,+GACE,mEACF,CAGA,kDAIE,kBAAmB,CADnB,oCAA6B,CAF7B,YAAa,CACb,gDAGF,CAGA,uCACE,SACF,CAEA,4CACE,YAAa,CAEb,qBAAsB,CADtB,UAEF,CAEA,2CAEE,iCAqBF,CAnBE,6DACE,yBACF,CAEA,6DACE,2BACF,CAEA,6DACE,yBACF,CAEA,6DACE,yBACF,CAEA,6DACE,yBACF,CAGF,yEACE,gCACF,CAEA,8DACE,0FACF,CAEA,qCACE,gBACF,CAGA,sIAIE,gBACF,CAEA,0CACE,sIAIE,YAAa,CAEb,gBAAkB,CADlB,6BAEF,CACF,CAEA,0CASE,6CAAsC,CAGtC,0FAA0E,CAD1E,2FAA2E,CAD3E,6FAA6E,CAF7E,kCAA2B,CAN3B,gBAAmB,CAInB,iCAAkC,CAClC,gBAMF,CAEA,uFAZE,oBAAqB,CACrB,mCAA8B,CAH9B,YAkBF,CAEA,2CAEE,oCAA6B,CAD7B,gDAEF,CAMA,gFACE,kCACF","file":"Table-6ee6a868.css","sourcesContent":["/* Container ---------------------------------------------------------------- */\n.TableContainer {\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-template-areas:\n 'title actions'\n 'divider divider'\n 'subtitle subtitle'\n 'filter filter'\n 'table table'\n 'footer footer';\n column-gap: var(--base-size-8);\n}\n\n/* TableTitle */\n.TableTitle {\n margin: 0;\n font-size: var(--text-body-size-medium);\n font-weight: var(--base-text-weight-semibold);\n /* stylelint-disable-next-line primer/typography */\n line-height: 20px;\n color: var(--fgColor-default);\n grid-area: title;\n align-self: center;\n}\n\n/* TableSubtitle */\n.TableSubtitle {\n margin: 0;\n font-size: var(--text-body-size-small);\n font-weight: var(--base-text-weight-normal);\n line-height: var(--text-title-lineHeight-small);\n color: var(--fgColor-default);\n grid-area: subtitle;\n}\n\n/* TableActions */\n.TableActions {\n display: flex;\n column-gap: var(--base-size-8);\n align-items: center;\n grid-area: actions;\n justify-self: end;\n}\n\n/* TableDivider */\n.TableDivider {\n width: 100%;\n height: 1px;\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--borderColor-default);\n grid-area: divider;\n margin-block-start: var(--base-size-16);\n margin-block-end: var(--base-size-8);\n}\n\n/* Spacing before the table */\n.TableTitle + .TableOverflowWrapper,\n.TableSubtitle + .TableOverflowWrapper,\n.TableActions + .TableOverflowWrapper {\n margin-block-start: var(--base-size-8);\n}\n\n.TableOverflowWrapper {\n grid-area: table;\n}\n\n/* Table -------------------------------------------------------------------- */\n.Table {\n /* Default table styles */\n --table-border-radius: 0.375rem;\n --table-cell-padding: var(--cell-padding-block, 0.5rem) var(--cell-padding-inline, 0.75rem);\n --table-font-size: 0.75rem;\n\n display: grid;\n width: 100%;\n /* stylelint-disable-next-line primer/typography */\n font-size: var(--table-font-size);\n /* stylelint-disable-next-line primer/typography */\n line-height: calc(20 / 12);\n border-spacing: 0;\n /* stylelint-disable-next-line primer/borders */\n border-collapse: separate;\n background-color: var(--bgColor-default);\n grid-area: table;\n grid-template-columns: var(--grid-template-columns);\n\n /* Density modes: condensed, normal, spacious */\n &:where([data-cell-padding='condensed']) {\n --cell-padding-block: 0.25rem;\n --cell-padding-inline: 0.5rem;\n }\n\n &:where([data-cell-padding='normal']) {\n --cell-padding-block: 0.5rem;\n --cell-padding-inline: 0.75rem;\n }\n\n &:where([data-cell-padding='spacious']) {\n --cell-padding-block: 0.75rem;\n --cell-padding-inline: 1rem;\n }\n}\n\n/* Borders */\n.TableCell:first-child,\n.TableHeader:first-child {\n border-inline-start: var(--borderWidth-thin) solid var(--borderColor-default);\n}\n\n.TableCell:last-child,\n.TableHeader:last-child {\n border-inline-end: var(--borderWidth-thin) solid var(--borderColor-default);\n}\n\n.TableHeader,\n.TableCell {\n display: flex;\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--table-cell-padding);\n text-align: start;\n align-items: center;\n border-block-end: var(--borderWidth-thin) solid var(--borderColor-default);\n}\n\n.TableHeader:where([data-cell-align='end']),\n.TableCell:where([data-cell-align='end']) {\n display: flex;\n text-align: end;\n justify-content: flex-end;\n}\n\n.TableHeader[data-cell-align='end'] .TableSortButton {\n display: flex;\n flex-direction: row-reverse;\n}\n\n.TableHead .TableRow:first-of-type .TableHeader {\n border-block-start: var(--borderWidth-thin) solid var(--borderColor-default);\n}\n\n/* Border radius */\n/* stylelint-disable-next-line selector-max-specificity */\n.TableHead .TableRow:first-of-type .TableHeader:first-child {\n /* stylelint-disable-next-line primer/borders */\n border-top-left-radius: var(--table-border-radius);\n}\n\n/* stylelint-disable-next-line selector-max-specificity */\n.TableHead .TableRow:first-of-type .TableHeader:last-child {\n /* stylelint-disable-next-line primer/borders */\n border-top-right-radius: var(--table-border-radius);\n}\n\n/* stylelint-disable-next-line selector-max-compound-selectors,selector-max-specificity */\n.TableOverflowWrapper:last-child .Table .TableBody:last-of-type .TableRow:last-of-type .TableCell:first-child {\n /* stylelint-disable-next-line primer/borders */\n border-bottom-left-radius: var(--table-border-radius);\n}\n\n/* stylelint-disable-next-line selector-max-compound-selectors,selector-max-specificity */\n.TableOverflowWrapper:last-child .Table .TableBody:last-of-type .TableRow:last-of-type .TableCell:last-child {\n /* stylelint-disable-next-line primer/borders */\n border-bottom-right-radius: var(--table-border-radius);\n}\n\n/**\n * Offset padding to make sure type aligns regardless of cell padding\n * selection\n */\n.TableRow > *:first-child:not(.TableCellSkeleton),\n.TableRow > *:first-child .TableCellSkeletonItem {\n padding-inline-start: var(--base-size-16);\n}\n\n.TableRow > *:last-child:not(.TableCellSkeleton),\n.TableRow > *:last-child .TableCellSkeletonItem {\n padding-inline-end: var(--base-size-16);\n}\n\n/* TableHeader */\n.TableHeader {\n font-weight: var(--base-text-weight-semibold);\n color: var(--fgColor-muted);\n background-color: var(--bgColor-muted);\n border-block-start: var(--borderWidth-thin) solid var(--borderColor-default);\n}\n\n.TableHeader:where([aria-sort='descending']),\n.TableHeader:where([aria-sort='ascending']) {\n color: var(--fgColor-default);\n}\n\n.TableSelectionHeader,\n.TableRowSelection {\n justify-content: center;\n}\n\n/* Control visibility of sort icons */\n.TableSortIcon {\n visibility: hidden;\n}\n\n/* The ASC icon is visible if the header is sortable and is hovered or focused */\n.TableHeader:hover .TableSortIcon--ascending,\n.TableHeader .TableSortButton:focus .TableSortIcon--ascending {\n visibility: visible;\n}\n\n/* Each sort icon is visible if the TableHeader is currently in the corresponding sort state */\n.TableHeader[aria-sort='ascending'] .TableSortIcon--ascending,\n.TableHeader[aria-sort='descending'] .TableSortIcon--descending {\n visibility: visible;\n}\n\n/* TableRow */\n.TableRow:hover .TableCell:not(.TableCellSkeleton) {\n background-color: var(--control-transparent-bgColor-hover);\n}\n\n/* TableCell */\n.TableCell:where([scope='row']) {\n display: flex;\n font-weight: var(--base-text-weight-semibold);\n color: var(--fgColor-default);\n align-items: center;\n}\n\n/* TableCellSkeleton */\n.TableCellSkeleton {\n padding: 0;\n}\n\n.TableCellSkeletonItems {\n display: flex;\n width: 100%;\n flex-direction: column;\n}\n\n.TableCellSkeletonItem {\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--table-cell-padding);\n\n &:nth-of-type(5n + 1) {\n --skeleton-item-width: 85%;\n }\n\n &:nth-of-type(5n + 2) {\n --skeleton-item-width: 67.5%;\n }\n\n &:nth-of-type(5n + 3) {\n --skeleton-item-width: 80%;\n }\n\n &:nth-of-type(5n + 4) {\n --skeleton-item-width: 60%;\n }\n\n &:nth-of-type(5n + 5) {\n --skeleton-item-width: 75%;\n }\n}\n\n.TableCellSkeletonItem [data-component='SkeletonText'] {\n width: var(--skeleton-item-width);\n}\n\n.TableCellSkeletonItem:not(:last-of-type) {\n border-block-end: var(--borderWidth-thin) solid var(--borderColor-default);\n}\n\n.TableSortButton {\n column-gap: 0.5rem;\n}\n\n/* Grid layout */\n.TableHead,\n.TableBody,\n.TableGroupHeaderBody,\n.TableRow {\n display: contents;\n}\n\n@supports (grid-template-columns: subgrid) {\n .TableHead,\n .TableBody,\n .TableGroupHeaderBody,\n .TableRow {\n display: grid;\n grid-template-columns: subgrid;\n grid-column: -1 /1;\n }\n}\n\n.TableGroupHeaderCell {\n display: flex;\n grid-column: 1 / -1;\n align-items: baseline;\n column-gap: var(--base-size-8);\n /* stylelint-disable-next-line primer/spacing */\n padding: var(--table-cell-padding);\n text-align: start;\n color: var(--fgColor-muted);\n background-color: var(--bgColor-muted);\n border-inline-start: var(--borderWidth-thin) solid var(--borderColor-default);\n border-inline-end: var(--borderWidth-thin) solid var(--borderColor-default);\n border-block-end: var(--borderWidth-thin) solid var(--borderColor-default);\n}\n\n.TableGroupHeaderContent {\n display: flex;\n align-items: baseline;\n column-gap: var(--base-size-8);\n}\n\n.TableGroupHeaderLabel {\n font-weight: var(--base-text-weight-semibold);\n color: var(--fgColor-default);\n}\n\n.TableGroupHeaderCount {\n color: var(--fgColor-muted);\n}\n\n.PlaceholderText {\n color: var(--fgColor-muted);\n}\n"]}
|