@codecademy/brand 2.8.0-alpha.ee8d477ea2.0 → 2.9.0-alpha.1b05c8bc21.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.
Files changed (22) hide show
  1. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/index.js +30 -5
  2. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/elements.d.ts +0 -5
  3. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/elements.js +12 -56
  4. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/index.js +3 -5
  5. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/NavPanels.d.ts +10 -0
  6. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/NavPanels.js +230 -0
  7. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/NavSection.d.ts +15 -0
  8. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/NavSection.js +75 -0
  9. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/consts.d.ts +9 -0
  10. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/consts.js +48 -0
  11. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/index.d.ts +11 -0
  12. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSectionVariant/index.js +100 -0
  13. package/dist/AppHeader/AppHeaderElements/AppHeaderDietCard/index.d.ts +10 -0
  14. package/dist/AppHeader/AppHeaderElements/AppHeaderDietCard/index.js +82 -0
  15. package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.js +0 -0
  16. package/dist/AppHeaderMobile/AppHeaderCatalogSectonVariantMobile/index.d.ts +4 -0
  17. package/dist/AppHeaderMobile/AppHeaderCatalogSectonVariantMobile/index.js +63 -0
  18. package/dist/AppHeaderMobile/AppHeaderSubMenuMobile/index.js +12 -5
  19. package/dist/GlobalHeader/context.d.ts +8 -0
  20. package/dist/GlobalHeader/context.js +9 -0
  21. package/dist/GlobalHeader/index.js +43 -37
  22. package/package.json +1 -1
@@ -3,6 +3,7 @@ import { useTheme } from '@emotion/react';
3
3
  import * as React from 'react';
4
4
  import { useCallback } from 'react';
5
5
  import { AppHeader, AppHeaderMobile, isAppHeaderItemWithHref } from '..';
6
+ import { GlobalHeaderItemClickContext } from './context';
6
7
  import { anonDefaultHeaderItems, anonDefaultMobileHeaderItems, anonLandingHeaderItems, anonLandingMobileHeaderItems, anonLoginHeaderItems, anonLoginMobileHeaderItems, anonSignupHeaderItems, anonSignupMobileHeaderItems, enterpriseHeaderItems, enterpriseMobileHeaderItems, freeHeaderItems, freeMobileHeaderItems, loadingHeaderItems, loadingMobileHeaderItems, proHeaderItems, proMobileHeaderItems, simpleBootcampHeaderItems, simpleBootcampMobileHeaderItems, simpleHeaderItems, simpleMobileHeaderItems, teamsHeaderItems, teamsMobileHeaderItems } from './GlobalHeaderVariants';
7
8
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
9
  export * from './types';
@@ -67,43 +68,48 @@ export const GlobalHeader = props => {
67
68
  },
68
69
  children: /*#__PURE__*/_jsx(GlobalNavRedesignContext.Provider, {
69
70
  value: !!props.displayGlobalNavRedesign,
70
- children: /*#__PURE__*/_jsxs(Box, {
71
- as: "header",
72
- position: "sticky",
73
- top: 0,
74
- zIndex: theme.elements.headerZ,
75
- overflow: {
76
- _: 'hidden',
77
- sm: 'visible'
78
- } // Prevent tooltip overflow on mobile
79
- ,
80
- children: [/*#__PURE__*/_jsx(AppHeader, {
81
- action: combinedAction,
82
- items: getAppHeaderItems(props, false),
83
- search: props.search,
84
- ...(props.type === 'anon' ? {
85
- redirectParam: props.redirectParam
86
- } : hideNotification ? {} : {
87
- notifications: props.notifications
88
- }),
89
- hideRightButtonDefaults: hideNotification,
90
- isAnon: props.type === 'anon',
91
- isTeams: props.type === 'teams',
92
- type: hideNotification ? 'enterprise' : 'standard'
93
- }), /*#__PURE__*/_jsx(AppHeaderMobile, {
94
- action: combinedAction,
95
- items: getAppHeaderItems(props, true),
96
- ...(props.type === 'anon' || hideNotification ? {} : {
97
- notifications: props.notifications
98
- }),
99
- search: props.search,
100
- redirectParam: props.type === 'anon' ? props.redirectParam : undefined,
101
- isEnterprise: props.type === 'enterprise',
102
- isAnon: props.type === 'anon',
103
- isSimple: props.type === 'simple',
104
- hideRightMenuButton: props.type === 'simple' || props.type === 'loading',
105
- navigationMenuFormattedLabel: props?.localizedLabels?.navigationMenuFormattedLabel
106
- }), props.children]
71
+ children: /*#__PURE__*/_jsx(GlobalHeaderItemClickContext.Provider, {
72
+ value: {
73
+ globalHeaderItemClick: combinedAction
74
+ },
75
+ children: /*#__PURE__*/_jsxs(Box, {
76
+ as: "header",
77
+ position: "sticky",
78
+ top: 0,
79
+ zIndex: theme.elements.headerZ,
80
+ overflow: {
81
+ _: 'hidden',
82
+ sm: 'visible'
83
+ } // Prevent tooltip overflow on mobile
84
+ ,
85
+ children: [/*#__PURE__*/_jsx(AppHeader, {
86
+ action: combinedAction,
87
+ items: getAppHeaderItems(props, false),
88
+ search: props.search,
89
+ ...(props.type === 'anon' ? {
90
+ redirectParam: props.redirectParam
91
+ } : hideNotification ? {} : {
92
+ notifications: props.notifications
93
+ }),
94
+ hideRightButtonDefaults: hideNotification,
95
+ isAnon: props.type === 'anon',
96
+ isTeams: props.type === 'teams',
97
+ type: hideNotification ? 'enterprise' : 'standard'
98
+ }), /*#__PURE__*/_jsx(AppHeaderMobile, {
99
+ action: combinedAction,
100
+ items: getAppHeaderItems(props, true),
101
+ ...(props.type === 'anon' || hideNotification ? {} : {
102
+ notifications: props.notifications
103
+ }),
104
+ search: props.search,
105
+ redirectParam: props.type === 'anon' ? props.redirectParam : undefined,
106
+ isEnterprise: props.type === 'enterprise',
107
+ isAnon: props.type === 'anon',
108
+ isSimple: props.type === 'simple',
109
+ hideRightMenuButton: props.type === 'simple' || props.type === 'loading',
110
+ navigationMenuFormattedLabel: props?.localizedLabels?.navigationMenuFormattedLabel
111
+ }), props.children]
112
+ })
107
113
  })
108
114
  })
109
115
  });
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": "2.8.0-alpha.ee8d477ea2.0",
4
+ "version": "2.9.0-alpha.1b05c8bc21.0",
5
5
  "author": "Codecademy Engineering <dev@codecademy.com>",
6
6
  "dependencies": {
7
7
  "@emotion/is-prop-valid": "^1.2.1",