@codecademy/brand 2.9.0-alpha.5a84a4940d.0 → 2.9.0-alpha.686a21266f.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.
@@ -6,6 +6,7 @@ import { CourseDifficulty } from '../../../ContentGroupBaseCard/types';
6
6
  import { useGlobalHeaderItemClick } from '../../../GlobalHeader/context';
7
7
  import { liveLearningHubItems, topLanguages } from '../../../lib/catalogList';
8
8
  import { AppHeaderDietCard } from '../AppHeaderDietCard';
9
+ import { useAppHeaderDropdownContext } from '../AppHeaderDropdownProvider';
9
10
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
10
11
  export const CourseTopicsPanel = ({
11
12
  tabIndex = 0
@@ -158,7 +159,7 @@ export const CertificationPathsPanel = ({
158
159
  gap: 8,
159
160
  children: [providers.map(provider => /*#__PURE__*/_jsx(ProviderChip, {
160
161
  text: provider,
161
- href: `/search?q=${provider} certifications`,
162
+ href: `/search?query=${provider} certifications`,
162
163
  tabIndex: tabIndex
163
164
  }, provider)), /*#__PURE__*/_jsx(ProviderChip, {
164
165
  text: "+ More providers",
@@ -239,6 +240,9 @@ const PanelLayout = ({
239
240
  const {
240
241
  globalHeaderItemClick
241
242
  } = useGlobalHeaderItemClick();
243
+ const {
244
+ handleClose
245
+ } = useAppHeaderDropdownContext();
242
246
  return /*#__PURE__*/_jsxs(FlexBox, {
243
247
  flexDirection: "column",
244
248
  gap: 24,
@@ -255,7 +259,10 @@ const PanelLayout = ({
255
259
  children: description
256
260
  }), children, /*#__PURE__*/_jsxs(TextButton, {
257
261
  href: linkItem.href,
258
- onClick: event => globalHeaderItemClick(event, linkItem),
262
+ onClick: event => {
263
+ globalHeaderItemClick(event, linkItem);
264
+ handleClose();
265
+ },
259
266
  tabIndex: tabIndex,
260
267
  children: [linkItem.text, " ", /*#__PURE__*/_jsx(MiniArrowRightIcon, {
261
268
  ml: 8
@@ -3,6 +3,7 @@ import { AnchorRefItemType } from '../../shared';
3
3
  export interface AppHeaderDropdownContextType {
4
4
  firstItemRef?: AnchorRefItemType;
5
5
  setFirstItemRef: Dispatch<SetStateAction<AnchorRefItemType>> | undefined;
6
+ handleClose: () => void;
6
7
  }
7
8
  export declare const AppHeaderDropdownContext: React.Context<AppHeaderDropdownContextType>;
8
9
  export declare const AppHeaderDropdownProvider: React.FC<{
@@ -1,10 +1,12 @@
1
1
  import { Box } from '@codecademy/gamut';
2
+ import noop from 'lodash/fp/noop';
2
3
  import React, { createContext, useContext, useState } from 'react';
3
4
  import { useOnEscHandler } from '../../shared';
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
5
6
  export const AppHeaderDropdownContext = /*#__PURE__*/createContext({
6
7
  firstItemRef: undefined,
7
- setFirstItemRef: undefined
8
+ setFirstItemRef: undefined,
9
+ handleClose: () => noop
8
10
  });
9
11
  export const AppHeaderDropdownProvider = ({
10
12
  children,
@@ -15,7 +17,8 @@ export const AppHeaderDropdownProvider = ({
15
17
  return /*#__PURE__*/_jsx(AppHeaderDropdownContext.Provider, {
16
18
  value: {
17
19
  firstItemRef,
18
- setFirstItemRef
20
+ setFirstItemRef,
21
+ handleClose
19
22
  },
20
23
  children: /*#__PURE__*/_jsx(Box, {
21
24
  onKeyDown: onKeyDown,
package/dist/index.d.ts CHANGED
@@ -27,7 +27,6 @@ export * from './ContentGroupBaseCard';
27
27
  export * from './ContentGroupBaseCard/types';
28
28
  export * from './ContentGroupBaseCard/helpers';
29
29
  export * from './CourseCard';
30
- export * from './CourseRecommendationsLink';
31
30
  export * from './CurriculumCard';
32
31
  export * from './CurriculumCard/Difficulty';
33
32
  export * from './CurriculumCard/Difficulty/types';
package/dist/index.js CHANGED
@@ -27,7 +27,6 @@ export * from './ContentGroupBaseCard';
27
27
  export * from './ContentGroupBaseCard/types';
28
28
  export * from './ContentGroupBaseCard/helpers';
29
29
  export * from './CourseCard';
30
- export * from './CourseRecommendationsLink';
31
30
  export * from './CurriculumCard';
32
31
  export * from './CurriculumCard/Difficulty';
33
32
  export * from './CurriculumCard/Difficulty/types';
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.9.0-alpha.5a84a4940d.0",
4
+ "version": "2.9.0-alpha.686a21266f.0",
5
5
  "author": "Codecademy Engineering <dev@codecademy.com>",
6
6
  "dependencies": {
7
7
  "@emotion/is-prop-valid": "^1.2.1",
@@ -1,3 +0,0 @@
1
- export declare const CourseRecommendationsLink: React.FC<{
2
- onClick?: () => void;
3
- }>;
@@ -1,27 +0,0 @@
1
- import { FillButton, FlexBox, Text } from '@codecademy/gamut';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- export const CourseRecommendationsLink = ({
4
- onClick
5
- }) => /*#__PURE__*/_jsxs(FlexBox, {
6
- column: true,
7
- p: 16,
8
- bg: "navy-100",
9
- border: 1,
10
- borderColor: "border-tertiary",
11
- borderRadius: "lg",
12
- children: [/*#__PURE__*/_jsx(Text, {
13
- variant: "p-large",
14
- fontWeight: "bold",
15
- children: "Get personalized course recommendations"
16
- }), /*#__PURE__*/_jsx(Text, {
17
- variant: "p-base",
18
- mt: 8,
19
- children: "Answer a few quick questions about your interests and skill level. We\u2019ll create a custom list of courses just for you."
20
- }), /*#__PURE__*/_jsx(FillButton, {
21
- size: "small",
22
- mt: 16,
23
- href: "/welcome/find-a-course",
24
- onClick: onClick,
25
- children: "Take the quiz"
26
- })]
27
- });