@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,487 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/nextjs';
|
|
3
|
+
import Card from '.';
|
|
4
|
+
import { CardVariant } from './Card.types';
|
|
5
|
+
import { COPY_ALIGN } from '../Copy/Copy.types';
|
|
6
|
+
import Container from '../Container';
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof Card> = {
|
|
9
|
+
title: 'MOLECULES/Card',
|
|
10
|
+
component: Card,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof Card>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
data: {
|
|
21
|
+
id: '1',
|
|
22
|
+
title: 'Cardio & Stretch 30\'',
|
|
23
|
+
description: 'Card description',
|
|
24
|
+
image: {
|
|
25
|
+
src: 'https://placehold.co/600x400',
|
|
26
|
+
alt: 'Placeholder image',
|
|
27
|
+
},
|
|
28
|
+
onClick: event => console.log('Card clicked', event),
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Basic: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
variant: CardVariant.BASIC,
|
|
36
|
+
data: {
|
|
37
|
+
id: '1',
|
|
38
|
+
title: 'Card title',
|
|
39
|
+
description: 'Card description',
|
|
40
|
+
image: {
|
|
41
|
+
src: 'https://dpfuvkwgoe3ki.cloudfront.net/styles/large_16_9/s3/2024-04/Thumbnail_Lilium2.jpg.webp', // 'https://placehold.co/600x400',
|
|
42
|
+
alt: 'Placeholder image',
|
|
43
|
+
},
|
|
44
|
+
tags: ['tag1', 'tag2'],
|
|
45
|
+
metaData: ['meta1', 'meta2'],
|
|
46
|
+
actions: {
|
|
47
|
+
like: {
|
|
48
|
+
count: 10,
|
|
49
|
+
isActive: false,
|
|
50
|
+
onClick: event => console.log('Like clicked', event),
|
|
51
|
+
},
|
|
52
|
+
share: {
|
|
53
|
+
isActive: true,
|
|
54
|
+
onClick: event => console.log('Share clicked', event),
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
// padded: true,
|
|
58
|
+
// scaleOnHover: false,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
render: args => {
|
|
62
|
+
return (
|
|
63
|
+
<div className="w-[800px] h-[350px] grid grid-cols-3 gap-4">
|
|
64
|
+
<div>
|
|
65
|
+
<Card {...args} />
|
|
66
|
+
</div>
|
|
67
|
+
<div>
|
|
68
|
+
<Card {...args} />
|
|
69
|
+
</div>
|
|
70
|
+
<div>
|
|
71
|
+
<Card {...args} />
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const BasicTitleOverlay: Story = {
|
|
79
|
+
args: {
|
|
80
|
+
variant: CardVariant.BASIC,
|
|
81
|
+
data: {
|
|
82
|
+
id: '1',
|
|
83
|
+
title: 'Card title',
|
|
84
|
+
image: {
|
|
85
|
+
src: 'https://dpfuvkwgoe3ki.cloudfront.net/styles/large_16_9/s3/2024-04/Thumbnail_Lilium2.jpg.webp', // 'https://placehold.co/600x400',
|
|
86
|
+
alt: 'Placeholder image',
|
|
87
|
+
},
|
|
88
|
+
titleOverlay: true,
|
|
89
|
+
scaleOnHover: true,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
render: args => {
|
|
93
|
+
return (
|
|
94
|
+
<div className="w-[800px] h-[350px] grid grid-cols-3 gap-4">
|
|
95
|
+
<div>
|
|
96
|
+
<Card {...args} />
|
|
97
|
+
</div>
|
|
98
|
+
<div>
|
|
99
|
+
<Card {...args} />
|
|
100
|
+
</div>
|
|
101
|
+
<div>
|
|
102
|
+
<Card {...args} />
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const Video: Story = {
|
|
110
|
+
args: {
|
|
111
|
+
variant: CardVariant.VIDEO,
|
|
112
|
+
data: {
|
|
113
|
+
id: '1',
|
|
114
|
+
title: 'Card title',
|
|
115
|
+
description: 'Card description',
|
|
116
|
+
image: {
|
|
117
|
+
src: 'https://dpfuvkwgoe3ki.cloudfront.net/styles/large_16_9/s3/2024-04/Thumbnail_Lilium2.jpg.webp', //'https://placehold.co/600x400',
|
|
118
|
+
alt: 'Placeholder image',
|
|
119
|
+
},
|
|
120
|
+
video: '../../../assets/sample-5s.mp4',
|
|
121
|
+
tags: ['tag1', 'tag2'],
|
|
122
|
+
metaData: ['meta1', 'meta2'],
|
|
123
|
+
actions: {
|
|
124
|
+
save: {
|
|
125
|
+
isActive: false,
|
|
126
|
+
onClick: event => console.log('Save clicked', event),
|
|
127
|
+
},
|
|
128
|
+
comment: {
|
|
129
|
+
count: 10,
|
|
130
|
+
isActive: true,
|
|
131
|
+
onClick: event => console.log('Comment clicked', event),
|
|
132
|
+
},
|
|
133
|
+
bookmark: {
|
|
134
|
+
isActive: true,
|
|
135
|
+
onClick: event => console.log('Bookmark clicked', event),
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const VideoOnly: Story = {
|
|
143
|
+
args: {
|
|
144
|
+
variant: CardVariant.VIDEO,
|
|
145
|
+
data: {
|
|
146
|
+
id: '1',
|
|
147
|
+
// title: 'Card title',
|
|
148
|
+
// description: 'Card description',
|
|
149
|
+
image: {
|
|
150
|
+
src: 'https://dpfuvkwgoe3ki.cloudfront.net/styles/large_16_9/s3/2024-04/Thumbnail_Lilium2.jpg.webp', //'https://placehold.co/600x400',
|
|
151
|
+
alt: 'Placeholder image',
|
|
152
|
+
},
|
|
153
|
+
video: '../../../assets/sample-5s.mp4',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
render: args => {
|
|
157
|
+
return (
|
|
158
|
+
<Container>
|
|
159
|
+
<div className="min-w-[500px]">
|
|
160
|
+
<Card {...args} />
|
|
161
|
+
</div>
|
|
162
|
+
</Container>
|
|
163
|
+
);
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export const Media: Story = {
|
|
168
|
+
args: {
|
|
169
|
+
variant: CardVariant.MEDIA,
|
|
170
|
+
data: {
|
|
171
|
+
id: '1',
|
|
172
|
+
title: 'Card & title 30',
|
|
173
|
+
description: 'Card description',
|
|
174
|
+
image: {
|
|
175
|
+
src: 'https://placehold.co/600x400',
|
|
176
|
+
alt: 'Placeholder image',
|
|
177
|
+
},
|
|
178
|
+
playCallback: (event: any) => console.log('Play clicked', event),
|
|
179
|
+
tags: ['tag1', 'tag2'],
|
|
180
|
+
metaData: ['meta1', 'meta2'],
|
|
181
|
+
actions: {
|
|
182
|
+
report: {
|
|
183
|
+
isActive: false,
|
|
184
|
+
onClick: event => console.log('Report clicked', event),
|
|
185
|
+
},
|
|
186
|
+
follow: {
|
|
187
|
+
isActive: true,
|
|
188
|
+
onClick: event => console.log('Follow clicked', event),
|
|
189
|
+
},
|
|
190
|
+
download: {
|
|
191
|
+
isActive: false,
|
|
192
|
+
onClick: event => console.log('Download clicked', event),
|
|
193
|
+
},
|
|
194
|
+
edit: {
|
|
195
|
+
isActive: true,
|
|
196
|
+
onClick: event => console.log('Edit clicked', event),
|
|
197
|
+
},
|
|
198
|
+
delete: {
|
|
199
|
+
isActive: false,
|
|
200
|
+
onClick: event => console.log('Delete clicked', event),
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export const MediaMultiple: Story = {
|
|
208
|
+
render: args => {
|
|
209
|
+
return (
|
|
210
|
+
<div className="grid grid-cols-3 gap-4">
|
|
211
|
+
<Card
|
|
212
|
+
variant={args.variant}
|
|
213
|
+
data={{
|
|
214
|
+
...args.data,
|
|
215
|
+
image: {
|
|
216
|
+
src: 'https://placehold.co/600x300/000000/FFF',
|
|
217
|
+
alt: 'Placeholder image',
|
|
218
|
+
},
|
|
219
|
+
}}
|
|
220
|
+
/>
|
|
221
|
+
<Card
|
|
222
|
+
variant={args.variant}
|
|
223
|
+
data={{
|
|
224
|
+
...args.data,
|
|
225
|
+
image: {
|
|
226
|
+
src: 'https://placehold.co/600x250/8899AA/FFF',
|
|
227
|
+
alt: 'Placeholder image',
|
|
228
|
+
},
|
|
229
|
+
}}
|
|
230
|
+
/>
|
|
231
|
+
<Card
|
|
232
|
+
variant={args.variant}
|
|
233
|
+
data={{
|
|
234
|
+
...args.data,
|
|
235
|
+
image: {
|
|
236
|
+
src: 'https://placehold.co/600x325/55DDAA/FFF',
|
|
237
|
+
alt: 'Placeholder image',
|
|
238
|
+
},
|
|
239
|
+
}}
|
|
240
|
+
/>
|
|
241
|
+
</div>
|
|
242
|
+
);
|
|
243
|
+
},
|
|
244
|
+
args: {
|
|
245
|
+
variant: CardVariant.MEDIA,
|
|
246
|
+
data: {
|
|
247
|
+
id: '1',
|
|
248
|
+
title: 'Card title',
|
|
249
|
+
description: 'Card description',
|
|
250
|
+
image: {
|
|
251
|
+
src: 'https://placehold.co/600x400',
|
|
252
|
+
alt: 'Placeholder image',
|
|
253
|
+
},
|
|
254
|
+
playCallback: (event: any) => console.log('Play clicked', event),
|
|
255
|
+
tags: ['tag1', 'tag2'],
|
|
256
|
+
metaData: ['meta1', 'meta2'],
|
|
257
|
+
actions: {
|
|
258
|
+
report: {
|
|
259
|
+
isActive: false,
|
|
260
|
+
onClick: event => console.log('Report clicked', event),
|
|
261
|
+
},
|
|
262
|
+
follow: {
|
|
263
|
+
isActive: true,
|
|
264
|
+
onClick: event => console.log('Follow clicked', event),
|
|
265
|
+
},
|
|
266
|
+
download: {
|
|
267
|
+
isActive: false,
|
|
268
|
+
onClick: event => console.log('Download clicked', event),
|
|
269
|
+
},
|
|
270
|
+
edit: {
|
|
271
|
+
isActive: true,
|
|
272
|
+
onClick: event => console.log('Edit clicked', event),
|
|
273
|
+
},
|
|
274
|
+
delete: {
|
|
275
|
+
isActive: false,
|
|
276
|
+
onClick: event => console.log('Delete clicked', event),
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
export const Icon: Story = {
|
|
284
|
+
args: {
|
|
285
|
+
variant: CardVariant.ICON,
|
|
286
|
+
data: {
|
|
287
|
+
id: '1',
|
|
288
|
+
icon: 'mdi:heart',
|
|
289
|
+
title: 'Monitor your diet easily',
|
|
290
|
+
moreTitle: 'Learn more',
|
|
291
|
+
description:
|
|
292
|
+
'The goal of a "monitor your diet easily" is to simplify the process of tracking and understanding nutritional intake',
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
render: args => {
|
|
296
|
+
return (
|
|
297
|
+
<div className="flex flex-col gap-4">
|
|
298
|
+
<div className="flex flex-row gap-4">
|
|
299
|
+
<Card
|
|
300
|
+
variant={args.variant}
|
|
301
|
+
data={{
|
|
302
|
+
...args.data,
|
|
303
|
+
icon: 'mdi:heart',
|
|
304
|
+
align: COPY_ALIGN.LEFT,
|
|
305
|
+
onClick: event => console.log('Card clicked', event),
|
|
306
|
+
moreTitle: 'Learn more',
|
|
307
|
+
}}
|
|
308
|
+
/>
|
|
309
|
+
<Card
|
|
310
|
+
variant={args.variant}
|
|
311
|
+
data={{
|
|
312
|
+
...args.data,
|
|
313
|
+
icon: 'mdi:star',
|
|
314
|
+
align: COPY_ALIGN.LEFT,
|
|
315
|
+
onClick: event => console.log('Card clicked', event),
|
|
316
|
+
moreTitle: 'Try now',
|
|
317
|
+
}}
|
|
318
|
+
/>
|
|
319
|
+
<Card
|
|
320
|
+
variant={args.variant}
|
|
321
|
+
data={{
|
|
322
|
+
...args.data,
|
|
323
|
+
icon: 'mdi:chart-line',
|
|
324
|
+
align: COPY_ALIGN.LEFT,
|
|
325
|
+
onClick: event => console.log('Card clicked', event),
|
|
326
|
+
moreTitle: 'View stats',
|
|
327
|
+
}}
|
|
328
|
+
/>
|
|
329
|
+
</div>
|
|
330
|
+
<div className="flex flex-row gap-4">
|
|
331
|
+
<Card
|
|
332
|
+
variant={args.variant}
|
|
333
|
+
data={{
|
|
334
|
+
...args.data,
|
|
335
|
+
icon: 'mdi:heart',
|
|
336
|
+
align: COPY_ALIGN.CENTER,
|
|
337
|
+
}}
|
|
338
|
+
/>
|
|
339
|
+
<Card
|
|
340
|
+
variant={args.variant}
|
|
341
|
+
data={{
|
|
342
|
+
...args.data,
|
|
343
|
+
icon: 'mdi:star',
|
|
344
|
+
align: COPY_ALIGN.CENTER,
|
|
345
|
+
}}
|
|
346
|
+
/>
|
|
347
|
+
<Card
|
|
348
|
+
variant={args.variant}
|
|
349
|
+
data={{
|
|
350
|
+
...args.data,
|
|
351
|
+
icon: 'mdi:chart-line',
|
|
352
|
+
align: COPY_ALIGN.CENTER,
|
|
353
|
+
}}
|
|
354
|
+
/>
|
|
355
|
+
</div>
|
|
356
|
+
<div className="flex flex-row gap-4">
|
|
357
|
+
<Card
|
|
358
|
+
variant={args.variant}
|
|
359
|
+
data={{
|
|
360
|
+
...args.data,
|
|
361
|
+
icon: 'mdi:heart',
|
|
362
|
+
align: COPY_ALIGN.RIGHT,
|
|
363
|
+
}}
|
|
364
|
+
/>
|
|
365
|
+
<Card
|
|
366
|
+
variant={args.variant}
|
|
367
|
+
data={{
|
|
368
|
+
...args.data,
|
|
369
|
+
icon: 'mdi:star',
|
|
370
|
+
align: COPY_ALIGN.RIGHT,
|
|
371
|
+
}}
|
|
372
|
+
/>
|
|
373
|
+
<Card
|
|
374
|
+
variant={args.variant}
|
|
375
|
+
data={{
|
|
376
|
+
...args.data,
|
|
377
|
+
icon: 'mdi:chart-line',
|
|
378
|
+
align: COPY_ALIGN.RIGHT,
|
|
379
|
+
}}
|
|
380
|
+
/>
|
|
381
|
+
</div>
|
|
382
|
+
</div>
|
|
383
|
+
);
|
|
384
|
+
},
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
export const Horz: Story = {
|
|
388
|
+
args: {
|
|
389
|
+
variant: CardVariant.HORZ,
|
|
390
|
+
data: {
|
|
391
|
+
id: '1',
|
|
392
|
+
title: 'Daily fitness challenges',
|
|
393
|
+
description: 'Flexi gives you the ability to achieve specific goals.',
|
|
394
|
+
image: {
|
|
395
|
+
src: 'https://dpfuvkwgoe3ki.cloudfront.net/styles/large_16_9/s3/2024-04/Thumbnail_Lilium2.jpg.webp', // 'https://placehold.co/600x400',
|
|
396
|
+
alt: 'Placeholder image',
|
|
397
|
+
},
|
|
398
|
+
// padded: true,
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
export const HorzIcons: Story = {
|
|
404
|
+
args: {
|
|
405
|
+
variant: CardVariant.HORZ,
|
|
406
|
+
data: {
|
|
407
|
+
id: '1',
|
|
408
|
+
title: 'Daily fitness challenges',
|
|
409
|
+
description: 'Flexi gives you the ability to achieve specific goals.',
|
|
410
|
+
padded: true,
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
render: args => {
|
|
414
|
+
return (
|
|
415
|
+
<div className="flex flex-col w-[400px] gap-4">
|
|
416
|
+
<Card
|
|
417
|
+
variant={args.variant}
|
|
418
|
+
data={{
|
|
419
|
+
...args.data,
|
|
420
|
+
icon: 'mdi:heart',
|
|
421
|
+
}}
|
|
422
|
+
/>
|
|
423
|
+
<Card
|
|
424
|
+
variant={args.variant}
|
|
425
|
+
data={{
|
|
426
|
+
...args.data,
|
|
427
|
+
icon: 'mdi:star',
|
|
428
|
+
}}
|
|
429
|
+
/>
|
|
430
|
+
<Card
|
|
431
|
+
variant={args.variant}
|
|
432
|
+
data={{
|
|
433
|
+
...args.data,
|
|
434
|
+
icon: 'mdi:chart-line',
|
|
435
|
+
}}
|
|
436
|
+
/>
|
|
437
|
+
</div>
|
|
438
|
+
);
|
|
439
|
+
},
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
export const Data: Story = {
|
|
443
|
+
args: {
|
|
444
|
+
variant: CardVariant.DATA,
|
|
445
|
+
data: {
|
|
446
|
+
id: '1',
|
|
447
|
+
data: {
|
|
448
|
+
item: '+',
|
|
449
|
+
label: 'Export Coaches',
|
|
450
|
+
numberData: {
|
|
451
|
+
from: 0,
|
|
452
|
+
to: 140,
|
|
453
|
+
animationOptions: {
|
|
454
|
+
ease: 'easeInOut',
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
animateNumber: true,
|
|
458
|
+
},
|
|
459
|
+
// padded: true,
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
export const DataDecimals: Story = {
|
|
465
|
+
args: {
|
|
466
|
+
variant: CardVariant.DATA,
|
|
467
|
+
data: {
|
|
468
|
+
id: '1',
|
|
469
|
+
data: {
|
|
470
|
+
item: '/5',
|
|
471
|
+
label: 'Ratings',
|
|
472
|
+
numberData: {
|
|
473
|
+
from: 0,
|
|
474
|
+
to: 4.8,
|
|
475
|
+
animationOptions: {
|
|
476
|
+
ease: 'easeInOut',
|
|
477
|
+
},
|
|
478
|
+
numDecimals: 1,
|
|
479
|
+
},
|
|
480
|
+
animateNumber: true,
|
|
481
|
+
},
|
|
482
|
+
// padded: true,
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
export default meta;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Props } from './Card.types';
|
|
3
|
+
import CardBasic from './types/CardBasic';
|
|
4
|
+
import CardMedia from './types/CardMedia';
|
|
5
|
+
import CardVideo from './types/CardVideo';
|
|
6
|
+
import CardIcon from './types/CardIcon';
|
|
7
|
+
import CardHorz from './types/CardHorz';
|
|
8
|
+
import CardData from './types/CardData';
|
|
9
|
+
|
|
10
|
+
const Card = ({ variant, className, data, ...rest }: Props) => {
|
|
11
|
+
switch (variant) {
|
|
12
|
+
case 'basic':
|
|
13
|
+
return <CardBasic className={className} {...data} {...rest} />;
|
|
14
|
+
case 'media':
|
|
15
|
+
return <CardMedia className={className} {...data} {...rest} />;
|
|
16
|
+
case 'video':
|
|
17
|
+
return <CardVideo className={className} {...data} {...rest} />;
|
|
18
|
+
case 'icon':
|
|
19
|
+
return <CardIcon className={className} {...data} {...rest} />;
|
|
20
|
+
case 'horz':
|
|
21
|
+
return <CardHorz className={className} {...data} {...rest} />;
|
|
22
|
+
case 'data':
|
|
23
|
+
return <CardData className={className} {...data} {...rest} />;
|
|
24
|
+
default:
|
|
25
|
+
return <CardBasic className={className} {...data} {...rest} />;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
Card.displayName = 'Card';
|
|
30
|
+
|
|
31
|
+
export default Card;
|
|
32
|
+
export type { Props };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { COPY_ALIGN } from '../Copy/Copy.types';
|
|
3
|
+
import { NumberType } from './types/CardData/CardData.types';
|
|
4
|
+
|
|
5
|
+
export enum CardVariant {
|
|
6
|
+
BASIC = 'basic',
|
|
7
|
+
MEDIA = 'media',
|
|
8
|
+
VIDEO = 'video',
|
|
9
|
+
ICON = 'icon',
|
|
10
|
+
HORZ = 'horz',
|
|
11
|
+
DATA = 'data',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ImageData {
|
|
15
|
+
src: string;
|
|
16
|
+
alt: string;
|
|
17
|
+
title?: string;
|
|
18
|
+
width?: number;
|
|
19
|
+
height?: number;
|
|
20
|
+
aspectRatio?: 'aspect-[16/10]' | 'aspect-[16/9]' | 'aspect-[4/3]' | 'aspect-[1/1]' | 'aspect-[3/4]' | 'aspect-[9/16]';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type ActionItem = {
|
|
24
|
+
count?: number;
|
|
25
|
+
isActive: boolean;
|
|
26
|
+
onClick: (event: any) => void;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export interface Actions {
|
|
30
|
+
like?: ActionItem;
|
|
31
|
+
share?: ActionItem;
|
|
32
|
+
save?: ActionItem;
|
|
33
|
+
comment?: ActionItem;
|
|
34
|
+
bookmark?: ActionItem;
|
|
35
|
+
report?: ActionItem;
|
|
36
|
+
follow?: ActionItem;
|
|
37
|
+
download?: ActionItem;
|
|
38
|
+
edit?: ActionItem;
|
|
39
|
+
delete?: ActionItem;
|
|
40
|
+
completed?: ActionItem;
|
|
41
|
+
custom?: ReactNode[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface CardData {
|
|
45
|
+
id: string;
|
|
46
|
+
title?: string;
|
|
47
|
+
subtitle?: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
image?: ImageData;
|
|
50
|
+
video?: string;
|
|
51
|
+
link?: string;
|
|
52
|
+
tags?: string[];
|
|
53
|
+
moreTitle?: string;
|
|
54
|
+
metaData?: string[];
|
|
55
|
+
actions?: Actions;
|
|
56
|
+
onClick?: (data: any) => void;
|
|
57
|
+
playCallback?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
58
|
+
isMuted?: boolean;
|
|
59
|
+
icon?: string;
|
|
60
|
+
padded?: boolean;
|
|
61
|
+
scaleOnHover?: boolean;
|
|
62
|
+
data?: {
|
|
63
|
+
item: string;
|
|
64
|
+
label: string;
|
|
65
|
+
numberData: NumberType;
|
|
66
|
+
animateNumber?: boolean;
|
|
67
|
+
};
|
|
68
|
+
align?: COPY_ALIGN;
|
|
69
|
+
raised?: boolean;
|
|
70
|
+
htmlDetails?: boolean;
|
|
71
|
+
accessRestriced?: boolean;
|
|
72
|
+
titleOverlay?: boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface Props {
|
|
76
|
+
variant?: CardVariant;
|
|
77
|
+
className?: string;
|
|
78
|
+
data: CardData;
|
|
79
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const cardWrapperClasses =
|
|
2
|
+
'relative rounded-lg overflow-hidden shadow bg-card-bg text-card-text dark:bg-darkCardBackground dark:text-darkCardText group';
|
|
3
|
+
|
|
4
|
+
export const clickableCardWrapperClasses =
|
|
5
|
+
'relative rounded-lg overflow-hidden cursor-pointer hover:scale-105 shadow hover:shadow-lg bg-card-bg text-card-text dark:bg-darkCardBackground dark:text-darkCardText hover:bg-card-bgHover group';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export const animateClasses = 'transition duration-500 ease-in-out ';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Card';
|