@primer/react 38.0.0-rc.6 → 38.0.0-rc.7
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 +47 -0
- package/dist/ActionBar/ActionBar.d.ts +15 -1
- package/dist/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar/ActionBar.js +381 -217
- package/dist/ActionBar/index.d.ts +1 -1
- package/dist/ActionList/Description.d.ts +4 -3
- package/dist/ActionList/Description.d.ts.map +1 -1
- package/dist/ActionList/Description.js +5 -5
- package/dist/ActionList/Divider.d.ts +5 -4
- package/dist/ActionList/Divider.d.ts.map +1 -1
- package/dist/ActionList/Divider.js +6 -7
- package/dist/ActionList/Group.d.ts +4 -5
- package/dist/ActionList/Group.d.ts.map +1 -1
- package/dist/ActionList/Group.js +9 -16
- package/dist/ActionList/Heading.d.ts +3 -2
- package/dist/ActionList/Heading.d.ts.map +1 -1
- package/dist/ActionList/Heading.js +1 -0
- package/dist/ActionList/Item.d.ts +5 -2
- package/dist/ActionList/Item.d.ts.map +1 -1
- package/dist/ActionList/Item.js +4 -8
- package/dist/ActionList/LinkItem.d.ts +1 -1
- package/dist/ActionList/LinkItem.d.ts.map +1 -1
- package/dist/ActionList/LinkItem.js +1 -2
- package/dist/ActionList/List.d.ts +1 -1
- package/dist/ActionList/List.d.ts.map +1 -1
- package/dist/ActionList/List.js +1 -3
- package/dist/ActionList/TrailingAction.d.ts +1 -0
- package/dist/ActionList/TrailingAction.d.ts.map +1 -1
- package/dist/ActionList/TrailingAction.js +3 -0
- package/dist/ActionList/Visuals.d.ts +4 -4
- package/dist/ActionList/Visuals.d.ts.map +1 -1
- package/dist/ActionList/Visuals.js +3 -3
- package/dist/ActionList/index.d.ts +12 -9
- package/dist/ActionList/index.d.ts.map +1 -1
- package/dist/ActionList/shared.d.ts +2 -3
- package/dist/ActionList/shared.d.ts.map +1 -1
- package/dist/ActionMenu/ActionMenu.d.ts +6 -5
- package/dist/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/dist/ActionMenu/ActionMenu.js +11 -6
- package/dist/Autocomplete/Autocomplete.d.ts +6 -4
- package/dist/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/Autocomplete/Autocomplete.js +1 -0
- package/dist/Autocomplete/AutocompleteInput.js +1 -0
- package/dist/Autocomplete/AutocompleteMenu.d.ts +1 -0
- package/dist/Autocomplete/AutocompleteMenu.d.ts.map +1 -1
- package/dist/Autocomplete/AutocompleteMenu.js +1 -0
- package/dist/Autocomplete/AutocompleteOverlay.d.ts +1 -0
- package/dist/Autocomplete/AutocompleteOverlay.d.ts.map +1 -1
- package/dist/Autocomplete/AutocompleteOverlay.js +1 -0
- package/dist/AvatarStack/AvatarStack.d.ts.map +1 -1
- package/dist/AvatarStack/AvatarStack.js +1 -3
- package/dist/BranchName/BranchName.d.ts +9 -10
- package/dist/BranchName/BranchName.d.ts.map +1 -1
- package/dist/BranchName/BranchName.js +1 -8
- package/dist/Button/Button.d.ts +1 -5
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +2 -85
- package/dist/Button/ButtonBase.d.ts.map +1 -1
- package/dist/Button/ButtonBase.js +8 -93
- package/dist/Button/IconButton.d.ts.map +1 -1
- package/dist/Button/IconButton.js +0 -16
- package/dist/Button/LinkButton.d.ts +1 -1
- package/dist/Button/LinkButton.d.ts.map +1 -1
- package/dist/Button/types.d.ts +1 -3
- package/dist/Button/types.d.ts.map +1 -1
- package/dist/Checkbox/Checkbox.d.ts +3 -1
- package/dist/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox/Checkbox.js +1 -0
- package/dist/CheckboxGroup/CheckboxGroup.d.ts +8 -7
- package/dist/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
- package/dist/CheckboxGroup/CheckboxGroup.js +4 -2
- package/dist/ConfirmationDialog/ConfirmationDialog-87ccf595.css +2 -0
- package/dist/ConfirmationDialog/ConfirmationDialog-87ccf595.css.map +1 -0
- package/dist/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -1
- package/dist/ConfirmationDialog/ConfirmationDialog.js +4 -1
- package/dist/ConfirmationDialog/ConfirmationDialog.module.css.js +1 -1
- package/dist/DataTable/Table.d.ts +3 -3
- package/dist/DataTable/Table.d.ts.map +1 -1
- package/dist/DataTable/Table.js +24 -19
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +2 -1
- package/dist/FilteredActionList/FilteredActionList-f6c2dc7a.css +2 -0
- package/dist/FilteredActionList/FilteredActionList-f6c2dc7a.css.map +1 -0
- package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionList.js +2 -7
- package/dist/FilteredActionList/FilteredActionList.module.css.js +2 -2
- package/dist/FilteredActionList/types.d.ts +5 -2
- package/dist/FilteredActionList/types.d.ts.map +1 -1
- package/dist/FormControl/FormControl.d.ts +8 -36
- package/dist/FormControl/FormControl.d.ts.map +1 -1
- package/dist/FormControl/FormControl.js +64 -66
- package/dist/FormControl/FormControlCaption.d.ts +6 -4
- package/dist/FormControl/FormControlCaption.d.ts.map +1 -1
- package/dist/FormControl/FormControlCaption.js +9 -13
- package/dist/FormControl/FormControlLabel.d.ts +3 -3
- package/dist/FormControl/FormControlLabel.d.ts.map +1 -1
- package/dist/FormControl/FormControlLabel.js +25 -31
- package/dist/FormControl/FormControlLeadingVisual-e217df71.css +2 -0
- package/dist/FormControl/FormControlLeadingVisual-e217df71.css.map +1 -0
- package/dist/FormControl/FormControlLeadingVisual.d.ts +2 -2
- package/dist/FormControl/FormControlLeadingVisual.d.ts.map +1 -1
- package/dist/FormControl/FormControlLeadingVisual.js +10 -17
- package/dist/FormControl/FormControlLeadingVisual.module.css.js +5 -0
- package/dist/FormControl/_FormControlContext.js +1 -1
- package/dist/FormControl/_FormControlValidation.d.ts +3 -3
- package/dist/FormControl/_FormControlValidation.d.ts.map +1 -1
- package/dist/FormControl/_FormControlValidation.js +7 -9
- package/dist/FormControl/index.d.ts +4 -0
- package/dist/FormControl/index.d.ts.map +1 -1
- package/dist/LabelGroup/LabelGroup-7d19205a.css +2 -0
- package/dist/LabelGroup/LabelGroup-7d19205a.css.map +1 -0
- package/dist/LabelGroup/LabelGroup.d.ts.map +1 -1
- package/dist/LabelGroup/LabelGroup.js +14 -27
- package/dist/LabelGroup/LabelGroup.module.css.js +2 -2
- package/dist/NavList/NavList.d.ts +3 -3
- package/dist/NavList/NavList.d.ts.map +1 -1
- package/dist/NavList/NavList.js +2 -1
- package/dist/Octicon/Octicon.d.ts +7 -6
- package/dist/Octicon/Octicon.d.ts.map +1 -1
- package/dist/Octicon/Octicon.js +4 -23
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +63 -85
- package/dist/PageHeader/PageHeader.d.ts +3 -3
- package/dist/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/PageHeader/PageHeader.js +5 -2
- package/dist/PageLayout/{PageLayout-8a294e74.css → PageLayout-a276fa3b.css} +2 -2
- package/dist/PageLayout/PageLayout-a276fa3b.css.map +1 -0
- package/dist/PageLayout/PageLayout.d.ts +14 -58
- package/dist/PageLayout/PageLayout.d.ts.map +1 -1
- package/dist/PageLayout/PageLayout.js +216 -245
- package/dist/PageLayout/PageLayout.module.css.js +2 -2
- package/dist/Radio/Radio.d.ts +3 -1
- package/dist/Radio/Radio.d.ts.map +1 -1
- package/dist/Radio/Radio.js +1 -0
- package/dist/RadioGroup/RadioGroup.d.ts +6 -5
- package/dist/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup/RadioGroup.js +1 -0
- package/dist/SegmentedControl/SegmentedControl.d.ts +3 -2
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +11 -14
- package/dist/SegmentedControl/SegmentedControlButton.d.ts +2 -1
- package/dist/SegmentedControl/SegmentedControlButton.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlButton.js +1 -0
- package/dist/SegmentedControl/SegmentedControlIconButton.d.ts +2 -1
- package/dist/SegmentedControl/SegmentedControlIconButton.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlIconButton.js +1 -0
- package/dist/Select/Select.d.ts +1 -0
- package/dist/Select/Select.d.ts.map +1 -1
- package/dist/Select/Select.js +1 -0
- package/dist/SelectPanel/SelectPanel.d.ts +2 -1
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +1 -0
- package/dist/Skeleton/SkeletonBox.d.ts.map +1 -1
- package/dist/Skeleton/SkeletonBox.js +26 -20
- package/dist/SkeletonAvatar/SkeletonAvatar.d.ts.map +1 -1
- package/dist/SkeletonAvatar/SkeletonAvatar.js +53 -62
- package/dist/StateLabel/{StateLabel-aaa1d148.css → StateLabel-b586b0bc.css} +2 -2
- package/dist/StateLabel/StateLabel-b586b0bc.css.map +1 -0
- package/dist/StateLabel/StateLabel.d.ts.map +1 -1
- package/dist/StateLabel/StateLabel.js +28 -39
- package/dist/StateLabel/StateLabel.module.css.js +1 -1
- package/dist/SubNav/SubNav.d.ts +4 -1
- package/dist/SubNav/SubNav.d.ts.map +1 -1
- package/dist/SubNav/SubNav.js +3 -1
- package/dist/Text/Text.d.ts +16 -8
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +34 -31
- package/dist/TextInput/TextInput.d.ts +3 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +2 -3
- package/dist/TextInput/index.d.ts +1 -0
- package/dist/TextInput/index.d.ts.map +1 -1
- package/dist/TextInputWithTokens/TextInputWithTokens.d.ts +3 -1
- package/dist/TextInputWithTokens/TextInputWithTokens.d.ts.map +1 -1
- package/dist/TextInputWithTokens/TextInputWithTokens.js +205 -211
- package/dist/Textarea/Textarea.d.ts +5 -4
- package/dist/Textarea/Textarea.d.ts.map +1 -1
- package/dist/Textarea/Textarea.js +40 -45
- package/dist/Tooltip/Tooltip-fffa9948.css +2 -0
- package/dist/Tooltip/Tooltip-fffa9948.css.map +1 -0
- package/dist/Tooltip/Tooltip.d.ts +6 -8
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +44 -118
- package/dist/Tooltip/Tooltip.module.css.js +5 -0
- package/dist/TooltipV2/Tooltip.d.ts +3 -16
- package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
- package/dist/TooltipV2/Tooltip.js +1 -0
- package/dist/TreeView/TreeView.d.ts +4 -1
- package/dist/TreeView/TreeView.d.ts.map +1 -1
- package/dist/TreeView/TreeView.js +42 -9
- package/dist/Truncate/Truncate.d.ts +2 -2
- package/dist/Truncate/Truncate.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css +2 -0
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNav.d.ts +0 -1
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +45 -17
- package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -2
- package/dist/UnderlineNav/UnderlineNavContext.d.ts +0 -2
- package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavContext.js +0 -1
- package/dist/UnderlineNav/styles.d.ts +1 -23
- package/dist/UnderlineNav/styles.d.ts.map +1 -1
- package/dist/UnderlineNav/styles.js +4 -59
- package/dist/constants.js +3 -3
- package/dist/deprecated/ActionList/Divider-7c6b656a.css +2 -0
- package/dist/deprecated/ActionList/Divider-7c6b656a.css.map +1 -0
- package/dist/deprecated/ActionList/Divider.d.ts +1 -2
- package/dist/deprecated/ActionList/Divider.d.ts.map +1 -1
- package/dist/deprecated/ActionList/Divider.js +6 -12
- package/dist/deprecated/ActionList/Divider.module.css.js +5 -0
- package/dist/deprecated/ActionList/Group.d.ts +1 -2
- package/dist/deprecated/ActionList/Group.d.ts.map +1 -1
- package/dist/deprecated/ActionList/Group.js +1 -8
- package/dist/deprecated/ActionList/Header-493b1d76.css +2 -0
- package/dist/deprecated/ActionList/Header-493b1d76.css.map +1 -0
- package/dist/deprecated/ActionList/Header.d.ts +2 -6
- package/dist/deprecated/ActionList/Header.d.ts.map +1 -1
- package/dist/deprecated/ActionList/Header.js +46 -37
- package/dist/deprecated/ActionList/Header.module.css.js +5 -0
- package/dist/deprecated/ActionList/Item-cf87f98a.css +3 -0
- package/dist/deprecated/ActionList/Item-cf87f98a.css.map +1 -0
- package/dist/deprecated/ActionList/Item.d.ts +1 -5
- package/dist/deprecated/ActionList/Item.d.ts.map +1 -1
- package/dist/deprecated/ActionList/Item.js +182 -271
- package/dist/deprecated/ActionList/Item.module.css.js +5 -0
- package/dist/deprecated/ActionList/List-1ec9d6d9.css +2 -0
- package/dist/deprecated/ActionList/List-1ec9d6d9.css.map +1 -0
- package/dist/deprecated/ActionList/List.d.ts +1 -0
- package/dist/deprecated/ActionList/List.d.ts.map +1 -1
- package/dist/deprecated/ActionList/List.js +92 -82
- package/dist/deprecated/ActionList/List.module.css.js +5 -0
- package/dist/deprecated/UnderlineNav/UnderlineNav-0c1e0dff.css +2 -0
- package/dist/deprecated/UnderlineNav/UnderlineNav-0c1e0dff.css.map +1 -0
- package/dist/deprecated/UnderlineNav/UnderlineNav.d.ts +6 -8
- package/dist/deprecated/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/deprecated/UnderlineNav/UnderlineNav.js +90 -49
- package/dist/deprecated/UnderlineNav/UnderlineNav.module.css.js +5 -0
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts +11 -7
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts.map +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.js +6 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.d.ts +6 -6
- package/dist/experimental/UnderlinePanels/UnderlinePanels.d.ts.map +1 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +8 -4
- package/dist/hooks/useSlots.d.ts.map +1 -1
- package/dist/hooks/useSlots.js +3 -2
- package/dist/hooks/useSyncedState.js +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts +6 -7
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +7 -9
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.d.ts +4 -4
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +1 -0
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.d.ts +2 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +1 -0
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.d.ts +3 -3
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +2 -3
- package/dist/internal/components/InputLabel.d.ts +2 -3
- package/dist/internal/components/InputLabel.d.ts.map +1 -1
- package/dist/internal/components/InputLabel.js +29 -36
- package/dist/internal/components/InputValidation.d.ts +1 -2
- package/dist/internal/components/InputValidation.d.ts.map +1 -1
- package/dist/internal/components/TextInputInnerAction.d.ts +16 -2
- package/dist/internal/components/TextInputInnerAction.d.ts.map +1 -1
- package/dist/internal/components/TextInputInnerAction.js +46 -60
- package/dist/internal/components/TextInputWrapper.d.ts +10 -32
- package/dist/internal/components/TextInputWrapper.d.ts.map +1 -1
- package/dist/internal/components/TextInputWrapper.js +87 -58
- package/dist/internal/components/UnstyledTextInput.d.ts +1 -2
- package/dist/internal/components/UnstyledTextInput.d.ts.map +1 -1
- package/dist/internal/components/UnstyledTextInput.js +1 -3
- package/dist/internal/components/ValidationAnimationContainer-04125429.css +2 -0
- package/dist/internal/components/ValidationAnimationContainer-04125429.css.map +1 -0
- package/dist/internal/components/ValidationAnimationContainer.d.ts.map +1 -1
- package/dist/internal/components/ValidationAnimationContainer.js +4 -9
- package/dist/internal/components/ValidationAnimationContainer.module.css.js +5 -0
- package/dist/utils/form-story-helpers.d.ts.map +1 -1
- package/dist/utils/is-slot.d.ts +6 -0
- package/dist/utils/is-slot.d.ts.map +1 -0
- package/dist/utils/is-slot.js +15 -0
- package/dist/utils/polymorphic.d.ts +2 -1
- package/dist/utils/polymorphic.d.ts.map +1 -1
- package/dist/utils/types/Slots.d.ts +7 -0
- package/dist/utils/types/Slots.d.ts.map +1 -0
- package/dist/utils/types/index.d.ts +1 -0
- package/dist/utils/types/index.d.ts.map +1 -1
- package/generated/components.json +21 -119
- package/package.json +2 -1
- package/dist/Button/styles.d.ts +0 -431
- package/dist/Button/styles.d.ts.map +0 -1
- package/dist/Button/styles.js +0 -5
- package/dist/ConfirmationDialog/ConfirmationDialog-de0401ff.css +0 -2
- package/dist/ConfirmationDialog/ConfirmationDialog-de0401ff.css.map +0 -1
- package/dist/FilteredActionList/FilteredActionList-e1eb1b75.css +0 -2
- package/dist/FilteredActionList/FilteredActionList-e1eb1b75.css.map +0 -1
- package/dist/LabelGroup/LabelGroup-eda75c0f.css +0 -2
- package/dist/LabelGroup/LabelGroup-eda75c0f.css.map +0 -1
- package/dist/PageLayout/PageLayout-8a294e74.css.map +0 -1
- package/dist/StateLabel/StateLabel-aaa1d148.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNav-78db938f.css +0 -2
- package/dist/UnderlineNav/UnderlineNav-78db938f.css.map +0 -1
- package/dist/internal/components/BoxWithFallback.d.ts +0 -6
- package/dist/internal/components/BoxWithFallback.d.ts.map +0 -1
- package/dist/internal/components/BoxWithFallback.js +0 -70
- package/dist/internal/utils/getGlobalFocusStyles.d.ts +0 -4
- package/dist/internal/utils/getGlobalFocusStyles.d.ts.map +0 -1
- package/dist/internal/utils/getGlobalFocusStyles.js +0 -7
- package/dist/internal/utils/sharedCheckboxAndRadioStyles.d.ts +0 -2
- package/dist/internal/utils/sharedCheckboxAndRadioStyles.d.ts.map +0 -1
- package/dist/utils/defaultSxProp.d.ts +0 -3
- package/dist/utils/defaultSxProp.d.ts.map +0 -1
- package/dist/utils/defaultSxProp.js +0 -3
- package/dist/utils/includeSystemProps.d.ts +0 -7
- package/dist/utils/includeSystemProps.d.ts.map +0 -1
- package/dist/utils/includeSystemProps.js +0 -14
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React, { forwardRef, useState,
|
|
2
|
+
import React, { forwardRef, useState, useRef, useId } from 'react';
|
|
3
3
|
import { KebabHorizontalIcon } from '@primer/octicons-react';
|
|
4
4
|
import { ActionList } from '../ActionList/index.js';
|
|
5
5
|
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
|
|
@@ -10,14 +10,23 @@ import { IconButton } from '../Button/IconButton.js';
|
|
|
10
10
|
import { useFocusZone } from '../hooks/useFocusZone.js';
|
|
11
11
|
import styles from './ActionBar.module.css.js';
|
|
12
12
|
import { clsx } from 'clsx';
|
|
13
|
-
import {
|
|
13
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
14
|
+
import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
|
|
14
15
|
import { FocusKeys } from '@primer/behaviors';
|
|
15
16
|
import { ActionMenu } from '../ActionMenu/ActionMenu.js';
|
|
16
17
|
|
|
17
18
|
const ACTIONBAR_ITEM_GAP = 8;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Registry of descendants to render in the list or menu. To preserve insertion order across updates, children are
|
|
22
|
+
* set to `null` when unregistered rather than fully dropped from the map.
|
|
23
|
+
*/
|
|
24
|
+
|
|
18
25
|
const ActionBarContext = /*#__PURE__*/React.createContext({
|
|
19
26
|
size: 'medium',
|
|
20
|
-
|
|
27
|
+
registerChild: () => {},
|
|
28
|
+
unregisterChild: () => {},
|
|
29
|
+
isVisibleChild: () => true
|
|
21
30
|
});
|
|
22
31
|
|
|
23
32
|
/*
|
|
@@ -25,17 +34,12 @@ small (28px), medium (32px), large (40px)
|
|
|
25
34
|
*/
|
|
26
35
|
|
|
27
36
|
const MORE_BTN_WIDTH = 32;
|
|
28
|
-
const
|
|
29
|
-
return React.Children.toArray(children).filter(child => {
|
|
30
|
-
return /*#__PURE__*/React.isValidElement(child);
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
const calculatePossibleItems = (childWidthArray, navWidth, moreMenuWidth = 0) => {
|
|
37
|
+
const calculatePossibleItems = (registryEntries, navWidth, moreMenuWidth = 0) => {
|
|
34
38
|
const widthToFit = navWidth - moreMenuWidth;
|
|
35
|
-
let breakpoint =
|
|
39
|
+
let breakpoint = registryEntries.length; // assume all items will fit
|
|
36
40
|
let sumsOfChildWidth = 0;
|
|
37
|
-
for (const [index,
|
|
38
|
-
sumsOfChildWidth += index > 0 ?
|
|
41
|
+
for (const [index, [, child]] of registryEntries.entries()) {
|
|
42
|
+
sumsOfChildWidth += index > 0 ? child.width + ACTIONBAR_ITEM_GAP : child.width;
|
|
39
43
|
if (sumsOfChildWidth > widthToFit) {
|
|
40
44
|
breakpoint = index;
|
|
41
45
|
break;
|
|
@@ -45,188 +49,295 @@ const calculatePossibleItems = (childWidthArray, navWidth, moreMenuWidth = 0) =>
|
|
|
45
49
|
}
|
|
46
50
|
return breakpoint;
|
|
47
51
|
};
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
const numberOfItemsPossible = calculatePossibleItems(childWidthArray, navWidth);
|
|
56
|
-
const numberOfItemsPossibleWithMoreMenu = calculatePossibleItems(childWidthArray, navWidth, moreMenuWidth || MORE_BTN_WIDTH);
|
|
57
|
-
const items = [];
|
|
58
|
-
const menuItems = [];
|
|
52
|
+
const getMenuItems = (navWidth, moreMenuWidth, childRegistry, hasActiveMenu) => {
|
|
53
|
+
const registryEntries = Array.from(childRegistry).filter(entry => entry[1] !== null);
|
|
54
|
+
if (registryEntries.length === 0) return new Set();
|
|
55
|
+
const numberOfItemsPossible = calculatePossibleItems(registryEntries, navWidth);
|
|
56
|
+
const numberOfItemsPossibleWithMoreMenu = calculatePossibleItems(registryEntries, navWidth, moreMenuWidth || MORE_BTN_WIDTH);
|
|
57
|
+
const menuItems = new Set();
|
|
59
58
|
|
|
60
59
|
// First, we check if we can fit all the items with their icons
|
|
61
|
-
if (
|
|
60
|
+
if (registryEntries.length >= numberOfItemsPossible) {
|
|
62
61
|
/* Below is an accessibility requirement. Never show only one item in the overflow menu.
|
|
63
62
|
* If there is only one item left to display in the overflow menu according to the calculation,
|
|
64
63
|
* we need to pull another item from the list into the overflow menu.
|
|
65
64
|
*/
|
|
66
|
-
const numberOfItemsInMenu =
|
|
65
|
+
const numberOfItemsInMenu = registryEntries.length - numberOfItemsPossibleWithMoreMenu;
|
|
67
66
|
const numberOfListItems = numberOfItemsInMenu === 1 ? numberOfItemsPossibleWithMoreMenu - 1 : numberOfItemsPossibleWithMoreMenu;
|
|
68
|
-
for (const [index, child] of
|
|
67
|
+
for (const [index, [id, child]] of registryEntries.entries()) {
|
|
69
68
|
if (index < numberOfListItems) {
|
|
70
|
-
|
|
69
|
+
continue;
|
|
71
70
|
//if the last item is a divider
|
|
72
|
-
} else if (
|
|
71
|
+
} else if (child.type === 'divider') {
|
|
73
72
|
if (index === numberOfListItems - 1 || index === numberOfListItems) {
|
|
74
73
|
continue;
|
|
75
74
|
} else {
|
|
76
|
-
|
|
77
|
-
key: index
|
|
78
|
-
});
|
|
79
|
-
menuItems.push(divider);
|
|
75
|
+
menuItems.add(id);
|
|
80
76
|
}
|
|
81
77
|
} else {
|
|
82
|
-
menuItems.
|
|
78
|
+
menuItems.add(id);
|
|
83
79
|
}
|
|
84
80
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
menuItems
|
|
88
|
-
});
|
|
89
|
-
} else if (numberOfItemsPossible > childArray.length && hasActiveMenu) {
|
|
81
|
+
return menuItems;
|
|
82
|
+
} else if (numberOfItemsPossible > registryEntries.length && hasActiveMenu) {
|
|
90
83
|
/* If the items fit in the list and there are items in the overflow menu, we need to move them back to the list */
|
|
91
|
-
|
|
92
|
-
items: childArray,
|
|
93
|
-
menuItems: []
|
|
94
|
-
});
|
|
84
|
+
return new Set();
|
|
95
85
|
}
|
|
96
86
|
};
|
|
97
87
|
const ActionBar = props => {
|
|
88
|
+
const $ = c(34);
|
|
98
89
|
const {
|
|
99
|
-
size
|
|
90
|
+
size: t0,
|
|
100
91
|
children,
|
|
101
|
-
|
|
102
|
-
flush
|
|
92
|
+
"aria-label": ariaLabel,
|
|
93
|
+
flush: t1,
|
|
103
94
|
className
|
|
104
95
|
} = props;
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
96
|
+
const size = t0 === undefined ? "medium" : t0;
|
|
97
|
+
const flush = t1 === undefined ? false : t1;
|
|
98
|
+
const [childRegistry, setChildRegistry] = useState(_temp);
|
|
99
|
+
let t2;
|
|
100
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
101
|
+
t2 = (id, childProps) => setChildRegistry(prev => new Map(prev).set(id, childProps));
|
|
102
|
+
$[0] = t2;
|
|
103
|
+
} else {
|
|
104
|
+
t2 = $[0];
|
|
105
|
+
}
|
|
106
|
+
const registerChild = t2;
|
|
107
|
+
let t3;
|
|
108
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
109
|
+
t3 = id_0 => setChildRegistry(prev_0 => new Map(prev_0).set(id_0, null));
|
|
110
|
+
$[1] = t3;
|
|
111
|
+
} else {
|
|
112
|
+
t3 = $[1];
|
|
113
|
+
}
|
|
114
|
+
const unregisterChild = t3;
|
|
115
|
+
const [menuItemIds, setMenuItemIds] = useState(_temp2);
|
|
112
116
|
const navRef = useRef(null);
|
|
113
117
|
const listRef = useRef(null);
|
|
114
118
|
const moreMenuRef = useRef(null);
|
|
115
119
|
const moreMenuBtnRef = useRef(null);
|
|
116
120
|
const containerRef = React.useRef(null);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
121
|
+
let t4;
|
|
122
|
+
if ($[2] !== childRegistry || $[3] !== menuItemIds.size) {
|
|
123
|
+
t4 = resizeObserverEntries => {
|
|
124
|
+
var _moreMenuRef$current$, _moreMenuRef$current;
|
|
125
|
+
const navWidth = resizeObserverEntries[0].contentRect.width;
|
|
126
|
+
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;
|
|
127
|
+
const hasActiveMenu = menuItemIds.size > 0;
|
|
128
|
+
if (navWidth > 0) {
|
|
129
|
+
const newMenuItemIds = getMenuItems(navWidth, moreMenuWidth, childRegistry, hasActiveMenu);
|
|
130
|
+
if (newMenuItemIds) {
|
|
131
|
+
setMenuItemIds(newMenuItemIds);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
$[2] = childRegistry;
|
|
136
|
+
$[3] = menuItemIds.size;
|
|
137
|
+
$[4] = t4;
|
|
138
|
+
} else {
|
|
139
|
+
t4 = $[4];
|
|
140
|
+
}
|
|
141
|
+
useResizeObserver(t4, navRef);
|
|
142
|
+
let t5;
|
|
143
|
+
if ($[5] !== menuItemIds) {
|
|
144
|
+
t5 = id_1 => !menuItemIds.has(id_1);
|
|
145
|
+
$[5] = menuItemIds;
|
|
146
|
+
$[6] = t5;
|
|
147
|
+
} else {
|
|
148
|
+
t5 = $[6];
|
|
149
|
+
}
|
|
150
|
+
const isVisibleChild = t5;
|
|
145
151
|
const [isWidgetOpen, setIsWidgetOpen] = useState(false);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
152
|
+
let t6;
|
|
153
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
154
|
+
t6 = () => {
|
|
155
|
+
setIsWidgetOpen(false);
|
|
156
|
+
};
|
|
157
|
+
$[7] = t6;
|
|
158
|
+
} else {
|
|
159
|
+
t6 = $[7];
|
|
160
|
+
}
|
|
161
|
+
const closeOverlay = t6;
|
|
162
|
+
let t7;
|
|
163
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
164
|
+
t7 = () => {
|
|
165
|
+
var _moreMenuBtnRef$curre;
|
|
166
|
+
(_moreMenuBtnRef$curre = moreMenuBtnRef.current) === null || _moreMenuBtnRef$curre === void 0 ? void 0 : _moreMenuBtnRef$curre.focus();
|
|
167
|
+
};
|
|
168
|
+
$[8] = t7;
|
|
169
|
+
} else {
|
|
170
|
+
t7 = $[8];
|
|
171
|
+
}
|
|
172
|
+
const focusOnMoreMenuBtn = t7;
|
|
173
|
+
let t8;
|
|
174
|
+
let t9;
|
|
175
|
+
if ($[9] !== isWidgetOpen) {
|
|
176
|
+
t8 = event => {
|
|
177
|
+
if (isWidgetOpen) {
|
|
178
|
+
event.preventDefault();
|
|
179
|
+
closeOverlay();
|
|
180
|
+
focusOnMoreMenuBtn();
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
t9 = [isWidgetOpen];
|
|
184
|
+
$[9] = isWidgetOpen;
|
|
185
|
+
$[10] = t8;
|
|
186
|
+
$[11] = t9;
|
|
187
|
+
} else {
|
|
188
|
+
t8 = $[10];
|
|
189
|
+
t9 = $[11];
|
|
190
|
+
}
|
|
191
|
+
useOnEscapePress(t8, t9);
|
|
192
|
+
let t10;
|
|
193
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
194
|
+
t10 = {
|
|
195
|
+
onClickOutside: closeOverlay,
|
|
196
|
+
containerRef,
|
|
197
|
+
ignoreClickRefs: [moreMenuBtnRef]
|
|
198
|
+
};
|
|
199
|
+
$[12] = t10;
|
|
200
|
+
} else {
|
|
201
|
+
t10 = $[12];
|
|
202
|
+
}
|
|
203
|
+
useOnOutsideClick(t10);
|
|
204
|
+
let t11;
|
|
205
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
206
|
+
t11 = {
|
|
207
|
+
containerRef: listRef,
|
|
208
|
+
bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
|
|
209
|
+
focusOutBehavior: "wrap"
|
|
210
|
+
};
|
|
211
|
+
$[13] = t11;
|
|
212
|
+
} else {
|
|
213
|
+
t11 = $[13];
|
|
214
|
+
}
|
|
215
|
+
useFocusZone(t11);
|
|
216
|
+
let t12;
|
|
217
|
+
if ($[14] !== isVisibleChild || $[15] !== size) {
|
|
218
|
+
t12 = {
|
|
172
219
|
size,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
220
|
+
registerChild,
|
|
221
|
+
unregisterChild,
|
|
222
|
+
isVisibleChild
|
|
223
|
+
};
|
|
224
|
+
$[14] = isVisibleChild;
|
|
225
|
+
$[15] = size;
|
|
226
|
+
$[16] = t12;
|
|
227
|
+
} else {
|
|
228
|
+
t12 = $[16];
|
|
229
|
+
}
|
|
230
|
+
let t13;
|
|
231
|
+
if ($[17] !== className) {
|
|
232
|
+
t13 = clsx(className, styles.Nav);
|
|
233
|
+
$[17] = className;
|
|
234
|
+
$[18] = t13;
|
|
235
|
+
} else {
|
|
236
|
+
t13 = $[18];
|
|
237
|
+
}
|
|
238
|
+
let t14;
|
|
239
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
240
|
+
t14 = {
|
|
241
|
+
gap: `${ACTIONBAR_ITEM_GAP}px`
|
|
242
|
+
};
|
|
243
|
+
$[19] = t14;
|
|
244
|
+
} else {
|
|
245
|
+
t14 = $[19];
|
|
246
|
+
}
|
|
247
|
+
let t15;
|
|
248
|
+
if ($[20] !== ariaLabel || $[21] !== childRegistry || $[22] !== menuItemIds) {
|
|
249
|
+
t15 = menuItemIds.size > 0 && /*#__PURE__*/jsxs(ActionMenu, {
|
|
250
|
+
children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
|
|
251
|
+
children: /*#__PURE__*/jsx(IconButton, {
|
|
252
|
+
variant: "invisible",
|
|
253
|
+
"aria-label": `More ${ariaLabel} items`,
|
|
254
|
+
icon: KebabHorizontalIcon
|
|
255
|
+
})
|
|
256
|
+
}), /*#__PURE__*/jsx(ActionMenu.Overlay, {
|
|
257
|
+
children: /*#__PURE__*/jsx(ActionList, {
|
|
258
|
+
children: Array.from(menuItemIds).map(id_2 => {
|
|
259
|
+
const menuItem = childRegistry.get(id_2);
|
|
260
|
+
if (!menuItem) {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
if (menuItem.type === "divider") {
|
|
264
|
+
return /*#__PURE__*/jsx(ActionList.Divider, {}, id_2);
|
|
265
|
+
} else {
|
|
266
|
+
const {
|
|
267
|
+
onClick,
|
|
268
|
+
icon: Icon,
|
|
269
|
+
label,
|
|
270
|
+
disabled
|
|
271
|
+
} = menuItem;
|
|
272
|
+
return /*#__PURE__*/jsxs(ActionList.Item, {
|
|
273
|
+
onClick: event_0 => {
|
|
274
|
+
closeOverlay();
|
|
275
|
+
focusOnMoreMenuBtn();
|
|
276
|
+
typeof onClick === "function" && onClick(event_0);
|
|
277
|
+
},
|
|
278
|
+
disabled: disabled,
|
|
279
|
+
children: [/*#__PURE__*/jsx(ActionList.LeadingVisual, {
|
|
280
|
+
children: /*#__PURE__*/jsx(Icon, {})
|
|
281
|
+
}), label]
|
|
282
|
+
}, label);
|
|
283
|
+
}
|
|
284
|
+
})
|
|
285
|
+
})
|
|
286
|
+
})]
|
|
287
|
+
});
|
|
288
|
+
$[20] = ariaLabel;
|
|
289
|
+
$[21] = childRegistry;
|
|
290
|
+
$[22] = menuItemIds;
|
|
291
|
+
$[23] = t15;
|
|
292
|
+
} else {
|
|
293
|
+
t15 = $[23];
|
|
294
|
+
}
|
|
295
|
+
let t16;
|
|
296
|
+
if ($[24] !== children || $[25] !== t15) {
|
|
297
|
+
t16 = /*#__PURE__*/jsxs("div", {
|
|
298
|
+
ref: listRef,
|
|
299
|
+
role: "toolbar",
|
|
300
|
+
className: styles.List,
|
|
301
|
+
style: t14,
|
|
302
|
+
children: [children, t15]
|
|
303
|
+
});
|
|
304
|
+
$[24] = children;
|
|
305
|
+
$[25] = t15;
|
|
306
|
+
$[26] = t16;
|
|
307
|
+
} else {
|
|
308
|
+
t16 = $[26];
|
|
309
|
+
}
|
|
310
|
+
let t17;
|
|
311
|
+
if ($[27] !== flush || $[28] !== t13 || $[29] !== t16) {
|
|
312
|
+
t17 = /*#__PURE__*/jsx("div", {
|
|
176
313
|
ref: navRef,
|
|
177
|
-
className:
|
|
314
|
+
className: t13,
|
|
178
315
|
"data-flush": flush,
|
|
179
|
-
children:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
onClick,
|
|
202
|
-
icon: Icon,
|
|
203
|
-
'aria-label': ariaLabel_0,
|
|
204
|
-
disabled
|
|
205
|
-
} = menuItem_0.props;
|
|
206
|
-
return /*#__PURE__*/jsxs(ActionList.Item, {
|
|
207
|
-
// eslint-disable-next-line primer-react/prefer-action-list-item-onselect
|
|
208
|
-
onClick: event_0 => {
|
|
209
|
-
closeOverlay();
|
|
210
|
-
focusOnMoreMenuBtn();
|
|
211
|
-
typeof onClick === 'function' && onClick(event_0);
|
|
212
|
-
},
|
|
213
|
-
disabled: disabled,
|
|
214
|
-
children: [Icon ? /*#__PURE__*/jsx(ActionList.LeadingVisual, {
|
|
215
|
-
children: /*#__PURE__*/jsx(Icon, {})
|
|
216
|
-
}) : null, ariaLabel_0]
|
|
217
|
-
}, menuItemChildren);
|
|
218
|
-
}
|
|
219
|
-
})
|
|
220
|
-
})
|
|
221
|
-
})]
|
|
222
|
-
})]
|
|
223
|
-
})
|
|
224
|
-
})
|
|
225
|
-
});
|
|
316
|
+
children: t16
|
|
317
|
+
});
|
|
318
|
+
$[27] = flush;
|
|
319
|
+
$[28] = t13;
|
|
320
|
+
$[29] = t16;
|
|
321
|
+
$[30] = t17;
|
|
322
|
+
} else {
|
|
323
|
+
t17 = $[30];
|
|
324
|
+
}
|
|
325
|
+
let t18;
|
|
326
|
+
if ($[31] !== t12 || $[32] !== t17) {
|
|
327
|
+
t18 = /*#__PURE__*/jsx(ActionBarContext.Provider, {
|
|
328
|
+
value: t12,
|
|
329
|
+
children: t17
|
|
330
|
+
});
|
|
331
|
+
$[31] = t12;
|
|
332
|
+
$[32] = t17;
|
|
333
|
+
$[33] = t18;
|
|
334
|
+
} else {
|
|
335
|
+
t18 = $[33];
|
|
336
|
+
}
|
|
337
|
+
return t18;
|
|
226
338
|
};
|
|
227
|
-
ActionBar.displayName = "ActionBar";
|
|
228
339
|
const ActionBarIconButton = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
229
|
-
const $ = c(
|
|
340
|
+
const $ = c(26);
|
|
230
341
|
let disabled;
|
|
231
342
|
let onClick;
|
|
232
343
|
let props;
|
|
@@ -245,58 +356,84 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
245
356
|
onClick = $[2];
|
|
246
357
|
props = $[3];
|
|
247
358
|
}
|
|
248
|
-
const
|
|
249
|
-
|
|
359
|
+
const ref = useRef(null);
|
|
360
|
+
useRefObjectAsForwardedRef(forwardedRef, ref);
|
|
361
|
+
const id = useId();
|
|
250
362
|
const {
|
|
251
363
|
size,
|
|
252
|
-
|
|
364
|
+
registerChild,
|
|
365
|
+
unregisterChild,
|
|
366
|
+
isVisibleChild
|
|
253
367
|
} = React.useContext(ActionBarContext);
|
|
368
|
+
const widthRef = useRef();
|
|
254
369
|
let t1;
|
|
255
|
-
if ($[4] !==
|
|
370
|
+
if ($[4] !== disabled || $[5] !== id || $[6] !== onClick || $[7] !== props || $[8] !== registerChild || $[9] !== unregisterChild) {
|
|
256
371
|
t1 = () => {
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
372
|
+
var _ref$current, _props$ariaLabel;
|
|
373
|
+
const width = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect().width;
|
|
374
|
+
if (width) {
|
|
375
|
+
widthRef.current = width;
|
|
376
|
+
}
|
|
377
|
+
if (!widthRef.current) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
registerChild(id, {
|
|
381
|
+
type: "action",
|
|
382
|
+
label: (_props$ariaLabel = props["aria-label"]) !== null && _props$ariaLabel !== void 0 ? _props$ariaLabel : "",
|
|
383
|
+
icon: props.icon,
|
|
384
|
+
disabled: !!disabled,
|
|
385
|
+
onClick: onClick,
|
|
386
|
+
width: widthRef.current
|
|
262
387
|
});
|
|
388
|
+
return () => unregisterChild(id);
|
|
263
389
|
};
|
|
264
|
-
$[4] =
|
|
265
|
-
$[5] =
|
|
266
|
-
$[6] =
|
|
267
|
-
$[7] =
|
|
390
|
+
$[4] = disabled;
|
|
391
|
+
$[5] = id;
|
|
392
|
+
$[6] = onClick;
|
|
393
|
+
$[7] = props;
|
|
394
|
+
$[8] = registerChild;
|
|
395
|
+
$[9] = unregisterChild;
|
|
396
|
+
$[10] = t1;
|
|
268
397
|
} else {
|
|
269
|
-
t1 = $[
|
|
398
|
+
t1 = $[10];
|
|
270
399
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
400
|
+
const t2 = props["aria-label"];
|
|
401
|
+
let t3;
|
|
402
|
+
if ($[11] !== disabled || $[12] !== onClick || $[13] !== props.icon || $[14] !== registerChild || $[15] !== t2 || $[16] !== unregisterChild) {
|
|
403
|
+
t3 = [registerChild, unregisterChild, t2, props.icon, disabled, onClick];
|
|
404
|
+
$[11] = disabled;
|
|
405
|
+
$[12] = onClick;
|
|
406
|
+
$[13] = props.icon;
|
|
407
|
+
$[14] = registerChild;
|
|
408
|
+
$[15] = t2;
|
|
409
|
+
$[16] = unregisterChild;
|
|
410
|
+
$[17] = t3;
|
|
277
411
|
} else {
|
|
278
|
-
|
|
412
|
+
t3 = $[17];
|
|
279
413
|
}
|
|
280
|
-
useIsomorphicLayoutEffect(t1,
|
|
281
|
-
let
|
|
282
|
-
if ($[
|
|
283
|
-
|
|
414
|
+
useIsomorphicLayoutEffect(t1, t3);
|
|
415
|
+
let t4;
|
|
416
|
+
if ($[18] !== disabled || $[19] !== onClick) {
|
|
417
|
+
t4 = event => {
|
|
284
418
|
var _onClick;
|
|
285
419
|
if (disabled) {
|
|
286
420
|
return;
|
|
287
421
|
}
|
|
288
422
|
(_onClick = onClick) === null || _onClick === void 0 ? void 0 : _onClick(event);
|
|
289
423
|
};
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
424
|
+
$[18] = disabled;
|
|
425
|
+
$[19] = onClick;
|
|
426
|
+
$[20] = t4;
|
|
293
427
|
} else {
|
|
294
|
-
|
|
428
|
+
t4 = $[20];
|
|
295
429
|
}
|
|
296
|
-
const clickHandler =
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
430
|
+
const clickHandler = t4;
|
|
431
|
+
if (!isVisibleChild(id)) {
|
|
432
|
+
return null;
|
|
433
|
+
}
|
|
434
|
+
let t5;
|
|
435
|
+
if ($[21] !== clickHandler || $[22] !== disabled || $[23] !== props || $[24] !== size) {
|
|
436
|
+
t5 = /*#__PURE__*/jsx(IconButton, {
|
|
300
437
|
"aria-disabled": disabled,
|
|
301
438
|
ref: ref,
|
|
302
439
|
size: size,
|
|
@@ -304,55 +441,82 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
|
|
|
304
441
|
...props,
|
|
305
442
|
variant: "invisible"
|
|
306
443
|
});
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[19] = t4;
|
|
444
|
+
$[21] = clickHandler;
|
|
445
|
+
$[22] = disabled;
|
|
446
|
+
$[23] = props;
|
|
447
|
+
$[24] = size;
|
|
448
|
+
$[25] = t5;
|
|
313
449
|
} else {
|
|
314
|
-
|
|
450
|
+
t5 = $[25];
|
|
315
451
|
}
|
|
316
|
-
return
|
|
452
|
+
return t5;
|
|
317
453
|
});
|
|
318
454
|
const VerticalDivider = () => {
|
|
319
|
-
const $ = c(
|
|
455
|
+
const $ = c(8);
|
|
320
456
|
const ref = useRef(null);
|
|
457
|
+
const id = useId();
|
|
321
458
|
const {
|
|
322
|
-
|
|
459
|
+
registerChild,
|
|
460
|
+
unregisterChild,
|
|
461
|
+
isVisibleChild
|
|
323
462
|
} = React.useContext(ActionBarContext);
|
|
463
|
+
const widthRef = useRef();
|
|
324
464
|
let t0;
|
|
325
|
-
|
|
326
|
-
if ($[0] !== setChildrenWidth) {
|
|
465
|
+
if ($[0] !== id || $[1] !== registerChild || $[2] !== unregisterChild) {
|
|
327
466
|
t0 = () => {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
467
|
+
var _ref$current2;
|
|
468
|
+
const width = (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.getBoundingClientRect().width;
|
|
469
|
+
if (width) {
|
|
470
|
+
widthRef.current = width;
|
|
471
|
+
}
|
|
472
|
+
if (!widthRef.current) {
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
registerChild(id, {
|
|
476
|
+
type: "divider",
|
|
477
|
+
width: widthRef.current
|
|
332
478
|
});
|
|
479
|
+
return () => unregisterChild(id);
|
|
333
480
|
};
|
|
334
|
-
|
|
335
|
-
$[
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
481
|
+
$[0] = id;
|
|
482
|
+
$[1] = registerChild;
|
|
483
|
+
$[2] = unregisterChild;
|
|
484
|
+
$[3] = t0;
|
|
338
485
|
} else {
|
|
339
|
-
t0 = $[
|
|
340
|
-
|
|
486
|
+
t0 = $[3];
|
|
487
|
+
}
|
|
488
|
+
let t1;
|
|
489
|
+
if ($[4] !== registerChild || $[5] !== unregisterChild) {
|
|
490
|
+
t1 = [registerChild, unregisterChild];
|
|
491
|
+
$[4] = registerChild;
|
|
492
|
+
$[5] = unregisterChild;
|
|
493
|
+
$[6] = t1;
|
|
494
|
+
} else {
|
|
495
|
+
t1 = $[6];
|
|
341
496
|
}
|
|
342
497
|
useIsomorphicLayoutEffect(t0, t1);
|
|
498
|
+
if (!isVisibleChild(id)) {
|
|
499
|
+
return null;
|
|
500
|
+
}
|
|
343
501
|
let t2;
|
|
344
|
-
if ($[
|
|
502
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
345
503
|
t2 = /*#__PURE__*/jsx("div", {
|
|
346
504
|
ref: ref,
|
|
347
505
|
"data-component": "ActionBar.VerticalDivider",
|
|
348
506
|
"aria-hidden": "true",
|
|
349
507
|
className: styles.Divider
|
|
350
508
|
});
|
|
351
|
-
$[
|
|
509
|
+
$[7] = t2;
|
|
352
510
|
} else {
|
|
353
|
-
t2 = $[
|
|
511
|
+
t2 = $[7];
|
|
354
512
|
}
|
|
355
513
|
return t2;
|
|
356
514
|
};
|
|
515
|
+
function _temp() {
|
|
516
|
+
return new Map();
|
|
517
|
+
}
|
|
518
|
+
function _temp2() {
|
|
519
|
+
return new Set();
|
|
520
|
+
}
|
|
357
521
|
|
|
358
522
|
export { ActionBar, ActionBarIconButton, VerticalDivider };
|