@primer/react 0.0.0-20260407184014 → 0.0.0-20260407233157

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-20260407184014
3
+ ## 0.0.0-20260407233157
4
4
 
5
5
  ### Minor Changes
6
6
 
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
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).
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: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 */
@@ -0,0 +1 @@
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"]}
@@ -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;
123
+ export declare const VerticalDivider: () => React.JSX.Element | null;
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,KAAiF,MAAM,OAAO,CAAA;AAErG,OAAO,EAAa,KAAK,mBAAmB,EAAC,MAAM,eAAe,CAAA;AAElE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,WAAW,CAAA;AAqC9C,KAAK,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;AAExC,KAAK,SAAS,GACV;IACE,wDAAwD;IACxD,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IAChD,iBAAiB,CAAC,EAAE,SAAS,CAAA;CAC9B,GACD;IACE,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAA;CAC3D,CAAA;AAEL,KAAK,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;AAEpC,MAAM,MAAM,cAAc,GAAG;IAC3B;;;SAGK;IACL,IAAI,CAAC,EAAE,IAAI,CAAA;IAEX,gCAAgC;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IAEzB;;;SAGK;IACL,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,GAA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AM,cAAc;;iCAgBzB,CAAA;AAEF,eAAO,MAAM,aAAa;IA9YxB,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;;;;;;;;;;;wGAya9C,CAAA;AAED,eAAO,MAAM,eAAe,gCAY3B,CAAA"}
@@ -1,19 +1,29 @@
1
1
  import { c } from 'react-compiler-runtime';
2
- import React, { useRef, forwardRef, useState, useMemo, useCallback, useContext, useSyncExternalStore } from 'react';
2
+ import React, { useRef, useState, forwardRef, useMemo, useCallback } 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';
5
7
  import { IconButton } from '../Button/IconButton.js';
6
8
  import { useFocusZone } from '../hooks/useFocusZone.js';
7
9
  import styles from './ActionBar.module.css.js';
8
10
  import { clsx } from 'clsx';
9
11
  import { createDescendantRegistry } from '../utils/descendant-registry.js';
10
- import { jsx, jsxs } from 'react/jsx-runtime';
12
+ import { jsxs, jsx } from 'react/jsx-runtime';
11
13
  import { useMergedRefs } from '../hooks/useMergedRefs.js';
12
14
  import { FocusKeys } from '@primer/behaviors';
13
15
  import { ActionMenu } from '../ActionMenu/ActionMenu.js';
14
16
 
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
+
15
24
  const ActionBarContext = /*#__PURE__*/React.createContext({
16
25
  size: 'medium',
26
+ isVisibleChild: () => true,
17
27
  groupId: undefined
18
28
  });
19
29
 
@@ -21,8 +31,23 @@ const ActionBarContext = /*#__PURE__*/React.createContext({
21
31
  small (28px), medium (32px), large (40px)
22
32
  */
23
33
 
34
+ const MORE_BTN_WIDTH = 32;
24
35
  const ActionBarItemsRegistry = createDescendantRegistry();
25
- const FOCUSABLE_ITEM_SELECTOR = ':is(button, a, input, [tabindex]):not(:disabled):not([data-overflowing]):not([data-more-button-inactive])';
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
+ };
26
51
  const renderMenuItem = (item, index) => {
27
52
  if (item.type === 'divider') {
28
53
  return /*#__PURE__*/jsx(ActionList.Divider, {}, index);
@@ -71,8 +96,44 @@ const renderMenuItem = (item, index) => {
71
96
  }, label);
72
97
  };
73
98
  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
+ };
74
135
  const ActionBar = props => {
75
- const $ = c(42);
136
+ const $ = c(38);
76
137
  const {
77
138
  size: t0,
78
139
  children,
@@ -86,284 +147,276 @@ const ActionBar = props => {
86
147
  const flush = t1 === undefined ? false : t1;
87
148
  const gap = t2 === undefined ? "condensed" : t2;
88
149
  const listRef = useRef(null);
150
+ const [computedGap, setComputedGap] = useState(ACTIONBAR_ITEM_GAP);
89
151
  const [childRegistry, setChildRegistry] = ActionBarItemsRegistry.useRegistryState();
152
+ const [menuItemIds, setMenuItemIds] = useState(_temp);
90
153
  const navRef = useRef(null);
91
154
  let t3;
92
- if ($[0] !== childRegistry) {
93
- t3 = childRegistry === null || childRegistry === void 0 ? void 0 : childRegistry.values().every(_temp);
94
- $[0] = childRegistry;
95
- $[1] = t3;
155
+ 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);
164
+ }
165
+ };
166
+ $[0] = t3;
96
167
  } else {
97
- t3 = $[1];
168
+ t3 = $[0];
98
169
  }
