@primer/react 0.0.0-20260312192556 → 0.0.0-20260312205452
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 +4 -12
- package/dist/ActionBar/ActionBar-a41224b2.css +2 -0
- package/dist/ActionBar/ActionBar-a41224b2.css.map +1 -0
- package/dist/ActionBar/ActionBar.d.ts +1 -1
- package/dist/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar/ActionBar.js +390 -389
- package/dist/ActionBar/ActionBar.module.css.js +2 -2
- package/dist/ActionBar/index.d.ts +1 -1
- package/dist/Autocomplete/AutocompleteInput.js +3 -3
- package/dist/Autocomplete/AutocompleteOverlay.js +3 -3
- package/dist/Banner/Banner-f672cdf9.css +2 -0
- package/dist/Banner/Banner-f672cdf9.css.map +1 -0
- package/dist/Banner/Banner.module.css.js +1 -1
- package/dist/Button/ButtonBase.d.ts.map +1 -1
- package/dist/Button/ButtonBase.js +3 -4
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/Heading/Heading.js +3 -3
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +3 -4
- package/dist/Overlay/Overlay.js +22 -21
- package/dist/PageLayout/PageLayout.js +5 -5
- package/dist/TextInputWithTokens/TextInputWithTokens.js +96 -95
- package/dist/deprecated/DialogV1/Dialog.js +12 -11
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useCombinedRefs.d.ts +51 -0
- package/dist/hooks/useCombinedRefs.d.ts.map +1 -0
- package/dist/hooks/useCombinedRefs.js +86 -0
- package/dist/hooks/useRefObjectAsForwardedRef.d.ts +12 -0
- package/dist/hooks/useRefObjectAsForwardedRef.d.ts.map +1 -1
- package/dist/hooks/useRefObjectAsForwardedRef.js +12 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/generated/components.json +1 -1
- package/generated/hooks.json +22 -0
- package/package.json +1 -1
- package/dist/ActionBar/ActionBar-f2b70d1d.css +0 -2
- package/dist/ActionBar/ActionBar-f2b70d1d.css.map +0 -1
- package/dist/Banner/Banner-b3871000.css +0 -2
- package/dist/Banner/Banner-b3871000.css.map +0 -1
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React, { useRef,
|
|
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 {
|
|
12
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
11
13
|
import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.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,7 +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();
|
|
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
51
|
const renderMenuItem = (item, index) => {
|
|
26
52
|
if (item.type === 'divider') {
|
|
27
53
|
return /*#__PURE__*/jsx(ActionList.Divider, {}, index);
|
|
@@ -70,8 +96,44 @@ const renderMenuItem = (item, index) => {
|
|
|
70
96
|
}, label);
|
|
71
97
|
};
|
|
72
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
|
+
};
|
|
73
135
|
const ActionBar = props => {
|
|
74
|
-
const $ = c(
|
|
136
|
+
const $ = c(38);
|
|
75
137
|
const {
|
|
76
138
|
size: t0,
|
|
77
139
|
children,
|
|
@@ -85,348 +147,275 @@ const ActionBar = props => {
|
|
|
85
147
|
const flush = t1 === undefined ? false : t1;
|
|
86
148
|
const gap = t2 === undefined ? "condensed" : t2;
|
|
87
149
|
const listRef = useRef(null);
|
|
150
|
+
const [computedGap, setComputedGap] = useState(ACTIONBAR_ITEM_GAP);
|
|
88
151
|
const [childRegistry, setChildRegistry] = ActionBarItemsRegistry.useRegistryState();
|
|
152
|
+
const [menuItemIds, setMenuItemIds] = useState(_temp);
|
|
89
153
|
const navRef = useRef(null);
|
|
90
154
|
let t3;
|
|
91
155
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
92
|
-
t3 = {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
+
}
|
|
96
165
|
};
|
|
97
166
|
$[0] = t3;
|
|
98
167
|
} else {
|
|
99
168
|
t3 = $[0];
|
|
100
169
|
}
|
|
101
|
-
useFocusZone(t3);
|
|
102
|
-
let T0;
|
|
103
|
-
let T1;
|
|
104
|
-
let T2;
|
|
105
|
-
let T3;
|
|
106
|
-
let t10;
|
|
107
|
-
let t11;
|
|
108
|
-
let t12;
|
|
109
|
-
let t13;
|
|
110
|
-
let t14;
|
|
111
|
-
let t15;
|
|
112
|
-
let t16;
|
|
113
|
-
let t17;
|
|
114
|
-
let t18;
|
|
115
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);
|
|
116
180
|
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
|
+
}
|
|
193
|
+
};
|
|
194
|
+
$[3] = childRegistry;
|
|
195
|
+
$[4] = computedGap;
|
|
196
|
+
$[5] = menuItemIds.size;
|
|
197
|
+
$[6] = t5;
|
|
198
|
+
} else {
|
|
199
|
+
t5 = $[6];
|
|
200
|
+
}
|
|
201
|
+
useResizeObserver(t5, navRef);
|
|
117
202
|
let t6;
|
|
203
|
+
if ($[7] !== menuItemIds) {
|
|
204
|
+
t6 = id => !menuItemIds.has(id);
|
|
205
|
+
$[7] = menuItemIds;
|
|
206
|
+
$[8] = t6;
|
|
207
|
+
} else {
|
|
208
|
+
t6 = $[8];
|
|
209
|
+
}
|
|
210
|
+
const isVisibleChild = t6;
|
|
118
211
|
let t7;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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();
|
|
125
226
|
for (const [key, childProps] of childRegistry !== null && childRegistry !== void 0 ? childRegistry : []) {
|
|
126
|
-
if (
|
|
227
|
+
if (childProps.type === "action" && childProps.groupId) {
|
|
127
228
|
const existingGroup = groupedItemsMap.get(childProps.groupId) || [];
|
|
128
229
|
existingGroup.push([key, childProps]);
|
|
129
230
|
groupedItemsMap.set(childProps.groupId, existingGroup);
|
|
130
231
|
}
|
|
131
232
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if ($[29] !== size) {
|
|
135
|
-
t18 = {
|
|
136
|
-
size
|
|
137
|
-
};
|
|
138
|
-
$[29] = size;
|
|
139
|
-
$[30] = t18;
|
|
140
|
-
} else {
|
|
141
|
-
t18 = $[30];
|
|
142
|
-
}
|
|
143
|
-
t15 = navRef;
|
|
144
|
-
if ($[31] !== className) {
|
|
145
|
-
t16 = clsx(className, styles.Nav);
|
|
146
|
-
$[31] = className;
|
|
147
|
-
$[32] = t16;
|
|
148
|
-
} else {
|
|
149
|
-
t16 = $[32];
|
|
150
|
-
}
|
|
151
|
-
t17 = flush;
|
|
152
|
-
t6 = listRef;
|
|
153
|
-
t7 = "toolbar";
|
|
154
|
-
t8 = styles.List;
|
|
155
|
-
t9 = ariaLabel;
|
|
156
|
-
t10 = ariaLabelledBy;
|
|
157
|
-
t11 = gap;
|
|
158
|
-
t12 = size;
|
|
159
|
-
t13 = overflowItems.length > 0;
|
|
160
|
-
if ($[33] !== children || $[34] !== setChildRegistry) {
|
|
161
|
-
t14 = /*#__PURE__*/jsx("div", {
|
|
162
|
-
className: styles.OverflowContainer,
|
|
163
|
-
children: /*#__PURE__*/jsx(ActionBarItemsRegistry.Provider, {
|
|
164
|
-
setRegistry: setChildRegistry,
|
|
165
|
-
children: children
|
|
166
|
-
})
|
|
167
|
-
});
|
|
168
|
-
$[33] = children;
|
|
169
|
-
$[34] = setChildRegistry;
|
|
170
|
-
$[35] = t14;
|
|
171
|
-
} else {
|
|
172
|
-
t14 = $[35];
|
|
173
|
-
}
|
|
174
|
-
T2 = ActionMenu;
|
|
175
|
-
const t19 = `More ${ariaLabel} items`;
|
|
176
|
-
if ($[36] !== t19) {
|
|
177
|
-
t5 = /*#__PURE__*/jsx(ActionMenu.Anchor, {
|
|
178
|
-
children: /*#__PURE__*/jsx(IconButton, {
|
|
179
|
-
variant: "invisible",
|
|
180
|
-
"aria-label": t19,
|
|
181
|
-
icon: KebabHorizontalIcon,
|
|
182
|
-
className: styles.MoreButton
|
|
183
|
-
})
|
|
184
|
-
});
|
|
185
|
-
$[36] = t19;
|
|
186
|
-
$[37] = t5;
|
|
187
|
-
} else {
|
|
188
|
-
t5 = $[37];
|
|
189
|
-
}
|
|
190
|
-
T1 = ActionMenu.Overlay;
|
|
191
|
-
T0 = ActionList;
|
|
192
|
-
t4 = overflowItems.map(t20 => {
|
|
193
|
-
const [id, menuItem] = t20;
|
|
194
|
-
if (menuItem.type === "divider") {
|
|
195
|
-
return /*#__PURE__*/jsx(ActionList.Divider, {}, id);
|
|
196
|
-
}
|
|
197
|
-
if (menuItem.type === "action") {
|
|
198
|
-
const {
|
|
199
|
-
onClick,
|
|
200
|
-
icon: Icon,
|
|
201
|
-
label,
|
|
202
|
-
disabled
|
|
203
|
-
} = menuItem;
|
|
204
|
-
return /*#__PURE__*/jsxs(ActionList.Item, {
|
|
205
|
-
onSelect: event => {
|
|
206
|
-
typeof onClick === "function" && onClick(event);
|
|
207
|
-
},
|
|
208
|
-
disabled: disabled,
|
|
209
|
-
children: [/*#__PURE__*/jsx(ActionList.LeadingVisual, {
|
|
210
|
-
children: /*#__PURE__*/jsx(Icon, {})
|
|
211
|
-
}), label]
|
|
212
|
-
}, label);
|
|
213
|
-
}
|
|
214
|
-
if (menuItem.type === "menu") {
|
|
215
|
-
const menuItems = menuItem.items;
|
|
216
|
-
const {
|
|
217
|
-
icon: Icon_0,
|
|
218
|
-
label: label_0,
|
|
219
|
-
returnFocusRef
|
|
220
|
-
} = menuItem;
|
|
221
|
-
return /*#__PURE__*/jsxs(ActionMenu, {
|
|
222
|
-
children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
|
|
223
|
-
children: /*#__PURE__*/jsxs(ActionList.Item, {
|
|
224
|
-
children: [Icon_0 !== "none" ? /*#__PURE__*/jsx(ActionList.LeadingVisual, {
|
|
225
|
-
children: /*#__PURE__*/jsx(Icon_0, {})
|
|
226
|
-
}) : null, label_0]
|
|
227
|
-
})
|
|
228
|
-
}), /*#__PURE__*/jsx(ActionMenu.Overlay, {
|
|
229
|
-
...(returnFocusRef && {
|
|
230
|
-
returnFocusRef
|
|
231
|
-
}),
|
|
232
|
-
children: /*#__PURE__*/jsx(ActionList, {
|
|
233
|
-
children: menuItems.map(_temp2)
|
|
234
|
-
})
|
|
235
|
-
})]
|
|
236
|
-
}, id);
|
|
237
|
-
}
|
|
238
|
-
const groupedMenuItems = groupedItems.get(id) || [];
|
|
239
|
-
if (menuItem.type === "group") {
|
|
240
|
-
return /*#__PURE__*/jsx(React.Fragment, {
|
|
241
|
-
children: groupedMenuItems.map(_temp3)
|
|
242
|
-
}, id);
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
$[1] = ariaLabel;
|
|
246
|
-
$[2] = ariaLabelledBy;
|
|
247
|
-
$[3] = childRegistry;
|
|
248
|
-
$[4] = children;
|
|
249
|
-
$[5] = className;
|
|
250
|
-
$[6] = flush;
|
|
251
|
-
$[7] = gap;
|
|
252
|
-
$[8] = setChildRegistry;
|
|
253
|
-
$[9] = size;
|
|
254
|
-
$[10] = T0;
|
|
255
|
-
$[11] = T1;
|
|
256
|
-
$[12] = T2;
|
|
257
|
-
$[13] = T3;
|
|
258
|
-
$[14] = t10;
|
|
259
|
-
$[15] = t11;
|
|
260
|
-
$[16] = t12;
|
|
261
|
-
$[17] = t13;
|
|
262
|
-
$[18] = t14;
|
|
263
|
-
$[19] = t15;
|
|
264
|
-
$[20] = t16;
|
|
265
|
-
$[21] = t17;
|
|
266
|
-
$[22] = t18;
|
|
267
|
-
$[23] = t4;
|
|
268
|
-
$[24] = t5;
|
|
269
|
-
$[25] = t6;
|
|
270
|
-
$[26] = t7;
|
|
271
|
-
$[27] = t8;
|
|
272
|
-
$[28] = t9;
|
|
233
|
+
$[10] = childRegistry;
|
|
234
|
+
$[11] = groupedItemsMap;
|
|
273
235
|
} else {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
t18 = $[22];
|
|
287
|
-
t4 = $[23];
|
|
288
|
-
t5 = $[24];
|
|
289
|
-
t6 = $[25];
|
|
290
|
-
t7 = $[26];
|
|
291
|
-
t8 = $[27];
|
|
292
|
-
t9 = $[28];
|
|
293
|
-
}
|
|
294
|
-
let t19;
|
|
295
|
-
if ($[38] !== T0 || $[39] !== t4) {
|
|
296
|
-
t19 = /*#__PURE__*/jsx(T0, {
|
|
297
|
-
children: t4
|
|
298
|
-
});
|
|
299
|
-
$[38] = T0;
|
|
300
|
-
$[39] = t4;
|
|
301
|
-
$[40] = t19;
|
|
236
|
+
groupedItemsMap = $[11];
|
|
237
|
+
}
|
|
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;
|
|
302
248
|
} else {
|
|
303
|
-
|
|
249
|
+
t8 = $[14];
|
|
304
250
|
}
|
|
305
|
-
let
|
|
306
|
-
if ($[
|
|
307
|
-
|
|
308
|
-
|
|
251
|
+
let t9;
|
|
252
|
+
if ($[15] !== className) {
|
|
253
|
+
t9 = clsx(className, styles.Nav);
|
|
254
|
+
$[15] = className;
|
|
255
|
+
$[16] = t9;
|
|
256
|
+
} else {
|
|
257
|
+
t9 = $[16];
|
|
258
|
+
}
|
|
259
|
+
let t10;
|
|
260
|
+
if ($[17] !== children || $[18] !== setChildRegistry) {
|
|
261
|
+
t10 = /*#__PURE__*/jsx(ActionBarItemsRegistry.Provider, {
|
|
262
|
+
setRegistry: setChildRegistry,
|
|
263
|
+
children: children
|
|
309
264
|
});
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
265
|
+
$[17] = children;
|
|
266
|
+
$[18] = setChildRegistry;
|
|
267
|
+
$[19] = t10;
|
|
313
268
|
} else {
|
|
314
|
-
|
|
269
|
+
t10 = $[19];
|
|
315
270
|
}
|
|
316
|
-
let
|
|
317
|
-
if ($[
|
|
318
|
-
|
|
319
|
-
children: [
|
|
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
|
+
})]
|
|
320
341
|
});
|
|
321
|
-
$[
|
|
322
|
-
$[
|
|
323
|
-
$[
|
|
324
|
-
$[
|
|
342
|
+
$[20] = ariaLabel;
|
|
343
|
+
$[21] = childRegistry;
|
|
344
|
+
$[22] = groupedItems;
|
|
345
|
+
$[23] = menuItemIds;
|
|
346
|
+
$[24] = t11;
|
|
325
347
|
} else {
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
let
|
|
329
|
-
if ($[
|
|
330
|
-
|
|
331
|
-
ref:
|
|
332
|
-
role:
|
|
333
|
-
className:
|
|
334
|
-
"aria-label":
|
|
335
|
-
"aria-labelledby":
|
|
336
|
-
"data-gap":
|
|
337
|
-
|
|
338
|
-
"data-has-overflow": t13,
|
|
339
|
-
children: [t14, t21]
|
|
348
|
+
t11 = $[24];
|
|
349
|
+
}
|
|
350
|
+
let t12;
|
|
351
|
+
if ($[25] !== ariaLabel || $[26] !== ariaLabelledBy || $[27] !== gap || $[28] !== t10 || $[29] !== t11) {
|
|
352
|
+
t12 = /*#__PURE__*/jsxs("div", {
|
|
353
|
+
ref: listRef,
|
|
354
|
+
role: "toolbar",
|
|
355
|
+
className: styles.List,
|
|
356
|
+
"aria-label": ariaLabel,
|
|
357
|
+
"aria-labelledby": ariaLabelledBy,
|
|
358
|
+
"data-gap": gap,
|
|
359
|
+
children: [t10, t11]
|
|
340
360
|
});
|
|
341
|
-
$[
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
347
|
-
$[54] = t6;
|
|
348
|
-
$[55] = t7;
|
|
349
|
-
$[56] = t8;
|
|
350
|
-
$[57] = t9;
|
|
351
|
-
$[58] = t22;
|
|
361
|
+
$[25] = ariaLabel;
|
|
362
|
+
$[26] = ariaLabelledBy;
|
|
363
|
+
$[27] = gap;
|
|
364
|
+
$[28] = t10;
|
|
365
|
+
$[29] = t11;
|
|
366
|
+
$[30] = t12;
|
|
352
367
|
} else {
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
let
|
|
356
|
-
if ($[
|
|
357
|
-
|
|
358
|
-
ref:
|
|
359
|
-
className:
|
|
360
|
-
"data-flush":
|
|
361
|
-
children:
|
|
368
|
+
t12 = $[30];
|
|
369
|
+
}
|
|
370
|
+
let t13;
|
|
371
|
+
if ($[31] !== flush || $[32] !== t12 || $[33] !== t9) {
|
|
372
|
+
t13 = /*#__PURE__*/jsx("div", {
|
|
373
|
+
ref: navRef,
|
|
374
|
+
className: t9,
|
|
375
|
+
"data-flush": flush,
|
|
376
|
+
children: t12
|
|
362
377
|
});
|
|
363
|
-
$[
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[63] = t23;
|
|
378
|
+
$[31] = flush;
|
|
379
|
+
$[32] = t12;
|
|
380
|
+
$[33] = t9;
|
|
381
|
+
$[34] = t13;
|
|
368
382
|
} else {
|
|
369
|
-
|
|
383
|
+
t13 = $[34];
|
|
370
384
|
}
|
|
371
|
-
let
|
|
372
|
-
if ($[
|
|
373
|
-
|
|
374
|
-
value:
|
|
375
|
-
children:
|
|
385
|
+
let t14;
|
|
386
|
+
if ($[35] !== t13 || $[36] !== t8) {
|
|
387
|
+
t14 = /*#__PURE__*/jsx(ActionBarContext.Provider, {
|
|
388
|
+
value: t8,
|
|
389
|
+
children: t13
|
|
376
390
|
});
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
$[67] = t24;
|
|
391
|
+
$[35] = t13;
|
|
392
|
+
$[36] = t8;
|
|
393
|
+
$[37] = t14;
|
|
381
394
|
} else {
|
|
382
|
-
|
|
395
|
+
t14 = $[37];
|
|
383
396
|
}
|
|
384
|
-
return
|
|
397
|
+
return t14;
|
|
385
398
|
};
|
|
386
|
-
function
|
|
387
|
-
const $ = c(
|
|
399
|
+
function useWidth(ref) {
|
|
400
|
+
const $ = c(3);
|
|
401
|
+
const [width, setWidth] = useState(-1);
|
|
388
402
|
let t0;
|
|
403
|
+
let t1;
|
|
389
404
|
if ($[0] !== ref) {
|
|
390
|
-
t0 =
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
});
|
|
394
|
-
if (ref.current) {
|
|
395
|
-
observer.observe(ref.current);
|
|
396
|
-
}
|
|
397
|
-
return () => observer.disconnect();
|
|
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);
|
|
398
408
|
};
|
|
409
|
+
t1 = [ref];
|
|
399
410
|
$[0] = ref;
|
|
400
411
|
$[1] = t0;
|
|
412
|
+
$[2] = t1;
|
|
401
413
|
} else {
|
|
402
414
|
t0 = $[1];
|
|
415
|
+
t1 = $[2];
|
|
403
416
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
t1 = () => ref.current ? ref.current.offsetTop > 0 : false;
|
|
407
|
-
$[2] = ref;
|
|
408
|
-
$[3] = t1;
|
|
409
|
-
} else {
|
|
410
|
-
t1 = $[3];
|
|
411
|
-
}
|
|
412
|
-
const isOverflowing = useSyncExternalStore(t0, t1, _temp4);
|
|
413
|
-
const id = ActionBarItemsRegistry.useRegisterDescendant(isOverflowing ? registryProps : null);
|
|
414
|
-
let t2;
|
|
415
|
-
if ($[4] !== id || $[5] !== isOverflowing) {
|
|
416
|
-
t2 = {
|
|
417
|
-
id,
|
|
418
|
-
isOverflowing
|
|
419
|
-
};
|
|
420
|
-
$[4] = id;
|
|
421
|
-
$[5] = isOverflowing;
|
|
422
|
-
$[6] = t2;
|
|
423
|
-
} else {
|
|
424
|
-
t2 = $[6];
|
|
425
|
-
}
|
|
426
|
-
return t2;
|
|
427
|
-
}
|
|
428
|
-
function _temp4() {
|
|
429
|
-
return false;
|
|
417
|
+
useIsomorphicLayoutEffect(t0, t1);
|
|
418
|
+
return width;
|
|
430
419
|
}
|
|
431
420
|
const ActionBarIconButton = /*#__PURE__*/forwardRef(({
|
|
432
421
|
disabled,
|
|
@@ -436,37 +425,39 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef(({
|
|
|
436
425
|
const ref = useRef(null);
|
|
437
426
|
useRefObjectAsForwardedRef(forwardedRef, ref);
|
|
438
427
|
const {
|
|
439
|
-
size
|
|
428
|
+
size,
|
|
429
|
+
isVisibleChild
|
|
440
430
|
} = React.useContext(ActionBarContext);
|
|
441
431
|
const {
|
|
442
432
|
groupId
|
|
443
433
|
} = React.useContext(ActionBarGroupContext);
|
|
434
|
+
const width = useWidth(ref);
|
|
444
435
|
const {
|
|
445
436
|
['aria-label']: ariaLabel,
|
|
446
437
|
icon
|
|
447
438
|
} = props;
|
|
448
|
-
const {
|
|
449
|
-
isOverflowing
|
|
450
|
-
} = useActionBarItem(ref, useMemo(() => ({
|
|
439
|
+
const registryProps = useMemo(() => ({
|
|
451
440
|
type: 'action',
|
|
452
441
|
label: ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : '',
|
|
453
442
|
icon,
|
|
454
443
|
disabled: !!disabled,
|
|
455
444
|
onClick: onClick,
|
|
445
|
+
width,
|
|
456
446
|
groupId: groupId !== null && groupId !== void 0 ? groupId : undefined
|
|
457
|
-
}), [ariaLabel, icon, disabled, onClick, groupId])
|
|
447
|
+
}), [ariaLabel, icon, disabled, onClick, groupId, width]);
|
|
448
|
+
const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
|
|
458
449
|
const clickHandler = useCallback(event => {
|
|
459
450
|
if (disabled) return;
|
|
460
451
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
461
452
|
}, [disabled, onClick]);
|
|
453
|
+
if (!isVisibleChild(id) || groupId && !isVisibleChild(groupId)) return null;
|
|
462
454
|
return /*#__PURE__*/jsx(IconButton, {
|
|
463
455
|
"aria-disabled": disabled,
|
|
464
456
|
ref: ref,
|
|
465
457
|
size: size,
|
|
466
458
|
onClick: clickHandler,
|
|
467
459
|
...props,
|
|
468
|
-
variant: "invisible"
|
|
469
|
-
"data-overflowing": isOverflowing
|
|
460
|
+
variant: "invisible"
|
|
470
461
|
});
|
|
471
462
|
});
|
|
472
463
|
const ActionBarGroupContext = /*#__PURE__*/React.createContext({
|
|
@@ -479,39 +470,38 @@ const ActionBarGroup = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
479
470
|
} = t0;
|
|
480
471
|
const backupRef = useRef(null);
|
|
481
472
|
const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
|
|
473
|
+
const width = useWidth(ref);
|
|
482
474
|
let t1;
|
|
483
|
-
if ($[0]
|
|
475
|
+
if ($[0] !== width) {
|
|
484
476
|
t1 = {
|
|
485
|
-
type: "group"
|
|
477
|
+
type: "group",
|
|
478
|
+
width
|
|
486
479
|
};
|
|
487
|
-
$[0] =
|
|
480
|
+
$[0] = width;
|
|
481
|
+
$[1] = t1;
|
|
488
482
|
} else {
|
|
489
|
-
t1 = $[
|
|
483
|
+
t1 = $[1];
|
|
490
484
|
}
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
isOverflowing
|
|
494
|
-
} = useActionBarItem(ref, t1);
|
|
485
|
+
const registryProps = t1;
|
|
486
|
+
const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
|
|
495
487
|
let t2;
|
|
496
|
-
if ($[
|
|
488
|
+
if ($[2] !== id) {
|
|
497
489
|
t2 = {
|
|
498
490
|
groupId: id
|
|
499
491
|
};
|
|
500
|
-
$[
|
|
501
|
-
$[
|
|
492
|
+
$[2] = id;
|
|
493
|
+
$[3] = t2;
|
|
502
494
|
} else {
|
|
503
|
-
t2 = $[
|
|
495
|
+
t2 = $[3];
|
|
504
496
|
}
|
|
505
497
|
let t3;
|
|
506
|
-
if ($[
|
|
498
|
+
if ($[4] !== children || $[5] !== ref) {
|
|
507
499
|
t3 = /*#__PURE__*/jsx("div", {
|
|
508
500
|
className: styles.Group,
|
|
509
501
|
ref: ref,
|
|
510
|
-
"data-overflowing": isOverflowing,
|
|
511
502
|
children: children
|
|
512
503
|
});
|
|
513
|
-
$[
|
|
514
|
-
$[4] = isOverflowing;
|
|
504
|
+
$[4] = children;
|
|
515
505
|
$[5] = ref;
|
|
516
506
|
$[6] = t3;
|
|
517
507
|
} else {
|
|
@@ -565,12 +555,17 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
565
555
|
}
|
|
566
556
|
const backupRef = useRef(null);
|
|
567
557
|
const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
|
|
558
|
+
const {
|
|
559
|
+
isVisibleChild
|
|
560
|
+
} = React.useContext(ActionBarContext);
|
|
568
561
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
562
|
+
const width = useWidth(ref);
|
|
569
563
|
const t1 = overflowIcon ? overflowIcon : icon;
|
|
570
564
|
let t2;
|
|
571
|
-
if ($[7] !== ariaLabel || $[8] !== items || $[9] !== returnFocusRef || $[10] !== t1) {
|
|
565
|
+
if ($[7] !== ariaLabel || $[8] !== items || $[9] !== returnFocusRef || $[10] !== t1 || $[11] !== width) {
|
|
572
566
|
t2 = {
|
|
573
567
|
type: "menu",
|
|
568
|
+
width,
|
|
574
569
|
label: ariaLabel,
|
|
575
570
|
icon: t1,
|
|
576
571
|
returnFocusRef,
|
|
@@ -580,124 +575,130 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
580
575
|
$[8] = items;
|
|
581
576
|
$[9] = returnFocusRef;
|
|
582
577
|
$[10] = t1;
|
|
583
|
-
$[11] =
|
|
578
|
+
$[11] = width;
|
|
579
|
+
$[12] = t2;
|
|
584
580
|
} else {
|
|
585
|
-
t2 = $[
|
|
581
|
+
t2 = $[12];
|
|
586
582
|
}
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
583
|
+
const registryProps = t2;
|
|
584
|
+
const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
|
|
585
|
+
if (!isVisibleChild(id)) {
|
|
586
|
+
return null;
|
|
587
|
+
}
|
|
588
|
+
let t3;
|
|
589
|
+
if ($[13] !== ariaLabel || $[14] !== icon || $[15] !== props) {
|
|
590
|
+
t3 = /*#__PURE__*/jsx(ActionMenu.Anchor, {
|
|
594
591
|
children: /*#__PURE__*/jsx(IconButton, {
|
|
595
592
|
variant: "invisible",
|
|
596
593
|
"aria-label": ariaLabel,
|
|
597
594
|
icon: icon,
|
|
598
|
-
...props
|
|
599
|
-
"data-overflowing": t3
|
|
595
|
+
...props
|
|
600
596
|
})
|
|
601
597
|
});
|
|
602
|
-
$[
|
|
603
|
-
$[
|
|
604
|
-
$[
|
|
605
|
-
$[
|
|
606
|
-
$[16] = t4;
|
|
598
|
+
$[13] = ariaLabel;
|
|
599
|
+
$[14] = icon;
|
|
600
|
+
$[15] = props;
|
|
601
|
+
$[16] = t3;
|
|
607
602
|
} else {
|
|
608
|
-
|
|
603
|
+
t3 = $[16];
|
|
609
604
|
}
|
|
610
|
-
let
|
|
605
|
+
let t4;
|
|
611
606
|
if ($[17] !== returnFocusRef) {
|
|
612
|
-
|
|
607
|
+
t4 = returnFocusRef && {
|
|
613
608
|
returnFocusRef
|
|
614
609
|
};
|
|
615
610
|
$[17] = returnFocusRef;
|
|
616
|
-
$[18] =
|
|
611
|
+
$[18] = t4;
|
|
617
612
|
} else {
|
|
618
|
-
|
|
613
|
+
t4 = $[18];
|
|
619
614
|
}
|
|
620
|
-
let
|
|
615
|
+
let t5;
|
|
621
616
|
if ($[19] !== items) {
|
|
622
|
-
|
|
617
|
+
t5 = items.map(_temp4);
|
|
623
618
|
$[19] = items;
|
|
624
|
-
$[20] =
|
|
619
|
+
$[20] = t5;
|
|
625
620
|
} else {
|
|
626
|
-
|
|
621
|
+
t5 = $[20];
|
|
627
622
|
}
|
|
628
|
-
let
|
|
629
|
-
if ($[21] !==
|
|
630
|
-
|
|
631
|
-
children:
|
|
623
|
+
let t6;
|
|
624
|
+
if ($[21] !== t5) {
|
|
625
|
+
t6 = /*#__PURE__*/jsx(ActionList, {
|
|
626
|
+
children: t5
|
|
632
627
|
});
|
|
633
|
-
$[21] =
|
|
634
|
-
$[22] =
|
|
628
|
+
$[21] = t5;
|
|
629
|
+
$[22] = t6;
|
|
635
630
|
} else {
|
|
636
|
-
|
|
631
|
+
t6 = $[22];
|
|
637
632
|
}
|
|
638
|
-
let
|
|
639
|
-
if ($[23] !==
|
|
640
|
-
|
|
641
|
-
...
|
|
642
|
-
children:
|
|
633
|
+
let t7;
|
|
634
|
+
if ($[23] !== t4 || $[24] !== t6) {
|
|
635
|
+
t7 = /*#__PURE__*/jsx(ActionMenu.Overlay, {
|
|
636
|
+
...t4,
|
|
637
|
+
children: t6
|
|
643
638
|
});
|
|
644
|
-
$[23] =
|
|
645
|
-
$[24] =
|
|
646
|
-
$[25] =
|
|
639
|
+
$[23] = t4;
|
|
640
|
+
$[24] = t6;
|
|
641
|
+
$[25] = t7;
|
|
647
642
|
} else {
|
|
648
|
-
|
|
643
|
+
t7 = $[25];
|
|
649
644
|
}
|
|
650
|
-
let
|
|
651
|
-
if ($[26] !== menuOpen || $[27] !== ref || $[28] !==
|
|
652
|
-
|
|
645
|
+
let t8;
|
|
646
|
+
if ($[26] !== menuOpen || $[27] !== ref || $[28] !== t3 || $[29] !== t7) {
|
|
647
|
+
t8 = /*#__PURE__*/jsxs(ActionMenu, {
|
|
653
648
|
anchorRef: ref,
|
|
654
649
|
open: menuOpen,
|
|
655
650
|
onOpenChange: setMenuOpen,
|
|
656
|
-
children: [
|
|
651
|
+
children: [t3, t7]
|
|
657
652
|
});
|
|
658
653
|
$[26] = menuOpen;
|
|
659
654
|
$[27] = ref;
|
|
660
|
-
$[28] =
|
|
661
|
-
$[29] =
|
|
662
|
-
$[30] =
|
|
655
|
+
$[28] = t3;
|
|
656
|
+
$[29] = t7;
|
|
657
|
+
$[30] = t8;
|
|
663
658
|
} else {
|
|
664
|
-
|
|
659
|
+
t8 = $[30];
|
|
665
660
|
}
|
|
666
|
-
return
|
|
661
|
+
return t8;
|
|
667
662
|
});
|
|
668
663
|
const VerticalDivider = () => {
|
|
669
664
|
const $ = c(3);
|
|
670
665
|
const ref = useRef(null);
|
|
666
|
+
const {
|
|
667
|
+
isVisibleChild
|
|
668
|
+
} = React.useContext(ActionBarContext);
|
|
669
|
+
const width = useWidth(ref);
|
|
671
670
|
let t0;
|
|
672
|
-
if ($[0]
|
|
671
|
+
if ($[0] !== width) {
|
|
673
672
|
t0 = {
|
|
674
|
-
type: "divider"
|
|
673
|
+
type: "divider",
|
|
674
|
+
width
|
|
675
675
|
};
|
|
676
|
-
$[0] =
|
|
676
|
+
$[0] = width;
|
|
677
|
+
$[1] = t0;
|
|
677
678
|
} else {
|
|
678
|
-
t0 = $[
|
|
679
|
+
t0 = $[1];
|
|
680
|
+
}
|
|
681
|
+
const registryProps = t0;
|
|
682
|
+
const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
|
|
683
|
+
if (!isVisibleChild(id)) {
|
|
684
|
+
return null;
|
|
679
685
|
}
|
|
680
|
-
const {
|
|
681
|
-
isOverflowing
|
|
682
|
-
} = useActionBarItem(ref, t0);
|
|
683
686
|
let t1;
|
|
684
|
-
if ($[
|
|
687
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
685
688
|
t1 = /*#__PURE__*/jsx("div", {
|
|
686
689
|
ref: ref,
|
|
687
690
|
"data-component": "ActionBar.VerticalDivider",
|
|
688
691
|
"aria-hidden": "true",
|
|
689
|
-
className: styles.Divider
|
|
690
|
-
"data-overflowing": isOverflowing
|
|
692
|
+
className: styles.Divider
|
|
691
693
|
});
|
|
692
|
-
$[1] = isOverflowing;
|
|
693
694
|
$[2] = t1;
|
|
694
695
|
} else {
|
|
695
696
|
t1 = $[2];
|
|
696
697
|
}
|
|
697
698
|
return t1;
|
|
698
699
|
};
|
|
699
|
-
function _temp(
|
|
700
|
-
return
|
|
700
|
+
function _temp() {
|
|
701
|
+
return new Set();
|
|
701
702
|
}
|
|
702
703
|
function _temp2(item, index) {
|
|
703
704
|
return renderMenuItem(item, index);
|
|
@@ -723,7 +724,7 @@ function _temp3(t0) {
|
|
|
723
724
|
}
|
|
724
725
|
return null;
|
|
725
726
|
}
|
|
726
|
-
function
|
|
727
|
+
function _temp4(item, index) {
|
|
727
728
|
return renderMenuItem(item, index);
|
|
728
729
|
}
|
|
729
730
|
|