@primer/react 0.0.0-20260420153513 → 0.0.0-20260421161712
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 +6 -42
- package/dist/ActionBar/ActionBar-3f7b52a3.css +2 -0
- package/dist/ActionBar/ActionBar-3f7b52a3.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 +296 -383
- package/dist/ActionBar/ActionBar.module.css.js +2 -2
- package/dist/ActionBar/index.d.ts +1 -1
- package/dist/ActionList/ActionList-8b212f46.css +2 -0
- package/dist/ActionList/ActionList-8b212f46.css.map +1 -0
- package/dist/ActionList/ActionList.module.css.js +1 -1
- package/dist/ActionList/Group-2c8b5711.css +1 -1
- package/dist/ActionList/Group-2c8b5711.css.map +1 -1
- package/dist/ActionList/Heading.js +17 -16
- package/dist/ActionMenu/ActionMenu-58362ca7.css +2 -0
- package/dist/ActionMenu/ActionMenu-58362ca7.css.map +1 -0
- package/dist/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/dist/ActionMenu/ActionMenu.js +5 -0
- package/dist/ActionMenu/ActionMenu.module.css.js +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay-647c7065.css +2 -0
- package/dist/AnchoredOverlay/AnchoredOverlay-647c7065.css.map +1 -0
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts +0 -5
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +29 -61
- package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +1 -1
- package/dist/Autocomplete/AutocompleteInput.js +3 -3
- package/dist/Autocomplete/AutocompleteOverlay.js +3 -3
- package/dist/Avatar/Avatar-61b19061.css +1 -1
- package/dist/Avatar/Avatar-61b19061.css.map +1 -1
- package/dist/AvatarStack/AvatarStack-8526f38a.css +1 -1
- package/dist/AvatarStack/AvatarStack-8526f38a.css.map +1 -1
- package/dist/Banner/Banner-41040ab7.css +1 -1
- package/dist/Banner/Banner-41040ab7.css.map +1 -1
- package/dist/BaseStyles-fda34843.css +1 -1
- package/dist/BaseStyles-fda34843.css.map +1 -1
- package/dist/Blankslate/Blankslate-a039d79a.css +1 -1
- package/dist/Blankslate/Blankslate-a039d79a.css.map +1 -1
- package/dist/BranchName/BranchName-2fad4f4b.css +1 -1
- package/dist/BranchName/BranchName-2fad4f4b.css.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs-dbfc9d95.css +1 -1
- package/dist/Breadcrumbs/Breadcrumbs-dbfc9d95.css.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +59 -51
- package/dist/Button/ButtonBase-4da3fa22.css +1 -1
- package/dist/Button/ButtonBase-4da3fa22.css.map +1 -1
- package/dist/Button/ButtonBase.d.ts.map +1 -1
- package/dist/Button/ButtonBase.js +3 -4
- package/dist/Checkbox/Checkbox-edc5dc3e.css +1 -1
- package/dist/Checkbox/Checkbox-edc5dc3e.css.map +1 -1
- package/dist/Checkbox/shared-edc41e16.css +1 -1
- package/dist/Checkbox/shared-edc41e16.css.map +1 -1
- package/dist/CircleBadge/CircleBadge-87549d20.css +1 -1
- package/dist/CircleBadge/CircleBadge-87549d20.css.map +1 -1
- package/dist/CounterLabel/CounterLabel-8c6e8ee4.css +1 -1
- package/dist/CounterLabel/CounterLabel-8c6e8ee4.css.map +1 -1
- package/dist/DataTable/Pagination-b6f8418c.css +1 -1
- package/dist/DataTable/Pagination-b6f8418c.css.map +1 -1
- package/dist/DataTable/Table-7f5cb3e4.css +1 -1
- package/dist/DataTable/Table-7f5cb3e4.css.map +1 -1
- package/dist/DataTable/index.d.ts +8 -4
- package/dist/DataTable/index.d.ts.map +1 -1
- package/dist/DataTable/index.js +0 -1
- package/dist/Dialog/Dialog-f9bb927a.css +1 -1
- package/dist/Dialog/Dialog-f9bb927a.css.map +1 -1
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +4 -1
- package/dist/FilteredActionList/FilteredActionList-6808e67a.css +1 -1
- package/dist/FilteredActionList/FilteredActionList-6808e67a.css.map +1 -1
- package/dist/Flash/Flash-a3596568.css +1 -1
- package/dist/Flash/Flash-a3596568.css.map +1 -1
- package/dist/FormControl/FormControl-fa33984d.css +1 -1
- package/dist/FormControl/FormControl-fa33984d.css.map +1 -1
- package/dist/FormControl/FormControlCaption-f58db5f7.css +1 -1
- package/dist/FormControl/FormControlCaption-f58db5f7.css.map +1 -1
- package/dist/FormControl/FormControlLeadingVisual-e217df71.css +1 -1
- package/dist/FormControl/FormControlLeadingVisual-e217df71.css.map +1 -1
- package/dist/Header/Header-aff64597.css +1 -1
- package/dist/Header/Header-aff64597.css.map +1 -1
- package/dist/Heading/Heading.js +3 -3
- package/dist/InlineMessage/InlineMessage-80d97643.css +1 -1
- package/dist/InlineMessage/InlineMessage-80d97643.css.map +1 -1
- package/dist/KeybindingHint/components/Chord-d4edcc89.css +1 -1
- package/dist/KeybindingHint/components/Chord-d4edcc89.css.map +1 -1
- package/dist/Label/Label-7904957c.css +1 -1
- package/dist/Label/Label-7904957c.css.map +1 -1
- package/dist/Link/Link-ba423096.css +1 -1
- package/dist/Link/Link-ba423096.css.map +1 -1
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +3 -4
- package/dist/NavList/NavList-5dc067e3.css +1 -1
- package/dist/NavList/NavList-5dc067e3.css.map +1 -1
- package/dist/Overlay/Overlay-f81a131d.css +2 -0
- package/dist/Overlay/Overlay-f81a131d.css.map +1 -0
- package/dist/Overlay/Overlay.d.ts +1 -1
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +41 -35
- package/dist/Overlay/Overlay.module.css.js +1 -1
- package/dist/PageHeader/PageHeader-9f4a690a.css +1 -1
- package/dist/PageHeader/PageHeader-9f4a690a.css.map +1 -1
- package/dist/PageLayout/PageLayout-3444a142.css +1 -1
- package/dist/PageLayout/PageLayout-3444a142.css.map +1 -1
- package/dist/PageLayout/PageLayout.js +5 -5
- package/dist/Pagehead/Pagehead-0744ffce.css +1 -1
- package/dist/Pagehead/Pagehead-0744ffce.css.map +1 -1
- package/dist/Pagination/Pagination-16a5b4c6.css +1 -1
- package/dist/Pagination/Pagination-16a5b4c6.css.map +1 -1
- package/dist/Popover/Popover-a93df39c.css +1 -1
- package/dist/Popover/Popover-a93df39c.css.map +1 -1
- package/dist/Radio/Radio-4319e717.css +1 -1
- package/dist/Radio/Radio-4319e717.css.map +1 -1
- package/dist/SegmentedControl/SegmentedControl-6389d0da.css +1 -1
- package/dist/SegmentedControl/SegmentedControl-6389d0da.css.map +1 -1
- package/dist/SelectPanel/SelectPanel-3ac7e8d0.css +2 -0
- package/dist/SelectPanel/SelectPanel-3ac7e8d0.css.map +1 -0
- package/dist/SelectPanel/SelectPanel.js +3 -3
- package/dist/SelectPanel/SelectPanel.module.css.js +1 -1
- package/dist/SideNav-baa2364d.css +1 -1
- package/dist/SideNav-baa2364d.css.map +1 -1
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +6 -3
- package/dist/StateLabel/StateLabel-cd51ae39.css +1 -1
- package/dist/StateLabel/StateLabel-cd51ae39.css.map +1 -1
- package/dist/SubNav/SubNav-88128e5c.css +1 -1
- package/dist/SubNav/SubNav-88128e5c.css.map +1 -1
- package/dist/TabNav/TabNav-83c6145e.css +1 -1
- package/dist/TabNav/TabNav-83c6145e.css.map +1 -1
- package/dist/TextInput/TextInput-dff8f842.css +1 -1
- package/dist/TextInput/TextInput-dff8f842.css.map +1 -1
- package/dist/TextInputWithTokens/TextInputWithTokens-946ead3e.css +1 -1
- package/dist/TextInputWithTokens/TextInputWithTokens-946ead3e.css.map +1 -1
- package/dist/TextInputWithTokens/TextInputWithTokens.js +91 -90
- package/dist/Textarea/TextArea-53e27580.css +1 -1
- package/dist/Textarea/TextArea-53e27580.css.map +1 -1
- package/dist/Timeline/Timeline-4d67684a.css +2 -0
- package/dist/Timeline/Timeline-4d67684a.css.map +1 -0
- package/dist/Timeline/Timeline.d.ts +1 -4
- package/dist/Timeline/Timeline.d.ts.map +1 -1
- package/dist/Timeline/Timeline.js +11 -17
- package/dist/Timeline/Timeline.module.css.js +1 -1
- package/dist/Timeline/index.d.ts +1 -1
- package/dist/Timeline/index.d.ts.map +1 -1
- package/dist/ToggleSwitch/ToggleSwitch-fc4696f5.css +2 -0
- package/dist/ToggleSwitch/ToggleSwitch-fc4696f5.css.map +1 -0
- package/dist/ToggleSwitch/ToggleSwitch.module.css.js +1 -1
- package/dist/Token/IssueLabelToken-ea9392ab.css +2 -0
- package/dist/Token/{IssueLabelToken-10cfada5.css.map → IssueLabelToken-ea9392ab.css.map} +1 -1
- package/dist/Token/IssueLabelToken.module.css.js +1 -1
- package/dist/Token/Token-b3c86dc0.css +1 -1
- package/dist/Token/Token-b3c86dc0.css.map +1 -1
- package/dist/Token/_RemoveTokenButton-a0d2969b.css +1 -1
- package/dist/Token/_RemoveTokenButton-a0d2969b.css.map +1 -1
- package/dist/Token/_TokenTextContainer-24678fbc.css +2 -0
- package/dist/Token/_TokenTextContainer-24678fbc.css.map +1 -0
- package/dist/Token/_TokenTextContainer.module.css.js +1 -1
- package/dist/Tooltip/Tooltip-dca4338d.css +1 -1
- package/dist/Tooltip/Tooltip-dca4338d.css.map +1 -1
- package/dist/TopicTag/TopicTag-b15f6cf1.css +1 -1
- package/dist/TopicTag/TopicTag-b15f6cf1.css.map +1 -1
- package/dist/TreeView/TreeView-70baca82.css +1 -1
- package/dist/TreeView/TreeView-70baca82.css.map +1 -1
- package/dist/deprecated/ActionList/Divider-7c6b656a.css +1 -1
- package/dist/deprecated/ActionList/Divider-7c6b656a.css.map +1 -1
- package/dist/deprecated/ActionList/Header-493b1d76.css +1 -1
- package/dist/deprecated/ActionList/Header-493b1d76.css.map +1 -1
- package/dist/deprecated/ActionList/Item-f48bd3ee.css +2 -2
- package/dist/deprecated/ActionList/Item-f48bd3ee.css.map +1 -1
- package/dist/deprecated/ActionList/List-1ec9d6d9.css +1 -1
- package/dist/deprecated/ActionList/List-1ec9d6d9.css.map +1 -1
- package/dist/deprecated/DialogV1/Dialog-dce13989.css +1 -1
- package/dist/deprecated/DialogV1/Dialog-dce13989.css.map +1 -1
- package/dist/deprecated/DialogV1/Dialog.js +10 -9
- package/dist/deprecated/UnderlineNav/UnderlineNav-0c1e0dff.css +1 -1
- package/dist/deprecated/UnderlineNav/UnderlineNav-0c1e0dff.css.map +1 -1
- package/dist/experimental/IssueLabel/IssueLabel-2007d7e7.css +1 -1
- package/dist/experimental/IssueLabel/IssueLabel-2007d7e7.css.map +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel-40b4ba73.css +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel-40b4ba73.css.map +1 -1
- package/dist/experimental/index.d.ts +0 -2
- package/dist/experimental/index.d.ts.map +1 -1
- package/dist/experimental/index.js +0 -1
- package/dist/hooks/useMergedRefs.d.ts +4 -4
- package/dist/hooks/useMergedRefs.js +4 -4
- package/dist/hooks/useResponsiveValue.d.ts +0 -2
- package/dist/hooks/useResponsiveValue.d.ts.map +1 -1
- package/dist/hooks/useResponsiveValue.js +0 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup-e38b5339.css +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup-e38b5339.css.map +1 -1
- package/dist/internal/components/InputLabel-985ef80b.css +1 -1
- package/dist/internal/components/InputLabel-985ef80b.css.map +1 -1
- package/dist/internal/components/InputValidation-dddeaafd.css +1 -1
- package/dist/internal/components/InputValidation-dddeaafd.css.map +1 -1
- package/dist/internal/components/TextInputInnerAction-477e9b99.css +1 -1
- package/dist/internal/components/TextInputInnerAction-477e9b99.css.map +1 -1
- package/dist/internal/components/TextInputWrapper-889df5d3.css +1 -1
- package/dist/internal/components/TextInputWrapper-889df5d3.css.map +1 -1
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css +1 -1
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css.map +1 -1
- package/generated/components.json +2 -103
- package/generated/hooks.json +0 -1
- package/package.json +3 -2
- package/dist/ActionBar/ActionBar-a41224b2.css +0 -2
- package/dist/ActionBar/ActionBar-a41224b2.css.map +0 -1
- package/dist/ActionList/ActionList-e35e912e.css +0 -2
- package/dist/ActionList/ActionList-e35e912e.css.map +0 -1
- package/dist/ActionMenu/ActionMenu-c4e2a589.css +0 -2
- package/dist/ActionMenu/ActionMenu-c4e2a589.css.map +0 -1
- package/dist/AnchoredOverlay/AnchoredOverlay-0c26c5f8.css +0 -2
- package/dist/AnchoredOverlay/AnchoredOverlay-0c26c5f8.css.map +0 -1
- package/dist/Card/Card-65d85331.css +0 -2
- package/dist/Card/Card-65d85331.css.map +0 -1
- package/dist/Card/Card.d.ts +0 -96
- package/dist/Card/Card.d.ts.map +0 -1
- package/dist/Card/Card.js +0 -485
- package/dist/Card/Card.module.css.js +0 -5
- package/dist/Card/index.d.ts +0 -31
- package/dist/Card/index.d.ts.map +0 -1
- package/dist/Card/index.js +0 -12
- package/dist/Overlay/Overlay-95cfd3c7.css +0 -2
- package/dist/Overlay/Overlay-95cfd3c7.css.map +0 -1
- package/dist/SelectPanel/SelectPanel-00796bf3.css +0 -2
- package/dist/SelectPanel/SelectPanel-00796bf3.css.map +0 -1
- package/dist/Timeline/Timeline-d1c91434.css +0 -2
- package/dist/Timeline/Timeline-d1c91434.css.map +0 -1
- package/dist/ToggleSwitch/ToggleSwitch-b5866af6.css +0 -2
- package/dist/ToggleSwitch/ToggleSwitch-b5866af6.css.map +0 -1
- package/dist/Token/IssueLabelToken-10cfada5.css +0 -2
- package/dist/Token/_TokenTextContainer-55ce2de3.css +0 -2
- package/dist/Token/_TokenTextContainer-55ce2de3.css.map +0 -1
|
@@ -1,29 +1,19 @@
|
|
|
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 {
|
|
13
|
-
import {
|
|
10
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
|
+
import { useMergedRefs } from '../hooks/useMergedRefs.js';
|
|
14
12
|
import { FocusKeys } from '@primer/behaviors';
|
|
15
13
|
import { ActionMenu } from '../ActionMenu/ActionMenu.js';
|
|
16
14
|
|
|
17
|
-
const ACTIONBAR_ITEM_GAP = 8;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Registry of descendants to render in the list or menu. To preserve insertion order across updates, children are
|
|
21
|
-
* set to `null` when unregistered rather than fully dropped from the map.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
15
|
const ActionBarContext = /*#__PURE__*/React.createContext({
|
|
25
16
|
size: 'medium',
|
|
26
|
-
isVisibleChild: () => true,
|
|
27
17
|
groupId: undefined
|
|
28
18
|
});
|
|
29
19
|
|
|
@@ -31,23 +21,8 @@ const ActionBarContext = /*#__PURE__*/React.createContext({
|
|
|
31
21
|
small (28px), medium (32px), large (40px)
|
|
32
22
|
*/
|
|
33
23
|
|
|
34
|
-
const MORE_BTN_WIDTH = 32;
|
|
35
24
|
const ActionBarItemsRegistry = createDescendantRegistry();
|
|
36
|
-
const
|
|
37
|
-
const widthToFit = navWidth - moreMenuWidth;
|
|
38
|
-
let breakpoint = registryEntries.length; // assume all items will fit
|
|
39
|
-
let sumsOfChildWidth = 0;
|
|
40
|
-
for (const [index, [, child]] of registryEntries.entries()) {
|
|
41
|
-
sumsOfChildWidth += index > 0 ? child.width + gap : child.width;
|
|
42
|
-
if (sumsOfChildWidth > widthToFit) {
|
|
43
|
-
breakpoint = index;
|
|
44
|
-
break;
|
|
45
|
-
} else {
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return breakpoint;
|
|
50
|
-
};
|
|
25
|
+
const FOCUSABLE_ITEM_SELECTOR = ':is(button, a, input, [tabindex]):not(:disabled):not([data-overflowing]):not([data-more-button-inactive])';
|
|
51
26
|
const renderMenuItem = (item, index) => {
|
|
52
27
|
if (item.type === 'divider') {
|
|
53
28
|
return /*#__PURE__*/jsx(ActionList.Divider, {}, index);
|
|
@@ -96,373 +71,293 @@ const renderMenuItem = (item, index) => {
|
|
|
96
71
|
}, label);
|
|
97
72
|
};
|
|
98
73
|
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);
|
|
74
|
+
const ActionBar = t0 => {
|
|
75
|
+
const $ = c(40);
|
|
137
76
|
const {
|
|
138
|
-
size:
|
|
77
|
+
size: t1,
|
|
139
78
|
children,
|
|
140
79
|
"aria-label": ariaLabel,
|
|
141
80
|
"aria-labelledby": ariaLabelledBy,
|
|
142
|
-
flush:
|
|
81
|
+
flush: t2,
|
|
143
82
|
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);
|
|
83
|
+
gap: t3
|
|
84
|
+
} = t0;
|
|
85
|
+
const size = t1 === undefined ? "medium" : t1;
|
|
86
|
+
const flush = t2 === undefined ? false : t2;
|
|
87
|
+
const gap = t3 === undefined ? "condensed" : t3;
|
|
151
88
|
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
89
|
let t4;
|
|
171
|
-
if ($[
|
|
172
|
-
t4 =
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
90
|
+
if ($[0] !== childRegistry) {
|
|
91
|
+
t4 = childRegistry && Array.from(childRegistry.entries()).filter(_temp);
|
|
92
|
+
$[0] = childRegistry;
|
|
93
|
+
$[1] = t4;
|
|
175
94
|
} else {
|
|
176
|
-
t4 = $[
|
|
95
|
+
t4 = $[1];
|
|
177
96
|
}
|
|
178
|
-
|
|
179
|
-
const moreMenuRef = useRef(null);
|
|
97
|
+
const overflowItems = t4;
|
|
180
98
|
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
|
-
}
|
|
99
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
100
|
+
t5 = {
|
|
101
|
+
bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
|
|
102
|
+
focusOutBehavior: "wrap",
|
|
103
|
+
focusableElementFilter: _temp2
|
|
193
104
|
};
|
|
194
|
-
$[
|
|
195
|
-
$[4] = computedGap;
|
|
196
|
-
$[5] = menuItemIds.size;
|
|
197
|
-
$[6] = t5;
|
|
105
|
+
$[2] = t5;
|
|
198
106
|
} else {
|
|
199
|
-
t5 = $[
|
|
107
|
+
t5 = $[2];
|
|
200
108
|
}
|
|
201
|
-
useResizeObserver(t5, navRef);
|
|
202
109
|
let t6;
|
|
203
|
-
if ($[
|
|
204
|
-
t6 =
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
110
|
+
if ($[3] !== overflowItems) {
|
|
111
|
+
t6 = [overflowItems];
|
|
112
|
+
$[3] = overflowItems;
|
|
113
|
+
$[4] = t6;
|
|
207
114
|
} else {
|
|
208
|
-
t6 = $[
|
|
115
|
+
t6 = $[4];
|
|
209
116
|
}
|
|
210
|
-
const
|
|
117
|
+
const {
|
|
118
|
+
containerRef
|
|
119
|
+
} = useFocusZone(t5, t6);
|
|
211
120
|
let t7;
|
|
212
|
-
if ($[
|
|
121
|
+
if ($[5] !== size) {
|
|
213
122
|
t7 = {
|
|
214
|
-
|
|
215
|
-
bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
|
|
216
|
-
focusOutBehavior: "wrap"
|
|
123
|
+
size
|
|
217
124
|
};
|
|
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;
|
|
125
|
+
$[5] = size;
|
|
126
|
+
$[6] = t7;
|
|
235
127
|
} else {
|
|
236
|
-
|
|
128
|
+
t7 = $[6];
|
|
237
129
|
}
|
|
238
|
-
const groupedItems = groupedItemsMap;
|
|
239
130
|
let t8;
|
|
240
|
-
if ($[
|
|
241
|
-
t8 =
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
$[
|
|
131
|
+
if ($[7] !== className) {
|
|
132
|
+
t8 = clsx(className, styles.Nav);
|
|
133
|
+
$[7] = className;
|
|
134
|
+
$[8] = t8;
|
|
135
|
+
} else {
|
|
136
|
+
t8 = $[8];
|
|
137
|
+
}
|
|
138
|
+
const t9 = containerRef;
|
|
139
|
+
const t10 = overflowItems ? overflowItems.length > 0 : undefined;
|
|
140
|
+
let t11;
|
|
141
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
142
|
+
t11 = /*#__PURE__*/jsx("div", {});
|
|
143
|
+
$[9] = t11;
|
|
144
|
+
} else {
|
|
145
|
+
t11 = $[9];
|
|
146
|
+
}
|
|
147
|
+
let t12;
|
|
148
|
+
if ($[10] !== children || $[11] !== setChildRegistry) {
|
|
149
|
+
t12 = /*#__PURE__*/jsxs("div", {
|
|
150
|
+
className: styles.OverflowContainer,
|
|
151
|
+
children: [t11, /*#__PURE__*/jsx(ActionBarItemsRegistry.Provider, {
|
|
152
|
+
setRegistry: setChildRegistry,
|
|
153
|
+
children: children
|
|
154
|
+
})]
|
|
155
|
+
});
|
|
156
|
+
$[10] = children;
|
|
157
|
+
$[11] = setChildRegistry;
|
|
158
|
+
$[12] = t12;
|
|
159
|
+
} else {
|
|
160
|
+
t12 = $[12];
|
|
161
|
+
}
|
|
162
|
+
const t13 = `More ${ariaLabel} items ${overflowItems === null || overflowItems === void 0 ? void 0 : overflowItems.length}`;
|
|
163
|
+
const t14 = overflowItems !== null && overflowItems !== void 0 && overflowItems.length ? undefined : true;
|
|
164
|
+
let t15;
|
|
165
|
+
if ($[13] !== size || $[14] !== t13 || $[15] !== t14) {
|
|
166
|
+
t15 = /*#__PURE__*/jsx(ActionMenu.Anchor, {
|
|
167
|
+
children: /*#__PURE__*/jsx(IconButton, {
|
|
168
|
+
variant: "invisible",
|
|
169
|
+
"aria-label": t13,
|
|
170
|
+
icon: KebabHorizontalIcon,
|
|
171
|
+
className: styles.MoreButton,
|
|
172
|
+
"data-more-button-inactive": t14,
|
|
173
|
+
size: size
|
|
174
|
+
})
|
|
175
|
+
});
|
|
246
176
|
$[13] = size;
|
|
247
|
-
$[14] =
|
|
177
|
+
$[14] = t13;
|
|
178
|
+
$[15] = t14;
|
|
179
|
+
$[16] = t15;
|
|
248
180
|
} else {
|
|
249
|
-
|
|
181
|
+
t15 = $[16];
|
|
250
182
|
}
|
|
251
|
-
let
|
|
252
|
-
if ($[
|
|
253
|
-
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
183
|
+
let t16;
|
|
184
|
+
if ($[17] !== overflowItems) {
|
|
185
|
+
t16 = overflowItems === null || overflowItems === void 0 ? void 0 : overflowItems.map(_temp4);
|
|
186
|
+
$[17] = overflowItems;
|
|
187
|
+
$[18] = t16;
|
|
256
188
|
} else {
|
|
257
|
-
|
|
189
|
+
t16 = $[18];
|
|
258
190
|
}
|
|
259
|
-
let
|
|
260
|
-
if ($[
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
191
|
+
let t17;
|
|
192
|
+
if ($[19] !== t16) {
|
|
193
|
+
t17 = /*#__PURE__*/jsx(ActionMenu.Overlay, {
|
|
194
|
+
children: /*#__PURE__*/jsx(ActionList, {
|
|
195
|
+
children: t16
|
|
196
|
+
})
|
|
264
197
|
});
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[19] = t10;
|
|
198
|
+
$[19] = t16;
|
|
199
|
+
$[20] = t17;
|
|
268
200
|
} else {
|
|
269
|
-
|
|
201
|
+
t17 = $[20];
|
|
270
202
|
}
|
|
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
|
-
})]
|
|
203
|
+
let t18;
|
|
204
|
+
if ($[21] !== t15 || $[22] !== t17) {
|
|
205
|
+
t18 = /*#__PURE__*/jsxs(ActionMenu, {
|
|
206
|
+
children: [t15, t17]
|
|
341
207
|
});
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
$[23] = menuItemIds;
|
|
346
|
-
$[24] = t11;
|
|
208
|
+
$[21] = t15;
|
|
209
|
+
$[22] = t17;
|
|
210
|
+
$[23] = t18;
|
|
347
211
|
} else {
|
|
348
|
-
|
|
212
|
+
t18 = $[23];
|
|
349
213
|
}
|
|
350
|
-
let
|
|
351
|
-
if ($[
|
|
352
|
-
|
|
353
|
-
ref:
|
|
214
|
+
let t19;
|
|
215
|
+
if ($[24] !== ariaLabel || $[25] !== ariaLabelledBy || $[26] !== gap || $[27] !== size || $[28] !== t10 || $[29] !== t12 || $[30] !== t18 || $[31] !== t9) {
|
|
216
|
+
t19 = /*#__PURE__*/jsxs("div", {
|
|
217
|
+
ref: t9,
|
|
354
218
|
role: "toolbar",
|
|
355
219
|
className: styles.List,
|
|
356
220
|
"aria-label": ariaLabel,
|
|
357
221
|
"aria-labelledby": ariaLabelledBy,
|
|
358
222
|
"data-gap": gap,
|
|
359
|
-
|
|
223
|
+
"data-size": size,
|
|
224
|
+
"data-has-overflow": t10,
|
|
225
|
+
children: [t12, t18]
|
|
360
226
|
});
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
227
|
+
$[24] = ariaLabel;
|
|
228
|
+
$[25] = ariaLabelledBy;
|
|
229
|
+
$[26] = gap;
|
|
230
|
+
$[27] = size;
|
|
364
231
|
$[28] = t10;
|
|
365
|
-
$[29] =
|
|
366
|
-
$[30] =
|
|
232
|
+
$[29] = t12;
|
|
233
|
+
$[30] = t18;
|
|
234
|
+
$[31] = t9;
|
|
235
|
+
$[32] = t19;
|
|
367
236
|
} else {
|
|
368
|
-
|
|
237
|
+
t19 = $[32];
|
|
369
238
|
}
|
|
370
|
-
let
|
|
371
|
-
if ($[
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
className: t9,
|
|
239
|
+
let t20;
|
|
240
|
+
if ($[33] !== flush || $[34] !== t19 || $[35] !== t8) {
|
|
241
|
+
t20 = /*#__PURE__*/jsx("div", {
|
|
242
|
+
className: t8,
|
|
375
243
|
"data-flush": flush,
|
|
376
|
-
children:
|
|
244
|
+
children: t19
|
|
377
245
|
});
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
246
|
+
$[33] = flush;
|
|
247
|
+
$[34] = t19;
|
|
248
|
+
$[35] = t8;
|
|
249
|
+
$[36] = t20;
|
|
382
250
|
} else {
|
|
383
|
-
|
|
251
|
+
t20 = $[36];
|
|
384
252
|
}
|
|
385
|
-
let
|
|
386
|
-
if ($[
|
|
387
|
-
|
|
388
|
-
value:
|
|
389
|
-
children:
|
|
253
|
+
let t21;
|
|
254
|
+
if ($[37] !== t20 || $[38] !== t7) {
|
|
255
|
+
t21 = /*#__PURE__*/jsx(ActionBarContext.Provider, {
|
|
256
|
+
value: t7,
|
|
257
|
+
children: t20
|
|
390
258
|
});
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
393
|
-
$[
|
|
259
|
+
$[37] = t20;
|
|
260
|
+
$[38] = t7;
|
|
261
|
+
$[39] = t21;
|
|
394
262
|
} else {
|
|
395
|
-
|
|
263
|
+
t21 = $[39];
|
|
396
264
|
}
|
|
397
|
-
return
|
|
265
|
+
return t21;
|
|
398
266
|
};
|
|
399
|
-
function
|
|
400
|
-
|
|
401
|
-
const
|
|
267
|
+
function useActionBarItem(ref, registryProps) {
|
|
268
|
+
var _useContext;
|
|
269
|
+
const $ = c(8);
|
|
270
|
+
const isGroupOverflowing = (_useContext = useContext(ActionBarGroupContext)) === null || _useContext === void 0 ? void 0 : _useContext.isOverflowing;
|
|
271
|
+
const isInGroup = isGroupOverflowing !== undefined;
|
|
402
272
|
let t0;
|
|
273
|
+
if ($[0] !== isInGroup || $[1] !== ref) {
|
|
274
|
+
t0 = onChange => {
|
|
275
|
+
if (isInGroup) {
|
|
276
|
+
return _temp5;
|
|
277
|
+
}
|
|
278
|
+
const observer = new IntersectionObserver(() => onChange(), {
|
|
279
|
+
threshold: 1
|
|
280
|
+
});
|
|
281
|
+
if (ref.current) {
|
|
282
|
+
observer.observe(ref.current);
|
|
283
|
+
}
|
|
284
|
+
return () => observer.disconnect();
|
|
285
|
+
};
|
|
286
|
+
$[0] = isInGroup;
|
|
287
|
+
$[1] = ref;
|
|
288
|
+
$[2] = t0;
|
|
289
|
+
} else {
|
|
290
|
+
t0 = $[2];
|
|
291
|
+
}
|
|
292
|
+
const subscribeIntersectionObserver = t0;
|
|
403
293
|
let t1;
|
|
404
|
-
if ($[
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
294
|
+
if ($[3] !== ref) {
|
|
295
|
+
t1 = () => ref.current ? ref.current.offsetTop > 0 : false;
|
|
296
|
+
$[3] = ref;
|
|
297
|
+
$[4] = t1;
|
|
298
|
+
} else {
|
|
299
|
+
t1 = $[4];
|
|
300
|
+
}
|
|
301
|
+
const isItemOverflowing = useSyncExternalStore(subscribeIntersectionObserver, t1, _temp6);
|
|
302
|
+
const isOverflowing = isGroupOverflowing || isItemOverflowing;
|
|
303
|
+
ActionBarItemsRegistry.useRegisterDescendant(isOverflowing ? registryProps : null);
|
|
304
|
+
const t2 = isOverflowing ? "" : undefined;
|
|
305
|
+
let t3;
|
|
306
|
+
if ($[5] !== isOverflowing || $[6] !== t2) {
|
|
307
|
+
t3 = {
|
|
308
|
+
isOverflowing,
|
|
309
|
+
dataOverflowingAttr: t2
|
|
408
310
|
};
|
|
409
|
-
|
|
410
|
-
$[
|
|
411
|
-
$[
|
|
412
|
-
$[2] = t1;
|
|
311
|
+
$[5] = isOverflowing;
|
|
312
|
+
$[6] = t2;
|
|
313
|
+
$[7] = t3;
|
|
413
314
|
} else {
|
|
414
|
-
|
|
415
|
-
t1 = $[2];
|
|
315
|
+
t3 = $[7];
|
|
416
316
|
}
|
|
417
|
-
|
|
418
|
-
|
|
317
|
+
return t3;
|
|
318
|
+
}
|
|
319
|
+
function _temp6() {
|
|
320
|
+
return false;
|
|
419
321
|
}
|
|
322
|
+
function _temp5() {}
|
|
420
323
|
const ActionBarIconButton = /*#__PURE__*/forwardRef(({
|
|
421
324
|
disabled,
|
|
422
325
|
onClick,
|
|
423
326
|
...props
|
|
424
327
|
}, forwardedRef) => {
|
|
425
328
|
const ref = useRef(null);
|
|
426
|
-
|
|
329
|
+
const mergedRef = useMergedRefs(ref, forwardedRef);
|
|
427
330
|
const {
|
|
428
|
-
size
|
|
429
|
-
isVisibleChild
|
|
331
|
+
size
|
|
430
332
|
} = React.useContext(ActionBarContext);
|
|
431
|
-
const {
|
|
432
|
-
groupId
|
|
433
|
-
} = React.useContext(ActionBarGroupContext);
|
|
434
|
-
const width = useWidth(ref);
|
|
435
333
|
const {
|
|
436
334
|
['aria-label']: ariaLabel,
|
|
437
335
|
icon
|
|
438
336
|
} = props;
|
|
439
|
-
const
|
|
337
|
+
const {
|
|
338
|
+
dataOverflowingAttr
|
|
339
|
+
} = useActionBarItem(ref, useMemo(() => ({
|
|
440
340
|
type: 'action',
|
|
441
341
|
label: ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : '',
|
|
442
342
|
icon,
|
|
443
343
|
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);
|
|
344
|
+
onClick: onClick
|
|
345
|
+
}), [ariaLabel, icon, disabled, onClick]));
|
|
449
346
|
const clickHandler = useCallback(event => {
|
|
450
347
|
if (disabled) return;
|
|
451
348
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
452
349
|
}, [disabled, onClick]);
|
|
453
|
-
if (!isVisibleChild(id) || groupId && !isVisibleChild(groupId)) return null;
|
|
454
350
|
return /*#__PURE__*/jsx(IconButton, {
|
|
455
351
|
"aria-disabled": disabled,
|
|
456
|
-
ref:
|
|
352
|
+
ref: mergedRef,
|
|
457
353
|
size: size,
|
|
458
354
|
onClick: clickHandler,
|
|
459
355
|
...props,
|
|
460
|
-
variant: "invisible"
|
|
356
|
+
variant: "invisible",
|
|
357
|
+
"data-overflowing": dataOverflowingAttr
|
|
461
358
|
});
|
|
462
359
|
});
|
|
463
|
-
const ActionBarGroupContext = /*#__PURE__*/React.createContext(
|
|
464
|
-
groupId: null
|
|
465
|
-
});
|
|
360
|
+
const ActionBarGroupContext = /*#__PURE__*/React.createContext(null);
|
|
466
361
|
const ActionBarGroup = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
467
362
|
const $ = c(10);
|
|
468
363
|
const {
|
|
@@ -470,38 +365,39 @@ const ActionBarGroup = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
470
365
|
} = t0;
|
|
471
366
|
const backupRef = useRef(null);
|
|
472
367
|
const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
|
|
473
|
-
const width = useWidth(ref);
|
|
474
368
|
let t1;
|
|
475
|
-
if ($[0]
|
|
369
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
476
370
|
t1 = {
|
|
477
|
-
type: "group"
|
|
478
|
-
width
|
|
371
|
+
type: "group"
|
|
479
372
|
};
|
|
480
|
-
$[0] =
|
|
481
|
-
$[1] = t1;
|
|
373
|
+
$[0] = t1;
|
|
482
374
|
} else {
|
|
483
|
-
t1 = $[
|
|
375
|
+
t1 = $[0];
|
|
484
376
|
}
|
|
485
|
-
const
|
|
486
|
-
|
|
377
|
+
const {
|
|
378
|
+
dataOverflowingAttr,
|
|
379
|
+
isOverflowing
|
|
380
|
+
} = useActionBarItem(ref, t1);
|
|
487
381
|
let t2;
|
|
488
|
-
if ($[
|
|
382
|
+
if ($[1] !== isOverflowing) {
|
|
489
383
|
t2 = {
|
|
490
|
-
|
|
384
|
+
isOverflowing
|
|
491
385
|
};
|
|
492
|
-
$[
|
|
493
|
-
$[
|
|
386
|
+
$[1] = isOverflowing;
|
|
387
|
+
$[2] = t2;
|
|
494
388
|
} else {
|
|
495
|
-
t2 = $[
|
|
389
|
+
t2 = $[2];
|
|
496
390
|
}
|
|
497
391
|
let t3;
|
|
498
|
-
if ($[
|
|
392
|
+
if ($[3] !== children || $[4] !== dataOverflowingAttr || $[5] !== ref) {
|
|
499
393
|
t3 = /*#__PURE__*/jsx("div", {
|
|
500
394
|
className: styles.Group,
|
|
501
395
|
ref: ref,
|
|
396
|
+
"data-overflowing": dataOverflowingAttr,
|
|
502
397
|
children: children
|
|
503
398
|
});
|
|
504
|
-
$[
|
|
399
|
+
$[3] = children;
|
|
400
|
+
$[4] = dataOverflowingAttr;
|
|
505
401
|
$[5] = ref;
|
|
506
402
|
$[6] = t3;
|
|
507
403
|
} else {
|
|
@@ -555,17 +451,12 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
555
451
|
}
|
|
556
452
|
const backupRef = useRef(null);
|
|
557
453
|
const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
|
|
558
|
-
const {
|
|
559
|
-
isVisibleChild
|
|
560
|
-
} = React.useContext(ActionBarContext);
|
|
561
454
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
562
|
-
const width = useWidth(ref);
|
|
563
455
|
const t1 = overflowIcon ? overflowIcon : icon;
|
|
564
456
|
let t2;
|
|
565
|
-
if ($[7] !== ariaLabel || $[8] !== items || $[9] !== returnFocusRef || $[10] !== t1
|
|
457
|
+
if ($[7] !== ariaLabel || $[8] !== items || $[9] !== returnFocusRef || $[10] !== t1) {
|
|
566
458
|
t2 = {
|
|
567
459
|
type: "menu",
|
|
568
|
-
width,
|
|
569
460
|
label: ariaLabel,
|
|
570
461
|
icon: t1,
|
|
571
462
|
returnFocusRef,
|
|
@@ -575,27 +466,26 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
575
466
|
$[8] = items;
|
|
576
467
|
$[9] = returnFocusRef;
|
|
577
468
|
$[10] = t1;
|
|
578
|
-
$[11] =
|
|
579
|
-
$[12] = t2;
|
|
469
|
+
$[11] = t2;
|
|
580
470
|
} else {
|
|
581
|
-
t2 = $[
|
|
582
|
-
}
|
|
583
|
-
const registryProps = t2;
|
|
584
|
-
const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
|
|
585
|
-
if (!isVisibleChild(id)) {
|
|
586
|
-
return null;
|
|
471
|
+
t2 = $[11];
|
|
587
472
|
}
|
|
473
|
+
const {
|
|
474
|
+
dataOverflowingAttr
|
|
475
|
+
} = useActionBarItem(ref, t2);
|
|
588
476
|
let t3;
|
|
589
|
-
if ($[
|
|
477
|
+
if ($[12] !== ariaLabel || $[13] !== dataOverflowingAttr || $[14] !== icon || $[15] !== props) {
|
|
590
478
|
t3 = /*#__PURE__*/jsx(ActionMenu.Anchor, {
|
|
591
479
|
children: /*#__PURE__*/jsx(IconButton, {
|
|
592
480
|
variant: "invisible",
|
|
593
481
|
"aria-label": ariaLabel,
|
|
594
482
|
icon: icon,
|
|
595
|
-
...props
|
|
483
|
+
...props,
|
|
484
|
+
"data-overflowing": dataOverflowingAttr
|
|
596
485
|
})
|
|
597
486
|
});
|
|
598
|
-
$[
|
|
487
|
+
$[12] = ariaLabel;
|
|
488
|
+
$[13] = dataOverflowingAttr;
|
|
599
489
|
$[14] = icon;
|
|
600
490
|
$[15] = props;
|
|
601
491
|
$[16] = t3;
|
|
@@ -614,7 +504,7 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
614
504
|
}
|
|
615
505
|
let t5;
|
|
616
506
|
if ($[19] !== items) {
|
|
617
|
-
t5 = items.map(
|
|
507
|
+
t5 = items.map(_temp7);
|
|
618
508
|
$[19] = items;
|
|
619
509
|
$[20] = t5;
|
|
620
510
|
} else {
|
|
@@ -663,68 +553,91 @@ const ActionBarMenu = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
663
553
|
const VerticalDivider = () => {
|
|
664
554
|
const $ = c(3);
|
|
665
555
|
const ref = useRef(null);
|
|
666
|
-
const {
|
|
667
|
-
isVisibleChild
|
|
668
|
-
} = React.useContext(ActionBarContext);
|
|
669
|
-
const width = useWidth(ref);
|
|
670
556
|
let t0;
|
|
671
|
-
if ($[0]
|
|
557
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
672
558
|
t0 = {
|
|
673
|
-
type: "divider"
|
|
674
|
-
width
|
|
559
|
+
type: "divider"
|
|
675
560
|
};
|
|
676
|
-
$[0] =
|
|
677
|
-
$[1] = t0;
|
|
561
|
+
$[0] = t0;
|
|
678
562
|
} else {
|
|
679
|
-
t0 = $[
|
|
680
|
-
}
|
|
681
|
-
const registryProps = t0;
|
|
682
|
-
const id = ActionBarItemsRegistry.useRegisterDescendant(registryProps);
|
|
683
|
-
if (!isVisibleChild(id)) {
|
|
684
|
-
return null;
|
|
563
|
+
t0 = $[0];
|
|
685
564
|
}
|
|
565
|
+
const {
|
|
566
|
+
dataOverflowingAttr
|
|
567
|
+
} = useActionBarItem(ref, t0);
|
|
686
568
|
let t1;
|
|
687
|
-
if ($[
|
|
569
|
+
if ($[1] !== dataOverflowingAttr) {
|
|
688
570
|
t1 = /*#__PURE__*/jsx("div", {
|
|
689
571
|
ref: ref,
|
|
690
572
|
"data-component": "ActionBar.VerticalDivider",
|
|
691
573
|
"aria-hidden": "true",
|
|
692
|
-
className: styles.Divider
|
|
574
|
+
className: styles.Divider,
|
|
575
|
+
"data-overflowing": dataOverflowingAttr
|
|
693
576
|
});
|
|
577
|
+
$[1] = dataOverflowingAttr;
|
|
694
578
|
$[2] = t1;
|
|
695
579
|
} else {
|
|
696
580
|
t1 = $[2];
|
|
697
581
|
}
|
|
698
582
|
return t1;
|
|
699
583
|
};
|
|
700
|
-
function _temp() {
|
|
701
|
-
return
|
|
584
|
+
function _temp(entry) {
|
|
585
|
+
return entry[1] !== null;
|
|
702
586
|
}
|
|
703
|
-
function _temp2(
|
|
587
|
+
function _temp2(element) {
|
|
588
|
+
return element.matches(FOCUSABLE_ITEM_SELECTOR);
|
|
589
|
+
}
|
|
590
|
+
function _temp3(item, index) {
|
|
704
591
|
return renderMenuItem(item, index);
|
|
705
592
|
}
|
|
706
|
-
function
|
|
707
|
-
const [
|
|
708
|
-
if (
|
|
593
|
+
function _temp4(t0) {
|
|
594
|
+
const [id, menuItem] = t0;
|
|
595
|
+
if (menuItem.type === "divider") {
|
|
596
|
+
return /*#__PURE__*/jsx(ActionList.Divider, {}, id);
|
|
597
|
+
}
|
|
598
|
+
if (menuItem.type === "action") {
|
|
709
599
|
const {
|
|
710
|
-
onClick
|
|
711
|
-
icon:
|
|
712
|
-
label
|
|
713
|
-
disabled
|
|
714
|
-
} =
|
|
600
|
+
onClick,
|
|
601
|
+
icon: Icon,
|
|
602
|
+
label,
|
|
603
|
+
disabled
|
|
604
|
+
} = menuItem;
|
|
715
605
|
return /*#__PURE__*/jsxs(ActionList.Item, {
|
|
716
|
-
onSelect:
|
|
717
|
-
typeof
|
|
606
|
+
onSelect: event => {
|
|
607
|
+
typeof onClick === "function" && onClick(event);
|
|
718
608
|
},
|
|
719
|
-
disabled:
|
|
609
|
+
disabled: disabled,
|
|
720
610
|
children: [/*#__PURE__*/jsx(ActionList.LeadingVisual, {
|
|
721
|
-
children: /*#__PURE__*/jsx(
|
|
722
|
-
}),
|
|
723
|
-
},
|
|
611
|
+
children: /*#__PURE__*/jsx(Icon, {})
|
|
612
|
+
}), label]
|
|
613
|
+
}, label);
|
|
614
|
+
}
|
|
615
|
+
if (menuItem.type === "menu") {
|
|
616
|
+
const menuItems = menuItem.items;
|
|
617
|
+
const {
|
|
618
|
+
icon: Icon_0,
|
|
619
|
+
label: label_0,
|
|
620
|
+
returnFocusRef
|
|
621
|
+
} = menuItem;
|
|
622
|
+
return /*#__PURE__*/jsxs(ActionMenu, {
|
|
623
|
+
children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
|
|
624
|
+
children: /*#__PURE__*/jsxs(ActionList.Item, {
|
|
625
|
+
children: [Icon_0 !== "none" ? /*#__PURE__*/jsx(ActionList.LeadingVisual, {
|
|
626
|
+
children: /*#__PURE__*/jsx(Icon_0, {})
|
|
627
|
+
}) : null, label_0]
|
|
628
|
+
})
|
|
629
|
+
}), /*#__PURE__*/jsx(ActionMenu.Overlay, {
|
|
630
|
+
...(returnFocusRef && {
|
|
631
|
+
returnFocusRef
|
|
632
|
+
}),
|
|
633
|
+
children: /*#__PURE__*/jsx(ActionList, {
|
|
634
|
+
children: menuItems.map(_temp3)
|
|
635
|
+
})
|
|
636
|
+
})]
|
|
637
|
+
}, id);
|
|
724
638
|
}
|
|
725
|
-
return null;
|
|
726
639
|
}
|
|
727
|
-
function
|
|
640
|
+
function _temp7(item, index) {
|
|
728
641
|
return renderMenuItem(item, index);
|
|
729
642
|
}
|
|
730
643
|
|