@codecademy/brand 3.29.0-alpha.7e80c447ff.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.
Files changed (47) hide show
  1. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/MarketingBanner.d.ts +1 -2
  2. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/MarketingBanner.js +3 -3
  3. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/NavPanels.d.ts +0 -1
  4. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/NavPanels.js +2 -3
  5. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/consts.d.ts +1 -0
  6. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/consts.js +2 -1
  7. package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.js +0 -0
  8. package/dist/AppHeader/AppHeaderElements/AppHeaderSection/MobileBackButton.d.ts +0 -25
  9. package/dist/AppHeader/AppHeaderElements/AppHeaderSection/MobileBackButton.js +2 -13
  10. package/dist/AppHeader/AppHeaderElements/AppHeaderSection/NavTabs.d.ts +20 -0
  11. package/dist/AppHeader/AppHeaderElements/AppHeaderSection/NavTabs.js +144 -0
  12. package/dist/AppHeader/AppHeaderElements/AppHeaderSection/elements.d.ts +63 -1
  13. package/dist/AppHeader/AppHeaderElements/AppHeaderSection/elements.js +81 -16
  14. package/dist/AppHeader/AppHeaderElements/AppHeaderSection/index.d.ts +16 -10
  15. package/dist/AppHeader/AppHeaderElements/AppHeaderSection/index.js +89 -28
  16. package/dist/DropdownButton/index.d.ts +3 -1
  17. package/dist/stories/Atoms/BetaSticker.stories.js +1 -0
  18. package/dist/stories/Molecules/AppBar.stories.d.ts +1 -0
  19. package/dist/stories/Molecules/AppBar.stories.js +2 -1
  20. package/dist/stories/Molecules/AppHeader/AppHeaderLink.stories.js +2 -0
  21. package/dist/stories/Molecules/AppHeader/AppHeaderLogo.stories.js +2 -1
  22. package/dist/stories/Molecules/Banner.stories.js +3 -0
  23. package/dist/stories/Molecules/CurriculumCard.stories.js +7 -0
  24. package/dist/stories/Molecules/EmptySection.stories.js +2 -1
  25. package/dist/stories/Molecules/EnhancedBanner.stories.js +1 -1
  26. package/dist/stories/Molecules/HubCard.stories.js +1 -0
  27. package/dist/stories/Molecules/NotificationList.stories.js +2 -1
  28. package/dist/stories/Molecules/Testimonial.stories.js +8 -4
  29. package/dist/stories/Organisms/GlobalFooter.stories.js +2 -1
  30. package/dist/stories/Organisms/GlobalHeader/About.stories.js +2 -1
  31. package/dist/stories/Organisms/GlobalHeader/Bootcamp.stories.js +2 -1
  32. package/dist/stories/Organisms/GlobalHeader/Enterprise.stories.js +2 -1
  33. package/dist/stories/Organisms/GlobalHeader/Simple.stories.js +2 -1
  34. package/dist/stories/Organisms/GlobalPage.stories.js +2 -0
  35. package/dist/stories/Organisms/LayoutMenu.stories.js +6 -3
  36. package/dist/stories/Organisms/LayoutMenuVariant.stories.js +4 -2
  37. package/dist/stories/Organisms/PageFeatures.stories.js +9 -1
  38. package/dist/stories/Organisms/PageHero.stories.js +20 -10
  39. package/dist/stories/Organisms/PagePrefooter.stories.js +8 -4
  40. package/dist/stories/Organisms/PageSingleFeature.stories.js +20 -10
  41. package/dist/stories/Organisms/PageVideoGallery.stories.js +10 -5
  42. package/dist/stories/Organisms/ScoreSummary.stories.js +8 -4
  43. package/dist/svg.d.ts +1 -0
  44. package/package.json +1 -2
  45. package/dist/AppHeader/AppHeaderElements/AppHeaderSection/AppHeaderSection.test.js +0 -193
  46. package/dist/AppHeader/AppHeaderElements/AppHeaderSection/NavSection.d.ts +0 -21
  47. package/dist/AppHeader/AppHeaderElements/AppHeaderSection/NavSection.js +0 -206
@@ -33,19 +33,22 @@ export const RegularButton = {
33
33
  ...ctaArgs,
34
34
  buttonType: 'fill'
35
35
  }
