@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,102 @@
1
+ import { __rest, __assign } from '../../_virtual/_tslib.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import 'react-multi-carousel/lib/styles.css';
4
+ import { forwardRef } from 'react';
5
+ import { getTheme, getCurrentThemeName } from '../utils.js';
6
+ import { ImageCarouselContainer, StyledImageCarousel, ImageCarouselItem, ImageContainer, StyledSVG, DynamicImage, StaticImage } from './ImageCarousel.styles.js';
7
+ import { useWindowSize } from '../../hooks/windowsize.js';
8
+ var ImageCarousel = forwardRef(function (_a, ref) {
9
+ var imageCarouselItems = _a.imageCarouselItems,
10
+ anchor = _a.anchor,
11
+ rest = __rest(_a, ["imageCarouselItems", "anchor"]);
12
+
13
+ if (!imageCarouselItems) return null;
14
+ var theme = getTheme(getCurrentThemeName());
15
+ var windowSize = useWindowSize(); // duplicate items if there are too few to fill the screen
16
+
17
+ var imageItems = imageCarouselItems.length < 9 ? imageCarouselItems.concat(imageCarouselItems) : imageCarouselItems;
18
+ var responsive = {
19
+ ultraWide: {
20
+ breakpoint: {
21
+ max: 8000,
22
+ min: 2560
23
+ },
24
+ items: 5,
25
+ partialVisibilityGutter: 0
26
+ },
27
+ desktopLarge: {
28
+ breakpoint: {
29
+ max: 2560,
30
+ min: 2000
31
+ },
32
+ items: 4,
33
+ partialVisibilityGutter: 0
34
+ },
35
+ desktopMedium: {
36
+ breakpoint: {
37
+ max: 2000,
38
+ min: parseFloat(theme.breakpoints.desktop)
39
+ },
40
+ items: 3,
41
+ partialVisibilityGutter: 0
42
+ },
43
+ desktopSmall: {
44
+ breakpoint: {
45
+ max: parseFloat(theme.breakpoints.desktop),
46
+ min: parseFloat(theme.breakpoints.tablet)
47
+ },
48
+ items: 2,
49
+ partialVisibilityGutter: 0
50
+ },
51
+ tablet: {
52
+ breakpoint: {
53
+ max: parseFloat(theme.breakpoints.tablet),
54
+ min: parseFloat(theme.breakpoints.mobile)
55
+ },
56
+ items: 2,
57
+ partialVisibilityGutter: 0
58
+ },
59
+ mobile: {
60
+ breakpoint: {
61
+ max: parseFloat(theme.breakpoints.mobile),
62
+ min: 0
63
+ },
64
+ items: 1,
65
+ partialVisibilityGutter: 0
66
+ }
67
+ };
68
+ return jsx(ImageCarouselContainer, __assign({
69
+ ref: ref,
70
+ id: anchor
71
+ }, {
72
+ children: jsx(StyledImageCarousel, __assign({
73
+ responsive: responsive,
74
+ centerMode: windowSize.width > 480 ? true : undefined,
75
+ partialVisbile: windowSize.width <= 480 ? true : false,
76
+ showDots: false,
77
+ infinite: true
78
+ }, rest, {
79
+ children: imageItems.map(function (item, i) {
80
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
81
+
82
+ return jsx(ImageCarouselItem, __assign({
83
+ landscape: i % 2 === 0
84
+ }, {
85
+ children: jsx(ImageContainer, __assign({
86
+ landscape: i % 2 === 0
87
+ }, {
88
+ children: ((_b = (_a = item.image) === null || _a === void 0 ? void 0 : _a.mimeType) === null || _b === void 0 ? void 0 : _b.includes('svg')) ? jsx(StyledSVG, {
89
+ src: (_c = item === null || item === void 0 ? void 0 : item.image) === null || _c === void 0 ? void 0 : _c.mediaItemUrl
90
+ }, void 0) : ((_e = (_d = item.image) === null || _d === void 0 ? void 0 : _d.localFile) === null || _e === void 0 ? void 0 : _e.childImageSharp) ? jsx(DynamicImage, {
91
+ image: (_h = (_g = (_f = item === null || item === void 0 ? void 0 : item.image) === null || _f === void 0 ? void 0 : _f.localFile) === null || _g === void 0 ? void 0 : _g.childImageSharp) === null || _h === void 0 ? void 0 : _h.gatsbyImageData,
92
+ alt: ""
93
+ }, void 0) : jsx(StaticImage, {
94
+ src: (_j = item === null || item === void 0 ? void 0 : item.image) === null || _j === void 0 ? void 0 : _j.mediaItemUrl
95
+ }, void 0)
96
+ }), void 0)
97
+ }), i);
98
+ })
99
+ }), void 0)
100
+ }), void 0);
101
+ });
102
+ export { ImageCarousel, ImageCarousel as default };
@@ -0,0 +1,96 @@
1
+ import { __makeTemplateObject } from '../../_virtual/_tslib.js';
2
+ import MultiCarousel from 'react-multi-carousel';
3
+ import styled, { css } from 'styled-components';
4
+ import { GatsbyImage } from 'gatsby-plugin-image';
5
+ import media from '../../styles/media.js';
6
+ var ImageCarouselContainer = styled.div.withConfig({
7
+ displayName: "ImageCarouselstyles__ImageCarouselContainer",
8
+ componentId: "sc-f0j8g6-0"
9
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n overflow-x: hidden;\n"], ["\n overflow-x: hidden;\n"])));
10
+ var StyledImageCarousel = styled(MultiCarousel).withConfig({
11
+ displayName: "ImageCarouselstyles__StyledImageCarousel",
12
+ componentId: "sc-f0j8g6-1"
13
+ })(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 100%;\n align-items: stretch;\n\n .react-multiple-carousel__arrow {\n top: 45%;\n z-index: 99;\n margin-right: ", ";\n overflow: overlay;\n\n ", "\n\n :before {\n color: ", ";\n }\n }\n\n .react-multiple-carousel__arrow--left {\n ", ";\n }\n\n .react-multiple-carousel__arrow--right {\n ", ";\n }\n"], ["\n width: 100%;\n align-items: stretch;\n\n .react-multiple-carousel__arrow {\n top: 45%;\n z-index: 99;\n margin-right: ", ";\n overflow: overlay;\n\n ", "\n\n :before {\n color: ", ";\n }\n }\n\n .react-multiple-carousel__arrow--left {\n ", ";\n }\n\n .react-multiple-carousel__arrow--right {\n ", ";\n }\n"])), function (_a) {
14
+ var theme = _a.theme;
15
+ return theme.spacings.spacing4;
16
+ }, function (_a) {
17
+ var theme = _a.theme;
18
+ return theme.components.imageCarousel.arrowBackgroundColor && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n filter: brightness(1);\n background-color: ", " !important;\n\n :hover {\n filter: brightness(0.8);\n }\n "], ["\n filter: brightness(1);\n background-color: ", " !important;\n\n :hover {\n filter: brightness(0.8);\n }\n "])), theme.components.imageCarousel.arrowBackgroundColor);
19
+ }, function (_a) {
20
+ var theme = _a.theme;
21
+ return theme.components.imageCarousel.arrowColor;
22
+ }, media.widerThanRestrictedWidthContainer(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n left: 15%;\n "], ["\n left: 15%;\n "]))), media.widerThanRestrictedWidthContainer(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n right: 15%;\n "], ["\n right: 15%;\n "]))));
23
+ var ImageCarouselItem = styled.div.withConfig({
24
+ displayName: "ImageCarouselstyles__ImageCarouselItem",
25
+ componentId: "sc-f0j8g6-2"
26
+ })(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n height: 100%;\n min-height: 25rem;\n display: flex;\n align-items: center;\n\n margin: ", ";\n\n ", "\n\n ", "\n\n ", "\n"], ["\n height: 100%;\n min-height: 25rem;\n display: flex;\n align-items: center;\n\n margin: ", ";\n\n ", "\n\n ", "\n\n ", "\n"])), function (_a) {
27
+ var theme = _a.theme;
28
+ return "0 " + theme.spacings.spacing16 + " !important";
29
+ }, media.mobileLarge(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin: ", ";\n\n ", "\n "], ["\n margin: ", ";\n\n ", "\n "])), function (_a) {
30
+ var theme = _a.theme;
31
+ return "0 " + theme.spacings.spacing32 + " !important";
32
+ }, function (_a) {
33
+ var landscape = _a.landscape;
34
+ return landscape && css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin: ", ";\n "], ["\n margin: ", ";\n "])), function (_a) {
35
+ var theme = _a.theme;
36
+ return "0 -" + theme.spacings.spacing16 + " !important";
37
+ });
38
+ }), media.tablet(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n margin-right: ", ";\n margin-left: ", ";\n\n ", "\n "], ["\n margin-right: ", ";\n margin-left: ", ";\n\n ", "\n "])), function (_a) {
39
+ var theme = _a.theme;
40
+ return theme.spacings.spacing32;
41
+ }, function (_a) {
42
+ var theme = _a.theme;
43
+ return theme.spacings.spacing32;
44
+ }, function (_a) {
45
+ var landscape = _a.landscape;
46
+ return landscape && css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n margin: ", ";\n "], ["\n margin: ", ";\n "])), function (_a) {
47
+ var theme = _a.theme;
48
+ return "0 -" + theme.spacings.spacing16 + " !important";
49
+ });
50
+ }), media.desktop(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n margin: ", ";\n\n ", "\n "], ["\n margin: ", ";\n\n ", "\n "])), function (_a) {
51
+ var theme = _a.theme;
52
+ return "0 " + theme.spacings.spacing64 + " !important";
53
+ }, function (_a) {
54
+ var landscape = _a.landscape;
55
+ return landscape && css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n margin: ", ";\n "], ["\n margin: ", ";\n "])), function (_a) {
56
+ var theme = _a.theme;
57
+ return "0 -" + theme.spacings.spacing48 + " !important";
58
+ });
59
+ }));
60
+ var ImageContainer = styled.div.withConfig({
61
+ displayName: "ImageCarouselstyles__ImageContainer",
62
+ componentId: "sc-f0j8g6-3"
63
+ })(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n width: 100%;\n height: 100% !important;\n padding: ", ";\n\n ", "\n\n ", "\n\n ", "\n\n // tablet large\n @media screen and (min-width: 896px) {\n height: 100% !important;\n padding: 0;\n\n ", "\n }\n\n ", "\n"], ["\n width: 100%;\n height: 100% !important;\n padding: ", ";\n\n ", "\n\n ", "\n\n ", "\n\n // tablet large\n @media screen and (min-width: 896px) {\n height: 100% !important;\n padding: 0;\n\n ", "\n }\n\n ", "\n"])), function (_a) {
64
+ var theme = _a.theme;
65
+ return "0 " + theme.spacings.spacing56;
66
+ }, function (_a) {
67
+ var landscape = _a.landscape;
68
+ return landscape && css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n height: 50% !important;\n padding: 0;\n "], ["\n height: 50% !important;\n padding: 0;\n "])));
69
+ }, media.mobileLarge(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n height: 90% !important;\n padding: 0;\n\n ", "\n "], ["\n height: 90% !important;\n padding: 0;\n\n ", "\n "])), function (_a) {
70
+ var landscape = _a.landscape;
71
+ return landscape && css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n height: 45% !important;\n "], ["\n height: 45% !important;\n "])));
72
+ }), media.tablet(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n height: 95% !important;\n padding: 0;\n\n ", "\n "], ["\n height: 95% !important;\n padding: 0;\n\n ", "\n "])), function (_a) {
73
+ var landscape = _a.landscape;
74
+ return landscape && css(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n height: 45% !important;\n "], ["\n height: 45% !important;\n "])));
75
+ }), function (_a) {
76
+ var landscape = _a.landscape;
77
+ return landscape && css(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n height: 55% !important;\n "], ["\n height: 55% !important;\n "])));
78
+ }, media.desktop(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n height: 100% !important;\n padding: 0;\n\n ", "\n "], ["\n height: 100% !important;\n padding: 0;\n\n ", "\n "])), function (_a) {
79
+ var landscape = _a.landscape;
80
+ return landscape && css(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n height: 65% !important;\n "], ["\n height: 65% !important;\n "])));
81
+ }));
82
+ var ImageCSS = css(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n pointer-events: none;\n user-select: none;\n"], ["\n width: 100%;\n height: 100%;\n object-fit: cover;\n pointer-events: none;\n user-select: none;\n"])));
83
+ var StaticImage = styled.img.withConfig({
84
+ displayName: "ImageCarouselstyles__StaticImage",
85
+ componentId: "sc-f0j8g6-4"
86
+ })(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), ImageCSS);
87
+ var DynamicImage = styled(GatsbyImage).withConfig({
88
+ displayName: "ImageCarouselstyles__DynamicImage",
89
+ componentId: "sc-f0j8g6-5"
90
+ })(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), ImageCSS);
91
+ var StyledSVG = styled.img.withConfig({
92
+ displayName: "ImageCarouselstyles__StyledSVG",
93
+ componentId: "sc-f0j8g6-6"
94
+ })(templateObject_25 || (templateObject_25 = __makeTemplateObject(["\n ", ";\n object-fit: unset;\n"], ["\n ", ";\n object-fit: unset;\n"])), ImageCSS);
95
+ 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, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25;
96
+ export { DynamicImage, ImageCarouselContainer, ImageCarouselItem, ImageContainer, StaticImage, StyledImageCarousel, StyledSVG };
@@ -0,0 +1,72 @@
1
+ import { __rest, __assign } from '../../_virtual/_tslib.js';
2
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { LanguageSelect, SimpleSelectorContainer, StyledLinkButton, StyledLink } from './LanguageSelector.styles.js';
5
+ import { getTheme, getCurrentThemeName, parseInternalLink } from '../utils.js';
6
+ var LanguageSelector = forwardRef(function (_a, ref) {
7
+ var translations = _a.translations,
8
+ simple = _a.simple,
9
+ onClickActive = _a.onClickActive,
10
+ selectProps = _a.selectProps,
11
+ rest = __rest(_a, ["translations", "simple", "onClickActive", "selectProps"]);
12
+
13
+ var theme = getTheme(getCurrentThemeName()); // If the site has a specific language enabled but the current page
14
+ // has no translation for that language, the language selector
15
+ // will not show that language in the current page
16
+
17
+ var allAvailableLanguages = translations.order.map(function (lang, i) {
18
+ return {
19
+ key: i,
20
+ value: lang,
21
+ label: lang
22
+ };
23
+ }).filter(function (lang) {
24
+ return translations.paths[lang.value];
25
+ });
26
+ var languageOptions = allAvailableLanguages.filter(function (option) {
27
+ return option.value !== translations.currentLanguage;
28
+ });
29
+
30
+ var handleChange = function handleChange(value) {
31
+ window.location.href = parseInternalLink(translations.paths[value]);
32
+ };
33
+
34
+ return jsxs(Fragment, {
35
+ children: [!simple && jsx(LanguageSelect, __assign({
36
+ options: languageOptions,
37
+ defaultValue: translations.currentLanguage,
38
+ onChange: function onChange(value) {
39
+ return handleChange(value);
40
+ },
41
+ bordered: false,
42
+ dropdownStyle: {
43
+ background: theme.components.languageSelector.dropdownBackground,
44
+ position: 'fixed'
45
+ },
46
+ dropdownAlign: {
47
+ offset: [0, 1]
48
+ }
49
+ }, selectProps), void 0), simple && jsx(SimpleSelectorContainer, __assign({}, rest, {
50
+ ref: ref
51
+ }, {
52
+ children: allAvailableLanguages.map(function (lang) {
53
+ return jsx(Fragment, {
54
+ children: lang.value === translations.currentLanguage && simple ? jsx(StyledLinkButton, __assign({
55
+ onClick: onClickActive ? function () {
56
+ return onClickActive();
57
+ } : undefined,
58
+ active: lang.value === translations.currentLanguage
59
+ }, {
60
+ children: lang.value
61
+ }), "translation-" + lang.value) : jsx(StyledLink, __assign({
62
+ href: translations.paths[lang.value],
63
+ active: lang.value === translations.currentLanguage
64
+ }, {
65
+ children: lang.value
66
+ }), "translation-" + lang.value)
67
+ }, void 0);
68
+ })
69
+ }), void 0)]
70
+ }, void 0);
71
+ });
72
+ export { LanguageSelector, LanguageSelector as default };
@@ -0,0 +1,72 @@
1
+ import { __makeTemplateObject } from '../../_virtual/_tslib.js';
2
+ import styled, { css } from 'styled-components';
3
+ import { Select } from '@sok/design-system';
4
+ /*
5
+ Note: Some of the dropdowb styling is applied in GlobalStyle.tsx due to
6
+ antd Select rendering html elements outside of this component.
7
+ */
8
+
9
+ var LanguageSelect = styled(Select).withConfig({
10
+ displayName: "LanguageSelectorstyles__LanguageSelect",
11
+ componentId: "sc-n828tp-0"
12
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .ant-select-selection-item {\n min-width: 50px;\n padding-right: ", " !important;\n color: ", ";\n font-family: ", " !important;\n font-size: ", " !important;\n font-weight: ", " !important;\n }\n\n &.ant-select-focused {\n outline: 1px auto ", ";\n }\n\n .ant-select-arrow {\n color: ", " !important;\n }\n"], ["\n .ant-select-selection-item {\n min-width: 50px;\n padding-right: ", " !important;\n color: ", ";\n font-family: ", " !important;\n font-size: ", " !important;\n font-weight: ", " !important;\n }\n\n &.ant-select-focused {\n outline: 1px auto ", ";\n }\n\n .ant-select-arrow {\n color: ", " !important;\n }\n"])), function (_a) {
13
+ var theme = _a.theme;
14
+ return theme.spacings.spacing24;
15
+ }, function (_a) {
16
+ var theme = _a.theme;
17
+ return theme.components.languageSelector.textColor;
18
+ }, function (_a) {
19
+ var theme = _a.theme;
20
+ return theme.components.languageSelector.fontFamily;
21
+ }, function (_a) {
22
+ var theme = _a.theme;
23
+ return theme.components.languageSelector.fontSizes.mobile.fontSize;
24
+ }, function (_a) {
25
+ var theme = _a.theme;
26
+ return theme.components.languageSelector.fontWeight;
27
+ }, function (_a) {
28
+ var theme = _a.theme;
29
+ return theme.components.languageSelector.focusColor;
30
+ }, function (_a) {
31
+ var theme = _a.theme;
32
+ return theme.components.languageSelector.arrowColor;
33
+ });
34
+ var linkStyles = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: block;\n\n color: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n\n ", "\n"], ["\n display: block;\n\n color: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n\n ", "\n"])), function (_a) {
35
+ var theme = _a.theme;
36
+ return theme.components.globalStyle.a.color;
37
+ }, function (_a) {
38
+ var theme = _a.theme;
39
+ return theme.components.globalStyle.p.fontFamily;
40
+ }, function (_a) {
41
+ var theme = _a.theme;
42
+ return theme.components.globalStyle.p.fontWeight;
43
+ }, function (_a) {
44
+ var theme = _a.theme;
45
+ return theme.components.globalStyle.p.fontSizes.mobile.fontSize;
46
+ }, function (_a) {
47
+ var theme = _a.theme;
48
+ return theme.components.globalStyle.p.fontSizes.mobile.lineHeight;
49
+ }, function (_a) {
50
+ var active = _a.active;
51
+ return active && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (_a) {
52
+ var theme = _a.theme;
53
+ return theme.components.languageSelector.activeColor;
54
+ });
55
+ });
56
+ var StyledLink = styled.a.withConfig({
57
+ displayName: "LanguageSelectorstyles__StyledLink",
58
+ componentId: "sc-n828tp-1"
59
+ })(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), linkStyles);
60
+ var StyledLinkButton = styled.button.withConfig({
61
+ displayName: "LanguageSelectorstyles__StyledLinkButton",
62
+ componentId: "sc-n828tp-2"
63
+ })(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background: transparent;\n border: none;\n padding: 0;\n\n ", "\n"], ["\n background: transparent;\n border: none;\n padding: 0;\n\n ", "\n"])), linkStyles);
64
+ var SimpleSelectorContainer = styled.div.withConfig({
65
+ displayName: "LanguageSelectorstyles__SimpleSelectorContainer",
66
+ componentId: "sc-n828tp-3"
67
+ })(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n column-gap: ", ";\n"], ["\n display: flex;\n flex-direction: row;\n column-gap: ", ";\n"])), function (_a) {
68
+ var theme = _a.theme;
69
+ return theme.spacings.spacing16;
70
+ });
71
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
72
+ export { LanguageSelect, SimpleSelectorContainer, StyledLink, StyledLinkButton };
@@ -0,0 +1,15 @@
1
+ import { __rest, __assign } from '../../_virtual/_tslib.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { MainContainer } from './Layout.styles.js';
5
+ var Layout = forwardRef(function (_a, ref) {
6
+ var children = _a.children,
7
+ rest = __rest(_a, ["children"]);
8
+
9
+ return jsx(MainContainer, __assign({}, rest, {
10
+ ref: ref
11
+ }, {
12
+ children: children
13
+ }), void 0);
14
+ });
15
+ export { Layout, Layout as default };
@@ -0,0 +1,8 @@
1
+ import { __makeTemplateObject } from '../../_virtual/_tslib.js';
2
+ import styled from 'styled-components';
3
+ var MainContainer = styled.div.withConfig({
4
+ displayName: "Layoutstyles__MainContainer",
5
+ componentId: "sc-1ak65wr-0"
6
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n"], ["\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n"])));
7
+ var templateObject_1;
8
+ export { MainContainer };
@@ -0,0 +1,25 @@
1
+ import { __rest, __assign } from '../../_virtual/_tslib.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { StyledList } from './List.styles.js';
4
+ import { parseHtmlContent } from '../utils.js';
5
+
6
+ var List = function List(_a) {
7
+ var textColor = _a.textColor,
8
+ values = _a.values,
9
+ ordered = _a.ordered,
10
+ className = _a.className,
11
+ anchor = _a.anchor,
12
+ rest = __rest(_a, ["textColor", "values", "ordered", "className", "anchor"]);
13
+
14
+ return jsx(StyledList, __assign({
15
+ id: anchor,
16
+ as: ordered ? 'ol' : 'ul',
17
+ textColor: textColor,
18
+ dangerouslySetInnerHTML: {
19
+ __html: parseHtmlContent(values)
20
+ },
21
+ className: className
22
+ }, rest), void 0);
23
+ };
24
+
25
+ export { List, List as default };
@@ -0,0 +1,11 @@
1
+ import { __makeTemplateObject } from '../../_virtual/_tslib.js';
2
+ import styled from 'styled-components';
3
+ var StyledList = styled.div.withConfig({
4
+ displayName: "Liststyles__StyledList",
5
+ componentId: "sc-1d3hz2-0"
6
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n li {\n color: ", ";\n }\n"], ["\n li {\n color: ", ";\n }\n"])), function (_a) {
7
+ var textColor = _a.textColor;
8
+ return textColor;
9
+ });
10
+ var templateObject_1;
11
+ export { StyledList };
@@ -0,0 +1,17 @@
1
+ import { __assign } from '../../_virtual/_tslib.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { Wrapper } from './MarginWrapper.styles.js';
4
+
5
+ var MarginWrapper = function MarginWrapper(_a) {
6
+ var children = _a.children,
7
+ smallBottomMargin = _a.smallBottomMargin,
8
+ noBottomMargin = _a.noBottomMargin;
9
+ return jsx(Wrapper, __assign({
10
+ smallBottomMargin: smallBottomMargin,
11
+ noBottomMargin: noBottomMargin
12
+ }, {
13
+ children: children
14
+ }), void 0);
15
+ };
16
+
17
+ export { MarginWrapper, MarginWrapper as default };
@@ -0,0 +1,38 @@
1
+ import { __makeTemplateObject } from '../../_virtual/_tslib.js';
2
+ import styled, { css } from 'styled-components';
3
+ import media from '../../styles/media.js';
4
+ /*
5
+ More detailed documentation on layout: https://confluence.sok.fi/display/DIGIALUSTAT/Page+layout+rules
6
+ Also see src/components/utils.ts helper functions
7
+ */
8
+
9
+ var Wrapper = styled.div.withConfig({
10
+ displayName: "MarginWrapperstyles__Wrapper",
11
+ componentId: "sc-13ewons-0"
12
+ })(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n /*\n Default bottom margin between blocks\n */\n\n margin-bottom: ", ";\n\n ", "\n\n ", "\n\n /*\n Bottom margin needs to be removed for a columns block with\n background color when the next block is also a columns block with\n background color\n OR\n if the block last columns block with background color on the page\n */\n ", "\n\n /*\n Smaller bottom margin needs to be used for consecutive text blocks\n */\n ", "\n"], ["\n /*\n Default bottom margin between blocks\n */\n\n margin-bottom: ", ";\n\n ", "\n\n ", "\n\n /*\n Bottom margin needs to be removed for a columns block with\n background color when the next block is also a columns block with\n background color\n OR\n if the block last columns block with background color on the page\n */\n ", "\n\n /*\n Smaller bottom margin needs to be used for consecutive text blocks\n */\n ", "\n"])), function (_a) {
13
+ var theme = _a.theme;
14
+ return theme.components.marginwrapper.block.mobile.margin.bottom;
15
+ }, media.tablet(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-bottom: ", ";\n "], ["\n margin-bottom: ", ";\n "])), function (_a) {
16
+ var theme = _a.theme;
17
+ return theme.components.marginwrapper.block.tablet.margin.bottom;
18
+ }), media.desktop(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-bottom: ", ";\n "], ["\n margin-bottom: ", ";\n "])), function (_a) {
19
+ var theme = _a.theme;
20
+ return theme.components.marginwrapper.block.desktop.margin.bottom;
21
+ }), function (_a) {
22
+ var noBottomMargin = _a.noBottomMargin;
23
+ return noBottomMargin && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-bottom: 0;\n\n ", "\n\n ", "\n "], ["\n margin-bottom: 0;\n\n ", "\n\n ", "\n "])), media.tablet(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-bottom: 0;\n "], ["\n margin-bottom: 0;\n "]))), media.desktop(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-bottom: 0;\n "], ["\n margin-bottom: 0;\n "]))));
24
+ }, function (_a) {
25
+ var smallBottomMargin = _a.smallBottomMargin;
26
+ return smallBottomMargin && css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n margin-bottom: ", ";\n\n ", "\n\n ", "\n "], ["\n margin-bottom: ", ";\n\n ", "\n\n ", "\n "])), function (_a) {
27
+ var theme = _a.theme;
28
+ return theme.components.marginwrapper.textBlock.mobile.margin.bottom;
29
+ }, media.tablet(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin-bottom: ", ";\n "], ["\n margin-bottom: ", ";\n "])), function (_a) {
30
+ var theme = _a.theme;
31
+ return theme.components.marginwrapper.textBlock.tablet.margin.bottom;
32
+ }), media.desktop(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-bottom: ", ";\n "], ["\n margin-bottom: ", ";\n "])), function (_a) {
33
+ var theme = _a.theme;
34
+ return theme.components.marginwrapper.textBlock.desktop.margin.bottom;
35
+ }));
36
+ });
37
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
38
+ export { Wrapper };
@@ -0,0 +1,132 @@
1
+ import { __assign } from '../../../_virtual/_tslib.js';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import { OverlayCardContainer, DynamicImage, StaticImage, SvgContainer, SvgImage, OverlayBackground, OverlayLink, TextContainer, Title, Description, OverlayCardContainerLink, OverlayBackgroundHover, OverlayTextContainerHover } from './OverlayCard.styles.js';
4
+ import { parseInternalLink, parseLink } from '../../utils.js';
5
+ import { OverlayLogicOptions } from '../OverlayCards.types.js';
6
+
7
+ var OverlayCardShowOnClick = function OverlayCardShowOnClick(_a) {
8
+ var _b, _c, _d;
9
+
10
+ var showLink = _a.showLink,
11
+ onClick = _a.onClick,
12
+ item = _a.item,
13
+ href = _a.href,
14
+ openInNewTab = _a.openInNewTab;
15
+ var title = item.title,
16
+ description = item.description,
17
+ image = item.image,
18
+ svg = item.svg;
19
+ return jsxs(OverlayCardContainer, __assign({
20
+ role: "button",
21
+ onClick: onClick
22
+ }, {
23
+ children: [(image === null || image === void 0 ? void 0 : image.mimeType.includes('image')) && ((_b = image === null || image === void 0 ? void 0 : image.localFile) === null || _b === void 0 ? void 0 : _b.childImageSharp) && jsx(DynamicImage, {
24
+ image: (_c = image.localFile.childImageSharp) === null || _c === void 0 ? void 0 : _c.gatsbyImageData,
25
+ alt: ""
26
+ }, void 0), (image === null || image === void 0 ? void 0 : image.mimeType.includes('image')) && !((_d = image === null || image === void 0 ? void 0 : image.localFile) === null || _d === void 0 ? void 0 : _d.childImageSharp) && jsx(StaticImage, {
27
+ src: image.mediaItemUrl,
28
+ alt: ""
29
+ }, void 0), svg && jsx(SvgContainer, {
30
+ children: jsx(SvgImage, {
31
+ src: svg.mediaItemUrl
32
+ }, void 0)
33
+ }, void 0), showLink && jsxs(Fragment, {
34
+ children: [jsx(OverlayBackground, {}, void 0), jsx(OverlayLink, __assign({
35
+ target: openInNewTab ? '__blank' : undefined,
36
+ rel: openInNewTab ? 'noopener' : undefined,
37
+ href: href
38
+ }, {
39
+ children: jsxs(TextContainer, {
40
+ children: [title && jsx(Title, {
41
+ children: title
42
+ }, void 0), jsx(Description, {
43
+ dangerouslySetInnerHTML: {
44
+ __html: description
45
+ }
46
+ }, void 0)]
47
+ }, void 0)
48
+ }), void 0)]
49
+ }, void 0)]
50
+ }), void 0);
51
+ };
52
+
53
+ var OverlayCardShowOnHover = function OverlayCardShowOnHover(_a) {
54
+ var _b, _c, _d;
55
+
56
+ var item = _a.item,
57
+ alwaysShowInMobile = _a.alwaysShowInMobile,
58
+ href = _a.href,
59
+ openInNewTab = _a.openInNewTab;
60
+ var title = item.title,
61
+ description = item.description,
62
+ image = item.image,
63
+ svg = item.svg;
64
+ return jsxs(OverlayCardContainerLink, __assign({
65
+ target: openInNewTab ? '__blank' : undefined,
66
+ rel: openInNewTab ? 'noopener' : undefined,
67
+ href: href
68
+ }, {
69
+ children: [(image === null || image === void 0 ? void 0 : image.mimeType.includes('image')) && ((_b = image === null || image === void 0 ? void 0 : image.localFile) === null || _b === void 0 ? void 0 : _b.childImageSharp) && jsx(DynamicImage, {
70
+ image: (_c = image.localFile.childImageSharp) === null || _c === void 0 ? void 0 : _c.gatsbyImageData,
71
+ alt: ""
72
+ }, void 0), (image === null || image === void 0 ? void 0 : image.mimeType.includes('image')) && !((_d = image === null || image === void 0 ? void 0 : image.localFile) === null || _d === void 0 ? void 0 : _d.childImageSharp) && jsx(StaticImage, {
73
+ src: image.mediaItemUrl,
74
+ alt: ""
75
+ }, void 0), svg && jsx(SvgContainer, {
76
+ children: jsx(SvgImage, {
77
+ src: svg.mediaItemUrl
78
+ }, void 0)
79
+ }, void 0), jsx(OverlayBackgroundHover, {
80
+ alwaysShowInMobile: alwaysShowInMobile
81
+ }, void 0), jsx(OverlayTextContainerHover, __assign({
82
+ alwaysShowInMobile: alwaysShowInMobile
83
+ }, {
84
+ children: jsxs(TextContainer, {
85
+ children: [title && jsx(Title, {
86
+ children: title
87
+ }, void 0), jsx(Description, {
88
+ dangerouslySetInnerHTML: {
89
+ __html: description
90
+ }
91
+ }, void 0)]
92
+ }, void 0)
93
+ }), void 0)]
94
+ }), void 0);
95
+ };
96
+
97
+ var OverlayCard = function OverlayCard(_a) {
98
+ var enableLinks = _a.enableLinks,
99
+ showLink = _a.showLink,
100
+ onClick = _a.onClick,
101
+ item = _a.item,
102
+ overlayLogic = _a.overlayLogic;
103
+ var externalLink = item.externalLink,
104
+ linkToPage = item.linkToPage;
105
+ var parsedInternalLink = (linkToPage === null || linkToPage === void 0 ? void 0 : linkToPage.uri) ? parseInternalLink(linkToPage.uri) : undefined;
106
+ var parsedExternalLink = externalLink ? parseLink(externalLink) : undefined;
107
+ /* It is possible to add both internal and external link to the card while creating the content,
108
+ so if the card has an internal link, that will be used as href. If enableLinks is false, href will
109
+ always be undefined */
110
+
111
+ var href = enableLinks ? parsedInternalLink || parsedExternalLink : undefined;
112
+ var openInNewTab = href === parsedExternalLink;
113
+
114
+ if (overlayLogic === OverlayLogicOptions.SHOW_DESCRIPTION_ON_CLICK) {
115
+ return jsx(OverlayCardShowOnClick, {
116
+ openInNewTab: openInNewTab,
117
+ href: href,
118
+ enableLinks: enableLinks,
119
+ showLink: showLink,
120
+ onClick: onClick,
121
+ item: item
122
+ }, void 0);
123
+ } else if (overlayLogic === OverlayLogicOptions.SHOW_DESCRIPTION_ON_HOVER || overlayLogic === OverlayLogicOptions.ALWAYS_SHOW_DESCRIPTION_IN_MOBILE) return jsx(OverlayCardShowOnHover, {
124
+ openInNewTab: openInNewTab,
125
+ href: href,
126
+ alwaysShowInMobile: overlayLogic === OverlayLogicOptions.ALWAYS_SHOW_DESCRIPTION_IN_MOBILE,
127
+ enableLinks: enableLinks,
128
+ item: item
129
+ }, void 0);else return null;
130
+ };
131
+
132
+ export { OverlayCard, OverlayCard as default };