@hhgtech/hhg-components 1.29.80 → 1.29.82
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/build/{index-1250dd06.js → WhatsApp-46f4f408.js} +24 -276
- package/build/adapters.js +17 -16
- package/build/atoms.js +102 -0
- package/build/babyGrowth.js +162 -164
- package/build/cache.js +3 -3
- package/build/care.js +17 -17
- package/build/components.js +181 -163
- package/build/{constants-ca71f9e5.js → constants-223c01fc.js} +2 -2
- package/build/{constants-4e7c419e.js → constants-8743b014.js} +0 -136
- package/build/constants-a78fa8b3.js +318 -0
- package/build/constants-f182fc32.js +425 -0
- package/build/constants.js +3 -3
- package/build/{core-bb2587e7.js → core-9d69a722.js} +2 -2
- package/build/{dataTransform-469b75eb.js → dataTransform-ded2692d.js} +1 -1
- package/build/{index-5d9ad07e.js → dataTransform-e39297c1.js} +3 -52
- package/build/defaultClassWrapper-b7719693.js +21 -0
- package/build/ecom.js +5 -5
- package/build/esm/WhatsApp-c599b715.js +46 -0
- package/build/esm/adapters.js +17 -16
- package/build/esm/atoms.js +59 -0
- package/build/esm/babyGrowth.js +87 -89
- package/build/esm/cache.js +3 -3
- package/build/esm/care.js +17 -17
- package/build/esm/components.js +91 -73
- package/build/esm/constants-a5827634.js +307 -0
- package/build/esm/{constants-7661ce64.js → constants-bb470362.js} +2 -2
- package/build/esm/{constants-508ba335.js → constants-f6b2e49d.js} +1 -127
- package/build/esm/constants-fa475b0f.js +417 -0
- package/build/esm/constants.js +3 -3
- package/build/esm/{core-5a22b83e.js → core-80bfe8b7.js} +2 -2
- package/build/esm/{dataTransform-f5db5afb.js → dataTransform-55f67eed.js} +1 -1
- package/build/esm/{index-9b54376f.js → dataTransform-623716c3.js} +5 -53
- package/build/esm/defaultClassWrapper-00903c00.js +15 -0
- package/build/esm/ecom.js +5 -5
- package/build/esm/fixedBottomAdBlock-60a5d48f.js +3474 -0
- package/build/esm/footer.js +18 -18
- package/build/esm/gAssets.js +4 -4
- package/build/esm/{getDynamicHealthTool-09fda8b3.js → getDynamicHealthTool-82855adc.js} +4 -4
- package/build/esm/{getSocialList-96301dbb.js → getSocialList-7d2cf48d.js} +5 -6
- package/build/esm/healthToolsForm.js +40 -0
- package/build/esm/healthToolsForms.d.ts +7 -0
- package/build/esm/hooks.js +17 -17
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-da2b8f22.js → index-01405723.js} +12 -11
- package/build/esm/index-01b5d2e9.js +202 -0
- package/build/esm/index-02d3f05b.js +1681 -0
- package/build/esm/{index-82861dba.js → index-046778af.js} +2 -2
- package/build/esm/{index-df29c4e0.js → index-049e0270.js} +33 -5
- package/build/esm/index-07f3f47e.js +14 -0
- package/build/esm/index-0b745f46.js +1349 -0
- package/build/esm/{index-e68d4285.js → index-0ca9b175.js} +2 -2
- package/build/esm/{index-c4699d44.js → index-0cd3523c.js} +35 -176
- package/build/esm/index-0ee66974.js +95 -0
- package/build/esm/index-10ab6596.js +489 -0
- package/build/esm/{index-5773eb18.js → index-13d8dd4b.js} +6 -6
- package/build/esm/{index.styled-9e147e72.js → index-1c9b481b.js} +21 -3
- package/build/esm/index-1d3c6ce7.js +195 -0
- package/build/esm/{index-474e0ae5.js → index-21256394.js} +2 -13
- package/build/esm/{index-2d47a346.js → index-219e3a35.js} +11 -10
- package/build/esm/{index-679d5383.js → index-29908d2c.js} +1 -1
- package/build/esm/{utils-ff5d88a2.js → index-2dc7803d.js} +71 -105
- package/build/esm/{index-4dcdce19.js → index-5723381f.js} +2 -2
- package/build/esm/{index-c807ef87.js → index-6210f454.js} +3 -3
- package/build/esm/index-7a1ea734.js +100 -0
- package/build/esm/{index-53a86337.js → index-7c384ae6.js} +5 -5
- package/build/esm/index-8eb04f36.js +130 -0
- package/build/esm/index-8fcf671c.js +335 -0
- package/build/esm/{index-80f4d7df.js → index-9471fca1.js} +2 -2
- package/build/esm/{index-92eedeb0.js → index-9b3a8b6d.js} +12 -201
- package/build/esm/{index-3c7f109c.js → index-9b9c1499.js} +2 -2
- package/build/esm/index-9f99909b.js +54 -0
- package/build/esm/index-ac2a8f95.js +1114 -0
- package/build/esm/index-acf8b60e.js +42 -0
- package/build/esm/index-ad1c7c38.js +275 -0
- package/build/esm/{index-bcd13f1d.js → index-bcedec73.js} +13 -12
- package/build/esm/{index-ef855343.js → index-c013ba1b.js} +4 -4
- package/build/esm/index-c2584051.js +262 -0
- package/build/esm/{types-957334f2.js → index-c430773c.js} +559 -3519
- package/build/esm/index-cdc50618.js +25 -0
- package/build/esm/{index-77dddeb9.js → index-cfedca38.js} +2 -2
- package/build/esm/index-d6a5f5cf.js +557 -0
- package/build/esm/index-e0b0d6a2.js +847 -0
- package/build/esm/index-ea63e0d2.js +148 -0
- package/build/esm/{index-32e2b169.js → index-f22f6e6e.js} +65 -28
- package/build/esm/index-f4b938f2.js +18 -0
- package/build/esm/index-f660abb7.js +156 -0
- package/build/esm/index-fa67d66e.js +789 -0
- package/build/esm/index.js +98 -73
- package/build/esm/labelSorting-7351409a.js +47 -0
- package/build/esm/lead.js +23 -33
- package/build/esm/logoIcon-3a581efb.js +104 -0
- package/build/esm/mantine.js +22 -20
- package/build/esm/misc.js +21 -21
- package/build/esm/molecules.js +88 -0
- package/build/esm/navigation.js +37 -37
- package/build/esm/onboardingV2.js +26 -35
- package/build/esm/organisms.js +57 -0
- package/build/esm/pwg.js +19 -19
- package/build/esm/{routing-7bc3e320.js → routing-9e330438.js} +2 -2
- package/build/esm/subot.js +31 -27
- package/build/esm/surveyOrPremiumBanner.js +45 -0
- package/build/esm/surveyQuestionCard.js +13 -0
- package/build/esm/surveyThankyouCard-ec204631.js +446 -0
- package/build/esm/together.js +52 -45
- package/build/esm/togetherAtoms.js +41 -0
- package/build/esm/togetherComponentGlobalContext.js +12 -0
- package/build/esm/togetherMolecules.js +53 -0
- package/build/esm/togetherOrganisms.js +57 -0
- package/build/esm/treePopoverMenu-cb214db6.js +332 -0
- package/build/esm/types-721e7a66.js +5 -0
- package/build/esm/{types-ee1be1e3.js → types-ffcf5fb4.js} +13 -13
- package/build/esm/types.js +1 -1
- package/build/esm/{useCategory-7e020652.js → useCategory-553bee0b.js} +5 -5
- package/build/esm/{useHealthToolCache-c70e4fd5.js → useHealthToolCache-6ce1724e.js} +2 -2
- package/build/esm/{useMantineLocale-1373e175.js → useMantineLocale-453f8013.js} +3 -3
- package/build/esm/{usePlacesAutocomplete-4bfe976e.js → usePlacesAutocomplete-8925d4fb.js} +1 -1
- package/build/esm/useTogetherAuthRequiredAction.js +60 -0
- package/build/esm/{useTranslations-adad3b06.js → useTranslations-b970f667.js} +1 -1
- package/build/esm/{utils-dee27bfd.js → utils-3b29eb79.js} +8 -356
- package/build/esm/{utils-b14c10f9.js → utils-6d45bdd1.js} +1 -1
- package/build/esm/vaccination.js +18 -29
- package/build/fixedBottomAdBlock-0129a006.js +3521 -0
- package/build/footer.js +18 -18
- package/build/gAssets.js +4 -4
- package/build/{getDynamicHealthTool-357666f7.js → getDynamicHealthTool-f08b5fab.js} +4 -4
- package/build/{getSocialList-c1404aff.js → getSocialList-8cc32f7c.js} +8 -9
- package/build/healthToolsForm.js +54 -0
- package/build/healthToolsForms.d.ts +7 -0
- package/build/hooks.js +17 -17
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/index-00a78d81.js +565 -0
- package/build/index-077bf48f.js +803 -0
- package/build/{index-bf6e5e4e.js → index-0b727664.js} +5 -5
- package/build/{index-917c975c.js → index-10760994.js} +37 -9
- package/build/index-130e0f35.js +1693 -0
- package/build/{index-82a3ba38.js → index-16ed0d98.js} +68 -33
- package/build/{index-040620f6.js → index-1e1d8eb1.js} +13 -12
- package/build/{index-e60c98f8.js → index-1fdf2f01.js} +2 -2
- package/build/{index-61ef343d.js → index-206afefb.js} +4 -4
- package/build/{types-c8956642.js → index-2afbeb3d.js} +761 -3727
- package/build/{index.styled-8aca5145.js → index-2fd9063e.js} +22 -4
- package/build/index-33432b02.js +270 -0
- package/build/index-3eb666e6.js +202 -0
- package/build/{index-94a2b0f9.js → index-405faafa.js} +2 -2
- package/build/index-4357a324.js +136 -0
- package/build/index-466a2c32.js +1362 -0
- package/build/index-4b7d4b5b.js +156 -0
- package/build/{index-5029b5d8.js → index-4bc690c9.js} +1 -1
- package/build/index-4cdcdbbe.js +498 -0
- package/build/index-53e14542.js +102 -0
- package/build/{index-91027d35.js → index-54aeefca.js} +2 -2
- package/build/index-60f6d762.js +1127 -0
- package/build/{index-858f60e0.js → index-64d8db08.js} +2 -2
- package/build/index-6aeb5ff5.js +866 -0
- package/build/index-71843eb4.js +61 -0
- package/build/index-765ed75d.js +209 -0
- package/build/index-7953fb8e.js +167 -0
- package/build/{index-d710511f.js → index-7ecc69af.js} +12 -11
- package/build/index-82c85f9d.js +277 -0
- package/build/index-9e8877c0.js +25 -0
- package/build/index-a2664204.js +107 -0
- package/build/{index-c67602d7.js → index-a6a9855f.js} +1 -13
- package/build/index-a8680a58.js +49 -0
- package/build/{index-ed587907.js → index-a9bbb5aa.js} +11 -10
- package/build/{utils-263a60f7.js → index-a9bdf889.js} +76 -120
- package/build/{index-f0a532c7.js → index-b66ae554.js} +6 -6
- package/build/index-ca616373.js +20 -0
- package/build/{index-b0414701.js → index-d9919cd2.js} +57 -200
- package/build/index-dd074159.js +32 -0
- package/build/{index-94fd9ea6.js → index-dff7ee1b.js} +32 -222
- package/build/{index-3a03bb34.js → index-e3bbd009.js} +2 -2
- package/build/index-ec34e358.js +343 -0
- package/build/{index-8c826f3e.js → index-f222ee45.js} +2 -2
- package/build/{index-2b32b21e.js → index-fd3e1d16.js} +2 -2
- package/build/index.js +251 -226
- package/build/labelSorting-f86081b7.js +53 -0
- package/build/lead.js +29 -39
- package/build/logoIcon-21a16853.js +110 -0
- package/build/mantine.js +24 -23
- package/build/misc.js +21 -21
- package/build/molecules.js +149 -0
- package/build/navigation.js +37 -37
- package/build/onboardingV2.js +45 -54
- package/build/organisms.js +74 -0
- package/build/pwg.js +19 -19
- package/build/{routing-bc8197d8.js → routing-d6c9099a.js} +2 -2
- package/build/subot.js +115 -111
- package/build/surveyOrPremiumBanner.js +53 -0
- package/build/surveyQuestionCard.js +22 -0
- package/build/surveyThankyouCard-5b23b8f6.js +454 -0
- package/build/together.js +100 -93
- package/build/togetherAtoms.js +55 -0
- package/build/togetherComponentGlobalContext.js +26 -0
- package/build/togetherMolecules.js +86 -0
- package/build/togetherOrganisms.js +71 -0
- package/build/treePopoverMenu-c0cb395f.js +343 -0
- package/build/{types-6996fb20.js → types-8d9c5f21.js} +13 -13
- package/build/types-b25ffde0.js +7 -0
- package/build/types.js +1 -1
- package/build/{useCategory-7d1f8a7d.js → useCategory-b695fd3a.js} +5 -5
- package/build/{useHealthToolCache-b7dea4aa.js → useHealthToolCache-048807ea.js} +2 -2
- package/build/{useMantineLocale-b243f628.js → useMantineLocale-0d63dfea.js} +3 -3
- package/build/{usePlacesAutocomplete-08b86d2d.js → usePlacesAutocomplete-9520e525.js} +1 -1
- package/build/useTogetherAuthRequiredAction.js +70 -0
- package/build/{useTranslations-d5456a98.js → useTranslations-685f989b.js} +1 -1
- package/build/{utils-9f62698f.js → utils-169c6a7d.js} +16 -375
- package/build/{utils-d421a448.js → utils-1a00c0f8.js} +1 -1
- package/build/vaccination.js +58 -69
- package/package.json +1 -1
- package/build/Instagram-91ba1e26.js +0 -32
- package/build/esm/Instagram-319a8e34.js +0 -26
- package/build/esm/index-13bf84f4.js +0 -298
- package/build/esm/index-1a3f36c3.js +0 -1086
- package/build/esm/index-800b956a.js +0 -7245
- package/build/esm/index-aebf96f3.js +0 -33
- package/build/esm/index-d48b5db6.js +0 -71
- package/build/esm/index-d5b66388.js +0 -23
- package/build/esm/index.styles-0ef0135c.js +0 -1322
- package/build/index-0523771b.js +0 -7324
- package/build/index-20ebc0bd.js +0 -30
- package/build/index-dbf560f2.js +0 -1100
- package/build/index-efcbac97.js +0 -39
- package/build/index-f5103542.js +0 -77
- package/build/index.styles-2bdfde5f.js +0 -1361
- /package/build/{BMI_BOYS.percentile.monthly-c38ce03a.js → BMI_BOYS.percentile.monthly-1aa95e30.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-1eccee42.js → BMI_BOYS.percentile.weekly-61d78e1c.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-0e7d5cb6.js → BMI_BOYS.percentile.yearly-f80e040e.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-f72f392f.js → BMI_BOYS.zscore.monthly-a6c7c8ff.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-94fd04e6.js → BMI_BOYS.zscore.weekly-742f7028.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-90d5e091.js → BMI_BOYS.zscore.yearly-c19cccd5.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-de3a9a14.js → BMI_GIRLS.percentile.monthly-089d3981.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-1e1ce2b7.js → BMI_GIRLS.percentile.weekly-0cc52cda.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-70a44f31.js → BMI_GIRLS.percentile.yearly-10bc603f.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-be4399a5.js → BMI_GIRLS.zscore.monthly-c3fe57f3.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-6121376b.js → BMI_GIRLS.zscore.weekly-b83a54db.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-822e7686.js → BMI_GIRLS.zscore.yearly-5f13cda2.js} +0 -0
- /package/build/{ChevronDown-f9d31306.js → ChevronDown-2fd86d66.js} +0 -0
- /package/build/{Close-27e0dcf1.js → Close-711196b0.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-5e094c3e.js → HEAD CIRCUM_BOYS.percentile.monthly-03b8d7fb.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-24f827d8.js → HEAD CIRCUM_BOYS.percentile.weekly-9ebd3eb6.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-d7478410.js → HEAD CIRCUM_BOYS.percentile.yearly-8e97b738.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-1123cad6.js → HEAD CIRCUM_BOYS.zscore.monthly-e7892261.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-a5b55615.js → HEAD CIRCUM_BOYS.zscore.weekly-47c5af84.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-0d818764.js → HEAD CIRCUM_BOYS.zscore.yearly-9a1bc325.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-dddf5ad9.js → HEAD CIRCUM_GIRLS.percentile.monthly-d84491d7.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-a80d6989.js → HEAD CIRCUM_GIRLS.percentile.weekly-a6f38c3e.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-01850b67.js → HEAD CIRCUM_GIRLS.percentile.yearly-5771d277.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-82890053.js → HEAD CIRCUM_GIRLS.zscore.monthly-e3633bcc.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-069f8c8f.js → HEAD CIRCUM_GIRLS.zscore.weekly-23b0ab1a.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-ae5ef237.js → HEAD CIRCUM_GIRLS.zscore.yearly-20f29cf1.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-d0da1664.js → HEIGHT_BOYS.percentile.monthly-57cc12ee.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-55446b8a.js → HEIGHT_BOYS.percentile.weekly-c788506a.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-f2f5b19f.js → HEIGHT_BOYS.percentile.yearly-ac56c1f2.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-e6ed98ef.js → HEIGHT_BOYS.zscore.monthly-1bb78253.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-d0d37479.js → HEIGHT_BOYS.zscore.weekly-22737c43.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-4023b808.js → HEIGHT_BOYS.zscore.yearly-90f6cd0a.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-6d9aeadc.js → HEIGHT_GIRLS.percentile.monthly-019f80d2.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-2087c9b4.js → HEIGHT_GIRLS.percentile.weekly-ceed9817.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-f98d8b05.js → HEIGHT_GIRLS.percentile.yearly-3e5192ac.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-99d299e3.js → HEIGHT_GIRLS.zscore.monthly-f8fca0b6.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-c46ed349.js → HEIGHT_GIRLS.zscore.weekly-827b17e8.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-fddefca4.js → HEIGHT_GIRLS.zscore.yearly-3cdb483d.js} +0 -0
- /package/build/{Visible-01dfaec9.js → Visible-515a4eec.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-cead8ece.js → WEIGHT_BOYS.percentile.monthly-2ecbd498.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-a97fa31a.js → WEIGHT_BOYS.percentile.weekly-75c9c25c.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-c2c41945.js → WEIGHT_BOYS.percentile.yearly-03e7cea6.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-d8de7dc2.js → WEIGHT_BOYS.zscore.monthly-2ff9fb56.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-41a6f6bf.js → WEIGHT_BOYS.zscore.weekly-e9f7fe2d.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-5762fa8a.js → WEIGHT_BOYS.zscore.yearly-4a96f34f.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-526fb18a.js → WEIGHT_GIRLS.percentile.monthly-5bf09e30.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-6c63ed2b.js → WEIGHT_GIRLS.percentile.weekly-f737ae23.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-0ecdbd3a.js → WEIGHT_GIRLS.percentile.yearly-56ebc8eb.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-0c353536.js → WEIGHT_GIRLS.zscore.monthly-4697d3b5.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-97898ff6.js → WEIGHT_GIRLS.zscore.weekly-3633820e.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-cbebe807.js → WEIGHT_GIRLS.zscore.yearly-a9a04790.js} +0 -0
- /package/build/{animation-8605b5bb.js → animation-85d012ee.js} +0 -0
- /package/build/{cart-ab5762b8.js → cart-8877bd63.js} +0 -0
- /package/build/{cookieHelper-b2132ffc.js → cookieHelper-86ae022e.js} +0 -0
- /package/build/{doctor-f121fd79.js → doctor-2c14fed1.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-e507536d.js → BMI_BOYS.percentile.monthly-42ff2c64.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-3cbf7392.js → BMI_BOYS.percentile.weekly-b4a6c521.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-c7d54bc3.js → BMI_BOYS.percentile.yearly-d3bc1a77.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-4d09aca0.js → BMI_BOYS.zscore.monthly-c4506dfa.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-319b78c5.js → BMI_BOYS.zscore.weekly-ddf3b3f9.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-764732c5.js → BMI_BOYS.zscore.yearly-e0e3139e.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-5a8e4069.js → BMI_GIRLS.percentile.monthly-96686bcc.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-a2fe6df1.js → BMI_GIRLS.percentile.weekly-c3106a65.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-810fe911.js → BMI_GIRLS.percentile.yearly-b38c1f1f.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-afab03b0.js → BMI_GIRLS.zscore.monthly-f8a7836f.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-8f4e7198.js → BMI_GIRLS.zscore.weekly-4c1fc771.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-7f043621.js → BMI_GIRLS.zscore.yearly-dce5e66a.js} +0 -0
- /package/build/esm/{ChevronDown-d24fd24b.js → ChevronDown-31ea3e19.js} +0 -0
- /package/build/esm/{Close-6243d246.js → Close-40d598bc.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-91c12176.js → HEAD CIRCUM_BOYS.percentile.monthly-34e3fa1c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-40e77c68.js → HEAD CIRCUM_BOYS.percentile.weekly-d3f3568f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-1a284ec4.js → HEAD CIRCUM_BOYS.percentile.yearly-dfae3ad2.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-16f716a6.js → HEAD CIRCUM_BOYS.zscore.monthly-95840c2f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-07d20112.js → HEAD CIRCUM_BOYS.zscore.weekly-8b198c1c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-1201a10a.js → HEAD CIRCUM_BOYS.zscore.yearly-b7d639ad.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-a6348baf.js → HEAD CIRCUM_GIRLS.percentile.monthly-47caa070.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-af26363f.js → HEAD CIRCUM_GIRLS.percentile.weekly-bae46665.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-e7637928.js → HEAD CIRCUM_GIRLS.percentile.yearly-81989cdd.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-9be0e0ca.js → HEAD CIRCUM_GIRLS.zscore.monthly-f2f7d985.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-3ffe9dcd.js → HEAD CIRCUM_GIRLS.zscore.weekly-e287ddb7.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-d7226db1.js → HEAD CIRCUM_GIRLS.zscore.yearly-8790b62a.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-c2e21892.js → HEIGHT_BOYS.percentile.monthly-5d2b6466.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-22018f1e.js → HEIGHT_BOYS.percentile.weekly-a38ad13e.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-391cd377.js → HEIGHT_BOYS.percentile.yearly-e4841712.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-e11f50f4.js → HEIGHT_BOYS.zscore.monthly-d8e722f8.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-8e2c8306.js → HEIGHT_BOYS.zscore.weekly-a92ea3ca.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-78e974bb.js → HEIGHT_BOYS.zscore.yearly-3af1adce.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-0a49ff89.js → HEIGHT_GIRLS.percentile.monthly-c5203801.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-5e158a8e.js → HEIGHT_GIRLS.percentile.weekly-4c25d07f.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-f5544ab2.js → HEIGHT_GIRLS.percentile.yearly-f91e2e27.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-92f67ec2.js → HEIGHT_GIRLS.zscore.monthly-b2a60aca.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-f5d11f32.js → HEIGHT_GIRLS.zscore.weekly-0a98c520.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-4fe6aad9.js → HEIGHT_GIRLS.zscore.yearly-8070d58f.js} +0 -0
- /package/build/esm/{Visible-7f408f98.js → Visible-e3e4fb6f.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-b09ae73a.js → WEIGHT_BOYS.percentile.monthly-b262b97d.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-733a24a9.js → WEIGHT_BOYS.percentile.weekly-7e817f9f.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-2bfcfc93.js → WEIGHT_BOYS.percentile.yearly-b7f1786a.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-c0d3a746.js → WEIGHT_BOYS.zscore.monthly-014af835.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-b41ff498.js → WEIGHT_BOYS.zscore.weekly-4577f724.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-15bb7570.js → WEIGHT_BOYS.zscore.yearly-08fd3f13.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-5b79dea8.js → WEIGHT_GIRLS.percentile.monthly-a6e1aa0d.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-33052637.js → WEIGHT_GIRLS.percentile.weekly-4c0b6f94.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-64382b53.js → WEIGHT_GIRLS.percentile.yearly-bf689a3a.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-63f19584.js → WEIGHT_GIRLS.zscore.monthly-f82fc3c8.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-938ebce2.js → WEIGHT_GIRLS.zscore.weekly-854ce987.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-016e1cfc.js → WEIGHT_GIRLS.zscore.yearly-2a3b869a.js} +0 -0
- /package/build/esm/{animation-bf170ee9.js → animation-85d9a0ed.js} +0 -0
- /package/build/esm/{cart-5bdb4fa5.js → cart-1ac23ce7.js} +0 -0
- /package/build/esm/{cookieHelper-ff6c13b4.js → cookieHelper-6c3b4790.js} +0 -0
- /package/build/esm/{doctor-f4cadffb.js → doctor-e0c2476d.js} +0 -0
- /package/build/esm/{index-eeedf0f0.js → index-189d7601.js} +0 -0
- /package/build/esm/{index-b87433a0.js → index-21bca818.js} +0 -0
- /package/build/esm/{index-6c0f560b.js → index-266a32ff.js} +0 -0
- /package/build/esm/{index-528e64f4.js → index-8684181f.js} +0 -0
- /package/build/esm/{isProduction-2838b9ae.js → isProduction-1937d355.js} +0 -0
- /package/build/esm/{localizeNumberFormat-9303c122.js → localizeNumberFormat-1f000110.js} +0 -0
- /package/build/esm/{normalizeLink-38ab69f4.js → normalizeLink-7a93ebb9.js} +0 -0
- /package/build/esm/{number-fcae69c7.js → number-1d1ba14a.js} +0 -0
- /package/build/esm/{paths-d1c61fa8.js → paths-b83be1a0.js} +0 -0
- /package/build/esm/{theme-0af1cc3d.js → theme-7dadf4a1.js} +0 -0
- /package/build/esm/{translationsContext-036458b7.js → translationsContext-42a1fa63.js} +0 -0
- /package/build/esm/{tslib.es6-2673b49d.js → tslib.es6-06ba3978.js} +0 -0
- /package/build/esm/{useIsInit-2c5ff93d.js → useIsInit-f4dec279.js} +0 -0
- /package/build/esm/{useOutsideClick-7023de23.js → useOutsideClick-210c1134.js} +0 -0
- /package/build/esm/{useScrollbarSize-dfdab229.js → useScrollbarSize-909ae7ec.js} +0 -0
- /package/build/esm/{useUniqueId-d4b0bdd3.js → useUniqueId-5885911d.js} +0 -0
- /package/build/esm/{utils-511a24f4.js → utils-d7bbdb52.js} +0 -0
- /package/build/{index-18ddaa1b.js → index-1f3fc2e3.js} +0 -0
- /package/build/{index-5c400e5e.js → index-2de1eb4a.js} +0 -0
- /package/build/{index-bced434a.js → index-6fdcd09d.js} +0 -0
- /package/build/{index-c524c362.js → index-bc9e8eae.js} +0 -0
- /package/build/{isProduction-2e55aee3.js → isProduction-20cd663d.js} +0 -0
- /package/build/{localizeNumberFormat-2befc6e4.js → localizeNumberFormat-7ff6bd3a.js} +0 -0
- /package/build/{normalizeLink-0fd36e61.js → normalizeLink-d307f624.js} +0 -0
- /package/build/{number-92da0262.js → number-dddf656c.js} +0 -0
- /package/build/{paths-350514c4.js → paths-7da79c64.js} +0 -0
- /package/build/{theme-f410baf6.js → theme-be20929b.js} +0 -0
- /package/build/{translationsContext-11cafcfc.js → translationsContext-00fdb62e.js} +0 -0
- /package/build/{tslib.es6-4bc45883.js → tslib.es6-bd3f8718.js} +0 -0
- /package/build/{useIsInit-0f6d1879.js → useIsInit-e06b96f5.js} +0 -0
- /package/build/{useOutsideClick-e067cc79.js → useOutsideClick-d95a32b6.js} +0 -0
- /package/build/{useScrollbarSize-ed50b4a6.js → useScrollbarSize-1499b1c3.js} +0 -0
- /package/build/{useUniqueId-4ce69bff.js → useUniqueId-1af8848e.js} +0 -0
- /package/build/{utils-4849d92a.js → utils-15a9772e.js} +0 -0
|
@@ -0,0 +1,3474 @@
|
|
|
1
|
+
import React__default, { memo, useMemo, useState, useCallback, useEffect, useImperativeHandle, useRef, createContext, useContext, Fragment, forwardRef } from 'react';
|
|
2
|
+
import { Bookmark } from '@hhgtech/icons/other';
|
|
3
|
+
import { C as CommonGAssets } from './index-9471fca1.js';
|
|
4
|
+
import { T as Text } from './index-5723381f.js';
|
|
5
|
+
import { H as Heading } from './index-046778af.js';
|
|
6
|
+
import { t as theme } from './theme-7dadf4a1.js';
|
|
7
|
+
import { _ as __rest, a as __awaiter } from './tslib.es6-06ba3978.js';
|
|
8
|
+
import { Card, Group, Box, Flex, createStyles, Stack, getStylesRef, useMantineTheme, rem } from '@mantine/core';
|
|
9
|
+
import innertext from 'innertext';
|
|
10
|
+
import { u as useScreenSize, A as Anchor, a as Avatar, b as AspectRatio, R as Radio, t as themeColors } from './index-9b3a8b6d.js';
|
|
11
|
+
import '@mantine/dates';
|
|
12
|
+
import { d as domainLocales, L as LOCALE_SPECS, F as FAVICONS } from './index-6210f454.js';
|
|
13
|
+
import { L as LOCALE } from './index-189d7601.js';
|
|
14
|
+
import './useMantineLocale-453f8013.js';
|
|
15
|
+
import './index-1d3c6ce7.js';
|
|
16
|
+
import './translationsContext-42a1fa63.js';
|
|
17
|
+
import 'string-format';
|
|
18
|
+
import '@mantine/hooks';
|
|
19
|
+
import { M as MediaQueries } from './utils-d7bbdb52.js';
|
|
20
|
+
import { i as isInternalLink } from './index-ea63e0d2.js';
|
|
21
|
+
import styled from '@emotion/styled';
|
|
22
|
+
import { C as Checkbox, P as PureInput } from './index-c2584051.js';
|
|
23
|
+
import throttle from 'lodash/throttle';
|
|
24
|
+
import { L as Logo } from './index-2dc7803d.js';
|
|
25
|
+
import { keyframes } from '@emotion/react';
|
|
26
|
+
import parse from 'html-react-parser';
|
|
27
|
+
import { i as isProduction } from './isProduction-1937d355.js';
|
|
28
|
+
import { u as useTranslations } from './useTranslations-b970f667.js';
|
|
29
|
+
import { D as DueDateForm, B as BmiForm, a as BabyPoopForm, T as ThrForm, O as OvulationForm, b as BabyVaccineForm, P as PWGForm } from './index-ac2a8f95.js';
|
|
30
|
+
import { B as BabyGrowthForm } from './index-d6a5f5cf.js';
|
|
31
|
+
import { f as formatUserProfileUrl } from './dataTransform-623716c3.js';
|
|
32
|
+
import { s as setDefaultClass } from './defaultClassWrapper-00903c00.js';
|
|
33
|
+
import { isBefore, startOfMonth, addMonths, format, subMonths, getDaysInMonth, isToday, isSameDay, isWithinInterval, isAfter, isPast } from 'date-fns';
|
|
34
|
+
import { a as useOutsideClick } from './useOutsideClick-210c1134.js';
|
|
35
|
+
import enUS from 'date-fns/locale/en-US';
|
|
36
|
+
import id from 'date-fns/locale/id';
|
|
37
|
+
import vi from 'date-fns/locale/vi';
|
|
38
|
+
import zhTW from 'date-fns/locale/zh-TW';
|
|
39
|
+
import { B as Button } from './index-9b9c1499.js';
|
|
40
|
+
import { D as Dropdown } from './index-29908d2c.js';
|
|
41
|
+
import { g as getSocialList } from './getSocialList-7d2cf48d.js';
|
|
42
|
+
import { I as Input } from './index-f660abb7.js';
|
|
43
|
+
import { D as Drawer } from './index-01b5d2e9.js';
|
|
44
|
+
import { v4 } from 'uuid';
|
|
45
|
+
|
|
46
|
+
var styles$1 = {"expertName":"PiqKaXk","anchor":"HgbW6-m","card":"_6lkfLYy","author":"j7c-onH","pointer":"wwI1--d"};
|
|
47
|
+
|
|
48
|
+
const CardAuthor = ({ avatarImg, authorName, authorLink, uploadTime, size, }) => {
|
|
49
|
+
return (React__default.createElement("div", { className: styles$1.author },
|
|
50
|
+
React__default.createElement("div", { className: "author" },
|
|
51
|
+
React__default.createElement("div", { className: "avatar", "data-size": size }, avatarImg),
|
|
52
|
+
React__default.createElement("div", { className: "poster", "data-is-disabled-url": !!!authorLink },
|
|
53
|
+
React__default.createElement(Text, { size: size === 'lg' ? 'p3' : 'p4' },
|
|
54
|
+
React__default.createElement("a", { href: authorLink },
|
|
55
|
+
React__default.createElement("span", { className: "name" }, authorName),
|
|
56
|
+
"\u2022",
|
|
57
|
+
' '),
|
|
58
|
+
React__default.createElement("span", null, uploadTime))))));
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const CardExpert = ({ isMobile, avatarImg, name, link, size = 'lg', specialty, }) => {
|
|
62
|
+
return (React__default.createElement("div", { className: styles$1.author },
|
|
63
|
+
React__default.createElement("div", { className: "author" },
|
|
64
|
+
React__default.createElement("div", { className: "expert-avatar", "data-size": size }, avatarImg),
|
|
65
|
+
React__default.createElement("div", { className: "expert", "data-is-disabled-url": !!!link }, isMobile ? (React__default.createElement("a", { href: link }, size === 'lg' ? (React__default.createElement(React__default.Fragment, null,
|
|
66
|
+
React__default.createElement(Heading, { tag: "h6", className: "expert__name", color: theme.colors.gray600 }, name),
|
|
67
|
+
React__default.createElement(Text, { color: theme.colors.gray500, size: "p3", className: "specialty" }, specialty))) : (React__default.createElement(React__default.Fragment, null,
|
|
68
|
+
React__default.createElement(Heading, { tag: "h6", className: "expert__name", color: theme.colors.gray600 }, name))))) : (React__default.createElement("a", { href: link }, size === 'lg' ? (React__default.createElement(React__default.Fragment, null,
|
|
69
|
+
React__default.createElement(Heading, { tag: "h6", className: "expert__name", color: theme.colors.gray600 }, name),
|
|
70
|
+
React__default.createElement(Text, { color: theme.colors.gray500, size: "p3", className: "specialty" }, specialty))) : (React__default.createElement(React__default.Fragment, null,
|
|
71
|
+
React__default.createElement("h6", { color: theme.colors.gray600, className: `${styles$1.expertName} expert__name` }, name),
|
|
72
|
+
React__default.createElement(Text, { color: theme.colors.gray500, size: "p4", className: "specialty" }, specialty)))))))));
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const AffiliateIcon = memo(() => {
|
|
76
|
+
return (React__default.createElement("div", { className: "shoppable" },
|
|
77
|
+
React__default.createElement("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
|
|
78
|
+
React__default.createElement("rect", { width: "24", height: "24", rx: "12", fill: "#1B3250" }),
|
|
79
|
+
React__default.createElement("path", { d: "M16.6667 8.00033H15.3333C15.3333 6.16033 13.84 4.66699 12 4.66699C10.16 4.66699 8.66667 6.16033 8.66667 8.00033H7.33333C6.6 8.00033 6 8.60033 6 9.33366V17.3337C6 18.067 6.6 18.667 7.33333 18.667H16.6667C17.4 18.667 18 18.067 18 17.3337V9.33366C18 8.60033 17.4 8.00033 16.6667 8.00033ZM12 6.00033C13.1067 6.00033 14 6.89366 14 8.00033H10C10 6.89366 10.8933 6.00033 12 6.00033ZM12 12.667C10.4467 12.667 9.14 11.607 8.77333 10.167C8.66 9.74699 8.98667 9.33366 9.42 9.33366C9.73333 9.33366 9.98667 9.56033 10.0733 9.86699C10.3067 10.7137 11.08 11.3337 12 11.3337C12.92 11.3337 13.6933 10.7137 13.9267 9.86699C14.0133 9.56033 14.2667 9.33366 14.58 9.33366C15.0133 9.33366 15.3333 9.74699 15.2267 10.167C14.86 11.607 13.5533 12.667 12 12.667Z", fill: "white" }))));
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const ArticleCard$1 = ({ articleLink, authorLink, authorName, avatarImg, banner, categoryLink, categoryName, className, dataEventActionForBanner, dataEventActionForBookmark, dataEventActionForCategory, dataEventActionForTitle, dataEventCategoryForBanner, dataEventCategoryForBookmark, dataEventCategoryForCategory, dataEventCategoryForTitle, dataEventLabelForBanner, dataEventLabelForBookmark, dataEventLabelForCategory, dataEventLabelForTitle, direction = 'horizontal', hasAffiliate, isBookmark = false, isBookmarkDisplayed = true, isMobile = true, onBookmark, onClickCategoryName, section = 'normal', size = 'md', specialty, style, styleBanner, styleLabel, styleTitle, text, title, type = 'author', uploadTime, articleLinkTarget, isPremium, headingAs, }) => {
|
|
83
|
+
const handleClick = (e) => {
|
|
84
|
+
e.stopPropagation();
|
|
85
|
+
onBookmark === null || onBookmark === void 0 ? void 0 : onBookmark();
|
|
86
|
+
};
|
|
87
|
+
const headingTag = size === 'lg' && type === 'expert'
|
|
88
|
+
? 'h4'
|
|
89
|
+
: size === 'lg' && section === 'home'
|
|
90
|
+
? isMobile
|
|
91
|
+
? 'h4'
|
|
92
|
+
: 'h3'
|
|
93
|
+
: size === 'lg'
|
|
94
|
+
? 'h4'
|
|
95
|
+
: 'h5';
|
|
96
|
+
const descriptionTag = size === 'lg' ? 'p3' : 'p4';
|
|
97
|
+
const categoryLabelTag = !isMobile && section === 'home' && size === 'lg' && type === 'author'
|
|
98
|
+
? 'c1'
|
|
99
|
+
: 'c2';
|
|
100
|
+
return (React__default.createElement("article", { className: `${styles$1.card} ${className || ''}`, "data-size": size, style: style, "data-direction": direction, "data-is-expert": type === 'expert' || undefined },
|
|
101
|
+
React__default.createElement("div", { className: "banner", style: styleBanner },
|
|
102
|
+
React__default.createElement("a", { className: styles$1.anchor, "data-event-category": dataEventCategoryForBanner, "data-event-action": dataEventActionForBanner, "data-event-label": dataEventLabelForBanner, href: articleLink || '#', target: articleLinkTarget }, banner),
|
|
103
|
+
isPremium && (React__default.createElement("img", { loading: "lazy", className: "premium", src: CommonGAssets.getAssetPath('premium-crown.svg') })),
|
|
104
|
+
hasAffiliate && React__default.createElement(AffiliateIcon, null)),
|
|
105
|
+
React__default.createElement("div", { className: "content" },
|
|
106
|
+
React__default.createElement("div", { className: "inner-content" },
|
|
107
|
+
React__default.createElement(Text, { style: styleLabel, className: "label", size: categoryLabelTag, weight: "caption" },
|
|
108
|
+
React__default.createElement("a", { className: styles$1.anchor, "data-event-category": dataEventCategoryForCategory, "data-event-action": dataEventActionForCategory, "data-event-label": dataEventLabelForCategory, href: categoryLink || '#', onClick: onClickCategoryName }, categoryName),
|
|
109
|
+
isBookmarkDisplayed && (React__default.createElement("a", { className: "bookmark", onClick: handleClick }, !isBookmark ? (React__default.createElement(Bookmark, { size: 18, "data-event-category": dataEventCategoryForBookmark, "data-event-action": dataEventActionForBookmark, "data-event-label": dataEventLabelForBookmark })) : (React__default.createElement(Bookmark, { size: 18, isActive: true, "data-event-category": dataEventCategoryForBookmark, "data-event-action": dataEventActionForBookmark, "data-event-label": dataEventLabelForBookmark, activeColor: "#2ED69E" }))))),
|
|
110
|
+
React__default.createElement(Heading, { tag: headingTag, style: styleTitle, className: "title", as: headingAs || (size === 'lg' ? 'h2' : 'h3') },
|
|
111
|
+
React__default.createElement("a", { className: styles$1.anchor, "data-event-category": dataEventCategoryForTitle, "data-event-action": dataEventActionForTitle, "data-event-label": dataEventLabelForTitle, href: articleLink || '#', target: articleLinkTarget }, title)),
|
|
112
|
+
text && (React__default.createElement("a", { href: articleLink || '#', target: articleLinkTarget },
|
|
113
|
+
React__default.createElement(Text, { size: descriptionTag, className: "text" }, text)))),
|
|
114
|
+
React__default.createElement("div", { className: "footer" }, type === 'author' ? (React__default.createElement(CardAuthor, { size: size, avatarImg: avatarImg, authorName: authorName, authorLink: authorLink, uploadTime: uploadTime, handleClick: handleClick, isBookmarked: isBookmark, dataEventCategoryForBookmark: dataEventCategoryForBookmark, dataEventActionForBookmark: dataEventActionForBookmark, dataEventLabelForBookmark: dataEventLabelForBookmark })) : (React__default.createElement(CardExpert, { size: size, isMobile: isMobile, avatarImg: avatarImg, specialty: specialty, name: authorName, link: authorLink, handleClick: handleClick, isBookmarked: isBookmark, dataEventCategoryForBookmark: dataEventCategoryForBookmark, dataEventActionForBookmark: dataEventActionForBookmark, dataEventLabelForBookmark: dataEventLabelForBookmark }))))));
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const _Horizontal = (_a) => {
|
|
118
|
+
var _b, _c, _d;
|
|
119
|
+
var { article, author, authorAvatar, badge = '', hideDescription = false, isBookmarked = false, onBookmark, time, tracking } = _a,
|
|
120
|
+
// size = 'lg',
|
|
121
|
+
rest = __rest(_a, ["article", "author", "authorAvatar", "badge", "hideDescription", "isBookmarked", "onBookmark", "time", "tracking"]);
|
|
122
|
+
const { isMobile } = useScreenSize();
|
|
123
|
+
console.log({ article });
|
|
124
|
+
// const maw = useMemo(() => {
|
|
125
|
+
// switch (size) {
|
|
126
|
+
// case 'lg':
|
|
127
|
+
// return 648
|
|
128
|
+
// case 'md':
|
|
129
|
+
// return 456
|
|
130
|
+
// case 'sm':
|
|
131
|
+
// return 264
|
|
132
|
+
// default:
|
|
133
|
+
// return 648
|
|
134
|
+
// }
|
|
135
|
+
// }, [size])
|
|
136
|
+
return (React__default.createElement(Card, Object.assign({ padding: 0, radius: 0,
|
|
137
|
+
// maw={maw}
|
|
138
|
+
sx: {
|
|
139
|
+
display: 'flex',
|
|
140
|
+
flexDirection: 'row',
|
|
141
|
+
gap: 24,
|
|
142
|
+
} }, rest),
|
|
143
|
+
React__default.createElement(Card.Section, { w: "100%", h: "100%", miw: 264, m: 0, className: "pointer" },
|
|
144
|
+
React__default.createElement("img", { src: (isMobile ? article.featureImageMobile : article.featureImage) ||
|
|
145
|
+
article.featureImage, alt: article.postName, style: {
|
|
146
|
+
width: '100%',
|
|
147
|
+
}, loading: "lazy" })),
|
|
148
|
+
React__default.createElement(Card.Section, null,
|
|
149
|
+
React__default.createElement(Group, { position: "apart", mt: 16, mb: 4 },
|
|
150
|
+
React__default.createElement(Anchor, { href: ((_b = article === null || article === void 0 ? void 0 : article.primaryCategory) === null || _b === void 0 ? void 0 : _b.permalink) || '#' },
|
|
151
|
+
React__default.createElement(Text, { size: "p4", color: "blue.6" }, (_c = article === null || article === void 0 ? void 0 : article.primaryCategory) === null || _c === void 0 ? void 0 : _c.displayName)),
|
|
152
|
+
React__default.createElement(Box, { sx: { cursor: 'pointer' }, role: "button", onClick: onBookmark }, !isBookmarked ? (React__default.createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" }, tracking === null || tracking === void 0 ? void 0 : tracking.bookmark),
|
|
153
|
+
React__default.createElement("path", { d: "M7 17.95L12 15.8L17 17.95V5.3C17 5.23333 16.9667 5.16667 16.9 5.1C16.8333 5.03333 16.7667 5 16.7 5H7.3C7.23333 5 7.16667 5.03333 7.1 5.1C7.03333 5.16667 7 5.23333 7 5.3V17.95ZM6.775 19.7C6.475 19.8333 6.18733 19.8123 5.912 19.637C5.63733 19.4623 5.5 19.2083 5.5 18.875V5.3C5.5 4.8 5.675 4.375 6.025 4.025C6.375 3.675 6.8 3.5 7.3 3.5H16.7C17.2 3.5 17.625 3.675 17.975 4.025C18.325 4.375 18.5 4.8 18.5 5.3V18.875C18.5 19.2083 18.3623 19.4623 18.087 19.637C17.8123 19.8123 17.525 19.8333 17.225 19.7L12 17.45L6.775 19.7ZM7 5H17H12H7Z", fill: "#595959" }))) : (React__default.createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" }, tracking === null || tracking === void 0 ? void 0 : tracking.bookmark),
|
|
154
|
+
React__default.createElement("path", { d: "M6.775 19.7C6.475 19.8333 6.18733 19.8123 5.912 19.637C5.63733 19.4623 5.5 19.2083 5.5 18.875V5.3C5.5 4.8 5.675 4.375 6.025 4.025C6.375 3.675 6.8 3.5 7.3 3.5H16.7C17.2 3.5 17.625 3.675 17.975 4.025C18.325 4.375 18.5 4.8 18.5 5.3V18.875C18.5 19.2083 18.3623 19.4623 18.087 19.637C17.8123 19.8123 17.525 19.8333 17.225 19.7L12 17.45L6.775 19.7Z", fill: "#595959" }))))),
|
|
155
|
+
React__default.createElement(Text, { size: hideDescription ? 's2' : 's1', mb: 8, weight: "semiBold", className: "pointer" }, article.postTitle || article.postName || ''),
|
|
156
|
+
!hideDescription && (React__default.createElement(Text, { size: "p2", mb: 16, lineClamp: 3, className: "pointer" }, innertext(article.excerpt ||
|
|
157
|
+
article.description ||
|
|
158
|
+
((_d = article.postContent) === null || _d === void 0 ? void 0 : _d.split('\r\n')[0]) ||
|
|
159
|
+
''))),
|
|
160
|
+
React__default.createElement(Flex, { gap: 12, align: 'center' },
|
|
161
|
+
React__default.createElement(Avatar, { size: 32, src: authorAvatar, withIndicator: true, indicatorConfig: {
|
|
162
|
+
offset: 5,
|
|
163
|
+
size: 18,
|
|
164
|
+
label: React__default.createElement("img", { loading: "lazy", src: badge, alt: "" }),
|
|
165
|
+
} }, "A"),
|
|
166
|
+
React__default.createElement(Text, { size: "n1", c: "gray.6" },
|
|
167
|
+
author,
|
|
168
|
+
" \u2022 ",
|
|
169
|
+
time)))));
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// MyComponent.styles.ts
|
|
173
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
174
|
+
var useStyles$4 = createStyles((_theme, {}) => ({
|
|
175
|
+
// add all styles as usual
|
|
176
|
+
root: {},
|
|
177
|
+
image: {},
|
|
178
|
+
title: {},
|
|
179
|
+
category: {},
|
|
180
|
+
description: {},
|
|
181
|
+
author: {},
|
|
182
|
+
}));
|
|
183
|
+
|
|
184
|
+
const RATIO = {
|
|
185
|
+
DEFAULT: 648 / 440,
|
|
186
|
+
NO_DESCRIPTION: 456 / 304,
|
|
187
|
+
};
|
|
188
|
+
const _Vertical = (_a) => {
|
|
189
|
+
var _b, _c, _d;
|
|
190
|
+
var { article, author, authorAvatar, badge = '', bannerImageWrapProps, hideDescription = false, isBookmarked = false, onBookmark, time, tracking,
|
|
191
|
+
// size = 'lg',
|
|
192
|
+
classNames, styles, unstyled, className } = _a, rest = __rest(_a, ["article", "author", "authorAvatar", "badge", "bannerImageWrapProps", "hideDescription", "isBookmarked", "onBookmark", "time", "tracking", "classNames", "styles", "unstyled", "className"]);
|
|
193
|
+
const { isMobile } = useScreenSize();
|
|
194
|
+
const { classes, cx } = useStyles$4(
|
|
195
|
+
// First argument of useStyles is styles params
|
|
196
|
+
{},
|
|
197
|
+
// Second argument is responsible for styles api integration
|
|
198
|
+
{ name: 'ArticleCard', classNames, styles, unstyled });
|
|
199
|
+
const type = useMemo(() => {
|
|
200
|
+
if (hideDescription) {
|
|
201
|
+
return RATIO.NO_DESCRIPTION;
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
return RATIO.DEFAULT;
|
|
205
|
+
}
|
|
206
|
+
}, [hideDescription]);
|
|
207
|
+
// const maw = useMemo(() => {
|
|
208
|
+
// switch (size) {
|
|
209
|
+
// case 'lg':
|
|
210
|
+
// return 648
|
|
211
|
+
// case 'md':
|
|
212
|
+
// return 456
|
|
213
|
+
// case 'sm':
|
|
214
|
+
// return 264
|
|
215
|
+
// default:
|
|
216
|
+
// return 648
|
|
217
|
+
// }
|
|
218
|
+
// }, [size])
|
|
219
|
+
return (React__default.createElement(Card, Object.assign({ className: cx(classes.root, className), padding: 'lg', radius: 0 }, rest),
|
|
220
|
+
React__default.createElement(Card.Section, { className: cx(classes.image, 'pointer') },
|
|
221
|
+
React__default.createElement(AspectRatio, Object.assign({ ratio: type }, bannerImageWrapProps),
|
|
222
|
+
React__default.createElement("img", { src: (isMobile ? article.featureImageMobile : article.featureImage) ||
|
|
223
|
+
article.featureImage, alt: article.postName, style: { objectFit: 'cover' } }))),
|
|
224
|
+
React__default.createElement(Card.Section, null,
|
|
225
|
+
React__default.createElement(Group, { position: "apart", mt: 16, mb: 4 },
|
|
226
|
+
React__default.createElement(Anchor, { className: classes.category, href: ((_b = article === null || article === void 0 ? void 0 : article.primaryCategory) === null || _b === void 0 ? void 0 : _b.permalink) || '#' },
|
|
227
|
+
React__default.createElement(Text, { size: "p4", color: "blue.6" }, (_c = article === null || article === void 0 ? void 0 : article.primaryCategory) === null || _c === void 0 ? void 0 : _c.displayName)),
|
|
228
|
+
React__default.createElement(Box, { sx: { cursor: 'pointer' }, role: "button", onClick: onBookmark }, !isBookmarked ? (React__default.createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" }, tracking === null || tracking === void 0 ? void 0 : tracking.bookmark),
|
|
229
|
+
React__default.createElement("path", { d: "M7 17.95L12 15.8L17 17.95V5.3C17 5.23333 16.9667 5.16667 16.9 5.1C16.8333 5.03333 16.7667 5 16.7 5H7.3C7.23333 5 7.16667 5.03333 7.1 5.1C7.03333 5.16667 7 5.23333 7 5.3V17.95ZM6.775 19.7C6.475 19.8333 6.18733 19.8123 5.912 19.637C5.63733 19.4623 5.5 19.2083 5.5 18.875V5.3C5.5 4.8 5.675 4.375 6.025 4.025C6.375 3.675 6.8 3.5 7.3 3.5H16.7C17.2 3.5 17.625 3.675 17.975 4.025C18.325 4.375 18.5 4.8 18.5 5.3V18.875C18.5 19.2083 18.3623 19.4623 18.087 19.637C17.8123 19.8123 17.525 19.8333 17.225 19.7L12 17.45L6.775 19.7ZM7 5H17H12H7Z", fill: "#595959" }))) : (React__default.createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" }, tracking === null || tracking === void 0 ? void 0 : tracking.bookmark),
|
|
230
|
+
React__default.createElement("path", { d: "M6.775 19.7C6.475 19.8333 6.18733 19.8123 5.912 19.637C5.63733 19.4623 5.5 19.2083 5.5 18.875V5.3C5.5 4.8 5.675 4.375 6.025 4.025C6.375 3.675 6.8 3.5 7.3 3.5H16.7C17.2 3.5 17.625 3.675 17.975 4.025C18.325 4.375 18.5 4.8 18.5 5.3V18.875C18.5 19.2083 18.3623 19.4623 18.087 19.637C17.8123 19.8123 17.525 19.8333 17.225 19.7L12 17.45L6.775 19.7Z", fill: "#595959" }))))),
|
|
231
|
+
React__default.createElement(Text, { className: cx(classes.title, 'pointer'), size: hideDescription ? 's2' : 's1', mb: 8, weight: "semiBold" }, article.postTitle || article.postName || ''),
|
|
232
|
+
!hideDescription && (React__default.createElement(Text, { className: cx(classes.description, 'pointer'), size: "p2", mb: 16, lineClamp: 3 }, innertext(article.excerpt ||
|
|
233
|
+
article.description ||
|
|
234
|
+
((_d = article.postContent) === null || _d === void 0 ? void 0 : _d.split('\r\n')[0]) ||
|
|
235
|
+
''))),
|
|
236
|
+
React__default.createElement(Flex, { className: classes.author, gap: 12, align: 'center' },
|
|
237
|
+
React__default.createElement(Avatar, { size: 32, src: authorAvatar, withIndicator: true, indicatorConfig: {
|
|
238
|
+
offset: 5,
|
|
239
|
+
size: 18,
|
|
240
|
+
label: React__default.createElement("img", { loading: "lazy", src: badge, alt: "" }),
|
|
241
|
+
} }, "A"),
|
|
242
|
+
React__default.createElement(Text, { size: "n1", c: "gray.6" },
|
|
243
|
+
author,
|
|
244
|
+
" \u2022 ",
|
|
245
|
+
time)))));
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
const ArticleCard = (_a) => {
|
|
249
|
+
var { variant = 'vertical' } = _a, rest = __rest(_a, ["variant"]);
|
|
250
|
+
return variant === 'horizontal' ? (React__default.createElement(_Horizontal, Object.assign({}, rest))) : (React__default.createElement(_Vertical, Object.assign({}, rest)));
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
const StyledCategoryCard = styled.a `
|
|
254
|
+
display: flex;
|
|
255
|
+
height: 125px;
|
|
256
|
+
|
|
257
|
+
box-sizing: border-box;
|
|
258
|
+
flex-direction: column;
|
|
259
|
+
align-items: center;
|
|
260
|
+
padding: 8px;
|
|
261
|
+
|
|
262
|
+
border: 1px solid ${theme.colors.neutral100};
|
|
263
|
+
background-color: white;
|
|
264
|
+
border-radius: ${theme.borderRadius};
|
|
265
|
+
box-shadow: 0px 5px 12px rgba(40, 74, 117, 0.08);
|
|
266
|
+
cursor: pointer;
|
|
267
|
+
text-decoration: none;
|
|
268
|
+
|
|
269
|
+
& > .banner {
|
|
270
|
+
width: 100%;
|
|
271
|
+
height: 63px;
|
|
272
|
+
text-align: center;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
& > .content {
|
|
276
|
+
display: -webkit-box;
|
|
277
|
+
overflow: hidden;
|
|
278
|
+
-webkit-box-orient: vertical;
|
|
279
|
+
-webkit-line-clamp: 2;
|
|
280
|
+
text-align: center;
|
|
281
|
+
word-break: break-word;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
* {
|
|
285
|
+
pointer-events: none;
|
|
286
|
+
}
|
|
287
|
+
`;
|
|
288
|
+
|
|
289
|
+
const CategoryCard = (_a) => {
|
|
290
|
+
var { category, imgBanner, label, className, style, href = '', dataEventCategory, dataEventAction, dataEventLabel } = _a, rest = __rest(_a, ["category", "imgBanner", "label", "className", "style", "href", "dataEventCategory", "dataEventAction", "dataEventLabel"]);
|
|
291
|
+
const url = (category === null || category === void 0 ? void 0 : category.customizedUrl) || (category === null || category === void 0 ? void 0 : category.permalink) || href || '';
|
|
292
|
+
return (React__default.createElement(StyledCategoryCard, Object.assign({ "data-event-category": dataEventCategory, "data-event-action": dataEventAction, "data-event-label": dataEventLabel, className: className, style: style, href: url }, ((category === null || category === void 0 ? void 0 : category.customizedUrl) &&
|
|
293
|
+
!isInternalLink(category.customizedUrl) && {
|
|
294
|
+
target: '_blank',
|
|
295
|
+
}), { onClick: (e) => {
|
|
296
|
+
if (url === '') {
|
|
297
|
+
e.preventDefault();
|
|
298
|
+
}
|
|
299
|
+
} }, rest),
|
|
300
|
+
React__default.createElement("div", { className: "banner" }, imgBanner),
|
|
301
|
+
React__default.createElement("div", { className: "content" },
|
|
302
|
+
React__default.createElement(Text, { className: "category_name", size: "sm", weight: "bold" }, (category === null || category === void 0 ? void 0 : category.displayName) || label || ''))));
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
const StyledCheckboxGroup = styled.div `
|
|
306
|
+
display: flex;
|
|
307
|
+
|
|
308
|
+
&[data-type='vertical'] {
|
|
309
|
+
flex-direction: column;
|
|
310
|
+
|
|
311
|
+
div {
|
|
312
|
+
margin-bottom: 20px;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
&[data-type='horizontal'] {
|
|
317
|
+
flex-wrap: wrap;
|
|
318
|
+
|
|
319
|
+
div {
|
|
320
|
+
margin-right: 25px;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
&[data-is-rectangle] {
|
|
324
|
+
div {
|
|
325
|
+
margin-right: 14px;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
`;
|
|
330
|
+
|
|
331
|
+
const CheckboxGroup = ({ name, values = [], onChanges, options = [], className, type = 'vertical', isDisabled, isRectangle, }) => {
|
|
332
|
+
const onChange = (value, checked) => {
|
|
333
|
+
const newValues = values.slice();
|
|
334
|
+
if (checked) {
|
|
335
|
+
newValues.push(value);
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
const removeIndex = newValues.findIndex((item) => item === value);
|
|
339
|
+
newValues.splice(removeIndex, 1);
|
|
340
|
+
}
|
|
341
|
+
if (onChanges) {
|
|
342
|
+
onChanges(newValues);
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
return (React__default.createElement(StyledCheckboxGroup, { className: className, "data-type": type, "data-is-rectangle": isRectangle || undefined }, options.map((option, index) => (React__default.createElement(Checkbox, { label: option.label, name: name, key: `${index}-${option.value}`, checked: values.includes(option.value), value: option.value, isDisabled: isDisabled || option.disabled, onChange: !isDisabled && onChange, isRectangle: isRectangle })))));
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
const StyledIconText = styled.div `
|
|
349
|
+
display: flex;
|
|
350
|
+
align-items: center;
|
|
351
|
+
--font-weight-lg: ${theme.sizes.fwBold};
|
|
352
|
+
--font-weight-md: ${theme.sizes.fwRegular};
|
|
353
|
+
--font-weight-sm: ${theme.sizes.fwRegular};
|
|
354
|
+
|
|
355
|
+
&[data-icon-position='left'] {
|
|
356
|
+
& > *:first-child {
|
|
357
|
+
margin-right: 8px;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
& > *:last-child {
|
|
361
|
+
width: calc(100% - 24px);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
&[data-icon-position='right'] {
|
|
365
|
+
& > *:first-child {
|
|
366
|
+
width: calc(100% - 24px);
|
|
367
|
+
}
|
|
368
|
+
& > *:last-child {
|
|
369
|
+
margin-left: 8px;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
${MediaQueries.mbDown} {
|
|
374
|
+
&[data-size='lg'] {
|
|
375
|
+
font-size: 16px;
|
|
376
|
+
line-height: 24px;
|
|
377
|
+
font-weight: var(--font-weight-lg);
|
|
378
|
+
}
|
|
379
|
+
&[data-size='md'] {
|
|
380
|
+
font-size: 14px;
|
|
381
|
+
line-height: 22px;
|
|
382
|
+
font-weight: var(--font-weight-md);
|
|
383
|
+
}
|
|
384
|
+
&[data-size='sm'] {
|
|
385
|
+
font-size: 13px;
|
|
386
|
+
line-height: 20px;
|
|
387
|
+
font-weight: var(----font-weight-sm);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
`;
|
|
391
|
+
|
|
392
|
+
const IconText = ({ size, iconPosition, className, children, icon: Icon, }) => {
|
|
393
|
+
return (React__default.createElement(StyledIconText, { className: className, "data-size": size, "data-icon-position": iconPosition },
|
|
394
|
+
iconPosition === 'left' && Icon,
|
|
395
|
+
children,
|
|
396
|
+
iconPosition === 'right' && Icon));
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
const StyledSlider = styled.div `
|
|
400
|
+
position: relative;
|
|
401
|
+
width: 100%;
|
|
402
|
+
|
|
403
|
+
& div[role='slider'] {
|
|
404
|
+
-webkit-text-size-adjust: none;
|
|
405
|
+
-webkit-user-select: none;
|
|
406
|
+
&:focus {
|
|
407
|
+
outline: none;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
`;
|
|
411
|
+
const StyledStep = styled.div `
|
|
412
|
+
position: absolute;
|
|
413
|
+
top: 19px;
|
|
414
|
+
width: 24px;
|
|
415
|
+
height: 24px;
|
|
416
|
+
color: ${theme.colors.white};
|
|
417
|
+
border: 2px solid ${theme.colors.white};
|
|
418
|
+
border-radius: 50%;
|
|
419
|
+
transform: translateY(-50%) translateX(-50%);
|
|
420
|
+
display: flex;
|
|
421
|
+
align-items: center;
|
|
422
|
+
justify-content: center;
|
|
423
|
+
cursor: pointer;
|
|
424
|
+
|
|
425
|
+
background-color: ${theme.colors.white};
|
|
426
|
+
color: ${theme.colors.gray300};
|
|
427
|
+
border: 1px solid ${theme.colors.gray300};
|
|
428
|
+
|
|
429
|
+
&[data-is-active='true'] {
|
|
430
|
+
background-color: ${theme.colors.primaryBase};
|
|
431
|
+
color: ${theme.colors.white};
|
|
432
|
+
border: none;
|
|
433
|
+
}
|
|
434
|
+
`;
|
|
435
|
+
const StyledTrackContainer = styled.div `
|
|
436
|
+
display: flex;
|
|
437
|
+
width: 100%;
|
|
438
|
+
height: 36px;
|
|
439
|
+
|
|
440
|
+
&[data-track-type='detail'] {
|
|
441
|
+
margin-top: 0;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
&[data-track-type='detail'][data-step-passed='true'] > div {
|
|
445
|
+
border: 1px solid ${theme.colors.primaryBase};
|
|
446
|
+
height: 0px;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
&[data-track-type='detail'] > div {
|
|
450
|
+
border: 1px solid ${theme.colors.gray200};
|
|
451
|
+
height: 0px;
|
|
452
|
+
}
|
|
453
|
+
`;
|
|
454
|
+
const StyledTrack = styled.div `
|
|
455
|
+
width: 100%;
|
|
456
|
+
height: 5px;
|
|
457
|
+
align-self: center;
|
|
458
|
+
border-radius: 4px;
|
|
459
|
+
background-color: ${theme.colors.gray200};
|
|
460
|
+
`;
|
|
461
|
+
const StyledStepLabel = styled.div `
|
|
462
|
+
position: absolute;
|
|
463
|
+
top: 32px;
|
|
464
|
+
min-width: 100px;
|
|
465
|
+
text-align: center;
|
|
466
|
+
color: ${theme.colors.gray500};
|
|
467
|
+
font-size: ${theme.sizes.fsCaption2};
|
|
468
|
+
font-weight: ${theme.sizes.fwBold};
|
|
469
|
+
|
|
470
|
+
&[data-step-passed='true'] {
|
|
471
|
+
color: ${theme.colors.gray800};
|
|
472
|
+
}
|
|
473
|
+
`;
|
|
474
|
+
const StyledBreadcrumbContainer = styled.div `
|
|
475
|
+
display: flex;
|
|
476
|
+
align-items: center;
|
|
477
|
+
`;
|
|
478
|
+
const StyledBreadcrumbWrapper = styled.div `
|
|
479
|
+
display: flex;
|
|
480
|
+
align-items: center;
|
|
481
|
+
font-size: ${theme.sizes.fsCaption2};
|
|
482
|
+
font-weight: ${theme.sizes.fwBold};
|
|
483
|
+
color: ${theme.colors.gray500};
|
|
484
|
+
cursor: pointer;
|
|
485
|
+
|
|
486
|
+
& > svg {
|
|
487
|
+
height: 10px;
|
|
488
|
+
width: 10px;
|
|
489
|
+
margin: 0 14px;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
& > svg > path {
|
|
493
|
+
stroke: ${theme.colors.gray500};
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
&[data-selected='true'] {
|
|
497
|
+
color: ${theme.colors.primaryBase};
|
|
498
|
+
}
|
|
499
|
+
`;
|
|
500
|
+
const StyledDetailStep = styled.div `
|
|
501
|
+
position: absolute;
|
|
502
|
+
left: 0;
|
|
503
|
+
top: 19px;
|
|
504
|
+
height: 24px;
|
|
505
|
+
cursor: pointer;
|
|
506
|
+
|
|
507
|
+
transform: translateY(-50%);
|
|
508
|
+
display: flex;
|
|
509
|
+
align-items: center;
|
|
510
|
+
|
|
511
|
+
padding: 8px;
|
|
512
|
+
background-color: ${theme.colors.white};
|
|
513
|
+
`;
|
|
514
|
+
const StyledDetailStepIndicator = styled.div `
|
|
515
|
+
min-width: 24px;
|
|
516
|
+
height: 24px;
|
|
517
|
+
border: 2px solid ${theme.colors.white};
|
|
518
|
+
border-radius: 50%;
|
|
519
|
+
margin-right: 8px;
|
|
520
|
+
display: flex;
|
|
521
|
+
align-items: center;
|
|
522
|
+
justify-content: center;
|
|
523
|
+
cursor: pointer;
|
|
524
|
+
|
|
525
|
+
background-color: ${theme.colors.white};
|
|
526
|
+
color: ${theme.colors.gray300};
|
|
527
|
+
border: 1px solid ${theme.colors.gray300};
|
|
528
|
+
|
|
529
|
+
&[data-is-active='true'] {
|
|
530
|
+
border: none;
|
|
531
|
+
background-color: ${theme.colors.primaryBase};
|
|
532
|
+
color: ${theme.colors.white};
|
|
533
|
+
}
|
|
534
|
+
`;
|
|
535
|
+
const StyledDetailStepIndicatorExternal = styled.div `
|
|
536
|
+
display: flex;
|
|
537
|
+
align-items: center;
|
|
538
|
+
justify-content: center;
|
|
539
|
+
|
|
540
|
+
& > svg {
|
|
541
|
+
height: 20px;
|
|
542
|
+
width: 20px;
|
|
543
|
+
margin-right: 8px;
|
|
544
|
+
|
|
545
|
+
& > path {
|
|
546
|
+
stroke: ${theme.colors.gray500};
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
`;
|
|
550
|
+
const StyledDetailStepLabel = styled.div `
|
|
551
|
+
color: ${theme.colors.gray400};
|
|
552
|
+
font-size: ${theme.sizes.fsCaption2};
|
|
553
|
+
font-weight: ${theme.sizes.fwBold};
|
|
554
|
+
margin-right: 8px;
|
|
555
|
+
flex: 0 0 auto;
|
|
556
|
+
|
|
557
|
+
&[data-step-passed='true'] {
|
|
558
|
+
color: ${theme.colors.gray800};
|
|
559
|
+
}
|
|
560
|
+
`;
|
|
561
|
+
const StyledDetailStepDescription = styled.div `
|
|
562
|
+
position: absolute;
|
|
563
|
+
top: 32px;
|
|
564
|
+
font-weight: ${theme.sizes.fwRegular};
|
|
565
|
+
color: ${theme.colors.gray400};
|
|
566
|
+
padding-right: 16px;
|
|
567
|
+
`;
|
|
568
|
+
|
|
569
|
+
const ProgressBar = ({ type, numberOfStep, activeStep, labelPrefix, detailSteps, className, onChange, }) => {
|
|
570
|
+
const [trackLength, setTrackLength] = useState(0);
|
|
571
|
+
const Track = (_a) => {
|
|
572
|
+
var { trackClassName } = _a, props = __rest(_a, ["trackClassName"]);
|
|
573
|
+
return (React__default.createElement(StyledTrackContainer, Object.assign({}, props, { className: trackClassName }),
|
|
574
|
+
React__default.createElement(StyledTrack, null)));
|
|
575
|
+
};
|
|
576
|
+
// step track
|
|
577
|
+
const Steps = ({ trackLength, activeStep, labelPrefix = 'Step', onChange, }) => {
|
|
578
|
+
return (React__default.createElement(React__default.Fragment, null, Array.from({ length: numberOfStep }, (v, i) => i).map((_, step) => (React__default.createElement(StyledStep, { "data-is-active": step === activeStep, "data-label": step, style: { left: (step * trackLength) / (numberOfStep - 1) }, onClick: () => {
|
|
579
|
+
onChange && onChange(step);
|
|
580
|
+
}, key: step },
|
|
581
|
+
step + 1,
|
|
582
|
+
React__default.createElement(StyledStepLabel, { "data-step-passed": step <= activeStep }, labelPrefix + ' ' + (step + 1)))))));
|
|
583
|
+
};
|
|
584
|
+
const stepTrack = (React__default.createElement(StyledSlider, { className: className + ' progress-bar' },
|
|
585
|
+
React__default.createElement(Track, null),
|
|
586
|
+
React__default.createElement(Steps, { trackLength: trackLength, activeStep: activeStep, labelPrefix: labelPrefix, onChange: onChange })));
|
|
587
|
+
// breadcrumb
|
|
588
|
+
const breadcrumbIcon = (React__default.createElement("svg", { "data-name": "Layer 1", viewBox: "0 0 5.5 9.5" },
|
|
589
|
+
React__default.createElement("title", null, 'chevron-right'),
|
|
590
|
+
React__default.createElement("path", { d: "M.75 8.75l4-4-4-4", fill: "none",
|
|
591
|
+
// stroke="#000"
|
|
592
|
+
strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5 })));
|
|
593
|
+
const breadcrumb = (React__default.createElement(StyledBreadcrumbContainer, null, detailSteps &&
|
|
594
|
+
Array.from({ length: detailSteps.length }, (v, i) => i).map((_, step_index) => {
|
|
595
|
+
var _a;
|
|
596
|
+
return (React__default.createElement(StyledBreadcrumbWrapper, { key: step_index, "data-selected": step_index === activeStep, onClick: () => {
|
|
597
|
+
onChange && onChange(step_index);
|
|
598
|
+
} }, (_a = detailSteps[step_index]) === null || _a === void 0 ? void 0 :
|
|
599
|
+
_a.text,
|
|
600
|
+
' ',
|
|
601
|
+
step_index < detailSteps.length - 1 && breadcrumbIcon));
|
|
602
|
+
})));
|
|
603
|
+
// detail track
|
|
604
|
+
const DetailStepsGroup = ({ detailSteps, activeStep, onChange, }) => {
|
|
605
|
+
return (React__default.createElement(React__default.Fragment, null, Array.from({ length: detailSteps.length }, (v, i) => i).map((step, step_index) => (React__default.createElement(StyledDetailStep, { key: step_index, style: {
|
|
606
|
+
left: (100 / detailSteps.length) * step_index + '%',
|
|
607
|
+
width: 100 / detailSteps.length + '%',
|
|
608
|
+
}, onClick: () => {
|
|
609
|
+
onChange && onChange(step_index);
|
|
610
|
+
} },
|
|
611
|
+
detailSteps[step_index].icon ? (React__default.createElement(StyledDetailStepIndicatorExternal, { onClick: () => {
|
|
612
|
+
onChange && onChange(step_index);
|
|
613
|
+
} }, detailSteps[step_index].icon)) : (React__default.createElement(StyledDetailStepIndicator, { "data-is-active": step_index === activeStep, "data-label": step, onClick: () => {
|
|
614
|
+
onChange && onChange(step_index);
|
|
615
|
+
}, key: step_index }, step_index + 1)),
|
|
616
|
+
React__default.createElement(StyledDetailStepLabel, { "data-step-passed": step_index < activeStep + 1 },
|
|
617
|
+
detailSteps[step_index].text,
|
|
618
|
+
React__default.createElement(StyledDetailStepDescription, null, detailSteps[step_index].description)),
|
|
619
|
+
step_index < detailSteps.length - 1 && (React__default.createElement(Track, { "data-step-passed": step_index < activeStep, trackClassName: 'progress-track', "data-track-type": "detail" })))))));
|
|
620
|
+
};
|
|
621
|
+
const detailTrack = (React__default.createElement(StyledSlider, { className: className + ' progress-bar' },
|
|
622
|
+
React__default.createElement(DetailStepsGroup, { activeStep: activeStep, detailSteps: detailSteps, onChange: onChange })));
|
|
623
|
+
const resizeTrack = useCallback(throttle(() => {
|
|
624
|
+
const progressTrack = document.querySelector('.progress-bar');
|
|
625
|
+
progressTrack && setTrackLength(progressTrack.offsetWidth);
|
|
626
|
+
}, 1000), []);
|
|
627
|
+
useEffect(() => {
|
|
628
|
+
const track = document.querySelector('.progress-bar');
|
|
629
|
+
setTrackLength(track === null || track === void 0 ? void 0 : track.offsetWidth);
|
|
630
|
+
window.addEventListener('resize', resizeTrack, {
|
|
631
|
+
passive: true,
|
|
632
|
+
});
|
|
633
|
+
return () => {
|
|
634
|
+
window.removeEventListener('resize', resizeTrack);
|
|
635
|
+
};
|
|
636
|
+
}, []);
|
|
637
|
+
return ((type === 'step-track' && stepTrack) ||
|
|
638
|
+
(type === 'breadcrumb' && breadcrumb) ||
|
|
639
|
+
(type === 'detail-track' && detailTrack));
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
const RadioGroup = React__default.forwardRef(({ id, value, options, className, isDisabled, size: sizeProp = 'small', direction = 'vertical', onChange, dataEventCategory, dataEventAction, dataEventLabel, }, ref) => {
|
|
643
|
+
const [check, setCheck] = useState(value);
|
|
644
|
+
useImperativeHandle(ref, () => ({
|
|
645
|
+
reset() {
|
|
646
|
+
setCheck(value);
|
|
647
|
+
},
|
|
648
|
+
}));
|
|
649
|
+
const handleOnChange = (v) => {
|
|
650
|
+
setCheck(v);
|
|
651
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(v);
|
|
652
|
+
};
|
|
653
|
+
const size = sizeProp === 'small' ? 'md' : 'lg';
|
|
654
|
+
const DirectionComp = direction === 'vertical' ? Stack : Group;
|
|
655
|
+
return (React__default.createElement(Radio.Group, { name: id, className: className, size: size, value: String(check), defaultValue: value, onChange: handleOnChange },
|
|
656
|
+
React__default.createElement(DirectionComp, { spacing: "xl" }, options.map((option) => (React__default.createElement(Radio, { key: option.value, value: option.value, label: option.label, disabled: isDisabled, "data-event-category": dataEventCategory, "data-event-action": dataEventAction, "data-event-label": dataEventLabel }))))));
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
const StyledSideMenu = styled.div `
|
|
660
|
+
--menu-width: 240px;
|
|
661
|
+
--menu-spacing: 28px 16px;
|
|
662
|
+
width: var(--menu-width);
|
|
663
|
+
height: 100vh;
|
|
664
|
+
padding: var(--menu-spacing);
|
|
665
|
+
background-color: ${theme.colors.neutral50};
|
|
666
|
+
transition: ease-in-out 0.5s;
|
|
667
|
+
|
|
668
|
+
&[data-is-collapsed] {
|
|
669
|
+
--menu-width: 64px;
|
|
670
|
+
--menu-spacing: 28px 8px;
|
|
671
|
+
}
|
|
672
|
+
`;
|
|
673
|
+
const SideMenu = ({ isCollapsed, className, style, children }) => {
|
|
674
|
+
return (React__default.createElement(StyledSideMenu, { style: style, className: className, "data-is-collapsed": isCollapsed || undefined }, children));
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
const StyledSideHeader = styled.div `
|
|
678
|
+
display: flex;
|
|
679
|
+
align-items: baseline;
|
|
680
|
+
justify-content: space-between;
|
|
681
|
+
|
|
682
|
+
svg {
|
|
683
|
+
transition: 0.4s ease-in-out;
|
|
684
|
+
}
|
|
685
|
+
`;
|
|
686
|
+
const StyledArrow = styled.div `
|
|
687
|
+
cursor: pointer;
|
|
688
|
+
&[data-is-collapsed] {
|
|
689
|
+
transform: rotate(180deg);
|
|
690
|
+
}
|
|
691
|
+
`;
|
|
692
|
+
const SideHeader = ({ isCollapsed, defaultLogo, onBackClick, customIcon, }) => {
|
|
693
|
+
return (React__default.createElement(StyledSideHeader, null,
|
|
694
|
+
React__default.createElement(Logo, { type: isCollapsed ? 'logomark' : defaultLogo || 'hellocare', customSize: {
|
|
695
|
+
width: isCollapsed ? '24px' : '77px',
|
|
696
|
+
height: '24px',
|
|
697
|
+
} }),
|
|
698
|
+
React__default.createElement(StyledArrow, { "data-is-collapsed": isCollapsed || undefined, onClick: onBackClick }, customIcon ? (customIcon) : (React__default.createElement("svg", { "data-name": "Layer 1", viewBox: "0 0 20 20", width: "20px", height: "20px" },
|
|
699
|
+
React__default.createElement("path", { d: "M10 .75A9.25 9.25 0 1019.25 10 9.25 9.25 0 0010 .75z", fill: "none", stroke: "#d2d6dc", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }),
|
|
700
|
+
React__default.createElement("path", { d: "M11.44 6.53L8 10l3.48 3.47", fill: "none", stroke: "#737373", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }))))));
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
const StyledDoctorInfo = styled.figure `
|
|
704
|
+
display: flex;
|
|
705
|
+
|
|
706
|
+
> img,
|
|
707
|
+
svg,
|
|
708
|
+
picture {
|
|
709
|
+
width: 40px;
|
|
710
|
+
height: 40px;
|
|
711
|
+
margin-right: 1rem;
|
|
712
|
+
border-radius: 6px;
|
|
713
|
+
object-fit: cover;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
> figcaption {
|
|
717
|
+
p + p {
|
|
718
|
+
margin-top: 2px;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
`;
|
|
722
|
+
const DoctorInfo = ({ name, description, image, isDescriptionHidden, }) => {
|
|
723
|
+
return (React__default.createElement(StyledDoctorInfo, null,
|
|
724
|
+
image,
|
|
725
|
+
!isDescriptionHidden && (React__default.createElement("figcaption", null,
|
|
726
|
+
React__default.createElement(Text, { size: "p4", weight: "bold" }, name),
|
|
727
|
+
React__default.createElement(Text, { size: "p4" }, description)))));
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
const StyledUserInfo = styled.div `
|
|
731
|
+
display: flex;
|
|
732
|
+
align-items: center;
|
|
733
|
+
margin-top: 24px;
|
|
734
|
+
margin-bottom: 36px;
|
|
735
|
+
|
|
736
|
+
figcaption {
|
|
737
|
+
white-space: nowrap;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
&[data-is-collapsed='true'] {
|
|
741
|
+
img {
|
|
742
|
+
max-width: 2rem;
|
|
743
|
+
max-height: 2rem;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
`;
|
|
747
|
+
const UserInfo = ({ isCollapsed, userName, role, avatar }) => {
|
|
748
|
+
return (React__default.createElement(StyledUserInfo, { "data-is-collapsed": isCollapsed || undefined },
|
|
749
|
+
React__default.createElement(DoctorInfo, { image: avatar, name: userName, description: role, isDescriptionHidden: isCollapsed })));
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
const StyledMenuLink = styled.div `
|
|
753
|
+
display: flex;
|
|
754
|
+
align-items: center;
|
|
755
|
+
padding: 9px 21px;
|
|
756
|
+
margin-bottom: 4px;
|
|
757
|
+
border-radius: 6px;
|
|
758
|
+
|
|
759
|
+
&:not([data-is-link-active]) {
|
|
760
|
+
cursor: pointer;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
p {
|
|
764
|
+
margin-left: 12px;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
&[data-is-link-active] {
|
|
768
|
+
background: ${theme.colors.primaryBase};
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
&[data-is-link-collapsed] {
|
|
772
|
+
justify-content: center;
|
|
773
|
+
margin-right: -14px;
|
|
774
|
+
margin-left: -14px;
|
|
775
|
+
}
|
|
776
|
+
`;
|
|
777
|
+
const MenuLink = ({ icon, isActive, children, isCollapsed, activeIcon, onLinkClick, textSize = 'base', textType = 'bold', textColorActive = '#fff', textColor = '#595959', }) => {
|
|
778
|
+
return (React__default.createElement(StyledMenuLink, { "data-is-link-active": isActive || undefined, onClick: onLinkClick, "data-is-link-collapsed": isCollapsed || undefined },
|
|
779
|
+
!(isActive && activeIcon) ? icon : activeIcon,
|
|
780
|
+
!isCollapsed && (React__default.createElement(Text, { size: textSize, weight: textType, color: isActive ? textColorActive : textColor }, children))));
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
|
784
|
+
__proto__: null,
|
|
785
|
+
SideMenu: SideMenu,
|
|
786
|
+
SideHeader: SideHeader,
|
|
787
|
+
UserInfo: UserInfo,
|
|
788
|
+
MenuLink: MenuLink
|
|
789
|
+
});
|
|
790
|
+
|
|
791
|
+
const StyledScrollList = styled.div `
|
|
792
|
+
position: relative;
|
|
793
|
+
width: 100%;
|
|
794
|
+
> .container {
|
|
795
|
+
display: flex;
|
|
796
|
+
width: 100%;
|
|
797
|
+
-ms-overflow-style: none;
|
|
798
|
+
overflow-x: auto;
|
|
799
|
+
scrollbar-width: none;
|
|
800
|
+
|
|
801
|
+
&::-webkit-scrollbar {
|
|
802
|
+
display: none;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
.section {
|
|
806
|
+
display: flex;
|
|
807
|
+
width: 100%;
|
|
808
|
+
flex-direction: column;
|
|
809
|
+
flex-shrink: 0;
|
|
810
|
+
margin: auto;
|
|
811
|
+
|
|
812
|
+
> .grid-layout {
|
|
813
|
+
display: grid;
|
|
814
|
+
width: 100%;
|
|
815
|
+
grid-row-gap: 8px;
|
|
816
|
+
|
|
817
|
+
> .item-grid {
|
|
818
|
+
width: 100%;
|
|
819
|
+
|
|
820
|
+
> * {
|
|
821
|
+
margin: 0 auto;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
.progress-bar {
|
|
827
|
+
display: grid;
|
|
828
|
+
height: 15px;
|
|
829
|
+
margin-bottom: 10px;
|
|
830
|
+
|
|
831
|
+
.items-progress {
|
|
832
|
+
position: relative;
|
|
833
|
+
display: flex;
|
|
834
|
+
width: 100%;
|
|
835
|
+
align-items: center;
|
|
836
|
+
justify-content: center;
|
|
837
|
+
|
|
838
|
+
.icon-status {
|
|
839
|
+
position: absolute;
|
|
840
|
+
display: flex;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
.line {
|
|
844
|
+
width: 50%;
|
|
845
|
+
height: 2px;
|
|
846
|
+
background-color: ${theme.colors.gray600};
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
.bullet-nav {
|
|
854
|
+
position: absolute;
|
|
855
|
+
z-index: ${theme.zIndexes.belowHeader};
|
|
856
|
+
bottom: -30px;
|
|
857
|
+
left: 50%;
|
|
858
|
+
display: flex;
|
|
859
|
+
transform: translate(-50%, -50%);
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
.bullet-nav__link {
|
|
863
|
+
display: block;
|
|
864
|
+
width: 8px;
|
|
865
|
+
height: 8px;
|
|
866
|
+
padding: 0;
|
|
867
|
+
margin-right: 8px;
|
|
868
|
+
backface-visibility: hidden;
|
|
869
|
+
background-color: #e4e8ec;
|
|
870
|
+
border-radius: 50%;
|
|
871
|
+
cursor: pointer;
|
|
872
|
+
transition: all 0.3s;
|
|
873
|
+
&.active {
|
|
874
|
+
&[data-scheme='hellosites'] {
|
|
875
|
+
background-color: ${theme.colors.primary600};
|
|
876
|
+
}
|
|
877
|
+
&[data-scheme='marrybaby'] {
|
|
878
|
+
background-color: ${theme.mbColors.pink};
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.arrow-left {
|
|
884
|
+
position: absolute;
|
|
885
|
+
z-index: 10;
|
|
886
|
+
top: 50%;
|
|
887
|
+
left: -35px;
|
|
888
|
+
transform: translateY(-50%);
|
|
889
|
+
&[data-event-category] > * {
|
|
890
|
+
pointer-events: none;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
.arrow-right {
|
|
895
|
+
position: absolute;
|
|
896
|
+
z-index: 10;
|
|
897
|
+
top: 50%;
|
|
898
|
+
right: -35px;
|
|
899
|
+
transform: translateY(-50%);
|
|
900
|
+
&[data-event-category] > * {
|
|
901
|
+
pointer-events: none;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
.image-gallery-wrapper {
|
|
906
|
+
display: flex;
|
|
907
|
+
position: relative;
|
|
908
|
+
margin-top: 16px;
|
|
909
|
+
justify-content: center;
|
|
910
|
+
gap: 16px;
|
|
911
|
+
.image-block {
|
|
912
|
+
display: block;
|
|
913
|
+
width: 100%;
|
|
914
|
+
border: 2px solid transparent;
|
|
915
|
+
border-radius: 4px;
|
|
916
|
+
}
|
|
917
|
+
.image-block.active {
|
|
918
|
+
border-color: ${theme.colors.primaryBase};
|
|
919
|
+
}
|
|
920
|
+
img {
|
|
921
|
+
height: 40px;
|
|
922
|
+
width: auto;
|
|
923
|
+
max-width: 100%;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
`;
|
|
927
|
+
|
|
928
|
+
const RenderIconStatus = ({ status }) => {
|
|
929
|
+
if (status === 'inActive') {
|
|
930
|
+
return (React__default.createElement("svg", { width: "6", height: "6", viewBox: "0 0 6 6", fill: "none" },
|
|
931
|
+
React__default.createElement("circle", { cx: "3", cy: "3", r: "3", fill: "#ADB3BC" })));
|
|
932
|
+
}
|
|
933
|
+
else if (status === 'active') {
|
|
934
|
+
return (React__default.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" },
|
|
935
|
+
React__default.createElement("circle", { cx: "6", cy: "6", r: "4", fill: "#2D87F3" }),
|
|
936
|
+
React__default.createElement("circle", { cx: "6", cy: "6", r: "5.5", stroke: "#2D87F3" })));
|
|
937
|
+
}
|
|
938
|
+
else if (status === 'done') {
|
|
939
|
+
return (React__default.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" },
|
|
940
|
+
React__default.createElement("path", { d: "M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12Z", fill: "#00B16A" }),
|
|
941
|
+
React__default.createElement("path", { d: "M8.76061 4.20029L4.80061 7.80029L3.00061 6.16392", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
942
|
+
}
|
|
943
|
+
return (React__default.createElement("svg", { width: "6", height: "6", viewBox: "0 0 6 6", fill: "none" },
|
|
944
|
+
React__default.createElement("circle", { cx: "3", cy: "3", r: "3", fill: "#ADB3BC" })));
|
|
945
|
+
};
|
|
946
|
+
/**
|
|
947
|
+
* @deprecated Consider to use at '@hhgtech/hhg-components/mantine'
|
|
948
|
+
*/
|
|
949
|
+
const ScrollList = ({ row = 2, column = 3, isDotsShown = true, isImageGalleryShown = false, mode = 'infinity', type = 'separated', distanceOverlappedLeft = {
|
|
950
|
+
amount: 0,
|
|
951
|
+
unit: 'pixel',
|
|
952
|
+
}, children, className, isProgressShown = false, statusChildren, isArrowShown = false, classNameLeftArrow, classNameRightArrow, dataEventCategory, dataEventAction, dataEventLabel, onChangePage, page, customPageWidth, scheme = 'hellosites', arrowType = 'Discover', }) => {
|
|
953
|
+
const hasPageProps = typeof page === 'number';
|
|
954
|
+
const [section, setSection] = useState(hasPageProps ? page : 0);
|
|
955
|
+
//Create groups
|
|
956
|
+
const groups = [];
|
|
957
|
+
React__default.Children.map(children, (element, idx) => {
|
|
958
|
+
if (idx % (row * column) === 0) {
|
|
959
|
+
groups.push([]);
|
|
960
|
+
}
|
|
961
|
+
groups[groups.length - 1].push(React__default.cloneElement(element));
|
|
962
|
+
});
|
|
963
|
+
const scrollRef = useRef();
|
|
964
|
+
const currentPage = useRef(0);
|
|
965
|
+
const scrollToPage = (index) => {
|
|
966
|
+
if (!scrollRef.current)
|
|
967
|
+
return;
|
|
968
|
+
const { clientWidth } = scrollRef.current;
|
|
969
|
+
const pageWidth = customPageWidth || clientWidth;
|
|
970
|
+
const distance = type === 'intertwined'
|
|
971
|
+
? distanceOverlappedLeft.unit === 'percentage'
|
|
972
|
+
? index * pageWidth +
|
|
973
|
+
(distanceOverlappedLeft.amount / 100) * pageWidth * index
|
|
974
|
+
: index * pageWidth +
|
|
975
|
+
distanceOverlappedLeft.amount * pageWidth * index
|
|
976
|
+
: index * pageWidth;
|
|
977
|
+
scrollRef.current.scrollTo({
|
|
978
|
+
top: 0,
|
|
979
|
+
left: distance,
|
|
980
|
+
behavior: 'smooth',
|
|
981
|
+
});
|
|
982
|
+
currentPage.current = index;
|
|
983
|
+
setSection(index);
|
|
984
|
+
};
|
|
985
|
+
const handleClick = (index) => {
|
|
986
|
+
if (!scrollRef.current)
|
|
987
|
+
return;
|
|
988
|
+
const { clientWidth } = scrollRef.current;
|
|
989
|
+
const pageWidth = customPageWidth || clientWidth;
|
|
990
|
+
const distance = type === 'intertwined'
|
|
991
|
+
? distanceOverlappedLeft.unit === 'percentage'
|
|
992
|
+
? index * pageWidth +
|
|
993
|
+
(distanceOverlappedLeft.amount / 100) * pageWidth * index
|
|
994
|
+
: index * pageWidth +
|
|
995
|
+
distanceOverlappedLeft.amount * pageWidth * index
|
|
996
|
+
: index * pageWidth;
|
|
997
|
+
scrollRef.current.scrollTo({
|
|
998
|
+
top: 0,
|
|
999
|
+
left: distance,
|
|
1000
|
+
behavior: 'smooth',
|
|
1001
|
+
});
|
|
1002
|
+
currentPage.current = index;
|
|
1003
|
+
setSection(index);
|
|
1004
|
+
onChangePage && onChangePage(index);
|
|
1005
|
+
};
|
|
1006
|
+
useEffect(() => {
|
|
1007
|
+
if (typeof page === 'number')
|
|
1008
|
+
scrollToPage(page);
|
|
1009
|
+
}, [page]);
|
|
1010
|
+
const handleClickArrow = (type) => {
|
|
1011
|
+
if (!scrollRef.current)
|
|
1012
|
+
return;
|
|
1013
|
+
const { clientWidth } = scrollRef.current;
|
|
1014
|
+
const pageWidth = customPageWidth || clientWidth;
|
|
1015
|
+
let distance;
|
|
1016
|
+
section === 0 ? (distance = 0) : (distance = section * pageWidth);
|
|
1017
|
+
if (type === 'forward') {
|
|
1018
|
+
if (distance === pageWidth * (groups.length - 1)) {
|
|
1019
|
+
setSection(groups.length - 1);
|
|
1020
|
+
distance = pageWidth * (groups.length - 1);
|
|
1021
|
+
onChangePage && onChangePage(groups.length - 1);
|
|
1022
|
+
}
|
|
1023
|
+
else {
|
|
1024
|
+
setSection(section + 1);
|
|
1025
|
+
distance += pageWidth;
|
|
1026
|
+
onChangePage && onChangePage(section + 1);
|
|
1027
|
+
}
|
|
1028
|
+
scrollRef.current.scrollTo({
|
|
1029
|
+
top: 0,
|
|
1030
|
+
left: distance,
|
|
1031
|
+
behavior: 'smooth',
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
if (type === 'back') {
|
|
1035
|
+
if (distance === 0) {
|
|
1036
|
+
setSection(0);
|
|
1037
|
+
onChangePage && onChangePage(0);
|
|
1038
|
+
distance = 0;
|
|
1039
|
+
}
|
|
1040
|
+
else {
|
|
1041
|
+
setSection(section - 1);
|
|
1042
|
+
onChangePage && onChangePage(section - 1);
|
|
1043
|
+
distance -= pageWidth;
|
|
1044
|
+
}
|
|
1045
|
+
scrollRef.current.scrollTo({
|
|
1046
|
+
top: 0,
|
|
1047
|
+
left: distance,
|
|
1048
|
+
behavior: 'smooth',
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
};
|
|
1052
|
+
const handleScroll = () => {
|
|
1053
|
+
if (mode === 'infinity') {
|
|
1054
|
+
if (!scrollRef.current)
|
|
1055
|
+
return;
|
|
1056
|
+
const { clientWidth, scrollLeft } = scrollRef.current;
|
|
1057
|
+
const pageWidth = customPageWidth || clientWidth;
|
|
1058
|
+
const page = Math.floor(scrollLeft / pageWidth);
|
|
1059
|
+
setSection(page);
|
|
1060
|
+
onChangePage && onChangePage(page);
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
1063
|
+
const handleScrollThrottle = throttle(handleScroll, 400);
|
|
1064
|
+
useEffect(() => {
|
|
1065
|
+
if (mode === 'snapped') {
|
|
1066
|
+
let isDown = false;
|
|
1067
|
+
let startX;
|
|
1068
|
+
let startY;
|
|
1069
|
+
let isSlidingY;
|
|
1070
|
+
let isSlidingX;
|
|
1071
|
+
let scrollLeft;
|
|
1072
|
+
let direction;
|
|
1073
|
+
const slider = scrollRef.current;
|
|
1074
|
+
const start = (pageX, pageY) => {
|
|
1075
|
+
isDown = true;
|
|
1076
|
+
isSlidingY = false;
|
|
1077
|
+
isSlidingX = false;
|
|
1078
|
+
startX = pageX - slider.offsetLeft;
|
|
1079
|
+
startY = pageY - slider.offsetTop;
|
|
1080
|
+
scrollLeft = slider.scrollLeft;
|
|
1081
|
+
};
|
|
1082
|
+
const startMouse = (e) => {
|
|
1083
|
+
start(e.pageX, e.pageY);
|
|
1084
|
+
};
|
|
1085
|
+
const startTouch = (e) => {
|
|
1086
|
+
start(e.touches[0].pageX, e.touches[0].pageY);
|
|
1087
|
+
};
|
|
1088
|
+
const end = () => {
|
|
1089
|
+
isDown = false;
|
|
1090
|
+
isSlidingY = false;
|
|
1091
|
+
isSlidingX = false;
|
|
1092
|
+
if (!scrollRef.current)
|
|
1093
|
+
return;
|
|
1094
|
+
const { clientWidth } = scrollRef.current;
|
|
1095
|
+
const pageWidth = customPageWidth || clientWidth;
|
|
1096
|
+
const page = direction === 'ltr'
|
|
1097
|
+
? currentPage.current !== 0
|
|
1098
|
+
? currentPage.current - 1
|
|
1099
|
+
: currentPage.current
|
|
1100
|
+
: direction === 'rtl'
|
|
1101
|
+
? currentPage.current < groups.length - 1
|
|
1102
|
+
? currentPage.current + 1
|
|
1103
|
+
: currentPage.current
|
|
1104
|
+
: currentPage.current;
|
|
1105
|
+
const distance = type === 'intertwined'
|
|
1106
|
+
? distanceOverlappedLeft.unit === 'percentage'
|
|
1107
|
+
? page * pageWidth +
|
|
1108
|
+
(distanceOverlappedLeft.amount / 100) * pageWidth * page
|
|
1109
|
+
: page * pageWidth +
|
|
1110
|
+
distanceOverlappedLeft.amount * pageWidth * page
|
|
1111
|
+
: page * pageWidth;
|
|
1112
|
+
scrollRef.current.scrollTo({
|
|
1113
|
+
top: 0,
|
|
1114
|
+
left: distance,
|
|
1115
|
+
behavior: 'smooth',
|
|
1116
|
+
});
|
|
1117
|
+
direction = 'none';
|
|
1118
|
+
if (currentPage.current !== page) {
|
|
1119
|
+
currentPage.current = page;
|
|
1120
|
+
setSection(page);
|
|
1121
|
+
onChangePage && onChangePage(page);
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
const move = (pageX, pageY) => {
|
|
1125
|
+
if (!isDown)
|
|
1126
|
+
return;
|
|
1127
|
+
const x = pageX - slider.offsetLeft;
|
|
1128
|
+
const y = pageY - slider.offsetTop;
|
|
1129
|
+
const walkX = x - startX;
|
|
1130
|
+
const walkY = y - startY;
|
|
1131
|
+
if (!isSlidingY && !isSlidingX && (walkY > 20 || walkY < -20)) {
|
|
1132
|
+
isSlidingY = true;
|
|
1133
|
+
}
|
|
1134
|
+
if (!isSlidingY && (walkX > 20 || walkX < -20)) {
|
|
1135
|
+
isSlidingX = true;
|
|
1136
|
+
slider.scrollLeft = scrollLeft - walkX;
|
|
1137
|
+
if (walkX > 0) {
|
|
1138
|
+
direction = 'ltr';
|
|
1139
|
+
}
|
|
1140
|
+
if (walkX < 0) {
|
|
1141
|
+
direction = 'rtl';
|
|
1142
|
+
}
|
|
1143
|
+
if (walkX === 0) {
|
|
1144
|
+
direction = 'none';
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
};
|
|
1148
|
+
const moveMouse = (e) => {
|
|
1149
|
+
if (isSlidingX) {
|
|
1150
|
+
e.preventDefault();
|
|
1151
|
+
}
|
|
1152
|
+
move(e.pageX, e.pageY);
|
|
1153
|
+
};
|
|
1154
|
+
const moveTouch = (e) => {
|
|
1155
|
+
if (isSlidingX) {
|
|
1156
|
+
e.preventDefault();
|
|
1157
|
+
}
|
|
1158
|
+
move(e.touches[0].pageX, e.touches[0].pageY);
|
|
1159
|
+
};
|
|
1160
|
+
slider === null || slider === void 0 ? void 0 : slider.addEventListener('mousedown', startMouse, {
|
|
1161
|
+
passive: true,
|
|
1162
|
+
});
|
|
1163
|
+
slider === null || slider === void 0 ? void 0 : slider.addEventListener('touchstart', startTouch, {
|
|
1164
|
+
passive: true,
|
|
1165
|
+
});
|
|
1166
|
+
window.addEventListener('mouseup', end, {
|
|
1167
|
+
passive: true,
|
|
1168
|
+
});
|
|
1169
|
+
window.addEventListener('touchend', end, {
|
|
1170
|
+
passive: true,
|
|
1171
|
+
});
|
|
1172
|
+
slider === null || slider === void 0 ? void 0 : slider.addEventListener('mousemove', moveMouse, {
|
|
1173
|
+
passive: true,
|
|
1174
|
+
});
|
|
1175
|
+
slider === null || slider === void 0 ? void 0 : slider.addEventListener('touchmove', moveTouch, {
|
|
1176
|
+
passive: true,
|
|
1177
|
+
});
|
|
1178
|
+
return () => {
|
|
1179
|
+
slider === null || slider === void 0 ? void 0 : slider.removeEventListener('mousedown', startMouse);
|
|
1180
|
+
slider === null || slider === void 0 ? void 0 : slider.removeEventListener('touchstart', startTouch);
|
|
1181
|
+
window.removeEventListener('mouseup', end);
|
|
1182
|
+
window.removeEventListener('touchend', end);
|
|
1183
|
+
slider === null || slider === void 0 ? void 0 : slider.removeEventListener('mousemove', moveMouse);
|
|
1184
|
+
slider === null || slider === void 0 ? void 0 : slider.removeEventListener('touchmove', moveTouch);
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
}, []);
|
|
1188
|
+
return (React__default.createElement(StyledScrollList, { className: className, "data-row": row, onScroll: handleScrollThrottle },
|
|
1189
|
+
isArrowShown && section > 0 && (React__default.createElement("div", { className: `${classNameLeftArrow} arrow-left`, onClick: () => handleClickArrow('back'), "data-event-category": dataEventCategory, "data-event-action": dataEventAction, "data-event-label": dataEventLabel }, arrowType === 'Care' ? (React__default.createElement("svg", { width: "42", height: "42", viewBox: "0 0 42 42", fill: "none" },
|
|
1190
|
+
React__default.createElement("g", { filter: "url(#filter0_dd_12599_34420)" },
|
|
1191
|
+
React__default.createElement("path", { d: "M7.00024 19C7.00024 10.1634 14.1637 3 23.0002 3V3C31.8368 3 39.0002 10.1634 39.0002 19V19C39.0002 27.8366 31.8368 35 23.0002 35V35C14.1637 35 7.00024 27.8366 7.00024 19V19Z", fill: "white" }),
|
|
1192
|
+
React__default.createElement("path", { d: "M20.9293 19L24.7503 15.179C25.1643 14.765 25.1643 14.093 24.7503 13.679C24.3363 13.265 23.6643 13.265 23.2503 13.679L18.6363 18.293C18.2453 18.684 18.2453 19.317 18.6363 19.707L23.2503 24.321C23.6643 24.735 24.3363 24.735 24.7503 24.321C25.1643 23.907 25.1643 23.235 24.7503 22.821L20.9293 19Z", fill: "#595959" }),
|
|
1193
|
+
React__default.createElement("path", { d: "M23.0002 34C14.716 34 8.00024 27.2843 8.00024 19H6.00024C6.00024 28.3888 13.6114 36 23.0002 36V34ZM38.0002 19C38.0002 27.2843 31.2845 34 23.0002 34V36C32.3891 36 40.0002 28.3888 40.0002 19H38.0002ZM23.0002 4C31.2845 4 38.0002 10.7157 38.0002 19H40.0002C40.0002 9.61116 32.3891 2 23.0002 2V4ZM23.0002 2C13.6114 2 6.00024 9.61116 6.00024 19H8.00024C8.00024 10.7157 14.716 4 23.0002 4V2Z", fill: "#DBDFE5" })),
|
|
1194
|
+
React__default.createElement("defs", null,
|
|
1195
|
+
React__default.createElement("filter", { id: "filter0_dd_12599_34420", x: "0.000244141", y: "0", width: "42", height: "42", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
1196
|
+
React__default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
1197
|
+
React__default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }),
|
|
1198
|
+
React__default.createElement("feOffset", { dx: "-2", dy: "2" }),
|
|
1199
|
+
React__default.createElement("feGaussianBlur", { stdDeviation: "2.5" }),
|
|
1200
|
+
React__default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0.263201 0 0 0 0 0.335725 0 0 0 0 0.393257 0 0 0 0.123689 0" }),
|
|
1201
|
+
React__default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow_12599_34420" }),
|
|
1202
|
+
React__default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }),
|
|
1203
|
+
React__default.createElement("feOffset", { dx: "-1", dy: "1" }),
|
|
1204
|
+
React__default.createElement("feGaussianBlur", { stdDeviation: "1" }),
|
|
1205
|
+
React__default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0.264489 0 0 0 0 0.275745 0 0 0 0 0.28861 0 0 0 0.01 0" }),
|
|
1206
|
+
React__default.createElement("feBlend", { mode: "normal", in2: "effect1_dropShadow_12599_34420", result: "effect2_dropShadow_12599_34420" }),
|
|
1207
|
+
React__default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect2_dropShadow_12599_34420", result: "shape" }))))) : (React__default.createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none" },
|
|
1208
|
+
React__default.createElement("path", { d: "M15.9996 28.2218C22.7497 28.2218 28.2218 22.7497 28.2218 15.9996C28.2218 9.24942 22.7497 3.77734 15.9996 3.77734C9.24942 3.77734 3.77734 9.24942 3.77734 15.9996C3.77734 22.7497 9.24942 28.2218 15.9996 28.2218Z", stroke: scheme === 'hellosites' ? '#2D87F3' : '#e85388', strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
1209
|
+
React__default.createElement("path", { d: "M15.9997 11.1109L11.1108 15.9998L15.9997 20.8887", stroke: scheme === 'hellosites' ? '#2D87F3' : '#e85388', strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
1210
|
+
React__default.createElement("path", { d: "M20.8886 15.999L11.1108 15.999", stroke: scheme === 'hellosites' ? '#2D87F3' : '#e85388', strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }))))),
|
|
1211
|
+
React__default.createElement("div", { ref: scrollRef, className: "container", style: {
|
|
1212
|
+
overflowX: mode === 'snapped' || isArrowShown ? 'hidden' : 'scroll',
|
|
1213
|
+
} }, groups.map((group, groupIndex) => {
|
|
1214
|
+
let baseIndex = 0;
|
|
1215
|
+
for (let i = 0; i < groupIndex; i++) {
|
|
1216
|
+
baseIndex += groups[i].length;
|
|
1217
|
+
}
|
|
1218
|
+
return (React__default.createElement("div", { key: groupIndex, className: "section", style: {
|
|
1219
|
+
marginLeft: type === 'intertwined' && groupIndex !== 0
|
|
1220
|
+
? distanceOverlappedLeft.amount +
|
|
1221
|
+
'' +
|
|
1222
|
+
(distanceOverlappedLeft.unit === 'percentage'
|
|
1223
|
+
? '%'
|
|
1224
|
+
: 'px')
|
|
1225
|
+
: '0px',
|
|
1226
|
+
} },
|
|
1227
|
+
row === 1 && isProgressShown && (React__default.createElement("div", { className: "progress-bar", style: {
|
|
1228
|
+
gridTemplateColumns: `repeat(${column}, 1fr)`,
|
|
1229
|
+
} }, group.map((item, itemIndex) => {
|
|
1230
|
+
const realIndex = baseIndex + itemIndex;
|
|
1231
|
+
const foundStatusItem = statusChildren.find((statusItem) => statusItem.index === realIndex);
|
|
1232
|
+
return (React__default.createElement("div", { className: "items-progress", key: itemIndex },
|
|
1233
|
+
itemIndex === 0 && groupIndex === 0 ? (React__default.createElement("div", { className: "line", style: { visibility: 'hidden' } })) : (React__default.createElement("div", { className: "line" })),
|
|
1234
|
+
React__default.createElement("div", { className: "icon-status" },
|
|
1235
|
+
React__default.createElement(RenderIconStatus, { status: foundStatusItem === null || foundStatusItem === void 0 ? void 0 : foundStatusItem.status })),
|
|
1236
|
+
groupIndex === groups.length - 1 &&
|
|
1237
|
+
itemIndex === group.length - 1 ? (React__default.createElement("div", { className: "line", style: { visibility: 'hidden' } })) : (React__default.createElement("div", { className: "line" }))));
|
|
1238
|
+
}))),
|
|
1239
|
+
React__default.createElement("div", { className: "grid-layout", "data-index": groupIndex, style: {
|
|
1240
|
+
gridTemplateColumns: `repeat(${column}, 1fr)`,
|
|
1241
|
+
gridTemplateRows: `repeat(${row}, 1fr)`,
|
|
1242
|
+
} }, group.map((item, itemIndex) => (React__default.createElement(React__default.Fragment, { key: itemIndex },
|
|
1243
|
+
React__default.createElement("div", { className: "item-grid", key: itemIndex }, item)))))));
|
|
1244
|
+
})),
|
|
1245
|
+
isArrowShown && section < groups.length - 1 && (React__default.createElement("div", { className: `${classNameRightArrow} arrow-right`, onClick: () => handleClickArrow('forward'), "data-event-category": dataEventCategory, "data-event-action": dataEventAction, "data-event-label": dataEventLabel },
|
|
1246
|
+
' ',
|
|
1247
|
+
arrowType === 'Care' ? (React__default.createElement("svg", { width: "42", height: "42", viewBox: "0 0 42 42", fill: "none" },
|
|
1248
|
+
React__default.createElement("g", { filter: "url(#filter0_dd_12597_34423)" },
|
|
1249
|
+
React__default.createElement("path", { d: "M7.00024 19C7.00024 10.1634 14.1637 3 23.0002 3C31.8368 3 39.0002 10.1634 39.0002 19C39.0002 27.8366 31.8368 35 23.0002 35C14.1637 35 7.00024 27.8366 7.00024 19Z", fill: "white" }),
|
|
1250
|
+
React__default.createElement("path", { d: "M24.0712 19L20.2502 15.179C19.8362 14.765 19.8362 14.093 20.2502 13.679C20.6642 13.265 21.3362 13.265 21.7502 13.679L26.3642 18.293C26.7552 18.684 26.7552 19.317 26.3642 19.707L21.7502 24.321C21.3362 24.735 20.6642 24.735 20.2502 24.321C19.8362 23.907 19.8362 23.235 20.2502 22.821L24.0712 19Z", fill: "#595959" }),
|
|
1251
|
+
React__default.createElement("path", { d: "M23.0002 34C14.716 34 8.00024 27.2843 8.00024 19H6.00024C6.00024 28.3888 13.6114 36 23.0002 36V34ZM38.0002 19C38.0002 27.2843 31.2845 34 23.0002 34V36C32.3891 36 40.0002 28.3888 40.0002 19H38.0002ZM23.0002 4C31.2845 4 38.0002 10.7157 38.0002 19H40.0002C40.0002 9.61116 32.3891 2 23.0002 2V4ZM23.0002 2C13.6114 2 6.00024 9.61116 6.00024 19H8.00024C8.00024 10.7157 14.716 4 23.0002 4V2Z", fill: "#DBDFE5" })),
|
|
1252
|
+
React__default.createElement("defs", null,
|
|
1253
|
+
React__default.createElement("filter", { id: "filter0_dd_12597_34423", x: "0.000244141", y: "0", width: "42", height: "42", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
1254
|
+
React__default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
1255
|
+
React__default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }),
|
|
1256
|
+
React__default.createElement("feOffset", { dx: "-2", dy: "2" }),
|
|
1257
|
+
React__default.createElement("feGaussianBlur", { stdDeviation: "2.5" }),
|
|
1258
|
+
React__default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0.263201 0 0 0 0 0.335725 0 0 0 0 0.393257 0 0 0 0.123689 0" }),
|
|
1259
|
+
React__default.createElement("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow_12597_34423" }),
|
|
1260
|
+
React__default.createElement("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }),
|
|
1261
|
+
React__default.createElement("feOffset", { dx: "-1", dy: "1" }),
|
|
1262
|
+
React__default.createElement("feGaussianBlur", { stdDeviation: "1" }),
|
|
1263
|
+
React__default.createElement("feColorMatrix", { type: "matrix", values: "0 0 0 0 0.264489 0 0 0 0 0.275745 0 0 0 0 0.28861 0 0 0 0.01 0" }),
|
|
1264
|
+
React__default.createElement("feBlend", { mode: "normal", in2: "effect1_dropShadow_12597_34423", result: "effect2_dropShadow_12597_34423" }),
|
|
1265
|
+
React__default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect2_dropShadow_12597_34423", result: "shape" }))))) : (React__default.createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none" },
|
|
1266
|
+
React__default.createElement("path", { d: "M15.9996 28.2218C22.7497 28.2218 28.2218 22.7497 28.2218 15.9996C28.2218 9.24942 22.7497 3.77734 15.9996 3.77734C9.24942 3.77734 3.77734 9.24942 3.77734 15.9996C3.77734 22.7497 9.24942 28.2218 15.9996 28.2218Z", stroke: scheme === 'hellosites' ? '#2D87F3' : '#e85388', strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
1267
|
+
React__default.createElement("path", { d: "M15.9998 20.8891L20.8887 16.0002L15.9998 11.1113", stroke: scheme === 'hellosites' ? '#2D87F3' : '#e85388', strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
1268
|
+
React__default.createElement("path", { d: "M11.1109 16L20.8887 16", stroke: scheme === 'hellosites' ? '#2D87F3' : '#e85388', strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }))))),
|
|
1269
|
+
isDotsShown && (React__default.createElement("ul", { className: "bullet-nav" }, groups.map((group, index) => (React__default.createElement("li", { key: index, className: "bullet-nav__item " },
|
|
1270
|
+
React__default.createElement("p", { onClick: () => handleClick(index), className: `bullet-nav__link scroll ${section == index ? 'active' : null}`, "data-scheme": scheme })))))),
|
|
1271
|
+
isImageGalleryShown && (React__default.createElement("div", { className: "image-gallery-wrapper", "data-test": groups.length }, groups.slice(0, 3).map((item, itemIndex) => (React__default.createElement("div", { className: `image-block ${section == itemIndex ? 'active' : null}`, key: itemIndex, onClick: () => handleClick(itemIndex), "data-scheme": scheme }, item)))))));
|
|
1272
|
+
};
|
|
1273
|
+
|
|
1274
|
+
const StyledStatisticContainer = styled.div `
|
|
1275
|
+
border-radius: ${theme.borderRadius};
|
|
1276
|
+
${(props) => props['data-is-in-card'] &&
|
|
1277
|
+
`
|
|
1278
|
+
padding: 12px;
|
|
1279
|
+
background-color: ${props['data-card-color']};`}
|
|
1280
|
+
`;
|
|
1281
|
+
const StyledDot = styled.div `
|
|
1282
|
+
width: 13px;
|
|
1283
|
+
height: 13px;
|
|
1284
|
+
margin-right: 10px;
|
|
1285
|
+
background-color: ${(props) => props['data-color']};
|
|
1286
|
+
border-radius: 50%;
|
|
1287
|
+
`;
|
|
1288
|
+
const StyledDescriptionWrapper = styled.div `
|
|
1289
|
+
display: flex;
|
|
1290
|
+
align-items: center;
|
|
1291
|
+
color: ${theme.colors.gray800};
|
|
1292
|
+
font-size: ${theme.sizes.fsParagraph4};
|
|
1293
|
+
font-weight: ${theme.sizes.fwRegular};
|
|
1294
|
+
`;
|
|
1295
|
+
const StyledStatisticNumberWrapper = styled.div `
|
|
1296
|
+
display: flex;
|
|
1297
|
+
align-items: center;
|
|
1298
|
+
margin-top: 4px;
|
|
1299
|
+
color: ${theme.colors.gray800};
|
|
1300
|
+
font-size: ${theme.sizes.fsHeading2};
|
|
1301
|
+
font-weight: ${theme.sizes.fwSemiBold};
|
|
1302
|
+
|
|
1303
|
+
& > svg {
|
|
1304
|
+
width: 24px;
|
|
1305
|
+
height: 24px;
|
|
1306
|
+
margin-right: 12px;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
&[data-size='small'] {
|
|
1310
|
+
margin-left: 23px;
|
|
1311
|
+
font-size: ${theme.sizes.fsParagraph4};
|
|
1312
|
+
font-weight: ${theme.sizes.fwBold};
|
|
1313
|
+
}
|
|
1314
|
+
`;
|
|
1315
|
+
|
|
1316
|
+
const StatisticCard = ({ type, description, value, withIcon, isInACard, cardColor, className, }) => {
|
|
1317
|
+
return (React__default.createElement(StyledStatisticContainer, { className: className, "data-size": type, "data-is-in-card": type === 'big' && isInACard, "data-card-color": cardColor },
|
|
1318
|
+
React__default.createElement(StyledDescriptionWrapper, null,
|
|
1319
|
+
type === 'small' && React__default.createElement(StyledDot, { "data-color": cardColor }),
|
|
1320
|
+
description),
|
|
1321
|
+
React__default.createElement(StyledStatisticNumberWrapper, { "data-size": type },
|
|
1322
|
+
type !== 'small' && withIcon,
|
|
1323
|
+
value)));
|
|
1324
|
+
};
|
|
1325
|
+
|
|
1326
|
+
const StyledTable = styled.table `
|
|
1327
|
+
width: 100%;
|
|
1328
|
+
position: relative;
|
|
1329
|
+
`;
|
|
1330
|
+
const Table = ({ children, className, style, horizontalPadding, verticalPadding, }) => {
|
|
1331
|
+
return (React__default.createElement(StyledTable, { className: className, style: Object.assign({ '--horizontal-spacing': horizontalPadding || '19px', '--vertical-spacing': verticalPadding || '26px' }, style) }, children));
|
|
1332
|
+
};
|
|
1333
|
+
|
|
1334
|
+
const StyledTableCell = styled.td `
|
|
1335
|
+
padding: var(--vertical-spacing) var(--horizontal-spacing);
|
|
1336
|
+
vertical-align: middle;
|
|
1337
|
+
|
|
1338
|
+
&[data-text-align='left'] {
|
|
1339
|
+
text-align: left;
|
|
1340
|
+
}
|
|
1341
|
+
&[data-text-align='right'] {
|
|
1342
|
+
text-align: right;
|
|
1343
|
+
}
|
|
1344
|
+
&[data-text-align='center'] {
|
|
1345
|
+
text-align: center;
|
|
1346
|
+
}
|
|
1347
|
+
`;
|
|
1348
|
+
const Cell = ({ children, className, style, textAlign, isTableHead, }) => {
|
|
1349
|
+
return (React__default.createElement(StyledTableCell, { className: className, style: style, "data-text-align": textAlign ? textAlign : 'left', as: isTableHead ? 'th' : 'td' }, children));
|
|
1350
|
+
};
|
|
1351
|
+
|
|
1352
|
+
const StyledTableRow = styled.tr `
|
|
1353
|
+
border-bottom: 1px solid ${theme.colors.gray100};
|
|
1354
|
+
|
|
1355
|
+
&[data-is-active='true'] {
|
|
1356
|
+
background-color: ${theme.colors.gray200};
|
|
1357
|
+
}
|
|
1358
|
+
`;
|
|
1359
|
+
const Row = ({ children, className, style, isActive, onRowClicked, rowId, }) => {
|
|
1360
|
+
return (React__default.createElement(StyledTableRow, { className: className, "data-is-active": isActive, style: style, onClick: () => {
|
|
1361
|
+
onRowClicked && onRowClicked(rowId);
|
|
1362
|
+
} }, children));
|
|
1363
|
+
};
|
|
1364
|
+
|
|
1365
|
+
const StyledTableHead = styled.thead `
|
|
1366
|
+
th {
|
|
1367
|
+
padding: var(--vertical-spacing) var(--horizontal-spacing);
|
|
1368
|
+
text-align: left;
|
|
1369
|
+
|
|
1370
|
+
color: ${theme.colors.gray500};
|
|
1371
|
+
font-weight: ${theme.sizes.fwBold};
|
|
1372
|
+
}
|
|
1373
|
+
&[data-is-sticky] {
|
|
1374
|
+
th {
|
|
1375
|
+
position: sticky;
|
|
1376
|
+
top: 0;
|
|
1377
|
+
background: white;
|
|
1378
|
+
border-bottom: 2px solid ${theme.colors.gray200};
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
`;
|
|
1382
|
+
const Head = ({ isSticky, children, className, style }) => {
|
|
1383
|
+
return (React__default.createElement(StyledTableHead, { className: className, "data-is-sticky": isSticky || undefined, style: style },
|
|
1384
|
+
React__default.createElement(Row, null, children)));
|
|
1385
|
+
};
|
|
1386
|
+
|
|
1387
|
+
const StyledTableBody = styled.tbody `
|
|
1388
|
+
position: relative;
|
|
1389
|
+
&[data-is-striped] {
|
|
1390
|
+
> tr:nth-child(odd) {
|
|
1391
|
+
background-color: ${theme.colors.neutral50};
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
&[data-is-hoverable] {
|
|
1395
|
+
> tr:hover {
|
|
1396
|
+
background-color: ${theme.colors.neutral100};
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
`;
|
|
1400
|
+
const Body$1 = ({ children, className, style, isHoverable, isStriped, }) => {
|
|
1401
|
+
return (React__default.createElement(StyledTableBody, { className: className, style: style, "data-is-striped": isStriped || undefined, "data-is-hoverable": isHoverable || undefined }, children));
|
|
1402
|
+
};
|
|
1403
|
+
|
|
1404
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
1405
|
+
__proto__: null,
|
|
1406
|
+
Table: Table,
|
|
1407
|
+
Cell: Cell,
|
|
1408
|
+
Head: Head,
|
|
1409
|
+
Row: Row,
|
|
1410
|
+
Body: Body$1
|
|
1411
|
+
});
|
|
1412
|
+
|
|
1413
|
+
var useStyles$3 = createStyles((theme) => {
|
|
1414
|
+
const itemLabelRef = getStylesRef('itemLabel');
|
|
1415
|
+
return {
|
|
1416
|
+
root: {
|
|
1417
|
+
display: 'inline-flex',
|
|
1418
|
+
maxWidth: '100%',
|
|
1419
|
+
borderBottom: `1px solid ${theme.colors.neutral[1]}`,
|
|
1420
|
+
'-webkit-overflow-scrolling': 'touch',
|
|
1421
|
+
overflowX: 'auto',
|
|
1422
|
+
overflowY: 'hidden',
|
|
1423
|
+
'-ms-overflow-style': 'none' /* for Internet Explorer, Edge */,
|
|
1424
|
+
'scrollbar-width': 'none' /* for Firefox */,
|
|
1425
|
+
'&::-webkit-scrollbar': {
|
|
1426
|
+
display: 'none',
|
|
1427
|
+
},
|
|
1428
|
+
columnGap: theme.spacing.lg,
|
|
1429
|
+
},
|
|
1430
|
+
item: {
|
|
1431
|
+
display: 'flex',
|
|
1432
|
+
alignItems: 'center',
|
|
1433
|
+
paddingBottom: '4px',
|
|
1434
|
+
'&:hover': {
|
|
1435
|
+
cursor: 'pointer',
|
|
1436
|
+
},
|
|
1437
|
+
'&.active': {
|
|
1438
|
+
color: theme.fn.primaryColor(),
|
|
1439
|
+
borderBottom: `3px solid ${theme.fn.primaryColor()}`,
|
|
1440
|
+
bottom: '-1px',
|
|
1441
|
+
position: 'relative',
|
|
1442
|
+
[`& .${itemLabelRef}`]: {},
|
|
1443
|
+
},
|
|
1444
|
+
},
|
|
1445
|
+
itemInner: {
|
|
1446
|
+
display: 'flex',
|
|
1447
|
+
alignItems: 'center',
|
|
1448
|
+
},
|
|
1449
|
+
label: {
|
|
1450
|
+
ref: itemLabelRef,
|
|
1451
|
+
},
|
|
1452
|
+
icon: {
|
|
1453
|
+
marginRight: theme.spacing.xs,
|
|
1454
|
+
},
|
|
1455
|
+
};
|
|
1456
|
+
});
|
|
1457
|
+
|
|
1458
|
+
/**
|
|
1459
|
+
* @deprecated Consider to use mantine
|
|
1460
|
+
*/
|
|
1461
|
+
const Tabs = ({ style, initialTab, tabContent, onChange, className, dataEventCategory, dataEventAction, dataEventLabel, id, styles, }) => {
|
|
1462
|
+
const { classes, cx, theme } = useStyles$3(undefined, { name: 'Tabs', styles });
|
|
1463
|
+
const [activeTab, setActiveTab] = useState(initialTab || 0);
|
|
1464
|
+
useEffect(() => {
|
|
1465
|
+
setActiveTab(initialTab);
|
|
1466
|
+
}, [initialTab]);
|
|
1467
|
+
return (React__default.createElement("ul", { style: style, className: cx(classes.root, className), role: "tablist", id: id }, tabContent.map((tab, i) => (React__default.createElement("li", { className: `${classes.item} ${activeTab === i ? 'active' : ''} ${tab.className}`, "aria-selected": activeTab === i, role: "tab", onClick: () => {
|
|
1468
|
+
setActiveTab(i);
|
|
1469
|
+
onChange && onChange(i);
|
|
1470
|
+
}, onKeyDown: (e) => {
|
|
1471
|
+
if (e.key === 'Enter') {
|
|
1472
|
+
setActiveTab(i);
|
|
1473
|
+
onChange && onChange(i);
|
|
1474
|
+
}
|
|
1475
|
+
}, key: i, "data-event-category": tab.dataEventCategory || dataEventCategory, "data-event-action": tab.dataEventAction || dataEventAction, "data-event-label": tab.dataEventLabel || dataEventLabel, tabIndex: 0, "data-testid": tab.dataTestid },
|
|
1476
|
+
React__default.createElement("div", { className: classes.itemInner },
|
|
1477
|
+
tab.icon && React__default.createElement("div", { className: classes.icon }, tab.icon),
|
|
1478
|
+
React__default.createElement(Text, { className: classes.label, size: tab.textSize || 'sm', weight: tab.textType || 'bold', color: activeTab === i
|
|
1479
|
+
? theme.fn.primaryColor()
|
|
1480
|
+
: tab.textColor || theme.colors.gray[4], dataEventCategory: tab.dataEventCategory, dataEventAction: tab.dataEventAction, dataEventLabel: tab.dataEventLabel }, tab.name)))))));
|
|
1481
|
+
};
|
|
1482
|
+
|
|
1483
|
+
const TRANSITION_TIMING = 200;
|
|
1484
|
+
const StyledFloatButtonGroup = styled.div ``;
|
|
1485
|
+
const StyledFloatButtonGroupBackgroundPanel = styled.div `
|
|
1486
|
+
width: 100vw;
|
|
1487
|
+
height: 100vh;
|
|
1488
|
+
position: fixed;
|
|
1489
|
+
bottom: 0;
|
|
1490
|
+
right: 0;
|
|
1491
|
+
background-color: ${theme.colors.white};
|
|
1492
|
+
opacity: 0.83;
|
|
1493
|
+
transition: display ${TRANSITION_TIMING}ms linear;
|
|
1494
|
+
|
|
1495
|
+
[data-floatmenu-open='true'] & {
|
|
1496
|
+
animation: showBackgroundPanel ${TRANSITION_TIMING}ms linear 0s normal
|
|
1497
|
+
forwards;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
[data-floatmenu-open='false'] & {
|
|
1501
|
+
animation: hideBackgroundPanel ${TRANSITION_TIMING}ms linear 0s normal
|
|
1502
|
+
forwards;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
@keyframes showBackgroundPanel {
|
|
1506
|
+
0% {
|
|
1507
|
+
opacity: 0;
|
|
1508
|
+
width: 100vw;
|
|
1509
|
+
height: 100vh;
|
|
1510
|
+
}
|
|
1511
|
+
100% {
|
|
1512
|
+
opacity: 0.83;
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
@keyframes hideBackgroundPanel {
|
|
1517
|
+
0% {
|
|
1518
|
+
width: 100vw;
|
|
1519
|
+
height: 100vh;
|
|
1520
|
+
}
|
|
1521
|
+
99% {
|
|
1522
|
+
width: 100vw;
|
|
1523
|
+
height: 100vh;
|
|
1524
|
+
}
|
|
1525
|
+
100% {
|
|
1526
|
+
opacity: 0;
|
|
1527
|
+
width: 0;
|
|
1528
|
+
height: 0;
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
`;
|
|
1532
|
+
const StyledFloatButtonGroupContent = styled.div `
|
|
1533
|
+
position: fixed;
|
|
1534
|
+
right: 16px;
|
|
1535
|
+
bottom: 40px;
|
|
1536
|
+
`;
|
|
1537
|
+
const StyledFloatButtonGroupItemsWrapper = styled.div `
|
|
1538
|
+
display: flex;
|
|
1539
|
+
flex-direction: column;
|
|
1540
|
+
gap: 16px;
|
|
1541
|
+
transition: all ${TRANSITION_TIMING}ms ease-in-out;
|
|
1542
|
+
position: fixed;
|
|
1543
|
+
bottom: 112px;
|
|
1544
|
+
right: 16px;
|
|
1545
|
+
|
|
1546
|
+
// scale
|
|
1547
|
+
[data-animation-type='scale'] & {
|
|
1548
|
+
transform-origin: 100% 100%;
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
[data-animation-type='scale'][data-floatmenu-open='true'] & {
|
|
1552
|
+
transform: scale(1);
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
[data-animation-type='scale'][data-floatmenu-open='false'] & {
|
|
1556
|
+
transform: scale(0);
|
|
1557
|
+
bottom: 46px;
|
|
1558
|
+
right: 36px;
|
|
1559
|
+
}
|
|
1560
|
+
`;
|
|
1561
|
+
const StyledFloatButtonGroupToggleIcon = styled.div `
|
|
1562
|
+
border-radius: 50%;
|
|
1563
|
+
width: 56px;
|
|
1564
|
+
height: 56px;
|
|
1565
|
+
position: relative;
|
|
1566
|
+
cursor: pointer;
|
|
1567
|
+
margin-left: auto;
|
|
1568
|
+
transition: all 0.1s linear;
|
|
1569
|
+
-webkit-tap-highlight-color: transparent;
|
|
1570
|
+
[data-site-type='hb'] & {
|
|
1571
|
+
background-color: ${theme.colors.primaryBase};
|
|
1572
|
+
&:hover {
|
|
1573
|
+
background-color: ${theme.colors.primaryHover};
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
[data-site-type='mb'] & {
|
|
1577
|
+
background-color: #2d87f3;
|
|
1578
|
+
&:hover {
|
|
1579
|
+
background-color: #2c74df;
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
&:before {
|
|
1584
|
+
content: '';
|
|
1585
|
+
width: 2px;
|
|
1586
|
+
height: 20px;
|
|
1587
|
+
background-color: ${theme.colors.white};
|
|
1588
|
+
border-radius: 2px;
|
|
1589
|
+
position: absolute;
|
|
1590
|
+
top: 50%;
|
|
1591
|
+
left: 50%;
|
|
1592
|
+
transform: translate(-50%, -50%);
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
&:after {
|
|
1596
|
+
content: '';
|
|
1597
|
+
width: 20px;
|
|
1598
|
+
height: 2px;
|
|
1599
|
+
background-color: ${theme.colors.white};
|
|
1600
|
+
border-radius: 2px;
|
|
1601
|
+
position: absolute;
|
|
1602
|
+
top: 50%;
|
|
1603
|
+
left: 50%;
|
|
1604
|
+
transform: translate(-50%, -50%);
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
[data-floatmenu-open='true'] &:before,
|
|
1608
|
+
[data-floatmenu-open='true'] &:after {
|
|
1609
|
+
animation: toX ${TRANSITION_TIMING}ms linear 0s normal forwards;
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
[data-floatmenu-open='false'] &:before,
|
|
1613
|
+
[data-floatmenu-open='false'] &:after {
|
|
1614
|
+
animation: toPlus ${TRANSITION_TIMING}ms linear 0s normal forwards;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
@keyframes toX {
|
|
1618
|
+
0% {
|
|
1619
|
+
transform: translate(-50%, -50%) rotateZ(0deg);
|
|
1620
|
+
}
|
|
1621
|
+
49% {
|
|
1622
|
+
transform: translate(-50%, -50%) rotateZ(0deg);
|
|
1623
|
+
}
|
|
1624
|
+
50% {
|
|
1625
|
+
width: 2px;
|
|
1626
|
+
height: 2px;
|
|
1627
|
+
transform: translate(-50%, -50%) rotateZ(45deg);
|
|
1628
|
+
}
|
|
1629
|
+
100% {
|
|
1630
|
+
transform: translate(-50%, -50%) rotateZ(45deg);
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
@keyframes toPlus {
|
|
1635
|
+
0% {
|
|
1636
|
+
transform: translate(-50%, -50%) rotateZ(45deg);
|
|
1637
|
+
}
|
|
1638
|
+
49% {
|
|
1639
|
+
transform: translate(-50%, -50%) rotateZ(45deg);
|
|
1640
|
+
}
|
|
1641
|
+
50% {
|
|
1642
|
+
width: 2px;
|
|
1643
|
+
height: 2px;
|
|
1644
|
+
transform: translate(-50%, -50%) rotateZ(0deg);
|
|
1645
|
+
}
|
|
1646
|
+
100% {
|
|
1647
|
+
transform: translate(-50%, -50%) rotateZ(0deg);
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
`;
|
|
1651
|
+
const StyledFloatButtonGroupButton = styled.div `
|
|
1652
|
+
display: flex;
|
|
1653
|
+
gap: 8px;
|
|
1654
|
+
align-items: center;
|
|
1655
|
+
justify-content: flex-end;
|
|
1656
|
+
|
|
1657
|
+
width: fit-content;
|
|
1658
|
+
margin-left: auto;
|
|
1659
|
+
|
|
1660
|
+
[data-floatmenu-open='true'] {
|
|
1661
|
+
cursor: pointer;
|
|
1662
|
+
}
|
|
1663
|
+
[data-floatmenu-open='false'] {
|
|
1664
|
+
pointer-events: none;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
[data-animation-type='zoom'] &,
|
|
1668
|
+
[data-animation-type='slide'] & {
|
|
1669
|
+
position: absolute;
|
|
1670
|
+
right: 0;
|
|
1671
|
+
width: max-content;
|
|
1672
|
+
}
|
|
1673
|
+
// slide
|
|
1674
|
+
[data-animation-type='slide'] & {
|
|
1675
|
+
transition: all ${TRANSITION_TIMING}ms ease-in;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
[data-animation-type='slide'][data-floatmenu-open='true'] & {
|
|
1679
|
+
animation: showItem ${TRANSITION_TIMING}ms;
|
|
1680
|
+
}
|
|
1681
|
+
[data-animation-type='slide'][data-floatmenu-open='false'] & {
|
|
1682
|
+
bottom: -64px !important;
|
|
1683
|
+
animation: hideItemOnZoom ${TRANSITION_TIMING + 50}ms normal forwards;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
// zoom
|
|
1687
|
+
[data-animation-type='zoom'][data-floatmenu-open='false'] & {
|
|
1688
|
+
animation: hideItemOnZoom ${TRANSITION_TIMING + 50}ms normal forwards;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
@keyframes showItem {
|
|
1692
|
+
0% {
|
|
1693
|
+
opacity: 0;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
100% {
|
|
1697
|
+
opacity: 1;
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
@keyframes hideItemOnZoom {
|
|
1702
|
+
0% {
|
|
1703
|
+
transform: translateX(0);
|
|
1704
|
+
opacity: 1;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
99% {
|
|
1708
|
+
transform: translateX(0);
|
|
1709
|
+
opacity: 0.5;
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
100% {
|
|
1713
|
+
transform: translateX(calc(100% + 16px));
|
|
1714
|
+
opacity: 0;
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
`;
|
|
1718
|
+
const StyledFloatButtonGroupButtonLabel = styled.div `
|
|
1719
|
+
font-size: 14px;
|
|
1720
|
+
|
|
1721
|
+
// zoom
|
|
1722
|
+
[data-animation-type='zoom'] & {
|
|
1723
|
+
transition: transform ${TRANSITION_TIMING}ms ease-in-out;
|
|
1724
|
+
transform-origin: 100% 0;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
[data-animation-type='zoom'][data-floatmenu-open='true'] & {
|
|
1728
|
+
transform: scale(1);
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
[data-animation-type='zoom'][data-floatmenu-open='false'] & {
|
|
1732
|
+
transform: scale(0);
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
// slide
|
|
1736
|
+
[data-animation-type='slide'] & {
|
|
1737
|
+
transition: opacity ${TRANSITION_TIMING}ms;
|
|
1738
|
+
}
|
|
1739
|
+
[data-animation-type='slide'][data-floatmenu-open='true'] & {
|
|
1740
|
+
opacity: 1;
|
|
1741
|
+
}
|
|
1742
|
+
[data-animation-type='slide'][data-floatmenu-open='false'] & {
|
|
1743
|
+
opacity: 0;
|
|
1744
|
+
}
|
|
1745
|
+
`;
|
|
1746
|
+
const StyledFloatButtonGroupButtonIcon = styled.div `
|
|
1747
|
+
border-radius: 50%;
|
|
1748
|
+
box-shadow: 0px 16px 24px rgba(0, 0, 0, 0.06), 0px 2px 8px rgba(0, 0, 0, 0.04),
|
|
1749
|
+
0px 0px 1px rgba(0, 0, 0, 0.04);
|
|
1750
|
+
width: 48px;
|
|
1751
|
+
height: 48px;
|
|
1752
|
+
display: flex;
|
|
1753
|
+
align-items: center;
|
|
1754
|
+
justify-content: center;
|
|
1755
|
+
background-color: ${theme.colors.white};
|
|
1756
|
+
|
|
1757
|
+
// zoom
|
|
1758
|
+
[data-animation-type='zoom'] & {
|
|
1759
|
+
transition: transform ${TRANSITION_TIMING}ms ease-in-out;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
[data-animation-type='zoom'][data-floatmenu-open='true'] & {
|
|
1763
|
+
transform: scale(1);
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
[data-animation-type='zoom'][data-floatmenu-open='false'] & {
|
|
1767
|
+
transform: scale(0);
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
> img {
|
|
1771
|
+
width: 24px;
|
|
1772
|
+
height: 24px;
|
|
1773
|
+
object-fit: contain;
|
|
1774
|
+
}
|
|
1775
|
+
`;
|
|
1776
|
+
|
|
1777
|
+
const FloatButtonGroup = ({ items, className, style, backgroundPanelStyle, isOpen: isOpenProp, onOpen, onClose, disableBackdropClick, siteType = 'hb', animationType = 'zoom', zIndex = 300, }) => {
|
|
1778
|
+
const [isOpen, setIsOpen] = useState(!!isOpenProp);
|
|
1779
|
+
useEffect(() => {
|
|
1780
|
+
setIsOpen(!!isOpenProp);
|
|
1781
|
+
}, [isOpenProp]);
|
|
1782
|
+
const handleOpen = () => {
|
|
1783
|
+
setIsOpen(true);
|
|
1784
|
+
if (onOpen) {
|
|
1785
|
+
onOpen();
|
|
1786
|
+
}
|
|
1787
|
+
};
|
|
1788
|
+
const handleClose = () => {
|
|
1789
|
+
setIsOpen(false);
|
|
1790
|
+
if (onClose) {
|
|
1791
|
+
onClose();
|
|
1792
|
+
}
|
|
1793
|
+
};
|
|
1794
|
+
return (React__default.createElement(StyledFloatButtonGroup, { style: style, className: className, "data-floatmenu-open": isOpen, "data-site-type": siteType, "data-animation-type": animationType },
|
|
1795
|
+
React__default.createElement(StyledFloatButtonGroupBackgroundPanel, { className: "float-button-group__panel", style: Object.assign({ zIndex }, backgroundPanelStyle), onClick: !disableBackdropClick ? handleClose : undefined }),
|
|
1796
|
+
React__default.createElement(StyledFloatButtonGroupContent, { className: "float-button-group___content", style: { zIndex } },
|
|
1797
|
+
React__default.createElement(StyledFloatButtonGroupItemsWrapper, null, items.map((item, index) => {
|
|
1798
|
+
return (React__default.createElement(StyledFloatButtonGroupButton, { className: `float-item-button-${index}`, style: Object.assign(Object.assign({}, (animationType === 'zoom' && {
|
|
1799
|
+
bottom: (items.length - 1 - index) * (48 + 16),
|
|
1800
|
+
transitionDelay: `${(TRANSITION_TIMING / items.length) *
|
|
1801
|
+
(isOpen ? items.length - 1 - index : index)}ms`,
|
|
1802
|
+
})), (animationType === 'slide' && {
|
|
1803
|
+
bottom: (items.length - 1 - index) * (48 + 16),
|
|
1804
|
+
transitionDelay: `${(TRANSITION_TIMING / items.length) *
|
|
1805
|
+
(!isOpen ? items.length - 1 - index : index)}ms`,
|
|
1806
|
+
})), key: index, onClick: () => {
|
|
1807
|
+
item.onClick();
|
|
1808
|
+
if (!item.keepMenuOnClick) {
|
|
1809
|
+
setIsOpen(false);
|
|
1810
|
+
}
|
|
1811
|
+
} },
|
|
1812
|
+
React__default.createElement(StyledFloatButtonGroupButtonLabel, { style: Object.assign({}, (animationType === 'zoom' && {
|
|
1813
|
+
transitionDelay: `${(TRANSITION_TIMING / items.length) *
|
|
1814
|
+
(isOpen ? items.length - 1 - index : index)}ms`,
|
|
1815
|
+
})) }, item.label),
|
|
1816
|
+
React__default.createElement(StyledFloatButtonGroupButtonIcon, { className: "float-item-button__icon-wrapper", style: Object.assign({}, ((animationType === 'zoom' ||
|
|
1817
|
+
animationType === 'slide') && {
|
|
1818
|
+
transitionDelay: `${(TRANSITION_TIMING / items.length) *
|
|
1819
|
+
(isOpen ? items.length - 1 - index : index)}ms`,
|
|
1820
|
+
})) }, item.icon)));
|
|
1821
|
+
})),
|
|
1822
|
+
React__default.createElement(StyledFloatButtonGroupToggleIcon, { onClick: isOpen ? handleClose : handleOpen }))));
|
|
1823
|
+
};
|
|
1824
|
+
|
|
1825
|
+
const StyledAcceptCardContainer = styled.div `
|
|
1826
|
+
padding: 16px;
|
|
1827
|
+
width: 375px;
|
|
1828
|
+
word-wrap: break-word;
|
|
1829
|
+
word-break: break-word;
|
|
1830
|
+
${MediaQueries.mbDown} {
|
|
1831
|
+
width: 100%;
|
|
1832
|
+
}
|
|
1833
|
+
&[data-theme='helloSites'] {
|
|
1834
|
+
background: ${theme.colors.secondaryBase};
|
|
1835
|
+
box-shadow: 0px 8px 40px rgba(0, 0, 0, 0.1);
|
|
1836
|
+
}
|
|
1837
|
+
&[data-theme='marryBaby'] {
|
|
1838
|
+
border: none;
|
|
1839
|
+
background: ${theme.mbColors.pink};
|
|
1840
|
+
border-radius: 12px 12px 0 0;
|
|
1841
|
+
}
|
|
1842
|
+
&[data-is-open='false'] {
|
|
1843
|
+
display: none;
|
|
1844
|
+
}
|
|
1845
|
+
&[data-default-position='true'] {
|
|
1846
|
+
position: fixed;
|
|
1847
|
+
z-index: 1000;
|
|
1848
|
+
bottom: 0;
|
|
1849
|
+
right: 0;
|
|
1850
|
+
${MediaQueries.mbDown} {
|
|
1851
|
+
left: 0;
|
|
1852
|
+
right: unset;
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
`;
|
|
1856
|
+
const StyledTitleSection = styled.p `
|
|
1857
|
+
position: relative;
|
|
1858
|
+
padding-left: 24px;
|
|
1859
|
+
color: ${theme.colors.white};
|
|
1860
|
+
font-size: 14px;
|
|
1861
|
+
font-weight: 600;
|
|
1862
|
+
line-height: 22px;
|
|
1863
|
+
&[data-has-content='true'] {
|
|
1864
|
+
::before {
|
|
1865
|
+
position: absolute;
|
|
1866
|
+
top: 0;
|
|
1867
|
+
bottom: 0;
|
|
1868
|
+
left: 0;
|
|
1869
|
+
width: 16px;
|
|
1870
|
+
height: 16px;
|
|
1871
|
+
margin: auto 0;
|
|
1872
|
+
content: url("data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.00001 1.33331C4.32001 1.33331 1.33334 4.31998 1.33334 7.99998C1.33334 11.68 4.32001 14.6666 8.00001 14.6666C11.68 14.6666 14.6667 11.68 14.6667 7.99998C14.6667 4.31998 11.68 1.33331 8.00001 1.33331ZM8.00001 11.3333C7.63334 11.3333 7.33334 11.0333 7.33334 10.6666V7.99998C7.33334 7.63331 7.63334 7.33331 8.00001 7.33331C8.36668 7.33331 8.66668 7.63331 8.66668 7.99998V10.6666C8.66668 11.0333 8.36668 11.3333 8.00001 11.3333ZM7.33334 5.99998H8.66668V4.66665H7.33334V5.99998Z' fill='white'/%3e%3c/svg%3e");
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
`;
|
|
1876
|
+
const StyledDescription = styled.p `
|
|
1877
|
+
margin-top: 2px;
|
|
1878
|
+
color: ${theme.colors.white};
|
|
1879
|
+
font-size: 12px;
|
|
1880
|
+
font-weight: 400;
|
|
1881
|
+
line-height: 18px;
|
|
1882
|
+
a {
|
|
1883
|
+
color: ${theme.colors.white};
|
|
1884
|
+
text-decoration: none;
|
|
1885
|
+
text-decoration-line: underline;
|
|
1886
|
+
}
|
|
1887
|
+
`;
|
|
1888
|
+
const StyledButtonGroup = styled.div `
|
|
1889
|
+
display: flex;
|
|
1890
|
+
align-items: center;
|
|
1891
|
+
margin-top: 8px;
|
|
1892
|
+
gap: 16px;
|
|
1893
|
+
`;
|
|
1894
|
+
const StyledAcceptButton = styled.div `
|
|
1895
|
+
padding: 7px 28px;
|
|
1896
|
+
background: ${theme.colors.white};
|
|
1897
|
+
border-radius: ${theme.borderRadius};
|
|
1898
|
+
color: ${theme.colors.secondaryBase};
|
|
1899
|
+
cursor: pointer;
|
|
1900
|
+
font-size: 12px;
|
|
1901
|
+
font-weight: 600;
|
|
1902
|
+
line-height: 18px;
|
|
1903
|
+
`;
|
|
1904
|
+
const StyledPoliciesButton = styled.a `
|
|
1905
|
+
color: ${theme.colors.white};
|
|
1906
|
+
font-size: 12px;
|
|
1907
|
+
font-weight: 600;
|
|
1908
|
+
line-height: 22px;
|
|
1909
|
+
text-decoration: none;
|
|
1910
|
+
text-decoration-line: underline;
|
|
1911
|
+
`;
|
|
1912
|
+
|
|
1913
|
+
const CookieAcceptConfirm = ({ className, policiesUrl, onAcceptClick, translations = {
|
|
1914
|
+
acceptButton: 'Accept',
|
|
1915
|
+
policiesButton: 'Our Policies',
|
|
1916
|
+
}, title = '', description = '', theme = 'helloSites', isOpen = true, useDefaultPosition = true, trackingAttributes, }) => {
|
|
1917
|
+
return (React__default.createElement(StyledAcceptCardContainer, { className: className, "data-theme": theme, "data-is-open": isOpen, "data-default-position": useDefaultPosition },
|
|
1918
|
+
React__default.createElement(StyledTitleSection, { "data-has-content": !!title }, title),
|
|
1919
|
+
React__default.createElement(StyledDescription, { dangerouslySetInnerHTML: {
|
|
1920
|
+
__html: description,
|
|
1921
|
+
} }),
|
|
1922
|
+
React__default.createElement(StyledButtonGroup, null,
|
|
1923
|
+
React__default.createElement(StyledAcceptButton, { role: "button", tabIndex: 0, onClick: onAcceptClick, "data-event-category": trackingAttributes === null || trackingAttributes === void 0 ? void 0 : trackingAttributes.dataEventCategory, "data-event-action": trackingAttributes === null || trackingAttributes === void 0 ? void 0 : trackingAttributes.dataEventAction, "data-event-label": trackingAttributes === null || trackingAttributes === void 0 ? void 0 : trackingAttributes.dataEventLabel }, translations.acceptButton),
|
|
1924
|
+
React__default.createElement(StyledPoliciesButton, { href: policiesUrl }, translations.policiesButton))));
|
|
1925
|
+
};
|
|
1926
|
+
|
|
1927
|
+
const slideInUp = keyframes `
|
|
1928
|
+
from {
|
|
1929
|
+
transform: translateY(100%);
|
|
1930
|
+
visibility: visible;
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
to {
|
|
1934
|
+
transform: translateY(0);
|
|
1935
|
+
}
|
|
1936
|
+
`;
|
|
1937
|
+
const slideOutDown = keyframes `
|
|
1938
|
+
from {
|
|
1939
|
+
transform: translate(0, 0);
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
to {
|
|
1943
|
+
visibility: hidden;
|
|
1944
|
+
transform: translate(0, 100%);
|
|
1945
|
+
}
|
|
1946
|
+
`;
|
|
1947
|
+
const StyledMobileBottomNavigationIcon = styled.div `
|
|
1948
|
+
cursor: pointer;
|
|
1949
|
+
display: flex;
|
|
1950
|
+
flex-direction: column;
|
|
1951
|
+
align-items: center;
|
|
1952
|
+
justify-items: center;
|
|
1953
|
+
gap: 4px;
|
|
1954
|
+
|
|
1955
|
+
.mobile-navigation-label {
|
|
1956
|
+
font-weight: 500;
|
|
1957
|
+
font-size: 10px;
|
|
1958
|
+
line-height: 16px;
|
|
1959
|
+
color: ${theme.colors.gray600};
|
|
1960
|
+
overflow: hidden;
|
|
1961
|
+
text-overflow: ellipsis;
|
|
1962
|
+
white-space: nowrap;
|
|
1963
|
+
width: 60px;
|
|
1964
|
+
text-align: center;
|
|
1965
|
+
${MediaQueries.mbDown} {
|
|
1966
|
+
max-width: 60px;
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
.mobile-navigation-icon {
|
|
1971
|
+
position: relative;
|
|
1972
|
+
height: 24px;
|
|
1973
|
+
&[data-no-label='true'] {
|
|
1974
|
+
border-radius: 50%;
|
|
1975
|
+
display: flex;
|
|
1976
|
+
flex-direction: column;
|
|
1977
|
+
justify-content: center;
|
|
1978
|
+
align-items: center;
|
|
1979
|
+
padding: 0px;
|
|
1980
|
+
gap: 16px;
|
|
1981
|
+
width: 40px;
|
|
1982
|
+
height: 40px;
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
&[data-is-special='true'] {
|
|
1987
|
+
display: flex;
|
|
1988
|
+
flex-direction: row;
|
|
1989
|
+
align-items: center;
|
|
1990
|
+
padding: 4px 12px 4px 6px;
|
|
1991
|
+
gap: 4px;
|
|
1992
|
+
|
|
1993
|
+
min-width: 152px;
|
|
1994
|
+
height: 32px;
|
|
1995
|
+
/* Neutral/Neutral-50 */
|
|
1996
|
+
background: ${theme.colors.primary50};
|
|
1997
|
+
border-radius: 20px;
|
|
1998
|
+
flex-grow: 1;
|
|
1999
|
+
.mobile-navigation-icon {
|
|
2000
|
+
&[data-no-label='true'] {
|
|
2001
|
+
width: 24px;
|
|
2002
|
+
height: 24px;
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
.mobile-navigation-label {
|
|
2006
|
+
max-width: max-content;
|
|
2007
|
+
color: ${theme.colors.primaryBase};
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
&[data-is-active='true'] {
|
|
2012
|
+
.mobile-navigation-label {
|
|
2013
|
+
color: ${theme.colors.primaryBase};
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
&[data-is-disabled='true'] {
|
|
2018
|
+
opacity: 0.2;
|
|
2019
|
+
}
|
|
2020
|
+
`;
|
|
2021
|
+
const StyledMobileBottomNavigation = styled.div `
|
|
2022
|
+
z-index: 100;
|
|
2023
|
+
position: fixed;
|
|
2024
|
+
bottom: 0;
|
|
2025
|
+
left: 0;
|
|
2026
|
+
width: 100%;
|
|
2027
|
+
height: 100%;
|
|
2028
|
+
max-height: 56px;
|
|
2029
|
+
min-height: 56px;
|
|
2030
|
+
display: flex;
|
|
2031
|
+
height: 100%;
|
|
2032
|
+
align-items: center;
|
|
2033
|
+
justify-content: space-evenly;
|
|
2034
|
+
background-color: ${theme.colors.white};
|
|
2035
|
+
@supports (padding-bottom: env(safe-area-inset-bottom)) {
|
|
2036
|
+
min-height: calc(56px + env(safe-area-inset-bottom));
|
|
2037
|
+
max-height: calc(56px + env(safe-area-inset-bottom));
|
|
2038
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
2039
|
+
}
|
|
2040
|
+
a {
|
|
2041
|
+
text-decoration: none;
|
|
2042
|
+
}
|
|
2043
|
+
&[data-is-collapsed='true'] {
|
|
2044
|
+
animation: ${slideOutDown} 500ms ease-in-out forwards;
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
&[data-is-collapsed='false'] {
|
|
2048
|
+
animation: ${slideInUp} 500ms ease-in-out forwards;
|
|
2049
|
+
}
|
|
2050
|
+
&[data-template='health-tool'] {
|
|
2051
|
+
height: 44px;
|
|
2052
|
+
max-height: 44px;
|
|
2053
|
+
min-height: 44px;
|
|
2054
|
+
justify-content: space-between;
|
|
2055
|
+
& > div {
|
|
2056
|
+
flex: 0;
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
`;
|
|
2060
|
+
const StyledBadge = styled.span `
|
|
2061
|
+
position: absolute;
|
|
2062
|
+
left: 100%;
|
|
2063
|
+
transform: translate(-10px, calc(-50% + 3px));
|
|
2064
|
+
background-color: ${theme.colors.green800};
|
|
2065
|
+
border-radius: 32px;
|
|
2066
|
+
border: 2px solid ${theme.colors.white};
|
|
2067
|
+
padding: 1px 4px;
|
|
2068
|
+
display: flex;
|
|
2069
|
+
flex-direction: column;
|
|
2070
|
+
justify-content: center;
|
|
2071
|
+
align-items: center;
|
|
2072
|
+
height: 20px;
|
|
2073
|
+
aspect-ratio: 1;
|
|
2074
|
+
&[data-no-label='true'] {
|
|
2075
|
+
left: 0;
|
|
2076
|
+
transform: translate(22px, -50%);
|
|
2077
|
+
}
|
|
2078
|
+
`;
|
|
2079
|
+
styled.div `
|
|
2080
|
+
position: absolute;
|
|
2081
|
+
top: 0;
|
|
2082
|
+
left: 0;
|
|
2083
|
+
height: 3px;
|
|
2084
|
+
background-color: ${theme.colors.primaryBase};
|
|
2085
|
+
transition: width 150ms linear;
|
|
2086
|
+
`;
|
|
2087
|
+
styled.div `
|
|
2088
|
+
a {
|
|
2089
|
+
text-decoration: none;
|
|
2090
|
+
}
|
|
2091
|
+
`;
|
|
2092
|
+
|
|
2093
|
+
const MobileBottomNavigationIcon = (_a) => {
|
|
2094
|
+
var { badgeAmount, disabled = false, hasBadge = false, icon, isActive = false, isSpecial = false, label } = _a, props = __rest(_a, ["badgeAmount", "disabled", "hasBadge", "icon", "isActive", "isSpecial", "label"]);
|
|
2095
|
+
return (React__default.createElement(StyledMobileBottomNavigationIcon, Object.assign({ "data-is-special": isSpecial, "data-is-active": isActive, "data-is-disabled": disabled }, props),
|
|
2096
|
+
React__default.createElement("div", { className: "mobile-navigation-icon", "data-no-label": !Boolean(label) },
|
|
2097
|
+
hasBadge && (React__default.createElement(StyledBadge, { "data-no-label": !Boolean(label) },
|
|
2098
|
+
React__default.createElement(Text, { size: "s5", weight: "semiBold", color: isSpecial ? theme.colors.primaryBase : theme.colors.white }, badgeAmount))),
|
|
2099
|
+
icon),
|
|
2100
|
+
label && React__default.createElement("span", { className: "mobile-navigation-label" }, label)));
|
|
2101
|
+
};
|
|
2102
|
+
|
|
2103
|
+
const MobileBottomNavigationWrapper = (_a) => {
|
|
2104
|
+
var { children, isCollapsed = false, template = 'homepage' } = _a, rest = __rest(_a, ["children", "isCollapsed", "template"]);
|
|
2105
|
+
return (React__default.createElement(StyledMobileBottomNavigation, Object.assign({ "data-is-collapsed": isCollapsed, "data-template": template }, rest), children));
|
|
2106
|
+
};
|
|
2107
|
+
const MobileBottomNavigation = MobileBottomNavigationWrapper;
|
|
2108
|
+
MobileBottomNavigation.Icon = MobileBottomNavigationIcon;
|
|
2109
|
+
|
|
2110
|
+
const SeoHead = ({ SEOData = {}, locale = 'vi-VN', routerPathname: pathname, routerQuery: query, nextHead: Head, siteType, seoCustom, userId, forcedCanonicalUrl, }) => {
|
|
2111
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2112
|
+
const { totalPages, currentPage, SEOTitle = '', SEODescription = '', SEOImage, seoType, SEOImageWidth, SEOImageHeight, customMetaData = [], isIndexable = true, hasNoCanonical = false, } = SEOData;
|
|
2113
|
+
const robotIndex = isIndexable && isProduction
|
|
2114
|
+
? 'index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1'
|
|
2115
|
+
: 'noindex';
|
|
2116
|
+
// const { locale = 'vi-VN', pathname, query } = router
|
|
2117
|
+
const { NEXT_PUBLIC_BASE_API_URL } = process.env;
|
|
2118
|
+
let newPath = SEOData.canonicalUrl || pathname;
|
|
2119
|
+
Object.keys(query).forEach((key) => {
|
|
2120
|
+
const queryItem = query[key];
|
|
2121
|
+
if (queryItem && Array.isArray(queryItem)) {
|
|
2122
|
+
newPath = newPath.replace(`[...${key}]`, queryItem.join('/'));
|
|
2123
|
+
}
|
|
2124
|
+
});
|
|
2125
|
+
const sL = locale || 'en-PH'; // standardized locale
|
|
2126
|
+
const siteUrl = siteType === 'helloSites' ? domainLocales[sL] : 'www.marrybaby.vn';
|
|
2127
|
+
const hasSlash = newPath.endsWith('/') ? '' : '/';
|
|
2128
|
+
// TODO: remove or replace html-react-parser
|
|
2129
|
+
const metaData = useMemo(() => {
|
|
2130
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2131
|
+
let resMetaData = '';
|
|
2132
|
+
if (SEOData.apiMetaData && typeof SEOData.apiMetaData === 'string') {
|
|
2133
|
+
const paginatedTitle = (_a = SEOData.apiMetaData) === null || _a === void 0 ? void 0 : _a.match(/<title.*?>(.*)<\/title>/);
|
|
2134
|
+
const paginatedNumber = ` - Page ${currentPage} of ${totalPages}`;
|
|
2135
|
+
const fD = currentPage && currentPage !== 1 && paginatedTitle
|
|
2136
|
+
? SEOData.apiMetaData
|
|
2137
|
+
.replace(paginatedTitle[0], paginatedTitle[0].includes('-')
|
|
2138
|
+
? paginatedTitle[0].replace('-', paginatedNumber + ' - ')
|
|
2139
|
+
: `<title>${paginatedTitle[1].concat(paginatedNumber)}</title>`)
|
|
2140
|
+
.replace(`<link rel="canonical" href="https://${siteUrl}${newPath}${hasSlash}" />`, `<link rel="canonical" href="https://${siteUrl}${newPath}${hasSlash}?page=${currentPage}" />`)
|
|
2141
|
+
: SEOData.apiMetaData;
|
|
2142
|
+
resMetaData = parse(fD, { trim: true });
|
|
2143
|
+
if (!resMetaData.find((data) => {
|
|
2144
|
+
var _a, _b;
|
|
2145
|
+
return ((_a = data.props) === null || _a === void 0 ? void 0 : _a.property) === 'og:image' ||
|
|
2146
|
+
((_b = data.props) === null || _b === void 0 ? void 0 : _b.property) === 'og:image:secure_url';
|
|
2147
|
+
})) {
|
|
2148
|
+
const DefaultOgImage = `https://${siteUrl}/images/${locale}.png`;
|
|
2149
|
+
resMetaData = [
|
|
2150
|
+
...resMetaData,
|
|
2151
|
+
React__default.createElement("meta", { key: 'og:image', property: "og:image", content: ((_b = SEOData.openGraph) === null || _b === void 0 ? void 0 : _b.image) || SEOImage || DefaultOgImage || '' }),
|
|
2152
|
+
React__default.createElement("meta", { key: 'og:image:secure_url', property: "og:image:secure_url", content: ((_c = SEOData.openGraph) === null || _c === void 0 ? void 0 : _c.image) || SEOImage || DefaultOgImage }),
|
|
2153
|
+
React__default.createElement("meta", { key: 'og:image:width', property: "og:image:width", content: (((_d = SEOData.openGraph) === null || _d === void 0 ? void 0 : _d.imageWidth) &&
|
|
2154
|
+
String((_e = SEOData.openGraph) === null || _e === void 0 ? void 0 : _e.imageWidth)) ||
|
|
2155
|
+
(SEOImageWidth && String(SEOImageWidth)) ||
|
|
2156
|
+
'1200' }),
|
|
2157
|
+
React__default.createElement("meta", { key: 'og:image:height', property: "og:image:height", content: (((_f = SEOData.openGraph) === null || _f === void 0 ? void 0 : _f.imageHeight) &&
|
|
2158
|
+
String((_g = SEOData.openGraph) === null || _g === void 0 ? void 0 : _g.imageHeight)) ||
|
|
2159
|
+
(SEOImageHeight && String(SEOImageHeight)) ||
|
|
2160
|
+
'630' }),
|
|
2161
|
+
];
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
return resMetaData;
|
|
2165
|
+
}, [
|
|
2166
|
+
SEOData.apiMetaData,
|
|
2167
|
+
SEOData.openGraph,
|
|
2168
|
+
SEOImage,
|
|
2169
|
+
SEOImageHeight,
|
|
2170
|
+
SEOImageWidth,
|
|
2171
|
+
currentPage,
|
|
2172
|
+
newPath,
|
|
2173
|
+
totalPages,
|
|
2174
|
+
locale,
|
|
2175
|
+
siteUrl,
|
|
2176
|
+
]);
|
|
2177
|
+
const defaultImage = `https://${siteUrl}/images/${locale}.png`;
|
|
2178
|
+
const fontUrl = siteType === 'marryBaby'
|
|
2179
|
+
? 'https://fonts.googleapis.com/css2?family=Inter:wght@400..800&display=swap'
|
|
2180
|
+
: locale === 'km-KH'
|
|
2181
|
+
? 'https://fonts.googleapis.com/css2?family=Battambang:wght@400;700&display=swap'
|
|
2182
|
+
: locale === 'th-TH'
|
|
2183
|
+
? 'https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wdth,wght@62.5..100,100..900&display=swap'
|
|
2184
|
+
: 'https://fonts.googleapis.com/css2?family=Inter:wght@400..800&display=swap';
|
|
2185
|
+
return (React__default.createElement(Head, null,
|
|
2186
|
+
React__default.createElement("link", { rel: "preconnect", href: "https://fonts.gstatic.com" }),
|
|
2187
|
+
React__default.createElement("link", { rel: "preload", href: fontUrl, as: "style" }),
|
|
2188
|
+
React__default.createElement("link", { rel: "stylesheet", href: fontUrl }),
|
|
2189
|
+
React__default.createElement("link", { rel: "preconnect", href: NEXT_PUBLIC_BASE_API_URL }),
|
|
2190
|
+
React__default.createElement("meta", { charSet: "UTF-8" }),
|
|
2191
|
+
React__default.createElement("meta", { name: "viewport", content: "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" }),
|
|
2192
|
+
React__default.createElement("meta", { name: "google", content: "notranslate" }),
|
|
2193
|
+
React__default.createElement("meta", { name: "robots", content: robotIndex }),
|
|
2194
|
+
React__default.createElement("meta", { property: "fb:app_id", content: "653713035016537" }),
|
|
2195
|
+
customMetaData.map((customMeta, index) => {
|
|
2196
|
+
return React__default.createElement("meta", Object.assign({ key: index }, customMeta));
|
|
2197
|
+
}),
|
|
2198
|
+
React__default.createElement("meta", { name: "theme-color", content: siteType === 'helloSites' ? '#2c87f3' : '#e85388' }),
|
|
2199
|
+
React__default.createElement("meta", { name: "page_type", content: "Home" }),
|
|
2200
|
+
React__default.createElement("meta", { name: "page_platform", content: "WEB" }),
|
|
2201
|
+
React__default.createElement("meta", { name: "page_language", content: sL }),
|
|
2202
|
+
React__default.createElement("meta", { name: "ahrefs-site-verification", content: "46e7521a2b89a1013149c4685bbe02a1d36a4732fef98655142b829bc87cba4d" }),
|
|
2203
|
+
!metaData && (React__default.createElement(React__default.Fragment, null,
|
|
2204
|
+
siteType === 'helloSites' ? (React__default.createElement("title", null, seoCustom
|
|
2205
|
+
? SEOTitle
|
|
2206
|
+
: SEOTitle + ' - ' + ((_a = LOCALE_SPECS[locale]) === null || _a === void 0 ? void 0 : _a.SITE_NAME))) : (React__default.createElement("title", null, SEOTitle)),
|
|
2207
|
+
!hasNoCanonical && (React__default.createElement("link", { rel: "canonical", href: `https://${siteUrl}${newPath}` })),
|
|
2208
|
+
React__default.createElement("meta", { name: "description", content: SEODescription || ((_b = SEOData.openGraph) === null || _b === void 0 ? void 0 : _b.description) }),
|
|
2209
|
+
SEOData.schemaData && (React__default.createElement("script", { type: "application/ld+json", className: "yoast-schema-graph", dangerouslySetInnerHTML: { __html: SEOData.schemaData } })),
|
|
2210
|
+
React__default.createElement("meta", { property: "og:locale", content: locale }),
|
|
2211
|
+
React__default.createElement("meta", { property: "og:type", content: seoType || 'website' }),
|
|
2212
|
+
React__default.createElement("meta", { property: "og:title", content: ((_c = SEOData.openGraph) === null || _c === void 0 ? void 0 : _c.title) || SEOTitle }),
|
|
2213
|
+
React__default.createElement("meta", { property: "og:description", content: ((_d = SEOData.openGraph) === null || _d === void 0 ? void 0 : _d.description) || SEODescription }),
|
|
2214
|
+
React__default.createElement("meta", { property: "og:url", content: `https://${siteUrl}${newPath}` }),
|
|
2215
|
+
React__default.createElement("meta", { property: "og:site_name", content: `https://${siteUrl}` }),
|
|
2216
|
+
React__default.createElement("meta", { property: "og:image", content: ((_e = SEOData.openGraph) === null || _e === void 0 ? void 0 : _e.image) || SEOImage || defaultImage || '' }),
|
|
2217
|
+
React__default.createElement("meta", { property: "og:image:secure_url", content: ((_f = SEOData.openGraph) === null || _f === void 0 ? void 0 : _f.image) || SEOImage || defaultImage }),
|
|
2218
|
+
React__default.createElement("meta", { property: "og:image:width", content: (((_g = SEOData.openGraph) === null || _g === void 0 ? void 0 : _g.imageWidth) &&
|
|
2219
|
+
String((_h = SEOData.openGraph) === null || _h === void 0 ? void 0 : _h.imageWidth)) ||
|
|
2220
|
+
(SEOImageWidth && String(SEOImageWidth)) ||
|
|
2221
|
+
'1200' }),
|
|
2222
|
+
React__default.createElement("meta", { property: "og:image:height", content: (((_j = SEOData.openGraph) === null || _j === void 0 ? void 0 : _j.imageHeight) &&
|
|
2223
|
+
String((_k = SEOData.openGraph) === null || _k === void 0 ? void 0 : _k.imageHeight)) ||
|
|
2224
|
+
(SEOImageHeight && String(SEOImageHeight)) ||
|
|
2225
|
+
'630' }),
|
|
2226
|
+
React__default.createElement("meta", { name: "twitter:card", content: "summary_large_image" }),
|
|
2227
|
+
React__default.createElement("meta", { name: "twitter:title", content: ((_l = SEOData.twitter) === null || _l === void 0 ? void 0 : _l.title) || SEOTitle }),
|
|
2228
|
+
React__default.createElement("meta", { name: "twitter:description", content: SEODescription }),
|
|
2229
|
+
React__default.createElement("meta", { name: "twitter:image", content: ((_m = SEOData.twitter) === null || _m === void 0 ? void 0 : _m.image) || SEOImage }))),
|
|
2230
|
+
(siteType === 'helloSites'
|
|
2231
|
+
? FAVICONS[sL] || []
|
|
2232
|
+
: FAVICONS.marryBaby).map((item, index) => {
|
|
2233
|
+
if (item.type === 'link') {
|
|
2234
|
+
return (React__default.createElement("link", { key: `favicon-${index}`, rel: item.rel, href: item.href, sizes: item.sizes }));
|
|
2235
|
+
}
|
|
2236
|
+
if (item.type === 'meta') {
|
|
2237
|
+
return React__default.createElement("meta", { key: index, name: item.name, content: item.content });
|
|
2238
|
+
}
|
|
2239
|
+
return null;
|
|
2240
|
+
}),
|
|
2241
|
+
Array.isArray(metaData) && !!forcedCanonicalUrl
|
|
2242
|
+
? metaData.filter((d) => d.props.name !== 'canonical' && d.props.rel !== 'canonical')
|
|
2243
|
+
: metaData,
|
|
2244
|
+
forcedCanonicalUrl && React__default.createElement("link", { rel: "canonical", href: forcedCanonicalUrl }),
|
|
2245
|
+
!SEOData.hasNoAmp && locale !== 'vi-VN' && (React__default.createElement("link", { rel: "amphtml", href: `https://${siteUrl}${newPath}${hasSlash}?amp=1` })),
|
|
2246
|
+
userId && typeof window !== 'undefined' ? (React__default.createElement("script", { dangerouslySetInnerHTML: {
|
|
2247
|
+
__html: `window.dataLayer = window.dataLayer || []; window.dataLayer.push({'userID': '${userId}'});`,
|
|
2248
|
+
} })) : null));
|
|
2249
|
+
};
|
|
2250
|
+
|
|
2251
|
+
const StyledIconContainerClass = 'hhgcomp-toolbanner-iconcontainer';
|
|
2252
|
+
const StyledInnerClass = 'hhgcomp-toolbanner-inner';
|
|
2253
|
+
const StyledWrapper$1 = setDefaultClass(styled.div `
|
|
2254
|
+
position: relative;
|
|
2255
|
+
width: 100%;
|
|
2256
|
+
height: 100%;
|
|
2257
|
+
`, 'hhgcomp-toolbanner-wrapper');
|
|
2258
|
+
const StyledContainer = styled.div `
|
|
2259
|
+
width: 100%;
|
|
2260
|
+
a {
|
|
2261
|
+
text-decoration: none;
|
|
2262
|
+
color: inherit;
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
background-color: ${(props) => props['data-banner-color'] || themeColors.blue[1]};
|
|
2266
|
+
|
|
2267
|
+
&[data-site='marryBaby'] {
|
|
2268
|
+
a {
|
|
2269
|
+
text-decoration: underline;
|
|
2270
|
+
}
|
|
2271
|
+
${MediaQueries.mbDown} {
|
|
2272
|
+
padding-bottom: 0;
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
${MediaQueries.tdDown} {
|
|
2277
|
+
height: auto;
|
|
2278
|
+
${StyledWrapper$1.classSelector} {
|
|
2279
|
+
.${StyledInnerClass} {
|
|
2280
|
+
display: flex;
|
|
2281
|
+
align-items: center;
|
|
2282
|
+
${MediaQueries.mbDown} {
|
|
2283
|
+
justify-content: space-between;
|
|
2284
|
+
}
|
|
2285
|
+
.${StyledIconContainerClass} {
|
|
2286
|
+
position: relative;
|
|
2287
|
+
right: -50px;
|
|
2288
|
+
bottom: -20px;
|
|
2289
|
+
width: 110px;
|
|
2290
|
+
min-width: 0;
|
|
2291
|
+
height: auto;
|
|
2292
|
+
min-height: 0;
|
|
2293
|
+
align-self: flex-end;
|
|
2294
|
+
margin-bottom: -20px;
|
|
2295
|
+
${MediaQueries.mbDown} {
|
|
2296
|
+
right: unset;
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
`;
|
|
2303
|
+
|
|
2304
|
+
const ToolsBannerCard = ({ className, heading, bannerColor, medicalReview = {
|
|
2305
|
+
link: '#',
|
|
2306
|
+
reviewer: '',
|
|
2307
|
+
date: '',
|
|
2308
|
+
}, icon, style, isPregTool, }) => {
|
|
2309
|
+
const { t } = useTranslations();
|
|
2310
|
+
const theme = useMantineTheme();
|
|
2311
|
+
const isMarryBaby = theme.other.template === 'mb';
|
|
2312
|
+
const siteType = isMarryBaby ? 'marryBaby' : 'helloSites';
|
|
2313
|
+
const headingAs = 'h2';
|
|
2314
|
+
const medicalReviewEle = (medicalReview === null || medicalReview === void 0 ? void 0 : medicalReview.reviewer) ? (React__default.createElement(Text, { size: "label2", as: "div", className: "embedded-review", sx: {
|
|
2315
|
+
a: {
|
|
2316
|
+
textUnderlineOffset: '2px',
|
|
2317
|
+
textDecoration: 'underline',
|
|
2318
|
+
},
|
|
2319
|
+
} },
|
|
2320
|
+
React__default.createElement("div", { dangerouslySetInnerHTML: {
|
|
2321
|
+
__html: t('toolPage.toolReviewer', {
|
|
2322
|
+
expert_name: `<a href="${medicalReview.link}">${medicalReview.reviewer.trim()}</a>`,
|
|
2323
|
+
date: medicalReview.date,
|
|
2324
|
+
}),
|
|
2325
|
+
} }))) : null;
|
|
2326
|
+
return (React__default.createElement(StyledContainer, { className: className, style: style, "data-site": siteType, "data-banner-color": bannerColor ||
|
|
2327
|
+
(isMarryBaby
|
|
2328
|
+
? theme.colors.mb[1]
|
|
2329
|
+
: isPregTool
|
|
2330
|
+
? theme.colors.pink[1]
|
|
2331
|
+
: theme.colors.blue[1]) },
|
|
2332
|
+
React__default.createElement(StyledWrapper$1, null,
|
|
2333
|
+
React__default.createElement(Flex, { gap: rem(24), align: 'center', justify: 'space-between', sx: { padding: rem(16), gap: rem(24), '.heading': {} } },
|
|
2334
|
+
React__default.createElement(Box, null,
|
|
2335
|
+
React__default.createElement(Text, { size: isMarryBaby ? 'h4' : 'h3', as: headingAs, className: 'heading' }, heading),
|
|
2336
|
+
medicalReview && (React__default.createElement(Text, { size: "n1", as: "div" }, medicalReviewEle))),
|
|
2337
|
+
React__default.createElement(Flex, { justify: 'center', align: 'center', sx: (theme) => ({
|
|
2338
|
+
width: rem(80),
|
|
2339
|
+
height: rem(80),
|
|
2340
|
+
borderRadius: isMarryBaby ? '24px' : '50%',
|
|
2341
|
+
backgroundColor: '#fff',
|
|
2342
|
+
flexShrink: 0,
|
|
2343
|
+
img: {
|
|
2344
|
+
maxWidth: rem(48),
|
|
2345
|
+
maxHeight: rem(48),
|
|
2346
|
+
},
|
|
2347
|
+
[theme.fn.smallerThan('sm')]: {
|
|
2348
|
+
width: rem(64),
|
|
2349
|
+
height: rem(64),
|
|
2350
|
+
img: {
|
|
2351
|
+
maxWidth: rem(40),
|
|
2352
|
+
maxHeight: rem(40),
|
|
2353
|
+
},
|
|
2354
|
+
},
|
|
2355
|
+
}) }, icon)))));
|
|
2356
|
+
};
|
|
2357
|
+
|
|
2358
|
+
var useStyles$2 = createStyles(() => {
|
|
2359
|
+
return {
|
|
2360
|
+
root: {
|
|
2361
|
+
borderTopLeftRadius: 'inherit',
|
|
2362
|
+
borderTopRightRadius: 'inherit',
|
|
2363
|
+
},
|
|
2364
|
+
};
|
|
2365
|
+
});
|
|
2366
|
+
|
|
2367
|
+
const CardWrapperContext = createContext({});
|
|
2368
|
+
|
|
2369
|
+
const Banner = (_a) => {
|
|
2370
|
+
var { styles, classNames, className } = _a, rest = __rest(_a, ["styles", "classNames", "className"]);
|
|
2371
|
+
const { classes, cx } = useStyles$2(undefined, {
|
|
2372
|
+
name: 'HealthToolCardWrapper__Banner',
|
|
2373
|
+
styles,
|
|
2374
|
+
classNames,
|
|
2375
|
+
});
|
|
2376
|
+
const { isPregTool } = useContext(CardWrapperContext);
|
|
2377
|
+
return (React__default.createElement(ToolsBannerCard, Object.assign({ isPregTool: isPregTool, className: cx(className, classes.root) }, rest)));
|
|
2378
|
+
};
|
|
2379
|
+
|
|
2380
|
+
var useStyles$1 = createStyles(() => {
|
|
2381
|
+
return {
|
|
2382
|
+
root: {
|
|
2383
|
+
padding: rem(16),
|
|
2384
|
+
},
|
|
2385
|
+
};
|
|
2386
|
+
});
|
|
2387
|
+
|
|
2388
|
+
const Body = (_a) => {
|
|
2389
|
+
var { children, styles, classNames, className } = _a, rest = __rest(_a, ["children", "styles", "classNames", "className"]);
|
|
2390
|
+
const { classes, cx } = useStyles$1(undefined, {
|
|
2391
|
+
name: 'HealthToolCardWrapper',
|
|
2392
|
+
styles,
|
|
2393
|
+
classNames,
|
|
2394
|
+
});
|
|
2395
|
+
return (React__default.createElement(Box, Object.assign({ className: cx(className, classes.root) }, rest), children));
|
|
2396
|
+
};
|
|
2397
|
+
|
|
2398
|
+
var useStyles = createStyles((theme, { isPregTool }) => {
|
|
2399
|
+
const isMarryBaby = theme.other.template === 'mb';
|
|
2400
|
+
return {
|
|
2401
|
+
root: {
|
|
2402
|
+
display: 'flex',
|
|
2403
|
+
flexDirection: 'column',
|
|
2404
|
+
borderRadius: rem(isMarryBaby ? 16 : 8),
|
|
2405
|
+
backgroundColor: '#fff',
|
|
2406
|
+
border: `1px solid ${isMarryBaby
|
|
2407
|
+
? theme.colors.mb[2]
|
|
2408
|
+
: isPregTool
|
|
2409
|
+
? theme.colors.pink[1]
|
|
2410
|
+
: theme.colors.blue[2]}`,
|
|
2411
|
+
},
|
|
2412
|
+
row: {
|
|
2413
|
+
display: 'flex',
|
|
2414
|
+
alignItems: 'stretch',
|
|
2415
|
+
justifyContent: 'space-between',
|
|
2416
|
+
gap: rem(16),
|
|
2417
|
+
},
|
|
2418
|
+
labelWrapper: {
|
|
2419
|
+
flex: '1 1 0px',
|
|
2420
|
+
display: 'flex',
|
|
2421
|
+
alignItems: 'center',
|
|
2422
|
+
borderBottom: `1px solid ${theme.colors.neutral[1]}`,
|
|
2423
|
+
},
|
|
2424
|
+
label: {
|
|
2425
|
+
fontSize: rem(14),
|
|
2426
|
+
color: theme.colors.gray[6],
|
|
2427
|
+
},
|
|
2428
|
+
control: {
|
|
2429
|
+
width: rem(180),
|
|
2430
|
+
flexShrink: 1,
|
|
2431
|
+
'&.error': {
|
|
2432
|
+
'button, input': {
|
|
2433
|
+
borderColor: theme.colors.red[7],
|
|
2434
|
+
},
|
|
2435
|
+
},
|
|
2436
|
+
},
|
|
2437
|
+
radioLabel: {
|
|
2438
|
+
fontSize: rem(16),
|
|
2439
|
+
},
|
|
2440
|
+
radioRoot: {
|
|
2441
|
+
padding: `${rem(10)} 0`,
|
|
2442
|
+
margin: 0,
|
|
2443
|
+
},
|
|
2444
|
+
bmiVal: {
|
|
2445
|
+
display: 'inline-block',
|
|
2446
|
+
},
|
|
2447
|
+
inputWithUnit__wrapper: {
|
|
2448
|
+
position: 'relative',
|
|
2449
|
+
},
|
|
2450
|
+
inputWithUnit__unit: {
|
|
2451
|
+
position: 'absolute',
|
|
2452
|
+
top: 0,
|
|
2453
|
+
right: 0,
|
|
2454
|
+
bottom: 0,
|
|
2455
|
+
paddingRight: rem(10),
|
|
2456
|
+
display: 'flex',
|
|
2457
|
+
alignItems: 'center',
|
|
2458
|
+
},
|
|
2459
|
+
inputWithUnit__unitText: {
|
|
2460
|
+
color: theme.colors.gray[6],
|
|
2461
|
+
},
|
|
2462
|
+
inputWithUnit__input: {
|
|
2463
|
+
input: {
|
|
2464
|
+
paddingRight: rem(30),
|
|
2465
|
+
'::-webkit-inner-spin-button': { '-webkit-appearance': 'none' },
|
|
2466
|
+
},
|
|
2467
|
+
},
|
|
2468
|
+
submitBtn: {},
|
|
2469
|
+
switchRoot: {
|
|
2470
|
+
padding: '16px 0',
|
|
2471
|
+
},
|
|
2472
|
+
};
|
|
2473
|
+
});
|
|
2474
|
+
|
|
2475
|
+
const _HealthToolCardWrapper = (_a) => {
|
|
2476
|
+
var { children, styles, classNames, className, isPregTool } = _a, rest = __rest(_a, ["children", "styles", "classNames", "className", "isPregTool"]);
|
|
2477
|
+
const { classes, cx } = useStyles({ isPregTool }, {
|
|
2478
|
+
name: 'HealthToolCardWrapper',
|
|
2479
|
+
styles,
|
|
2480
|
+
classNames,
|
|
2481
|
+
});
|
|
2482
|
+
return (React__default.createElement(CardWrapperContext.Provider, { value: {
|
|
2483
|
+
isPregTool,
|
|
2484
|
+
} },
|
|
2485
|
+
React__default.createElement(Box, Object.assign({ className: cx(className, classes.root) }, rest), children)));
|
|
2486
|
+
};
|
|
2487
|
+
const HealthToolCardWrapper = _HealthToolCardWrapper;
|
|
2488
|
+
HealthToolCardWrapper.Body = Body;
|
|
2489
|
+
HealthToolCardWrapper.Banner = Banner;
|
|
2490
|
+
|
|
2491
|
+
const DueDateCardEmbed = (_a) => {
|
|
2492
|
+
var _b;
|
|
2493
|
+
var { dueDatePageInfo, expertUrl, formProps } = _a, props = __rest(_a, ["dueDatePageInfo", "expertUrl", "formProps"]);
|
|
2494
|
+
const { t } = useTranslations();
|
|
2495
|
+
return (React__default.createElement(HealthToolCardWrapper, Object.assign({ isPregTool: true }, props),
|
|
2496
|
+
React__default.createElement(HealthToolCardWrapper.Banner, { color: "pink", icon: React__default.createElement("img", { alt: "health-tool-icon", src: (dueDatePageInfo === null || dueDatePageInfo === void 0 ? void 0 : dueDatePageInfo.featured_image) ||
|
|
2497
|
+
CommonGAssets.getAssetPath('health-tools/due-date-icon.svg'), loading: "lazy" }), heading: t('healthTools.dueDateCalculator'), medicalReview: {
|
|
2498
|
+
link: expertUrl,
|
|
2499
|
+
reviewer: (_b = dueDatePageInfo === null || dueDatePageInfo === void 0 ? void 0 : dueDatePageInfo.reviewed_by) === null || _b === void 0 ? void 0 : _b.display_name,
|
|
2500
|
+
date: dueDatePageInfo === null || dueDatePageInfo === void 0 ? void 0 : dueDatePageInfo.reviewed_date,
|
|
2501
|
+
} }),
|
|
2502
|
+
React__default.createElement(HealthToolCardWrapper.Body, null,
|
|
2503
|
+
React__default.createElement(DueDateForm, Object.assign({}, formProps)))));
|
|
2504
|
+
};
|
|
2505
|
+
|
|
2506
|
+
const BMICardEmbed = (_a) => {
|
|
2507
|
+
var _b, _c, _d;
|
|
2508
|
+
var { bmiContent, bmiGenerated, bmiUnit, formProps } = _a, props = __rest(_a, ["bmiContent", "bmiGenerated", "bmiUnit", "formProps"]);
|
|
2509
|
+
const { t } = useTranslations();
|
|
2510
|
+
return (React__default.createElement(HealthToolCardWrapper, Object.assign({}, props),
|
|
2511
|
+
React__default.createElement(HealthToolCardWrapper.Banner, { icon: React__default.createElement("img", { alt: "health-tool-icon", src: (bmiContent === null || bmiContent === void 0 ? void 0 : bmiContent.featured_image) ||
|
|
2512
|
+
CommonGAssets.getAssetPath('health-tools/bmi.svg'), loading: "lazy" }), heading: t('bmi.heading'), medicalReview: {
|
|
2513
|
+
link: (_b = bmiContent === null || bmiContent === void 0 ? void 0 : bmiContent.reviewBy) === null || _b === void 0 ? void 0 : _b.link,
|
|
2514
|
+
reviewer: (_c = bmiContent === null || bmiContent === void 0 ? void 0 : bmiContent.reviewBy) === null || _c === void 0 ? void 0 : _c.reviewer,
|
|
2515
|
+
date: (_d = bmiContent === null || bmiContent === void 0 ? void 0 : bmiContent.reviewBy) === null || _d === void 0 ? void 0 : _d.date,
|
|
2516
|
+
} }),
|
|
2517
|
+
React__default.createElement(HealthToolCardWrapper.Body, null,
|
|
2518
|
+
React__default.createElement(BmiForm, Object.assign({ bmiGenerated: bmiGenerated, bmiUnit: bmiUnit }, formProps)))));
|
|
2519
|
+
};
|
|
2520
|
+
|
|
2521
|
+
const BabyGrowthCardEmbed = (_a) => {
|
|
2522
|
+
var _b, _c, _d;
|
|
2523
|
+
var { babyGrowthContent, formProps } = _a, props = __rest(_a, ["babyGrowthContent", "formProps"]);
|
|
2524
|
+
return (React__default.createElement(HealthToolCardWrapper, Object.assign({}, props),
|
|
2525
|
+
React__default.createElement(HealthToolCardWrapper.Banner, { icon: React__default.createElement("img", { className: "embedded-icon", alt: "health-tool-icon", src: (babyGrowthContent === null || babyGrowthContent === void 0 ? void 0 : babyGrowthContent.featuredImage) ||
|
|
2526
|
+
CommonGAssets.getAssetPath('health-tools/toolsIconBabyGrowth.svg'), loading: "lazy" }), heading: (babyGrowthContent === null || babyGrowthContent === void 0 ? void 0 : babyGrowthContent.title) || '', medicalReview: {
|
|
2527
|
+
link: (_b = babyGrowthContent === null || babyGrowthContent === void 0 ? void 0 : babyGrowthContent.reviewBy) === null || _b === void 0 ? void 0 : _b.link,
|
|
2528
|
+
reviewer: (_c = babyGrowthContent === null || babyGrowthContent === void 0 ? void 0 : babyGrowthContent.reviewBy) === null || _c === void 0 ? void 0 : _c.reviewer.trim(),
|
|
2529
|
+
date: (_d = babyGrowthContent === null || babyGrowthContent === void 0 ? void 0 : babyGrowthContent.reviewBy) === null || _d === void 0 ? void 0 : _d.date,
|
|
2530
|
+
} }),
|
|
2531
|
+
React__default.createElement(HealthToolCardWrapper.Body, null,
|
|
2532
|
+
React__default.createElement(BabyGrowthForm, Object.assign({}, formProps)))));
|
|
2533
|
+
};
|
|
2534
|
+
|
|
2535
|
+
const BabyPoopEmbed = (_a) => {
|
|
2536
|
+
var { babyPoopPage, formProps } = _a, props = __rest(_a, ["babyPoopPage", "formProps"]);
|
|
2537
|
+
const { reviewedBy, reviewedDate } = babyPoopPage || {};
|
|
2538
|
+
return (React__default.createElement(HealthToolCardWrapper, Object.assign({}, props),
|
|
2539
|
+
React__default.createElement(HealthToolCardWrapper.Banner, { icon: React__default.createElement("img", { alt: "health-tool-icon", src: babyPoopPage === null || babyPoopPage === void 0 ? void 0 : babyPoopPage.featuredImage, loading: "lazy" }), heading: babyPoopPage.title, medicalReview: {
|
|
2540
|
+
link: reviewedBy === null || reviewedBy === void 0 ? void 0 : reviewedBy.profileUrl,
|
|
2541
|
+
reviewer: reviewedBy === null || reviewedBy === void 0 ? void 0 : reviewedBy.displayName,
|
|
2542
|
+
date: reviewedDate,
|
|
2543
|
+
} }),
|
|
2544
|
+
React__default.createElement(HealthToolCardWrapper.Body, null,
|
|
2545
|
+
React__default.createElement(BabyPoopForm, Object.assign({ babyPoopPage: babyPoopPage }, formProps)))));
|
|
2546
|
+
};
|
|
2547
|
+
|
|
2548
|
+
const THRCardEmbed = (_a) => {
|
|
2549
|
+
var _b, _c;
|
|
2550
|
+
var { thrContent, formProps } = _a, props = __rest(_a, ["thrContent", "formProps"]);
|
|
2551
|
+
const { t } = useTranslations();
|
|
2552
|
+
return (React__default.createElement(HealthToolCardWrapper, Object.assign({}, props),
|
|
2553
|
+
React__default.createElement(HealthToolCardWrapper.Banner, { icon: React__default.createElement("img", { alt: "health-tool-icon", src: (thrContent === null || thrContent === void 0 ? void 0 : thrContent.featured_image) ||
|
|
2554
|
+
CommonGAssets.getAssetPath('health-tools/target-heart-rate-icon.svg'), loading: "lazy" }), heading: t('targetHearRate.heading'), medicalReview: ((_b = thrContent === null || thrContent === void 0 ? void 0 : thrContent.reviewedBy) === null || _b === void 0 ? void 0 : _b.display_name)
|
|
2555
|
+
? {
|
|
2556
|
+
link: formatUserProfileUrl(thrContent === null || thrContent === void 0 ? void 0 : thrContent.reviewedBy),
|
|
2557
|
+
reviewer: (_c = thrContent === null || thrContent === void 0 ? void 0 : thrContent.reviewedBy) === null || _c === void 0 ? void 0 : _c.display_name,
|
|
2558
|
+
date: thrContent === null || thrContent === void 0 ? void 0 : thrContent.reviewedDate,
|
|
2559
|
+
}
|
|
2560
|
+
: undefined }),
|
|
2561
|
+
React__default.createElement(HealthToolCardWrapper.Body, null,
|
|
2562
|
+
React__default.createElement(ThrForm, Object.assign({}, formProps)))));
|
|
2563
|
+
};
|
|
2564
|
+
|
|
2565
|
+
const BMRCardEmbed = (_a) => {
|
|
2566
|
+
var _b, _c, _d;
|
|
2567
|
+
var { bmrContent, bmiGenerated, bmiUnit, formProps } = _a, props = __rest(_a, ["bmrContent", "bmiGenerated", "bmiUnit", "formProps"]);
|
|
2568
|
+
const { t } = useTranslations();
|
|
2569
|
+
return (React__default.createElement(HealthToolCardWrapper, Object.assign({}, props),
|
|
2570
|
+
React__default.createElement(HealthToolCardWrapper.Banner, { icon: React__default.createElement("img", { alt: "health-tool-icon", src: (bmrContent === null || bmrContent === void 0 ? void 0 : bmrContent.featured_image) ||
|
|
2571
|
+
CommonGAssets.getAssetPath('health-tools/bmr.svg'), loading: "lazy" }), heading: t('bmr.heading'), medicalReview: {
|
|
2572
|
+
link: (_b = bmrContent === null || bmrContent === void 0 ? void 0 : bmrContent.reviewBy) === null || _b === void 0 ? void 0 : _b.link,
|
|
2573
|
+
reviewer: (_c = bmrContent === null || bmrContent === void 0 ? void 0 : bmrContent.reviewBy) === null || _c === void 0 ? void 0 : _c.reviewer,
|
|
2574
|
+
date: (_d = bmrContent === null || bmrContent === void 0 ? void 0 : bmrContent.reviewBy) === null || _d === void 0 ? void 0 : _d.date,
|
|
2575
|
+
} }),
|
|
2576
|
+
React__default.createElement(HealthToolCardWrapper.Body, null,
|
|
2577
|
+
React__default.createElement(BmiForm, Object.assign({ bmiGenerated: bmiGenerated, bmiUnit: bmiUnit }, formProps, { submitProps: Object.assign(Object.assign({}, formProps === null || formProps === void 0 ? void 0 : formProps.submitProps), { dataEventAction: 'BMR' }) })))));
|
|
2578
|
+
};
|
|
2579
|
+
|
|
2580
|
+
const OvulationCardEmbed = (_a) => {
|
|
2581
|
+
var _b;
|
|
2582
|
+
var { ovulationPageInfo, expertUrl, formProps, isMobile } = _a, props = __rest(_a, ["ovulationPageInfo", "expertUrl", "formProps", "isMobile"]);
|
|
2583
|
+
const { t } = useTranslations();
|
|
2584
|
+
return (React__default.createElement(HealthToolCardWrapper, Object.assign({ isPregTool: true }, props),
|
|
2585
|
+
React__default.createElement(HealthToolCardWrapper.Banner, { icon: React__default.createElement("img", { alt: "health-tool-icon", src: (ovulationPageInfo === null || ovulationPageInfo === void 0 ? void 0 : ovulationPageInfo.featured_image) ||
|
|
2586
|
+
CommonGAssets.getAssetPath('health-tools/ovulation-icon.svg'), loading: "lazy" }), heading: t('healthTools.ovulationCalculator'), medicalReview: {
|
|
2587
|
+
link: expertUrl,
|
|
2588
|
+
reviewer: (_b = ovulationPageInfo === null || ovulationPageInfo === void 0 ? void 0 : ovulationPageInfo.reviewed_by) === null || _b === void 0 ? void 0 : _b.display_name,
|
|
2589
|
+
date: ovulationPageInfo === null || ovulationPageInfo === void 0 ? void 0 : ovulationPageInfo.reviewed_date,
|
|
2590
|
+
} }),
|
|
2591
|
+
React__default.createElement(HealthToolCardWrapper.Body, null,
|
|
2592
|
+
React__default.createElement(OvulationForm, Object.assign({ isMobile: isMobile }, formProps)))));
|
|
2593
|
+
};
|
|
2594
|
+
|
|
2595
|
+
const BabyVaccineCardEmbed = (_a) => {
|
|
2596
|
+
var _b, _c, _d;
|
|
2597
|
+
var { babyVaccineContent, formProps } = _a, props = __rest(_a, ["babyVaccineContent", "formProps"]);
|
|
2598
|
+
const { t } = useTranslations();
|
|
2599
|
+
return (React__default.createElement(HealthToolCardWrapper, Object.assign({}, props),
|
|
2600
|
+
React__default.createElement(HealthToolCardWrapper.Banner, { icon: React__default.createElement("img", { alt: "health-tool-icon", src: (babyVaccineContent === null || babyVaccineContent === void 0 ? void 0 : babyVaccineContent.featuredImage) ||
|
|
2601
|
+
CommonGAssets.getAssetPath('health-tools/baby-vaccine-icon.svg'), loading: "lazy" }), heading: t('babyVaccineTool.heading'), medicalReview: {
|
|
2602
|
+
link: ((_b = babyVaccineContent === null || babyVaccineContent === void 0 ? void 0 : babyVaccineContent.reviewBy) === null || _b === void 0 ? void 0 : _b.link) || '',
|
|
2603
|
+
reviewer: ((_c = babyVaccineContent === null || babyVaccineContent === void 0 ? void 0 : babyVaccineContent.reviewBy) === null || _c === void 0 ? void 0 : _c.reviewer) || '',
|
|
2604
|
+
date: ((_d = babyVaccineContent === null || babyVaccineContent === void 0 ? void 0 : babyVaccineContent.reviewBy) === null || _d === void 0 ? void 0 : _d.date) || '',
|
|
2605
|
+
} }),
|
|
2606
|
+
React__default.createElement(HealthToolCardWrapper.Body, null,
|
|
2607
|
+
React__default.createElement(BabyVaccineForm, Object.assign({}, formProps)))));
|
|
2608
|
+
};
|
|
2609
|
+
|
|
2610
|
+
const PWGCardEmbed = (_a) => {
|
|
2611
|
+
var _b;
|
|
2612
|
+
var { pwgContent, formProps } = _a, props = __rest(_a, ["pwgContent", "formProps"]);
|
|
2613
|
+
const { t } = useTranslations();
|
|
2614
|
+
return (React__default.createElement(HealthToolCardWrapper, Object.assign({ isPregTool: true }, props),
|
|
2615
|
+
React__default.createElement(HealthToolCardWrapper.Banner, { icon: React__default.createElement("img", { alt: "health-tool-icon", src: (pwgContent === null || pwgContent === void 0 ? void 0 : pwgContent.featuredImage) ||
|
|
2616
|
+
CommonGAssets.getAssetPath('health-tools/pwg-icon.svg'), loading: "lazy" }), heading: t('pregnancyWeightGain.heading'), medicalReview: {
|
|
2617
|
+
link: formatUserProfileUrl(pwgContent === null || pwgContent === void 0 ? void 0 : pwgContent.reviewedBy),
|
|
2618
|
+
reviewer: (_b = pwgContent === null || pwgContent === void 0 ? void 0 : pwgContent.reviewedBy) === null || _b === void 0 ? void 0 : _b.display_name,
|
|
2619
|
+
date: pwgContent === null || pwgContent === void 0 ? void 0 : pwgContent.reviewedDate,
|
|
2620
|
+
} }),
|
|
2621
|
+
React__default.createElement(HealthToolCardWrapper.Body, null,
|
|
2622
|
+
React__default.createElement(PWGForm, Object.assign({}, formProps)))));
|
|
2623
|
+
};
|
|
2624
|
+
|
|
2625
|
+
const StyledCalendarWrapper$1 = styled.div `
|
|
2626
|
+
flex: 1;
|
|
2627
|
+
`;
|
|
2628
|
+
const StyledCalendarCellsWrapper = styled.div `
|
|
2629
|
+
padding: 0 10px;
|
|
2630
|
+
`;
|
|
2631
|
+
const StyledCalendarHead = styled.div `
|
|
2632
|
+
display: flex;
|
|
2633
|
+
height: 80px;
|
|
2634
|
+
align-items: center;
|
|
2635
|
+
.calendar-month {
|
|
2636
|
+
font-size: 16px;
|
|
2637
|
+
flex: 1;
|
|
2638
|
+
text-align: center;
|
|
2639
|
+
strong {
|
|
2640
|
+
margin-left: 5px;
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
${MediaQueries.mbDown} {
|
|
2644
|
+
height: 70px;
|
|
2645
|
+
}
|
|
2646
|
+
`;
|
|
2647
|
+
const StyledCalendarGrid = styled.div `
|
|
2648
|
+
display: grid;
|
|
2649
|
+
grid-template-columns: repeat(7, 1fr);
|
|
2650
|
+
row-gap: 2px;
|
|
2651
|
+
`;
|
|
2652
|
+
const StyledCalendarDaysOfWeek = styled(StyledCalendarGrid) `
|
|
2653
|
+
margin-bottom: 8px;
|
|
2654
|
+
`;
|
|
2655
|
+
styled.div `
|
|
2656
|
+
height: 40px;
|
|
2657
|
+
width: 40px;
|
|
2658
|
+
display: flex;
|
|
2659
|
+
align-items: center;
|
|
2660
|
+
justify-content: center;
|
|
2661
|
+
`;
|
|
2662
|
+
const StyledCalendarDayLabel = styled.div `
|
|
2663
|
+
font-size: 14px;
|
|
2664
|
+
display: flex;
|
|
2665
|
+
justify-content: center;
|
|
2666
|
+
align-items: center;
|
|
2667
|
+
color: 1px solid ${theme.colors.gray800};
|
|
2668
|
+
font-weight: 300;
|
|
2669
|
+
`;
|
|
2670
|
+
const StyledCalendarMonthSeparator = styled.div `
|
|
2671
|
+
width: 18px;
|
|
2672
|
+
position: relative;
|
|
2673
|
+
&::before {
|
|
2674
|
+
content: '';
|
|
2675
|
+
position: absolute;
|
|
2676
|
+
inset: 16px 0 0 0;
|
|
2677
|
+
width: 1px;
|
|
2678
|
+
left: 50%;
|
|
2679
|
+
right: 50%;
|
|
2680
|
+
background: ${theme.colors.neutral100};
|
|
2681
|
+
}
|
|
2682
|
+
`;
|
|
2683
|
+
const StyledCalendarDaysWrapper = styled.div `
|
|
2684
|
+
margin: 0 auto;
|
|
2685
|
+
`;
|
|
2686
|
+
const StyledCalendarMonthWrapper = styled.div `
|
|
2687
|
+
position: relative;
|
|
2688
|
+
`;
|
|
2689
|
+
const StyledCalendarDateGrid = StyledCalendarGrid;
|
|
2690
|
+
const StyledCalendarDayNumberWrapper = styled.div `
|
|
2691
|
+
position: relative;
|
|
2692
|
+
display: flex;
|
|
2693
|
+
justify-content: center;
|
|
2694
|
+
align-items: center;
|
|
2695
|
+
height: 34px;
|
|
2696
|
+
${MediaQueries.mbUp} {
|
|
2697
|
+
height: 38px;
|
|
2698
|
+
}
|
|
2699
|
+
&[data-is-disabled='true'] {
|
|
2700
|
+
opacity: 0.3;
|
|
2701
|
+
}
|
|
2702
|
+
&[data-in-range='true']:not([data-is-from='true'][data-is-to='true']) {
|
|
2703
|
+
background-color: ${theme.colors.gray100};
|
|
2704
|
+
}
|
|
2705
|
+
&:before {
|
|
2706
|
+
position: absolute;
|
|
2707
|
+
top: 0;
|
|
2708
|
+
bottom: 0;
|
|
2709
|
+
right: 0;
|
|
2710
|
+
background-color: ${theme.colors.gray100};
|
|
2711
|
+
}
|
|
2712
|
+
&[data-is-from='true'][data-in-range='true'][data-is-to='false'] {
|
|
2713
|
+
background-color: transparent;
|
|
2714
|
+
&:before {
|
|
2715
|
+
content: '';
|
|
2716
|
+
left: 50%;
|
|
2717
|
+
right: 0;
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
|
|
2721
|
+
&[data-is-to='true'][data-in-range='true'][data-is-from='false'],
|
|
2722
|
+
&:hover[data-in-range='true']:is([data-has-range='false'] &) {
|
|
2723
|
+
background-color: transparent;
|
|
2724
|
+
&:before {
|
|
2725
|
+
content: '';
|
|
2726
|
+
left: 0;
|
|
2727
|
+
right: 50%;
|
|
2728
|
+
}
|
|
2729
|
+
}
|
|
2730
|
+
`;
|
|
2731
|
+
const StyledCalendarDayNumber = styled.div `
|
|
2732
|
+
position: relative;
|
|
2733
|
+
font-weight: 600;
|
|
2734
|
+
${MediaQueries.mbDown} {
|
|
2735
|
+
width: 32px;
|
|
2736
|
+
height: 32px;
|
|
2737
|
+
}
|
|
2738
|
+
${MediaQueries.mbUp} {
|
|
2739
|
+
width: 36px;
|
|
2740
|
+
height: 36px;
|
|
2741
|
+
}
|
|
2742
|
+
display: flex;
|
|
2743
|
+
justify-content: center;
|
|
2744
|
+
align-items: center;
|
|
2745
|
+
cursor: pointer;
|
|
2746
|
+
[data-is-disabled='true'] & {
|
|
2747
|
+
cursor: not-allowed;
|
|
2748
|
+
}
|
|
2749
|
+
line-height: 1;
|
|
2750
|
+
color: 1px solid ${theme.colors.gray800};
|
|
2751
|
+
[data-is-selected='true'] &,
|
|
2752
|
+
[data-is-today='true'] &,
|
|
2753
|
+
[data-is-selected='false']:hover & {
|
|
2754
|
+
border-radius: 32px;
|
|
2755
|
+
}
|
|
2756
|
+
[data-is-selected='true'] & {
|
|
2757
|
+
background-color: ${theme.colors.primaryBase};
|
|
2758
|
+
color: white;
|
|
2759
|
+
}
|
|
2760
|
+
[data-is-selected='false']:hover & {
|
|
2761
|
+
background-color: ${theme.colors.primary50};
|
|
2762
|
+
}
|
|
2763
|
+
[data-is-today='true'][data-is-selected='false'] & {
|
|
2764
|
+
background-color: transparent;
|
|
2765
|
+
border-radius: 32px;
|
|
2766
|
+
border: 1px solid ${theme.colors.primaryBase};
|
|
2767
|
+
}
|
|
2768
|
+
`;
|
|
2769
|
+
|
|
2770
|
+
function handleClickDay(d, range) {
|
|
2771
|
+
if (!range.from && !range.to) {
|
|
2772
|
+
return Object.assign(Object.assign({}, range), { from: d });
|
|
2773
|
+
}
|
|
2774
|
+
if (range.from && range.to) {
|
|
2775
|
+
return { from: d, to: null };
|
|
2776
|
+
}
|
|
2777
|
+
if (range.from) {
|
|
2778
|
+
if (isBefore(d, range.from)) {
|
|
2779
|
+
return Object.assign(Object.assign({}, range), { from: d });
|
|
2780
|
+
}
|
|
2781
|
+
else {
|
|
2782
|
+
return Object.assign(Object.assign({}, range), { to: d });
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
return range;
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2788
|
+
const dateLocaleByLocale = {
|
|
2789
|
+
'en-PH': enUS,
|
|
2790
|
+
'vi-VN': vi,
|
|
2791
|
+
'zh-TW': zhTW,
|
|
2792
|
+
'id-ID': id,
|
|
2793
|
+
};
|
|
2794
|
+
function DateRangePickerCalendar(props) {
|
|
2795
|
+
const { value = { from: null, to: null } } = props;
|
|
2796
|
+
const [hoverDay, setHoverDay] = useState(null);
|
|
2797
|
+
const { isMobile } = useScreenSize();
|
|
2798
|
+
const [range, setRange] = useState(() => value);
|
|
2799
|
+
const [date, setDate] = useState(() => { var _a; return startOfMonth((_a = value.from) !== null && _a !== void 0 ? _a : new Date()); });
|
|
2800
|
+
const nextMonth = useMemo(() => addMonths(date, 1), [date]);
|
|
2801
|
+
function goToPreviousMonth() {
|
|
2802
|
+
setDate((d) => subMonths(d, 1));
|
|
2803
|
+
}
|
|
2804
|
+
function goToNextMonth() {
|
|
2805
|
+
setDate((d) => addMonths(d, 1));
|
|
2806
|
+
}
|
|
2807
|
+
const monthProps = Object.assign(Object.assign({}, props), { goToNextMonth,
|
|
2808
|
+
goToPreviousMonth,
|
|
2809
|
+
range,
|
|
2810
|
+
setRange,
|
|
2811
|
+
hoverDay,
|
|
2812
|
+
setHoverDay });
|
|
2813
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
2814
|
+
React__default.createElement(DateRangePickerCalendarMonth, Object.assign({}, monthProps, { date: date })),
|
|
2815
|
+
!isMobile && React__default.createElement(StyledCalendarMonthSeparator, null),
|
|
2816
|
+
!isMobile && (React__default.createElement(DateRangePickerCalendarMonth, Object.assign({}, monthProps, { date: nextMonth })))));
|
|
2817
|
+
}
|
|
2818
|
+
function DateRangePickerCalendarMonth({ date,
|
|
2819
|
+
// value,
|
|
2820
|
+
range, setRange, onChange, goToPreviousMonth, goToNextMonth, minDate, maxDate, close = () => undefined, autoClose = false, hoverDay, setHoverDay, }) {
|
|
2821
|
+
const { locale } = useTranslations();
|
|
2822
|
+
const dateLocale = useMemo(() => { var _a; return (_a = dateLocaleByLocale[locale]) !== null && _a !== void 0 ? _a : dateLocaleByLocale['en-PH']; }, [locale]);
|
|
2823
|
+
const monthLabel = useMemo(() => format(date, 'MMMM', { locale: dateLocale }), [date, dateLocale]);
|
|
2824
|
+
const weekDays = useMemo(() => {
|
|
2825
|
+
if (!dateLocale) {
|
|
2826
|
+
return [];
|
|
2827
|
+
}
|
|
2828
|
+
return [1, 2, 3, 4, 5, 6, 0].map((i) => dateLocale.localize.day(i, { width: 'narrow' }));
|
|
2829
|
+
}, [dateLocale]);
|
|
2830
|
+
useEffect(() => {
|
|
2831
|
+
if (range.from && range.to) {
|
|
2832
|
+
onChange(range);
|
|
2833
|
+
}
|
|
2834
|
+
}, [range]);
|
|
2835
|
+
function renderWeekDays() {
|
|
2836
|
+
return (React__default.createElement(StyledCalendarDaysOfWeek, null, weekDays.map((d, i) => (React__default.createElement(StyledCalendarDayLabel, { key: `${d}-${i}` }, d)))));
|
|
2837
|
+
}
|
|
2838
|
+
function renderMonth() {
|
|
2839
|
+
const year = date.getFullYear();
|
|
2840
|
+
const monthIndex = date.getMonth();
|
|
2841
|
+
const daysInMonth = getDaysInMonth(date);
|
|
2842
|
+
const days = [];
|
|
2843
|
+
for (let i = 1; i <= daysInMonth; i++) {
|
|
2844
|
+
days.push(new Date(year, monthIndex, i));
|
|
2845
|
+
}
|
|
2846
|
+
const weekDayIndex = days[0] ? days[0].getDay() : 0;
|
|
2847
|
+
if (weekDayIndex !== 1) {
|
|
2848
|
+
const idx = weekDayIndex === 0 ? 6 : weekDayIndex - 1;
|
|
2849
|
+
for (let i = 0; i < idx; i++) {
|
|
2850
|
+
days.unshift(null);
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2853
|
+
return (React__default.createElement(StyledCalendarMonthWrapper, { key: `month-${monthIndex}`, "data-month-index": monthIndex, "data-has-range": Boolean(range.from && range.to) },
|
|
2854
|
+
React__default.createElement(StyledCalendarDaysWrapper, null,
|
|
2855
|
+
React__default.createElement(StyledCalendarDateGrid, null, days.map(renderDay)))));
|
|
2856
|
+
}
|
|
2857
|
+
function renderDay(d, index) {
|
|
2858
|
+
if (d === null) {
|
|
2859
|
+
return (React__default.createElement(StyledCalendarDayNumberWrapper, { key: `idx-${index}`, "data-empty": "true" }));
|
|
2860
|
+
}
|
|
2861
|
+
const day = d.getDate();
|
|
2862
|
+
const isDateToday = isToday(d);
|
|
2863
|
+
const isFrom = range.from ? isSameDay(range.from, d) : false;
|
|
2864
|
+
const isTo = range.to ? isSameDay(range.to, d) : false;
|
|
2865
|
+
const isSelected = isFrom || isTo;
|
|
2866
|
+
const hasHoveredDay = hoverDay !== null;
|
|
2867
|
+
let inRange = false;
|
|
2868
|
+
if (hasHoveredDay &&
|
|
2869
|
+
range.from &&
|
|
2870
|
+
isBefore(range.from, hoverDay) &&
|
|
2871
|
+
!range.to) {
|
|
2872
|
+
inRange = isWithinInterval(d, { start: range.from, end: hoverDay });
|
|
2873
|
+
}
|
|
2874
|
+
else if (range.from && range.to) {
|
|
2875
|
+
inRange = isWithinInterval(d, { start: range.from, end: range.to });
|
|
2876
|
+
}
|
|
2877
|
+
let isDisabled = false;
|
|
2878
|
+
if (minDate && maxDate) {
|
|
2879
|
+
isDisabled = !isWithinInterval(d, { start: minDate, end: maxDate });
|
|
2880
|
+
}
|
|
2881
|
+
else if (minDate) {
|
|
2882
|
+
isDisabled = isBefore(d, minDate);
|
|
2883
|
+
}
|
|
2884
|
+
else if (maxDate) {
|
|
2885
|
+
isDisabled = isAfter(d, maxDate);
|
|
2886
|
+
}
|
|
2887
|
+
return (React__default.createElement(StyledCalendarDayNumberWrapper, { key: day, "data-is-today": isDateToday, "data-is-past": !isDateToday && isPast(d), "data-is-selected": isSelected, "data-is-disabled": isDisabled, "data-in-range": inRange, "data-is-from": isFrom, "data-is-to": isTo, onMouseEnter: () => {
|
|
2888
|
+
setHoverDay(d);
|
|
2889
|
+
}, onMouseLeave: () => setHoverDay(null), onClick: () => {
|
|
2890
|
+
if (isDisabled) {
|
|
2891
|
+
return;
|
|
2892
|
+
}
|
|
2893
|
+
setRange((r) => {
|
|
2894
|
+
if (autoClose && range.from && !range.to) {
|
|
2895
|
+
close();
|
|
2896
|
+
}
|
|
2897
|
+
return handleClickDay(d, r);
|
|
2898
|
+
});
|
|
2899
|
+
} },
|
|
2900
|
+
React__default.createElement(StyledCalendarDayNumber, { onClick: () => undefined },
|
|
2901
|
+
React__default.createElement("p", null, day))));
|
|
2902
|
+
}
|
|
2903
|
+
return (React__default.createElement(StyledCalendarWrapper$1, { className: "calendar-wrapper" },
|
|
2904
|
+
React__default.createElement(StyledCalendarHead, null,
|
|
2905
|
+
React__default.createElement(Button, { onClick: goToPreviousMonth, size: "md", color: "ghost", icon: React__default.createElement("img", { src: CommonGAssets.getAssetPath('calendarArrowLeft.svg'), loading: "lazy" }) }),
|
|
2906
|
+
React__default.createElement("div", { className: "calendar-month" },
|
|
2907
|
+
monthLabel,
|
|
2908
|
+
React__default.createElement("strong", null, format(date, 'yyyy'))),
|
|
2909
|
+
React__default.createElement(Button, { onClick: goToNextMonth, size: "md", color: "ghost", icon: React__default.createElement("img", { src: CommonGAssets.getAssetPath('calendarArrowRight.svg'), loading: "lazy" }) })),
|
|
2910
|
+
React__default.createElement(StyledCalendarCellsWrapper, null,
|
|
2911
|
+
React__default.createElement("div", null, renderWeekDays()),
|
|
2912
|
+
React__default.createElement("div", null, renderMonth()))));
|
|
2913
|
+
}
|
|
2914
|
+
|
|
2915
|
+
const StyledWrapper = styled.div `
|
|
2916
|
+
display: block;
|
|
2917
|
+
position: relative;
|
|
2918
|
+
width: 270px;
|
|
2919
|
+
input {
|
|
2920
|
+
pointer-events: none;
|
|
2921
|
+
caret-color: transparent;
|
|
2922
|
+
}
|
|
2923
|
+
${MediaQueries.mbDown} {
|
|
2924
|
+
width: 100%;
|
|
2925
|
+
}
|
|
2926
|
+
`;
|
|
2927
|
+
const StyledCalendarWrapper = styled.div `
|
|
2928
|
+
display: flex;
|
|
2929
|
+
position: absolute;
|
|
2930
|
+
top: 46px;
|
|
2931
|
+
left: 0;
|
|
2932
|
+
width: 684px;
|
|
2933
|
+
border: 1px solid ${theme.colors.gray200};
|
|
2934
|
+
filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04))
|
|
2935
|
+
drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.04))
|
|
2936
|
+
drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.04));
|
|
2937
|
+
border-radius: ${theme.borderRadius};
|
|
2938
|
+
background-color: white;
|
|
2939
|
+
z-index: 100;
|
|
2940
|
+
padding-bottom: 16px;
|
|
2941
|
+
align-items: stretch;
|
|
2942
|
+
user-select: none;
|
|
2943
|
+
${MediaQueries.mbDown} {
|
|
2944
|
+
width: 100%;
|
|
2945
|
+
}
|
|
2946
|
+
`;
|
|
2947
|
+
|
|
2948
|
+
/**
|
|
2949
|
+
* @deprecated Consider to use at '@hhgtech/hhg-components/mantine'
|
|
2950
|
+
*/
|
|
2951
|
+
function DateRangePicker({ inputSize = 'md', name = 'date-range-picker', value, minDate, maxDate, onChange, className, autoClose = false, }) {
|
|
2952
|
+
if (!value) {
|
|
2953
|
+
value = { from: null, to: null };
|
|
2954
|
+
}
|
|
2955
|
+
const [opened, setOpened] = useState(false);
|
|
2956
|
+
function close() {
|
|
2957
|
+
setOpened(false);
|
|
2958
|
+
}
|
|
2959
|
+
const ref = useRef(null);
|
|
2960
|
+
useOutsideClick(ref, () => {
|
|
2961
|
+
close();
|
|
2962
|
+
});
|
|
2963
|
+
function handleChange(nextValue) {
|
|
2964
|
+
if (onChange) {
|
|
2965
|
+
onChange(nextValue);
|
|
2966
|
+
}
|
|
2967
|
+
}
|
|
2968
|
+
function formatDate(d) {
|
|
2969
|
+
return format(d, 'dd/MM/yyyy');
|
|
2970
|
+
}
|
|
2971
|
+
const fieldValue = useMemo(() => {
|
|
2972
|
+
if (value.from && value.to) {
|
|
2973
|
+
if (isSameDay(value.from, value.to)) {
|
|
2974
|
+
return formatDate(value.from);
|
|
2975
|
+
}
|
|
2976
|
+
return `${formatDate(value.from)} - ${formatDate(value.to)}`;
|
|
2977
|
+
}
|
|
2978
|
+
return '';
|
|
2979
|
+
}, [value.from, value.to]);
|
|
2980
|
+
function renderCalendar() {
|
|
2981
|
+
return (React__default.createElement(DateRangePickerCalendar, { value: value, onChange: handleChange, minDate: minDate, maxDate: maxDate, close: close, autoClose: autoClose }));
|
|
2982
|
+
}
|
|
2983
|
+
return (React__default.createElement(StyledWrapper, { className: [className, opened && 'focused'].filter(Boolean).join(' '), ref: ref },
|
|
2984
|
+
React__default.createElement("label", { htmlFor: name },
|
|
2985
|
+
React__default.createElement(PureInput, { size: inputSize, value: fieldValue, name: name, actionIcon: React__default.createElement("img", { src: CommonGAssets.getAssetPath('calendar.svg'), loading: "lazy" }), onFocus: () => setOpened(true) })),
|
|
2986
|
+
opened ? (React__default.createElement(StyledCalendarWrapper, { onMouseDown: (e) => {
|
|
2987
|
+
e.stopPropagation();
|
|
2988
|
+
} }, renderCalendar())) : null));
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2991
|
+
var styles = {"breadcrumb":"WUqzfRb","separator":"MnVGtSY","textLink":"NclbhXQ"};
|
|
2992
|
+
|
|
2993
|
+
const BreadcrumbItem = ({ LinkComponent, page, isLast, onChangePage, }) => {
|
|
2994
|
+
const { label, value, isDropdown, dropdownItems, dataEventCategory, dataEventAction, dataEventLabel, } = page;
|
|
2995
|
+
if (isDropdown) {
|
|
2996
|
+
return (React__default.createElement(Dropdown, { options: dropdownItems, placeholder: "...", id: "", placeholderIcon: null, onChange: onChangePage, className: "collapsed-breadcrumb" }));
|
|
2997
|
+
}
|
|
2998
|
+
return (React__default.createElement("div", { className: styles.textLink, title: typeof label !== 'string' ? value : label, "data-last": isLast }, LinkComponent && (React__default.createElement(LinkComponent, { "data-event-category": dataEventCategory, "data-event-action": dataEventAction, "data-event-label": dataEventLabel, href: value || '#' }, label))));
|
|
2999
|
+
};
|
|
3000
|
+
/**
|
|
3001
|
+
* @deprecated
|
|
3002
|
+
*/
|
|
3003
|
+
const Breadcrumbs = ({ className, pages, size, LinkComponent = 'a', onChangePage, separator, }) => {
|
|
3004
|
+
const mappedList = useMemo(() => pages
|
|
3005
|
+
.map((item, index) => {
|
|
3006
|
+
if (pages.length > 4) {
|
|
3007
|
+
if (index > 1 && index < pages.length - 2)
|
|
3008
|
+
return null;
|
|
3009
|
+
if (index === 1) {
|
|
3010
|
+
return Object.assign(Object.assign({}, item), { isDropdown: index === 1, dropdownItems: pages.slice(1, pages.length - 2) });
|
|
3011
|
+
}
|
|
3012
|
+
return item;
|
|
3013
|
+
}
|
|
3014
|
+
return item;
|
|
3015
|
+
})
|
|
3016
|
+
.filter(Boolean), [pages]);
|
|
3017
|
+
return (React__default.createElement("div", { "data-size": size, className: `${styles.breadcrumb} ${className || ''}` }, mappedList.map((page, index) => {
|
|
3018
|
+
const isLast = index + 1 === mappedList.length;
|
|
3019
|
+
return (React__default.createElement(Fragment, { key: index },
|
|
3020
|
+
React__default.createElement(BreadcrumbItem, { LinkComponent: LinkComponent, page: page, isLast: isLast, onChangePage: onChangePage }),
|
|
3021
|
+
!isLast &&
|
|
3022
|
+
(page.separator || separator || (React__default.createElement("div", { className: styles.separator, "data-size": size })))));
|
|
3023
|
+
})));
|
|
3024
|
+
};
|
|
3025
|
+
|
|
3026
|
+
const StyledShareContainer = styled.div `
|
|
3027
|
+
display: flex;
|
|
3028
|
+
gap: 20px;
|
|
3029
|
+
width: 100%;
|
|
3030
|
+
align-items: center;
|
|
3031
|
+
justify-content: center;
|
|
3032
|
+
.icon-group {
|
|
3033
|
+
display: flex;
|
|
3034
|
+
align-items: center;
|
|
3035
|
+
gap: 10px;
|
|
3036
|
+
a,
|
|
3037
|
+
svg {
|
|
3038
|
+
width: 32px;
|
|
3039
|
+
height: 32px;
|
|
3040
|
+
}
|
|
3041
|
+
.share {
|
|
3042
|
+
width: 32px;
|
|
3043
|
+
height: 32px;
|
|
3044
|
+
padding: 8px;
|
|
3045
|
+
|
|
3046
|
+
&:hover {
|
|
3047
|
+
background-color: ${theme.colors.neutral50};
|
|
3048
|
+
}
|
|
3049
|
+
|
|
3050
|
+
svg {
|
|
3051
|
+
margin: 0;
|
|
3052
|
+
width: 16px;
|
|
3053
|
+
height: 16px;
|
|
3054
|
+
}
|
|
3055
|
+
}
|
|
3056
|
+
}
|
|
3057
|
+
`;
|
|
3058
|
+
|
|
3059
|
+
const AttachIcon = () => {
|
|
3060
|
+
return (React__default.createElement("svg", { width: "17", height: "16", viewBox: "0 0 17 16", fill: "none" },
|
|
3061
|
+
React__default.createElement("path", { d: "M6.86364 10.6666H5.22727C4.86912 10.6666 4.51448 10.5977 4.18359 10.4637C3.8527 10.3296 3.55205 10.1332 3.2988 9.8856C2.78734 9.3855 2.5 8.70722 2.5 7.99998C2.5 7.29274 2.78734 6.61446 3.2988 6.11436C3.81026 5.61426 4.50396 5.33331 5.22727 5.33331H6.86364M9.78374 5.33331H11.7727C12.1309 5.33331 12.4855 5.40229 12.8164 5.5363C13.1473 5.67031 13.4479 5.86674 13.7012 6.11436C13.9545 6.36198 14.1553 6.65596 14.2924 6.97949C14.4295 7.30303 14.5 7.64979 14.5 7.99998C14.5 8.35017 14.4295 8.69693 14.2924 9.02047C14.1553 9.344 13.9545 9.63798 13.7012 9.8856C13.4479 10.1332 13.1473 10.3296 12.8164 10.4637C12.4855 10.5977 12.1309 10.6666 11.7727 10.6666H9.78374", stroke: "#595959", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
3062
|
+
React__default.createElement("path", { d: "M6.5 8H10.5", stroke: "#595959", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
3063
|
+
};
|
|
3064
|
+
const ShareContainer = ({ url, onCopied, locale, siteType, }) => {
|
|
3065
|
+
const { t } = useTranslations();
|
|
3066
|
+
const socialList = getSocialList({ shareUrl: url || '', locale }).filter((s) => !s.allowedLocales || s.allowedLocales.includes(locale));
|
|
3067
|
+
const copyToClipboard = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
3068
|
+
var _a;
|
|
3069
|
+
yield ((_a = navigator === null || navigator === void 0 ? void 0 : navigator.clipboard) === null || _a === void 0 ? void 0 : _a.writeText(url));
|
|
3070
|
+
onCopied === null || onCopied === void 0 ? void 0 : onCopied();
|
|
3071
|
+
});
|
|
3072
|
+
const currentUrl = useMemo(() => {
|
|
3073
|
+
if (typeof window !== 'undefined') {
|
|
3074
|
+
return window.location.href;
|
|
3075
|
+
}
|
|
3076
|
+
else
|
|
3077
|
+
return '';
|
|
3078
|
+
}, []);
|
|
3079
|
+
return (React__default.createElement(StyledShareContainer, null,
|
|
3080
|
+
React__default.createElement(Text, { size: "p3", color: theme.colors.gray800 }, t('shareContainer.title')),
|
|
3081
|
+
React__default.createElement("div", { className: "icon-group" },
|
|
3082
|
+
socialList.map((social, index) => (React__default.createElement("a", { key: index, href: social.href, target: "_blank", rel: "noreferrer", "data-event-category": "Health Tool", "data-event-action": `Social Share - ${social.name}`, "data-event-label": currentUrl }, social.icon))),
|
|
3083
|
+
React__default.createElement(Button, { theme: siteType, size: "sm", type: "button", color: "tertiary", className: "share", style: {}, icon: React__default.createElement(AttachIcon, null), onClick: copyToClipboard, "data-event-category": "Health Tool", "data-event-action": "Copy Link", "data-event-label": currentUrl }))));
|
|
3084
|
+
};
|
|
3085
|
+
|
|
3086
|
+
const StyledShareDrawer = styled(Drawer) `
|
|
3087
|
+
padding-bottom: 24px;
|
|
3088
|
+
.share-container {
|
|
3089
|
+
display: flex;
|
|
3090
|
+
flex-direction: column;
|
|
3091
|
+
gap: 24px;
|
|
3092
|
+
}
|
|
3093
|
+
.icon-group {
|
|
3094
|
+
margin-top: 12px;
|
|
3095
|
+
display: flex;
|
|
3096
|
+
gap: 16px;
|
|
3097
|
+
img {
|
|
3098
|
+
border-radius: 8px;
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
.input-group {
|
|
3102
|
+
margin-top: 8px;
|
|
3103
|
+
display: flex;
|
|
3104
|
+
gap: 8px;
|
|
3105
|
+
button {
|
|
3106
|
+
padding: 10px;
|
|
3107
|
+
&:hover {
|
|
3108
|
+
background-color: ${theme.colors.neutral50};
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
svg {
|
|
3112
|
+
margin: 0;
|
|
3113
|
+
}
|
|
3114
|
+
a,
|
|
3115
|
+
svg:not(.copy) {
|
|
3116
|
+
width: 32px;
|
|
3117
|
+
height: 32px;
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
`;
|
|
3121
|
+
|
|
3122
|
+
const CopyIcon = () => {
|
|
3123
|
+
return (React__default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", className: "copy" },
|
|
3124
|
+
React__default.createElement("path", { d: "M4 2.5C3.17125 2.5 2.5 3.17125 2.5 4V13.75C2.5 14.164 2.836 14.5 3.25 14.5C3.664 14.5 4 14.164 4 13.75V4H13.75C14.164 4 14.5 3.664 14.5 3.25C14.5 2.836 14.164 2.5 13.75 2.5H4ZM7 5.5C6.17125 5.5 5.5 6.17125 5.5 7V16C5.5 16.8287 6.17125 17.5 7 17.5H16C16.8287 17.5 17.5 16.8287 17.5 16V7C17.5 6.17125 16.8287 5.5 16 5.5H7ZM7 7H16V16H7V7Z", fill: "#595959" })));
|
|
3125
|
+
};
|
|
3126
|
+
const ShareDrawer = (_a) => {
|
|
3127
|
+
var { open, title, onClose, onCopied, onShared, url, locale } = _a, rest = __rest(_a, ["open", "title", "onClose", "onCopied", "onShared", "url", "locale"]);
|
|
3128
|
+
const { t } = useTranslations();
|
|
3129
|
+
const copyToClipboard = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
3130
|
+
var _b;
|
|
3131
|
+
yield ((_b = navigator === null || navigator === void 0 ? void 0 : navigator.clipboard) === null || _b === void 0 ? void 0 : _b.writeText(url));
|
|
3132
|
+
onCopied === null || onCopied === void 0 ? void 0 : onCopied();
|
|
3133
|
+
}), [url, onCopied]);
|
|
3134
|
+
const socialList = getSocialList({ shareUrl: url || '', locale }).filter((platform) => !platform.allowedLocales || platform.allowedLocales.includes(locale));
|
|
3135
|
+
useEffect(() => {
|
|
3136
|
+
if (open && navigator.share) {
|
|
3137
|
+
navigator
|
|
3138
|
+
.share({
|
|
3139
|
+
title: title !== null && title !== void 0 ? title : 'Read This Post',
|
|
3140
|
+
url,
|
|
3141
|
+
})
|
|
3142
|
+
.then(() => {
|
|
3143
|
+
onShared === null || onShared === void 0 ? void 0 : onShared();
|
|
3144
|
+
})
|
|
3145
|
+
.catch(() => {
|
|
3146
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
3147
|
+
});
|
|
3148
|
+
}
|
|
3149
|
+
}, [url, title, onShared, open]);
|
|
3150
|
+
if (typeof navigator !== 'undefined' && navigator.share) {
|
|
3151
|
+
return null;
|
|
3152
|
+
}
|
|
3153
|
+
else {
|
|
3154
|
+
return (React__default.createElement(StyledShareDrawer, Object.assign({ title: t('share.title'), onClose: onClose, open: open, placement: "bottom" }, rest),
|
|
3155
|
+
React__default.createElement("div", { className: "share-container" },
|
|
3156
|
+
React__default.createElement("div", { className: "icon-container" },
|
|
3157
|
+
React__default.createElement(Text, { weight: "semiBold", size: "s3", color: theme.colors.gray600 }, t('share.title')),
|
|
3158
|
+
React__default.createElement("div", { className: "icon-group" }, socialList.map((social, index) => (React__default.createElement("a", { key: index, href: social.href, target: "_blank", rel: "noreferrer" }, social.icon))))),
|
|
3159
|
+
React__default.createElement("div", { className: "link-container" },
|
|
3160
|
+
React__default.createElement(Text, { weight: "semiBold", size: "s3", color: theme.colors.gray600 }, t('share.copyLink')),
|
|
3161
|
+
React__default.createElement("div", { className: "input-group" },
|
|
3162
|
+
React__default.createElement(Input, { name: "link", size: "md", value: url, isDisabled: true }),
|
|
3163
|
+
React__default.createElement(Button, { size: "md", type: "button", color: "tertiary", icon: React__default.createElement(CopyIcon, null), onClick: copyToClipboard }))))));
|
|
3164
|
+
}
|
|
3165
|
+
};
|
|
3166
|
+
|
|
3167
|
+
const StyledFixedAdBlock = styled.div `
|
|
3168
|
+
position: fixed;
|
|
3169
|
+
z-index: 48;
|
|
3170
|
+
bottom: 0;
|
|
3171
|
+
left: 50%;
|
|
3172
|
+
width: fit-content;
|
|
3173
|
+
max-width: 100%;
|
|
3174
|
+
background: none;
|
|
3175
|
+
transform: translateX(-50%);
|
|
3176
|
+
.close-sticky-button {
|
|
3177
|
+
position: absolute;
|
|
3178
|
+
display: flex;
|
|
3179
|
+
width: 16px;
|
|
3180
|
+
height: 16px;
|
|
3181
|
+
align-items: center;
|
|
3182
|
+
justify-content: center;
|
|
3183
|
+
background: #bfbfbf;
|
|
3184
|
+
border-radius: 50%;
|
|
3185
|
+
color: white;
|
|
3186
|
+
|
|
3187
|
+
cursor: pointer;
|
|
3188
|
+
font-size: 12px;
|
|
3189
|
+
line-height: 12px;
|
|
3190
|
+
transform: translate(50%, -50%);
|
|
3191
|
+
top: 0;
|
|
3192
|
+
right: 0;
|
|
3193
|
+
}
|
|
3194
|
+
opacity: 0;
|
|
3195
|
+
pointer-events: none;
|
|
3196
|
+
&[data-visible='true'] {
|
|
3197
|
+
opacity: 1;
|
|
3198
|
+
pointer-events: auto;
|
|
3199
|
+
}
|
|
3200
|
+
`;
|
|
3201
|
+
const StyledAdContainer = styled.div `
|
|
3202
|
+
display: flex;
|
|
3203
|
+
justify-content: center;
|
|
3204
|
+
align-items: center;
|
|
3205
|
+
flex-direction: column;
|
|
3206
|
+
max-width: 100%;
|
|
3207
|
+
width: fit-content;
|
|
3208
|
+
height: fit-content;
|
|
3209
|
+
margin-inline: auto;
|
|
3210
|
+
/* margin: 1rem auto; */
|
|
3211
|
+
&[data-no-wrapper='false'] {
|
|
3212
|
+
border: 1px solid ${theme.colors.neutral50};
|
|
3213
|
+
background: ${theme.colors.neutral50};
|
|
3214
|
+
}
|
|
3215
|
+
&[data-no-wrapper='true'] {
|
|
3216
|
+
line-height: 0;
|
|
3217
|
+
}
|
|
3218
|
+
&[data-header-bottom='true'] {
|
|
3219
|
+
flex-direction: column-reverse;
|
|
3220
|
+
background: none;
|
|
3221
|
+
border: none;
|
|
3222
|
+
}
|
|
3223
|
+
`;
|
|
3224
|
+
/* background: ${theme.colors.neutral50}; */
|
|
3225
|
+
const StyledAdHeader = styled.div `
|
|
3226
|
+
width: 100%;
|
|
3227
|
+
padding: 0 5px 1.5px;
|
|
3228
|
+
display: flex;
|
|
3229
|
+
align-items: center;
|
|
3230
|
+
justify-content: center;
|
|
3231
|
+
gap: 5px;
|
|
3232
|
+
text-transform: capitalize;
|
|
3233
|
+
img {
|
|
3234
|
+
height: 12px;
|
|
3235
|
+
width: 12px;
|
|
3236
|
+
max-width: 12px;
|
|
3237
|
+
max-height: 12px;
|
|
3238
|
+
}
|
|
3239
|
+
&[data-header-bottom='true'] {
|
|
3240
|
+
background: ${theme.colors.neutral50};
|
|
3241
|
+
}
|
|
3242
|
+
span {
|
|
3243
|
+
font-size: 10px;
|
|
3244
|
+
line-height: 12px;
|
|
3245
|
+
color: ${theme.colors.gray400};
|
|
3246
|
+
font-weight: 400;
|
|
3247
|
+
}
|
|
3248
|
+
`;
|
|
3249
|
+
const StyledCloseBtn = styled.div `
|
|
3250
|
+
background-color: white;
|
|
3251
|
+
background-image: url(${CommonGAssets.getAssetPath('close-blue.svg')});
|
|
3252
|
+
background-repeat: no-repeat;
|
|
3253
|
+
background-size: 10px;
|
|
3254
|
+
background-position: center;
|
|
3255
|
+
width: 12px;
|
|
3256
|
+
height: 12px;
|
|
3257
|
+
position: absolute;
|
|
3258
|
+
top: 1px;
|
|
3259
|
+
right: 1px;
|
|
3260
|
+
cursor: pointer;
|
|
3261
|
+
`;
|
|
3262
|
+
|
|
3263
|
+
const SlotsById = {};
|
|
3264
|
+
const displayAd = ({ contentId, adUnitPath, size, divId, pos, sizeMapping, hideIfHasSubot, customTargetings, onSuccess, }) => {
|
|
3265
|
+
if (!divId || !document.getElementById(divId))
|
|
3266
|
+
return console.error('divId is required');
|
|
3267
|
+
destroyAdSlot(divId);
|
|
3268
|
+
window.googletag = window.googletag || { cmd: [] };
|
|
3269
|
+
const { googletag } = window;
|
|
3270
|
+
googletag.cmd.push(function () {
|
|
3271
|
+
const $content_id_container = document.querySelector('meta[name="content_id"]');
|
|
3272
|
+
const $content_id = typeof contentId === 'string' ? contentId : $content_id_container === null || $content_id_container === void 0 ? void 0 : $content_id_container.content;
|
|
3273
|
+
const newSlot = googletag.defineSlot(adUnitPath, size, divId);
|
|
3274
|
+
if (newSlot) {
|
|
3275
|
+
try {
|
|
3276
|
+
if (customTargetings) {
|
|
3277
|
+
Object.keys(customTargetings).forEach((k) => {
|
|
3278
|
+
if (k)
|
|
3279
|
+
newSlot === null || newSlot === void 0 ? void 0 : newSlot.setTargeting(k, customTargetings[k]);
|
|
3280
|
+
});
|
|
3281
|
+
}
|
|
3282
|
+
}
|
|
3283
|
+
catch (e) {
|
|
3284
|
+
console.error(e);
|
|
3285
|
+
}
|
|
3286
|
+
SlotsById[divId] = newSlot;
|
|
3287
|
+
newSlot.setTargeting('Pos', pos);
|
|
3288
|
+
newSlot.addService(googletag.pubads());
|
|
3289
|
+
if ($content_id)
|
|
3290
|
+
newSlot.setTargeting('Content_ID', $content_id);
|
|
3291
|
+
if (sizeMapping)
|
|
3292
|
+
newSlot.defineSizeMapping(sizeMapping);
|
|
3293
|
+
if (hideIfHasSubot && document.getElementById('subot--container')) {
|
|
3294
|
+
newSlot.setTargeting('chatbot', true);
|
|
3295
|
+
}
|
|
3296
|
+
googletag.display(divId);
|
|
3297
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
3298
|
+
}
|
|
3299
|
+
});
|
|
3300
|
+
};
|
|
3301
|
+
const destroyAdSlot = (divId) => {
|
|
3302
|
+
if (SlotsById[divId]) {
|
|
3303
|
+
window.googletag = window.googletag || { cmd: [] };
|
|
3304
|
+
const { googletag } = window;
|
|
3305
|
+
googletag.cmd.push(function () {
|
|
3306
|
+
googletag.destroySlots([SlotsById[divId]]);
|
|
3307
|
+
delete SlotsById[divId];
|
|
3308
|
+
});
|
|
3309
|
+
}
|
|
3310
|
+
};
|
|
3311
|
+
const DEFAULT_30S_AD_POS = [
|
|
3312
|
+
'TopBanner',
|
|
3313
|
+
'MidBanner1',
|
|
3314
|
+
'MidBanner2',
|
|
3315
|
+
'EndBanner',
|
|
3316
|
+
'Sticky',
|
|
3317
|
+
];
|
|
3318
|
+
const ForwaredAdBlock = forwardRef(function InfinityAdBlock({ className, adUnitPath, size, divId, pos, sizeMapping, contentId, isHidden, hideIfHasSubot, isSticky, refreshInterval, // seconds
|
|
3319
|
+
customTargetings, style, adDefaultSize, noWrapper, showCloseBtn, onCloseAd, headerBottom, wrapperProps, locale, isMarryBaby, }, ref) {
|
|
3320
|
+
const defaultRefreshInterval = refreshInterval ||
|
|
3321
|
+
(locale === LOCALE.Vietnam
|
|
3322
|
+
? pos.some((p) => DEFAULT_30S_AD_POS.includes(p))
|
|
3323
|
+
? 30
|
|
3324
|
+
: undefined
|
|
3325
|
+
: undefined);
|
|
3326
|
+
const { t } = useTranslations();
|
|
3327
|
+
const containerRef = useRef(null);
|
|
3328
|
+
const adRefreshIntervalRef = useRef(null);
|
|
3329
|
+
const refreshIntervalRef = useRef(defaultRefreshInterval);
|
|
3330
|
+
refreshIntervalRef.current = defaultRefreshInterval;
|
|
3331
|
+
const [localCloseAd, setLocalCloseAd] = useState(false);
|
|
3332
|
+
const adSlotChanged = () => {
|
|
3333
|
+
if (refreshIntervalRef.current) {
|
|
3334
|
+
if (adRefreshIntervalRef.current !== null) {
|
|
3335
|
+
clearInterval(adRefreshIntervalRef.current);
|
|
3336
|
+
}
|
|
3337
|
+
adRefreshIntervalRef.current = window.setInterval(() => {
|
|
3338
|
+
window.googletag = window.googletag || { cmd: [] };
|
|
3339
|
+
const { googletag } = window;
|
|
3340
|
+
googletag.cmd.push(function () {
|
|
3341
|
+
if (SlotsById[divId]) {
|
|
3342
|
+
googletag.pubads().refresh([SlotsById[divId]]);
|
|
3343
|
+
}
|
|
3344
|
+
});
|
|
3345
|
+
}, refreshIntervalRef.current * 1000);
|
|
3346
|
+
}
|
|
3347
|
+
};
|
|
3348
|
+
useEffect(() => {
|
|
3349
|
+
return () => {
|
|
3350
|
+
destroyAdSlot(divId);
|
|
3351
|
+
if (adRefreshIntervalRef.current)
|
|
3352
|
+
clearInterval(adRefreshIntervalRef.current);
|
|
3353
|
+
};
|
|
3354
|
+
}, []);
|
|
3355
|
+
useEffect(() => {
|
|
3356
|
+
adSlotChanged();
|
|
3357
|
+
}, [defaultRefreshInterval]);
|
|
3358
|
+
useEffect(() => {
|
|
3359
|
+
if (!isHidden) {
|
|
3360
|
+
displayAd({
|
|
3361
|
+
contentId,
|
|
3362
|
+
adUnitPath,
|
|
3363
|
+
size,
|
|
3364
|
+
divId,
|
|
3365
|
+
pos,
|
|
3366
|
+
sizeMapping,
|
|
3367
|
+
hideIfHasSubot,
|
|
3368
|
+
customTargetings,
|
|
3369
|
+
onSuccess: adSlotChanged,
|
|
3370
|
+
});
|
|
3371
|
+
}
|
|
3372
|
+
}, [isHidden]);
|
|
3373
|
+
if (localCloseAd)
|
|
3374
|
+
return null;
|
|
3375
|
+
const AdContent = (React__default.createElement("div", { style: {
|
|
3376
|
+
position: 'relative',
|
|
3377
|
+
width: 'fit-content',
|
|
3378
|
+
height: 'fit-content',
|
|
3379
|
+
overflow: 'hidden',
|
|
3380
|
+
maxWidth: '100%',
|
|
3381
|
+
display: 'flex',
|
|
3382
|
+
alignItems: 'center',
|
|
3383
|
+
justifyContent: 'center',
|
|
3384
|
+
} },
|
|
3385
|
+
React__default.createElement("div", { ref: ref, id: divId }),
|
|
3386
|
+
showCloseBtn && (React__default.createElement(StyledCloseBtn, { onClick: () => {
|
|
3387
|
+
onCloseAd === null || onCloseAd === void 0 ? void 0 : onCloseAd();
|
|
3388
|
+
setLocalCloseAd(true);
|
|
3389
|
+
} }))));
|
|
3390
|
+
if (isSticky)
|
|
3391
|
+
return AdContent;
|
|
3392
|
+
const minWidth = adDefaultSize
|
|
3393
|
+
? adDefaultSize[0]
|
|
3394
|
+
: size
|
|
3395
|
+
? Array.isArray(size[0])
|
|
3396
|
+
? size[0][0]
|
|
3397
|
+
: size[0]
|
|
3398
|
+
: undefined;
|
|
3399
|
+
const minHeight = adDefaultSize
|
|
3400
|
+
? adDefaultSize[1]
|
|
3401
|
+
: size
|
|
3402
|
+
? Array.isArray(size[0])
|
|
3403
|
+
? size[0][1]
|
|
3404
|
+
: size[1]
|
|
3405
|
+
: undefined;
|
|
3406
|
+
return (React__default.createElement(Box, Object.assign({}, wrapperProps, { className: className }),
|
|
3407
|
+
React__default.createElement(StyledAdContainer, { ref: containerRef, className: className, style: style, "data-no-wrapper": !!noWrapper, "data-header-bottom": !!headerBottom }, noWrapper ? (AdContent) : (React__default.createElement(React__default.Fragment, null,
|
|
3408
|
+
React__default.createElement(StyledAdHeader, { "data-header-bottom": !!headerBottom },
|
|
3409
|
+
React__default.createElement("img", { src: isMarryBaby
|
|
3410
|
+
? CommonGAssets.getAssetPath('adsIcon-mb.svg')
|
|
3411
|
+
: CommonGAssets.getAssetPath('adsIcon.svg'), alt: "", loading: "lazy" }),
|
|
3412
|
+
React__default.createElement("span", null, t('adBanner.title'))),
|
|
3413
|
+
React__default.createElement("div", { style: {
|
|
3414
|
+
minWidth: minWidth || '100%',
|
|
3415
|
+
minHeight: minHeight || '100%',
|
|
3416
|
+
position: 'relative',
|
|
3417
|
+
} }, AdContent))))));
|
|
3418
|
+
});
|
|
3419
|
+
const AdBlock = memo(ForwaredAdBlock, (prevProps, nextProps) => {
|
|
3420
|
+
return (prevProps.adUnitPath === nextProps.adUnitPath &&
|
|
3421
|
+
prevProps.divId === nextProps.divId &&
|
|
3422
|
+
prevProps.className === nextProps.className);
|
|
3423
|
+
});
|
|
3424
|
+
|
|
3425
|
+
const FixedBottomAdBlock = ({ className, adUnitPath, divId, isMobile, contentId, customTargetings, locale, isMarryBaby, }) => {
|
|
3426
|
+
const [hideAd, setHideAd] = useState(true);
|
|
3427
|
+
const [userHideAd, setUserHideAd] = useState(false);
|
|
3428
|
+
const [hidden, setHidden] = useState(true);
|
|
3429
|
+
const adRef = useRef(null);
|
|
3430
|
+
const mountRandRef = useRef(v4());
|
|
3431
|
+
const fixedAdRef = useRef(null);
|
|
3432
|
+
const timeoutRef = useRef();
|
|
3433
|
+
const closeBtnTimeoutRef = useRef();
|
|
3434
|
+
useEffect(() => {
|
|
3435
|
+
const checkAdShowing = () => {
|
|
3436
|
+
if (closeBtnTimeoutRef.current)
|
|
3437
|
+
clearTimeout(closeBtnTimeoutRef.current);
|
|
3438
|
+
closeBtnTimeoutRef.current = setTimeout(() => {
|
|
3439
|
+
var _a;
|
|
3440
|
+
if (document.getElementById('subot--container')) {
|
|
3441
|
+
setHideAd(true);
|
|
3442
|
+
}
|
|
3443
|
+
else {
|
|
3444
|
+
setHideAd(false);
|
|
3445
|
+
if (!((_a = adRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight)) {
|
|
3446
|
+
setHidden(true);
|
|
3447
|
+
}
|
|
3448
|
+
else {
|
|
3449
|
+
setHidden(false);
|
|
3450
|
+
}
|
|
3451
|
+
}
|
|
3452
|
+
checkAdShowing();
|
|
3453
|
+
}, 4000);
|
|
3454
|
+
};
|
|
3455
|
+
checkAdShowing();
|
|
3456
|
+
return () => {
|
|
3457
|
+
timeoutRef.current && clearTimeout(timeoutRef.current);
|
|
3458
|
+
closeBtnTimeoutRef.current && clearTimeout(closeBtnTimeoutRef.current);
|
|
3459
|
+
};
|
|
3460
|
+
}, []);
|
|
3461
|
+
if (hideAd || userHideAd)
|
|
3462
|
+
return null;
|
|
3463
|
+
return (React__default.createElement(StyledFixedAdBlock, { key: isMobile ? 'mobile' : 'desktop', ref: fixedAdRef, className: className, "data-visible": !hidden }, adUnitPath && (React__default.createElement(AdBlock, { wrapperProps: { m: 0 }, ref: adRef, adUnitPath: adUnitPath, size: isMobile
|
|
3464
|
+
? [
|
|
3465
|
+
[320, 50],
|
|
3466
|
+
[320, 100],
|
|
3467
|
+
]
|
|
3468
|
+
: [728, 90], divId: (divId || 'div-gpt-ad-sticky') +
|
|
3469
|
+
(isMobile ? '-mobile' : '') +
|
|
3470
|
+
contentId +
|
|
3471
|
+
String(mountRandRef.current), pos: ['Sticky'], contentId: contentId, hideIfHasSubot: isMobile, customTargetings: customTargetings, adDefaultSize: isMobile ? [320, 50] : [728, 90], showCloseBtn: true, onCloseAd: () => setUserHideAd(true), refreshInterval: 60, locale: locale, isMarryBaby: isMarryBaby }))));
|
|
3472
|
+
};
|
|
3473
|
+
|
|
3474
|
+
export { ArticleCard$1 as A, BMICardEmbed as B, CategoryCard as C, DoctorInfo as D, FloatButtonGroup as F, IconText as I, MobileBottomNavigation as M, OvulationCardEmbed as O, ProgressBar as P, RadioGroup as R, ScrollList as S, Tabs as T, ArticleCard as a, CheckboxGroup as b, StatisticCard as c, index as d, CookieAcceptConfirm as e, MobileBottomNavigationIcon as f, SeoHead as g, ToolsBannerCard as h, index$1 as i, DueDateCardEmbed as j, BabyGrowthCardEmbed as k, BabyPoopEmbed as l, THRCardEmbed as m, BMRCardEmbed as n, BabyVaccineCardEmbed as o, PWGCardEmbed as p, DateRangePicker as q, Breadcrumbs as r, ShareContainer as s, ShareDrawer as t, AdBlock as u, FixedBottomAdBlock as v };
|