@codecademy/brand 1.46.0 → 1.47.0-alpha.7fd7014dbf.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 (327) hide show
  1. package/package.json +1 -1
  2. package/dist/AbbreviatedCommunityEventCard/index.js +0 -98
  3. package/dist/AppBar/AppBarSection.js +0 -41
  4. package/dist/AppBar/index.js +0 -20
  5. package/dist/AppBarDeprecated/AppBarSectionDeprecated.js +0 -25
  6. package/dist/AppBarDeprecated/index.js +0 -26
  7. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/index.js +0 -98
  8. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/elements.js +0 -63
  9. package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/index.js +0 -440
  10. package/dist/AppHeader/AppHeaderElements/AppHeaderDropdown/index.js +0 -157
  11. package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/AppHeaderDropdownLink.js +0 -25
  12. package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/AppHeaderMenuItem.js +0 -26
  13. package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/types.js +0 -1
  14. package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/index.js +0 -2
  15. package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownProvider/index.js +0 -26
  16. package/dist/AppHeader/AppHeaderElements/AppHeaderLink/index.js +0 -70
  17. package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.js +0 -53
  18. package/dist/AppHeader/AppHeaderElements/AppHeaderListItem/index.js +0 -32
  19. package/dist/AppHeader/AppHeaderElements/AppHeaderLogo/index.js +0 -57
  20. package/dist/AppHeader/AppHeaderElements/AppHeaderMenuProvider/index.js +0 -88
  21. package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/AppHeaderDropdownNavButton.js +0 -50
  22. package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/AppHeaderMenuNavButton.js +0 -38
  23. package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/index.js +0 -36
  24. package/dist/AppHeader/AppHeaderElements/AppHeaderProvider/index.js +0 -19
  25. package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesDropdown/index.js +0 -113
  26. package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesSection/index.js +0 -194
  27. package/dist/AppHeader/Search/DefaultResults.js +0 -112
  28. package/dist/AppHeader/Search/QuizAndHelpCenterLinks.js +0 -80
  29. package/dist/AppHeader/Search/SearchButton.js +0 -58
  30. package/dist/AppHeader/Search/SearchPane.js +0 -518
  31. package/dist/AppHeader/Search/SearchWorker/PromiseLookup.js +0 -35
  32. package/dist/AppHeader/Search/SearchWorker/index.js +0 -24
  33. package/dist/AppHeader/Search/SearchWorker/src.js +0 -307
  34. package/dist/AppHeader/Search/SearchWorker/types.js +0 -5
  35. package/dist/AppHeader/Search/SearchWorker/worker.js +0 -31
  36. package/dist/AppHeader/Search/consts.js +0 -40
  37. package/dist/AppHeader/Search/hooks/useUrlChangeDetection.js +0 -14
  38. package/dist/AppHeader/Search/safelyRedirect.js +0 -49
  39. package/dist/AppHeader/Search/types.js +0 -1
  40. package/dist/AppHeader/Search/useHeaderSearch.js +0 -39
  41. package/dist/AppHeader/index.js +0 -77
  42. package/dist/AppHeader/shared/elements.js +0 -151
  43. package/dist/AppHeader/shared/index.js +0 -4
  44. package/dist/AppHeader/shared/keyboardNav.js +0 -67
  45. package/dist/AppHeader/shared/mockAppHeaderItems.js +0 -10
  46. package/dist/AppHeader/shared/testTypes.js +0 -0
  47. package/dist/AppHeader/shared/types.js +0 -1
  48. package/dist/AppHeader/shared/utils.js +0 -103
  49. package/dist/AppHeader/utils/types.js +0 -1
  50. package/dist/AppHeaderMobile/AppHeaderMainMenuMobile/MobileSearchBar.js +0 -77
  51. package/dist/AppHeaderMobile/AppHeaderMainMenuMobile/index.js +0 -111
  52. package/dist/AppHeaderMobile/AppHeaderSubMenuMobile/elements.js +0 -30
  53. package/dist/AppHeaderMobile/AppHeaderSubMenuMobile/index.js +0 -104
  54. package/dist/AppHeaderMobile/AppHeaderSubMenuTarget/index.js +0 -60
  55. package/dist/AppHeaderMobile/index.js +0 -226
  56. package/dist/Avatar/Avatar.stories.js +0 -15
  57. package/dist/Avatar/index.js +0 -45
  58. package/dist/AvatarChooser/index.js +0 -105
  59. package/dist/BackToTopAnchor/index.js +0 -38
  60. package/dist/Banner/CountdownTimer.js +0 -110
  61. package/dist/Banner/EnhancedBanner.js +0 -178
  62. package/dist/Banner/index.js +0 -123
  63. package/dist/BetaSticker/index.js +0 -57
  64. package/dist/CareerPathCard/index.js +0 -41
  65. package/dist/Carousel/elements.js +0 -14
  66. package/dist/Carousel/index.js +0 -242
  67. package/dist/CertificationPathCard/index.js +0 -42
  68. package/dist/CommunityEventCard/EventTypeIcon.js +0 -59
  69. package/dist/CommunityEventCard/index.js +0 -305
  70. package/dist/CommunityEventToast/index.js +0 -32
  71. package/dist/ContentGroupBaseCard/helpers.js +0 -12
  72. package/dist/ContentGroupBaseCard/index.js +0 -178
  73. package/dist/ContentGroupBaseCard/shared.js +0 -76
  74. package/dist/ContentGroupBaseCard/types.js +0 -12
  75. package/dist/CourseCard/index.js +0 -47
  76. package/dist/CurriculumCard/BottomTag/index.js +0 -26
  77. package/dist/CurriculumCard/Difficulty/helpers.js +0 -13
  78. package/dist/CurriculumCard/Difficulty/index.js +0 -47
  79. package/dist/CurriculumCard/Difficulty/types.js +0 -20
  80. package/dist/CurriculumCard/Footer/index.js +0 -54
  81. package/dist/CurriculumCard/Image/index.js +0 -56
  82. package/dist/CurriculumCard/Subtitle/helpers.js +0 -8
  83. package/dist/CurriculumCard/Subtitle/index.js +0 -34
  84. package/dist/CurriculumCard/index.js +0 -129
  85. package/dist/DropdownButton/DropdownList.js +0 -73
  86. package/dist/DropdownButton/index.js +0 -169
  87. package/dist/DropdownButton/useDynamicPopoverPosition.js +0 -55
  88. package/dist/DropdownButton/useDynamicPopoverPosition.test.js +0 -85
  89. package/dist/EditorialImage/index.js +0 -22
  90. package/dist/EmptySection/index.js +0 -183
  91. package/dist/ErrorContents/index.js +0 -48
  92. package/dist/FeatureList/index.js +0 -41
  93. package/dist/GlobalFooter/FooterHeading.js +0 -30
  94. package/dist/GlobalFooter/FooterLegal/LegalLinks.js +0 -43
  95. package/dist/GlobalFooter/FooterLegal/MadeIn.js +0 -64
  96. package/dist/GlobalFooter/FooterLegal/index.js +0 -22
  97. package/dist/GlobalFooter/FooterLinks.js +0 -53
  98. package/dist/GlobalFooter/FooterNavLinks/CatalogLinks.js +0 -298
  99. package/dist/GlobalFooter/FooterNavLinks/CompanyLinks.js +0 -299
  100. package/dist/GlobalFooter/FooterNavLinks/ReferralRock/ReferAFriendLinkWithModal.js +0 -268
  101. package/dist/GlobalFooter/FooterNavLinks/ReferralRock/ReferralFields.js +0 -29
  102. package/dist/GlobalFooter/FooterNavLinks/ReferralRock/ReferralForm.js +0 -74
  103. package/dist/GlobalFooter/FooterNavLinks/ReferralRock/ReferralLinkSocialMediaSharing.js +0 -86
  104. package/dist/GlobalFooter/FooterNavLinks/ReferralRock/types.js +0 -1
  105. package/dist/GlobalFooter/FooterNavLinks/SocialMediaLinks.js +0 -50
  106. package/dist/GlobalFooter/FooterNavLinks/index.js +0 -45
  107. package/dist/GlobalFooter/FooterSubHeading.js +0 -22
  108. package/dist/GlobalFooter/index.js +0 -39
  109. package/dist/GlobalFooter/types.js +0 -1
  110. package/dist/GlobalHeader/GlobalHeaderItems.js +0 -405
  111. package/dist/GlobalHeader/GlobalHeaderVariants.js +0 -211
  112. package/dist/GlobalHeader/index.js +0 -106
  113. package/dist/GlobalHeader/types.js +0 -1
  114. package/dist/GlobalHeader/urlHelpers.js +0 -21
  115. package/dist/GlobalPage/index.js +0 -53
  116. package/dist/Grid/GridCollapse.js +0 -199
  117. package/dist/Grid/GridCollapse.test.js +0 -96
  118. package/dist/Grid/Subgrid.js +0 -37
  119. package/dist/Grid/getCSSFromColumnCount.js +0 -7
  120. package/dist/Grid/index.js +0 -3
  121. package/dist/HeaderHeightArea/index.js +0 -40
  122. package/dist/HeaderHeightArea/useIsInHeaderRegion.js +0 -15
  123. package/dist/HorizontalScrollMenu/index.js +0 -75
  124. package/dist/HubCard/index.js +0 -38
  125. package/dist/InfoCard/index.js +0 -157
  126. package/dist/Konamimojisplosion/Konamimojisplosion.js +0 -7
  127. package/dist/Konamimojisplosion/index.js +0 -2
  128. package/dist/Konamimojisplosion/useKonamimojisplosion.js +0 -34
  129. package/dist/LandingPage/CTA.js +0 -11
  130. package/dist/LandingPage/Description.js +0 -14
  131. package/dist/LandingPage/Feature.js +0 -96
  132. package/dist/LandingPage/PageFAQs.js +0 -42
  133. package/dist/LandingPage/PageFeatures.js +0 -112
  134. package/dist/LandingPage/PageFeaturesEnhanced.js +0 -159
  135. package/dist/LandingPage/PageFeaturesWithReferences.js +0 -136
  136. package/dist/LandingPage/PageHero.js +0 -22
  137. package/dist/LandingPage/PagePrefooter.js +0 -74
  138. package/dist/LandingPage/PageSingleFeature.js +0 -128
  139. package/dist/LandingPage/PageTestimonials.js +0 -113
  140. package/dist/LandingPage/PageVideoGallery.js +0 -49
  141. package/dist/LandingPage/Title.js +0 -28
  142. package/dist/LandingPage/TitleWithEyebrow.js +0 -40
  143. package/dist/LandingPage/index.js +0 -14
  144. package/dist/LandingPage/types.js +0 -1
  145. package/dist/LayoutMenu/AccordionMenu.js +0 -68
  146. package/dist/LayoutMenu/LayoutMenu.js +0 -96
  147. package/dist/LayoutMenu/LayoutMenuSection.js +0 -34
  148. package/dist/LayoutMenu/SectionItemLink.js +0 -16
  149. package/dist/LayoutMenu/SelectedSectionItem.js +0 -17
  150. package/dist/LayoutMenu/index.js +0 -3
  151. package/dist/LayoutMenuVariant/AccordionMenu.js +0 -85
  152. package/dist/LayoutMenuVariant/LayoutMenu.js +0 -92
  153. package/dist/LayoutMenuVariant/LayoutMenuSection.js +0 -42
  154. package/dist/LayoutMenuVariant/SectionItemLink.js +0 -17
  155. package/dist/LayoutMenuVariant/index.js +0 -2
  156. package/dist/LearningOutcomeBadges/LearningOutcomeLevelBadge.js +0 -57
  157. package/dist/LearningOutcomeBadges/LearningOutcomeLowAssessmentBadge.js +0 -35
  158. package/dist/LearningOutcomeBadges/index.js +0 -2
  159. package/dist/LearningOutcomeCard/index.js +0 -178
  160. package/dist/LearningOutcomePopover/index.js +0 -125
  161. package/dist/LearningOutcomeTile/Tile.js +0 -79
  162. package/dist/LearningOutcomeTile/index.js +0 -116
  163. package/dist/LearningOutcomeTile/types.js +0 -11
  164. package/dist/ListSection/index.js +0 -64
  165. package/dist/Loading/index.js +0 -82
  166. package/dist/LoadingCurriculumCard/index.js +0 -82
  167. package/dist/Logo/CodecademyLogo.js +0 -19
  168. package/dist/Logo/CodecademyPremiumLogo.js +0 -35
  169. package/dist/Logo/CodecademyProAltLogo.js +0 -19
  170. package/dist/Logo/CodecademyProLockupLogo.js +0 -13
  171. package/dist/Logo/CodecademyProLogo.js +0 -21
  172. package/dist/Logo/CodecademyProMonoLogo.js +0 -22
  173. package/dist/Logo/CodecademyProgramLogo.js +0 -14
  174. package/dist/Logo/CodecademyTeamsLogo.js +0 -41
  175. package/dist/Logo/index.js +0 -30
  176. package/dist/LogoFromSkillsoft/index.js +0 -55
  177. package/dist/LogoLXStudio/index.js +0 -47
  178. package/dist/LogoProCutout/index.js +0 -31
  179. package/dist/LogoProCutoutTransparent/index.js +0 -31
  180. package/dist/MarketingToaster/index.js +0 -67
  181. package/dist/NotFoundContent/index.js +0 -55
  182. package/dist/NotificationList/EmptyNotification/emptyNotificationContents.js +0 -23
  183. package/dist/NotificationList/EmptyNotification/index.js +0 -38
  184. package/dist/NotificationList/NotificationItem.js +0 -151
  185. package/dist/NotificationList/index.js +0 -46
  186. package/dist/NotificationList/typings.js +0 -1
  187. package/dist/Notifications/NotificationBell.js +0 -72
  188. package/dist/Notifications/NotificationsContents.js +0 -85
  189. package/dist/Notifications/NotificationsDropdown.js +0 -25
  190. package/dist/Notifications/__fixtures__/NotificationTestComponent.js +0 -12
  191. package/dist/Notifications/__fixtures__/stubs.js +0 -8
  192. package/dist/Notifications/constants.js +0 -4
  193. package/dist/Notifications/elements.js +0 -21
  194. package/dist/Notifications/types.js +0 -1
  195. package/dist/Notifications/useHeaderNotifications.js +0 -37
  196. package/dist/Notifications/useNotificationButtons.js +0 -56
  197. package/dist/PageAlerts/PageAlerts.js +0 -75
  198. package/dist/PageAlerts/PageAlertsProvider.js +0 -34
  199. package/dist/PageAlerts/index.js +0 -3
  200. package/dist/PageAlerts/types.js +0 -1
  201. package/dist/PageLayoutWithSidebarMenu/PageLayoutWithSidebarMenu.js +0 -53
  202. package/dist/PageLayoutWithSidebarMenu/index.js +0 -1
  203. package/dist/PageSection/index.js +0 -67
  204. package/dist/PastDue/PastDueModalContents/index.js +0 -30
  205. package/dist/PastDue/index.js +0 -2
  206. package/dist/PastDue/pastDueMessages.js +0 -48
  207. package/dist/PausableImage/BaseImage/index.js +0 -54
  208. package/dist/PausableImage/index.js +0 -37
  209. package/dist/PlanCard/PlanCardBanner.js +0 -28
  210. package/dist/PlanCard/PlanFeature.js +0 -83
  211. package/dist/PlanCard/PopularBadge.js +0 -13
  212. package/dist/PlanCard/PricingAmount.js +0 -117
  213. package/dist/PlanCard/RecommendedBadge.js +0 -24
  214. package/dist/PlanCard/consts.js +0 -135
  215. package/dist/PlanCard/index.js +0 -370
  216. package/dist/PlanCard/types.js +0 -62
  217. package/dist/PlanCardTeams/consts.js +0 -8
  218. package/dist/PlanCardTeams/index.js +0 -167
  219. package/dist/PricingSection/PlanFeature.js +0 -88
  220. package/dist/PricingSection/PricingCard/PricingAmount.js +0 -84
  221. package/dist/PricingSection/PricingCard/RecommendedBadge.js +0 -24
  222. package/dist/PricingSection/PricingCard/consts.js +0 -85
  223. package/dist/PricingSection/PricingCard/index.js +0 -241
  224. package/dist/PricingSection/ProductCTA.js +0 -44
  225. package/dist/PricingSection/Products.js +0 -74
  226. package/dist/PricingSection/config.js +0 -36
  227. package/dist/PricingSection/index.js +0 -58
  228. package/dist/PricingSection/types.js +0 -8
  229. package/dist/ProLabel/index.js +0 -59
  230. package/dist/ProLogo/index.js +0 -27
  231. package/dist/ProLogoAlt/index.js +0 -26
  232. package/dist/ProductFeatureShowcase/index.js +0 -120
  233. package/dist/QuizScore/index.js +0 -84
  234. package/dist/RatingsBar/index.js +0 -32
  235. package/dist/ResourceCard/index.js +0 -59
  236. package/dist/ScoreSummary/SubScores.js +0 -165
  237. package/dist/ScoreSummary/helpers.js +0 -20
  238. package/dist/ScoreSummary/index.js +0 -108
  239. package/dist/ScoreSummary/types.js +0 -1
  240. package/dist/SkillPathCard/index.js +0 -38
  241. package/dist/SocialMediaSharing/SocialShareIconLink.js +0 -49
  242. package/dist/SocialMediaSharing/index.js +0 -116
  243. package/dist/SocialMediaSharingDropdown/index.js +0 -111
  244. package/dist/Testimonial/index.js +0 -163
  245. package/dist/index.js +0 -86
  246. package/dist/lib/breakpointHooks/index.js +0 -60
  247. package/dist/lib/catalogList/index.js +0 -173
  248. package/dist/lib/resourcesList/index.js +0 -232
  249. package/dist/remoteAssets/components.js +0 -1
  250. package/dist/stories/Atoms/Avatar.stories.js +0 -16
  251. package/dist/stories/Atoms/BetaSticker.stories.js +0 -22
  252. package/dist/stories/Atoms/Logos/Logo.stories.js +0 -78
  253. package/dist/stories/Atoms/Logos/LogoFromSkillsoft.stories.js +0 -15
  254. package/dist/stories/Atoms/Logos/LogoLXStudio.stories.js +0 -11
  255. package/dist/stories/Atoms/Logos/ProLabel.stories.js +0 -16
  256. package/dist/stories/Atoms/Logos/ProLogoAlt.stories.js +0 -24
  257. package/dist/stories/Atoms/RatingsBar.stories.js +0 -16
  258. package/dist/stories/Atoms/Subgrid.stories.js +0 -87
  259. package/dist/stories/Molecules/AppBar.stories.js +0 -32
  260. package/dist/stories/Molecules/AppHeader/AppHeader.stories.js +0 -84
  261. package/dist/stories/Molecules/AppHeader/AppHeaderDropdown.stories.js +0 -67
  262. package/dist/stories/Molecules/AppHeader/AppHeaderLink.stories.js +0 -52
  263. package/dist/stories/Molecules/AppHeader/AppHeaderLogo.stories.js +0 -44
  264. package/dist/stories/Molecules/AppHeader/AppHeaderMainMenuMobile.stories.js +0 -34
  265. package/dist/stories/Molecules/AppHeader/AppHeaderMobile.stories.js +0 -40
  266. package/dist/stories/Molecules/AppHeader/AppHeaderSubMenuMobile.stories.js +0 -25
  267. package/dist/stories/Molecules/AppHeader/LXStudioHeader.stories.js +0 -176
  268. package/dist/stories/Molecules/AppHeader/LXStudioMobileHeader.stories.js +0 -84
  269. package/dist/stories/Molecules/AppHeader/MockAppHeaderElements.js +0 -90
  270. package/dist/stories/Molecules/AvatarChooser.stories.js +0 -22
  271. package/dist/stories/Molecules/BackToTopAnchor.stories.js +0 -51
  272. package/dist/stories/Molecules/Banner.stories.js +0 -115
  273. package/dist/stories/Molecules/Carousel.stories.js +0 -47
  274. package/dist/stories/Molecules/ContentGroupBaseCard.stories.js +0 -173
  275. package/dist/stories/Molecules/CurriculumCard.stories.js +0 -208
  276. package/dist/stories/Molecules/CurriculumCards/CareerPathCard.stories.js +0 -92
  277. package/dist/stories/Molecules/CurriculumCards/CertificationPathCard.stories.js +0 -65
  278. package/dist/stories/Molecules/CurriculumCards/CourseCard.stories.js +0 -83
  279. package/dist/stories/Molecules/CurriculumCards/LoadingCurriculumCard.stories.js +0 -20
  280. package/dist/stories/Molecules/CurriculumCards/SkillPathCard.stories.js +0 -90
  281. package/dist/stories/Molecules/DropdownButton.stories.js +0 -207
  282. package/dist/stories/Molecules/EditorialImage.stories.js +0 -17
  283. package/dist/stories/Molecules/EmptySection.stories.js +0 -168
  284. package/dist/stories/Molecules/EnhancedBanner.stories.js +0 -114
  285. package/dist/stories/Molecules/ErrorContents.stories.js +0 -19
  286. package/dist/stories/Molecules/GridCollapse.stories.js +0 -42
  287. package/dist/stories/Molecules/HorizontalScrollMenu.examples.js +0 -67
  288. package/dist/stories/Molecules/HorizontalScrollMenu.stories.js +0 -11
  289. package/dist/stories/Molecules/HubCard.stories.js +0 -28
  290. package/dist/stories/Molecules/InfoCard.stories.js +0 -30
  291. package/dist/stories/Molecules/LearningOutcomeCard.stories.js +0 -75
  292. package/dist/stories/Molecules/LearningOutcomeLevelBadge.stories.js +0 -20
  293. package/dist/stories/Molecules/LearningOutcomeLowAssessmentBadge.stories.js +0 -10
  294. package/dist/stories/Molecules/LearningOutcomePopover.stories.js +0 -39
  295. package/dist/stories/Molecules/LearningOutcomeTile.stories.js +0 -276
  296. package/dist/stories/Molecules/ListSection.stories.js +0 -97
  297. package/dist/stories/Molecules/Loading.stories.js +0 -10
  298. package/dist/stories/Molecules/NotificationList.stories.js +0 -100
  299. package/dist/stories/Molecules/PageSection.stories.js +0 -67
  300. package/dist/stories/Molecules/PastDueModalContents.stories.js +0 -62
  301. package/dist/stories/Molecules/PausableImage.stories.js +0 -16
  302. package/dist/stories/Molecules/ResourceCard.stories.js +0 -18
  303. package/dist/stories/Molecules/SocialMediaSharing.stories.js +0 -20
  304. package/dist/stories/Molecules/SocialMediaSharingDropdown.stories.js +0 -20
  305. package/dist/stories/Molecules/Testimonial.stories.js +0 -63
  306. package/dist/stories/Organisms/GlobalFooter.stories.js +0 -29
  307. package/dist/stories/Organisms/GlobalHeader/About.stories.js +0 -136
  308. package/dist/stories/Organisms/GlobalHeader/Anon.stories.js +0 -73
  309. package/dist/stories/Organisms/GlobalHeader/Bootcamp.stories.js +0 -32
  310. package/dist/stories/Organisms/GlobalHeader/Enterprise.stories.js +0 -108
  311. package/dist/stories/Organisms/GlobalHeader/Free.stories.js +0 -133
  312. package/dist/stories/Organisms/GlobalHeader/Pro.stories.js +0 -199
  313. package/dist/stories/Organisms/GlobalHeader/Simple.stories.js +0 -31
  314. package/dist/stories/Organisms/GlobalPage.stories.js +0 -142
  315. package/dist/stories/Organisms/LayoutMenu.stories.js +0 -242
  316. package/dist/stories/Organisms/LayoutMenuVariant.stories.js +0 -224
  317. package/dist/stories/Organisms/PageAlerts.example.js +0 -42
  318. package/dist/stories/Organisms/PageAlerts.stories.js +0 -15
  319. package/dist/stories/Organisms/PageFeatures.stories.js +0 -183
  320. package/dist/stories/Organisms/PageHero.stories.js +0 -145
  321. package/dist/stories/Organisms/PageLayoutWithSidebarMenu.stories.js +0 -34
  322. package/dist/stories/Organisms/PagePrefooter.stories.js +0 -62
  323. package/dist/stories/Organisms/PageSingleFeature.stories.js +0 -158
  324. package/dist/stories/Organisms/PageVideoGallery.stories.js +0 -70
  325. package/dist/stories/Organisms/PlanCard.stories.js +0 -98
  326. package/dist/stories/Organisms/PlanCardTeams.stories.js +0 -27
  327. package/dist/stories/Organisms/ScoreSummary.stories.js +0 -299
