@primer/react 0.0.0-20260407233157 → 0.0.0-20260408162035

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 CHANGED
@@ -1,10 +1,10 @@
1
1
  # @primer/react
2
2
 
3
- ## 0.0.0-20260407233157
3
+ ## 0.0.0-20260408162035
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - [#7735](https://github.com/primer/react/pull/7735) [`b12d9f5`](https://github.com/primer/react/commit/b12d9f5e05cec248f1d38bf402cd2a592678b69c) Thanks [@liuliu-dev](https://github.com/liuliu-dev)! - Breadcrumbs: Add `visibleItemsOnNarrow` prop to control how many breadcrumb items are shown on narrow viewports (defaults to showing only the previous item as a back link).
7
+ - [#7655](https://github.com/primer/react/pull/7655) [`8f1f205`](https://github.com/primer/react/commit/8f1f205a637939eb167095b4ac766cf6524ac558) Thanks [@iansan5653](https://github.com/iansan5653)! - Replace `ActionBar` overflow calculations with CSS wrapping approach to improve performance and stability
8
8
 
9
9
  - [#7677](https://github.com/primer/react/pull/7677) [`c1a81b1`](https://github.com/primer/react/commit/c1a81b178742ba547b85a3df3ed3c27bcff6b7c5) Thanks [@TylerJDev](https://github.com/TylerJDev)! - AnchoredOverlay: Add Popover API to AnchoredOverlay (behind `primer_react_css_anchor_positioning` feature flag)
10
10
 
@@ -0,0 +1,2 @@
1
+ .prc-ActionBar-List-9uz46{align-items:flex-start;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}.prc-ActionBar-List-9uz46:not([data-has-overflow]){animation:prc-ActionBar-detect-overflow-mAuJu linear;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,var(--color-border-muted));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-MoreButton-RHqpx{display:var(--morebutton-display,none)}
2
+ /*# sourceMappingURL=ActionBar-3f7b52a3.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ActionBar/ActionBar.module.css.js"],"names":[],"mappings":"AAAA,0BASE,sBAAuB,CAPvB,YAAa,CAQb,yDAAqD,CAGrD,gEAA0D,CAL1D,eAAgB,CADhB,kBAAmB,CAJnB,WAAY,CAQZ,eAAgB,CAVhB,iBA2DF,CA5CE,mDAIE,oDAAiC,CACjC,qCACF,CAGA,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,6DAAoC,CAFpC,UAAW,CAHX,aAAc,CAEd,kCAA2B,CAK3B,0EAAqE,CANrE,sCAOF,CAQF,kEAJE,YAAa,CACb,WASF,CANA,uCAEE,cAAe,CAEf,wBAAyB,CACzB,eACF,CAEA,gCACE,sCACF","file":"ActionBar-3f7b52a3.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 /* Only apply scroll animation before overflow is calculated (for SSR/initial render) */\n &:not([data-has-overflow]) {\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\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\n.MoreButton {\n display: var(--morebutton-display, none);\n}\n"]}
@@ -120,6 +120,6 @@ export declare const ActionBarMenu: React.ForwardRefExoticComponent<{
120
120
  keyshortcuts?: string;
121
121
  keybindingHint?: string | string[];
122
122
  } & Omit<import("..").ButtonBaseProps, "aria-label" | "aria-labelledby"> & React.RefAttributes<unknown>>;
123
- export declare const VerticalDivider: () => React.JSX.Element | null;
123
+ export declare const VerticalDivider: () => React.JSX.Element;
124
124
  export {};
125
125
  //# sourceMappingURL=ActionBar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBar.d.ts","sourceRoot":"","sources":["../../src/ActionBar/ActionBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2D,MAAM,OAAO,CAAA;AAE/E,OAAO,EAAa,KAAK,mBAAmB,EAAC,MAAM,eAAe,CAAA;AAKlE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,WAAW,CAAA;AAkD9C,KAAK,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;AAExC,KAAK,SAAS,GACV;IACE,wDAAwD;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ChB,CAAA;AAEL,MAAM,MAAM,kBAAkB,GAAG;IAC/B,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAA;IACpB,+BAA+B;IAC/B,IAAI,EAAE,wBAAwB,CAAC,MAAM,CAAC,CAAA;IACtC,KAAK,EAAE,sBAAsB,EAAE,CAAA;IAC/B;;;OAGG;IACH,YAAY,CAAC,EAAE,wBAAwB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAA;IACxD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;CAC9C,GAAG,eAAe,CAAA;AAwDnB,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAkIvE,CAAA;AAqCD,eAAO,MAAM,mBAAmB,0FA2C/B,CAAA;AAMD,eAAO,MAAM,cAAc;;iCAezB,CAAA;AAEF,eAAO,MAAM,aAAa;IA/SxB,2CAA2C;kBAC7B,MAAM;IACpB,+BAA+B;UACzB,wBAAwB,CAAC,MAAM,CAAC;WAC/B,sBAAsB,EAAE;IAC/B;;;OAGG;mBACY,wBAAwB,CAAC,MAAM,CAAC,GAAG,MAAM;IACxD;;OAEG;qBACc,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;;;;;;;;;;;wGA2U9C,CAAA;AAED,eAAO,MAAM,eAAe,yBAgB3B,CAAA"}
@@ -1,29 +1,19 @@
1
1
  import { c } from 'react-compiler-runtime';
2
- import React, { useRef, useState, forwardRef, useMemo, useCallback } from 'react';
2
+ import React, { useRef, forwardRef, useState, useMemo, useCallback, useContext, useSyncExternalStore } from 'react';
3
3
  import { KebabHorizontalIcon } from '@primer/octicons-react';
4
4
  import { ActionList } from '../ActionList/index.js';
5
- import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
6
- import { useResizeObserver } from '../hooks/useResizeObserver.js';
7
5
  import { IconButton } from '../Button/IconButton.js';
8
6
  import { useFocusZone } from '../hooks/useFocusZone.js';
9
7
  import styles from './ActionBar.module.css.js';
10
8
  import { clsx } from 'clsx';
11
9
  import { createDescendantRegistry } from '../utils/descendant-registry.js';
12
- import { jsxs, jsx } from 'react/jsx-runtime';
10
+ import { jsx, jsxs } from 'react/jsx-runtime';
13
11
  import { useMergedRefs } from '../hooks/useMergedRefs.js';
14
12
  import { FocusKeys } from '@primer/behaviors';
15
13
  import { ActionMenu } from '../ActionMenu/ActionMenu.js';
16
14
 
17
- const ACTIONBAR_ITEM_GAP = 8;
18
-
19
- /**
20
- * Registry of descendants to render in the list or menu. To preserve insertion order across updates, children are
21
- * set to `null` when unregistered rather than fully dropped from the map.
22
- */
23
-
24
15
  const ActionBarContext = /*#__PURE__*/React.createContext({
25
16
  size: 'medium',
26
- isVisibleChild: () => true,
27
17
  groupId: undefined
28
18
  });
29
19
 
@@ -31,23 +21,8 @@ const ActionBarContext = /*#__PURE__*/React.createContext({
31
21
  small (28px), medium (32px), large (40px)
32
22
  */
33
23
 
34
- const MORE_BTN_WIDTH = 32;
35
24
  const ActionBarItemsRegistry = createDescendantRegistry();
36
- const calculatePossibleItems = (registryEntries, navWidth, gap, moreMenuWidth = 0) => {
37
- const widthToFit = navWidth - moreMenuWidth;
38
- let breakpoint = registryEntries.length; // assume all items will fit
39
- let sumsOfChildWidth = 0;
40
- for (const [index, [, child]] of registryEntries.entries()) {
41
- sumsOfChildWidth += index > 0 ? child.width + gap : child.width;
42
- if (sumsOfChildWidth > widthToFit) {
43
- breakpoint = index;
44
- break;
45
- } else {
46
- continue;
47
- }
48
- }
49
- return breakpoint;
50
- };
25
+ const FOCUSABLE_ITEM_SELECTOR = ':is(button, a, input, [tabindex]):not(:disabled):not([data-overflowing]):not([data-more-button-inactive])';
51
26
  const renderMenuItem = (item, index) => {
52
27
  if (item.type === 'divider') {
53
28
  return /*#__PURE__*/jsx(ActionList.Divider, {}, index);
@@ -96,44 +71,8 @@ const renderMenuItem = (item, index) => {
96
71
  }, label);
97
72
  };
98
73
  renderMenuItem.displayName = "renderMenuItem";
99
- const getMenuItems = (navWidth, moreMenuWidth, childRegistry, hasActiveMenu, gap) => {
100
- var _childRegistry$entrie;
101
- const registryEntries = Array.from((_childRegistry$entrie = childRegistry === null || childRegistry === void 0 ? void 0 : childRegistry.entries()) !== null && _childRegistry$entrie !== void 0 ? _childRegistry$entrie : []).filter(entry => entry[1] !== null && (entry[1].type !== 'action' || entry[1].groupId === undefined));
102
- if (registryEntries.length === 0) return new Set();
103
- const numberOfItemsPossible = calculatePossibleItems(registryEntries, navWidth, gap);
104
- const numberOfItemsPossibleWithMoreMenu = calculatePossibleItems(registryEntries, navWidth, gap, moreMenuWidth || MORE_BTN_WIDTH);
105
- const menuItems = new Set();
106
-
107
- // First, we check if we can fit all the items with their icons
108
- if (registryEntries.length >= numberOfItemsPossible) {
109
- /* Below is an accessibility requirement. Never show only one item in the overflow menu.
110
- * If there is only one item left to display in the overflow menu according to the calculation,
111
- * we need to pull another item from the list into the overflow menu.
112
- */
113
- const numberOfItemsInMenu = registryEntries.length - numberOfItemsPossibleWithMoreMenu;
114
- const numberOfListItems = numberOfItemsInMenu === 1 ? numberOfItemsPossibleWithMoreMenu - 1 : numberOfItemsPossibleWithMoreMenu;
115
- for (const [index, [id, child]] of registryEntries.entries()) {
116
- if (index < numberOfListItems) {
117
- continue;
118
- //if the last item is a divider
119
- } else if (child.type === 'divider') {
120
- if (index === numberOfListItems - 1 || index === numberOfListItems) {
121
- continue;
122
- } else {
123
- menuItems.add(id);
124
- }
125
- } else {
126
- menuItems.add(id);
127
- }
128
- }
129
- return menuItems;
130
- } else if (numberOfItemsPossible > registryEntries.length && hasActiveMenu) {
131
- /* If the items fit in the list and there are items in the overflow menu, we need to move them back to the list */
132
- return new Set();
133
- }
134
- };
135
74
  const ActionBar = props => {
136
- const $ = c(38);
75
+ const $ = c(37);
137
76
  const {
138
77
  size: t0,
139
78
  children,
@@ -147,276 +86,257 @@ const ActionBar = props => {
147
86
  const flush = t1 === undefined ? false : t1;
148
87
  const gap = t2 === undefined ? "condensed" : t2;
149
88
  const listRef = useRef(null);
150
- const [computedGap, setComputedGap] = useState(ACTIONBAR_ITEM_GAP);
151
89
  const [childRegistry, setChildRegistry] = ActionBarItemsRegistry.useRegistryState();
152
- const [menuItemIds, setMenuItemIds] = useState(_temp);
153
90
  const navRef = useRef(null);
154
91
  let t3;
155
92
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
156
- t3 = () => {
157
- if (!listRef.current) {
158
- return;
159
- }
160
- const g = window.getComputedStyle(listRef.current).gap;
161
- const parsed = parseFloat(g);
162
- if (!Number.isNaN(parsed)) {
163
- setComputedGap(parsed);
93
+ t3 = {
94
+ containerRef: listRef,
95
+ bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
96
+ focusOutBehavior: "wrap",
97
+ strict: true,
98
+ getNextFocusable: (direction, from) => {
99
+ var _listRef$current$quer, _listRef$current;
100
+ const items = Array.from((_listRef$current$quer = (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.querySelectorAll(FOCUSABLE_ITEM_SELECTOR)) !== null && _listRef$current$quer !== void 0 ? _listRef$current$quer : []);
101
+ const fromIndex = from ? items.indexOf(from) : -1;
102
+ switch (direction) {
103
+ case "start":
104
+ {
105
+ return items[0];
106
+ }
107
+ case "end":
108
+ {
109
+ return items.at(-1);
110
+ }
111
+ case "next":
112
+ {
113
+ var _items;
114
+ return (_items = items[fromIndex + 1]) !== null && _items !== void 0 ? _items : items[0];
115
+ }
116
+ case "previous":
117
+ {
118
+ var _items2;
119
+ return (_items2 = items[fromIndex - 1]) !== null && _items2 !== void 0 ? _items2 : items.at(-1);
120
+ }
121
+ }
164
122
  }
165
123
  };
166
124
  $[0] = t3;
167
125
  } else {
168
126
  t3 = $[0];
169
127
  }
128
+ useFocusZone(t3);
170
129
  let t4;
171
- if ($[1] !== gap) {
172
- t4 = [gap];
173
- $[1] = gap;
130
+ if ($[1] !== childRegistry) {
131
+ t4 = childRegistry && Array.from(childRegistry.entries()).filter(_temp);
132
+ $[1] = childRegistry;
174
133
  $[2] = t4;
175
134
  } else {
176
135
  t4 = $[2];
177
136
  }
178
- useIsomorphicLayoutEffect(t3, t4);
179
- const moreMenuRef = useRef(null);
137
+ const overflowItems = t4;
180
138
  let t5;
181
- if ($[3] !== childRegistry || $[4] !== computedGap || $[5] !== menuItemIds.size) {
182
- t5 = resizeObserverEntries => {
183
- var _moreMenuRef$current$, _moreMenuRef$current;
184
- const navWidth = resizeObserverEntries[0].contentRect.width;
185
- const moreMenuWidth = (_moreMenuRef$current$ = (_moreMenuRef$current = moreMenuRef.current) === null || _moreMenuRef$current === void 0 ? void 0 : _moreMenuRef$current.getBoundingClientRect().width) !== null && _moreMenuRef$current$ !== void 0 ? _moreMenuRef$current$ : 0;
186
- const hasActiveMenu = menuItemIds.size > 0;
187
- if (navWidth > 0) {
188
- const newMenuItemIds = getMenuItems(navWidth, moreMenuWidth, childRegistry, hasActiveMenu, computedGap);
189
- if (newMenuItemIds) {
190
- setMenuItemIds(newMenuItemIds);
191
- }
192
- }
139
+ if ($[3] !== size) {
140
+ t5 = {
141
+ size
193
142
  };
194
- $[3] = childRegistry;
195
- $[4] = computedGap;
196
- $[5] = menuItemIds.size;
197
- $[6] = t5;
143
+ $[3] = size;
144
+ $[4] = t5;
198
145
  } else {
199
- t5 = $[6];
146
+ t5 = $[4];
200
147
  }
201
- useResizeObserver(t5, navRef);
202
148
  let t6;
203
- if ($[7] !== menuItemIds) {
204
- t6 = id => !menuItemIds.has(id);
205
- $[7] = menuItemIds;
206
- $[8] = t6;
149
+ if ($[5] !== className) {
150
+ t6 = clsx(className, styles.Nav);
151
+ $[5] = className;
152
+ $[6] = t6;
207
153
  } else {
208
- t6 = $[8];
154
+ t6 = $[6];
209
155
  }
210
- const isVisibleChild = t6;
211
- let t7;
212
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
213
- t7 = {
214
- containerRef: listRef,
215
- bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
216
- focusOutBehavior: "wrap"
217
- };
218
- $[9] = t7;
156
+ const t7 = overflowItems ? overflowItems.length > 0 : undefined;
157
+ let t8;
158
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
159
+ t8 = /*#__PURE__*/jsx("div", {});
160
+ $[7] = t8;
219
161
  } else {
220
- t7 = $[9];
221
- }
222
- useFocusZone(t7);
223
- let groupedItemsMap;
224
- if ($[10] !== childRegistry) {
225
- groupedItemsMap = new Map();
226
- for (const [key, childProps] of childRegistry !== null && childRegistry !== void 0 ? childRegistry : []) {
227
- if (childProps.type === "action" && childProps.groupId) {
228
- const existingGroup = groupedItemsMap.get(childProps.groupId) || [];
229
- existingGroup.push([key, childProps]);
230
- groupedItemsMap.set(childProps.groupId, existingGroup);
231
- }
232
- }
233
- $[10] = childRegistry;
234
- $[11] = groupedItemsMap;
162
+ t8 = $[7];
163
+ }
164
+ let t9;
165
+ if ($[8] !== children || $[9] !== setChildRegistry) {
166
+ t9 = /*#__PURE__*/jsxs("div", {
167
+ className: styles.OverflowContainer,
168
+ children: [t8, /*#__PURE__*/jsx(ActionBarItemsRegistry.Provider, {
169
+ setRegistry: setChildRegistry,
170
+ children: children
171
+ })]
172
+ });
173
+ $[8] = children;
174
+ $[9] = setChildRegistry;
175
+ $[10] = t9;
235
176
  } else {
236
- groupedItemsMap = $[11];
177
+ t9 = $[10];
237
178
  }
238
- const groupedItems = groupedItemsMap;
239
- let t8;
240
- if ($[12] !== isVisibleChild || $[13] !== size) {
241
- t8 = {
242
- size,
243
- isVisibleChild
244
- };
245
- $[12] = isVisibleChild;
246
- $[13] = size;
247
- $[14] = t8;
179
+ const t10 = `More ${ariaLabel} items ${overflowItems === null || overflowItems === void 0 ? void 0 : overflowItems.length}`;
180
+ const t11 = overflowItems !== null && overflowItems !== void 0 && overflowItems.length ? undefined : true;
181
+ let t12;
182
+ if ($[11] !== size || $[12] !== t10 || $[13] !== t11) {
183
+ t12 = /*#__PURE__*/jsx(ActionMenu.Anchor, {
184
+ children: /*#__PURE__*/jsx(IconButton, {
185
+ variant: "invisible",
186
+ "aria-label": t10,
187
+ icon: KebabHorizontalIcon,
188
+ className: styles.MoreButton,
189
+ "data-more-button-inactive": t11,
190
+ size: size
191
+ })
192
+ });
193
+ $[11] = size;
194
+ $[12] = t10;
195
+ $[13] = t11;
196
+ $[14] = t12;
248
197
  } else {
249
- t8 = $[14];
198
+ t12 = $[14];
250
199
  }
251
- let t9;
252
- if ($[15] !== className) {
253
- t9 = clsx(className, styles.Nav);
254
- $[15] = className;
255
- $[16] = t9;
200
+ let t13;
201
+ if ($[15] !== overflowItems) {
202
+ t13 = overflowItems === null || overflowItems === void 0 ? void 0 : overflowItems.map(_temp3);
203
+ $[15] = overflowItems;
204
+ $[16] = t13;
256
205
  } else {
257
- t9 = $[16];
206
+ t13 = $[16];
258
207
  }
259
- let t10;
260
- if ($[17] !== children || $[18] !== setChildRegistry) {
261
- t10 = /*#__PURE__*/jsx(ActionBarItemsRegistry.Provider, {
262
- setRegistry: setChildRegistry,
263
- children: children
208
+ let t14;
209
+ if ($[17] !== t13) {
210
+ t14 = /*#__PURE__*/jsx(ActionMenu.Overlay, {
211
+ children: /*#__PURE__*/jsx(ActionList, {
212
+ children: t13
213
+ })
264
214
  });
265
- $[17] = children;
266
- $[18] = setChildRegistry;
267
- $[19] = t10;
215
+ $[17] = t13;
216
+ $[18] = t14;
268
217
  } else {
269
- t10 = $[19];
218
+ t14 = $[18];
270
219
  }
271
- let t11;
272
- if ($[20] !== ariaLabel || $[21] !== childRegistry || $[22] !== groupedItems || $[23] !== menuItemIds) {
273
- t11 = menuItemIds.size > 0 && /*#__PURE__*/jsxs(ActionMenu, {
274
- children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
275
- children: /*#__PURE__*/jsx(IconButton, {
276
- variant: "invisible",
277
- "aria-label": `More ${ariaLabel} items`,
278
- icon: KebabHorizontalIcon
279
- })
280
- }), /*#__PURE__*/jsx(ActionMenu.Overlay, {
281
- children: /*#__PURE__*/jsx(ActionList, {
282
- children: Array.from(menuItemIds).map(id_0 => {
283
- const menuItem = childRegistry === null || childRegistry === void 0 ? void 0 : childRegistry.get(id_0);
284
- if (!menuItem) {
285
- return null;
286
- }
287
- if (menuItem.type === "divider") {
288
- return /*#__PURE__*/jsx(ActionList.Divider, {}, id_0);
289
- } else {
290
- if (menuItem.type === "action") {
291
- const {
292
- onClick,
293
- icon: Icon,
294
- label,
295
- disabled
296
- } = menuItem;
297
- return /*#__PURE__*/jsxs(ActionList.Item, {
298
- onSelect: event => {
299
- typeof onClick === "function" && onClick(event);
300
- },
301
- disabled: disabled,
302
- children: [/*#__PURE__*/jsx(ActionList.LeadingVisual, {
303
- children: /*#__PURE__*/jsx(Icon, {})
304
- }), label]
305
- }, label);
306
- }
307
- }
308
- if (menuItem.type === "menu") {
309
- const menuItems = menuItem.items;
310
- const {
311
- icon: Icon_0,
312
- label: label_0,
313
- returnFocusRef
314
- } = menuItem;
315
- return /*#__PURE__*/jsxs(ActionMenu, {
316
- children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
317
- children: /*#__PURE__*/jsxs(ActionList.Item, {
318
- children: [Icon_0 !== "none" ? /*#__PURE__*/jsx(ActionList.LeadingVisual, {
319
- children: /*#__PURE__*/jsx(Icon_0, {})
320
- }) : null, label_0]
321
- })
322
- }), /*#__PURE__*/jsx(ActionMenu.Overlay, {
323
- ...(returnFocusRef && {
324
- returnFocusRef
325
- }),
326
- children: /*#__PURE__*/jsx(ActionList, {
327
- children: menuItems.map(_temp2)
328
- })
329
- })]
330
- }, id_0);
331
- }
332
- const groupedMenuItems = groupedItems.get(id_0) || [];
333
- if (menuItem.type === "group") {
334
- return /*#__PURE__*/jsx(React.Fragment, {
335
- children: groupedMenuItems.map(_temp3)
336
- }, id_0);
337
- }
338
- })
339
- })
340
- })]
220
+ let t15;
221
+ if ($[19] !== t12 || $[20] !== t14) {
222
+ t15 = /*#__PURE__*/jsxs(ActionMenu, {
223
+ children: [t12, t14]
341
224
  });
342
- $[20] = ariaLabel;
343
- $[21] = childRegistry;
344
- $[22] = groupedItems;
345
- $[23] = menuItemIds;
346
- $[24] = t11;
225
+ $[19] = t12;
226
+ $[20] = t14;
227
+ $[21] = t15;
347
228
  } else {
348
- t11 = $[24];
229
+ t15 = $[21];
349
230
  }
350
- let t12;
351
- if ($[25] !== ariaLabel || $[26] !== ariaLabelledBy || $[27] !== gap || $[28] !== t10 || $[29] !== t11) {
352
- t12 = /*#__PURE__*/jsxs("div", {
231
+ let t16;
232
+ if ($[22] !== ariaLabel || $[23] !== ariaLabelledBy || $[24] !== gap || $[25] !== size || $[26] !== t15 || $[27] !== t7 || $[28] !== t9) {
233
+ t16 = /*#__PURE__*/jsxs("div", {
353
234
  ref: listRef,
354
235
  role: "toolbar",
355
236
  className: styles.List,
356
237
  "aria-label": ariaLabel,
357
238
  "aria-labelledby": ariaLabelledBy,
358
239
  "data-gap": gap,
359
- children: [t10, t11]
240
+ "data-size": size,
241
+ "data-has-overflow": t7,
242
+ children: [t9, t15]
360
243
  });
361
- $[25] = ariaLabel;
362
- $[26] = ariaLabelledBy;
363
- $[27] = gap;
364
- $[28] = t10;
365
- $[29] = t11;
366
- $[30] = t12;
244
+ $[22] = ariaLabel;
245
+ $[23] = ariaLabelledBy;
246
+ $[24] = gap;
247
+ $[25] = size;
248
+ $[26] = t15;
249
+ $[27] = t7;
250
+ $[28] = t9;
251
+ $[29] = t16;
367
252
  } else {
368
- t12 = $[30];
253
+ t16 = $[29];
369
254
  }
370
- let t13;
371
- if ($[31] !== flush || $[32] !== t12 || $[33] !== t9) {
372
- t13 = /*#__PURE__*/jsx("div", {
255
+ let t17;
256
+ if ($[30] !== flush || $[31] !== t16 || $[32] !== t6) {
257
+ t17 = /*#__PURE__*/jsx("div", {
373
258
  ref: navRef,
374
- className: t9,
259
+ className: t6,
375
260
  "data-flush": flush,
376
- children: t12
261
+ children: t16
377
262
  });
378
- $[31] = flush;
379
- $[32] = t12;
380
- $[33] = t9;
381
- $[34] = t13;
263
+ $[30] = flush;
264
+ $[31] = t16;
265
+ $[32] = t6;
266
+ $[33] = t17;
382
267
  } else {
383
- t13 = $[34];
268
+ t17 = $[33];
384
269
  }
385
- let t14;
386
- if ($[35] !== t13 || $[36] !== t8) {
387
- t14 = /*#__PURE__*/jsx(ActionBarContext.Provider, {
388
- value: t8,
389
- children: t13
270
+ let t18;
271
+ if ($[34] !== t17 || $[35] !== t5) {
272
+ t18 = /*#__PURE__*/jsx(ActionBarContext.Provider, {
273
+ value: t5,
274
+ children: t17
390
275
  });
391
- $[35] = t13;
392
- $[36] = t8;
393
- $[37] = t14;
276
+ $[34] = t17;
277
+ $[35] = t5;
278
+ $[36] = t18;
394
279
  } else {
395
- t14 = $[37];
280
+ t18 = $[36];
396
281
  }
397
- return t14;
282
+ return t18;
398
283
  };
399
- function useWidth(ref) {
400
- const $ = c(3);
401
- const [width, setWidth] = useState(-1);
284
+ function useActionBarItem(ref, registryProps) {
285
+ var _useContext;
286
+ const $ = c(8);
287
+ const isGroupOverflowing = (_useContext = useContext(ActionBarGroupContext)) === null || _useContext === void 0 ? void 0 : _useContext.isOverflowing;
288
+ const isInGroup = isGroupOverflowing !== undefined;
402
289
  let t0;
290
+ if ($[0] !== isInGroup || $[1] !== ref) {
291
+ t0 = onChange => {
292
+ if (isInGroup) {
293
+ return _temp4;
294
+ }
295
+ const observer = new IntersectionObserver(() => onChange(), {
296
+ threshold: 1
297
+ });
298
+ if (ref.current) {
299
+ observer.observe(ref.current);
300
+ }
301
+ return () => observer.disconnect();
302
+ };
303
+ $[0] = isInGroup;
304
+ $[1] = ref;
305
+ $[2] = t0;
306
+ } else {
307
+ t0 = $[2];
308
+ }
309
+ const subscribeIntersectionObserver = t0;
403
310
  let t1;
404
- if ($[0] !== ref) {
405
- t0 = () => {
406
- var _ref$current$getBound, _ref$current;
407
- return setWidth((_ref$current$getBound = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect().width) !== null && _ref$current$getBound !== void 0 ? _ref$current$getBound : -1);
311
+ if ($[3] !== ref) {
312
+ t1 = () => ref.current ? ref.current.offsetTop > 0 : false;
313
+ $[3] = ref;
314
+ $[4] = t1;
315
+ } else {
316
+ t1 = $[4];
317
+ }
318
+ const isItemOverflowing = useSyncExternalStore(subscribeIntersectionObserver, t1, _temp5);
319
+ const isOverflowing = isGroupOverflowing || isItemOverflowing;
320
+ ActionBarItemsRegistry.useRegisterDescendant(isOverflowing ? registryProps : null);
321
+ const t2 = isOverflowing ? "" : undefined;
322
+ let t3;
323
+ if ($[5] !== isOverflowing || $[6] !== t2) {
324
+ t3 = {
325
+ isOverflowing,
326
+ dataOverflowingAttr: t2
408
327
  };
409
- t1 = [ref];
410
- $[0] = ref;
411
- $[1] = t0;
412
- $[2] = t1;
328
+ $[5] = isOverflowing;
329
+ $[6] = t2;
330
+ $[7] = t3;
413
331
  } else {
414
- t0 = $[1];
415
- t1 = $[2];
332
+ t3 = $[7];
416
333
  }
417
- useIsomorphicLayoutEffect(t0, t1);
418
- return width;
334
+ return t3;
335
+ }
336
+ function _temp5() {
337
+ return false;
419
338
  }
339
+ function _temp4() {}
420
340
  const ActionBarIconButton = /*#__PURE__*/forwardRef(({
421
341
  disabled,
422
342
  onClick,
@@ -425,44 +345,36 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef(({
425
345
  const ref = useRef(null);
426
346
  const mergedRef = useMergedRefs(ref, forwardedRef);
427
347
  const {
428
- size,
429
- isVisibleChild
348
+ size
430
349
  } = React.useContext(ActionBarContext);
431
- const {
432
- groupId
433
- } = React.useContext(ActionBarGroupContext);
434
- const width = useWidth(ref);
435
350
  const {
436
351
  ['aria-label']: ariaLabel,
437
352
  icon
438
353
  } = props;
439
- const registryProps = useMemo(() => ({
354
+ const {
355
+ dataOverflowingAttr
356
+ } = useActionBarItem(ref, useMemo(() => ({
440
357
  type: 'action',
441
358
  label: ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : '',
442
359
  icon,
443
360
  disabled: !!disabled,
444
- onClick: onClick,
445
- width,
446
- groupId: groupId !== null && groupId !== void 0 ? groupId : undefined
447
- }), [ariaLabel, icon, disabled, onClick, groupId, width]);
448
- const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
361
+ onClick: onClick
362
+ }), [ariaLabel, icon, disabled, onClick]));
449
363
  const clickHandler = useCallback(event => {
450
364
  if (disabled) return;
451
365
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
452
366
  }, [disabled, onClick]);
453
- if (!isVisibleChild(id) || groupId && !isVisibleChild(groupId)) return null;
454
367
  return /*#__PURE__*/jsx(IconButton, {
455
368
  "aria-disabled": disabled,
456
369
  ref: mergedRef,
457
370
  size: size,
458
371
  onClick: clickHandler,
459
372
  ...props,
460
- variant: "invisible"
373
+ variant: "invisible",
374
+ "data-overflowing": dataOverflowingAttr
461
375
  });
462
376
  });
463
- const ActionBarGroupContext = /*#__PURE__*/React.createContext({
464
- groupId: null
465
- });
377
+ const ActionBarGroupContext = /*#__PURE__*/React.createContext(null);
466
378
  const ActionBarGroup = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
467
379
  const $ = c(10);
468
380
  const {
@@ -470,38 +382,39 @@ const ActionBarGroup = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
470
382
  } = t0;
471
383
  const backupRef = useRef(null);
472
384
  const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
473
- const width = useWidth(ref);
474
385
  let t1;
475
- if ($[0] !== width) {
386
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
476
387
  t1 = {
477
- type: "group",
478
- width
388
+ type: "group"
479
389
  };
480
- $[0] = width;
481
- $[1] = t1;
390
+ $[0] = t1;
482
391
  } else {
483
- t1 = $[1];
392
+ t1 = $[0];
484
393
  }
485
- const registryProps = t1;
486
- const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
394
+ const {
395
+ dataOverflowingAttr,
396
+ isOverflowing
397
+ } = useActionBarItem(ref, t1);
487
398
  let t2;
488
- if ($[2] !== id) {
399
+ if ($[1] !== isOverflowing) {
489
400
  t2 = {
490
- groupId: id
401
+ isOverflowing
491
402
  };
492
- $[2] = id;
493
- $[3] = t2;
403
+ $[1] = isOverflowing;
404
+ $[2] = t2;
494
405
  } else {
495
- t2 = $[3];
406
+ t2 = $[2];
496
407
  }
497
408
  let t3;
498
- if ($[4] !== children || $[5] !== ref) {
409
+ if ($[3] !== children || $[4] !== dataOverflowingAttr || $[5] !== ref) {
499
410
  t3 = /*#__PURE__*/jsx("div", {
500
411
  className: styles.Group,
501
412
  ref: ref,
413
+ "data-overflowing": dataOverflowingAttr,
502
414
  children: children
503
415
  });
504
- $[4] = children;
416
+ $[3] = children;
417
+ $[4] = dataOverflowingAttr;
505
418
  $[5] = ref;
506
419
  $[6] = t3;
507
420
  } else {
@@ -555,17 +468,12 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
555
468
  }
556
469
  const backupRef = useRef(null);
557
470
  const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
558
- const {
559
- isVisibleChild
560
- } = React.useContext(ActionBarContext);
561
471
  const [menuOpen, setMenuOpen] = useState(false);
562
- const width = useWidth(ref);
563
472
  const t1 = overflowIcon ? overflowIcon : icon;
564
473
  let t2;
565
- if ($[7] !== ariaLabel || $[8] !== items || $[9] !== returnFocusRef || $[10] !== t1 || $[11] !== width) {
474
+ if ($[7] !== ariaLabel || $[8] !== items || $[9] !== returnFocusRef || $[10] !== t1) {
566
475
  t2 = {
567
476
  type: "menu",
568
- width,
569
477
  label: ariaLabel,
570
478
  icon: t1,
571
479
  returnFocusRef,
@@ -575,27 +483,26 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
575
483
  $[8] = items;
576
484
  $[9] = returnFocusRef;
577
485
  $[10] = t1;
578
- $[11] = width;
579
- $[12] = t2;
486
+ $[11] = t2;
580
487
  } else {
581
- t2 = $[12];
582
- }
583
- const registryProps = t2;
584
- const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
585
- if (!isVisibleChild(id)) {
586
- return null;
488
+ t2 = $[11];
587
489
  }
490
+ const {
491
+ dataOverflowingAttr
492
+ } = useActionBarItem(ref, t2);
588
493
  let t3;
589
- if ($[13] !== ariaLabel || $[14] !== icon || $[15] !== props) {
494
+ if ($[12] !== ariaLabel || $[13] !== dataOverflowingAttr || $[14] !== icon || $[15] !== props) {
590
495
  t3 = /*#__PURE__*/jsx(ActionMenu.Anchor, {
591
496
  children: /*#__PURE__*/jsx(IconButton, {
592
497
  variant: "invisible",
593
498
  "aria-label": ariaLabel,
594
499
  icon: icon,
595
- ...props
500
+ ...props,
501
+ "data-overflowing": dataOverflowingAttr
596
502
  })
597
503
  });
598
- $[13] = ariaLabel;
504
+ $[12] = ariaLabel;
505
+ $[13] = dataOverflowingAttr;
599
506
  $[14] = icon;
600
507
  $[15] = props;
601
508
  $[16] = t3;
@@ -614,7 +521,7 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
614
521
  }
615
522
  let t5;
616
523
  if ($[19] !== items) {
617
- t5 = items.map(_temp4);
524
+ t5 = items.map(_temp6);
618
525
  $[19] = items;
619
526
  $[20] = t5;
620
527
  } else {
@@ -663,68 +570,88 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
663
570
  const VerticalDivider = () => {
664
571
  const $ = c(3);
665
572
  const ref = useRef(null);
666
- const {
667
- isVisibleChild
668
- } = React.useContext(ActionBarContext);
669
- const width = useWidth(ref);
670
573
  let t0;
671
- if ($[0] !== width) {
574
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
672
575
  t0 = {
673
- type: "divider",
674
- width
576
+ type: "divider"
675
577
  };
676
- $[0] = width;
677
- $[1] = t0;
578
+ $[0] = t0;
678
579
  } else {
679
- t0 = $[1];
680
- }
681
- const registryProps = t0;
682
- const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
683
- if (!isVisibleChild(id)) {
684
- return null;
580
+ t0 = $[0];
685
581
  }
582
+ const {
583
+ dataOverflowingAttr
584
+ } = useActionBarItem(ref, t0);
686
585
  let t1;
687
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
586
+ if ($[1] !== dataOverflowingAttr) {
688
587
  t1 = /*#__PURE__*/jsx("div", {
689
588
  ref: ref,
690
589
  "data-component": "ActionBar.VerticalDivider",
691
590
  "aria-hidden": "true",
692
- className: styles.Divider
591
+ className: styles.Divider,
592
+ "data-overflowing": dataOverflowingAttr
693
593
  });
594
+ $[1] = dataOverflowingAttr;
694
595
  $[2] = t1;
695
596
  } else {
696
597
  t1 = $[2];
697
598
  }
698
599
  return t1;
699
600
  };
700
- function _temp() {
701
- return new Set();
601
+ function _temp(entry) {
602
+ return entry[1] !== null;
702
603
  }
703
604
  function _temp2(item, index) {
704
605
  return renderMenuItem(item, index);
705
606
  }
706
607
  function _temp3(t0) {
707
- const [key_0, childProps_0] = t0;
708
- if (childProps_0.type === "action") {
608
+ const [id, menuItem] = t0;
609
+ if (menuItem.type === "divider") {
610
+ return /*#__PURE__*/jsx(ActionList.Divider, {}, id);
611
+ }
612
+ if (menuItem.type === "action") {
709
613
  const {
710
- onClick: onClick_0,
711
- icon: Icon_1,
712
- label: label_1,
713
- disabled: disabled_0
714
- } = childProps_0;
614
+ onClick,
615
+ icon: Icon,
616
+ label,
617
+ disabled
618
+ } = menuItem;
715
619
  return /*#__PURE__*/jsxs(ActionList.Item, {
716
- onSelect: event_0 => {
717
- typeof onClick_0 === "function" && onClick_0(event_0);
620
+ onSelect: event => {
621
+ typeof onClick === "function" && onClick(event);
718
622
  },
719
- disabled: disabled_0,
623
+ disabled: disabled,
720
624
  children: [/*#__PURE__*/jsx(ActionList.LeadingVisual, {
721
- children: /*#__PURE__*/jsx(Icon_1, {})
722
- }), label_1]
723
- }, key_0);
625
+ children: /*#__PURE__*/jsx(Icon, {})
626
+ }), label]
627
+ }, label);
628
+ }
629
+ if (menuItem.type === "menu") {
630
+ const menuItems = menuItem.items;
631
+ const {
632
+ icon: Icon_0,
633
+ label: label_0,
634
+ returnFocusRef
635
+ } = menuItem;
636
+ return /*#__PURE__*/jsxs(ActionMenu, {
637
+ children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
638
+ children: /*#__PURE__*/jsxs(ActionList.Item, {
639
+ children: [Icon_0 !== "none" ? /*#__PURE__*/jsx(ActionList.LeadingVisual, {
640
+ children: /*#__PURE__*/jsx(Icon_0, {})
641
+ }) : null, label_0]
642
+ })
643
+ }), /*#__PURE__*/jsx(ActionMenu.Overlay, {
644
+ ...(returnFocusRef && {
645
+ returnFocusRef
646
+ }),
647
+ children: /*#__PURE__*/jsx(ActionList, {
648
+ children: menuItems.map(_temp2)
649
+ })
650
+ })]
651
+ }, id);
724
652
  }
725
- return null;
726
653
  }
727
- function _temp4(item, index) {
654
+ function _temp6(item, index) {
728
655
  return renderMenuItem(item, index);
729
656
  }
730
657
 
@@ -1,5 +1,5 @@
1
- import './ActionBar-a41224b2.css';
1
+ import './ActionBar-3f7b52a3.css';
2
2
 
3
- var styles = {"List":"prc-ActionBar-List-9uz46","Divider":"prc-ActionBar-Divider-6V8yH","Nav":"prc-ActionBar-Nav-9spON","Group":"prc-ActionBar-Group-peNCk"};
3
+ var styles = {"List":"prc-ActionBar-List-9uz46","detect-overflow":"prc-ActionBar-detect-overflow-mAuJu","Divider":"prc-ActionBar-Divider-6V8yH","Nav":"prc-ActionBar-Nav-9spON","Group":"prc-ActionBar-Group-peNCk","OverflowContainer":"prc-ActionBar-OverflowContainer-AkYZs","MoreButton":"prc-ActionBar-MoreButton-RHqpx"};
4
4
 
5
5
  export { styles as default };
@@ -1,7 +1,7 @@
1
1
  export type { ActionBarProps, ActionBarMenuProps, ActionBarMenuItemProps } from './ActionBar';
2
2
  declare const ActionBar: import("react").FC<import("react").PropsWithChildren<import("./ActionBar").ActionBarProps>> & {
3
3
  IconButton: import("react").ForwardRefExoticComponent<import("./ActionBar").ActionBarIconButtonProps & import("react").RefAttributes<unknown>>;
4
- Divider: () => import("react").JSX.Element | null;
4
+ Divider: () => import("react").JSX.Element;
5
5
  Group: import("react").ForwardRefExoticComponent<{
6
6
  children?: import("react").ReactNode | undefined;
7
7
  } & import("react").RefAttributes<unknown>>;
@@ -1,2 +1,2 @@
1
- .prc-Breadcrumbs-BreadcrumbsBase-3Gb-B{display:flex;justify-content:space-between;width:100%}.prc-Breadcrumbs-BreadcrumbsList-BKjpe{margin-bottom:0;margin-top:0;padding-left:0}:is([data-overflow=menu],[data-overflow=menu-with-root]) .prc-Breadcrumbs-BreadcrumbsList-BKjpe{display:flex;flex-direction:row;white-space:nowrap}.prc-Breadcrumbs-ItemSeparator-kjXqh{align-self:center;color:var(--fgColor-muted,var(--color-fg-muted));display:flex;justify-content:center;-webkit-user-select:none;user-select:none;white-space:nowrap}.prc-Breadcrumbs-ItemWrapper-k0NLn{list-style:none}.prc-Breadcrumbs-ItemWrapper-k0NLn,.prc-Breadcrumbs-ItemWrapper-k0NLn:after{display:inline-block;font-size:var(--text-body-size-medium,.875rem)}.prc-Breadcrumbs-ItemWrapper-k0NLn:after{border-right:.1em solid var(--fgColor-muted,var(--color-fg-muted));content:"";height:.8em;margin:0 .5em;transform:rotate(15deg) translateY(.0625em)}.prc-Breadcrumbs-ItemWrapper-k0NLn:first-child{margin-left:0}.prc-Breadcrumbs-ItemWrapper-k0NLn:last-child:after{content:none}.prc-Breadcrumbs-Item-jcraJ{display:inline-block;font-size:var(--text-body-size-medium,.875rem)}.prc-Breadcrumbs-Item-jcraJ:focus-visible{border-radius:var(--borderRadius-small,.1875rem);box-shadow:none;outline:2px solid var(--focus-outlineColor,var(--color-accent-fg));outline-offset:2px}[data-variant=normal] .prc-Breadcrumbs-Item-jcraJ{color:var(--fgColor-link,var(--color-accent-fg));-webkit-text-decoration:none;text-decoration:none}:is([data-variant=normal] .prc-Breadcrumbs-Item-jcraJ):not([aria-current]):hover{-webkit-text-decoration:underline;text-decoration:underline}:is([data-variant=normal] .prc-Breadcrumbs-Item-jcraJ):focus-visible{-webkit-text-decoration:none;text-decoration:none}[aria-current]:is([data-variant=normal] .prc-Breadcrumbs-Item-jcraJ){color:var(--fgColor-default,var(--color-fg-default))}[data-variant=spacious] .prc-Breadcrumbs-Item-jcraJ{border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-default,var(--color-fg-default));padding-block:var(--base-size-4,.25rem);padding-inline:var(--base-size-6,.375rem);-webkit-text-decoration:none;text-decoration:none}:is([data-variant=spacious] .prc-Breadcrumbs-Item-jcraJ):hover{background:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg));-webkit-text-decoration:none;text-decoration:none}[aria-current]:is([data-variant=spacious] .prc-Breadcrumbs-Item-jcraJ){font-weight:var(--base-text-weight-semibold,600)}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs{align-items:center;display:inline-grid;flex:0 99999 auto;grid-auto-flow:column;list-style:none;min-width:auto;white-space:nowrap}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs:has(.prc-Breadcrumbs-MenuOverlay--ayLx){white-space:normal}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs:first-child{margin-left:0}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs:last-child .prc-Breadcrumbs-ItemSeparator-kjXqh{display:none}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuDetails-JOGTj{display:inline-block;position:relative}:is(.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuDetails-JOGTj) summary{cursor:pointer;list-style:none}:is(:is(.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuDetails-JOGTj) summary)::-webkit-details-marker{display:none}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuOverlay--ayLx{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));max-height:100vh;max-width:var(--overlay-width-small,20rem);min-width:var(--overlay-width-xsmall,12rem);overflow:hidden;position:absolute;top:calc(var(--overlay-offset,.25rem) + var(--control-small-size,1.75rem));z-index:1}@media (prefers-reduced-motion:no-preference){.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuOverlay--ayLx{animation:prc-Breadcrumbs-overlay-appear-CSLnF .2s cubic-bezier(.33,1,.68,1)}}@media screen and (max-width:543.98px){.prc-Breadcrumbs-ItemWrapper-k0NLn[data-narrow-hidden]{display:none}.prc-Breadcrumbs-ItemWrapper-k0NLn[data-narrow-last]:after{content:none}}
2
- /*# sourceMappingURL=Breadcrumbs-a44d6835.css.map */
1
+ .prc-Breadcrumbs-BreadcrumbsBase-3Gb-B{display:flex;justify-content:space-between;width:100%}.prc-Breadcrumbs-BreadcrumbsList-BKjpe{margin-bottom:0;margin-top:0;padding-left:0}:is([data-overflow=menu],[data-overflow=menu-with-root]) .prc-Breadcrumbs-BreadcrumbsList-BKjpe{display:flex;flex-direction:row;white-space:nowrap}.prc-Breadcrumbs-ItemSeparator-kjXqh{align-self:center;color:var(--fgColor-muted,var(--color-fg-muted));display:flex;justify-content:center;-webkit-user-select:none;user-select:none;white-space:nowrap}.prc-Breadcrumbs-ItemWrapper-k0NLn{list-style:none}.prc-Breadcrumbs-ItemWrapper-k0NLn,.prc-Breadcrumbs-ItemWrapper-k0NLn:after{display:inline-block;font-size:var(--text-body-size-medium,.875rem)}.prc-Breadcrumbs-ItemWrapper-k0NLn:after{border-right:.1em solid var(--fgColor-muted,var(--color-fg-muted));content:"";height:.8em;margin:0 .5em;transform:rotate(15deg) translateY(.0625em)}.prc-Breadcrumbs-ItemWrapper-k0NLn:first-child{margin-left:0}.prc-Breadcrumbs-ItemWrapper-k0NLn:last-child:after{content:none}.prc-Breadcrumbs-Item-jcraJ{display:inline-block;font-size:var(--text-body-size-medium,.875rem)}.prc-Breadcrumbs-Item-jcraJ:focus-visible{border-radius:var(--borderRadius-small,.1875rem);box-shadow:none;outline:2px solid var(--focus-outlineColor,var(--color-accent-fg));outline-offset:2px}[data-variant=normal] .prc-Breadcrumbs-Item-jcraJ{color:var(--fgColor-link,var(--color-accent-fg));-webkit-text-decoration:none;text-decoration:none}:is([data-variant=normal] .prc-Breadcrumbs-Item-jcraJ):not([aria-current]):hover{-webkit-text-decoration:underline;text-decoration:underline}:is([data-variant=normal] .prc-Breadcrumbs-Item-jcraJ):focus-visible{-webkit-text-decoration:none;text-decoration:none}[aria-current]:is([data-variant=normal] .prc-Breadcrumbs-Item-jcraJ){color:var(--fgColor-default,var(--color-fg-default))}[data-variant=spacious] .prc-Breadcrumbs-Item-jcraJ{border-radius:var(--borderRadius-medium,.375rem);color:var(--fgColor-default,var(--color-fg-default));padding-block:var(--base-size-4,.25rem);padding-inline:var(--base-size-6,.375rem);-webkit-text-decoration:none;text-decoration:none}:is([data-variant=spacious] .prc-Breadcrumbs-Item-jcraJ):hover{background:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg));-webkit-text-decoration:none;text-decoration:none}[aria-current]:is([data-variant=spacious] .prc-Breadcrumbs-Item-jcraJ){font-weight:var(--base-text-weight-semibold,600)}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs{align-items:center;display:inline-grid;flex:0 99999 auto;grid-auto-flow:column;list-style:none;min-width:auto;white-space:nowrap}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs:has(.prc-Breadcrumbs-MenuOverlay--ayLx){white-space:normal}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs:first-child{margin-left:0}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs:last-child .prc-Breadcrumbs-ItemSeparator-kjXqh{display:none}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuDetails-JOGTj{display:inline-block;position:relative}:is(.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuDetails-JOGTj) summary{cursor:pointer;list-style:none}:is(:is(.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuDetails-JOGTj) summary)::-webkit-details-marker{display:none}.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuOverlay--ayLx{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));max-height:100vh;max-width:var(--overlay-width-small,20rem);min-width:var(--overlay-width-xsmall,12rem);overflow:hidden;position:absolute;top:calc(var(--overlay-offset,.25rem) + var(--control-small-size,1.75rem));z-index:1}@media (prefers-reduced-motion:no-preference){.prc-Breadcrumbs-BreadcrumbsItem-L-Xrs .prc-Breadcrumbs-MenuOverlay--ayLx{animation:prc-Breadcrumbs-overlay-appear-CSLnF .2s cubic-bezier(.33,1,.68,1)}}
2
+ /*# sourceMappingURL=Breadcrumbs-dbfc9d95.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Breadcrumbs/Breadcrumbs.module.css.js","../../postcss-preset-primer/src/mixins/focusOutline.css"],"names":[],"mappings":"AAAA,uCACE,YAAa,CACb,6BAA8B,CAC9B,UACF,CAEA,uCAGE,eAAgB,CADhB,YAAa,CADb,cAGF,CAIE,gGAEE,YAAa,CACb,kBAAmB,CAFnB,kBAGF,CAGF,qCAGE,iBAAkB,CAFlB,gDAA2B,CAC3B,YAAa,CAEb,sBAAuB,CAEvB,wBAAiB,CAAjB,gBAAiB,CADjB,kBAEF,CAEA,mCAGE,eAuBF,CArBE,4EAJA,oBAAqB,CACrB,8CAaA,CAVA,yCAQE,kEAA8C,CAF9C,UAAW,CAJX,WAAa,CAEb,aAAe,CAKf,2CACF,CAEA,+CACE,aACF,CAGE,oDACE,YACF,CAIJ,4BACE,oBAAqB,CACrB,8CAOF,CALE,0CACE,gDAAwC,CC5D1C,eAAgB,CAFhB,kEAAgC,CAChC,kBDgEA,CAIA,kDACE,gDAA0B,CAC1B,4BAAqB,CAArB,oBAeF,CAZI,iFACE,iCAA0B,CAA1B,yBACF,CAGF,qEACE,4BAAqB,CAArB,oBACF,CAEA,qEACE,oDACF,CAKF,oDAKE,gDAAyC,CAJzC,oDAA6B,CAG7B,uCAAiC,CADjC,yCAAkC,CADlC,4BAAqB,CAArB,oBAaF,CARE,+DACE,kGAAoD,CACpD,4BAAqB,CAArB,oBACF,CAEA,uEACE,gDACF,CAIJ,uCAGE,kBAAmB,CAFnB,mBAAoB,CAGpB,iBAAkB,CAFlB,qBAAsB,CAKtB,eAAgB,CAFhB,cAAe,CACf,kBAiDF,CA7CE,+EACE,kBACF,CAEA,mDACE,aACF,CAGE,uFACE,YACF,CAGF,0EAEE,oBAAqB,CADrB,iBAWF,CARE,uFAEE,cAAe,CADf,eAMF,CAHE,oHACE,YACF,CAIJ,0EAKE,mEAAwC,CADxC,8CAAwC,CADxC,mEAAwC,CAIxC,gBAAiB,CACjB,0CAAqC,CAFrC,2CAAsC,CAGtC,eAAgB,CARhB,iBAAkB,CAUlB,0EAA4D,CAT5D,SAcF,CAHE,8CAbF,0EAcI,4EAEJ,CADE","file":"Breadcrumbs-dbfc9d95.css","sourcesContent":[".BreadcrumbsBase {\n display: flex;\n justify-content: space-between;\n width: 100%;\n}\n\n.BreadcrumbsList {\n padding-left: 0;\n margin-top: 0;\n margin-bottom: 0;\n}\n\n[data-overflow='menu'],\n[data-overflow='menu-with-root'] {\n & .BreadcrumbsList {\n white-space: nowrap;\n display: flex;\n flex-direction: row;\n }\n}\n\n.ItemSeparator {\n color: var(--fgColor-muted);\n display: flex;\n align-self: center;\n justify-content: center;\n white-space: nowrap;\n user-select: none;\n}\n\n.ItemWrapper {\n display: inline-block;\n font-size: var(--text-body-size-medium);\n list-style: none;\n\n &::after {\n display: inline-block;\n height: 0.8em;\n /* stylelint-disable-next-line primer/spacing */\n margin: 0 0.5em;\n font-size: var(--text-body-size-medium);\n content: '';\n /* stylelint-disable-next-line primer/borders, primer/colors */\n border-right: 0.1em solid var(--fgColor-muted);\n transform: rotate(15deg) translateY(0.0625em);\n }\n\n &:first-child {\n margin-left: 0;\n }\n\n &:last-child {\n &::after {\n content: none;\n }\n }\n}\n\n.Item {\n display: inline-block;\n font-size: var(--text-body-size-medium);\n\n &:focus-visible {\n border-radius: var(--borderRadius-small);\n\n @mixin focusOutline 2px;\n }\n}\n\n[data-variant='normal'] {\n & .Item {\n color: var(--fgColor-link);\n text-decoration: none;\n\n &:not([aria-current]) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus-visible {\n text-decoration: none;\n }\n\n &[aria-current] {\n color: var(--fgColor-default);\n }\n }\n}\n\n[data-variant='spacious'] {\n & .Item {\n color: var(--fgColor-default);\n text-decoration: none;\n padding-inline: var(--base-size-6);\n padding-block: var(--base-size-4);\n border-radius: var(--borderRadius-medium);\n\n &:hover {\n background: var(--control-transparent-bgColor-hover);\n text-decoration: none;\n }\n\n &[aria-current] {\n font-weight: var(--base-text-weight-semibold);\n }\n }\n}\n\n.BreadcrumbsItem {\n display: inline-grid;\n grid-auto-flow: column;\n align-items: center;\n flex: 0 99999 auto;\n min-width: auto;\n white-space: nowrap;\n list-style: none;\n\n /* allow menu items to wrap line */\n &:has(.MenuOverlay) {\n white-space: normal;\n }\n\n &:first-child {\n margin-left: 0;\n }\n\n &:last-child {\n .ItemSeparator {\n display: none;\n }\n }\n\n .MenuDetails {\n position: relative;\n display: inline-block;\n\n & summary {\n list-style: none;\n cursor: pointer;\n\n &::-webkit-details-marker {\n display: none;\n }\n }\n }\n\n .MenuOverlay {\n position: absolute;\n z-index: 1;\n box-shadow: var(--shadow-floating-small);\n border-radius: var(--borderRadius-large);\n background-color: var(--overlay-bgColor);\n min-width: var(--overlay-width-xsmall);\n max-height: 100vh;\n max-width: var(--overlay-width-small);\n overflow: hidden;\n /* stylelint-disable-next-line primer/spacing */\n top: calc(var(--overlay-offset) + var(--control-small-size));\n\n @media (prefers-reduced-motion: no-preference) {\n animation: overlay-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);\n }\n }\n}\n","@define-mixin focusOutline $outlineOffset: -2px, $outlineColor: var(--focus-outlineColor) {\n outline: 2px solid $outlineColor;\n outline-offset: $outlineOffset;\n box-shadow: none;\n}\n"]}
@@ -23,15 +23,8 @@ export type BreadcrumbsProps = React.PropsWithChildren<{
23
23
  * Allows passing of CSS custom properties to the breadcrumbs container.
24
24
  */
25
25
  style?: React.CSSProperties;
26
- /**
27
- * The number of breadcrumb items to keep visible on narrow viewports.
28
- * On small screens, only the N items immediately before the current page
29
- * are shown (as back-navigation links). The current page itself is hidden.
30
- * @default 1
31
- */
32
- visibleItemsOnNarrow?: number;
33
26
  }>;
34
- declare function Breadcrumbs({ className, children, style, overflow, variant, visibleItemsOnNarrow, }: BreadcrumbsProps): React.JSX.Element;
27
+ declare function Breadcrumbs({ className, children, style, overflow, variant }: BreadcrumbsProps): React.JSX.Element;
35
28
  declare namespace Breadcrumbs {
36
29
  var displayName: string;
37
30
  }
@@ -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,KAA6E,MAAM,OAAO,CAAA;AAWjG,OAAO,EAAC,KAAK,gBAAgB,EAAkB,MAAM,6BAA6B,CAAA;AAElF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACrD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,gBAAgB,CAAA;IAC7C;;;;OAIG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC/B;;OAEG;IACH,KAAK,CAAC,E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AE,CAAC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { c } from 'react-compiler-runtime';
2
2
  import { clsx } from 'clsx';
3
- import React, { useRef, useMemo, useCallback, useState, useEffect } from 'react';
3
+ import React, { useRef, useCallback, useState, useMemo, useEffect } from 'react';
4
4
  import classes from './Breadcrumbs.module.css.js';
5
5
  import { ActionList } from '../ActionList/index.js';
6
6
  import { IconButton } from '../Button/IconButton.js';
@@ -211,24 +211,14 @@ function Breadcrumbs({
211
211
  children,
212
212
  style,
213
213
  overflow = 'wrap',
214
- variant = 'normal',
215
- visibleItemsOnNarrow = 1
214
+ variant = 'normal'
216
215
  }) {
217
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
+ }));
218
221
  const containerRef = useRef(null);
219
- const childArray = useMemo(() => getValidChildren(children), [children]);
220
- const visibleCountOnNarrow = Math.max(1, Math.min(visibleItemsOnNarrow, childArray.length - 1));
221
- const wrappedChildren = React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child)).map((child_0, index, arr) => {
222
- const isLast = index === arr.length - 1;
223
- const isVisibleOnNarrow = index >= arr.length - 1 - visibleCountOnNarrow && !isLast;
224
- const isLastVisibleOnNarrow = index === arr.length - 2;
225
- return /*#__PURE__*/jsx("li", {
226
- className: classes.ItemWrapper,
227
- "data-narrow-hidden": isVisibleOnNarrow ? undefined : '',
228
- "data-narrow-last": isLastVisibleOnNarrow ? '' : undefined,
229
- children: child_0
230
- }, index);
231
- });
232
222
  const measureMenuButton = useCallback(element => {
233
223
  if (element) {
234
224
  const iconButtonElement = element.querySelector('button[data-component="IconButton"]');
@@ -241,6 +231,7 @@ function Breadcrumbs({
241
231
  }, []);
242
232
  const hideRoot = !(overflow === 'menu-with-root');
243
233
  const [effectiveHideRoot, setEffectiveHideRoot] = useState(hideRoot);
234
+ const childArray = useMemo(() => getValidChildren(children), [children]);
244
235
  const rootItem = childArray[0];
245
236
 
246
237
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -257,7 +248,7 @@ function Breadcrumbs({
257
248
  const listElement = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.querySelector('ol');
258
249
  if (overflowMenuEnabled && listElement && listElement.children.length > 0 && listElement.children.length === childArray.length) {
259
250
  const listElementArray = Array.from(listElement.children);
260
- const widths = listElementArray.map(child_1 => child_1.offsetWidth);
251
+ const widths = listElementArray.map(child_0 => child_0.offsetWidth);
261
252
  setChildArrayWidths(widths);
262
253
  setRootItemWidth(listElementArray[0].offsetWidth);
263
254
  }
@@ -330,18 +321,10 @@ function Breadcrumbs({
330
321
  const finalChildren = React.useMemo(() => {
331
322
  if (overflowMenuEnabled) {
332
323
  if (overflow === 'wrap' || menuItems.length === 0) {
333
- const validChildren = React.Children.toArray(children).filter(child_2 => /*#__PURE__*/React.isValidElement(child_2));
334
- return validChildren.map((child_3, index_0) => {
335
- const isLast_0 = index_0 === validChildren.length - 1;
336
- const isVisibleOnNarrow_0 = index_0 >= validChildren.length - 1 - visibleCountOnNarrow && !isLast_0;
337
- const isLastVisibleOnNarrow_0 = index_0 === validChildren.length - 2;
338
- return /*#__PURE__*/jsx("li", {
339
- className: classes.ItemWrapper,
340
- "data-narrow-hidden": isVisibleOnNarrow_0 ? undefined : '',
341
- "data-narrow-last": isLastVisibleOnNarrow_0 ? '' : undefined,
342
- children: child_3
343
- }, index_0);
344
- });
324
+ return React.Children.map(children, child_1 => /*#__PURE__*/jsx("li", {
325
+ className: classes.ItemWrapper,
326
+ children: child_1
327
+ }));
345
328
  }
346
329
  let effectiveMenuItems = [...menuItems];
347
330
  // In 'menu-with-root' mode, include the root item inside the menu even if it's visible in the breadcrumbs
@@ -356,10 +339,10 @@ function Breadcrumbs({
356
339
  "aria-label": `${effectiveMenuItems.length} more breadcrumb items`
357
340
  }), /*#__PURE__*/jsx(ItemSeparator, {})]
358
341
  }, "breadcrumbs-menu");
359
- const visibleElements = visibleItems.map((child_4, index_1) => /*#__PURE__*/jsxs("li", {
342
+ const visibleElements = visibleItems.map((child_2, index) => /*#__PURE__*/jsxs("li", {
360
343
  className: classes.BreadcrumbsItem,
361
- children: [child_4, /*#__PURE__*/jsx(ItemSeparator, {})]
362
- }, `visible + ${index_1}`));
344
+ children: [child_2, /*#__PURE__*/jsx(ItemSeparator, {})]
345
+ }, `visible + ${index}`));
363
346
  const rootElement = /*#__PURE__*/jsxs("li", {
364
347
  className: classes.BreadcrumbsItem,
365
348
  children: [rootItem, /*#__PURE__*/jsx(ItemSeparator, {})]
@@ -372,7 +355,7 @@ function Breadcrumbs({
372
355
  return [rootElement, menuElement, ...visibleElements];
373
356
  }
374
357
  }
375
- }, [overflowMenuEnabled, overflow, menuItems, effectiveHideRoot, measureMenuButton, visibleItems, rootItem, children, visibleCountOnNarrow]);
358
+ }, [overflowMenuEnabled, overflow, menuItems, effectiveHideRoot, measureMenuButton, visibleItems, rootItem, children]);
376
359
  return overflowMenuEnabled ? /*#__PURE__*/jsx("nav", {
377
360
  className: clsx(className, classes.BreadcrumbsBase),
378
361
  "aria-label": "Breadcrumbs",
@@ -1,4 +1,4 @@
1
- import './Breadcrumbs-a44d6835.css';
1
+ import './Breadcrumbs-dbfc9d95.css';
2
2
 
3
3
  var classes = {"BreadcrumbsBase":"prc-Breadcrumbs-BreadcrumbsBase-3Gb-B","BreadcrumbsList":"prc-Breadcrumbs-BreadcrumbsList-BKjpe","ItemSeparator":"prc-Breadcrumbs-ItemSeparator-kjXqh","ItemWrapper":"prc-Breadcrumbs-ItemWrapper-k0NLn","Item":"prc-Breadcrumbs-Item-jcraJ","BreadcrumbsItem":"prc-Breadcrumbs-BreadcrumbsItem-L-Xrs","MenuOverlay":"prc-Breadcrumbs-MenuOverlay--ayLx","MenuDetails":"prc-Breadcrumbs-MenuDetails-JOGTj","overlay-appear":"prc-Breadcrumbs-overlay-appear-CSLnF"};
4
4
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@primer/react",
3
3
  "type": "module",
4
- "version": "0.0.0-20260407233157",
4
+ "version": "0.0.0-20260408162035",
5
5
  "description": "An implementation of GitHub's Primer Design System using React",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -1,2 +0,0 @@
1
- .prc-ActionBar-List-9uz46{align-items:center;display:flex;gap:var(--actionbar-gap,var(--stack-gap-condensed,.5rem));list-style:none;margin-bottom:-1px;min-width:0;position:relative;white-space:nowrap}.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-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,var(--color-border-muted));content:"";display:block;height:var(--base-size-20,1.25rem);width:var(--borderWidth-thin,.0625rem)}.prc-ActionBar-Group-peNCk{display:flex;gap:inherit}
2
- /*# sourceMappingURL=ActionBar-a41224b2.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ActionBar/ActionBar.module.css.js"],"names":[],"mappings":"AAAA,0BAUE,kBAAmB,CARnB,YAAa,CASb,yDAAqD,CAFrD,eAAgB,CAFhB,kBAAmB,CAJnB,WAAY,CAFZ,iBAAkB,CAOlB,kBAiBF,CAXE,iDACE,iBAKF,CAHE,8EACE,kCACF,CAGF,sDACE,iDACF,CAGF,yBAIE,kBAAmB,CAHnB,YAAa,CAEb,wBAAyB,CADzB,uCAOF,CAHE,kDACE,gBACF,CAIA,oCAME,6DAAoC,CAFpC,UAAW,CAHX,aAAc,CAEd,kCAA2B,CAD3B,sCAKF,CAGF,2BACE,YAAa,CACb,WACF","file":"ActionBar-a41224b2.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 white-space: nowrap;\n list-style: none;\n align-items: center;\n gap: var(--actionbar-gap, var(--stack-gap-condensed));\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\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 }\n}\n\n.Group {\n display: flex;\n gap: inherit;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/Breadcrumbs/Breadcrumbs.module.css.js","../../postcss-preset-primer/src/mixins/focusOutline.css"],"names":[],"mappings":"AAAA,uCACE,YAAa,CACb,6BAA8B,CAC9B,UACF,CAEA,uCAGE,eAAgB,CADhB,YAAa,CADb,cAGF,CAIE,gGAEE,YAAa,CACb,kBAAmB,CAFnB,kBAGF,CAGF,qCAGE,iBAAkB,CAFlB,gDAA2B,CAC3B,YAAa,CAEb,sBAAuB,CAEvB,wBAAiB,CAAjB,gBAAiB,CADjB,kBAEF,CAEA,mCAGE,eAuBF,CArBE,4EAJA,oBAAqB,CACrB,8CAaA,CAVA,yCAQE,kEAA8C,CAF9C,UAAW,CAJX,WAAa,CAEb,aAAe,CAKf,2CACF,CAEA,+CACE,aACF,CAGE,oDACE,YACF,CAIJ,4BACE,oBAAqB,CACrB,8CAOF,CALE,0CACE,gDAAwC,CC5D1C,eAAgB,CAFhB,kEAAgC,CAChC,kBDgEA,CAIA,kDACE,gDAA0B,CAC1B,4BAAqB,CAArB,oBAeF,CAZI,iFACE,iCAA0B,CAA1B,yBACF,CAGF,qEACE,4BAAqB,CAArB,oBACF,CAEA,qEACE,oDACF,CAKF,oDAKE,gDAAyC,CAJzC,oDAA6B,CAG7B,uCAAiC,CADjC,yCAAkC,CADlC,4BAAqB,CAArB,oBAaF,CARE,+DACE,kGAAoD,CACpD,4BAAqB,CAArB,oBACF,CAEA,uEACE,gDACF,CAIJ,uCAGE,kBAAmB,CAFnB,mBAAoB,CAGpB,iBAAkB,CAFlB,qBAAsB,CAKtB,eAAgB,CAFhB,cAAe,CACf,kBAiDF,CA7CE,+EACE,kBACF,CAEA,mDACE,aACF,CAGE,uFACE,YACF,CAGF,0EAEE,oBAAqB,CADrB,iBAWF,CARE,uFAEE,cAAe,CADf,eAMF,CAHE,oHACE,YACF,CAIJ,0EAKE,mEAAwC,CADxC,8CAAwC,CADxC,mEAAwC,CAIxC,gBAAiB,CACjB,0CAAqC,CAFrC,2CAAsC,CAGtC,eAAgB,CARhB,iBAAkB,CAUlB,0EAA4D,CAT5D,SAcF,CAHE,8CAbF,0EAcI,4EAEJ,CADE,CAKJ,uCACE,uDACE,YACF,CAIE,2DACE,YACF,CAEJ","file":"Breadcrumbs-a44d6835.css","sourcesContent":[".BreadcrumbsBase {\n display: flex;\n justify-content: space-between;\n width: 100%;\n}\n\n.BreadcrumbsList {\n padding-left: 0;\n margin-top: 0;\n margin-bottom: 0;\n}\n\n[data-overflow='menu'],\n[data-overflow='menu-with-root'] {\n & .BreadcrumbsList {\n white-space: nowrap;\n display: flex;\n flex-direction: row;\n }\n}\n\n.ItemSeparator {\n color: var(--fgColor-muted);\n display: flex;\n align-self: center;\n justify-content: center;\n white-space: nowrap;\n user-select: none;\n}\n\n.ItemWrapper {\n display: inline-block;\n font-size: var(--text-body-size-medium);\n list-style: none;\n\n &::after {\n display: inline-block;\n height: 0.8em;\n /* stylelint-disable-next-line primer/spacing */\n margin: 0 0.5em;\n font-size: var(--text-body-size-medium);\n content: '';\n /* stylelint-disable-next-line primer/borders, primer/colors */\n border-right: 0.1em solid var(--fgColor-muted);\n transform: rotate(15deg) translateY(0.0625em);\n }\n\n &:first-child {\n margin-left: 0;\n }\n\n &:last-child {\n &::after {\n content: none;\n }\n }\n}\n\n.Item {\n display: inline-block;\n font-size: var(--text-body-size-medium);\n\n &:focus-visible {\n border-radius: var(--borderRadius-small);\n\n @mixin focusOutline 2px;\n }\n}\n\n[data-variant='normal'] {\n & .Item {\n color: var(--fgColor-link);\n text-decoration: none;\n\n &:not([aria-current]) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus-visible {\n text-decoration: none;\n }\n\n &[aria-current] {\n color: var(--fgColor-default);\n }\n }\n}\n\n[data-variant='spacious'] {\n & .Item {\n color: var(--fgColor-default);\n text-decoration: none;\n padding-inline: var(--base-size-6);\n padding-block: var(--base-size-4);\n border-radius: var(--borderRadius-medium);\n\n &:hover {\n background: var(--control-transparent-bgColor-hover);\n text-decoration: none;\n }\n\n &[aria-current] {\n font-weight: var(--base-text-weight-semibold);\n }\n }\n}\n\n.BreadcrumbsItem {\n display: inline-grid;\n grid-auto-flow: column;\n align-items: center;\n flex: 0 99999 auto;\n min-width: auto;\n white-space: nowrap;\n list-style: none;\n\n /* allow menu items to wrap line */\n &:has(.MenuOverlay) {\n white-space: normal;\n }\n\n &:first-child {\n margin-left: 0;\n }\n\n &:last-child {\n .ItemSeparator {\n display: none;\n }\n }\n\n .MenuDetails {\n position: relative;\n display: inline-block;\n\n & summary {\n list-style: none;\n cursor: pointer;\n\n &::-webkit-details-marker {\n display: none;\n }\n }\n }\n\n .MenuOverlay {\n position: absolute;\n z-index: 1;\n box-shadow: var(--shadow-floating-small);\n border-radius: var(--borderRadius-large);\n background-color: var(--overlay-bgColor);\n min-width: var(--overlay-width-xsmall);\n max-height: 100vh;\n max-width: var(--overlay-width-small);\n overflow: hidden;\n /* stylelint-disable-next-line primer/spacing */\n top: calc(var(--overlay-offset) + var(--control-small-size));\n\n @media (prefers-reduced-motion: no-preference) {\n animation: overlay-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);\n }\n }\n}\n\n/* On narrow viewports, hide breadcrumb items marked for narrow hiding */\n@media screen and (max-width: 543.98px) {\n .ItemWrapper[data-narrow-hidden] {\n display: none;\n }\n\n /* Hide the trailing separator on the last visible item on narrow */\n .ItemWrapper[data-narrow-last] {\n &::after {\n content: none;\n }\n }\n}\n","@define-mixin focusOutline $outlineOffset: -2px, $outlineColor: var(--focus-outlineColor) {\n outline: 2px solid $outlineColor;\n outline-offset: $outlineOffset;\n box-shadow: none;\n}\n"]}