36
- })
36
+ }),
37
+ name: 'Regular Button'
37
38
  };
38
39
  export const WithoutButton = {
39
40
  render: args => /*#__PURE__*/_jsx(PagePrefooter, {
40
41
  ...args,
41
42
  cta: undefined
42
- })
43
+ }),
44
+ name: 'Without Button'
43
45
  };
44
46
  export const WithoutDescription = {
45
47
  render: args => /*#__PURE__*/_jsx(PagePrefooter, {
46
48
  ...args,
47
49
  desc: undefined
48
- })
50
+ }),
51
+ name: 'Without Description'
49
52
  };
50
53
  export const DarkMode = {
51
54
  render: args => /*#__PURE__*/_jsx(Background, {
@@ -54,5 +57,6 @@ export const DarkMode = {
54
57
  children: /*#__PURE__*/_jsx(PagePrefooter, {
55
58
  ...args
56
59
  })
57
- })
60
+ }),
61
+ name: 'Dark Mode'
58
62
  };
@@ -28,7 +28,8 @@ export default meta;
28
28
  export const SingleFeature = {
29
29
  render: args => /*#__PURE__*/_jsx(PageSingleFeature, {
30
30
  ...args
31
- })
31
+ }),
32
+ name: 'Single Feature'
32
33
  };
33
34
  export const Video = {
34
35
  render: args => /*#__PURE__*/_jsx(PageSingleFeature, {
@@ -41,7 +42,8 @@ export const Video = {
41
42
  autoplay: true
42
43
  },
43
44
  title: "What's it like to be a Software Engineer"
44
- })
45
+ }),
46
+ name: 'Video'
45
47
  };
46
48
  export const AdjustTheMediaWidth = {
47
49
  render: args => /*#__PURE__*/_jsx(PageSingleFeature, {
@@ -59,21 +61,24 @@ export const RegularButton = {
59
61
  buttonType: 'fill'
60
62
  },
61
63
  mediaWidth: 4
62
- })
64
+ }),
65
+ name: 'Regular Button'
63
66
  };
64
67
  export const WithoutButton = {
65
68
  render: args => /*#__PURE__*/_jsx(PageSingleFeature, {
66
69
  ...args,
67
70
  cta: undefined,
68
71
  mediaWidth: 3
69
- })
72
+ }),
73
+ name: 'Without Button'
70
74
  };
71
75
  export const WithoutDescription = {
72
76
  render: args => /*#__PURE__*/_jsx(PageSingleFeature, {
73
77
  ...args,
74
78
  desc: undefined,
75
79
  mediaWidth: 4
76
- })
80
+ }),
81
+ name: 'Without Description'
77
82
  };
78
83
  export const Eyebrow = {
79
84
  render: args => /*#__PURE__*/_jsx(PageSingleFeature, {
@@ -81,7 +86,8 @@ export const Eyebrow = {
81
86
  eyebrow: {
82
87
  text: 'Codecademy'
83
88
  }
84
- })
89
+ }),
90
+ name: 'Eyebrow'
85
91
  };
86
92
  export const AccentEyebrow = {
87
93
  render: args => /*#__PURE__*/_jsx(PageSingleFeature, {
@@ -90,7 +96,8 @@ export const AccentEyebrow = {
90
96
  text: 'Codecademy',
91
97
  accent: true
92
98
  }
93
- })
99
+ }),
100
+ name: 'Accent Eyebrow'
94
101
  };
95
102
  export const HideImageOnMobile = {
96
103
  render: args => /*#__PURE__*/_jsx(PageSingleFeature, {
@@ -104,7 +111,8 @@ export const WithoutMedia = {
104
111
  render: args => /*#__PURE__*/_jsx(PageSingleFeature, {
105
112
  ...args,
106
113
  media: undefined
107
- })
114
+ }),
115
+ name: 'Without Media'
108
116
  };
109
117
  export const DarkMode = {
110
118
  render: args => /*#__PURE__*/_jsx(Background, {
@@ -116,7 +124,8 @@ export const DarkMode = {
116
124
  text: 'Codecademy'
117
125
  }
118
126
  })
119
- })
127
+ }),
128
+ name: 'Dark Mode'
120
129
  };
