@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,52 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { theme } from 'misc/theme'
|
|
4
|
+
import { useId } from 'react-id-generator'
|
|
5
|
+
import Skeleton from 'react-loading-skeleton'
|
|
6
|
+
import styled from 'styled-components'
|
|
7
|
+
|
|
8
|
+
type Props = {
|
|
9
|
+
count: number
|
|
10
|
+
className?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const StyledLiSkeleton = styled.li`
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: 12px;
|
|
17
|
+
padding: 8px 16px;
|
|
18
|
+
|
|
19
|
+
> :first-child {
|
|
20
|
+
flex: 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
> :nth-child(2) {
|
|
24
|
+
flex: 6;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
& + li::before {
|
|
28
|
+
content: '';
|
|
29
|
+
position: absolute;
|
|
30
|
+
left: 18px;
|
|
31
|
+
right: 18px;
|
|
32
|
+
top: 0;
|
|
33
|
+
height: 1px;
|
|
34
|
+
background-color: ${theme.colors.neutral100};
|
|
35
|
+
}
|
|
36
|
+
`
|
|
37
|
+
|
|
38
|
+
const LiSkeleton = ({ count, className }: Props) => {
|
|
39
|
+
const idList = useId(count)
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
{[...Array(count)].map((__v, i) => (
|
|
43
|
+
<StyledLiSkeleton className={className} key={idList[i]}>
|
|
44
|
+
<Skeleton count={1} height={32} />
|
|
45
|
+
<Skeleton count={1} height={24} />
|
|
46
|
+
</StyledLiSkeleton>
|
|
47
|
+
))}
|
|
48
|
+
</>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default LiSkeleton
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { useMemo, useRef } from 'react'
|
|
2
|
+
|
|
3
|
+
import { MagnifierIcon } from 'care/components/atoms/icons'
|
|
4
|
+
import { useTranslations } from 'hooks/useTranslations'
|
|
5
|
+
import { theme } from 'misc/theme'
|
|
6
|
+
import styled from 'styled-components'
|
|
7
|
+
|
|
8
|
+
import { StyledInput } from '../index.styled'
|
|
9
|
+
import { FocusedType, GATrackingCode } from '../types'
|
|
10
|
+
import { useAnimatedPlaceholder } from '../useAnimatedPlaceholder'
|
|
11
|
+
|
|
12
|
+
export const StyledFakeInputSearchMobile = styled.div`
|
|
13
|
+
user-select: none;
|
|
14
|
+
input {
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
background-color: white;
|
|
17
|
+
}
|
|
18
|
+
`
|
|
19
|
+
|
|
20
|
+
type Props = {
|
|
21
|
+
focused: FocusedType
|
|
22
|
+
onClick?: () => void
|
|
23
|
+
value?: string
|
|
24
|
+
trackingAttributes?: GATrackingCode
|
|
25
|
+
inputSearchPlaceholder?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function MobileFakeInput({
|
|
29
|
+
focused,
|
|
30
|
+
value = '',
|
|
31
|
+
onClick,
|
|
32
|
+
trackingAttributes,
|
|
33
|
+
inputSearchPlaceholder,
|
|
34
|
+
}: Props) {
|
|
35
|
+
const { t } = useTranslations()
|
|
36
|
+
const wrapperRef = useRef<HTMLDivElement>(null)
|
|
37
|
+
|
|
38
|
+
useAnimatedPlaceholder({ wrapperRef, disabled: !!inputSearchPlaceholder })
|
|
39
|
+
|
|
40
|
+
const gaAttributes = useMemo(() => {
|
|
41
|
+
if (trackingAttributes) {
|
|
42
|
+
return {
|
|
43
|
+
'data-event-category': trackingAttributes.dataEventCategory,
|
|
44
|
+
'data-event-action': trackingAttributes.dataEventAction,
|
|
45
|
+
'data-event-label': trackingAttributes.dataEventLabel,
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
return {}
|
|
49
|
+
}
|
|
50
|
+
}, [trackingAttributes])
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<StyledFakeInputSearchMobile
|
|
54
|
+
onClick={() => onClick && onClick()}
|
|
55
|
+
ref={wrapperRef}
|
|
56
|
+
{...gaAttributes}
|
|
57
|
+
>
|
|
58
|
+
<StyledInput
|
|
59
|
+
inputClassName={focused === 'location' ? 'focused' : undefined}
|
|
60
|
+
name="booking-search-placeholder"
|
|
61
|
+
displayIcon={<MagnifierIcon color={theme.colors.gray400} />}
|
|
62
|
+
placeholder={t('booking.searchBar.searchInput.placeholder')}
|
|
63
|
+
value={value}
|
|
64
|
+
size="md"
|
|
65
|
+
/>
|
|
66
|
+
</StyledFakeInputSearchMobile>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { Story } from '@storybook/react/types-6-0'
|
|
4
|
+
|
|
5
|
+
import { Props, MobileTopBar } from '.'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: MobileTopBar,
|
|
9
|
+
title: 'Projects/Care/Organisms/BookingSearchBar/MobileTopBar',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const Template: Story<Props> = (args) => <MobileTopBar {...args} />
|
|
13
|
+
|
|
14
|
+
export const Normal = Template.bind({})
|
|
15
|
+
|
|
16
|
+
Normal.args = {
|
|
17
|
+
headingText: 'Search',
|
|
18
|
+
textRight: 'Close',
|
|
19
|
+
// iconLeft?:
|
|
20
|
+
onRightClick: () => console.log('onRightClick'),
|
|
21
|
+
onClick: () => console.log('onClick'),
|
|
22
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Text } from 'components/atoms/text'
|
|
2
|
+
import { theme } from 'misc/theme'
|
|
3
|
+
import styled from 'styled-components'
|
|
4
|
+
|
|
5
|
+
export const StyledTopBar = styled.header`
|
|
6
|
+
display: flex;
|
|
7
|
+
height: 64px;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
margin: 0 auto;
|
|
11
|
+
position: sticky;
|
|
12
|
+
z-index: 99;
|
|
13
|
+
background-color: white;
|
|
14
|
+
top: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
`
|
|
17
|
+
|
|
18
|
+
export const StyledTopBarHeaderRight = styled.div`
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
flex: 1;
|
|
21
|
+
justify-content: flex-end;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
text-decoration: underline;
|
|
24
|
+
`
|
|
25
|
+
|
|
26
|
+
export const StyledTopBarIcon = styled.div`
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
margin-left: 16px;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
`
|
|
32
|
+
|
|
33
|
+
export const StyledTopbarHeading = styled.div`
|
|
34
|
+
width: 100%;
|
|
35
|
+
margin-left: 24px;
|
|
36
|
+
`
|
|
37
|
+
|
|
38
|
+
export const StyledTopbarHeadingText = styled(Text)`
|
|
39
|
+
color: ${theme.colors.secondaryDark};
|
|
40
|
+
text-align: start;
|
|
41
|
+
`
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { CloseIcon } from 'care/components/atoms/icons'
|
|
4
|
+
import { theme } from 'misc/theme'
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
StyledTopBar,
|
|
8
|
+
StyledTopBarHeaderRight,
|
|
9
|
+
StyledTopbarHeading,
|
|
10
|
+
StyledTopbarHeadingText,
|
|
11
|
+
StyledTopBarIcon,
|
|
12
|
+
} from './index.styled'
|
|
13
|
+
|
|
14
|
+
export type Props = {
|
|
15
|
+
className?: string
|
|
16
|
+
headingText: string
|
|
17
|
+
textRight?: string
|
|
18
|
+
iconLeft?: JSX.Element
|
|
19
|
+
onRightClick?: () => void
|
|
20
|
+
onLeftClick?: () => void
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const MobileTopBar = ({
|
|
24
|
+
className,
|
|
25
|
+
onLeftClick,
|
|
26
|
+
headingText,
|
|
27
|
+
onRightClick,
|
|
28
|
+
iconLeft,
|
|
29
|
+
textRight,
|
|
30
|
+
}: Props) => {
|
|
31
|
+
return (
|
|
32
|
+
<StyledTopBar className={className}>
|
|
33
|
+
<StyledTopBarIcon onClick={onLeftClick}>
|
|
34
|
+
{iconLeft || <CloseIcon color={theme.colors.gray800} />}
|
|
35
|
+
</StyledTopBarIcon>
|
|
36
|
+
<StyledTopbarHeading>
|
|
37
|
+
<StyledTopbarHeadingText size="md" type="bold">
|
|
38
|
+
{headingText}
|
|
39
|
+
</StyledTopbarHeadingText>
|
|
40
|
+
</StyledTopbarHeading>
|
|
41
|
+
<StyledTopBarHeaderRight onClick={onRightClick}>
|
|
42
|
+
{textRight && <p>{textRight}</p>}
|
|
43
|
+
</StyledTopBarHeaderRight>
|
|
44
|
+
</StyledTopBar>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { MobileTopBar }
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { ID_OPTION_CURRENT_LOCATION } from 'care/interfaces/constants'
|
|
2
|
+
import {
|
|
3
|
+
CareLocaleType,
|
|
4
|
+
City,
|
|
5
|
+
SearchBarSectionApi,
|
|
6
|
+
SearchCityByGeoIpApi,
|
|
7
|
+
} from 'care/interfaces/types'
|
|
8
|
+
import { GeoLocationPermission, GPSType } from 'interfaces/types'
|
|
9
|
+
|
|
10
|
+
import { SEARCH_KEYWORD_MIN_LENGTH } from './constants'
|
|
11
|
+
import { FocusedType } from './types'
|
|
12
|
+
|
|
13
|
+
export type ReducerState = {
|
|
14
|
+
isMobile: boolean
|
|
15
|
+
isDebug: boolean
|
|
16
|
+
navigateTo: null | string
|
|
17
|
+
geoLocationPermission: GeoLocationPermission
|
|
18
|
+
geoLocationCoordinates: null | GPSType
|
|
19
|
+
searchLocationKeywords: string
|
|
20
|
+
searchKeywords: string
|
|
21
|
+
focused: FocusedType
|
|
22
|
+
selectedLocation: City | null
|
|
23
|
+
defaultCity: City | null
|
|
24
|
+
initialCities: City[]
|
|
25
|
+
cities: City[]
|
|
26
|
+
searchResults: SearchBarSectionApi[]
|
|
27
|
+
initialSearchResults: SearchBarSectionApi[]
|
|
28
|
+
isLoadingCities: boolean
|
|
29
|
+
isLoadingSearchResults: boolean
|
|
30
|
+
isMobileModalOpened: boolean
|
|
31
|
+
initialSelectedCity: City | null
|
|
32
|
+
autoCompleteDisabled: boolean
|
|
33
|
+
inputSearchPlaceholder: string
|
|
34
|
+
locale: CareLocaleType
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const initialState: ReducerState = {
|
|
38
|
+
isMobile: false,
|
|
39
|
+
isDebug: false,
|
|
40
|
+
navigateTo: null,
|
|
41
|
+
geoLocationPermission: 'unset',
|
|
42
|
+
geoLocationCoordinates: null,
|
|
43
|
+
focused: 'none',
|
|
44
|
+
searchLocationKeywords: '',
|
|
45
|
+
searchKeywords: '',
|
|
46
|
+
selectedLocation: null,
|
|
47
|
+
defaultCity: null,
|
|
48
|
+
initialCities: [],
|
|
49
|
+
cities: [],
|
|
50
|
+
searchResults: [],
|
|
51
|
+
initialSearchResults: [],
|
|
52
|
+
isLoadingCities: false,
|
|
53
|
+
isLoadingSearchResults: false,
|
|
54
|
+
isMobileModalOpened: false,
|
|
55
|
+
initialSelectedCity: null,
|
|
56
|
+
autoCompleteDisabled: false,
|
|
57
|
+
inputSearchPlaceholder: '',
|
|
58
|
+
locale: 'vi-VN',
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export enum ActionTypes {
|
|
62
|
+
NavigateTo = 'navigate to url',
|
|
63
|
+
ClickOutsideInputLocation = 'click outside input location',
|
|
64
|
+
ClickOutsideInputSearch = 'click outside input search',
|
|
65
|
+
SelectCurrentLocation = 'select current location',
|
|
66
|
+
FocusInputLocation = 'focus input location',
|
|
67
|
+
FocusInputSearch = 'focus input search',
|
|
68
|
+
ChangeInputLocation = 'change input location',
|
|
69
|
+
ChangeInputSearch = 'change input search',
|
|
70
|
+
ClearInputLocation = 'clear input location',
|
|
71
|
+
ClearInputSearch = 'clear input search',
|
|
72
|
+
SelectLocation = 'select location',
|
|
73
|
+
FetchCitiesStart = 'fetch cities start',
|
|
74
|
+
FetchCitiesFinish = 'fetch cities finish',
|
|
75
|
+
FetchSearchResultsStart = 'fetch search results start',
|
|
76
|
+
FetchSearchResultsComplete = 'fetch search results complete',
|
|
77
|
+
FetchSearchResultsFinish = 'fetch search results finish',
|
|
78
|
+
FetchCitiesByGeoIpComplete = 'fetch cities by geo IP finish',
|
|
79
|
+
FetchCitiesByKeywordComplete = 'fetch cities by keyword finish',
|
|
80
|
+
DisplayInitialCities = 'display initial cities',
|
|
81
|
+
DisplayInitialSearchResults = 'display initial search results',
|
|
82
|
+
GrantGeoLocationPermission = 'grant geolocation permission',
|
|
83
|
+
DenyGeoLocationPermission = 'deny geolocation permission',
|
|
84
|
+
OpenMobileModal = 'open mobile modal',
|
|
85
|
+
CloseMobileModal = 'close mobile modal',
|
|
86
|
+
UpdateInitialSearchValue = 'update initial search value',
|
|
87
|
+
SelectSearchResult = 'select search result',
|
|
88
|
+
SetInputSearchPlaceholder = 'set input search placeholder',
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type Action =
|
|
92
|
+
| { type: ActionTypes.NavigateTo; payload: string }
|
|
93
|
+
| { type: ActionTypes.ClickOutsideInputLocation }
|
|
94
|
+
| { type: ActionTypes.ClickOutsideInputSearch }
|
|
95
|
+
| { type: ActionTypes.FocusInputLocation }
|
|
96
|
+
| { type: ActionTypes.FocusInputSearch }
|
|
97
|
+
| { type: ActionTypes.ChangeInputLocation; payload: string }
|
|
98
|
+
| { type: ActionTypes.ChangeInputSearch; payload: string }
|
|
99
|
+
| { type: ActionTypes.ClearInputLocation }
|
|
100
|
+
| { type: ActionTypes.ClearInputSearch }
|
|
101
|
+
| { type: ActionTypes.SelectCurrentLocation; payload: City }
|
|
102
|
+
| { type: ActionTypes.SelectLocation; payload: City }
|
|
103
|
+
| { type: ActionTypes.FetchCitiesStart }
|
|
104
|
+
| { type: ActionTypes.FetchCitiesFinish }
|
|
105
|
+
| { type: ActionTypes.FetchSearchResultsStart }
|
|
106
|
+
| {
|
|
107
|
+
type: ActionTypes.FetchSearchResultsComplete
|
|
108
|
+
payload: SearchBarSectionApi[]
|
|
109
|
+
}
|
|
110
|
+
| { type: ActionTypes.FetchSearchResultsFinish }
|
|
111
|
+
| {
|
|
112
|
+
type: ActionTypes.FetchCitiesByGeoIpComplete
|
|
113
|
+
payload: SearchCityByGeoIpApi
|
|
114
|
+
}
|
|
115
|
+
| { type: ActionTypes.FetchCitiesByKeywordComplete; payload: City[] }
|
|
116
|
+
| { type: ActionTypes.DisplayInitialCities }
|
|
117
|
+
| { type: ActionTypes.DisplayInitialSearchResults }
|
|
118
|
+
| { type: ActionTypes.GrantGeoLocationPermission; payload: GPSType }
|
|
119
|
+
| { type: ActionTypes.DenyGeoLocationPermission }
|
|
120
|
+
| { type: ActionTypes.OpenMobileModal }
|
|
121
|
+
| { type: ActionTypes.CloseMobileModal }
|
|
122
|
+
| { type: ActionTypes.UpdateInitialSearchValue; payload: string }
|
|
123
|
+
| {
|
|
124
|
+
type: ActionTypes.SelectSearchResult
|
|
125
|
+
payload: { name: string; url: string }
|
|
126
|
+
}
|
|
127
|
+
| { type: ActionTypes.SetInputSearchPlaceholder; payload: string }
|
|
128
|
+
|
|
129
|
+
function resetSearchLocationKeywords(state: ReducerState): ReducerState {
|
|
130
|
+
const { selectedLocation, searchLocationKeywords } = state
|
|
131
|
+
if (selectedLocation && searchLocationKeywords !== selectedLocation.name) {
|
|
132
|
+
return { ...state, searchLocationKeywords: selectedLocation.name }
|
|
133
|
+
}
|
|
134
|
+
return state
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function reducer(state: ReducerState, action: Action): ReducerState {
|
|
138
|
+
if (state.isDebug) {
|
|
139
|
+
console.log('bookingSearchBar', { action, state })
|
|
140
|
+
}
|
|
141
|
+
switch (action.type) {
|
|
142
|
+
case ActionTypes.NavigateTo:
|
|
143
|
+
return {
|
|
144
|
+
...state,
|
|
145
|
+
navigateTo: action.payload,
|
|
146
|
+
focused: 'none',
|
|
147
|
+
isMobileModalOpened: false,
|
|
148
|
+
}
|
|
149
|
+
case ActionTypes.ClickOutsideInputLocation: {
|
|
150
|
+
if (state.isMobile || state.focused !== 'location') {
|
|
151
|
+
return state
|
|
152
|
+
}
|
|
153
|
+
return resetSearchLocationKeywords({ ...state, focused: 'none' })
|
|
154
|
+
}
|
|
155
|
+
case ActionTypes.ClickOutsideInputSearch: {
|
|
156
|
+
if (state.isMobile || state.focused !== 'search') {
|
|
157
|
+
return state
|
|
158
|
+
}
|
|
159
|
+
return { ...state, focused: 'none' }
|
|
160
|
+
}
|
|
161
|
+
case ActionTypes.FocusInputLocation: {
|
|
162
|
+
const nextState: ReducerState = { ...state, focused: 'location' }
|
|
163
|
+
if (state.selectedLocation?.id === ID_OPTION_CURRENT_LOCATION) {
|
|
164
|
+
nextState.searchLocationKeywords = ''
|
|
165
|
+
}
|
|
166
|
+
return nextState
|
|
167
|
+
}
|
|
168
|
+
case ActionTypes.FocusInputSearch:
|
|
169
|
+
const nextState: ReducerState = { ...state, focused: 'search' }
|
|
170
|
+
if (state.isMobile) {
|
|
171
|
+
return resetSearchLocationKeywords(nextState)
|
|
172
|
+
}
|
|
173
|
+
return nextState
|
|
174
|
+
case ActionTypes.ChangeInputLocation:
|
|
175
|
+
return { ...state, searchLocationKeywords: action.payload }
|
|
176
|
+
case ActionTypes.ChangeInputSearch: {
|
|
177
|
+
const keyword = action.payload
|
|
178
|
+
return {
|
|
179
|
+
...state,
|
|
180
|
+
searchKeywords: keyword,
|
|
181
|
+
isLoadingSearchResults:
|
|
182
|
+
keyword.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale],
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
case ActionTypes.SelectCurrentLocation:
|
|
186
|
+
return {
|
|
187
|
+
...state,
|
|
188
|
+
focused: 'none',
|
|
189
|
+
selectedLocation: action.payload,
|
|
190
|
+
searchLocationKeywords: action.payload.name,
|
|
191
|
+
}
|
|
192
|
+
case ActionTypes.ClearInputLocation:
|
|
193
|
+
return {
|
|
194
|
+
...state,
|
|
195
|
+
focused: 'location',
|
|
196
|
+
cities: state.initialCities,
|
|
197
|
+
searchLocationKeywords: '',
|
|
198
|
+
}
|
|
199
|
+
case ActionTypes.ClearInputSearch:
|
|
200
|
+
return { ...state, focused: 'search', searchKeywords: '' }
|
|
201
|
+
case ActionTypes.SelectLocation:
|
|
202
|
+
return {
|
|
203
|
+
...state,
|
|
204
|
+
focused: 'none',
|
|
205
|
+
selectedLocation: action.payload,
|
|
206
|
+
searchLocationKeywords: action.payload.name,
|
|
207
|
+
}
|
|
208
|
+
case ActionTypes.SelectSearchResult:
|
|
209
|
+
return {
|
|
210
|
+
...state,
|
|
211
|
+
searchKeywords: action.payload.name,
|
|
212
|
+
isMobileModalOpened: false,
|
|
213
|
+
focused: 'none',
|
|
214
|
+
navigateTo: action.payload.url,
|
|
215
|
+
}
|
|
216
|
+
case ActionTypes.FetchCitiesStart:
|
|
217
|
+
return { ...state, isLoadingCities: true }
|
|
218
|
+
case ActionTypes.FetchCitiesFinish:
|
|
219
|
+
return { ...state, isLoadingCities: false }
|
|
220
|
+
case ActionTypes.FetchSearchResultsStart:
|
|
221
|
+
return { ...state, isLoadingSearchResults: true }
|
|
222
|
+
case ActionTypes.FetchSearchResultsFinish:
|
|
223
|
+
return { ...state, isLoadingSearchResults: false }
|
|
224
|
+
case ActionTypes.FetchSearchResultsComplete: {
|
|
225
|
+
const nextState: ReducerState = {
|
|
226
|
+
...state,
|
|
227
|
+
searchResults: action.payload,
|
|
228
|
+
}
|
|
229
|
+
if (state.initialSearchResults.length === 0) {
|
|
230
|
+
nextState.initialSearchResults = action.payload
|
|
231
|
+
}
|
|
232
|
+
return nextState
|
|
233
|
+
}
|
|
234
|
+
case ActionTypes.FetchCitiesByGeoIpComplete: {
|
|
235
|
+
let { cities } = action.payload
|
|
236
|
+
const { default: defaultCity } = action.payload
|
|
237
|
+
cities = cities.filter((c) => c.id !== defaultCity.id)
|
|
238
|
+
cities.unshift(defaultCity)
|
|
239
|
+
if (
|
|
240
|
+
state.initialSelectedCity &&
|
|
241
|
+
!cities.find((c) => c.id === state.initialSelectedCity.id)
|
|
242
|
+
) {
|
|
243
|
+
cities.unshift(state.initialSelectedCity)
|
|
244
|
+
}
|
|
245
|
+
const nextState: ReducerState = {
|
|
246
|
+
...state,
|
|
247
|
+
defaultCity,
|
|
248
|
+
initialCities: cities,
|
|
249
|
+
cities,
|
|
250
|
+
}
|
|
251
|
+
if (
|
|
252
|
+
state.geoLocationPermission === 'denied' &&
|
|
253
|
+
!state.initialSelectedCity
|
|
254
|
+
) {
|
|
255
|
+
nextState.selectedLocation = defaultCity
|
|
256
|
+
nextState.searchLocationKeywords = defaultCity.name
|
|
257
|
+
}
|
|
258
|
+
return nextState
|
|
259
|
+
}
|
|
260
|
+
case ActionTypes.FetchCitiesByKeywordComplete:
|
|
261
|
+
return { ...state, cities: action.payload }
|
|
262
|
+
case ActionTypes.DisplayInitialCities:
|
|
263
|
+
return { ...state, cities: state.initialCities }
|
|
264
|
+
case ActionTypes.DisplayInitialSearchResults:
|
|
265
|
+
return {
|
|
266
|
+
...state,
|
|
267
|
+
searchResults: state.initialSearchResults,
|
|
268
|
+
isLoadingSearchResults: false,
|
|
269
|
+
}
|
|
270
|
+
case ActionTypes.GrantGeoLocationPermission:
|
|
271
|
+
return {
|
|
272
|
+
...state,
|
|
273
|
+
geoLocationPermission: 'granted',
|
|
274
|
+
geoLocationCoordinates: action.payload,
|
|
275
|
+
}
|
|
276
|
+
case ActionTypes.DenyGeoLocationPermission:
|
|
277
|
+
return {
|
|
278
|
+
...state,
|
|
279
|
+
geoLocationPermission: 'denied',
|
|
280
|
+
geoLocationCoordinates: null,
|
|
281
|
+
}
|
|
282
|
+
case ActionTypes.OpenMobileModal:
|
|
283
|
+
return { ...state, isMobileModalOpened: true }
|
|
284
|
+
case ActionTypes.CloseMobileModal:
|
|
285
|
+
return { ...state, isMobileModalOpened: false }
|
|
286
|
+
case ActionTypes.UpdateInitialSearchValue:
|
|
287
|
+
return { ...state, searchKeywords: action.payload }
|
|
288
|
+
case ActionTypes.SetInputSearchPlaceholder:
|
|
289
|
+
return { ...state, inputSearchPlaceholder: action.payload }
|
|
290
|
+
default:
|
|
291
|
+
return state
|
|
292
|
+
}
|
|
293
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
export const DoctorIcon = () => (
|
|
4
|
+
<svg width="14" height="18" viewBox="0 0 14 18">
|
|
5
|
+
<path
|
|
6
|
+
d="M7.00004 0.666992C5.29757 0.666992 3.64067 0.813476 2.52087 1.03158C1.73311 1.18457 1.16671 1.86816 1.16671 2.6722V4.83366C1.16671 5.29264 1.54106 5.66699 2.00004 5.66699H12C12.459 5.66699 12.8334 5.29264 12.8334 4.83366V2.69824C12.8334 1.89421 12.267 1.21061 11.4792 1.05762C10.3562 0.839518 8.69275 0.666992 7.00004 0.666992ZM6.16671 1.50033H7.83337V2.33366H8.66671V4.00033H7.83337V4.83366H6.16671V4.00033H5.33337V2.33366H6.16671V1.50033ZM1.42712 6.50033C1.3197 6.89421 1.24158 7.32389 1.19275 7.77637C1.14718 8.18001 1.05603 9.25423 1.06254 9.36491C0.603556 9.72624 0.333374 10.2861 0.333374 10.9014C0.333374 11.8356 0.977906 12.6364 1.84379 12.8285C2.74548 15.0192 4.55212 17.3337 7.00004 17.3337C9.44796 17.3337 11.2546 14.9964 12.1563 12.8024C13.0222 12.6136 13.6667 11.8356 13.6667 10.9014C13.6667 10.2861 13.3965 9.72624 12.9375 9.36491C12.9441 9.25423 12.8562 8.16048 12.8073 7.75033C12.7552 7.30436 12.6804 6.89095 12.573 6.50033H5.35942C6.52804 8.20606 9.27543 7.18717 11.0365 7.62012C11.5736 8.79199 11.1667 10.4326 11.1667 10.4326L11.8177 10.641C11.9121 10.6702 12 10.7549 12 10.9014C12 11.0576 11.8861 11.1943 11.6875 11.1878L11.0105 11.0837L10.7761 11.7347C9.96554 14.0492 8.4128 15.667 7.00004 15.667C5.58728 15.667 4.03455 14.0492 3.224 11.7347L2.96358 11.0837L2.26046 11.1878C2.11723 11.1878 2.00004 11.0576 2.00004 10.9014C2.00004 10.7549 2.08793 10.6702 2.18233 10.641L2.83337 10.4326C2.73246 10.5531 2.4102 8.7041 2.83337 8.03678C3.59184 7.5127 4.2266 7.87728 5.12504 6.50033H1.42712ZM5.17712 9.05241C4.57166 9.05241 4.08337 9.55371 4.08337 10.1722C4.08337 10.7907 4.57166 11.292 5.17712 11.292C5.78259 11.292 6.27087 10.7907 6.27087 10.1722C6.27087 9.55371 5.78259 9.05241 5.17712 9.05241ZM8.82296 9.05241C8.21749 9.05241 7.72921 9.55371 7.72921 10.1722C7.72921 10.7907 8.21749 11.292 8.82296 11.292C9.42843 11.292 9.91671 10.7907 9.91671 10.1722C9.91671 9.55371 9.42843 9.05241 8.82296 9.05241Z"
|
|
7
|
+
fill="#9AA2AC"
|
|
8
|
+
/>
|
|
9
|
+
</svg>
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
export const ServiceIcon = () => (
|
|
13
|
+
<svg width="18" height="18" viewBox="0 0 18 18">
|
|
14
|
+
<path
|
|
15
|
+
d="M8.99996 0.666992C6.27535 0.666992 3.85348 1.97884 2.33329 4.00033H4.59892C5.80009 2.94564 7.36259 2.33366 8.99996 2.33366C10.6373 2.33366 12.1998 2.94564 13.401 4.00033H15.6666C14.1464 1.97884 11.7246 0.666992 8.99996 0.666992ZM1.78642 4.83366C1.07678 7.04069 0.666626 9.59928 0.666626 12.3337C0.666626 14.085 0.826131 15.7679 1.13538 17.3337H16.8645C17.1738 15.7679 17.3333 14.085 17.3333 12.3337C17.3333 9.59928 16.9231 7.04069 16.2135 4.83366H1.78642ZM8.99996 7.33366C11.3014 7.33366 13.1666 9.19889 13.1666 11.5003C13.1666 13.8018 11.3014 15.667 8.99996 15.667C6.69853 15.667 4.83329 13.8018 4.83329 11.5003C4.83329 9.19889 6.69853 7.33366 8.99996 7.33366ZM8.16663 9.00033V10.667H6.49996V12.3337H8.16663V14.0003H9.83329V12.3337H11.5V10.667H9.83329V9.00033H8.16663Z"
|
|
16
|
+
fill="#9AA2AC"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
export const HospitalIcon = () => (
|
|
22
|
+
<svg width="16" height="17" viewBox="0 0 16 17">
|
|
23
|
+
<path
|
|
24
|
+
d="M8 0.666992L0.5 5.63533V14.8337C0.5 15.7545 1.24583 16.5003 2.16667 16.5003H13.8333C14.7542 16.5003 15.5 15.7545 15.5 14.8337V5.63533L8 0.666992ZM11.3333 10.667H8.83333V13.167H7.16667V10.667H4.66667V9.00033H7.16667V6.50033H8.83333V9.00033H11.3333V10.667Z"
|
|
25
|
+
fill="#9AA2AC"
|
|
26
|
+
/>
|
|
27
|
+
</svg>
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
export const SpecialtyIcon = () => (
|
|
31
|
+
<svg width="16" height="16" viewBox="0 0 16 16">
|
|
32
|
+
<path
|
|
33
|
+
d="M3.83333 0.5C2.94928 0.5 2.10143 0.851189 1.47631 1.47631C0.851189 2.10143 0.5 2.94928 0.5 3.83333C0.5 4.71739 0.851189 5.56523 1.47631 6.19036C2.10143 6.81548 2.94928 7.16667 3.83333 7.16667C4.71739 7.16667 5.56523 6.81548 6.19036 6.19036C6.81548 5.56523 7.16667 4.71739 7.16667 3.83333C7.16667 2.94928 6.81548 2.10143 6.19036 1.47631C5.56523 0.851189 4.71739 0.5 3.83333 0.5V0.5ZM10.5 0.5C9.57917 0.5 8.83333 1.24583 8.83333 2.16667V5.5C8.83333 6.42083 9.57917 7.16667 10.5 7.16667H13.8333C14.7542 7.16667 15.5 6.42083 15.5 5.5V2.16667C15.5 1.24583 14.7542 0.5 13.8333 0.5H10.5ZM3.83333 8.83333C2.94928 8.83333 2.10143 9.18452 1.47631 9.80964C0.851189 10.4348 0.5 11.2826 0.5 12.1667C0.5 13.0507 0.851189 13.8986 1.47631 14.5237C2.10143 15.1488 2.94928 15.5 3.83333 15.5C4.71739 15.5 5.56523 15.1488 6.19036 14.5237C6.81548 13.8986 7.16667 13.0507 7.16667 12.1667C7.16667 11.2826 6.81548 10.4348 6.19036 9.80964C5.56523 9.18452 4.71739 8.83333 3.83333 8.83333V8.83333ZM12.1667 8.83333C11.2826 8.83333 10.4348 9.18452 9.80964 9.80964C9.18452 10.4348 8.83333 11.2826 8.83333 12.1667C8.83333 13.0507 9.18452 13.8986 9.80964 14.5237C10.4348 15.1488 11.2826 15.5 12.1667 15.5C13.0507 15.5 13.8986 15.1488 14.5237 14.5237C15.1488 13.8986 15.5 13.0507 15.5 12.1667C15.5 11.2826 15.1488 10.4348 14.5237 9.80964C13.8986 9.18452 13.0507 8.83333 12.1667 8.83333V8.83333Z"
|
|
34
|
+
fill="#9AA2AC"
|
|
35
|
+
/>
|
|
36
|
+
</svg>
|
|
37
|
+
)
|