@@ -1,35 +0,0 @@
1
- class SplitPromise {
2
- constructor() {
3
- this.promise = new Promise(r => this.resolver = r);
4
- }
5
- }
6
- export class PromiseLookup {
7
- constructor(args) {
8
- this.args = args;
9
- }
10
- namespaces = new Map();
11
- getNamespace(namespace) {
12
- let ns = this.namespaces.get(namespace);
13
- if (!ns) {
14
- ns = new Map();
15
- this.namespaces.set(namespace, ns);
16
- }
17
- return ns;
18
- }
19
- getSplitPromise(namespace, key) {
20
- const ns = this.getNamespace(namespace);
21
- let splitPromise = ns.get(key);
22
- if (!splitPromise) {
23
- splitPromise = new SplitPromise();
24
- ns.set(key, splitPromise);
25
- this.args.onKeyInit(namespace, key);
26
- }
27
- return splitPromise;
28
- }
29
- get(namespace, key) {
30
- return this.getSplitPromise(namespace, key).promise;
31
- }
32
- resolve(namespace, key, value) {
33
- this.getSplitPromise(namespace, key).resolver(value);
34
- }
35
- }
@@ -1,24 +0,0 @@
1
- import { SearchAction } from './types';
2
- let workerPromise;
3
- const initErr = 'Search worker not initialized';
4
- export const searchWorker = {
5
- init() {
6
- if (!workerPromise) {
7
- workerPromise = (async () => {
8
- // lazy load worker
9
- const {
10
- createSearchWorker
11
- } = await import('./worker');
12
- return createSearchWorker();
13
- })();
14
- }
15
- },
16
- async autocomplete(query) {
17
- if (!workerPromise) throw new Error(initErr);
18
- return (await workerPromise)(SearchAction.Autocomplete, query);
19
- },
20
- async searchAsYouType(query) {
21
- if (!workerPromise) throw new Error(initErr);
22
- return (await workerPromise)(SearchAction.SearchAsYouType, query);
23
- }
24
- };
@@ -1,307 +0,0 @@
1
- /*
2
- * A web worker to handle search-as-you-type and autocomplete
3
- *
4
- * This worker implements an algorithm for text matching that tests
5
- * a query string against a set of titles, and gives a score to
6
- * each character in a given title.
7
- *
8
- * e.g. matching query "abcde" to title "ab cde"
9
- * "a" and "b" each get a score of 2, because each is part of the match "ab"
10
- * "c", "d", and "e" each get a score of 3, because each is part of the match "cde"
11
- *
12
- * For autocomplete, a large list of titles is preloaded, and this
13
- * scoring algorithm is used both to find the top 5 matches, and to
14
- * determine which characters should be highlighted.
15
- * (These titles have certain phrases like "Intro to" removed so that they
16
- * better resemble something that a user would type.)
17
- *
18
- * For search-as-you-type, we rely on typesense to find matches,
19
- * but we still use this algorithm for character highlighting.
20
- */
21
-
22
- function getPortalOrigin() {
23
- const {
24
- origin
25
- } = window.location;
26
- const envs = ['tengu', 'tayra', 'staging', 'www'];
27
-
28
- // for standard envs, use portal app in the same env
29
- if (envs.some(s => `https://${s}.codecademy.com` === origin)) return origin;
30
-
31
- // for local, use local portal-app, replace if origin port is monolith or le
32
- if (origin.includes('localhost')) return origin.replace(/:\d{4}/, ':3100');
33
-
34
- // otherwise (e.g. in monolith pr env) use staging portal-app
35
- return 'https://staging.codecademy.com';
36
- }
37
- export function serializeSearchWorkerSrc() {
38
- const BASE_URL = `${getPortalOrigin()}/api/portal/search`;
39
- const fnAsStr = worker.toString().trim();
40
-
41
- // in a prod build, webpack will handle removing comments
42
-
43
- return fnAsStr.slice(fnAsStr.indexOf('{') + 1, -1) // remove wrapping function, which may have been renamed by minification
44
- .replaceAll(' ', '') // remove indentation
45
- .replaceAll('{BASE_URL}', BASE_URL) // interpolate base url
46
- .replaceAll('{SEARCH}', window.location.search); // interpolate search query
47
- }
48
-
49
- /*
50
- * This function contains the code that is serialized to run in the worker. It
51
- * can't reference anything outside of itself (except types). Data is passed to
52
- * the worker via onmessage and passed back to the main thread via postMessage.
53
- */
54
- function worker() {
55
- const preloadTitlesPromise = (async () => {
56
- const f = await fetch('{BASE_URL}/autocomplete-preload{SEARCH}');
57
- const rawTitles = await f.json();
58
- return rawTitles.map(preparseTitle);
59
- })();
60
- function preparseTitle({
61
- value,
62
- popularity
63
- }) {
64
- const lower = value.toLowerCase();
65
- const words = getWordSet(lower);
66
- return {
67
- title: value,
68
- lower,
69
- words,
70
- popularity
71
- };
72
- }
73
- function preparseQuery(query) {
74
- const words = getWordSet(query);
75
- return {
76
- query,
77
- words
78
- };
79
- }
80
- const wordSplitters = /[ :-]/g;
81
- function getWordSet(str) {
82
- const words = str.split(wordSplitters).map(w => w.trim()).filter(Boolean);
83
- return new Set(words);
84
- }
85
- const handlers = {
86
- autocomplete: autocompleteHandler,
87
- 'search-as-you-type': searchAsYouTypeHandler
88
- };
89
- onmessage = ({
90
- data
91
- }) => {
92
- const {
93
- query,
94
- action
95
- } = data;
96
- const handler = handlers[action];
97
- if (handler) {
98
- handler(preparseQuery(query));
99
- }
100
- };
101
- function getScoredTitle(q, t) {
102
- const charScores = getCharScores(q, t);
103
- const score = getTotalScore(q, t, charScores);
104
- return {
105
- title: t.title,
106
- charScores,
107
- score
108
- };
109
- }
110
- const maxResults = 5;
111
- async function autocompleteHandler(q) {
112
- const titles = await preloadTitlesPromise;
113
- const scoredTitles = titles.map(t => getScoredTitle(q, t));
114
- const topAutocompleteTitles = scoredTitles.filter(x => x.score > 0).sort((a, b) => a.score > b.score ? -1 : 1).slice(0, maxResults).map(t => ({
115
- title: t.title,
116
- segments: getHighlightSegments(t.title, t.charScores)
117
- }));
118
- postMessage({
119
- query: q.query,
120
- result: topAutocompleteTitles,
121
- action: 'autocomplete'
122
- });
123
- }
124
- async function searchAsYouTypeHandler(q) {
125
- const f = await fetch('{BASE_URL}/search-as-you-type{SEARCH}', {
126
- body: JSON.stringify({
127
- query: q.query,
128
- max: maxResults
129
- }),
130
- method: 'POST'
131
- });
132
- const searchAsYouTypeResults = await f.json();
133
- for (const entry of searchAsYouTypeResults.top) {
134
- const t = preparseTitle({
135
- value: entry.title,
136
- popularity: 0
137
- });
138
- const charScores = getCharScores(q, t);
139
- entry.segments = getHighlightSegments(entry.title, charScores);
140
- entry.key = q.query + ':' + entry.title;
141
- }
142
- postMessage({
143
- query: q.query,
144
- result: searchAsYouTypeResults,
145
- action: 'search-as-you-type'
146
- });
147
- }
148
-
149
- /*
150
- * For the search "alge", .04 is just low enough so that "Linear algebra"
151
- * (which matches on 4 letters) comes in above "Data structures and algorithms"
152
- * (which only matches on 3 letters, but has a high popularity score).
153
- */
154
- const popularityStrength = 0.04;
155
-
156
- // Total used in sorting to find autocomplet top 5
157
- // Bonus scores are includes in certain cases
158
- function getTotalScore(q, t, charScores) {
159
- let fromChars = 0;
160
- for (const s of charScores) {
161
- fromChars += s;
162
- }
163
- const fromPopularity = (t.popularity || 0) * popularityStrength;
164
- let bonus = 0;
165
- // for each complete word present in both the title and query
166
- for (const qw of q.words) {
167
- if (t.words.has(qw)) {
168
- bonus += 100;
169
- }
170
- }
171
-
172
- // if the title starts with the query
173
- if (t.lower.startsWith(q.query)) {
174
- bonus += 200;
175
- } else if (t.lower.startsWith(q.query.slice(0, 3))) {
176
- // or at least the first 3 chars
177
- bonus += 100;
178
- }
179
-
180
- // if the title is an exact match with the query
181
- if (t.lower === q.query) {
182
- bonus += 100;
183
- }
184
-
185
- // if there are some matching chars and the title is within 3 chars length of the query
186
- if (fromChars > 1 && Math.abs(t.lower.length - q.query.length) <= 3) {
187
- bonus += 100;
188
- }
189
- return fromChars + (fromChars > 1 ? fromPopularity : 0) + bonus;
190
- }
191
-
192
- // returns { value: string, highlight: boolean }[]
193
- function getHighlightSegments(title, charScores) {
194
- let currentSegment = null;
195
- const segments = [];
196
- const shouldHighlight = i => charScores[i] > 0;
197
- const isDifferentFromPrev = i => shouldHighlight(i - 1) !== shouldHighlight(i);
198
- for (let i = 0; i < title.length; i++) {
199
- if (i === 0 || isDifferentFromPrev(i)) {
200
- // If this char should be highlighted, but the prev one should not
201
- // or vice versa, start a new segment.
202
- currentSegment = {
203
- value: '',
204
- highlight: shouldHighlight(i)
205
- };
206
- segments.push(currentSegment);
207
- }
208
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
209
- currentSegment.value += title[i];
210
- }
211
- return segments;
212
- }
213
-
214
- // Used by autocomplete, both for finding top 5, and for highlighting
215
- // Used by search-as-you-type, only for highlighting
216
- // Returns number[], where each number is the match score for a char in the title
217
- function getCharScores(q, t) {
218
- /*
219
- * Prefill the array for each char in the title.
220
- * For each char, we keep an array of the consecutive matches the char is a part of.
221
- */
222
- const cmcsForTitleChars = Array(t.lower.length).fill(0).map(() => []);
223
-
224
- /*
225
- * Overlay the query onto the title to see which chars match.
226
- * Shift to align at different positions.
227
- * e.g.
228
- * shift: 0
229
- * query: python3 learn
230
- * title: learn python 3
231
- * (no matches)
232
- *
233
- * shift: 6
234
- * query: python3 learn
235
- * title: learn python 3
236
- * (the word "python" matches)
237
- *
238
- * shift: 7
239
- * query: python3 learn
240
- * title: learn python 3
241
- * ("3" matches)
242
- *
243
- * shift: -8
244
- * query: python3 learn
245
- * title: learn python 3
246
- * ("learn" matches)
247
- */
248
- for (let shift = 1 - q.query.length; shift < t.lower.length; shift++) {
249
- // for each shift position
250
-
251
- let cmc = null;
252
- const startOverlap = Math.max(shift, 0);
253
- const endOverlap = Math.min(q.query.length + shift, t.lower.length);
254
-
255
- // i is the index of a char in the title
256
- for (let i = startOverlap; i < endOverlap; i++) {
257
- // for each char position in the potentially overlapping area
258
-
259
- // if char at this position matches (and isn't a space)
260
- if (q.query[i - shift] === t.lower[i] && t.lower[i] !== ' ') {
261
- if (!cmc) {
262
- // start a new cmc if needed
263
- cmc = {
264
- value: ''
265
- };
266
- }
267
-
268
- /*
269
- * Append this char to the current cmc.
270
- * We use an object with {value} so that we can modify by reference,
271
- * since we want to modify the cmc, not only for this char, but also
272
- * for any previous chars that this cmc was pushed to, since those
273
- * chars are part of this same consecutive match.
274
- */
275
- cmc.value += q.query[i - shift];
276
-
277
- // include this cmc for this char
278
- cmcsForTitleChars[i].push(cmc);
279
- } else if (cmc) {
280
- // set to null so that the next match starts a new cmc
281
- cmc = null;
282
- }
283
- }
284
- }
285
- const avgQueryWordLength = q.query.length / q.words.size;
286
-
287
- // If avgQueryWordLength is 1-3, we want to the min match to be about that same size.
288
- // If avgQueryWordLength is longer, we want min match to be longer...but not too long.
289
- // e.g. For avgQueryWordLength of 9, min should be 5
290
- // The misspelling "regresion" should still match "regression", but not "encryption",
291
- // "authentication" or other words ending in "ion"
292
- const minMatchLength = Math.ceil(avgQueryWordLength ** 0.65);
293
- const charScores = [];
294
- for (const cmcs of cmcsForTitleChars) {
295
- let score = 0;
296
- for (const cmc of cmcs) {
297
- // if the string of consecutive matching chars meets the minMatchLength
298
- // or if it's a standalone word in the query (e.g "C")
299
- if (cmc.value.length >= minMatchLength || q.words.has(cmc.value)) {
300
- score += cmc.value.length;
301
- }
302
- }
303
- charScores.push(score);
304
- }
305
- return charScores;
306
- }
307
- }
@@ -1,5 +0,0 @@
1
- export let SearchAction = /*#__PURE__*/function (SearchAction) {
2
- SearchAction["Autocomplete"] = "autocomplete";
3
- SearchAction["SearchAsYouType"] = "search-as-you-type";
4
- return SearchAction;
5
- }({});
@@ -1,31 +0,0 @@
1
- import { PromiseLookup } from './PromiseLookup';
2
- import { serializeSearchWorkerSrc } from './src';
3
- const mockWorker = () => ({
4
- onmessage: () => null,
5
- postMessage: () => null
6
- });
7
- export function createSearchWorker() {
8
- const src = serializeSearchWorkerSrc();
9
- const blob = new Blob([src], {
10
- type: 'text/javascript'
11
- });
12
- const dataUrl = URL.createObjectURL?.(blob);
13
- const w = typeof Worker === 'undefined' ? mockWorker() : new Worker(dataUrl);
14
- const results = new PromiseLookup({
15
- onKeyInit: (action, query) => w.postMessage({
16
- action,
17
- query
18
- })
19
- });
20
- w.onmessage = ({
21
- data
22
- }) => {
23
- const {
24
- query,
25
- result,
26
- action
27
- } = data;
28
- results.resolve(action, query, result);
29
- };
30
- return (action, query) => results.get(action, query);
31
- }
@@ -1,40 +0,0 @@
1
- export const searchPlaceholder = 'What are you learning today?';
2
- export const popularSearchTerms = ['Artificial Intelligence', 'Data Science', 'Python', 'Web Development', 'HTML', 'Java'];
3
- export let ContentType = /*#__PURE__*/function (ContentType) {
4
- ContentType["COURSE"] = "Course";
5
- ContentType["SKILLPATH"] = "Skill Path";
6
- ContentType["CAREERPATH"] = "Career Path";
7
- ContentType["ARTICLE"] = "Article";
8
- ContentType["DOC"] = "Doc";
9
- return ContentType;
10
- }({});
11
- export const popularContent = [{
12
- title: 'Learn Python 3',
13
- href: '/learn/learn-python-3',
14
- type: ContentType.COURSE,
15
- slug: 'learn-python-3',
16
- contentId: '6c152bd262967f8c941c9707ed636bda'
17
- }, {
18
- title: 'Business Intelligence Data Analyst',
19
- href: '/learn/paths/bi-data-analyst',
20
- type: ContentType.CAREERPATH,
21
- slug: 'bi-data-analyst',
22
- contentId: 'd03c7391224540ef8f850f8807a2b72a'
23
- }, {
24
- title: 'Code Foundations',
25
- href: '/learn/paths/code-foundations',
26
- type: ContentType.SKILLPATH,
27
- slug: 'code-foundations',
28
- contentId: '5b55e668646caa552f8e4d1d'
29
- }, {
30
- title: 'What is Programming?',
31
- href: '/article/what-is-programming',
32
- type: ContentType.ARTICLE,
33
- slug: 'what-is-programming'
34
- }, {
35
- title: 'HTML | Elements',
36
- href: '/resources/docs/html',
37
- type: ContentType.DOC,
38
- slug: 'html/concepts/elements'
39
- }];
40
- export const ALLOWED_HOSTS = ['skillsoft.com', 'percipio.com', 'localhost', 'codecademy.com', 'squads-dev.com'];
@@ -1,14 +0,0 @@
1
- import { useEffect, useRef } from 'react';
2
- export const useUrlChangeDetection = ({
3
- onUrlChange,
4
- getCurrentUrl = () => window.location?.href
5
- }) => {
6
- const currentUrl = getCurrentUrl();
7
- const prevUrlRef = useRef(currentUrl);
8
- useEffect(() => {
9
- if (prevUrlRef.current !== currentUrl) {
10
- onUrlChange();
11
- prevUrlRef.current = currentUrl;
12
- }
13
- }, [currentUrl, onUrlChange]);
14
- };
@@ -1,49 +0,0 @@
1
- /**
2
- * fork of @mono/util-url/src/safelyRedirect.ts, since
3
- * the build script doesn't resolve @mono dependencies
4
- */
5
-
6
- import { ALLOWED_HOSTS } from './consts';
7
- export function safelyRedirect(url) {
8
- try {
9
- const sanitizedURL = sanitizeURL(url);
10
- if (isRelativeUrl(sanitizedURL) || hasAllowedHost(sanitizedURL)) {
11
- window.location.assign(sanitizedURL);
12
- } else {
13
- throw new Error(`Invalid redirect url: ${sanitizedURL}`);
14
- }
15
- } catch (error) {}
16
- }
17
- function hasAllowedHost(url) {
18
- const parsedUrl = new URL(url);
19
- const {
20
- hostname
21
- } = parsedUrl;
22
- return ALLOWED_HOSTS.some(host =>
23
- // Exact match or exact subdomain match (e.g. sub.codecademy.com)
24
- hostname === host || hostname.endsWith(`.${host}`));
25
- }
26
-
27
- // when a url is relative, the URL constructor will throw a TypeError;
28
- function isRelativeUrl(url) {
29
- try {
30
- const parsedUrl = new URL(url);
31
- return parsedUrl === undefined;
32
- } catch (error) {
33
- return true;
34
- }
35
- }
36
-
37
- // supports already encoded urls by decoding and re-encoding.
38
- // params are handled separately to allow for the encoding of / characters
39
- function sanitizeURL(url) {
40
- const [path, params] = url.split('?', 2);
41
- const sanitizedPath = encodeURI(decodeURI(path));
42
- if (!params) return sanitizedPath;
43
- const urlParams = new URLSearchParams(params);
44
- urlParams.forEach((value, key) => {
45
- const decoded = decodeURIComponent(value);
46
- urlParams.set(key, decoded);
47
- });
48
- return `${sanitizedPath}?${urlParams.toString()}`;
49
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,39 +0,0 @@
1
- import { useRef, useState } from 'react';
2
- import { AnimatedHeaderZone } from '../shared';
3
- import { SearchButton } from './SearchButton';
4
- import { SearchPane } from './SearchPane';
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- export const useHeaderSearch = ({
7
- onEnable,
8
- onSearch,
9
- onTrackingClick,
10
- onSearchAsYouType
11
- }) => {
12
- const [isSearchVisible, setIsSearchVisible] = useState(false);
13
- const searchButtonRef = useRef(null);
14
- const toggleSearch = () => {
15
- if (!isSearchVisible) {
16
- onEnable();
17
- }
18
- setIsSearchVisible(oldIsSearchVisible => !oldIsSearchVisible);
19
- };
20
- return [{
21
- id: 'search',
22
- type: 'render-element',
23
- renderElement: () => /*#__PURE__*/_jsx(SearchButton, {
24
- isSearchVisible: isSearchVisible,
25
- setIsSearchVisible: setIsSearchVisible,
26
- toggleSearch: toggleSearch,
27
- searchButtonRef: searchButtonRef
28
- })
29
- }, /*#__PURE__*/_jsx(AnimatedHeaderZone, {
30
- visible: isSearchVisible,
31
- children: /*#__PURE__*/_jsx(SearchPane, {
32
- onSearch: onSearch,
33
- onTrackingClick: onTrackingClick,
34
- toggleSearch: toggleSearch,
35
- searchButtonRef: searchButtonRef,
36
- onSearchAsYouType: onSearchAsYouType
37
- })
38
- }, "search-content")];
39
- };
@@ -1,77 +0,0 @@
1
- import * as React from 'react';
2
- import { useMemo, useRef } from 'react';
3
- import { HeaderHeightArea } from '../HeaderHeightArea';
4
- import { NotificationsDropdown } from '../Notifications/NotificationsDropdown';
5
- import { useHeaderNotifications } from '../Notifications/useHeaderNotifications';
6
- import { AppHeaderListItem } from './AppHeaderElements/AppHeaderListItem';
7
- import { AppHeaderProvider } from './AppHeaderElements/AppHeaderProvider';
8
- import { useHeaderSearch } from './Search/useHeaderSearch';
9
- import { appHeaderMobileBreakpoint, appHeaderSpacing, StyledAppBar, StyledNavBar } from './shared';
10
- import { mapAppHeaderItemToElement } from './shared/utils';
11
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
- export * from './Search/consts';
13
- export const AppHeader = ({
14
- action,
15
- isAnon,
16
- hideRightButtonDefaults,
17
- items,
18
- notifications,
19
- redirectParam,
20
- search,
21
- isStandalone,
22
- isTeams,
23
- dropdownSpacing,
24
- type = 'standard'
25
- }) => {
26
- const menuContainerRef = useRef(null);
27
- const [notificationsBell, notificationsView] = useHeaderNotifications({
28
- settings: notifications,
29
- Renderer: NotificationsDropdown
30
- });
31
- const [searchButton, searchPane] = useHeaderSearch({
32
- ...search
33
- });
34
- const right = useMemo(() => {
35
- const defaultItems = hideRightButtonDefaults ? [] : [searchButton, ...(notificationsBell ? [notificationsBell] : [])];
36
- if (isTeams) {
37
- const teamsSpecificMenuItems = items.right.slice(0, -1);
38
- const profile = items.right[items.right.length - 1];
39
- return [...teamsSpecificMenuItems, ...defaultItems, profile];
40
- }
41
- return [...defaultItems, ...items.right];
42
- }, [searchButton, notificationsBell, hideRightButtonDefaults, items, isTeams]);
43
- const mapItemsToElement = (items, side) => {
44
- return items.map((item, index) => {
45
- const margin = appHeaderSpacing[type];
46
- return /*#__PURE__*/_jsx(AppHeaderListItem, {
47
- mr: margin,
48
- ml: side === 'right' && index === 0 ? 'auto' : margin,
49
- children: mapAppHeaderItemToElement({
50
- action,
51
- item,
52
- isAnon,
53
- isStandalone,
54
- isTeams,
55
- redirectParam,
56
- spacing: dropdownSpacing
57
- })
58
- }, item.id);
59
- });
60
- };
61
- return /*#__PURE__*/_jsx(HeaderHeightArea, {
62
- display: {
63
- _: 'none',
64
- [appHeaderMobileBreakpoint]: 'block'
65
- },
66
- children: /*#__PURE__*/_jsxs(AppHeaderProvider, {
67
- children: [/*#__PURE__*/_jsx(StyledAppBar, {
68
- "aria-label": "Main",
69
- as: "nav",
70
- children: /*#__PURE__*/_jsxs(StyledNavBar, {
71
- ref: menuContainerRef,
72
- children: [mapItemsToElement(items.left, 'left'), mapItemsToElement(right, 'right')]
73
- })
74
- }), notificationsView, searchPane]
75
- })
76
- });
77
- };