@codecademy/brand 3.41.0-alpha.5a07edc219.0 → 3.41.0-alpha.923081f516.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/AppHeader/AppHeaderElements/AppHeaderCatalogSection/elements.d.ts +92 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/elements.js +63 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/index.d.ts +13 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/index.js +440 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesSection/index.d.ts +13 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesSection/index.js +194 -0
- package/dist/lib/catalogList/index.d.ts +3 -0
- package/dist/lib/catalogList/index.js +138 -1
- package/package.json +9 -9
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import { Anchor, Badge, Box, Column, FlexBox, GridBox, LayoutGrid, Text } from '@codecademy/gamut';
|
|
2
|
+
import { MiniArrowRightIcon } from '@codecademy/gamut-icons';
|
|
3
|
+
import { TinyBlocks } from '@codecademy/gamut-illustrations';
|
|
4
|
+
import { Background } from '@codecademy/gamut-styles';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { useEffect, useRef } from 'react';
|
|
7
|
+
import { useHeaderDisplayContext } from '../../../GlobalHeader/context';
|
|
8
|
+
import { careerPaths, getTopSubjects, liveLearningHubItems, topLanguages } from '../../../lib/catalogList';
|
|
9
|
+
import { DescriptionSectionContainer, LayoutGridAntiAliased, useMegaMenuHeaderResponsiveStyles } from '../../shared';
|
|
10
|
+
import { useAppHeaderDropdownContext } from '../AppHeaderDropdownProvider';
|
|
11
|
+
import { BannerAnchor, StyledAnchorColumn, StyledColumn, StyledFillButton, SubjectAnchor, topicWrapperProps, useBannerResponsiveStyles } from './elements';
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
const quizAnchorData = {
|
|
14
|
+
text: 'Take our quiz',
|
|
15
|
+
id: 'quiz',
|
|
16
|
+
type: 'text-button',
|
|
17
|
+
href: '/explore/sorting-quiz',
|
|
18
|
+
trackingTarget: 'sorting_quiz'
|
|
19
|
+
};
|
|
20
|
+
const onboardingQuizAnchorData = {
|
|
21
|
+
text: 'Take our quiz',
|
|
22
|
+
id: 'onboarding_quiz',
|
|
23
|
+
type: 'text-button',
|
|
24
|
+
href: '/welcome/find-a-course',
|
|
25
|
+
trackingTarget: 'sorting_quiz'
|
|
26
|
+
};
|
|
27
|
+
const catalogButtonData = {
|
|
28
|
+
text: 'Explore all courses',
|
|
29
|
+
id: 'catalog',
|
|
30
|
+
type: 'text-button',
|
|
31
|
+
href: '/catalog',
|
|
32
|
+
trackingTarget: 'topnav_catalog_explore_full'
|
|
33
|
+
};
|
|
34
|
+
const uxDesignerCareerPathHighlight = {
|
|
35
|
+
text: 'Want to help shape digital products? Check out the new UX Designer career path.',
|
|
36
|
+
id: 'nav-highlight',
|
|
37
|
+
type: 'link',
|
|
38
|
+
href: '/learn/paths/ux-designer-career-path',
|
|
39
|
+
trackingTarget: 'topnav_catalog_banner_ux_designer_career_path'
|
|
40
|
+
};
|
|
41
|
+
export const AppHeaderCatalogSection = /*#__PURE__*/React.forwardRef(({
|
|
42
|
+
action,
|
|
43
|
+
item,
|
|
44
|
+
isOpen,
|
|
45
|
+
keyDownEvents,
|
|
46
|
+
handleClose
|
|
47
|
+
}, ref) => {
|
|
48
|
+
const firstElemRef = useRef(null);
|
|
49
|
+
const {
|
|
50
|
+
setFirstItemRef
|
|
51
|
+
} = useAppHeaderDropdownContext();
|
|
52
|
+
const {
|
|
53
|
+
showOnboardingQuiz,
|
|
54
|
+
showSortingQuiz
|
|
55
|
+
} = useHeaderDisplayContext();
|
|
56
|
+
const tabIndex = isOpen === false ? -1 : 0;
|
|
57
|
+
const styles = useMegaMenuHeaderResponsiveStyles();
|
|
58
|
+
const bannerStyles = useBannerResponsiveStyles();
|
|
59
|
+
const showQuiz = showOnboardingQuiz || showSortingQuiz;
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (setFirstItemRef && firstElemRef.current) {
|
|
62
|
+
setFirstItemRef(firstElemRef.current);
|
|
63
|
+
}
|
|
64
|
+
}, [setFirstItemRef, firstElemRef]);
|
|
65
|
+
const navHighlightData = uxDesignerCareerPathHighlight;
|
|
66
|
+
const topSubjects = getTopSubjects();
|
|
67
|
+
const onClick = (event, linkItem) => {
|
|
68
|
+
handleClose?.();
|
|
69
|
+
return action(event, linkItem);
|
|
70
|
+
};
|
|
71
|
+
const DescriptionSection = ({
|
|
72
|
+
title,
|
|
73
|
+
subtitle
|
|
74
|
+
}) => /*#__PURE__*/_jsxs(DescriptionSectionContainer, {
|
|
75
|
+
"data-focusablecatalog": "true",
|
|
76
|
+
"data-testid": "title-description-section",
|
|
77
|
+
tabIndex: -1,
|
|
78
|
+
flexDirection: "column",
|
|
79
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
80
|
+
as: "h2",
|
|
81
|
+
variant: "title-xs",
|
|
82
|
+
mb: 8,
|
|
83
|
+
fontWeight: 700,
|
|
84
|
+
children: title
|
|
85
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
86
|
+
fontSize: 14,
|
|
87
|
+
children: subtitle
|
|
88
|
+
})]
|
|
89
|
+
});
|
|
90
|
+
return /*#__PURE__*/_jsxs(LayoutGridAntiAliased, {
|
|
91
|
+
onKeyDown: keyDownEvents,
|
|
92
|
+
ref: ref,
|
|
93
|
+
as: "ul",
|
|
94
|
+
p: 0,
|
|
95
|
+
children: [/*#__PURE__*/_jsx(StyledColumn, {
|
|
96
|
+
as: "li",
|
|
97
|
+
size: 12,
|
|
98
|
+
children: /*#__PURE__*/_jsxs(LayoutGrid, {
|
|
99
|
+
children: [/*#__PURE__*/_jsx(Column, {
|
|
100
|
+
size: {
|
|
101
|
+
xs: 12,
|
|
102
|
+
lg: 3
|
|
103
|
+
},
|
|
104
|
+
rowspan: 2,
|
|
105
|
+
children: /*#__PURE__*/_jsx(Background, {
|
|
106
|
+
...styles,
|
|
107
|
+
px: {
|
|
108
|
+
_: 16,
|
|
109
|
+
xs: 32,
|
|
110
|
+
sm: 64,
|
|
111
|
+
md: 48,
|
|
112
|
+
lg: 24
|
|
113
|
+
},
|
|
114
|
+
py: {
|
|
115
|
+
_: 16,
|
|
116
|
+
sm: 32
|
|
117
|
+
},
|
|
118
|
+
borderBottom: 1,
|
|
119
|
+
children: /*#__PURE__*/_jsxs(FlexBox, {
|
|
120
|
+
height: "100%",
|
|
121
|
+
flexDirection: "column",
|
|
122
|
+
justifyContent: {
|
|
123
|
+
lg: 'space-between'
|
|
124
|
+
},
|
|
125
|
+
children: [/*#__PURE__*/_jsx(DescriptionSection, {
|
|
126
|
+
title: "Popular course topics",
|
|
127
|
+
subtitle: "Explore free or paid courses in topics that interest you."
|
|
128
|
+
}), /*#__PURE__*/_jsx(StyledFillButton, {
|
|
129
|
+
"data-focusablecatalog": "true",
|
|
130
|
+
href: catalogButtonData.href,
|
|
131
|
+
onClick: event => onClick(event, item),
|
|
132
|
+
tabIndex: tabIndex,
|
|
133
|
+
ref: firstElemRef,
|
|
134
|
+
children: catalogButtonData.text
|
|
135
|
+
})]
|
|
136
|
+
})
|
|
137
|
+
})
|
|
138
|
+
}), /*#__PURE__*/_jsx(Column, {
|
|
139
|
+
size: {
|
|
140
|
+
xs: 12,
|
|
141
|
+
lg: 8
|
|
142
|
+
},
|
|
143
|
+
py: 32,
|
|
144
|
+
pl: {
|
|
145
|
+
_: 16,
|
|
146
|
+
xs: 32,
|
|
147
|
+
sm: 64,
|
|
148
|
+
md: 48
|
|
149
|
+
},
|
|
150
|
+
children: /*#__PURE__*/_jsxs(GridBox, {
|
|
151
|
+
as: "ul",
|
|
152
|
+
gridTemplateColumns: {
|
|
153
|
+
_: '1fr',
|
|
154
|
+
lg: 'repeat(3, 1fr)'
|
|
155
|
+
},
|
|
156
|
+
gridTemplateRows: {
|
|
157
|
+
_: 'repeat(18, 1fr)',
|
|
158
|
+
lg: 'repeat(6, 1fr)'
|
|
159
|
+
},
|
|
160
|
+
listStyleType: "none",
|
|
161
|
+
gridAutoFlow: "column",
|
|
162
|
+
pl: 0,
|
|
163
|
+
children: [topLanguages.map(item => /*#__PURE__*/_jsx(Box, {
|
|
164
|
+
minHeight: 32,
|
|
165
|
+
...topicWrapperProps,
|
|
166
|
+
children: /*#__PURE__*/_jsx(Anchor, {
|
|
167
|
+
"data-focusablecatalog": "true",
|
|
168
|
+
variant: "interface",
|
|
169
|
+
href: item.href,
|
|
170
|
+
onClick: event => onClick(event, item),
|
|
171
|
+
tabIndex: tabIndex,
|
|
172
|
+
children: /*#__PURE__*/_jsxs(FlexBox, {
|
|
173
|
+
alignItems: "center",
|
|
174
|
+
gap: 8,
|
|
175
|
+
children: [item.text, item.badge]
|
|
176
|
+
})
|
|
177
|
+
})
|
|
178
|
+
}, item.id)), topSubjects.map(item => /*#__PURE__*/_jsx(Box, {
|
|
179
|
+
minHeight: 36,
|
|
180
|
+
...topicWrapperProps,
|
|
181
|
+
children: /*#__PURE__*/_jsx(SubjectAnchor, {
|
|
182
|
+
"data-focusablecatalog": "true",
|
|
183
|
+
variant: "interface",
|
|
184
|
+
href: item.href,
|
|
185
|
+
onClick: event => onClick(event, item),
|
|
186
|
+
tabIndex: tabIndex,
|
|
187
|
+
children: item.text
|
|
188
|
+
})
|
|
189
|
+
}, item.id))]
|
|
190
|
+
})
|
|
191
|
+
}), /*#__PURE__*/_jsx(GridBox, {
|
|
192
|
+
...bannerStyles,
|
|
193
|
+
gridColumnStart: {
|
|
194
|
+
xs: 1,
|
|
195
|
+
lg: 4
|
|
196
|
+
},
|
|
197
|
+
gridColumnEnd: "span 12",
|
|
198
|
+
py: 16,
|
|
199
|
+
px: {
|
|
200
|
+
_: 16,
|
|
201
|
+
xs: 32,
|
|
202
|
+
sm: 64,
|
|
203
|
+
md: 48
|
|
204
|
+
},
|
|
205
|
+
borderTop: 1,
|
|
206
|
+
children: /*#__PURE__*/_jsxs(BannerAnchor, {
|
|
207
|
+
variant: "interface",
|
|
208
|
+
href: navHighlightData.href,
|
|
209
|
+
onClick: event => onClick(event, navHighlightData),
|
|
210
|
+
"data-focusablecatalog": "true",
|
|
211
|
+
tabIndex: tabIndex,
|
|
212
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
213
|
+
display: {
|
|
214
|
+
xs: 'flex'
|
|
215
|
+
},
|
|
216
|
+
width: "100%",
|
|
217
|
+
alignItems: "center",
|
|
218
|
+
children: [/*#__PURE__*/_jsx(Badge, {
|
|
219
|
+
variant: "tertiary",
|
|
220
|
+
size: "sm",
|
|
221
|
+
mr: 8,
|
|
222
|
+
children: "New"
|
|
223
|
+
}), navHighlightData.text]
|
|
224
|
+
}), /*#__PURE__*/_jsx(MiniArrowRightIcon, {
|
|
225
|
+
justifySelf: "end",
|
|
226
|
+
alignSelf: "center"
|
|
227
|
+
})]
|
|
228
|
+
})
|
|
229
|
+
})]
|
|
230
|
+
})
|
|
231
|
+
}, "Popular course topics"), !item.hideCareerPaths && /*#__PURE__*/_jsx(StyledColumn, {
|
|
232
|
+
as: "li",
|
|
233
|
+
size: 12,
|
|
234
|
+
children: /*#__PURE__*/_jsxs(LayoutGrid, {
|
|
235
|
+
children: [/*#__PURE__*/_jsx(Column, {
|
|
236
|
+
size: {
|
|
237
|
+
xs: 12,
|
|
238
|
+
lg: 3
|
|
239
|
+
},
|
|
240
|
+
children: /*#__PURE__*/_jsx(Background, {
|
|
241
|
+
...styles,
|
|
242
|
+
px: {
|
|
243
|
+
_: 16,
|
|
244
|
+
xs: 32,
|
|
245
|
+
sm: 64,
|
|
246
|
+
md: 48,
|
|
247
|
+
lg: 24
|
|
248
|
+
},
|
|
249
|
+
py: {
|
|
250
|
+
_: 16,
|
|
251
|
+
sm: 32
|
|
252
|
+
},
|
|
253
|
+
borderBottom: 1,
|
|
254
|
+
children: /*#__PURE__*/_jsx(DescriptionSection, {
|
|
255
|
+
title: "Top career paths",
|
|
256
|
+
subtitle: "Choose your career. We'll teach you the skills to get job-ready."
|
|
257
|
+
})
|
|
258
|
+
})
|
|
259
|
+
}), /*#__PURE__*/_jsx(Column, {
|
|
260
|
+
size: {
|
|
261
|
+
xs: 12,
|
|
262
|
+
lg: 8
|
|
263
|
+
},
|
|
264
|
+
children: /*#__PURE__*/_jsx(LayoutGrid, {
|
|
265
|
+
as: "ul",
|
|
266
|
+
py: 32,
|
|
267
|
+
pl: {
|
|
268
|
+
_: 16,
|
|
269
|
+
xs: 32,
|
|
270
|
+
sm: 64,
|
|
271
|
+
md: 48
|
|
272
|
+
},
|
|
273
|
+
children: careerPaths.map(item => /*#__PURE__*/_jsx(StyledAnchorColumn, {
|
|
274
|
+
as: "li",
|
|
275
|
+
size: {
|
|
276
|
+
_: 12,
|
|
277
|
+
lg: 4
|
|
278
|
+
},
|
|
279
|
+
children: /*#__PURE__*/_jsx(Anchor, {
|
|
280
|
+
"data-focusablecatalog": "true",
|
|
281
|
+
variant: "interface",
|
|
282
|
+
href: item.href,
|
|
283
|
+
onClick: event => onClick(event, item),
|
|
284
|
+
tabIndex: tabIndex,
|
|
285
|
+
children: item.text
|
|
286
|
+
})
|
|
287
|
+
}, item.id))
|
|
288
|
+
})
|
|
289
|
+
})]
|
|
290
|
+
})
|
|
291
|
+
}, "Top career paths"), /*#__PURE__*/_jsx(StyledColumn, {
|
|
292
|
+
as: "li",
|
|
293
|
+
size: 12,
|
|
294
|
+
children: /*#__PURE__*/_jsxs(LayoutGrid, {
|
|
295
|
+
children: [/*#__PURE__*/_jsx(Column, {
|
|
296
|
+
size: {
|
|
297
|
+
xs: 12,
|
|
298
|
+
lg: 3
|
|
299
|
+
},
|
|
300
|
+
children: /*#__PURE__*/_jsx(Background, {
|
|
301
|
+
...styles,
|
|
302
|
+
px: {
|
|
303
|
+
_: 16,
|
|
304
|
+
xs: 32,
|
|
305
|
+
sm: 64,
|
|
306
|
+
md: 48,
|
|
307
|
+
lg: 24
|
|
308
|
+
},
|
|
309
|
+
py: {
|
|
310
|
+
_: 16,
|
|
311
|
+
sm: 32
|
|
312
|
+
},
|
|
313
|
+
children: /*#__PURE__*/_jsx(DescriptionSection, {
|
|
314
|
+
title: liveLearningHubItems.title,
|
|
315
|
+
subtitle: liveLearningHubItems.description || ''
|
|
316
|
+
})
|
|
317
|
+
})
|
|
318
|
+
}), /*#__PURE__*/_jsx(Column, {
|
|
319
|
+
size: {
|
|
320
|
+
xs: 12,
|
|
321
|
+
lg: 8
|
|
322
|
+
},
|
|
323
|
+
children: /*#__PURE__*/_jsx(LayoutGrid, {
|
|
324
|
+
as: "ul",
|
|
325
|
+
py: 32,
|
|
326
|
+
pl: {
|
|
327
|
+
_: 16,
|
|
328
|
+
xs: 32,
|
|
329
|
+
sm: 64,
|
|
330
|
+
md: 48
|
|
331
|
+
},
|
|
332
|
+
children: liveLearningHubItems.data.map(dataItem => {
|
|
333
|
+
const {
|
|
334
|
+
id,
|
|
335
|
+
href,
|
|
336
|
+
text,
|
|
337
|
+
badge,
|
|
338
|
+
newTab
|
|
339
|
+
} = dataItem;
|
|
340
|
+
return /*#__PURE__*/_jsx(Column, {
|
|
341
|
+
as: "li",
|
|
342
|
+
size: {
|
|
343
|
+
_: 12,
|
|
344
|
+
lg: 4
|
|
345
|
+
},
|
|
346
|
+
mb: {
|
|
347
|
+
_: 16,
|
|
348
|
+
lg: 0
|
|
349
|
+
},
|
|
350
|
+
children: /*#__PURE__*/_jsx(Anchor, {
|
|
351
|
+
"data-focusableresource": "true",
|
|
352
|
+
variant: "interface",
|
|
353
|
+
href: href,
|
|
354
|
+
onClick: event => onClick(event, dataItem),
|
|
355
|
+
tabIndex: tabIndex,
|
|
356
|
+
target: newTab ? '_blank' : '_self',
|
|
357
|
+
children: 'description' in dataItem && /*#__PURE__*/_jsxs(_Fragment, {
|
|
358
|
+
children: [/*#__PURE__*/_jsxs(FlexBox, {
|
|
359
|
+
whiteSpace: "nowrap",
|
|
360
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
361
|
+
fontSize: 16,
|
|
362
|
+
fontWeight: "bold",
|
|
363
|
+
as: "h3",
|
|
364
|
+
pb: 4,
|
|
365
|
+
children: text
|
|
366
|
+
}), badge]
|
|
367
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
368
|
+
fontSize: 14,
|
|
369
|
+
pb: 4,
|
|
370
|
+
pr: 40,
|
|
371
|
+
children: dataItem.description
|
|
372
|
+
})]
|
|
373
|
+
})
|
|
374
|
+
})
|
|
375
|
+
}, id);
|
|
376
|
+
})
|
|
377
|
+
})
|
|
378
|
+
})]
|
|
379
|
+
})
|
|
380
|
+
}, "Live Learning"), showQuiz && /*#__PURE__*/_jsx(Column, {
|
|
381
|
+
px: {
|
|
382
|
+
_: 16,
|
|
383
|
+
xs: 32,
|
|
384
|
+
sm: 64,
|
|
385
|
+
md: 48,
|
|
386
|
+
lg: 24
|
|
387
|
+
},
|
|
388
|
+
py: 16,
|
|
389
|
+
children: /*#__PURE__*/_jsxs(FlexBox, {
|
|
390
|
+
alignItems: {
|
|
391
|
+
_: 'flex-start',
|
|
392
|
+
sm: 'center'
|
|
393
|
+
},
|
|
394
|
+
flexDirection: {
|
|
395
|
+
_: 'column',
|
|
396
|
+
sm: 'row'
|
|
397
|
+
},
|
|
398
|
+
children: [/*#__PURE__*/_jsxs(FlexBox, {
|
|
399
|
+
alignItems: "center",
|
|
400
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
401
|
+
mr: 12,
|
|
402
|
+
children: /*#__PURE__*/_jsx(TinyBlocks, {
|
|
403
|
+
"aria-hidden": true,
|
|
404
|
+
height: 26,
|
|
405
|
+
width: 26
|
|
406
|
+
})
|
|
407
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
408
|
+
children: "Not sure where to begin?"
|
|
409
|
+
})]
|
|
410
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
411
|
+
children: /*#__PURE__*/_jsxs(Anchor, {
|
|
412
|
+
variant: "standard",
|
|
413
|
+
fontSize: 14,
|
|
414
|
+
fontWeight: 700,
|
|
415
|
+
textAlign: {
|
|
416
|
+
_: 'left',
|
|
417
|
+
lg: 'center'
|
|
418
|
+
},
|
|
419
|
+
href: showOnboardingQuiz ? onboardingQuizAnchorData.href : quizAnchorData.href,
|
|
420
|
+
"data-focusablecatalog": "true",
|
|
421
|
+
onClick: event => onClick(event, showOnboardingQuiz ? onboardingQuizAnchorData : quizAnchorData),
|
|
422
|
+
tabIndex: tabIndex,
|
|
423
|
+
ml: {
|
|
424
|
+
_: 0,
|
|
425
|
+
sm: 16
|
|
426
|
+
},
|
|
427
|
+
pt: {
|
|
428
|
+
_: 8,
|
|
429
|
+
sm: 0
|
|
430
|
+
},
|
|
431
|
+
children: [showOnboardingQuiz ? onboardingQuizAnchorData.text : quizAnchorData.text, /*#__PURE__*/_jsx("span", {
|
|
432
|
+
"aria-hidden": true,
|
|
433
|
+
children: "\xA0\u2192"
|
|
434
|
+
})]
|
|
435
|
+
})
|
|
436
|
+
})]
|
|
437
|
+
})
|
|
438
|
+
})]
|
|
439
|
+
});
|
|
440
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { RefObject } from 'react';
|
|
3
|
+
import { AppHeaderAction, AppHeaderResourcesDataItem } from '../../shared';
|
|
4
|
+
export type AppHeaderResourcesSectionProps = AppHeaderAction & {
|
|
5
|
+
resources: AppHeaderResourcesDataItem[];
|
|
6
|
+
ref?: RefObject<HTMLUListElement>;
|
|
7
|
+
role?: string;
|
|
8
|
+
id?: string;
|
|
9
|
+
keyDownEvents?: (event: React.KeyboardEvent) => void;
|
|
10
|
+
isOpen?: boolean;
|
|
11
|
+
handleClose?: () => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const AppHeaderResourcesSection: React.ForwardRefExoticComponent<Omit<AppHeaderResourcesSectionProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
import { Anchor, Column, FlexBox, LayoutGrid, Text } from '@codecademy/gamut';
|
|
3
|
+
import { Background, css } from '@codecademy/gamut-styles';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { useEffect, useRef } from 'react';
|
|
6
|
+
import { DescriptionSectionContainer, LayoutGridAntiAliased, useMegaMenuHeaderResponsiveStyles } from '../../shared';
|
|
7
|
+
import { useAppHeaderDropdownContext } from '../AppHeaderDropdownProvider';
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
+
const StyledColumn = /*#__PURE__*/_styled(Column, {
|
|
10
|
+
target: "e1wdl1ig0",
|
|
11
|
+
label: "StyledColumn"
|
|
12
|
+
})(css({
|
|
13
|
+
borderBottom: 1,
|
|
14
|
+
borderColor: 'border-primary'
|
|
15
|
+
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9BcHBIZWFkZXIvQXBwSGVhZGVyRWxlbWVudHMvQXBwSGVhZGVyUmVzb3VyY2VzU2VjdGlvbi9pbmRleC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBMEJxQiIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMvQXBwSGVhZGVyL0FwcEhlYWRlckVsZW1lbnRzL0FwcEhlYWRlclJlc291cmNlc1NlY3Rpb24vaW5kZXgudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQW5jaG9yLCBDb2x1bW4sIEZsZXhCb3gsIExheW91dEdyaWQsIFRleHQgfSBmcm9tICdAY29kZWNhZGVteS9nYW11dCc7XG5pbXBvcnQgeyBCYWNrZ3JvdW5kLCBjc3MgfSBmcm9tICdAY29kZWNhZGVteS9nYW11d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bm9uZScgOiAxO1xuXG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgPFN0eWxlZENvbHVtbiBzaXplPXsxMn0ga2V5PXt0aXRsZX0gYXM9XCJsaVwiPlxuICAgICAgICAgICAgPExheW91dEdyaWQ+XG4gICAgICAgICAgICAgIDxDb2x1bW4gc2l6ZT17eyB4czogMTIsIG1kOiAzIH19PlxuICAgICAgICAgICAgICAgIDxCYWNrZ3JvdW5kXG4gICAgICAgICAgICAgICAgICB7Li4uc3R5bGVzfVxuICAgICAgICAgICAgICAgICAgcHg9e3sgXzogMTYsIHhzOiAzMiB9fVxuICAgICAgICAgICAgICAgICAgcHk9e3sgXzogMTYsIHNtOiAyNCB9fVxuICAgICAgICAgICAgICAgICAgYm9yZGVyQm90dG9tPXtib3JkZXJCb3R0b219XG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgPERlc2NyaXB0aW9uU2VjdGlvbiB0aXRsZT17dGl0bGV9IHN1YnRpdGxlPXtkZXNjcmlwdGlvbn0gLz5cbiAgICAgICAgICAgICAgICAgIHtsaW5rcyAmJiAoXG4gICAgICAgICAgICAgICAgICAgIDxGbGV4Qm94IGZsZXhEaXJlY3Rpb249XCJjb2x1bW5cIiBhbGlnbkl0ZW1zPVwiZmxleC1zdGFydFwiPlxuICAgICAgICAgICAgICAgICAgICAgIHtsaW5rcy5tYXAoKGxpbmssIGxpbmtJbmRleCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPEFuY2hvclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhcmlhbnQ9XCJzdGFuZGFyZFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9udFNpemU9ezE0fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnRXZWlnaHQ9ezcwMH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0QWxpZ249e3sgXzogJ2NlbnRlcicsIG1kOiAnbGVmdCcgfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBocmVmPXtsaW5rLmhyZWZ9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS1mb2N1c2FibGVyZXNvdXJjZT1cInRydWVcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s9eyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50OiBSZWFjdC5Nb3VzZUV2ZW50PEhUTUxBbmNob3JFbGVtZW50PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgPT4gb25DbGljayhldmVudCwgbGluayl9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFiSW5kZXg9e3RhYkluZGV4fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG10PXt7IF86IDE2LCBsZzogZGVzY3JpcHRpb24gPyAxNiA6IDI0IH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0PXtsaW5rLm5ld1RhYiA/ICdfYmxhbmsnIDogJ19zZWxmJ31cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk9e2xpbmsuaWR9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmPXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlY3Rpb25JbmRleCA9PT0gMCAmJiBsaW5rSW5kZXggPT09IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBmaXJzdEVsZW1SZWZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB1bmRlZmluZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bGluay50ZXh0fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGFyaWEtaGlkZGVuPiZuYnNwO+KGkjwvc3Bhbj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPC9BbmNob3I+XG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgIH0pfVxuICAgICAgICAgICAgICAgICAgICA8L0ZsZXhCb3g+XG4gICAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICAgIDwvQmFja2dyb3VuZD5cbiAgICAgICAgICAgICAgPC9Db2x1bW4+XG4gICAgICAgICAgICAgIDxDb2x1bW4gc2l6ZT17eyB4czogMTIsIG1kOiA4IH19PlxuICAgICAgICAgICAgICAgIDxMYXlvdXRHcmlkXG4gICAgICAgICAgICAgICAgICBhcz1cInVsXCJcbiAgICAgICAgICAgICAgICAgIHB0PXszMn1cbiAgICAgICAgICAgICAgICAgIHBiPXsyNH1cbiAgICAgICAgICAgICAgICAgIHBsPXt7IF86IDE2LCBzbTogNjQsIG1kOiA0OCB9fVxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgIHtkYXRhLm1hcCgoaXRlbSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCB7IGlkLCBocmVmLCB0ZXh0LCBiYWRnZSwgbmV3VGFiIH0gPSBpdGVtO1xuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgPENvbHVtbiBhcz1cImxpXCIga2V5PXtpZH0gc2l6ZT17eyBfOiAxMiwgbGc6IDQgfX0+XG4gICAgICAgICAgICAgICAgICAgICAgICA8QW5jaG9yXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEtZm9jdXNhYmxlcmVzb3VyY2U9XCJ0cnVlXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyaWFudD1cImludGVyZmFjZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGhyZWY9e2hyZWZ9XG4gICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s9eyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudDogUmVhY3QuTW91c2VFdmVudDxIVE1MQW5jaG9yRWxlbWVudD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgKSA9PiBvbkNsaWNrKGV2ZW50LCBpdGVtKX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgdGFiSW5kZXg9e3RhYkluZGV4fVxuICAgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXQ9e25ld1RhYiA/ICdfYmxhbmsnIDogJ19zZWxmJ31cbiAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgeydkZXNjcmlwdGlvbicgaW4gaXRlbSA/IChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPEZsZXhCb3ggd2hpdGVTcGFjZT1cIm5vd3JhcFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8VGV4dFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnRTaXplPXsxNn1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb250V2VpZ2h0PVwiYm9sZFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXM9XCJoM1wiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGI9ezR9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7dGV4dH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9UZXh0PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7YmFkZ2V9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L0ZsZXhCb3g+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8VGV4dCBmb250U2l6ZT17MTR9IHBiPXsyNH0gcHI9ezQwfT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge2l0ZW0uZGVzY3JpcHRpb259XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L1RleHQ+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC8+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICkgOiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPFRleHQgZm9udFNpemU9ezE2fSBwYj17OH0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7dGV4dH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L1RleHQ+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICl9XG4gICAgICAgICAgICAgICAgICAgICAgICA8L0FuY2hvcj5cbiAgICAgICAgICAgICAgICAgICAgICA8L0NvbHVtbj5cbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgIH0pfVxuICAgICAgICAgICAgICAgIDwvTGF5b3V0R3JpZD5cbiAgICAgICAgICAgICAgPC9Db2x1bW4+XG4gICAgICAgICAgICA8L0xheW91dEdyaWQ+XG4gICAgICAgICAgPC9TdHlsZWRDb2x1bW4+XG4gICAgICAgICk7XG4gICAgICB9KX1cbiAgICA8L0xheW91dEdyaWRBbnRpQWxpYXNlZD5cbiAgKTtcbn0pO1xuIl19 */");
|
|
16
|
+
export const AppHeaderResourcesSection = /*#__PURE__*/React.forwardRef(({
|
|
17
|
+
resources,
|
|
18
|
+
action,
|
|
19
|
+
isOpen,
|
|
20
|
+
keyDownEvents,
|
|
21
|
+
handleClose
|
|
22
|
+
}, ref) => {
|
|
23
|
+
const tabIndex = isOpen === false ? -1 : 0;
|
|
24
|
+
const styles = useMegaMenuHeaderResponsiveStyles();
|
|
25
|
+
const {
|
|
26
|
+
setFirstItemRef
|
|
27
|
+
} = useAppHeaderDropdownContext();
|
|
28
|
+
const firstElemRef = useRef(null);
|
|
29
|
+
const onClick = (event, linkItem) => {
|
|
30
|
+
handleClose?.();
|
|
31
|
+
return action(event, linkItem);
|
|
32
|
+
};
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (setFirstItemRef && firstElemRef.current) {
|
|
35
|
+
setFirstItemRef(firstElemRef.current);
|
|
36
|
+
}
|
|
37
|
+
}, [setFirstItemRef, firstElemRef]);
|
|
38
|
+
const DescriptionSection = ({
|
|
39
|
+
title,
|
|
40
|
+
subtitle
|
|
41
|
+
}) => /*#__PURE__*/_jsxs(DescriptionSectionContainer, {
|
|
42
|
+
"data-focusableresource": "true",
|
|
43
|
+
tabIndex: -1,
|
|
44
|
+
flexDirection: "column",
|
|
45
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
46
|
+
as: "h2",
|
|
47
|
+
variant: "title-xs",
|
|
48
|
+
pr: {
|
|
49
|
+
_: 96,
|
|
50
|
+
md: 16
|
|
51
|
+
},
|
|
52
|
+
mr: {
|
|
53
|
+
_: 96,
|
|
54
|
+
md: 0
|
|
55
|
+
},
|
|
56
|
+
children: title
|
|
57
|
+
}), subtitle && /*#__PURE__*/_jsx(Text, {
|
|
58
|
+
fontSize: 14,
|
|
59
|
+
my: 8,
|
|
60
|
+
children: subtitle
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
63
|
+
return /*#__PURE__*/_jsx(LayoutGridAntiAliased, {
|
|
64
|
+
onKeyDown: keyDownEvents,
|
|
65
|
+
ref: ref,
|
|
66
|
+
as: "ul",
|
|
67
|
+
p: 0,
|
|
68
|
+
children: resources.map((section, sectionIndex) => {
|
|
69
|
+
const {
|
|
70
|
+
title,
|
|
71
|
+
description,
|
|
72
|
+
links,
|
|
73
|
+
data
|
|
74
|
+
} = section;
|
|
75
|
+
const borderBottom = sectionIndex === resources.length - 1 ? 'none' : 1;
|
|
76
|
+
return /*#__PURE__*/_jsx(StyledColumn, {
|
|
77
|
+
size: 12,
|
|
78
|
+
as: "li",
|
|
79
|
+
children: /*#__PURE__*/_jsxs(LayoutGrid, {
|
|
80
|
+
children: [/*#__PURE__*/_jsx(Column, {
|
|
81
|
+
size: {
|
|
82
|
+
xs: 12,
|
|
83
|
+
md: 3
|
|
84
|
+
},
|
|
85
|
+
children: /*#__PURE__*/_jsxs(Background, {
|
|
86
|
+
...styles,
|
|
87
|
+
px: {
|
|
88
|
+
_: 16,
|
|
89
|
+
xs: 32
|
|
90
|
+
},
|
|
91
|
+
py: {
|
|
92
|
+
_: 16,
|
|
93
|
+
sm: 24
|
|
94
|
+
},
|
|
95
|
+
borderBottom: borderBottom,
|
|
96
|
+
children: [/*#__PURE__*/_jsx(DescriptionSection, {
|
|
97
|
+
title: title,
|
|
98
|
+
subtitle: description
|
|
99
|
+
}), links && /*#__PURE__*/_jsx(FlexBox, {
|
|
100
|
+
flexDirection: "column",
|
|
101
|
+
alignItems: "flex-start",
|
|
102
|
+
children: links.map((link, linkIndex) => {
|
|
103
|
+
return /*#__PURE__*/_jsxs(Anchor, {
|
|
104
|
+
variant: "standard",
|
|
105
|
+
fontSize: 14,
|
|
106
|
+
fontWeight: 700,
|
|
107
|
+
textAlign: {
|
|
108
|
+
_: 'center',
|
|
109
|
+
md: 'left'
|
|
110
|
+
},
|
|
111
|
+
href: link.href,
|
|
112
|
+
"data-focusableresource": "true",
|
|
113
|
+
onClick: event => onClick(event, link),
|
|
114
|
+
tabIndex: tabIndex,
|
|
115
|
+
mt: {
|
|
116
|
+
_: 16,
|
|
117
|
+
lg: description ? 16 : 24
|
|
118
|
+
},
|
|
119
|
+
target: link.newTab ? '_blank' : '_self',
|
|
120
|
+
ref: sectionIndex === 0 && linkIndex === 0 ? firstElemRef : undefined,
|
|
121
|
+
children: [link.text, /*#__PURE__*/_jsx("span", {
|
|
122
|
+
"aria-hidden": true,
|
|
123
|
+
children: "\xA0\u2192"
|
|
124
|
+
})]
|
|
125
|
+
}, link.id);
|
|
126
|
+
})
|
|
127
|
+
})]
|
|
128
|
+
})
|
|
129
|
+
}), /*#__PURE__*/_jsx(Column, {
|
|
130
|
+
size: {
|
|
131
|
+
xs: 12,
|
|
132
|
+
md: 8
|
|
133
|
+
},
|
|
134
|
+
children: /*#__PURE__*/_jsx(LayoutGrid, {
|
|
135
|
+
as: "ul",
|
|
136
|
+
pt: 32,
|
|
137
|
+
pb: 24,
|
|
138
|
+
pl: {
|
|
139
|
+
_: 16,
|
|
140
|
+
sm: 64,
|
|
141
|
+
md: 48
|
|
142
|
+
},
|
|
143
|
+
children: data.map(item => {
|
|
144
|
+
const {
|
|
145
|
+
id,
|
|
146
|
+
href,
|
|
147
|
+
text,
|
|
148
|
+
badge,
|
|
149
|
+
newTab
|
|
150
|
+
} = item;
|
|
151
|
+
return /*#__PURE__*/_jsx(Column, {
|
|
152
|
+
as: "li",
|
|
153
|
+
size: {
|
|
154
|
+
_: 12,
|
|
155
|
+
lg: 4
|
|
156
|
+
},
|
|
157
|
+
children: /*#__PURE__*/_jsx(Anchor, {
|
|
158
|
+
"data-focusableresource": "true",
|
|
159
|
+
variant: "interface",
|
|
160
|
+
href: href,
|
|
161
|
+
onClick: event => onClick(event, item),
|
|
162
|
+
tabIndex: tabIndex,
|
|
163
|
+
target: newTab ? '_blank' : '_self',
|
|
164
|
+
children: 'description' in item ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
165
|
+
children: [/*#__PURE__*/_jsxs(FlexBox, {
|
|
166
|
+
whiteSpace: "nowrap",
|
|
167
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
168
|
+
fontSize: 16,
|
|
169
|
+
fontWeight: "bold",
|
|
170
|
+
as: "h3",
|
|
171
|
+
pb: 4,
|
|
172
|
+
children: text
|
|
173
|
+
}), badge]
|
|
174
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
175
|
+
fontSize: 14,
|
|
176
|
+
pb: 24,
|
|
177
|
+
pr: 40,
|
|
178
|
+
children: item.description
|
|
179
|
+
})]
|
|
180
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
181
|
+
fontSize: 16,
|
|
182
|
+
pb: 8,
|
|
183
|
+
children: text
|
|
184
|
+
})
|
|
185
|
+
})
|
|
186
|
+
}, id);
|
|
187
|
+
})
|
|
188
|
+
})
|
|
189
|
+
})]
|
|
190
|
+
})
|
|
191
|
+
}, title);
|
|
192
|
+
})
|
|
193
|
+
});
|
|
194
|
+
});
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { AppHeaderLinkItem, AppHeaderResourcesDataItem } from '../../AppHeader/shared';
|
|
2
2
|
export declare const careerPaths: AppHeaderLinkItem[];
|
|
3
|
+
export declare const liveLearningHubItems: AppHeaderResourcesDataItem;
|
|
3
4
|
export declare const liveLearningNavPanelItems: (isCoachingEnabled?: boolean) => AppHeaderResourcesDataItem;
|
|
5
|
+
export declare const topLanguages: AppHeaderLinkItem[];
|
|
6
|
+
export declare const getTopSubjects: () => AppHeaderLinkItem[];
|