@codecademy/brand 3.29.0-alpha.9e369d57a0.0 → 3.29.0-alpha.9e88d7b76a.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/MarketingBanner.d.ts +1 -2
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/MarketingBanner.js +3 -3
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/NavPanels.d.ts +0 -1
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/NavPanels.js +2 -3
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/consts.d.ts +1 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/consts.js +2 -1
- package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.js +0 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/MobileBackButton.d.ts +0 -25
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/MobileBackButton.js +2 -13
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/NavTabs.d.ts +20 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/NavTabs.js +144 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/elements.d.ts +63 -1
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/elements.js +81 -16
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/index.d.ts +16 -10
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/index.js +89 -28
- package/dist/DropdownButton/index.d.ts +3 -1
- package/dist/stories/Atoms/BetaSticker.stories.js +1 -0
- package/dist/stories/Molecules/AppBar.stories.d.ts +1 -0
- package/dist/stories/Molecules/AppBar.stories.js +2 -1
- package/dist/stories/Molecules/AppHeader/AppHeaderLink.stories.js +2 -0
- package/dist/stories/Molecules/AppHeader/AppHeaderLogo.stories.js +2 -1
- package/dist/stories/Molecules/Banner.stories.js +3 -0
- package/dist/stories/Molecules/CurriculumCard.stories.js +7 -0
- package/dist/stories/Molecules/EmptySection.stories.js +2 -1
- package/dist/stories/Molecules/EnhancedBanner.stories.js +1 -1
- package/dist/stories/Molecules/HubCard.stories.js +1 -0
- package/dist/stories/Molecules/NotificationList.stories.js +2 -1
- package/dist/stories/Molecules/Testimonial.stories.js +8 -4
- package/dist/stories/Organisms/GlobalFooter.stories.js +2 -1
- package/dist/stories/Organisms/GlobalHeader/About.stories.js +2 -1
- package/dist/stories/Organisms/GlobalHeader/Bootcamp.stories.js +2 -1
- package/dist/stories/Organisms/GlobalHeader/Enterprise.stories.js +2 -1
- package/dist/stories/Organisms/GlobalHeader/Simple.stories.js +2 -1
- package/dist/stories/Organisms/GlobalPage.stories.js +2 -0
- package/dist/stories/Organisms/LayoutMenu.stories.js +6 -3
- package/dist/stories/Organisms/LayoutMenuVariant.stories.js +4 -2
- package/dist/stories/Organisms/PageFeatures.stories.js +9 -1
- package/dist/stories/Organisms/PageHero.stories.js +20 -10
- package/dist/stories/Organisms/PagePrefooter.stories.js +8 -4
- package/dist/stories/Organisms/PageSingleFeature.stories.js +20 -10
- package/dist/stories/Organisms/PageVideoGallery.stories.js +10 -5
- package/dist/stories/Organisms/ScoreSummary.stories.js +8 -4
- package/dist/svg.d.ts +1 -0
- package/package.json +1 -2
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/AppHeaderSection.test.js +0 -193
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/NavSection.d.ts +0 -21
- package/dist/AppHeader/AppHeaderElements/AppHeaderSection/NavSection.js +0 -206
|
@@ -1,36 +1,77 @@
|
|
|
1
1
|
import { Box } from '@codecademy/gamut';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { useGlobalHeaderDynamicDataContext } from '../../../GlobalHeader/context';
|
|
2
|
+
import { motion } from 'framer-motion';
|
|
3
|
+
import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { useGlobalHeaderDynamicDataContext, useGlobalHeaderItemClick } from '../../../GlobalHeader/context';
|
|
5
5
|
import { AppHeaderSectionContext } from './AppHeaderSectionContext';
|
|
6
|
-
import {
|
|
6
|
+
import { NavTabContainer, StyledSection } from './elements';
|
|
7
7
|
import { MobileBackButton } from './MobileBackButton';
|
|
8
8
|
import { MobileNavMenu } from './MobileNavMenu';
|
|
9
|
-
import
|
|
9
|
+
import { NavTab, NavTabList, NavTabPanel } from './NavTabs';
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
export const AppHeaderSection = /*#__PURE__*/
|
|
11
|
+
export const AppHeaderSection = /*#__PURE__*/forwardRef(({
|
|
12
12
|
isOpen = true,
|
|
13
|
-
keyDownEvents,
|
|
14
|
-
navSections,
|
|
15
13
|
MarketingBanner,
|
|
16
14
|
isMobile = false,
|
|
17
15
|
handleClose,
|
|
18
|
-
type
|
|
16
|
+
type,
|
|
17
|
+
defaultSelectedKey,
|
|
18
|
+
navSections
|
|
19
19
|
}, ref) => {
|
|
20
|
-
const
|
|
20
|
+
const firstTabId = navSections?.[0]?.item?.id;
|
|
21
|
+
const [activeTab, setActiveTab] = useState(defaultSelectedKey || firstTabId);
|
|
21
22
|
const [activePanel, setActivePanel] = useState(null);
|
|
23
|
+
const tabListRef = useRef(null);
|
|
22
24
|
const {
|
|
23
25
|
globalHeaderDynamicData
|
|
24
26
|
} = useGlobalHeaderDynamicDataContext();
|
|
27
|
+
const {
|
|
28
|
+
globalHeaderItemClick
|
|
29
|
+
} = useGlobalHeaderItemClick();
|
|
25
30
|
const banner = globalHeaderDynamicData?.catalogDropdown?.banner;
|
|
26
31
|
const showMarketingBanner = banner?.text && banner?.href && MarketingBanner;
|
|
27
32
|
const tabIndex = isOpen ? 0 : -1;
|
|
28
33
|
const activePanelSelected = activePanel !== null;
|
|
34
|
+
const onSelect = useCallback((key, event, item) => {
|
|
35
|
+
setActiveTab(key);
|
|
36
|
+
if (item && event) {
|
|
37
|
+
globalHeaderItemClick(event, item);
|
|
38
|
+
}
|
|
39
|
+
}, [setActiveTab, globalHeaderItemClick]);
|
|
40
|
+
const onKeyDown = useCallback(event => {
|
|
41
|
+
if (!tabListRef.current) return;
|
|
42
|
+
|
|
43
|
+
// get list of tabs available
|
|
44
|
+
const tabs = Array.from(tabListRef.current?.querySelectorAll('button[role="tab"]') || []);
|
|
45
|
+
// get the index of the active tab
|
|
46
|
+
const activeElement = tabs.indexOf(document.activeElement);
|
|
47
|
+
if (['ArrowUp', 'ArrowLeft'].includes(event.key)) {
|
|
48
|
+
// prevent scrollbar from moving when arrow keys are pressed on tabs
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
const prevTab = tabs[activeElement - 1];
|
|
51
|
+
if (prevTab) {
|
|
52
|
+
prevTab.focus();
|
|
53
|
+
} else {
|
|
54
|
+
// focus the last tab
|
|
55
|
+
tabs[tabs.length - 1].focus();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (['ArrowDown', 'ArrowRight'].includes(event.key)) {
|
|
59
|
+
// prevent scrollbar from moving when arrow keys are pressed on tabs
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
const nextTab = tabs[activeElement + 1];
|
|
62
|
+
if (nextTab) {
|
|
63
|
+
nextTab.focus();
|
|
64
|
+
} else {
|
|
65
|
+
// focus the first tab
|
|
66
|
+
tabs[0].focus();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}, []);
|
|
29
70
|
useEffect(() => {
|
|
30
|
-
if (isOpen) {
|
|
31
|
-
setActiveTab(
|
|
71
|
+
if (!isOpen) {
|
|
72
|
+
setActiveTab(firstTabId);
|
|
32
73
|
}
|
|
33
|
-
}, [isOpen]);
|
|
74
|
+
}, [isOpen, firstTabId]);
|
|
34
75
|
return /*#__PURE__*/_jsx(AppHeaderSectionContext.Provider, {
|
|
35
76
|
value: {
|
|
36
77
|
activePanel,
|
|
@@ -38,6 +79,7 @@ export const AppHeaderSection = /*#__PURE__*/React.forwardRef(({
|
|
|
38
79
|
tabIndex
|
|
39
80
|
},
|
|
40
81
|
children: /*#__PURE__*/_jsxs(StyledSection, {
|
|
82
|
+
ref: ref,
|
|
41
83
|
activePanelSelected: activePanelSelected,
|
|
42
84
|
children: [showMarketingBanner && /*#__PURE__*/_jsx(Box, {
|
|
43
85
|
display: {
|
|
@@ -45,31 +87,50 @@ export const AppHeaderSection = /*#__PURE__*/React.forwardRef(({
|
|
|
45
87
|
xs: 'block'
|
|
46
88
|
},
|
|
47
89
|
children: /*#__PURE__*/_jsx(MarketingBanner, {
|
|
48
|
-
tabIndex: tabIndex,
|
|
49
90
|
text: banner?.text,
|
|
50
|
-
href: banner?.href
|
|
91
|
+
href: banner?.href,
|
|
92
|
+
tabIndex: tabIndex
|
|
51
93
|
})
|
|
52
|
-
}), /*#__PURE__*/_jsxs(
|
|
53
|
-
|
|
54
|
-
|
|
94
|
+
}), /*#__PURE__*/_jsxs(NavTabContainer, {
|
|
95
|
+
p: 8,
|
|
96
|
+
rowGap: 8,
|
|
55
97
|
children: [isMobile && /*#__PURE__*/_jsx(MobileBackButton, {
|
|
56
98
|
handleClose: handleClose,
|
|
57
99
|
type: type
|
|
100
|
+
}), /*#__PURE__*/_jsx(NavTabList, {
|
|
101
|
+
type: type,
|
|
102
|
+
ref: tabListRef,
|
|
103
|
+
children: navSections.map(({
|
|
104
|
+
item
|
|
105
|
+
}, index) => /*#__PURE__*/_jsx(NavTab, {
|
|
106
|
+
item: item,
|
|
107
|
+
onSelect: onSelect,
|
|
108
|
+
isActive: activeTab === item.id,
|
|
109
|
+
onKeyDown: onKeyDown,
|
|
110
|
+
index: index
|
|
111
|
+
}, item.id))
|
|
58
112
|
}), navSections.map((section, index) => {
|
|
59
113
|
const {
|
|
60
|
-
item
|
|
114
|
+
item: {
|
|
115
|
+
id
|
|
116
|
+
},
|
|
61
117
|
panel: Panel
|
|
62
118
|
} = section;
|
|
63
|
-
return /*#__PURE__*/_jsx(
|
|
64
|
-
isActiveTab: activeTab === index,
|
|
65
|
-
setActiveTab: setActiveTab,
|
|
66
|
-
icon: item.icon,
|
|
67
|
-
text: item.text,
|
|
119
|
+
return /*#__PURE__*/_jsx(NavTabPanel, {
|
|
68
120
|
index: index,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
children: /*#__PURE__*/_jsx(
|
|
72
|
-
|
|
121
|
+
isActiveTab: activeTab === id,
|
|
122
|
+
id: id,
|
|
123
|
+
children: /*#__PURE__*/_jsx(motion.div, {
|
|
124
|
+
animate: {
|
|
125
|
+
opacity: activeTab === id ? 1 : 0
|
|
126
|
+
},
|
|
127
|
+
transition: {
|
|
128
|
+
duration: 0.4,
|
|
129
|
+
ease: 'easeInOut'
|
|
130
|
+
},
|
|
131
|
+
children: /*#__PURE__*/_jsx(Panel, {})
|
|
132
|
+
})
|
|
133
|
+
}, id);
|
|
73
134
|
})]
|
|
74
135
|
}), /*#__PURE__*/_jsx(MobileNavMenu, {
|
|
75
136
|
handleClose: handleClose,
|
|
@@ -42,7 +42,9 @@ export declare const DropdownButton: React.ForwardRefExoticComponent<(Omit<{
|
|
|
42
42
|
verticalOffset?: number;
|
|
43
43
|
} & import("@codecademy/gamut/dist/Button/shared").ButtonBaseProps & Omit<{
|
|
44
44
|
theme?: import("@emotion/react").Theme | undefined;
|
|
45
|
-
as?: import("react"
|
|
45
|
+
as?: import("react" /**
|
|
46
|
+
* Sets the size of the down arrow icon in the buttons that have text or the kebab and horizontal kebab icons.
|
|
47
|
+
*/).ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
46
48
|
} & {
|
|
47
49
|
theme?: import("@emotion/react").Theme | undefined;
|
|
48
50
|
} & Pick<React.DetailedHTMLProps<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 React.ClassAttributes<HTMLButtonElement> | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value">, "ref"> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement> & {
|
|
@@ -23,6 +23,7 @@ export const CurrentTab = {
|
|
|
23
23
|
render: args => /*#__PURE__*/_jsx(AppHeaderLink, {
|
|
24
24
|
...args
|
|
25
25
|
}),
|
|
26
|
+
name: 'Current Tab',
|
|
26
27
|
args: {
|
|
27
28
|
item: {
|
|
28
29
|
id: 'link-current-tab',
|
|
@@ -37,6 +38,7 @@ export const NewTab = {
|
|
|
37
38
|
render: args => /*#__PURE__*/_jsx(AppHeaderLink, {
|
|
38
39
|
...args
|
|
39
40
|
}),
|
|
41
|
+
name: 'New Tab',
|
|
40
42
|
args: {
|
|
41
43
|
item: {
|
|
42
44
|
id: 'link-new-tab',
|
|
@@ -18,6 +18,7 @@ export const Navy = {
|
|
|
18
18
|
render: args => /*#__PURE__*/_jsx(Banner, {
|
|
19
19
|
...args
|
|
20
20
|
}),
|
|
21
|
+
name: 'Navy',
|
|
21
22
|
args: {
|
|
22
23
|
children: 'Navy',
|
|
23
24
|
variant: 'navy'
|
|
@@ -27,6 +28,7 @@ export const Yellow = {
|
|
|
27
28
|
render: args => /*#__PURE__*/_jsx(Banner, {
|
|
28
29
|
...args
|
|
29
30
|
}),
|
|
31
|
+
name: 'Yellow',
|
|
30
32
|
args: {
|
|
31
33
|
children: 'Yellow',
|
|
32
34
|
variant: 'yellow'
|
|
@@ -36,6 +38,7 @@ export const Subtle = {
|
|
|
36
38
|
render: args => /*#__PURE__*/_jsx(Banner, {
|
|
37
39
|
...args
|
|
38
40
|
}),
|
|
41
|
+
name: 'Subtle',
|
|
39
42
|
args: {
|
|
40
43
|
children: 'Subtle',
|
|
41
44
|
variant: 'subtle'
|
|
@@ -43,6 +43,7 @@ export const CurriculumCardEnrolled = {
|
|
|
43
43
|
render: args => /*#__PURE__*/_jsx(CurriculumCard, {
|
|
44
44
|
...args
|
|
45
45
|
}),
|
|
46
|
+
name: 'Curriculum Card Enrolled',
|
|
46
47
|
args: {
|
|
47
48
|
progressState: 'inProgress'
|
|
48
49
|
}
|
|
@@ -51,6 +52,7 @@ export const CurriculumCardInProgress = {
|
|
|
51
52
|
render: args => /*#__PURE__*/_jsx(CurriculumCard, {
|
|
52
53
|
...args
|
|
53
54
|
}),
|
|
55
|
+
name: 'Curriculum Card In Progress',
|
|
54
56
|
args: {
|
|
55
57
|
progressState: 'inProgress',
|
|
56
58
|
footerTextVariant: 'inProgress'
|
|
@@ -60,6 +62,7 @@ export const CurriculumCardCompleted = {
|
|
|
60
62
|
render: args => /*#__PURE__*/_jsx(CurriculumCard, {
|
|
61
63
|
...args
|
|
62
64
|
}),
|
|
65
|
+
name: 'Curriculum Card Completed',
|
|
63
66
|
args: {
|
|
64
67
|
progressState: 'completed'
|
|
65
68
|
}
|
|
@@ -68,6 +71,7 @@ export const CurriculumCardBeta = {
|
|
|
68
71
|
render: args => /*#__PURE__*/_jsx(CurriculumCard, {
|
|
69
72
|
...args
|
|
70
73
|
}),
|
|
74
|
+
name: 'Curriculum Card Beta',
|
|
71
75
|
args: {
|
|
72
76
|
beta: true
|
|
73
77
|
}
|
|
@@ -76,6 +80,7 @@ export const CurriculumCardAlternativeSubtitle = {
|
|
|
76
80
|
render: args => /*#__PURE__*/_jsx(CurriculumCard, {
|
|
77
81
|
...args
|
|
78
82
|
}),
|
|
83
|
+
name: 'Curriculum Card Alternative Subtitle',
|
|
79
84
|
args: {
|
|
80
85
|
showAltSubtitle: true,
|
|
81
86
|
scope: {
|
|
@@ -124,6 +129,7 @@ export const CareerPathVariant = {
|
|
|
124
129
|
})
|
|
125
130
|
})]
|
|
126
131
|
}),
|
|
132
|
+
name: 'Career Path Variant',
|
|
127
133
|
args: {
|
|
128
134
|
text: 'Career Path',
|
|
129
135
|
title: 'Front-End Engineer',
|
|
@@ -150,6 +156,7 @@ export const HorizontalCurriculumCard = {
|
|
|
150
156
|
})
|
|
151
157
|
})
|
|
152
158
|
}),
|
|
159
|
+
name: 'Horizontal Curriculum Card',
|
|
153
160
|
args: {
|
|
154
161
|
text: 'Career Path',
|
|
155
162
|
title: 'Front-End Engineer',
|
|
@@ -20,6 +20,7 @@ export const BackgroundRight = {
|
|
|
20
20
|
render: args => /*#__PURE__*/_jsx(HubCard, {
|
|
21
21
|
...args
|
|
22
22
|
}),
|
|
23
|
+
name: 'Background Right',
|
|
23
24
|
args: {
|
|
24
25
|
backgroundImage: 'https://static-assets.codecademy.com/assets/components/cards/explore-category-card/subject/data-science.svg',
|
|
25
26
|
backgroundPosition: 'right'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { action } from 'storybook/actions';
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
2
|
import { NotificationList } from '../../index';
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
const notifications = [{
|
|
@@ -93,6 +93,7 @@ export const Empty = {
|
|
|
93
93
|
render: args => /*#__PURE__*/_jsx(NotificationList, {
|
|
94
94
|
...args
|
|
95
95
|
}),
|
|
96
|
+
name: 'Empty',
|
|
96
97
|
args: {
|
|
97
98
|
notifications: []
|
|
98
99
|
}
|
|
@@ -28,7 +28,8 @@ export const Default = {
|
|
|
28
28
|
export const LightMode = {
|
|
29
29
|
render: args => /*#__PURE__*/_jsx(Testimonial, {
|
|
30
30
|
...args
|
|
31
|
-
})
|
|
31
|
+
}),
|
|
32
|
+
name: 'Light Mode'
|
|
32
33
|
};
|
|
33
34
|
export const DarkMode = {
|
|
34
35
|
render: args => /*#__PURE__*/_jsx(Background, {
|
|
@@ -42,18 +43,21 @@ export const DarkMode = {
|
|
|
42
43
|
...args
|
|
43
44
|
})
|
|
44
45
|
})
|
|
45
|
-
})
|
|
46
|
+
}),
|
|
47
|
+
name: 'Dark Mode'
|
|
46
48
|
};
|
|
47
49
|
export const SmallLight = {
|
|
48
50
|
render: args => /*#__PURE__*/_jsx(Testimonial, {
|
|
49
51
|
orientation: "vertical",
|
|
50
52
|
...args
|
|
51
|
-
})
|
|
53
|
+
}),
|
|
54
|
+
name: 'Small Light'
|
|
52
55
|
};
|
|
53
56
|
export const MediumDark = {
|
|
54
57
|
render: args => /*#__PURE__*/_jsx(Testimonial, {
|
|
55
58
|
...args,
|
|
56
59
|
orientation: "horizontal",
|
|
57
60
|
hidePhoto: true
|
|
58
|
-
})
|
|
61
|
+
}),
|
|
62
|
+
name: 'Medium Dark'
|
|
59
63
|
};
|
|
@@ -55,7 +55,8 @@ export const WithSelectedItem = {
|
|
|
55
55
|
render: args => /*#__PURE__*/_jsx(LayoutMenu, {
|
|
56
56
|
...args,
|
|
57
57
|
selectedItem: "python"
|
|
58
|
-
})
|
|
58
|
+
}),
|
|
59
|
+
name: 'With Selected Item'
|
|
59
60
|
};
|
|
60
61
|
export const WithAdditionalLinks = {
|
|
61
62
|
render: args => /*#__PURE__*/_jsxs(LayoutMenu, {
|
|
@@ -73,7 +74,8 @@ export const WithAdditionalLinks = {
|
|
|
73
74
|
children: "Where do I begin?"
|
|
74
75
|
})
|
|
75
76
|
})]
|
|
76
|
-
})
|
|
77
|
+
}),
|
|
78
|
+
name: 'With Additional Links'
|
|
77
79
|
};
|
|
78
80
|
export const WithAdditionalLinksOnTopAndBottom = {
|
|
79
81
|
render: args => /*#__PURE__*/_jsx(LayoutMenu, {
|
|
@@ -235,5 +237,6 @@ export const WithSetMenuHeight = {
|
|
|
235
237
|
children: "Where do I begin?"
|
|
236
238
|
})
|
|
237
239
|
})]
|
|
238
|
-
})
|
|
240
|
+
}),
|
|
241
|
+
name: 'With Set Menu Height'
|
|
239
242
|
};
|
|
@@ -62,7 +62,8 @@ export const WithAdditionalLinks = {
|
|
|
62
62
|
children: "Where do I begin?"
|
|
63
63
|
})
|
|
64
64
|
})
|
|
65
|
-
})
|
|
65
|
+
}),
|
|
66
|
+
name: 'With Additional Links'
|
|
66
67
|
};
|
|
67
68
|
export const WithAdditionalLinksOnTopAndBottom = {
|
|
68
69
|
render: args => /*#__PURE__*/_jsx(LayoutMenuVariant.LayoutMenu, {
|
|
@@ -218,5 +219,6 @@ export const WithSetMenuHeight = {
|
|
|
218
219
|
children: "Where do I begin?"
|
|
219
220
|
})
|
|
220
221
|
})
|
|
221
|
-
})
|
|
222
|
+
}),
|
|
223
|
+
name: 'With Set Menu Height'
|
|
222
224
|
};
|
|
@@ -48,12 +48,14 @@ export default meta;
|
|
|
48
48
|
export const FeaturedInfo = {
|
|
49
49
|
render: args => /*#__PURE__*/_jsx(PageFeatures, {
|
|
50
50
|
...args
|
|
51
|
-
})
|
|
51
|
+
}),
|
|
52
|
+
name: 'Featured Info'
|
|
52
53
|
};
|
|
53
54
|
export const FeaturedImages = {
|
|
54
55
|
render: args => /*#__PURE__*/_jsx(PageFeatures, {
|
|
55
56
|
...args
|
|
56
57
|
}),
|
|
58
|
+
name: 'Featured Images',
|
|
57
59
|
args: {
|
|
58
60
|
featuresMedia: 'image'
|
|
59
61
|
}
|
|
@@ -62,6 +64,7 @@ export const FeaturedIcons = {
|
|
|
62
64
|
render: args => /*#__PURE__*/_jsx(PageFeatures, {
|
|
63
65
|
...args
|
|
64
66
|
}),
|
|
67
|
+
name: 'Featured Icons',
|
|
65
68
|
args: {
|
|
66
69
|
featuresMedia: 'icon'
|
|
67
70
|
}
|
|
@@ -70,6 +73,7 @@ export const FeaturedStats = {
|
|
|
70
73
|
render: args => /*#__PURE__*/_jsx(PageFeatures, {
|
|
71
74
|
...args
|
|
72
75
|
}),
|
|
76
|
+
name: 'Featured Stats',
|
|
73
77
|
args: {
|
|
74
78
|
featuresMedia: 'stat',
|
|
75
79
|
features: [{
|
|
@@ -91,6 +95,7 @@ export const FeaturesGrid = {
|
|
|
91
95
|
render: args => /*#__PURE__*/_jsx(PageFeatures, {
|
|
92
96
|
...args
|
|
93
97
|
}),
|
|
98
|
+
name: 'Features Grid',
|
|
94
99
|
args: {
|
|
95
100
|
maxCols: 3,
|
|
96
101
|
featuresMedia: 'icon'
|
|
@@ -100,6 +105,7 @@ export const WithoutDescription = {
|
|
|
100
105
|
render: args => /*#__PURE__*/_jsx(PageFeatures, {
|
|
101
106
|
...args
|
|
102
107
|
}),
|
|
108
|
+
name: 'Without Description',
|
|
103
109
|
args: {
|
|
104
110
|
featuresMedia: 'icon',
|
|
105
111
|
desc: undefined,
|
|
@@ -123,6 +129,7 @@ export const RegularButton = {
|
|
|
123
129
|
buttonType: 'fill'
|
|
124
130
|
}
|
|
125
131
|
}),
|
|
132
|
+
name: 'Regular Button',
|
|
126
133
|
args: {
|
|
127
134
|
featuresMedia: 'image'
|
|
128
135
|
}
|
|
@@ -135,6 +142,7 @@ export const DarkMode = {
|
|
|
135
142
|
...args
|
|
136
143
|
})
|
|
137
144
|
}),
|
|
145
|
+
name: 'Dark Mode',
|
|
138
146
|
args: {
|
|
139
147
|
featuresMedia: 'icon'
|
|
140
148
|
}
|
|
@@ -46,13 +46,15 @@ export const Video = {
|
|
|
46
46
|
autoplay: true
|
|
47
47
|
},
|
|
48
48
|
title: "What's it like to be a Software Engineer"
|
|
49
|
-
})
|
|
49
|
+
}),
|
|
50
|
+
name: 'Video'
|
|
50
51
|
};
|
|
51
52
|
export const ShortText = {
|
|
52
53
|
render: args => /*#__PURE__*/_jsx(PageHero, {
|
|
53
54
|
...args,
|
|
54
55
|
textLength: "short"
|
|
55
|
-
})
|
|
56
|
+
}),
|
|
57
|
+
name: 'Short Text'
|
|
56
58
|
};
|
|
57
59
|
export const RegularButton = {
|
|
58
60
|
render: args => /*#__PURE__*/_jsx(PageHero, {
|
|
@@ -61,19 +63,22 @@ export const RegularButton = {
|
|
|
61
63
|
...ctaArgs,
|
|
62
64
|
buttonType: 'fill'
|
|
63
65
|
}
|
|
64
|
-
})
|
|
66
|
+
}),
|
|
67
|
+
name: 'Regular Button'
|
|
65
68
|
};
|
|
66
69
|
export const WithoutButton = {
|
|
67
70
|
render: args => /*#__PURE__*/_jsx(PageHero, {
|
|
68
71
|
...args,
|
|
69
72
|
cta: undefined
|
|
70
|
-
})
|
|
73
|
+
}),
|
|
74
|
+
name: 'Without Button'
|
|
71
75
|
};
|
|
72
76
|
export const WithoutDescription = {
|
|
73
77
|
render: args => /*#__PURE__*/_jsx(PageHero, {
|
|
74
78
|
...args,
|
|
75
79
|
desc: undefined
|
|
76
|
-
})
|
|
80
|
+
}),
|
|
81
|
+
name: 'Without Description'
|
|
77
82
|
};
|
|
78
83
|
export const Eyebrow = {
|
|
79
84
|
render: args => /*#__PURE__*/_jsx(PageHero, {
|
|
@@ -82,7 +87,8 @@ export const Eyebrow = {
|
|
|
82
87
|
text: 'Hello there'
|
|
83
88
|
},
|
|
84
89
|
textLength: "short"
|
|
85
|
-
})
|
|
90
|
+
}),
|
|
91
|
+
name: 'Eyebrow'
|
|
86
92
|
};
|
|
87
93
|
export const AccentEyebrow = {
|
|
88
94
|
render: args => /*#__PURE__*/_jsx(PageHero, {
|
|
@@ -92,20 +98,23 @@ export const AccentEyebrow = {
|
|
|
92
98
|
accent: true
|
|
93
99
|
},
|
|
94
100
|
textLength: "short"
|
|
95
|
-
})
|
|
101
|
+
}),
|
|
102
|
+
name: 'Accent Eyebrow'
|
|
96
103
|
};
|
|
97
104
|
export const ShowImageOnMobile = {
|
|
98
105
|
render: args => /*#__PURE__*/_jsx(PageHero, {
|
|
99
106
|
...args,
|
|
100
107
|
showImageOnMobile: true,
|
|
101
108
|
textLength: "short"
|
|
102
|
-
})
|
|
109
|
+
}),
|
|
110
|
+
name: 'Show Image On Mobile'
|
|
103
111
|
};
|
|
104
112
|
export const WithoutMedia = {
|
|
105
113
|
render: args => /*#__PURE__*/_jsx(PageHero, {
|
|
106
114
|
...args,
|
|
107
115
|
media: undefined
|
|
108
|
-
})
|
|
116
|
+
}),
|
|
117
|
+
name: 'Without Media'
|
|
109
118
|
};
|
|
110
119
|
export const DarkMode = {
|
|
111
120
|
render: args => /*#__PURE__*/_jsx(Background, {
|
|
@@ -117,7 +126,8 @@ export const DarkMode = {
|
|
|
117
126
|
text: 'Hello there'
|
|
118
127
|
}
|
|
119
128
|
})
|
|
120
|
-
})
|
|
129
|
+
}),
|
|
130
|
+
name: 'Dark Mode'
|
|
121
131
|
};
|
|
122
132
|
export const PausableImage = {
|
|
123
133
|
render: args => /*#__PURE__*/_jsx(PageHero, {
|