@primer/react 0.0.0-20260715113945 → 0.0.0-20260715132248
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 +5 -5
- package/dist/ActionBar/ActionBar-e63def3c.css +2 -0
- package/dist/ActionBar/ActionBar-e63def3c.css.map +1 -0
- package/dist/ActionBar/ActionBar.module.css.js +1 -1
- package/dist/ActionList/Group.js +1 -1
- package/dist/ActionList/Item.js +1 -1
- package/dist/ActionList/List.js +1 -1
- package/dist/ActionMenu/ActionMenu.js +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +1 -2
- package/dist/Autocomplete/AutocompleteMenu.js +2 -3
- package/dist/Breadcrumbs/Breadcrumbs.js +1 -4
- package/dist/Dialog/Dialog.js +1 -1
- package/dist/FilteredActionList/useAnnouncements.js +14 -20
- package/dist/LabelGroup/LabelGroup-7d19205a.css +2 -0
- package/dist/LabelGroup/LabelGroup-7d19205a.css.map +1 -0
- package/dist/LabelGroup/LabelGroup.module.css.js +1 -1
- package/dist/NavList/NavList.js +1 -1
- package/dist/PageHeader/PageHeader.js +1 -1
- package/dist/PageLayout/DragHandle.d.ts +38 -0
- package/dist/PageLayout/DragHandle.js +220 -0
- package/dist/PageLayout/PageLayout.js +54 -248
- package/dist/PageLayout/index.d.ts +3 -1
- package/dist/PageLayout/usePaneWidth.d.ts +55 -1
- package/dist/PageLayout/usePaneWidth.js +10 -5
- package/dist/TextInputWithTokens/TextInputWithTokens.js +1 -1
- package/dist/TooltipV2/Tooltip.js +1 -2
- package/dist/TreeView/TreeView.js +3 -6
- package/dist/experimental/SelectPanel2/SelectPanel.js +2 -2
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +1 -1
- package/dist/experimental/index.js +1 -1
- package/dist/hooks/useDialog.js +1 -2
- package/dist/hooks/useScrollFlash.js +1 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +7 -5
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +1 -1
- package/dist/internal/components/UnderlineTabbedInterface-25587345.css +2 -0
- package/dist/internal/components/UnderlineTabbedInterface-25587345.css.map +1 -0
- package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
- package/dist/utils/warning.js +2 -3
- package/package.json +2 -2
- package/dist/ActionBar/ActionBar-3767d551.css +0 -2
- package/dist/ActionBar/ActionBar-3767d551.css.map +0 -1
- package/dist/LabelGroup/LabelGroup-db41f443.css +0 -2
- package/dist/LabelGroup/LabelGroup-db41f443.css.map +0 -1
- package/dist/internal/components/UnderlineTabbedInterface-70ae932b.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-70ae932b.css.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260715132248
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#8160](https://github.com/primer/react/pull/8160) [`74c731b`](https://github.com/primer/react/commit/74c731b16478bd328eb44ca87d4eb66d43f56fd8) Thanks [@TylerJDev](https://github.com/TylerJDev)! - PageLayout: Export the resize primitives `usePaneWidth` and `DragHandle` (with `defaultPaneWidth` and related types) so pane-resize behavior can be reused outside of `PageLayout`.
|
|
4
8
|
|
|
5
9
|
### Patch Changes
|
|
6
10
|
|
|
7
11
|
- [#8064](https://github.com/primer/react/pull/8064) [`eb447fe`](https://github.com/primer/react/commit/eb447fef0f1565934dc38d09df21d8063957aa9d) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Update the ActionBar overflow menu anchor label to `More items`
|
|
8
12
|
|
|
9
|
-
- [#8166](https://github.com/primer/react/pull/8166) [`46e4d47`](https://github.com/primer/react/commit/46e4d4749f07526477df1cb96015c3bfbb0323fd) Thanks [@mattcosta7](https://github.com/mattcosta7)! - Add `contain: layout` to high-churn overflow containers (`ActionBar`, `UnderlineNav`, `UnderlinePanels`, and `LabelGroup`) so their frequent reflows no longer invalidate ancestor layout.
|
|
10
|
-
|
|
11
13
|
- Fake entry to force publishing
|
|
12
14
|
|
|
13
15
|
- [#8116](https://github.com/primer/react/pull/8116) [`cade4af`](https://github.com/primer/react/commit/cade4af9a70f3fd2622031af585dc07dccd79e11) Thanks [@mattcosta7](https://github.com/mattcosta7)! - `useAnchoredPosition`: improve performance by caching the scrollable-ancestor walk per anchor, reducing repositioning work for overlays, menus, and tooltips.
|
|
14
16
|
|
|
15
|
-
- [#8164](https://github.com/primer/react/pull/8164) [`f86e5a6`](https://github.com/primer/react/commit/f86e5a6420e857e7476c3954d419f4e228bdcf1a) Thanks [@jonrohan](https://github.com/jonrohan)! - Fix `UnderlineNav` tab list not filling the full width of the underline nav in Safari
|
|
16
|
-
|
|
17
17
|
## 38.32.0
|
|
18
18
|
|
|
19
19
|
### Minor Changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-ActionBar-List-9uz46{align-items:flex-start;animation:prc-ActionBar-detect-overflow-mAuJu linear;display:flex;gap:var(--actionbar-gap,var(--stack-gap-condensed,.5rem));height:var(--actionbar-height,var(--control-small-size,1.75rem));list-style:none;margin-bottom:-1px;min-width:0;overflow:hidden;position:relative;animation-timeline:scroll(self block)}.prc-ActionBar-List-9uz46[data-has-overflow=true]{--morebutton-display:flex}.prc-ActionBar-List-9uz46:where([data-size=small]){--actionbar-height:var(--control-small-size,1.75rem)}.prc-ActionBar-List-9uz46:where([data-size=medium]){--actionbar-height:var(--control-medium-size,2rem)}.prc-ActionBar-List-9uz46:where([data-size=large]){--actionbar-height:var(--control-large-size,2.5rem)}.prc-ActionBar-List-9uz46:where([data-gap=none]){--actionbar-gap:0}.prc-ActionBar-List-9uz46:where([data-gap=none]) .prc-ActionBar-Divider-6V8yH{padding:0 var(--base-size-8,.5rem)}.prc-ActionBar-List-9uz46:where([data-gap=condensed]){--actionbar-gap:var(--stack-gap-condensed,0.5rem)}.prc-ActionBar-List-9uz46 [data-overflowing]{visibility:hidden!important}@keyframes prc-ActionBar-detect-overflow-mAuJu{0%,to{--morebutton-display:flex}}.prc-ActionBar-Nav-9spON{align-items:center;display:flex;justify-content:flex-end;padding-inline:var(--base-size-16,1rem)}.prc-ActionBar-Nav-9spON:where([data-flush=true]){padding-inline:0}.prc-ActionBar-Divider-6V8yH:before{background:var(--borderColor-muted,#d1d9e0b3);content:"";display:block;height:var(--base-size-20,1.25rem);margin-top:calc((var(--actionbar-height) - var(--base-size-20,1.25rem))/2);width:var(--borderWidth-thin,.0625rem)}.prc-ActionBar-Group-peNCk,.prc-ActionBar-OverflowContainer-AkYZs{display:flex;gap:inherit}.prc-ActionBar-OverflowContainer-AkYZs{flex-wrap:wrap;justify-content:flex-end;overflow:hidden}.prc-ActionBar-OverflowContainer-AkYZs .prc-ActionBar-OverflowSpacer-tbHkV{height:var(--actionbar-height)}.prc-ActionBar-MoreButton-RHqpx{display:var(--morebutton-display,none)}
|
|
2
|
+
/*# sourceMappingURL=ActionBar-e63def3c.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ActionBar/ActionBar.module.css.js"],"names":[],"mappings":"AAAA,0BASE,sBAAuB,CASvB,oDAAiC,CAhBjC,YAAa,CAQb,yDAAqD,CAGrD,gEAA0D,CAL1D,eAAgB,CADhB,kBAAmB,CAJnB,WAAY,CAQZ,eAAgB,CAVhB,iBAAkB,CAkBlB,qCAsCF,CAnCE,kDACE,yBACF,CAEA,mDACE,oDACF,CAEA,oDACE,kDACF,CAEA,mDACE,mDACF,CAGA,iDACE,iBAKF,CAHE,8EACE,kCACF,CAGF,sDACE,iDACF,CAEA,6CAIE,2BACF,CAGF,+CACE,MAEE,yBACF,CACF,CAEA,yBAIE,kBAAmB,CAHnB,YAAa,CAEb,wBAAyB,CADzB,uCAOF,CAHE,kDACE,gBACF,CAIA,oCAME,6CAAoC,CAFpC,UAAW,CAHX,aAAc,CAEd,kCAA2B,CAK3B,0EAAqE,CANrE,sCAOF,CAQF,kEAJE,YAAa,CACb,WAaF,CAVA,uCAEE,cAAe,CAEf,wBAAyB,CACzB,eAKF,CAHE,2EACE,8BACF,CAGF,gCACE,sCACF","file":"ActionBar-e63def3c.css","sourcesContent":[".List {\n position: relative;\n display: flex;\n min-width: 0;\n\n /* wonder why this is here */\n /* stylelint-disable-next-line primer/spacing */\n margin-bottom: -1px;\n list-style: none;\n align-items: flex-start;\n gap: var(--actionbar-gap, var(--stack-gap-condensed));\n overflow: hidden;\n /* Explicit height is required to clip wrapped items */\n height: var(--actionbar-height, var(--control-small-size));\n\n /* Scroll-based animations have no effect unless the container is scrollable (has overflow, even with overflow:hidden)\n so we can use them to detect overflow. It would be cleaner to use scroll-state container queries for this, but\n browser support for scroll-driven animations is slightly better. */\n animation: detect-overflow linear;\n animation-timeline: scroll(self block);\n\n /* After initial render, JS is used to control visibility which provides progressive enhancement for unsupported browsers */\n &[data-has-overflow='true'] {\n --morebutton-display: flex;\n }\n\n &:where([data-size='small']) {\n --actionbar-height: var(--control-small-size);\n }\n\n &:where([data-size='medium']) {\n --actionbar-height: var(--control-medium-size);\n }\n\n &:where([data-size='large']) {\n --actionbar-height: var(--control-large-size);\n }\n\n /* Gap scale (mirrors Stack) */\n &:where([data-gap='none']) {\n --actionbar-gap: 0;\n\n .Divider {\n padding: 0 var(--base-size-8);\n }\n }\n\n &:where([data-gap='condensed']) {\n --actionbar-gap: var(--stack-gap-condensed);\n }\n\n & [data-overflowing] {\n /* Hide overflowing items. Even though they are clipped by `overflow: hidden`, setting `visibility: hidden` ensures\n they can't accidentally be shown and also hides them from screen readers / keyboard nav. `!important` prevents\n consumers from unintentionally overriding this and breaking accessibility. */\n visibility: hidden !important;\n }\n}\n\n@keyframes detect-overflow {\n 0%,\n 100% {\n --morebutton-display: flex;\n }\n}\n\n.Nav {\n display: flex;\n padding-inline: var(--base-size-16);\n justify-content: flex-end;\n align-items: center;\n\n &:where([data-flush='true']) {\n padding-inline: 0;\n }\n}\n\n.Divider {\n &::before {\n display: block;\n width: var(--borderWidth-thin);\n height: var(--base-size-20);\n content: '';\n /* stylelint-disable-next-line primer/colors */\n background: var(--borderColor-muted);\n /* stylelint-disable-next-line primer/spacing */\n margin-top: calc((var(--actionbar-height) - var(--base-size-20)) / 2);\n }\n}\n\n.Group {\n display: flex;\n gap: inherit;\n}\n\n.OverflowContainer {\n display: flex;\n flex-wrap: wrap;\n gap: inherit;\n justify-content: flex-end;\n overflow: hidden;\n\n .OverflowSpacer {\n height: var(--actionbar-height);\n }\n}\n\n.MoreButton {\n display: var(--morebutton-display, none);\n}\n"]}
|
package/dist/ActionList/Group.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
2
|
-
import { useSlots } from "../hooks/useSlots.js";
|
|
3
2
|
import { invariant } from "../utils/invariant.js";
|
|
3
|
+
import { useSlots } from "../hooks/useSlots.js";
|
|
4
4
|
import { ListContext } from "./shared.js";
|
|
5
5
|
import ActionList_module_css_default from "./ActionList.module.css.js";
|
|
6
6
|
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
package/dist/ActionList/Item.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
2
|
-
import { useSlots } from "../hooks/useSlots.js";
|
|
3
2
|
import { ConditionalWrapper } from "../internal/components/ConditionalWrapper.js";
|
|
4
3
|
import { invariant } from "../utils/invariant.js";
|
|
5
4
|
import { fixedForwardRef } from "../utils/modern-polymorphic.js";
|
|
6
5
|
import VisuallyHidden from "../_VisuallyHidden.js";
|
|
7
6
|
import { TooltipContext } from "../TooltipV2/TooltipContext.js";
|
|
8
7
|
import { Tooltip } from "../TooltipV2/Tooltip.js";
|
|
8
|
+
import { useSlots } from "../hooks/useSlots.js";
|
|
9
9
|
import { ActionListContainerContext } from "./ActionListContainerContext.js";
|
|
10
10
|
import { ItemContext, ListContext } from "./shared.js";
|
|
11
11
|
import ActionList_module_css_default from "./ActionList.module.css.js";
|
package/dist/ActionList/List.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
2
2
|
import useIsomorphicLayoutEffect from "../utils/useIsomorphicLayoutEffect.js";
|
|
3
3
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
4
|
-
import { useSlots } from "../hooks/useSlots.js";
|
|
5
4
|
import { fixedForwardRef } from "../utils/modern-polymorphic.js";
|
|
5
|
+
import { useSlots } from "../hooks/useSlots.js";
|
|
6
6
|
import { FocusKeys, useFocusZone } from "../hooks/useFocusZone.js";
|
|
7
7
|
import { ActionListContainerContext } from "./ActionListContainerContext.js";
|
|
8
8
|
import { ListContext } from "./shared.js";
|
|
@@ -2,10 +2,10 @@ import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
|
2
2
|
import { useProvidedStateOrCreate } from "../hooks/useProvidedStateOrCreate.js";
|
|
3
3
|
import { useMenuKeyboardNavigation } from "../hooks/useMenuKeyboardNavigation.js";
|
|
4
4
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
5
|
-
import { isSlot } from "../utils/is-slot.js";
|
|
6
5
|
import { Tooltip } from "../TooltipV2/Tooltip.js";
|
|
7
6
|
import { ButtonComponent } from "../Button/Button.js";
|
|
8
7
|
import { useResponsiveValue } from "../hooks/useResponsiveValue.js";
|
|
8
|
+
import { isSlot } from "../utils/is-slot.js";
|
|
9
9
|
import { DialogContext } from "../Dialog/DialogContext.js";
|
|
10
10
|
import { ActionListContainerContext } from "../ActionList/ActionListContainerContext.js";
|
|
11
11
|
import { Divider } from "../ActionList/Divider.js";
|
|
@@ -122,8 +122,7 @@ const AnchoredOverlay = ({ renderAnchor, anchorRef: externalAnchorRef, anchorId:
|
|
|
122
122
|
else currentOverlay.style.removeProperty("position-try-fallbacks");
|
|
123
123
|
pendingPositionFrame = requestAnimationFrame(() => {
|
|
124
124
|
pendingPositionFrame = null;
|
|
125
|
-
const
|
|
126
|
-
const result = getDefaultPosition(anchorElement, currentOverlay, fallbackWidth);
|
|
125
|
+
const result = getDefaultPosition(anchorElement, currentOverlay, width ? parseInt(widthMap[width]) : parseInt(widthMap.small));
|
|
127
126
|
currentOverlay.setAttribute("data-align", result.horizontal);
|
|
128
127
|
if (result.suggestedSide) currentOverlay.setAttribute("data-side", result.suggestedSide);
|
|
129
128
|
const offset = result.horizontal === "left" ? result.leftOffset : result.rightOffset;
|
|
@@ -193,11 +193,10 @@ function AutocompleteMenu(props) {
|
|
|
193
193
|
t12 = (current, _previous, directlyActivated) => {
|
|
194
194
|
activeDescendantRef.current = current || null;
|
|
195
195
|
if (current) {
|
|
196
|
-
|
|
196
|
+
setHighlightedItem(allItemsToRenderRef.current.find((item_1) => {
|
|
197
197
|
var _current$closest;
|
|
198
198
|
return item_1.id === ((_current$closest = current.closest("li")) === null || _current$closest === void 0 ? void 0 : _current$closest.getAttribute("data-id"));
|
|
199
|
-
});
|
|
200
|
-
setHighlightedItem(selectedItem);
|
|
199
|
+
}));
|
|
201
200
|
setIsMenuDirectlyActivated(directlyActivated);
|
|
202
201
|
}
|
|
203
202
|
if (current && customScrollContainerRef && customScrollContainerRef.current && directlyActivated) scrollIntoView(current, customScrollContainerRef.current, menuScrollMargins);
|
|
@@ -250,10 +250,7 @@ function Breadcrumbs(t0) {
|
|
|
250
250
|
const measuredContainerWidth = containerElement.offsetWidth;
|
|
251
251
|
setContainerWidth((prev_0) => prev_0 === measuredContainerWidth ? prev_0 : measuredContainerWidth);
|
|
252
252
|
const listElement = containerElement.querySelector("ol");
|
|
253
|
-
if (listElement && listElement.children.length > 0 && listElement.children.length === childArray.length)
|
|
254
|
-
const widths = Array.from(listElement.children).map(_temp3);
|
|
255
|
-
setChildArrayWidths(widths);
|
|
256
|
-
}
|
|
253
|
+
if (listElement && listElement.children.length > 0 && listElement.children.length === childArray.length) setChildArrayWidths(Array.from(listElement.children).map(_temp3));
|
|
257
254
|
};
|
|
258
255
|
$[3] = childArray.length;
|
|
259
256
|
$[4] = overflow;
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -3,9 +3,9 @@ import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
|
3
3
|
import { useOnEscapePress } from "../hooks/useOnEscapePress.js";
|
|
4
4
|
import { useResizeObserver } from "../hooks/useResizeObserver.js";
|
|
5
5
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
6
|
-
import { useSlots } from "../hooks/useSlots.js";
|
|
7
6
|
import { IconButton } from "../Button/IconButton.js";
|
|
8
7
|
import { ButtonComponent } from "../Button/Button.js";
|
|
8
|
+
import { useSlots } from "../hooks/useSlots.js";
|
|
9
9
|
import { useFocusTrap } from "../hooks/useFocusTrap.js";
|
|
10
10
|
import { useFocusZone } from "../hooks/useFocusZone.js";
|
|
11
11
|
import Portal_default from "../Portal/index.js";
|
|
@@ -31,23 +31,20 @@ const useAnnouncements = (items, listContainerRef, inputRef, enabled = true, loa
|
|
|
31
31
|
}, [enabled]);
|
|
32
32
|
useEffect(function announceInitialFocus() {
|
|
33
33
|
const focusHandler = () => {
|
|
34
|
-
if (usingRovingTabindex) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
} else window.requestAnimationFrame(() => {
|
|
34
|
+
if (usingRovingTabindex) announce$1(`${items.length} item${items.length > 1 ? "s" : ""} available, ${selectedItems} selected.`, {
|
|
35
|
+
delayMs,
|
|
36
|
+
from: liveRegion ? liveRegion : void 0
|
|
37
|
+
});
|
|
38
|
+
else window.requestAnimationFrame(() => {
|
|
41
39
|
const activeItem = getItemWithActiveDescendant(listContainerRef, items);
|
|
42
40
|
if (!activeItem) return;
|
|
43
41
|
const { index, text, selected } = activeItem;
|
|
44
|
-
|
|
42
|
+
announce$1([
|
|
45
43
|
`Focus on filter text box and list of items`,
|
|
46
44
|
`Focused item: ${text}`,
|
|
47
45
|
`${selected ? "selected" : "not selected"}`,
|
|
48
46
|
`${index + 1} of ${items.length}`
|
|
49
|
-
].join(", ")
|
|
50
|
-
announce$1(announcementText, {
|
|
47
|
+
].join(", "), {
|
|
51
48
|
delayMs,
|
|
52
49
|
from: liveRegion ? liveRegion : void 0
|
|
53
50
|
});
|
|
@@ -73,23 +70,20 @@ const useAnnouncements = (items, listContainerRef, inputRef, enabled = true, loa
|
|
|
73
70
|
announce$1(`${message === null || message === void 0 ? void 0 : message.title}. ${message === null || message === void 0 ? void 0 : message.description}`, { delayMs });
|
|
74
71
|
return;
|
|
75
72
|
}
|
|
76
|
-
if (usingRovingTabindex) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
});
|
|
82
|
-
} else window.requestAnimationFrame(() => {
|
|
73
|
+
if (usingRovingTabindex) announce$1(`${items.length} item${items.length > 1 ? "s" : ""} available, ${selectedItems} selected.`, {
|
|
74
|
+
delayMs,
|
|
75
|
+
from: liveRegion ? liveRegion : void 0
|
|
76
|
+
});
|
|
77
|
+
else window.requestAnimationFrame(() => {
|
|
83
78
|
const activeItem = getItemWithActiveDescendant(listContainerRef, items);
|
|
84
79
|
if (!activeItem) return;
|
|
85
80
|
const { index, text, selected } = activeItem;
|
|
86
|
-
|
|
81
|
+
announce$1([
|
|
87
82
|
`List updated`,
|
|
88
83
|
`Focused item: ${text}`,
|
|
89
84
|
`${selected ? "selected" : "not selected"}`,
|
|
90
85
|
`${index + 1} of ${items.length}`
|
|
91
|
-
].join(", ")
|
|
92
|
-
announce$1(announcementText, {
|
|
86
|
+
].join(", "), {
|
|
93
87
|
delayMs,
|
|
94
88
|
from: liveRegion ? liveRegion : void 0
|
|
95
89
|
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-LabelGroup-Container-E-ePP{display:flex;flex-wrap:nowrap;gap:var(--base-size-4,.25rem);line-height:1;max-width:100%;overflow:hidden}.prc-LabelGroup-Container-E-ePP:where([data-overflow=inline]){flex-wrap:wrap}.prc-LabelGroup-Container-E-ePP:where([data-list]){list-style-type:none;margin-block-end:0;margin-block-start:0;padding-inline-start:0}.prc-LabelGroup-ItemWrapper-GkO4t{align-items:center;display:flex;min-height:28px}.prc-LabelGroup-ItemWrapper--hidden-mdrB0{order:9999;pointer-events:none;visibility:hidden}.prc-LabelGroup-OverlayContainer-duQvd{align-items:flex-start;display:flex}.prc-LabelGroup-OverlayInner-nDXRC{display:flex;flex-wrap:wrap;gap:var(--base-size-4,.25rem)}.prc-LabelGroup-CloseButton-IyLno{flex-shrink:0}
|
|
2
|
+
/*# sourceMappingURL=LabelGroup-7d19205a.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/LabelGroup/LabelGroup.module.css.js"],"names":[],"mappings":"AAAA,gCACE,YAAa,CACb,gBAAiB,CACjB,6BAAuB,CAEvB,aAAc,CACd,cAAe,CACf,eAYF,CAVE,8DACE,cACF,CAEA,mDAIE,oBAAqB,CADrB,kBAAmB,CADnB,oBAAqB,CADrB,sBAIF,CAGF,kCAEE,kBAAmB,CADnB,YAAa,CAOb,eACF,CAEA,0CACE,UAAW,CACX,mBAAoB,CACpB,iBACF,CAEA,uCACE,sBAAuB,CACvB,YACF,CAEA,mCACE,YAAa,CACb,cAAe,CACf,6BACF,CAEA,kCACE,aACF","file":"LabelGroup-7d19205a.css","sourcesContent":[".Container {\n display: flex;\n flex-wrap: nowrap;\n gap: var(--base-size-4);\n /* stylelint-disable-next-line primer/typography */\n line-height: 1;\n max-width: 100%;\n overflow: hidden;\n\n &:where([data-overflow='inline']) {\n flex-wrap: wrap;\n }\n\n &:where([data-list]) {\n padding-inline-start: 0;\n margin-block-start: 0;\n margin-block-end: 0;\n list-style-type: none;\n }\n}\n\n.ItemWrapper {\n display: flex;\n align-items: center;\n /* This min-height matches the height of the expand/collapse button.\n Without it, the labels/tokens will do a slight layout shift when expanded.\n This is because the height of the first row will match the token sizes,\n but the height of the second row will be the height of the collapse button.\n */\n min-height: 28px;\n}\n\n.ItemWrapper--hidden {\n order: 9999;\n pointer-events: none;\n visibility: hidden;\n}\n\n.OverlayContainer {\n align-items: flex-start;\n display: flex;\n}\n\n.OverlayInner {\n display: flex;\n flex-wrap: wrap;\n gap: var(--base-size-4);\n}\n\n.CloseButton {\n flex-shrink: 0;\n}\n"]}
|
package/dist/NavList/NavList.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import useIsomorphicLayoutEffect from "../utils/useIsomorphicLayoutEffect.js";
|
|
2
2
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
3
|
-
import { useSlots } from "../hooks/useSlots.js";
|
|
4
3
|
import { fixedForwardRef } from "../utils/modern-polymorphic.js";
|
|
5
4
|
import _VisuallyHidden_module_css_default from "../_VisuallyHidden.module.css.js";
|
|
5
|
+
import { useSlots } from "../hooks/useSlots.js";
|
|
6
6
|
import { ActionListContainerContext } from "../ActionList/ActionListContainerContext.js";
|
|
7
7
|
import Heading$1 from "../Heading/Heading.js";
|
|
8
8
|
import ActionList_module_css_default from "../ActionList/ActionList.module.css.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
2
2
|
import { warning } from "../utils/warning.js";
|
|
3
|
-
import { isSlot } from "../utils/is-slot.js";
|
|
4
3
|
import { isResponsiveValue } from "../hooks/useResponsiveValue.js";
|
|
4
|
+
import { isSlot } from "../utils/is-slot.js";
|
|
5
5
|
import { getResponsiveAttributes } from "../internal/utils/getResponsiveAttributes.js";
|
|
6
6
|
import Heading from "../Heading/Heading.js";
|
|
7
7
|
import Link from "../Link/Link.js";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/PageLayout/DragHandle.d.ts
|
|
4
|
+
type DragHandleProps = {
|
|
5
|
+
/** Ref for imperative ARIA updates during drag */handleRef: React.RefObject<HTMLDivElement>; /** Called once when drag starts with initial cursor X position */
|
|
6
|
+
onDragStart: (clientX: number) => void; /** Called on each drag tick with cursor position (pointer) or delta (keyboard) */
|
|
7
|
+
onDrag: (value: number, isKeyboard: boolean) => void; /** Called when drag operation completes */
|
|
8
|
+
onDragEnd: () => void; /** Reset width on double-click */
|
|
9
|
+
onDoubleClick?: React.MouseEventHandler<HTMLDivElement>; /** ARIA slider min value */
|
|
10
|
+
'aria-valuemin'?: number; /** ARIA slider max value */
|
|
11
|
+
'aria-valuemax'?: number; /** ARIA slider current value */
|
|
12
|
+
'aria-valuenow'?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Ref to the element that receives drag-time styling/containment optimizations
|
|
15
|
+
* (e.g. the resizable pane). When omitted, those side effects are skipped.
|
|
16
|
+
*/
|
|
17
|
+
dragTargetRef?: React.RefObject<HTMLElement | null>;
|
|
18
|
+
/**
|
|
19
|
+
* Ref to a content wrapper element that receives drag-time containment.
|
|
20
|
+
* Only needed for layouts (like PageLayout) that optimize sibling content during drag.
|
|
21
|
+
*/
|
|
22
|
+
contentWrapperRef?: React.RefObject<HTMLElement | null>;
|
|
23
|
+
/**
|
|
24
|
+
* Formats the `aria-valuetext` announced for the current width.
|
|
25
|
+
* @default valueNow => `Pane width ${valueNow} pixels`
|
|
26
|
+
*/
|
|
27
|
+
formatValueText?: (valueNow: number) => string; /** Value for the `data-component` attribute. */
|
|
28
|
+
'data-component'?: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* DragHandle - handles all pointer and keyboard interactions for resizing.
|
|
32
|
+
* ARIA values are set in JSX for SSR accessibility, then updated via DOM
|
|
33
|
+
* manipulation during drag for performance. The consumer owns writing the width
|
|
34
|
+
* (via the `onDrag` callback); this component only reports interactions.
|
|
35
|
+
*/
|
|
36
|
+
declare const DragHandle: React.NamedExoticComponent<DragHandleProps>;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { DragHandle, DragHandleProps };
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import PageLayout_module_css_default from "./PageLayout.module.css.js";
|
|
2
|
+
import { defaultFormatValueText } from "./usePaneWidth.js";
|
|
3
|
+
import { removeDraggingStyles, setDraggingStyles } from "./paneUtils.js";
|
|
4
|
+
import { c } from "react-compiler-runtime";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import React, { memo } from "react";
|
|
7
|
+
//#region src/PageLayout/DragHandle.tsx
|
|
8
|
+
const isArrowKey = (key) => key === "ArrowLeft" || key === "ArrowRight" || key === "ArrowUp" || key === "ArrowDown";
|
|
9
|
+
const isShrinkKey = (key) => key === "ArrowLeft" || key === "ArrowDown";
|
|
10
|
+
/**
|
|
11
|
+
* DragHandle - handles all pointer and keyboard interactions for resizing.
|
|
12
|
+
* ARIA values are set in JSX for SSR accessibility, then updated via DOM
|
|
13
|
+
* manipulation during drag for performance. The consumer owns writing the width
|
|
14
|
+
* (via the `onDrag` callback); this component only reports interactions.
|
|
15
|
+
*/
|
|
16
|
+
const DragHandle = /*#__PURE__*/ memo(function DragHandle(t0) {
|
|
17
|
+
const $ = c(39);
|
|
18
|
+
const { handleRef, onDragStart, onDrag, onDragEnd, onDoubleClick, "aria-valuemin": ariaValueMin, "aria-valuemax": ariaValueMax, "aria-valuenow": ariaValueNow, dragTargetRef, contentWrapperRef, formatValueText: t1, "data-component": t2 } = t0;
|
|
19
|
+
const formatValueText = t1 === void 0 ? defaultFormatValueText : t1;
|
|
20
|
+
const dataComponent = t2 === void 0 ? "PageLayout.DragHandle" : t2;
|
|
21
|
+
const stableOnDragStart = React.useRef(onDragStart);
|
|
22
|
+
const stableOnDrag = React.useRef(onDrag);
|
|
23
|
+
const stableOnDragEnd = React.useRef(onDragEnd);
|
|
24
|
+
let t3;
|
|
25
|
+
if ($[0] !== onDrag || $[1] !== onDragEnd || $[2] !== onDragStart) {
|
|
26
|
+
t3 = () => {
|
|
27
|
+
stableOnDragStart.current = onDragStart;
|
|
28
|
+
stableOnDrag.current = onDrag;
|
|
29
|
+
stableOnDragEnd.current = onDragEnd;
|
|
30
|
+
};
|
|
31
|
+
$[0] = onDrag;
|
|
32
|
+
$[1] = onDragEnd;
|
|
33
|
+
$[2] = onDragStart;
|
|
34
|
+
$[3] = t3;
|
|
35
|
+
} else t3 = $[3];
|
|
36
|
+
React.useEffect(t3);
|
|
37
|
+
const isDraggingRef = React.useRef(false);
|
|
38
|
+
let t4;
|
|
39
|
+
if ($[4] !== contentWrapperRef || $[5] !== dragTargetRef || $[6] !== handleRef) {
|
|
40
|
+
t4 = () => {
|
|
41
|
+
var _dragTargetRef$curren, _contentWrapperRef$cu;
|
|
42
|
+
if (isDraggingRef.current) return;
|
|
43
|
+
setDraggingStyles({
|
|
44
|
+
handle: handleRef.current,
|
|
45
|
+
pane: (_dragTargetRef$curren = dragTargetRef === null || dragTargetRef === void 0 ? void 0 : dragTargetRef.current) !== null && _dragTargetRef$curren !== void 0 ? _dragTargetRef$curren : null,
|
|
46
|
+
contentWrapper: (_contentWrapperRef$cu = contentWrapperRef === null || contentWrapperRef === void 0 ? void 0 : contentWrapperRef.current) !== null && _contentWrapperRef$cu !== void 0 ? _contentWrapperRef$cu : null
|
|
47
|
+
});
|
|
48
|
+
isDraggingRef.current = true;
|
|
49
|
+
};
|
|
50
|
+
$[4] = contentWrapperRef;
|
|
51
|
+
$[5] = dragTargetRef;
|
|
52
|
+
$[6] = handleRef;
|
|
53
|
+
$[7] = t4;
|
|
54
|
+
} else t4 = $[7];
|
|
55
|
+
const startDragging = t4;
|
|
56
|
+
let t5;
|
|
57
|
+
if ($[8] !== contentWrapperRef || $[9] !== dragTargetRef || $[10] !== handleRef) {
|
|
58
|
+
t5 = () => {
|
|
59
|
+
var _dragTargetRef$curren2, _contentWrapperRef$cu2;
|
|
60
|
+
if (!isDraggingRef.current) return;
|
|
61
|
+
removeDraggingStyles({
|
|
62
|
+
handle: handleRef.current,
|
|
63
|
+
pane: (_dragTargetRef$curren2 = dragTargetRef === null || dragTargetRef === void 0 ? void 0 : dragTargetRef.current) !== null && _dragTargetRef$curren2 !== void 0 ? _dragTargetRef$curren2 : null,
|
|
64
|
+
contentWrapper: (_contentWrapperRef$cu2 = contentWrapperRef === null || contentWrapperRef === void 0 ? void 0 : contentWrapperRef.current) !== null && _contentWrapperRef$cu2 !== void 0 ? _contentWrapperRef$cu2 : null
|
|
65
|
+
});
|
|
66
|
+
isDraggingRef.current = false;
|
|
67
|
+
};
|
|
68
|
+
$[8] = contentWrapperRef;
|
|
69
|
+
$[9] = dragTargetRef;
|
|
70
|
+
$[10] = handleRef;
|
|
71
|
+
$[11] = t5;
|
|
72
|
+
} else t5 = $[11];
|
|
73
|
+
const endDragging = t5;
|
|
74
|
+
let t6;
|
|
75
|
+
if ($[12] !== startDragging) {
|
|
76
|
+
t6 = (event) => {
|
|
77
|
+
if (event.button !== 0) return;
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
const target = event.currentTarget;
|
|
80
|
+
try {
|
|
81
|
+
target.setPointerCapture(event.pointerId);
|
|
82
|
+
} catch {}
|
|
83
|
+
stableOnDragStart.current(event.clientX);
|
|
84
|
+
startDragging();
|
|
85
|
+
};
|
|
86
|
+
$[12] = startDragging;
|
|
87
|
+
$[13] = t6;
|
|
88
|
+
} else t6 = $[13];
|
|
89
|
+
const handlePointerDown = t6;
|
|
90
|
+
const rafIdRef = React.useRef(null);
|
|
91
|
+
const pendingClientXRef = React.useRef(null);
|
|
92
|
+
let t7;
|
|
93
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
94
|
+
t7 = (event_0) => {
|
|
95
|
+
if (!isDraggingRef.current) return;
|
|
96
|
+
event_0.preventDefault();
|
|
97
|
+
pendingClientXRef.current = event_0.clientX;
|
|
98
|
+
if (rafIdRef.current === null) rafIdRef.current = requestAnimationFrame(() => {
|
|
99
|
+
rafIdRef.current = null;
|
|
100
|
+
if (pendingClientXRef.current !== null) {
|
|
101
|
+
stableOnDrag.current(pendingClientXRef.current, false);
|
|
102
|
+
pendingClientXRef.current = null;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
$[14] = t7;
|
|
107
|
+
} else t7 = $[14];
|
|
108
|
+
const handlePointerMove = t7;
|
|
109
|
+
let t8;
|
|
110
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
111
|
+
t8 = (event_1) => {
|
|
112
|
+
if (!isDraggingRef.current) return;
|
|
113
|
+
event_1.preventDefault();
|
|
114
|
+
};
|
|
115
|
+
$[15] = t8;
|
|
116
|
+
} else t8 = $[15];
|
|
117
|
+
const handlePointerUp = t8;
|
|
118
|
+
let t9;
|
|
119
|
+
if ($[16] !== endDragging) {
|
|
120
|
+
t9 = () => {
|
|
121
|
+
if (!isDraggingRef.current) return;
|
|
122
|
+
if (rafIdRef.current !== null) {
|
|
123
|
+
cancelAnimationFrame(rafIdRef.current);
|
|
124
|
+
rafIdRef.current = null;
|
|
125
|
+
pendingClientXRef.current = null;
|
|
126
|
+
}
|
|
127
|
+
endDragging();
|
|
128
|
+
stableOnDragEnd.current();
|
|
129
|
+
};
|
|
130
|
+
$[16] = endDragging;
|
|
131
|
+
$[17] = t9;
|
|
132
|
+
} else t9 = $[17];
|
|
133
|
+
const handleLostPointerCapture = t9;
|
|
134
|
+
let t10;
|
|
135
|
+
if ($[18] !== startDragging) {
|
|
136
|
+
t10 = (event_2) => {
|
|
137
|
+
if (!isArrowKey(event_2.key)) return;
|
|
138
|
+
event_2.preventDefault();
|
|
139
|
+
const delta = isShrinkKey(event_2.key) ? -3 : 3;
|
|
140
|
+
if (!isDraggingRef.current) startDragging();
|
|
141
|
+
stableOnDrag.current(delta, true);
|
|
142
|
+
};
|
|
143
|
+
$[18] = startDragging;
|
|
144
|
+
$[19] = t10;
|
|
145
|
+
} else t10 = $[19];
|
|
146
|
+
const handleKeyDown = t10;
|
|
147
|
+
let t11;
|
|
148
|
+
if ($[20] !== endDragging) {
|
|
149
|
+
t11 = (event_3) => {
|
|
150
|
+
if (!isArrowKey(event_3.key)) return;
|
|
151
|
+
event_3.preventDefault();
|
|
152
|
+
endDragging();
|
|
153
|
+
stableOnDragEnd.current();
|
|
154
|
+
};
|
|
155
|
+
$[20] = endDragging;
|
|
156
|
+
$[21] = t11;
|
|
157
|
+
} else t11 = $[21];
|
|
158
|
+
const handleKeyUp = t11;
|
|
159
|
+
let t12;
|
|
160
|
+
let t13;
|
|
161
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
162
|
+
t12 = () => () => {
|
|
163
|
+
if (rafIdRef.current !== null) {
|
|
164
|
+
cancelAnimationFrame(rafIdRef.current);
|
|
165
|
+
rafIdRef.current = null;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
t13 = [];
|
|
169
|
+
$[22] = t12;
|
|
170
|
+
$[23] = t13;
|
|
171
|
+
} else {
|
|
172
|
+
t12 = $[22];
|
|
173
|
+
t13 = $[23];
|
|
174
|
+
}
|
|
175
|
+
React.useEffect(t12, t13);
|
|
176
|
+
let t14;
|
|
177
|
+
if ($[24] !== ariaValueNow || $[25] !== formatValueText) {
|
|
178
|
+
t14 = ariaValueNow !== void 0 ? formatValueText(ariaValueNow) : void 0;
|
|
179
|
+
$[24] = ariaValueNow;
|
|
180
|
+
$[25] = formatValueText;
|
|
181
|
+
$[26] = t14;
|
|
182
|
+
} else t14 = $[26];
|
|
183
|
+
let t15;
|
|
184
|
+
if ($[27] !== ariaValueMax || $[28] !== ariaValueMin || $[29] !== ariaValueNow || $[30] !== dataComponent || $[31] !== handleKeyDown || $[32] !== handleKeyUp || $[33] !== handleLostPointerCapture || $[34] !== handlePointerDown || $[35] !== handleRef || $[36] !== onDoubleClick || $[37] !== t14) {
|
|
185
|
+
t15 = /*#__PURE__*/ jsx("div", {
|
|
186
|
+
ref: handleRef,
|
|
187
|
+
className: PageLayout_module_css_default.DraggableHandle,
|
|
188
|
+
"data-component": dataComponent,
|
|
189
|
+
role: "slider",
|
|
190
|
+
"aria-label": "Draggable pane splitter",
|
|
191
|
+
"aria-valuemin": ariaValueMin,
|
|
192
|
+
"aria-valuemax": ariaValueMax,
|
|
193
|
+
"aria-valuenow": ariaValueNow,
|
|
194
|
+
"aria-valuetext": t14,
|
|
195
|
+
tabIndex: 0,
|
|
196
|
+
onPointerDown: handlePointerDown,
|
|
197
|
+
onPointerMove: handlePointerMove,
|
|
198
|
+
onPointerUp: handlePointerUp,
|
|
199
|
+
onLostPointerCapture: handleLostPointerCapture,
|
|
200
|
+
onKeyDown: handleKeyDown,
|
|
201
|
+
onKeyUp: handleKeyUp,
|
|
202
|
+
onDoubleClick
|
|
203
|
+
});
|
|
204
|
+
$[27] = ariaValueMax;
|
|
205
|
+
$[28] = ariaValueMin;
|
|
206
|
+
$[29] = ariaValueNow;
|
|
207
|
+
$[30] = dataComponent;
|
|
208
|
+
$[31] = handleKeyDown;
|
|
209
|
+
$[32] = handleKeyUp;
|
|
210
|
+
$[33] = handleLostPointerCapture;
|
|
211
|
+
$[34] = handlePointerDown;
|
|
212
|
+
$[35] = handleRef;
|
|
213
|
+
$[36] = onDoubleClick;
|
|
214
|
+
$[37] = t14;
|
|
215
|
+
$[38] = t15;
|
|
216
|
+
} else t15 = $[38];
|
|
217
|
+
return t15;
|
|
218
|
+
});
|
|
219
|
+
//#endregion
|
|
220
|
+
export { DragHandle };
|