@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,139 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import Collapsible from '.';
|
|
4
|
+
import Icon from '../Icon';
|
|
5
|
+
import Heading from '../Heading';
|
|
6
|
+
import { HEADING_TAGS } from '../Heading/Heading.types';
|
|
7
|
+
import Copy from '../Copy';
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof Collapsible.Root> = {
|
|
10
|
+
title: 'ATOMS/Collapsible',
|
|
11
|
+
component: Collapsible.Root,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof Collapsible.Root>;
|
|
15
|
+
|
|
16
|
+
export const Default: Story = {
|
|
17
|
+
render: () => (
|
|
18
|
+
<Collapsible.Root>
|
|
19
|
+
<Collapsible.Trigger>
|
|
20
|
+
<div className="flex items-center justify-between w-full">
|
|
21
|
+
<Heading tag={HEADING_TAGS.H4} flush>
|
|
22
|
+
Click to expand
|
|
23
|
+
</Heading>
|
|
24
|
+
<Icon name="mdi:chevron-down" />
|
|
25
|
+
</div>
|
|
26
|
+
</Collapsible.Trigger>
|
|
27
|
+
<Collapsible.Content>
|
|
28
|
+
<div className="p-4">
|
|
29
|
+
<Copy>
|
|
30
|
+
This is the collapsible content. It can contain any React components or HTML elements.
|
|
31
|
+
</Copy>
|
|
32
|
+
</div>
|
|
33
|
+
</Collapsible.Content>
|
|
34
|
+
</Collapsible.Root>
|
|
35
|
+
),
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Controlled: Story = {
|
|
39
|
+
render: () => {
|
|
40
|
+
const [open, setOpen] = useState(false);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div className="space-y-4">
|
|
44
|
+
<button
|
|
45
|
+
onClick={() => setOpen(!open)}
|
|
46
|
+
className="px-4 py-2 bg-primary text-white rounded">
|
|
47
|
+
{open ? 'Close' : 'Open'} from external control
|
|
48
|
+
</button>
|
|
49
|
+
<Collapsible.Root open={open} onOpenChange={setOpen}>
|
|
50
|
+
<Collapsible.Trigger>
|
|
51
|
+
<div className="flex items-center justify-between w-full">
|
|
52
|
+
<Heading tag={HEADING_TAGS.H4} flush>
|
|
53
|
+
Controlled Collapsible
|
|
54
|
+
</Heading>
|
|
55
|
+
<Icon name={open ? 'mdi:chevron-up' : 'mdi:chevron-down'} />
|
|
56
|
+
</div>
|
|
57
|
+
</Collapsible.Trigger>
|
|
58
|
+
<Collapsible.Content>
|
|
59
|
+
<div className="p-4">
|
|
60
|
+
<Copy>
|
|
61
|
+
This collapsible is controlled by external state. Try using the button above to toggle it.
|
|
62
|
+
</Copy>
|
|
63
|
+
</div>
|
|
64
|
+
</Collapsible.Content>
|
|
65
|
+
</Collapsible.Root>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const WithCustomStyling: Story = {
|
|
72
|
+
render: () => (
|
|
73
|
+
<Collapsible.Root className="border-2 border-primary rounded-lg overflow-hidden">
|
|
74
|
+
<Collapsible.Trigger className="w-full bg-primary-lighter hover:bg-primary p-4">
|
|
75
|
+
<div className="flex items-center justify-between">
|
|
76
|
+
<Heading tag={HEADING_TAGS.H4} flush className="text-white">
|
|
77
|
+
Custom Styled Collapsible
|
|
78
|
+
</Heading>
|
|
79
|
+
<Icon name="mdi:chevron-down" className="text-white" />
|
|
80
|
+
</div>
|
|
81
|
+
</Collapsible.Trigger>
|
|
82
|
+
<Collapsible.Content className="bg-grey-50 dark:bg-grey-900">
|
|
83
|
+
<div className="p-4">
|
|
84
|
+
<Copy>
|
|
85
|
+
This collapsible demonstrates custom styling applied via className props.
|
|
86
|
+
</Copy>
|
|
87
|
+
</div>
|
|
88
|
+
</Collapsible.Content>
|
|
89
|
+
</Collapsible.Root>
|
|
90
|
+
),
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const Multiple: Story = {
|
|
94
|
+
render: () => (
|
|
95
|
+
<div className="space-y-2">
|
|
96
|
+
{['First', 'Second', 'Third'].map((item) => (
|
|
97
|
+
<Collapsible.Root key={item}>
|
|
98
|
+
<Collapsible.Trigger>
|
|
99
|
+
<div className="flex items-center justify-between w-full">
|
|
100
|
+
<Heading tag={HEADING_TAGS.H5} flush>
|
|
101
|
+
{item} Item
|
|
102
|
+
</Heading>
|
|
103
|
+
<Icon name="mdi:chevron-down" />
|
|
104
|
+
</div>
|
|
105
|
+
</Collapsible.Trigger>
|
|
106
|
+
<Collapsible.Content>
|
|
107
|
+
<div className="p-4">
|
|
108
|
+
<Copy>Content for {item.toLowerCase()} collapsible item.</Copy>
|
|
109
|
+
</div>
|
|
110
|
+
</Collapsible.Content>
|
|
111
|
+
</Collapsible.Root>
|
|
112
|
+
))}
|
|
113
|
+
</div>
|
|
114
|
+
),
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const DefaultOpen: Story = {
|
|
118
|
+
render: () => (
|
|
119
|
+
<Collapsible.Root defaultOpen>
|
|
120
|
+
<Collapsible.Trigger>
|
|
121
|
+
<div className="flex items-center justify-between w-full">
|
|
122
|
+
<Heading tag={HEADING_TAGS.H4} flush>
|
|
123
|
+
Open by default
|
|
124
|
+
</Heading>
|
|
125
|
+
<Icon name="mdi:chevron-down" />
|
|
126
|
+
</div>
|
|
127
|
+
</Collapsible.Trigger>
|
|
128
|
+
<Collapsible.Content>
|
|
129
|
+
<div className="p-4">
|
|
130
|
+
<Copy>
|
|
131
|
+
This collapsible is open by default using the `defaultOpen` prop.
|
|
132
|
+
</Copy>
|
|
133
|
+
</div>
|
|
134
|
+
</Collapsible.Content>
|
|
135
|
+
</Collapsible.Root>
|
|
136
|
+
),
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export default meta;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
3
|
+
import cx from 'classnames';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { CollapsibleRootProps, CollapsibleTriggerProps, CollapsibleContentProps } from './Collapsible.types';
|
|
6
|
+
|
|
7
|
+
const CollapsibleRoot = forwardRef<HTMLDivElement, CollapsibleRootProps>(
|
|
8
|
+
({ className, testID, children, ...props }, ref) => {
|
|
9
|
+
return (
|
|
10
|
+
<CollapsiblePrimitive.Root
|
|
11
|
+
ref={ref}
|
|
12
|
+
data-testid={testID || 'Collapsible'}
|
|
13
|
+
className={twMerge(cx('collapsible-root', className))}
|
|
14
|
+
{...props}>
|
|
15
|
+
{children}
|
|
16
|
+
</CollapsiblePrimitive.Root>
|
|
17
|
+
);
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
CollapsibleRoot.displayName = 'CollapsibleRoot';
|
|
22
|
+
|
|
23
|
+
const CollapsibleTrigger = forwardRef<HTMLButtonElement, CollapsibleTriggerProps>(
|
|
24
|
+
({ className, children, ...props }, ref) => {
|
|
25
|
+
return (
|
|
26
|
+
<CollapsiblePrimitive.Trigger
|
|
27
|
+
ref={ref}
|
|
28
|
+
className={twMerge(
|
|
29
|
+
cx(
|
|
30
|
+
!className && 'collapsible-trigger',
|
|
31
|
+
'transition duration-500 ease-in-out',
|
|
32
|
+
className,
|
|
33
|
+
),
|
|
34
|
+
)}
|
|
35
|
+
{...props}>
|
|
36
|
+
{children}
|
|
37
|
+
</CollapsiblePrimitive.Trigger>
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
CollapsibleTrigger.displayName = 'CollapsibleTrigger';
|
|
43
|
+
|
|
44
|
+
const CollapsibleContent = forwardRef<HTMLDivElement, CollapsibleContentProps>(
|
|
45
|
+
({ className, children, ...props }, ref) => {
|
|
46
|
+
return (
|
|
47
|
+
<CollapsiblePrimitive.Content
|
|
48
|
+
ref={ref}
|
|
49
|
+
className={twMerge(
|
|
50
|
+
cx(
|
|
51
|
+
'collapsible-content',
|
|
52
|
+
'transition-all duration-500 ease-in-out',
|
|
53
|
+
'data-[state=closed]:animate-collapse-up data-[state=open]:animate-collapse-down',
|
|
54
|
+
'overflow-hidden',
|
|
55
|
+
className,
|
|
56
|
+
),
|
|
57
|
+
)}
|
|
58
|
+
{...props}>
|
|
59
|
+
{children}
|
|
60
|
+
</CollapsiblePrimitive.Content>
|
|
61
|
+
);
|
|
62
|
+
},
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
CollapsibleContent.displayName = 'CollapsibleContent';
|
|
66
|
+
|
|
67
|
+
const Collapsible = {
|
|
68
|
+
Root: CollapsibleRoot,
|
|
69
|
+
Trigger: CollapsibleTrigger,
|
|
70
|
+
Content: CollapsibleContent,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default Collapsible;
|
|
74
|
+
export { CollapsibleRoot, CollapsibleTrigger, CollapsibleContent };
|
|
75
|
+
export type { CollapsibleRootProps, CollapsibleTriggerProps, CollapsibleContentProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
2
|
+
|
|
3
|
+
export interface CollapsibleRootProps extends CollapsiblePrimitive.CollapsibleProps {
|
|
4
|
+
testID?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface CollapsibleTriggerProps extends CollapsiblePrimitive.CollapsibleTriggerProps {
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface CollapsibleContentProps extends CollapsiblePrimitive.CollapsibleContentProps {
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import Container from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Container> = {
|
|
5
|
+
title: 'LAYOUTS/Container',
|
|
6
|
+
component: Container,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof Container>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {};
|
|
12
|
+
|
|
13
|
+
Default.args = {
|
|
14
|
+
children: <div>Container</div>,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import { CONTAINER_DIRECTION, Props } from './Container.types';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
|
|
5
|
+
const Container = ({
|
|
6
|
+
children,
|
|
7
|
+
className,
|
|
8
|
+
spacing,
|
|
9
|
+
padded,
|
|
10
|
+
isNarrow,
|
|
11
|
+
isCentered,
|
|
12
|
+
isFlush,
|
|
13
|
+
direction = CONTAINER_DIRECTION.COLUMN,
|
|
14
|
+
}: Props) => {
|
|
15
|
+
const classes = twMerge(
|
|
16
|
+
cx(
|
|
17
|
+
'container relative mx-auto my-0',
|
|
18
|
+
{ 'px-2 md:px-4 lg:px-4': padded },
|
|
19
|
+
{ 'py-40': spacing === 'feature' },
|
|
20
|
+
{ 'py-24': spacing === 'component' },
|
|
21
|
+
{ 'py-16': spacing === 'module' },
|
|
22
|
+
{ 'py-10': spacing === 'element' },
|
|
23
|
+
{ 'py-4': spacing === 'atom' },
|
|
24
|
+
{ 'py-0': spacing === 'none' },
|
|
25
|
+
{ 'max-w-3xl': isNarrow },
|
|
26
|
+
{ 'flex items-center justify-center flex-col flex-1': isCentered },
|
|
27
|
+
{ 'px-0 max-w-full mx-0': isFlush },
|
|
28
|
+
{ 'flex flex-col': direction === CONTAINER_DIRECTION.COLUMN },
|
|
29
|
+
{ 'flex-row': direction === CONTAINER_DIRECTION.ROW },
|
|
30
|
+
),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const contentClasses = cx(
|
|
34
|
+
'w-full h-full',
|
|
35
|
+
// {
|
|
36
|
+
// 'w-full': !isCentered,
|
|
37
|
+
// },
|
|
38
|
+
className,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div data-testid="Container" className={classes}>
|
|
43
|
+
<div className={contentClasses}>{children}</div>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
Container.displayName = 'Container';
|
|
49
|
+
|
|
50
|
+
export default Container;
|
|
51
|
+
export type { Props };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export enum CONTAINER_DIRECTION {
|
|
4
|
+
ROW = 'row',
|
|
5
|
+
COLUMN = 'column',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface Props {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
spacing?: 'feature' | 'component' | 'module' | 'element' | 'atom' | 'none';
|
|
11
|
+
padded?: boolean;
|
|
12
|
+
isNarrow?: boolean;
|
|
13
|
+
isCentered?: boolean;
|
|
14
|
+
isFlush?: boolean;
|
|
15
|
+
direction?: CONTAINER_DIRECTION;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Container';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import ContentPageLayout from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof ContentPageLayout> = {
|
|
5
|
+
title: 'LAYOUTS/ContentPageLayout',
|
|
6
|
+
component: ContentPageLayout,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof ContentPageLayout>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {};
|
|
12
|
+
|
|
13
|
+
Default.args = {
|
|
14
|
+
children: <div>ContentPageLayout</div>,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import { Props, CPL_SPACING } from './ContentPageLayout.types';
|
|
3
|
+
|
|
4
|
+
const ContentPageLayout = ({
|
|
5
|
+
spacing = CPL_SPACING.DEFAULT,
|
|
6
|
+
children,
|
|
7
|
+
narrow,
|
|
8
|
+
flush,
|
|
9
|
+
className,
|
|
10
|
+
}: Props) => {
|
|
11
|
+
const classes = cx(
|
|
12
|
+
'flex',
|
|
13
|
+
'flex-col',
|
|
14
|
+
'flex-1',
|
|
15
|
+
'relative',
|
|
16
|
+
{ 'py-40': spacing === 'feature' },
|
|
17
|
+
{ 'py-24': spacing === 'component' },
|
|
18
|
+
{ 'py-16': spacing === 'module' },
|
|
19
|
+
{ 'py-10': spacing === 'element' },
|
|
20
|
+
{ 'py-8': spacing === 'default' },
|
|
21
|
+
{ 'py-4': spacing === 'atom' },
|
|
22
|
+
{ 'py-0': spacing === 'none' },
|
|
23
|
+
{ 'max-w-5xl': narrow },
|
|
24
|
+
{ 'p-0': flush },
|
|
25
|
+
className,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div data-testid="ContentPageLayout" className={classes}>
|
|
30
|
+
{children}
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
ContentPageLayout.displayName = 'ContentPageLayout';
|
|
36
|
+
|
|
37
|
+
export default ContentPageLayout;
|
|
38
|
+
export type { Props };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export enum CPL_SPACING {
|
|
2
|
+
NONE = 'none',
|
|
3
|
+
ATOM = 'atom',
|
|
4
|
+
DEFAULT = 'default',
|
|
5
|
+
ELEMENT = 'element',
|
|
6
|
+
COMPONENT = 'component',
|
|
7
|
+
MODULE = 'module',
|
|
8
|
+
FEATURE = 'feature',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface Props {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
narrow?: boolean;
|
|
14
|
+
flush?: boolean;
|
|
15
|
+
spacing?: CPL_SPACING;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ContentPageLayout';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import ContentRowsLayout from '.';
|
|
3
|
+
import { CRL_SIZE } from './ContentRowsLayout.types';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof ContentRowsLayout> = {
|
|
6
|
+
title: 'LAYOUTS/ContentRowsLayout',
|
|
7
|
+
component: ContentRowsLayout,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof ContentRowsLayout>;
|
|
11
|
+
|
|
12
|
+
export const Default: Story = {};
|
|
13
|
+
|
|
14
|
+
Default.args = {
|
|
15
|
+
size: CRL_SIZE.DEFAULT,
|
|
16
|
+
children: <>ContentRowsLayout</>,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import { Props, CRL_SIZE } from './ContentRowsLayout.types';
|
|
3
|
+
|
|
4
|
+
const ContentRowsLayout = ({ className, children, size = CRL_SIZE.DEFAULT }: Props) => {
|
|
5
|
+
const classes = cx(
|
|
6
|
+
'grid',
|
|
7
|
+
'auto-rows-min',
|
|
8
|
+
'grid-cols-1',
|
|
9
|
+
'gap-x-4',
|
|
10
|
+
{ 'gap-y-0 mb-0': size === 'none' },
|
|
11
|
+
{ 'gap-y-2 mb-2': size === 'atom' },
|
|
12
|
+
{ 'gap-y-4 mb-4': size === 'default' },
|
|
13
|
+
{ 'gap-y-8 mb-8': size === 'element' },
|
|
14
|
+
{ 'gap-y-16 mb-16': size === 'module' },
|
|
15
|
+
{ 'gap-y-24 mb-24': size === 'component' },
|
|
16
|
+
{ 'gap-y-40 mb-40': size === 'feature' },
|
|
17
|
+
className,
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div data-testid="ContentRowsLayout" className={classes}>
|
|
22
|
+
{children}
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
ContentRowsLayout.displayName = 'ContentRowsLayout';
|
|
28
|
+
|
|
29
|
+
export default ContentRowsLayout;
|
|
30
|
+
export type { Props };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export enum CRL_SIZE {
|
|
2
|
+
NONE = 'none',
|
|
3
|
+
ATOM = 'atom',
|
|
4
|
+
DEFAULT = 'default',
|
|
5
|
+
ELEMENT = 'element',
|
|
6
|
+
COMPONENT = 'component',
|
|
7
|
+
MODULE = 'module',
|
|
8
|
+
FEATURE = 'feature',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface Props {
|
|
12
|
+
className?: string;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
size?: CRL_SIZE;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ContentRowsLayout';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import Copy from '.';
|
|
3
|
+
import { COPY_ALIGN, COPY_TAG } from './Copy.types';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Copy> = {
|
|
6
|
+
title: 'ATOMS/Copy',
|
|
7
|
+
component: Copy,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof Copy>;
|
|
11
|
+
|
|
12
|
+
export const Default: Story = {
|
|
13
|
+
render: (args) => {
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<Copy {...args} />
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
Default.args = {
|
|
22
|
+
as: COPY_TAG.P,
|
|
23
|
+
align: COPY_ALIGN.LEFT,
|
|
24
|
+
children:
|
|
25
|
+
'Proin eget tortor risus. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla quis lorem ut libero malesuada feugiat. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Vivamus suscipit tortor eget felis porttitor volutpat. Nulla porttitor accumsan tincidunt. Pellentesque in ipsum id orci porta dapibus.',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
import { Props, COPY_TAG } from './Copy.types';
|
|
4
|
+
|
|
5
|
+
const Copy = ({
|
|
6
|
+
children,
|
|
7
|
+
as: Tag = COPY_TAG.P,
|
|
8
|
+
size,
|
|
9
|
+
bold,
|
|
10
|
+
align,
|
|
11
|
+
transform,
|
|
12
|
+
underlined,
|
|
13
|
+
id,
|
|
14
|
+
className,
|
|
15
|
+
testID,
|
|
16
|
+
// inverted = false,
|
|
17
|
+
// maxLength = false,
|
|
18
|
+
}: Props) => {
|
|
19
|
+
const classes = cx(
|
|
20
|
+
{ [`text-${align}`]: align },
|
|
21
|
+
{ 'font-bold': bold },
|
|
22
|
+
{ 'text-base mb-3 mt-0': Tag === 'p' },
|
|
23
|
+
{ 'text-sm': Tag === 'small' },
|
|
24
|
+
{ 'text-sm': size === 'small' },
|
|
25
|
+
{ 'text-base': size === 'medium' },
|
|
26
|
+
{ 'text-lg': size === 'large' },
|
|
27
|
+
{ 'text-2xl': size === 'intro' },
|
|
28
|
+
{ 'underline': underlined },
|
|
29
|
+
transform,
|
|
30
|
+
className,
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Tag data-testid={testID || id || 'Copy'} className={twMerge(classes)}>
|
|
35
|
+
{children}
|
|
36
|
+
</Tag>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
Copy.displayName = 'Copy';
|
|
41
|
+
|
|
42
|
+
export default Copy;
|
|
43
|
+
export type { Props };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export enum COPY_ALIGN {
|
|
2
|
+
LEFT = 'left',
|
|
3
|
+
CENTER = 'center',
|
|
4
|
+
RIGHT = 'right',
|
|
5
|
+
JUSTIFY = 'justify',
|
|
6
|
+
NOWRAP = 'nowrap',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export enum COPY_TRANSFORM {
|
|
10
|
+
LOWERCASE = 'lowercase',
|
|
11
|
+
UPPERCASE = 'uppercase',
|
|
12
|
+
CAPITALIZE = 'capitalize',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export enum COPY_CONTEXTUAL {
|
|
16
|
+
INVERTED = 'inverted',
|
|
17
|
+
MUTED = 'muted',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export enum COPY_SIZE {
|
|
21
|
+
SMALL = 'small',
|
|
22
|
+
MEDIUM = 'medium',
|
|
23
|
+
LARGE = 'large',
|
|
24
|
+
INTRO = 'intro',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export enum COPY_TAG {
|
|
28
|
+
P = 'p',
|
|
29
|
+
SPAN = 'span',
|
|
30
|
+
DIV = 'div',
|
|
31
|
+
SMALL = 'small',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Props {
|
|
35
|
+
children:
|
|
36
|
+
| string
|
|
37
|
+
| Array<React.ReactNode>
|
|
38
|
+
| React.ReactNode
|
|
39
|
+
| string
|
|
40
|
+
| undefined;
|
|
41
|
+
align?: COPY_ALIGN;
|
|
42
|
+
size?: COPY_SIZE;
|
|
43
|
+
bold?: boolean;
|
|
44
|
+
underlined?: boolean;
|
|
45
|
+
transform?: COPY_TRANSFORM;
|
|
46
|
+
contextual?: COPY_CONTEXTUAL;
|
|
47
|
+
inverted?: boolean;
|
|
48
|
+
maxLength?: boolean;
|
|
49
|
+
as?: COPY_TAG;
|
|
50
|
+
id?: string;
|
|
51
|
+
testID?: string;
|
|
52
|
+
className?: string;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default} from './Copy';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import DisplayHeading from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof DisplayHeading> = {
|
|
5
|
+
title: 'MOLECULES/DisplayHeading',
|
|
6
|
+
component: DisplayHeading,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof DisplayHeading>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
text: 'Display Heading',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import { Props } from './DisplayHeading.types';
|
|
4
|
+
import Heading from '../Heading';
|
|
5
|
+
import { HEADING_TAGS } from '../Heading/Heading.types';
|
|
6
|
+
|
|
7
|
+
const DisplayHeading = ({ text, flush, tag = HEADING_TAGS.H1, colorOverride }: Props) => {
|
|
8
|
+
// split the text into an array of words
|
|
9
|
+
const arrayOfWords = text?.split(' ');
|
|
10
|
+
return (
|
|
11
|
+
<div data-testid="DisplayHeading" className={cx('relative display-heading-wrapper', colorOverride)}>
|
|
12
|
+
<Heading tag={tag} flush={flush} className="font-display font-extrabold">
|
|
13
|
+
{arrayOfWords.map((word, index) => {
|
|
14
|
+
// if last word.
|
|
15
|
+
const isLastWord = arrayOfWords.length > 1 && index === arrayOfWords.length - 1;
|
|
16
|
+
const dhKey = `${word}-${index}`;
|
|
17
|
+
return (
|
|
18
|
+
<span key={dhKey}>
|
|
19
|
+
<span
|
|
20
|
+
className={cx({ 'display-heading relative': !isLastWord }, { 'inline-block relative': isLastWord })}>
|
|
21
|
+
<>
|
|
22
|
+
{isLastWord && (
|
|
23
|
+
<>
|
|
24
|
+
<div className="display-heading--emphasis z-0" />
|
|
25
|
+
<span className={cx('display-heading--lastword relative', colorOverride)}>{word}</span>
|
|
26
|
+
</>
|
|
27
|
+
)}
|
|
28
|
+
{!isLastWord && <span className="relative z-10">{word}</span>}
|
|
29
|
+
</>
|
|
30
|
+
</span>
|
|
31
|
+
{!isLastWord && ' '}
|
|
32
|
+
</span>
|
|
33
|
+
);
|
|
34
|
+
})}
|
|
35
|
+
</Heading>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
DisplayHeading.displayName = 'DisplayHeading';
|
|
41
|
+
|
|
42
|
+
export default DisplayHeading;
|
|
43
|
+
export type { Props };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DisplayHeading';
|