@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,155 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { Story } from '@storybook/react/types-6-0'
|
|
4
|
+
|
|
5
|
+
import { ResultSection, Props } from '.'
|
|
6
|
+
import { TranslationsProvider } from '../../../../../i18n/translationsProvider'
|
|
7
|
+
import { initialState } from '../reducer'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
component: ResultSection,
|
|
11
|
+
title: 'Projects/Care/Organisms/BookingSearchBar/ResultSection',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const Template: Story<Props> = (args) => (
|
|
15
|
+
<TranslationsProvider locale={'en-PH'}>
|
|
16
|
+
<ResultSection {...args} />
|
|
17
|
+
</TranslationsProvider>
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
const baseProps: Partial<Props> = {
|
|
21
|
+
state: initialState,
|
|
22
|
+
dispatch: (action) => console.log('dispatch', action),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Service = Template.bind({})
|
|
26
|
+
Service.args = {
|
|
27
|
+
...baseProps,
|
|
28
|
+
type: 'services',
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const Specialty = Template.bind({})
|
|
32
|
+
Specialty.args = {
|
|
33
|
+
...baseProps,
|
|
34
|
+
type: 'specialties',
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const clinicArgs = {
|
|
38
|
+
...baseProps,
|
|
39
|
+
type: 'hospitals',
|
|
40
|
+
itemsToShow: 2,
|
|
41
|
+
keyword: 'Clin',
|
|
42
|
+
itemsToShowDesktop: 4,
|
|
43
|
+
data: [
|
|
44
|
+
{
|
|
45
|
+
id: 1390,
|
|
46
|
+
name: 'Las Pi\u00f1as District Hospital',
|
|
47
|
+
slug: 'las-pinas-district-hospital',
|
|
48
|
+
logo: 'https://cdn-healthcare.hellohealthgroup.com/hospitals/ph/las-pinas-district-hospital20220211.png',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 1343,
|
|
52
|
+
name: 'A Zarate General Hospital',
|
|
53
|
+
slug: 'a-zarate-general-hospital',
|
|
54
|
+
logo: 'https://cdn-healthcare.hellohealthgroup.com/hospitals/ph/a-zarate-general-hospital20220211.png',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 1314,
|
|
58
|
+
name: 'Perpetual Help Medical Center - Las Pi\u00f1as Hospital',
|
|
59
|
+
slug: 'perpetual-help-medical-center-las-pinas-hospital',
|
|
60
|
+
logo: 'https://cdn-healthcare.hellohealthgroup.com/hospitals/ph/perpetual-help-medical-center-las-pinas-hospital20220211.png',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 1391,
|
|
64
|
+
name: 'Las Pi\u00f1as Doctors Hospital',
|
|
65
|
+
slug: 'las-pinas-doctors-hospital',
|
|
66
|
+
logo: 'https://cdn-healthcare.hellohealthgroup.com/hospitals/ph/las-pinas-doctors-hospital20220211.png',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 1282,
|
|
70
|
+
name: 'Las Pi\u00f1as Doctors Hospital, Inc.',
|
|
71
|
+
slug: 'las-pinas-doctors-hospital-inc',
|
|
72
|
+
logo: 'https://cdn-healthcare.hellohealthgroup.com/hospitals/ph/las-pinas-doctors-hospital-inc20220211.png',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 313,
|
|
76
|
+
name: 'Gat Andres Bonifacio Memorial Medical Center',
|
|
77
|
+
slug: 'gat-andres-bonifacio-memorial-medical-center',
|
|
78
|
+
logo: 'https://cdn-healthcare.hellohealthgroup.com/hospitals/ph/gat-andres-bonifacio-memorial-medical-center20220211.png',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 1288,
|
|
82
|
+
name: 'Mary Johnston Hospital, Inc.',
|
|
83
|
+
slug: 'mary-johnston-hospital-inc',
|
|
84
|
+
logo: 'https://cdn-healthcare.hellohealthgroup.com/hospitals/ph/mary-johnston-hospital-inc20220211.png',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 1492,
|
|
88
|
+
name: 'Tondo Medical Center',
|
|
89
|
+
slug: 'tondo-medical-center',
|
|
90
|
+
logo: 'https://cdn-healthcare.hellohealthgroup.com/hospitals/ph/tondo-medical-center20220211.png',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const ClinicDesktop = Template.bind({})
|
|
96
|
+
ClinicDesktop.args = {
|
|
97
|
+
...baseProps,
|
|
98
|
+
...clinicArgs,
|
|
99
|
+
isMobile: false,
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const ClinicMobile = Template.bind({})
|
|
103
|
+
ClinicMobile.args = {
|
|
104
|
+
...baseProps,
|
|
105
|
+
...clinicArgs,
|
|
106
|
+
isMobile: true,
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const DoctorsDesktop = Template.bind({})
|
|
110
|
+
DoctorsDesktop.args = {
|
|
111
|
+
...baseProps,
|
|
112
|
+
data: [
|
|
113
|
+
{
|
|
114
|
+
id: 347,
|
|
115
|
+
name: 'BS.CKI Nguy\u1ec5n Th\u1ecb H\u1ed3ng Th\u00ea',
|
|
116
|
+
slug: 'bscki-nguyen-thi-hong-the',
|
|
117
|
+
avatar: 'https://unsplash.it/64',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: 348,
|
|
121
|
+
name: 'BS.CKI Nguy\u1ec5n Th\u1ecb Kim Tr\u00e2n',
|
|
122
|
+
slug: 'bscki-nguyen-thi-kim-tran',
|
|
123
|
+
avatar: 'https://unsplash.it/64',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: 343,
|
|
127
|
+
name: 'ThS.BS Nguy\u1ec5n Ch\u00ed Th\u00e0nh',
|
|
128
|
+
slug: 'thsbs-nguyen-chi-thanh',
|
|
129
|
+
avatar: 'https://unsplash.it/64',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: 340,
|
|
133
|
+
name: 'BS.CKI Nguy\u1ec5n Th\u00e0nh \u0110\u00f4ng',
|
|
134
|
+
slug: 'bscki-nguyen-thanh-dong',
|
|
135
|
+
avatar: 'https://unsplash.it/64',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: 531,
|
|
139
|
+
name: 'BS Nguy\u1ec5n \u0110\u0103ng Khoa',
|
|
140
|
+
slug: 'bs-nguyen-dang-khoa',
|
|
141
|
+
avatar: 'https://unsplash.it/64',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: 367,
|
|
145
|
+
name: 'BS.Nguy\u1ec5n Th\u1ecb Ki\u1ec1u Ti\u00ean',
|
|
146
|
+
slug: 'bsnguyen-thi-kieu-tien',
|
|
147
|
+
avatar: 'https://unsplash.it/64',
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
type: 'doctors',
|
|
151
|
+
isMobile: false,
|
|
152
|
+
itemsToShow: 2,
|
|
153
|
+
itemsToShowDesktop: 4,
|
|
154
|
+
keyword: 'Doc',
|
|
155
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Text } from 'components/atoms'
|
|
2
|
+
import { theme } from 'misc/theme'
|
|
3
|
+
import { MediaQueries } from 'misc/utils'
|
|
4
|
+
import styled from 'styled-components'
|
|
5
|
+
|
|
6
|
+
export const StyledTypeHeader = styled.header`
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
padding: 12px 24px;
|
|
10
|
+
background-color: ${theme.colors.neutral50};
|
|
11
|
+
box-shadow: inset 0px 1px 0px #e4e8ec;
|
|
12
|
+
`
|
|
13
|
+
|
|
14
|
+
export const StyledInfoWrapper = styled.div`
|
|
15
|
+
display: grid;
|
|
16
|
+
flex: 2;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: 16px;
|
|
19
|
+
grid-template-columns: 16px 1fr;
|
|
20
|
+
`
|
|
21
|
+
|
|
22
|
+
export const StyledTypeName = styled.p`
|
|
23
|
+
color: ${theme.colors.neutral800};
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
font-weight: ${theme.sizes.fwSemiBold};
|
|
26
|
+
letter-spacing: -0.2px;
|
|
27
|
+
line-height: 22px;
|
|
28
|
+
`
|
|
29
|
+
|
|
30
|
+
export const StyledSeeMoreButton = styled.button`
|
|
31
|
+
flex: 1;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
text-align: end;
|
|
34
|
+
`
|
|
35
|
+
|
|
36
|
+
export const StyledResultsContainer = styled.section`
|
|
37
|
+
padding: 12px 16px;
|
|
38
|
+
--rowGap: 16px;
|
|
39
|
+
--graphicSize: 32px;
|
|
40
|
+
|
|
41
|
+
${MediaQueries.tdUp} {
|
|
42
|
+
--rowGap: 8px;
|
|
43
|
+
}
|
|
44
|
+
`
|
|
45
|
+
|
|
46
|
+
export const StyledItemsWrapper = styled.ul<{
|
|
47
|
+
isShown?: boolean
|
|
48
|
+
isMore?: boolean
|
|
49
|
+
}>`
|
|
50
|
+
--gap: 16px;
|
|
51
|
+
${MediaQueries.tdUp} {
|
|
52
|
+
--gap: 8px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
display: grid;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
gap: var(--gap);
|
|
58
|
+
transition: max-height 0.8s ease-out;
|
|
59
|
+
|
|
60
|
+
${({ isMore }) =>
|
|
61
|
+
isMore &&
|
|
62
|
+
`
|
|
63
|
+
height: auto;
|
|
64
|
+
max-height: 0;
|
|
65
|
+
margin-top: var(--gap);
|
|
66
|
+
`}
|
|
67
|
+
|
|
68
|
+
${({ isShown }) =>
|
|
69
|
+
isShown &&
|
|
70
|
+
`
|
|
71
|
+
max-height: 600px;
|
|
72
|
+
`}
|
|
73
|
+
|
|
74
|
+
@media (prefers-reduced-motion) {
|
|
75
|
+
transition: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
${MediaQueries.tdUp} {
|
|
79
|
+
grid-template-columns: 1fr 1fr;
|
|
80
|
+
} ;
|
|
81
|
+
`
|
|
82
|
+
|
|
83
|
+
export const StyledSeeMore = styled(Text)`
|
|
84
|
+
margin-top: 12px;
|
|
85
|
+
margin-bottom: 8px;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
text-align: start;
|
|
88
|
+
text-transform: capitalize;
|
|
89
|
+
`
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import React, { useState, Dispatch, useMemo } from 'react'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Action,
|
|
5
|
+
ActionTypes,
|
|
6
|
+
ReducerState,
|
|
7
|
+
} from 'care/components/organisms/bookingSearchBar/reducer'
|
|
8
|
+
import { LOCALIZED_SLUGS } from 'care/interfaces/constants'
|
|
9
|
+
import { Text } from 'components/atoms'
|
|
10
|
+
import { useTranslations } from 'hooks/useTranslations'
|
|
11
|
+
import { theme } from 'misc/theme'
|
|
12
|
+
import Skeleton from 'react-loading-skeleton'
|
|
13
|
+
|
|
14
|
+
import { SearchBarSectionItemApi } from '../../../../interfaces/types'
|
|
15
|
+
import { SEARCH_KEYWORD_MIN_LENGTH } from '../constants'
|
|
16
|
+
import { ResultSectionItem } from '../resultSectionItem'
|
|
17
|
+
import {
|
|
18
|
+
StyledImageSkeletonWrapper,
|
|
19
|
+
StyledPictureWrapper,
|
|
20
|
+
StyledResult,
|
|
21
|
+
} from '../resultSectionItem/index.styled'
|
|
22
|
+
import { DoctorIcon, HospitalIcon, ServiceIcon, SpecialtyIcon } from './icons'
|
|
23
|
+
import {
|
|
24
|
+
StyledInfoWrapper,
|
|
25
|
+
StyledItemsWrapper,
|
|
26
|
+
StyledResultsContainer,
|
|
27
|
+
StyledSeeMore,
|
|
28
|
+
StyledSeeMoreButton,
|
|
29
|
+
StyledTypeHeader,
|
|
30
|
+
StyledTypeName,
|
|
31
|
+
} from './index.styled'
|
|
32
|
+
|
|
33
|
+
export type Props = {
|
|
34
|
+
type: 'specialties' | 'services' | 'hospitals' | 'doctors'
|
|
35
|
+
data: SearchBarSectionItemApi[]
|
|
36
|
+
state: ReducerState
|
|
37
|
+
dispatch: Dispatch<Action>
|
|
38
|
+
itemsToShow: number
|
|
39
|
+
itemsToShowDesktop: number
|
|
40
|
+
keyword: string
|
|
41
|
+
isMobile: boolean
|
|
42
|
+
isLoading?: boolean
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const ResultSection = ({
|
|
46
|
+
type,
|
|
47
|
+
data,
|
|
48
|
+
state,
|
|
49
|
+
dispatch,
|
|
50
|
+
itemsToShow,
|
|
51
|
+
itemsToShowDesktop,
|
|
52
|
+
isMobile,
|
|
53
|
+
isLoading,
|
|
54
|
+
keyword,
|
|
55
|
+
}: Props) => {
|
|
56
|
+
const [seeMoreOpen, setSeeMoreOpen] = useState(false)
|
|
57
|
+
const { t, locale } = useTranslations()
|
|
58
|
+
const { selectedLocation, searchKeywords } = state
|
|
59
|
+
|
|
60
|
+
const slugs = useMemo(() => LOCALIZED_SLUGS[locale], [locale])
|
|
61
|
+
|
|
62
|
+
const typeInformation: {
|
|
63
|
+
[key in Props['type']]: {
|
|
64
|
+
name: string
|
|
65
|
+
icon: React.ReactNode
|
|
66
|
+
slug: string
|
|
67
|
+
}
|
|
68
|
+
} = useMemo(() => {
|
|
69
|
+
return {
|
|
70
|
+
doctors: {
|
|
71
|
+
name: t('booking.searchPopup.doctors'),
|
|
72
|
+
icon: <DoctorIcon />,
|
|
73
|
+
slug: slugs.DOCTOR,
|
|
74
|
+
},
|
|
75
|
+
services: {
|
|
76
|
+
name: t('booking.searchPopup.services'),
|
|
77
|
+
icon: <ServiceIcon />,
|
|
78
|
+
slug: slugs.SERVICE,
|
|
79
|
+
},
|
|
80
|
+
hospitals: {
|
|
81
|
+
name: t('booking.searchPopup.hospitals'),
|
|
82
|
+
icon: <HospitalIcon />,
|
|
83
|
+
slug: slugs.HOSPITAL,
|
|
84
|
+
},
|
|
85
|
+
specialties: {
|
|
86
|
+
name: t('booking.searchPopup.specialties'),
|
|
87
|
+
icon: <SpecialtyIcon />,
|
|
88
|
+
slug: slugs.SPECIALTIES,
|
|
89
|
+
},
|
|
90
|
+
}
|
|
91
|
+
}, [type, slugs])
|
|
92
|
+
|
|
93
|
+
const typeSlug = useMemo(() => typeInformation[type].slug, [typeInformation])
|
|
94
|
+
|
|
95
|
+
const showItemCount = isMobile ? itemsToShow : itemsToShowDesktop
|
|
96
|
+
|
|
97
|
+
function onClickItem(item: SearchBarSectionItemApi) {
|
|
98
|
+
let url = ''
|
|
99
|
+
switch (type) {
|
|
100
|
+
case 'specialties':
|
|
101
|
+
url = `/${selectedLocation.slug}/${typeInformation.doctors.slug}/${item.slug}`
|
|
102
|
+
break
|
|
103
|
+
case 'services':
|
|
104
|
+
url = `/${selectedLocation.slug}/${typeSlug}/${item.slug}`
|
|
105
|
+
break
|
|
106
|
+
case 'doctors':
|
|
107
|
+
case 'hospitals':
|
|
108
|
+
url = `/${typeSlug}/${item.slug}-${item.id}`
|
|
109
|
+
break
|
|
110
|
+
}
|
|
111
|
+
if (url) {
|
|
112
|
+
dispatch({
|
|
113
|
+
type: ActionTypes.SelectSearchResult,
|
|
114
|
+
payload: { name: item.name, url },
|
|
115
|
+
})
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function renderItem(item: SearchBarSectionItemApi) {
|
|
120
|
+
return (
|
|
121
|
+
<ResultSectionItem
|
|
122
|
+
key={item.id}
|
|
123
|
+
item={item}
|
|
124
|
+
type={type}
|
|
125
|
+
imageUrl={item.logo || item.avatar || item.thumbnail}
|
|
126
|
+
onClickItem={onClickItem}
|
|
127
|
+
/>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function onSeeAllClick() {
|
|
132
|
+
let url = ''
|
|
133
|
+
switch (type) {
|
|
134
|
+
case 'specialties':
|
|
135
|
+
url = `/${typeSlug}`
|
|
136
|
+
break
|
|
137
|
+
case 'services':
|
|
138
|
+
case 'doctors':
|
|
139
|
+
case 'hospitals':
|
|
140
|
+
url = `/${selectedLocation.slug}/${typeSlug}`
|
|
141
|
+
break
|
|
142
|
+
}
|
|
143
|
+
if (url) {
|
|
144
|
+
dispatch({ type: ActionTypes.NavigateTo, payload: url })
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function onClickSearchByKeyword() {
|
|
149
|
+
const { slug: typeSlug } = typeInformation[type]
|
|
150
|
+
const url = `/${selectedLocation.slug}/${typeSlug}?q=${searchKeywords}`
|
|
151
|
+
dispatch({ type: ActionTypes.NavigateTo, payload: url })
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<section>
|
|
156
|
+
<StyledTypeHeader>
|
|
157
|
+
<StyledInfoWrapper>
|
|
158
|
+
{typeInformation[type].icon}
|
|
159
|
+
<StyledTypeName>{typeInformation[type].name}</StyledTypeName>
|
|
160
|
+
</StyledInfoWrapper>
|
|
161
|
+
<StyledSeeMoreButton onClick={onSeeAllClick}>
|
|
162
|
+
<Text size="p3" color={theme.colors.primaryBase}>
|
|
163
|
+
{t('booking.searchPopup.seeAll')}
|
|
164
|
+
</Text>
|
|
165
|
+
</StyledSeeMoreButton>
|
|
166
|
+
</StyledTypeHeader>
|
|
167
|
+
|
|
168
|
+
{(isLoading || (data && data.length > 0)) && (
|
|
169
|
+
<StyledResultsContainer>
|
|
170
|
+
<StyledItemsWrapper>
|
|
171
|
+
{isLoading &&
|
|
172
|
+
Array(2)
|
|
173
|
+
.fill(undefined)
|
|
174
|
+
.map((_, i) => (
|
|
175
|
+
<StyledResult key={type + 'loading' + i}>
|
|
176
|
+
<StyledPictureWrapper>
|
|
177
|
+
<StyledImageSkeletonWrapper>
|
|
178
|
+
<Skeleton
|
|
179
|
+
height={14}
|
|
180
|
+
width={type === 'hospitals' ? 12 : 32}
|
|
181
|
+
style={{
|
|
182
|
+
maxWidth: 'var(--graphicSize)',
|
|
183
|
+
minHeight: 'var(--graphicSize)',
|
|
184
|
+
}}
|
|
185
|
+
/>
|
|
186
|
+
</StyledImageSkeletonWrapper>
|
|
187
|
+
</StyledPictureWrapper>
|
|
188
|
+
<Skeleton width={120} height={24} />
|
|
189
|
+
</StyledResult>
|
|
190
|
+
))}
|
|
191
|
+
{!isLoading &&
|
|
192
|
+
data &&
|
|
193
|
+
data.length > 0 &&
|
|
194
|
+
data.slice(0, showItemCount).map(renderItem)}
|
|
195
|
+
</StyledItemsWrapper>
|
|
196
|
+
|
|
197
|
+
<StyledItemsWrapper isShown={seeMoreOpen} isMore>
|
|
198
|
+
{data.slice(showItemCount, -1).map(renderItem)}
|
|
199
|
+
</StyledItemsWrapper>
|
|
200
|
+
{type === 'specialties' && showItemCount < data.length && !isLoading && (
|
|
201
|
+
<button onClick={() => setSeeMoreOpen(!seeMoreOpen)}>
|
|
202
|
+
<StyledSeeMore size="p3" color={theme.colors.primaryBase}>
|
|
203
|
+
{seeMoreOpen
|
|
204
|
+
? t('booking.searchPopup.seeLessSpecialties')
|
|
205
|
+
: t('booking.searchPopup.seeMoreSpecialties')}
|
|
206
|
+
</StyledSeeMore>
|
|
207
|
+
</button>
|
|
208
|
+
)}
|
|
209
|
+
{type !== 'specialties' &&
|
|
210
|
+
showItemCount < data.length &&
|
|
211
|
+
!isLoading &&
|
|
212
|
+
keyword.trim().length > SEARCH_KEYWORD_MIN_LENGTH[locale] && (
|
|
213
|
+
<button onClick={onClickSearchByKeyword}>
|
|
214
|
+
<StyledSeeMore size="p3" color={theme.colors.primaryBase}>
|
|
215
|
+
{t(`booking.searchPopup.searchIn.${type}`, {
|
|
216
|
+
name: keyword,
|
|
217
|
+
})}
|
|
218
|
+
</StyledSeeMore>
|
|
219
|
+
</button>
|
|
220
|
+
)}
|
|
221
|
+
</StyledResultsContainer>
|
|
222
|
+
)}
|
|
223
|
+
{!isLoading && data?.length === 0 && (
|
|
224
|
+
<StyledResultsContainer>
|
|
225
|
+
<Text size="sm" color={theme.colors.gray400}>
|
|
226
|
+
{t('booking.searchBar.noResults')}
|
|
227
|
+
</Text>
|
|
228
|
+
</StyledResultsContainer>
|
|
229
|
+
)}
|
|
230
|
+
</section>
|
|
231
|
+
)
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export { ResultSection }
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { Story } from '@storybook/react/types-6-0'
|
|
4
|
+
import styled from 'styled-components'
|
|
5
|
+
|
|
6
|
+
import { ResultSectionItem, Props } from '.'
|
|
7
|
+
import { MediaQueries } from '../../../../../misc/utils'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
component: ResultSectionItem,
|
|
11
|
+
title: 'Projects/Care/Organisms/BookingSearchBar/ResultSectionItem',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// CSS Variables are always coming from the parent. In this case I will mock them with this stylesheet.
|
|
15
|
+
const StyledMockVariablesWrapper = styled.div`
|
|
16
|
+
--rowGap: 16px;
|
|
17
|
+
--graphicSize: 32px;
|
|
18
|
+
|
|
19
|
+
${MediaQueries.tdUp} {
|
|
20
|
+
--rowGap: 8px;
|
|
21
|
+
}
|
|
22
|
+
`
|
|
23
|
+
|
|
24
|
+
const Template: Story<Props> = (args) => (
|
|
25
|
+
<StyledMockVariablesWrapper>
|
|
26
|
+
<ResultSectionItem {...args} />
|
|
27
|
+
</StyledMockVariablesWrapper>
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
export const Doctor = Template.bind({})
|
|
31
|
+
Doctor.args = {
|
|
32
|
+
type: 'doctors',
|
|
33
|
+
item: { id: 1, name: 'Dr. John Doe', slug: '/doctor/john' },
|
|
34
|
+
imageUrl: 'https://source.unsplash.com/random/74x74',
|
|
35
|
+
} as Props
|
|
36
|
+
|
|
37
|
+
export const Service = Template.bind({})
|
|
38
|
+
Service.args = {
|
|
39
|
+
type: 'services',
|
|
40
|
+
item: { id: 2, name: 'Vaccination', slug: '/services/vaccination' },
|
|
41
|
+
imageUrl: 'https://source.unsplash.com/random/74x74',
|
|
42
|
+
} as Props
|
|
43
|
+
|
|
44
|
+
export const Specialty = Template.bind({})
|
|
45
|
+
Specialty.args = {
|
|
46
|
+
type: 'specialties',
|
|
47
|
+
item: { id: 2, name: 'General Practitioner', slug: '/spec/general' },
|
|
48
|
+
imageUrl: 'https://source.unsplash.com/random/74x74',
|
|
49
|
+
} as Props
|
|
50
|
+
|
|
51
|
+
export const Clinic = Template.bind({})
|
|
52
|
+
Clinic.args = {
|
|
53
|
+
type: 'hospitals',
|
|
54
|
+
item: { id: 3, name: 'FV Hospital', slug: '/hospital/fv' },
|
|
55
|
+
} as Props
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { SearchBarSectionApi } from 'care/interfaces/types'
|
|
2
|
+
import { Text } from 'components/atoms/text'
|
|
3
|
+
import { theme } from 'misc/theme'
|
|
4
|
+
import { MediaQueries } from 'misc/utils'
|
|
5
|
+
import styled from 'styled-components'
|
|
6
|
+
|
|
7
|
+
export const StyledResult = styled.li`
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: var(--rowGap);
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
`
|
|
13
|
+
|
|
14
|
+
export const StyledRoundedIconWrapper = styled.div<{
|
|
15
|
+
type: SearchBarSectionApi['type']
|
|
16
|
+
}>`
|
|
17
|
+
--wrapper-size: var(--graphicSize);
|
|
18
|
+
border-radius: calc(var(--wrapper-size) / 2);
|
|
19
|
+
background-color: var(--neutral50);
|
|
20
|
+
width: var(--wrapper-size);
|
|
21
|
+
height: var(--wrapper-size);
|
|
22
|
+
aspect-ratio: 1/1;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
|
|
25
|
+
${({ type }) =>
|
|
26
|
+
type &&
|
|
27
|
+
type === 'doctors' &&
|
|
28
|
+
`
|
|
29
|
+
border-radius: calc(var(--graphicSize) / 2);
|
|
30
|
+
`}
|
|
31
|
+
|
|
32
|
+
img {
|
|
33
|
+
width: var(--graphicSize);
|
|
34
|
+
height: var(--graphicSize);
|
|
35
|
+
${({ type }) =>
|
|
36
|
+
type && type === 'doctors'
|
|
37
|
+
? `
|
|
38
|
+
|
|
39
|
+
object-fit: cover;
|
|
40
|
+
`
|
|
41
|
+
: `
|
|
42
|
+
object-fit: contain;
|
|
43
|
+
`}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:focus-visible {
|
|
47
|
+
outline: 1px solid ${theme.colors.gray600};
|
|
48
|
+
}
|
|
49
|
+
`
|
|
50
|
+
|
|
51
|
+
export const StyledText = styled(Text)`
|
|
52
|
+
line-height: 22px;
|
|
53
|
+
letter-spacing: -0.2px;
|
|
54
|
+
|
|
55
|
+
${MediaQueries.tdUp} {
|
|
56
|
+
&[data-size='p3'] {
|
|
57
|
+
font-size: 14px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
`
|
|
61
|
+
|
|
62
|
+
export const StyledPictureWrapper = styled.figure`
|
|
63
|
+
max-width: var(--graphicSize);
|
|
64
|
+
min-width: var(--graphicSize);
|
|
65
|
+
`
|
|
66
|
+
|
|
67
|
+
export const StyledLocationPin = styled.svg`
|
|
68
|
+
margin: 0 auto;
|
|
69
|
+
display: block;
|
|
70
|
+
`
|
|
71
|
+
|
|
72
|
+
export const StyledImageSkeletonWrapper = styled.div`
|
|
73
|
+
display: grid;
|
|
74
|
+
place-items: center;
|
|
75
|
+
`
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React, { useMemo } from 'react'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
DefaultThumbnailAny,
|
|
5
|
+
DefaultThumbnailDoctor,
|
|
6
|
+
DefaultThumbnailService,
|
|
7
|
+
} from 'care/components/atoms/icons'
|
|
8
|
+
import {
|
|
9
|
+
SearchBarSectionApi,
|
|
10
|
+
SearchBarSectionItemApi,
|
|
11
|
+
} from 'care/interfaces/types'
|
|
12
|
+
import { theme } from 'misc/theme'
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
StyledResult,
|
|
16
|
+
StyledRoundedIconWrapper,
|
|
17
|
+
StyledText,
|
|
18
|
+
StyledPictureWrapper,
|
|
19
|
+
StyledLocationPin,
|
|
20
|
+
} from './index.styled'
|
|
21
|
+
|
|
22
|
+
const defaultThumbnailByType: { [k in SearchBarSectionApi['type']]?: any } = {
|
|
23
|
+
doctors: DefaultThumbnailDoctor,
|
|
24
|
+
services: DefaultThumbnailService,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type Props = {
|
|
28
|
+
type: SearchBarSectionApi['type']
|
|
29
|
+
item: SearchBarSectionItemApi
|
|
30
|
+
imageUrl?: string
|
|
31
|
+
onClickItem?: (item: SearchBarSectionItemApi) => void
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const ResultSectionItem = ({ type, item, imageUrl, onClickItem }: Props) => {
|
|
35
|
+
const onKeyDown = (e: React.KeyboardEvent<HTMLLIElement>) => {
|
|
36
|
+
if (e.key === 'Enter' || e.key === 'Space') {
|
|
37
|
+
if (onClickItem) {
|
|
38
|
+
onClickItem(item)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const defaultThumbnail = useMemo(() => {
|
|
44
|
+
const Cmp: any = defaultThumbnailByType[type] || DefaultThumbnailAny
|
|
45
|
+
return <Cmp width={32} height={type === 'services' ? 32 : 24} />
|
|
46
|
+
}, [type])
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<StyledResult
|
|
50
|
+
onClick={() => onClickItem && onClickItem(item)}
|
|
51
|
+
onKeyDown={onKeyDown}
|
|
52
|
+
tabIndex={0}
|
|
53
|
+
role="button"
|
|
54
|
+
>
|
|
55
|
+
<StyledPictureWrapper>
|
|
56
|
+
{type === 'hospitals' ? (
|
|
57
|
+
<StyledLocationPin width="12" height="16" viewBox="0 0 12 16">
|
|
58
|
+
<path
|
|
59
|
+
fillRule="evenodd"
|
|
60
|
+
clipRule="evenodd"
|
|
61
|
+
d="M0.75 5.94873C0.75 3.04623 3.0975 0.69873 6 0.69873C8.9025 0.69873 11.25 3.04623 11.25 5.94873C11.25 9.07623 7.935 13.3887 6.5775 15.0312C6.2775 15.3912 5.73 15.3912 5.43 15.0312C4.065 13.3887 0.75 9.07623 0.75 5.94873ZM4.125 5.94873C4.125 6.98373 4.965 7.82373 6 7.82373C7.035 7.82373 7.875 6.98373 7.875 5.94873C7.875 4.91373 7.035 4.07373 6 4.07373C4.965 4.07373 4.125 4.91373 4.125 5.94873Z"
|
|
62
|
+
fill="#9AA2AC"
|
|
63
|
+
/>
|
|
64
|
+
</StyledLocationPin>
|
|
65
|
+
) : (
|
|
66
|
+
<StyledRoundedIconWrapper type={type}>
|
|
67
|
+
{imageUrl ? (
|
|
68
|
+
<img
|
|
69
|
+
src={imageUrl}
|
|
70
|
+
width={32}
|
|
71
|
+
height={type === 'services' ? 32 : 24}
|
|
72
|
+
/>
|
|
73
|
+
) : (
|
|
74
|
+
defaultThumbnail
|
|
75
|
+
)}
|
|
76
|
+
</StyledRoundedIconWrapper>
|
|
77
|
+
)}
|
|
78
|
+
</StyledPictureWrapper>
|
|
79
|
+
<StyledText color={theme.colors.gray800} size="p3">
|
|
80
|
+
{item.name}
|
|
81
|
+
</StyledText>
|
|
82
|
+
</StyledResult>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { ResultSectionItem }
|