@hhgtech/hhg-components 1.19.0-beta-5 → 1.19.0-beta-7
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/.eslintrc.json +53 -0
- package/package.json +5 -2
- package/src/assets/svg/Spotlight.svg +12 -0
- package/src/assets/svg/StarEmptyIcon.tsx +19 -0
- package/src/assets/svg/StarFullIcon.tsx +21 -0
- package/src/assets/svg/StarHalfIcon.tsx +35 -0
- package/src/assets/svg/arrowDoor.svg +9 -0
- package/src/assets/svg/calendar.svg +3 -0
- package/src/assets/svg/calendarArrowLeft.svg +3 -0
- package/src/assets/svg/calendarArrowRight.svg +3 -0
- package/src/assets/svg/check.svg +3 -0
- package/src/assets/svg/chevronDown.svg +3 -0
- package/src/assets/svg/chevronRight.svg +3 -0
- package/src/assets/svg/chevronRightActive.svg +3 -0
- package/src/assets/svg/chevronRightWhite.svg +3 -0
- package/src/assets/svg/chevronUpBlue.svg +3 -0
- package/src/assets/svg/closeLight.svg +4 -0
- package/src/assets/svg/closeWhite.svg +4 -0
- package/src/assets/svg/community.svg +1 -0
- package/src/assets/svg/discover.png +0 -0
- package/src/assets/svg/facebook.svg +4 -0
- package/src/assets/svg/hamburgerMenu.svg +5 -0
- package/src/assets/svg/hamburgerMenuNew.svg +1 -0
- package/src/assets/svg/hamburgerMenuNewWithSearch.svg +1 -0
- package/src/assets/svg/healthTools.png +0 -0
- package/src/assets/svg/helloCare-thumbnail.png +0 -0
- package/src/assets/svg/index.ts +63 -0
- package/src/assets/svg/info-light.svg +5 -0
- package/src/assets/svg/instagram.svg +1 -0
- package/src/assets/svg/linkedin.svg +1 -0
- package/src/assets/svg/lock.png +0 -0
- package/src/assets/svg/login.svg +1 -0
- package/src/assets/svg/sehat-badge.png +0 -0
- package/src/assets/svg/together.png +0 -0
- package/src/assets/svg/youtube.svg +4 -0
- package/src/assets/svg/zalo.png +0 -0
- package/src/cache/core.ts +52 -0
- package/src/cache/index.ts +1 -0
- package/src/care/api/paths.ts +11 -0
- package/src/care/api/utils.ts +32 -0
- package/src/care/components/atoms/icons/index.tsx +170 -0
- package/src/care/components/organisms/bookingSearchBar/constants.ts +9 -0
- package/src/care/components/organisms/bookingSearchBar/index.stories.tsx +127 -0
- package/src/care/components/organisms/bookingSearchBar/index.styled.ts +51 -0
- package/src/care/components/organisms/bookingSearchBar/index.test.tsx +556 -0
- package/src/care/components/organisms/bookingSearchBar/index.tsx +448 -0
- package/src/care/components/organisms/bookingSearchBar/locationResults/index.styled.ts +94 -0
- package/src/care/components/organisms/bookingSearchBar/locationResults/index.tsx +132 -0
- package/src/care/components/organisms/bookingSearchBar/locationResults/liSkeleton.tsx +52 -0
- package/src/care/components/organisms/bookingSearchBar/mobileFakeInput/index.tsx +68 -0
- package/src/care/components/organisms/bookingSearchBar/mobileTopbar/index.stories.tsx +22 -0
- package/src/care/components/organisms/bookingSearchBar/mobileTopbar/index.styled.ts +41 -0
- package/src/care/components/organisms/bookingSearchBar/mobileTopbar/index.tsx +48 -0
- package/src/care/components/organisms/bookingSearchBar/reducer.ts +293 -0
- package/src/care/components/organisms/bookingSearchBar/resultSection/icons.tsx +37 -0
- package/src/care/components/organisms/bookingSearchBar/resultSection/index.stories.tsx +155 -0
- package/src/care/components/organisms/bookingSearchBar/resultSection/index.styled.ts +89 -0
- package/src/care/components/organisms/bookingSearchBar/resultSection/index.tsx +234 -0
- package/src/care/components/organisms/bookingSearchBar/resultSectionItem/index.stories.tsx +55 -0
- package/src/care/components/organisms/bookingSearchBar/resultSectionItem/index.styled.ts +75 -0
- package/src/care/components/organisms/bookingSearchBar/resultSectionItem/index.tsx +86 -0
- package/src/care/components/organisms/bookingSearchBar/searchInputs/index.styled.ts +42 -0
- package/src/care/components/organisms/bookingSearchBar/searchInputs/index.tsx +219 -0
- package/src/care/components/organisms/bookingSearchBar/searchResults/index.stories.tsx +55 -0
- package/src/care/components/organisms/bookingSearchBar/searchResults/index.tsx +62 -0
- package/src/care/components/organisms/bookingSearchBar/searchResults/mockData.ts +169 -0
- package/src/care/components/organisms/bookingSearchBar/searchSubmitIcon/index.tsx +73 -0
- package/src/care/components/organisms/bookingSearchBar/types.ts +12 -0
- package/src/care/components/organisms/bookingSearchBar/useAnimatedPlaceholder.ts +86 -0
- package/src/care/components/organisms/bookingSearchBar/useSearchBarApi.ts +150 -0
- package/src/care/components/organisms/bookingSearchBar/utils/Typewriter.ts +437 -0
- package/src/care/index.ts +6 -0
- package/src/care/interfaces/constants.ts +75 -0
- package/src/care/interfaces/types.ts +258 -0
- package/src/components/atoms/alert/__snapshots__/index.test.tsx.snap +130 -0
- package/src/components/atoms/alert/index.stories.tsx +21 -0
- package/src/components/atoms/alert/index.styled.tsx +44 -0
- package/src/components/atoms/alert/index.test.tsx +28 -0
- package/src/components/atoms/alert/index.tsx +47 -0
- package/src/components/atoms/avatar/index.stories.tsx +49 -0
- package/src/components/atoms/avatar/index.styled.tsx +96 -0
- package/src/components/atoms/avatar/index.tsx +91 -0
- package/src/components/atoms/badge/__snapshots__/index.test.tsx.snap +61 -0
- package/src/components/atoms/badge/index.stories.tsx +71 -0
- package/src/components/atoms/badge/index.styled.tsx +138 -0
- package/src/components/atoms/badge/index.test.tsx +27 -0
- package/src/components/atoms/badge/index.tsx +45 -0
- package/src/components/atoms/borderHeading/index.stories.tsx +38 -0
- package/src/components/atoms/borderHeading/index.styled.tsx +50 -0
- package/src/components/atoms/borderHeading/index.tsx +39 -0
- package/src/components/atoms/button/__snapshots__/index.test.tsx.snap +57 -0
- package/src/components/atoms/button/index.stories.tsx +107 -0
- package/src/components/atoms/button/index.styled.tsx +335 -0
- package/src/components/atoms/button/index.test.tsx +25 -0
- package/src/components/atoms/button/index.tsx +207 -0
- package/src/components/atoms/checkbox/__snapshots__/index.test.tsx.snap +120 -0
- package/src/components/atoms/checkbox/index.stories.tsx +30 -0
- package/src/components/atoms/checkbox/index.styled.tsx +90 -0
- package/src/components/atoms/checkbox/index.test.tsx +31 -0
- package/src/components/atoms/checkbox/index.tsx +48 -0
- package/src/components/atoms/container/index.styled.tsx +16 -0
- package/src/components/atoms/container/index.tsx +21 -0
- package/src/components/atoms/displayWrapper/index.styled.tsx +19 -0
- package/src/components/atoms/displayWrapper/index.tsx +66 -0
- package/src/components/atoms/divider/__snapshots__/index.test.tsx.snap +14 -0
- package/src/components/atoms/divider/index.stories.tsx +19 -0
- package/src/components/atoms/divider/index.styled.tsx +10 -0
- package/src/components/atoms/divider/index.test.tsx +22 -0
- package/src/components/atoms/divider/index.tsx +34 -0
- package/src/components/atoms/fileDropdown/__snapshots__/index.test.tsx.snap +143 -0
- package/src/components/atoms/fileDropdown/index.stories.tsx +41 -0
- package/src/components/atoms/fileDropdown/index.styled.tsx +112 -0
- package/src/components/atoms/fileDropdown/index.test.tsx +46 -0
- package/src/components/atoms/fileDropdown/index.tsx +200 -0
- package/src/components/atoms/flag/__snapshots__/index.test.tsx.snap +59 -0
- package/src/components/atoms/flag/icons/cambodia.tsx +24 -0
- package/src/components/atoms/flag/icons/english.tsx +195 -0
- package/src/components/atoms/flag/icons/india.tsx +24 -0
- package/src/components/atoms/flag/icons/indonesia.tsx +55 -0
- package/src/components/atoms/flag/icons/malaysia.tsx +89 -0
- package/src/components/atoms/flag/icons/myanmar.tsx +105 -0
- package/src/components/atoms/flag/icons/philippines.tsx +24 -0
- package/src/components/atoms/flag/icons/taiwan.tsx +154 -0
- package/src/components/atoms/flag/icons/thailand.tsx +55 -0
- package/src/components/atoms/flag/icons/vietnam.tsx +57 -0
- package/src/components/atoms/flag/index.stories.tsx +30 -0
- package/src/components/atoms/flag/index.styled.tsx +18 -0
- package/src/components/atoms/flag/index.test.tsx +21 -0
- package/src/components/atoms/flag/index.tsx +150 -0
- package/src/components/atoms/grid/__snapshots__/index.test.tsx.snap +38 -0
- package/src/components/atoms/grid/index.stories.tsx +50 -0
- package/src/components/atoms/grid/index.styled.tsx +34 -0
- package/src/components/atoms/grid/index.test.tsx +26 -0
- package/src/components/atoms/grid/index.tsx +61 -0
- package/src/components/atoms/heading/__snapshots__/index.test.tsx.snap +38 -0
- package/src/components/atoms/heading/index.stories.tsx +27 -0
- package/src/components/atoms/heading/index.styled.tsx +108 -0
- package/src/components/atoms/heading/index.test.tsx +23 -0
- package/src/components/atoms/heading/index.tsx +59 -0
- package/src/components/atoms/icons/Ask.tsx +54 -0
- package/src/components/atoms/icons/BarChart.tsx +39 -0
- package/src/components/atoms/icons/Booking.tsx +37 -0
- package/src/components/atoms/icons/Bookmark.tsx +44 -0
- package/src/components/atoms/icons/Community.tsx +46 -0
- package/src/components/atoms/icons/EditSpecial.tsx +30 -0
- package/src/components/atoms/icons/Family.tsx +37 -0
- package/src/components/atoms/icons/Font.tsx +37 -0
- package/src/components/atoms/icons/Heart.tsx +37 -0
- package/src/components/atoms/icons/Home.tsx +54 -0
- package/src/components/atoms/icons/Like.tsx +49 -0
- package/src/components/atoms/icons/MyCommunity.tsx +37 -0
- package/src/components/atoms/icons/PlusSpecial.tsx +30 -0
- package/src/components/atoms/icons/Recalculate.tsx +37 -0
- package/src/components/atoms/icons/Scale.tsx +44 -0
- package/src/components/atoms/icons/Share.tsx +37 -0
- package/src/components/atoms/icons/Stethoscope.tsx +37 -0
- package/src/components/atoms/icons/index.stories.tsx +50 -0
- package/src/components/atoms/icons/index.ts +46 -0
- package/src/components/atoms/index.ts +33 -0
- package/src/components/atoms/input/__snapshots__/index.test.tsx.snap +137 -0
- package/src/components/atoms/input/delete.svg +3 -0
- package/src/components/atoms/input/index.stories.tsx +50 -0
- package/src/components/atoms/input/index.styled.tsx +124 -0
- package/src/components/atoms/input/index.test.tsx +23 -0
- package/src/components/atoms/input/index.tsx +140 -0
- package/src/components/atoms/label/__snapshots__/index.test.tsx.snap +21 -0
- package/src/components/atoms/label/index.stories.tsx +16 -0
- package/src/components/atoms/label/index.test.tsx +25 -0
- package/src/components/atoms/label/index.tsx +37 -0
- package/src/components/atoms/logo/__snapshots__/index.test.tsx.snap +99 -0
- package/src/components/atoms/logo/index.stories.tsx +84 -0
- package/src/components/atoms/logo/index.test.tsx +18 -0
- package/src/components/atoms/logo/index.tsx +1915 -0
- package/src/components/atoms/marryBabyText/index.styled.tsx +86 -0
- package/src/components/atoms/marryBabyText/index.tsx +57 -0
- package/src/components/atoms/pagination/__snapshots__/index.test.tsx.snap +185 -0
- package/src/components/atoms/pagination/index.stories.tsx +92 -0
- package/src/components/atoms/pagination/index.styled.tsx +73 -0
- package/src/components/atoms/pagination/index.test.tsx +26 -0
- package/src/components/atoms/pagination/index.tsx +286 -0
- package/src/components/atoms/progress/index.stories.tsx +55 -0
- package/src/components/atoms/progress/index.styled.tsx +30 -0
- package/src/components/atoms/progress/index.tsx +29 -0
- package/src/components/atoms/pureInput/__snapshots__/index.test.tsx.snap +135 -0
- package/src/components/atoms/pureInput/delete.svg +3 -0
- package/src/components/atoms/pureInput/index.stories.tsx +54 -0
- package/src/components/atoms/pureInput/index.styled.tsx +123 -0
- package/src/components/atoms/pureInput/index.test.tsx +29 -0
- package/src/components/atoms/pureInput/index.tsx +162 -0
- package/src/components/atoms/radio/__snapshots__/index.test.tsx.snap +163 -0
- package/src/components/atoms/radio/index.stories.tsx +48 -0
- package/src/components/atoms/radio/index.styled.tsx +133 -0
- package/src/components/atoms/radio/index.test.tsx +31 -0
- package/src/components/atoms/radio/index.tsx +66 -0
- package/src/components/atoms/rateStars/index.stories.tsx +71 -0
- package/src/components/atoms/rateStars/index.styled.tsx +17 -0
- package/src/components/atoms/rateStars/index.tsx +101 -0
- package/src/components/atoms/shadow/__snapshots__/index.test.tsx.snap +37 -0
- package/src/components/atoms/shadow/index.stories.tsx +55 -0
- package/src/components/atoms/shadow/index.styled.tsx +31 -0
- package/src/components/atoms/shadow/index.test.tsx +25 -0
- package/src/components/atoms/shadow/index.tsx +20 -0
- package/src/components/atoms/slider/__snapshots__/index.test.tsx.snap +172 -0
- package/src/components/atoms/slider/index.stories.tsx +22 -0
- package/src/components/atoms/slider/index.styled.tsx +68 -0
- package/src/components/atoms/slider/index.test.tsx +27 -0
- package/src/components/atoms/slider/index.tsx +140 -0
- package/src/components/atoms/tag/__snapshots__/index.test.tsx.snap +72 -0
- package/src/components/atoms/tag/index.stories.tsx +54 -0
- package/src/components/atoms/tag/index.styled.tsx +184 -0
- package/src/components/atoms/tag/index.test.tsx +23 -0
- package/src/components/atoms/tag/index.tsx +72 -0
- package/src/components/atoms/text/index.stories.tsx +24 -0
- package/src/components/atoms/text/index.styled.tsx +231 -0
- package/src/components/atoms/text/index.tsx +99 -0
- package/src/components/atoms/textArea/index.stories.tsx +30 -0
- package/src/components/atoms/textArea/index.tsx +86 -0
- package/src/components/atoms/textDivider/index.tsx +48 -0
- package/src/components/atoms/toggle/__snapshots__/index.test.tsx.snap +73 -0
- package/src/components/atoms/toggle/index.stories.tsx +38 -0
- package/src/components/atoms/toggle/index.styled.tsx +55 -0
- package/src/components/atoms/toggle/index.test.tsx +27 -0
- package/src/components/atoms/toggle/index.tsx +28 -0
- package/src/components/atoms/underlinedLink/index.stories.tsx +35 -0
- package/src/components/atoms/underlinedLink/index.styled.tsx +66 -0
- package/src/components/atoms/underlinedLink/index.text.tsx +23 -0
- package/src/components/atoms/underlinedLink/index.tsx +30 -0
- package/src/components/atoms/uploader/__snapshots__/index.test.tsx.snap +170 -0
- package/src/components/atoms/uploader/index.stories.tsx +128 -0
- package/src/components/atoms/uploader/index.styled.tsx +53 -0
- package/src/components/atoms/uploader/index.test.tsx +96 -0
- package/src/components/atoms/uploader/index.tsx +107 -0
- package/src/components/index.ts +3 -0
- package/src/components/molecules/ampNextPage/index.tsx +48 -0
- package/src/components/molecules/articleCard/bookmark.png +0 -0
- package/src/components/molecules/articleCard/bookmarked.png +0 -0
- package/src/components/molecules/articleCard/index.stories.tsx +222 -0
- package/src/components/molecules/articleCard/index.styled.tsx +391 -0
- package/src/components/molecules/articleCard/index.tsx +430 -0
- package/src/components/molecules/breadcrumbs/__snapshots__/index.test.tsx.snap +173 -0
- package/src/components/molecules/breadcrumbs/index.stories.tsx +79 -0
- package/src/components/molecules/breadcrumbs/index.styled.tsx +99 -0
- package/src/components/molecules/breadcrumbs/index.test.tsx +45 -0
- package/src/components/molecules/breadcrumbs/index.tsx +141 -0
- package/src/components/molecules/carousel/index.stories.tsx +40 -0
- package/src/components/molecules/carousel/index.styled.tsx +115 -0
- package/src/components/molecules/carousel/index.tsx +178 -0
- package/src/components/molecules/categoryCard/index.stories.tsx +19 -0
- package/src/components/molecules/categoryCard/index.styled.tsx +38 -0
- package/src/components/molecules/categoryCard/index.tsx +51 -0
- package/src/components/molecules/checkboxGroup/__snapshots__/index.test.tsx.snap +214 -0
- package/src/components/molecules/checkboxGroup/index.stories.tsx +118 -0
- package/src/components/molecules/checkboxGroup/index.styled.tsx +27 -0
- package/src/components/molecules/checkboxGroup/index.test.tsx +36 -0
- package/src/components/molecules/checkboxGroup/index.tsx +66 -0
- package/src/components/molecules/cookieAcceptConfirm/__snapshots__/index.test.tsx.snap +152 -0
- package/src/components/molecules/cookieAcceptConfirm/index.stories.tsx +23 -0
- package/src/components/molecules/cookieAcceptConfirm/index.styled.tsx +101 -0
- package/src/components/molecules/cookieAcceptConfirm/index.test.tsx +23 -0
- package/src/components/molecules/cookieAcceptConfirm/index.tsx +78 -0
- package/src/components/molecules/cookieAcceptConfirm/info.svg +3 -0
- package/src/components/molecules/datePicker/__snapshots__/index.test.tsx.snap +377 -0
- package/src/components/molecules/datePicker/index.stories.tsx +55 -0
- package/src/components/molecules/datePicker/index.styled.tsx +374 -0
- package/src/components/molecules/datePicker/index.test.tsx +46 -0
- package/src/components/molecules/datePicker/index.tsx +361 -0
- package/src/components/molecules/dateRangePicker/calendar/index.styled.ts +122 -0
- package/src/components/molecules/dateRangePicker/calendar/index.tsx +247 -0
- package/src/components/molecules/dateRangePicker/index.stories.tsx +45 -0
- package/src/components/molecules/dateRangePicker/index.styled.ts +36 -0
- package/src/components/molecules/dateRangePicker/index.tsx +103 -0
- package/src/components/molecules/dateRangePicker/types.ts +4 -0
- package/src/components/molecules/dateRangePicker/utils.ts +26 -0
- package/src/components/molecules/doctorInfo/index.stories.tsx +20 -0
- package/src/components/molecules/doctorInfo/index.tsx +54 -0
- package/src/components/molecules/dropdown/__snapshots__/index.test.tsx.snap +133 -0
- package/src/components/molecules/dropdown/index.stories.tsx +158 -0
- package/src/components/molecules/dropdown/index.styled.tsx +149 -0
- package/src/components/molecules/dropdown/index.test.tsx +45 -0
- package/src/components/molecules/dropdown/index.tsx +143 -0
- package/src/components/molecules/dropdownSearch/index.stories.tsx +66 -0
- package/src/components/molecules/dropdownSearch/index.styled.tsx +157 -0
- package/src/components/molecules/dropdownSearch/index.tsx +169 -0
- package/src/components/molecules/dropdownSearch/search.svg +4 -0
- package/src/components/molecules/floatButtonGroup/add-period.svg +9 -0
- package/src/components/molecules/floatButtonGroup/index.stories.tsx +72 -0
- package/src/components/molecules/floatButtonGroup/index.styled.tsx +310 -0
- package/src/components/molecules/floatButtonGroup/index.tsx +155 -0
- package/src/components/molecules/iconText/__snapshots__/index.test.tsx.snap +64 -0
- package/src/components/molecules/iconText/index.stories.tsx +22 -0
- package/src/components/molecules/iconText/index.styled.tsx +47 -0
- package/src/components/molecules/iconText/index.test.tsx +31 -0
- package/src/components/molecules/iconText/index.tsx +33 -0
- package/src/components/molecules/index.ts +39 -0
- package/src/components/molecules/languageSwitcher/index.stories.tsx +32 -0
- package/src/components/molecules/languageSwitcher/index.styled.tsx +23 -0
- package/src/components/molecules/languageSwitcher/index.tsx +68 -0
- package/src/components/molecules/languageSwitcher/tooltipSelection/index.styled.tsx +69 -0
- package/src/components/molecules/languageSwitcher/tooltipSelection/index.tsx +84 -0
- package/src/components/molecules/mobileBottomNavigation/MobileBottomNavigationIcon.tsx +51 -0
- package/src/components/molecules/mobileBottomNavigation/index.stories.tsx +173 -0
- package/src/components/molecules/mobileBottomNavigation/index.styled.tsx +150 -0
- package/src/components/molecules/mobileBottomNavigation/index.tsx +41 -0
- package/src/components/molecules/modal/__snapshots__/index.test.tsx.snap +3 -0
- package/src/components/molecules/modal/index.stories.tsx +139 -0
- package/src/components/molecules/modal/index.styled.tsx +146 -0
- package/src/components/molecules/modal/index.test.tsx +26 -0
- package/src/components/molecules/modal/index.tsx +147 -0
- package/src/components/molecules/popup/__snapshots__/index.test.tsx.snap +102 -0
- package/src/components/molecules/popup/index.stories.tsx +21 -0
- package/src/components/molecules/popup/index.styled.tsx +90 -0
- package/src/components/molecules/popup/index.test.tsx +26 -0
- package/src/components/molecules/popup/index.tsx +45 -0
- package/src/components/molecules/progressBar/__snapshots__/index.test.tsx.snap +167 -0
- package/src/components/molecules/progressBar/index.stories.tsx +72 -0
- package/src/components/molecules/progressBar/index.styled.tsx +182 -0
- package/src/components/molecules/progressBar/index.test.tsx +75 -0
- package/src/components/molecules/progressBar/index.tsx +245 -0
- package/src/components/molecules/radioGroup/__snapshots__/index.test.tsx.snap +290 -0
- package/src/components/molecules/radioGroup/index.stories.tsx +131 -0
- package/src/components/molecules/radioGroup/index.styled.tsx +75 -0
- package/src/components/molecules/radioGroup/index.test.tsx +33 -0
- package/src/components/molecules/radioGroup/index.tsx +80 -0
- package/src/components/molecules/scrollList/index.stories.tsx +113 -0
- package/src/components/molecules/scrollList/index.styled.tsx +140 -0
- package/src/components/molecules/scrollList/index.tsx +786 -0
- package/src/components/molecules/seoHead/index.tsx +382 -0
- package/src/components/molecules/sidemenu/__snapshots__/index.test.tsx.snap +273 -0
- package/src/components/molecules/sidemenu/index.stories.tsx +156 -0
- package/src/components/molecules/sidemenu/index.test.tsx +56 -0
- package/src/components/molecules/sidemenu/index.tsx +4 -0
- package/src/components/molecules/sidemenu/menuLink.tsx +78 -0
- package/src/components/molecules/sidemenu/sideHeader.tsx +85 -0
- package/src/components/molecules/sidemenu/sideMenu.tsx +39 -0
- package/src/components/molecules/sidemenu/test.tsx +94 -0
- package/src/components/molecules/sidemenu/userInfo.tsx +44 -0
- package/src/components/molecules/starsRatingBox/index.stories.tsx +121 -0
- package/src/components/molecules/starsRatingBox/index.styled.tsx +23 -0
- package/src/components/molecules/starsRatingBox/index.tsx +83 -0
- package/src/components/molecules/statisticCard/__snapshots__/index.test.tsx.snap +86 -0
- package/src/components/molecules/statisticCard/index.stories.tsx +40 -0
- package/src/components/molecules/statisticCard/index.styled.tsx +47 -0
- package/src/components/molecules/statisticCard/index.test.tsx +44 -0
- package/src/components/molecules/statisticCard/index.tsx +48 -0
- package/src/components/molecules/surveyQuestionCard/__snapshots__/index.test.tsx.snap +743 -0
- package/src/components/molecules/surveyQuestionCard/index.stories.tsx +115 -0
- package/src/components/molecules/surveyQuestionCard/index.styled.tsx +220 -0
- package/src/components/molecules/surveyQuestionCard/index.test.tsx +53 -0
- package/src/components/molecules/surveyQuestionCard/index.tsx +2 -0
- package/src/components/molecules/surveyQuestionCard/surveyQuestionCard.tsx +213 -0
- package/src/components/molecules/surveyQuestionCard/surveyQuestionContent.tsx +200 -0
- package/src/components/molecules/surveyQuestionCard/surveyRadio.tsx +69 -0
- package/src/components/molecules/surveyQuestionCard/surveyThankyouCard.tsx +129 -0
- package/src/components/molecules/table/__snapshots__/index.test.tsx.snap +56 -0
- package/src/components/molecules/table/index.stories.tsx +264 -0
- package/src/components/molecules/table/index.test.tsx +29 -0
- package/src/components/molecules/table/index.tsx +5 -0
- package/src/components/molecules/table/table.tsx +38 -0
- package/src/components/molecules/table/tableBody.tsx +46 -0
- package/src/components/molecules/table/tableCell.tsx +47 -0
- package/src/components/molecules/table/tableHead.tsx +46 -0
- package/src/components/molecules/table/tableRow.tsx +45 -0
- package/src/components/molecules/tabs/__snapshots__/index.test.tsx.snap +104 -0
- package/src/components/molecules/tabs/index.stories.tsx +45 -0
- package/src/components/molecules/tabs/index.styled.tsx +58 -0
- package/src/components/molecules/tabs/index.test.tsx +49 -0
- package/src/components/molecules/tabs/index.tsx +89 -0
- package/src/components/organisms/footer/discoverFooter/index.styled.tsx +286 -0
- package/src/components/organisms/footer/discoverFooter/index.tsx +448 -0
- package/src/components/organisms/footer/index.stories.tsx +207 -0
- package/src/components/organisms/footer/index.tsx +70 -0
- package/src/components/organisms/footer/maryBabyFooter/index.styled.tsx +502 -0
- package/src/components/organisms/footer/maryBabyFooter/index.tsx +393 -0
- package/src/components/organisms/index.ts +31 -0
- package/src/components/organisms/navigationBookingButton/index.styled.tsx +11 -0
- package/src/components/organisms/navigationBookingButton/index.tsx +53 -0
- package/src/components/organisms/navigationLayout/CustomFooter.tsx +154 -0
- package/src/components/organisms/navigationLayout/ampSideBar/index.styled.tsx +151 -0
- package/src/components/organisms/navigationLayout/ampSideBar/index.tsx +276 -0
- package/src/components/organisms/navigationLayout/assets/check.svg +3 -0
- package/src/components/organisms/navigationLayout/assets/chevronDown.svg +3 -0
- package/src/components/organisms/navigationLayout/assets/chevronRightWhite.svg +3 -0
- package/src/components/organisms/navigationLayout/assets/chevronUpBlue.svg +3 -0
- package/src/components/organisms/navigationLayout/assets/closeLight.svg +4 -0
- package/src/components/organisms/navigationLayout/assets/closeWhite.svg +4 -0
- package/src/components/organisms/navigationLayout/assets/hamburgerMenu.svg +5 -0
- package/src/components/organisms/navigationLayout/assets/index.js +19 -0
- package/src/components/organisms/navigationLayout/assets/info-light.svg +5 -0
- package/src/components/organisms/navigationLayout/constants.ts +958 -0
- package/src/components/organisms/navigationLayout/footer/index.styled.tsx +286 -0
- package/src/components/organisms/navigationLayout/footer/index.tsx +449 -0
- package/src/components/organisms/navigationLayout/index.stories.tsx +273 -0
- package/src/components/organisms/navigationLayout/index.styled.tsx +153 -0
- package/src/components/organisms/navigationLayout/index.tsx +1272 -0
- package/src/components/organisms/navigationLayout/languageWrapper.tsx +19 -0
- package/src/components/organisms/navigationLayout/languages/default.ts +63 -0
- package/src/components/organisms/navigationLayout/layout.tsx +406 -0
- package/src/components/organisms/navigationLayout/marryBabyText/index.styled.tsx +86 -0
- package/src/components/organisms/navigationLayout/marryBabyText/index.tsx +57 -0
- package/src/components/organisms/navigationLayout/maryBabyFooter/index.styled.tsx +502 -0
- package/src/components/organisms/navigationLayout/maryBabyFooter/index.tsx +383 -0
- package/src/components/organisms/navigationLayout/menuCareList/categorySkeleton.tsx +25 -0
- package/src/components/organisms/navigationLayout/menuCareList/index.styled.tsx +156 -0
- package/src/components/organisms/navigationLayout/menuCareList/index.tsx +266 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/categorySkeleton.tsx +25 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/helloSites.tsx +419 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/index.styled.tsx +196 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/index.tsx +92 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/marryBaby.styled.tsx +151 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/marryBaby.tsx +409 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/spotlightsList/index.styled.tsx +147 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/spotlightsList/index.tsx +141 -0
- package/src/components/organisms/navigationLayout/menuCategoriesList/spotlightsList/spotlightSkeleton.tsx +25 -0
- package/src/components/organisms/navigationLayout/menuCommunitiesList/categorySkeleton.tsx +25 -0
- package/src/components/organisms/navigationLayout/menuCommunitiesList/helloSites.tsx +309 -0
- package/src/components/organisms/navigationLayout/menuCommunitiesList/index.styled.tsx +162 -0
- package/src/components/organisms/navigationLayout/menuCommunitiesList/index.tsx +80 -0
- package/src/components/organisms/navigationLayout/menuCommunitiesList/marryBaby.styled.tsx +119 -0
- package/src/components/organisms/navigationLayout/menuCommunitiesList/marryBaby.tsx +181 -0
- package/src/components/organisms/navigationLayout/menuHealthToolsList/categorySkeleton.tsx +25 -0
- package/src/components/organisms/navigationLayout/menuHealthToolsList/helloSites.tsx +364 -0
- package/src/components/organisms/navigationLayout/menuHealthToolsList/index.styled.tsx +176 -0
- package/src/components/organisms/navigationLayout/menuHealthToolsList/index.tsx +83 -0
- package/src/components/organisms/navigationLayout/menuHealthToolsList/marryBaby.tsx +166 -0
- package/src/components/organisms/navigationLayout/menuHealthToolsList/marrybaby.styled.tsx +118 -0
- package/src/components/organisms/navigationLayout/menuSectionCard/cardSkeleton.tsx +32 -0
- package/src/components/organisms/navigationLayout/menuSectionCard/index.styled.tsx +46 -0
- package/src/components/organisms/navigationLayout/menuSectionCard/index.tsx +52 -0
- package/src/components/organisms/navigationLayout/menuServiceList/categoriesSubList.tsx +121 -0
- package/src/components/organisms/navigationLayout/menuServiceList/communitySubList.tsx +143 -0
- package/src/components/organisms/navigationLayout/menuServiceList/index.styled.tsx +460 -0
- package/src/components/organisms/navigationLayout/menuServiceList/index.tsx +746 -0
- package/src/components/organisms/navigationLayout/menuServiceList/marryBabyMobileMenuSection.tsx +239 -0
- package/src/components/organisms/navigationLayout/navigationBar/ArrowLeftPopupIcon.tsx +21 -0
- package/src/components/organisms/navigationLayout/navigationBar/ClosePopupIcon.tsx +20 -0
- package/src/components/organisms/navigationLayout/navigationBar/HamburgerIcon.tsx +43 -0
- package/src/components/organisms/navigationLayout/navigationBar/NavigationBar.types.ts +99 -0
- package/src/components/organisms/navigationLayout/navigationBar/NavigationBarMobile.tsx +503 -0
- package/src/components/organisms/navigationLayout/navigationBar/SearchIcon.tsx +22 -0
- package/src/components/organisms/navigationLayout/navigationBar/index.styled.tsx +540 -0
- package/src/components/organisms/navigationLayout/navigationBar/index.tsx +798 -0
- package/src/components/organisms/navigationLayout/navigationLogoutPopup/index.styled.tsx +87 -0
- package/src/components/organisms/navigationLayout/navigationLogoutPopup/index.tsx +95 -0
- package/src/components/organisms/navigationLayout/profilePopup/index.tsx +102 -0
- package/src/components/organisms/navigationLayout/profilePopupWrapper/index.styled.tsx +164 -0
- package/src/components/organisms/navigationLayout/profilePopupWrapper/index.tsx +58 -0
- package/src/components/organisms/navigationLayout/siteWide/index.styled.tsx +116 -0
- package/src/components/organisms/navigationLayout/siteWide/index.tsx +162 -0
- package/src/components/organisms/navigationLayout/sponsoredBy/index.styled.tsx +119 -0
- package/src/components/organisms/navigationLayout/sponsoredBy/index.tsx +254 -0
- package/src/components/organisms/navigationLayout/tooltipSelection/index.styled.tsx +66 -0
- package/src/components/organisms/navigationLayout/tooltipSelection/index.tsx +81 -0
- package/src/components/organisms/navigationLayout/types.ts +322 -0
- package/src/components/organisms/navigationLayout/utils.tsx +424 -0
- package/src/components/organisms/navigationLogoutPopup/index.stories.tsx +34 -0
- package/src/components/organisms/navigationLogoutPopup/index.styled.tsx +87 -0
- package/src/components/organisms/navigationLogoutPopup/index.tsx +78 -0
- package/src/components/organisms/navigationProfileButton/index.stories.tsx +51 -0
- package/src/components/organisms/navigationProfileButton/index.styled.tsx +254 -0
- package/src/components/organisms/navigationProfileButton/index.tsx +217 -0
- package/src/components/organisms/navigationProfileButton/popupWrapper.tsx +58 -0
- package/src/components/organisms/navigationProfileButton/profilePopup.tsx +97 -0
- package/src/components/organisms/navigationV2/components/atoms/ArrowLeftPopupIcon.tsx +21 -0
- package/src/components/organisms/navigationV2/components/atoms/ClosePopupIcon.tsx +21 -0
- package/src/components/organisms/navigationV2/components/atoms/HamburgerIcon.tsx +58 -0
- package/src/components/organisms/navigationV2/components/atoms/ItemNav/index.styled.tsx +63 -0
- package/src/components/organisms/navigationV2/components/atoms/ItemNav/index.tsx +71 -0
- package/src/components/organisms/navigationV2/components/atoms/PopupWrapper/btnClosePopup.tsx +30 -0
- package/src/components/organisms/navigationV2/components/atoms/PopupWrapper/index.styled.tsx +62 -0
- package/src/components/organisms/navigationV2/components/atoms/PopupWrapper/index.tsx +45 -0
- package/src/components/organisms/navigationV2/components/atoms/SearchIcon.tsx +22 -0
- package/src/components/organisms/navigationV2/components/atoms/searchInput/index.tsx +45 -0
- package/src/components/organisms/navigationV2/components/molecules/Categories/index.styled.tsx +74 -0
- package/src/components/organisms/navigationV2/components/molecules/Categories/index.tsx +115 -0
- package/src/components/organisms/navigationV2/components/molecules/Spotlights/index.styled.tsx +40 -0
- package/src/components/organisms/navigationV2/components/molecules/Spotlights/index.tsx +60 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCareList/Item/index.styled.tsx +155 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCareList/Item/index.tsx +103 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCareList/careSpotlights.tsx +40 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCareList/index.styled.tsx +29 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCareList/index.tsx +65 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCategoriesList/Item/index.styled.tsx +46 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCategoriesList/Item/index.tsx +50 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCategoriesList/categorySpotlights.tsx +59 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCategoriesList/index.styled.tsx +30 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCategoriesList/index.tsx +64 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCommunitiesList/Item/index.styled.tsx +89 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCommunitiesList/Item/index.tsx +91 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCommunitiesList/communitySpotlights.tsx +49 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCommunitiesList/index.styled.tsx +42 -0
- package/src/components/organisms/navigationV2/components/molecules/menuCommunitiesList/index.tsx +56 -0
- package/src/components/organisms/navigationV2/components/molecules/menuHealthToolsList/Item/index.styled.tsx +104 -0
- package/src/components/organisms/navigationV2/components/molecules/menuHealthToolsList/Item/index.tsx +99 -0
- package/src/components/organisms/navigationV2/components/molecules/menuHealthToolsList/index.styled.tsx +18 -0
- package/src/components/organisms/navigationV2/components/molecules/menuHealthToolsList/index.tsx +65 -0
- package/src/components/organisms/navigationV2/components/molecules/menuHealthToolsList/toolSpotlights.tsx +41 -0
- package/src/components/organisms/navigationV2/components/molecules/menuServiceList/index.styled.tsx +358 -0
- package/src/components/organisms/navigationV2/components/molecules/menuServiceList/index.tsx +88 -0
- package/src/components/organisms/navigationV2/components/molecules/navigationBar/hamburgerMenu.tsx +74 -0
- package/src/components/organisms/navigationV2/components/molecules/navigationBar/index.styled.tsx +214 -0
- package/src/components/organisms/navigationV2/components/molecules/navigationBar/index.tsx +283 -0
- package/src/components/organisms/navigationV2/components/molecules/navigationBar/navigationProfileButtonWithContext.tsx +50 -0
- package/src/components/organisms/navigationV2/components/molecules/spotlightNoData/index.styled.tsx +70 -0
- package/src/components/organisms/navigationV2/components/molecules/spotlightNoData/index.tsx +74 -0
- package/src/components/organisms/navigationV2/constants.ts +277 -0
- package/src/components/organisms/navigationV2/hooks/useHeaderHeight.tsx +84 -0
- package/src/components/organisms/navigationV2/hooks/useInsider.tsx +67 -0
- package/src/components/organisms/navigationV2/hooks/useNavConfig.tsx +99 -0
- package/src/components/organisms/navigationV2/hooks/useNavServices.tsx +73 -0
- package/src/components/organisms/navigationV2/index.stories.tsx +287 -0
- package/src/components/organisms/navigationV2/index.styled.tsx +30 -0
- package/src/components/organisms/navigationV2/index.tsx +320 -0
- package/src/components/organisms/navigationV2/navigationContext.tsx +38 -0
- package/src/components/organisms/navigationV2/types.ts +307 -0
- package/src/components/organisms/navigationV2/utils.tsx +400 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-chevronDown.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-chevronRight.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-eCom.svg +22 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-helpCircle.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-logOut.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-myBooking.svg +36 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-myCommunity.svg +19 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-myFamily.svg +15 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-myHealth.svg +13 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-mySaved.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-rank-ambassador.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-rank-doctor.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-rank-expert.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-rank-influencer.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-rank-member.svg +8 -0
- package/src/components/organisms/userProfileNavigation/assets/helloSites/icon-settingsWheel.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-arrowRight.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-lock.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-logOut.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-myCommunity.svg +4 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-myHealth.svg +6 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-mySaved.svg +3 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-rank-ambassador.svg +40 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-rank-doctor.svg +40 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-rank-expert.svg +27 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-rank-influencer.svg +33 -0
- package/src/components/organisms/userProfileNavigation/assets/marryBaby/icon-rank-member.svg +33 -0
- package/src/components/organisms/userProfileNavigation/constants.ts +23 -0
- package/src/components/organisms/userProfileNavigation/index.stories.tsx +79 -0
- package/src/components/organisms/userProfileNavigation/index.styled.ts +60 -0
- package/src/components/organisms/userProfileNavigation/index.tsx +219 -0
- package/src/components/organisms/userProfileNavigation/navHeader/index.styled.ts +76 -0
- package/src/components/organisms/userProfileNavigation/navHeader/index.tsx +68 -0
- package/src/components/organisms/userProfileNavigation/navMenu/index.styled.ts +115 -0
- package/src/components/organisms/userProfileNavigation/navMenu/index.tsx +79 -0
- package/src/components/organisms/userProfileNavigation/navMenu/items.ts +38 -0
- package/src/components/organisms/userProfileNavigation/navigationCard/index.styled.ts +51 -0
- package/src/components/organisms/userProfileNavigation/navigationCard/index.tsx +96 -0
- package/src/components/organisms/userProfileNavigation/types.ts +35 -0
- package/src/components/organisms/userProfileNavigation/userStats/index.styled.ts +110 -0
- package/src/components/organisms/userProfileNavigation/userStats/index.tsx +78 -0
- package/src/core.ts +7 -0
- package/src/docs/releases/getReleases.js +56 -0
- package/src/docs/releases/index.stories.mdx +9 -0
- package/src/ecom/dataFormatter/index.ts +933 -0
- package/src/ecom/dataFormatter/lib/apiTypes.ts +623 -0
- package/src/ecom/dataFormatter/lib/dataTypes.ts +571 -0
- package/src/ecom/dataFormatter/lib/utils.ts +40 -0
- package/src/ecom/index.tsx +5 -0
- package/src/ecom/interfaces/constants.ts +1000 -0
- package/src/ecom/interfaces/types.ts +194 -0
- package/src/hooks/useCSSFocusPopupHelper.ts +32 -0
- package/src/hooks/useDragScroll.ts +55 -0
- package/src/hooks/useDropdownSearch.tsx +52 -0
- package/src/hooks/useFbDataLayer.tsx +49 -0
- package/src/hooks/useGeolocation.ts +86 -0
- package/src/hooks/useGetIsMobile.ts +20 -0
- package/src/hooks/useImagesPicker.ts +56 -0
- package/src/hooks/useIsInit.ts +9 -0
- package/src/hooks/useOutsideClick.ts +20 -0
- package/src/hooks/useScreenSize.ts +35 -0
- package/src/hooks/useScrollbarSize.ts +74 -0
- package/src/hooks/useTranslations.tsx +41 -0
- package/src/i18n/en-PH.json +235 -0
- package/src/i18n/hi-IN.json +235 -0
- package/src/i18n/id-ID.json +235 -0
- package/src/i18n/index.ts +3 -0
- package/src/i18n/km-KH.json +235 -0
- package/src/i18n/ms-MY.json +235 -0
- package/src/i18n/my-MM.json +235 -0
- package/src/i18n/th-TH.json +235 -0
- package/src/i18n/tl-PH.json +235 -0
- package/src/i18n/translations.ts +47 -0
- package/src/i18n/translationsContext.ts +12 -0
- package/src/i18n/translationsProvider.tsx +66 -0
- package/src/i18n/vi-VN.json +242 -0
- package/src/i18n/zh-TW.json +235 -0
- package/src/index.ts +12 -0
- package/src/interfaces/constants.ts +402 -0
- package/src/interfaces/types.ts +85 -0
- package/src/misc/cookieHelper.tsx +31 -0
- package/src/misc/lazyLoad.ts +7 -0
- package/src/misc/mockTheme.tsx +11 -0
- package/src/misc/number.ts +24 -0
- package/src/misc/routing.tsx +45 -0
- package/src/misc/theme.ts +186 -0
- package/src/misc/utils.ts +214 -0
- package/src/test/testTranslationProvider.tsx +14 -0
- package/src/together/api/dataTransform.ts +650 -0
- package/src/together/api/paths.ts +163 -0
- package/src/together/api/utils.ts +399 -0
- package/src/together/assets/images/avatar-default.png +0 -0
- package/src/together/assets/images/icon-whatsapp.png +0 -0
- package/src/together/assets/images/icon-zalo.png +0 -0
- package/src/together/assets/marrybaby/svg/comment.svg +4 -0
- package/src/together/assets/marrybaby/svg/commentSolid.svg +5 -0
- package/src/together/assets/marrybaby/svg/commentWhite.svg +4 -0
- package/src/together/assets/marrybaby/svg/copy.svg +1 -0
- package/src/together/assets/marrybaby/svg/facebook.svg +9 -0
- package/src/together/assets/marrybaby/svg/heart.svg +4 -0
- package/src/together/assets/marrybaby/svg/heartSolid.svg +4 -0
- package/src/together/assets/marrybaby/svg/linkedin.svg +6 -0
- package/src/together/assets/marrybaby/svg/loading.svg +15 -0
- package/src/together/assets/marrybaby/svg/messenger.svg +17 -0
- package/src/together/assets/marrybaby/svg/more.svg +6 -0
- package/src/together/assets/marrybaby/svg/moreSolid.svg +6 -0
- package/src/together/assets/marrybaby/svg/pin.svg +6 -0
- package/src/together/assets/marrybaby/svg/pinOrange.svg +6 -0
- package/src/together/assets/marrybaby/svg/share.svg +5 -0
- package/src/together/assets/marrybaby/svg/share2.svg +5 -0
- package/src/together/assets/marrybaby/svg/sortBy.svg +5 -0
- package/src/together/assets/marrybaby/svg/twitter.svg +4 -0
- package/src/together/assets/marrybaby/svg/zalo.png +0 -0
- package/src/together/assets/svg/bullet-point.svg +3 -0
- package/src/together/assets/svg/chevronRightActive.svg +3 -0
- package/src/together/assets/svg/close-circle-line.svg +5 -0
- package/src/together/assets/svg/closeLight copy.svg +4 -0
- package/src/together/assets/svg/closeLight.svg +4 -0
- package/src/together/assets/svg/delete.svg +13 -0
- package/src/together/assets/svg/icon-alert-circle-primary.svg +5 -0
- package/src/together/assets/svg/icon-alert-circle-warning.svg +5 -0
- package/src/together/assets/svg/icon-alert-circle.svg +5 -0
- package/src/together/assets/svg/icon-arrow-circle-upgrade.svg +3 -0
- package/src/together/assets/svg/icon-arrow-left.svg +4 -0
- package/src/together/assets/svg/icon-arrow-right-circle.svg +5 -0
- package/src/together/assets/svg/icon-bell-off.svg +7 -0
- package/src/together/assets/svg/icon-bell-on.svg +4 -0
- package/src/together/assets/svg/icon-bookmark-fill.svg +3 -0
- package/src/together/assets/svg/icon-bookmark.svg +3 -0
- package/src/together/assets/svg/icon-cancel.svg +13 -0
- package/src/together/assets/svg/icon-check-gray.svg +3 -0
- package/src/together/assets/svg/icon-check-pink.svg +3 -0
- package/src/together/assets/svg/icon-check-success.svg +4 -0
- package/src/together/assets/svg/icon-check.svg +4 -0
- package/src/together/assets/svg/icon-chevron-left-dark.svg +3 -0
- package/src/together/assets/svg/icon-chevron-right-dark.svg +3 -0
- package/src/together/assets/svg/icon-chevron-right-white.svg +3 -0
- package/src/together/assets/svg/icon-chevron-right.svg +3 -0
- package/src/together/assets/svg/icon-close-circle-line.svg +5 -0
- package/src/together/assets/svg/icon-close-circle.svg +5 -0
- package/src/together/assets/svg/icon-close.svg +4 -0
- package/src/together/assets/svg/icon-edit.svg +3 -0
- package/src/together/assets/svg/icon-enter.svg +4 -0
- package/src/together/assets/svg/icon-facebook.svg +3 -0
- package/src/together/assets/svg/icon-heart-empty.svg +3 -0
- package/src/together/assets/svg/icon-heart-fill-red.svg +3 -0
- package/src/together/assets/svg/icon-heart-fill.svg +3 -0
- package/src/together/assets/svg/icon-kebab.svg +5 -0
- package/src/together/assets/svg/icon-link.svg +4 -0
- package/src/together/assets/svg/icon-linkedin.svg +4 -0
- package/src/together/assets/svg/icon-pin-gray.svg +4 -0
- package/src/together/assets/svg/icon-pin-yellow.svg +4 -0
- package/src/together/assets/svg/icon-pin.svg +4 -0
- package/src/together/assets/svg/icon-reply-arrow.svg +3 -0
- package/src/together/assets/svg/icon-reply-circle-empty.svg +3 -0
- package/src/together/assets/svg/icon-reply-circle-fill.svg +3 -0
- package/src/together/assets/svg/icon-share-on-media.svg +7 -0
- package/src/together/assets/svg/icon-sort-arrow.svg +4 -0
- package/src/together/assets/svg/icon-tab-edit-2.svg +4 -0
- package/src/together/assets/svg/icon-tab-edit-primary.svg +4 -0
- package/src/together/assets/svg/icon-trash-bin.svg +6 -0
- package/src/together/assets/svg/icon-twitter.svg +4 -0
- package/src/together/assets/svg/loading.svg +7 -0
- package/src/together/assets/svg/reviewer-author.svg +12 -0
- package/src/together/assets/svg/reviewer-editor.svg +12 -0
- package/src/together/assets/svg/reviewer-expert.svg +5 -0
- package/src/together/assets/svg/reviewer-fact-check.svg +4 -0
- package/src/together/assets/svg/reviewer-medical.svg +4 -0
- package/src/together/components/atoms/cardLink/index.styled.tsx +64 -0
- package/src/together/components/atoms/cardLink/index.tsx +149 -0
- package/src/together/components/atoms/cardReactions/index.styled.tsx +96 -0
- package/src/together/components/atoms/cardReactions/index.tsx +221 -0
- package/src/together/components/atoms/index.tsx +8 -0
- package/src/together/components/atoms/labelSortPin/index.styled.tsx +78 -0
- package/src/together/components/atoms/labelSortPin/index.tsx +50 -0
- package/src/together/components/atoms/labelSortPin/labelPin.tsx +47 -0
- package/src/together/components/atoms/labelSortPin/labelSorting.tsx +127 -0
- package/src/together/components/atoms/loading/index.styled.tsx +42 -0
- package/src/together/components/atoms/loading/index.tsx +25 -0
- package/src/together/components/atoms/loading/loadingCard.tsx +38 -0
- package/src/together/components/atoms/tagTopic/index.styled.tsx +33 -0
- package/src/together/components/atoms/tagTopic/index.tsx +57 -0
- package/src/together/components/atoms/userAvatar/index.styled.tsx +39 -0
- package/src/together/components/atoms/userAvatar/index.tsx +62 -0
- package/src/together/components/molecules/cardAuthor/customMMLocale/formatDistance.ts +112 -0
- package/src/together/components/molecules/cardAuthor/customMMLocale/index.ts +16 -0
- package/src/together/components/molecules/cardAuthor/customMMLocale/types.ts +37 -0
- package/src/together/components/molecules/cardAuthor/index.styled.tsx +164 -0
- package/src/together/components/molecules/cardAuthor/index.tsx +314 -0
- package/src/together/components/molecules/createNewPostContent/index.stories.tsx +114 -0
- package/src/together/components/molecules/createNewPostContent/index.styled.tsx +73 -0
- package/src/together/components/molecules/createNewPostContent/index.tsx +351 -0
- package/src/together/components/molecules/createPostDescription/editor.tsx +915 -0
- package/src/together/components/molecules/createPostDescription/index.styled.tsx +328 -0
- package/src/together/components/molecules/createPostDescription/index.tsx +163 -0
- package/src/together/components/molecules/createPostTitle/index.styled.tsx +62 -0
- package/src/together/components/molecules/createPostTitle/index.tsx +133 -0
- package/src/together/components/molecules/index.tsx +18 -0
- package/src/together/components/molecules/inputCommentBar/index.styled.tsx +227 -0
- package/src/together/components/molecules/inputCommentBar/index.tsx +341 -0
- package/src/together/components/molecules/inputCommentBar/mainInputTriggerContext.tsx +26 -0
- package/src/together/components/molecules/popupDanger/index.styled.tsx +174 -0
- package/src/together/components/molecules/popupDanger/index.tsx +113 -0
- package/src/together/components/molecules/popupDoctor/index.styled.tsx +185 -0
- package/src/together/components/molecules/popupDoctor/index.tsx +271 -0
- package/src/together/components/molecules/popupExpert/index.styled.tsx +175 -0
- package/src/together/components/molecules/popupExpert/index.tsx +216 -0
- package/src/together/components/molecules/popupFrame/index.styled.tsx +76 -0
- package/src/together/components/molecules/popupFrame/index.tsx +43 -0
- package/src/together/components/molecules/popupFrame/popupShare.tsx +178 -0
- package/src/together/components/molecules/popupHospital/index.styled.tsx +173 -0
- package/src/together/components/molecules/popupHospital/index.tsx +249 -0
- package/src/together/components/molecules/postContent/index.styled.tsx +66 -0
- package/src/together/components/molecules/postContent/index.tsx +125 -0
- package/src/together/components/molecules/postImagePreview/imagePreviewPopup.tsx +73 -0
- package/src/together/components/molecules/postImagePreview/index.styled.tsx +154 -0
- package/src/together/components/molecules/postImagePreview/index.tsx +115 -0
- package/src/together/components/molecules/postImagePreview/postSingleImageViewPopup/index.styled.tsx +84 -0
- package/src/together/components/molecules/postImagePreview/postSingleImageViewPopup/index.tsx +83 -0
- package/src/together/components/molecules/shareBox/index.stories.tsx +36 -0
- package/src/together/components/molecules/shareBox/index.styled.tsx +141 -0
- package/src/together/components/molecules/shareBox/index.tsx +188 -0
- package/src/together/components/molecules/socialLinkPreview/index.styled.tsx +39 -0
- package/src/together/components/molecules/socialLinkPreview/index.tsx +206 -0
- package/src/together/components/molecules/submitReportForm/index.styled.tsx +34 -0
- package/src/together/components/molecules/submitReportForm/index.tsx +84 -0
- package/src/together/components/molecules/topicSelectList/index.stories.tsx +93 -0
- package/src/together/components/molecules/topicSelectList/index.styled.tsx +53 -0
- package/src/together/components/molecules/topicSelectList/index.tsx +186 -0
- package/src/together/components/organisms/cardPost/cardPostPopover.tsx +293 -0
- package/src/together/components/organisms/cardPost/index.stories.tsx +212 -0
- package/src/together/components/organisms/cardPost/index.styled.tsx +181 -0
- package/src/together/components/organisms/cardPost/index.tsx +458 -0
- package/src/together/components/organisms/cardReply/cardReplyPopover.tsx +122 -0
- package/src/together/components/organisms/cardReply/index.styled.tsx +199 -0
- package/src/together/components/organisms/cardReply/index.tsx +362 -0
- package/src/together/components/organisms/index.tsx +5 -0
- package/src/together/components/organisms/popoverMenu/index.styled.tsx +313 -0
- package/src/together/components/organisms/popoverMenu/index.tsx +102 -0
- package/src/together/components/organisms/popoverMenu/treePopoverMenu.tsx +156 -0
- package/src/together/hooks/useTogetherAuthRequiredAction.tsx +124 -0
- package/src/together/index.ts +12 -0
- package/src/together/interfaces/constants.ts +306 -0
- package/src/together/interfaces/types.ts +1418 -0
- package/src/together/togetherComponentGlobalContext.tsx +150 -0
- package/src/together/utils/apiActions/comment.tsx +168 -0
- package/src/together/utils/apiActions/community.ts +59 -0
- package/src/together/utils/apiActions/post.ts +234 -0
- package/src/together/utils/apiActions/topic.ts +40 -0
- package/src/together/utils/notification.ts +20 -0
- package/src/together/utils/post.ts +351 -0
- package/tsconfig.json +28 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { Story } from '@storybook/react/types-6-0'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
SurveyQuestionCard,
|
|
7
|
+
Props as QuestionCardProps,
|
|
8
|
+
} from './surveyQuestionCard'
|
|
9
|
+
import {
|
|
10
|
+
SurveyThankyouCard,
|
|
11
|
+
Props as ThankyouCardProps,
|
|
12
|
+
} from './surveyThankyouCard'
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
component: SurveyQuestionCard,
|
|
16
|
+
title: 'Molecules/SurveyQuestionCard',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const QuestionTemplate: Story<QuestionCardProps> = (args) => (
|
|
20
|
+
<SurveyQuestionCard {...args} />
|
|
21
|
+
)
|
|
22
|
+
const TemplateThankyou: Story<ThankyouCardProps> = (args) => (
|
|
23
|
+
<SurveyThankyouCard {...args} />
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
export const Normal = QuestionTemplate.bind({})
|
|
27
|
+
Normal.args = {
|
|
28
|
+
className: 'test',
|
|
29
|
+
headerText: 'HAVE TIME FOR A QUICK SURVEY ?',
|
|
30
|
+
descriptionText: 'You must choose one options',
|
|
31
|
+
// image: 'https://source.unsplash.com/random/300x400',
|
|
32
|
+
question: {
|
|
33
|
+
type: 'radio',
|
|
34
|
+
title: 'What’s your age group?',
|
|
35
|
+
subtitle: 'Select an option',
|
|
36
|
+
is_multi_select: true,
|
|
37
|
+
multi_select_option: 1,
|
|
38
|
+
from: 2,
|
|
39
|
+
to: 4,
|
|
40
|
+
options: [
|
|
41
|
+
{
|
|
42
|
+
label: '18 - 25',
|
|
43
|
+
value: '1',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: '26 - 45',
|
|
47
|
+
value: '2',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: '46 - 65',
|
|
51
|
+
value: '3',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: '65+',
|
|
55
|
+
value: '4',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
prevText: 'Back',
|
|
60
|
+
nextText: 'Next',
|
|
61
|
+
onNextClick: console.log,
|
|
62
|
+
} as QuestionCardProps
|
|
63
|
+
|
|
64
|
+
export const Thankyou = TemplateThankyou.bind({})
|
|
65
|
+
Thankyou.args = {
|
|
66
|
+
className: 'test',
|
|
67
|
+
thankyou: 'thank you',
|
|
68
|
+
thankyouSubtitle: 'thank you subtitle',
|
|
69
|
+
} as ThankyouCardProps
|
|
70
|
+
|
|
71
|
+
export const ContactForm = QuestionTemplate.bind({})
|
|
72
|
+
ContactForm.args = {
|
|
73
|
+
className: 'test',
|
|
74
|
+
prevText: 'Back',
|
|
75
|
+
nextText: 'Submit',
|
|
76
|
+
|
|
77
|
+
question: {
|
|
78
|
+
type: 'textbox',
|
|
79
|
+
title:
|
|
80
|
+
'Before revealing the result, please fill in your information so we can further advise you on this matter',
|
|
81
|
+
textOptions: [
|
|
82
|
+
{
|
|
83
|
+
name: 'name',
|
|
84
|
+
label: 'Name',
|
|
85
|
+
placeholder: 'Fill your name',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'phone',
|
|
89
|
+
label: 'Phone Number',
|
|
90
|
+
placeholder: '(+84) 1234 5678',
|
|
91
|
+
type: 'tel',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'email',
|
|
95
|
+
label: 'Email',
|
|
96
|
+
placeholder: 'name@gmail.com',
|
|
97
|
+
type: 'email',
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
isContactForm: true,
|
|
102
|
+
onNextClick: console.log,
|
|
103
|
+
termAndPolicyText: (
|
|
104
|
+
<>
|
|
105
|
+
{`Click "Continue" to agree to Hellobacsi's `}
|
|
106
|
+
<a href="#" target="_blank">
|
|
107
|
+
Terms of Service
|
|
108
|
+
</a>{' '}
|
|
109
|
+
and{' '}
|
|
110
|
+
<a href="#" target="_blank">
|
|
111
|
+
Privacy Policy
|
|
112
|
+
</a>
|
|
113
|
+
</>
|
|
114
|
+
),
|
|
115
|
+
} as QuestionCardProps
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { StyledRadio } from 'components/atoms/radio/index.styled'
|
|
2
|
+
import { ThemeProps } from 'misc/theme'
|
|
3
|
+
import styled from 'styled-components'
|
|
4
|
+
|
|
5
|
+
export const StyledSurveyQuestionCard = styled.div`
|
|
6
|
+
padding: 1rem;
|
|
7
|
+
background: ${(props: ThemeProps) => props.theme.colors.neutral100};
|
|
8
|
+
.survey-inner-wrapper {
|
|
9
|
+
padding: 1.25rem 1rem 1.5rem;
|
|
10
|
+
background: ${(props: ThemeProps) => props.theme.colors.white};
|
|
11
|
+
border-radius: 6px;
|
|
12
|
+
.survey-header {
|
|
13
|
+
border-bottom: 1px solid #dbdfe5;
|
|
14
|
+
margin-bottom: 12px;
|
|
15
|
+
.survey-header-text {
|
|
16
|
+
color: ${(props: ThemeProps) => props.theme.colors.gray500};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.survey-contact-submit {
|
|
21
|
+
width: 100%;
|
|
22
|
+
margin-bottom: 1.5rem;
|
|
23
|
+
}
|
|
24
|
+
.term-policy-container {
|
|
25
|
+
width: 70%;
|
|
26
|
+
min-width: 210px;
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
margin: 0 auto 1.5rem;
|
|
29
|
+
text-align: center;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.survey-progress-wrapper {
|
|
33
|
+
width: calc(100% + 2rem);
|
|
34
|
+
height: 4px;
|
|
35
|
+
margin-bottom: 1rem;
|
|
36
|
+
margin-left: -1rem;
|
|
37
|
+
background: #e4e8ec;
|
|
38
|
+
.survey-progress {
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
background: #00b16a;
|
|
42
|
+
transform: scaleX(0);
|
|
43
|
+
transform-origin: left;
|
|
44
|
+
transition: transform ease-in-out 0.3s;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.survey-button-wrapper {
|
|
49
|
+
display: flex;
|
|
50
|
+
justify-content: flex-end;
|
|
51
|
+
button {
|
|
52
|
+
justify-content: center;
|
|
53
|
+
&[data-has-icon='true'] {
|
|
54
|
+
svg {
|
|
55
|
+
width: 10px;
|
|
56
|
+
height: 10px;
|
|
57
|
+
margin-right: 10px;
|
|
58
|
+
vertical-align: unset;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
&.survey-next-button {
|
|
62
|
+
&[data-has-icon='true'] {
|
|
63
|
+
svg {
|
|
64
|
+
margin-right: 0;
|
|
65
|
+
margin-left: 10px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
&[data-center='true'] {
|
|
71
|
+
justify-content: center;
|
|
72
|
+
button:only-child {
|
|
73
|
+
width: 200px;
|
|
74
|
+
max-width: 80%;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
.survey-prev-button {
|
|
78
|
+
margin-right: 0.5rem;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
`
|
|
83
|
+
|
|
84
|
+
export const StyledSurveyRadio = styled(StyledRadio)`
|
|
85
|
+
&[data-type='circle'] {
|
|
86
|
+
padding: 16px 20px;
|
|
87
|
+
border: 0.5px solid transparent;
|
|
88
|
+
background: #fafafa;
|
|
89
|
+
border-radius: 6px;
|
|
90
|
+
&[data-checked='true'] {
|
|
91
|
+
border: 0.5px solid #2d87f3;
|
|
92
|
+
background: #f7f9fc;
|
|
93
|
+
}
|
|
94
|
+
input {
|
|
95
|
+
border: solid 2px #737373;
|
|
96
|
+
margin-right: 0;
|
|
97
|
+
background: white;
|
|
98
|
+
&[type='checkbox'] {
|
|
99
|
+
&:checked {
|
|
100
|
+
border: 0;
|
|
101
|
+
background: ${(props: ThemeProps) => props.theme.colors.primaryBase}
|
|
102
|
+
url("data:image/svg+xml,%3Csvg width='22' height='22' viewBox='0 0 22 22' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11 21C16.5228 21 21 16.5228 21 11C21 5.47715 16.5228 1 11 1C5.47715 1 1 5.47715 1 11C1 16.5228 5.47715 21 11 21Z' fill='%232D87F3' stroke='%232D87F3' stroke-width='2'/%3E%3Cpath d='M15.5714 8L9.67857 14L7 11.2727' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A")
|
|
103
|
+
no-repeat center center;
|
|
104
|
+
&:after {
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&[data-has-image='true'] {
|
|
112
|
+
position: relative;
|
|
113
|
+
display: block;
|
|
114
|
+
padding: 12px;
|
|
115
|
+
input {
|
|
116
|
+
position: absolute;
|
|
117
|
+
top: 20px;
|
|
118
|
+
right: 20px;
|
|
119
|
+
}
|
|
120
|
+
.choice-image-wrapper {
|
|
121
|
+
position: relative;
|
|
122
|
+
padding-top: 56.25%;
|
|
123
|
+
margin-bottom: 0.75rem;
|
|
124
|
+
img {
|
|
125
|
+
position: absolute;
|
|
126
|
+
top: 0;
|
|
127
|
+
left: 0;
|
|
128
|
+
width: 100%;
|
|
129
|
+
height: 100%;
|
|
130
|
+
border-radius: 6px;
|
|
131
|
+
object-fit: cover;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
`
|
|
137
|
+
|
|
138
|
+
export const StyledSurveyThankyouCard = styled.div`
|
|
139
|
+
position: relative;
|
|
140
|
+
width: 100%;
|
|
141
|
+
padding-top: min(400px, 100%);
|
|
142
|
+
.survey-thankyou-wrapper-inner {
|
|
143
|
+
position: absolute;
|
|
144
|
+
top: 0;
|
|
145
|
+
left: 0;
|
|
146
|
+
display: flex;
|
|
147
|
+
width: 100%;
|
|
148
|
+
height: 100%;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
align-items: center;
|
|
151
|
+
justify-content: center;
|
|
152
|
+
.survey-thankyou-icon {
|
|
153
|
+
width: 36%;
|
|
154
|
+
max-height: 50%;
|
|
155
|
+
margin-bottom: 1.5rem;
|
|
156
|
+
}
|
|
157
|
+
.survey-thankyou-title {
|
|
158
|
+
margin-bottom: 1rem;
|
|
159
|
+
text-align: center;
|
|
160
|
+
}
|
|
161
|
+
.survey-thankyou-subtitle {
|
|
162
|
+
text-align: center;
|
|
163
|
+
> * {
|
|
164
|
+
text-align: center;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
`
|
|
169
|
+
|
|
170
|
+
export const StyledSurveyQuestionContent = styled.div`
|
|
171
|
+
.survey-question-text-wrapper {
|
|
172
|
+
margin-bottom: 24px;
|
|
173
|
+
.survey-question-title {
|
|
174
|
+
margin-bottom: 4px;
|
|
175
|
+
}
|
|
176
|
+
.survey-question-subtitle,
|
|
177
|
+
.survey-question-description {
|
|
178
|
+
color: ${(props: ThemeProps) => props.theme.colors.gray500};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
.survey-question-image {
|
|
182
|
+
width: 100%;
|
|
183
|
+
margin-bottom: 12px;
|
|
184
|
+
border-radius: 6px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.survey-question-answer-wrapper {
|
|
188
|
+
margin-bottom: 1.5rem;
|
|
189
|
+
.survey-question-options-wrapper {
|
|
190
|
+
display: grid;
|
|
191
|
+
grid-gap: 0.5rem;
|
|
192
|
+
grid-template-columns: 1fr;
|
|
193
|
+
&[data-has-image='true'] {
|
|
194
|
+
grid-gap: 0.8rem;
|
|
195
|
+
grid-template-columns: 1fr 1fr;
|
|
196
|
+
}
|
|
197
|
+
.survey-question-option-item {
|
|
198
|
+
label {
|
|
199
|
+
color: #262626;
|
|
200
|
+
font-size: 16px;
|
|
201
|
+
font-style: normal;
|
|
202
|
+
font-weight: normal;
|
|
203
|
+
line-height: 24px;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
.survey-contact-input {
|
|
208
|
+
margin-bottom: 1rem;
|
|
209
|
+
&:first-child {
|
|
210
|
+
margin-top: 1rem;
|
|
211
|
+
}
|
|
212
|
+
label {
|
|
213
|
+
font-weight: 700;
|
|
214
|
+
}
|
|
215
|
+
input {
|
|
216
|
+
margin-top: 6px;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
`
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { render, cleanup } from '@testing-library/react'
|
|
4
|
+
import 'jest-styled-components'
|
|
5
|
+
|
|
6
|
+
import MockTheme from '../../../misc/mockTheme'
|
|
7
|
+
import { SurveyQuestionCard } from './surveyQuestionCard'
|
|
8
|
+
|
|
9
|
+
afterEach(cleanup)
|
|
10
|
+
|
|
11
|
+
test('it renders', () => {
|
|
12
|
+
const surveyQuestionCard = render(
|
|
13
|
+
<MockTheme>
|
|
14
|
+
<SurveyQuestionCard
|
|
15
|
+
className="test"
|
|
16
|
+
headerText="HAVE TIME FOR A QUICK SURVEY ?"
|
|
17
|
+
descriptionText="You must choose one options"
|
|
18
|
+
question={{
|
|
19
|
+
type: 'radio',
|
|
20
|
+
title: 'What’s your age group?',
|
|
21
|
+
subtitle: 'Select an option',
|
|
22
|
+
is_multi_select: true,
|
|
23
|
+
multi_select_option: 1,
|
|
24
|
+
from: 2,
|
|
25
|
+
to: 4,
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
label: '18 - 25',
|
|
29
|
+
value: '1',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: '26 - 45',
|
|
33
|
+
value: '2',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: '46 - 65',
|
|
37
|
+
value: '3',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: '65+',
|
|
41
|
+
value: '4',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
}}
|
|
45
|
+
prevText="Back"
|
|
46
|
+
nextText="Next"
|
|
47
|
+
/>
|
|
48
|
+
</MockTheme>,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
const self = surveyQuestionCard.container.firstChild
|
|
52
|
+
expect(self).toMatchSnapshot()
|
|
53
|
+
})
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import React, { CSSProperties, ReactNode, useRef, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { Button, Text } from 'components/atoms'
|
|
4
|
+
|
|
5
|
+
import { StyledSurveyQuestionCard } from './index.styled'
|
|
6
|
+
import {
|
|
7
|
+
SurveyOption,
|
|
8
|
+
SurveyTextOption,
|
|
9
|
+
SurveyQuestion,
|
|
10
|
+
SurveyQuestionContent,
|
|
11
|
+
} from './surveyQuestionContent'
|
|
12
|
+
|
|
13
|
+
export type SurveyAnswer = SurveyOption[] | SurveyTextOption[]
|
|
14
|
+
|
|
15
|
+
export type Props = {
|
|
16
|
+
headerText?: string
|
|
17
|
+
className?: string
|
|
18
|
+
style?: CSSProperties
|
|
19
|
+
|
|
20
|
+
termAndPolicyText?: ReactNode
|
|
21
|
+
prevText?: ReactNode
|
|
22
|
+
nextText: ReactNode
|
|
23
|
+
isContactForm?: boolean
|
|
24
|
+
isSubmitButton?: boolean
|
|
25
|
+
isDisableNext?: boolean
|
|
26
|
+
isDisablePrev?: boolean
|
|
27
|
+
onPrevClick?: () => void
|
|
28
|
+
isButtonCenter?: boolean
|
|
29
|
+
onNextClick?: (answer?: SurveyAnswer) => void
|
|
30
|
+
|
|
31
|
+
question: SurveyQuestion
|
|
32
|
+
progress?: number
|
|
33
|
+
descriptionText?: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export enum NodeMultipleOptions {
|
|
37
|
+
UNLIMITED = 0,
|
|
38
|
+
EXACT_NUMBER = 1,
|
|
39
|
+
RANGE = 2,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const SurveyQuestionCard = ({
|
|
43
|
+
className,
|
|
44
|
+
headerText,
|
|
45
|
+
style,
|
|
46
|
+
|
|
47
|
+
question,
|
|
48
|
+
|
|
49
|
+
termAndPolicyText,
|
|
50
|
+
prevText,
|
|
51
|
+
nextText,
|
|
52
|
+
isContactForm,
|
|
53
|
+
isDisableNext,
|
|
54
|
+
isDisablePrev,
|
|
55
|
+
onPrevClick,
|
|
56
|
+
onNextClick,
|
|
57
|
+
|
|
58
|
+
isSubmitButton,
|
|
59
|
+
isButtonCenter,
|
|
60
|
+
progress,
|
|
61
|
+
descriptionText,
|
|
62
|
+
}: Props) => {
|
|
63
|
+
// const [currentQuestionIndex, setQuestionIndex] = useState(0)
|
|
64
|
+
const [answer, setAnswer] = useState<SurveyAnswer>([])
|
|
65
|
+
const { is_multi_select, multi_select_option, from, to } = question
|
|
66
|
+
|
|
67
|
+
// const currentQuestion = questions[currentQuestionIndex]
|
|
68
|
+
// const currentAnswer = answers[currentQuestionIndex]
|
|
69
|
+
const currentType = question?.type
|
|
70
|
+
const submitDisabled =
|
|
71
|
+
(currentType === 'checkbox' &&
|
|
72
|
+
question.options?.length &&
|
|
73
|
+
(!answer ||
|
|
74
|
+
answer.length === 0 ||
|
|
75
|
+
(is_multi_select &&
|
|
76
|
+
multi_select_option === NodeMultipleOptions.RANGE &&
|
|
77
|
+
(answer.length < from || answer.length > to)) ||
|
|
78
|
+
(is_multi_select &&
|
|
79
|
+
multi_select_option === NodeMultipleOptions.EXACT_NUMBER &&
|
|
80
|
+
answer.length !== from))) ||
|
|
81
|
+
(currentType === 'radio' &&
|
|
82
|
+
question.options?.length &&
|
|
83
|
+
(!answer || answer.length === 0)) ||
|
|
84
|
+
(currentType === 'textbox' &&
|
|
85
|
+
question.textOptions?.length &&
|
|
86
|
+
(answer.length < question.textOptions.length ||
|
|
87
|
+
answer.some((a) => !a.value)))
|
|
88
|
+
|
|
89
|
+
const normalizedProgress =
|
|
90
|
+
typeof progress === 'number'
|
|
91
|
+
? progress > 1
|
|
92
|
+
? 1
|
|
93
|
+
: progress < 0
|
|
94
|
+
? 0
|
|
95
|
+
: Number(progress.toFixed(2))
|
|
96
|
+
: -1
|
|
97
|
+
|
|
98
|
+
const formRef = useRef<HTMLFormElement>(null)
|
|
99
|
+
const reportValidity = () => {
|
|
100
|
+
if (currentType === 'textbox') {
|
|
101
|
+
// report validity for input elements
|
|
102
|
+
return formRef.current.reportValidity()
|
|
103
|
+
}
|
|
104
|
+
return true
|
|
105
|
+
}
|
|
106
|
+
return (
|
|
107
|
+
<StyledSurveyQuestionCard className={className} style={style}>
|
|
108
|
+
<div className="survey-inner-wrapper">
|
|
109
|
+
{headerText && (
|
|
110
|
+
<div className="survey-header">
|
|
111
|
+
<Text className="survey-header-text" size="c2">
|
|
112
|
+
{headerText}
|
|
113
|
+
</Text>
|
|
114
|
+
</div>
|
|
115
|
+
)}
|
|
116
|
+
<form ref={formRef} onSubmit={(e) => e.preventDefault()}>
|
|
117
|
+
<SurveyQuestionContent
|
|
118
|
+
question={question}
|
|
119
|
+
description={descriptionText}
|
|
120
|
+
onOptionsChange={(options) => {
|
|
121
|
+
setAnswer(options)
|
|
122
|
+
}}
|
|
123
|
+
onTextOptionsChange={(text) => {
|
|
124
|
+
setAnswer(text)
|
|
125
|
+
}}
|
|
126
|
+
/>
|
|
127
|
+
</form>
|
|
128
|
+
{isContactForm && nextText && (
|
|
129
|
+
<Button
|
|
130
|
+
className="survey-contact-submit"
|
|
131
|
+
size="lg"
|
|
132
|
+
isDisabled={isDisableNext || submitDisabled}
|
|
133
|
+
onClick={() =>
|
|
134
|
+
reportValidity() && onNextClick && onNextClick(answer)
|
|
135
|
+
}
|
|
136
|
+
>
|
|
137
|
+
{nextText}
|
|
138
|
+
</Button>
|
|
139
|
+
)}
|
|
140
|
+
{termAndPolicyText && (
|
|
141
|
+
<div className="term-policy-container">{termAndPolicyText}</div>
|
|
142
|
+
)}
|
|
143
|
+
{typeof progress === 'number' && (
|
|
144
|
+
<div className="survey-progress-wrapper">
|
|
145
|
+
<div
|
|
146
|
+
className="survey-progress"
|
|
147
|
+
style={{
|
|
148
|
+
transform: `scaleX(${normalizedProgress})`,
|
|
149
|
+
}}
|
|
150
|
+
></div>
|
|
151
|
+
</div>
|
|
152
|
+
)}
|
|
153
|
+
{(prevText || nextText) && (
|
|
154
|
+
<div data-center={isButtonCenter} className="survey-button-wrapper">
|
|
155
|
+
{prevText && (
|
|
156
|
+
<Button
|
|
157
|
+
className="survey-prev-button"
|
|
158
|
+
size="lg"
|
|
159
|
+
color={isDisablePrev ? 'primary' : 'secondary'}
|
|
160
|
+
isDisabled={isDisablePrev}
|
|
161
|
+
icon={
|
|
162
|
+
<svg
|
|
163
|
+
width="6"
|
|
164
|
+
height="10"
|
|
165
|
+
viewBox="0 0 6 10"
|
|
166
|
+
fill="none"
|
|
167
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
168
|
+
>
|
|
169
|
+
<path
|
|
170
|
+
d="M2.44677 4.99999L5.31252 2.13424C5.62302 1.82374 5.62302 1.31974 5.31252 1.00924C5.00202 0.698742 4.49802 0.698742 4.18752 1.00924L0.727018 4.46974C0.433768 4.76299 0.433768 5.23774 0.727018 5.53024L4.18752 8.99074C4.49802 9.30124 5.00202 9.30124 5.31252 8.99074C5.62302 8.68024 5.62302 8.17624 5.31252 7.86574L2.44677 4.99999Z"
|
|
171
|
+
fill={isDisablePrev ? '#fff' : '#2D87F3'}
|
|
172
|
+
/>
|
|
173
|
+
</svg>
|
|
174
|
+
}
|
|
175
|
+
onClick={onPrevClick}
|
|
176
|
+
>
|
|
177
|
+
{prevText}
|
|
178
|
+
</Button>
|
|
179
|
+
)}
|
|
180
|
+
{!isContactForm && nextText && (
|
|
181
|
+
<Button
|
|
182
|
+
onClick={() =>
|
|
183
|
+
reportValidity() && onNextClick && onNextClick(answer)
|
|
184
|
+
}
|
|
185
|
+
className="survey-next-button"
|
|
186
|
+
size="lg"
|
|
187
|
+
isDisabled={isDisableNext || submitDisabled}
|
|
188
|
+
>
|
|
189
|
+
{nextText}{' '}
|
|
190
|
+
{isSubmitButton ? undefined : (
|
|
191
|
+
<svg
|
|
192
|
+
width="6"
|
|
193
|
+
height="10"
|
|
194
|
+
viewBox="0 0 6 10"
|
|
195
|
+
fill="none"
|
|
196
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
197
|
+
>
|
|
198
|
+
<path
|
|
199
|
+
d="M3.80322 5.19994L0.937465 2.33419C0.626965 2.02369 0.626965 1.51969 0.937465 1.20919C1.24796 0.898693 1.75196 0.898693 2.06246 1.20919L5.52297 4.66969C5.81622 4.96294 5.81622 5.43769 5.52297 5.73019L2.06246 9.19069C1.75196 9.50119 1.24796 9.50119 0.937465 9.19069C0.626965 8.88019 0.626965 8.37619 0.937465 8.06569L3.80322 5.19994Z"
|
|
200
|
+
fill="#ffffff"
|
|
201
|
+
/>
|
|
202
|
+
</svg>
|
|
203
|
+
)}
|
|
204
|
+
</Button>
|
|
205
|
+
)}
|
|
206
|
+
</div>
|
|
207
|
+
)}
|
|
208
|
+
</div>
|
|
209
|
+
</StyledSurveyQuestionCard>
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export { SurveyQuestionCard }
|