@sok-brand-sites/common-frontend-components 0.0.1-security → 1.643.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of @sok-brand-sites/common-frontend-components might be problematic. Click here for more details.

Files changed (211) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -3
  3. package/dist/_virtual/_tslib.js +234 -0
  4. package/dist/assets/icons/Icons.js +118 -0
  5. package/dist/assets/logos/logos.js +19 -0
  6. package/dist/components/Accordion/Accordion.js +36 -0
  7. package/dist/components/Accordion/Accordion.styles.js +75 -0
  8. package/dist/components/AnimationWrapper/AnimationWrapper.js +35 -0
  9. package/dist/components/AnimationWrapper/AnimationWrapper.styles.js +26 -0
  10. package/dist/components/BlockGenerator/BlockContent.js +139 -0
  11. package/dist/components/BlockGenerator/BlockGenerator.js +62 -0
  12. package/dist/components/BlockGenerator/BlockGenerator.styles.js +44 -0
  13. package/dist/components/Button/Button.js +49 -0
  14. package/dist/components/Button/Button.styles.js +46 -0
  15. package/dist/components/Card/Card.js +79 -0
  16. package/dist/components/Card/Card.styles.js +137 -0
  17. package/dist/components/Carousel/Carousel.js +153 -0
  18. package/dist/components/Carousel/Carousel.styles.js +261 -0
  19. package/dist/components/CarouselNarrow/CarouselNarrow.js +120 -0
  20. package/dist/components/CarouselNarrow/CarouselNarrow.styles.js +281 -0
  21. package/dist/components/Column/Column.js +31 -0
  22. package/dist/components/Column/Column.styles.js +34 -0
  23. package/dist/components/Columns/Columns.js +38 -0
  24. package/dist/components/Columns/Columns.styles.js +21 -0
  25. package/dist/components/Embed/Embed.js +54 -0
  26. package/dist/components/Embed/Embed.styles.js +12 -0
  27. package/dist/components/Footer/Footer.js +63 -0
  28. package/dist/components/Footer/Footer.styles.js +67 -0
  29. package/dist/components/FormBuilder/FormBuilder.js +364 -0
  30. package/dist/components/FormBuilder/FormBuilder.styles.js +224 -0
  31. package/dist/components/FormBuilder/FormBuilderCheckboxes.js +39 -0
  32. package/dist/components/FormBuilder/FormBuilderInput.js +29 -0
  33. package/dist/components/FormBuilder/FormBuilderParagraph.js +15 -0
  34. package/dist/components/FormBuilder/FormBuilderSelect.js +39 -0
  35. package/dist/components/FormBuilder/FormBuilderTextAreaInput.js +29 -0
  36. package/dist/components/FormBuilder/utiles.js +13 -0
  37. package/dist/components/FullBgHero/FullBgHero.js +93 -0
  38. package/dist/components/FullBgHero/FullBgHero.styles.js +180 -0
  39. package/dist/components/GlobalStyle/GlobalStyle.js +285 -0
  40. package/dist/components/Header/Header.js +290 -0
  41. package/dist/components/Header/Header.styles.js +314 -0
  42. package/dist/components/Heading/Heading.js +29 -0
  43. package/dist/components/Heading/Heading.styles.js +21 -0
  44. package/dist/components/Hero/Hero.js +76 -0
  45. package/dist/components/Hero/Hero.styles.js +128 -0
  46. package/dist/components/IconLinks/IconLinks.js +118 -0
  47. package/dist/components/IconLinks/IconLinks.styles.js +259 -0
  48. package/dist/components/ImageCarousel/ImageCarousel.js +102 -0
  49. package/dist/components/ImageCarousel/ImageCarousel.styles.js +96 -0
  50. package/dist/components/LanguageSelector/LanguageSelector.js +72 -0
  51. package/dist/components/LanguageSelector/LanguageSelector.styles.js +72 -0
  52. package/dist/components/Layout/Layout.js +15 -0
  53. package/dist/components/Layout/Layout.styles.js +8 -0
  54. package/dist/components/List/List.js +25 -0
  55. package/dist/components/List/List.styles.js +11 -0
  56. package/dist/components/MarginWrapper/MarginWrapper.js +17 -0
  57. package/dist/components/MarginWrapper/MarginWrapper.styles.js +38 -0
  58. package/dist/components/OverlayCards/OverlayCard/OverlayCard.js +132 -0
  59. package/dist/components/OverlayCards/OverlayCard/OverlayCard.styles.js +133 -0
  60. package/dist/components/OverlayCards/OverlayCards.js +46 -0
  61. package/dist/components/OverlayCards/OverlayCards.styles.js +14 -0
  62. package/dist/components/OverlayCards/OverlayCards.types.js +9 -0
  63. package/dist/components/Paragraph/Paragraph.js +29 -0
  64. package/dist/components/Paragraph/Paragraph.styles.js +14 -0
  65. package/dist/components/PlaceOfBusiness/ContactInformation/ContactInformation.js +45 -0
  66. package/dist/components/PlaceOfBusiness/ContactInformation/ContactInformation.styles.js +37 -0
  67. package/dist/components/PlaceOfBusiness/LogoTitle/LogoTitle.js +16 -0
  68. package/dist/components/PlaceOfBusiness/LogoTitle/LogoTitle.styles.js +44 -0
  69. package/dist/components/PlaceOfBusiness/OpenToday/OpenToday.js +43 -0
  70. package/dist/components/PlaceOfBusiness/OpenToday/OpenToday.styles.js +63 -0
  71. package/dist/components/PlaceOfBusiness/OpeningHours/OpeningHours.js +77 -0
  72. package/dist/components/PlaceOfBusiness/OpeningHours/OpeningHours.styles.js +68 -0
  73. package/dist/components/PlaceOfBusiness/PlaceOfBusinessInfo/PlaceOfBusinessInfo.js +125 -0
  74. package/dist/components/PlaceOfBusiness/PlaceOfBusinessInfo/PlaceOfBusinessInfo.styles.js +32 -0
  75. package/dist/components/PlaceOfBusiness/PlaceOfBusinessListItem/PlaceOfBusinessListItem.js +85 -0
  76. package/dist/components/PlaceOfBusiness/PlaceOfBusinessListItem/PlaceOfBusinessListItem.styles.js +134 -0
  77. package/dist/components/PlaceOfBusiness/PlaceOfBusinessSearch/PlaceOfBusinessSearch.js +142 -0
  78. package/dist/components/PlaceOfBusiness/PlaceOfBusinessSearch/PlaceOfBusinessSearch.styles.js +43 -0
  79. package/dist/components/PlaceOfBusiness/Services/Services.js +30 -0
  80. package/dist/components/PlaceOfBusiness/Services/Services.styles.js +61 -0
  81. package/dist/components/PlaceOfBusiness/utils.js +177 -0
  82. package/dist/components/Promotion/Promotion.js +66 -0
  83. package/dist/components/Promotion/Promotion.styles.js +124 -0
  84. package/dist/components/RestrictedWidthContainer/RestrictedWidthContainer.js +63 -0
  85. package/dist/components/Seo/Seo.js +58 -0
  86. package/dist/components/SideBySide/SideBySide.js +81 -0
  87. package/dist/components/SideBySide/SideBySide.styles.js +179 -0
  88. package/dist/components/SocialMediaLinks/SocialMediaLinks.js +28 -0
  89. package/dist/components/SocialMediaLinks/SocialMediaLinks.styles.js +22 -0
  90. package/dist/components/SubHero/SubHero.js +22 -0
  91. package/dist/components/SubHero/SubHero.styles.js +52 -0
  92. package/dist/components/Table/Table.js +23 -0
  93. package/dist/components/Table/Table.styles.js +121 -0
  94. package/dist/components/Table/WpTable.styles.js +5 -0
  95. package/dist/components/constants.js +34 -0
  96. package/dist/components/utils.js +160 -0
  97. package/dist/fonts/Agrandir/Agrandir-Bold.woff.js +2 -0
  98. package/dist/fonts/Agrandir/Agrandir-Bold.woff2.js +2 -0
  99. package/dist/fonts/Agrandir/Agrandir-Light.woff.js +2 -0
  100. package/dist/fonts/Agrandir/Agrandir-Light.woff2.js +2 -0
  101. package/dist/fonts/Agrandir/index.js +16 -0
  102. package/dist/fonts/Brule/Brule-Bold.woff.js +2 -0
  103. package/dist/fonts/Brule/Brule-Bold.woff2.js +2 -0
  104. package/dist/fonts/Brule/Brule-Medium.woff.js +2 -0
  105. package/dist/fonts/Brule/Brule-Medium.woff2.js +2 -0
  106. package/dist/fonts/Brule/Brule-Regular.woff.js +2 -0
  107. package/dist/fonts/Brule/Brule-Regular.woff2.js +2 -0
  108. package/dist/fonts/Brule/index.js +18 -0
  109. package/dist/fonts/Domaine/Domaine-Text-Medium.woff.js +2 -0
  110. package/dist/fonts/Domaine/Domaine-Text-Medium.woff2.js +2 -0
  111. package/dist/fonts/Domaine/index.js +14 -0
  112. package/dist/fonts/FranklinGothic/FranklinGothic-LT-Com-Bk.woff.js +2 -0
  113. package/dist/fonts/FranklinGothic/FranklinGothic-LT-Com-Bk.woff2.js +2 -0
  114. package/dist/fonts/FranklinGothic/FranklinGothic-LT-Com-DmCn.woff.js +2 -0
  115. package/dist/fonts/FranklinGothic/FranklinGothic-LT-Com-DmCn.woff2.js +2 -0
  116. package/dist/fonts/FranklinGothic/FranklinGothic-LT-Com-MdCn.woff.js +2 -0
  117. package/dist/fonts/FranklinGothic/FranklinGothic-LT-Com-MdCn.woff2.js +2 -0
  118. package/dist/fonts/FranklinGothic/index.js +18 -0
  119. package/dist/fonts/MinionPro/MinionPro-Regular.woff.js +2 -0
  120. package/dist/fonts/MinionPro/MinionPro-Regular.woff2.js +2 -0
  121. package/dist/fonts/MinionPro/index.js +14 -0
  122. package/dist/fonts/Montserrat/Montserrat-Bold.woff.js +2 -0
  123. package/dist/fonts/Montserrat/Montserrat-Bold.woff2.js +2 -0
  124. package/dist/fonts/Montserrat/Montserrat-BoldItalic.woff.js +2 -0
  125. package/dist/fonts/Montserrat/Montserrat-BoldItalic.woff2.js +2 -0
  126. package/dist/fonts/Montserrat/Montserrat-ExtraBold.woff.js +2 -0
  127. package/dist/fonts/Montserrat/Montserrat-ExtraBold.woff2.js +2 -0
  128. package/dist/fonts/Montserrat/Montserrat-ExtraBoldItalic.woff.js +2 -0
  129. package/dist/fonts/Montserrat/Montserrat-ExtraBoldItalic.woff2.js +2 -0
  130. package/dist/fonts/Montserrat/Montserrat-Italic.woff.js +2 -0
  131. package/dist/fonts/Montserrat/Montserrat-Italic.woff2.js +2 -0
  132. package/dist/fonts/Montserrat/Montserrat-Light.woff.js +2 -0
  133. package/dist/fonts/Montserrat/Montserrat-Light.woff2.js +2 -0
  134. package/dist/fonts/Montserrat/Montserrat-LightItalic.woff.js +2 -0
  135. package/dist/fonts/Montserrat/Montserrat-LightItalic.woff2.js +2 -0
  136. package/dist/fonts/Montserrat/Montserrat-Medium.woff.js +2 -0
  137. package/dist/fonts/Montserrat/Montserrat-Medium.woff2.js +2 -0
  138. package/dist/fonts/Montserrat/Montserrat-MediumItalic.woff.js +2 -0
  139. package/dist/fonts/Montserrat/Montserrat-MediumItalic.woff2.js +2 -0
  140. package/dist/fonts/Montserrat/Montserrat-Regular.woff.js +2 -0
  141. package/dist/fonts/Montserrat/Montserrat-Regular.woff2.js +2 -0
  142. package/dist/fonts/Montserrat/index.js +90 -0
  143. package/dist/fonts/SBonus/SBonusUX-BoldItalic.woff.js +2 -0
  144. package/dist/fonts/SBonus/SBonusUX-BoldItalic.woff2.js +2 -0
  145. package/dist/fonts/SBonus/SBonusUX-ExtraboldItalic.woff.js +2 -0
  146. package/dist/fonts/SBonus/SBonusUX-ExtraboldItalic.woff2.js +2 -0
  147. package/dist/fonts/SBonus/SBonusUX-LightItalic.woff.js +2 -0
  148. package/dist/fonts/SBonus/SBonusUX-LightItalic.woff2.js +2 -0
  149. package/dist/fonts/SBonus/SBonusUX-MediumItalic.woff.js +2 -0
  150. package/dist/fonts/SBonus/SBonusUX-MediumItalic.woff2.js +2 -0
  151. package/dist/fonts/SBonus/SBonusUX-RegularItalic.woff.js +2 -0
  152. package/dist/fonts/SBonus/SBonusUX-RegularItalic.woff2.js +2 -0
  153. package/dist/fonts/SBonus/SBonusUXWEB-Bold.woff.js +2 -0
  154. package/dist/fonts/SBonus/SBonusUXWEB-Bold.woff2.js +2 -0
  155. package/dist/fonts/SBonus/SBonusUXWEB-Extrabold.woff.js +2 -0
  156. package/dist/fonts/SBonus/SBonusUXWEB-Extrabold.woff2.js +2 -0
  157. package/dist/fonts/SBonus/SBonusUXWEB-Light.woff.js +2 -0
  158. package/dist/fonts/SBonus/SBonusUXWEB-Light.woff2.js +2 -0
  159. package/dist/fonts/SBonus/SBonusUXWEB-Medium.woff.js +2 -0
  160. package/dist/fonts/SBonus/SBonusUXWEB-Medium.woff2.js +2 -0
  161. package/dist/fonts/SBonus/SBonusUXWEB-Regular.woff.js +2 -0
  162. package/dist/fonts/SBonus/SBonusUXWEB-Regular.woff2.js +2 -0
  163. package/dist/fonts/SBonus/index.js +95 -0
  164. package/dist/fonts/SBonusDisplay/SBonusDisplay-Bold.woff.js +2 -0
  165. package/dist/fonts/SBonusDisplay/SBonusDisplay-Bold.woff2.js +2 -0
  166. package/dist/fonts/SBonusDisplay/SBonusDisplay-Light.woff.js +2 -0
  167. package/dist/fonts/SBonusDisplay/SBonusDisplay-Light.woff2.js +2 -0
  168. package/dist/fonts/SBonusDisplay/SBonusDisplay-Medium.woff.js +2 -0
  169. package/dist/fonts/SBonusDisplay/SBonusDisplay-Medium.woff2.js +2 -0
  170. package/dist/fonts/SBonusDisplay/SBonusDisplay-Regular.woff.js +2 -0
  171. package/dist/fonts/SBonusDisplay/SBonusDisplay-Regular.woff2.js +2 -0
  172. package/dist/fonts/SBonusDisplay/SBonusDisplay-SemiBold.woff.js +2 -0
  173. package/dist/fonts/SBonusDisplay/SBonusDisplay-SemiBold.woff2.js +2 -0
  174. package/dist/fonts/SBonusDisplay/index.js +22 -0
  175. package/dist/fonts/SuomiGrumpy/SuomiGrumpy-Black.woff.js +2 -0
  176. package/dist/fonts/SuomiGrumpy/SuomiGrumpy-Black.woff2.js +2 -0
  177. package/dist/fonts/SuomiGrumpy/index.js +14 -0
  178. package/dist/fonts/utils.js +5 -0
  179. package/dist/hooks/useElementRect.js +65 -0
  180. package/dist/hooks/windowsize.js +31 -0
  181. package/dist/locales/constants.js +6 -0
  182. package/dist/locales/translations.json.js +153 -0
  183. package/dist/styles/media.js +40 -0
  184. package/dist/themes/neutral/breakpoints.js +11 -0
  185. package/dist/themes/neutral/colors.js +3 -0
  186. package/dist/themes/neutral/components.js +940 -0
  187. package/dist/themes/neutral/fonts.js +7 -0
  188. package/dist/themes/neutral/index.js +10 -0
  189. package/dist/themes/neutral/spacings.js +21 -0
  190. package/dist/themes/ravintolakonseptit/breakpoints.js +11 -0
  191. package/dist/themes/ravintolakonseptit/colors.js +17 -0
  192. package/dist/themes/ravintolakonseptit/components.js +936 -0
  193. package/dist/themes/ravintolakonseptit/fonts.js +5 -0
  194. package/dist/themes/ravintolakonseptit/index.js +10 -0
  195. package/dist/themes/ravintolakonseptit/spacings.js +21 -0
  196. package/dist/themes/sokos/breakpoints.js +11 -0
  197. package/dist/themes/sokos/colors.js +3 -0
  198. package/dist/themes/sokos/components.js +936 -0
  199. package/dist/themes/sokos/index.js +10 -0
  200. package/dist/themes/sokospalvelut/breakpoints.js +11 -0
  201. package/dist/themes/sokospalvelut/colors.js +3 -0
  202. package/dist/themes/sokospalvelut/components.js +936 -0
  203. package/dist/themes/sokospalvelut/fonts.js +11 -0
  204. package/dist/themes/sokospalvelut/index.js +10 -0
  205. package/dist/themes/theme.types.js +12 -0
  206. package/dist/themes/tykkimakiresort/colors.js +35 -0
  207. package/dist/themes/tykkimakiresort/components.js +936 -0
  208. package/dist/themes/tykkimakiresort/fonts.js +7 -0
  209. package/dist/themes/tykkimakiresort/index.js +10 -0
  210. package/package.json +33 -3
  211. package/scripts/build.js +132 -0
