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