@codecademy/brand 5.2.0-alpha.d45bb6b38.0 → 5.2.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.
@@ -1,9 +1,10 @@
1
- import { Anchor, Box } from '@codecademy/gamut';
1
+ import { Anchor, Box, GridBox, Text } from '@codecademy/gamut';
2
2
  import React from 'react';
3
- import { useGlobalHeaderItemClick } from '../../../GlobalHeader/context';
3
+ import { useGlobalHeaderDynamicDataContext, useGlobalHeaderItemClick } from '../../../GlobalHeader/context';
4
4
  import { useAppHeaderSectionContext } from '../AppHeaderSection/AppHeaderSectionContext';
5
5
  import { PanelLayout } from '../AppHeaderSection/PanelLayout';
6
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ import { SkillTile } from '../AppHeaderSkillTile';
7
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
7
8
  const makeCta = (id, href, text, trackingTarget) => ({
8
9
  id,
9
10
  href,
@@ -18,17 +19,22 @@ export const BootcampsPanel = () => {
18
19
  const {
19
20
  globalHeaderItemClick
20
21
  } = useGlobalHeaderItemClick();
22
+ const {
23
+ globalHeaderDynamicData
24
+ } = useGlobalHeaderDynamicDataContext();
21
25
  const privateBootcampFormUrl = 'https://forms.office.com/r/qqjDwRmkqA';
26
+ const upcomingBootcamps = globalHeaderDynamicData?.liveCoursesDropdown?.upcomingBootcamps ?? [];
22
27
  const description = /*#__PURE__*/_jsxs(Box, {
23
28
  mb: 8,
24
- children: ["Join live virtual bootcamps that span multiple weeks and help you build real-world, in-demand skills. Led by experts, each bootcamp includes instructor support, community, and comes with Codecademy Pro access.", /*#__PURE__*/_jsx("br", {}), "Looking for a private bootcamp?", ' ', /*#__PURE__*/_jsx(Anchor, {
29
+ children: ["Join live virtual bootcamps that span multiple weeks and help you build real-world, in-demand skills. Led by experts, each bootcamp includes instructor support, community, professional mentorship\u2014and comes with Codecademy Pro access.", /*#__PURE__*/_jsx("br", {}), "Looking for a private bootcamp?", ' ', /*#__PURE__*/_jsx(Anchor, {
25
30
  tabIndex: tabIndex,
26
31
  href: privateBootcampFormUrl,
27
32
  onClick: event => globalHeaderItemClick(event, {
28
33
  type: 'link',
29
34
  href: privateBootcampFormUrl,
30
35
  text: 'Get in touch',
31
- id: 'private-bootcamp-contact'
36
+ id: 'private-bootcamp-contact',
37
+ trackingTarget: 'topnav_live_courses_private_bootcamp_contact'
32
38
  }),
33
39
  children: "Get in touch"
34
40
  })]
@@ -36,7 +42,33 @@ export const BootcampsPanel = () => {
36
42
  return /*#__PURE__*/_jsx(PanelLayout, {
37
43
  heading: "Bootcamps",
38
44
  description: description,
39
- linkItem: makeCta('bootcamps', '/bootcamps', 'Explore Bootcamps', 'topnav_live_courses_bootcamps')
45
+ linkItem: makeCta('bootcamps', '/bootcamps', 'Explore all Bootcamps', 'topnav_live_courses_bootcamps'),
46
+ children: upcomingBootcamps.length > 0 && /*#__PURE__*/_jsxs(_Fragment, {
47
+ children: [/*#__PURE__*/_jsx(Text, {
48
+ variant: "p-large",
49
+ fontWeight: 700,
50
+ as: "h3",
51
+ children: "Upcoming bootcamps"
52
+ }), /*#__PURE__*/_jsx(GridBox, {
53
+ gridTemplateColumns: {
54
+ _: '1fr',
55
+ xs: '1fr 1fr'
56
+ },
57
+ gap: 8,
58
+ pl: 0,
59
+ as: "ul",
60
+ listStyle: "none",
61
+ mb: 24,
62
+ children: upcomingBootcamps.map(bootcamp => /*#__PURE__*/_jsx("li", {
63
+ children: /*#__PURE__*/_jsx(SkillTile, {
64
+ item: {
65
+ ...bootcamp,
66
+ type: 'link'
67
+ }
68
+ })
69
+ }, bootcamp.id))
70
+ })]
71
+ })
40
72
  });
41
73
  };
42
74
  export const CoachingPanel = () => {
@@ -98,6 +98,15 @@ export type PromotedPath = {
98
98
  difficulty: CourseDifficulty | null;
99
99
  durationHours: number | null;
100
100
  };
101
+ export type UpcomingLiveCoursesNavItem = {
102
+ id: string;
103
+ href: string;
104
+ text: string;
105
+ trackingTarget: string;
106
+ };
107
+ export type LiveCoursesDropdownData = {
108
+ upcomingBootcamps: UpcomingLiveCoursesNavItem[];
109
+ };
101
110
  export type GlobalHeaderDynamicData = {
102
111
  catalogDropdown: {
103
112
  banner: {
@@ -116,5 +125,6 @@ export type GlobalHeaderDynamicData = {
116
125
  totalCertificationPathCount: number;
117
126
  };
118
127
  };
128
+ liveCoursesDropdown: LiveCoursesDropdownData;
119
129
  };
120
130
  export {};
@@ -1,10 +1,10 @@
1
- import { theme } from '@codecademy/gamut-styles';
1
+ import { colors } from '@codecademy/gamut-styles';
2
2
  import * as React from 'react';
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  export const ProLabelCutout = ({
5
5
  ariaLabel = 'Pro',
6
- backgroundColor = theme.colors.navy,
7
- cutoutColor = theme.colors.white,
6
+ backgroundColor = colors.navy,
7
+ cutoutColor = colors.white,
8
8
  width = 30
9
9
  }) => /*#__PURE__*/_jsxs("svg", {
10
10
  width: width,
@@ -1,9 +1,9 @@
1
- import { theme } from '@codecademy/gamut-styles';
1
+ import { colors } from '@codecademy/gamut-styles';
2
2
  import * as React from 'react';
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  export const ProLabelCutoutTransparent = ({
5
5
  ariaLabel = 'Pro',
6
- backgroundColor = theme.colors.navy,
6
+ backgroundColor = colors.navy,
7
7
  width = 30
8
8
  }) => /*#__PURE__*/_jsxs("svg", {
9
9
  width: width,
@@ -1,15 +1,15 @@
1
- import { Colors } from '@codecademy/gamut-styles';
1
+ import { colors } from '@codecademy/gamut-styles';
2
2
  import * as React from 'react';
3
3
  type BaseProps = {
4
4
  ariaLabel?: string;
5
- backgroundColor?: Colors;
5
+ backgroundColor?: keyof typeof colors;
6
6
  width?: number;
7
7
  };
8
8
  export type ProLabelProps = (BaseProps & {
9
9
  variant: 'transparent';
10
10
  }) | (BaseProps & {
11
11
  variant: 'cutout';
12
- cutoutColor?: Colors;
12
+ cutoutColor?: keyof typeof colors;
13
13
  });
14
14
  export declare const ProLabel: React.FC<ProLabelProps>;
15
15
  export {};
@@ -1,9 +1,8 @@
1
- import { theme } from '@codecademy/gamut-styles';
1
+ import { colors } from '@codecademy/gamut-styles';
2
2
  import * as React from 'react';
3
3
  import { ProLabelCutout } from './ProLabelCutout';
4
4
  import { ProLabelCutoutTransparent } from './ProLabelCutoutTransparent';
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
- const themeColor = color => theme.colors[color];
7
6
  export const ProLabel = props => {
8
7
  if (props.variant === 'cutout') {
9
8
  const {
@@ -12,8 +11,8 @@ export const ProLabel = props => {
12
11
  ...forwardedProps
13
12
  } = props;
14
13
  return /*#__PURE__*/_jsx(ProLabelCutout, {
15
- backgroundColor: themeColor(backgroundColor),
16
- cutoutColor: themeColor(cutoutColor),
14
+ backgroundColor: colors[backgroundColor],
15
+ cutoutColor: colors[cutoutColor],
17
16
  ...forwardedProps
18
17
  });
19
18
  }
@@ -22,7 +21,7 @@ export const ProLabel = props => {
22
21
  ...forwardedProps
23
22
  } = props;
24
23
  return /*#__PURE__*/_jsx(ProLabelCutoutTransparent, {
25
- backgroundColor: themeColor(backgroundColor),
24
+ backgroundColor: colors[backgroundColor],
26
25
  ...forwardedProps
27
26
  });
28
27
  };
@@ -1,9 +1,9 @@
1
- import { Colors } from '@codecademy/gamut-styles';
1
+ import { colors } from '@codecademy/gamut-styles';
2
2
  import * as React from 'react';
3
3
  export type ProLogoAltProps = {
4
4
  ariaLabel?: string;
5
- backgroundColor?: Colors;
6
- textColor?: Colors;
5
+ backgroundColor?: keyof typeof colors;
6
+ textColor?: keyof typeof colors;
7
7
  width?: number;
8
8
  };
9
9
  export declare const ProLogoAlt: React.FC<ProLogoAltProps>;
@@ -1,7 +1,6 @@
1
- import { theme } from '@codecademy/gamut-styles';
1
+ import { colors } from '@codecademy/gamut-styles';
2
2
  import * as React from 'react';
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
- const themeColor = color => theme.colors[color];
5
4
  export const ProLogoAlt = ({
6
5
  ariaLabel = 'Codecademy Pro Logo',
7
6
  backgroundColor = 'yellow',
@@ -14,14 +13,14 @@ export const ProLogoAlt = ({
14
13
  xmlns: "http://www.w3.org/2000/svg",
15
14
  "aria-label": ariaLabel,
16
15
  children: /*#__PURE__*/_jsxs("g", {
17
- fill: themeColor(backgroundColor),
16
+ fill: colors[backgroundColor],
18
17
  fillRule: "evenodd",
19
18
  children: [/*#__PURE__*/_jsx("path", {
20
19
  d: "m0 0h74v40h-74zm78 34h17v6h-17z",
21
- fill: themeColor(backgroundColor)
20
+ fill: colors[backgroundColor]
22
21
  }), /*#__PURE__*/_jsx("path", {
23
22
  d: "m13.971 23.67v6.82h-3.971v-20.145h6.82c4.749 0 7.253 2.965 7.253 6.62 0 3.625-2.504 6.705-7.253 6.705zm2.245-9.871h-2.245v6.446h2.245c2.187 0 3.77-1.036 3.77-3.28 0-2.245-1.583-3.166-3.77-3.166zm21.518 16.691-4.46-7.741h-2.821v7.741h-4v-20.145h7.568c4.404 0 6.994 2.62 6.994 6.13 0 1.9-.777 4.317-3.828 5.526l5.151 8.49h-4.604zm-.72-13.986c0-1.784-1.295-2.705-3.51-2.705h-3.051v5.468h3.05c2.216 0 3.511-1.036 3.511-2.763zm16.453-6.504c5.843 0 10.533 4.346 10.533 10.418s-4.69 10.417-10.533 10.417c-5.842 0-10.533-4.345-10.533-10.417s4.691-10.418 10.533-10.418zm0 17.152c3.799 0 6.36-2.878 6.36-6.734 0-3.857-2.561-6.734-6.36-6.734s-6.36 2.877-6.36 6.734c0 3.856 2.561 6.734 6.36 6.734z",
24
- fill: themeColor(textColor)
23
+ fill: colors[textColor]
25
24
  })]
26
25
  })
27
26
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codecademy/brand",
3
- "version": "5.2.0-alpha.d45bb6b38.0",
3
+ "version": "5.2.0",
4
4
  "description": "Brand component library for Codecademy",
5
5
  "license": "MIT",
6
6
  "repository": "git@github.com:codecademy-engineering/mono.git",