99
170
  let t4;
171
+ if ($[1] !== gap) {
172
+ t4 = [gap];
173
+ $[1] = gap;
174
+ $[2] = t4;
175
+ } else {
176
+ t4 = $[2];
177
+ }
178
+ useIsomorphicLayoutEffect(t3, t4);
179
+ const moreMenuRef = useRef(null);
100
180
  let t5;
101
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
102
- t4 = (direction, from) => {
103
- var _listRef$current$quer, _listRef$current;
104
- 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 : []);
105
- const fromIndex = from ? items.indexOf(from) : -1;
106
- switch (direction) {
107
- case "start":
108
- {
109
- return items[0];
110
- }
111
- case "end":
112
- {
113
- return items.at(-1);
114
- }
115
- case "next":
116
- {
117
- var _items;
118
- return (_items = items[fromIndex + 1]) !== null && _items !== void 0 ? _items : items[0];
119
- }
120
- case "previous":
121
- {
122
- var _items2;
123
- return (_items2 = items[fromIndex - 1]) !== null && _items2 !== void 0 ? _items2 : items.at(-1);
124
- }
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
+ }
125
192
  }
126
193
  };
127
- t5 = previous => {
128
- var _listRef$current$quer2, _listRef$current2;
129
- if (previous.matches(FOCUSABLE_ITEM_SELECTOR) && previous instanceof HTMLElement) {
130
- return previous;
131
- }
132
- return (_listRef$current$quer2 = (_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 ? void 0 : _listRef$current2.querySelector(FOCUSABLE_ITEM_SELECTOR)) !== null && _listRef$current$quer2 !== void 0 ? _listRef$current$quer2 : undefined;
133
- };
134
- $[2] = t4;
135
- $[3] = t5;
194
+ $[3] = childRegistry;
195
+ $[4] = computedGap;
196
+ $[5] = menuItemIds.size;
197
+ $[6] = t5;
136
198
  } else {
137
- t4 = $[2];
138
- t5 = $[3];
199
+ t5 = $[6];
139
200
  }
201
+ useResizeObserver(t5, navRef);
140
202
  let t6;
141
- if ($[4] !== t3) {
142
- t6 = {
143
- containerRef: listRef,
144
- bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
145
- focusOutBehavior: "wrap",
146
- disabled: t3,
147
- getNextFocusable: t4,
148
- focusInStrategy: t5
149
- };
150
- $[4] = t3;
151
- $[5] = t6;
203
+ if ($[7] !== menuItemIds) {
204
+ t6 = id => !menuItemIds.has(id);
205
+ $[7] = menuItemIds;
206
+ $[8] = t6;
152
207
  } else {
153
- t6 = $[5];
208
+ t6 = $[8];
154
209
  }
155
- useFocusZone(t6);
210
+ const isVisibleChild = t6;
156
211
  let t7;
157
- if ($[6] !== childRegistry) {
158
- t7 = childRegistry && Array.from(childRegistry.entries()).filter(_temp2);
159
- $[6] = childRegistry;
160
- $[7] = 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;
219
+ } 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;
161
235
  } else {
162
- t7 = $[7];
236
+ groupedItemsMap = $[11];
163
237
  }
164
- const overflowItems = t7;
238
+ const groupedItems = groupedItemsMap;
165
239
  let t8;
