@codecademy/brand 3.0.0-alpha.da574fc3ea.0 → 3.1.0-alpha.02a4ffb480.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 +10 -6
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/NavPanels.d.ts +10 -4
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/NavPanels.js +250 -76
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/NavSection.js +15 -7
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/consts.d.ts +3 -1
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/consts.js +11 -2
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/index.js +58 -26
- package/dist/AppHeader/AppHeaderElements/AppHeaderDietCard/index.d.ts +10 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderDietCard/index.js +82 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownProvider/index.d.ts +1 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownProvider/index.js +5 -2
- package/dist/AppHeaderMobile/AppHeaderCatalogSectonVariantMobile/index.d.ts +4 -0
- package/dist/AppHeaderMobile/AppHeaderCatalogSectonVariantMobile/index.js +63 -0
- package/dist/AppHeaderMobile/AppHeaderMainMenuMobile/index.js +34 -14
- package/dist/AppHeaderMobile/AppHeaderSubMenuMobile/index.js +12 -5
- package/dist/GlobalHeader/GlobalHeaderItems.d.ts +2 -0
- package/dist/GlobalHeader/GlobalHeaderItems.js +18 -1
- package/dist/GlobalHeader/GlobalHeaderVariants.d.ts +2 -2
- package/dist/GlobalHeader/GlobalHeaderVariants.js +39 -17
- package/dist/GlobalHeader/index.d.ts +1 -0
- package/dist/GlobalHeader/index.js +46 -42
- package/dist/GlobalHeader/types.d.ts +1 -0
- package/dist/LearningOutcomeFlyout/LearningOutcomeCardList.d.ts +2 -1
- package/dist/LearningOutcomeFlyout/LearningOutcomeCardList.js +26 -7
- package/dist/LearningOutcomeFlyout/index.d.ts +5 -47
- package/dist/LearningOutcomeFlyout/index.js +32 -21
- package/dist/LearningOutcomeFlyout/types.d.ts +49 -0
- package/dist/LearningOutcomeFlyout/types.js +5 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/stories/Molecules/LearningOutcomeFlyout.stories.js +8 -4
- package/package.json +1 -1
- package/dist/CourseRecommendationsLink/index.d.ts +0 -3
- package/dist/CourseRecommendationsLink/index.js +0 -27
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { addPayment, bootcampCta, businessSolutions, catalogDropdown, communityDropdown, enterpriseLogo, freeProfile, liveLearningHub, loading, login, logo, myHome, myPercipioHome, pricingDropdown, proProfile, resourcesDropdown, signUp, simpleResourcesDropdown, tryProForFree, unpausePro, upgradePlan, upgradeToPro } from './GlobalHeaderItems';
|
|
1
|
+
import { addPayment, bootcampCta, businessSolutions, catalogDropdown, communityDropdown, enterpriseLogo, freeProfile, liveLearningHub, loading, login, logo, myHome, myPercipioHome, pricingDropdown, proProfile, requestTeamsDemo, resourcesDropdown, signUp, signUpTextButton, simpleResourcesDropdown, tryProForFree, unpausePro, upgradePlan, upgradeToPro } from './GlobalHeaderItems';
|
|
2
|
+
const isBusinessPage = isBlpHeroExperimentVariant => {
|
|
3
|
+
if (typeof window === 'undefined') return false;
|
|
4
|
+
return window.location.pathname === '/business' && Boolean(isBlpHeroExperimentVariant);
|
|
5
|
+
};
|
|
2
6
|
const transformSimpleResourcesDropdownlabels = resourcesLabel => ({
|
|
3
7
|
...simpleResourcesDropdown,
|
|
4
8
|
text: resourcesLabel?.title || simpleResourcesDropdown.text,
|
|
@@ -7,36 +11,54 @@ const transformSimpleResourcesDropdownlabels = resourcesLabel => ({
|
|
|
7
11
|
text: resourcesLabel?.[item.id] || item.text
|
|
8
12
|
}))
|
|
9
13
|
});
|
|
10
|
-
const anonHeaderItems = (renderLogin, renderSignUp, hidePricing, user) => {
|
|
14
|
+
const anonHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isBlpHeroExperimentVariant) => {
|
|
11
15
|
const specialLogo = {
|
|
12
16
|
...logo,
|
|
13
17
|
checkMini: true
|
|
14
18
|
};
|
|
15
19
|
const leftItems = [specialLogo, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), liveLearningHub, businessSolutions];
|
|
16
20
|
const rightItems = [];
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
if (isBusinessPage(isBlpHeroExperimentVariant)) {
|
|
22
|
+
if (renderSignUp) {
|
|
23
|
+
rightItems.push(signUpTextButton);
|
|
24
|
+
}
|
|
25
|
+
if (renderLogin) {
|
|
26
|
+
rightItems.push(requestTeamsDemo);
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
if (renderLogin) {
|
|
30
|
+
rightItems.push(login);
|
|
31
|
+
}
|
|
32
|
+
if (renderSignUp) {
|
|
33
|
+
rightItems.push(signUp);
|
|
34
|
+
}
|
|
22
35
|
}
|
|
23
36
|
return {
|
|
24
37
|
left: leftItems,
|
|
25
38
|
right: rightItems
|
|
26
39
|
};
|
|
27
40
|
};
|
|
28
|
-
const anonMobileHeaderItems = (renderLogin, renderSignUp, hidePricing, user) => {
|
|
41
|
+
const anonMobileHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isBlpHeroExperimentVariant) => {
|
|
29
42
|
const specialLogo = {
|
|
30
43
|
...logo,
|
|
31
44
|
checkMini: true
|
|
32
45
|
};
|
|
33
46
|
const leftItems = [specialLogo];
|
|
34
47
|
const rightItems = [];
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
if (isBusinessPage(isBlpHeroExperimentVariant)) {
|
|
49
|
+
if (renderSignUp) {
|
|
50
|
+
rightItems.push(signUpTextButton);
|
|
51
|
+
}
|
|
52
|
+
if (renderLogin) {
|
|
53
|
+
rightItems.push(requestTeamsDemo);
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
if (renderLogin) {
|
|
57
|
+
rightItems.push(login);
|
|
58
|
+
}
|
|
59
|
+
if (renderSignUp) {
|
|
60
|
+
rightItems.push(signUp);
|
|
61
|
+
}
|
|
40
62
|
}
|
|
41
63
|
const mainMenuItems = [catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), liveLearningHub, businessSolutions];
|
|
42
64
|
return {
|
|
@@ -45,11 +67,11 @@ const anonMobileHeaderItems = (renderLogin, renderSignUp, hidePricing, user) =>
|
|
|
45
67
|
mainMenu: mainMenuItems
|
|
46
68
|
};
|
|
47
69
|
};
|
|
48
|
-
export const anonDefaultHeaderItems = (hidePricing, user) => {
|
|
49
|
-
return anonHeaderItems(true, true, hidePricing, user);
|
|
70
|
+
export const anonDefaultHeaderItems = (hidePricing, user, isBlpHeroExperimentVariant) => {
|
|
71
|
+
return anonHeaderItems(true, true, hidePricing, user, isBlpHeroExperimentVariant);
|
|
50
72
|
};
|
|
51
|
-
export const anonDefaultMobileHeaderItems = (hidePricing, user) => {
|
|
52
|
-
return anonMobileHeaderItems(true, true, hidePricing, user);
|
|
73
|
+
export const anonDefaultMobileHeaderItems = (hidePricing, user, isBlpHeroExperimentVariant) => {
|
|
74
|
+
return anonMobileHeaderItems(true, true, hidePricing, user, isBlpHeroExperimentVariant);
|
|
53
75
|
};
|
|
54
76
|
export const anonLandingHeaderItems = (hidePricing, user) => {
|
|
55
77
|
return anonHeaderItems(true, false, hidePricing, user);
|
|
@@ -7,5 +7,6 @@ export declare const HeaderQuizContext: React.Context<{
|
|
|
7
7
|
showSortingQuiz?: boolean;
|
|
8
8
|
}>;
|
|
9
9
|
export declare const GlobalNavRedesignContext: React.Context<boolean>;
|
|
10
|
+
export declare const BlpHeroExperimentContext: React.Context<boolean>;
|
|
10
11
|
export type GlobalHeaderProps = AnonHeader | FreeHeader | ProHeader | EnterpriseHeader | TeamsHeader | LoadingHeader | SimpleHeader | SimpleBootcampHeader;
|
|
11
12
|
export declare const GlobalHeader: React.FC<GlobalHeaderProps>;
|
|
@@ -13,6 +13,7 @@ export const HeaderQuizContext = /*#__PURE__*/React.createContext({
|
|
|
13
13
|
showSortingQuiz: false
|
|
14
14
|
});
|
|
15
15
|
export const GlobalNavRedesignContext = /*#__PURE__*/React.createContext(false);
|
|
16
|
+
export const BlpHeroExperimentContext = /*#__PURE__*/React.createContext(false);
|
|
16
17
|
|
|
17
18
|
// Overloading getAppHeaderItems function to return different types based on mobile parameter
|
|
18
19
|
|
|
@@ -30,7 +31,7 @@ function getAppHeaderItems(props, mobile) {
|
|
|
30
31
|
case 'signup':
|
|
31
32
|
return mobile ? anonSignupMobileHeaderItems(hidePricing, props.user) : anonSignupHeaderItems(hidePricing, props.user);
|
|
32
33
|
default:
|
|
33
|
-
return mobile ? anonDefaultMobileHeaderItems(hidePricing, props.user) : anonDefaultHeaderItems(hidePricing, props.user);
|
|
34
|
+
return mobile ? anonDefaultMobileHeaderItems(hidePricing, props.user, props.isBlpHeroExperimentVariant) : anonDefaultHeaderItems(hidePricing, props.user, props.isBlpHeroExperimentVariant);
|
|
34
35
|
}
|
|
35
36
|
case 'enterprise':
|
|
36
37
|
return mobile ? enterpriseMobileHeaderItems(props.user, props) : enterpriseHeaderItems(props.user, props);
|
|
@@ -68,47 +69,50 @@ export const GlobalHeader = props => {
|
|
|
68
69
|
},
|
|
69
70
|
children: /*#__PURE__*/_jsx(GlobalNavRedesignContext.Provider, {
|
|
70
71
|
value: !!props.displayGlobalNavRedesign,
|
|
71
|
-
children: /*#__PURE__*/_jsx(
|
|
72
|
-
value:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
72
|
+
children: /*#__PURE__*/_jsx(BlpHeroExperimentContext.Provider, {
|
|
73
|
+
value: !!props.isBlpHeroExperimentVariant,
|
|
74
|
+
children: /*#__PURE__*/_jsx(GlobalHeaderItemClickContext.Provider, {
|
|
75
|
+
value: {
|
|
76
|
+
globalHeaderItemClick: combinedAction
|
|
77
|
+
},
|
|
78
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
79
|
+
as: "header",
|
|
80
|
+
position: "sticky",
|
|
81
|
+
top: 0,
|
|
82
|
+
zIndex: theme.elements.headerZ,
|
|
83
|
+
overflow: {
|
|
84
|
+
_: 'hidden',
|
|
85
|
+
sm: 'visible'
|
|
86
|
+
} // Prevent tooltip overflow on mobile
|
|
87
|
+
,
|
|
88
|
+
children: [/*#__PURE__*/_jsx(AppHeader, {
|
|
89
|
+
action: combinedAction,
|
|
90
|
+
items: getAppHeaderItems(props, false),
|
|
91
|
+
search: props.search,
|
|
92
|
+
...(props.type === 'anon' ? {
|
|
93
|
+
redirectParam: props.redirectParam
|
|
94
|
+
} : hideNotification ? {} : {
|
|
95
|
+
notifications: props.notifications
|
|
96
|
+
}),
|
|
97
|
+
hideRightButtonDefaults: hideNotification,
|
|
98
|
+
isAnon: props.type === 'anon',
|
|
99
|
+
isTeams: props.type === 'teams',
|
|
100
|
+
type: hideNotification ? 'enterprise' : 'standard'
|
|
101
|
+
}), /*#__PURE__*/_jsx(AppHeaderMobile, {
|
|
102
|
+
action: combinedAction,
|
|
103
|
+
items: getAppHeaderItems(props, true),
|
|
104
|
+
...(props.type === 'anon' || hideNotification ? {} : {
|
|
105
|
+
notifications: props.notifications
|
|
106
|
+
}),
|
|
107
|
+
search: props.search,
|
|
108
|
+
redirectParam: props.type === 'anon' ? props.redirectParam : undefined,
|
|
109
|
+
isEnterprise: props.type === 'enterprise',
|
|
110
|
+
isAnon: props.type === 'anon',
|
|
111
|
+
isSimple: props.type === 'simple',
|
|
112
|
+
hideRightMenuButton: props.type === 'simple' || props.type === 'loading',
|
|
113
|
+
navigationMenuFormattedLabel: props?.localizedLabels?.navigationMenuFormattedLabel
|
|
114
|
+
}), props.children]
|
|
115
|
+
})
|
|
112
116
|
})
|
|
113
117
|
})
|
|
114
118
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ParentLearningOutcome } from '
|
|
1
|
+
import { ParentLearningOutcome } from './types';
|
|
2
2
|
interface LearningOutcomeCardListProps {
|
|
3
3
|
learningOutcomes: ParentLearningOutcome[];
|
|
4
|
+
onClick?: (misc: Record<string, string>) => void;
|
|
4
5
|
}
|
|
5
6
|
export declare const LearningOutcomeCardList: React.FC<LearningOutcomeCardListProps>;
|
|
6
7
|
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { FlexBox } from '@codecademy/gamut';
|
|
1
|
+
import { Anchor, Box, FlexBox } from '@codecademy/gamut';
|
|
2
2
|
import { LearningOutcomeCard } from '../LearningOutcomeCard';
|
|
3
|
+
import { getLearningOutcomePath, miscTrackingData } from '.';
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
export const LearningOutcomeCardList = ({
|
|
5
|
-
learningOutcomes
|
|
6
|
+
learningOutcomes,
|
|
7
|
+
onClick
|
|
6
8
|
}) => {
|
|
7
9
|
return /*#__PURE__*/_jsx(FlexBox, {
|
|
8
10
|
as: "ul",
|
|
@@ -14,10 +16,27 @@ export const LearningOutcomeCardList = ({
|
|
|
14
16
|
id,
|
|
15
17
|
level,
|
|
16
18
|
outcome
|
|
17
|
-
}) =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
}) => {
|
|
20
|
+
const trackingData = miscTrackingData(level, id, undefined, outcome);
|
|
21
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
22
|
+
as: "li",
|
|
23
|
+
listStyle: "none",
|
|
24
|
+
m: 0,
|
|
25
|
+
p: 0,
|
|
26
|
+
width: "100%",
|
|
27
|
+
children: /*#__PURE__*/_jsx(Anchor, {
|
|
28
|
+
href: getLearningOutcomePath(id),
|
|
29
|
+
onClick: () => onClick?.(trackingData),
|
|
30
|
+
target: "_blank",
|
|
31
|
+
variant: "interface",
|
|
32
|
+
width: "100%",
|
|
33
|
+
children: /*#__PURE__*/_jsx(LearningOutcomeCard, {
|
|
34
|
+
level: level,
|
|
35
|
+
outcome: outcome,
|
|
36
|
+
isInteractive: true
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
}, id);
|
|
40
|
+
})
|
|
22
41
|
});
|
|
23
42
|
};
|
|
@@ -1,50 +1,8 @@
|
|
|
1
1
|
import { LearningOutcomeLevels } from '../LearningOutcomeBadges';
|
|
2
|
-
|
|
3
|
-
Language = "language",
|
|
4
|
-
Subject = "subject"
|
|
5
|
-
}
|
|
6
|
-
interface LearningOutcomeSkill {
|
|
7
|
-
id: string;
|
|
8
|
-
slug: string;
|
|
9
|
-
title?: string | null;
|
|
10
|
-
classification?: SkillClassification | null;
|
|
11
|
-
}
|
|
12
|
-
export interface ParentLearningOutcome {
|
|
13
|
-
id: string;
|
|
14
|
-
outcome: string;
|
|
15
|
-
level: number | null | undefined;
|
|
16
|
-
}
|
|
17
|
-
export interface LearningOutcomeDetailsProps {
|
|
18
|
-
level: LearningOutcomeLevels;
|
|
19
|
-
outcome: string;
|
|
20
|
-
percentComplete: number | undefined | null;
|
|
21
|
-
highestScore: number | undefined | null;
|
|
22
|
-
highestScoreAchievedAt: string | undefined | null;
|
|
23
|
-
latestScore: number | undefined | null;
|
|
24
|
-
latestScoreAchievedAt: string | undefined | null;
|
|
25
|
-
parentLOs?: ParentLearningOutcome[];
|
|
26
|
-
skills?: LearningOutcomeSkill[] | null;
|
|
27
|
-
childLearningOutcomes?: {
|
|
28
|
-
id: string;
|
|
29
|
-
outcome: string;
|
|
30
|
-
percentComplete?: number | undefined | null;
|
|
31
|
-
progress?: {
|
|
32
|
-
latestScore?: number | null;
|
|
33
|
-
covered: boolean | undefined | null;
|
|
34
|
-
coveredAt?: string | null;
|
|
35
|
-
highestScore?: number | null;
|
|
36
|
-
};
|
|
37
|
-
}[];
|
|
38
|
-
}
|
|
39
|
-
interface LearningOutcomeFlyoutProps {
|
|
40
|
-
expanded: boolean;
|
|
41
|
-
onClose: () => void;
|
|
42
|
-
learningOutcome: LearningOutcomeDetailsProps;
|
|
43
|
-
learningOutcomeHref: string;
|
|
44
|
-
learningOutcomeOnClick?: () => void;
|
|
45
|
-
skillTagOnClick?: (skillSlug: string) => void;
|
|
46
|
-
childLearningOutcomeOnClick?: () => void;
|
|
47
|
-
}
|
|
2
|
+
import { LearningOutcomeFlyoutProps, LearningOutcomeSkill } from './types';
|
|
48
3
|
export declare const sortSkillsByClassification: (skills?: LearningOutcomeSkill[] | null) => LearningOutcomeSkill[];
|
|
4
|
+
export declare const getLearningOutcomePath: (id?: string) => string;
|
|
5
|
+
export declare const miscTrackingData: (level?: LearningOutcomeLevels | null, id?: string, latestScore?: number | null, outcome?: string) => {
|
|
6
|
+
misc: string;
|
|
7
|
+
};
|
|
49
8
|
export declare const LearningOutcomeFlyout: React.FC<LearningOutcomeFlyoutProps>;
|
|
50
|
-
export {};
|