@primer/react 0.0.0-20260413220131 → 0.0.0-20260414013428
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 -24
- package/dist/ActionBar/ActionBar.js +3 -3
- package/dist/ActionList/{ActionList-e35e912e.css → ActionList-8b212f46.css} +2 -2
- package/dist/ActionList/ActionList-8b212f46.css.map +1 -0
- package/dist/ActionList/ActionList.module.css.js +1 -1
- package/dist/ActionList/Heading.js +17 -16
- package/dist/ActionMenu/ActionMenu-58362ca7.css +2 -0
- package/dist/ActionMenu/ActionMenu-58362ca7.css.map +1 -0
- package/dist/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/dist/ActionMenu/ActionMenu.js +5 -0
- package/dist/ActionMenu/ActionMenu.module.css.js +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay-759cef30.css +2 -0
- package/dist/AnchoredOverlay/AnchoredOverlay-759cef30.css.map +1 -0
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +45 -20
- package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +1 -1
- package/dist/Autocomplete/AutocompleteInput.js +3 -3
- package/dist/Autocomplete/AutocompleteOverlay.js +3 -3
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +58 -43
- package/dist/Button/ButtonBase.d.ts.map +1 -1
- package/dist/Button/ButtonBase.js +3 -4
- package/dist/DataTable/index.d.ts +8 -4
- package/dist/DataTable/index.d.ts.map +1 -1
- package/dist/DataTable/index.js +0 -1
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +4 -1
- package/dist/Heading/Heading.js +3 -3
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +3 -4
- package/dist/Overlay/Overlay-af89f3ff.css +2 -0
- package/dist/Overlay/Overlay-af89f3ff.css.map +1 -0
- package/dist/Overlay/Overlay.d.ts +1 -1
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +49 -27
- package/dist/Overlay/Overlay.module.css.js +1 -1
- package/dist/PageLayout/PageLayout.js +5 -5
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +6 -3
- package/dist/TextInputWithTokens/TextInputWithTokens.js +91 -90
- package/dist/Token/IssueLabelToken-ea9392ab.css +2 -0
- package/dist/Token/{IssueLabelToken-10cfada5.css.map → IssueLabelToken-ea9392ab.css.map} +1 -1
- package/dist/Token/IssueLabelToken.module.css.js +1 -1
- package/dist/Token/_TokenTextContainer-24678fbc.css +2 -0
- package/dist/Token/_TokenTextContainer-24678fbc.css.map +1 -0
- package/dist/Token/_TokenTextContainer.module.css.js +1 -1
- package/dist/deprecated/DialogV1/Dialog.js +10 -9
- package/dist/experimental/index.d.ts +0 -2
- package/dist/experimental/index.d.ts.map +1 -1
- package/dist/experimental/index.js +0 -1
- package/dist/hooks/useMergedRefs.d.ts +4 -4
- package/dist/hooks/useMergedRefs.js +4 -4
- package/generated/components.json +0 -91
- package/package.json +2 -3
- package/dist/ActionList/ActionList-e35e912e.css.map +0 -1
- package/dist/ActionMenu/ActionMenu-c4e2a589.css +0 -2
- package/dist/ActionMenu/ActionMenu-c4e2a589.css.map +0 -1
- package/dist/AnchoredOverlay/AnchoredOverlay-647c7065.css +0 -2
- package/dist/AnchoredOverlay/AnchoredOverlay-647c7065.css.map +0 -1
- package/dist/Card/Card-65d85331.css +0 -2
- package/dist/Card/Card-65d85331.css.map +0 -1
- package/dist/Card/Card.d.ts +0 -96
- package/dist/Card/Card.d.ts.map +0 -1
- package/dist/Card/Card.js +0 -485
- package/dist/Card/Card.module.css.js +0 -5
- package/dist/Card/index.d.ts +0 -31
- package/dist/Card/index.d.ts.map +0 -1
- package/dist/Card/index.js +0 -12
- package/dist/Overlay/Overlay-30b84506.css +0 -2
- package/dist/Overlay/Overlay-30b84506.css.map +0 -1
- package/dist/Token/IssueLabelToken-10cfada5.css +0 -2
- package/dist/Token/_TokenTextContainer-55ce2de3.css +0 -2
- package/dist/Token/_TokenTextContainer-55ce2de3.css.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext, useRef, useEffect, useCallback } from 'react';
|
|
2
2
|
import { AutocompleteContext } from './AutocompleteContext.js';
|
|
3
|
-
import {
|
|
3
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
4
4
|
import VisuallyHidden from '../_VisuallyHidden.js';
|
|
5
5
|
import classes from './AutocompleteOverlay.module.css.js';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
@@ -48,7 +48,7 @@ function AutocompleteOverlay({
|
|
|
48
48
|
align: 'start',
|
|
49
49
|
anchorElementRef: computedAnchorRef
|
|
50
50
|
}, [showMenu, selectedItemLength]);
|
|
51
|
-
|
|
51
|
+
const mergedRef = useMergedRefs(scrollContainerRef, floatingElementRef);
|
|
52
52
|
const closeOptionList = useCallback(() => {
|
|
53
53
|
setShowMenu(false);
|
|
54
54
|
}, [setShowMenu]);
|
|
@@ -60,7 +60,7 @@ function AutocompleteOverlay({
|
|
|
60
60
|
preventFocusOnOpen: true,
|
|
61
61
|
onClickOutside: closeOptionList,
|
|
62
62
|
onEscape: closeOptionList,
|
|
63
|
-
ref:
|
|
63
|
+
ref: mergedRef,
|
|
64
64
|
top: position === null || position === void 0 ? void 0 : position.top,
|
|
65
65
|
left: position === null || position === void 0 ? void 0 : position.left,
|
|
66
66
|
className: clsx(classes.Overlay, className),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,SAAS,CAAA;AAC/B,OAAO,KA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S,KAAK,CAAC,WAAW;aANtB,EAAE;mBACI,OAAO;;aADb,EAAE;mBACI,OAAO;;;;CAgCuD,CAAA;AAE7E;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAA;AAE9C;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,IAAI,oBAAoB,CAAC,EAAE,CAAC,CAAA"}
|
|
@@ -10,6 +10,7 @@ import { useOnEscapePress } from '../hooks/useOnEscapePress.js';
|
|
|
10
10
|
import { useOnOutsideClick } from '../hooks/useOnOutsideClick.js';
|
|
11
11
|
import { fixedForwardRef } from '../utils/modern-polymorphic.js';
|
|
12
12
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
|
+
import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
|
|
13
14
|
import Details from '../Details/Details.js';
|
|
14
15
|
|
|
15
16
|
const BreadcrumbsList = t0 => {
|
|
@@ -212,6 +213,11 @@ function Breadcrumbs({
|
|
|
212
213
|
overflow = 'wrap',
|
|
213
214
|
variant = 'normal'
|
|
214
215
|
}) {
|
|
216
|
+
const overflowMenuEnabled = useFeatureFlag('primer_react_breadcrumbs_overflow_menu');
|
|
217
|
+
const wrappedChildren = React.Children.map(children, child => /*#__PURE__*/jsx("li", {
|
|
218
|
+
className: classes.ItemWrapper,
|
|
219
|
+
children: child
|
|
220
|
+
}));
|
|
215
221
|
const containerRef = useRef(null);
|
|
216
222
|
const measureMenuButton = useCallback(element => {
|
|
217
223
|
if (element) {
|
|
@@ -240,13 +246,13 @@ function Breadcrumbs({
|
|
|
240
246
|
useEffect(() => {
|
|
241
247
|
var _containerRef$current;
|
|
242
248
|
const listElement = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.querySelector('ol');
|
|
243
|
-
if (listElement && listElement.children.length > 0 && listElement.children.length === childArray.length) {
|
|
249
|
+
if (overflowMenuEnabled && listElement && listElement.children.length > 0 && listElement.children.length === childArray.length) {
|
|
244
250
|
const listElementArray = Array.from(listElement.children);
|
|
245
|
-
const widths = listElementArray.map(
|
|
251
|
+
const widths = listElementArray.map(child_0 => child_0.offsetWidth);
|
|
246
252
|
setChildArrayWidths(widths);
|
|
247
253
|
setRootItemWidth(listElementArray[0].offsetWidth);
|
|
248
254
|
}
|
|
249
|
-
}, [childArray]);
|
|
255
|
+
}, [childArray, overflowMenuEnabled]);
|
|
250
256
|
const calculateOverflow = useCallback(availableWidth => {
|
|
251
257
|
let eHideRoot = effectiveHideRoot;
|
|
252
258
|
const MENU_BUTTON_WIDTH = menuButtonWidth;
|
|
@@ -291,7 +297,7 @@ function Breadcrumbs({
|
|
|
291
297
|
};
|
|
292
298
|
}, [childArray, childArrayWidths, effectiveHideRoot, hideRoot, overflow, rootItemWidth, menuButtonWidth]);
|
|
293
299
|
const handleResize = useCallback(entries => {
|
|
294
|
-
if (entries[0]) {
|
|
300
|
+
if (overflowMenuEnabled && entries[0]) {
|
|
295
301
|
const containerWidth = entries[0].contentRect.width;
|
|
296
302
|
const result = calculateOverflow(containerWidth);
|
|
297
303
|
if (visibleItems.length !== result.visibleItems.length && menuItems.length !== result.menuItems.length || result.effectiveHideRoot !== effectiveHideRoot) {
|
|
@@ -300,10 +306,10 @@ function Breadcrumbs({
|
|
|
300
306
|
setEffectiveHideRoot(result.effectiveHideRoot);
|
|
301
307
|
}
|
|
302
308
|
}
|
|
303
|
-
}, [calculateOverflow, effectiveHideRoot, menuItems.length, visibleItems.length]);
|
|
309
|
+
}, [calculateOverflow, effectiveHideRoot, menuItems.length, overflowMenuEnabled, visibleItems.length]);
|
|
304
310
|
useResizeObserver(handleResize, containerRef);
|
|
305
311
|
useEffect(() => {
|
|
306
|
-
if ((overflow === 'menu' || overflow === 'menu-with-root') && childArray.length > 5 && menuItems.length === 0) {
|
|
312
|
+
if (overflowMenuEnabled && (overflow === 'menu' || overflow === 'menu-with-root') && childArray.length > 5 && menuItems.length === 0) {
|
|
307
313
|
var _containerRef$current2;
|
|
308
314
|
const containerWidth_0 = ((_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.offsetWidth) || 800;
|
|
309
315
|
const result_0 = calculateOverflow(containerWidth_0);
|
|
@@ -311,44 +317,46 @@ function Breadcrumbs({
|
|
|
311
317
|
setMenuItems(result_0.menuItems);
|
|
312
318
|
setEffectiveHideRoot(result_0.effectiveHideRoot);
|
|
313
319
|
}
|
|
314
|
-
}, [overflow, childArray, calculateOverflow, menuItems.length]);
|
|
320
|
+
}, [overflow, childArray, calculateOverflow, menuItems.length, overflowMenuEnabled]);
|
|
315
321
|
const finalChildren = React.useMemo(() => {
|
|
316
|
-
if (
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
322
|
+
if (overflowMenuEnabled) {
|
|
323
|
+
if (overflow === 'wrap' || menuItems.length === 0) {
|
|
324
|
+
return React.Children.map(children, child_1 => /*#__PURE__*/jsx("li", {
|
|
325
|
+
className: classes.ItemWrapper,
|
|
326
|
+
children: child_1
|
|
327
|
+
}));
|
|
328
|
+
}
|
|
329
|
+
let effectiveMenuItems = [...menuItems];
|
|
330
|
+
// In 'menu-with-root' mode, include the root item inside the menu even if it's visible in the breadcrumbs
|
|
331
|
+
if (!effectiveHideRoot) {
|
|
332
|
+
effectiveMenuItems = [...menuItems.slice(1)];
|
|
333
|
+
}
|
|
334
|
+
const menuElement = /*#__PURE__*/jsxs("li", {
|
|
335
|
+
className: classes.BreadcrumbsItem,
|
|
336
|
+
children: [/*#__PURE__*/jsx(BreadcrumbsMenuItem, {
|
|
337
|
+
ref: measureMenuButton,
|
|
338
|
+
items: effectiveMenuItems,
|
|
339
|
+
"aria-label": `${effectiveMenuItems.length} more breadcrumb items`
|
|
340
|
+
}), /*#__PURE__*/jsx(ItemSeparator, {})]
|
|
341
|
+
}, "breadcrumbs-menu");
|
|
342
|
+
const visibleElements = visibleItems.map((child_2, index) => /*#__PURE__*/jsxs("li", {
|
|
343
|
+
className: classes.BreadcrumbsItem,
|
|
344
|
+
children: [child_2, /*#__PURE__*/jsx(ItemSeparator, {})]
|
|
345
|
+
}, `visible + ${index}`));
|
|
346
|
+
const rootElement = /*#__PURE__*/jsxs("li", {
|
|
347
|
+
className: classes.BreadcrumbsItem,
|
|
348
|
+
children: [rootItem, /*#__PURE__*/jsx(ItemSeparator, {})]
|
|
349
|
+
}, `rootElement`);
|
|
350
|
+
if (effectiveHideRoot) {
|
|
351
|
+
// Show: [overflow menu, leaf breadcrumb]
|
|
352
|
+
return [menuElement, ...visibleElements];
|
|
353
|
+
} else {
|
|
354
|
+
// Show: [root breadcrumb, overflow menu, leaf breadcrumb]
|
|
355
|
+
return [rootElement, menuElement, ...visibleElements];
|
|
356
|
+
}
|
|
349
357
|
}
|
|
350
|
-
}, [overflow, menuItems, effectiveHideRoot, measureMenuButton, visibleItems, rootItem, children]);
|
|
351
|
-
return /*#__PURE__*/jsx("nav", {
|
|
358
|
+
}, [overflowMenuEnabled, overflow, menuItems, effectiveHideRoot, measureMenuButton, visibleItems, rootItem, children]);
|
|
359
|
+
return overflowMenuEnabled ? /*#__PURE__*/jsx("nav", {
|
|
352
360
|
className: clsx(className, classes.BreadcrumbsBase),
|
|
353
361
|
"aria-label": "Breadcrumbs",
|
|
354
362
|
style: style,
|
|
@@ -358,9 +366,16 @@ function Breadcrumbs({
|
|
|
358
366
|
children: /*#__PURE__*/jsx(BreadcrumbsList, {
|
|
359
367
|
children: finalChildren
|
|
360
368
|
})
|
|
369
|
+
}) : /*#__PURE__*/jsx("nav", {
|
|
370
|
+
className: clsx(className, classes.BreadcrumbsBase),
|
|
371
|
+
"aria-label": "Breadcrumbs",
|
|
372
|
+
style: style,
|
|
373
|
+
"data-variant": variant,
|
|
374
|
+
children: /*#__PURE__*/jsx(BreadcrumbsList, {
|
|
375
|
+
children: wrappedChildren
|
|
376
|
+
})
|
|
361
377
|
});
|
|
362
378
|
}
|
|
363
|
-
Breadcrumbs.displayName = "Breadcrumbs";
|
|
364
379
|
const ItemSeparator = () => {
|
|
365
380
|
const $ = c(1);
|
|
366
381
|
let t0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../src/Button/ButtonBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAC/F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AA2BxC,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../src/Button/ButtonBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAC/F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AA2BxC,QAAA,MAAM,UAAU,EA0JV,8BAA8B,CAAC,QAAQ,GAAG,GAAG,EAAE,WAAW,CAAC,CAAA;AAEjE,OAAO,EAAC,UAAU,EAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
3
3
|
import { ConditionalWrapper } from '../internal/components/ConditionalWrapper.js';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import classes from './ButtonBase.module.css.js';
|
|
@@ -46,7 +46,7 @@ const ButtonBase = /*#__PURE__*/forwardRef(({
|
|
|
46
46
|
...rest
|
|
47
47
|
} = props;
|
|
48
48
|
const innerRef = React.useRef(null);
|
|
49
|
-
|
|
49
|
+
const combinedRefs = useMergedRefs(forwardedRef, innerRef);
|
|
50
50
|
const uuid = useId(id);
|
|
51
51
|
const loadingAnnouncementID = `${uuid}-loading-announcement`;
|
|
52
52
|
|
|
@@ -74,8 +74,7 @@ const ButtonBase = /*#__PURE__*/forwardRef(({
|
|
|
74
74
|
children: [/*#__PURE__*/jsx(Component, {
|
|
75
75
|
"aria-disabled": loading ? true : undefined,
|
|
76
76
|
...rest,
|
|
77
|
-
|
|
78
|
-
ref: innerRef,
|
|
77
|
+
ref: combinedRefs,
|
|
79
78
|
className: clsx(classes.ButtonBase, className),
|
|
80
79
|
"data-block": block ? 'block' : null,
|
|
81
80
|
"data-inactive": inactive ? true : undefined,
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { DataTable } from './DataTable';
|
|
2
2
|
import { ErrorDialog } from './ErrorDialog';
|
|
3
|
-
import {
|
|
3
|
+
import { TableHead, TableBody, TableRow, TableHeader, TableCell, TableCellPlaceholder, TableContainer, TableSubtitle, TableActions, TableDivider, TableSkeleton } from './Table';
|
|
4
4
|
import { Pagination } from './Pagination';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
declare const Table: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "ref"> & {
|
|
6
|
+
'aria-describedby'?: string;
|
|
7
|
+
'aria-labelledby'?: string;
|
|
8
|
+
gridTemplateColumns?: React.CSSProperties["gridTemplateColumns"];
|
|
9
|
+
cellPadding?: "condensed" | "normal" | "spacious";
|
|
10
|
+
} & import("react").RefAttributes<HTMLTableElement>> & {
|
|
7
11
|
Container: typeof TableContainer;
|
|
8
|
-
Title:
|
|
12
|
+
Title: import("react").ForwardRefExoticComponent<Omit<import("./Table").TableTitleProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
9
13
|
Subtitle: typeof TableSubtitle;
|
|
10
14
|
Actions: typeof TableActions;
|
|
11
15
|
Divider: typeof TableDivider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DataTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AACzC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DataTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AACzC,OAAO,EAEL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,WAAW,EACX,SAAS,EACT,oBAAoB,EACpB,cAAc,EAEd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,aAAa,EACd,MAAM,SAAS,CAAA;AAChB,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AAEvC,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;CAeT,CAAA;AAEF,OAAO,EAAC,SAAS,EAAE,KAAK,EAAC,CAAA;AACzB,YAAY,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;AAC/C,YAAY,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAC,kBAAkB,EAAC,MAAM,UAAU,CAAA;AAC3C,YAAY,EAAC,MAAM,EAAE,aAAa,EAAE,WAAW,EAAC,MAAM,UAAU,CAAA;AAChE,YAAY,EAAC,SAAS,EAAC,MAAM,OAAO,CAAA;AACpC,YAAY,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA"}
|
package/dist/DataTable/index.js
CHANGED
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -6,7 +6,7 @@ import { XIcon } from '@primer/octicons-react';
|
|
|
6
6
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
7
7
|
import { FocusKeys } from '@primer/behaviors';
|
|
8
8
|
import { Portal } from '../Portal/Portal.js';
|
|
9
|
-
import {
|
|
9
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
10
10
|
import { useId } from '../hooks/useId.js';
|
|
11
11
|
import classes from './Dialog.module.css.js';
|
|
12
12
|
import { clsx } from 'clsx';
|
|
@@ -131,7 +131,7 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
131
131
|
footer: Dialog.Footer
|
|
132
132
|
});
|
|
133
133
|
const dialogRef = useRef(null);
|
|
134
|
-
|
|
134
|
+
const mergedRef = useMergedRefs(forwardedRef, dialogRef);
|
|
135
135
|
const backdropRef = useRef(null);
|
|
136
136
|
useFocusTrap({
|
|
137
137
|
containerRef: dialogRef,
|
|
@@ -205,7 +205,7 @@ const _Dialog = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
205
205
|
setLastMouseDownIsBackdrop(e.target === e.currentTarget);
|
|
206
206
|
},
|
|
207
207
|
children: /*#__PURE__*/jsxs("div", {
|
|
208
|
-
ref:
|
|
208
|
+
ref: mergedRef,
|
|
209
209
|
role: role,
|
|
210
210
|
"aria-labelledby": dialogLabelId,
|
|
211
211
|
"aria-describedby": dialogDescriptionId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultFeatureFlags.d.ts","sourceRoot":"","sources":["../../src/FeatureFlags/DefaultFeatureFlags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAEnD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"DefaultFeatureFlags.d.ts","sourceRoot":"","sources":["../../src/FeatureFlags/DefaultFeatureFlags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAEnD,eAAO,MAAM,mBAAmB,kBAQ9B,CAAA"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { FeatureFlagScope } from './FeatureFlagScope.js';
|
|
2
2
|
|
|
3
3
|
const DefaultFeatureFlags = FeatureFlagScope.create({
|
|
4
|
+
primer_react_breadcrumbs_overflow_menu: false,
|
|
4
5
|
primer_react_css_anchor_positioning: false,
|
|
5
6
|
primer_react_select_panel_fullscreen_on_narrow: false,
|
|
6
7
|
primer_react_select_panel_order_selected_at_top: false,
|
|
7
|
-
primer_react_select_panel_remove_active_descendant: false
|
|
8
|
+
primer_react_select_panel_remove_active_descendant: false,
|
|
9
|
+
primer_react_spinner_synchronize_animations: false,
|
|
10
|
+
primer_react_overlay_max_height_clamp_to_viewport: false
|
|
8
11
|
});
|
|
9
12
|
|
|
10
13
|
export { DefaultFeatureFlags };
|
package/dist/Heading/Heading.js
CHANGED
|
@@ -2,7 +2,7 @@ import { clsx } from 'clsx';
|
|
|
2
2
|
import React, { forwardRef, useEffect } from 'react';
|
|
3
3
|
import classes from './Heading.module.css.js';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
import {
|
|
5
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
6
6
|
|
|
7
7
|
const Heading = /*#__PURE__*/forwardRef(({
|
|
8
8
|
as: Component = 'h2',
|
|
@@ -11,7 +11,7 @@ const Heading = /*#__PURE__*/forwardRef(({
|
|
|
11
11
|
...props
|
|
12
12
|
}, forwardedRef) => {
|
|
13
13
|
const innerRef = React.useRef(null);
|
|
14
|
-
|
|
14
|
+
const mergedRef = useMergedRefs(forwardedRef, innerRef);
|
|
15
15
|
if (process.env.NODE_ENV !== "production") {
|
|
16
16
|
/**
|
|
17
17
|
* The Linter yells because it thinks this conditionally calls an effect,
|
|
@@ -31,7 +31,7 @@ const Heading = /*#__PURE__*/forwardRef(({
|
|
|
31
31
|
className: clsx(className, classes.Heading),
|
|
32
32
|
"data-variant": variant,
|
|
33
33
|
...props,
|
|
34
|
-
ref:
|
|
34
|
+
ref: mergedRef
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
Heading.displayName = 'Heading';
|
package/dist/Link/Link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/Link/Link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAY,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAA;AAG1E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAC,KAAK,gBAAgB,EAAkB,MAAM,6BAA6B,CAAA;AAElF,KAAK,eAAe,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,IAAI;IACzD,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,EAC9D,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,eAAe,CAAC,EACjD,KAAK,YAAY,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/Link/Link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAY,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAA;AAG1E,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAC,KAAK,gBAAgB,EAAkB,MAAM,6BAA6B,CAAA;AAElF,KAAK,eAAe,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,IAAI;IACzD,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,EAC9D,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,eAAe,CAAC,EACjD,KAAK,YAAY,CAAC,OAAO,CAAC,sBAwC3B,CAAA;AAID,QAAA,MAAM,IAAI,IA9CoB,EAAE,SAAS,KAAK,CAAC,WAAW;;;;CA8CM,CAAA;AAEhE,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,IAAI,CAAC,CAAA;AACnD,eAAe,IAAI,CAAA"}
|
package/dist/Link/Link.js
CHANGED
|
@@ -3,7 +3,7 @@ import React, { useEffect } from 'react';
|
|
|
3
3
|
import classes from './Link.module.css.js';
|
|
4
4
|
import { fixedForwardRef } from '../utils/modern-polymorphic.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
import {
|
|
6
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
7
7
|
|
|
8
8
|
const UnwrappedLink = (props, ref) => {
|
|
9
9
|
const {
|
|
@@ -15,7 +15,7 @@ const UnwrappedLink = (props, ref) => {
|
|
|
15
15
|
...restProps
|
|
16
16
|
} = props;
|
|
17
17
|
const innerRef = React.useRef(null);
|
|
18
|
-
|
|
18
|
+
const mergedRef = useMergedRefs(ref, innerRef);
|
|
19
19
|
if (process.env.NODE_ENV !== "production") {
|
|
20
20
|
/**
|
|
21
21
|
* The Linter yells because it thinks this conditionally calls an effect,
|
|
@@ -37,8 +37,7 @@ const UnwrappedLink = (props, ref) => {
|
|
|
37
37
|
"data-inline": inline,
|
|
38
38
|
"data-hover-color": hoverColor,
|
|
39
39
|
...restProps,
|
|
40
|
-
|
|
41
|
-
ref: innerRef
|
|
40
|
+
ref: mergedRef
|
|
42
41
|
});
|
|
43
42
|
};
|
|
44
43
|
UnwrappedLink.displayName = "UnwrappedLink";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
@keyframes prc-Overlay-overlay-appear-JpFey{0%{opacity:0}to{opacity:1}}.prc-Overlay-Overlay-jfs-T{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border-radius:var(--borderRadius-large,.75rem);box-shadow:var(--shadow-floating-small,var(--color-overlay-shadow));height:auto;max-height:100vh;max-width:calc(100vw - 2rem);min-width:192px;overflow:auto;position:absolute;width:auto}.prc-Overlay-Overlay-jfs-T:not([data-anchor-position]):not([data-variant=modal]),.prc-Overlay-Overlay-jfs-T[data-anchor-position=false]{bottom:var(--bottom,auto);right:var(--right,auto)}@media screen and (max-width:calc(48rem - 0.02px)){[data-responsive=fullscreen]:is(.prc-Overlay-Overlay-jfs-T[data-anchor-position=false],.prc-Overlay-Overlay-jfs-T:not([data-anchor-position]):not([data-variant=modal])):not([data-variant]){left:0;top:0}}:is(.prc-Overlay-Overlay-jfs-T[data-anchor-position=false],.prc-Overlay-Overlay-jfs-T:not([data-anchor-position]):not([data-variant=modal])):not([data-variant]){left:var(--left,auto);top:var(--top,auto)}.prc-Overlay-Overlay-jfs-T:focus{outline:none}@media (forced-colors:active){.prc-Overlay-Overlay-jfs-T{outline:1px solid transparent}}.prc-Overlay-Overlay-jfs-T:where([data-reflow-container=true]){max-width:calc(100vw - 2rem)}.prc-Overlay-Overlay-jfs-T:where([data-overflow-auto]){overflow:auto}.prc-Overlay-Overlay-jfs-T:where([data-overflow-hidden]){overflow:hidden}.prc-Overlay-Overlay-jfs-T:where([data-overflow-scroll]){overflow:scroll}.prc-Overlay-Overlay-jfs-T:where([data-overflow-visible]){overflow:visible}.prc-Overlay-Overlay-jfs-T:where([data-height-xsmall]){height:192px}.prc-Overlay-Overlay-jfs-T:where([data-height-small]){height:256px}.prc-Overlay-Overlay-jfs-T:where([data-height-medium]){height:320px}.prc-Overlay-Overlay-jfs-T:where([data-height-large]){height:432px}.prc-Overlay-Overlay-jfs-T:where([data-height-xlarge]){height:600px}.prc-Overlay-Overlay-jfs-T:where([data-height-auto]),.prc-Overlay-Overlay-jfs-T:where([data-height-initial]){height:auto}.prc-Overlay-Overlay-jfs-T:where([data-height-fit-content]){height:-moz-fit-content;height:fit-content}.prc-Overlay-Overlay-jfs-T:where([data-max-height-xsmall]){max-height:192px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-small]){max-height:256px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-medium]){max-height:320px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-large]){max-height:432px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-xlarge]){max-height:600px}.prc-Overlay-Overlay-jfs-T:where([data-max-height-clamp-to-viewport][data-max-height-xsmall]){max-height:min(192px,100dvh)}.prc-Overlay-Overlay-jfs-T:where([data-max-height-clamp-to-viewport][data-max-height-small]){max-height:min(256px,100dvh)}.prc-Overlay-Overlay-jfs-T:where([data-max-height-clamp-to-viewport][data-max-height-medium]){max-height:min(320px,100dvh)}.prc-Overlay-Overlay-jfs-T:where([data-max-height-clamp-to-viewport][data-max-height-large]){max-height:min(432px,100dvh)}.prc-Overlay-Overlay-jfs-T:where([data-max-height-clamp-to-viewport][data-max-height-xlarge]){max-height:min(600px,100dvh)}.prc-Overlay-Overlay-jfs-T:where([data-max-height-fit-content]){max-height:-moz-fit-content;max-height:fit-content}.prc-Overlay-Overlay-jfs-T:where([data-width-small]){width:256px}.prc-Overlay-Overlay-jfs-T:where([data-width-medium]){width:320px}.prc-Overlay-Overlay-jfs-T:where([data-width-large]){width:480px}.prc-Overlay-Overlay-jfs-T:where([data-width-xlarge]){width:640px}.prc-Overlay-Overlay-jfs-T:where([data-width-xxlarge]){width:960px}.prc-Overlay-Overlay-jfs-T:where([data-width-auto]){width:auto}.prc-Overlay-Overlay-jfs-T:where([data-max-width-small]){max-width:256px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-medium]){max-width:320px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-large]){max-width:480px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-xlarge]){max-width:640px}.prc-Overlay-Overlay-jfs-T:where([data-max-width-xxlarge]){max-width:960px}.prc-Overlay-Overlay-jfs-T:where([data-visibility-visible]){visibility:visible}.prc-Overlay-Overlay-jfs-T:where([data-visibility-hidden]){visibility:hidden}@media screen and (max-width:calc(48rem - 0.02px)){.prc-Overlay-Overlay-jfs-T:where([data-responsive=fullscreen]),.prc-Overlay-Overlay-jfs-T[data-responsive=fullscreen][data-anchor-position]{border-radius:unset;height:100vh;left:0;margin:0;max-height:none;max-width:none;padding-bottom:env(safe-area-inset-bottom);position:fixed;top:0;width:100vw}@supports (height:100dvh){.prc-Overlay-Overlay-jfs-T:where([data-responsive=fullscreen]),.prc-Overlay-Overlay-jfs-T[data-responsive=fullscreen][data-anchor-position]{height:100dvh}}}@supports (height:100dvh){.prc-Overlay-Overlay-jfs-T:where([data-variant=fullscreen]){height:100dvh}}@media (prefers-reduced-motion:no-preference){.prc-Overlay-Overlay-jfs-T{animation:prc-Overlay-overlay-appear-JpFey .2s cubic-bezier(.33,1,.68,1)}}
|
|
2
|
+
/*# sourceMappingURL=Overlay-af89f3ff.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Overlay/Overlay.module.css.js"],"names":[],"mappings":"AAAA,4CACE,GACE,SACF,CAEA,GACE,SACF,CACF,CAEA,2BAQE,mEAAwC,CACxC,8CAAwC,CACxC,mEAAwC,CALxC,WAAY,CACZ,gBAAiB,CAJjB,4BAA6B,CAE7B,eAAgB,CAGhB,aAAc,CANd,iBAAkB,CAElB,UA0NF,CAjNE,wIAKE,yBAA2B,CAF3B,uBAkBF,CAZI,mDADF,6LAGI,MAAO,CADP,KAGJ,CADE,CAGF,iKAIE,qBAAuB,CAFvB,mBAGF,CAGF,iCACE,YACF,CAEA,8BAvCF,2BAyCI,6BAoLJ,CAnLE,CAEA,+DACE,4BACF,CAEA,uDACE,aACF,CAEA,yDACE,eACF,CAEA,yDACE,eACF,CAEA,0DACE,gBACF,CAEA,uDACE,YACF,CAEA,sDACE,YACF,CAEA,uDACE,YACF,CAEA,sDACE,YACF,CAEA,uDACE,YACF,CAEA,6GAEE,WACF,CAEA,4DACE,uBAAmB,CAAnB,kBACF,CAEA,2DACE,gBACF,CAEA,0DACE,gBACF,CAEA,2DACE,gBACF,CAEA,0DACE,gBACF,CAEA,2DACE,gBACF,CAGA,8FACE,4BACF,CAEA,6FACE,4BACF,CAEA,8FACE,4BACF,CAEA,6FACE,4BACF,CAEA,8FACE,4BACF,CAEA,gEACE,2BAAuB,CAAvB,sBACF,CAEA,qDACE,WACF,CAEA,sDACE,WACF,CAEA,qDAEE,WACF,CAEA,sDAEE,WACF,CAEA,uDAEE,WACF,CAEA,oDACE,UACF,CAEA,yDACE,eACF,CAEA,0DACE,eACF,CAEA,yDACE,eACF,CAEA,0DACE,eACF,CAEA,2DACE,eACF,CAEA,4DACE,kBACF,CAEA,2DACE,iBACF,CAIE,mDAFF,4IAWI,mBAAoB,CAHpB,YAAa,CAHb,MAAO,CAKP,QAAS,CADT,eAAgB,CAFhB,cAAe,CAMf,0CAA2C,CAV3C,cAAe,CACf,KAAM,CAEN,WAcJ,CALI,0BAfJ,4IAiBM,aAGN,CAFI,CACF,CAGF,0BAEE,4DACE,aACF,CACF,CAGF,8CACE,2BACE,wEACF,CACF","file":"Overlay-af89f3ff.css","sourcesContent":["@keyframes overlay-appear {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.Overlay {\n position: absolute;\n max-width: calc(100vw - 2rem);\n width: auto;\n min-width: 192px;\n height: auto;\n max-height: 100vh;\n overflow: auto;\n background-color: var(--overlay-bgColor);\n border-radius: var(--borderRadius-large);\n box-shadow: var(--shadow-floating-small);\n\n &[data-anchor-position='false'],\n &:not([data-anchor-position]):not([data-variant='modal']) {\n /* stylelint-disable-next-line primer/spacing */\n right: var(--right, auto);\n /* stylelint-disable-next-line primer/spacing */\n bottom: var(--bottom, auto);\n\n /* stylelint-disable-next-line selector-max-specificity */\n &[data-responsive='fullscreen']:not([data-variant]) {\n @media screen and (--viewportRange-narrow) {\n top: 0;\n left: 0;\n }\n }\n\n &:not([data-variant]) {\n /* stylelint-disable-next-line primer/spacing */\n top: var(--top, auto);\n /* stylelint-disable-next-line primer/spacing */\n left: var(--left, auto);\n }\n }\n\n &:focus {\n outline: none;\n }\n\n @media (forced-colors: active) {\n /* Support for Windows high contrast https://sarahmhigley.com/writing/whcm-quick-tips */\n outline: solid 1px transparent;\n }\n\n &:where([data-reflow-container='true']) {\n max-width: calc(100vw - 2rem);\n }\n\n &:where([data-overflow-auto]) {\n overflow: auto;\n }\n\n &:where([data-overflow-hidden]) {\n overflow: hidden;\n }\n\n &:where([data-overflow-scroll]) {\n overflow: scroll;\n }\n\n &:where([data-overflow-visible]) {\n overflow: visible;\n }\n\n &:where([data-height-xsmall]) {\n height: 192px;\n }\n\n &:where([data-height-small]) {\n height: 256px;\n }\n\n &:where([data-height-medium]) {\n height: 320px;\n }\n\n &:where([data-height-large]) {\n height: 432px;\n }\n\n &:where([data-height-xlarge]) {\n height: 600px;\n }\n\n &:where([data-height-auto]),\n &:where([data-height-initial]) {\n height: auto;\n }\n\n &:where([data-height-fit-content]) {\n height: fit-content;\n }\n\n &:where([data-max-height-xsmall]) {\n max-height: 192px;\n }\n\n &:where([data-max-height-small]) {\n max-height: 256px;\n }\n\n &:where([data-max-height-medium]) {\n max-height: 320px;\n }\n\n &:where([data-max-height-large]) {\n max-height: 432px;\n }\n\n &:where([data-max-height-xlarge]) {\n max-height: 600px;\n }\n\n /* Max-height size tokens clamped to viewport (enabled via feature flag) */\n &:where([data-max-height-clamp-to-viewport][data-max-height-xsmall]) {\n max-height: min(192px, 100dvh);\n }\n\n &:where([data-max-height-clamp-to-viewport][data-max-height-small]) {\n max-height: min(256px, 100dvh);\n }\n\n &:where([data-max-height-clamp-to-viewport][data-max-height-medium]) {\n max-height: min(320px, 100dvh);\n }\n\n &:where([data-max-height-clamp-to-viewport][data-max-height-large]) {\n max-height: min(432px, 100dvh);\n }\n\n &:where([data-max-height-clamp-to-viewport][data-max-height-xlarge]) {\n max-height: min(600px, 100dvh);\n }\n\n &:where([data-max-height-fit-content]) {\n max-height: fit-content;\n }\n\n &:where([data-width-small]) {\n width: 256px;\n }\n\n &:where([data-width-medium]) {\n width: 320px;\n }\n\n &:where([data-width-large]) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 480px;\n }\n\n &:where([data-width-xlarge]) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 640px;\n }\n\n &:where([data-width-xxlarge]) {\n /* stylelint-disable-next-line primer/responsive-widths */\n width: 960px;\n }\n\n &:where([data-width-auto]) {\n width: auto;\n }\n\n &:where([data-max-width-small]) {\n max-width: 256px;\n }\n\n &:where([data-max-width-medium]) {\n max-width: 320px;\n }\n\n &:where([data-max-width-large]) {\n max-width: 480px;\n }\n\n &:where([data-max-width-xlarge]) {\n max-width: 640px;\n }\n\n &:where([data-max-width-xxlarge]) {\n max-width: 960px;\n }\n\n &:where([data-visibility-visible]) {\n visibility: visible;\n }\n\n &:where([data-visibility-hidden]) {\n visibility: hidden;\n }\n\n &:where([data-responsive='fullscreen']),\n &[data-responsive='fullscreen'][data-anchor-position] {\n @media screen and (--viewportRange-narrow) {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n max-width: none;\n height: 100vh;\n max-height: none;\n margin: 0;\n border-radius: unset;\n /* stylelint-disable-next-line primer/spacing */\n padding-bottom: env(safe-area-inset-bottom);\n\n @supports (height: 100dvh) {\n /* fix for mobile safari (100vh clips the screen with the toolbar) */\n height: 100dvh;\n }\n }\n }\n\n @supports (height: 100dvh) {\n /* fix for mobile safari (100vh clips the screen with the toolbar) */\n &:where([data-variant='fullscreen']) {\n height: 100dvh;\n }\n }\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .Overlay {\n animation: overlay-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/Overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,qBAAqB,EAAe,MAAM,OAAO,CAAA;AAC9D,OAAO,KAA0B,MAAM,OAAO,CAAA;AAE9C,OAAO,KAAK,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAA;AAI/C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAK/F,KAAK,kBAAkB,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAA;IAC7B,MAAM,CAAC,EAAE,MAAM,OAAO,SAAS,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,QAAQ,EAAE,MAAM,CAAC,CAAA;IAC9C,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IACjC,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;IACnD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,SAAS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,EAAE,cAAc,CAAC,CAAA;AAElE;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,OAAO,EA+FR,8BAA8B,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAA;AAEhE,MAAM,MAAM,YAAY,GAAG,qBAAqB,CAAC,OAAO,OAAO,CAAC,CAAA;AAEhE,eAAe,OAAO,CAAA"}
|
package/dist/Overlay/Overlay.js
CHANGED
|
@@ -2,7 +2,7 @@ import { c } from 'react-compiler-runtime';
|
|
|
2
2
|
import React, { useRef, useEffect } from 'react';
|
|
3
3
|
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
4
4
|
import { Portal } from '../Portal/Portal.js';
|
|
5
|
-
import {
|
|
5
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
6
6
|
import classes from './Overlay.module.css.js';
|
|
7
7
|
import { clsx } from 'clsx';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -20,6 +20,14 @@ const heightMap = {
|
|
|
20
20
|
// Passing 'initial' initially applies 'auto'
|
|
21
21
|
'fit-content': 'fit-content'
|
|
22
22
|
};
|
|
23
|
+
const widthMap = {
|
|
24
|
+
small: '256px',
|
|
25
|
+
medium: '320px',
|
|
26
|
+
large: '480px',
|
|
27
|
+
xlarge: '640px',
|
|
28
|
+
xxlarge: '960px',
|
|
29
|
+
auto: 'auto'
|
|
30
|
+
};
|
|
23
31
|
const animationDuration = 200;
|
|
24
32
|
function getSlideAnimationStartingVector(anchorSide) {
|
|
25
33
|
if (anchorSide !== null && anchorSide !== void 0 && anchorSide.endsWith('bottom')) {
|
|
@@ -116,7 +124,7 @@ const BaseOverlay = /*#__PURE__*/React.forwardRef(({
|
|
|
116
124
|
|
|
117
125
|
*/
|
|
118
126
|
const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
119
|
-
const $ = c(
|
|
127
|
+
const $ = c(50);
|
|
120
128
|
let _PrivateDisablePortal;
|
|
121
129
|
let anchorSide;
|
|
122
130
|
let ignoreClickRefs;
|
|
@@ -200,8 +208,9 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
200
208
|
const role = t3 === undefined ? "none" : t3;
|
|
201
209
|
const visibility = t4 === undefined ? "visible" : t4;
|
|
202
210
|
const width = t5 === undefined ? "auto" : t5;
|
|
211
|
+
const featureFlagMaxHeightClampToViewport = useFeatureFlag("primer_react_overlay_max_height_clamp_to_viewport");
|
|
203
212
|
const overlayRef = useRef(null);
|
|
204
|
-
|
|
213
|
+
const mergedRef = useMergedRefs(forwardedRef, overlayRef);
|
|
205
214
|
const cssAnchorPositioning = useFeatureFlag("primer_react_css_anchor_positioning");
|
|
206
215
|
let t6;
|
|
207
216
|
if ($[19] !== ignoreClickRefs || $[20] !== initialFocusRef || $[21] !== onClickOutside || $[22] !== onEscape || $[23] !== preventFocusOnOpen || $[24] !== returnFocusRef) {
|
|
@@ -275,49 +284,62 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
|
|
|
275
284
|
const leftPosition = left === undefined && right === undefined ? 0 : left;
|
|
276
285
|
const t11 = !preventOverflow ? true : undefined;
|
|
277
286
|
let t12;
|
|
278
|
-
if ($[33] !==
|
|
279
|
-
t12 =
|
|
287
|
+
if ($[33] !== featureFlagMaxHeightClampToViewport) {
|
|
288
|
+
t12 = featureFlagMaxHeightClampToViewport ? {
|
|
289
|
+
"data-max-height-clamp-to-viewport": ""
|
|
290
|
+
} : {};
|
|
291
|
+
$[33] = featureFlagMaxHeightClampToViewport;
|
|
292
|
+
$[34] = t12;
|
|
293
|
+
} else {
|
|
294
|
+
t12 = $[34];
|
|
295
|
+
}
|
|
296
|
+
let t13;
|
|
297
|
+
if ($[35] !== height || $[36] !== leftPosition || $[37] !== mergedRef || $[38] !== props || $[39] !== responsiveVariant || $[40] !== right || $[41] !== role || $[42] !== t11 || $[43] !== t12 || $[44] !== visibility || $[45] !== width) {
|
|
298
|
+
t13 = /*#__PURE__*/jsx(BaseOverlay, {
|
|
280
299
|
role: role,
|
|
281
300
|
width: width,
|
|
282
301
|
"data-reflow-container": t11,
|
|
283
|
-
ref:
|
|
302
|
+
ref: mergedRef,
|
|
284
303
|
left: leftPosition,
|
|
285
304
|
right: right,
|
|
286
305
|
height: height,
|
|
287
306
|
visibility: visibility,
|
|
288
307
|
"data-responsive": responsiveVariant,
|
|
308
|
+
...t12,
|
|
289
309
|
...props
|
|
290
310
|
});
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
$[
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
311
|
+
$[35] = height;
|
|
312
|
+
$[36] = leftPosition;
|
|
313
|
+
$[37] = mergedRef;
|
|
314
|
+
$[38] = props;
|
|
315
|
+
$[39] = responsiveVariant;
|
|
316
|
+
$[40] = right;
|
|
317
|
+
$[41] = role;
|
|
318
|
+
$[42] = t11;
|
|
319
|
+
$[43] = t12;
|
|
320
|
+
$[44] = visibility;
|
|
321
|
+
$[45] = width;
|
|
322
|
+
$[46] = t13;
|
|
301
323
|
} else {
|
|
302
|
-
|
|
324
|
+
t13 = $[46];
|
|
303
325
|
}
|
|
304
|
-
const overlayContent =
|
|
326
|
+
const overlayContent = t13;
|
|
305
327
|
if (_PrivateDisablePortal && cssAnchorPositioning) {
|
|
306
328
|
return overlayContent;
|
|
307
329
|
}
|
|
308
|
-
let
|
|
309
|
-
if ($[
|
|
310
|
-
|
|
330
|
+
let t14;
|
|
331
|
+
if ($[47] !== overlayContent || $[48] !== portalContainerName) {
|
|
332
|
+
t14 = /*#__PURE__*/jsx(Portal, {
|
|
311
333
|
containerName: portalContainerName,
|
|
312
334
|
children: overlayContent
|
|
313
335
|
});
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
336
|
+
$[47] = overlayContent;
|
|
337
|
+
$[48] = portalContainerName;
|
|
338
|
+
$[49] = t14;
|
|
317
339
|
} else {
|
|
318
|
-
|
|
340
|
+
t14 = $[49];
|
|
319
341
|
}
|
|
320
|
-
return
|
|
342
|
+
return t14;
|
|
321
343
|
});
|
|
322
344
|
|
|
323
|
-
export { BaseOverlay, Overlay as default, heightMap };
|
|
345
|
+
export { BaseOverlay, Overlay as default, heightMap, widthMap };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useRef, memo } from 'react';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { useId } from '../hooks/useId.js';
|
|
4
|
-
import {
|
|
4
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
5
5
|
import { isResponsiveValue } from '../hooks/useResponsiveValue.js';
|
|
6
6
|
import { useSlots } from '../hooks/useSlots.js';
|
|
7
7
|
import { useOverflow } from '../hooks/useOverflow.js';
|
|
@@ -581,7 +581,7 @@ const Pane = /*#__PURE__*/React.forwardRef(({
|
|
|
581
581
|
onResizeEnd,
|
|
582
582
|
currentWidth: controlledWidth
|
|
583
583
|
});
|
|
584
|
-
|
|
584
|
+
const mergedRef = useMergedRefs(forwardRef, paneRef);
|
|
585
585
|
const hasOverflow = useOverflow(paneRef);
|
|
586
586
|
const paneId = useId(id);
|
|
587
587
|
const labelProp = {};
|
|
@@ -615,7 +615,7 @@ const Pane = /*#__PURE__*/React.forwardRef(({
|
|
|
615
615
|
},
|
|
616
616
|
position: positionProp
|
|
617
617
|
}), /*#__PURE__*/jsx("div", {
|
|
618
|
-
ref:
|
|
618
|
+
ref: mergedRef
|
|
619
619
|
// Suppress hydration mismatch for --pane-width when localStorage
|
|
620
620
|
// provides a width that differs from the server-rendered default.
|
|
621
621
|
// Not needed when onResizeEnd is provided (localStorage isn't read).
|
|
@@ -785,7 +785,7 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
|
|
|
785
785
|
contentWrapperRef: sidebarContentWrapperRef,
|
|
786
786
|
constrainToViewport: true
|
|
787
787
|
});
|
|
788
|
-
|
|
788
|
+
const mergedRef = useMergedRefs(forwardRef, sidebarRef);
|
|
789
789
|
const hasOverflow = useOverflow(sidebarRef);
|
|
790
790
|
const sidebarId = useId(id);
|
|
791
791
|
const labelProp = {};
|
|
@@ -824,7 +824,7 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
|
|
|
824
824
|
getDefaultWidth: getDefaultWidth,
|
|
825
825
|
saveWidth: saveWidth
|
|
826
826
|
}), /*#__PURE__*/jsx("div", {
|
|
827
|
-
ref:
|
|
827
|
+
ref: mergedRef
|
|
828
828
|
// Suppress hydration mismatch for --pane-width when localStorage
|
|
829
829
|
// provides a width that differs from the server-rendered default.
|
|
830
830
|
,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/Spinner/Spinner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../src/Spinner/Spinner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAA;AAQlE,QAAA,MAAM,OAAO;;;;CAIZ,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,OAAO,OAAO,CAAA;IAC3B,0KAA0K;IAC1K,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,4MAA4M;IAC5M,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;CAC5C,GAAG,kBAAkB,CAAA;AAEtB,iBAAS,OAAO,CAAC,EACf,IAAI,EAAE,OAAkB,EACxB,MAAkB,EAClB,YAAY,EAAE,SAAS,EACvB,SAAS,EACT,KAAK,EACL,KAAa,EACb,GAAG,KAAK,EACT,EAAE,YAAY,4BAiEd;kBAzEQ,OAAO;;;AA0FhB,eAAe,OAAO,CAAA"}
|