166
- if ($[8] !== size) {
240
+ if ($[12] !== isVisibleChild || $[13] !== size) {
167
241
  t8 = {
168
- size
242
+ size,
243
+ isVisibleChild
169
244
  };
170
- $[8] = size;
171
- $[9] = t8;
245
+ $[12] = isVisibleChild;
246
+ $[13] = size;
247
+ $[14] = t8;
172
248
  } else {
173
- t8 = $[9];
249
+ t8 = $[14];
174
250
  }
175
251
  let t9;
176
- if ($[10] !== className) {
252
+ if ($[15] !== className) {
177
253
  t9 = clsx(className, styles.Nav);
178
- $[10] = className;
179
- $[11] = t9;
180
- } else {
181
- t9 = $[11];
182
- }
183
- const t10 = overflowItems ? overflowItems.length > 0 : undefined;
184
- let t11;
185
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
186
- t11 = /*#__PURE__*/jsx("div", {});
187
- $[12] = t11;
254
+ $[15] = className;
255
+ $[16] = t9;
188
256
  } else {
189
- t11 = $[12];
257
+ t9 = $[16];
190
258
  }
191
- let t12;
192
- if ($[13] !== children || $[14] !== setChildRegistry) {
193
- t12 = /*#__PURE__*/jsxs("div", {
194
- className: styles.OverflowContainer,
195
- children: [t11, /*#__PURE__*/jsx(ActionBarItemsRegistry.Provider, {
196
- setRegistry: setChildRegistry,
197
- children: children
198
- })]
199
- });
200
- $[13] = children;
201
- $[14] = setChildRegistry;
202
- $[15] = t12;
203
- } else {
204
- t12 = $[15];
205
- }
206
- const t13 = `More ${ariaLabel} items ${overflowItems === null || overflowItems === void 0 ? void 0 : overflowItems.length}`;
207
- const t14 = overflowItems !== null && overflowItems !== void 0 && overflowItems.length ? undefined : true;
208
- let t15;
209
- if ($[16] !== size || $[17] !== t13 || $[18] !== t14) {
210
- t15 = /*#__PURE__*/jsx(ActionMenu.Anchor, {
211
- children: /*#__PURE__*/jsx(IconButton, {
212
- variant: "invisible",
213
- "aria-label": t13,
214
- icon: KebabHorizontalIcon,
215
- className: styles.MoreButton,
216
- "data-more-button-inactive": t14,
217
- size: size
218
- })
219
- });
220
- $[16] = size;
221
- $[17] = t13;
222
- $[18] = t14;
223
- $[19] = t15;
224
- } else {
225
- t15 = $[19];
226
- }
227
- let t16;
228
- if ($[20] !== overflowItems) {
229
- t16 = overflowItems === null || overflowItems === void 0 ? void 0 : overflowItems.map(_temp4);
230
- $[20] = overflowItems;
231
- $[21] = t16;
232
- } else {
233
- t16 = $[21];
234
- }
235
- let t17;
236
- if ($[22] !== t16) {
237
- t17 = /*#__PURE__*/jsx(ActionMenu.Overlay, {
238
- children: /*#__PURE__*/jsx(ActionList, {
239
- children: t16
240
- })
259
+ let t10;
260
+ if ($[17] !== children || $[18] !== setChildRegistry) {
261
+ t10 = /*#__PURE__*/jsx(ActionBarItemsRegistry.Provider, {
262
+ setRegistry: setChildRegistry,
263
+ children: children
241
264
  });
242
- $[22] = t16;
243
- $[23] = t17;
265
+ $[17] = children;
266
+ $[18] = setChildRegistry;
267
+ $[19] = t10;
244
268
  } else {
245
- t17 = $[23];
269
+ t10 = $[19];
246
270
  }
247
- let t18;
248
- if ($[24] !== t15 || $[25] !== t17) {
249
- t18 = /*#__PURE__*/jsxs(ActionMenu, {
250
- children: [t15, t17]
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
+ })]
251
341
  });
252
- $[24] = t15;
253
- $[25] = t17;
254
- $[26] = t18;
342
+ $[20] = ariaLabel;
343
+ $[21] = childRegistry;
344
+ $[22] = groupedItems;
345
+ $[23] = menuItemIds;
346
+ $[24] = t11;
255
347
  } else {
256
- t18 = $[26];
348
+ t11 = $[24];
257
349
  }
258
- let t19;
259
- if ($[27] !== ariaLabel || $[28] !== ariaLabelledBy || $[29] !== gap || $[30] !== size || $[31] !== t10 || $[32] !== t12 || $[33] !== t18) {
260
- t19 = /*#__PURE__*/jsxs("div", {
350
+ let t12;
351
+ if ($[25] !== ariaLabel || $[26] !== ariaLabelledBy || $[27] !== gap || $[28] !== t10 || $[29] !== t11) {
352
+ t12 = /*#__PURE__*/jsxs("div", {
261
353
  ref: listRef,
262
354
  role: "toolbar",
263
355
  className: styles.List,
264
356
  "aria-label": ariaLabel,
265
357
  "aria-labelledby": ariaLabelledBy,
266
358
  "data-gap": gap,
267
- "data-size": size,
268
- "data-has-overflow": t10,
269
- children: [t12, t18]
359
+ children: [t10, t11]
270
360
  });
271
- $[27] = ariaLabel;
272
- $[28] = ariaLabelledBy;
273
- $[29] = gap;
274
- $[30] = size;
275
- $[31] = t10;
276
- $[32] = t12;
277
- $[33] = t18;
278
- $[34] = t19;
279
- } else {
280
- t19 = $[34];
281
- }
282
- let t20;
283
- if ($[35] !== flush || $[36] !== t19 || $[37] !== t9) {
284
- t20 = /*#__PURE__*/jsx("div", {
361
+ $[25] = ariaLabel;
362
+ $[26] = ariaLabelledBy;
363
+ $[27] = gap;
364
+ $[28] = t10;
365
+ $[29] = t11;
366
+ $[30] = t12;
367
+ } else {
368
+ t12 = $[30];
369
+ }
370
+ let t13;
371
+ if ($[31] !== flush || $[32] !== t12 || $[33] !== t9) {
372
+ t13 = /*#__PURE__*/jsx("div", {
285
373
  ref: navRef,
286
374
  className: t9,
287
375
  "data-flush": flush,
288
- children: t19
376
+ children: t12
289
377
  });
290
- $[35] = flush;
291
- $[36] = t19;
292
- $[37] = t9;
293
- $[38] = t20;
378
+ $[31] = flush;
379
+ $[32] = t12;
380
+ $[33] = t9;
381
+ $[34] = t13;
294
382
  } else {
295
- t20 = $[38];
383
+ t13 = $[34];
296
384
  }
297
- let t21;
298
- if ($[39] !== t20 || $[40] !== t8) {
299
- t21 = /*#__PURE__*/jsx(ActionBarContext.Provider, {
385
+ let t14;
386
+ if ($[35] !== t13 || $[36] !== t8) {
387
+ t14 = /*#__PURE__*/jsx(ActionBarContext.Provider, {
300
388
  value: t8,
301
- children: t20
389
+ children: t13
302
390
  });
303
- $[39] = t20;
304
- $[40] = t8;
305
- $[41] = t21;
391
+ $[35] = t13;
392
+ $[36] = t8;
393
+ $[37] = t14;
306
394
  } else {
307
- t21 = $[41];
395
+ t14 = $[37];
308
396
  }
309
- return t21;
397
+ return t14;
310
398
  };
311
- function useActionBarItem(ref, registryProps) {
312
- var _useContext;
313
- const $ = c(8);
314
- const isGroupOverflowing = (_useContext = useContext(ActionBarGroupContext)) === null || _useContext === void 0 ? void 0 : _useContext.isOverflowing;
315
- const isInGroup = isGroupOverflowing !== undefined;
399
+ function useWidth(ref) {
400
+ const $ = c(3);
401
+ const [width, setWidth] = useState(-1);
316
402
  let t0;
317
- if ($[0] !== isInGroup || $[1] !== ref) {
318
- t0 = onChange => {
319
- if (isInGroup) {
320
- return _temp5;
321
- }
322
- const observer = new IntersectionObserver(() => onChange(), {
323
- threshold: 1
324
- });
325
- if (ref.current) {
326
- observer.observe(ref.current);
327
- }
328
- return () => observer.disconnect();
329
- };
330
- $[0] = isInGroup;
331
- $[1] = ref;
332
- $[2] = t0;
333
- } else {
334
- t0 = $[2];
335
- }
336
- const subscribeIntersectionObserver = t0;
337
403
  let t1;
338
- if ($[3] !== ref) {
339
- t1 = () => ref.current ? ref.current.offsetTop > 0 : false;
340
- $[3] = ref;
341
- $[4] = t1;
342
- } else {
343
- t1 = $[4];
344
- }
345
- const isItemOverflowing = useSyncExternalStore(subscribeIntersectionObserver, t1, _temp6);
346
- const isOverflowing = isGroupOverflowing || isItemOverflowing;
347
- ActionBarItemsRegistry.useRegisterDescendant(isOverflowing ? registryProps : null);
348
- const t2 = isOverflowing ? "" : undefined;
349
- let t3;
350
- if ($[5] !== isOverflowing || $[6] !== t2) {
351
- t3 = {
352
- isOverflowing,
353
- dataOverflowingAttr: t2
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);
354
408
  };
355
- $[5] = isOverflowing;
356
- $[6] = t2;
357
- $[7] = t3;
409
+ t1 = [ref];
410
+ $[0] = ref;
411
+ $[1] = t0;
412
+ $[2] = t1;
358
413
  } else {
359
- t3 = $[7];
414
+ t0 = $[1];
415
+ t1 = $[2];
360
416
  }
361
- return t3;
417
+ useIsomorphicLayoutEffect(t0, t1);
418
+ return width;
362
419
  }
363
- function _temp6() {
364
- return false;
365
- }
366
- function _temp5() {}
367
420
  const ActionBarIconButton = /*#__PURE__*/forwardRef(({
368
421
  disabled,
369
422
  onClick,
@@ -372,36 +425,44 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef(({
372
425
  const ref = useRef(null);
373
426
  const mergedRef = useMergedRefs(ref, forwardedRef);
374
427
  const {
375
- size
428
+ size,
429
+ isVisibleChild
376
430
  } = React.useContext(ActionBarContext);
431
+ const {
432
+ groupId
433
+ } = React.useContext(ActionBarGroupContext);
434
+ const width = useWidth(ref);
377
435
  const {
378
436
  ['aria-label']: ariaLabel,
379
437
  icon
380
438
  } = props;
381
- const {
382
- dataOverflowingAttr
383
- } = useActionBarItem(ref, useMemo(() => ({
439
+ const registryProps = useMemo(() => ({
384
440
  type: 'action',
385
441
  label: ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : '',
386
442
  icon,
387
443
  disabled: !!disabled,
388
- onClick: onClick
389
- }), [ariaLabel, icon, disabled, onClick]));
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);
390
449
  const clickHandler = useCallback(event => {
391
450
  if (disabled) return;
392
451
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
393
452
  }, [disabled, onClick]);
453
+ if (!isVisibleChild(id) || groupId && !isVisibleChild(groupId)) return null;
394
454
  return /*#__PURE__*/jsx(IconButton, {
395
455
  "aria-disabled": disabled,
396
456
  ref: mergedRef,
397
457
  size: size,
398
458
  onClick: clickHandler,
399
459
  ...props,
400
- variant: "invisible",
401
- "data-overflowing": dataOverflowingAttr
460
+ variant: "invisible"
402
461
  });
403
462
  });
404
- const ActionBarGroupContext = /*#__PURE__*/React.createContext(null);
463
+ const ActionBarGroupContext = /*#__PURE__*/React.createContext({
464
+ groupId: null
465
+ });
405
466
  const ActionBarGroup = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
406
467
  const $ = c(10);
407
468
  const {
@@ -409,39 +470,38 @@ const ActionBarGroup = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
409
470
  } = t0;
410
471
  const backupRef = useRef(null);
411
472
  const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
473
+ const width = useWidth(ref);
412
474
  let t1;
413
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
475
+ if ($[0] !== width) {
414
476
  t1 = {
415
- type: "group"
477
+ type: "group",
478
+ width
416
479
  };
417
- $[0] = t1;
480
+ $[0] = width;
481
+ $[1] = t1;
418
482
  } else {
419
- t1 = $[0];
483
+ t1 = $[1];
420
484
  }
421
- const {
422
- dataOverflowingAttr,
423
- isOverflowing
424
- } = useActionBarItem(ref, t1);
485
+ const registryProps = t1;
486
+ const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
425
487
  let t2;
426
- if ($[1] !== isOverflowing) {
488
+ if ($[2] !== id) {
427
489
  t2 = {
428
- isOverflowing
490
+ groupId: id
429
491
  };
430
- $[1] = isOverflowing;
431
- $[2] = t2;
492
+ $[2] = id;
493
+ $[3] = t2;
432
494
  } else {
433
- t2 = $[2];
495
+ t2 = $[3];
434
496
  }
435
497
  let t3;
436
- if ($[3] !== children || $[4] !== dataOverflowingAttr || $[5] !== ref) {
498
+ if ($[4] !== children || $[5] !== ref) {
437
499
  t3 = /*#__PURE__*/jsx("div", {
438
500
  className: styles.Group,
439
501
  ref: ref,
440
- "data-overflowing": dataOverflowingAttr,
441
502
  children: children
442
503
  });
443
- $[3] = children;
444
- $[4] = dataOverflowingAttr;
504
+ $[4] = children;
445
505
  $[5] = ref;
446
506
  $[6] = t3;
447
507
  } else {
@@ -495,12 +555,17 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
495
555
  }
496
556
  const backupRef = useRef(null);
497
557
  const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
558
+ const {
559
+ isVisibleChild
560
+ } = React.useContext(ActionBarContext);
498
561
  const [menuOpen, setMenuOpen] = useState(false);
562
+ const width = useWidth(ref);
499
563
  const t1 = overflowIcon ? overflowIcon : icon;
500
564
  let t2;
501
- if ($[7] !== ariaLabel || $[8] !== items || $[9] !== returnFocusRef || $[10] !== t1) {
565
+ if ($[7] !== ariaLabel || $[8] !== items || $[9] !== returnFocusRef || $[10] !== t1 || $[11] !== width) {
502
566
  t2 = {
503
567
  type: "menu",
568
+ width,
504
569
  label: ariaLabel,
505
570
  icon: t1,
506
571
  returnFocusRef,
@@ -510,26 +575,27 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
510
575
  $[8] = items;
511
576
  $[9] = returnFocusRef;
512
577
  $[10] = t1;
513
- $[11] = t2;
578
+ $[11] = width;
579
+ $[12] = t2;
514
580
  } else {
515
- t2 = $[11];
581
+ t2 = $[12];
582
+ }
583
+ const registryProps = t2;
584
+ const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
585
+ if (!isVisibleChild(id)) {
586
+ return null;
516
587
  }
517
- const {
518
- dataOverflowingAttr
519
- } = useActionBarItem(ref, t2);
520
588
  let t3;
521
- if ($[12] !== ariaLabel || $[13] !== dataOverflowingAttr || $[14] !== icon || $[15] !== props) {
589
+ if ($[13] !== ariaLabel || $[14] !== icon || $[15] !== props) {
522
590
  t3 = /*#__PURE__*/jsx(ActionMenu.Anchor, {
523
591
  children: /*#__PURE__*/jsx(IconButton, {
524
592
  variant: "invisible",
525
593
  "aria-label": ariaLabel,
526
594
  icon: icon,
527
- ...props,
528
- "data-overflowing": dataOverflowingAttr
595
+ ...props
529
596
  })
530
597
  });
531
- $[12] = ariaLabel;
532
- $[13] = dataOverflowingAttr;
598
+ $[13] = ariaLabel;
533
599
  $[14] = icon;
534
600
  $[15] = props;
535
601
  $[16] = t3;
@@ -548,7 +614,7 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
548
614
  }
549
615
  let t5;
550
616
  if ($[19] !== items) {
551
- t5 = items.map(_temp7);
617
+ t5 = items.map(_temp4);
552
618
  $[19] = items;
553
619
  $[20] = t5;
554
620
  } else {
@@ -597,91 +663,68 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
597
663
  const VerticalDivider = () => {
598
664
  const $ = c(3);
599
665
  const ref = useRef(null);
666
+ const {
667
+ isVisibleChild
668
+ } = React.useContext(ActionBarContext);
669
+ const width = useWidth(ref);
600
670
  let t0;
601
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
671
+ if ($[0] !== width) {
602
672
  t0 = {
603
- type: "divider"
673
+ type: "divider",
674
+ width
604
675
  };
605
- $[0] = t0;
676
+ $[0] = width;
677
+ $[1] = t0;
606
678
  } else {
607
- t0 = $[0];
679
+ t0 = $[1];
680
+ }
681
+ const registryProps = t0;
682
+ const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
683
+ if (!isVisibleChild(id)) {
684
+ return null;
608
685
  }
609
- const {
610
- dataOverflowingAttr
611
- } = useActionBarItem(ref, t0);
612
686
  let t1;
613
- if ($[1] !== dataOverflowingAttr) {
687
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
614
688
  t1 = /*#__PURE__*/jsx("div", {
615
689
  ref: ref,
616
690
  "data-component": "ActionBar.VerticalDivider",
617
691
  "aria-hidden": "true",
618
- className: styles.Divider,
619
- "data-overflowing": dataOverflowingAttr
692
+ className: styles.Divider
620
693
  });
621
- $[1] = dataOverflowingAttr;
622
694
  $[2] = t1;
623
695
  } else {
624
696
  t1 = $[2];
625
697
  }
626
698
  return t1;
627
699
  };
628
- function _temp(v) {
629
- return v !== null;
630
- }
631
- function _temp2(entry) {
632
- return entry[1] !== null;
700
+ function _temp() {
701
+ return new Set();
633
702
  }
634
- function _temp3(item, index) {
703
+ function _temp2(item, index) {
635
704
  return renderMenuItem(item, index);
636
705
  }
637
- function _temp4(t0) {
638
- const [id, menuItem] = t0;
639
- if (menuItem.type === "divider") {
640
- return /*#__PURE__*/jsx(ActionList.Divider, {}, id);
641
- }
642
- if (menuItem.type === "action") {
706
+ function _temp3(t0) {
707
+ const [key_0, childProps_0] = t0;
708
+ if (childProps_0.type === "action") {
643
709
  const {
644
- onClick,
645
- icon: Icon,
646
- label,
647
- disabled
648
- } = menuItem;
710
+ onClick: onClick_0,
711
+ icon: Icon_1,
712
+ label: label_1,
713
+ disabled: disabled_0
714
+ } = childProps_0;
649
715
  return /*#__PURE__*/jsxs(ActionList.Item, {
650
- onSelect: event => {
651
- typeof onClick === "function" && onClick(event);
716
+ onSelect: event_0 => {
717
+ typeof onClick_0 === "function" && onClick_0(event_0);
652
718
  },
653
- disabled: disabled,
719
+ disabled: disabled_0,
654
720
  children: [/*#__PURE__*/jsx(ActionList.LeadingVisual, {
655
- children: /*#__PURE__*/jsx(Icon, {})
656
- }), label]
657
- }, label);
658
- }
659
- if (menuItem.type === "menu") {
660
- const menuItems = menuItem.items;
661
- const {
662
- icon: Icon_0,
663
- label: label_0,
664
- returnFocusRef
665
- } = menuItem;
666
- return /*#__PURE__*/jsxs(ActionMenu, {
667
- children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
668
- children: /*#__PURE__*/jsxs(ActionList.Item, {
669
- children: [Icon_0 !== "none" ? /*#__PURE__*/jsx(ActionList.LeadingVisual, {
670
- children: /*#__PURE__*/jsx(Icon_0, {})
671
- }) : null, label_0]
672
- })
673
- }), /*#__PURE__*/jsx(ActionMenu.Overlay, {
674
- ...(returnFocusRef && {
675
- returnFocusRef
676
- }),
677
- children: /*#__PURE__*/jsx(ActionList, {
678
- children: menuItems.map(_temp3)
679
- })
680
- })]
681
- }, id);
721
+ children: /*#__PURE__*/jsx(Icon_1, {})
722
+ }), label_1]
723
+ }, key_0);
682
724
  }
725
+ return null;
683
726
  }
684
- function _temp7(item, index) {
727
+ function _temp4(item, index) {
685
728
  return renderMenuItem(item, index);
686
729
  }
687
730
 
@@ -1,5 +1,5 @@
1
- import './ActionBar-3f7b52a3.css';
1
+ import './ActionBar-a41224b2.css';
2
2
 
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"};
3
+ var styles = {"List":"prc-ActionBar-List-9uz46","Divider":"prc-ActionBar-Divider-6V8yH","Nav":"prc-ActionBar-Nav-9spON","Group":"prc-ActionBar-Group-peNCk"};
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;
4
+ Divider: () => import("react").JSX.Element | null;
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)}}
2
- /*# sourceMappingURL=Breadcrumbs-dbfc9d95.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)}}@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 */
@@ -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,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"]}
@@ -23,8 +23,15 @@ 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;
26
33
  }>;
27
- declare function Breadcrumbs({ className, children, style, overflow, variant }: BreadcrumbsProps): React.JSX.Element;
34
+ declare function Breadcrumbs({ className, children, style, overflow, variant, visibleItemsOnNarrow, }: BreadcrumbsProps): React.JSX.Element;
28
35
  declare namespace Breadcrumbs {
29
36
  var displayName: string;
30
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/Breadcr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AAG,GAAG,IAAI,0BAA0B,CAAC,EAAE,CAAC,CAAA;;YAnBlG,EAAE,SAAS,KAAK,CAAC,WAAW;aANtB,EAAE;mBACI,OAAO;;aADb,EAAE;mBACI,OAAO;;;;;;;AA2BtB,wBAAiF;AAEjF;;GAEG;AACH,eAAO,MAAM,UAAU;WA3BpB,EAAE,SAAS,KAAK,CAAC,WAAW;aANtB,EAAE;mBACI,OAAO;;aADb,EAAE;mBACI,OAAO;;;;CAgCuD,CAAA;AAE7E;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAA;AAE9C;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,IAAI,oBAAoB,CAAC,EAAE,CAAC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { c } from 'react-compiler-runtime';
2
2
  import { clsx } from 'clsx';
3
- import React, { useRef, useCallback, useState, useMemo, useEffect } from 'react';
3
+ import React, { useRef, useMemo, useCallback, useState, 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,14 +211,24 @@ function Breadcrumbs({
211
211
  children,
212
212
  style,
213
213
  overflow = 'wrap',
214
- variant = 'normal'
214
+ variant = 'normal',
215
+ visibleItemsOnNarrow = 1
215
216
  }) {
216
217
  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
- }));
221
218
  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
+ });
222
232
  const measureMenuButton = useCallback(element => {
223
233
  if (element) {
224
234
  const iconButtonElement = element.querySelector('button[data-component="IconButton"]');
@@ -231,7 +241,6 @@ function Breadcrumbs({
231
241
  }, []);
232
242
  const hideRoot = !(overflow === 'menu-with-root');
233
243
  const [effectiveHideRoot, setEffectiveHideRoot] = useState(hideRoot);
234
- const childArray = useMemo(() => getValidChildren(children), [children]);
235
244
  const rootItem = childArray[0];
236
245
 
237
246
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -248,7 +257,7 @@ function Breadcrumbs({
248
257
  const listElement = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.querySelector('ol');
249
258
  if (overflowMenuEnabled && listElement && listElement.children.length > 0 && listElement.children.length === childArray.length) {
250
259
  const listElementArray = Array.from(listElement.children);
251
- const widths = listElementArray.map(child_0 => child_0.offsetWidth);
260
+ const widths = listElementArray.map(child_1 => child_1.offsetWidth);
252
261
  setChildArrayWidths(widths);
253
262
  setRootItemWidth(listElementArray[0].offsetWidth);
254
263
  }
@@ -321,10 +330,18 @@ function Breadcrumbs({
321
330
  const finalChildren = React.useMemo(() => {
322
331
  if (overflowMenuEnabled) {
323
332
  if (overflow === 'wrap' || menuItems.length === 0) {
324
- return React.Children.map(children, child_1 => /*#__PURE__*/jsx("li", {
325
- className: classes.ItemWrapper,
326
- children: child_1
327
- }));
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
+ });
328
345
  }
329
346
  let effectiveMenuItems = [...menuItems];
330
347
  // In 'menu-with-root' mode, include the root item inside the menu even if it's visible in the breadcrumbs
@@ -339,10 +356,10 @@ function Breadcrumbs({
339
356
  "aria-label": `${effectiveMenuItems.length} more breadcrumb items`
340
357
  }), /*#__PURE__*/jsx(ItemSeparator, {})]
341
358
  }, "breadcrumbs-menu");
342
- const visibleElements = visibleItems.map((child_2, index) => /*#__PURE__*/jsxs("li", {
359
+ const visibleElements = visibleItems.map((child_4, index_1) => /*#__PURE__*/jsxs("li", {
343
360
  className: classes.BreadcrumbsItem,
344
- children: [child_2, /*#__PURE__*/jsx(ItemSeparator, {})]
345
- }, `visible + ${index}`));
361
+ children: [child_4, /*#__PURE__*/jsx(ItemSeparator, {})]
362
+ }, `visible + ${index_1}`));
346
363
  const rootElement = /*#__PURE__*/jsxs("li", {
347
364
  className: classes.BreadcrumbsItem,
348
365
  children: [rootItem, /*#__PURE__*/jsx(ItemSeparator, {})]
@@ -355,7 +372,7 @@ function Breadcrumbs({
355
372
  return [rootElement, menuElement, ...visibleElements];
356
373
  }
357
374
  }
358
- }, [overflowMenuEnabled, overflow, menuItems, effectiveHideRoot, measureMenuButton, visibleItems, rootItem, children]);
375
+ }, [overflowMenuEnabled, overflow, menuItems, effectiveHideRoot, measureMenuButton, visibleItems, rootItem, children, visibleCountOnNarrow]);
359
376
  return overflowMenuEnabled ? /*#__PURE__*/jsx("nav", {
360
377
  className: clsx(className, classes.BreadcrumbsBase),
361
378
  "aria-label": "Breadcrumbs",
@@ -1,4 +1,4 @@
1
- import './Breadcrumbs-dbfc9d95.css';
1
+ import './Breadcrumbs-a44d6835.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-20260407184014",
4
+ "version": "0.0.0-20260407233157",
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: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 */
@@ -1 +0,0 @@
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"]}
@@ -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","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"]}