@codecademy/brand 2.0.0-alpha.4e24057d69.0 → 2.0.0-alpha.5000e6813b.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/README.md +1 -1
- package/dist/AbbreviatedCommunityEventCard/index.js +98 -0
- package/dist/AppBar/AppBarSection.js +41 -0
- package/dist/AppBar/index.js +20 -0
- package/dist/AppBarDeprecated/AppBarSectionDeprecated.js +25 -0
- package/dist/AppBarDeprecated/index.js +26 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/index.js +98 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/elements.js +63 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/index.js +440 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdown/index.js +157 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/AppHeaderDropdownLink.js +25 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/AppHeaderMenuItem.js +26 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/elements/types.js +1 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownLinks/index.js +2 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderDropdownProvider/index.js +26 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderLink/index.js +70 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.js +53 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderListItem/index.js +32 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderLogo/index.js +57 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderMenuProvider/index.js +88 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/AppHeaderDropdownNavButton.js +50 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/AppHeaderMenuNavButton.js +38 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderNavButton/index.js +36 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderProvider/index.js +19 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesDropdown/index.js +113 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesSection/index.js +194 -0
- package/dist/AppHeader/Search/DefaultResults.js +112 -0
- package/dist/AppHeader/Search/QuizAndHelpCenterLinks.js +80 -0
- package/dist/AppHeader/Search/SearchButton.js +58 -0
- package/dist/AppHeader/Search/SearchPane.js +518 -0
- package/dist/AppHeader/Search/SearchWorker/PromiseLookup.js +35 -0
- package/dist/AppHeader/Search/SearchWorker/index.js +24 -0
- package/dist/AppHeader/Search/SearchWorker/src.js +307 -0
- package/dist/AppHeader/Search/SearchWorker/types.js +5 -0
- package/dist/AppHeader/Search/SearchWorker/worker.js +31 -0
- package/dist/AppHeader/Search/consts.js +40 -0
- package/dist/AppHeader/Search/hooks/useUrlChangeDetection.js +14 -0
- package/dist/AppHeader/Search/safelyRedirect.js +49 -0
- package/dist/AppHeader/Search/types.js +1 -0
- package/dist/AppHeader/Search/useHeaderSearch.js +39 -0
- package/dist/AppHeader/index.js +77 -0
- package/dist/AppHeader/shared/elements.js +151 -0
- package/dist/AppHeader/shared/index.js +4 -0
- package/dist/AppHeader/shared/keyboardNav.js +67 -0
- package/dist/AppHeader/shared/mockAppHeaderItems.js +10 -0
- package/dist/AppHeader/shared/testTypes.js +0 -0
- package/dist/AppHeader/shared/types.js +1 -0
- package/dist/AppHeader/shared/utils.js +103 -0
- package/dist/AppHeader/utils/types.js +1 -0
- package/dist/AppHeaderMobile/AppHeaderMainMenuMobile/MobileSearchBar.js +77 -0
- package/dist/AppHeaderMobile/AppHeaderMainMenuMobile/index.js +111 -0
- package/dist/AppHeaderMobile/AppHeaderSubMenuMobile/elements.js +30 -0
- package/dist/AppHeaderMobile/AppHeaderSubMenuMobile/index.js +104 -0
- package/dist/AppHeaderMobile/AppHeaderSubMenuTarget/index.js +60 -0
- package/dist/AppHeaderMobile/index.js +226 -0
- package/dist/Avatar/Avatar.stories.js +15 -0
- package/dist/Avatar/index.js +45 -0
- package/dist/AvatarChooser/index.js +105 -0
- package/dist/BackToTopAnchor/index.js +38 -0
- package/dist/Banner/index.js +102 -0
- package/dist/BetaSticker/index.js +57 -0
- package/dist/CareerPathCard/index.js +41 -0
- package/dist/Carousel/elements.js +14 -0
- package/dist/Carousel/index.js +242 -0
- package/dist/CertificationPathCard/index.js +42 -0
- package/dist/CommunityEventCard/EventTypeIcon.js +59 -0
- package/dist/CommunityEventCard/index.js +305 -0
- package/dist/CommunityEventToast/index.js +32 -0
- package/dist/ContentGroupBaseCard/helpers.js +12 -0
- package/dist/ContentGroupBaseCard/index.js +178 -0
- package/dist/ContentGroupBaseCard/shared.js +76 -0
- package/dist/ContentGroupBaseCard/types.js +12 -0
- package/dist/CourseCard/index.js +47 -0
- package/dist/CurriculumCard/BottomTag/index.js +26 -0
- package/dist/CurriculumCard/Difficulty/helpers.js +13 -0
- package/dist/CurriculumCard/Difficulty/index.js +47 -0
- package/dist/CurriculumCard/Difficulty/types.js +20 -0
- package/dist/CurriculumCard/Footer/index.js +54 -0
- package/dist/CurriculumCard/Image/index.js +56 -0
- package/dist/CurriculumCard/Subtitle/helpers.js +8 -0
- package/dist/CurriculumCard/Subtitle/index.js +34 -0
- package/dist/CurriculumCard/index.js +129 -0
- package/dist/DropdownButton/DropdownList.js +73 -0
- package/dist/DropdownButton/index.js +169 -0
- package/dist/DropdownButton/useDynamicPopoverPosition.js +55 -0
- package/dist/DropdownButton/useDynamicPopoverPosition.test.js +85 -0
- package/dist/EditorialImage/index.js +22 -0
- package/dist/EmptySection/index.js +183 -0
- package/dist/ErrorContents/index.js +48 -0
- package/dist/FeatureList/index.js +41 -0
- package/dist/GlobalFooter/FooterHeading.js +30 -0
- package/dist/GlobalFooter/FooterLegal/LegalLinks.js +43 -0
- package/dist/GlobalFooter/FooterLegal/MadeIn.js +64 -0
- package/dist/GlobalFooter/FooterLegal/index.js +22 -0
- package/dist/GlobalFooter/FooterLinks.js +53 -0
- package/dist/GlobalFooter/FooterNavLinks/CatalogLinks.js +298 -0
- package/dist/GlobalFooter/FooterNavLinks/CompanyLinks.js +299 -0
- package/dist/GlobalFooter/FooterNavLinks/ReferralRock/ReferAFriendLinkWithModal.js +268 -0
- package/dist/GlobalFooter/FooterNavLinks/ReferralRock/ReferralFields.js +29 -0
- package/dist/GlobalFooter/FooterNavLinks/ReferralRock/ReferralForm.js +74 -0
- package/dist/GlobalFooter/FooterNavLinks/ReferralRock/ReferralLinkSocialMediaSharing.js +86 -0
- package/dist/GlobalFooter/FooterNavLinks/ReferralRock/types.js +1 -0
- package/dist/GlobalFooter/FooterNavLinks/SocialMediaLinks.js +50 -0
- package/dist/GlobalFooter/FooterNavLinks/index.js +45 -0
- package/dist/GlobalFooter/FooterSubHeading.js +22 -0
- package/dist/GlobalFooter/index.js +39 -0
- package/dist/GlobalFooter/types.js +1 -0
- package/dist/GlobalHeader/GlobalHeaderItems.js +405 -0
- package/dist/GlobalHeader/GlobalHeaderVariants.js +211 -0
- package/dist/GlobalHeader/index.js +101 -0
- package/dist/GlobalHeader/types.js +1 -0
- package/dist/GlobalHeader/urlHelpers.js +21 -0
- package/dist/GlobalPage/index.js +53 -0
- package/dist/Grid/GridCollapse.js +199 -0
- package/dist/Grid/GridCollapse.test.js +96 -0
- package/dist/Grid/Subgrid.js +37 -0
- package/dist/Grid/getCSSFromColumnCount.js +7 -0
- package/dist/Grid/index.js +3 -0
- package/dist/HeaderHeightArea/index.js +40 -0
- package/dist/HeaderHeightArea/useIsInHeaderRegion.js +15 -0
- package/dist/HorizontalScrollMenu/index.js +75 -0
- package/dist/HubCard/index.js +38 -0
- package/dist/InfoCard/index.js +157 -0
- package/dist/Konamimojisplosion/Konamimojisplosion.js +7 -0
- package/dist/Konamimojisplosion/index.js +2 -0
- package/dist/Konamimojisplosion/useKonamimojisplosion.js +34 -0
- package/dist/LandingPage/CTA.js +11 -0
- package/dist/LandingPage/Description.js +14 -0
- package/dist/LandingPage/Feature.js +96 -0
- package/dist/LandingPage/PageFAQs.js +42 -0
- package/dist/LandingPage/PageFeatures.js +112 -0
- package/dist/LandingPage/PageFeaturesEnhanced.js +159 -0
- package/dist/LandingPage/PageFeaturesWithReferences.js +136 -0
- package/dist/LandingPage/PageHero.js +22 -0
- package/dist/LandingPage/PagePrefooter.js +74 -0
- package/dist/LandingPage/PageSingleFeature.js +128 -0
- package/dist/LandingPage/PageTestimonials.js +113 -0
- package/dist/LandingPage/PageVideoGallery.js +49 -0
- package/dist/LandingPage/Title.js +28 -0
- package/dist/LandingPage/TitleWithEyebrow.js +40 -0
- package/dist/LandingPage/index.js +14 -0
- package/dist/LandingPage/types.js +1 -0
- package/dist/LayoutMenu/AccordionMenu.js +68 -0
- package/dist/LayoutMenu/LayoutMenu.js +96 -0
- package/dist/LayoutMenu/LayoutMenuSection.js +34 -0
- package/dist/LayoutMenu/SectionItemLink.js +16 -0
- package/dist/LayoutMenu/SelectedSectionItem.js +17 -0
- package/dist/LayoutMenu/index.js +3 -0
- package/dist/LayoutMenuVariant/AccordionMenu.js +85 -0
- package/dist/LayoutMenuVariant/LayoutMenu.js +92 -0
- package/dist/LayoutMenuVariant/LayoutMenuSection.js +42 -0
- package/dist/LayoutMenuVariant/SectionItemLink.js +17 -0
- package/dist/LayoutMenuVariant/index.js +2 -0
- package/dist/LearningOutcomeAssessmentScores/AssessmentDetail.js +55 -0
- package/dist/LearningOutcomeAssessmentScores/index.js +24 -0
- package/dist/LearningOutcomeBadges/LearningOutcomeLevelBadge.js +57 -0
- package/dist/LearningOutcomeBadges/LearningOutcomeLowAssessmentBadge.js +35 -0
- package/dist/LearningOutcomeBadges/index.js +2 -0
- package/dist/LearningOutcomeCard/index.js +178 -0
- package/dist/LearningOutcomeFlyout/index.js +168 -0
- package/dist/LearningOutcomePopover/index.js +125 -0
- package/dist/LearningOutcomeTile/Tile.js +79 -0
- package/dist/LearningOutcomeTile/index.js +114 -0
- package/dist/LearningOutcomeTile/types.js +11 -0
- package/dist/ListSection/index.js +64 -0
- package/dist/Loading/index.js +82 -0
- package/dist/LoadingCurriculumCard/index.js +82 -0
- package/dist/Logo/CodecademyLogo.js +19 -0
- package/dist/Logo/CodecademyPremiumLogo.js +35 -0
- package/dist/Logo/CodecademyProAltLogo.js +19 -0
- package/dist/Logo/CodecademyProLockupLogo.js +13 -0
- package/dist/Logo/CodecademyProLogo.js +21 -0
- package/dist/Logo/CodecademyProMonoLogo.js +22 -0
- package/dist/Logo/CodecademyProgramLogo.js +14 -0
- package/dist/Logo/CodecademyTeamsLogo.js +41 -0
- package/dist/Logo/index.js +30 -0
- package/dist/LogoFromSkillsoft/index.js +55 -0
- package/dist/LogoLXStudio/index.js +47 -0
- package/dist/LogoProCutout/index.js +31 -0
- package/dist/LogoProCutoutTransparent/index.js +31 -0
- package/dist/MarketingToaster/index.js +67 -0
- package/dist/NotFoundContent/index.js +55 -0
- package/dist/NotificationList/EmptyNotification/emptyNotificationContents.js +23 -0
- package/dist/NotificationList/EmptyNotification/index.js +38 -0
- package/dist/NotificationList/NotificationItem.js +151 -0
- package/dist/NotificationList/index.js +46 -0
- package/dist/NotificationList/typings.js +1 -0
- package/dist/Notifications/NotificationBell.js +72 -0
- package/dist/Notifications/NotificationsContents.js +85 -0
- package/dist/Notifications/NotificationsDropdown.js +25 -0
- package/dist/Notifications/__fixtures__/NotificationTestComponent.js +12 -0
- package/dist/Notifications/__fixtures__/stubs.js +8 -0
- package/dist/Notifications/constants.js +4 -0
- package/dist/Notifications/elements.js +21 -0
- package/dist/Notifications/types.js +1 -0
- package/dist/Notifications/useHeaderNotifications.js +37 -0
- package/dist/Notifications/useNotificationButtons.js +56 -0
- package/dist/PageAlerts/PageAlerts.js +75 -0
- package/dist/PageAlerts/PageAlertsProvider.js +34 -0
- package/dist/PageAlerts/index.js +3 -0
- package/dist/PageAlerts/types.js +1 -0
- package/dist/PageLayoutWithSidebarMenu/PageLayoutWithSidebarMenu.js +53 -0
- package/dist/PageLayoutWithSidebarMenu/index.js +1 -0
- package/dist/PageSection/index.js +67 -0
- package/dist/PastDue/PastDueModalContents/index.js +30 -0
- package/dist/PastDue/index.js +2 -0
- package/dist/PastDue/pastDueMessages.js +48 -0
- package/dist/PausableImage/BaseImage/index.js +54 -0
- package/dist/PausableImage/index.js +37 -0
- package/dist/PlanCard/PlanCardBanner.js +28 -0
- package/dist/PlanCard/PlanFeature.js +83 -0
- package/dist/PlanCard/PopularBadge.js +13 -0
- package/dist/PlanCard/PricingAmount.js +117 -0
- package/dist/PlanCard/RecommendedBadge.js +24 -0
- package/dist/PlanCard/consts.js +135 -0
- package/dist/PlanCard/index.js +370 -0
- package/dist/PlanCard/types.js +62 -0
- package/dist/PlanCardTeams/consts.js +8 -0
- package/dist/PlanCardTeams/index.js +167 -0
- package/dist/PricingSection/PlanFeature.js +88 -0
- package/dist/PricingSection/PricingCard/PricingAmount.js +84 -0
- package/dist/PricingSection/PricingCard/RecommendedBadge.js +24 -0
- package/dist/PricingSection/PricingCard/consts.js +85 -0
- package/dist/PricingSection/PricingCard/index.js +241 -0
- package/dist/PricingSection/ProductCTA.js +44 -0
- package/dist/PricingSection/Products.js +74 -0
- package/dist/PricingSection/config.js +36 -0
- package/dist/PricingSection/index.js +58 -0
- package/dist/PricingSection/types.js +8 -0
- package/dist/ProLabel/index.js +59 -0
- package/dist/ProLogo/index.js +27 -0
- package/dist/ProLogoAlt/index.js +26 -0
- package/dist/ProductFeatureShowcase/index.js +120 -0
- package/dist/QuizScore/index.js +84 -0
- package/dist/RatingsBar/index.js +32 -0
- package/dist/ResourceCard/index.js +59 -0
- package/dist/ScoreSummary/SubScores.js +165 -0
- package/dist/ScoreSummary/helpers.js +20 -0
- package/dist/ScoreSummary/index.js +108 -0
- package/dist/ScoreSummary/types.js +1 -0
- package/dist/SkillPathCard/index.js +38 -0
- package/dist/SocialMediaSharing/SocialShareIconLink.js +49 -0
- package/dist/SocialMediaSharing/index.js +116 -0
- package/dist/SocialMediaSharingDropdown/index.js +111 -0
- package/dist/Testimonial/index.js +163 -0
- package/dist/index.js +87 -0
- package/dist/lib/breakpointHooks/index.js +60 -0
- package/dist/lib/catalogList/index.js +173 -0
- package/dist/lib/resourcesList/index.js +232 -0
- package/dist/remoteAssets/components.js +1 -0
- package/dist/stories/Atoms/Avatar.stories.js +16 -0
- package/dist/stories/Atoms/BetaSticker.stories.js +22 -0
- package/dist/stories/Atoms/Logos/Logo.stories.js +78 -0
- package/dist/stories/Atoms/Logos/LogoFromSkillsoft.stories.js +15 -0
- package/dist/stories/Atoms/Logos/LogoLXStudio.stories.js +11 -0
- package/dist/stories/Atoms/Logos/ProLabel.stories.js +16 -0
- package/dist/stories/Atoms/Logos/ProLogoAlt.stories.js +24 -0
- package/dist/stories/Atoms/RatingsBar.stories.js +16 -0
- package/dist/stories/Atoms/Subgrid.stories.js +87 -0
- package/dist/stories/Molecules/AppBar.stories.js +32 -0
- package/dist/stories/Molecules/AppHeader/AppHeader.stories.js +84 -0
- package/dist/stories/Molecules/AppHeader/AppHeaderDropdown.stories.js +67 -0
- package/dist/stories/Molecules/AppHeader/AppHeaderLink.stories.js +52 -0
- package/dist/stories/Molecules/AppHeader/AppHeaderLogo.stories.js +44 -0
- package/dist/stories/Molecules/AppHeader/AppHeaderMainMenuMobile.stories.js +34 -0
- package/dist/stories/Molecules/AppHeader/AppHeaderMobile.stories.js +40 -0
- package/dist/stories/Molecules/AppHeader/AppHeaderSubMenuMobile.stories.js +25 -0
- package/dist/stories/Molecules/AppHeader/LXStudioHeader.stories.js +176 -0
- package/dist/stories/Molecules/AppHeader/LXStudioMobileHeader.stories.js +84 -0
- package/dist/stories/Molecules/AppHeader/MockAppHeaderElements.js +90 -0
- package/dist/stories/Molecules/AvatarChooser.stories.js +22 -0
- package/dist/stories/Molecules/BackToTopAnchor.stories.js +51 -0
- package/dist/stories/Molecules/Banner.stories.js +115 -0
- package/dist/stories/Molecules/Carousel.stories.js +47 -0
- package/dist/stories/Molecules/ContentGroupBaseCard.stories.js +173 -0
- package/dist/stories/Molecules/CurriculumCard.stories.js +208 -0
- package/dist/stories/Molecules/CurriculumCards/CareerPathCard.stories.js +92 -0
- package/dist/stories/Molecules/CurriculumCards/CertificationPathCard.stories.js +65 -0
- package/dist/stories/Molecules/CurriculumCards/CourseCard.stories.js +83 -0
- package/dist/stories/Molecules/CurriculumCards/LoadingCurriculumCard.stories.js +20 -0
- package/dist/stories/Molecules/CurriculumCards/SkillPathCard.stories.js +90 -0
- package/dist/stories/Molecules/DropdownButton.stories.js +207 -0
- package/dist/stories/Molecules/EditorialImage.stories.js +17 -0
- package/dist/stories/Molecules/EmptySection.stories.js +168 -0
- package/dist/stories/Molecules/ErrorContents.stories.js +19 -0
- package/dist/stories/Molecules/GridCollapse.stories.js +42 -0
- package/dist/stories/Molecules/HorizontalScrollMenu.examples.js +67 -0
- package/dist/stories/Molecules/HorizontalScrollMenu.stories.js +11 -0
- package/dist/stories/Molecules/HubCard.stories.js +28 -0
- package/dist/stories/Molecules/InfoCard.stories.js +30 -0
- package/dist/stories/Molecules/LearningOutcomeAssessmentScores.stories.js +23 -0
- package/dist/stories/Molecules/LearningOutcomeCard.stories.js +75 -0
- package/dist/stories/Molecules/LearningOutcomeFlyout.stories.js +35 -0
- package/dist/stories/Molecules/LearningOutcomeLevelBadge.stories.js +20 -0
- package/dist/stories/Molecules/LearningOutcomeLowAssessmentBadge.stories.js +10 -0
- package/dist/stories/Molecules/LearningOutcomePopover.stories.js +39 -0
- package/dist/stories/Molecules/LearningOutcomeTile.stories.js +276 -0
- package/dist/stories/Molecules/ListSection.stories.js +97 -0
- package/dist/stories/Molecules/Loading.stories.js +10 -0
- package/dist/stories/Molecules/NotificationList.stories.js +100 -0
- package/dist/stories/Molecules/PageSection.stories.js +67 -0
- package/dist/stories/Molecules/PastDueModalContents.stories.js +62 -0
- package/dist/stories/Molecules/PausableImage.stories.js +16 -0
- package/dist/stories/Molecules/ResourceCard.stories.js +18 -0
- package/dist/stories/Molecules/SocialMediaSharing.stories.js +20 -0
- package/dist/stories/Molecules/SocialMediaSharingDropdown.stories.js +20 -0
- package/dist/stories/Molecules/Testimonial.stories.js +63 -0
- package/dist/stories/Organisms/GlobalFooter.stories.js +29 -0
- package/dist/stories/Organisms/GlobalHeader/About.stories.js +136 -0
- package/dist/stories/Organisms/GlobalHeader/Anon.stories.js +73 -0
- package/dist/stories/Organisms/GlobalHeader/Bootcamp.stories.js +32 -0
- package/dist/stories/Organisms/GlobalHeader/Enterprise.stories.js +108 -0
- package/dist/stories/Organisms/GlobalHeader/Free.stories.js +133 -0
- package/dist/stories/Organisms/GlobalHeader/Pro.stories.js +199 -0
- package/dist/stories/Organisms/GlobalHeader/Simple.stories.js +31 -0
- package/dist/stories/Organisms/GlobalPage.stories.js +142 -0
- package/dist/stories/Organisms/LayoutMenu.stories.js +242 -0
- package/dist/stories/Organisms/LayoutMenuVariant.stories.js +224 -0
- package/dist/stories/Organisms/PageAlerts.example.js +42 -0
- package/dist/stories/Organisms/PageAlerts.stories.js +15 -0
- package/dist/stories/Organisms/PageFeatures.stories.js +183 -0
- package/dist/stories/Organisms/PageHero.stories.js +145 -0
- package/dist/stories/Organisms/PageLayoutWithSidebarMenu.stories.js +34 -0
- package/dist/stories/Organisms/PagePrefooter.stories.js +62 -0
- package/dist/stories/Organisms/PageSingleFeature.stories.js +158 -0
- package/dist/stories/Organisms/PageVideoGallery.stories.js +70 -0
- package/dist/stories/Organisms/PlanCard.stories.js +98 -0
- package/dist/stories/Organisms/PlanCardTeams.stories.js +27 -0
- package/dist/stories/Organisms/ScoreSummary.stories.js +299 -0
- package/package.json +2 -2
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Box, Column, FlexBox, LayoutGrid } from '@codecademy/gamut';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { CTA } from './CTA';
|
|
4
|
+
import { Description } from './Description';
|
|
5
|
+
import { Feature, FeaturedDescription, FeaturedIcon, FeaturedImage, FeaturedStat, FeaturedTitle } from './Feature';
|
|
6
|
+
import { Title } from './Title';
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const rowRenderEach = (items, itemRenderer) => {
|
|
9
|
+
/* eslint-disable react/no-array-index-key */
|
|
10
|
+
return /*#__PURE__*/_jsx(FlexBox, {
|
|
11
|
+
flexDirection: {
|
|
12
|
+
_: 'column',
|
|
13
|
+
sm: 'row'
|
|
14
|
+
},
|
|
15
|
+
as: "ul",
|
|
16
|
+
pl: 0,
|
|
17
|
+
gap: {
|
|
18
|
+
sm: 32
|
|
19
|
+
},
|
|
20
|
+
children: items.map((item, i) => /*#__PURE__*/_jsx(FlexBox, {
|
|
21
|
+
as: "li",
|
|
22
|
+
flex: 1,
|
|
23
|
+
children: itemRenderer(item)
|
|
24
|
+
}, i))
|
|
25
|
+
});
|
|
26
|
+
/* eslint-enable react/no-array-index-key */
|
|
27
|
+
};
|
|
28
|
+
const gridRenderEach = (maxCols, items, itemRenderer) => {
|
|
29
|
+
const size = {
|
|
30
|
+
_: 12,
|
|
31
|
+
sm: 12 / maxCols
|
|
32
|
+
};
|
|
33
|
+
/* eslint-disable react/no-array-index-key */
|
|
34
|
+
return /*#__PURE__*/_jsx(LayoutGrid, {
|
|
35
|
+
columnGap: {
|
|
36
|
+
_: 8,
|
|
37
|
+
sm: 32
|
|
38
|
+
},
|
|
39
|
+
as: "ul",
|
|
40
|
+
children: items.map((item, i) => /*#__PURE__*/_jsx(Column, {
|
|
41
|
+
size: size,
|
|
42
|
+
as: "li",
|
|
43
|
+
children: itemRenderer(item)
|
|
44
|
+
}, i))
|
|
45
|
+
});
|
|
46
|
+
/* eslint-enable react/no-array-index-key */
|
|
47
|
+
};
|
|
48
|
+
const renderEach = (maxCols, items, itemRenderer) => {
|
|
49
|
+
if (maxCols === undefined) {
|
|
50
|
+
return rowRenderEach(items, itemRenderer);
|
|
51
|
+
}
|
|
52
|
+
if (maxCols > 0 && maxCols <= 4) {
|
|
53
|
+
return gridRenderEach(maxCols, items, itemRenderer);
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
};
|
|
57
|
+
export const PageFeatures = ({
|
|
58
|
+
title,
|
|
59
|
+
desc,
|
|
60
|
+
cta,
|
|
61
|
+
maxCols,
|
|
62
|
+
features,
|
|
63
|
+
featuresMedia,
|
|
64
|
+
testId,
|
|
65
|
+
onAnchorClick
|
|
66
|
+
}) => /*#__PURE__*/_jsxs("div", {
|
|
67
|
+
"data-testid": testId,
|
|
68
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
69
|
+
children: [title && /*#__PURE__*/_jsx(Title, {
|
|
70
|
+
isPageHeading: false,
|
|
71
|
+
children: title
|
|
72
|
+
}), desc && /*#__PURE__*/_jsx(Description, {
|
|
73
|
+
text: desc,
|
|
74
|
+
onAnchorClick: onAnchorClick
|
|
75
|
+
}), cta && /*#__PURE__*/_jsx(Box, {
|
|
76
|
+
mt: 32,
|
|
77
|
+
children: /*#__PURE__*/_jsx(CTA, {
|
|
78
|
+
href: cta.href,
|
|
79
|
+
onClick: cta.onClick,
|
|
80
|
+
buttonType: cta.buttonType,
|
|
81
|
+
children: cta.text
|
|
82
|
+
})
|
|
83
|
+
})]
|
|
84
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
85
|
+
mt: 16,
|
|
86
|
+
children: renderEach(maxCols, features, ({
|
|
87
|
+
testId,
|
|
88
|
+
imgSrc,
|
|
89
|
+
imgAlt,
|
|
90
|
+
statText,
|
|
91
|
+
title: featTitle,
|
|
92
|
+
desc
|
|
93
|
+
}) => /*#__PURE__*/_jsxs(Feature, {
|
|
94
|
+
testId: testId,
|
|
95
|
+
children: [featuresMedia === 'image' && imgSrc && /*#__PURE__*/_jsx(FeaturedImage, {
|
|
96
|
+
src: imgSrc,
|
|
97
|
+
alt: imgAlt ?? ''
|
|
98
|
+
}), featuresMedia === 'icon' && imgSrc && /*#__PURE__*/_jsx(FeaturedIcon, {
|
|
99
|
+
src: imgSrc,
|
|
100
|
+
alt: imgAlt ?? ''
|
|
101
|
+
}), featuresMedia === 'stat' && /*#__PURE__*/_jsx(FeaturedStat, {
|
|
102
|
+
children: statText
|
|
103
|
+
}), featTitle && /*#__PURE__*/_jsx(FeaturedTitle, {
|
|
104
|
+
as: desc ? title ? 'h3' : 'h2' : 'div',
|
|
105
|
+
children: featTitle
|
|
106
|
+
}), desc && /*#__PURE__*/_jsx(FeaturedDescription, {
|
|
107
|
+
desc: desc,
|
|
108
|
+
onAnchorClick: onAnchorClick
|
|
109
|
+
})]
|
|
110
|
+
}))
|
|
111
|
+
})]
|
|
112
|
+
});
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Box, Column, FlexBox, LayoutGrid } from '@codecademy/gamut';
|
|
2
|
+
import { Background, ColorMode } from '@codecademy/gamut-styles';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { CTA } from './CTA';
|
|
5
|
+
import { Description } from './Description';
|
|
6
|
+
import { FeaturedDescription, FeaturedIcon, FeaturedImage, FeaturedStat, FeaturedTitle } from './Feature';
|
|
7
|
+
import { Title } from './Title';
|
|
8
|
+
import { TitleWithEyebrow } from './TitleWithEyebrow';
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const rowRenderEach = (items, itemRenderer) => {
|
|
11
|
+
return /*#__PURE__*/_jsx(FlexBox, {
|
|
12
|
+
flexDirection: {
|
|
13
|
+
_: 'column',
|
|
14
|
+
sm: 'row'
|
|
15
|
+
},
|
|
16
|
+
as: "ul",
|
|
17
|
+
pl: 0,
|
|
18
|
+
mb: 0,
|
|
19
|
+
gap: {
|
|
20
|
+
sm: 32
|
|
21
|
+
},
|
|
22
|
+
children: items.map(item => /*#__PURE__*/_jsx(FlexBox, {
|
|
23
|
+
as: "li",
|
|
24
|
+
flex: 1,
|
|
25
|
+
children: itemRenderer(item)
|
|
26
|
+
}, item.title))
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const gridRenderEach = (maxCols, items, itemRenderer) => {
|
|
30
|
+
const size = {
|
|
31
|
+
_: 12,
|
|
32
|
+
xs: 12 / (maxCols / 2),
|
|
33
|
+
lg: 12 / maxCols
|
|
34
|
+
};
|
|
35
|
+
return /*#__PURE__*/_jsx(LayoutGrid, {
|
|
36
|
+
gap: 32,
|
|
37
|
+
as: "ul",
|
|
38
|
+
pl: 0,
|
|
39
|
+
mb: 0,
|
|
40
|
+
children: items.map(item => /*#__PURE__*/_jsx(Column, {
|
|
41
|
+
size: size,
|
|
42
|
+
as: "li",
|
|
43
|
+
children: itemRenderer(item)
|
|
44
|
+
}, item.title))
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const renderEach = (maxCols, items, itemRenderer) => {
|
|
48
|
+
if (maxCols === undefined) {
|
|
49
|
+
return rowRenderEach(items, itemRenderer);
|
|
50
|
+
}
|
|
51
|
+
if (maxCols > 0 && maxCols <= 4) {
|
|
52
|
+
return gridRenderEach(maxCols, items, itemRenderer);
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
};
|
|
56
|
+
export const PageFeaturesEnhanced = ({
|
|
57
|
+
eyebrow,
|
|
58
|
+
title,
|
|
59
|
+
desc,
|
|
60
|
+
cta,
|
|
61
|
+
maxCols,
|
|
62
|
+
features,
|
|
63
|
+
featuresMedia,
|
|
64
|
+
testId,
|
|
65
|
+
onAnchorClick
|
|
66
|
+
}) => {
|
|
67
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
68
|
+
"data-testid": testId,
|
|
69
|
+
children: [title && /*#__PURE__*/_jsx(FlexBox, {
|
|
70
|
+
justifyContent: "center",
|
|
71
|
+
textAlign: "center",
|
|
72
|
+
mb: 8,
|
|
73
|
+
children: eyebrow ? /*#__PURE__*/_jsx(TitleWithEyebrow, {
|
|
74
|
+
title: title,
|
|
75
|
+
eyebrow: eyebrow,
|
|
76
|
+
isPageHeading: false,
|
|
77
|
+
titleStyle: {
|
|
78
|
+
fontWeight: 700,
|
|
79
|
+
fontSize: {
|
|
80
|
+
_: 44,
|
|
81
|
+
sm: 44
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
eyebrowStyle: {
|
|
85
|
+
fontWeight: 'lighter',
|
|
86
|
+
fontSize: {
|
|
87
|
+
_: 16,
|
|
88
|
+
sm: 16
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}) : /*#__PURE__*/_jsx(Title, {
|
|
92
|
+
isPageHeading: false,
|
|
93
|
+
children: title
|
|
94
|
+
})
|
|
95
|
+
}), desc && /*#__PURE__*/_jsx(FlexBox, {
|
|
96
|
+
justifyContent: "center",
|
|
97
|
+
textAlign: "center",
|
|
98
|
+
children: /*#__PURE__*/_jsx(Description, {
|
|
99
|
+
text: desc,
|
|
100
|
+
onAnchorClick: onAnchorClick
|
|
101
|
+
})
|
|
102
|
+
}), cta && /*#__PURE__*/_jsx(Box, {
|
|
103
|
+
mt: 32,
|
|
104
|
+
children: /*#__PURE__*/_jsx(CTA, {
|
|
105
|
+
href: cta.href,
|
|
106
|
+
onClick: cta.onClick,
|
|
107
|
+
buttonType: cta.buttonType,
|
|
108
|
+
children: cta.text
|
|
109
|
+
})
|
|
110
|
+
}), /*#__PURE__*/_jsx(ColorMode, {
|
|
111
|
+
mode: "dark",
|
|
112
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
113
|
+
mt: 16,
|
|
114
|
+
children: renderEach(maxCols, features, ({
|
|
115
|
+
testId,
|
|
116
|
+
imgSrc,
|
|
117
|
+
imgAlt,
|
|
118
|
+
statText,
|
|
119
|
+
title: featTitle,
|
|
120
|
+
desc
|
|
121
|
+
}) => /*#__PURE__*/_jsxs(Background, {
|
|
122
|
+
bg: "white-300",
|
|
123
|
+
borderRadius: "lg",
|
|
124
|
+
py: 24,
|
|
125
|
+
px: 16,
|
|
126
|
+
color: "white",
|
|
127
|
+
"data-testid": testId,
|
|
128
|
+
children: [featuresMedia === 'image' && imgSrc && /*#__PURE__*/_jsx(FeaturedImage, {
|
|
129
|
+
src: imgSrc,
|
|
130
|
+
alt: imgAlt ?? ''
|
|
131
|
+
}), featuresMedia === 'icon' && imgSrc && /*#__PURE__*/_jsx(FeaturedIcon, {
|
|
132
|
+
src: imgSrc,
|
|
133
|
+
alt: imgAlt ?? '',
|
|
134
|
+
props: {
|
|
135
|
+
mb: 16,
|
|
136
|
+
width: '48px',
|
|
137
|
+
height: '48px'
|
|
138
|
+
}
|
|
139
|
+
}), featuresMedia === 'stat' && /*#__PURE__*/_jsx(FeaturedStat, {
|
|
140
|
+
children: statText
|
|
141
|
+
}), featTitle && /*#__PURE__*/_jsx(FeaturedTitle, {
|
|
142
|
+
as: desc ? title ? 'h3' : 'h2' : 'div',
|
|
143
|
+
props: {
|
|
144
|
+
fontSize: {
|
|
145
|
+
_: 20,
|
|
146
|
+
lg: 20
|
|
147
|
+
},
|
|
148
|
+
mb: 16
|
|
149
|
+
},
|
|
150
|
+
children: featTitle
|
|
151
|
+
}), desc && /*#__PURE__*/_jsx(FeaturedDescription, {
|
|
152
|
+
desc: desc,
|
|
153
|
+
onAnchorClick: onAnchorClick
|
|
154
|
+
})]
|
|
155
|
+
}))
|
|
156
|
+
})
|
|
157
|
+
})]
|
|
158
|
+
});
|
|
159
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Box, Column, FlexBox, LayoutGrid } from '@codecademy/gamut';
|
|
2
|
+
import { DotDense } from '@codecademy/gamut-patterns';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { FeatureList } from '../FeatureList';
|
|
5
|
+
import { CTA } from './CTA';
|
|
6
|
+
import { Description } from './Description';
|
|
7
|
+
import { Title } from './Title';
|
|
8
|
+
import { TitleWithEyebrow } from './TitleWithEyebrow';
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export const PageFeaturesWithReferences = ({
|
|
11
|
+
eyebrow,
|
|
12
|
+
title,
|
|
13
|
+
desc,
|
|
14
|
+
cta,
|
|
15
|
+
testId,
|
|
16
|
+
rightCoverImage,
|
|
17
|
+
showImageOnMobile,
|
|
18
|
+
rightCoverPattern,
|
|
19
|
+
onAnchorClick,
|
|
20
|
+
featureList
|
|
21
|
+
}) => {
|
|
22
|
+
const hasRightCoverImage = rightCoverImage && rightCoverImage?.url;
|
|
23
|
+
return /*#__PURE__*/_jsxs(LayoutGrid, {
|
|
24
|
+
"data-testid": testId,
|
|
25
|
+
p: 0,
|
|
26
|
+
m: 0,
|
|
27
|
+
gap: {
|
|
28
|
+
_: 8,
|
|
29
|
+
sm: 48
|
|
30
|
+
},
|
|
31
|
+
children: [/*#__PURE__*/_jsx(Column, {
|
|
32
|
+
size: {
|
|
33
|
+
_: 12,
|
|
34
|
+
sm: 12,
|
|
35
|
+
md: hasRightCoverImage ? 7 : 12,
|
|
36
|
+
lg: hasRightCoverImage ? 6 : 12
|
|
37
|
+
},
|
|
38
|
+
p: {
|
|
39
|
+
_: 4,
|
|
40
|
+
sm: 8,
|
|
41
|
+
md: 24
|
|
42
|
+
},
|
|
43
|
+
children: /*#__PURE__*/_jsxs(FlexBox, {
|
|
44
|
+
flexDirection: "column",
|
|
45
|
+
p: 0,
|
|
46
|
+
m: 0,
|
|
47
|
+
gap: 0,
|
|
48
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
49
|
+
children: [title && /*#__PURE__*/_jsx(FlexBox, {
|
|
50
|
+
children: eyebrow ? /*#__PURE__*/_jsx(TitleWithEyebrow, {
|
|
51
|
+
title: title,
|
|
52
|
+
eyebrow: eyebrow,
|
|
53
|
+
isPageHeading: false,
|
|
54
|
+
titleStyle: {
|
|
55
|
+
fontWeight: 700,
|
|
56
|
+
fontSize: {
|
|
57
|
+
_: 44,
|
|
58
|
+
sm: 44
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
eyebrowStyle: {
|
|
62
|
+
fontWeight: 'lighter',
|
|
63
|
+
fontSize: {
|
|
64
|
+
_: 16,
|
|
65
|
+
sm: 16
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}) : /*#__PURE__*/_jsx(Title, {
|
|
69
|
+
isPageHeading: false,
|
|
70
|
+
children: title
|
|
71
|
+
})
|
|
72
|
+
}), desc && /*#__PURE__*/_jsx(FlexBox, {
|
|
73
|
+
children: /*#__PURE__*/_jsx(Description, {
|
|
74
|
+
text: desc,
|
|
75
|
+
onAnchorClick: onAnchorClick
|
|
76
|
+
})
|
|
77
|
+
}), cta && /*#__PURE__*/_jsx(Box, {
|
|
78
|
+
mt: 32,
|
|
79
|
+
children: /*#__PURE__*/_jsx(CTA, {
|
|
80
|
+
href: cta.href,
|
|
81
|
+
onClick: cta.onClick,
|
|
82
|
+
buttonType: cta.buttonType,
|
|
83
|
+
children: cta.text
|
|
84
|
+
})
|
|
85
|
+
})]
|
|
86
|
+
}), featureList && featureList?.length > 0 && /*#__PURE__*/_jsx(FeatureList, {
|
|
87
|
+
featureList: featureList
|
|
88
|
+
})]
|
|
89
|
+
})
|
|
90
|
+
}), hasRightCoverImage && /*#__PURE__*/_jsx(Column, {
|
|
91
|
+
display: {
|
|
92
|
+
_: !showImageOnMobile ? 'none' : 'initial',
|
|
93
|
+
sm: 'initial'
|
|
94
|
+
},
|
|
95
|
+
size: {
|
|
96
|
+
_: 12,
|
|
97
|
+
md: 4,
|
|
98
|
+
lg: 6
|
|
99
|
+
},
|
|
100
|
+
height: "100%",
|
|
101
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
102
|
+
position: "relative",
|
|
103
|
+
width: "100%",
|
|
104
|
+
height: {
|
|
105
|
+
_: '400px',
|
|
106
|
+
md: '100%'
|
|
107
|
+
},
|
|
108
|
+
children: [rightCoverPattern && /*#__PURE__*/_jsx(Box, {
|
|
109
|
+
position: "absolute",
|
|
110
|
+
width: 125,
|
|
111
|
+
height: "calc(100% + 8rem)",
|
|
112
|
+
zIndex: 1,
|
|
113
|
+
left: "calc(50% - 4rem)",
|
|
114
|
+
top: "-4rem",
|
|
115
|
+
display: {
|
|
116
|
+
_: 'none',
|
|
117
|
+
xs: 'none',
|
|
118
|
+
sm: 'block'
|
|
119
|
+
},
|
|
120
|
+
children: /*#__PURE__*/_jsx(DotDense, {})
|
|
121
|
+
}), /*#__PURE__*/_jsx("img", {
|
|
122
|
+
style: {
|
|
123
|
+
width: '100%',
|
|
124
|
+
height: '100%',
|
|
125
|
+
objectFit: 'contain',
|
|
126
|
+
justifySelf: 'center',
|
|
127
|
+
position: 'absolute',
|
|
128
|
+
zIndex: 2
|
|
129
|
+
},
|
|
130
|
+
src: rightCoverImage.url,
|
|
131
|
+
alt: title || 'N/A'
|
|
132
|
+
})]
|
|
133
|
+
})
|
|
134
|
+
})]
|
|
135
|
+
});
|
|
136
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PageSingleFeature } from './PageSingleFeature';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
const getMediaWidth = (mediaType, textLength) => {
|
|
5
|
+
if (mediaType === 'video') {
|
|
6
|
+
return 5;
|
|
7
|
+
}
|
|
8
|
+
if (mediaType === 'image') {
|
|
9
|
+
return textLength === 'short' ? 6 : 3;
|
|
10
|
+
}
|
|
11
|
+
return undefined;
|
|
12
|
+
};
|
|
13
|
+
export const PageHero = ({
|
|
14
|
+
showImageOnMobile,
|
|
15
|
+
textLength = 'long',
|
|
16
|
+
...props
|
|
17
|
+
}) => /*#__PURE__*/_jsx(PageSingleFeature, {
|
|
18
|
+
...props,
|
|
19
|
+
isPageHeading: true,
|
|
20
|
+
hideImageOnMobile: !showImageOnMobile,
|
|
21
|
+
mediaWidth: getMediaWidth(props.media?.type, textLength)
|
|
22
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Box, FlexBox } from '@codecademy/gamut';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { CTA } from './CTA';
|
|
4
|
+
import { Description } from './Description';
|
|
5
|
+
import { Title } from './Title';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
export const PagePrefooter = ({
|
|
8
|
+
title,
|
|
9
|
+
desc,
|
|
10
|
+
cta,
|
|
11
|
+
onAnchorClick,
|
|
12
|
+
testId,
|
|
13
|
+
additionalCtas
|
|
14
|
+
}) => {
|
|
15
|
+
const SectionTitle = title && /*#__PURE__*/_jsx(Title, {
|
|
16
|
+
children: title
|
|
17
|
+
});
|
|
18
|
+
const Desc = desc && /*#__PURE__*/_jsx(Description, {
|
|
19
|
+
text: desc,
|
|
20
|
+
onAnchorClick: onAnchorClick
|
|
21
|
+
});
|
|
22
|
+
const hasAdditionalCtas = additionalCtas && additionalCtas.length > 0;
|
|
23
|
+
return cta ? /*#__PURE__*/_jsxs(FlexBox, {
|
|
24
|
+
"data-testid": testId,
|
|
25
|
+
flexDirection: {
|
|
26
|
+
_: 'column',
|
|
27
|
+
sm: 'row'
|
|
28
|
+
},
|
|
29
|
+
justifyContent: "space-between",
|
|
30
|
+
alignItems: {
|
|
31
|
+
sm: 'center'
|
|
32
|
+
},
|
|
33
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
34
|
+
flex: 1,
|
|
35
|
+
children: [SectionTitle, Desc]
|
|
36
|
+
}), /*#__PURE__*/_jsxs(FlexBox, {
|
|
37
|
+
mt: {
|
|
38
|
+
_: 32,
|
|
39
|
+
sm: 0
|
|
40
|
+
},
|
|
41
|
+
ml: {
|
|
42
|
+
sm: 32
|
|
43
|
+
},
|
|
44
|
+
gap: 16,
|
|
45
|
+
flexDirection: {
|
|
46
|
+
_: 'column',
|
|
47
|
+
md: 'row'
|
|
48
|
+
},
|
|
49
|
+
maxWidth: {
|
|
50
|
+
_: '100%',
|
|
51
|
+
sm: 'max-content'
|
|
52
|
+
},
|
|
53
|
+
children: [/*#__PURE__*/_jsx(CTA, {
|
|
54
|
+
href: cta.href,
|
|
55
|
+
onClick: cta.onClick,
|
|
56
|
+
buttonType: hasAdditionalCtas ? 'fill' : cta.buttonType,
|
|
57
|
+
children: cta.text
|
|
58
|
+
}, cta.text), hasAdditionalCtas ? additionalCtas.map(cta => {
|
|
59
|
+
if (!cta) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return /*#__PURE__*/_jsx(CTA, {
|
|
63
|
+
href: cta.href,
|
|
64
|
+
onClick: cta.onClick,
|
|
65
|
+
buttonType: "fill",
|
|
66
|
+
children: cta.text
|
|
67
|
+
}, cta.text);
|
|
68
|
+
}) : null]
|
|
69
|
+
})]
|
|
70
|
+
}) : /*#__PURE__*/_jsxs("div", {
|
|
71
|
+
"data-testid": testId,
|
|
72
|
+
children: [SectionTitle, Desc]
|
|
73
|
+
});
|
|
74
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { Anchor, Box, Column, FlexBox, LayoutGrid, Video } from '@codecademy/gamut';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { FeatureList } from '../FeatureList';
|
|
4
|
+
import { PausableImage } from '../PausableImage';
|
|
5
|
+
import { CTA } from './CTA';
|
|
6
|
+
import { Description } from './Description';
|
|
7
|
+
import { Title } from './Title';
|
|
8
|
+
import { TitleWithEyebrow } from './TitleWithEyebrow';
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
+
export const FeaturedImage = ({
|
|
11
|
+
src,
|
|
12
|
+
alt,
|
|
13
|
+
linkUrl,
|
|
14
|
+
hideImageOnMobile
|
|
15
|
+
}) => {
|
|
16
|
+
const Container = linkUrl ? Anchor : Box;
|
|
17
|
+
return /*#__PURE__*/_jsx(Container, {
|
|
18
|
+
display: {
|
|
19
|
+
_: hideImageOnMobile ? 'none' : 'initial',
|
|
20
|
+
sm: 'initial'
|
|
21
|
+
},
|
|
22
|
+
href: linkUrl,
|
|
23
|
+
width: 1,
|
|
24
|
+
tabIndex: linkUrl ? 0 : undefined,
|
|
25
|
+
children: /*#__PURE__*/_jsx(PausableImage, {
|
|
26
|
+
src: src,
|
|
27
|
+
alt: alt,
|
|
28
|
+
"data-testid": "feature-image"
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export const PageSingleFeature = ({
|
|
33
|
+
cta,
|
|
34
|
+
desc,
|
|
35
|
+
eyebrow,
|
|
36
|
+
hideImageOnMobile,
|
|
37
|
+
isPageHeading,
|
|
38
|
+
media,
|
|
39
|
+
mediaWidth = 6,
|
|
40
|
+
onAnchorClick,
|
|
41
|
+
testId,
|
|
42
|
+
title,
|
|
43
|
+
additionalCtas,
|
|
44
|
+
featureList
|
|
45
|
+
}) => {
|
|
46
|
+
const hasAdditionalCtas = additionalCtas && additionalCtas.length > 0;
|
|
47
|
+
const primaryContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
48
|
+
children: [title && (eyebrow ? /*#__PURE__*/_jsx(TitleWithEyebrow, {
|
|
49
|
+
title: title,
|
|
50
|
+
eyebrow: eyebrow,
|
|
51
|
+
isPageHeading: isPageHeading
|
|
52
|
+
}) : /*#__PURE__*/_jsx(Title, {
|
|
53
|
+
isPageHeading: isPageHeading,
|
|
54
|
+
children: title
|
|
55
|
+
})), desc && /*#__PURE__*/_jsx(Description, {
|
|
56
|
+
text: desc,
|
|
57
|
+
onAnchorClick: onAnchorClick
|
|
58
|
+
}), cta && /*#__PURE__*/_jsxs(FlexBox, {
|
|
59
|
+
mt: 32,
|
|
60
|
+
gap: 16,
|
|
61
|
+
flexDirection: {
|
|
62
|
+
_: 'column',
|
|
63
|
+
sm: cta.buttonType === 'fill' && mediaWidth < 5 ? 'row' : 'column',
|
|
64
|
+
md: 'row'
|
|
65
|
+
},
|
|
66
|
+
maxWidth: {
|
|
67
|
+
_: '100%',
|
|
68
|
+
sm: 'max-content'
|
|
69
|
+
},
|
|
70
|
+
children: [/*#__PURE__*/_jsx(CTA, {
|
|
71
|
+
href: cta.href,
|
|
72
|
+
onClick: cta.onClick,
|
|
73
|
+
buttonType: hasAdditionalCtas ? 'fill' : cta.buttonType,
|
|
74
|
+
children: cta.text
|
|
75
|
+
}, cta.text), hasAdditionalCtas ? additionalCtas.map(cta => {
|
|
76
|
+
if (!cta) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
return /*#__PURE__*/_jsx(CTA, {
|
|
80
|
+
href: cta.href,
|
|
81
|
+
onClick: cta.onClick,
|
|
82
|
+
buttonType: "fill",
|
|
83
|
+
children: cta.text
|
|
84
|
+
}, cta.text);
|
|
85
|
+
}) : null]
|
|
86
|
+
}), featureList && /*#__PURE__*/_jsx(FeatureList, {
|
|
87
|
+
featureList: featureList
|
|
88
|
+
})]
|
|
89
|
+
});
|
|
90
|
+
if (!media) {
|
|
91
|
+
return /*#__PURE__*/_jsx("div", {
|
|
92
|
+
"data-testid": testId,
|
|
93
|
+
children: primaryContent
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
const textWidth = 12 - mediaWidth;
|
|
97
|
+
return /*#__PURE__*/_jsxs(LayoutGrid, {
|
|
98
|
+
"data-testid": testId,
|
|
99
|
+
rowGap: 16,
|
|
100
|
+
columnGap: {
|
|
101
|
+
_: 8,
|
|
102
|
+
sm: 32
|
|
103
|
+
},
|
|
104
|
+
children: [/*#__PURE__*/_jsx(Column, {
|
|
105
|
+
size: {
|
|
106
|
+
sm: textWidth
|
|
107
|
+
},
|
|
108
|
+
alignContent: "flex-start",
|
|
109
|
+
alignSelf: !desc ? 'center' : 'flex-start',
|
|
110
|
+
children: primaryContent
|
|
111
|
+
}), /*#__PURE__*/_jsxs(Column, {
|
|
112
|
+
size: {
|
|
113
|
+
sm: mediaWidth
|
|
114
|
+
},
|
|
115
|
+
gridRowStart: {
|
|
116
|
+
_: hideImageOnMobile ? 'initial' : 1,
|
|
117
|
+
sm: 'initial'
|
|
118
|
+
},
|
|
119
|
+
alignContent: "flex-start",
|
|
120
|
+
children: [media.type === 'image' && /*#__PURE__*/_jsx(FeaturedImage, {
|
|
121
|
+
...media,
|
|
122
|
+
hideImageOnMobile: hideImageOnMobile
|
|
123
|
+
}), media.type === 'video' && /*#__PURE__*/_jsx(Video, {
|
|
124
|
+
...media
|
|
125
|
+
})]
|
|
126
|
+
})]
|
|
127
|
+
});
|
|
128
|
+
};
|