@primer/react 38.43.0-rc.fd837f586 → 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 +18 -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/dist/Token/_RemoveTokenButton.js +115 -20
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +417 -121
- package/dist/hooks/useControllableState.js +70 -19
- package/dist/hooks/useOnOutsideClick.js +48 -21
- package/dist/hooks/useSafeTimeout.js +54 -19
- package/dist/internal/hooks/useDevOnlyEffect.js +3 -8
- package/generated/components.json +47 -0
- package/package.json +3 -3
- package/dist/DataTable/Table-6ee6a868.css +0 -2
- package/dist/DataTable/Table-6ee6a868.css.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
1
2
|
import { warning } from "../utils/warning.js";
|
|
2
3
|
import React from "react";
|
|
3
4
|
//#region src/hooks/useControllableState.ts
|
|
@@ -11,27 +12,77 @@ import React from "react";
|
|
|
11
12
|
* Note: This hook will warn if a component is switching from controlled to
|
|
12
13
|
* uncontrolled, or vice-versa.
|
|
13
14
|
*/
|
|
14
|
-
function useControllableState(
|
|
15
|
+
function useControllableState(t0) {
|
|
16
|
+
const $ = c(16);
|
|
17
|
+
const { name: t1, defaultValue, value, onChange } = t0;
|
|
18
|
+
const name = t1 === void 0 ? "custom" : t1;
|
|
15
19
|
const [state, internalSetState] = React.useState(value !== null && value !== void 0 ? value : defaultValue);
|
|
16
|
-
const controlled = React.
|
|
20
|
+
const [controlled] = React.useState(value !== void 0);
|
|
17
21
|
const stableOnChange = React.useRef(onChange);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
let t2;
|
|
23
|
+
if ($[0] !== onChange) {
|
|
24
|
+
t2 = () => {
|
|
25
|
+
stableOnChange.current = onChange;
|
|
26
|
+
};
|
|
27
|
+
$[0] = onChange;
|
|
28
|
+
$[1] = t2;
|
|
29
|
+
} else t2 = $[1];
|
|
30
|
+
React.useEffect(t2);
|
|
31
|
+
let t3;
|
|
32
|
+
if ($[2] !== controlled || $[3] !== state) {
|
|
33
|
+
t3 = (stateOrUpdater) => {
|
|
34
|
+
var _stableOnChange$curre;
|
|
35
|
+
const value_0 = typeof stateOrUpdater === "function" ? stateOrUpdater(state) : stateOrUpdater;
|
|
36
|
+
if (controlled === false) internalSetState(value_0);
|
|
37
|
+
(_stableOnChange$curre = stableOnChange.current) === null || _stableOnChange$curre === void 0 || _stableOnChange$curre.call(stableOnChange, value_0);
|
|
38
|
+
};
|
|
39
|
+
$[2] = controlled;
|
|
40
|
+
$[3] = state;
|
|
41
|
+
$[4] = t3;
|
|
42
|
+
} else t3 = $[4];
|
|
43
|
+
const setState = t3;
|
|
44
|
+
let t4;
|
|
45
|
+
let t5;
|
|
46
|
+
if ($[5] !== controlled || $[6] !== name || $[7] !== value) {
|
|
47
|
+
t4 = () => {
|
|
48
|
+
const controlledValue = value !== void 0;
|
|
49
|
+
if (controlled === false && controlledValue) warning(true, "A component is changing an uncontrolled %s component to be controlled. This is likely caused by the value changing to a defined value from undefined. Decide between using a controlled or uncontrolled value for the lifetime of the component. More info: https://reactjs.org/link/controlled-components", name);
|
|
50
|
+
if (controlled === true && !controlledValue) warning(true, "A component is changing a controlled %s component to be uncontrolled. This is likely caused by the value changing to an undefined value from a defined one. Decide between using a controlled or uncontrolled value for the lifetime of the component. More info: https://reactjs.org/link/controlled-components", name);
|
|
51
|
+
};
|
|
52
|
+
t5 = [
|
|
53
|
+
name,
|
|
54
|
+
value,
|
|
55
|
+
controlled
|
|
56
|
+
];
|
|
57
|
+
$[5] = controlled;
|
|
58
|
+
$[6] = name;
|
|
59
|
+
$[7] = value;
|
|
60
|
+
$[8] = t4;
|
|
61
|
+
$[9] = t5;
|
|
62
|
+
} else {
|
|
63
|
+
t4 = $[8];
|
|
64
|
+
t5 = $[9];
|
|
65
|
+
}
|
|
66
|
+
React.useEffect(t4, t5);
|
|
67
|
+
if (controlled === true) {
|
|
68
|
+
const t6 = value;
|
|
69
|
+
let t7;
|
|
70
|
+
if ($[10] !== setState || $[11] !== t6) {
|
|
71
|
+
t7 = [t6, setState];
|
|
72
|
+
$[10] = setState;
|
|
73
|
+
$[11] = t6;
|
|
74
|
+
$[12] = t7;
|
|
75
|
+
} else t7 = $[12];
|
|
76
|
+
return t7;
|
|
77
|
+
}
|
|
78
|
+
let t6;
|
|
79
|
+
if ($[13] !== setState || $[14] !== state) {
|
|
80
|
+
t6 = [state, setState];
|
|
81
|
+
$[13] = setState;
|
|
82
|
+
$[14] = state;
|
|
83
|
+
$[15] = t6;
|
|
84
|
+
} else t6 = $[15];
|
|
85
|
+
return t6;
|
|
35
86
|
}
|
|
36
87
|
//#endregion
|
|
37
88
|
export { useControllableState };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
2
3
|
//#region src/hooks/useOnOutsideClick.tsx
|
|
3
4
|
const stopPropagation = true;
|
|
4
5
|
/**
|
|
@@ -18,27 +19,53 @@ function deregister(id) {
|
|
|
18
19
|
delete registry[id];
|
|
19
20
|
}
|
|
20
21
|
let handlerId = 0;
|
|
21
|
-
const useOnOutsideClick = (
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
register(id, handler);
|
|
37
|
-
return () => {
|
|
38
|
-
deregister(id);
|
|
39
|
-
if (Object.keys(registry).length === 0) document.removeEventListener("mousedown", handleClick, { capture: true });
|
|
22
|
+
const useOnOutsideClick = (t0) => {
|
|
23
|
+
const $ = c(8);
|
|
24
|
+
const { containerRef, ignoreClickRefs, onClickOutside } = t0;
|
|
25
|
+
const [id_0] = useState(_temp);
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[0] !== containerRef || $[1] !== ignoreClickRefs || $[2] !== onClickOutside) {
|
|
28
|
+
t1 = (event) => {
|
|
29
|
+
var _containerRef$current;
|
|
30
|
+
if (event instanceof MouseEvent && event.button > 0) return stopPropagation;
|
|
31
|
+
if ((_containerRef$current = containerRef.current) !== null && _containerRef$current !== void 0 && _containerRef$current.contains(event.target)) return stopPropagation;
|
|
32
|
+
if (ignoreClickRefs && ignoreClickRefs.some((t2) => {
|
|
33
|
+
const { current } = t2;
|
|
34
|
+
return current === null || current === void 0 ? void 0 : current.contains(event.target);
|
|
35
|
+
})) return stopPropagation;
|
|
36
|
+
onClickOutside(event);
|
|
40
37
|
};
|
|
41
|
-
|
|
38
|
+
$[0] = containerRef;
|
|
39
|
+
$[1] = ignoreClickRefs;
|
|
40
|
+
$[2] = onClickOutside;
|
|
41
|
+
$[3] = t1;
|
|
42
|
+
} else t1 = $[3];
|
|
43
|
+
const handler = t1;
|
|
44
|
+
let t2;
|
|
45
|
+
let t3;
|
|
46
|
+
if ($[4] !== handler || $[5] !== id_0) {
|
|
47
|
+
t2 = () => {
|
|
48
|
+
if (Object.keys(registry).length === 0) document.addEventListener("mousedown", handleClick, { capture: true });
|
|
49
|
+
register(id_0, handler);
|
|
50
|
+
return () => {
|
|
51
|
+
deregister(id_0);
|
|
52
|
+
if (Object.keys(registry).length === 0) document.removeEventListener("mousedown", handleClick, { capture: true });
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
t3 = [id_0, handler];
|
|
56
|
+
$[4] = handler;
|
|
57
|
+
$[5] = id_0;
|
|
58
|
+
$[6] = t2;
|
|
59
|
+
$[7] = t3;
|
|
60
|
+
} else {
|
|
61
|
+
t2 = $[6];
|
|
62
|
+
t3 = $[7];
|
|
63
|
+
}
|
|
64
|
+
useEffect(t2, t3);
|
|
42
65
|
};
|
|
66
|
+
function _temp() {
|
|
67
|
+
handlerId = handlerId + 1;
|
|
68
|
+
return handlerId;
|
|
69
|
+
}
|
|
43
70
|
//#endregion
|
|
44
71
|
export { useOnOutsideClick };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c } from "../utils/react-compiler-runtime.js";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
2
3
|
//#region src/hooks/useSafeTimeout.ts
|
|
3
4
|
/**
|
|
4
5
|
* Safely call `setTimeout` and `clearTimeout` within a component.
|
|
@@ -6,25 +7,59 @@ import { useCallback, useEffect, useRef } from "react";
|
|
|
6
7
|
* This hook ensures that all timeouts are cleared when the component unmounts.
|
|
7
8
|
*/
|
|
8
9
|
function useSafeTimeout() {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
const $ = c(6);
|
|
11
|
+
let t0;
|
|
12
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
13
|
+
t0 = /* @__PURE__ */ new Set();
|
|
14
|
+
$[0] = t0;
|
|
15
|
+
} else t0 = $[0];
|
|
16
|
+
const timers = useRef(t0);
|
|
17
|
+
let t1;
|
|
18
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
19
|
+
t1 = (handler, timeout, ...t2) => {
|
|
20
|
+
const args = t2;
|
|
21
|
+
const id = window.setTimeout(handler, timeout, ...args);
|
|
22
|
+
timers.current.add(id);
|
|
23
|
+
return id;
|
|
22
24
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
$[1] = t1;
|
|
26
|
+
} else t1 = $[1];
|
|
27
|
+
const safeSetTimeout = t1;
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
30
|
+
t2 = (id_0) => {
|
|
31
|
+
clearTimeout(id_0);
|
|
32
|
+
timers.current.delete(id_0);
|
|
33
|
+
};
|
|
34
|
+
$[2] = t2;
|
|
35
|
+
} else t2 = $[2];
|
|
36
|
+
const safeClearTimeout = t2;
|
|
37
|
+
let t3;
|
|
38
|
+
let t4;
|
|
39
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
40
|
+
t3 = () => {
|
|
41
|
+
const timerSet = timers.current;
|
|
42
|
+
return () => {
|
|
43
|
+
for (const id_1 of timerSet) clearTimeout(id_1);
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
t4 = [];
|
|
47
|
+
$[3] = t3;
|
|
48
|
+
$[4] = t4;
|
|
49
|
+
} else {
|
|
50
|
+
t3 = $[3];
|
|
51
|
+
t4 = $[4];
|
|
52
|
+
}
|
|
53
|
+
useEffect(t3, t4);
|
|
54
|
+
let t5;
|
|
55
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
56
|
+
t5 = {
|
|
57
|
+
safeSetTimeout,
|
|
58
|
+
safeClearTimeout
|
|
59
|
+
};
|
|
60
|
+
$[5] = t5;
|
|
61
|
+
} else t5 = $[5];
|
|
62
|
+
return t5;
|
|
28
63
|
}
|
|
29
64
|
//#endregion
|
|
30
65
|
export { useSafeTimeout as default };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
2
|
//#region src/internal/hooks/useDevOnlyEffect.ts
|
|
3
3
|
/**
|
|
4
|
-
* Runs an effect only in development.
|
|
5
|
-
*
|
|
6
|
-
* call is dropped by the consumer's `process.env.NODE_ENV` replacement) while
|
|
7
|
-
* centralising the `eslint-disable react-hooks/rules-of-hooks` to one place
|
|
8
|
-
* instead of every call site.
|
|
4
|
+
* Runs an effect only in development. Selecting the implementation at module
|
|
5
|
+
* initialization avoids conditional Hook calls and uses a no-op in production.
|
|
9
6
|
*
|
|
10
7
|
* `exhaustive-deps` is wired up to also check call sites of this hook via
|
|
11
8
|
* `additionalEffectHooks` in `eslint.config.mjs`, so callers get the same
|
|
@@ -14,8 +11,6 @@ import { useEffect } from "react";
|
|
|
14
11
|
* @param effect The effect callback to run in development.
|
|
15
12
|
* @param deps Dependency list, same semantics as `useEffect`.
|
|
16
13
|
*/
|
|
17
|
-
const useDevOnlyEffect =
|
|
18
|
-
useEffect(effect, deps);
|
|
19
|
-
};
|
|
14
|
+
const useDevOnlyEffect = useEffect;
|
|
20
15
|
//#endregion
|
|
21
16
|
export { useDevOnlyEffect };
|
|
@@ -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",
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
"react-is": "18.3.1",
|
|
166
166
|
"recast": "0.23.7",
|
|
167
167
|
"rimraf": "5.0.5",
|
|
168
|
-
"rolldown": "^1.2.
|
|
168
|
+
"rolldown": "^1.2.14",
|
|
169
169
|
"rolldown-plugin-dts": "^0.26.0",
|
|
170
170
|
"rolldown-plugin-import-css": "^0.0.0",
|
|
171
171
|
"rolldown-plugin-preserve-directives": "^0.0.0",
|
|
@@ -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"]}
|