121
130
  export const PausableImage = {
122
131
  render: args => /*#__PURE__*/_jsx(PageSingleFeature, {
@@ -144,5 +153,6 @@ export const LinkableImage = {
144
153
  eyebrow: {
145
154
  text: 'Codecademy'
146
155
  }
147
- })
156
+ }),
157
+ name: 'Linkable Image'
148
158
  };
@@ -32,7 +32,8 @@ export default meta;
32
32
  export const VideoGallery = {
33
33
  render: args => /*#__PURE__*/_jsx(PageVideoGallery, {
34
34
  ...args
35
- })
35
+ }),
36
+ name: 'Video Gallery'
36
37
  };
37
38
  export const RegularButton = {
38
39
  render: args => /*#__PURE__*/_jsx(PageVideoGallery, {
@@ -41,18 +42,21 @@ export const RegularButton = {
41
42
  ...ctaArgs,
42
43
  buttonType: 'fill'
43
44
  }
44
- })
45
+ }),
46
+ name: 'Regular Button'
45
47
  };
46
48
  export const WithoutDescription = {
47
49
  render: args => /*#__PURE__*/_jsx(PageVideoGallery, {
48
50
  ...args,
49
51
  desc: undefined
50
- })
52
+ }),
53
+ name: 'Without Description'
51
54
  };
52
55
  export const GalleryOnly = {
53
56
  render: args => /*#__PURE__*/_jsx(PageVideoGallery, {
54
57
  videos: args.videos
55
- })
58
+ }),
59
+ name: 'Gallery Only'
56
60
  };
57
61
  export const DarkMode = {
58
62
  render: args => /*#__PURE__*/_jsx(Background, {
@@ -61,5 +65,6 @@ export const DarkMode = {
61
65
  children: /*#__PURE__*/_jsx(PageVideoGallery, {
62
66
  ...args
63
67
  })
64
- })
68
+ }),
69
+ name: 'Dark Mode'
65
70
  };
@@ -79,7 +79,8 @@ export const RowLayout = {
79
79
  slug: 'becp-22-going-off-platform-with-html-and-css',
80
80
  title: 'Going off-platform with HTML and CSS'
81
81
  }]
82
- })
82
+ }),
83
+ name: 'Row Layout'
83
84
  };
84
85
  export const ColumnLayout = {
85
86
  render: args => /*#__PURE__*/_jsx(ScoreSummary, {
@@ -125,7 +126,8 @@ export const ColumnLayout = {
125
126
  slug: 'wdcp-22-practice-javascript-syntax-arrays-loops-objects-iterators',
126
127
  title: 'Practice JavaScript Syntax: Arrays, Loops, Objects, Iterators'
127
128
  }]
128
- })
129
+ }),
130
+ name: 'Column Layout'
129
131
  };
130
132
  export const RowLayoutNoMaxWidth = {
131
133
  render: args => /*#__PURE__*/_jsx(ScoreSummary, {
@@ -212,7 +214,8 @@ export const Description = {
212
214
  slug: 'wdcp-22-practice-javascript-syntax-arrays-loops-objects-iterators',
213
215
  title: 'Practice JavaScript Syntax: Arrays, Loops, Objects, Iterators'
214
216
  }]
215
- })
217
+ }),
218
+ name: 'Description'
216
219
  };
217
220
  export const DescriptionInColumnLayout = {
218
221
  render: args => /*#__PURE__*/_jsx(ScoreSummary, {
@@ -291,5 +294,6 @@ export const ColorfulIcons = {
291
294
  },
292
295
  trackSlug: undefined,
293
296
  untestedSubContent: []
294
- })
297
+ }),
298
+ name: 'Colorful Icons'
295
299
  };
