@primer/react 0.0.0-20260227111155 → 0.0.0-20260227121550
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 +2 -98
- package/dist/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar/ActionBar.js +152 -92
- package/dist/ActionList/ActionList-f4ac3b54.css +2 -0
- package/dist/ActionList/ActionList-f4ac3b54.css.map +1 -0
- package/dist/ActionList/ActionList.module.css.js +1 -1
- 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.d.ts.map +1 -1
- package/dist/ActionList/Item.js +37 -99
- 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/Autocomplete/Autocomplete.js +159 -76
- package/dist/Autocomplete/AutocompleteMenu.js +333 -128
- package/dist/Autocomplete/AutocompleteOverlay.js +130 -49
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +276 -112
- package/dist/Blankslate/{Blankslate-a039d79a.css → Blankslate-f5a9755a.css} +2 -2
- package/dist/Blankslate/Blankslate-f5a9755a.css.map +1 -0
- package/dist/Blankslate/Blankslate.module.css.js +1 -1
- package/dist/Button/ButtonBase.d.ts.map +1 -1
- package/dist/Button/ButtonBase.js +14 -9
- package/dist/Checkbox/Checkbox.js +163 -55
- package/dist/Dialog/Dialog.js +347 -105
- package/dist/FilteredActionList/FilteredActionList-f6c2dc7a.css +2 -0
- package/dist/FilteredActionList/FilteredActionList-f6c2dc7a.css.map +1 -0
- package/dist/FilteredActionList/FilteredActionList.d.ts +1 -16
- package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionList.js +42 -147
- package/dist/FilteredActionList/FilteredActionList.module.css.js +2 -2
- package/dist/Overlay/Overlay-43cda449.css +2 -0
- package/dist/Overlay/Overlay-43cda449.css.map +1 -0
- package/dist/Overlay/Overlay.module.css.js +1 -1
- package/dist/PageLayout/PageLayout-cb491b47.css +2 -0
- package/dist/PageLayout/PageLayout-cb491b47.css.map +1 -0
- package/dist/PageLayout/PageLayout.d.ts +6 -117
- package/dist/PageLayout/PageLayout.d.ts.map +1 -1
- package/dist/PageLayout/PageLayout.js +1227 -750
- package/dist/PageLayout/PageLayout.module.css.js +2 -2
- package/dist/PageLayout/index.d.ts +0 -1
- package/dist/PageLayout/index.d.ts.map +1 -1
- package/dist/PageLayout/usePaneWidth.d.ts +11 -38
- package/dist/PageLayout/usePaneWidth.d.ts.map +1 -1
- package/dist/PageLayout/usePaneWidth.js +198 -359
- package/dist/SelectPanel/SelectPanel.d.ts +1 -1
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +33 -85
- package/dist/SplitPageLayout/SplitPageLayout.d.ts +1 -4
- package/dist/SplitPageLayout/SplitPageLayout.d.ts.map +1 -1
- package/dist/SplitPageLayout/SplitPageLayout.js +2 -54
- package/dist/Text/Text.d.ts +1 -1
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +13 -10
- package/dist/TreeView/TreeView.d.ts.map +1 -1
- package/dist/TreeView/TreeView.js +101 -59
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +4 -11
- package/dist/UnderlineNav/UnderlineNavItem.js +149 -56
- package/dist/experimental/SelectPanel2/SelectPanel-1f8c23b5.css +2 -0
- package/dist/experimental/SelectPanel2/{SelectPanel-f0c4b9ca.css.map → SelectPanel-1f8c23b5.css.map} +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.js +593 -209
- package/dist/experimental/SelectPanel2/SelectPanel.module.css.js +1 -1
- 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/hooks/useRefObjectAsForwardedRef.d.ts.map +1 -1
- package/dist/hooks/useRefObjectAsForwardedRef.js +2 -10
- package/dist/hooks/useScrollFlash.d.ts.map +1 -1
- package/dist/hooks/useScrollFlash.js +22 -14
- package/dist/hooks/useSlots.d.ts +6 -50
- package/dist/hooks/useSlots.d.ts.map +1 -1
- package/dist/hooks/useSlots.js +36 -114
- 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/dist/live-region/Announce.d.ts.map +1 -1
- package/dist/live-region/Announce.js +4 -7
- package/generated/components.json +11 -239
- package/package.json +4 -4
- package/dist/ActionList/ActionList-c04a02d6.css +0 -2
- package/dist/ActionList/ActionList-c04a02d6.css.map +0 -1
- package/dist/Blankslate/Blankslate-a039d79a.css.map +0 -1
- package/dist/FilteredActionList/FilteredActionList-02db90c6.css +0 -2
- package/dist/FilteredActionList/FilteredActionList-02db90c6.css.map +0 -1
- package/dist/Overlay/Overlay-15519c09.css +0 -2
- package/dist/Overlay/Overlay-15519c09.css.map +0 -1
- package/dist/PageLayout/PageLayout-3444a142.css +0 -2
- package/dist/PageLayout/PageLayout-3444a142.css.map +0 -1
- package/dist/experimental/SelectPanel2/SelectPanel-f0c4b9ca.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c } from 'react-compiler-runtime';
|
|
2
|
+
import { useRef, useReducer, useDeferredValue } from 'react';
|
|
3
|
+
import { AutocompleteContext, AutocompleteDeferredInputContext, AutocompleteInputContext } from './AutocompleteContext.js';
|
|
3
4
|
import AutocompleteInput from './AutocompleteInput.js';
|
|
4
5
|
import AutocompleteMenu from './AutocompleteMenu.js';
|
|
5
6
|
import AutocompleteOverlay from './AutocompleteOverlay.js';
|
|
@@ -48,10 +49,12 @@ const reducer = (state, action) => {
|
|
|
48
49
|
return state;
|
|
49
50
|
}
|
|
50
51
|
};
|
|
51
|
-
const Autocomplete =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
const Autocomplete = t0 => {
|
|
53
|
+
const $ = c(24);
|
|
54
|
+
const {
|
|
55
|
+
children,
|
|
56
|
+
id: idProp
|
|
57
|
+
} = t0;
|
|
55
58
|
const activeDescendantRef = useRef(null);
|
|
56
59
|
const scrollContainerRef = useRef(null);
|
|
57
60
|
const inputRef = useRef(null);
|
|
@@ -63,80 +66,160 @@ const Autocomplete = ({
|
|
|
63
66
|
isMenuDirectlyActivated,
|
|
64
67
|
selectedItemLength
|
|
65
68
|
} = state;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
69
|
+
let t1;
|
|
70
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
71
|
+
t1 = value => {
|
|
72
|
+
dispatch({
|
|
73
|
+
type: "inputValue",
|
|
74
|
+
payload: value
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
$[0] = t1;
|
|
78
|
+
} else {
|
|
79
|
+
t1 = $[0];
|
|
80
|
+
}
|
|
81
|
+
const setInputValue = t1;
|
|
82
|
+
let t2;
|
|
83
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
84
|
+
t2 = value_0 => {
|
|
85
|
+
dispatch({
|
|
86
|
+
type: "showMenu",
|
|
87
|
+
payload: value_0
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
$[1] = t2;
|
|
91
|
+
} else {
|
|
92
|
+
t2 = $[1];
|
|
93
|
+
}
|
|
94
|
+
const setShowMenu = t2;
|
|
95
|
+
let t3;
|
|
96
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
97
|
+
t3 = value_1 => {
|
|
98
|
+
dispatch({
|
|
99
|
+
type: "autocompleteSuggestion",
|
|
100
|
+
payload: value_1
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
$[2] = t3;
|
|
104
|
+
} else {
|
|
105
|
+
t3 = $[2];
|
|
106
|
+
}
|
|
107
|
+
const setAutocompleteSuggestion = t3;
|
|
108
|
+
let t4;
|
|
109
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
110
|
+
t4 = value_2 => {
|
|
111
|
+
dispatch({
|
|
112
|
+
type: "isMenuDirectlyActivated",
|
|
113
|
+
payload: value_2
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
$[3] = t4;
|
|
117
|
+
} else {
|
|
118
|
+
t4 = $[3];
|
|
119
|
+
}
|
|
120
|
+
const setIsMenuDirectlyActivated = t4;
|
|
121
|
+
let t5;
|
|
122
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
123
|
+
t5 = value_3 => {
|
|
124
|
+
dispatch({
|
|
125
|
+
type: "selectedItemLength",
|
|
126
|
+
payload: value_3
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
$[4] = t5;
|
|
130
|
+
} else {
|
|
131
|
+
t5 = $[4];
|
|
132
|
+
}
|
|
133
|
+
const setSelectedItemLength = t5;
|
|
96
134
|
const id = useId(idProp);
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
135
|
+
let t6;
|
|
136
|
+
if ($[5] !== id || $[6] !== selectedItemLength || $[7] !== showMenu) {
|
|
137
|
+
t6 = {
|
|
138
|
+
activeDescendantRef,
|
|
139
|
+
id,
|
|
140
|
+
inputRef,
|
|
141
|
+
scrollContainerRef,
|
|
142
|
+
selectedItemLength,
|
|
143
|
+
setAutocompleteSuggestion,
|
|
144
|
+
setInputValue,
|
|
145
|
+
setIsMenuDirectlyActivated,
|
|
146
|
+
setShowMenu,
|
|
147
|
+
setSelectedItemLength,
|
|
148
|
+
showMenu
|
|
149
|
+
};
|
|
150
|
+
$[5] = id;
|
|
151
|
+
$[6] = selectedItemLength;
|
|
152
|
+
$[7] = showMenu;
|
|
153
|
+
$[8] = t6;
|
|
154
|
+
} else {
|
|
155
|
+
t6 = $[8];
|
|
156
|
+
}
|
|
157
|
+
const autocompleteContextValue = t6;
|
|
158
|
+
let t7;
|
|
159
|
+
if ($[9] !== autocompleteSuggestion || $[10] !== inputValue || $[11] !== isMenuDirectlyActivated) {
|
|
160
|
+
t7 = {
|
|
161
|
+
autocompleteSuggestion,
|
|
162
|
+
inputValue,
|
|
163
|
+
isMenuDirectlyActivated
|
|
164
|
+
};
|
|
165
|
+
$[9] = autocompleteSuggestion;
|
|
166
|
+
$[10] = inputValue;
|
|
167
|
+
$[11] = isMenuDirectlyActivated;
|
|
168
|
+
$[12] = t7;
|
|
169
|
+
} else {
|
|
170
|
+
t7 = $[12];
|
|
171
|
+
}
|
|
172
|
+
const autocompleteInputContextValue = t7;
|
|
124
173
|
const deferredInputValue = useDeferredValue(inputValue);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
174
|
+
let t8;
|
|
175
|
+
if ($[13] !== deferredInputValue) {
|
|
176
|
+
t8 = {
|
|
177
|
+
deferredInputValue
|
|
178
|
+
};
|
|
179
|
+
$[13] = deferredInputValue;
|
|
180
|
+
$[14] = t8;
|
|
181
|
+
} else {
|
|
182
|
+
t8 = $[14];
|
|
183
|
+
}
|
|
184
|
+
const autocompleteDeferredInputContextValue = t8;
|
|
185
|
+
let t9;
|
|
186
|
+
if ($[15] !== autocompleteDeferredInputContextValue || $[16] !== children) {
|
|
187
|
+
t9 = /*#__PURE__*/jsx(AutocompleteDeferredInputContext.Provider, {
|
|
188
|
+
value: autocompleteDeferredInputContextValue,
|
|
189
|
+
children: children
|
|
190
|
+
});
|
|
191
|
+
$[15] = autocompleteDeferredInputContextValue;
|
|
192
|
+
$[16] = children;
|
|
193
|
+
$[17] = t9;
|
|
194
|
+
} else {
|
|
195
|
+
t9 = $[17];
|
|
196
|
+
}
|
|
197
|
+
let t10;
|
|
198
|
+
if ($[18] !== autocompleteInputContextValue || $[19] !== t9) {
|
|
199
|
+
t10 = /*#__PURE__*/jsx(AutocompleteInputContext.Provider, {
|
|
131
200
|
value: autocompleteInputContextValue,
|
|
132
|
-
children:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
201
|
+
children: t9
|
|
202
|
+
});
|
|
203
|
+
$[18] = autocompleteInputContextValue;
|
|
204
|
+
$[19] = t9;
|
|
205
|
+
$[20] = t10;
|
|
206
|
+
} else {
|
|
207
|
+
t10 = $[20];
|
|
208
|
+
}
|
|
209
|
+
let t11;
|
|
210
|
+
if ($[21] !== autocompleteContextValue || $[22] !== t10) {
|
|
211
|
+
t11 = /*#__PURE__*/jsx(AutocompleteContext.Provider, {
|
|
212
|
+
value: autocompleteContextValue,
|
|
213
|
+
children: t10
|
|
214
|
+
});
|
|
215
|
+
$[21] = autocompleteContextValue;
|
|
216
|
+
$[22] = t10;
|
|
217
|
+
$[23] = t11;
|
|
218
|
+
} else {
|
|
219
|
+
t11 = $[23];
|
|
220
|
+
}
|
|
221
|
+
return t11;
|
|
138
222
|
};
|
|
139
|
-
Autocomplete.displayName = "Autocomplete";
|
|
140
223
|
var Autocomplete$1 = Object.assign(Autocomplete, {
|
|
141
224
|
__SLOT__: Symbol('Autocomplete'),
|
|
142
225
|
Context: AutocompleteContext,
|