@codecademy/brand 3.26.0-alpha.c0e3f304ed.0 → 3.26.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 +6 -28
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/elements.d.ts +8 -46
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdown/index.d.ts +0 -1
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdown/index.js +10 -67
- package/dist/AppHeader/AppHeaderElements/AppHeaderLink/index.d.ts +3 -40
- package/dist/AppHeader/AppHeaderElements/AppHeaderLink/index.js +16 -30
- package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/elements.d.ts +42 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/elements.js +36 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.d.ts +1 -8
- package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.js +32 -25
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/index.d.ts +5 -2
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/index.js +91 -24
- package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesDropdown/index.js +5 -27
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/NavSection.d.ts +2 -2
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/NavSection.js +38 -20
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/elements.js +8 -8
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/index.js +5 -13
- package/dist/AppHeader/AppHeaderElements/AppHeaderSkillTile/index.js +2 -2
- package/dist/AppHeader/shared/elements.d.ts +12 -25
- package/dist/AppHeader/shared/elements.js +126 -26
- package/dist/AppHeader/shared/types.d.ts +1 -1
- package/dist/AppHeader/shared/utils.d.ts +1 -2
- package/dist/AppHeader/shared/utils.js +0 -2
- package/dist/AppHeaderMobile/index.js +2 -3
- package/dist/PlanCard/PricingAmount.js +6 -6
- package/dist/PlanCard/types.d.ts +1 -0
- package/dist/PlanCard/types.js +13 -1
- package/package.json +1 -1
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/AppHeaderDropdownLink.d.ts +0 -3
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/AppHeaderDropdownLink.js +0 -25
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/AppHeaderMenuItem.d.ts +0 -3
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/AppHeaderMenuItem.js +0 -26
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/StyledAppHeaderLink.d.ts +0 -79
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/StyledAppHeaderLink.js +0 -36
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/types.d.ts +0 -4
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/types.js +0 -1
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/index.d.ts +0 -2
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/index.js +0 -2
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/AppHeaderDropdownNavButton.d.ts +0 -18
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/AppHeaderDropdownNavButton.js +0 -50
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/AppHeaderMenuNavButton.d.ts +0 -9
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/AppHeaderMenuNavButton.js +0 -38
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const StyledAppHeaderLink: import("@emotion/styled").StyledComponent<(((Omit<Omit<Partial<import("@codecademy/gamut/dist/helpers").AppendedIconProps> & {
|
|
2
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
3
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
4
|
+
} & import("@codecademy/gamut").AnchorProps & Pick<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "content" | "translate" | "property" | "hidden" | "slot" | "style" | "title" | "suppressHydrationWarning" | "className" | "id" | "lang" | "media" | "target" | "type" | "role" | "tabIndex" | "href" | "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" | "children" | "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" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "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" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | keyof import("react").ClassAttributes<HTMLAnchorElement> | "download" | "hrefLang" | "ping" | "referrerPolicy">, "ref"> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement> & import("../../shared").AppHeaderAction & {
|
|
5
|
+
isInDropdown?: boolean;
|
|
6
|
+
item: import("../../shared").AppHeaderLinkItem;
|
|
7
|
+
mobile?: boolean;
|
|
8
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
9
|
+
role?: React.AriaRole;
|
|
10
|
+
}, "ref"> | Omit<Omit<Partial<import("@codecademy/gamut/dist/helpers").AppendedIconProps> & {
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
13
|
+
} & import("@codecademy/gamut").AnchorProps & Pick<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "content" | "translate" | "property" | "hidden" | "slot" | "style" | "title" | "suppressHydrationWarning" | "className" | "id" | "lang" | "media" | "target" | "type" | "role" | "tabIndex" | "href" | "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" | "children" | "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" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "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" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | keyof import("react").ClassAttributes<HTMLAnchorElement> | "download" | "hrefLang" | "ping" | "referrerPolicy"> & Omit<{
|
|
14
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
15
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
18
|
+
} & Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "disabled" | "content" | "translate" | "property" | "hidden" | "form" | "slot" | "style" | "title" | "suppressHydrationWarning" | "className" | "id" | "lang" | "name" | "type" | "role" | "tabIndex" | "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" | "children" | "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" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "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" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | keyof import("react").ClassAttributes<HTMLButtonElement> | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value">, "ref"> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement> & import("../../shared").AppHeaderAction & {
|
|
19
|
+
isInDropdown?: boolean;
|
|
20
|
+
item: import("../../shared").AppHeaderLinkItem;
|
|
21
|
+
mobile?: boolean;
|
|
22
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
23
|
+
role?: React.AriaRole;
|
|
24
|
+
}, "ref"> | Omit<Omit<Partial<import("@codecademy/gamut/dist/helpers").AppendedIconProps> & {
|
|
25
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
26
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
27
|
+
} & import("@codecademy/gamut").AnchorProps & Pick<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "content" | "translate" | "property" | "hidden" | "slot" | "style" | "title" | "suppressHydrationWarning" | "className" | "id" | "lang" | "media" | "target" | "type" | "role" | "tabIndex" | "href" | "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" | "children" | "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" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "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" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | keyof import("react").ClassAttributes<HTMLAnchorElement> | "download" | "hrefLang" | "ping" | "referrerPolicy"> & Omit<{
|
|
28
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
29
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
30
|
+
} & {
|
|
31
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
32
|
+
} & Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "disabled" | "content" | "translate" | "property" | "hidden" | "form" | "slot" | "style" | "title" | "suppressHydrationWarning" | "className" | "id" | "lang" | "name" | "type" | "role" | "tabIndex" | "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" | "children" | "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" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "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" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | keyof import("react").ClassAttributes<HTMLButtonElement> | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value"> & Pick<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "content" | "translate" | "property" | "hidden" | "slot" | "style" | "title" | "suppressHydrationWarning" | "className" | "id" | "lang" | "media" | "target" | "type" | "role" | "tabIndex" | "href" | "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" | "children" | "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" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "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" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | keyof import("react").ClassAttributes<HTMLAnchorElement> | "download" | "hrefLang" | "ping" | "referrerPolicy">, "ref"> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement> & import("../../shared").AppHeaderAction & {
|
|
33
|
+
isInDropdown?: boolean;
|
|
34
|
+
item: import("../../shared").AppHeaderLinkItem;
|
|
35
|
+
mobile?: boolean;
|
|
36
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
37
|
+
role?: React.AriaRole;
|
|
38
|
+
}, "ref">) & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>) & {
|
|
39
|
+
theme?: import("@emotion/react").Theme;
|
|
40
|
+
}) & {
|
|
41
|
+
theme?: import("@emotion/react").Theme;
|
|
42
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
import { css, theme } from '@codecademy/gamut-styles';
|
|
3
|
+
import { AppHeaderLink } from '../AppHeaderLink';
|
|
4
|
+
export const StyledAppHeaderLink = /*#__PURE__*/_styled(AppHeaderLink, {
|
|
5
|
+
target: "exw2w3p0",
|
|
6
|
+
label: "StyledAppHeaderLink"
|
|
7
|
+
})(css({
|
|
8
|
+
display: 'flex',
|
|
9
|
+
position: 'relative',
|
|
10
|
+
'@media (max-width: 1199px)': {
|
|
11
|
+
pl: 0
|
|
12
|
+
},
|
|
13
|
+
'&::before': {
|
|
14
|
+
content: '""',
|
|
15
|
+
position: 'absolute',
|
|
16
|
+
width: 'calc(100% - 24px)',
|
|
17
|
+
left: {
|
|
18
|
+
_: 0,
|
|
19
|
+
lg: 12
|
|
20
|
+
},
|
|
21
|
+
borderRadius: 'lg',
|
|
22
|
+
transition: 'background-color 0.15s ease',
|
|
23
|
+
pointerEvents: 'none',
|
|
24
|
+
zIndex: -1
|
|
25
|
+
},
|
|
26
|
+
'&:hover::before, &:focus-visible::before': {
|
|
27
|
+
backgroundColor: theme.colors['navy-100']
|
|
28
|
+
},
|
|
29
|
+
'&:hover, &:focus-visible, &:active': {
|
|
30
|
+
color: 'hyper-400',
|
|
31
|
+
borderRadius: 'lg'
|
|
32
|
+
},
|
|
33
|
+
'&:active::before': {
|
|
34
|
+
backgroundColor: theme.colors['navy-200']
|
|
35
|
+
}
|
|
36
|
+
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9BcHBIZWFkZXIvQXBwSGVhZGVyRWxlbWVudHMvQXBwSGVhZGVyTGlua1NlY3Rpb25zL2VsZW1lbnRzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLbUMiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjL0FwcEhlYWRlci9BcHBIZWFkZXJFbGVtZW50cy9BcHBIZWFkZXJMaW5rU2VjdGlvbnMvZWxlbWVudHMudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzLCB0aGVtZSB9IGZyb20gJ0Bjb2RlY2FkZW15L2dhbXV0LXN0eWxlcyc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbmltcG9ydCB7IEFwcEhlYWRlckxpbmsgfSBmcm9tICcuLi9BcHBIZWFkZXJMaW5rJztcblxuZXhwb3J0IGNvbnN0IFN0eWxlZEFwcEhlYWRlckxpbmsgPSBzdHlsZWQoQXBwSGVhZGVyTGluaykoXG4gIGNzcyh7XG4gICAgZGlzcGxheTogJ2ZsZXgnLFxuICAgIHBvc2l0aW9uOiAncmVsYXRpdmUnLFxuICAgICdAbWVkaWEgKG1heC13aWR0aDogMTE5OXB4KSc6IHtcbiAgICAgIHBsOiAwLFxuICAgIH0sXG4gICAgJyY6OmJlZm9yZSc6IHtcbiAgICAgIGNvbnRlbnQ6ICdcIlwiJyxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgd2lkdGg6ICdjYWxjKDEwMCUgLSAyNHB4KScsXG4gICAgICBsZWZ0OiB7IF86IDAsIGxnOiAxMiB9LFxuICAgICAgYm9yZGVyUmFkaXVzOiAnbGcnLFxuICAgICAgdHJhbnNpdGlvbjogJ2JhY2tncm91bmQtY29sb3IgMC4xNXMgZWFzZScsXG4gICAgICBwb2ludGVyRXZlbnRzOiAnbm9uZScsXG4gICAgICB6SW5kZXg6IC0xLFxuICAgIH0sXG4gICAgJyY6aG92ZXI6OmJlZm9yZSwgJjpmb2N1cy12aXNpYmxlOjpiZWZvcmUnOiB7XG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6IHRoZW1lLmNvbG9yc1snbmF2eS0xMDAnXSxcbiAgICB9LFxuICAgICcmOmhvdmVyLCAmOmZvY3VzLXZpc2libGUsICY6YWN0aXZlJzoge1xuICAgICAgY29sb3I6ICdoeXBlci00MDAnLFxuICAgICAgYm9yZGVyUmFkaXVzOiAnbGcnLFxuICAgIH0sXG4gICAgJyY6YWN0aXZlOjpiZWZvcmUnOiB7XG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6IHRoZW1lLmNvbG9yc1snbmF2eS0yMDAnXSxcbiAgICB9LFxuICB9KVxuKTtcbiJdfQ== */");
|
|
@@ -2,14 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { AppHeaderAction, AppHeaderDropdownItem } from '../../shared';
|
|
3
3
|
export type AppHeaderLinkSectionsProps = AppHeaderAction & {
|
|
4
4
|
item: AppHeaderDropdownItem;
|
|
5
|
-
|
|
6
|
-
role?: string;
|
|
7
|
-
id?: string;
|
|
8
|
-
style?: {};
|
|
9
|
-
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
10
|
-
onFocus?: () => void;
|
|
11
|
-
onBlur?: () => void;
|
|
5
|
+
isOpen?: boolean;
|
|
12
6
|
mobile?: boolean;
|
|
13
|
-
tabIndex?: number;
|
|
14
7
|
};
|
|
15
8
|
export declare const AppHeaderLinkSections: React.FC<AppHeaderLinkSectionsProps>;
|
|
@@ -1,53 +1,60 @@
|
|
|
1
1
|
import { MenuSeparator } from '@codecademy/gamut';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { useAppHeaderMenuContext } from '../AppHeaderMenuProvider';
|
|
5
|
+
import { StyledAppHeaderLink } from './elements';
|
|
5
6
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
7
|
const LinkComponent = ({
|
|
7
8
|
action,
|
|
8
|
-
isFirstElem,
|
|
9
|
-
isMenuItem,
|
|
10
9
|
link,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
mobile,
|
|
11
|
+
isOpen,
|
|
12
|
+
role,
|
|
13
|
+
showLineBreak = false
|
|
15
14
|
}) => {
|
|
16
|
-
const
|
|
15
|
+
const {
|
|
16
|
+
menuItems,
|
|
17
|
+
setMenuItems
|
|
18
|
+
} = useAppHeaderMenuContext();
|
|
19
|
+
const ref = useRef(null);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (setMenuItems && ref?.current) {
|
|
22
|
+
setMenuItems(menuItems.add(ref.current));
|
|
23
|
+
}
|
|
24
|
+
return () => menuItems.clear();
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
+
}, []);
|
|
17
27
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
18
|
-
children: [showLineBreak && /*#__PURE__*/_jsx(MenuSeparator, {}), /*#__PURE__*/_jsx(
|
|
28
|
+
children: [showLineBreak && /*#__PURE__*/_jsx(MenuSeparator, {}), /*#__PURE__*/_jsx(StyledAppHeaderLink, {
|
|
29
|
+
ref: ref,
|
|
19
30
|
action: action,
|
|
20
|
-
isFirstElem: !isMenuItem ? isFirstElem : undefined,
|
|
21
31
|
item: link,
|
|
22
32
|
mobile: mobile,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
role: role,
|
|
34
|
+
tabIndex: isOpen || mobile ? 0 : -1,
|
|
35
|
+
isInDropdown: true
|
|
26
36
|
})]
|
|
27
37
|
});
|
|
28
38
|
};
|
|
29
39
|
export const AppHeaderLinkSections = ({
|
|
30
40
|
action,
|
|
31
41
|
item,
|
|
32
|
-
|
|
33
|
-
tabIndex,
|
|
42
|
+
isOpen,
|
|
34
43
|
mobile
|
|
35
44
|
}) => {
|
|
36
45
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
37
46
|
children: item.type === 'profile-dropdown' ? item.popover.map((linkSection, sectionIndex) => linkSection.map((link, linkIndex) => /*#__PURE__*/_jsx(LinkComponent, {
|
|
38
47
|
action: action,
|
|
39
48
|
link: link,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, link.id))) : item.popover.map(
|
|
45
|
-
onKeyDown: onKeyDown,
|
|
49
|
+
mobile: mobile,
|
|
50
|
+
isOpen: isOpen,
|
|
51
|
+
role: "menuitem",
|
|
52
|
+
showLineBreak: sectionIndex !== 0 && linkIndex === 0
|
|
53
|
+
}, link.id))) : item.popover.map(link => /*#__PURE__*/_jsx(LinkComponent, {
|
|
46
54
|
action: action,
|
|
47
55
|
link: link,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
mobile: mobile
|
|
56
|
+
mobile: mobile,
|
|
57
|
+
isOpen: isOpen
|
|
51
58
|
}, link.id))
|
|
52
59
|
});
|
|
53
60
|
};
|
|
@@ -3,7 +3,10 @@ interface AppHeaderNavButtonProps {
|
|
|
3
3
|
buttonRef: React.RefObject<HTMLButtonElement>;
|
|
4
4
|
handleOnClick: (event: React.MouseEvent) => void;
|
|
5
5
|
isOpen: boolean;
|
|
6
|
-
item
|
|
6
|
+
item?: AppHeaderDropdownItem;
|
|
7
|
+
text?: string;
|
|
8
|
+
onFocus?: () => void;
|
|
7
9
|
}
|
|
8
|
-
export declare const
|
|
10
|
+
export declare const AppHeaderMenuNavButton: React.FC<AppHeaderNavButtonProps>;
|
|
11
|
+
export declare const AppHeaderDropdownNavButton: React.FC<AppHeaderNavButtonProps>;
|
|
9
12
|
export {};
|
|
@@ -1,36 +1,103 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { IconButton, TextButton } from '@codecademy/gamut';
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { Avatar } from '../../../Avatar';
|
|
4
|
+
import { DropdownAnchor, DropdownIcon, StyledText } from '../../shared';
|
|
5
|
+
import { useAppHeaderDropdownContext } from '../AppHeaderDropdownProvider';
|
|
6
|
+
import { useAppHeaderMenuContext } from '../AppHeaderMenuProvider';
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const AppHeaderNavButton = ({
|
|
5
9
|
buttonRef,
|
|
6
10
|
handleOnClick,
|
|
7
11
|
isOpen,
|
|
8
|
-
item
|
|
12
|
+
item,
|
|
13
|
+
text,
|
|
14
|
+
onFocus
|
|
9
15
|
}) => {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const sharedProps = {
|
|
17
|
+
'aria-expanded': isOpen,
|
|
18
|
+
'aria-haspopup': true,
|
|
19
|
+
onClick: handleOnClick,
|
|
20
|
+
ref: buttonRef
|
|
21
|
+
};
|
|
22
|
+
if (item?.type === 'profile-dropdown') {
|
|
23
|
+
return /*#__PURE__*/_jsx(TextButton, {
|
|
24
|
+
"data-testid": "avatar-dropdown-button"
|
|
25
|
+
// this resets our programatic menu index to 0 in case someone clicks out of the dropdown
|
|
26
|
+
,
|
|
27
|
+
variant: "interface",
|
|
28
|
+
onFocus: onFocus,
|
|
29
|
+
...sharedProps,
|
|
30
|
+
children: /*#__PURE__*/_jsx(Avatar, {
|
|
31
|
+
alt: "User profile avatar",
|
|
32
|
+
disableDropshadow: true,
|
|
33
|
+
size: 40,
|
|
34
|
+
src: item.avatar
|
|
35
|
+
})
|
|
17
36
|
});
|
|
18
37
|
}
|
|
19
|
-
if ('isIconOnly' in item
|
|
20
|
-
return /*#__PURE__*/_jsx(
|
|
21
|
-
buttonRef: buttonRef,
|
|
22
|
-
handleOnClick: handleOnClick,
|
|
23
|
-
isOpen: isOpen,
|
|
24
|
-
title: item.text,
|
|
38
|
+
if (item?.icon && 'isIconOnly' in item) {
|
|
39
|
+
return /*#__PURE__*/_jsx(IconButton, {
|
|
25
40
|
icon: item.icon,
|
|
26
|
-
|
|
41
|
+
tip: item.text ?? 'Dropdown',
|
|
42
|
+
tipProps: {
|
|
43
|
+
alignment: 'bottom-center',
|
|
44
|
+
placement: 'floating'
|
|
45
|
+
},
|
|
46
|
+
onFocus: onFocus,
|
|
47
|
+
...sharedProps
|
|
27
48
|
});
|
|
28
49
|
}
|
|
29
|
-
return /*#__PURE__*/
|
|
30
|
-
|
|
31
|
-
|
|
50
|
+
return /*#__PURE__*/_jsxs(DropdownAnchor, {
|
|
51
|
+
title: item?.text ?? text,
|
|
52
|
+
variant: "interface",
|
|
53
|
+
onFocus: onFocus,
|
|
54
|
+
...sharedProps,
|
|
55
|
+
children: [/*#__PURE__*/_jsx(StyledText, {
|
|
56
|
+
fontWeight: isOpen ? 'bold' : 'normal',
|
|
57
|
+
textAlign: "center",
|
|
58
|
+
title: item?.text ?? text,
|
|
59
|
+
children: item?.text ?? text
|
|
60
|
+
}), /*#__PURE__*/_jsx(DropdownIcon, {
|
|
61
|
+
open: isOpen,
|
|
62
|
+
size: 12
|
|
63
|
+
})]
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
export const AppHeaderMenuNavButton = ({
|
|
67
|
+
isOpen,
|
|
68
|
+
...props
|
|
69
|
+
}) => {
|
|
70
|
+
const {
|
|
71
|
+
menuItems,
|
|
72
|
+
resetIndex
|
|
73
|
+
} = useAppHeaderMenuContext();
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (isOpen) {
|
|
76
|
+
const menuItemsArray = menuItems.values();
|
|
77
|
+
const firstMenuItem = menuItemsArray.next().value;
|
|
78
|
+
firstMenuItem?.focus();
|
|
79
|
+
}
|
|
80
|
+
}, [isOpen, menuItems]);
|
|
81
|
+
return /*#__PURE__*/_jsx(AppHeaderNavButton, {
|
|
82
|
+
isOpen: isOpen,
|
|
83
|
+
onFocus: resetIndex,
|
|
84
|
+
...props
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
export const AppHeaderDropdownNavButton = ({
|
|
88
|
+
isOpen,
|
|
89
|
+
...props
|
|
90
|
+
}) => {
|
|
91
|
+
const {
|
|
92
|
+
firstItemRef
|
|
93
|
+
} = useAppHeaderDropdownContext();
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (isOpen) {
|
|
96
|
+
firstItemRef?.focus();
|
|
97
|
+
}
|
|
98
|
+
}, [isOpen, firstItemRef]);
|
|
99
|
+
return /*#__PURE__*/_jsx(AppHeaderNavButton, {
|
|
32
100
|
isOpen: isOpen,
|
|
33
|
-
|
|
34
|
-
icon: item?.icon
|
|
101
|
+
...props
|
|
35
102
|
});
|
|
36
103
|
};
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import { DropdownPositions, useHeaderDisplayContext } from '../../../GlobalHeader/context';
|
|
6
6
|
import { AnimatedMegaMenuDropdown } from '../../shared';
|
|
7
7
|
import { AppHeaderDropdownProvider } from '../AppHeaderDropdownProvider';
|
|
8
|
-
import { AppHeaderDropdownNavButton } from '../AppHeaderNavButton
|
|
8
|
+
import { AppHeaderDropdownNavButton } from '../AppHeaderNavButton';
|
|
9
9
|
import { useAppHeaderContext } from '../AppHeaderProvider';
|
|
10
10
|
import { AppHeaderSection } from '../AppHeaderSection';
|
|
11
11
|
import { RESOURCES_NAV_SECTIONS } from './consts';
|
|
@@ -15,7 +15,7 @@ const StyledAnimatedMegaMenuDropdown = /*#__PURE__*/_styled(AnimatedMegaMenuDrop
|
|
|
15
15
|
shouldForwardProp: prop => prop !== 'narrowResourceDropdownPosition' && prop !== 'wideResourceDropdownPosition',
|
|
16
16
|
target: "ekdg1bw0",
|
|
17
17
|
label: "StyledAnimatedMegaMenuDropdown"
|
|
18
|
-
})("left:", ({
|
|
18
|
+
})("top:3.5rem;left:", ({
|
|
19
19
|
narrowResourceDropdownPosition
|
|
20
20
|
}) => {
|
|
21
21
|
return narrowResourceDropdownPosition;
|
|
@@ -23,7 +23,7 @@ const StyledAnimatedMegaMenuDropdown = /*#__PURE__*/_styled(AnimatedMegaMenuDrop
|
|
|
23
23
|
wideResourceDropdownPosition
|
|
24
24
|
}) => {
|
|
25
25
|
return wideResourceDropdownPosition;
|
|
26
|
-
}, ";}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
26
|
+
}, ";}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9BcHBIZWFkZXIvQXBwSGVhZGVyRWxlbWVudHMvQXBwSGVhZGVyUmVzb3VyY2VzRHJvcGRvd24vaW5kZXgudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWdDRSIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMvQXBwSGVhZGVyL0FwcEhlYWRlckVsZW1lbnRzL0FwcEhlYWRlclJlc291cmNlc0Ryb3Bkb3duL2luZGV4LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbG9yTW9kZSB9IGZyb20gJ0Bjb2RlY2FkZW15L2dhbXV0LXN0eWxlcyc7XG5pbXBvcnQgc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BcHBIZWFkZXIgZm9jdXMgbG9naWNcbiAgICAgICAgcmVmPXtkcm9wZG93blJlZn1cbiAgICAgICAgZGF0YS10ZXN0aWQ9XCJyZXNvdXJjZXMtbWVudS1kcm9wZG93blwiXG4gICAgICAgIG9uQW5pbWF0aW9uQ29tcGxldGU9e2FuaW1hdGlvbkZpbmlzaGVkfVxuICAgICAgPlxuICAgICAgICA8Q29sb3JNb2RlIG1vZGU9XCJsaWdodFwiPlxuICAgICAgICAgIDxBcHBIZWFkZXJTZWN0aW9uXG4gICAgICAgICAgICBpc09wZW49e2lzT3Blbn1cbiAgICAgICAgICAgIHJlZj17Y29udGFpbmVyUmVmfVxuICAgICAgICAgICAgbmF2U2VjdGlvbnM9e1JFU09VUkNFU19OQVZfU0VDVElPTlN9XG4gICAgICAgICAgICBoYW5kbGVDbG9zZT17KCkgPT4gc2V0SXNPcGVuKGZhbHNlKX1cbiAgICAgICAgICAgIHR5cGU9XCJyZXNvdXJjZXMtZHJvcGRvd25cIlxuICAgICAgICAgIC8+XG4gICAgICAgIDwvQ29sb3JNb2RlPlxuICAgICAgPC9TdHlsZWRBbmltYXRlZE1lZ2FNZW51RHJvcGRvd24+XG4gICAgPC9BcHBIZWFkZXJEcm9wZG93blByb3ZpZGVyPlxuICApO1xufTtcbiJdfQ== */"));
|
|
27
27
|
export const AppHeaderResourcesDropdown = ({
|
|
28
28
|
action,
|
|
29
29
|
item
|
|
@@ -47,11 +47,7 @@ export const AppHeaderResourcesDropdown = ({
|
|
|
47
47
|
} = DropdownPositions[headerType];
|
|
48
48
|
const narrowResourceDropdownPosition = resourceDropdown.narrow;
|
|
49
49
|
const wideResourceDropdownPosition = resourceDropdown.wide;
|
|
50
|
-
|
|
51
|
-
// Add scrollbar for short screens after transition (otherwise scrollbar appears and dissapears for adequate heights during transition)
|
|
52
|
-
const [animationCompleteStyles, setAnimationCompleteStyles] = useState(false);
|
|
53
50
|
const animationFinished = () => {
|
|
54
|
-
setAnimationCompleteStyles(isOpen);
|
|
55
51
|
if (isOpen && dropdownRef.current) {
|
|
56
52
|
dropdownRef.current.scrollTop = 0;
|
|
57
53
|
}
|
|
@@ -97,32 +93,14 @@ export const AppHeaderResourcesDropdown = ({
|
|
|
97
93
|
buttonRef: buttonRef,
|
|
98
94
|
handleOnClick: handleOnClick,
|
|
99
95
|
isOpen: isOpen,
|
|
100
|
-
|
|
96
|
+
text: text
|
|
101
97
|
}), /*#__PURE__*/_jsx(StyledAnimatedMegaMenuDropdown, {
|
|
98
|
+
isOpen: isOpen,
|
|
102
99
|
narrowResourceDropdownPosition: narrowResourceDropdownPosition,
|
|
103
100
|
wideResourceDropdownPosition: wideResourceDropdownPosition,
|
|
104
101
|
tabIndex: -1 // prevent from interfering with AppHeader focus logic
|
|
105
102
|
,
|
|
106
103
|
ref: dropdownRef,
|
|
107
|
-
style: {
|
|
108
|
-
top: '3.5rem',
|
|
109
|
-
minWidth: '64rem',
|
|
110
|
-
overflowY: 'auto',
|
|
111
|
-
maxHeight: animationCompleteStyles ? '85vh' : 0,
|
|
112
|
-
backgroundColor: 'transparent'
|
|
113
|
-
},
|
|
114
|
-
initial: {
|
|
115
|
-
borderWidth: 0,
|
|
116
|
-
height: 0
|
|
117
|
-
},
|
|
118
|
-
animate: {
|
|
119
|
-
borderWidth: 0,
|
|
120
|
-
height: isOpen ? 'fit-content' : 0
|
|
121
|
-
},
|
|
122
|
-
transition: {
|
|
123
|
-
duration: 0.175
|
|
124
|
-
},
|
|
125
|
-
"aria-hidden": !isOpen,
|
|
126
104
|
"data-testid": "resources-menu-dropdown",
|
|
127
105
|
onAnimationComplete: animationFinished,
|
|
128
106
|
children: /*#__PURE__*/_jsx(ColorMode, {
|
|
@@ -2,8 +2,8 @@ import { GamutIconProps } from '@codecademy/gamut-icons';
|
|
|
2
2
|
import React, { PropsWithChildren } from 'react';
|
|
3
3
|
import { AppHeaderCatalogDropdownItem, AppHeaderResourcesDropdownItem } from '../../shared';
|
|
4
4
|
type NavSectionProps = PropsWithChildren & {
|
|
5
|
-
activeTab: number;
|
|
6
5
|
item: AppHeaderCatalogDropdownItem | AppHeaderResourcesDropdownItem;
|
|
6
|
+
isActiveTab: boolean;
|
|
7
7
|
setActiveTab: (tab: number) => void;
|
|
8
8
|
icon?: React.ComponentType<GamutIconProps>;
|
|
9
9
|
text: string;
|
|
@@ -17,5 +17,5 @@ export declare const NavigationButton: import("@emotion/styled").StyledComponent
|
|
|
17
17
|
isActive: boolean;
|
|
18
18
|
index: number;
|
|
19
19
|
}, React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
20
|
-
declare const NavSection: ({
|
|
20
|
+
declare const NavSection: ({ isActiveTab, setActiveTab, icon: Icon, text, index, children, item, tabIndex, }: NavSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export default NavSection;
|