@primer/react 38.3.0 → 38.4.0-rc.1ca4eb46b
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.
Potentially problematic release.
This version of @primer/react might be problematic. Click here for more details.
- package/CHANGELOG.md +17 -0
- package/dist/Banner/Banner-f672cdf9.css +2 -0
- package/dist/Banner/Banner-f672cdf9.css.map +1 -0
- package/dist/Banner/Banner.d.ts +8 -0
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +2 -0
- package/dist/Banner/Banner.module.css.js +1 -1
- package/dist/Banner/index.d.ts +1 -0
- package/dist/Banner/index.d.ts.map +1 -1
- package/dist/DataTable/Pagination.d.ts.map +1 -1
- package/dist/DataTable/Pagination.js +181 -187
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +0 -1
- package/dist/FilteredActionList/FilteredActionList.js +15 -13
- package/dist/LabelGroup/LabelGroup.d.ts.map +1 -1
- package/dist/LabelGroup/LabelGroup.js +12 -5
- package/dist/SegmentedControl/{SegmentedControl-5cfe12ab.css → SegmentedControl-6389d0da.css} +2 -2
- package/dist/SegmentedControl/SegmentedControl-6389d0da.css.map +1 -0
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +11 -5
- package/dist/SegmentedControl/SegmentedControl.module.css.js +1 -1
- package/dist/SegmentedControl/SegmentedControlButton.d.ts +2 -0
- package/dist/SegmentedControl/SegmentedControlButton.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlButton.js +104 -82
- package/dist/SegmentedControl/SegmentedControlIconButton.d.ts +2 -0
- package/dist/SegmentedControl/SegmentedControlIconButton.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlIconButton.js +122 -181
- package/dist/TreeView/TreeView.d.ts.map +1 -1
- package/dist/TreeView/TreeView.js +5 -7
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts.map +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.js +4 -5
- package/generated/components.json +6 -0
- package/package.json +8 -8
- package/dist/Banner/Banner-c1744c4b.css +0 -2
- package/dist/Banner/Banner-c1744c4b.css.map +0 -1
- package/dist/SegmentedControl/SegmentedControl-5cfe12ab.css.map +0 -1
- package/dist/internal/components/LiveRegion.d.ts +0 -14
- package/dist/internal/components/LiveRegion.d.ts.map +0 -1
- package/dist/internal/components/LiveRegion.js +0 -130
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { VisuallyHidden } from '../../VisuallyHidden/VisuallyHidden.js';
|
|
5
|
-
|
|
6
|
-
const LiveRegionContext = /*#__PURE__*/React.createContext(null);
|
|
7
|
-
function useLiveRegion() {
|
|
8
|
-
const context = React.useContext(LiveRegionContext);
|
|
9
|
-
if (!context) {
|
|
10
|
-
throw new Error("useLiveRegion() must be used within a <LiveRegion>");
|
|
11
|
-
}
|
|
12
|
-
return context;
|
|
13
|
-
}
|
|
14
|
-
function LiveRegion(t0) {
|
|
15
|
-
const $ = c(5);
|
|
16
|
-
const {
|
|
17
|
-
children
|
|
18
|
-
} = t0;
|
|
19
|
-
const [message, setMessage] = React.useState("");
|
|
20
|
-
let t1;
|
|
21
|
-
if ($[0] !== message) {
|
|
22
|
-
t1 = {
|
|
23
|
-
announce: setMessage,
|
|
24
|
-
message
|
|
25
|
-
};
|
|
26
|
-
$[0] = message;
|
|
27
|
-
$[1] = t1;
|
|
28
|
-
} else {
|
|
29
|
-
t1 = $[1];
|
|
30
|
-
}
|
|
31
|
-
const value = t1;
|
|
32
|
-
let t2;
|
|
33
|
-
if ($[2] !== children || $[3] !== value) {
|
|
34
|
-
t2 = /*#__PURE__*/jsx(LiveRegionContext.Provider, {
|
|
35
|
-
value: value,
|
|
36
|
-
children: children
|
|
37
|
-
});
|
|
38
|
-
$[2] = children;
|
|
39
|
-
$[3] = value;
|
|
40
|
-
$[4] = t2;
|
|
41
|
-
} else {
|
|
42
|
-
t2 = $[4];
|
|
43
|
-
}
|
|
44
|
-
return t2;
|
|
45
|
-
}
|
|
46
|
-
function LiveRegionOutlet() {
|
|
47
|
-
const $ = c(2);
|
|
48
|
-
const liveRegion = useLiveRegion();
|
|
49
|
-
let t0;
|
|
50
|
-
if ($[0] !== liveRegion.message) {
|
|
51
|
-
t0 = /*#__PURE__*/jsx(VisuallyHidden, {
|
|
52
|
-
role: "status",
|
|
53
|
-
"aria-live": "polite",
|
|
54
|
-
"aria-atomic": true,
|
|
55
|
-
children: liveRegion.message
|
|
56
|
-
});
|
|
57
|
-
$[0] = liveRegion.message;
|
|
58
|
-
$[1] = t0;
|
|
59
|
-
} else {
|
|
60
|
-
t0 = $[1];
|
|
61
|
-
}
|
|
62
|
-
return t0;
|
|
63
|
-
}
|
|
64
|
-
function Message(t0) {
|
|
65
|
-
const $ = c(8);
|
|
66
|
-
const {
|
|
67
|
-
value
|
|
68
|
-
} = t0;
|
|
69
|
-
const liveRegion = useLiveRegion();
|
|
70
|
-
const savedLiveRegion = React.useRef(liveRegion);
|
|
71
|
-
const committedRef = React.useRef(false);
|
|
72
|
-
let t1;
|
|
73
|
-
let t2;
|
|
74
|
-
if ($[0] !== liveRegion) {
|
|
75
|
-
t1 = () => {
|
|
76
|
-
savedLiveRegion.current = liveRegion;
|
|
77
|
-
};
|
|
78
|
-
t2 = [liveRegion];
|
|
79
|
-
$[0] = liveRegion;
|
|
80
|
-
$[1] = t1;
|
|
81
|
-
$[2] = t2;
|
|
82
|
-
} else {
|
|
83
|
-
t1 = $[1];
|
|
84
|
-
t2 = $[2];
|
|
85
|
-
}
|
|
86
|
-
React.useEffect(t1, t2);
|
|
87
|
-
let t3;
|
|
88
|
-
let t4;
|
|
89
|
-
if ($[3] !== value) {
|
|
90
|
-
t3 = () => {
|
|
91
|
-
if (committedRef.current !== true) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const timeoutId = setTimeout(() => {
|
|
95
|
-
savedLiveRegion.current.announce(value);
|
|
96
|
-
}, 750);
|
|
97
|
-
return () => {
|
|
98
|
-
clearTimeout(timeoutId);
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
t4 = [value];
|
|
102
|
-
$[3] = value;
|
|
103
|
-
$[4] = t3;
|
|
104
|
-
$[5] = t4;
|
|
105
|
-
} else {
|
|
106
|
-
t3 = $[4];
|
|
107
|
-
t4 = $[5];
|
|
108
|
-
}
|
|
109
|
-
React.useEffect(t3, t4);
|
|
110
|
-
let t5;
|
|
111
|
-
let t6;
|
|
112
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
113
|
-
t5 = () => {
|
|
114
|
-
committedRef.current = true;
|
|
115
|
-
return () => {
|
|
116
|
-
committedRef.current = false;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
t6 = [];
|
|
120
|
-
$[6] = t5;
|
|
121
|
-
$[7] = t6;
|
|
122
|
-
} else {
|
|
123
|
-
t5 = $[6];
|
|
124
|
-
t6 = $[7];
|
|
125
|
-
}
|
|
126
|
-
React.useEffect(t5, t6);
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export { LiveRegion, LiveRegionOutlet, Message, useLiveRegion };
|