@@ -0,0 +1,30 @@
1
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
+ import { ServicesContainer, Title, ServicesGrid, ServicesGridItem, ArrowContainer } from './Services.styles.js';
3
+ import translationJSON from '../../../locales/translations.json.js';
4
+ import { icons } from '../../../assets/icons/Icons.js';
5
+
6
+ var Services = function Services(_a) {
7
+ var services = _a.services,
8
+ lang = _a.lang;
9
+ return jsx(Fragment, {
10
+ children: services && jsxs(ServicesContainer, {
11
+ children: [jsx(Title, {
12
+ children: translationJSON.placeOfBusiness.placeOfBusinessInfo.services[lang]
13
+ }, void 0), jsx(ServicesGrid, {
14
+ children: services === null || services === void 0 ? void 0 : services.map(function (service) {
15
+ var _a, _b;
16
+
17
+ return jsxs(ServicesGridItem, {
18
+ children: [jsx(ArrowContainer, {
19
+ children: jsx(icons.Arrow, {}, void 0)
20
+ }, void 0), jsx("p", {
21
+ children: (_a = service.serviceType) === null || _a === void 0 ? void 0 : _a.name
22
+ }, void 0)]
23
+ }, (_b = service.serviceType) === null || _b === void 0 ? void 0 : _b.name);
24
+ })
25
+ }, void 0)]
26
+ }, void 0)
27
+ }, void 0);
28
+ };
29
+
30
+ export { Services, Services as default };
@@ -0,0 +1,61 @@
1
+ import { __makeTemplateObject } from '../../../_virtual/_tslib.js';
2
+ import styled from 'styled-components';
3
+ import media from '../../../styles/media.js';
4
+ var ServicesContainer = styled.div.withConfig({
5
+ displayName: "Servicesstyles__ServicesContainer",
6
+ componentId: "sc-1ajwmbh-0"
7
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n row-gap: ", ";\n"], ["\n display: flex;\n flex-direction: column;\n row-gap: ", ";\n"])), function (_a) {
8
+ var theme = _a.theme;
9
+ return theme.spacings.spacing32;
10
+ });
11
+ var Title = styled.div.withConfig({
12
+ displayName: "Servicesstyles__Title",
13
+ componentId: "sc-1ajwmbh-1"
14
+ })(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n\n ", "\n"], ["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n\n ", "\n"])), function (_a) {
15
+ var theme = _a.theme;
16
+ return theme.components.placeOfBusiness.services.title.fontFamily;
17
+ }, function (_a) {
18
+ var theme = _a.theme;
19
+ return theme.components.placeOfBusiness.services.title.fontWeight;
20
+ }, function (_a) {
21
+ var theme = _a.theme;
22
+ return theme.components.placeOfBusiness.services.title.fontSizes.mobile.fontSize;
23
+ }, function (_a) {
24
+ var theme = _a.theme;
25
+ return theme.components.placeOfBusiness.services.title.fontSizes.mobile.lineHeight;
26
+ }, function (_a) {
27
+ var theme = _a.theme;
28
+ return theme.components.placeOfBusiness.services.title.color;
29
+ }, media.desktop(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size: ", ";\n line-height: ", ";\n "], ["\n font-size: ", ";\n line-height: ", ";\n "])), function (_a) {
30
+ var theme = _a.theme;
31
+ return theme.components.placeOfBusiness.services.title.fontSizes.desktop.fontSize;
32
+ }, function (_a) {
33
+ var theme = _a.theme;
34
+ return theme.components.placeOfBusiness.services.title.fontSizes.desktop.lineHeight;
35
+ }));
36
+ var ServicesGrid = styled.div.withConfig({
37
+ displayName: "Servicesstyles__ServicesGrid",
38
+ componentId: "sc-1ajwmbh-2"
39
+ })(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: 1fr;\n column-gap: ", ";\n\n ", "\n"], ["\n display: grid;\n grid-template-columns: 1fr;\n column-gap: ", ";\n\n ", "\n"])), function (_a) {
40
+ var theme = _a.theme;
41
+ return theme.spacings.spacing16;
42
+ }, media.tablet(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n grid-template-columns: 1fr 1fr;\n "], ["\n grid-template-columns: 1fr 1fr;\n "]))));
43
+ var ServicesGridItem = styled.div.withConfig({
44
+ displayName: "Servicesstyles__ServicesGridItem",
45
+ componentId: "sc-1ajwmbh-3"
46
+ })(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: ", " 0;\n border-bottom: 1px solid #f0f0f0;\n column-gap: ", ";\n"], ["\n display: flex;\n align-items: center;\n padding: ", " 0;\n border-bottom: 1px solid #f0f0f0;\n column-gap: ", ";\n"])), function (_a) {
47
+ var theme = _a.theme;
48
+ return theme.spacings.spacing16;
49
+ }, function (_a) {
50
+ var theme = _a.theme;
51
+ return theme.spacings.spacing16;
52
+ });
53
+ var ArrowContainer = styled.div.withConfig({
54
+ displayName: "Servicesstyles__ArrowContainer",
55
+ componentId: "sc-1ajwmbh-4"
56
+ })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n transform: rotate(180deg);\n svg path {\n fill: ", ";\n }\n"], ["\n transform: rotate(180deg);\n svg path {\n fill: ", ";\n }\n"])), function (_a) {
57
+ var theme = _a.theme;
58
+ return theme.components.placeOfBusiness.services.arrowColor;
59
+ });
60
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
61
+ export { ArrowContainer, ServicesContainer, ServicesGrid, ServicesGridItem, Title };
@@ -0,0 +1,177 @@
1
+ import translationJSON from '../../locales/translations.json.js';
2
+ import { format, add, areIntervalsOverlapping } from 'date-fns';
3
+
4
+ function filterPobs(pobs, searchInput) {
5
+ var splittingRegex = /-| /;
6
+ var filters = searchInput ? searchInput.trim().split(splittingRegex) : '';
7
+
8
+ if (filters) {
9
+ return pobs.filter(function (pob) {
10
+ // Returns the pob if any of the following conditions is met:
11
+ // 1. postcode starts with the filter
12
+ // 2. any of the parts (split by space or hyphen) in the address starts with the filter
13
+ // 3. postcodeName starts with the filter
14
+ // 4. any of the parts (split by space or hyphen) in the name starts with the filter
15
+ // For multiple filter strings, all of them have to meet one of the criteria for a match,
16
+ // i.e., the filter is an AND filter and not OR
17
+ return filters.every(function (filter) {
18
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
19
+
20
+ return ((_c = (_b = (_a = pob.location) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b.postcode) === null || _c === void 0 ? void 0 : _c.toLowerCase().startsWith(filter.toLowerCase())) || ((_f = (_e = (_d = pob.location) === null || _d === void 0 ? void 0 : _d.address) === null || _e === void 0 ? void 0 : _e.street) === null || _f === void 0 ? void 0 : _f.toLowerCase().split(splittingRegex).some(function (part) {
21
+ return part.startsWith(filter.toLowerCase());
22
+ })) || ((_j = (_h = (_g = pob.location) === null || _g === void 0 ? void 0 : _g.address) === null || _h === void 0 ? void 0 : _h.postcodeName) === null || _j === void 0 ? void 0 : _j.toLowerCase().startsWith(filter.toLowerCase())) || ((_k = pob.name) === null || _k === void 0 ? void 0 : _k.toLowerCase().split(splittingRegex).some(function (part) {
23
+ return part.startsWith(filter.toLowerCase());
24
+ })) || ((_m = (_l = pob.brand) === null || _l === void 0 ? void 0 : _l.name) === null || _m === void 0 ? void 0 : _m.toLowerCase().split(splittingRegex).some(function (part) {
25
+ return part.includes(filter.toLowerCase());
26
+ }));
27
+ });
28
+ }).sort(function (a, b) {
29
+ return sortPobs(a, b, filters);
30
+ });
31
+ }
32
+
33
+ return pobs;
34
+ } // Sort pobs first with brand priority, e.g., if filter is "Prisma",
35
+ // show all pobs under Prisma brand first and then the
36
+ // other Prisma matches such as "Silmäasema Espoo Prisma Olari" (a shop inside Prisma)
37
+ // When both a and b are under the same brand, sort by a better match in names, e.g.,
38
+ // "Prisma O" gives "Prisma Olari" first and "Prisma Iso Omena" second.
39
+
40
+
41
+ var sortPobs = function sortPobs(a, b, filters) {
42
+ var value = sortByBrandStartsWith(a, b, filters);
43
+
44
+ if (value === 0) {
45
+ value = sortByBrandExactMatch(a, b, filters);
46
+
47
+ if (value === 0) {
48
+ return sortByUnsplitFilter(a, b, filters);
49
+ }
50
+
51
+ return value;
52
+ }
53
+
54
+ return value;
55
+ };
56
+
57
+ function sortByBrandExactMatch(a, b, filters) {
58
+ var aBrandNameInFilters = filters.some(function (filter) {
59
+ var _a, _b;
60
+
61
+ return ((_b = (_a = a.brand) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === filter.toLowerCase();
62
+ });
63
+ var bBrandNameInFilters = filters.some(function (filter) {
64
+ var _a, _b;
65
+
66
+ return ((_b = (_a = b.brand) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === filter.toLowerCase();
67
+ });
68
+ if (aBrandNameInFilters && !bBrandNameInFilters) return -1;
69
+ if (!aBrandNameInFilters && bBrandNameInFilters) return 1;
70
+ return 0;
71
+ }
72
+
73
+ function sortByBrandStartsWith(a, b, filters) {
74
+ var aBrandNameInFilters = filters.some(function (filter) {
75
+ var _a, _b;
76
+
77
+ return (_b = (_a = a.brand) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase().startsWith(filter.toLowerCase());
78
+ });
79
+ var bBrandNameInFilters = filters.some(function (filter) {
80
+ var _a, _b;
81
+
82
+ return (_b = (_a = b.brand) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase().startsWith(filter.toLowerCase());
83
+ });
84
+ if (aBrandNameInFilters && !bBrandNameInFilters) return -1;
85
+ if (!aBrandNameInFilters && bBrandNameInFilters) return 1;
86
+ return 0;
87
+ }
88
+
89
+ function sortByUnsplitFilter(a, b, filters) {
90
+ var _a, _b;
91
+
92
+ var filter = filters.join(' ');
93
+ var aPobNameInFilter = (_a = a.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(filter.toLowerCase());
94
+ var bPobNameInFilter = (_b = b.name) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(filter.toLowerCase());
95
+ if (aPobNameInFilter && !bPobNameInFilter) return -1;
96
+ if (!aPobNameInFilter && bPobNameInFilter) return 1;
97
+ return 0;
98
+ } // check modes for weekdays https://confluence.sok.fi/pages/viewpage.action?pageId=60170941
99
+
100
+
101
+ var getOpenHours = function getOpenHours(language, openingTimesToday) {
102
+ var _a, _b;
103
+
104
+ var openHours = [];
105
+
106
+ if (!openingTimesToday) {
107
+ openHours.push(translationJSON.placeOfBusiness.noOpeningHours[language]);
108
+ } else if (openingTimesToday.mode === 'RANGE' && ((_a = openingTimesToday.ranges) === null || _a === void 0 ? void 0 : _a.length)) {
109
+ (_b = openingTimesToday.ranges) === null || _b === void 0 ? void 0 : _b.forEach(function (range) {
110
+ openHours.push(range.open + " - " + range.close);
111
+ });
112
+ } else if (openingTimesToday.mode === '24H') {
113
+ openHours.push('24h');
114
+ } else if (openingTimesToday.mode === 'BY_RESERVATION') {
115
+ openHours.push(translationJSON.placeOfBusiness.byAppointment[language]);
116
+ } else if (openingTimesToday.mode === 'CLOSED') {
117
+ openHours.push(translationJSON.placeOfBusiness.closed[language]);
118
+ } else {
119
+ openHours.push(translationJSON.placeOfBusiness.noOpeningHours[language]);
120
+ }
121
+
122
+ return openHours;
123
+ };
124
+
125
+ var getUrl = function getUrl(name, laariId, language) {
126
+ if (laariId === void 0) {
127
+ laariId = '';
128
+ } // Remove commas and dots, split by space, join with hyphens, remove consecutive hyphens
129
+
130
+
131
+ var nameStr = name.toLowerCase().replace(/[,.]/g, '').split(' ').join('-').replace(/-+/g, '-').replace(/ä|Ä|u00e4|u00E4|å|Å|u00e5|u00E5/g, 'a').replace(/ö|Ö|u00e6|u00E6/g, 'o');
132
+ var lang = language.toLowerCase();
133
+ var url;
134
+
135
+ if (lang === 'fi') {
136
+ url = "/toimipaikka/" + nameStr + "/" + laariId;
137
+ } else if (lang === 'en') {
138
+ url = "/" + lang + "/location/" + nameStr + "/" + laariId;
139
+ } else {
140
+ url = "/" + lang + "/verksamhetsstalle/" + nameStr + "/" + laariId;
141
+ }
142
+
143
+ return url;
144
+ };
145
+
146
+ var isOpenNow = function isOpenNow(formattedCurrentDate, openingTimesToday) {
147
+ var _a;
148
+
149
+ if (!openingTimesToday) return false;
150
+ if ((openingTimesToday === null || openingTimesToday === void 0 ? void 0 : openingTimesToday.mode) === 'CLOSED' || (openingTimesToday === null || openingTimesToday === void 0 ? void 0 : openingTimesToday.mode) === 'BY_RESERVATION') return false;
151
+ if ((openingTimesToday === null || openingTimesToday === void 0 ? void 0 : openingTimesToday.mode) === '24H') return true;
152
+
153
+ if ((openingTimesToday === null || openingTimesToday === void 0 ? void 0 : openingTimesToday.mode) === 'RANGE') {
154
+ var currentTime_1 = format(new Date(), 'HH:mm'); // T before the time in the string is needed for mobile Safari
155
+
156
+ var isOpen = (_a = openingTimesToday.ranges) === null || _a === void 0 ? void 0 : _a.some(function (range) {
157
+ var formattedCurrentTime = new Date(formattedCurrentDate + "T" + currentTime_1);
158
+ var formattedCurrentTimePlusOneMinute = add(new Date(formattedCurrentTime), {
159
+ minutes: 1
160
+ });
161
+ var formattedOpeningTime = new Date(formattedCurrentDate + "T" + range.open);
162
+ var formattedClosingTime = range.closeOnSameDay ? new Date(formattedCurrentDate + "T" + range.close) : add(new Date(formattedCurrentDate + "T" + range.close), {
163
+ days: 1
164
+ });
165
+ return areIntervalsOverlapping({
166
+ start: formattedCurrentTime,
167
+ end: formattedCurrentTimePlusOneMinute
168
+ }, {
169
+ start: formattedOpeningTime,
170
+ end: formattedClosingTime
171
+ });
172
+ });
173
+ return isOpen;
174
+ }
175
+ };
176
+
177
+ export { filterPobs, getOpenHours, getUrl, isOpenNow, sortByBrandExactMatch, sortByBrandStartsWith, sortByUnsplitFilter, sortPobs };
@@ -0,0 +1,66 @@
1
+ import { __rest, __assign } from '../../_virtual/_tslib.js';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { useTheme } from 'styled-components';
5
+ import RestrictedWidthContainer from '../RestrictedWidthContainer/RestrictedWidthContainer.js';
6
+ import { PromotionContainer, MediaContainer, DynamicImage, StaticImage, Video, Overlay, ContentContainer, Category, Title } from './Promotion.styles.js';
7
+ import Button from '../Button/Button.js';
8
+ var Promotion = forwardRef(function (_a, ref) {
9
+ var _b, _c, _d;
10
+
11
+ var category = _a.category,
12
+ title = _a.title,
13
+ opacity = _a.opacity,
14
+ media = _a.media,
15
+ button = _a.button,
16
+ anchor = _a.anchor,
17
+ rest = __rest(_a, ["category", "title", "opacity", "media", "button", "anchor"]);
18
+
19
+ var theme = useTheme();
20
+ return jsxs(PromotionContainer, __assign({
21
+ id: anchor
22
+ }, rest, {
23
+ ref: ref
24
+ }, {
25
+ children: [jsxs(MediaContainer, {
26
+ children: [(media === null || media === void 0 ? void 0 : media.mimeType.includes('image')) && ((_b = media === null || media === void 0 ? void 0 : media.localFile) === null || _b === void 0 ? void 0 : _b.childImageSharp) && jsx(DynamicImage, {
27
+ image: (_c = media.localFile.childImageSharp) === null || _c === void 0 ? void 0 : _c.gatsbyImageData,
28
+ alt: ""
29
+ }, void 0), (media === null || media === void 0 ? void 0 : media.mimeType.includes('image')) && !((_d = media === null || media === void 0 ? void 0 : media.localFile) === null || _d === void 0 ? void 0 : _d.childImageSharp) && jsx(StaticImage, {
30
+ src: media.mediaItemUrl,
31
+ alt: ""
32
+ }, void 0), (media === null || media === void 0 ? void 0 : media.mediaItemUrl) && (media === null || media === void 0 ? void 0 : media.mimeType.includes('video')) && jsx(Video, __assign({
33
+ muted: true,
34
+ loop: true,
35
+ playsInline: true,
36
+ autoPlay: true
37
+ }, {
38
+ children: jsx("source", {
39
+ type: media.mimeType,
40
+ src: media.mediaItemUrl
41
+ }, void 0)
42
+ }), void 0), jsx(Overlay, {
43
+ opacity: opacity
44
+ }, void 0)]
45
+ }, void 0), jsx(RestrictedWidthContainer, {
46
+ children: jsxs(ContentContainer, {
47
+ children: [jsx(Category, {
48
+ children: category
49
+ }, void 0), jsx(Title, {
50
+ dangerouslySetInnerHTML: {
51
+ __html: title === null || title === void 0 ? void 0 : title.replace(/\u00a0/g, ' ')
52
+ }
53
+ }, void 0), (button === null || button === void 0 ? void 0 : button.buttonText) && jsx(Button, {
54
+ linkToPage: button === null || button === void 0 ? void 0 : button.linkToPage,
55
+ externalLink: button === null || button === void 0 ? void 0 : button.externalLink,
56
+ openWithNewTab: button === null || button === void 0 ? void 0 : button.openWithNewTab,
57
+ buttonText: button === null || button === void 0 ? void 0 : button.buttonText,
58
+ htmlAnchorTarget: button === null || button === void 0 ? void 0 : button.htmlAnchorTarget,
59
+ // Todo: this should be configurable by from the editor
60
+ align: theme.components.promotion.alignContent
61
+ }, void 0)]
62
+ }, void 0)
63
+ }, void 0)]
64
+ }), void 0);
65
+ });
66
+ export { Promotion, Promotion as default };
@@ -0,0 +1,124 @@
1
+ import { __makeTemplateObject } from '../../_virtual/_tslib.js';
2
+ import styled, { css } from 'styled-components';
3
+ import { GatsbyImage } from 'gatsby-plugin-image';
4
+ import media from '../../styles/media.js';
5
+ var PromotionContainer = styled.div.withConfig({
6
+ displayName: "Promotionstyles__PromotionContainer",
7
+ componentId: "sc-1xki3yx-0"
8
+ })(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n min-height: ", ";\n\n ", "\n\n ", "\n"], ["\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n min-height: ", ";\n\n ", "\n\n ", "\n"])), function (_a) {
9
+ var theme = _a.theme;
10
+ return theme.components.promotion.minHeight.mobile;
11
+ }, media.tablet(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n min-height: ", ";\n "], ["\n min-height: ", ";\n "])), function (_a) {
12
+ var theme = _a.theme;
13
+ return theme.components.promotion.minHeight.tablet;
14
+ }), media.desktop(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n min-height: ", ";\n "], ["\n min-height: ", ";\n "])), function (_a) {
15
+ var theme = _a.theme;
16
+ return theme.components.promotion.minHeight.desktop;
17
+ }));
18
+ var MediaContainer = styled.div.withConfig({
19
+ displayName: "Promotionstyles__MediaContainer",
20
+ componentId: "sc-1xki3yx-1"
21
+ })(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n height: 100%;\n width: 100%;\n z-index: 0;\n"], ["\n position: absolute;\n height: 100%;\n width: 100%;\n z-index: 0;\n"])));
22
+ var Video = styled.video.withConfig({
23
+ displayName: "Promotionstyles__Video",
24
+ componentId: "sc-1xki3yx-2"
25
+ })(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 100%;\n object-fit: cover;\n height: 100%;\n"], ["\n width: 100%;\n object-fit: cover;\n height: 100%;\n"])));
26
+ var ImageCSS = css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n width: 100%;\n object-fit: cover;\n height: 100%;\n"], ["\n width: 100%;\n object-fit: cover;\n height: 100%;\n"])));
27
+ var DynamicImage = styled(GatsbyImage).withConfig({
28
+ displayName: "Promotionstyles__DynamicImage",
29
+ componentId: "sc-1xki3yx-3"
30
+ })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), ImageCSS);
31
+ var StaticImage = styled.img.withConfig({
32
+ displayName: "Promotionstyles__StaticImage",
33
+ componentId: "sc-1xki3yx-4"
34
+ })(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), ImageCSS);
35
+ var Overlay = styled.div.withConfig({
36
+ displayName: "Promotionstyles__Overlay",
37
+ componentId: "sc-1xki3yx-5"
38
+ })(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: black;\n opacity: ", ";\n"], ["\n position: absolute;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: black;\n opacity: ", ";\n"])), function (_a) {
39
+ var opacity = _a.opacity;
40
+ return opacity ? opacity : '0';
41
+ });
42
+ var ContentContainer = styled.div.withConfig({
43
+ displayName: "Promotionstyles__ContentContainer",
44
+ componentId: "sc-1xki3yx-6"
45
+ })(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n width: 100%;\n z-index: 1;\n text-align: ", ";\n padding: ", " 0;\n"], ["\n width: 100%;\n z-index: 1;\n text-align: ", ";\n padding: ", " 0;\n"])), function (_a) {
46
+ var theme = _a.theme;
47
+ return theme.components.promotion.alignContent;
48
+ }, function (_a) {
49
+ var theme = _a.theme;
50
+ return theme.spacings.spacing32;
51
+ });
52
+ var Category = styled.div.withConfig({
53
+ displayName: "Promotionstyles__Category",
54
+ componentId: "sc-1xki3yx-7"
55
+ })(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-transform: ", ";\n margin-bottom: ", ";\n word-wrap: break-word;\n"], ["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-transform: ", ";\n margin-bottom: ", ";\n word-wrap: break-word;\n"])), function (_a) {
56
+ var theme = _a.theme;
57
+ return theme.components.promotion.category.fontFamily;
58
+ }, function (_a) {
59
+ var theme = _a.theme;
60
+ return theme.components.promotion.category.fontWeight;
61
+ }, function (_a) {
62
+ var theme = _a.theme;
63
+ return theme.components.promotion.category.fontSize;
64
+ }, function (_a) {
65
+ var theme = _a.theme;
66
+ return theme.components.promotion.category.fontSize;
67
+ }, function (_a) {
68
+ var theme = _a.theme;
69
+ return theme.components.promotion.category.color;
70
+ }, function (_a) {
71
+ var theme = _a.theme;
72
+ return theme.components.promotion.category.textTransform;
73
+ }, function (_a) {
74
+ var theme = _a.theme;
75
+ return theme.spacings.spacing8;
76
+ });
77
+ var Title = styled.div.withConfig({
78
+ displayName: "Promotionstyles__Title",
79
+ componentId: "sc-1xki3yx-8"
80
+ })(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-transform: ", ";\n letter-spacing: ", ";\n margin-bottom: ", ";\n word-wrap: break-word;\n\n ", "\n\n ", "\n"], ["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-transform: ", ";\n letter-spacing: ", ";\n margin-bottom: ", ";\n word-wrap: break-word;\n\n ", "\n\n ", "\n"])), function (_a) {
81
+ var theme = _a.theme;
82
+ return theme.components.promotion.title.fontFamily;
83
+ }, function (_a) {
84
+ var theme = _a.theme;
85
+ return theme.components.promotion.title.fontWeight;
86
+ }, function (_a) {
87
+ var theme = _a.theme;
88
+ return theme.components.promotion.title.fontSizes.mobile.fontSize;
89
+ }, function (_a) {
90
+ var theme = _a.theme;
91
+ return theme.components.promotion.title.fontSizes.mobile.lineHeight;
92
+ }, function (_a) {
93
+ var theme = _a.theme;
94
+ return theme.components.promotion.title.color;
95
+ }, function (_a) {
96
+ var theme = _a.theme;
97
+ return theme.components.promotion.title.textTransform;
98
+ }, function (_a) {
99
+ var theme = _a.theme;
100
+ return theme.components.promotion.title.letterSpacing;
101
+ }, function (_a) {
102
+ var theme = _a.theme;
103
+ return theme.spacings.spacing32;
104
+ }, media.tablet(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n margin-bottom: ", ";\n font-size: ", ";\n line-height: ", ";\n "], ["\n margin-bottom: ", ";\n font-size: ", ";\n line-height: ", ";\n "])), function (_a) {
105
+ var theme = _a.theme;
106
+ return theme.spacings.spacing48;
107
+ }, function (_a) {
108
+ var theme = _a.theme;
109
+ return theme.components.promotion.title.fontSizes.tablet.fontSize;
110
+ }, function (_a) {
111
+ var theme = _a.theme;
112
+ return theme.components.promotion.title.fontSizes.tablet.lineHeight;
113
+ }), media.desktop(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n margin-bottom: ", ";\n font-size: ", ";\n line-height: ", ";\n "], ["\n margin-bottom: ", ";\n font-size: ", ";\n line-height: ", ";\n "])), function (_a) {
114
+ var theme = _a.theme;
115
+ return theme.spacings.spacing48;
116
+ }, function (_a) {
117
+ var theme = _a.theme;
118
+ return theme.components.promotion.title.fontSizes.desktop.fontSize;
119
+ }, function (_a) {
120
+ var theme = _a.theme;
121
+ return theme.components.promotion.title.fontSizes.desktop.lineHeight;
122
+ }));
123
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14;
124
+ export { Category, ContentContainer, DynamicImage, MediaContainer, Overlay, PromotionContainer, StaticImage, Title, Video };
@@ -0,0 +1,63 @@
1
+ import { __makeTemplateObject, __assign } from '../../_virtual/_tslib.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import styled from 'styled-components';
4
+ import media from '../../styles/media.js';
5
+ var RestrictedWidth = styled.div.withConfig({
6
+ displayName: "RestrictedWidthContainer__RestrictedWidth",
7
+ componentId: "sc-k414oz-0"
8
+ })(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 100%;\n max-width: ", ";\n margin-left: ", ";\n margin-right: ", ";\n z-index: 1;\n overflow: ", ";\n\n ", "\n\n ", "\n"], ["\n width: 100%;\n max-width: ", ";\n margin-left: ", ";\n margin-right: ", ";\n z-index: 1;\n overflow: ", ";\n\n ", "\n\n ", "\n"
9
+ /* This fixes overflow with margins/paddings when the parent of this component has
10
+ display: flex and flex-direction: column. With flex-direction: row (default), this
11
+ component is not overflowing horizontally.
12
+ */
13
+ ])), function (_a) {
14
+ var theme = _a.theme;
15
+ return theme.components.restrictedWidthContainer.maxWidth;
16
+ }, function (_a) {
17
+ var theme = _a.theme;
18
+ return theme.components.restrictedWidthContainer.mobile.margin.left;
19
+ }, function (_a) {
20
+ var theme = _a.theme;
21
+ return theme.components.restrictedWidthContainer.mobile.margin.right;
22
+ }, function (_a) {
23
+ var hideOverflow = _a.hideOverflow;
24
+ return hideOverflow ? 'hidden' : 'unset';
25
+ }, media.tablet(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-left: ", ";\n margin-right: ", ";\n "], ["\n margin-left: ", ";\n margin-right: ", ";\n "])), function (_a) {
26
+ var theme = _a.theme;
27
+ return theme.components.restrictedWidthContainer.tablet.margin.left;
28
+ }, function (_a) {
29
+ var theme = _a.theme;
30
+ return theme.components.restrictedWidthContainer.tablet.margin.right;
31
+ }), media.desktop(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-left: ", ";\n margin-right: ", ";\n "], ["\n margin-left: ", ";\n margin-right: ", ";\n "])), function (_a) {
32
+ var theme = _a.theme;
33
+ return theme.components.restrictedWidthContainer.desktop.margin.left;
34
+ }, function (_a) {
35
+ var theme = _a.theme;
36
+ return theme.components.restrictedWidthContainer.desktop.margin.right;
37
+ }));
38
+ /* This fixes overflow with margins/paddings when the parent of this component has
39
+ display: flex and flex-direction: column. With flex-direction: row (default), this
40
+ component is not overflowing horizontally.
41
+ */
42
+
43
+ var FlexContainer = styled.div.withConfig({
44
+ displayName: "RestrictedWidthContainer__FlexContainer",
45
+ componentId: "sc-k414oz-1"
46
+ })(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n width: 100%;\n"], ["\n display: flex;\n flex-direction: row;\n justify-content: center;\n width: 100%;\n"])));
47
+
48
+ var RestrictedWidthContainer = function RestrictedWidthContainer(_a) {
49
+ var children = _a.children,
50
+ className = _a.className,
51
+ hideOverflow = _a.hideOverflow;
52
+ return jsx(FlexContainer, {
53
+ children: jsx(RestrictedWidth, __assign({
54
+ className: className,
55
+ hideOverflow: hideOverflow
56
+ }, {
57
+ children: children
58
+ }), void 0)
59
+ }, void 0);
60
+ };
61
+
62
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
63
+ export { RestrictedWidthContainer, RestrictedWidthContainer as default };
@@ -0,0 +1,58 @@
1
+ import { __assign } from '../../_virtual/_tslib.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { Helmet } from 'react-helmet';
4
+ import { getCurrentLanguage } from '../utils.js';
5
+
6
+ var Seo = function Seo(_a) {
7
+ var focuskw = _a.focuskw,
8
+ title = _a.title,
9
+ metaDesc = _a.metaDesc,
10
+ opengraphTitle = _a.opengraphTitle,
11
+ opengraphDescription = _a.opengraphDescription,
12
+ opengraphImage = _a.opengraphImage,
13
+ twitterTitle = _a.twitterTitle,
14
+ twitterDescription = _a.twitterDescription,
15
+ twitterImage = _a.twitterImage,
16
+ children = _a.children;
17
+ return jsx(Helmet, __assign({
18
+ htmlAttributes: {
19
+ lang: getCurrentLanguage()
20
+ },
21
+ title: title,
22
+ meta: [{
23
+ name: 'keywords',
24
+ content: focuskw === null || focuskw === void 0 ? void 0 : focuskw.split(' ').join(',')
25
+ }, {
26
+ name: 'description',
27
+ content: metaDesc
28
+ }, {
29
+ property: 'og:type',
30
+ content: 'website'
31
+ }, {
32
+ property: 'og:title',
33
+ content: opengraphTitle || title
34
+ }, {
35
+ property: 'og:description',
36
+ content: opengraphDescription || metaDesc
37
+ }, {
38
+ property: 'og:image',
39
+ content: opengraphImage === null || opengraphImage === void 0 ? void 0 : opengraphImage.mediaItemUrl
40
+ }, {
41
+ name: 'twitter:title',
42
+ content: twitterTitle || title
43
+ }, {
44
+ name: 'twitter:description',
45
+ content: twitterDescription || metaDesc
46
+ }, {
47
+ name: 'twitter:image',
48
+ content: (twitterImage === null || twitterImage === void 0 ? void 0 : twitterImage.mediaItemUrl) || (opengraphImage === null || opengraphImage === void 0 ? void 0 : opengraphImage.mediaItemUrl)
49
+ }, {
50
+ name: 'twitter:card',
51
+ content: 'summary_large_image'
52
+ }]
53
+ }, {
54
+ children: children
55
+ }), void 0);
56
+ };
57
+
58
+ export { Seo, Seo as default };