@primer/react 0.0.0-20260313180314 → 0.0.0-20260313180903
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 +6 -32
- package/dist/ActionList/Item.d.ts.map +1 -1
- package/dist/ActionList/Item.js +192 -628
- package/dist/ActionList/List.d.ts.map +1 -1
- package/dist/ActionList/List.js +5 -6
- package/dist/Banner/Banner-f672cdf9.css +2 -0
- package/dist/Banner/Banner-f672cdf9.css.map +1 -0
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +0 -1
- package/dist/Banner/Banner.module.css.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +1 -0
- package/dist/Button/{ButtonBase-6659abcf.css → ButtonBase-781fba8b.css} +2 -2
- package/dist/Button/{ButtonBase-6659abcf.css.map → ButtonBase-781fba8b.css.map} +1 -1
- package/dist/Button/ButtonBase.module.css.js +1 -1
- package/dist/Dialog/{Dialog-2de477b3.css → Dialog-2d417a89.css} +2 -2
- package/dist/Dialog/{Dialog-2de477b3.css.map → Dialog-2d417a89.css.map} +1 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +1 -3
- package/dist/Dialog/Dialog.module.css.js +2 -2
- package/dist/Overlay/{Overlay-dbaa6b8c.css → Overlay-15519c09.css} +2 -2
- package/dist/Overlay/Overlay-15519c09.css.map +1 -0
- package/dist/Overlay/Overlay.module.css.js +1 -1
- package/dist/PageLayout/PageLayout.d.ts +20 -4
- package/dist/PageLayout/PageLayout.d.ts.map +1 -1
- package/dist/PageLayout/PageLayout.js +0 -12
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +29 -30
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +5 -31
- package/dist/Timeline/Timeline-19bef8c5.css +2 -0
- package/dist/Timeline/Timeline-19bef8c5.css.map +1 -0
- package/dist/Timeline/Timeline.d.ts +1 -1
- package/dist/Timeline/Timeline.d.ts.map +1 -1
- package/dist/Timeline/Timeline.js +14 -27
- package/dist/Timeline/Timeline.module.css.js +1 -1
- package/dist/TreeView/TreeView.d.ts.map +1 -1
- package/dist/TreeView/TreeView.js +59 -101
- package/dist/UnderlineNav/UnderlineNav-4c80468c.css +2 -0
- package/dist/UnderlineNav/UnderlineNav-4c80468c.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNav.d.ts +1 -3
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +40 -342
- package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -2
- package/dist/UnderlineNav/UnderlineNavContext.d.ts +1 -11
- package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavContext.js +1 -4
- package/dist/UnderlineNav/UnderlineNavItem.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavItem.js +40 -37
- package/dist/UnderlineNav/index.d.ts +1 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels-162f9aed.css +2 -0
- package/dist/experimental/UnderlinePanels/UnderlinePanels-162f9aed.css.map +1 -0
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +1 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +1 -1
- package/dist/internal/components/UnderlineTabbedInterface-7317470b.css +2 -0
- package/dist/internal/components/UnderlineTabbedInterface-7317470b.css.map +1 -0
- package/dist/internal/components/UnderlineTabbedInterface.d.ts +0 -1
- package/dist/internal/components/UnderlineTabbedInterface.d.ts.map +1 -1
- package/dist/internal/components/UnderlineTabbedInterface.js +66 -60
- package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
- package/dist/utils/character-counter.d.ts.map +1 -1
- package/dist/utils/character-counter.js +0 -1
- package/generated/components.json +5 -13
- package/package.json +1 -1
- package/dist/Banner/Banner-41040ab7.css +0 -2
- package/dist/Banner/Banner-41040ab7.css.map +0 -1
- package/dist/Overlay/Overlay-dbaa6b8c.css.map +0 -1
- package/dist/Timeline/Timeline-4d67684a.css +0 -2
- package/dist/Timeline/Timeline-4d67684a.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css +0 -2
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css.map +0 -1
- package/dist/UnderlineNav/styles.d.ts +0 -16
- package/dist/UnderlineNav/styles.d.ts.map +0 -1
- package/dist/UnderlineNav/styles.js +0 -19
- package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css +0 -2
- package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css.map +0 -1
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css.map +0 -1
|
@@ -31,8 +31,7 @@ const RootContext = /*#__PURE__*/React.createContext({
|
|
|
31
31
|
announceUpdate: () => {},
|
|
32
32
|
expandedStateCache: {
|
|
33
33
|
current: new Map()
|
|
34
|
-
}
|
|
35
|
-
scrollElementIntoView: () => {}
|
|
34
|
+
}
|
|
36
35
|
});
|
|
37
36
|
const ItemContext = /*#__PURE__*/React.createContext({
|
|
38
37
|
itemId: '',
|
|
@@ -52,7 +51,7 @@ const ItemContext = /*#__PURE__*/React.createContext({
|
|
|
52
51
|
/* Size of toggle icon in pixels. */
|
|
53
52
|
const TOGGLE_ICON_SIZE = 12;
|
|
54
53
|
const Root = t0 => {
|
|
55
|
-
const $ = c(
|
|
54
|
+
const $ = c(23);
|
|
56
55
|
const {
|
|
57
56
|
"aria-label": ariaLabel,
|
|
58
57
|
"aria-labelledby": ariaLabelledby,
|
|
@@ -128,132 +127,89 @@ const Root = t0 => {
|
|
|
128
127
|
t7 = $[5];
|
|
129
128
|
}
|
|
130
129
|
useTypeahead(t7);
|
|
131
|
-
const pendingScrollRef = React.useRef(null);
|
|
132
|
-
let t8;
|
|
133
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
134
|
-
t8 = element_0 => {
|
|
135
|
-
if (!element_0) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
if (pendingScrollRef.current !== null) {
|
|
139
|
-
cancelAnimationFrame(pendingScrollRef.current);
|
|
140
|
-
}
|
|
141
|
-
pendingScrollRef.current = requestAnimationFrame(() => {
|
|
142
|
-
pendingScrollRef.current = null;
|
|
143
|
-
if (!element_0.isConnected) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
element_0.scrollIntoView({
|
|
147
|
-
block: "nearest",
|
|
148
|
-
inline: "nearest"
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
$[6] = t8;
|
|
153
|
-
} else {
|
|
154
|
-
t8 = $[6];
|
|
155
|
-
}
|
|
156
|
-
const scrollElementIntoView = t8;
|
|
157
|
-
let t10;
|
|
158
|
-
let t9;
|
|
159
|
-
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
160
|
-
t9 = () => () => {
|
|
161
|
-
if (pendingScrollRef.current !== null) {
|
|
162
|
-
cancelAnimationFrame(pendingScrollRef.current);
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
t10 = [];
|
|
166
|
-
$[7] = t10;
|
|
167
|
-
$[8] = t9;
|
|
168
|
-
} else {
|
|
169
|
-
t10 = $[7];
|
|
170
|
-
t9 = $[8];
|
|
171
|
-
}
|
|
172
|
-
useEffect(t9, t10);
|
|
173
130
|
const expandedStateCache = React.useRef(null);
|
|
174
131
|
if (expandedStateCache.current === null) {
|
|
175
|
-
let
|
|
176
|
-
if ($[
|
|
177
|
-
|
|
178
|
-
$[
|
|
132
|
+
let t8;
|
|
133
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
134
|
+
t8 = new Map();
|
|
135
|
+
$[6] = t8;
|
|
179
136
|
} else {
|
|
180
|
-
|
|
137
|
+
t8 = $[6];
|
|
181
138
|
}
|
|
182
|
-
expandedStateCache.current =
|
|
139
|
+
expandedStateCache.current = t8;
|
|
183
140
|
}
|
|
184
|
-
let
|
|
185
|
-
if ($[
|
|
186
|
-
|
|
141
|
+
let t8;
|
|
142
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
143
|
+
t8 = {
|
|
187
144
|
announceUpdate,
|
|
188
|
-
expandedStateCache
|
|
189
|
-
scrollElementIntoView
|
|
145
|
+
expandedStateCache
|
|
190
146
|
};
|
|
191
|
-
$[
|
|
147
|
+
$[7] = t8;
|
|
192
148
|
} else {
|
|
193
|
-
|
|
149
|
+
t8 = $[7];
|
|
194
150
|
}
|
|
195
|
-
let
|
|
196
|
-
if ($[
|
|
197
|
-
|
|
151
|
+
let t9;
|
|
152
|
+
if ($[8] !== ariaLiveMessage) {
|
|
153
|
+
t9 = /*#__PURE__*/jsx(VisuallyHidden, {
|
|
198
154
|
children: /*#__PURE__*/jsx(AriaStatus, {
|
|
199
155
|
announceOnShow: true,
|
|
200
156
|
children: ariaLiveMessage
|
|
201
157
|
})
|
|
202
158
|
});
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
159
|
+
$[8] = ariaLiveMessage;
|
|
160
|
+
$[9] = t9;
|
|
205
161
|
} else {
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
const
|
|
209
|
-
let
|
|
210
|
-
if ($[
|
|
211
|
-
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
162
|
+
t9 = $[9];
|
|
163
|
+
}
|
|
164
|
+
const t10 = truncate || false;
|
|
165
|
+
let t11;
|
|
166
|
+
if ($[10] !== className) {
|
|
167
|
+
t11 = clsx(className, classes.TreeViewRootUlStyles);
|
|
168
|
+
$[10] = className;
|
|
169
|
+
$[11] = t11;
|
|
214
170
|
} else {
|
|
215
|
-
|
|
171
|
+
t11 = $[11];
|
|
216
172
|
}
|
|
217
|
-
let
|
|
218
|
-
if ($[
|
|
219
|
-
|
|
173
|
+
let t12;
|
|
174
|
+
if ($[12] !== ariaLabel || $[13] !== ariaLabelledby || $[14] !== children || $[15] !== flat || $[16] !== style || $[17] !== t10 || $[18] !== t11) {
|
|
175
|
+
t12 = /*#__PURE__*/jsx("ul", {
|
|
220
176
|
ref: containerRef,
|
|
221
177
|
role: "tree",
|
|
222
178
|
"aria-label": ariaLabel,
|
|
223
179
|
"aria-labelledby": ariaLabelledby,
|
|
224
180
|
"data-omit-spacer": flat,
|
|
225
|
-
"data-truncate-text":
|
|
181
|
+
"data-truncate-text": t10,
|
|
226
182
|
onMouseDown: onMouseDown,
|
|
227
|
-
className:
|
|
183
|
+
className: t11,
|
|
228
184
|
style: style,
|
|
229
185
|
children: children
|
|
230
186
|
});
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
187
|
+
$[12] = ariaLabel;
|
|
188
|
+
$[13] = ariaLabelledby;
|
|
189
|
+
$[14] = children;
|
|
190
|
+
$[15] = flat;
|
|
191
|
+
$[16] = style;
|
|
192
|
+
$[17] = t10;
|
|
193
|
+
$[18] = t11;
|
|
194
|
+
$[19] = t12;
|
|
239
195
|
} else {
|
|
240
|
-
|
|
196
|
+
t12 = $[19];
|
|
241
197
|
}
|
|
242
|
-
let
|
|
243
|
-
if ($[
|
|
244
|
-
|
|
245
|
-
value:
|
|
198
|
+
let t13;
|
|
199
|
+
if ($[20] !== t12 || $[21] !== t9) {
|
|
200
|
+
t13 = /*#__PURE__*/jsx(RootContext.Provider, {
|
|
201
|
+
value: t8,
|
|
246
202
|
children: /*#__PURE__*/jsxs(Fragment, {
|
|
247
|
-
children: [
|
|
203
|
+
children: [t9, t12]
|
|
248
204
|
})
|
|
249
205
|
});
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
206
|
+
$[20] = t12;
|
|
207
|
+
$[21] = t9;
|
|
208
|
+
$[22] = t13;
|
|
253
209
|
} else {
|
|
254
|
-
|
|
210
|
+
t13 = $[22];
|
|
255
211
|
}
|
|
256
|
-
return
|
|
212
|
+
return t13;
|
|
257
213
|
};
|
|
258
214
|
Root.displayName = 'TreeView';
|
|
259
215
|
|
|
@@ -280,8 +236,7 @@ const Item = /*#__PURE__*/React.forwardRef(({
|
|
|
280
236
|
trailingVisual: TrailingVisual
|
|
281
237
|
});
|
|
282
238
|
const {
|
|
283
|
-
expandedStateCache
|
|
284
|
-
scrollElementIntoView
|
|
239
|
+
expandedStateCache
|
|
285
240
|
} = React.useContext(RootContext);
|
|
286
241
|
const labelId = useId();
|
|
287
242
|
const leadingVisualId = useId();
|
|
@@ -402,9 +357,12 @@ const Item = /*#__PURE__*/React.forwardRef(({
|
|
|
402
357
|
"data-has-leading-action": slots.leadingAction ? true : undefined,
|
|
403
358
|
onKeyDown: handleKeyDown,
|
|
404
359
|
onFocus: event_1 => {
|
|
405
|
-
|
|
406
|
-
//
|
|
407
|
-
|
|
360
|
+
var _event_1$currentTarge;
|
|
361
|
+
// Scroll the first child into view when the item receives focus
|
|
362
|
+
(_event_1$currentTarge = event_1.currentTarget.firstElementChild) === null || _event_1$currentTarge === void 0 ? void 0 : _event_1$currentTarge.scrollIntoView({
|
|
363
|
+
block: 'nearest',
|
|
364
|
+
inline: 'nearest'
|
|
365
|
+
});
|
|
408
366
|
|
|
409
367
|
// Set the focused state
|
|
410
368
|
setIsFocused(true);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-UnderlineNav-ScrollContainer-kBvfS{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:auto;animation:prc-UnderlineNav-detect-overflow-6HuSH linear;scrollbar-color:var(--borderColor-muted,var(--color-border-muted)) transparent;scrollbar-gutter:stable;scrollbar-width:thin;animation-timeline:scroll(self inline);--UnderlineNav_icons-display:inline}.prc-UnderlineNav-ScrollContainer-kBvfS [data-component=icon]{display:var(--UnderlineNav_icons-display)}.prc-UnderlineNav-ScrollContainer-kBvfS[data-hide-icons=true]{animation:none;animation-timeline:none;--UnderlineNav_icons-display:none}@keyframes prc-UnderlineNav-detect-overflow-6HuSH{0%,to{--UnderlineNav_icons-display:none}}
|
|
2
|
+
/*# sourceMappingURL=UnderlineNav-4c80468c.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/UnderlineNav/UnderlineNav.module.css.js"],"names":[],"mappings":"AAAA,wCACE,eAAgB,CAChB,iBAAkB,CAClB,+BAAgC,CAOhC,uDAAiC,CALjC,8EAAqD,CACrD,uBAAwB,CAFxB,oBAAqB,CAOrB,sCAAuC,CAEvC,mCAgBF,CAdE,8DACE,yCACF,CAMA,8DACE,cAAe,CACf,uBAAwB,CAExB,iCACF,CAGF,kDACE,MAEE,iCACF,CACF","file":"UnderlineNav-4c80468c.css","sourcesContent":[".ScrollContainer {\n overflow-x: auto;\n overflow-y: hidden;\n -webkit-overflow-scrolling: auto;\n scrollbar-width: thin;\n scrollbar-color: var(--borderColor-muted) transparent;\n scrollbar-gutter: stable;\n\n /* Progressive enhancement: Detect overflow using scroll-based animations.\n This lets us calculate the icon visibility during SSR. */\n animation: detect-overflow linear;\n animation-timeline: scroll(self inline);\n\n --UnderlineNav_icons-display: inline;\n\n [data-component='icon'] {\n display: var(--UnderlineNav_icons-display);\n }\n\n /* Even on browsers that support scroll-driven animations, we still need to\n force icons to remain hidden with JS to avoid flickering as they cause/remove\n overflow. Once they are hidden once, they remain hidden for the life of the\n component. */\n &[data-hide-icons='true'] {\n animation: none;\n animation-timeline: none;\n\n --UnderlineNav_icons-display: none;\n }\n}\n\n@keyframes detect-overflow {\n 0%,\n 100% {\n --UnderlineNav_icons-display: none;\n }\n}\n"]}
|
|
@@ -15,7 +15,5 @@ export type UnderlineNavProps = {
|
|
|
15
15
|
*/
|
|
16
16
|
variant?: 'inset' | 'flush';
|
|
17
17
|
};
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const getValidChildren: (children: React.ReactNode) => React.ReactElement<any>[];
|
|
20
|
-
export declare const UnderlineNav: React.ForwardRefExoticComponent<UnderlineNavProps & React.RefAttributes<unknown>>;
|
|
18
|
+
export declare const UnderlineNav: React.ForwardRefExoticComponent<UnderlineNavProps & React.RefAttributes<HTMLElement>>;
|
|
21
19
|
//# sourceMappingURL=UnderlineNav.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgD,MAAM,OAAO,CAAA;AAOpE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;CAC5B,CAAA;AAOD,eAAO,MAAM,YAAY,uFA0ExB,CAAA"}
|