@codecademy/brand 1.1.0-alpha.5e1469da84.0 → 1.1.0-alpha.6efa8b9b8d.0
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/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/index.js +2 -2
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdown/index.js +26 -56
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/AppHeaderDropdownLink.js +0 -1
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/AppHeaderMenuItem.js +0 -1
- package/dist/AppHeader/AppHeaderElements/AppHeaderLink/index.d.ts +8 -16
- package/dist/AppHeader/AppHeaderElements/AppHeaderLink/index.js +21 -23
- package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.d.ts +6 -1
- package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.js +73 -24
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/AppHeaderDropdownNavButton.d.ts +2 -12
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/AppHeaderDropdownNavButton.js +5 -22
- package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesDropdown/index.js +2 -2
- package/dist/AppHeader/index.d.ts +12 -5
- package/dist/AppHeader/index.js +92 -12
- package/dist/AppHeader/shared/elements.d.ts +1 -17
- package/dist/AppHeader/shared/elements.js +22 -47
- package/dist/AppHeader/shared/types.d.ts +2 -5
- package/dist/AppHeaderMobile/AppHeaderMainMenuMobile/index.js +2 -3
- package/dist/AppHeaderMobile/AppHeaderSubMenuMobile/elements.js +1 -2
- package/dist/AppHeaderMobile/AppHeaderSubMenuMobile/index.js +4 -9
- package/dist/AppHeaderMobile/index.js +6 -15
- package/dist/LogoFromSkillsoft/index.d.ts +5 -4
- package/dist/LogoFromSkillsoft/index.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/stories/Molecules/AppHeader/AppHeader.stories.js +1 -24
- package/dist/stories/Molecules/AppHeader/AppHeaderDropdown.stories.js +0 -2
- package/dist/stories/Organisms/GlobalFooter.stories.js +1 -4
- package/dist/stories/Organisms/GlobalHeader/About.stories.js +0 -3
- package/dist/stories/Organisms/GlobalHeader/Anon.stories.js +0 -3
- package/dist/stories/Organisms/GlobalHeader/Bootcamp.stories.js +0 -3
- package/dist/stories/Organisms/GlobalHeader/Enterprise.stories.js +0 -3
- package/dist/stories/Organisms/GlobalHeader/Free.stories.js +0 -3
- package/dist/stories/Organisms/GlobalHeader/Pro.stories.js +0 -3
- package/dist/stories/Organisms/GlobalHeader/Simple.stories.js +0 -3
- package/dist/stories/Organisms/GlobalPage.stories.js +0 -3
- package/package.json +1 -1
- package/dist/AppHeader/shared/utils.d.ts +0 -14
- package/dist/AppHeader/shared/utils.js +0 -76
- package/dist/LogoLXStudio/index.d.ts +0 -3
- package/dist/LogoLXStudio/index.js +0 -48
- package/dist/stories/Atoms/Logos/LogoLXStudio.stories.d.ts +0 -6
- package/dist/stories/Atoms/Logos/LogoLXStudio.stories.js +0 -11
- package/dist/stories/Molecules/AppHeader/LXStudioHeader.stories.d.ts +0 -6
- package/dist/stories/Molecules/AppHeader/LXStudioHeader.stories.js +0 -93
- package/dist/stories/Molecules/AppHeader/LXStudioMobileHeader.stories.d.ts +0 -6
- package/dist/stories/Molecules/AppHeader/LXStudioMobileHeader.stories.js +0 -83
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { StyledDropdown } from '../../shared';
|
|
4
4
|
import { AppHeaderCatalogSection } from '../AppHeaderCatalogSection';
|
|
5
5
|
import { AppHeaderDropdownProvider } from '../AppHeaderDropdownProvider';
|
|
6
6
|
import { AppHeaderDropdownNavButton } from '../AppHeaderNavButton/AppHeaderDropdownNavButton';
|
|
@@ -67,7 +67,7 @@ export const AppHeaderCatalogDropdown = _ref => {
|
|
|
67
67
|
handleOnClick: handleOnClick,
|
|
68
68
|
isOpen: isOpen,
|
|
69
69
|
title: text
|
|
70
|
-
}), /*#__PURE__*/_jsx(
|
|
70
|
+
}), /*#__PURE__*/_jsx(StyledDropdown, {
|
|
71
71
|
style: {
|
|
72
72
|
top: '3.5rem',
|
|
73
73
|
minWidth: '64rem',
|
|
@@ -1,45 +1,28 @@
|
|
|
1
1
|
import _styled from "@emotion/styled/base";
|
|
2
|
-
import { Menu } from '@codecademy/gamut';
|
|
3
2
|
import { css } from '@codecademy/gamut-styles';
|
|
4
|
-
import { useCallback, useEffect,
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
4
|
import * as React from 'react';
|
|
6
5
|
import { useIsomorphicLayoutEffect } from 'react-use';
|
|
7
|
-
import {
|
|
6
|
+
import { StyledDropdown } from '../../shared';
|
|
8
7
|
import { AppHeaderDropdownProvider } from '../AppHeaderDropdownProvider';
|
|
9
8
|
import { AppHeaderLinkSections } from '../AppHeaderLinkSections';
|
|
10
9
|
import { AppHeaderMenuProvider } from '../AppHeaderMenuProvider';
|
|
11
10
|
import { AppHeaderNavButton } from '../AppHeaderNavButton';
|
|
12
11
|
import { useAppHeaderContext } from '../AppHeaderProvider';
|
|
13
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
const topSpacing = {
|
|
15
|
-
lg: '3.2rem',
|
|
16
|
-
md: '2.75rem',
|
|
17
|
-
sm: '2.25rem'
|
|
18
|
-
};
|
|
19
|
-
const getSpacing = _ref => {
|
|
20
|
-
let {
|
|
21
|
-
isProfileDropdown,
|
|
22
|
-
isGenericDropdown,
|
|
23
|
-
isIconDropdown,
|
|
24
|
-
isStandalone
|
|
25
|
-
} = _ref;
|
|
26
|
-
if (isProfileDropdown || isIconDropdown) return topSpacing.lg;
|
|
27
|
-
if (isGenericDropdown && isStandalone) return topSpacing.md;
|
|
28
|
-
return topSpacing.sm;
|
|
29
|
-
};
|
|
30
13
|
const StyledLinkSection = /*#__PURE__*/_styled(AppHeaderLinkSections, {
|
|
31
14
|
target: "efmcgmc0",
|
|
32
15
|
label: "StyledLinkSection"
|
|
33
16
|
})(css({
|
|
34
17
|
padding: `0.75rem 0`,
|
|
35
18
|
position: `absolute`
|
|
36
|
-
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
37
|
-
export const AppHeaderDropdown =
|
|
19
|
+
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9BcHBIZWFkZXIvQXBwSGVhZGVyRWxlbWVudHMvQXBwSGVhZGVyRHJvcGRvd24vaW5kZXgudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWlCMEIiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjL0FwcEhlYWRlci9BcHBIZWFkZXJFbGVtZW50cy9BcHBIZWFkZXJEcm9wZG93bi9pbmRleC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tICdAY29kZWNhZGVteS9nYW11dC1zdHlsZXMnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgdXNlQ2FsbGJhY2ssIHVzZUVmZmVjdCwgdXNlUmVmLCB1c2VTdGF0ZSB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCAqIGFzIFJlYWN0IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IHVzZUlzb21vcnBoaWNMYXlvdXRFZmZlY3QgfSBmcm9tICdyZWFjdC11c2UnO1xuXG5pbXBvcnQge1xuICBBcHBIZWFkZXJBY3Rpb24sXG4gIEFwcEhlYWRlckRyb3Bkb3duSXRlbSxcbiAgU3R5bGVkRHJvcGRvd24sXG59IGZ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XG4gICAgICAgIGlzT3Blbj17aXNPcGVufVxuICAgICAgICBpdGVtPXtpdGVtfVxuICAgICAgLz5cbiAgICAgIDxTdHlsZWREcm9wZG93blxuICAgICAgICBzdHlsZT17e1xuICAgICAgICAgIHJpZ2h0OiBpc1Byb2ZpbGVEcm9wZG93biA/ICcwLjVyZW0nIDogJycsXG4gICAgICAgICAgdG9wOiBpc1Byb2ZpbGVEcm9wZG93biA/ICcyLjc1cmVtJyA6ICcyLjI1cmVtJyxcbiAgICAgICAgICB3aWR0aDogZGltZW5zaW9ucy53aWR0aCxcbiAgICAgICAgfX1cbiAgICAgICAgaW5pdGlhbD17eyBib3JkZXJXaWR0aDogMCwgaGVpZ2h0OiAwIH19XG4gICAgICAgIGFuaW1hdGU9e3tcbiAgICAgICAgICBib3JkZXJXaWR0aDogaXNPcGVuID8gMSA6IDAsXG4gICAgICAgICAgaGVpZ2h0OiBpc09wZW4gPyBkaW1lbnNpb25zLmhlaWdodCA6IDAsXG4gICAgICAgIH19XG4gICAgICAgIHRyYW5zaXRpb249e3sgZHVyYXRpb246IDAuMTc1IH19XG4gICAgICAgIGFyaWEtaGlkZGVuPXshaXNPcGVufVxuICAgICAgPlxuICAgICAgICA8U3R5bGVkTGlua1NlY3Rpb25cbiAgICAgICAgICBzdGFuZGFsb25lPXtzdGFuZGFsb25lfVxuICAgICAgICAgIGFjdGlvbj17YWN0aW9ufVxuICAgICAgICAgIGl0ZW09e2l0ZW19XG4gICAgICAgICAgcmVmPXtsaXN0UmVmfVxuICAgICAgICAgIGlkPXtgbWVudS1jb250YWluZXIke2l0ZW0udGV4dH1gfVxuICAgICAgICAgIHNob3dJY29uPXsoaXNQcm9maWxlRHJvcGRvd24gfHwgaXNHZW5lcmljRHJvcGRvd24pID8/IG51bGx9XG4gICAgICAgICAgYXJpYS1jb250cm9scz17YG1lbnUtY29udGFpbmVyJHtpdGVtLnRleHR9YH1cbiAgICAgICAgICBhcmlhLWxhYmVsPXtpdGVtLnRleHR9XG4gICAgICAgICAgYXJpYS1oaWRkZW49eyFpc09wZW59XG4gICAgICAgICAgdGFiSW5kZXg9e3RhYkluZGV4fVxuICAgICAgICAvPlxuICAgICAgPC9TdHlsZWREcm9wZG93bj5cbiAgICA8L1Byb3ZpZGVyPlxuICApO1xufTtcbiJdfQ== */");
|
|
20
|
+
export const AppHeaderDropdown = _ref => {
|
|
38
21
|
let {
|
|
39
22
|
action,
|
|
40
23
|
item,
|
|
41
24
|
standalone
|
|
42
|
-
} =
|
|
25
|
+
} = _ref;
|
|
43
26
|
const listRef = useRef(null);
|
|
44
27
|
const buttonRef = useRef(null);
|
|
45
28
|
const [dimensions, setDimensions] = useState({
|
|
@@ -57,13 +40,13 @@ export const AppHeaderDropdown = _ref2 => {
|
|
|
57
40
|
const handleOnClick = event => {
|
|
58
41
|
toggleIsOpen();
|
|
59
42
|
if (!isOpen) {
|
|
60
|
-
|
|
43
|
+
action(event, item);
|
|
61
44
|
if (setLastOpenedDropdown) {
|
|
62
45
|
setLastOpenedDropdown(dropdownId);
|
|
63
46
|
}
|
|
64
47
|
}
|
|
65
48
|
};
|
|
66
|
-
const
|
|
49
|
+
const handleClose = useCallback(() => {
|
|
67
50
|
setIsOpen(false);
|
|
68
51
|
buttonRef.current?.focus();
|
|
69
52
|
}, []);
|
|
@@ -90,7 +73,7 @@ export const AppHeaderDropdown = _ref2 => {
|
|
|
90
73
|
const list = listRef?.current;
|
|
91
74
|
const button = buttonRef?.current;
|
|
92
75
|
if (isOpen && list && !list.contains(event.target) && button && !button.contains(event.target)) {
|
|
93
|
-
|
|
76
|
+
handleClose();
|
|
94
77
|
}
|
|
95
78
|
}
|
|
96
79
|
document.addEventListener('mousedown', handleClickOutside);
|
|
@@ -99,59 +82,46 @@ export const AppHeaderDropdown = _ref2 => {
|
|
|
99
82
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
100
83
|
document.removeEventListener('blur', handleClickOutside);
|
|
101
84
|
};
|
|
102
|
-
}, [listRef, isOpen]);
|
|
85
|
+
}, [listRef, isOpen, handleClose]);
|
|
103
86
|
const isProfileDropdown = item.type === 'profile-dropdown';
|
|
104
87
|
const isGenericDropdown = ['dropdown', 'resources-simple-dropdown'].includes(item.type);
|
|
105
|
-
const isIconDropdown = 'isIconOnly' in item && item.isIconOnly;
|
|
106
88
|
const Provider = isProfileDropdown ? AppHeaderMenuProvider : AppHeaderDropdownProvider;
|
|
107
|
-
const topSpacing = useMemo(() => getSpacing({
|
|
108
|
-
isProfileDropdown,
|
|
109
|
-
isGenericDropdown,
|
|
110
|
-
isIconDropdown,
|
|
111
|
-
isStandalone: standalone
|
|
112
|
-
}), [isProfileDropdown, isGenericDropdown, isIconDropdown, standalone]);
|
|
113
89
|
return /*#__PURE__*/_jsxs(Provider, {
|
|
114
|
-
handleClose:
|
|
90
|
+
handleClose: handleClose,
|
|
115
91
|
children: [/*#__PURE__*/_jsx(AppHeaderNavButton, {
|
|
116
92
|
buttonRef: buttonRef,
|
|
117
93
|
handleOnClick: handleOnClick,
|
|
118
94
|
isOpen: isOpen,
|
|
119
95
|
item: item
|
|
120
|
-
}), /*#__PURE__*/_jsx(
|
|
96
|
+
}), /*#__PURE__*/_jsx(StyledDropdown, {
|
|
121
97
|
style: {
|
|
122
98
|
right: isProfileDropdown ? '0.5rem' : '',
|
|
123
|
-
top:
|
|
99
|
+
top: isProfileDropdown ? '2.75rem' : '2.25rem',
|
|
124
100
|
width: dimensions.width
|
|
125
101
|
},
|
|
126
|
-
animate: {
|
|
127
|
-
height: isOpen ? dimensions.height : 0
|
|
128
|
-
},
|
|
129
102
|
initial: {
|
|
130
103
|
borderWidth: 0,
|
|
131
104
|
height: 0
|
|
132
105
|
},
|
|
106
|
+
animate: {
|
|
107
|
+
borderWidth: isOpen ? 1 : 0,
|
|
108
|
+
height: isOpen ? dimensions.height : 0
|
|
109
|
+
},
|
|
133
110
|
transition: {
|
|
134
111
|
duration: 0.175
|
|
135
112
|
},
|
|
136
113
|
"aria-hidden": !isOpen,
|
|
137
|
-
children: /*#__PURE__*/_jsx(
|
|
138
|
-
|
|
114
|
+
children: /*#__PURE__*/_jsx(StyledLinkSection, {
|
|
115
|
+
standalone: standalone,
|
|
116
|
+
action: action,
|
|
117
|
+
item: item,
|
|
139
118
|
ref: listRef,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
action: action,
|
|
147
|
-
item: item,
|
|
148
|
-
id: `menu-container${item.text}`,
|
|
149
|
-
showIcon: (isProfileDropdown || isGenericDropdown) ?? null,
|
|
150
|
-
"aria-controls": `menu-container${item.text}`,
|
|
151
|
-
"aria-label": item.text,
|
|
152
|
-
"aria-hidden": !isOpen,
|
|
153
|
-
tabIndex: tabIndex
|
|
154
|
-
})
|
|
119
|
+
id: `menu-container${item.text}`,
|
|
120
|
+
showIcon: (isProfileDropdown || isGenericDropdown) ?? null,
|
|
121
|
+
"aria-controls": `menu-container${item.text}`,
|
|
122
|
+
"aria-label": item.text,
|
|
123
|
+
"aria-hidden": !isOpen,
|
|
124
|
+
tabIndex: tabIndex
|
|
155
125
|
})
|
|
156
126
|
})]
|
|
157
127
|
});
|
|
@@ -2,23 +2,19 @@ import { Anchor } from '@codecademy/gamut';
|
|
|
2
2
|
import React, { ComponentProps } from 'react';
|
|
3
3
|
import { AppHeaderAction, AppHeaderLinkItem } from '../../shared';
|
|
4
4
|
export type AppHeaderLinkProps = ComponentProps<typeof Anchor> & AppHeaderAction & {
|
|
5
|
-
isInDropdown?: boolean;
|
|
6
5
|
item: AppHeaderLinkItem;
|
|
7
|
-
|
|
8
|
-
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
9
|
-
role?: React.AriaRole;
|
|
6
|
+
role?: string;
|
|
10
7
|
showIcon?: boolean;
|
|
8
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
11
9
|
};
|
|
12
10
|
export declare const AppHeaderLink: React.ForwardRefExoticComponent<(Omit<Omit<Partial<import("@codecademy/gamut/dist/helpers").AppendedIconProps> & {
|
|
13
11
|
theme?: import("@emotion/react").Theme | undefined;
|
|
14
12
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
15
13
|
} & import("@codecademy/gamut").AnchorProps & Pick<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "onClick" | "href" | "slot" | "style" | "title" | "children" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "media" | "target" | "type" | keyof React.ClassAttributes<HTMLAnchorElement> | "download" | "hrefLang" | "ping" | "referrerPolicy">, "ref"> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement> & AppHeaderAction & {
|
|
16
|
-
isInDropdown?: boolean;
|
|
17
14
|
item: AppHeaderLinkItem;
|
|
18
|
-
|
|
19
|
-
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
20
|
-
role?: React.AriaRole;
|
|
15
|
+
role?: string;
|
|
21
16
|
showIcon?: boolean;
|
|
17
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
22
18
|
}, "ref"> | Omit<Omit<Partial<import("@codecademy/gamut/dist/helpers").AppendedIconProps> & {
|
|
23
19
|
theme?: import("@emotion/react").Theme | undefined;
|
|
24
20
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
@@ -28,12 +24,10 @@ export declare const AppHeaderLink: React.ForwardRefExoticComponent<(Omit<Omit<P
|
|
|
28
24
|
} & {
|
|
29
25
|
theme?: import("@emotion/react").Theme | undefined;
|
|
30
26
|
} & Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "onClick" | "slot" | "style" | "title" | "children" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "type" | "form" | "name" | "disabled" | keyof React.ClassAttributes<HTMLButtonElement> | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value">, "ref"> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement> & AppHeaderAction & {
|
|
31
|
-
isInDropdown?: boolean;
|
|
32
27
|
item: AppHeaderLinkItem;
|
|
33
|
-
|
|
34
|
-
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
35
|
-
role?: React.AriaRole;
|
|
28
|
+
role?: string;
|
|
36
29
|
showIcon?: boolean;
|
|
30
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
37
31
|
}, "ref"> | Omit<Omit<Partial<import("@codecademy/gamut/dist/helpers").AppendedIconProps> & {
|
|
38
32
|
theme?: import("@emotion/react").Theme | undefined;
|
|
39
33
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
@@ -43,10 +37,8 @@ export declare const AppHeaderLink: React.ForwardRefExoticComponent<(Omit<Omit<P
|
|
|
43
37
|
} & {
|
|
44
38
|
theme?: import("@emotion/react").Theme | undefined;
|
|
45
39
|
} & Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "onClick" | "slot" | "style" | "title" | "children" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "type" | "form" | "name" | "disabled" | keyof React.ClassAttributes<HTMLButtonElement> | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value"> & Pick<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "onClick" | "href" | "slot" | "style" | "title" | "children" | "onAnimationStart" | "onDragStart" | "onDragEnd" | "onDrag" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "media" | "target" | "type" | keyof React.ClassAttributes<HTMLAnchorElement> | "download" | "hrefLang" | "ping" | "referrerPolicy">, "ref"> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement> & AppHeaderAction & {
|
|
46
|
-
isInDropdown?: boolean;
|
|
47
40
|
item: AppHeaderLinkItem;
|
|
48
|
-
|
|
49
|
-
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
50
|
-
role?: React.AriaRole;
|
|
41
|
+
role?: string;
|
|
51
42
|
showIcon?: boolean;
|
|
43
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
52
44
|
}, "ref">) & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _styled from "@emotion/styled/base";
|
|
2
|
-
import { Anchor,
|
|
2
|
+
import { Anchor, Text } from '@codecademy/gamut';
|
|
3
3
|
import { MiniOpenIcon } from '@codecademy/gamut-icons';
|
|
4
4
|
import { css } from '@codecademy/gamut-styles';
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
6
|
import { appHeaderMobileBreakpoint } from '../../shared';
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
8
|
const StyledAnchor = /*#__PURE__*/_styled(Anchor, {
|
|
9
|
-
target: "
|
|
9
|
+
target: "eey89861",
|
|
10
10
|
label: "StyledAnchor"
|
|
11
11
|
})(css({
|
|
12
12
|
alignContent: 'center',
|
|
@@ -17,13 +17,7 @@ const StyledAnchor = /*#__PURE__*/_styled(Anchor, {
|
|
|
17
17
|
minWidth: '0',
|
|
18
18
|
textAlign: 'left',
|
|
19
19
|
whiteSpace: 'nowrap'
|
|
20
|
-
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
21
|
-
const StyledMenuItem = /*#__PURE__*/_styled(MenuItem, {
|
|
22
|
-
target: "eey89861",
|
|
23
|
-
label: "StyledMenuItem"
|
|
24
|
-
})(css({
|
|
25
|
-
whiteSpace: 'nowrap'
|
|
26
|
-
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9BcHBIZWFkZXIvQXBwSGVhZGVyRWxlbWVudHMvQXBwSGVhZGVyTGluay9pbmRleC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBbUN1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMvQXBwSGVhZGVyL0FwcEhlYWRlckVsZW1lbnRzL0FwcEhlYWRlckxpbmsvaW5kZXgudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQW5jaG9yLCBNZW51SXRlbSwgVGV4dCB9IGZyb20gJ0Bjb2RlY2FkZW15L2dhbXV0JztcbmltcG9ydCB7IE1pbmlPcGVuSWNvbiB9IGZyb20gJ0Bjb2RlY2FkZW15L2dhbXV0LWljb25zJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0Bjb2RlY2FkZW15L2dhbXV0LXN0eWxlcyc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgUmVhY3QsIHsgQ29tcG9uZW50UHJvcHMsIGZvcndhcmRSZWYgfSBmcm9tICdyZWFjdCc7XG5cbmltcG9ydCB7XG4gIEFwcEhlYWRlckFjdGlvbixcbiAgQXBwSGVhZGVyTGlua0l0ZW0sXG4gIGFwcEhlYWRlck1vYmlsZUJyZWFrcG9pbnQsXG59IGZyb20gJy4uLy4uL3NoYXJlZCc7XG5cbmV4cG9ydCB0eXBlIEFwcEhlYWRlckxpbmtQcm9wcyA9IENvbXB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fVxuICAgICAgICByb2xlPXtyb2xlfVxuICAgICAgICBteD17bXh9XG4gICAgICAgIHB5PXtweX1cbiAgICAgICAgey4uLnByb3BzfVxuICAgICAgICByZWY9e3JlZn1cbiAgICAgICAgaWNvbj17c2hvd0ljb24gJiYgSWNvbiAmJiAhbW9iaWxlID8gSWNvbiA6IHVuZGVmaW5lZH1cbiAgICAgICAgdmFyaWFudD17IWlzSW5Ecm9wZG93biAmJiAnaW50ZXJmYWNlJ31cbiAgICAgID5cbiAgICAgICAge21vYmlsZSAmJiBJY29uICYmIDxJY29uIG1yPXsxNn0gbWI9ezR9IHNpemU9ezI0fSBhcmlhLWhpZGRlbiAvPn1cbiAgICAgICAge2l0ZW0udGV4dH1cbiAgICAgICAge2l0ZW0uYmFkZ2V9XG4gICAgICAgIHtpdGVtLm5ld1RhYiAmJiAoXG4gICAgICAgICAgPFJlc3BvbnNpdmVNaW5pT3Blbkljb24gbWw9ezE2fSBtYj17NH0gc2l6ZT17MTZ9IGFyaWEtaGlkZGVuIC8+XG4gICAgICAgICl9XG4gICAgICAgIHtyb2xlID09PSAnbWVudWl0ZW0nICYmIDxUZXh0IHNjcmVlbnJlYWRlcj4gTGluazwvVGV4dD59XG4gICAgICA8L0l0ZW0+XG4gICAgKTtcbiAgfVxuKTtcbiJdfQ== */");
|
|
20
|
+
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9BcHBIZWFkZXIvQXBwSGVhZGVyRWxlbWVudHMvQXBwSGVhZGVyTGluay9pbmRleC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBb0JxQiIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMvQXBwSGVhZGVyL0FwcEhlYWRlckVsZW1lbnRzL0FwcEhlYWRlckxpbmsvaW5kZXgudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1w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YXJpYW50PVwiaW50ZXJmYWNlXCJcbiAgICAgICAgLy8gbWFrZXMgc3VyZSB0aGlzIGlzIGxldmVsIHdpdGggb3VyIGRyb3Bkb3ducywgd2hpY2ggaGF2ZSBhIDFweCBoZWlnaHQgZGlmZmVyZW50aWFsXG4gICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgICAgIG1iPXt7IF86IDAsIFthcHBIZWFkZXJNb2JpbGVCcmVha3BvaW50XTogMSBhcyBhbnkgfX1cbiAgICAgICAgbXg9e214fVxuICAgICAgICBweT17cHl9XG4gICAgICAgIHJvbGU9e3JvbGV9XG4gICAgICAgIHsuLi5wcm9wc31cbiAgICAgICAgcmVmPXtyZWZ9XG4gICAgICAgIGFyaWEtbGFiZWw9e2l0ZW0uYXJpYUxhYmVsID8gaXRlbS5hcmlhTGFiZWwgOiBpdGVtLnRleHR9XG4gICAgICA+XG4gICAgICAgIHtzaG93SWNvbiAmJiBJY29uICYmIDxJY29uIG1yPXsxNn0gbWI9ezR9IHNpemU9ezI0fSBhcmlhLWhpZGRlbiAvPn1cbiAgICAgICAge2l0ZW0udGV4dH1cbiAgICAgICAge2l0ZW0uYmFkZ2V9XG4gICAgICAgIHtpdGVtLm5ld1RhYiAmJiAoXG4gICAgICAgICAgPFJlc3BvbnNpdmVNaW5pT3Blbkljb24gbWw9ezE2fSBtYj17NH0gc2l6ZT17MTZ9IGFyaWEtaGlkZGVuIC8+XG4gICAgICAgICl9XG4gICAgICAgIHtyb2xlID09PSAnbWVudWl0ZW0nICYmIDxUZXh0IHNjcmVlbnJlYWRlcj4gTGluazwvVGV4dD59XG4gICAgICA8L1N0eWxlZEFuY2hvcj5cbiAgICApO1xuICB9XG4pO1xuIl19 */");
|
|
27
21
|
const ResponsiveMiniOpenIcon = /*#__PURE__*/_styled(MiniOpenIcon, {
|
|
28
22
|
target: "eey89860",
|
|
29
23
|
label: "ResponsiveMiniOpenIcon"
|
|
@@ -32,40 +26,44 @@ const ResponsiveMiniOpenIcon = /*#__PURE__*/_styled(MiniOpenIcon, {
|
|
|
32
26
|
_: 'block',
|
|
33
27
|
[appHeaderMobileBreakpoint]: 'none'
|
|
34
28
|
}
|
|
35
|
-
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
29
|
+
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9BcHBIZWFkZXIvQXBwSGVhZGVyRWxlbWVudHMvQXBwSGVhZGVyTGluay9pbmRleC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBaUMrQiIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMvQXBwSGVhZGVyL0FwcEhlYWRlckVsZW1lbnRzL0FwcEhlYWRlckxpbmsvaW5kZXgudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQW5jaG9yLCBUZXh0IH0gZnJvbSAnQGNvZGVjYWRlbXkvZ2FtdXQnO1xuaW1wb3J0IHsgTWluaU9wZW5JY29uIH0gZnJvbSAnQGNvZGVjYWRlbXkvZ2FtdXQtaWNvbnMnO1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGNvZGVjYWRlbXkvZ2FtdXQtc3R5bGVzJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCBSZWFjdCwgeyBDb21wb25lbnRQcm9wcywgZm9yd2FyZFJlZiB9IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0IHtcbiAgQXBwSGVhZGVyQWN0aW9uLFxuICBBcHBIZWFkZXJMaW5rSXRlbSxcbiAgYXBwSGVhZGVyTW9iaWxlQnJlYWtwb2ludCxcbn0gZnJvbSAnLi4vLi4vc2hhcmV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sID8gaXRlbS5hcmlhTGFiZWwgOiBpdGVtLnRleHR9XG4gICAgICA+XG4gICAgICAgIHtzaG93SWNvbiAmJiBJY29uICYmIDxJY29uIG1yPXsxNn0gbWI9ezR9IHNpemU9ezI0fSBhcmlhLWhpZGRlbiAvPn1cbiAgICAgICAge2l0ZW0udGV4dH1cbiAgICAgICAge2l0ZW0uYmFkZ2V9XG4gICAgICAgIHtpdGVtLm5ld1RhYiAmJiAoXG4gICAgICAgICAgPFJlc3BvbnNpdmVNaW5pT3Blbkljb24gbWw9ezE2fSBtYj17NH0gc2l6ZT17MTZ9IGFyaWEtaGlkZGVuIC8+XG4gICAgICAgICl9XG4gICAgICAgIHtyb2xlID09PSAnbWVudWl0ZW0nICYmIDxUZXh0IHNjcmVlbnJlYWRlcj4gTGluazwvVGV4dD59XG4gICAgICA8L1N0eWxlZEFuY2hvcj5cbiAgICApO1xuICB9XG4pO1xuIl19 */");
|
|
36
30
|
export const AppHeaderLink = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
37
31
|
let {
|
|
38
32
|
action,
|
|
39
33
|
item,
|
|
40
34
|
showIcon = false,
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
mx = {
|
|
36
|
+
_: 0,
|
|
37
|
+
[appHeaderMobileBreakpoint]: 24
|
|
38
|
+
},
|
|
43
39
|
py = {
|
|
44
40
|
_: 16,
|
|
45
41
|
[appHeaderMobileBreakpoint]: 8
|
|
46
42
|
},
|
|
47
|
-
isInDropdown,
|
|
48
43
|
role,
|
|
49
44
|
...props
|
|
50
45
|
} = _ref;
|
|
51
|
-
const Item = isInDropdown ? StyledMenuItem : StyledAnchor;
|
|
52
46
|
const Icon = item.icon;
|
|
53
|
-
return /*#__PURE__*/_jsxs(
|
|
54
|
-
"aria-label": item.ariaLabel ? item.ariaLabel : item.text,
|
|
47
|
+
return /*#__PURE__*/_jsxs(StyledAnchor, {
|
|
55
48
|
"data-testid": item.dataTestId,
|
|
56
|
-
href: item.href
|
|
57
|
-
// @ts-expect-error - The onClick type for StyledMenuItem is pretty complicated, we are better off expecting an error here for now. Will refactor with new Header work: GM-1025
|
|
58
|
-
,
|
|
49
|
+
href: item.href,
|
|
59
50
|
onClick: event => action(event, item),
|
|
60
51
|
target: item.newTab ? 'blank' : '',
|
|
61
|
-
|
|
52
|
+
variant: "interface"
|
|
53
|
+
// makes sure this is level with our dropdowns, which have a 1px height differential
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
+
,
|
|
56
|
+
mb: {
|
|
57
|
+
_: 0,
|
|
58
|
+
[appHeaderMobileBreakpoint]: 1
|
|
59
|
+
},
|
|
62
60
|
mx: mx,
|
|
63
61
|
py: py,
|
|
62
|
+
role: role,
|
|
64
63
|
...props,
|
|
65
64
|
ref: ref,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
children: [mobile && Icon && /*#__PURE__*/_jsx(Icon, {
|
|
65
|
+
"aria-label": item.ariaLabel ? item.ariaLabel : item.text,
|
|
66
|
+
children: [showIcon && Icon && /*#__PURE__*/_jsx(Icon, {
|
|
69
67
|
mr: 16,
|
|
70
68
|
mb: 4,
|
|
71
69
|
size: 24,
|
|
@@ -11,6 +11,11 @@ export type AppHeaderLinkSectionsProps = AppHeaderAction & {
|
|
|
11
11
|
onFocus?: () => void;
|
|
12
12
|
onBlur?: () => void;
|
|
13
13
|
mobile?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* If true, the link is being rendered as a standalone component, rather than
|
|
16
|
+
* part of the global header.
|
|
17
|
+
*/
|
|
18
|
+
standalone?: boolean;
|
|
14
19
|
tabIndex?: number;
|
|
15
20
|
};
|
|
16
|
-
export declare const AppHeaderLinkSections: React.
|
|
21
|
+
export declare const AppHeaderLinkSections: React.ForwardRefExoticComponent<Omit<AppHeaderLinkSectionsProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
|