@primer/react 0.0.0-20260218170127 → 0.0.0-20260218171116
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 +4 -18
- package/dist/ActionList/Description.js +35 -113
- package/dist/ActionList/Divider.js +11 -30
- package/dist/ActionList/Group.js +117 -294
- package/dist/ActionList/Heading.js +22 -77
- package/dist/ActionList/Item.js +37 -98
- package/dist/ActionList/LinkItem.js +24 -80
- package/dist/ActionList/List.js +33 -143
- package/dist/ActionList/Selection.js +30 -78
- package/dist/ActionList/TrailingAction.js +23 -83
- package/dist/ActionList/Visuals.js +64 -162
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +62 -72
- package/dist/PageLayout/PageLayout-5bde7892.css +2 -0
- package/dist/PageLayout/PageLayout-5bde7892.css.map +1 -0
- package/dist/PageLayout/PageLayout.d.ts +71 -2
- package/dist/PageLayout/PageLayout.d.ts.map +1 -1
- package/dist/PageLayout/PageLayout.js +496 -44
- package/dist/PageLayout/PageLayout.module.css.js +2 -2
- package/dist/PageLayout/usePaneWidth.d.ts +17 -5
- package/dist/PageLayout/usePaneWidth.d.ts.map +1 -1
- package/dist/PageLayout/usePaneWidth.js +123 -112
- package/dist/SplitPageLayout/SplitPageLayout.d.ts +4 -1
- package/dist/SplitPageLayout/SplitPageLayout.d.ts.map +1 -1
- package/dist/SplitPageLayout/SplitPageLayout.js +54 -2
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +4 -11
- package/dist/hooks/useIsMacOS.d.ts +3 -15
- package/dist/hooks/useIsMacOS.d.ts.map +1 -1
- package/dist/hooks/useIsMacOS.js +26 -24
- package/dist/internal/components/UnderlineTabbedInterface-20c3ba3d.css +2 -0
- package/dist/internal/components/UnderlineTabbedInterface-20c3ba3d.css.map +1 -0
- package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
- package/generated/components.json +200 -2
- package/package.json +1 -1
- package/dist/PageLayout/PageLayout-e8fc2355.css +0 -2
- package/dist/PageLayout/PageLayout-e8fc2355.css.map +0 -1
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260218171116
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
- [#
|
|
8
|
-
|
|
9
|
-
### Patch Changes
|
|
10
|
-
|
|
11
|
-
- [#7537](https://github.com/primer/react/pull/7537) [`4fd987c`](https://github.com/primer/react/commit/4fd987c4194f51dc7e66f16895542a1e4678bde7) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(ActionList): enable React Compiler
|
|
12
|
-
|
|
13
|
-
- [#7504](https://github.com/primer/react/pull/7504) [`d91e78e`](https://github.com/primer/react/commit/d91e78e8d1e69915222354b95d09d93d269dbd8b) Thanks [@TylerJDev](https://github.com/TylerJDev)! - UnderlineNav: Adds `overflow: hidden` when the "More" button isn't present
|
|
14
|
-
|
|
15
|
-
- Fake entry to force publishing
|
|
16
|
-
|
|
17
|
-
- [#7532](https://github.com/primer/react/pull/7532) [`4cefced`](https://github.com/primer/react/commit/4cefcedc95f626a3784938cc27801917b712a1f9) Thanks [@hectahertz](https://github.com/hectahertz)! - **PageLayout**: Eliminate forced reflow (~614ms) on mount by replacing `getComputedStyle` call with a pure JS viewport width check for the `--pane-max-width-diff` CSS variable.
|
|
18
|
-
|
|
19
|
-
- [#7548](https://github.com/primer/react/pull/7548) [`d4b32c3`](https://github.com/primer/react/commit/d4b32c3672d3d5421711324654c1028527dcdf38) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(useIsMacOS): replace useState+useEffect with useSyncExternalStore to eliminate unnecessary re-render
|
|
20
|
-
|
|
21
|
-
## 38.12.0
|
|
22
|
-
|
|
23
|
-
### Minor Changes
|
|
7
|
+
- [#7521](https://github.com/primer/react/pull/7521) [`1e09366`](https://github.com/primer/react/commit/1e09366be1ea47056d29de22316b6501b4125eb3) Thanks [@TylerJDev](https://github.com/TylerJDev)! - PageLayout: Add `PageLayout.Sidebar` sub-component
|
|
24
8
|
|
|
25
9
|
- [#7348](https://github.com/primer/react/pull/7348) [`3c160b2`](https://github.com/primer/react/commit/3c160b26bded975de6175ccf04272e8946cef54e) Thanks [@mattcosta7](https://github.com/mattcosta7)! - Add `currentWidth` and `onResizeEnd` props to PageLayout.Pane for controlled resizable width
|
|
26
10
|
|
|
@@ -66,6 +50,8 @@
|
|
|
66
50
|
|
|
67
51
|
### Patch Changes
|
|
68
52
|
|
|
53
|
+
- Fake entry to force publishing
|
|
54
|
+
|
|
69
55
|
- [#7527](https://github.com/primer/react/pull/7527) [`c87db98`](https://github.com/primer/react/commit/c87db981280090cdccc84d19c607d1462212d223) Thanks [@llastflowers](https://github.com/llastflowers)! - Update PageHeader story to have semantic headings
|
|
70
56
|
|
|
71
57
|
- [#7535](https://github.com/primer/react/pull/7535) [`d86c970`](https://github.com/primer/react/commit/d86c970be94dc47da55d492dc978d63d3f9ca005) Thanks [@francinelucca](https://github.com/francinelucca)! - fix: ActionBar overflow menu not closing on select
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { c } from 'react-compiler-runtime';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { ItemContext } from './shared.js';
|
|
4
3
|
import classes from './ActionList.module.css.js';
|
|
@@ -6,125 +5,48 @@ import { clsx } from 'clsx';
|
|
|
6
5
|
import { jsx } from 'react/jsx-runtime';
|
|
7
6
|
import Truncate from '../Truncate/Truncate.js';
|
|
8
7
|
|
|
9
|
-
const Description =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if ($[0] !== t0) {
|
|
17
|
-
({
|
|
18
|
-
variant: t1,
|
|
19
|
-
className,
|
|
20
|
-
truncate,
|
|
21
|
-
style,
|
|
22
|
-
...props
|
|
23
|
-
} = t0);
|
|
24
|
-
$[0] = t0;
|
|
25
|
-
$[1] = className;
|
|
26
|
-
$[2] = props;
|
|
27
|
-
$[3] = style;
|
|
28
|
-
$[4] = t1;
|
|
29
|
-
$[5] = truncate;
|
|
30
|
-
} else {
|
|
31
|
-
className = $[1];
|
|
32
|
-
props = $[2];
|
|
33
|
-
style = $[3];
|
|
34
|
-
t1 = $[4];
|
|
35
|
-
truncate = $[5];
|
|
36
|
-
}
|
|
37
|
-
const variant = t1 === undefined ? "inline" : t1;
|
|
8
|
+
const Description = ({
|
|
9
|
+
variant = 'inline',
|
|
10
|
+
className,
|
|
11
|
+
truncate,
|
|
12
|
+
style,
|
|
13
|
+
...props
|
|
14
|
+
}) => {
|
|
38
15
|
const {
|
|
39
16
|
blockDescriptionId,
|
|
40
17
|
inlineDescriptionId
|
|
41
18
|
} = React.useContext(ItemContext);
|
|
42
19
|
const containerRef = React.useRef(null);
|
|
43
|
-
const [computedTitle, setComputedTitle] = React.useState(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
$[6] = truncate;
|
|
53
|
-
$[7] = t2;
|
|
54
|
-
} else {
|
|
55
|
-
t2 = $[7];
|
|
56
|
-
}
|
|
57
|
-
let t3;
|
|
58
|
-
if ($[8] !== props.children || $[9] !== truncate) {
|
|
59
|
-
t3 = [truncate, props.children];
|
|
60
|
-
$[8] = props.children;
|
|
61
|
-
$[9] = truncate;
|
|
62
|
-
$[10] = t3;
|
|
63
|
-
} else {
|
|
64
|
-
t3 = $[10];
|
|
65
|
-
}
|
|
66
|
-
React.useEffect(t2, t3);
|
|
67
|
-
const effectiveTitle = typeof props.children === "string" ? props.children : computedTitle;
|
|
68
|
-
if (variant === "block" || !truncate) {
|
|
69
|
-
const t4 = variant === "block" ? blockDescriptionId : inlineDescriptionId;
|
|
70
|
-
let t5;
|
|
71
|
-
if ($[11] !== className) {
|
|
72
|
-
t5 = clsx(className, classes.Description);
|
|
73
|
-
$[11] = className;
|
|
74
|
-
$[12] = t5;
|
|
75
|
-
} else {
|
|
76
|
-
t5 = $[12];
|
|
77
|
-
}
|
|
78
|
-
let t6;
|
|
79
|
-
if ($[13] !== props.children || $[14] !== style || $[15] !== t4 || $[16] !== t5) {
|
|
80
|
-
t6 = /*#__PURE__*/jsx("span", {
|
|
81
|
-
id: t4,
|
|
82
|
-
className: t5,
|
|
83
|
-
style: style,
|
|
84
|
-
"data-component": "ActionList.Description",
|
|
85
|
-
children: props.children
|
|
86
|
-
});
|
|
87
|
-
$[13] = props.children;
|
|
88
|
-
$[14] = style;
|
|
89
|
-
$[15] = t4;
|
|
90
|
-
$[16] = t5;
|
|
91
|
-
$[17] = t6;
|
|
92
|
-
} else {
|
|
93
|
-
t6 = $[17];
|
|
20
|
+
const [computedTitle, setComputedTitle] = React.useState('');
|
|
21
|
+
|
|
22
|
+
// Extract text content from rendered DOM for tooltip
|
|
23
|
+
React.useEffect(() => {
|
|
24
|
+
if (truncate && containerRef.current) {
|
|
25
|
+
const textContent = containerRef.current.textContent || '';
|
|
26
|
+
setComputedTitle(textContent);
|
|
94
27
|
}
|
|
95
|
-
|
|
28
|
+
}, [truncate, props.children]);
|
|
29
|
+
const effectiveTitle = typeof props.children === 'string' ? props.children : computedTitle;
|
|
30
|
+
if (variant === 'block' || !truncate) {
|
|
31
|
+
return /*#__PURE__*/jsx("span", {
|
|
32
|
+
id: variant === 'block' ? blockDescriptionId : inlineDescriptionId,
|
|
33
|
+
className: clsx(className, classes.Description),
|
|
34
|
+
style: style,
|
|
35
|
+
"data-component": "ActionList.Description",
|
|
36
|
+
children: props.children
|
|
37
|
+
});
|
|
96
38
|
} else {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
ref: containerRef,
|
|
109
|
-
id: inlineDescriptionId,
|
|
110
|
-
className: t4,
|
|
111
|
-
style: style,
|
|
112
|
-
title: effectiveTitle,
|
|
113
|
-
inline: true,
|
|
114
|
-
maxWidth: "100%",
|
|
115
|
-
"data-component": "ActionList.Description",
|
|
116
|
-
children: props.children
|
|
117
|
-
});
|
|
118
|
-
$[20] = effectiveTitle;
|
|
119
|
-
$[21] = inlineDescriptionId;
|
|
120
|
-
$[22] = props.children;
|
|
121
|
-
$[23] = style;
|
|
122
|
-
$[24] = t4;
|
|
123
|
-
$[25] = t5;
|
|
124
|
-
} else {
|
|
125
|
-
t5 = $[25];
|
|
126
|
-
}
|
|
127
|
-
return t5;
|
|
39
|
+
return /*#__PURE__*/jsx(Truncate, {
|
|
40
|
+
ref: containerRef,
|
|
41
|
+
id: inlineDescriptionId,
|
|
42
|
+
className: clsx(className, classes.Description),
|
|
43
|
+
style: style,
|
|
44
|
+
title: effectiveTitle,
|
|
45
|
+
inline: true,
|
|
46
|
+
maxWidth: "100%",
|
|
47
|
+
"data-component": "ActionList.Description",
|
|
48
|
+
children: props.children
|
|
49
|
+
});
|
|
128
50
|
}
|
|
129
51
|
};
|
|
130
52
|
Description.__SLOT__ = Symbol('ActionList.Description');
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { c } from 'react-compiler-runtime';
|
|
2
1
|
import { clsx } from 'clsx';
|
|
3
2
|
import classes from './ActionList.module.css.js';
|
|
4
3
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -6,36 +5,18 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
6
5
|
/**
|
|
7
6
|
* Visually separates `Items` or `Groups` in an `ActionList`.
|
|
8
7
|
*/
|
|
9
|
-
const Divider =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
$[1] = t1;
|
|
20
|
-
} else {
|
|
21
|
-
t1 = $[1];
|
|
22
|
-
}
|
|
23
|
-
let t2;
|
|
24
|
-
if ($[2] !== style || $[3] !== t1) {
|
|
25
|
-
t2 = /*#__PURE__*/jsx("li", {
|
|
26
|
-
className: t1,
|
|
27
|
-
style: style,
|
|
28
|
-
"aria-hidden": "true",
|
|
29
|
-
"data-component": "ActionList.Divider"
|
|
30
|
-
});
|
|
31
|
-
$[2] = style;
|
|
32
|
-
$[3] = t1;
|
|
33
|
-
$[4] = t2;
|
|
34
|
-
} else {
|
|
35
|
-
t2 = $[4];
|
|
36
|
-
}
|
|
37
|
-
return t2;
|
|
8
|
+
const Divider = ({
|
|
9
|
+
className,
|
|
10
|
+
style
|
|
11
|
+
}) => {
|
|
12
|
+
return /*#__PURE__*/jsx("li", {
|
|
13
|
+
className: clsx(className, classes.Divider),
|
|
14
|
+
style: style,
|
|
15
|
+
"aria-hidden": "true",
|
|
16
|
+
"data-component": "ActionList.Divider"
|
|
17
|
+
});
|
|
38
18
|
};
|
|
19
|
+
Divider.displayName = "Divider";
|
|
39
20
|
Divider.__SLOT__ = Symbol('ActionList.Divider');
|
|
40
21
|
|
|
41
22
|
export { Divider };
|