@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,71 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import { Props } from './Image.types';
|
|
3
|
+
import { createElement } from 'react';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
|
|
6
|
+
const Image = ({
|
|
7
|
+
src,
|
|
8
|
+
alt,
|
|
9
|
+
title,
|
|
10
|
+
caption,
|
|
11
|
+
figure = false,
|
|
12
|
+
onLoad,
|
|
13
|
+
id,
|
|
14
|
+
className,
|
|
15
|
+
sizes = '(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw',
|
|
16
|
+
testID,
|
|
17
|
+
...rest
|
|
18
|
+
}: Props) => {
|
|
19
|
+
try {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
21
|
+
const nextImage = require('next/image').default;
|
|
22
|
+
if (!nextImage) throw new Error('Next.js Image not found');
|
|
23
|
+
|
|
24
|
+
const hasFill = !rest.width ? true : false;
|
|
25
|
+
const useSizes = hasFill ? { sizes } : {};
|
|
26
|
+
return createElement(nextImage, {
|
|
27
|
+
src: typeof src === 'string' ? src : src,
|
|
28
|
+
alt,
|
|
29
|
+
title,
|
|
30
|
+
fill: hasFill,
|
|
31
|
+
onLoad,
|
|
32
|
+
className,
|
|
33
|
+
...useSizes,
|
|
34
|
+
...rest,
|
|
35
|
+
});
|
|
36
|
+
} catch {
|
|
37
|
+
const figureClasses = cx('m-0');
|
|
38
|
+
const classes = twMerge(cx('w-full h-full', className));
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Render as a figure.
|
|
42
|
+
*/
|
|
43
|
+
if (figure || caption) {
|
|
44
|
+
return (
|
|
45
|
+
<figure data-testid={testID || id || 'Image'} className={figureClasses}>
|
|
46
|
+
<img onLoad={onLoad} src={src} alt={alt} title={title} className={classes} />
|
|
47
|
+
{caption && <figcaption>{caption}</figcaption>}
|
|
48
|
+
</figure>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Default render as an image.
|
|
54
|
+
*/
|
|
55
|
+
return (
|
|
56
|
+
<img
|
|
57
|
+
data-testid={testID || id || 'Image'}
|
|
58
|
+
onLoad={onLoad}
|
|
59
|
+
src={src}
|
|
60
|
+
alt={alt}
|
|
61
|
+
title={title}
|
|
62
|
+
className={classes}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
Image.displayName = 'Image';
|
|
69
|
+
|
|
70
|
+
export default Image;
|
|
71
|
+
export type { Props };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ImageProps } from 'next/image';
|
|
2
|
+
|
|
3
|
+
export interface Props extends ImageProps {
|
|
4
|
+
src: string;
|
|
5
|
+
alt: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
onLoad?: () => void;
|
|
8
|
+
/** Image caption, will display as a `figure` if set. */
|
|
9
|
+
caption?: string;
|
|
10
|
+
/** Display within a `figure`. */
|
|
11
|
+
figure?: boolean;
|
|
12
|
+
/** The image will take up the entire width of the container. */
|
|
13
|
+
fluid?: boolean;
|
|
14
|
+
/** The next/image sizes attribute. */
|
|
15
|
+
sizes?: string;
|
|
16
|
+
crossOrigin?: 'anonymous' | 'use-credentials';
|
|
17
|
+
id?: string;
|
|
18
|
+
testID?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Image';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import Label from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Label> = {
|
|
5
|
+
title: 'ATOMS/Label',
|
|
6
|
+
component: Label,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof Label>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
id: 'id',
|
|
14
|
+
children: 'Label',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import { Props } from './Label.types';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
|
|
6
|
+
const Label = ({ children, id, transform, className }: Props) => {
|
|
7
|
+
return (
|
|
8
|
+
<label data-testid="Label" className={twMerge(cx('label mb-2 text-body-text dark:text-body-text-dark', transform, className))} htmlFor={id}>
|
|
9
|
+
{children}
|
|
10
|
+
</label>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
Label.displayName = 'Label';
|
|
15
|
+
|
|
16
|
+
export default Label;
|
|
17
|
+
export type { Props };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Label';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import Link from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Link> = {
|
|
5
|
+
title: 'ATOMS/Link',
|
|
6
|
+
component: Link,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof Link>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
href: 'https://www.google.com',
|
|
14
|
+
children: 'Example Link text',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const External: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
href: 'https://www.google.com',
|
|
21
|
+
children: 'Example Link text',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import { Props } from './Link.types';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import Icon from '../Icon';
|
|
5
|
+
|
|
6
|
+
const Link = ({
|
|
7
|
+
href,
|
|
8
|
+
children,
|
|
9
|
+
onClick = () => {},
|
|
10
|
+
history,
|
|
11
|
+
target,
|
|
12
|
+
id,
|
|
13
|
+
testID,
|
|
14
|
+
className,
|
|
15
|
+
prefetch,
|
|
16
|
+
hideExternalIcon = false,
|
|
17
|
+
}: Props) => {
|
|
18
|
+
// const linkClasses = cx('link cursor-pointer no-underline text-body-text dark:text-body-text-dark', className);
|
|
19
|
+
const linkClasses = cx('link cursor-pointer no-underline', className);
|
|
20
|
+
|
|
21
|
+
// Check if link is external
|
|
22
|
+
const isExternal = !hideExternalIcon && href && href.startsWith('http');
|
|
23
|
+
if (isExternal) {
|
|
24
|
+
return (
|
|
25
|
+
<span className="inline-flex flex-row gap-2 items-center">
|
|
26
|
+
<a
|
|
27
|
+
data-testid={testID || id || 'Link'}
|
|
28
|
+
className={cx(linkClasses)}
|
|
29
|
+
href={href}
|
|
30
|
+
target="_blank"
|
|
31
|
+
rel="noopener noreferrer">
|
|
32
|
+
{children}
|
|
33
|
+
</a>
|
|
34
|
+
<Icon name="mdi:external-link" className="inline-block w-4 h-4 ml-1 mb-0" />
|
|
35
|
+
</span>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Allow for non-next.js Application usage.
|
|
40
|
+
try {
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
42
|
+
const nextLink = require('next/link').default;
|
|
43
|
+
if (!nextLink) throw new Error('Next.js Link not found');
|
|
44
|
+
|
|
45
|
+
return React.createElement(
|
|
46
|
+
nextLink,
|
|
47
|
+
{
|
|
48
|
+
href: href || '#',
|
|
49
|
+
onClick: onClick,
|
|
50
|
+
'data-testid': testID || id || 'Link',
|
|
51
|
+
className: linkClasses,
|
|
52
|
+
target: target || '_self',
|
|
53
|
+
prefetch: prefetch || false,
|
|
54
|
+
},
|
|
55
|
+
children,
|
|
56
|
+
);
|
|
57
|
+
} catch {
|
|
58
|
+
const handleClick = (event: React.MouseEvent): void => {
|
|
59
|
+
if (onClick) {
|
|
60
|
+
onClick(event);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (event.defaultPrevented === true) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (history && href) {
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
history.push(href);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<a data-testid={testID || id || 'Link'} className={linkClasses} href={href} onClick={handleClick} target={target}>
|
|
76
|
+
{children}
|
|
77
|
+
</a>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
Link.displayName = 'Link';
|
|
83
|
+
|
|
84
|
+
export default Link;
|
|
85
|
+
export type { Props };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { History } from 'history';
|
|
2
|
+
|
|
3
|
+
export interface Props {
|
|
4
|
+
href?: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
history?: History;
|
|
7
|
+
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
8
|
+
onClick?: React.MouseEventHandler;
|
|
9
|
+
id?: string;
|
|
10
|
+
testID?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
prefetch?: boolean;
|
|
13
|
+
hideExternalIcon?: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Link';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import List from '.';
|
|
3
|
+
import ListItem from '../ListItem';
|
|
4
|
+
import { ListTag } from './List.types';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof List> = {
|
|
7
|
+
title: 'ATOMS/List',
|
|
8
|
+
component: List,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof List>;
|
|
12
|
+
|
|
13
|
+
export const Default: Story = {
|
|
14
|
+
render: (args) => {
|
|
15
|
+
// const TYPE = select(listLabel, listOptions, listDefault);
|
|
16
|
+
const LI1 = args.as === ListTag.DL ? ListTag.DT : ListTag.LI;
|
|
17
|
+
const LI2 = args.as === ListTag.DL ? ListTag.DD : ListTag.LI;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<List {...args}>
|
|
21
|
+
<ListItem as={LI1}>{args.as}</ListItem>
|
|
22
|
+
<ListItem as={LI2}>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy.</ListItem>
|
|
23
|
+
<ListItem as={LI1}>Lorem ipsum dolor sit amet.</ListItem>
|
|
24
|
+
<ListItem as={LI2}>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy.</ListItem>
|
|
25
|
+
<ListItem as={LI1}>Consetetur sadipscing elitr.</ListItem>
|
|
26
|
+
<ListItem as={LI2}>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy.</ListItem>
|
|
27
|
+
<ListItem as={LI1}>Sit amet, consetetur sadipscing.</ListItem>
|
|
28
|
+
<ListItem as={LI2}>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy.</ListItem>
|
|
29
|
+
</List>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
Default.args = {
|
|
34
|
+
as: ListTag.DL,
|
|
35
|
+
variants: [],
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default meta;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import { ListTag, Props } from './List.types';
|
|
3
|
+
|
|
4
|
+
const List = ({ variants, children, as = ListTag.UL, id, testID, className }: Props) => {
|
|
5
|
+
const modifiers = variants ? variants.map((el) => `list--${el}`) : null;
|
|
6
|
+
const Tag = as;
|
|
7
|
+
return (
|
|
8
|
+
<Tag data-testid={testID || id || 'List'} className={cx(modifiers, className)}>
|
|
9
|
+
{children}
|
|
10
|
+
</Tag>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
List.displayName = 'List';
|
|
15
|
+
|
|
16
|
+
export default List;
|
|
17
|
+
export type { Props };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type VariantsTypes = 'unstyled' | 'inline' | 'small' | 'large';
|
|
2
|
+
|
|
3
|
+
export enum Variants {
|
|
4
|
+
UNSTYLED = 'unstyled',
|
|
5
|
+
INLINE = 'inline',
|
|
6
|
+
SMALL = 'small',
|
|
7
|
+
LARGE = 'large',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum ListTag {
|
|
11
|
+
OL = 'ol',
|
|
12
|
+
UL = 'ul',
|
|
13
|
+
DL = 'dl',
|
|
14
|
+
DIV = 'div',
|
|
15
|
+
DT = 'dt',
|
|
16
|
+
DD = 'dd',
|
|
17
|
+
LI = 'li',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type Props = {
|
|
21
|
+
variants?: Array<Variants>;
|
|
22
|
+
children: string | React.ReactNode | Array<React.ReactNode>;
|
|
23
|
+
as?: ListTag;
|
|
24
|
+
id?: string;
|
|
25
|
+
testID?: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './List';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import ListItem from '.';
|
|
3
|
+
import Container from '../Container';
|
|
4
|
+
import List from '../List';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof ListItem> = {
|
|
7
|
+
title: 'MOLECULES/ListItem',
|
|
8
|
+
component: ListItem,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof ListItem>;
|
|
12
|
+
|
|
13
|
+
export const Default: Story = {
|
|
14
|
+
args: {
|
|
15
|
+
as: 'div',
|
|
16
|
+
title: 'List item',
|
|
17
|
+
onClick: () => console.log('Pressed'),
|
|
18
|
+
},
|
|
19
|
+
render: args => (
|
|
20
|
+
<Container>
|
|
21
|
+
<ListItem {...args} />
|
|
22
|
+
</Container>
|
|
23
|
+
),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const WithIcon: Story = {
|
|
27
|
+
args: {
|
|
28
|
+
as: 'div',
|
|
29
|
+
title: 'List item',
|
|
30
|
+
icon: 'account',
|
|
31
|
+
onClick: () => console.log('Pressed'),
|
|
32
|
+
},
|
|
33
|
+
render: args => {
|
|
34
|
+
return (
|
|
35
|
+
<Container>
|
|
36
|
+
<ListItem {...args} />
|
|
37
|
+
</Container>
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const FullList: Story = {
|
|
43
|
+
args: {
|
|
44
|
+
as: 'div',
|
|
45
|
+
title: 'List item',
|
|
46
|
+
onClick: () => console.log('Pressed'),
|
|
47
|
+
},
|
|
48
|
+
render: args => {
|
|
49
|
+
return (
|
|
50
|
+
<Container>
|
|
51
|
+
<List>
|
|
52
|
+
<ListItem {...args} />
|
|
53
|
+
<ListItem {...args} />
|
|
54
|
+
<ListItem {...args} />
|
|
55
|
+
</List>
|
|
56
|
+
</Container>
|
|
57
|
+
);
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default meta;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import { Props } from './ListItem.types';
|
|
3
|
+
import Icon from '../Icon';
|
|
4
|
+
import { HEADING_TAGS } from '../Heading/Heading.types';
|
|
5
|
+
import Heading from '../Heading';
|
|
6
|
+
import Button from '../Button';
|
|
7
|
+
import { BTN_VARIANTS } from '../Button/Button.types';
|
|
8
|
+
|
|
9
|
+
const ListItem = ({
|
|
10
|
+
onClick,
|
|
11
|
+
title,
|
|
12
|
+
icon,
|
|
13
|
+
children,
|
|
14
|
+
as: Tag = 'li',
|
|
15
|
+
id,
|
|
16
|
+
testID,
|
|
17
|
+
className,
|
|
18
|
+
}: Props) => (
|
|
19
|
+
<Tag data-testid={testID || id || 'ListItem'} className={cx({ 'list-item': Tag !== 'div' }, className)}>
|
|
20
|
+
{onClick && (
|
|
21
|
+
<Button variant={BTN_VARIANTS.LINK} onClick={onClick}>
|
|
22
|
+
<div className="">
|
|
23
|
+
{icon && (
|
|
24
|
+
<div>
|
|
25
|
+
<Icon name={icon} size={24} />
|
|
26
|
+
</div>
|
|
27
|
+
)}
|
|
28
|
+
{title && (
|
|
29
|
+
<div>
|
|
30
|
+
<Heading flush tag={HEADING_TAGS.H4} singleLine>
|
|
31
|
+
{title}
|
|
32
|
+
</Heading>
|
|
33
|
+
</div>
|
|
34
|
+
)}
|
|
35
|
+
{children && <div>{children}</div>}
|
|
36
|
+
</div>
|
|
37
|
+
<div>
|
|
38
|
+
<Icon name="mdi:chevron-right" size={24} />
|
|
39
|
+
</div>
|
|
40
|
+
</Button>
|
|
41
|
+
)}
|
|
42
|
+
{!onClick && (
|
|
43
|
+
<div className="">
|
|
44
|
+
{children && <div>{children}</div>}
|
|
45
|
+
</div>
|
|
46
|
+
)}
|
|
47
|
+
</Tag>
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
ListItem.displayName = 'ListItem';
|
|
51
|
+
|
|
52
|
+
export default ListItem;
|
|
53
|
+
export type { Props };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type Props = {
|
|
2
|
+
children?: string | Array<React.ReactNode> | React.ReactNode | Array<any> | any;
|
|
3
|
+
as: 'div' | 'li' | 'dt' | 'dd';
|
|
4
|
+
id?: string;
|
|
5
|
+
testID?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
onClick?: (arg?: any) => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ListItem';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import Loader from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Loader> = {
|
|
5
|
+
title: 'UI/Loader',
|
|
6
|
+
component: Loader,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof Loader>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
size: 8,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Props } from './Loader.types';
|
|
2
|
+
|
|
3
|
+
const Loader = ({ color, size = 8, thickness = 4 }: Props) => {
|
|
4
|
+
const sizeClass = size ? `w-${size} h-${size}` : 'w-8 h-8';
|
|
5
|
+
return (
|
|
6
|
+
<div data-testid="Loader" className='flex items-center justify-center'>
|
|
7
|
+
<div role="status" className='flex items-center'>
|
|
8
|
+
<svg
|
|
9
|
+
className={`animate-spin ${sizeClass} fill-current`}
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
fill="none"
|
|
12
|
+
viewBox="0 0 24 24">
|
|
13
|
+
<circle
|
|
14
|
+
className="opacity-25"
|
|
15
|
+
cx="12"
|
|
16
|
+
cy="12"
|
|
17
|
+
r="10"
|
|
18
|
+
stroke={color || 'currentColor'}
|
|
19
|
+
strokeWidth={thickness}></circle>
|
|
20
|
+
<path
|
|
21
|
+
className="opacity-75"
|
|
22
|
+
fill={color || 'currentColor'}
|
|
23
|
+
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
24
|
+
</svg>
|
|
25
|
+
<span className="sr-only">Loading...</span>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
Loader.displayName = 'Loader';
|
|
32
|
+
|
|
33
|
+
export default Loader;
|
|
34
|
+
export type { Props };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Loader';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import Logo from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Logo> = {
|
|
5
|
+
title: 'ATOMS/Logo',
|
|
6
|
+
component: Logo,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof Logo>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
logo: '/assets/nrglogo.svg',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import { Props } from './Logo.types';
|
|
4
|
+
import Image from '../Image';
|
|
5
|
+
|
|
6
|
+
const Logo = ({ testID, logo, className, aspectRatioClass = 'aspect-[1/1]' }: Props) => {
|
|
7
|
+
return (
|
|
8
|
+
<div data-testid={testID || 'Logo'} className={cx('relative w-full', aspectRatioClass, className)}>
|
|
9
|
+
<Image src={logo} alt="logo" fill sizes="(max-width: 600px) 100px, 200px" priority />
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
Logo.displayName = 'Logo';
|
|
15
|
+
|
|
16
|
+
export default Logo;
|
|
17
|
+
export type { Props };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Logo';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import Menu from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Menu> = {
|
|
5
|
+
title: 'MOLECULES/Menu',
|
|
6
|
+
component: Menu,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof Menu>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
title: 'Menu',
|
|
14
|
+
links: [
|
|
15
|
+
{
|
|
16
|
+
id: '1',
|
|
17
|
+
title: 'Home',
|
|
18
|
+
url: '/',
|
|
19
|
+
// icon: 'mdi:home',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: '2',
|
|
23
|
+
title: 'About',
|
|
24
|
+
url: '/about',
|
|
25
|
+
// icon: 'mdi:information',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: '3',
|
|
29
|
+
title: 'Contact',
|
|
30
|
+
url: '/contact',
|
|
31
|
+
// icon: 'mdi:email',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default meta;
|