@primer/react 38.23.0 → 38.24.0-rc.4089ee5c5
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 +30 -0
- package/dist/ActionBar/ActionBar-e63def3c.css +2 -0
- package/dist/ActionBar/ActionBar-e63def3c.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 +295 -381
- package/dist/ActionBar/ActionBar.module.css.js +2 -2
- package/dist/ActionBar/index.d.ts +1 -1
- package/dist/ActionList/{Group-743ff5c8.css → Group-efcb39da.css} +2 -2
- package/dist/ActionList/Group-efcb39da.css.map +1 -0
- package/dist/ActionList/Group.d.ts +6 -9
- package/dist/ActionList/Group.d.ts.map +1 -1
- package/dist/ActionList/Group.js +52 -22
- package/dist/ActionList/Group.module.css.js +2 -2
- package/dist/ActionList/GroupHeadingTrailingAction.d.ts +21 -0
- package/dist/ActionList/GroupHeadingTrailingAction.d.ts.map +1 -0
- package/dist/ActionList/GroupHeadingTrailingAction.js +66 -0
- package/dist/ActionList/index.d.ts +7 -1
- package/dist/ActionList/index.d.ts.map +1 -1
- package/dist/Blankslate/Blankslate.d.ts.map +1 -1
- package/dist/Blankslate/Blankslate.js +6 -0
- package/dist/BranchName/BranchName.js +1 -0
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +3 -0
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +1 -0
- package/dist/Checkbox/Checkbox.d.ts +1 -0
- package/dist/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox/Checkbox.js +10 -5
- package/dist/CheckboxGroup/CheckboxGroup.js +1 -0
- package/dist/CircleBadge/CircleBadge.d.ts.map +1 -1
- package/dist/CircleBadge/CircleBadge.js +44 -28
- package/dist/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -1
- package/dist/ConfirmationDialog/ConfirmationDialog.js +1 -0
- package/dist/CounterLabel/CounterLabel.d.ts +2 -0
- package/dist/CounterLabel/CounterLabel.d.ts.map +1 -1
- package/dist/CounterLabel/CounterLabel.js +25 -90
- package/dist/Details/Details.d.ts +6 -2
- package/dist/Details/Details.d.ts.map +1 -1
- package/dist/Details/Details.js +31 -22
- package/dist/Dialog/Dialog.d.ts +1 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +16 -6
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +2 -1
- package/dist/Flash/Flash.d.ts.map +1 -1
- package/dist/Flash/Flash.js +2 -1
- package/dist/FormControl/FormControl.d.ts.map +1 -1
- package/dist/FormControl/FormControl.js +2 -0
- package/dist/FormControl/FormControlCaption.d.ts.map +1 -1
- package/dist/FormControl/FormControlCaption.js +1 -0
- package/dist/FormControl/FormControlLabel.d.ts.map +1 -1
- package/dist/FormControl/FormControlLabel.js +1 -0
- package/dist/FormControl/FormControlLeadingVisual.d.ts.map +1 -1
- package/dist/FormControl/FormControlLeadingVisual.js +1 -0
- package/dist/FormControl/_FormControlValidation.d.ts.map +1 -1
- package/dist/FormControl/_FormControlValidation.js +1 -0
- package/dist/Header/Header.d.ts.map +1 -1
- package/dist/Header/Header.js +3 -0
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +1 -0
- package/dist/Timeline/{Timeline-ad31a7fb.css → Timeline-05decc91.css} +2 -2
- package/dist/Timeline/Timeline-05decc91.css.map +1 -0
- package/dist/Timeline/Timeline.module.css.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts +1 -0
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +5 -2
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +3 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.d.ts +1 -0
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +3 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +3 -1
- package/dist/internal/components/InputValidation.d.ts +2 -1
- package/dist/internal/components/InputValidation.d.ts.map +1 -1
- package/dist/internal/components/InputValidation.js +64 -33
- package/generated/components.json +4 -0
- package/package.json +1 -1
- package/dist/ActionBar/ActionBar-a41224b2.css +0 -2
- package/dist/ActionBar/ActionBar-a41224b2.css.map +0 -1
- package/dist/ActionList/Group-743ff5c8.css.map +0 -1
- package/dist/Timeline/Timeline-ad31a7fb.css.map +0 -1
|
@@ -1,53 +1,27 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React, { useRef, useState,
|
|
2
|
+
import React, { forwardRef, useRef, useState, useMemo, useCallback, useContext, useSyncExternalStore } from 'react';
|
|
3
3
|
import { KebabHorizontalIcon } from '@primer/octicons-react';
|
|
4
4
|
import { ActionList } from '../ActionList/index.js';
|
|
5
|
-
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
6
|
-
import { useResizeObserver } from '../hooks/useResizeObserver.js';
|
|
7
5
|
import { IconButton } from '../Button/IconButton.js';
|
|
8
6
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
9
7
|
import styles from './ActionBar.module.css.js';
|
|
10
8
|
import { clsx } from 'clsx';
|
|
11
9
|
import { createDescendantRegistry } from '../utils/descendant-registry.js';
|
|
12
|
-
import {
|
|
10
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
11
|
import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
|
|
14
12
|
import { FocusKeys } from '@primer/behaviors';
|
|
15
13
|
import { ActionMenu } from '../ActionMenu/ActionMenu.js';
|
|
16
14
|
|
|
17
|
-
const ACTIONBAR_ITEM_GAP = 8;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Registry of descendants to render in the list or menu. To preserve insertion order across updates, children are
|
|
21
|
-
* set to `null` when unregistered rather than fully dropped from the map.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
15
|
const ActionBarContext = /*#__PURE__*/React.createContext({
|
|
25
|
-
size: 'medium'
|
|
26
|
-
isVisibleChild: () => true,
|
|
27
|
-
groupId: undefined
|
|
16
|
+
size: 'medium'
|
|
28
17
|
});
|
|
29
18
|
|
|
30
19
|
/*
|
|
31
20
|
small (28px), medium (32px), large (40px)
|
|
32
21
|
*/
|
|
33
22
|
|
|
34
|
-
const MORE_BTN_WIDTH = 32;
|
|
35
23
|
const ActionBarItemsRegistry = createDescendantRegistry();
|
|
36
|
-
const
|
|
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
|
-
};
|
|
24
|
+
const FOCUSABLE_ITEM_SELECTOR = ':is(button, a, input, [tabindex]):not(:disabled):not([data-overflowing]):not([data-more-button-inactive])';
|
|
51
25
|
const renderMenuItem = (item, index) => {
|
|
52
26
|
if (item.type === 'divider') {
|
|
53
27
|
return /*#__PURE__*/jsx(ActionList.Divider, {}, index);
|
|
@@ -96,328 +70,258 @@ const renderMenuItem = (item, index) => {
|
|
|
96
70
|
}, label);
|
|
97
71
|
};
|
|
98
72
|
renderMenuItem.displayName = "renderMenuItem";
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
const registryEntries = Array.from((_childRegistry$entrie = childRegistry === null || childRegistry === void 0 ? void 0 : childRegistry.entries()) !== null && _childRegistry$entrie !== void 0 ? _childRegistry$entrie : []).filter(entry => entry[1] !== null && (entry[1].type !== 'action' || entry[1].groupId === undefined));
|
|
102
|
-
if (registryEntries.length === 0) return new Set();
|
|
103
|
-
const numberOfItemsPossible = calculatePossibleItems(registryEntries, navWidth, gap);
|
|
104
|
-
const numberOfItemsPossibleWithMoreMenu = calculatePossibleItems(registryEntries, navWidth, gap, moreMenuWidth || MORE_BTN_WIDTH);
|
|
105
|
-
const menuItems = new Set();
|
|
106
|
-
|
|
107
|
-
// First, we check if we can fit all the items with their icons
|
|
108
|
-
if (registryEntries.length >= numberOfItemsPossible) {
|
|
109
|
-
/* Below is an accessibility requirement. Never show only one item in the overflow menu.
|
|
110
|
-
* If there is only one item left to display in the overflow menu according to the calculation,
|
|
111
|
-
* we need to pull another item from the list into the overflow menu.
|
|
112
|
-
*/
|
|
113
|
-
const numberOfItemsInMenu = registryEntries.length - numberOfItemsPossibleWithMoreMenu;
|
|
114
|
-
const numberOfListItems = numberOfItemsInMenu === 1 ? numberOfItemsPossibleWithMoreMenu - 1 : numberOfItemsPossibleWithMoreMenu;
|
|
115
|
-
for (const [index, [id, child]] of registryEntries.entries()) {
|
|
116
|
-
if (index < numberOfListItems) {
|
|
117
|
-
continue;
|
|
118
|
-
//if the last item is a divider
|
|
119
|
-
} else if (child.type === 'divider') {
|
|
120
|
-
if (index === numberOfListItems - 1 || index === numberOfListItems) {
|
|
121
|
-
continue;
|
|
122
|
-
} else {
|
|
123
|
-
menuItems.add(id);
|
|
124
|
-
}
|
|
125
|
-
} else {
|
|
126
|
-
menuItems.add(id);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return menuItems;
|
|
130
|
-
} else if (numberOfItemsPossible > registryEntries.length && hasActiveMenu) {
|
|
131
|
-
/* If the items fit in the list and there are items in the overflow menu, we need to move them back to the list */
|
|
132
|
-
return new Set();
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
const ActionBar = props => {
|
|
136
|
-
const $ = c(38);
|
|
73
|
+
const ActionBar = t0 => {
|
|
74
|
+
const $ = c(40);
|
|
137
75
|
const {
|
|
138
|
-
size:
|
|
76
|
+
size: t1,
|
|
139
77
|
children,
|
|
140
78
|
"aria-label": ariaLabel,
|
|
141
79
|
"aria-labelledby": ariaLabelledBy,
|
|
142
|
-
flush:
|
|
80
|
+
flush: t2,
|
|
143
81
|
className,
|
|
144
|
-
gap:
|
|
145
|
-
} =
|
|
146
|
-
const size =
|
|
147
|
-
const flush =
|
|
148
|
-
const gap =
|
|
149
|
-
const listRef = useRef(null);
|
|
150
|
-
const [computedGap, setComputedGap] = useState(ACTIONBAR_ITEM_GAP);
|
|
82
|
+
gap: t3
|
|
83
|
+
} = t0;
|
|
84
|
+
const size = t1 === undefined ? "medium" : t1;
|
|
85
|
+
const flush = t2 === undefined ? false : t2;
|
|
86
|
+
const gap = t3 === undefined ? "condensed" : t3;
|
|
151
87
|
const [childRegistry, setChildRegistry] = ActionBarItemsRegistry.useRegistryState();
|
|
152
|
-
const [menuItemIds, setMenuItemIds] = useState(_temp);
|
|
153
|
-
const navRef = useRef(null);
|
|
154
|
-
let 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;
|
|
167
|
-
} else {
|
|
168
|
-
t3 = $[0];
|
|
169
|
-
}
|
|
170
88
|
let t4;
|
|
171
|
-
if ($[
|
|
172
|
-
t4 =
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
89
|
+
if ($[0] !== childRegistry) {
|
|
90
|
+
t4 = childRegistry && Array.from(childRegistry.entries()).filter(_temp);
|
|
91
|
+
$[0] = childRegistry;
|
|
92
|
+
$[1] = t4;
|
|
175
93
|
} else {
|
|
176
|
-
t4 = $[
|
|
94
|
+
t4 = $[1];
|
|
177
95
|
}
|
|
178
|
-
|
|
179
|
-
const moreMenuRef = useRef(null);
|
|
96
|
+
const overflowItems = t4;
|
|
180
97
|
let t5;
|
|
181
|
-
if ($[
|
|
182
|
-
t5 =
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
}
|
|
98
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
99
|
+
t5 = {
|
|
100
|
+
bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
|
|
101
|
+
focusOutBehavior: "wrap",
|
|
102
|
+
focusableElementFilter: _temp2
|
|
193
103
|
};
|
|
194
|
-
$[
|
|
195
|
-
$[4] = computedGap;
|
|
196
|
-
$[5] = menuItemIds.size;
|
|
197
|
-
$[6] = t5;
|
|
104
|
+
$[2] = t5;
|
|
198
105
|
} else {
|
|
199
|
-
t5 = $[
|
|
106
|
+
t5 = $[2];
|
|
200
107
|
}
|
|
201
|
-
useResizeObserver(t5, navRef);
|
|
202
108
|
let t6;
|
|
203
|
-
if ($[
|
|
204
|
-
t6 =
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
109
|
+
if ($[3] !== overflowItems) {
|
|
110
|
+
t6 = [overflowItems];
|
|
111
|
+
$[3] = overflowItems;
|
|
112
|
+
$[4] = t6;
|
|
207
113
|
} else {
|
|
208
|
-
t6 = $[
|
|
114
|
+
t6 = $[4];
|
|
209
115
|
}
|
|
210
|
-
const
|
|
116
|
+
const {
|
|
117
|
+
containerRef
|
|
118
|
+
} = useFocusZone(t5, t6);
|
|
211
119
|
let t7;
|
|
212
|
-
if ($[
|
|
120
|
+
if ($[5] !== size) {
|
|
213
121
|
t7 = {
|
|
214
|
-
|
|
215
|
-
bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
|
|
216
|
-
focusOutBehavior: "wrap"
|
|
122
|
+
size
|
|
217
123
|
};
|
|
218
|
-
$[
|
|
219
|
-
|
|
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;
|
|
124
|
+
$[5] = size;
|
|
125
|
+
$[6] = t7;
|
|
235
126
|
} else {
|
|
236
|
-
|
|
127
|
+
t7 = $[6];
|
|
237
128
|
}
|
|
238
|
-
const groupedItems = groupedItemsMap;
|
|
239
129
|
let t8;
|
|
240
|
-
if ($[
|
|
241
|
-
t8 =
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
$[
|
|
130
|
+
if ($[7] !== className) {
|
|
131
|
+
t8 = clsx(className, styles.Nav);
|
|
132
|
+
$[7] = className;
|
|
133
|
+
$[8] = t8;
|
|
134
|
+
} else {
|
|
135
|
+
t8 = $[8];
|
|
136
|
+
}
|
|
137
|
+
const t9 = containerRef;
|
|
138
|
+
const t10 = overflowItems ? overflowItems.length > 0 : undefined;
|
|
139
|
+
let t11;
|
|
140
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
141
|
+
t11 = /*#__PURE__*/jsx("div", {
|
|
142
|
+
className: styles.OverflowSpacer
|
|
143
|
+
});
|
|
144
|
+
$[9] = t11;
|
|
145
|
+
} else {
|
|
146
|
+
t11 = $[9];
|
|
147
|
+
}
|
|
148
|
+
let t12;
|
|
149
|
+
if ($[10] !== children || $[11] !== setChildRegistry) {
|
|
150
|
+
t12 = /*#__PURE__*/jsxs("div", {
|
|
151
|
+
className: styles.OverflowContainer,
|
|
152
|
+
children: [t11, /*#__PURE__*/jsx(ActionBarItemsRegistry.Provider, {
|
|
153
|
+
setRegistry: setChildRegistry,
|
|
154
|
+
children: children
|
|
155
|
+
})]
|
|
156
|
+
});
|
|
157
|
+
$[10] = children;
|
|
158
|
+
$[11] = setChildRegistry;
|
|
159
|
+
$[12] = t12;
|
|
160
|
+
} else {
|
|
161
|
+
t12 = $[12];
|
|
162
|
+
}
|
|
163
|
+
const t13 = `More ${ariaLabel} items ${overflowItems === null || overflowItems === void 0 ? void 0 : overflowItems.length}`;
|
|
164
|
+
const t14 = overflowItems !== null && overflowItems !== void 0 && overflowItems.length ? undefined : true;
|
|
165
|
+
let t15;
|
|
166
|
+
if ($[13] !== size || $[14] !== t13 || $[15] !== t14) {
|
|
167
|
+
t15 = /*#__PURE__*/jsx(ActionMenu.Anchor, {
|
|
168
|
+
children: /*#__PURE__*/jsx(IconButton, {
|
|
169
|
+
variant: "invisible",
|
|
170
|
+
"aria-label": t13,
|
|
171
|
+
icon: KebabHorizontalIcon,
|
|
172
|
+
className: styles.MoreButton,
|
|
173
|
+
"data-more-button-inactive": t14,
|
|
174
|
+
size: size
|
|
175
|
+
})
|
|
176
|
+
});
|
|
246
177
|
$[13] = size;
|
|
247
|
-
$[14] =
|
|
178
|
+
$[14] = t13;
|
|
179
|
+
$[15] = t14;
|
|
180
|
+
$[16] = t15;
|
|
248
181
|
} else {
|
|
249
|
-
|
|
182
|
+
t15 = $[16];
|
|
250
183
|
}
|
|
251
|
-
let
|
|
252
|
-
if ($[
|
|
253
|
-
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
184
|
+
let t16;
|
|
185
|
+
if ($[17] !== overflowItems) {
|
|
186
|
+
t16 = overflowItems === null || overflowItems === void 0 ? void 0 : overflowItems.map(_temp4);
|
|
187
|
+
$[17] = overflowItems;
|
|
188
|
+
$[18] = t16;
|
|
256
189
|
} else {
|
|
257
|
-
|
|
190
|
+
t16 = $[18];
|
|
258
191
|
}
|
|
259
|
-
let
|
|
260
|
-
if ($[
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
192
|
+
let t17;
|
|
193
|
+
if ($[19] !== t16) {
|
|
194
|
+
t17 = /*#__PURE__*/jsx(ActionMenu.Overlay, {
|
|
195
|
+
children: /*#__PURE__*/jsx(ActionList, {
|
|
196
|
+
children: t16
|
|
197
|
+
})
|
|
264
198
|
});
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[19] = t10;
|
|
199
|
+
$[19] = t16;
|
|
200
|
+
$[20] = t17;
|
|
268
201
|
} else {
|
|
269
|
-
|
|
202
|
+
t17 = $[20];
|
|
270
203
|
}
|
|
271
|
-
let
|
|
272
|
-
if ($[
|
|
273
|
-
|
|
274
|
-
children: [
|
|
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
|
-
})]
|
|
204
|
+
let t18;
|
|
205
|
+
if ($[21] !== t15 || $[22] !== t17) {
|
|
206
|
+
t18 = /*#__PURE__*/jsxs(ActionMenu, {
|
|
207
|
+
children: [t15, t17]
|
|
341
208
|
});
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
$[23] = menuItemIds;
|
|
346
|
-
$[24] = t11;
|
|
209
|
+
$[21] = t15;
|
|
210
|
+
$[22] = t17;
|
|
211
|
+
$[23] = t18;
|
|
347
212
|
} else {
|
|
348
|
-
|
|
213
|
+
t18 = $[23];
|
|
349
214
|
}
|
|
350
|
-
let
|
|
351
|
-
if ($[
|
|
352
|
-
|
|
353
|
-
ref:
|
|
215
|
+
let t19;
|
|
216
|
+
if ($[24] !== ariaLabel || $[25] !== ariaLabelledBy || $[26] !== gap || $[27] !== size || $[28] !== t10 || $[29] !== t12 || $[30] !== t18 || $[31] !== t9) {
|
|
217
|
+
t19 = /*#__PURE__*/jsxs("div", {
|
|
218
|
+
ref: t9,
|
|
354
219
|
role: "toolbar",
|
|
355
220
|
className: styles.List,
|
|
356
221
|
"aria-label": ariaLabel,
|
|
357
222
|
"aria-labelledby": ariaLabelledBy,
|
|
358
223
|
"data-gap": gap,
|
|
359
|
-
|
|
224
|
+
"data-size": size,
|
|
225
|
+
"data-has-overflow": t10,
|
|
226
|
+
children: [t12, t18]
|
|
360
227
|
});
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
228
|
+
$[24] = ariaLabel;
|
|
229
|
+
$[25] = ariaLabelledBy;
|
|
230
|
+
$[26] = gap;
|
|
231
|
+
$[27] = size;
|
|
364
232
|
$[28] = t10;
|
|
365
|
-
$[29] =
|
|
366
|
-
$[30] =
|
|
233
|
+
$[29] = t12;
|
|
234
|
+
$[30] = t18;
|
|
235
|
+
$[31] = t9;
|
|
236
|
+
$[32] = t19;
|
|
367
237
|
} else {
|
|
368
|
-
|
|
238
|
+
t19 = $[32];
|
|
369
239
|
}
|
|
370
|
-
let
|
|
371
|
-
if ($[
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
className: t9,
|
|
240
|
+
let t20;
|
|
241
|
+
if ($[33] !== flush || $[34] !== t19 || $[35] !== t8) {
|
|
242
|
+
t20 = /*#__PURE__*/jsx("div", {
|
|
243
|
+
className: t8,
|
|
375
244
|
"data-component": "ActionBar",
|
|
376
245
|
"data-flush": flush,
|
|
377
|
-
children:
|
|
246
|
+
children: t19
|
|
378
247
|
});
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
248
|
+
$[33] = flush;
|
|
249
|
+
$[34] = t19;
|
|
250
|
+
$[35] = t8;
|
|
251
|
+
$[36] = t20;
|
|
383
252
|
} else {
|
|
384
|
-
|
|
253
|
+
t20 = $[36];
|
|
385
254
|
}
|
|
386
|
-
let
|
|
387
|
-
if ($[
|
|
388
|
-
|
|
389
|
-
value:
|
|
390
|
-
children:
|
|
255
|
+
let t21;
|
|
256
|
+
if ($[37] !== t20 || $[38] !== t7) {
|
|
257
|
+
t21 = /*#__PURE__*/jsx(ActionBarContext.Provider, {
|
|
258
|
+
value: t7,
|
|
259
|
+
children: t20
|
|
391
260
|
});
|
|
392
|
-
$[
|
|
393
|
-
$[
|
|
394
|
-
$[
|
|
261
|
+
$[37] = t20;
|
|
262
|
+
$[38] = t7;
|
|
263
|
+
$[39] = t21;
|
|
395
264
|
} else {
|
|
396
|
-
|
|
265
|
+
t21 = $[39];
|
|
397
266
|
}
|
|
398
|
-
return
|
|
267
|
+
return t21;
|
|
399
268
|
};
|
|
400
|
-
function
|
|
401
|
-
|
|
402
|
-
const
|
|
269
|
+
function useActionBarItem(ref, registryProps) {
|
|
270
|
+
var _useContext;
|
|
271
|
+
const $ = c(8);
|
|
272
|
+
const isGroupOverflowing = (_useContext = useContext(ActionBarGroupContext)) === null || _useContext === void 0 ? void 0 : _useContext.isOverflowing;
|
|
273
|
+
const isInGroup = isGroupOverflowing !== undefined;
|
|
403
274
|
let t0;
|
|
275
|
+
if ($[0] !== isInGroup || $[1] !== ref) {
|
|
276
|
+
t0 = onChange => {
|
|
277
|
+
if (isInGroup) {
|
|
278
|
+
return _temp5;
|
|
279
|
+
}
|
|
280
|
+
const observer = new IntersectionObserver(() => onChange(), {
|
|
281
|
+
threshold: 0.75
|
|
282
|
+
});
|
|
283
|
+
if (ref.current) {
|
|
284
|
+
observer.observe(ref.current);
|
|
285
|
+
}
|
|
286
|
+
return () => observer.disconnect();
|
|
287
|
+
};
|
|
288
|
+
$[0] = isInGroup;
|
|
289
|
+
$[1] = ref;
|
|
290
|
+
$[2] = t0;
|
|
291
|
+
} else {
|
|
292
|
+
t0 = $[2];
|
|
293
|
+
}
|
|
294
|
+
const subscribeIntersectionObserver = t0;
|
|
404
295
|
let t1;
|
|
405
|
-
if ($[
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
296
|
+
if ($[3] !== ref) {
|
|
297
|
+
t1 = () => ref.current ? ref.current.offsetTop > 0 : false;
|
|
298
|
+
$[3] = ref;
|
|
299
|
+
$[4] = t1;
|
|
300
|
+
} else {
|
|
301
|
+
t1 = $[4];
|
|
302
|
+
}
|
|
303
|
+
const isItemOverflowing = useSyncExternalStore(subscribeIntersectionObserver, t1, _temp6);
|
|
304
|
+
const isOverflowing = isGroupOverflowing || isItemOverflowing;
|
|
305
|
+
ActionBarItemsRegistry.useRegisterDescendant(isOverflowing ? registryProps : null);
|
|
306
|
+
const t2 = isOverflowing ? "" : undefined;
|
|
307
|
+
let t3;
|
|
308
|
+
if ($[5] !== isOverflowing || $[6] !== t2) {
|
|
309
|
+
t3 = {
|
|
310
|
+
isOverflowing,
|
|
311
|
+
dataOverflowingAttr: t2
|
|
409
312
|
};
|
|
410
|
-
|
|
411
|
-
$[
|
|
412
|
-
$[
|
|
413
|
-
$[2] = t1;
|
|
313
|
+
$[5] = isOverflowing;
|
|
314
|
+
$[6] = t2;
|
|
315
|
+
$[7] = t3;
|
|
414
316
|
} else {
|
|
415
|
-
|
|
416
|
-
t1 = $[2];
|
|
317
|
+
t3 = $[7];
|
|
417
318
|
}
|
|
418
|
-
|
|
419
|
-
|
|
319
|
+
return t3;
|
|
320
|
+
}
|
|
321
|
+
function _temp6() {
|
|
322
|
+
return false;
|
|
420
323
|
}
|
|
324
|
+
function _temp5() {}
|
|
421
325
|
const ActionBarIconButton = /*#__PURE__*/forwardRef(({
|
|
422
326
|
disabled,
|
|
423
327
|
onClick,
|
|
@@ -426,44 +330,36 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef(({
|
|
|
426
330
|
const ref = useRef(null);
|
|
427
331
|
useRefObjectAsForwardedRef(forwardedRef, ref);
|
|
428
332
|
const {
|
|
429
|
-
size
|
|
430
|
-
isVisibleChild
|
|
333
|
+
size
|
|
431
334
|
} = React.useContext(ActionBarContext);
|
|
432
|
-
const {
|
|
433
|
-
groupId
|
|
434
|
-
} = React.useContext(ActionBarGroupContext);
|
|
435
|
-
const width = useWidth(ref);
|
|
436
335
|
const {
|
|
437
336
|
['aria-label']: ariaLabel,
|
|
438
337
|
icon
|
|
439
338
|
} = props;
|
|
440
|
-
const
|
|
339
|
+
const {
|
|
340
|
+
dataOverflowingAttr
|
|
341
|
+
} = useActionBarItem(ref, useMemo(() => ({
|
|
441
342
|
type: 'action',
|
|
442
343
|
label: ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : '',
|
|
443
344
|
icon,
|
|
444
345
|
disabled: !!disabled,
|
|
445
|
-
onClick: onClick
|
|
446
|
-
|
|
447
|
-
groupId: groupId !== null && groupId !== void 0 ? groupId : undefined
|
|
448
|
-
}), [ariaLabel, icon, disabled, onClick, groupId, width]);
|
|
449
|
-
const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
|
|
346
|
+
onClick: onClick
|
|
347
|
+
}), [ariaLabel, icon, disabled, onClick]));
|
|
450
348
|
const clickHandler = useCallback(event => {
|
|
451
349
|
if (disabled) return;
|
|
452
350
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
453
351
|
}, [disabled, onClick]);
|
|
454
|
-
if (!isVisibleChild(id) || groupId && !isVisibleChild(groupId)) return null;
|
|
455
352
|
return /*#__PURE__*/jsx(IconButton, {
|
|
456
353
|
"aria-disabled": disabled,
|
|
457
354
|
ref: ref,
|
|
458
355
|
size: size,
|
|
459
356
|
onClick: clickHandler,
|
|
460
357
|
...props,
|
|
461
|
-
variant: "invisible"
|
|
358
|
+
variant: "invisible",
|
|
359
|
+
"data-overflowing": dataOverflowingAttr
|
|
462
360
|
});
|
|
463
361
|
});
|
|
464
|
-
const ActionBarGroupContext = /*#__PURE__*/React.createContext(
|
|
465
|
-
groupId: null
|
|
466
|
-
});
|
|
362
|
+
const ActionBarGroupContext = /*#__PURE__*/React.createContext(null);
|
|
467
363
|
const ActionBarGroup = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
468
364
|
const $ = c(10);
|
|
469
365
|
const {
|
|
@@ -471,39 +367,40 @@ const ActionBarGroup = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
471
367
|
} = t0;
|
|
472
368
|
const backupRef = useRef(null);
|
|
473
369
|
const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
|
|
474
|
-
const width = useWidth(ref);
|
|
475
370
|
let t1;
|
|
476
|
-
if ($[0]
|
|
371
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
477
372
|
t1 = {
|
|
478
|
-
type: "group"
|
|
479
|
-
width
|
|
373
|
+
type: "group"
|
|
480
374
|
};
|
|
481
|
-
$[0] =
|
|
482
|
-
$[1] = t1;
|
|
375
|
+
$[0] = t1;
|
|
483
376
|
} else {
|
|
484
|
-
t1 = $[
|
|
377
|
+
t1 = $[0];
|
|
485
378
|
}
|
|
486
|
-
const
|
|
487
|
-
|
|
379
|
+
const {
|
|
380
|
+
dataOverflowingAttr,
|
|
381
|
+
isOverflowing
|
|
382
|
+
} = useActionBarItem(ref, t1);
|
|
488
383
|
let t2;
|
|
489
|
-
if ($[
|
|
384
|
+
if ($[1] !== isOverflowing) {
|
|
490
385
|
t2 = {
|
|
491
|
-
|
|
386
|
+
isOverflowing
|
|
492
387
|
};
|
|
493
|
-
$[
|
|
494
|
-
$[
|
|
388
|
+
$[1] = isOverflowing;
|
|
389
|
+
$[2] = t2;
|
|
495
390
|
} else {
|
|
496
|
-
t2 = $[
|
|
391
|
+
t2 = $[2];
|
|
497
392
|
}
|
|
498
393
|
let t3;
|
|
499
|
-
if ($[
|
|
394
|
+
if ($[3] !== children || $[4] !== dataOverflowingAttr || $[5] !== ref) {
|
|
500
395
|
t3 = /*#__PURE__*/jsx("div", {
|
|
501
396
|
className: styles.Group,
|
|
502
397
|
"data-component": "ActionBar.Group",
|
|
503
398
|
ref: ref,
|
|
399
|
+
"data-overflowing": dataOverflowingAttr,
|
|
504
400
|
children: children
|
|
505
401
|
});
|
|
506
|
-
$[
|
|
402
|
+
$[3] = children;
|
|
403
|
+
$[4] = dataOverflowingAttr;
|
|
507
404
|
$[5] = ref;
|
|
508
405
|
$[6] = t3;
|
|
509
406
|
} else {
|
|
@@ -557,17 +454,12 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
557
454
|
}
|
|
558
455
|
const backupRef = useRef(null);
|
|
559
456
|
const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
|
|
560
|
-
const {
|
|
561
|
-
isVisibleChild
|
|
562
|
-
} = React.useContext(ActionBarContext);
|
|
563
457
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
564
|
-
const width = useWidth(ref);
|
|
565
458
|
const t1 = overflowIcon ? overflowIcon : icon;
|
|
566
459
|
let t2;
|
|
567
|
-
if ($[7] !== ariaLabel || $[8] !== items || $[9] !== returnFocusRef || $[10] !== t1
|
|
460
|
+
if ($[7] !== ariaLabel || $[8] !== items || $[9] !== returnFocusRef || $[10] !== t1) {
|
|
568
461
|
t2 = {
|
|
569
462
|
type: "menu",
|
|
570
|
-
width,
|
|
571
463
|
label: ariaLabel,
|
|
572
464
|
icon: t1,
|
|
573
465
|
returnFocusRef,
|
|
@@ -577,28 +469,27 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
577
469
|
$[8] = items;
|
|
578
470
|
$[9] = returnFocusRef;
|
|
579
471
|
$[10] = t1;
|
|
580
|
-
$[11] =
|
|
581
|
-
$[12] = t2;
|
|
472
|
+
$[11] = t2;
|
|
582
473
|
} else {
|
|
583
|
-
t2 = $[
|
|
584
|
-
}
|
|
585
|
-
const registryProps = t2;
|
|
586
|
-
const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
|
|
587
|
-
if (!isVisibleChild(id)) {
|
|
588
|
-
return null;
|
|
474
|
+
t2 = $[11];
|
|
589
475
|
}
|
|
476
|
+
const {
|
|
477
|
+
dataOverflowingAttr
|
|
478
|
+
} = useActionBarItem(ref, t2);
|
|
590
479
|
let t3;
|
|
591
|
-
if ($[
|
|
480
|
+
if ($[12] !== ariaLabel || $[13] !== dataOverflowingAttr || $[14] !== icon || $[15] !== props) {
|
|
592
481
|
t3 = /*#__PURE__*/jsx(ActionMenu.Anchor, {
|
|
593
482
|
children: /*#__PURE__*/jsx(IconButton, {
|
|
594
483
|
variant: "invisible",
|
|
595
484
|
"aria-label": ariaLabel,
|
|
596
485
|
icon: icon,
|
|
597
486
|
...props,
|
|
487
|
+
"data-overflowing": dataOverflowingAttr,
|
|
598
488
|
"data-component": "ActionBar.Menu.IconButton"
|
|
599
489
|
})
|
|
600
490
|
});
|
|
601
|
-
$[
|
|
491
|
+
$[12] = ariaLabel;
|
|
492
|
+
$[13] = dataOverflowingAttr;
|
|
602
493
|
$[14] = icon;
|
|
603
494
|
$[15] = props;
|
|
604
495
|
$[16] = t3;
|
|
@@ -617,7 +508,7 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
617
508
|
}
|
|
618
509
|
let t5;
|
|
619
510
|
if ($[19] !== items) {
|
|
620
|
-
t5 = items.map(
|
|
511
|
+
t5 = items.map(_temp7);
|
|
621
512
|
$[19] = items;
|
|
622
513
|
$[20] = t5;
|
|
623
514
|
} else {
|
|
@@ -666,68 +557,91 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
666
557
|
const VerticalDivider = () => {
|
|
667
558
|
const $ = c(3);
|
|
668
559
|
const ref = useRef(null);
|
|
669
|
-
const {
|
|
670
|
-
isVisibleChild
|
|
671
|
-
} = React.useContext(ActionBarContext);
|
|
672
|
-
const width = useWidth(ref);
|
|
673
560
|
let t0;
|
|
674
|
-
if ($[0]
|
|
561
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
675
562
|
t0 = {
|
|
676
|
-
type: "divider"
|
|
677
|
-
width
|
|
563
|
+
type: "divider"
|
|
678
564
|
};
|
|
679
|
-
$[0] =
|
|
680
|
-
$[1] = t0;
|
|
565
|
+
$[0] = t0;
|
|
681
566
|
} else {
|
|
682
|
-
t0 = $[
|
|
683
|
-
}
|
|
684
|
-
const registryProps = t0;
|
|
685
|
-
const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
|
|
686
|
-
if (!isVisibleChild(id)) {
|
|
687
|
-
return null;
|
|
567
|
+
t0 = $[0];
|
|
688
568
|
}
|
|
569
|
+
const {
|
|
570
|
+
dataOverflowingAttr
|
|
571
|
+
} = useActionBarItem(ref, t0);
|
|
689
572
|
let t1;
|
|
690
|
-
if ($[
|
|
573
|
+
if ($[1] !== dataOverflowingAttr) {
|
|
691
574
|
t1 = /*#__PURE__*/jsx("div", {
|
|
692
575
|
ref: ref,
|
|
693
576
|
"data-component": "ActionBar.VerticalDivider",
|
|
694
577
|
"aria-hidden": "true",
|
|
695
|
-
className: styles.Divider
|
|
578
|
+
className: styles.Divider,
|
|
579
|
+
"data-overflowing": dataOverflowingAttr
|
|
696
580
|
});
|
|
581
|
+
$[1] = dataOverflowingAttr;
|
|
697
582
|
$[2] = t1;
|
|
698
583
|
} else {
|
|
699
584
|
t1 = $[2];
|
|
700
585
|
}
|
|
701
586
|
return t1;
|
|
702
587
|
};
|
|
703
|
-
function _temp() {
|
|
704
|
-
return
|
|
588
|
+
function _temp(entry) {
|
|
589
|
+
return entry[1] !== null;
|
|
705
590
|
}
|
|
706
|
-
function _temp2(
|
|
591
|
+
function _temp2(element) {
|
|
592
|
+
return element.matches(FOCUSABLE_ITEM_SELECTOR);
|
|
593
|
+
}
|
|
594
|
+
function _temp3(item, index) {
|
|
707
595
|
return renderMenuItem(item, index);
|
|
708
596
|
}
|
|
709
|
-
function
|
|
710
|
-
const [
|
|
711
|
-
if (
|
|
597
|
+
function _temp4(t0) {
|
|
598
|
+
const [id, menuItem] = t0;
|
|
599
|
+
if (menuItem.type === "divider") {
|
|
600
|
+
return /*#__PURE__*/jsx(ActionList.Divider, {}, id);
|
|
601
|
+
}
|
|
602
|
+
if (menuItem.type === "action") {
|
|
712
603
|
const {
|
|
713
|
-
onClick
|
|
714
|
-
icon:
|
|
715
|
-
label
|
|
716
|
-
disabled
|
|
717
|
-
} =
|
|
604
|
+
onClick,
|
|
605
|
+
icon: Icon,
|
|
606
|
+
label,
|
|
607
|
+
disabled
|
|
608
|
+
} = menuItem;
|
|
718
609
|
return /*#__PURE__*/jsxs(ActionList.Item, {
|
|
719
|
-
onSelect:
|
|
720
|
-
typeof
|
|
610
|
+
onSelect: event => {
|
|
611
|
+
typeof onClick === "function" && onClick(event);
|
|
721
612
|
},
|
|
722
|
-
disabled:
|
|
613
|
+
disabled: disabled,
|
|
723
614
|
children: [/*#__PURE__*/jsx(ActionList.LeadingVisual, {
|
|
724
|
-
children: /*#__PURE__*/jsx(
|
|
725
|
-
}),
|
|
726
|
-
},
|
|
615
|
+
children: /*#__PURE__*/jsx(Icon, {})
|
|
616
|
+
}), label]
|
|
617
|
+
}, label);
|
|
618
|
+
}
|
|
619
|
+
if (menuItem.type === "menu") {
|
|
620
|
+
const menuItems = menuItem.items;
|
|
621
|
+
const {
|
|
622
|
+
icon: Icon_0,
|
|
623
|
+
label: label_0,
|
|
624
|
+
returnFocusRef
|
|
625
|
+
} = menuItem;
|
|
626
|
+
return /*#__PURE__*/jsxs(ActionMenu, {
|
|
627
|
+
children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
|
|
628
|
+
children: /*#__PURE__*/jsxs(ActionList.Item, {
|
|
629
|
+
children: [Icon_0 !== "none" ? /*#__PURE__*/jsx(ActionList.LeadingVisual, {
|
|
630
|
+
children: /*#__PURE__*/jsx(Icon_0, {})
|
|
631
|
+
}) : null, label_0]
|
|
632
|
+
})
|
|
633
|
+
}), /*#__PURE__*/jsx(ActionMenu.Overlay, {
|
|
634
|
+
...(returnFocusRef && {
|
|
635
|
+
returnFocusRef
|
|
636
|
+
}),
|
|
637
|
+
children: /*#__PURE__*/jsx(ActionList, {
|
|
638
|
+
children: menuItems.map(_temp3)
|
|
639
|
+
})
|
|
640
|
+
})]
|
|
641
|
+
}, id);
|
|
727
642
|
}
|
|
728
|
-
return null;
|
|
729
643
|
}
|
|
730
|
-
function
|
|
644
|
+
function _temp7(item, index) {
|
|
731
645
|
return renderMenuItem(item, index);
|
|
732
646
|
}
|
|
733
647
|
|