@4alldigital/foundation-ui--core 3.0.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/LICENSE.txt +21 -0
- package/package.json +35 -0
- package/src/__mocks__/_examples/cnbc.ts +146 -0
- package/src/__mocks__/_examples/nrg.ts +222 -0
- package/src/__mocks__/empty-module.js +0 -0
- package/src/__mocks__/fileMock.js +3 -0
- package/src/__mocks__/fileTransformer.js +8 -0
- package/src/__mocks__/mockSearchData.js +511 -0
- package/src/__mocks__/nrglogo.svg +74 -0
- package/src/__mocks__/styleMock.js +3 -0
- package/src/__mocks__/tempPolyFills.js +5 -0
- package/src/components/Accordion/Accordion.stories.tsx +33 -0
- package/src/components/Accordion/Accordion.tsx +53 -0
- package/src/components/Accordion/Accordion.types.ts +8 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/AnimationCounter/AnimationCounter.stories.tsx +22 -0
- package/src/components/AnimationCounter/AnimationCounter.tsx +51 -0
- package/src/components/AnimationCounter/AnimationCounter.types.ts +10 -0
- package/src/components/AnimationCounter/index.ts +1 -0
- package/src/components/AnimationSet1/AnimationSet1.stories.tsx +36 -0
- package/src/components/AnimationSet1/AnimationSet1.tsx +107 -0
- package/src/components/AnimationSet1/AnimationSet1.types.ts +12 -0
- package/src/components/AnimationSet1/index.ts +1 -0
- package/src/components/Authenticator/Authenticator.stories.tsx +37 -0
- package/src/components/Authenticator/Authenticator.tsx +84 -0
- package/src/components/Authenticator/Authenticator.types.ts +7 -0
- package/src/components/Authenticator/index.ts +1 -0
- package/src/components/Avatar/Avatar.stories.tsx +26 -0
- package/src/components/Avatar/Avatar.tsx +88 -0
- package/src/components/Avatar/Avatar.types.ts +8 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Banner/Banner.stories.tsx +59 -0
- package/src/components/Banner/Banner.tsx +60 -0
- package/src/components/Banner/Banner.types.ts +9 -0
- package/src/components/Banner/index.ts +1 -0
- package/src/components/Blockquote/Blockquote.stories.tsx +20 -0
- package/src/components/Blockquote/Blockquote.tsx +32 -0
- package/src/components/Blockquote/Blockquote.types.ts +8 -0
- package/src/components/Blockquote/index.ts +1 -0
- package/src/components/Button/Button.stories.tsx +50 -0
- package/src/components/Button/Button.tsx +117 -0
- package/src/components/Button/Button.types.ts +43 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/ButtonGroup/ButtonGroup.stories.tsx +59 -0
- package/src/components/ButtonGroup/ButtonGroup.tsx +35 -0
- package/src/components/ButtonGroup/ButtonGroup.types.ts +5 -0
- package/src/components/ButtonGroup/index.ts +1 -0
- package/src/components/Calendar/Calendar.stories.tsx +100 -0
- package/src/components/Calendar/Calendar.tsx +91 -0
- package/src/components/Calendar/Calendar.types.ts +10 -0
- package/src/components/Calendar/index.ts +2 -0
- package/src/components/Card/Card.stories.tsx +487 -0
- package/src/components/Card/Card.tsx +32 -0
- package/src/components/Card/Card.types.ts +79 -0
- package/src/components/Card/constants/index.ts +8 -0
- package/src/components/Card/index.ts +1 -0
- package/src/components/Card/types/CardBasic/CardBasic.tsx +262 -0
- package/src/components/Card/types/CardBasic/CardBasic.types.ts +7 -0
- package/src/components/Card/types/CardBasic/index.ts +1 -0
- package/src/components/Card/types/CardData/CardData.tsx +68 -0
- package/src/components/Card/types/CardData/CardData.types.ts +21 -0
- package/src/components/Card/types/CardData/index.ts +1 -0
- package/src/components/Card/types/CardHorz/CardHorz.tsx +80 -0
- package/src/components/Card/types/CardHorz/CardHorz.types.ts +8 -0
- package/src/components/Card/types/CardHorz/index.ts +1 -0
- package/src/components/Card/types/CardIcon/CardIcon.tsx +76 -0
- package/src/components/Card/types/CardIcon/CardIcon.types.ts +8 -0
- package/src/components/Card/types/CardIcon/index.ts +1 -0
- package/src/components/Card/types/CardMedia/CardMedia.tsx +277 -0
- package/src/components/Card/types/CardMedia/CardMedia.types.ts +5 -0
- package/src/components/Card/types/CardMedia/index.ts +1 -0
- package/src/components/Card/types/CardVideo/CardVideo.tsx +262 -0
- package/src/components/Card/types/CardVideo/CardVideo.types.ts +11 -0
- package/src/components/Card/types/CardVideo/index.ts +1 -0
- package/src/components/CardGrid/CardGrid.stories.tsx +122 -0
- package/src/components/CardGrid/CardGrid.tsx +25 -0
- package/src/components/CardGrid/CardGrid.types.ts +7 -0
- package/src/components/CardGrid/index.ts +1 -0
- package/src/components/Carousel/Carousel.stories.tsx +351 -0
- package/src/components/Carousel/Carousel.tsx +174 -0
- package/src/components/Carousel/Carousel.types.ts +32 -0
- package/src/components/Carousel/MIGRATION.md +156 -0
- package/src/components/Carousel/index.ts +1 -0
- package/src/components/Cart/Cart.stories.tsx +92 -0
- package/src/components/Cart/Cart.tsx +194 -0
- package/src/components/Cart/Cart.types.ts +4 -0
- package/src/components/Cart/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +18 -0
- package/src/components/Checkbox/Checkbox.tsx +38 -0
- package/src/components/Checkbox/Checkbox.types.ts +15 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Chip/Chip.stories.tsx +37 -0
- package/src/components/Chip/Chip.tsx +104 -0
- package/src/components/Chip/Chip.types.ts +13 -0
- package/src/components/Chip/index.ts +1 -0
- package/src/components/Collapsible/Collapsible.stories.tsx +139 -0
- package/src/components/Collapsible/Collapsible.tsx +75 -0
- package/src/components/Collapsible/Collapsible.types.ts +14 -0
- package/src/components/Collapsible/index.ts +3 -0
- package/src/components/Container/Container.stories.tsx +17 -0
- package/src/components/Container/Container.tsx +51 -0
- package/src/components/Container/Container.types.ts +17 -0
- package/src/components/Container/index.ts +1 -0
- package/src/components/ContentPageLayout/ContentPageLayout.stories.tsx +17 -0
- package/src/components/ContentPageLayout/ContentPageLayout.tsx +38 -0
- package/src/components/ContentPageLayout/ContentPageLayout.types.ts +17 -0
- package/src/components/ContentPageLayout/index.ts +1 -0
- package/src/components/ContentRowsLayout/ContentRowsLayout.stories.tsx +19 -0
- package/src/components/ContentRowsLayout/ContentRowsLayout.tsx +30 -0
- package/src/components/ContentRowsLayout/ContentRowsLayout.types.ts +15 -0
- package/src/components/ContentRowsLayout/index.ts +1 -0
- package/src/components/Copy/Copy.stories.tsx +28 -0
- package/src/components/Copy/Copy.tsx +43 -0
- package/src/components/Copy/Copy.types.tsx +53 -0
- package/src/components/Copy/index.tsx +1 -0
- package/src/components/DisplayHeading/DisplayHeading.stories.tsx +17 -0
- package/src/components/DisplayHeading/DisplayHeading.tsx +43 -0
- package/src/components/DisplayHeading/DisplayHeading.types.ts +8 -0
- package/src/components/DisplayHeading/index.ts +1 -0
- package/src/components/FileUpload/FileUpload.stories.tsx +18 -0
- package/src/components/FileUpload/FileUpload.tsx +41 -0
- package/src/components/FileUpload/FileUpload.types.ts +9 -0
- package/src/components/FileUpload/index.ts +1 -0
- package/src/components/Footer/Footer.stories.tsx +17 -0
- package/src/components/Footer/Footer.tsx +78 -0
- package/src/components/Footer/Footer.types.ts +4 -0
- package/src/components/Footer/index.ts +1 -0
- package/src/components/Form/Form.stories.tsx +81 -0
- package/src/components/Form/Form.tsx +98 -0
- package/src/components/Form/Form.types.ts +34 -0
- package/src/components/Form/index.ts +1 -0
- package/src/components/FormField/FormField.stories.tsx +205 -0
- package/src/components/FormField/FormField.tsx +258 -0
- package/src/components/FormField/FormField.types.ts +89 -0
- package/src/components/FormField/index.ts +1 -0
- package/src/components/FormSelect/FormSelect.stories.tsx +27 -0
- package/src/components/FormSelect/FormSelect.tsx +46 -0
- package/src/components/FormSelect/FormSelect.types.ts +45 -0
- package/src/components/FormSelect/index.ts +1 -0
- package/src/components/FullContentBackgroundImage/FullContentBackgroundImage.stories.tsx +18 -0
- package/src/components/FullContentBackgroundImage/FullContentBackgroundImage.tsx +26 -0
- package/src/components/FullContentBackgroundImage/FullContentBackgroundImage.types.ts +6 -0
- package/src/components/FullContentBackgroundImage/index.ts +1 -0
- package/src/components/FullScreenVideoModal/FullScreenVideoModal.stories.tsx +34 -0
- package/src/components/FullScreenVideoModal/FullScreenVideoModal.tsx +41 -0
- package/src/components/FullScreenVideoModal/FullScreenVideoModal.types.ts +9 -0
- package/src/components/FullScreenVideoModal/index.ts +1 -0
- package/src/components/Header/Header.stories.tsx +51 -0
- package/src/components/Header/Header.tsx +170 -0
- package/src/components/Header/Header.types.ts +11 -0
- package/src/components/Header/index.ts +1 -0
- package/src/components/Heading/Heading.stories.tsx +57 -0
- package/src/components/Heading/Heading.tsx +47 -0
- package/src/components/Heading/Heading.types.ts +35 -0
- package/src/components/Heading/index.ts +1 -0
- package/src/components/Hero/Hero.stories.tsx +17 -0
- package/src/components/Hero/Hero.tsx +28 -0
- package/src/components/Hero/Hero.types.ts +17 -0
- package/src/components/Hero/index.ts +1 -0
- package/src/components/Hr/Hr.stories.tsx +13 -0
- package/src/components/Hr/Hr.tsx +16 -0
- package/src/components/Hr/Hr.types.ts +3 -0
- package/src/components/Hr/index.ts +1 -0
- package/src/components/HtmlContent/HtmlContent.stories.tsx +29 -0
- package/src/components/HtmlContent/HtmlContent.tsx +36 -0
- package/src/components/HtmlContent/HtmlContent.types.ts +6 -0
- package/src/components/HtmlContent/index.ts +1 -0
- package/src/components/Icon/Icon.stories.tsx +26 -0
- package/src/components/Icon/Icon.tsx +24 -0
- package/src/components/Icon/Icon.types.ts +8 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/Image/Image.stories.tsx +32 -0
- package/src/components/Image/Image.tsx +71 -0
- package/src/components/Image/Image.types.ts +20 -0
- package/src/components/Image/index.ts +1 -0
- package/src/components/Label/Label.stories.tsx +18 -0
- package/src/components/Label/Label.tsx +17 -0
- package/src/components/Label/Label.types.ts +9 -0
- package/src/components/Label/index.ts +1 -0
- package/src/components/Link/Link.stories.tsx +25 -0
- package/src/components/Link/Link.tsx +85 -0
- package/src/components/Link/Link.types.ts +14 -0
- package/src/components/Link/index.ts +1 -0
- package/src/components/List/List.stories.tsx +38 -0
- package/src/components/List/List.tsx +17 -0
- package/src/components/List/List.types.ts +27 -0
- package/src/components/List/index.ts +1 -0
- package/src/components/ListItem/ListItem.stories.tsx +61 -0
- package/src/components/ListItem/ListItem.tsx +53 -0
- package/src/components/ListItem/ListItem.types.ts +10 -0
- package/src/components/ListItem/index.ts +1 -0
- package/src/components/Loader/Loader.stories.tsx +17 -0
- package/src/components/Loader/Loader.tsx +34 -0
- package/src/components/Loader/Loader.types.ts +5 -0
- package/src/components/Loader/index.ts +1 -0
- package/src/components/Logo/Logo.stories.tsx +17 -0
- package/src/components/Logo/Logo.tsx +17 -0
- package/src/components/Logo/Logo.types.ts +6 -0
- package/src/components/Logo/index.ts +1 -0
- package/src/components/Menu/Menu.stories.tsx +37 -0
- package/src/components/Menu/Menu.tsx +45 -0
- package/src/components/Menu/Menu.types.ts +15 -0
- package/src/components/Menu/index.ts +1 -0
- package/src/components/Notice/Notice.stories.tsx +49 -0
- package/src/components/Notice/Notice.tsx +63 -0
- package/src/components/Notice/Notice.types.ts +11 -0
- package/src/components/Notice/index.ts +1 -0
- package/src/components/OTPInput/OTPInput.stories.tsx +18 -0
- package/src/components/OTPInput/OTPInput.tsx +80 -0
- package/src/components/OTPInput/OTPInput.types.ts +8 -0
- package/src/components/OTPInput/index.ts +1 -0
- package/src/components/PanelCards/PanelCards.stories.tsx +125 -0
- package/src/components/PanelCards/PanelCards.tsx +81 -0
- package/src/components/PanelCards/PanelCards.types.ts +11 -0
- package/src/components/PanelCards/index.ts +1 -0
- package/src/components/PanelCustom/PanelCustom.stories.tsx +18 -0
- package/src/components/PanelCustom/PanelCustom.tsx +39 -0
- package/src/components/PanelCustom/PanelCustom.types.ts +20 -0
- package/src/components/PanelCustom/index.ts +1 -0
- package/src/components/PanelFeature/PanelFeature.stories.tsx +46 -0
- package/src/components/PanelFeature/PanelFeature.tsx +83 -0
- package/src/components/PanelFeature/PanelFeature.types.ts +27 -0
- package/src/components/PanelFeature/index.ts +1 -0
- package/src/components/PanelHero/PanelHero.stories.tsx +126 -0
- package/src/components/PanelHero/PanelHero.tsx +184 -0
- package/src/components/PanelHero/PanelHero.types.ts +19 -0
- package/src/components/PanelHero/index.ts +1 -0
- package/src/components/PanelIntro/PanelIntro.stories.tsx +38 -0
- package/src/components/PanelIntro/PanelIntro.tsx +139 -0
- package/src/components/PanelIntro/PanelIntro.types.ts +19 -0
- package/src/components/PanelIntro/index.ts +1 -0
- package/src/components/PanelProduct/PanelProduct.stories.tsx +24 -0
- package/src/components/PanelProduct/PanelProduct.tsx +87 -0
- package/src/components/PanelProduct/PanelProduct.types.ts +14 -0
- package/src/components/PanelProduct/index.ts +1 -0
- package/src/components/PanelScroller/PanelScroller.stories.tsx +81 -0
- package/src/components/PanelScroller/PanelScroller.tsx +58 -0
- package/src/components/PanelScroller/PanelScroller.types.ts +8 -0
- package/src/components/PanelScroller/index.ts +1 -0
- package/src/components/PanelVideo/PanelVideo.stories.tsx +42 -0
- package/src/components/PanelVideo/PanelVideo.tsx +81 -0
- package/src/components/PanelVideo/PanelVideo.types.ts +11 -0
- package/src/components/PanelVideo/index.ts +1 -0
- package/src/components/Radio/Radio.stories.tsx +24 -0
- package/src/components/Radio/Radio.tsx +44 -0
- package/src/components/Radio/Radio.types.ts +13 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/Schedule/Schedule.stories.tsx +96 -0
- package/src/components/Schedule/Schedule.tsx +118 -0
- package/src/components/Schedule/Schedule.types.ts +64 -0
- package/src/components/Schedule/index.ts +1 -0
- package/src/components/ScheduleItem/ScheduleItem.stories.tsx +21 -0
- package/src/components/ScheduleItem/ScheduleItem.tsx +77 -0
- package/src/components/ScheduleItem/ScheduleItem.types.ts +8 -0
- package/src/components/ScheduleItem/index.ts +1 -0
- package/src/components/Screen/Screen.stories.tsx +27 -0
- package/src/components/Screen/Screen.tsx +63 -0
- package/src/components/Screen/Screen.types.ts +16 -0
- package/src/components/Screen/index.ts +1 -0
- package/src/components/ShadcnButton/ShadcnButton.tsx +57 -0
- package/src/components/ShadcnButton/index.ts +2 -0
- package/src/components/ShadcnCarousel/ShadcnCarousel.tsx +261 -0
- package/src/components/ShadcnCarousel/index.ts +9 -0
- package/src/components/Share/Share.stories.tsx +17 -0
- package/src/components/Share/Share.tsx +60 -0
- package/src/components/Share/Share.types.ts +12 -0
- package/src/components/Share/index.ts +1 -0
- package/src/components/SubscriptionManager/SubscriptionManager.stories.tsx +177 -0
- package/src/components/SubscriptionManager/SubscriptionManager.tsx +369 -0
- package/src/components/SubscriptionManager/SubscriptionManager.types.ts +36 -0
- package/src/components/SubscriptionManager/index.ts +1 -0
- package/src/components/Switch/Switch.stories.tsx +20 -0
- package/src/components/Switch/Switch.tsx +30 -0
- package/src/components/Switch/Switch.types.ts +7 -0
- package/src/components/Switch/index.ts +1 -0
- package/src/components/Tabs/Tabs.stories.tsx +34 -0
- package/src/components/Tabs/Tabs.tsx +42 -0
- package/src/components/Tabs/Tabs.types.ts +8 -0
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/TextInput/TextInput.stories.tsx +18 -0
- package/src/components/TextInput/TextInput.tsx +78 -0
- package/src/components/TextInput/TextInput.types.ts +81 -0
- package/src/components/TextInput/index.ts +1 -0
- package/src/components/Video/Video.stories.tsx +75 -0
- package/src/components/Video/Video.tsx +280 -0
- package/src/components/Video/Video.types.ts +147 -0
- package/src/components/Video/index.ts +1 -0
- package/src/components/VisitUs/VisitUs.stories.tsx +32 -0
- package/src/components/VisitUs/VisitUs.tsx +56 -0
- package/src/components/VisitUs/VisitUs.types.ts +13 -0
- package/src/components/VisitUs/index.ts +1 -0
- package/src/components/index.ts +143 -0
- package/src/constants/index.ts +6 -0
- package/src/context/Amplify/index.tsx +65 -0
- package/src/context/App/index.tsx +93 -0
- package/src/context/Cart/index.tsx +64 -0
- package/src/context/ExampleContext/index.tsx +34 -0
- package/src/context/Theme/index.tsx +37 -0
- package/src/context/index.ts +18 -0
- package/src/features/Search/Search.stories.tsx +395 -0
- package/src/features/Search/Search.tsx +204 -0
- package/src/features/Search/Search.types.ts +41 -0
- package/src/features/Search/config/config-helper.ts +219 -0
- package/src/features/Search/index.ts +1 -0
- package/src/features/Search/view-helpers/appendClassName.ts +14 -0
- package/src/features/Search/view-helpers/formatResult.ts +97 -0
- package/src/features/Search/view-helpers/getFilterValueDisplay.ts +10 -0
- package/src/features/Search/view-helpers/getUrlSanitizer.ts +23 -0
- package/src/features/Search/view-helpers/index.ts +4 -0
- package/src/features/Search/views/Layout/Layout.tsx +50 -0
- package/src/features/Search/views/Layout/Layout.types.ts +13 -0
- package/src/features/Search/views/Layout/index.ts +1 -0
- package/src/features/Search/views/MultiCheckboxFacet/MultiCheckboxFacet.tsx +85 -0
- package/src/features/Search/views/MultiCheckboxFacet/MultiCheckboxFacet.types.ts +5 -0
- package/src/features/Search/views/MultiCheckboxFacet/index.ts +1 -0
- package/src/features/Search/views/Paging/Paging.tsx +35 -0
- package/src/features/Search/views/Paging/Paging.types.ts +24 -0
- package/src/features/Search/views/Paging/index.ts +1 -0
- package/src/features/Search/views/PagingInfo/PagingInfo.tsx +34 -0
- package/src/features/Search/views/PagingInfo/PagingInfo.types.ts +26 -0
- package/src/features/Search/views/PagingInfo/index.ts +1 -0
- package/src/features/Search/views/Result/Result.tsx +84 -0
- package/src/features/Search/views/Result/Result.types.ts +47 -0
- package/src/features/Search/views/Result/index.ts +1 -0
- package/src/features/Search/views/Results/Results.tsx +16 -0
- package/src/features/Search/views/Results/Results.types.ts +24 -0
- package/src/features/Search/views/Results/index.ts +1 -0
- package/src/features/Search/views/ResultsPerPage/ResultsPerPage.tsx +32 -0
- package/src/features/Search/views/ResultsPerPage/ResultsPerPage.types.ts +26 -0
- package/src/features/Search/views/ResultsPerPage/index.ts +1 -0
- package/src/features/Search/views/SearchBox/SearchBox.tsx +51 -0
- package/src/features/Search/views/SearchBox/SearchBox.types.ts +10 -0
- package/src/features/Search/views/SearchBox/index.ts +1 -0
- package/src/features/Search/views/Sidebar/Sidebar.tsx +14 -0
- package/src/features/Search/views/Sidebar/Sidebar.types.ts +3 -0
- package/src/features/Search/views/Sidebar/index.ts +1 -0
- package/src/features/Search/views/SingleLinksFacet/SingleLinksFacet.tsx +62 -0
- package/src/features/Search/views/SingleLinksFacet/SingleLinksFacet.types.ts +5 -0
- package/src/features/Search/views/SingleLinksFacet/index.ts +1 -0
- package/src/features/Search/views/SingleSelectFacet/SingleSelectFacet.tsx +34 -0
- package/src/features/Search/views/SingleSelectFacet/SingleSelectFacet.types.ts +5 -0
- package/src/features/Search/views/SingleSelectFacet/index.ts +1 -0
- package/src/features/Search/views/Sorting/Sorting.tsx +24 -0
- package/src/features/Search/views/Sorting/Sorting.types.ts +25 -0
- package/src/features/Search/views/Sorting/index.ts +1 -0
- package/src/features/index.ts +11 -0
- package/src/forms/ForgotPasswordForm/ForgotPasswordForm.stories.tsx +19 -0
- package/src/forms/ForgotPasswordForm/ForgotPasswordForm.tsx +28 -0
- package/src/forms/ForgotPasswordForm/ForgotPasswordForm.types.ts +3 -0
- package/src/forms/ForgotPasswordForm/index.ts +1 -0
- package/src/forms/LoginForm/LoginForm.stories.tsx +67 -0
- package/src/forms/LoginForm/LoginForm.tsx +112 -0
- package/src/forms/LoginForm/LoginForm.types.ts +7 -0
- package/src/forms/LoginForm/index.ts +1 -0
- package/src/forms/ProfileForm/ProfileForm.stories.tsx +23 -0
- package/src/forms/ProfileForm/ProfileForm.tsx +40 -0
- package/src/forms/ProfileForm/ProfileForm.types.ts +6 -0
- package/src/forms/ProfileForm/index.ts +1 -0
- package/src/forms/PromoCodeForm/PromoCodeForm.stories.tsx +19 -0
- package/src/forms/PromoCodeForm/PromoCodeForm.tsx +22 -0
- package/src/forms/PromoCodeForm/PromoCodeForm.types.ts +4 -0
- package/src/forms/PromoCodeForm/index.ts +1 -0
- package/src/forms/RegisterForm/RegisterForm.stories.tsx +85 -0
- package/src/forms/RegisterForm/RegisterForm.tsx +108 -0
- package/src/forms/RegisterForm/RegisterForm.types.ts +6 -0
- package/src/forms/RegisterForm/index.ts +1 -0
- package/src/forms/ResetPasswordAuthForm/ResetPasswordAuthForm.stories.tsx +23 -0
- package/src/forms/ResetPasswordAuthForm/ResetPasswordAuthForm.tsx +39 -0
- package/src/forms/ResetPasswordAuthForm/ResetPasswordAuthForm.types.ts +3 -0
- package/src/forms/ResetPasswordAuthForm/index.ts +1 -0
- package/src/forms/ResetPasswordForm/ResetPasswordForm.stories.tsx +23 -0
- package/src/forms/ResetPasswordForm/ResetPasswordForm.tsx +30 -0
- package/src/forms/ResetPasswordForm/ResetPasswordForm.types.ts +3 -0
- package/src/forms/ResetPasswordForm/index.ts +1 -0
- package/src/forms/SubscriptionForm/SubscriptionForm.stories.tsx +31 -0
- package/src/forms/SubscriptionForm/SubscriptionForm.tsx +46 -0
- package/src/forms/SubscriptionForm/SubscriptionForm.types.ts +6 -0
- package/src/forms/SubscriptionForm/index.ts +1 -0
- package/src/forms/constants/index.ts +13 -0
- package/src/forms/index.ts +17 -0
- package/src/forms/validations/index.ts +39 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useLanguage.ts +18 -0
- package/src/hooks/useTheme.ts +6 -0
- package/src/index.ts +8 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/setupTests.ts +5 -0
- package/src/templates/AccountScreen/AccountScreen.stories.tsx +67 -0
- package/src/templates/AccountScreen/AccountScreen.tsx +78 -0
- package/src/templates/AccountScreen/AccountScreen.types.ts +31 -0
- package/src/templates/AccountScreen/index.ts +1 -0
- package/src/templates/AuthScreen/AuthScreen.stories.tsx +33 -0
- package/src/templates/AuthScreen/AuthScreen.tsx +21 -0
- package/src/templates/AuthScreen/AuthScreen.types.ts +8 -0
- package/src/templates/AuthScreen/index.ts +1 -0
- package/src/templates/CardGridScreen/CardGridScreen.stories.tsx +95 -0
- package/src/templates/CardGridScreen/CardGridScreen.tsx +43 -0
- package/src/templates/CardGridScreen/CardGridScreen.types.ts +11 -0
- package/src/templates/CardGridScreen/index.ts +1 -0
- package/src/templates/CatalogueScreen/CatalogueScreen.stories.tsx +31 -0
- package/src/templates/CatalogueScreen/CatalogueScreen.tsx +21 -0
- package/src/templates/CatalogueScreen/CatalogueScreen.types.ts +8 -0
- package/src/templates/CatalogueScreen/index.ts +1 -0
- package/src/templates/ChallengeLibraryScreen/ChallengeLibraryScreen.stories.tsx +171 -0
- package/src/templates/ChallengeLibraryScreen/ChallengeLibraryScreen.tsx +36 -0
- package/src/templates/ChallengeLibraryScreen/ChallengeLibraryScreen.types.ts +9 -0
- package/src/templates/ChallengeLibraryScreen/index.ts +1 -0
- package/src/templates/ChallengeScreen/ChallengeScreen.stories.tsx +65 -0
- package/src/templates/ChallengeScreen/ChallengeScreen.tsx +88 -0
- package/src/templates/ChallengeScreen/ChallengeScreen.types.ts +22 -0
- package/src/templates/ChallengeScreen/index.ts +1 -0
- package/src/templates/ContentScreen/ContentScreen.stories.tsx +71 -0
- package/src/templates/ContentScreen/ContentScreen.tsx +55 -0
- package/src/templates/ContentScreen/ContentScreen.types.ts +9 -0
- package/src/templates/ContentScreen/index.ts +1 -0
- package/src/templates/DashboardScreen/DashboardScreen.stories.tsx +490 -0
- package/src/templates/DashboardScreen/DashboardScreen.tsx +156 -0
- package/src/templates/DashboardScreen/DashboardScreen.types.ts +28 -0
- package/src/templates/DashboardScreen/index.ts +1 -0
- package/src/templates/FAQScreen/FAQScreen.stories.tsx +278 -0
- package/src/templates/FAQScreen/FAQScreen.tsx +32 -0
- package/src/templates/FAQScreen/FAQScreen.types.ts +14 -0
- package/src/templates/FAQScreen/index.ts +1 -0
- package/src/templates/HomeScreen/HomeScreen.stories.tsx +315 -0
- package/src/templates/HomeScreen/HomeScreen.tsx +50 -0
- package/src/templates/HomeScreen/HomeScreen.types.ts +23 -0
- package/src/templates/HomeScreen/index.ts +1 -0
- package/src/templates/LogoutScreen/LogoutScreen.stories.tsx +20 -0
- package/src/templates/LogoutScreen/LogoutScreen.tsx +25 -0
- package/src/templates/LogoutScreen/LogoutScreen.types.ts +4 -0
- package/src/templates/LogoutScreen/index.ts +1 -0
- package/src/templates/MenuScreen/MenuScreen.stories.tsx +36 -0
- package/src/templates/MenuScreen/MenuScreen.tsx +32 -0
- package/src/templates/MenuScreen/MenuScreen.types.ts +11 -0
- package/src/templates/MenuScreen/index.ts +1 -0
- package/src/templates/NotFoundScreen/NotFoundScreen.stories.tsx +20 -0
- package/src/templates/NotFoundScreen/NotFoundScreen.tsx +31 -0
- package/src/templates/NotFoundScreen/NotFoundScreen.types.ts +5 -0
- package/src/templates/NotFoundScreen/index.ts +1 -0
- package/src/templates/PasswordResetAuthScreen/PasswordResetAuthScreen.stories.tsx +27 -0
- package/src/templates/PasswordResetAuthScreen/PasswordResetAuthScreen.tsx +20 -0
- package/src/templates/PasswordResetAuthScreen/PasswordResetAuthScreen.types.ts +6 -0
- package/src/templates/PasswordResetAuthScreen/index.ts +1 -0
- package/src/templates/PasswordResetScreen/PasswordResetScreen.stories.tsx +22 -0
- package/src/templates/PasswordResetScreen/PasswordResetScreen.tsx +19 -0
- package/src/templates/PasswordResetScreen/PasswordResetScreen.types.ts +6 -0
- package/src/templates/PasswordResetScreen/index.ts +1 -0
- package/src/templates/ProfileScreen/ProfileScreen.stories.tsx +41 -0
- package/src/templates/ProfileScreen/ProfileScreen.tsx +30 -0
- package/src/templates/ProfileScreen/ProfileScreen.types.ts +24 -0
- package/src/templates/ProfileScreen/index.ts +1 -0
- package/src/templates/ScheduleScreen/ScheduleScreen.stories.tsx +174 -0
- package/src/templates/ScheduleScreen/ScheduleScreen.tsx +29 -0
- package/src/templates/ScheduleScreen/ScheduleScreen.types.ts +9 -0
- package/src/templates/ScheduleScreen/index.ts +1 -0
- package/src/templates/SubscriptionScreen/SubscriptionScreen.stories.tsx +98 -0
- package/src/templates/SubscriptionScreen/SubscriptionScreen.tsx +49 -0
- package/src/templates/SubscriptionScreen/SubscriptionScreen.types.ts +28 -0
- package/src/templates/SubscriptionScreen/index.ts +1 -0
- package/src/templates/WorkoutScreen/WorkoutScreen.stories.tsx +173 -0
- package/src/templates/WorkoutScreen/WorkoutScreen.tsx +230 -0
- package/src/templates/WorkoutScreen/WorkoutScreen.types.ts +34 -0
- package/src/templates/WorkoutScreen/index.ts +1 -0
- package/src/templates/index.ts +40 -0
- package/src/translations/en.ts +777 -0
- package/src/translations/fr.ts +182 -0
- package/src/translations/index.ts +2 -0
- package/src/utils/htmlParser/index.tsx +22 -0
- package/src/utils/index.ts +38 -0
- package/src/utils/parseDuration/index.ts +94 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import { Props } from './PanelFeature.types';
|
|
4
|
+
import AnimationSet1 from '../AnimationSet1';
|
|
5
|
+
import DisplayHeading from '../DisplayHeading';
|
|
6
|
+
import Copy from '../Copy';
|
|
7
|
+
import Button from '../Button';
|
|
8
|
+
import Chip from '../Chip';
|
|
9
|
+
import Container from '../Container';
|
|
10
|
+
import { SPACING } from '../Hero/Hero.types';
|
|
11
|
+
import { ChipVariant } from '../Chip/Chip.types';
|
|
12
|
+
|
|
13
|
+
const PanelFeature = ({
|
|
14
|
+
testID,
|
|
15
|
+
title,
|
|
16
|
+
description,
|
|
17
|
+
inversed,
|
|
18
|
+
assets,
|
|
19
|
+
buttonData,
|
|
20
|
+
withBg = true,
|
|
21
|
+
spacing = SPACING.DEFAULT,
|
|
22
|
+
chips,
|
|
23
|
+
}: Props) => {
|
|
24
|
+
return (
|
|
25
|
+
<div
|
|
26
|
+
data-testid={testID || 'PanelFeature'}
|
|
27
|
+
className={cx('relative m-auto w-full flex flex-none flex-nowrap px-4 lg:px-0', spacing)}>
|
|
28
|
+
{withBg && (
|
|
29
|
+
<div className="rounded-full blur-[250px] flex flex-none aspect-square absolute -top-24 -left-48 w-[500px] opacity-20 bg-gradient-to-r from-primary-700 to-primary-300" />
|
|
30
|
+
)}
|
|
31
|
+
<Container>
|
|
32
|
+
<div
|
|
33
|
+
className={cx(
|
|
34
|
+
'relative flex flex-col-reverse sm:flex-col md:flex-row lg:flex-row flex-nowrap w-full h-min justify-between overflow-visible p-0 md:items-center gap-16',
|
|
35
|
+
{
|
|
36
|
+
'flex-row-reverse': inversed,
|
|
37
|
+
},
|
|
38
|
+
)}>
|
|
39
|
+
<div className="w-full md:w-1/2 w-1/2 flex flex-col items-start justify-center gap-8">
|
|
40
|
+
<div className="relative text-center md:text-left">
|
|
41
|
+
<DisplayHeading text={title} flush />
|
|
42
|
+
</div>
|
|
43
|
+
<div className="relative text-center md:text-left">
|
|
44
|
+
<Copy className="mb-0">{description}</Copy>
|
|
45
|
+
</div>
|
|
46
|
+
{chips && (
|
|
47
|
+
<div className="grid grid-cols-3 gap-2 mx-auto md:mx-0">
|
|
48
|
+
{chips?.map((chip, index) => (
|
|
49
|
+
<Chip
|
|
50
|
+
key={`chip-${index}`}
|
|
51
|
+
rounded
|
|
52
|
+
iconFirst
|
|
53
|
+
text={chip.text}
|
|
54
|
+
icon={chip.icon}
|
|
55
|
+
variant={chip.variant as ChipVariant}
|
|
56
|
+
/>
|
|
57
|
+
))}
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
60
|
+
<div className="mx-auto md:m-0">
|
|
61
|
+
<Button {...buttonData} />
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
<div className="w-full md:w-1/2 flex items-center justify-center">
|
|
65
|
+
<div className="w-full aspect-[1/1] flex items-center justify-center">
|
|
66
|
+
<AnimationSet1
|
|
67
|
+
bgAsset={assets.bgAsset}
|
|
68
|
+
focalAsset1={assets.focalAsset1}
|
|
69
|
+
focalAsset2={assets.focalAsset2}
|
|
70
|
+
focalAsset3={assets.focalAsset3}
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</Container>
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
PanelFeature.displayName = 'PanelFeature';
|
|
81
|
+
|
|
82
|
+
export default PanelFeature;
|
|
83
|
+
export type { Props };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Props as ButtonProps } from '../Button/Button.types';
|
|
2
|
+
|
|
3
|
+
import { Asset } from '../AnimationSet1/AnimationSet1.types';
|
|
4
|
+
import { SPACING } from '../Hero/Hero.types';
|
|
5
|
+
|
|
6
|
+
export interface Props {
|
|
7
|
+
testID?: string;
|
|
8
|
+
inversed?: boolean;
|
|
9
|
+
title: string;
|
|
10
|
+
description: string;
|
|
11
|
+
meta?: any[];
|
|
12
|
+
buttonData: ButtonProps;
|
|
13
|
+
assets: {
|
|
14
|
+
bgAsset?: Asset;
|
|
15
|
+
focalAsset1?: Asset;
|
|
16
|
+
focalAsset2?: Asset;
|
|
17
|
+
focalAsset3?: Asset;
|
|
18
|
+
};
|
|
19
|
+
withBg?: boolean;
|
|
20
|
+
spacing?: SPACING;
|
|
21
|
+
chips?: {
|
|
22
|
+
text: string;
|
|
23
|
+
icon?: string;
|
|
24
|
+
iconFirst?: boolean;
|
|
25
|
+
variant?: string
|
|
26
|
+
}[];
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './PanelFeature';
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
3
|
+
import PanelHero from '.';
|
|
4
|
+
import { BTN_SIZES, BTN_VARIANTS } from '../Button/Button.types';
|
|
5
|
+
import { HEADING_TAGS } from '../Heading/Heading.types';
|
|
6
|
+
import Copy from '../Copy';
|
|
7
|
+
import Icon from '../Icon';
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof PanelHero> = {
|
|
10
|
+
title: 'ORGANISMS/PanelHero',
|
|
11
|
+
component: PanelHero,
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: 'centered',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type Story = StoryObj<typeof PanelHero>;
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
args: {
|
|
21
|
+
withBg: true,
|
|
22
|
+
title: 'The "Barre Outside" Series',
|
|
23
|
+
contentComponent: (
|
|
24
|
+
<Copy className="flex flex-row gap-2 items-center justify-end">
|
|
25
|
+
Test Component <Icon name="mdi:home" />
|
|
26
|
+
</Copy>
|
|
27
|
+
),
|
|
28
|
+
description:
|
|
29
|
+
"<p>You want to start working out! You wish to increase muscle strength, improve mobility and posture but you are very busy, you work all day and don't really know how or where to start. In this section I recommend 5 workouts that you can start with and try your best to complete within the space of a week ( 7 days). You will find yourself getting stronger, more toned with increasingly more energy too.</p>",
|
|
30
|
+
buttonData: {
|
|
31
|
+
variant: BTN_VARIANTS.PRIMARY,
|
|
32
|
+
size: BTN_SIZES.LARGE,
|
|
33
|
+
children: 'New Classes',
|
|
34
|
+
},
|
|
35
|
+
image:
|
|
36
|
+
'https://assets.nrgbarrebody.app/styles/full_16_9/s3/2024-05/WhatsApp%20Image%202024-05-05%20at%2012.26.48.jpeg?itok=oxJt0m9N',
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const Video: Story = {
|
|
41
|
+
args: {
|
|
42
|
+
title: 'The "Barre Outside" Series',
|
|
43
|
+
description:
|
|
44
|
+
"A series of pocket size workouts you can do outdoors in your local park, in your garden, by the pool or on the beach. Let's stay strong and enjoy the fresh air together.",
|
|
45
|
+
buttonData: {
|
|
46
|
+
variant: BTN_VARIANTS.PRIMARY,
|
|
47
|
+
size: BTN_SIZES.LARGE,
|
|
48
|
+
children: 'New Classes',
|
|
49
|
+
},
|
|
50
|
+
video: {
|
|
51
|
+
sources: [
|
|
52
|
+
{
|
|
53
|
+
src: 'https://assets.nrgbarrebody.app/2022-01/VideoPanel2%20-%20HD%201080p.mp4.mp4',
|
|
54
|
+
type: 'video/mp4',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
aspectRatioValue: '16/9',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const ManyPanels: Story = {
|
|
63
|
+
args: {
|
|
64
|
+
title: 'The "Barre Outside" Series',
|
|
65
|
+
description:
|
|
66
|
+
"<p>You want to start working out! You wish to increase muscle strength, improve mobility and posture but you are very busy, you work all day and don't really know how or where to start. In this section I recommend 5 workouts that you can start with and try your best to complete within the space of a week ( 7 days). You will find yourself getting stronger, more toned with increasingly more energy too.</p>",
|
|
67
|
+
buttonData: {
|
|
68
|
+
variant: BTN_VARIANTS.PRIMARY,
|
|
69
|
+
size: BTN_SIZES.LARGE,
|
|
70
|
+
children: 'New Classes',
|
|
71
|
+
},
|
|
72
|
+
image:
|
|
73
|
+
'https://assets.nrgbarrebody.app/styles/full_16_9/s3/2024-05/WhatsApp%20Image%202024-05-05%20at%2012.26.48.jpeg?itok=oxJt0m9N',
|
|
74
|
+
},
|
|
75
|
+
render: () => {
|
|
76
|
+
const examplePanels = [
|
|
77
|
+
{
|
|
78
|
+
title: "The 'Barre Outside' Series",
|
|
79
|
+
description:
|
|
80
|
+
"<p>A series of pocket size workouts you can do outdoors in your local park or in your garden. Let's stay strong and enjoy the fresh air together.<br>\n </p>",
|
|
81
|
+
buttonData: { variant: BTN_VARIANTS.PRIMARY, size: BTN_SIZES.LARGE, children: 'New Classes Added' },
|
|
82
|
+
image: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-05/_28A3873.jpg?itok=sI_dy3FT',
|
|
83
|
+
inversed: true,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
title: 'Access the LIVE CLASSES',
|
|
87
|
+
description:
|
|
88
|
+
'<p>Join the LIVE CLASSES daily and access their recordings. Check the schedule of Live Classes. 25 classes per month, Monday-Saturday.</p>',
|
|
89
|
+
buttonData: { variant: BTN_VARIANTS.PRIMARY, size: BTN_SIZES.LARGE, children: 'Schedule ' },
|
|
90
|
+
image: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2022-03/day5.jpg?itok=EbeIXNcD',
|
|
91
|
+
inversed: false,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
title: 'Catalogue',
|
|
95
|
+
description: '<p>Access the barre workouts catalogue.</p>',
|
|
96
|
+
buttonData: { variant: BTN_VARIANTS.PRIMARY, size: BTN_SIZES.LARGE, children: 'Catalogue' },
|
|
97
|
+
inversed: true,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
title: '10mn Daily Workouts',
|
|
101
|
+
description: '<p>When 10 minutes is all you have</p>',
|
|
102
|
+
buttonData: { variant: BTN_VARIANTS.PRIMARY, size: BTN_SIZES.LARGE, children: 'Get Started' },
|
|
103
|
+
image: 'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2022-01/Untitled-21_0.jpg?itok=LOmcW1iy',
|
|
104
|
+
inversed: false,
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
title: "The ' Working Girl' Program",
|
|
108
|
+
description:
|
|
109
|
+
"<p>You want to start working out! You wish to increase muscle strength, improve mobility and posture but you are very busy, you work all day and don't really know how or where to start. In this section I recommend 5 workouts that you can start with and try your best to complete within the space of a week ( 7 days). You will find yourself getting stronger, more toned with increasingly more energy too.</p>",
|
|
110
|
+
buttonData: { variant: BTN_VARIANTS.PRIMARY, size: BTN_SIZES.LARGE, children: "Let's do this" },
|
|
111
|
+
image:
|
|
112
|
+
'https://d9r66csa6956h.cloudfront.net/styles/full_16_9/s3/2023-05/202103%20NBP%20-%20NRG%20BarreBody-95.jpg?itok=jpKPlyi3',
|
|
113
|
+
inversed: true,
|
|
114
|
+
},
|
|
115
|
+
];
|
|
116
|
+
return (
|
|
117
|
+
<div>
|
|
118
|
+
{examplePanels.map((panel, index) => (
|
|
119
|
+
<PanelHero key={`panel-${index}`} {...panel} headingTag={HEADING_TAGS.H3} />
|
|
120
|
+
))}
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export default meta;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useRef } from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import { Props } from './PanelHero.types';
|
|
4
|
+
import Button from '../Button';
|
|
5
|
+
import DisplayHeading from '../DisplayHeading';
|
|
6
|
+
import Container from '../Container';
|
|
7
|
+
import Image from '../Image';
|
|
8
|
+
import { COPY_ALIGN } from '../Copy/Copy.types';
|
|
9
|
+
import { Transition, motion, useAnimation, useInView } from 'framer-motion';
|
|
10
|
+
import Video from '../Video';
|
|
11
|
+
import HtmlContent from '../HtmlContent';
|
|
12
|
+
import { twMerge } from 'tailwind-merge';
|
|
13
|
+
|
|
14
|
+
const PanelHero = ({
|
|
15
|
+
testID,
|
|
16
|
+
title,
|
|
17
|
+
contentComponent,
|
|
18
|
+
description,
|
|
19
|
+
image,
|
|
20
|
+
buttonData,
|
|
21
|
+
inversed = false,
|
|
22
|
+
withBg = true,
|
|
23
|
+
spacing,
|
|
24
|
+
video,
|
|
25
|
+
headingTag,
|
|
26
|
+
className,
|
|
27
|
+
}: Props) => {
|
|
28
|
+
const controls = useAnimation();
|
|
29
|
+
const ref = useRef(null);
|
|
30
|
+
const isInView = useInView(ref);
|
|
31
|
+
|
|
32
|
+
const defaultAnimation: Transition = {
|
|
33
|
+
damping: 30,
|
|
34
|
+
delay: 0,
|
|
35
|
+
mass: 1.2,
|
|
36
|
+
stiffness: 200,
|
|
37
|
+
type: 'spring',
|
|
38
|
+
duration: 0.5,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (isInView) {
|
|
43
|
+
controls.start(i => ({
|
|
44
|
+
transform: 'none',
|
|
45
|
+
transition: { ...defaultAnimation, delay: i * 0.1 },
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
}, [controls, isInView]);
|
|
49
|
+
|
|
50
|
+
const aspectRatioClass = useMemo(() => {
|
|
51
|
+
switch (video?.aspectRatioValue) {
|
|
52
|
+
case '4/3':
|
|
53
|
+
return 'aspect-[4/3]';
|
|
54
|
+
case '1/1':
|
|
55
|
+
return 'aspect-[1/1]';
|
|
56
|
+
case '3/4':
|
|
57
|
+
return 'aspect-[3/4]';
|
|
58
|
+
case '9/16':
|
|
59
|
+
return 'aspect-[9/16]';
|
|
60
|
+
case '16/7':
|
|
61
|
+
return 'aspect-[16/7]';
|
|
62
|
+
case '16/5':
|
|
63
|
+
return 'aspect-[16/5]';
|
|
64
|
+
default:
|
|
65
|
+
return 'aspect-[16/9]';
|
|
66
|
+
}
|
|
67
|
+
}, [video]);
|
|
68
|
+
|
|
69
|
+
const translateX = inversed ? 'translateX(100px)' : 'translateX(-100px)';
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<div
|
|
73
|
+
data-testid={testID || 'PanelHero'}
|
|
74
|
+
className={twMerge(
|
|
75
|
+
cx('relative m-auto w-full flex flex-none flex-nowrap py-16 sm:py-24 md:py-32 lg:py-40', spacing, className),
|
|
76
|
+
)}>
|
|
77
|
+
{withBg && (
|
|
78
|
+
<div
|
|
79
|
+
className={cx(
|
|
80
|
+
'rounded-full blur-[200px] flex flex-none aspect-square absolute w-[700px] bg-gradient-to-b md:bg-gradient-to-r from-primary-200 to-primary-200 dark:from-primary-800 dark:to-primary-800 z-0',
|
|
81
|
+
{
|
|
82
|
+
'-bottom-24 right-0': !inversed,
|
|
83
|
+
'-top-24 left-0': inversed,
|
|
84
|
+
},
|
|
85
|
+
)}
|
|
86
|
+
/>
|
|
87
|
+
)}
|
|
88
|
+
<Container>
|
|
89
|
+
<div
|
|
90
|
+
className={cx(
|
|
91
|
+
'relative flex flex-col md:flex-row flex-nowrap w-full h-min justify-between overflow-visible p-0 items-center gap-0 md:gap-16',
|
|
92
|
+
{
|
|
93
|
+
'md:flex-row-reverse': inversed,
|
|
94
|
+
},
|
|
95
|
+
)}>
|
|
96
|
+
<div ref={ref} className="w-full md:w-1/2 w-1/2 flex flex-col items-start justify-center z-10">
|
|
97
|
+
<div
|
|
98
|
+
className={cx(
|
|
99
|
+
'relative flex flex-col gap-4 from-body-bg dark:from-body-bg-dark p-4 rounded',
|
|
100
|
+
{
|
|
101
|
+
'text-right bg-gradient-to-t md:bg-gradient-to-l': !inversed,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
'text-left bg-gradient-to-t md:bg-gradient-to-r': inversed,
|
|
105
|
+
},
|
|
106
|
+
)}>
|
|
107
|
+
<motion.div
|
|
108
|
+
initial={{
|
|
109
|
+
transform: translateX,
|
|
110
|
+
}}
|
|
111
|
+
custom={0}
|
|
112
|
+
animate={controls}>
|
|
113
|
+
<DisplayHeading text={title} tag={headingTag} />
|
|
114
|
+
</motion.div>
|
|
115
|
+
{contentComponent && (
|
|
116
|
+
<motion.div
|
|
117
|
+
initial={{
|
|
118
|
+
transform: translateX,
|
|
119
|
+
}}
|
|
120
|
+
custom={1}
|
|
121
|
+
animate={controls}>
|
|
122
|
+
{contentComponent}
|
|
123
|
+
</motion.div>
|
|
124
|
+
)}
|
|
125
|
+
{description && (
|
|
126
|
+
<motion.div
|
|
127
|
+
initial={{
|
|
128
|
+
transform: translateX,
|
|
129
|
+
}}
|
|
130
|
+
custom={1}
|
|
131
|
+
animate={controls}>
|
|
132
|
+
<HtmlContent
|
|
133
|
+
className="mb-0"
|
|
134
|
+
align={inversed ? COPY_ALIGN.LEFT : COPY_ALIGN.RIGHT}
|
|
135
|
+
data={description}
|
|
136
|
+
/>
|
|
137
|
+
</motion.div>
|
|
138
|
+
)}
|
|
139
|
+
{buttonData && (
|
|
140
|
+
<motion.div
|
|
141
|
+
initial={{
|
|
142
|
+
transform: translateX,
|
|
143
|
+
}}
|
|
144
|
+
custom={2}
|
|
145
|
+
animate={controls}>
|
|
146
|
+
<div
|
|
147
|
+
className={cx('flex items-center', {
|
|
148
|
+
'justify-end': !inversed,
|
|
149
|
+
'justify-start': inversed,
|
|
150
|
+
})}>
|
|
151
|
+
<Button {...buttonData} />
|
|
152
|
+
</div>
|
|
153
|
+
</motion.div>
|
|
154
|
+
)}
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
<div className="relative w-full md:w-1/2 w-1/2 z-0">
|
|
158
|
+
<div className={cx('relative md:scale-[1.35] rounded overflow-hidden shadow', aspectRatioClass)}>
|
|
159
|
+
{image && <Image src={image} alt={title} fill />}
|
|
160
|
+
{video && (
|
|
161
|
+
<Video
|
|
162
|
+
sources={video.sources}
|
|
163
|
+
options={{
|
|
164
|
+
autoplay: true,
|
|
165
|
+
muted: true,
|
|
166
|
+
controls: false,
|
|
167
|
+
loop: true,
|
|
168
|
+
playsinline: true,
|
|
169
|
+
}}
|
|
170
|
+
aspectRatioValue={video.aspectRatioValue}
|
|
171
|
+
/>
|
|
172
|
+
)}
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
</Container>
|
|
177
|
+
</div>
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
PanelHero.displayName = 'PanelHero';
|
|
182
|
+
|
|
183
|
+
export default PanelHero;
|
|
184
|
+
export type { Props };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Props as ButtonProps } from '../Button/Button.types';
|
|
2
|
+
import { Props as VideoProps } from '../Video/Video.types';
|
|
3
|
+
import { SPACING } from '../Hero/Hero.types';
|
|
4
|
+
import { HEADING_TAGS } from '../Heading/Heading.types';
|
|
5
|
+
|
|
6
|
+
export interface Props {
|
|
7
|
+
testID?: string;
|
|
8
|
+
inversed?: boolean;
|
|
9
|
+
title: string;
|
|
10
|
+
contentComponent?: React.ReactNode;
|
|
11
|
+
description?: string;
|
|
12
|
+
buttonData?: ButtonProps;
|
|
13
|
+
image?: string;
|
|
14
|
+
video?: VideoProps;
|
|
15
|
+
withBg?: boolean;
|
|
16
|
+
spacing?: SPACING;
|
|
17
|
+
headingTag?: HEADING_TAGS;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './PanelHero';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import PanelIntro from '.';
|
|
3
|
+
import { BTN_SIZES, BTN_VARIANTS } from '../Button/Button.types';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof PanelIntro> = {
|
|
6
|
+
title: 'ORGANISMS/PanelIntro',
|
|
7
|
+
component: PanelIntro,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof PanelIntro>;
|
|
11
|
+
|
|
12
|
+
export const Default: Story = {
|
|
13
|
+
args: {
|
|
14
|
+
title: 'The "Barre Outside" Series',
|
|
15
|
+
withBg: true,
|
|
16
|
+
description:
|
|
17
|
+
"<p>You want to start working out! You wish to increase muscle strength, improve mobility and posture but you are very busy, you work all day and don't really know how or where to start. In this section I recommend 5 workouts that you can start with and try your best to complete within the space of a week ( 7 days). You will find yourself getting stronger, more toned with increasingly more energy too.</p>",
|
|
18
|
+
buttonData: {
|
|
19
|
+
variant: BTN_VARIANTS.PRIMARY,
|
|
20
|
+
size: BTN_SIZES.LARGE,
|
|
21
|
+
children: 'New Classes',
|
|
22
|
+
},
|
|
23
|
+
image:
|
|
24
|
+
'https://assets.nrgbarrebody.app/styles/full_16_9/s3/2024-05/WhatsApp%20Image%202024-05-05%20at%2012.26.48.jpeg?itok=oxJt0m9N',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const BgImage: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
title: 'The "Barre Outside" Series',
|
|
31
|
+
description:
|
|
32
|
+
"<p>You want to start working out! You wish to increase muscle strength, improve mobility and posture but you are very busy, you work all day and don't really know how or where to start. In this section I recommend 5 workouts that you can start with and try your best to complete within the space of a week ( 7 days). You will find yourself getting stronger, more toned with increasingly more energy too.</p>",
|
|
33
|
+
bgImage:
|
|
34
|
+
'https://assets.nrgbarrebody.app/styles/full_16_9/s3/2024-05/WhatsApp%20Image%202024-05-05%20at%2012.26.48.jpeg?itok=oxJt0m9N',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default meta;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import Button from '../Button';
|
|
4
|
+
import DisplayHeading from '../DisplayHeading';
|
|
5
|
+
import Container from '../Container';
|
|
6
|
+
import Image from '../Image';
|
|
7
|
+
import { COPY_ALIGN } from '../Copy/Copy.types';
|
|
8
|
+
import { Transition, motion, useAnimation, useInView } from 'framer-motion';
|
|
9
|
+
import Video from '../Video';
|
|
10
|
+
import HtmlContent from '../HtmlContent';
|
|
11
|
+
import { twMerge } from 'tailwind-merge';
|
|
12
|
+
import { Props } from './PanelIntro.types';
|
|
13
|
+
|
|
14
|
+
const PanelIntro = ({
|
|
15
|
+
testID,
|
|
16
|
+
title,
|
|
17
|
+
description,
|
|
18
|
+
image,
|
|
19
|
+
buttonData,
|
|
20
|
+
inversed = false,
|
|
21
|
+
withBg = true,
|
|
22
|
+
spacing,
|
|
23
|
+
video,
|
|
24
|
+
headingTag,
|
|
25
|
+
className,
|
|
26
|
+
bgImage,
|
|
27
|
+
}: Props) => {
|
|
28
|
+
const controls = useAnimation();
|
|
29
|
+
const ref = useRef(null);
|
|
30
|
+
const isInView = useInView(ref);
|
|
31
|
+
|
|
32
|
+
const defaultAnimation: Transition = {
|
|
33
|
+
damping: 30,
|
|
34
|
+
delay: 0,
|
|
35
|
+
mass: 1.2,
|
|
36
|
+
stiffness: 200,
|
|
37
|
+
type: 'spring',
|
|
38
|
+
duration: 0.5,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (isInView) {
|
|
43
|
+
controls.start(i => ({
|
|
44
|
+
transform: 'none',
|
|
45
|
+
transition: { ...defaultAnimation, delay: i * 0.1 },
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
}, [controls, isInView]);
|
|
49
|
+
|
|
50
|
+
const translateY = 'translateY(100px)';
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div
|
|
54
|
+
data-testid={testID || 'PanelIntro'}
|
|
55
|
+
className={twMerge(
|
|
56
|
+
cx('relative m-auto w-full flex flex-none flex-nowrap py-24 sm:py-32 md:py-48 lg:py-56', spacing, className),
|
|
57
|
+
)}>
|
|
58
|
+
{withBg && (
|
|
59
|
+
<div
|
|
60
|
+
className={cx(
|
|
61
|
+
'rounded-full blur-[200px] flex flex-none aspect-square absolute w-[700px] opacity-30 bg-gradient-to-b md:bg-gradient-to-r from-primary-700 to-primary-300 z-0',
|
|
62
|
+
{
|
|
63
|
+
'-bottom-24 right-0': !inversed,
|
|
64
|
+
'-top-24 left-0': inversed,
|
|
65
|
+
},
|
|
66
|
+
)}
|
|
67
|
+
/>
|
|
68
|
+
)}
|
|
69
|
+
{bgImage && (
|
|
70
|
+
<div className="absolute inset-0 z-0">
|
|
71
|
+
<Image src={bgImage} alt={title} className="object-cover opacity-50" />
|
|
72
|
+
<div className="absolute inset-0 bg-gradient-to-t from-body-bg to-transparent" />
|
|
73
|
+
</div>
|
|
74
|
+
)}
|
|
75
|
+
<Container>
|
|
76
|
+
<div className="relative flex flex-col gap-4 items-center justify-center">
|
|
77
|
+
<div ref={ref} className="px-4 md-px-0">
|
|
78
|
+
<div className="flex flex-col gap-4 items-center justify-center">
|
|
79
|
+
<motion.div
|
|
80
|
+
initial={{
|
|
81
|
+
transform: translateY,
|
|
82
|
+
}}
|
|
83
|
+
custom={0}
|
|
84
|
+
animate={controls}>
|
|
85
|
+
<DisplayHeading text={title} tag={headingTag} />
|
|
86
|
+
</motion.div>
|
|
87
|
+
{description && (
|
|
88
|
+
<motion.div
|
|
89
|
+
initial={{
|
|
90
|
+
transform: translateY,
|
|
91
|
+
}}
|
|
92
|
+
custom={1}
|
|
93
|
+
animate={controls}>
|
|
94
|
+
<HtmlContent className="mb-0" align={COPY_ALIGN.CENTER} data={description} />
|
|
95
|
+
</motion.div>
|
|
96
|
+
)}
|
|
97
|
+
{buttonData && (
|
|
98
|
+
<motion.div
|
|
99
|
+
initial={{
|
|
100
|
+
transform: translateY,
|
|
101
|
+
}}
|
|
102
|
+
custom={2}
|
|
103
|
+
animate={controls}>
|
|
104
|
+
<div className="flex items-center">
|
|
105
|
+
<Button {...buttonData} />
|
|
106
|
+
</div>
|
|
107
|
+
</motion.div>
|
|
108
|
+
)}
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
{(image || video) && (
|
|
112
|
+
<div className="relative w-full md:w-1/2 z-0">
|
|
113
|
+
<div className="relative scale-[1.35] rounded overflow-hidden shadow aspect-[16/9] mt-20">
|
|
114
|
+
{image && <Image src={image} alt={title} fill />}
|
|
115
|
+
{video && (
|
|
116
|
+
<Video
|
|
117
|
+
sources={video.sources}
|
|
118
|
+
options={{
|
|
119
|
+
autoplay: true,
|
|
120
|
+
muted: true,
|
|
121
|
+
controls: false,
|
|
122
|
+
loop: true,
|
|
123
|
+
}}
|
|
124
|
+
aspectRatioValue={video.aspectRatioValue}
|
|
125
|
+
/>
|
|
126
|
+
)}
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
)}
|
|
130
|
+
</div>
|
|
131
|
+
</Container>
|
|
132
|
+
</div>
|
|
133
|
+
);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
PanelIntro.displayName = 'PanelIntro';
|
|
137
|
+
|
|
138
|
+
export default PanelIntro;
|
|
139
|
+
export type { Props };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Props as ButtonProps } from '../Button/Button.types';
|
|
2
|
+
import { Props as VideoProps } from '../Video/Video.types';
|
|
3
|
+
import { SPACING } from '../Hero/Hero.types';
|
|
4
|
+
import { HEADING_TAGS } from '../Heading/Heading.types';
|
|
5
|
+
|
|
6
|
+
export interface Props {
|
|
7
|
+
testID?: string;
|
|
8
|
+
inversed?: boolean;
|
|
9
|
+
title: string;
|
|
10
|
+
headingTag?: HEADING_TAGS;
|
|
11
|
+
description?: string;
|
|
12
|
+
buttonData?: ButtonProps;
|
|
13
|
+
image?: string;
|
|
14
|
+
video?: VideoProps;
|
|
15
|
+
withBg?: boolean;
|
|
16
|
+
spacing?: SPACING;
|
|
17
|
+
className?: string;
|
|
18
|
+
bgImage?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './PanelIntro';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import PanelProduct from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof PanelProduct> = {
|
|
5
|
+
title: 'ORGANISMS/PanelProduct',
|
|
6
|
+
component: PanelProduct,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof PanelProduct>;
|
|
13
|
+
|
|
14
|
+
export const Default: Story = {
|
|
15
|
+
args: {
|
|
16
|
+
image1: '/assets/iphone-flat-1.png',
|
|
17
|
+
image2: '/assets/iphone-flat-2.png',
|
|
18
|
+
title: 'Grace meets strength with NRG at home.',
|
|
19
|
+
description:
|
|
20
|
+
"Unlock the benefits of ballet barre training with our convenient subscription app. Featuring classes led by professional dancers, our app offers an engaging way to tone your muscles, enhance your flexibility, and boost your overall fitness. Whether you're looking to try something new or deepen your practice, our app provides the tools you need. Start your free trial now!",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|