@codecademy/brand 3.22.1 → 3.23.0-alpha.baf109039b.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/AppHeaderMobile/AppHeaderMainMenuMobile/index.js +5 -6
- package/dist/GlobalHeader/GlobalHeaderVariants.d.ts +77 -22
- package/dist/GlobalHeader/GlobalHeaderVariants.js +150 -32
- package/dist/GlobalHeader/index.d.ts +0 -1
- package/dist/GlobalHeader/index.js +114 -60
- package/dist/GlobalHeader/types.d.ts +0 -1
- package/package.json +1 -1
|
@@ -5,15 +5,15 @@ import { useContext, useState } from 'react';
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { AppHeaderLink } from '../../AppHeader/AppHeaderElements/AppHeaderLink';
|
|
7
7
|
import { AppHeaderLinkSections } from '../../AppHeader/AppHeaderElements/AppHeaderLinkSections';
|
|
8
|
-
import {
|
|
8
|
+
import { GlobalNavRedesignContext } from '../../GlobalHeader';
|
|
9
9
|
import { login, requestTeamsDemo, signUp, signUpTextButton } from '../../GlobalHeader/GlobalHeaderItems';
|
|
10
10
|
import { AppHeaderSubNavMobile } from '../AppHeaderSubMenuMobile';
|
|
11
11
|
import { MobileUlWrapper } from '../AppHeaderSubMenuMobile/elements';
|
|
12
12
|
import { AppHeaderSubMenuRow } from '../AppHeaderSubMenuTarget';
|
|
13
13
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
const
|
|
14
|
+
const isBusinessPage = () => {
|
|
15
15
|
if (typeof window === 'undefined') return false;
|
|
16
|
-
return
|
|
16
|
+
return window.location.pathname === '/business' || window.location.pathname === '/business/pricing';
|
|
17
17
|
};
|
|
18
18
|
const BackgroundWrapper = /*#__PURE__*/_styled(Box, {
|
|
19
19
|
target: "emi0o3k0",
|
|
@@ -26,7 +26,7 @@ const BackgroundWrapper = /*#__PURE__*/_styled(Box, {
|
|
|
26
26
|
borderRadius: 'lg',
|
|
27
27
|
padding: '16px'
|
|
28
28
|
}
|
|
29
|
-
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
29
|
+
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9BcHBIZWFkZXJNb2JpbGUvQXBwSGVhZGVyTWFpbk1lbnVNb2JpbGUvaW5kZXgudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVDMEIiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL0FwcEhlYWRlck1vYmlsZS9BcHBIZWFkZXJNYWluTWVudU1vYmlsZS9pbmRleC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1xuICBCb3gsXG4gIENvbnRlbnRDb250YWluZXIsXG4gIEZpbGxCdXR0b24sXG4gIFRleHQsXG4gIFRleHRCdXR0b24sXG59IGZyb20gJ0Bjb2RlY2FkZW15L2dhbXV0JztcbmltcG9ydCB7IGNzcywgc3RhdGVzLCB0aGVtZSB9IGZyb20gJ0Bjb2RlY2FkZW15L2dhbXV0LXN0eWxlcyc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyB1c2VDb250ZXh0LCB1c2VTdGF0ZSB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCAqIGFzIFJlYWN0IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0IHsgQXBwSGVhZGVyTGluayB9IGZyb20gJy4uLy4uL0FwcEhlYWRlci9BcHBIZWFkZXJFbGVtZW50cy9BcHBIZWFkZXJMaW5rJztcbmltcG9ydCB7IEFwcEhlYWRlckxpbmtTZWN0aW9ucyB9IGZyb20gJy4uLy4uL0FwcEhlYWRlci9BcHBIZWFkZXJFbGVtZW50cy9BcHBIZWFkZXJMaW5rU2VjdGlvbnM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ldHVybiAoXG4gICAgICAgICAgPD5cbiAgICAgICAgICAgIDxUZXh0IGFzPVwiaDJcIiBmb250U2l6ZT17MjJ9IG10PXsxNn0gbWI9ezE2fT5cbiAgICAgICAgICAgICAge2l0ZW0udGV4dH1cbiAgICAgICAgICAgIDwvVGV4dD5cbiAgICAgICAgICAgIDxBcHBIZWFkZXJMaW5rU2VjdGlvbnMgYWN0aW9uPXthY3Rpb259IGl0ZW09e2l0ZW19IG1vYmlsZSAvPlxuICAgICAgICAgIDwvPlxuICAgICAgICApO1xuICAgICAgY2FzZSAnZmlsbC1idXR0b24nOlxuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgIDxGaWxsQnV0dG9uXG4gICAgICAgICAgICBkYXRhLXRlc3RpZD17aXRlbS5kYXRhVGVzdElkfVxuICAgICAgICAgICAgaHJlZj17aXRlbS5ocmVmfVxuICAgICAgICAgICAgb25DbGljaz17KGV2ZW50OiBSZWFjdC5Nb3VzZUV2ZW50KSA9PiBhY3Rpb24oZXZlbnQsIGl0ZW0pfVxuICAgICAgICAgICAgbXQ9ezI0fVxuICAgICAgICAgICAga2V5PXtpdGVtLmlkfVxuICAgICAgICAgID5cbiAgICAgICAgICAgIHtpdGVtLnRleHR9XG4gICAgICAgICAgPC9GaWxsQnV0dG9uPlxuICAgICAgICApO1xuICAgICAgY2FzZSAndGV4dC1idXR0b24nOlxuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgIDxUZXh0QnV0dG9uXG4gICAgICAgICAgICBtdD17MTZ9XG4gICAgICAgICAgICBrZXk9e2l0ZW0uaWR9XG4gICAgICAgICAgICBkYXRhLXRlc3RpZD17aXRlbS5kYXRhVGVzdElkfVxuICAgICAgICAgICAgaHJlZj17aXRlbS5ocmVmfVxuICAgICAgICAgICAgb25DbGljaz17KGV2ZW50OiBSZWFjdC5Nb3VzZUV2ZW50KSA9PiBhY3Rpb24oZXZlbnQsIGl0ZW0pfVxuICAgICAgICAgID5cbiAgICAgICAgICAgIHtpdGVtL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yZGVyVG9wOiAnMXB4IHNvbGlkIHZhcigtLWJvcmRlci10ZXJ0aWFyeSknLFxuICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgPlxuICAgICAgICAgICAgICB7aXNCdXNpbmVzc1BhZ2UoKSA/IChcbiAgICAgICAgICAgICAgICA8PlxuICAgICAgICAgICAgICAgICAgPFRleHRCdXR0b25cbiAgICAgICAgICAgICAgICAgICAgZGF0YS10ZXN0aWQ9e3NpZ25VcFRleHRCdXR0b24uZGF0YVRlc3RJZH1cbiAgICAgICAgICAgICAgICAgICAgaHJlZj17c2lnblVwVGV4dEJ1dHRvbi5ocmVmfVxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrPXsoZXZlbnQ6IFJlYWN0Lk1vdXNlRXZlbnQpID0+XG4gICAgICAgICAgICAgICAgICAgICAgYWN0aW9uKGV2ZW50LCBzaWduVXBUZXh0QnV0dG9uKVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGtleT17c2lnblVwVGV4dEJ1dHRvbi5pZH1cbiAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAge3NpZ25VcFRleHRCdXR0b24udGV4dH1cbiAgICAgICAgICAgICAgICAgIDwvVGV4dEJ1dHRvbj5cblxuICAgICAgICAgICAgICAgICAgPEZpbGxCdXR0b25cbiAgICAgICAgICAgICAgICAgICAgZGF0YS10ZXN0aWQ9e3JlcXVlc3RUZWFtc0RlbW8uZGF0YVRlc3RJZH1cbiAgICAgICAgICAgICAgICAgICAgaHJlZj17cmVxdWVzdFRlYW1zRGVtby5ocmVmfVxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrPXsoZXZlbnQ6IFJlYWN0Lk1vdXNlRXZlbnQpID0+XG4gICAgICAgICAgICAgICAgICAgICAgYWN0aW9uKGV2ZW50LCByZXF1ZXN0VGVhbXNEZW1vKVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGtleT17cmVxdWVzdFRlYW1zRGVtby5pZH1cbiAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAge3JlcXVlc3RUZWFtc0RlbW8udGV4dH1cbiAgICAgICAgICAgICAgICAgIDwvRmlsbEJ1dHRvbj5cbiAgICAgICAgICAgICAgICA8Lz5cbiAgICAgICAgICAgICAgKSA6IChcbiAgICAgICAgICAgICAgICA8PlxuICAgICAgICAgICAgICAgICAgPEZpbGxCdXR0b25cbiAgICAgICAgICAgICAgICAgICAgZGF0YS10ZXN0aWQ9e3NpZ25VcC5kYXRhVGVzdElkfVxuICAgICAgICAgICAgICAgICAgICBocmVmPXtzaWduVXAuaHJlZn1cbiAgICAgICAgICAgICAgICAgICAgb25DbGljaz17KGV2ZW50OiBSZWFjdC5Nb3VzZUV2ZW50KSA9PiBhY3Rpb24oZXZlbnQsIHNpZ25VcCl9XG4gICAgICAgICAgICAgICAgICAgIGtleT17c2lnblVwLmlkfVxuICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICB7c2lnblVwLnRleHR9XG4gICAgICAgICAgICAgICAgICA8L0ZpbGxCdXR0b24+XG5cbiAgICAgICAgICAgICAgICAgIDxUZXh0QnV0dG9uXG4gICAgICAgICAgICAgICAgICAgIGtleT17bG9naW4uaWR9XG4gICAgICAgICAgICAgICAgICAgIGRhdGEtdGVzdGlkPXtsb2dpbi5kYXRhVGVzdElkfVxuICAgICAgICAgICAgICAgICAgICBocmVmPXtsb2dpbi5ocmVmfVxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrPXsoZXZlbnQ6IFJlYWN0Lk1vdXNlRXZlbnQpID0+IGFjdGlvbihldmVudCwgbG9naW4pfVxuICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICB7bG9naW4udGV4dH1cbiAgICAgICAgICAgICAgICAgIDwvVGV4dEJ1dHRvbj5cbiAgICAgICAgICAgICAgICA8Lz5cbiAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICl9XG4gICAgICAgIDwvTW9iaWxlVWxXcmFwcGVyPlxuICAgICAgPC9CYWNrZ3JvdW5kV3JhcHBlcj5cbiAgICA8L0NvbnRlbnRDb250YWluZXI+XG4gICk7XG59O1xuIl19 */");
|
|
30
30
|
export const AppHeaderMainMenuMobile = ({
|
|
31
31
|
action,
|
|
32
32
|
items,
|
|
@@ -35,7 +35,6 @@ export const AppHeaderMainMenuMobile = ({
|
|
|
35
35
|
handleCloseMainMenu
|
|
36
36
|
}) => {
|
|
37
37
|
const [subMenuItem, setSubMenuItem] = useState();
|
|
38
|
-
const isBlpHeroExperimentVariant = useContext(BlpHeroExperimentContext);
|
|
39
38
|
const displayGlobalNavRedesign = useContext(GlobalNavRedesignContext);
|
|
40
39
|
const openSubMenu = (event, item) => {
|
|
41
40
|
action(event, item);
|
|
@@ -117,7 +116,7 @@ export const AppHeaderMainMenuMobile = ({
|
|
|
117
116
|
paddingTop: '16px',
|
|
118
117
|
borderTop: '1px solid var(--border-tertiary)'
|
|
119
118
|
},
|
|
120
|
-
children:
|
|
119
|
+
children: isBusinessPage() ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
121
120
|
children: [/*#__PURE__*/_jsx(TextButton, {
|
|
122
121
|
"data-testid": signUpTextButton.dataTestId,
|
|
123
122
|
href: signUpTextButton.href,
|
|
@@ -1,28 +1,83 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FormattedAppHeaderItems, FormattedMobileAppHeaderItems } from '../AppHeader/shared';
|
|
2
2
|
import { GlobalHeaderProps } from '.';
|
|
3
3
|
import { User } from './types';
|
|
4
|
-
export declare const anonDefaultHeaderItems: (hidePricing
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export declare const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
export declare const anonDefaultHeaderItems: ({ hidePricing, user, isInRevampedBlpExperimentVariant, }: {
|
|
5
|
+
hidePricing?: boolean;
|
|
6
|
+
user?: User;
|
|
7
|
+
isInRevampedBlpExperimentVariant?: boolean;
|
|
8
|
+
}) => FormattedAppHeaderItems;
|
|
9
|
+
export declare const anonDefaultMobileHeaderItems: ({ hidePricing, user, isInRevampedBlpExperimentVariant, }: {
|
|
10
|
+
hidePricing?: boolean;
|
|
11
|
+
user?: User;
|
|
12
|
+
isInRevampedBlpExperimentVariant?: boolean;
|
|
13
|
+
}) => FormattedMobileAppHeaderItems;
|
|
14
|
+
export declare const anonLandingHeaderItems: ({ hidePricing, user, isInRevampedBlpExperimentVariant, }: {
|
|
15
|
+
hidePricing?: boolean;
|
|
16
|
+
user?: User;
|
|
17
|
+
isInRevampedBlpExperimentVariant?: boolean;
|
|
18
|
+
}) => FormattedAppHeaderItems;
|
|
19
|
+
export declare const anonLandingMobileHeaderItems: ({ hidePricing, user, isInRevampedBlpExperimentVariant, }: {
|
|
20
|
+
hidePricing?: boolean;
|
|
21
|
+
user?: User;
|
|
22
|
+
isInRevampedBlpExperimentVariant?: boolean;
|
|
23
|
+
}) => FormattedMobileAppHeaderItems;
|
|
24
|
+
export declare const anonLoginHeaderItems: ({ hidePricing, user, isInRevampedBlpExperimentVariant, }: {
|
|
25
|
+
hidePricing?: boolean;
|
|
26
|
+
user?: User;
|
|
27
|
+
isInRevampedBlpExperimentVariant?: boolean;
|
|
28
|
+
}) => FormattedAppHeaderItems;
|
|
29
|
+
export declare const anonLoginMobileHeaderItems: ({ hidePricing, user, isInRevampedBlpExperimentVariant, }: {
|
|
30
|
+
hidePricing?: boolean;
|
|
31
|
+
user?: User;
|
|
32
|
+
isInRevampedBlpExperimentVariant?: boolean;
|
|
33
|
+
}) => FormattedMobileAppHeaderItems;
|
|
34
|
+
export declare const anonSignupHeaderItems: ({ hidePricing, user, isInRevampedBlpExperimentVariant, }: {
|
|
35
|
+
hidePricing?: boolean;
|
|
36
|
+
user?: User;
|
|
37
|
+
isInRevampedBlpExperimentVariant?: boolean;
|
|
38
|
+
}) => FormattedAppHeaderItems;
|
|
39
|
+
export declare const anonSignupMobileHeaderItems: ({ hidePricing, user, isInRevampedBlpExperimentVariant, }: {
|
|
40
|
+
hidePricing?: boolean;
|
|
41
|
+
user?: User;
|
|
42
|
+
isInRevampedBlpExperimentVariant?: boolean;
|
|
43
|
+
}) => FormattedMobileAppHeaderItems;
|
|
44
|
+
export declare const freeHeaderItems: ({ user, hidePricing, isInRevampedBlpExperimentVariant, }: {
|
|
45
|
+
user: User;
|
|
46
|
+
hidePricing?: boolean;
|
|
47
|
+
isInRevampedBlpExperimentVariant?: boolean;
|
|
48
|
+
}) => FormattedAppHeaderItems;
|
|
49
|
+
export declare const freeMobileHeaderItems: ({ user, hidePricing, isInRevampedBlpExperimentVariant, }: {
|
|
50
|
+
user: User;
|
|
51
|
+
hidePricing?: boolean;
|
|
52
|
+
isInRevampedBlpExperimentVariant?: boolean;
|
|
53
|
+
}) => FormattedMobileAppHeaderItems;
|
|
54
|
+
export declare const enterpriseHeaderItems: ({ user, props, }: {
|
|
55
|
+
user: User;
|
|
56
|
+
props: GlobalHeaderProps;
|
|
57
|
+
}) => FormattedAppHeaderItems;
|
|
58
|
+
export declare const proHeaderItems: ({ user, }: {
|
|
59
|
+
user: User;
|
|
60
|
+
}) => FormattedAppHeaderItems;
|
|
61
|
+
export declare const teamsHeaderItems: ({ user, }: {
|
|
62
|
+
user: User;
|
|
63
|
+
}) => FormattedAppHeaderItems;
|
|
64
|
+
export declare const enterpriseMobileHeaderItems: ({ user, props, }: {
|
|
65
|
+
user: User;
|
|
66
|
+
props: GlobalHeaderProps;
|
|
67
|
+
}) => FormattedMobileAppHeaderItems;
|
|
68
|
+
export declare const proMobileHeaderItems: ({ user, }: {
|
|
69
|
+
user: User;
|
|
70
|
+
}) => FormattedMobileAppHeaderItems;
|
|
71
|
+
export declare const teamsMobileHeaderItems: ({ user, }: {
|
|
72
|
+
user: User;
|
|
73
|
+
}) => FormattedMobileAppHeaderItems;
|
|
23
74
|
export declare const loadingHeaderItems: FormattedAppHeaderItems;
|
|
24
75
|
export declare const loadingMobileHeaderItems: FormattedMobileAppHeaderItems;
|
|
25
76
|
export declare const simpleHeaderItems: FormattedAppHeaderItems;
|
|
26
77
|
export declare const simpleMobileHeaderItems: FormattedMobileAppHeaderItems;
|
|
27
|
-
export declare const simpleBootcampHeaderItems: (bootcampSlug:
|
|
28
|
-
|
|
78
|
+
export declare const simpleBootcampHeaderItems: ({ bootcampSlug, }: {
|
|
79
|
+
bootcampSlug: string;
|
|
80
|
+
}) => FormattedAppHeaderItems;
|
|
81
|
+
export declare const simpleBootcampMobileHeaderItems: ({ bootcampSlug, }: {
|
|
82
|
+
bootcampSlug: string;
|
|
83
|
+
}) => FormattedMobileAppHeaderItems;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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 =
|
|
2
|
+
const isBusinessPage = () => {
|
|
3
3
|
if (typeof window === 'undefined') return false;
|
|
4
|
-
return
|
|
4
|
+
return window.location.pathname === '/business' || window.location.pathname === '/business/pricing';
|
|
5
5
|
};
|
|
6
6
|
const transformSimpleResourcesDropdownlabels = resourcesLabel => ({
|
|
7
7
|
...simpleResourcesDropdown,
|
|
@@ -11,14 +11,20 @@ const transformSimpleResourcesDropdownlabels = resourcesLabel => ({
|
|
|
11
11
|
text: resourcesLabel?.[item.id] || item.text
|
|
12
12
|
}))
|
|
13
13
|
});
|
|
14
|
-
const anonHeaderItems = (
|
|
14
|
+
const anonHeaderItems = ({
|
|
15
|
+
renderLogin,
|
|
16
|
+
renderSignUp,
|
|
17
|
+
hidePricing,
|
|
18
|
+
user,
|
|
19
|
+
isInRevampedBlpExperimentVariant
|
|
20
|
+
}) => {
|
|
15
21
|
const specialLogo = {
|
|
16
22
|
...logo,
|
|
17
23
|
checkMini: true
|
|
18
24
|
};
|
|
19
25
|
const leftItems = [specialLogo, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown(isInRevampedBlpExperimentVariant)]), liveLearningHub, businessSolutions];
|
|
20
26
|
const rightItems = [];
|
|
21
|
-
if (isBusinessPage(
|
|
27
|
+
if (isBusinessPage()) {
|
|
22
28
|
if (renderSignUp) {
|
|
23
29
|
rightItems.push(signUpTextButton);
|
|
24
30
|
}
|
|
@@ -38,14 +44,20 @@ const anonHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isBlpHero
|
|
|
38
44
|
right: rightItems
|
|
39
45
|
};
|
|
40
46
|
};
|
|
41
|
-
const anonMobileHeaderItems = (
|
|
47
|
+
const anonMobileHeaderItems = ({
|
|
48
|
+
renderLogin,
|
|
49
|
+
renderSignUp,
|
|
50
|
+
hidePricing,
|
|
51
|
+
user,
|
|
52
|
+
isInRevampedBlpExperimentVariant
|
|
53
|
+
}) => {
|
|
42
54
|
const specialLogo = {
|
|
43
55
|
...logo,
|
|
44
56
|
checkMini: true
|
|
45
57
|
};
|
|
46
58
|
const leftItems = [specialLogo];
|
|
47
59
|
const rightItems = [];
|
|
48
|
-
if (isBusinessPage(
|
|
60
|
+
if (isBusinessPage()) {
|
|
49
61
|
if (renderSignUp) {
|
|
50
62
|
rightItems.push(signUpTextButton);
|
|
51
63
|
}
|
|
@@ -67,31 +79,115 @@ const anonMobileHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isB
|
|
|
67
79
|
mainMenu: mainMenuItems
|
|
68
80
|
};
|
|
69
81
|
};
|
|
70
|
-
export const anonDefaultHeaderItems = (
|
|
71
|
-
|
|
82
|
+
export const anonDefaultHeaderItems = ({
|
|
83
|
+
hidePricing,
|
|
84
|
+
user,
|
|
85
|
+
isInRevampedBlpExperimentVariant
|
|
86
|
+
}) => {
|
|
87
|
+
return anonHeaderItems({
|
|
88
|
+
renderLogin: true,
|
|
89
|
+
renderSignUp: true,
|
|
90
|
+
hidePricing,
|
|
91
|
+
user,
|
|
92
|
+
isInRevampedBlpExperimentVariant
|
|
93
|
+
});
|
|
72
94
|
};
|
|
73
|
-
export const anonDefaultMobileHeaderItems = (
|
|
74
|
-
|
|
95
|
+
export const anonDefaultMobileHeaderItems = ({
|
|
96
|
+
hidePricing,
|
|
97
|
+
user,
|
|
98
|
+
isInRevampedBlpExperimentVariant
|
|
99
|
+
}) => {
|
|
100
|
+
return anonMobileHeaderItems({
|
|
101
|
+
renderLogin: true,
|
|
102
|
+
renderSignUp: true,
|
|
103
|
+
hidePricing,
|
|
104
|
+
user,
|
|
105
|
+
isInRevampedBlpExperimentVariant
|
|
106
|
+
});
|
|
75
107
|
};
|
|
76
|
-
export const anonLandingHeaderItems = (
|
|
77
|
-
|
|
108
|
+
export const anonLandingHeaderItems = ({
|
|
109
|
+
hidePricing,
|
|
110
|
+
user,
|
|
111
|
+
isInRevampedBlpExperimentVariant
|
|
112
|
+
}) => {
|
|
113
|
+
return anonHeaderItems({
|
|
114
|
+
renderLogin: true,
|
|
115
|
+
renderSignUp: false,
|
|
116
|
+
hidePricing,
|
|
117
|
+
user,
|
|
118
|
+
isInRevampedBlpExperimentVariant
|
|
119
|
+
});
|
|
78
120
|
};
|
|
79
|
-
export const anonLandingMobileHeaderItems = (
|
|
80
|
-
|
|
121
|
+
export const anonLandingMobileHeaderItems = ({
|
|
122
|
+
hidePricing,
|
|
123
|
+
user,
|
|
124
|
+
isInRevampedBlpExperimentVariant
|
|
125
|
+
}) => {
|
|
126
|
+
return anonMobileHeaderItems({
|
|
127
|
+
renderLogin: true,
|
|
128
|
+
renderSignUp: false,
|
|
129
|
+
hidePricing,
|
|
130
|
+
user,
|
|
131
|
+
isInRevampedBlpExperimentVariant
|
|
132
|
+
});
|
|
81
133
|
};
|
|
82
|
-
export const anonLoginHeaderItems = (
|
|
83
|
-
|
|
134
|
+
export const anonLoginHeaderItems = ({
|
|
135
|
+
hidePricing,
|
|
136
|
+
user,
|
|
137
|
+
isInRevampedBlpExperimentVariant
|
|
138
|
+
}) => {
|
|
139
|
+
return anonHeaderItems({
|
|
140
|
+
renderLogin: false,
|
|
141
|
+
renderSignUp: true,
|
|
142
|
+
hidePricing,
|
|
143
|
+
user,
|
|
144
|
+
isInRevampedBlpExperimentVariant
|
|
145
|
+
});
|
|
84
146
|
};
|
|
85
|
-
export const anonLoginMobileHeaderItems = (
|
|
86
|
-
|
|
147
|
+
export const anonLoginMobileHeaderItems = ({
|
|
148
|
+
hidePricing,
|
|
149
|
+
user,
|
|
150
|
+
isInRevampedBlpExperimentVariant
|
|
151
|
+
}) => {
|
|
152
|
+
return anonMobileHeaderItems({
|
|
153
|
+
renderLogin: false,
|
|
154
|
+
renderSignUp: true,
|
|
155
|
+
hidePricing,
|
|
156
|
+
user,
|
|
157
|
+
isInRevampedBlpExperimentVariant
|
|
158
|
+
});
|
|
87
159
|
};
|
|
88
|
-
export const anonSignupHeaderItems = (
|
|
89
|
-
|
|
160
|
+
export const anonSignupHeaderItems = ({
|
|
161
|
+
hidePricing,
|
|
162
|
+
user,
|
|
163
|
+
isInRevampedBlpExperimentVariant
|
|
164
|
+
}) => {
|
|
165
|
+
return anonHeaderItems({
|
|
166
|
+
renderLogin: true,
|
|
167
|
+
renderSignUp: false,
|
|
168
|
+
hidePricing,
|
|
169
|
+
user,
|
|
170
|
+
isInRevampedBlpExperimentVariant
|
|
171
|
+
});
|
|
90
172
|
};
|
|
91
|
-
export const anonSignupMobileHeaderItems = (
|
|
92
|
-
|
|
173
|
+
export const anonSignupMobileHeaderItems = ({
|
|
174
|
+
hidePricing,
|
|
175
|
+
user,
|
|
176
|
+
isInRevampedBlpExperimentVariant
|
|
177
|
+
}) => {
|
|
178
|
+
return anonMobileHeaderItems({
|
|
179
|
+
renderLogin: true,
|
|
180
|
+
renderSignUp: false,
|
|
181
|
+
hidePricing,
|
|
182
|
+
user,
|
|
183
|
+
isInRevampedBlpExperimentVariant
|
|
184
|
+
});
|
|
93
185
|
};
|
|
94
|
-
export const freeHeaderItems = (
|
|
186
|
+
export const freeHeaderItems = ({
|
|
187
|
+
user,
|
|
188
|
+
hidePricing,
|
|
189
|
+
isInRevampedBlpExperimentVariant
|
|
190
|
+
}) => {
|
|
95
191
|
const specialLogo = {
|
|
96
192
|
...logo,
|
|
97
193
|
checkMini: true
|
|
@@ -106,7 +202,11 @@ export const freeHeaderItems = (user, hidePricing, isInRevampedBlpExperimentVari
|
|
|
106
202
|
right: rightItems
|
|
107
203
|
};
|
|
108
204
|
};
|
|
109
|
-
export const freeMobileHeaderItems = (
|
|
205
|
+
export const freeMobileHeaderItems = ({
|
|
206
|
+
user,
|
|
207
|
+
hidePricing,
|
|
208
|
+
isInRevampedBlpExperimentVariant
|
|
209
|
+
}) => {
|
|
110
210
|
const specialLogo = {
|
|
111
211
|
...logo,
|
|
112
212
|
checkMini: true
|
|
@@ -121,7 +221,10 @@ export const freeMobileHeaderItems = (user, hidePricing, isInRevampedBlpExperime
|
|
|
121
221
|
mainMenu: mainMenuItems
|
|
122
222
|
};
|
|
123
223
|
};
|
|
124
|
-
export const enterpriseHeaderItems = (
|
|
224
|
+
export const enterpriseHeaderItems = ({
|
|
225
|
+
user,
|
|
226
|
+
props
|
|
227
|
+
}) => {
|
|
125
228
|
const {
|
|
126
229
|
hideHeaderLinksInChromeless,
|
|
127
230
|
hideHeaderResourcesDropdown,
|
|
@@ -134,7 +237,9 @@ export const enterpriseHeaderItems = (user, props) => {
|
|
|
134
237
|
right: []
|
|
135
238
|
};
|
|
136
239
|
};
|
|
137
|
-
export const proHeaderItems =
|
|
240
|
+
export const proHeaderItems = ({
|
|
241
|
+
user
|
|
242
|
+
}) => {
|
|
138
243
|
const leftItems = [logo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(user.isPlusUser ? [upgradePlan] : []), liveLearningHub, businessSolutions];
|
|
139
244
|
const rightItems = [];
|
|
140
245
|
rightItems.push(proProfile(user));
|
|
@@ -146,7 +251,9 @@ export const proHeaderItems = user => {
|
|
|
146
251
|
right: rightItems
|
|
147
252
|
};
|
|
148
253
|
};
|
|
149
|
-
export const teamsHeaderItems =
|
|
254
|
+
export const teamsHeaderItems = ({
|
|
255
|
+
user
|
|
256
|
+
}) => {
|
|
150
257
|
const leftItems = [logo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), liveLearningHub];
|
|
151
258
|
const rightItems = [];
|
|
152
259
|
if (user.isAccountManager && user.inBusinessTrial && !user.hasBusinessSubscription) {
|
|
@@ -158,7 +265,10 @@ export const teamsHeaderItems = user => {
|
|
|
158
265
|
right: rightItems
|
|
159
266
|
};
|
|
160
267
|
};
|
|
161
|
-
export const enterpriseMobileHeaderItems = (
|
|
268
|
+
export const enterpriseMobileHeaderItems = ({
|
|
269
|
+
user,
|
|
270
|
+
props
|
|
271
|
+
}) => {
|
|
162
272
|
const {
|
|
163
273
|
hideHeaderLinksInChromeless,
|
|
164
274
|
hideHeaderResourcesDropdown,
|
|
@@ -174,7 +284,9 @@ export const enterpriseMobileHeaderItems = (user, props) => {
|
|
|
174
284
|
mainMenu: mainMenuItems
|
|
175
285
|
};
|
|
176
286
|
};
|
|
177
|
-
export const proMobileHeaderItems =
|
|
287
|
+
export const proMobileHeaderItems = ({
|
|
288
|
+
user
|
|
289
|
+
}) => {
|
|
178
290
|
const leftItems = [logo];
|
|
179
291
|
const rightItems = [];
|
|
180
292
|
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(user.isPlusUser ? [upgradePlan] : []), liveLearningHub, businessSolutions, proProfile(user)];
|
|
@@ -187,7 +299,9 @@ export const proMobileHeaderItems = user => {
|
|
|
187
299
|
mainMenu: mainMenuItems
|
|
188
300
|
};
|
|
189
301
|
};
|
|
190
|
-
export const teamsMobileHeaderItems =
|
|
302
|
+
export const teamsMobileHeaderItems = ({
|
|
303
|
+
user
|
|
304
|
+
}) => {
|
|
191
305
|
const leftItems = [logo];
|
|
192
306
|
const rightItems = [];
|
|
193
307
|
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), liveLearningHub, proProfile(user)];
|
|
@@ -218,13 +332,17 @@ export const simpleMobileHeaderItems = {
|
|
|
218
332
|
right: [],
|
|
219
333
|
mainMenu: []
|
|
220
334
|
};
|
|
221
|
-
export const simpleBootcampHeaderItems =
|
|
335
|
+
export const simpleBootcampHeaderItems = ({
|
|
336
|
+
bootcampSlug
|
|
337
|
+
}) => {
|
|
222
338
|
return {
|
|
223
339
|
left: [logo],
|
|
224
340
|
right: [bootcampCta(bootcampSlug)]
|
|
225
341
|
};
|
|
226
342
|
};
|
|
227
|
-
export const simpleBootcampMobileHeaderItems =
|
|
343
|
+
export const simpleBootcampMobileHeaderItems = ({
|
|
344
|
+
bootcampSlug
|
|
345
|
+
}) => {
|
|
228
346
|
return {
|
|
229
347
|
left: [logo],
|
|
230
348
|
right: [bootcampCta(bootcampSlug)],
|
|
@@ -3,7 +3,6 @@ import { AnonHeader, EnterpriseHeader, FreeHeader, LoadingHeader, ProHeader, Sim
|
|
|
3
3
|
export * from './types';
|
|
4
4
|
export declare const LiveLearningHubContext: React.Context<boolean>;
|
|
5
5
|
export declare const GlobalNavRedesignContext: React.Context<boolean>;
|
|
6
|
-
export declare const BlpHeroExperimentContext: React.Context<boolean>;
|
|
7
6
|
export declare const RevampedBlpExperimentContext: React.Context<boolean>;
|
|
8
7
|
export type GlobalHeaderProps = AnonHeader | FreeHeader | ProHeader | EnterpriseHeader | TeamsHeader | LoadingHeader | SimpleHeader | SimpleBootcampHeader;
|
|
9
8
|
export declare const GlobalHeader: React.FC<GlobalHeaderProps>;
|
|
@@ -9,7 +9,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
export * from './types';
|
|
10
10
|
export const LiveLearningHubContext = /*#__PURE__*/React.createContext(false);
|
|
11
11
|
export const GlobalNavRedesignContext = /*#__PURE__*/React.createContext(false);
|
|
12
|
-
export const BlpHeroExperimentContext = /*#__PURE__*/React.createContext(false);
|
|
13
12
|
export const RevampedBlpExperimentContext = /*#__PURE__*/React.createContext(false);
|
|
14
13
|
|
|
15
14
|
// Overloading getAppHeaderItems function to return different types based on mobile parameter
|
|
@@ -25,26 +24,84 @@ function getAppHeaderItems(props, mobile, dynamicDataLoading) {
|
|
|
25
24
|
case 'anon':
|
|
26
25
|
switch (props.variant) {
|
|
27
26
|
case 'landing':
|
|
28
|
-
return mobile ? anonLandingMobileHeaderItems(
|
|
27
|
+
return mobile ? anonLandingMobileHeaderItems({
|
|
28
|
+
hidePricing,
|
|
29
|
+
user: props.user,
|
|
30
|
+
isInRevampedBlpExperimentVariant: props.isInRevampedBlpExperimentVariant
|
|
31
|
+
}) : anonLandingHeaderItems({
|
|
32
|
+
hidePricing,
|
|
33
|
+
user: props.user,
|
|
34
|
+
isInRevampedBlpExperimentVariant: props.isInRevampedBlpExperimentVariant
|
|
35
|
+
});
|
|
29
36
|
case 'login':
|
|
30
|
-
return mobile ? anonLoginMobileHeaderItems(
|
|
37
|
+
return mobile ? anonLoginMobileHeaderItems({
|
|
38
|
+
hidePricing,
|
|
39
|
+
user: props.user,
|
|
40
|
+
isInRevampedBlpExperimentVariant: props.isInRevampedBlpExperimentVariant
|
|
41
|
+
}) : anonLoginHeaderItems({
|
|
42
|
+
hidePricing,
|
|
43
|
+
user: props.user,
|
|
44
|
+
isInRevampedBlpExperimentVariant: props.isInRevampedBlpExperimentVariant
|
|
45
|
+
});
|
|
31
46
|
case 'signup':
|
|
32
|
-
return mobile ? anonSignupMobileHeaderItems(
|
|
47
|
+
return mobile ? anonSignupMobileHeaderItems({
|
|
48
|
+
hidePricing,
|
|
49
|
+
user: props.user,
|
|
50
|
+
isInRevampedBlpExperimentVariant: props.isInRevampedBlpExperimentVariant
|
|
51
|
+
}) : anonSignupHeaderItems({
|
|
52
|
+
hidePricing,
|
|
53
|
+
user: props.user,
|
|
54
|
+
isInRevampedBlpExperimentVariant: props.isInRevampedBlpExperimentVariant
|
|
55
|
+
});
|
|
33
56
|
default:
|
|
34
|
-
return mobile ? anonDefaultMobileHeaderItems(
|
|
57
|
+
return mobile ? anonDefaultMobileHeaderItems({
|
|
58
|
+
hidePricing,
|
|
59
|
+
user: props.user,
|
|
60
|
+
isInRevampedBlpExperimentVariant: props.isInRevampedBlpExperimentVariant
|
|
61
|
+
}) : anonDefaultHeaderItems({
|
|
62
|
+
hidePricing,
|
|
63
|
+
user: props.user,
|
|
64
|
+
isInRevampedBlpExperimentVariant: props.isInRevampedBlpExperimentVariant
|
|
65
|
+
});
|
|
35
66
|
}
|
|
36
67
|
case 'enterprise':
|
|
37
|
-
return mobile ? enterpriseMobileHeaderItems(
|
|
68
|
+
return mobile ? enterpriseMobileHeaderItems({
|
|
69
|
+
user: props.user,
|
|
70
|
+
props
|
|
71
|
+
}) : enterpriseHeaderItems({
|
|
72
|
+
user: props.user,
|
|
73
|
+
props
|
|
74
|
+
});
|
|
38
75
|
case 'free':
|
|
39
|
-
return mobile ? freeMobileHeaderItems(
|
|
76
|
+
return mobile ? freeMobileHeaderItems({
|
|
77
|
+
user: props.user,
|
|
78
|
+
hidePricing,
|
|
79
|
+
isInRevampedBlpExperimentVariant: props.isInRevampedBlpExperimentVariant
|
|
80
|
+
}) : freeHeaderItems({
|
|
81
|
+
user: props.user,
|
|
82
|
+
hidePricing,
|
|
83
|
+
isInRevampedBlpExperimentVariant: props.isInRevampedBlpExperimentVariant
|
|
84
|
+
});
|
|
40
85
|
case 'pro':
|
|
41
|
-
return mobile ? proMobileHeaderItems(
|
|
86
|
+
return mobile ? proMobileHeaderItems({
|
|
87
|
+
user: props.user
|
|
88
|
+
}) : proHeaderItems({
|
|
89
|
+
user: props.user
|
|
90
|
+
});
|
|
42
91
|
case 'teams':
|
|
43
|
-
return mobile ? teamsMobileHeaderItems(
|
|
92
|
+
return mobile ? teamsMobileHeaderItems({
|
|
93
|
+
user: props.user
|
|
94
|
+
}) : teamsHeaderItems({
|
|
95
|
+
user: props.user
|
|
96
|
+
});
|
|
44
97
|
case 'simple':
|
|
45
98
|
return mobile ? simpleMobileHeaderItems : simpleHeaderItems;
|
|
46
99
|
case 'bootcamp':
|
|
47
|
-
return mobile ? simpleBootcampMobileHeaderItems(
|
|
100
|
+
return mobile ? simpleBootcampMobileHeaderItems({
|
|
101
|
+
bootcampSlug: props.bootcampSlug
|
|
102
|
+
}) : simpleBootcampHeaderItems({
|
|
103
|
+
bootcampSlug: props.bootcampSlug
|
|
104
|
+
});
|
|
48
105
|
case 'loading':
|
|
49
106
|
return mobile ? loadingMobileHeaderItems : loadingHeaderItems;
|
|
50
107
|
}
|
|
@@ -75,56 +132,53 @@ export const GlobalHeader = props => {
|
|
|
75
132
|
},
|
|
76
133
|
children: /*#__PURE__*/_jsx(GlobalNavRedesignContext.Provider, {
|
|
77
134
|
value: !!props.displayGlobalNavRedesign,
|
|
78
|
-
children: /*#__PURE__*/_jsx(
|
|
79
|
-
value: !!props.
|
|
80
|
-
children: /*#__PURE__*/_jsx(
|
|
81
|
-
value:
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
navigationMenuFormattedLabel: props?.localizedLabels?.navigationMenuFormattedLabel
|
|
126
|
-
}), props.children]
|
|
127
|
-
})
|
|
135
|
+
children: /*#__PURE__*/_jsx(RevampedBlpExperimentContext.Provider, {
|
|
136
|
+
value: !!props.isInRevampedBlpExperimentVariant,
|
|
137
|
+
children: /*#__PURE__*/_jsx(GlobalHeaderItemClickContext.Provider, {
|
|
138
|
+
value: {
|
|
139
|
+
globalHeaderItemClick: combinedAction
|
|
140
|
+
},
|
|
141
|
+
children: /*#__PURE__*/_jsx(GlobalHeaderDynamicDataContext.Provider, {
|
|
142
|
+
value: useMemo(() => ({
|
|
143
|
+
globalHeaderDynamicData: dynamicData ?? null
|
|
144
|
+
}), [dynamicData]),
|
|
145
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
146
|
+
as: "header",
|
|
147
|
+
position: "sticky",
|
|
148
|
+
top: 0,
|
|
149
|
+
zIndex: theme.elements.headerZ,
|
|
150
|
+
overflow: {
|
|
151
|
+
_: 'hidden',
|
|
152
|
+
sm: 'visible'
|
|
153
|
+
} // Prevent tooltip overflow on mobile
|
|
154
|
+
,
|
|
155
|
+
children: [/*#__PURE__*/_jsx(AppHeader, {
|
|
156
|
+
action: combinedAction,
|
|
157
|
+
items: getAppHeaderItems(props, false, dynamicDataLoading ?? false),
|
|
158
|
+
search: props.search,
|
|
159
|
+
...(props.type === 'anon' ? {
|
|
160
|
+
redirectParam: props.redirectParam
|
|
161
|
+
} : hideNotification ? {} : {
|
|
162
|
+
notifications: props.notifications
|
|
163
|
+
}),
|
|
164
|
+
hideRightButtonDefaults: hideNotification,
|
|
165
|
+
isAnon: props.type === 'anon',
|
|
166
|
+
isTeams: props.type === 'teams',
|
|
167
|
+
type: hideNotification ? 'enterprise' : 'standard'
|
|
168
|
+
}), /*#__PURE__*/_jsx(AppHeaderMobile, {
|
|
169
|
+
action: combinedAction,
|
|
170
|
+
items: getAppHeaderItems(props, true, dynamicDataLoading ?? false),
|
|
171
|
+
...(props.type === 'anon' || hideNotification ? {} : {
|
|
172
|
+
notifications: props.notifications
|
|
173
|
+
}),
|
|
174
|
+
search: props.search,
|
|
175
|
+
redirectParam: props.type === 'anon' ? props.redirectParam : undefined,
|
|
176
|
+
isEnterprise: props.type === 'enterprise',
|
|
177
|
+
isAnon: props.type === 'anon',
|
|
178
|
+
isSimple: props.type === 'simple',
|
|
179
|
+
hideRightMenuButton: props.type === 'simple' || props.type === 'loading',
|
|
180
|
+
navigationMenuFormattedLabel: props?.localizedLabels?.navigationMenuFormattedLabel
|
|
181
|
+
}), props.children]
|
|
128
182
|
})
|
|
129
183
|
})
|
|
130
184
|
})
|
|
@@ -32,7 +32,6 @@ interface BaseHeader extends WithChildrenProp, AppHeaderAction {
|
|
|
32
32
|
localizedLabels?: localizedLabels;
|
|
33
33
|
search: AppHeaderSearch;
|
|
34
34
|
displayGlobalNavRedesign?: boolean;
|
|
35
|
-
isBlpHeroExperimentVariant?: boolean;
|
|
36
35
|
isInRevampedBlpExperimentVariant?: boolean;
|
|
37
36
|
dynamicData?: GlobalHeaderDynamicData | null;
|
|
38
37
|
dynamicDataLoading?: boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/brand",
|
|
3
3
|
"description": "Brand component library for Codecademy",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.23.0-alpha.baf109039b.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@emotion/is-prop-valid": "^1.2.1",
|