@primer/react 0.0.0-20260622150202 → 0.0.0-20260622155414
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 +3 -34
- package/dist/ActionList/ActionList-65f7daac.css +1 -1
- package/dist/ActionList/ActionList-65f7daac.css.map +1 -1
- package/dist/ActionList/ActionList.module.css.js +1 -1
- package/dist/ActionList/Description.d.ts.map +1 -1
- package/dist/ActionList/GroupHeadingTrailingAction.js +14 -20
- package/dist/ActionList/LinkItem.d.ts +1 -1
- package/dist/ActionList/List.d.ts +11 -2
- package/dist/ActionList/List.d.ts.map +1 -1
- package/dist/ActionList/TrailingAction.d.ts +1 -2
- package/dist/ActionList/TrailingAction.d.ts.map +1 -1
- package/dist/ActionList/TrailingAction.js +31 -37
- package/dist/ActionList/index.d.ts +24 -4
- package/dist/ActionList/index.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay-83281f45.css +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay-83281f45.css.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +3 -8
- package/dist/Autocomplete/AutocompleteInput.d.ts.map +1 -1
- package/dist/Autocomplete/AutocompleteInput.js +1 -3
- package/dist/Autocomplete/AutocompleteMenu.d.ts.map +1 -1
- package/dist/Autocomplete/AutocompleteMenu.js +1 -7
- package/dist/AvatarStack/AvatarStack-9bb5649f.css +1 -1
- package/dist/AvatarStack/AvatarStack-9bb5649f.css.map +1 -1
- package/dist/AvatarStack/AvatarStack.d.ts.map +1 -1
- package/dist/AvatarStack/AvatarStack.js +0 -1
- package/dist/BaseStyles-fda34843.css +1 -1
- package/dist/BaseStyles-fda34843.css.map +1 -1
- package/dist/Blankslate/Blankslate-a039d79a.css +2 -0
- package/dist/Blankslate/Blankslate-a039d79a.css.map +1 -0
- package/dist/Blankslate/Blankslate.module.css.js +1 -1
- package/dist/BranchName/BranchName-2fad4f4b.css +1 -1
- package/dist/BranchName/BranchName-2fad4f4b.css.map +1 -1
- package/dist/BranchName/BranchName.d.ts +4 -2
- package/dist/BranchName/BranchName.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs-54395fc6.css +1 -1
- package/dist/Breadcrumbs/Breadcrumbs-54395fc6.css.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +10 -4
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +149 -330
- package/dist/Button/ButtonBase-311501b9.css +1 -1
- package/dist/Button/ButtonBase-311501b9.css.map +1 -1
- package/dist/Button/ButtonBase.module.css.js +1 -1
- package/dist/ButtonGroup/ButtonGroup-54ba293b.css +1 -1
- package/dist/ButtonGroup/ButtonGroup-54ba293b.css.map +1 -1
- package/dist/Card/Card.d.ts +20 -2
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/index.d.ts +8 -2
- package/dist/Card/index.d.ts.map +1 -1
- package/dist/Checkbox/Checkbox-edc5dc3e.css +1 -1
- package/dist/Checkbox/Checkbox-edc5dc3e.css.map +1 -1
- package/dist/CircleBadge/CircleBadge.d.ts +1 -1
- package/dist/CircleBadge/CircleBadge.d.ts.map +1 -1
- package/dist/CircleBadge/CircleBadge.js +1 -2
- package/dist/DataTable/storybook/data.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +1 -1
- package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionList.js +0 -4
- package/dist/FilteredActionList/FilteredActionListLoaders-a46a8ea4.css +2 -0
- package/dist/FilteredActionList/FilteredActionListLoaders-a46a8ea4.css.map +1 -0
- package/dist/FilteredActionList/FilteredActionListLoaders.js +1 -1
- package/dist/FilteredActionList/FilteredActionListLoaders.module.css.js +2 -2
- package/dist/FilteredActionList/useAnnouncements.d.ts.map +1 -1
- package/dist/LabelGroup/LabelGroup.d.ts.map +1 -1
- package/dist/LabelGroup/LabelGroup.js +0 -5
- package/dist/Link/Link-ba423096.css +1 -1
- package/dist/Link/Link-ba423096.css.map +1 -1
- package/dist/Link/Link.d.ts +1 -1
- package/dist/NavList/NavList.d.ts +8 -2
- package/dist/NavList/NavList.d.ts.map +1 -1
- package/dist/Overlay/Overlay-214d10dd.css +1 -1
- package/dist/Overlay/Overlay-214d10dd.css.map +1 -1
- package/dist/Overlay/Overlay.module.css.js +1 -1
- package/dist/Popover/Popover-a93df39c.css +1 -1
- package/dist/Popover/Popover-a93df39c.css.map +1 -1
- package/dist/SelectPanel/SelectPanel.d.ts +2 -2
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +6 -26
- 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/SubNav/SubNav-88128e5c.css +1 -1
- package/dist/SubNav/SubNav-88128e5c.css.map +1 -1
- package/dist/Text/Text.d.ts +7 -2
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Textarea/Textarea.d.ts.map +1 -1
- package/dist/Timeline/Timeline-ff81db92.css +1 -1
- package/dist/Timeline/Timeline-ff81db92.css.map +1 -1
- package/dist/ToggleSwitch/ToggleSwitch.d.ts.map +1 -1
- package/dist/Token/IssueLabelToken-10cfada5.css +1 -1
- package/dist/Token/IssueLabelToken-10cfada5.css.map +1 -1
- package/dist/Token/_TokenTextContainer-55ce2de3.css +1 -1
- package/dist/Token/_TokenTextContainer-55ce2de3.css.map +1 -1
- package/dist/Token/_TokenTextContainer.module.css.js +1 -1
- package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
- package/dist/TooltipV2/Tooltip.js +0 -1
- package/dist/TreeView/TreeView-1bf45a33.css +1 -1
- package/dist/TreeView/TreeView-1bf45a33.css.map +1 -1
- package/dist/TreeView/TreeView.d.ts +2 -11
- package/dist/TreeView/TreeView.d.ts.map +1 -1
- package/dist/TreeView/TreeView.js +166 -201
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css +2 -0
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNav.d.ts +2 -1
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +331 -91
- package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -2
- package/dist/UnderlineNav/UnderlineNavContext.d.ts +11 -1
- package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavContext.js +4 -1
- package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css +2 -0
- package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNavItem.d.ts +32 -1
- package/dist/UnderlineNav/UnderlineNavItem.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavItem.js +38 -33
- package/dist/UnderlineNav/UnderlineNavItem.module.css.js +1 -1
- package/dist/UnderlineNav/index.d.ts +1 -1
- package/dist/UnderlineNav/index.d.ts.map +1 -1
- package/dist/UnderlineNav/styles.d.ts +16 -0
- package/dist/UnderlineNav/styles.d.ts.map +1 -0
- package/dist/UnderlineNav/styles.js +19 -0
- package/dist/UnderlineNav/types.d.ts +10 -0
- package/dist/UnderlineNav/types.d.ts.map +1 -0
- package/dist/UnderlineNav/utils.d.ts +0 -2
- package/dist/UnderlineNav/utils.d.ts.map +1 -1
- package/dist/UnderlineNav/utils.js +1 -2
- package/dist/deprecated/ActionList/Group.d.ts +1 -1
- package/dist/deprecated/ActionList/Group.d.ts.map +1 -1
- package/dist/deprecated/ActionList/Group.js +5 -9
- package/dist/experimental/SelectPanel2/SelectPanel-608e207e.css +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel-608e207e.css.map +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts +1 -4
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts.map +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.js +2 -3
- package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css +2 -0
- package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css.map +1 -0
- package/dist/experimental/UnderlinePanels/UnderlinePanels.d.ts.map +1 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +11 -8
- package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +1 -1
- package/dist/hooks/useControllableState.d.ts.map +1 -1
- package/dist/hooks/useControllableState.js +0 -2
- package/dist/hooks/useDetails.d.ts.map +1 -1
- package/dist/hooks/useDialog.d.ts.map +1 -1
- package/dist/hooks/useFocusZone.d.ts.map +1 -1
- package/dist/hooks/useFocusZone.js +1 -3
- package/dist/hooks/useMenuInitialFocus.d.ts.map +1 -1
- package/dist/hooks/useMenuInitialFocus.js +0 -1
- package/dist/hooks/useMergedRefs.js +30 -17
- package/dist/hooks/useMnemonics.d.ts.map +1 -1
- package/dist/internal/components/TextInputWrapper-b2f7f9fa.css +1 -1
- package/dist/internal/components/TextInputWrapper-b2f7f9fa.css.map +1 -1
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css +2 -0
- package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css.map +1 -0
- package/dist/internal/components/UnderlineTabbedInterface.d.ts +1 -0
- package/dist/internal/components/UnderlineTabbedInterface.d.ts.map +1 -1
- package/dist/internal/components/UnderlineTabbedInterface.js +60 -66
- package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
- package/dist/utils/StressTest.d.ts.map +1 -1
- package/dist/utils/descendant-registry.d.ts.map +1 -1
- package/dist/utils/form-story-helpers.d.ts +1 -2
- package/dist/utils/form-story-helpers.d.ts.map +1 -1
- package/dist/utils/modern-polymorphic.d.ts +1 -1
- package/dist/utils/modern-polymorphic.d.ts.map +1 -1
- package/dist/utils/story-helpers.d.ts +1 -2
- package/dist/utils/story-helpers.d.ts.map +1 -1
- package/generated/components.json +8 -20
- package/package.json +3 -5
- package/dist/Blankslate/Blankslate-11d7a7fd.css +0 -2
- package/dist/Blankslate/Blankslate-11d7a7fd.css.map +0 -1
- package/dist/FilteredActionList/FilteredActionListLoaders-bdda3d7e.css +0 -2
- package/dist/FilteredActionList/FilteredActionListLoaders-bdda3d7e.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNav-263b4e8f.css +0 -2
- package/dist/UnderlineNav/UnderlineNav-263b4e8f.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNavItem-402cd41c.css +0 -2
- package/dist/UnderlineNav/UnderlineNavItem-402cd41c.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNavItemsRegistry.d.ts +0 -40
- package/dist/UnderlineNav/UnderlineNavItemsRegistry.d.ts.map +0 -1
- package/dist/UnderlineNav/UnderlineNavItemsRegistry.js +0 -6
- package/dist/experimental/UnderlinePanels/UnderlinePanels-162f9aed.css +0 -2
- package/dist/experimental/UnderlinePanels/UnderlinePanels-162f9aed.css.map +0 -1
- package/dist/internal/components/UnderlineTabbedInterface-1745a3d6.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-1745a3d6.css.map +0 -1
|
@@ -1,19 +1,117 @@
|
|
|
1
|
-
import { forwardRef, useRef, useState,
|
|
1
|
+
import React, { forwardRef, useRef, useState, useCallback } from 'react';
|
|
2
|
+
import { useDevOnlyEffect } from '../internal/hooks/useDevOnlyEffect.js';
|
|
3
|
+
import { UnderlineNavContext } from './UnderlineNavContext.js';
|
|
4
|
+
import { useResizeObserver } from '../hooks/useResizeObserver.js';
|
|
2
5
|
import VisuallyHidden from '../_VisuallyHidden.js';
|
|
6
|
+
import { dividerStyles, baseMenuMinWidth, menuItemStyles } from './styles.js';
|
|
7
|
+
import { UnderlineWrapper, UnderlineItemList, LoadingCounter, GAP } from '../internal/components/UnderlineTabbedInterface.js';
|
|
8
|
+
import { TriangleDownIcon } from '@primer/octicons-react';
|
|
9
|
+
import { useOnEscapePress } from '../hooks/useOnEscapePress.js';
|
|
10
|
+
import { useOnOutsideClick } from '../hooks/useOnOutsideClick.js';
|
|
11
|
+
import { useId } from '../hooks/useId.js';
|
|
3
12
|
import { ActionList } from '../ActionList/index.js';
|
|
4
|
-
import { UnderlineWrapper, UnderlineItemList, LoadingCounter } from '../internal/components/UnderlineTabbedInterface.js';
|
|
5
13
|
import { invariant } from '../utils/invariant.js';
|
|
6
14
|
import classes from './UnderlineNav.module.css.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { isCurrent, getValidChildren } from './utils.js';
|
|
12
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
13
|
-
import { SkeletonText } from '../SkeletonText/SkeletonText.js';
|
|
15
|
+
import { getAnchoredPosition } from '@primer/behaviors';
|
|
16
|
+
import { getValidChildren } from './utils.js';
|
|
17
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
18
|
+
import { ButtonComponent } from '../Button/Button.js';
|
|
14
19
|
import CounterLabel from '../CounterLabel/CounterLabel.js';
|
|
15
|
-
import { ActionMenu } from '../ActionMenu/ActionMenu.js';
|
|
16
20
|
|
|
21
|
+
// When page is loaded, we don't have ref for the more button as it is not on the DOM yet.
|
|
22
|
+
// However, we need to calculate number of possible items when the more button present as well. So using the width of the more button as a constant.
|
|
23
|
+
const MORE_BTN_WIDTH = 86;
|
|
24
|
+
// The height is needed to make sure we don't have a layout shift when the more button is the only item in the nav.
|
|
25
|
+
const MORE_BTN_HEIGHT = 45;
|
|
26
|
+
const overflowEffect = (navWidth, moreMenuWidth, childArray, childWidthArray, noIconChildWidthArray, updateListAndMenu) => {
|
|
27
|
+
let iconsVisible = true;
|
|
28
|
+
if (childWidthArray.length === 0) {
|
|
29
|
+
updateListAndMenu({
|
|
30
|
+
items: childArray,
|
|
31
|
+
menuItems: []
|
|
32
|
+
}, iconsVisible, false);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const numberOfItemsPossible = calculatePossibleItems(childWidthArray, navWidth);
|
|
36
|
+
const numberOfItemsWithoutIconPossible = calculatePossibleItems(noIconChildWidthArray, navWidth);
|
|
37
|
+
// We need to take more menu width into account when calculating the number of items possible
|
|
38
|
+
const numberOfItemsPossibleWithMoreMenu = calculatePossibleItems(noIconChildWidthArray, navWidth, moreMenuWidth || MORE_BTN_WIDTH);
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
const items = [];
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
|
+
const menuItems = [];
|
|
43
|
+
|
|
44
|
+
// First, we check if we can fit all the items with their icons
|
|
45
|
+
if (childArray.length <= numberOfItemsPossible) {
|
|
46
|
+
items.push(...childArray);
|
|
47
|
+
} else if (childArray.length <= numberOfItemsWithoutIconPossible) {
|
|
48
|
+
// if we can't fit all the items with their icons, we check if we can fit all the items without their icons
|
|
49
|
+
iconsVisible = false;
|
|
50
|
+
items.push(...childArray);
|
|
51
|
+
} else {
|
|
52
|
+
// if we can't fit all the items without their icons, we keep the icons hidden and show the ones that doesn't fit into the list in the overflow menu
|
|
53
|
+
iconsVisible = false;
|
|
54
|
+
|
|
55
|
+
/* Below is an accessibility requirement. Never show only one item in the overflow menu.
|
|
56
|
+
* If there is only one item left to display in the overflow menu according to the calculation,
|
|
57
|
+
* we need to pull another item from the list into the overflow menu.
|
|
58
|
+
*/
|
|
59
|
+
const numberOfItemsInMenu = childArray.length - numberOfItemsPossibleWithMoreMenu;
|
|
60
|
+
const numberOfListItems = numberOfItemsInMenu === 1 ? numberOfItemsPossibleWithMoreMenu - 1 : numberOfItemsPossibleWithMoreMenu;
|
|
61
|
+
for (const [index, child] of childArray.entries()) {
|
|
62
|
+
if (index < numberOfListItems) {
|
|
63
|
+
items.push(child);
|
|
64
|
+
} else {
|
|
65
|
+
const ariaCurrent = child.props['aria-current'];
|
|
66
|
+
const isCurrent = Boolean(ariaCurrent) && ariaCurrent !== 'false';
|
|
67
|
+
// We need to make sure to keep the selected item always visible.
|
|
68
|
+
// To do that, we swap the selected item with the last item in the list to make it visible. (When there is at least 1 item in the list to swap.)
|
|
69
|
+
if (isCurrent && numberOfListItems > 0) {
|
|
70
|
+
// If selected item couldn't make in to the list, we swap it with the last item in the list.
|
|
71
|
+
const indexToReplaceAt = numberOfListItems - 1; // because we are replacing the last item in the list
|
|
72
|
+
// splice method modifies the array by removing 1 item here at the given index and replace it with the "child" element then returns the removed item.
|
|
73
|
+
const propsectiveAction = items.splice(indexToReplaceAt, 1, child)[0];
|
|
74
|
+
menuItems.push(propsectiveAction);
|
|
75
|
+
} else {
|
|
76
|
+
menuItems.push(child);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
updateListAndMenu({
|
|
82
|
+
items,
|
|
83
|
+
menuItems
|
|
84
|
+
}, iconsVisible, true);
|
|
85
|
+
};
|
|
86
|
+
const calculatePossibleItems = (childWidthArray, navWidth, moreMenuWidth = 0) => {
|
|
87
|
+
const widthToFit = navWidth - moreMenuWidth;
|
|
88
|
+
let breakpoint = childWidthArray.length; // assume all items will fit
|
|
89
|
+
let sumsOfChildWidth = 0;
|
|
90
|
+
for (const [index, childWidth] of childWidthArray.entries()) {
|
|
91
|
+
sumsOfChildWidth = sumsOfChildWidth + childWidth.width + GAP;
|
|
92
|
+
if (sumsOfChildWidth > widthToFit) {
|
|
93
|
+
breakpoint = index;
|
|
94
|
+
break;
|
|
95
|
+
} else {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return breakpoint;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// Inline styles converted from baseMenuStyles for use as CSSProperties
|
|
103
|
+
const baseMenuInlineStyles = {
|
|
104
|
+
position: 'absolute',
|
|
105
|
+
zIndex: 1,
|
|
106
|
+
top: '90%',
|
|
107
|
+
boxShadow: '0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)',
|
|
108
|
+
borderRadius: 12,
|
|
109
|
+
background: 'var(--overlay-bgColor)',
|
|
110
|
+
listStyle: 'none',
|
|
111
|
+
minWidth: `${baseMenuMinWidth}px`,
|
|
112
|
+
maxWidth: '640px',
|
|
113
|
+
right: 0
|
|
114
|
+
};
|
|
17
115
|
const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
18
116
|
as = 'nav',
|
|
19
117
|
'aria-label': ariaLabel,
|
|
@@ -22,117 +120,259 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
22
120
|
className,
|
|
23
121
|
children
|
|
24
122
|
}, forwardedRef) => {
|
|
25
|
-
var
|
|
123
|
+
var _listRef$current2;
|
|
26
124
|
const backupRef = useRef(null);
|
|
27
125
|
const navRef = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
|
|
28
126
|
const listRef = useRef(null);
|
|
127
|
+
const moreMenuRef = useRef(null);
|
|
128
|
+
const moreMenuBtnRef = useRef(null);
|
|
129
|
+
const containerRef = React.useRef(null);
|
|
130
|
+
const disclosureWidgetId = useId();
|
|
131
|
+
const [isWidgetOpen, setIsWidgetOpen] = useState(false);
|
|
132
|
+
const [iconsVisible, setIconsVisible] = useState(true);
|
|
133
|
+
const [childWidthArray, setChildWidthArray] = useState([]);
|
|
134
|
+
const [noIconChildWidthArray, setNoIconChildWidthArray] = useState([]);
|
|
135
|
+
// Track whether the initial overflow calculation is complete to prevent CLS
|
|
136
|
+
const [isOverflowMeasured, setIsOverflowMeasured] = useState(false);
|
|
137
|
+
const validChildren = getValidChildren(children);
|
|
138
|
+
|
|
139
|
+
// Responsive props object manages which items are in the list and which items are in the menu.
|
|
140
|
+
const [responsiveProps, setResponsiveProps] = useState({
|
|
141
|
+
items: validChildren,
|
|
142
|
+
menuItems: []
|
|
143
|
+
});
|
|
29
144
|
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (isOverflowing && !hasEverOverflowed) setHasOverflowed(true);
|
|
145
|
+
// Make sure to have the fresh props data for list items when children are changed (keeping aria-current up-to-date)
|
|
146
|
+
const listItems = responsiveProps.items.map(item => {
|
|
147
|
+
var _validChildren$find;
|
|
148
|
+
return (_validChildren$find = validChildren.find(child => child.key === item.key)) !== null && _validChildren$find !== void 0 ? _validChildren$find : item;
|
|
149
|
+
});
|
|
36
150
|
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
151
|
+
// Make sure to have the fresh props data for menu items when children are changed (keeping aria-current up-to-date)
|
|
152
|
+
const menuItems = responsiveProps.menuItems.map(menuItem => {
|
|
153
|
+
var _validChildren$find2;
|
|
154
|
+
return (_validChildren$find2 = validChildren.find(child => child.key === menuItem.key)) !== null && _validChildren$find2 !== void 0 ? _validChildren$find2 : menuItem;
|
|
155
|
+
});
|
|
156
|
+
// This is the case where the viewport is too narrow to show any list item with the more menu. In this case, we only show the dropdown
|
|
157
|
+
const onlyMenuVisible = responsiveProps.items.length === 0;
|
|
41
158
|
useDevOnlyEffect(() => {
|
|
42
159
|
// Address illegal state where there are multiple items that have `aria-current='page'` attribute
|
|
43
|
-
const activeElements = validChildren.filter(child =>
|
|
160
|
+
const activeElements = validChildren.filter(child => {
|
|
161
|
+
return child.props['aria-current'] !== undefined;
|
|
162
|
+
});
|
|
44
163
|
!(activeElements.length <= 1) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Only one current element is allowed') : invariant(false) : void 0;
|
|
45
164
|
!ariaLabel ? process.env.NODE_ENV !== "production" ? invariant(false, 'Use the `aria-label` prop to provide an accessible label for assistive technology') : invariant(false) : void 0;
|
|
46
165
|
}, [validChildren, ariaLabel]);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
166
|
+
function getItemsWidth(itemText) {
|
|
167
|
+
var _noIconChildWidthArra, _noIconChildWidthArra2;
|
|
168
|
+
return (_noIconChildWidthArra = (_noIconChildWidthArra2 = noIconChildWidthArray.find(item => item.text === itemText)) === null || _noIconChildWidthArra2 === void 0 ? void 0 : _noIconChildWidthArra2.width) !== null && _noIconChildWidthArra !== void 0 ? _noIconChildWidthArra : 0;
|
|
169
|
+
}
|
|
170
|
+
const swapMenuItemWithListItem = (prospectiveListItem, indexOfProspectiveListItem, event, callback) => {
|
|
171
|
+
var _navRef$current$getBo, _navRef$current, _listRef$current$getB, _listRef$current;
|
|
172
|
+
// get the selected menu item's width
|
|
173
|
+
const widthToFitIntoList = getItemsWidth(prospectiveListItem.props.children);
|
|
174
|
+
// Check if there is any empty space on the right side of the list
|
|
175
|
+
const availableSpace = ((_navRef$current$getBo = (_navRef$current = navRef.current) === null || _navRef$current === void 0 ? void 0 : _navRef$current.getBoundingClientRect().width) !== null && _navRef$current$getBo !== void 0 ? _navRef$current$getBo : 0) - ((_listRef$current$getB = (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.getBoundingClientRect().width) !== null && _listRef$current$getB !== void 0 ? _listRef$current$getB : 0);
|
|
51
176
|
|
|
52
|
-
|
|
53
|
-
|
|
177
|
+
// Calculate how many items need to be pulled in to the menu to make room for the selected menu item
|
|
178
|
+
// I.e. if we need to pull 2 items in (index 0 and index 1), breakpoint (index) will return 1.
|
|
179
|
+
const index = getBreakpointForItemSwapping(widthToFitIntoList, availableSpace);
|
|
180
|
+
const indexToSliceAt = responsiveProps.items.length - 1 - index;
|
|
181
|
+
// Form the new list of items
|
|
182
|
+
const itemsLeftInList = [...responsiveProps.items].slice(0, indexToSliceAt);
|
|
183
|
+
const updatedItemList = [...itemsLeftInList, prospectiveListItem];
|
|
184
|
+
// Form the new menu items
|
|
185
|
+
const itemsToAddToMenu = [...responsiveProps.items].slice(indexToSliceAt);
|
|
186
|
+
const updatedMenuItems = [...menuItems];
|
|
187
|
+
// Add itemsToAddToMenu array's items to the menu at the index of the prospectiveListItem and remove 1 count of items (prospectiveListItem)
|
|
188
|
+
updatedMenuItems.splice(indexOfProspectiveListItem, 1, ...itemsToAddToMenu);
|
|
189
|
+
callback({
|
|
190
|
+
items: updatedItemList,
|
|
191
|
+
menuItems: updatedMenuItems
|
|
192
|
+
}, false, true);
|
|
193
|
+
};
|
|
194
|
+
// How many items do we need to pull in to the menu to make room for the selected menu item.
|
|
195
|
+
function getBreakpointForItemSwapping(widthToFitIntoList, availableSpace) {
|
|
196
|
+
let widthToSwap = 0;
|
|
197
|
+
let breakpoint = 0;
|
|
198
|
+
for (const [index, item] of [...responsiveProps.items].reverse().entries()) {
|
|
199
|
+
widthToSwap += getItemsWidth(item.props.children);
|
|
200
|
+
if (widthToFitIntoList < widthToSwap + availableSpace) {
|
|
201
|
+
breakpoint = index;
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return breakpoint;
|
|
206
|
+
}
|
|
207
|
+
const updateListAndMenu = useCallback((props, displayIcons, overflowMeasured) => {
|
|
208
|
+
setResponsiveProps(props);
|
|
209
|
+
setIconsVisible(displayIcons);
|
|
210
|
+
if (overflowMeasured) {
|
|
211
|
+
setIsOverflowMeasured(true);
|
|
212
|
+
}
|
|
213
|
+
}, []);
|
|
214
|
+
const setChildrenWidth = useCallback(size => {
|
|
215
|
+
setChildWidthArray(arr => {
|
|
216
|
+
const newArr = [...arr, size];
|
|
217
|
+
return newArr;
|
|
218
|
+
});
|
|
219
|
+
}, []);
|
|
220
|
+
const setNoIconChildrenWidth = useCallback(size => {
|
|
221
|
+
setNoIconChildWidthArray(arr => {
|
|
222
|
+
const newArr = [...arr, size];
|
|
223
|
+
return newArr;
|
|
224
|
+
});
|
|
225
|
+
}, []);
|
|
226
|
+
const closeOverlay = React.useCallback(() => {
|
|
227
|
+
setIsWidgetOpen(false);
|
|
228
|
+
}, [setIsWidgetOpen]);
|
|
229
|
+
const focusOnMoreMenuBtn = React.useCallback(() => {
|
|
230
|
+
var _moreMenuBtnRef$curre;
|
|
231
|
+
(_moreMenuBtnRef$curre = moreMenuBtnRef.current) === null || _moreMenuBtnRef$curre === void 0 ? void 0 : _moreMenuBtnRef$curre.focus();
|
|
232
|
+
}, []);
|
|
233
|
+
const onAnchorClick = useCallback(event => {
|
|
234
|
+
if (event.defaultPrevented || event.button !== 0) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
setIsWidgetOpen(isWidgetOpen => !isWidgetOpen);
|
|
238
|
+
}, []);
|
|
239
|
+
useOnEscapePress(event => {
|
|
240
|
+
if (isWidgetOpen) {
|
|
241
|
+
event.preventDefault();
|
|
242
|
+
closeOverlay();
|
|
243
|
+
focusOnMoreMenuBtn();
|
|
244
|
+
}
|
|
245
|
+
}, [isWidgetOpen]);
|
|
246
|
+
useOnOutsideClick({
|
|
247
|
+
onClickOutside: closeOverlay,
|
|
248
|
+
containerRef,
|
|
249
|
+
ignoreClickRefs: [moreMenuBtnRef]
|
|
250
|
+
});
|
|
251
|
+
useResizeObserver(resizeObserverEntries => {
|
|
252
|
+
var _moreMenuRef$current$, _moreMenuRef$current;
|
|
253
|
+
const navWidth = resizeObserverEntries[0].contentRect.width;
|
|
254
|
+
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;
|
|
255
|
+
navWidth !== 0 && overflowEffect(navWidth, moreMenuWidth, validChildren, childWidthArray, noIconChildWidthArray, updateListAndMenu);
|
|
256
|
+
}, navRef);
|
|
257
|
+
|
|
258
|
+
// Compute menuInlineStyles if needed
|
|
259
|
+
let menuInlineStyles = {
|
|
260
|
+
...baseMenuInlineStyles
|
|
261
|
+
};
|
|
262
|
+
if (containerRef.current && listRef.current) {
|
|
263
|
+
const {
|
|
264
|
+
left
|
|
265
|
+
} = getAnchoredPosition(containerRef.current, listRef.current, {
|
|
266
|
+
align: 'start',
|
|
267
|
+
side: 'outside-bottom'
|
|
268
|
+
});
|
|
269
|
+
menuInlineStyles = {
|
|
270
|
+
...baseMenuInlineStyles,
|
|
271
|
+
right: undefined,
|
|
272
|
+
left
|
|
273
|
+
};
|
|
274
|
+
}
|
|
54
275
|
return /*#__PURE__*/jsxs(UnderlineNavContext.Provider, {
|
|
55
|
-
value:
|
|
276
|
+
value: {
|
|
277
|
+
setChildrenWidth,
|
|
278
|
+
setNoIconChildrenWidth,
|
|
279
|
+
loadingCounters,
|
|
280
|
+
iconsVisible
|
|
281
|
+
},
|
|
56
282
|
children: [ariaLabel && /*#__PURE__*/jsx(VisuallyHidden, {
|
|
57
283
|
as: "h2",
|
|
58
284
|
children: `${ariaLabel} navigation`
|
|
59
|
-
}), /*#__PURE__*/
|
|
285
|
+
}), /*#__PURE__*/jsx(UnderlineWrapper, {
|
|
60
286
|
as: as,
|
|
61
287
|
"aria-label": ariaLabel,
|
|
62
|
-
className:
|
|
288
|
+
className: className,
|
|
63
289
|
ref: navRef,
|
|
64
290
|
"data-variant": variant,
|
|
65
|
-
"data-overflow-
|
|
66
|
-
|
|
67
|
-
,
|
|
68
|
-
"data-hide-icons": hasEverOverflowed ? 'true' : undefined
|
|
69
|
-
// Ensure button is shown (after initial render) on browsers that don't support scroll-driven animations
|
|
70
|
-
,
|
|
71
|
-
"data-has-overflow": isOverflowing ? 'true' : undefined,
|
|
72
|
-
children: [/*#__PURE__*/jsx(UnderlineItemList, {
|
|
291
|
+
"data-overflow-measured": isOverflowMeasured ? 'true' : 'false',
|
|
292
|
+
children: /*#__PURE__*/jsxs(UnderlineItemList, {
|
|
73
293
|
ref: listRef,
|
|
74
294
|
role: "list",
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
onOpenChange: setMenuOpen,
|
|
87
|
-
children: [/*#__PURE__*/jsx(ActionMenu.Button, {
|
|
295
|
+
children: [listItems, menuItems.length > 0 && /*#__PURE__*/jsxs("li", {
|
|
296
|
+
ref: moreMenuRef,
|
|
297
|
+
style: {
|
|
298
|
+
display: 'flex',
|
|
299
|
+
alignItems: 'center',
|
|
300
|
+
height: `${MORE_BTN_HEIGHT}px`
|
|
301
|
+
},
|
|
302
|
+
children: [!onlyMenuVisible && /*#__PURE__*/jsx("div", {
|
|
303
|
+
style: dividerStyles
|
|
304
|
+
}), /*#__PURE__*/jsx(ButtonComponent, {
|
|
305
|
+
ref: moreMenuBtnRef,
|
|
88
306
|
className: classes.MoreButton,
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
children: /*#__PURE__*/
|
|
94
|
-
children:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
307
|
+
"aria-controls": disclosureWidgetId,
|
|
308
|
+
"aria-expanded": isWidgetOpen,
|
|
309
|
+
onClick: onAnchorClick,
|
|
310
|
+
trailingAction: TriangleDownIcon,
|
|
311
|
+
children: /*#__PURE__*/jsx("span", {
|
|
312
|
+
children: onlyMenuVisible ? /*#__PURE__*/jsxs(Fragment, {
|
|
313
|
+
children: [/*#__PURE__*/jsxs(VisuallyHidden, {
|
|
314
|
+
as: "span",
|
|
315
|
+
children: [`${ariaLabel}`, "\xA0"]
|
|
316
|
+
}), "Menu"]
|
|
317
|
+
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
318
|
+
children: ["More", /*#__PURE__*/jsxs(VisuallyHidden, {
|
|
319
|
+
as: "span",
|
|
320
|
+
children: ["\xA0", `${ariaLabel} items`]
|
|
321
|
+
})]
|
|
322
|
+
})
|
|
98
323
|
})
|
|
99
|
-
}), /*#__PURE__*/jsx(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
324
|
+
}), /*#__PURE__*/jsx(ActionList, {
|
|
325
|
+
selectionVariant: "single",
|
|
326
|
+
ref: containerRef,
|
|
327
|
+
id: disclosureWidgetId,
|
|
328
|
+
style: {
|
|
329
|
+
...((_listRef$current2 = listRef.current) !== null && _listRef$current2 !== void 0 && _listRef$current2.clientWidth && listRef.current.clientWidth >= baseMenuMinWidth ? baseMenuInlineStyles : menuInlineStyles),
|
|
330
|
+
display: isWidgetOpen ? 'block' : 'none'
|
|
331
|
+
},
|
|
332
|
+
children: menuItems.map((menuItem, index) => {
|
|
333
|
+
const {
|
|
334
|
+
children: menuItemChildren,
|
|
335
|
+
counter,
|
|
336
|
+
'aria-current': ariaCurrent,
|
|
337
|
+
onSelect,
|
|
338
|
+
...menuItemProps
|
|
339
|
+
} = menuItem.props;
|
|
340
|
+
|
|
341
|
+
// This logic is used to pop the selected item out of the menu and into the list when the navigation is control externally
|
|
342
|
+
if (Boolean(ariaCurrent) && ariaCurrent !== 'false') {
|
|
343
|
+
const event = new MouseEvent('click');
|
|
344
|
+
!onlyMenuVisible && swapMenuItemWithListItem(menuItem, index,
|
|
345
|
+
// @ts-ignore - not a big deal because it is internally creating an event but ask help
|
|
346
|
+
event, updateListAndMenu);
|
|
347
|
+
}
|
|
348
|
+
return /*#__PURE__*/jsx(ActionList.LinkItem, {
|
|
349
|
+
style: menuItemStyles,
|
|
350
|
+
onClick: event => {
|
|
351
|
+
// When there are no items in the list, do not run the swap function as we want to keep everything in the menu.
|
|
352
|
+
!onlyMenuVisible && swapMenuItemWithListItem(menuItem, index, event, updateListAndMenu);
|
|
353
|
+
closeOverlay();
|
|
354
|
+
focusOnMoreMenuBtn();
|
|
355
|
+
// fire onSelect event that comes from the UnderlineNav.Item (if it is defined)
|
|
356
|
+
typeof onSelect === 'function' && onSelect(event);
|
|
357
|
+
},
|
|
358
|
+
...menuItemProps,
|
|
359
|
+
children: /*#__PURE__*/jsxs("span", {
|
|
360
|
+
className: classes.MenuItemContent,
|
|
361
|
+
children: [menuItemChildren, loadingCounters ? /*#__PURE__*/jsx(LoadingCounter, {}) : counter !== undefined && /*#__PURE__*/jsx("span", {
|
|
362
|
+
"data-component": "counter",
|
|
363
|
+
children: /*#__PURE__*/jsx(CounterLabel, {
|
|
364
|
+
children: counter
|
|
125
365
|
})
|
|
126
366
|
})]
|
|
127
|
-
}
|
|
128
|
-
})
|
|
367
|
+
})
|
|
368
|
+
}, menuItemChildren);
|
|
129
369
|
})
|
|
130
370
|
})]
|
|
131
371
|
})]
|
|
132
|
-
})
|
|
372
|
+
})
|
|
133
373
|
})]
|
|
134
374
|
});
|
|
135
375
|
});
|
|
136
376
|
UnderlineNav.displayName = 'UnderlineNav';
|
|
137
377
|
|
|
138
|
-
export { UnderlineNav };
|
|
378
|
+
export { MORE_BTN_WIDTH, UnderlineNav };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './UnderlineNav-
|
|
1
|
+
import './UnderlineNav-4344d9b0.css';
|
|
2
2
|
|
|
3
|
-
var classes = {"
|
|
3
|
+
var classes = {"MenuItemContent":"prc-UnderlineNav-MenuItemContent-3J7gB","MoreButton":"prc-UnderlineNav-MoreButton-Y8soj"};
|
|
4
4
|
|
|
5
5
|
export { classes as default };
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare const UnderlineNavContext: React.Context<{
|
|
3
|
+
setChildrenWidth: React.Dispatch<{
|
|
4
|
+
text: string;
|
|
5
|
+
width: number;
|
|
6
|
+
}>;
|
|
7
|
+
setNoIconChildrenWidth: React.Dispatch<{
|
|
8
|
+
text: string;
|
|
9
|
+
width: number;
|
|
10
|
+
}>;
|
|
2
11
|
loadingCounters: boolean;
|
|
12
|
+
iconsVisible: boolean;
|
|
3
13
|
}>;
|
|
4
14
|
//# sourceMappingURL=UnderlineNavContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineNavContext.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UnderlineNavContext.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,eAAO,MAAM,mBAAmB;sBACZ,KAAK,CAAC,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;4BACvC,KAAK,CAAC,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;qBACpD,OAAO;kBACV,OAAO;EAMrB,CAAA"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
2
|
|
|
3
3
|
const UnderlineNavContext = /*#__PURE__*/createContext({
|
|
4
|
-
|
|
4
|
+
setChildrenWidth: () => null,
|
|
5
|
+
setNoIconChildrenWidth: () => null,
|
|
6
|
+
loadingCounters: false,
|
|
7
|
+
iconsVisible: true
|
|
5
8
|
});
|
|
6
9
|
|
|
7
10
|
export { UnderlineNavContext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/UnderlineNav/UnderlineNavItem.module.css.js"],"names":[],"mappings":"AAAA,yCAGE,kBAAmB,CAFnB,YAAa,CACb,qBAEF","file":"UnderlineNavItem-b65e8fd3.css","sourcesContent":[".UnderlineNavItem {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { IconProps } from '@primer/octicons-react';
|
|
2
3
|
import type { ForwardRefComponent as PolymorphicForwardRefComponent } from '../utils/polymorphic';
|
|
3
|
-
import { type UnderlineNavItemProps } from './UnderlineNavItemsRegistry';
|
|
4
4
|
export type LinkProps = {
|
|
5
5
|
download?: string;
|
|
6
6
|
href?: string;
|
|
@@ -12,5 +12,36 @@ export type LinkProps = {
|
|
|
12
12
|
type?: string;
|
|
13
13
|
referrerPolicy?: React.AnchorHTMLAttributes<HTMLAnchorElement>['referrerPolicy'];
|
|
14
14
|
};
|
|
15
|
+
export type UnderlineNavItemProps = {
|
|
16
|
+
/**
|
|
17
|
+
* Primary content for an UnderlineNav
|
|
18
|
+
*/
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Callback that will trigger both on click selection and keyboard selection.
|
|
22
|
+
*/
|
|
23
|
+
onSelect?: (event: React.MouseEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLAnchorElement>) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Is `UnderlineNav.Item` current page?
|
|
26
|
+
*/
|
|
27
|
+
'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false' | boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Icon before the text
|
|
30
|
+
* @deprecated Use the `leadingVisual` prop instead
|
|
31
|
+
*/
|
|
32
|
+
icon?: React.FunctionComponent<IconProps> | React.ReactElement<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Render a visual before the text
|
|
35
|
+
*/
|
|
36
|
+
leadingVisual?: React.ReactElement;
|
|
37
|
+
/**
|
|
38
|
+
* Renders `UnderlineNav.Item` as given component i.e. react-router's Link
|
|
39
|
+
**/
|
|
40
|
+
as?: React.ElementType | 'a';
|
|
41
|
+
/**
|
|
42
|
+
* Counter
|
|
43
|
+
*/
|
|
44
|
+
counter?: number | string;
|
|
45
|
+
} & LinkProps;
|
|
15
46
|
export declare const UnderlineNavItem: PolymorphicForwardRefComponent<"a", UnderlineNavItemProps>;
|
|
16
47
|
//# sourceMappingURL=UnderlineNavItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineNavItem.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UnderlineNavItem.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAC3D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAO/F,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,gBAAgB,CAAC,CAAA;CACjF,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAExG;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;IAE5F;;;OAGG;IAEH,IAAI,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAEnE;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IAElC;;QAEI;IACJ,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,GAAG,CAAA;IAE5B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC1B,GAAG,SAAS,CAAA;AAEb,eAAO,MAAM,gBAAgB,EAgFxB,8BAA8B,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAA"}
|