@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,170 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import { Props } from './Header.types';
|
|
4
|
+
import { useAppContext } from '../../context/App';
|
|
5
|
+
import Logo from '../Logo';
|
|
6
|
+
import Button from '../Button';
|
|
7
|
+
import Menu from '../Menu';
|
|
8
|
+
import { BTN_VARIANTS } from '../Button/Button.types';
|
|
9
|
+
// import Copy from '../Copy';
|
|
10
|
+
import Link from '../Link';
|
|
11
|
+
import { useLanguage } from '../../hooks';
|
|
12
|
+
import Container from '../Container';
|
|
13
|
+
import { twMerge } from 'tailwind-merge';
|
|
14
|
+
import Cart from '../Cart';
|
|
15
|
+
// import Avatar from '../Avatar';
|
|
16
|
+
|
|
17
|
+
const Header = ({
|
|
18
|
+
testID,
|
|
19
|
+
// loginCallback,
|
|
20
|
+
// logoutCallback,
|
|
21
|
+
// isAuthenticated = false,
|
|
22
|
+
hideMenu = false,
|
|
23
|
+
className,
|
|
24
|
+
// logoOnly,
|
|
25
|
+
// userPicture,
|
|
26
|
+
}: Props) => {
|
|
27
|
+
const context = useAppContext();
|
|
28
|
+
const T = useLanguage();
|
|
29
|
+
|
|
30
|
+
const [mobileMenuClass, mobileMenuIcon] = useState('hidden');
|
|
31
|
+
const [showDropdown, setShowDropdown] = useState(false);
|
|
32
|
+
|
|
33
|
+
const toggleMenuClass = () => {
|
|
34
|
+
if (mobileMenuClass === 'hidden') {
|
|
35
|
+
mobileMenuIcon('block');
|
|
36
|
+
} else {
|
|
37
|
+
mobileMenuIcon('hidden');
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const defaultHeaderStyles = 'relative z-10 w-full m-auto py-4 bg-header-bg dark:bg-darkHeaderBackground';
|
|
42
|
+
|
|
43
|
+
if (context?.brand?.logoOnly) {
|
|
44
|
+
return (
|
|
45
|
+
<header data-testid={testID || '"Header"'} className={twMerge(cx(defaultHeaderStyles, className))}>
|
|
46
|
+
<div className="relative w-full flex flex-col md:flex-row justify-center items-center">
|
|
47
|
+
{context?.brand?.logo && (
|
|
48
|
+
<div className={cx('relative w-16 md:w-24', context?.brand?.logoAspectRatio)}>
|
|
49
|
+
<Link href="/">
|
|
50
|
+
<Logo logo={context?.brand?.logo} aspectRatioClass={context?.brand?.logoAspectRatio} />
|
|
51
|
+
</Link>
|
|
52
|
+
</div>
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
</header>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<header
|
|
61
|
+
data-testid={testID || '"Header"'}
|
|
62
|
+
className={twMerge(cx(defaultHeaderStyles, ' text-header-text dark:text-darkHeaderText', className))}>
|
|
63
|
+
<Container padded>
|
|
64
|
+
<div className="relative w-full flex">
|
|
65
|
+
{context?.brand?.logo && (
|
|
66
|
+
<div className={cx('relative h-12', context?.brand?.logoAspectRatio)}>
|
|
67
|
+
<Link href="/">
|
|
68
|
+
<Logo logo={context?.brand?.logo} aspectRatioClass={context?.brand?.logoAspectRatio} />
|
|
69
|
+
</Link>
|
|
70
|
+
</div>
|
|
71
|
+
)}
|
|
72
|
+
<div className="flex-1 hidden md:flex items-center justify-center">
|
|
73
|
+
{context?.app?.isAuthenticated && context?.header?.authNav && (
|
|
74
|
+
<Menu links={context.header.authNav} separators />
|
|
75
|
+
)}
|
|
76
|
+
{!context?.app?.isAuthenticated && context?.header?.anonNav && (
|
|
77
|
+
<Menu links={context.header.anonNav} separators />
|
|
78
|
+
)}
|
|
79
|
+
</div>
|
|
80
|
+
{/* <!-- tablet/desktop --> */}
|
|
81
|
+
<div className="hidden md:flex items-center justify-center">
|
|
82
|
+
{!context?.app?.isAuthenticated && context?.app?.loginCallback && (
|
|
83
|
+
<div className="w-32 flex justify-end">
|
|
84
|
+
<Button onClick={context?.app?.loginCallback}>{T.UI.LOGIN}</Button>
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
87
|
+
{!context?.app?.isAuthenticated && !context?.app?.loginCallback && (
|
|
88
|
+
<div className="w-32 flex justify-end" />
|
|
89
|
+
)}
|
|
90
|
+
{context?.app?.isAuthenticated && (
|
|
91
|
+
<div className="relative">
|
|
92
|
+
<Button
|
|
93
|
+
onClick={() => setShowDropdown(!showDropdown)}
|
|
94
|
+
icon={!showDropdown ? 'mdi:user' : 'mdi:user-outline'}
|
|
95
|
+
/>
|
|
96
|
+
<div
|
|
97
|
+
onClick={() => setShowDropdown(false)}
|
|
98
|
+
className={cx(
|
|
99
|
+
'absolute bg-body-bg dark:bg-body-bg-dark shadow rounded py-2 px-6 right-0 top-12 z-20 text-body-text dark:text-body-text-dark text-right',
|
|
100
|
+
{ hidden: !showDropdown },
|
|
101
|
+
)}>
|
|
102
|
+
{context?.header?.profile && <Menu links={context.header.profile} inline={false} />}
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
)}
|
|
106
|
+
{context?.app?.showCart && <Cart />}
|
|
107
|
+
</div>
|
|
108
|
+
{/* <!-- mobile --> */}
|
|
109
|
+
<div className="flex md:hidden flex-col justify-center flex-1 items-end">
|
|
110
|
+
<Button variant={BTN_VARIANTS.PRIMARY} icon="mdi:menu" onClick={toggleMenuClass} />
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
<div className={cx('navbar-menu relative z-50', mobileMenuClass, { hidden: hideMenu })}>
|
|
114
|
+
{/* <!-- Mobile Menu --> */}
|
|
115
|
+
<div className="navbar-backdrop fixed inset-0 bg-black opacity-25"></div>
|
|
116
|
+
<nav className="fixed top-0 left-0 bottom-0 flex flex-col w-5/6 max-w-sm py-4 px-4 bg-body-bg dark:bg-body-bg-dark border-r overflow-y-auto">
|
|
117
|
+
<div className="flex justify-between">
|
|
118
|
+
<div className="relative w-32">
|
|
119
|
+
{context?.brand?.logo && (
|
|
120
|
+
<div className="relative w-32">
|
|
121
|
+
<Logo logo={context?.brand?.logo} aspectRatioClass={context?.brand?.logoAspectRatio} />
|
|
122
|
+
</div>
|
|
123
|
+
)}
|
|
124
|
+
</div>
|
|
125
|
+
<div>
|
|
126
|
+
<Button variant={BTN_VARIANTS.PRIMARY} icon="mdi:close" onClick={toggleMenuClass} />
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
<div className="flex flex-col flex-1 gap-4">
|
|
130
|
+
<div className="flex flex-1 justify-center pt-4">
|
|
131
|
+
{context?.app?.isAuthenticated && context?.header?.authNav && (
|
|
132
|
+
<Menu links={context.header.authNav} separators />
|
|
133
|
+
)}
|
|
134
|
+
{!context?.app?.isAuthenticated && context?.header?.anonNav && (
|
|
135
|
+
<Menu links={context.header.anonNav} separators />
|
|
136
|
+
)}
|
|
137
|
+
</div>
|
|
138
|
+
<div className="flex flex-1 justify-center pt-4">
|
|
139
|
+
{context?.app?.isAuthenticated && context?.header?.profile && (
|
|
140
|
+
<Menu links={context.header.profile} separators />
|
|
141
|
+
)}
|
|
142
|
+
</div>
|
|
143
|
+
{context?.app?.isAuthenticated && (
|
|
144
|
+
<div className="md:hidden flex justify-center">
|
|
145
|
+
<Button onClick={context?.app?.logoutCallback}>{T.UI.LOGOUT}</Button>
|
|
146
|
+
</div>
|
|
147
|
+
)}
|
|
148
|
+
{!context?.app?.isAuthenticated && (
|
|
149
|
+
<div className="md:hidden flex justify-center">
|
|
150
|
+
<Button
|
|
151
|
+
onClick={() => {
|
|
152
|
+
context?.app?.loginCallback?.();
|
|
153
|
+
toggleMenuClass();
|
|
154
|
+
}}>
|
|
155
|
+
{T.UI.LOGIN}
|
|
156
|
+
</Button>
|
|
157
|
+
</div>
|
|
158
|
+
)}
|
|
159
|
+
</div>
|
|
160
|
+
</nav>
|
|
161
|
+
</div>
|
|
162
|
+
</Container>
|
|
163
|
+
</header>
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
Header.displayName = 'Header';
|
|
168
|
+
|
|
169
|
+
export default Header;
|
|
170
|
+
export type { Props };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Header';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import Heading from '.';
|
|
3
|
+
import { HEADING_TAGS } from './Heading.types';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Heading> = {
|
|
6
|
+
title: 'ATOMS/Heading',
|
|
7
|
+
component: Heading,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof Heading>;
|
|
11
|
+
|
|
12
|
+
export const Default: Story = {
|
|
13
|
+
args: {
|
|
14
|
+
tag: HEADING_TAGS.H1,
|
|
15
|
+
children: 'Default Heading',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export const Examples: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
bold: false,
|
|
23
|
+
},
|
|
24
|
+
render: args => {
|
|
25
|
+
return (
|
|
26
|
+
<>
|
|
27
|
+
<div>
|
|
28
|
+
<Heading {...args} tag={HEADING_TAGS.H1}>
|
|
29
|
+
Heading 1
|
|
30
|
+
</Heading>
|
|
31
|
+
</div>
|
|
32
|
+
<div>
|
|
33
|
+
<Heading {...args} tag={HEADING_TAGS.H2}>
|
|
34
|
+
Heading 2
|
|
35
|
+
</Heading>
|
|
36
|
+
</div>
|
|
37
|
+
<div>
|
|
38
|
+
<Heading {...args} tag={HEADING_TAGS.H3}>
|
|
39
|
+
Heading 3
|
|
40
|
+
</Heading>
|
|
41
|
+
</div>
|
|
42
|
+
<div>
|
|
43
|
+
<Heading {...args} tag={HEADING_TAGS.H4}>
|
|
44
|
+
Heading 4
|
|
45
|
+
</Heading>
|
|
46
|
+
</div>
|
|
47
|
+
<div>
|
|
48
|
+
<Heading {...args} tag={HEADING_TAGS.H5}>
|
|
49
|
+
Heading 5
|
|
50
|
+
</Heading>
|
|
51
|
+
</div>
|
|
52
|
+
</>
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default meta;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import { HEADING_TAGS, Props } from './Heading.types';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
|
|
5
|
+
const Heading = ({ children, tag = HEADING_TAGS.H2, transform, align, id, testID, flush, className, singleLine, bold = true }: Props) => {
|
|
6
|
+
const fontSize = () => {
|
|
7
|
+
switch (tag) {
|
|
8
|
+
case 'h1':
|
|
9
|
+
return 'text-3xl md:text-4xl lg:text-5xl';
|
|
10
|
+
case 'h2':
|
|
11
|
+
return 'text-3xl md:text-4xl lg:text-4xl';
|
|
12
|
+
case 'h3':
|
|
13
|
+
return 'text-xl md:text-2xl lg:text-2xl';
|
|
14
|
+
case 'h4':
|
|
15
|
+
return 'text-lg md:text-lg lg:text-xl';
|
|
16
|
+
case 'h5':
|
|
17
|
+
return 'text-base md:text-base lg:text-lg';
|
|
18
|
+
default:
|
|
19
|
+
return 'text-2xl md:text-2xl lg:text-4xl';
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const size = fontSize();
|
|
24
|
+
|
|
25
|
+
const Tag = tag;
|
|
26
|
+
const classes = cx(
|
|
27
|
+
`m-0 p-0 font-heading ${size}`,
|
|
28
|
+
{ 'font-bold': bold },
|
|
29
|
+
{ [`text-${align}`]: align },
|
|
30
|
+
{ 'mb-2': !flush },
|
|
31
|
+
{ 'm-0': flush },
|
|
32
|
+
{ 'whitespace-nowrap text-ellipsis overflow-hidden': singleLine },
|
|
33
|
+
transform,
|
|
34
|
+
className,
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Tag data-testid={testID || id || 'Heading'} className={twMerge(classes)}>
|
|
39
|
+
{children}
|
|
40
|
+
</Tag>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
Heading.displayName = 'Heading';
|
|
45
|
+
|
|
46
|
+
export default Heading;
|
|
47
|
+
export type { Props };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export enum HEADING_TAGS {
|
|
2
|
+
H1 = 'h1',
|
|
3
|
+
H2 = 'h2',
|
|
4
|
+
H3 = 'h3',
|
|
5
|
+
H4 = 'h4',
|
|
6
|
+
H5 = 'h5',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export enum HEADING_ALIGN {
|
|
10
|
+
LEFT = 'left',
|
|
11
|
+
CENTER = 'center',
|
|
12
|
+
RIGHT = 'right',
|
|
13
|
+
JUSTIFY = 'justify',
|
|
14
|
+
NOWRAP = 'nowrap',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum HEADING_TRANSFORM {
|
|
18
|
+
LOWERCASE = 'lowercase',
|
|
19
|
+
UPPERCASE = 'uppercase',
|
|
20
|
+
CAPITALIZE = 'capitalize',
|
|
21
|
+
NORMAL_CASE = 'normal-case',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface Props {
|
|
25
|
+
children: string | React.ReactNode;
|
|
26
|
+
tag?: HEADING_TAGS;
|
|
27
|
+
align?: HEADING_ALIGN;
|
|
28
|
+
transform?: HEADING_TRANSFORM;
|
|
29
|
+
id?: string;
|
|
30
|
+
testID?: string;
|
|
31
|
+
flush?: boolean;
|
|
32
|
+
className?: string;
|
|
33
|
+
singleLine?: boolean;
|
|
34
|
+
bold?: boolean;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Heading';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import Hero from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Hero> = {
|
|
5
|
+
title: 'MOLECULES/Hero',
|
|
6
|
+
component: Hero,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof Hero>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
children: 'Hello World',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import { Props } from './Hero.types';
|
|
4
|
+
import Container from '../Container';
|
|
5
|
+
|
|
6
|
+
const Hero = ({ testID, children, withBg = true, inversed = false }: Props) => {
|
|
7
|
+
return (
|
|
8
|
+
<div data-testid={testID || 'PanelHero'} className="relative py-8 m-auto w-full flex flex-none flex-nowrap">
|
|
9
|
+
{withBg && (
|
|
10
|
+
<div
|
|
11
|
+
className={cx(
|
|
12
|
+
'rounded-full blur-[200px] flex flex-none aspect-square absolute w-[700px] opacity-20 bg-gradient-to-r from-primary-700 to-primary-300 z-0',
|
|
13
|
+
{
|
|
14
|
+
'-bottom-24 right-0': !inversed,
|
|
15
|
+
'-top-24 left-0': inversed,
|
|
16
|
+
},
|
|
17
|
+
)}
|
|
18
|
+
/>
|
|
19
|
+
)}
|
|
20
|
+
<Container>{children}</Container>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
Hero.displayName = 'Hero';
|
|
26
|
+
|
|
27
|
+
export default Hero;
|
|
28
|
+
export type { Props };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export enum SPACING {
|
|
2
|
+
NONE = 'py-0',
|
|
3
|
+
ATOM = 'py-8',
|
|
4
|
+
DEFAULT = 'py-16',
|
|
5
|
+
ELEMENT = 'py-24',
|
|
6
|
+
COMPONENT = 'py-32',
|
|
7
|
+
MODULE = 'py-40',
|
|
8
|
+
FEATURE = 'py-64',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface Props {
|
|
12
|
+
testID?: string;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
withBg?: boolean;
|
|
15
|
+
inversed?: boolean;
|
|
16
|
+
spacing: SPACING;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Hero';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import Hr from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Hr> = {
|
|
5
|
+
title: 'ATOMS/Hr',
|
|
6
|
+
component: Hr,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof Hr>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import { Props } from './Hr.types';
|
|
3
|
+
|
|
4
|
+
const Hr = ({ size = 'small' }: Props) => (
|
|
5
|
+
<hr
|
|
6
|
+
className={cx('border-0 border-b border-body-text-dark dark:border-body-text-dark', {
|
|
7
|
+
'mt-4 mb-4': size === 'small',
|
|
8
|
+
'mt-8 mb-8': size === 'medium',
|
|
9
|
+
'mt-16 mb-16 ': size === 'large',
|
|
10
|
+
})}
|
|
11
|
+
/>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
Hr.displayName = 'Hr';
|
|
15
|
+
|
|
16
|
+
export default Hr;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Hr';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import HtmlContent from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof HtmlContent> = {
|
|
5
|
+
title: 'MOLECULES/HtmlContent',
|
|
6
|
+
component: HtmlContent,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof HtmlContent>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
data: '<p>Some HTML content</p>',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const MultipleParagraphs: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
data: '<p>Some HTML content</p><div>test</div><p>With multiple paragraphs</p><div>test</div>',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const WithLinks: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
data: '<p>Some HTML content with a <a href="https://www.google.com">link</a>. New Content sentence and then <br> some content after a line break </br></p><p>New content in a new para.</p>',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import parse from 'html-react-parser';
|
|
4
|
+
import { Props } from './HtmlContent.types';
|
|
5
|
+
import { options } from '../../utils/htmlParser';
|
|
6
|
+
|
|
7
|
+
const HtmlContent = ({ testID, data, align, className }: Props) => {
|
|
8
|
+
if (!data) {
|
|
9
|
+
return <></>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<span
|
|
14
|
+
data-testid={testID || '"HtmlContent"'}
|
|
15
|
+
className={cx(
|
|
16
|
+
'relative',
|
|
17
|
+
{
|
|
18
|
+
'text-right': align === 'right',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
'text-center': align === 'center',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
'text-left': align === 'left',
|
|
25
|
+
},
|
|
26
|
+
className,
|
|
27
|
+
)}>
|
|
28
|
+
{parse(data, options)}
|
|
29
|
+
</span>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
HtmlContent.displayName = 'HtmlContent';
|
|
34
|
+
|
|
35
|
+
export default HtmlContent;
|
|
36
|
+
export type { Props };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './HtmlContent';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import Icon from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Icon> = {
|
|
5
|
+
title: 'ATOMS/Icon',
|
|
6
|
+
component: Icon,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof Icon>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
name: 'heroicons:backspace', // https://icon-sets.iconify.design
|
|
14
|
+
size: 24,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const Colored: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
name: 'mdi:home',
|
|
21
|
+
size: 24,
|
|
22
|
+
color: 'red',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Icon as IconifyIcon } from '@iconify/react';
|
|
2
|
+
import { Props } from './Icon.types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Icon component
|
|
6
|
+
* List of supported icons can be found at https://icon-sets.iconify.design.
|
|
7
|
+
*/
|
|
8
|
+
const Icon = ({ name, size = 24, color, id, className, testID }: Props) => {
|
|
9
|
+
return (
|
|
10
|
+
<IconifyIcon
|
|
11
|
+
data-testid={testID || id || 'Icon'}
|
|
12
|
+
icon={name}
|
|
13
|
+
width={size}
|
|
14
|
+
height={size}
|
|
15
|
+
color={color || 'currentColor'}
|
|
16
|
+
className={className}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
Icon.displayName = 'Icon';
|
|
22
|
+
|
|
23
|
+
export default Icon;
|
|
24
|
+
export type { Props };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import Image from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Image> = {
|
|
5
|
+
title: 'ATOMS/Image',
|
|
6
|
+
component: Image,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof Image>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
src: 'http://via.placeholder.com/450x200',
|
|
14
|
+
width: 450,
|
|
15
|
+
height: 200,
|
|
16
|
+
alt: 'Placeholder image',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const NextExample: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
src: 'http://via.placeholder.com/450x400',
|
|
23
|
+
width: 0,
|
|
24
|
+
height: 0,
|
|
25
|
+
fill: true,
|
|
26
|
+
sizes: '100vh',
|
|
27
|
+
alt: 'Placeholder image',
|
|
28
|
+
className: 'object-cover',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default meta;
|