package/dist/svg.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare module '*.svg' {
2
+ type AssetURL = string;
2
3
  const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>;
3
4
  const content: string;
4
5
 
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@codecademy/brand",
3
3
  "description": "Brand component library for Codecademy",
4
- "version": "3.29.0-alpha.7e80c447ff.0",
4
+ "version": "3.29.0-alpha.9e88d7b76a.0",
5
5
  "author": "Codecademy Engineering <dev@codecademy.com>",
6
6
  "dependencies": {
7
7
  "@emotion/is-prop-valid": "^1.2.1",
8
8
  "@splidejs/react-splide": "^0.7.12",
9
9
  "@splidejs/splide": "4.1.3",
10
- "@types/recurly__recurly-js": "4.22.0",
11
10
  "classnames": "^2.3.2",
12
11
  "date-fns": "^2.30.0",
13
12
  "emojisplosion": "^2.6.1",
@@ -1,193 +0,0 @@
1
- import { setupRtl } from '@codecademy/gamut-tests';
2
- import userEvent from '@testing-library/user-event';
3
- import React from 'react';
4
- import { GlobalHeaderDynamicDataContext, GlobalHeaderItemClickContext } from '../../../GlobalHeader/context';
5
- import { CATALOG_NAV_SECTIONS } from '../AppHeaderCatalogDropdown/consts';
6
- import { MarketingBanner } from '../AppHeaderCatalogDropdown/MarketingBanner';
7
- import { AppHeaderSection } from '.';
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- const mockOnClick = jest.fn();
10
- const mockKeyDownEvents = jest.fn();
11
- const mockItem = {
12
- text: 'catalog',
13
- id: 'the-catalog',
14
- type: 'catalog-dropdown',
15
- trackingTarget: 'catalog-dropdown'
16
- };
17
- const defaultProps = {
18
- item: mockItem,
19
- isOpen: true,
20
- keyDownEvents: mockKeyDownEvents
21
- };
22
- const mockContextValue = {
23
- globalHeaderItemClick: mockOnClick
24
- };
25
- const mockDataContextValue = {
26
- globalHeaderDynamicData: {
27
- catalogDropdown: {
28
- banner: {
29
- href: 'https://example.com',
30
- text: 'Test banner text'
31
- },
32
- skillPaths: {
33
- totalSkillPathCount: 0,
34
- promotedSkillPaths: []
35
- },
36
- careerPaths: {
37
- totalCareerPathCount: 0,
38
- promotedCareerPaths: []
39
- },
40
- certificationPaths: {
41
- totalCertificationPathCount: 0
42
- }
43
- }
44
- }
45
- };
46
- describe('AppHeaderSection', () => {
47
- const createWrapper = (dataContextValue = mockDataContextValue) => ({
48
- children
49
- }) => /*#__PURE__*/_jsx(GlobalHeaderDynamicDataContext.Provider, {
50
- value: dataContextValue,
51
- children: /*#__PURE__*/_jsx(GlobalHeaderItemClickContext.Provider, {
52
- value: mockContextValue,
53
- children: children
54
- })
55
- });
56
- const renderView = setupRtl(AppHeaderSection, defaultProps).options({
57
- wrapper: createWrapper()
58
- });
59
- it('renders the component ', () => {
60
- const {
61
- view
62
- } = renderView({
63
- navSections: CATALOG_NAV_SECTIONS,
64
- handleClose: jest.fn(),
65
- type: 'catalog-dropdown'
66
- });
67
- expect(view.getByRole('heading', {
68
- name: 'Course topics'
69
- })).toBeInTheDocument();
70
- });
71
- describe('marketing banner', () => {
72
- const createRenderView = bannerData => setupRtl(AppHeaderSection, defaultProps).options({
73
- wrapper: createWrapper({
74
- globalHeaderDynamicData: {
75
- catalogDropdown: {
76
- banner: bannerData,
77
- skillPaths: {
78
- totalSkillPathCount: 0,
79
- promotedSkillPaths: []
80
- },
81
- careerPaths: {
82
- totalCareerPathCount: 0,
83
- promotedCareerPaths: []
84
- },
85
- certificationPaths: {
86
- totalCertificationPathCount: 0
87
- }
88
- }
89
- }
90
- })
91
- });
92
- it('renders the marketing banner when the banner text and href are present', () => {
93
- const {
94
- view
95
- } = renderView({
96
- navSections: CATALOG_NAV_SECTIONS,
97
- handleClose: jest.fn(),
98
- type: 'catalog-dropdown',
99
- MarketingBanner
100
- });
101
- expect(view.getByText('Test banner text')).toBeInTheDocument();
102
- });
103
- it('does not render the marketing banner when the banner href is empty', () => {
104
- const {
105
- view
106
- } = createRenderView({
107
- href: '',
108
- text: 'Test banner text'
109
- })({
110
- navSections: CATALOG_NAV_SECTIONS,
111
- handleClose: jest.fn(),
112
- type: 'catalog-dropdown',
113
- MarketingBanner
114
- });
115
- expect(view.queryByText('Test banner text')).not.toBeInTheDocument();
116
- expect(view.queryByTestId('marketing-banner')).not.toBeInTheDocument();
117
- });
118
- it('does not render the marketing banner when the banner text is empty', () => {
119
- const {
120
- view
121
- } = createRenderView({
122
- href: 'https://example.com',
123
- text: ''
124
- })({
125
- navSections: CATALOG_NAV_SECTIONS,
126
- handleClose: jest.fn(),
127
- type: 'catalog-dropdown',
128
- MarketingBanner
129
- });
130
- expect(view.queryByTestId('marketing-banner')).not.toBeInTheDocument();
131
- });
132
- it('does not render the marketing banner when the banner text is empty', () => {
133
- const {
134
- view
135
- } = createRenderView({
136
- href: 'https://example.com',
137
- text: ''
138
- })({
139
- navSections: CATALOG_NAV_SECTIONS,
140
- handleClose: jest.fn(),
141
- type: 'catalog-dropdown',
142
- MarketingBanner
143
- });
144
- expect(view.queryByText('Test banner text')).not.toBeInTheDocument();
145
- });
146
- });
147
- describe('tab navigation', () => {
148
- it('starts with the first tab active by default', () => {
149
- const {
150
- view
151
- } = renderView({
152
- navSections: CATALOG_NAV_SECTIONS,
153
- handleClose: jest.fn(),
154
- type: 'catalog-dropdown'
155
- });
156
- const courseTopicsButton = view.getByTestId('nav-section-course-topics');
157
- expect(courseTopicsButton).toHaveAttribute('aria-expanded', 'true');
158
- });
159
- it('switches active tab when clicking on different sections', async () => {
160
- const {
161
- view
162
- } = renderView({
163
- navSections: CATALOG_NAV_SECTIONS,
164
- handleClose: jest.fn(),
165
- type: 'catalog-dropdown'
166
- });
167
- const careerPathsButton = view.getByTestId('nav-section-career-paths');
168
- await userEvent.click(careerPathsButton);
169
- expect(careerPathsButton).toHaveAttribute('aria-expanded', 'true');
170
- const courseTopicsButton = view.getByTestId('nav-section-course-topics');
171
- expect(courseTopicsButton).toHaveAttribute('aria-expanded', 'false');
172
- });
173
- it('calls tracking with correct parameters when clicking nav section', async () => {
174
- const {
175
- view
176
- } = renderView({
177
- navSections: CATALOG_NAV_SECTIONS,
178
- handleClose: jest.fn(),
179
- type: 'catalog-dropdown'
180
- });
181
- const careerPathsButton = view.getByTestId('nav-section-career-paths');
182
- await userEvent.click(careerPathsButton);
183
- expect(mockOnClick).toHaveBeenCalledTimes(1);
184
- expect(mockOnClick).toHaveBeenCalledWith(expect.anything(),
185
- // event object
186
- expect.objectContaining({
187
- id: 'career-paths',
188
- type: 'catalog-dropdown'
189
- }) // tracking parameters
190
- );
191
- });
192
- });
193
- });
@@ -1,21 +0,0 @@
1
- import { GamutIconProps } from '@codecademy/gamut-icons';
2
- import React, { PropsWithChildren } from 'react';
3
- import { AppHeaderCatalogDropdownItem, AppHeaderResourcesDropdownItem } from '../../shared';
4
- type NavSectionProps = PropsWithChildren & {
5
- item: AppHeaderCatalogDropdownItem | AppHeaderResourcesDropdownItem;
6
- isActiveTab: boolean;
7
- setActiveTab: (tab: number) => void;
8
- icon?: React.ComponentType<GamutIconProps>;
9
- text: string;
10
- index: number;
11
- tabIndex?: number;
12
- };
13
- export declare const NavigationButton: import("@emotion/styled").StyledComponent<{
14
- theme?: import("@emotion/react").Theme;
15
- as?: React.ElementType;
16
- } & {
17
- isActive: boolean;
18
- index: number;
19
- }, React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
20
- declare const NavSection: ({ isActiveTab, setActiveTab, icon: Icon, text, index, children, item, tabIndex, }: NavSectionProps) => import("react/jsx-runtime").JSX.Element;
21
- export default NavSection;