@jetbrains/kotlin-web-site-ui 3.1.0 → 4.0.0-alpha.2

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.
Files changed (151) hide show
  1. package/out/blocks/formik-wrapper/index.css +8 -0
  2. package/out/blocks/formik-wrapper/index.js +4 -0
  3. package/out/blocks/formik-wrapper/input.js +38 -0
  4. package/out/blocks/formik-wrapper/privacy-checkbox.js +52 -0
  5. package/out/blocks/formik-wrapper/privacy-notice.js +49 -0
  6. package/out/blocks/formik-wrapper/privacy-notice.module.pcss.js +6 -0
  7. package/out/blocks/formik-wrapper/submit-button.js +21 -0
  8. package/out/components/cta-block/cta-block.js +45 -0
  9. package/out/components/cta-block/cta-block.module.pcss.js +8 -0
  10. package/out/components/cta-block/index.css +36 -0
  11. package/out/components/cta-block/index.js +3 -0
  12. package/out/components/footer/footer.js +73 -0
  13. package/out/components/footer/footer.module.pcss.js +13 -0
  14. package/out/components/footer/index.css +242 -0
  15. package/out/components/footer/index.js +3 -0
  16. package/out/components/footer/logo/jetbrains-logo.svg.js +38 -0
  17. package/out/components/footer/logo/logo.js +14 -0
  18. package/out/components/footer/logo/logo.module.pcss.js +4 -0
  19. package/out/components/footer/nav/nav-data.js +30 -0
  20. package/out/components/footer/nav/nav-item.js +31 -0
  21. package/out/components/footer/nav/nav-item.module.pcss.js +5 -0
  22. package/out/components/footer/nav/nav-list.js +18 -0
  23. package/out/components/footer/nav/nav-list.module.pcss.js +4 -0
  24. package/out/components/footer/social-list/social-data.js +38 -0
  25. package/out/components/footer/social-list/social-item/social-item.js +23 -0
  26. package/out/components/footer/social-list/social-item/social-item.module.pcss.js +5 -0
  27. package/out/components/footer/social-list/social-list.js +14 -0
  28. package/out/components/footer/social-list/social-list.module.pcss.js +4 -0
  29. package/out/components/footer/social-list/svg/github-logo.svg.js +35 -0
  30. package/out/components/footer/social-list/svg/reddit-logo.svg.js +33 -0
  31. package/out/components/footer/social-list/svg/slack-logo.svg.js +33 -0
  32. package/out/components/footer/social-list/svg/stackoverflow-logo.svg.js +36 -0
  33. package/out/components/footer/social-list/svg/twitter-logo.svg.js +33 -0
  34. package/out/components/footer/social-list/svg/youtube-logo.svg.js +35 -0
  35. package/out/components/grid/index.css +1081 -0
  36. package/out/components/grid/index.js +1 -0
  37. package/out/components/header/consts.js +3 -0
  38. package/out/components/header/header.js +68 -0
  39. package/out/components/header/header.module.pcss.js +6 -0
  40. package/out/components/header/horizontal-menu/horizontal-menu.js +110 -0
  41. package/out/components/header/horizontal-menu/horizontal-menu.module.pcss.js +16 -0
  42. package/out/components/header/index.css +402 -0
  43. package/out/components/header/index.js +4 -0
  44. package/out/components/header/logo-large/kotlin-logo-large.svg.js +53 -0
  45. package/out/components/header/logo-large/logo-large.js +40 -0
  46. package/out/components/header/logo-large/logo-large.module.pcss.js +6 -0
  47. package/out/components/header/logo-small/kotlin-logo-small.svg.js +47 -0
  48. package/out/components/header/logo-small/logo-small.js +33 -0
  49. package/out/components/header/logo-small/logo-small.module.pcss.js +7 -0
  50. package/out/components/header/menu-popup/menu-button/close-icon.svg.js +35 -0
  51. package/out/components/header/menu-popup/menu-button/hamburger-icon.svg.js +35 -0
  52. package/out/components/header/menu-popup/menu-button/menu-button.js +22 -0
  53. package/out/components/header/menu-popup/menu-button/menu-button.module.pcss.js +4 -0
  54. package/out/components/header/menu-popup/menu-popup.js +104 -0
  55. package/out/components/header/menu-popup/menu-popup.module.pcss.js +9 -0
  56. package/out/components/header/nav-scheme.js +135 -0
  57. package/out/components/header/search-button/search-button.js +22 -0
  58. package/out/components/header/search-button/search-button.module.pcss.js +5 -0
  59. package/out/components/header/search-button/search.svg.js +34 -0
  60. package/out/components/popup/index.css +35 -0
  61. package/out/components/popup/index.js +3 -0
  62. package/out/components/popup/popup.js +61 -0
  63. package/out/components/popup/popup.module.pcss.js +6 -0
  64. package/out/components/quotes-slider/index.css +86 -0
  65. package/out/components/quotes-slider/index.js +3 -0
  66. package/out/components/quotes-slider/quites-slider.js +100 -0
  67. package/out/components/quotes-slider/quote.svg.js +33 -0
  68. package/out/components/quotes-slider/quotes-slider.module.pcss.js +13 -0
  69. package/out/components/quotes-slider/slider-arrow.svg.js +33 -0
  70. package/out/components/top-menu/dropdown-menu/arrow-dropdown-icon.svg.js +34 -0
  71. package/out/components/top-menu/dropdown-menu/dropdown-menu.js +81 -0
  72. package/out/components/top-menu/dropdown-menu/dropdown-menu.module.pcss.js +14 -0
  73. package/out/components/top-menu/horizontal-menu/horizontal-menu.js +48 -0
  74. package/out/components/top-menu/horizontal-menu/horizontal-menu.module.pcss.js +6 -0
  75. package/out/components/top-menu/index.css +224 -0
  76. package/out/components/top-menu/index.js +3 -0
  77. package/out/components/top-menu/top-menu.js +51 -0
  78. package/out/components/top-menu/top-menu.module.pcss.js +6 -0
  79. package/out/components/typography/create-text-cn.js +26 -0
  80. package/out/components/typography/hooks.js +6 -0
  81. package/out/components/typography/index.css +176 -0
  82. package/out/components/typography/index.js +3 -0
  83. package/out/components/youtube-player/index.css +119 -0
  84. package/out/components/youtube-player/index.js +3 -0
  85. package/out/components/youtube-player/loading_24.svg.js +31 -0
  86. package/out/components/youtube-player/play_24.svg.js +31 -0
  87. package/out/components/youtube-player/utils.js +28 -0
  88. package/out/components/youtube-player/youtube-player.js +152 -0
  89. package/out/components/youtube-player/youtube-player.module.pcss.js +16 -0
  90. package/out/packages/data-services/index.js +9 -0
  91. package/out/packages/data-services/marketo-submiter.js +62 -0
  92. package/out/packages/data-services/privacy-consent-ids.json.js +5 -0
  93. package/out/packages/data-services/privacy-consent-service.js +44 -0
  94. package/out/packages/data-services/urls.js +4 -0
  95. package/{dist → out}/svg/kotlin_64.svg +0 -0
  96. package/package.json +19 -2
  97. package/dist/ctaBlock.css +0 -2
  98. package/dist/ctaBlock.css.map +0 -1
  99. package/dist/ctaBlock.js +0 -3
  100. package/dist/ctaBlock.js.LICENSE.txt +0 -8
  101. package/dist/ctaBlock.js.map +0 -1
  102. package/dist/dataServices.js +0 -3
  103. package/dist/dataServices.js.LICENSE.txt +0 -17
  104. package/dist/dataServices.js.map +0 -1
  105. package/dist/footer.css +0 -2
  106. package/dist/footer.css.map +0 -1
  107. package/dist/footer.js +0 -3
  108. package/dist/footer.js.LICENSE.txt +0 -14
  109. package/dist/footer.js.map +0 -1
  110. package/dist/formikWrappers.css +0 -2
  111. package/dist/formikWrappers.css.map +0 -1
  112. package/dist/formikWrappers.js +0 -3
  113. package/dist/formikWrappers.js.LICENSE.txt +0 -14
  114. package/dist/formikWrappers.js.map +0 -1
  115. package/dist/grid.css +0 -2
  116. package/dist/grid.css.map +0 -1
  117. package/dist/grid.js +0 -2
  118. package/dist/grid.js.map +0 -1
  119. package/dist/header.css +0 -2
  120. package/dist/header.css.map +0 -1
  121. package/dist/header.js +0 -3
  122. package/dist/header.js.LICENSE.txt +0 -14
  123. package/dist/header.js.map +0 -1
  124. package/dist/popup.css +0 -2
  125. package/dist/popup.css.map +0 -1
  126. package/dist/popup.js +0 -3
  127. package/dist/popup.js.LICENSE.txt +0 -26
  128. package/dist/popup.js.map +0 -1
  129. package/dist/quotesSlider.css +0 -2
  130. package/dist/quotesSlider.css.map +0 -1
  131. package/dist/quotesSlider.js +0 -3
  132. package/dist/quotesSlider.js.LICENSE.txt +0 -14
  133. package/dist/quotesSlider.js.map +0 -1
  134. package/dist/svg/loading_24.svg +0 -1
  135. package/dist/svg/play_24.svg +0 -1
  136. package/dist/svg/quote.svg +0 -3
  137. package/dist/svg/slider-arrow.svg +0 -3
  138. package/dist/topMenu.css +0 -2
  139. package/dist/topMenu.css.map +0 -1
  140. package/dist/topMenu.js +0 -3
  141. package/dist/topMenu.js.LICENSE.txt +0 -14
  142. package/dist/topMenu.js.map +0 -1
  143. package/dist/typography.css +0 -2
  144. package/dist/typography.css.map +0 -1
  145. package/dist/typography.js +0 -2
  146. package/dist/typography.js.map +0 -1
  147. package/dist/youtubePlayer.css +0 -2
  148. package/dist/youtubePlayer.css.map +0 -1
  149. package/dist/youtubePlayer.js +0 -3
  150. package/dist/youtubePlayer.js.LICENSE.txt +0 -14
  151. package/dist/youtubePlayer.js.map +0 -1
@@ -0,0 +1,51 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useTheme } from '@rescui/ui-contexts';
3
+ import classNames from 'classnames';
4
+ import styles from './top-menu.module.pcss.js';
5
+ import { useTextStyles } from '@rescui/typography';
6
+ import { HorizontalMenu } from './horizontal-menu/horizontal-menu.js';
7
+ import { DropdownMenu } from './dropdown-menu/dropdown-menu.js';
8
+
9
+ const TopMenu = ({
10
+ homeUrl,
11
+ title,
12
+ mobileTitle,
13
+ activeIndex,
14
+ items,
15
+ linkHandler = () => {},
16
+ className,
17
+ children,
18
+ forwardedRef,
19
+ mobileOverview
20
+ }) => {
21
+ const theme = useTheme();
22
+ const textCn = useTextStyles();
23
+ return jsxs("div", Object.assign({
24
+ className: classNames(styles.topMenu, className, {
25
+ [styles.topMenuDarkTheme]: theme === 'dark'
26
+ }),
27
+ ref: forwardedRef
28
+ }, {
29
+ children: [jsx("a", Object.assign({
30
+ href: homeUrl,
31
+ className: classNames(styles.logo, textCn('rs-h3')),
32
+ onClick: event => linkHandler(event, homeUrl)
33
+ }, {
34
+ children: title
35
+ }), void 0), jsx(DropdownMenu, {
36
+ items: items,
37
+ activeIndex: activeIndex,
38
+ linkHandler: linkHandler,
39
+ title: title,
40
+ mobileTitle: mobileTitle,
41
+ homeUrl: homeUrl,
42
+ mobileOverview: mobileOverview
43
+ }, void 0), jsx(HorizontalMenu, {
44
+ items: items,
45
+ activeIndex: activeIndex,
46
+ linkHandler: linkHandler
47
+ }, void 0), children]
48
+ }), void 0);
49
+ };
50
+
51
+ export { TopMenu };
@@ -0,0 +1,6 @@
1
+ var styles = {
2
+ "topMenu": "ktl-top-menu-module_top-menu_PRX9X",
3
+ "topMenuDarkTheme": "ktl-top-menu-module_top-menu-dark-theme_aNBxr",
4
+ "logo": "ktl-top-menu-module_logo_CNH2W"
5
+ };
6
+ export { styles as default };
@@ -0,0 +1,26 @@
1
+ import bemCnFast from 'bem-cn-fast';
2
+
3
+ function createTextCn(theme) {
4
+ if (!theme) {
5
+ throw new TypeError('theme argument is required');
6
+ }
7
+
8
+ function textCn(type = 'ktl-text-1', params = {
9
+ paragraphOffsetAuto: false,
10
+ hardness: undefined,
11
+ external: false,
12
+ mode: undefined
13
+ }) {
14
+ return bemCnFast(type)({
15
+ 'paragraph-offset-auto': params.paragraphOffsetAuto,
16
+ hardness: params.hardness,
17
+ external: params.external,
18
+ mode: params.mode,
19
+ theme
20
+ });
21
+ }
22
+
23
+ return textCn;
24
+ }
25
+
26
+ export { createTextCn };
@@ -0,0 +1,6 @@
1
+ import { useTheme } from '@rescui/ui-contexts';
2
+ import { createTextCn } from './create-text-cn.js';
3
+
4
+ const useTextStyles = () => createTextCn(useTheme());
5
+
6
+ export { useTextStyles };
@@ -0,0 +1,176 @@
1
+ :root {
2
+ --ktl-light-grey: #f4f4f4;
3
+ --ktl-dark-100: rgba(39, 40, 44, 1);
4
+ --ktl-dark-bg-hard: rgba(27, 27, 27, 1);
5
+ --ktl-icon-color-dark: rgba(39, 40, 44, 0.75);
6
+ --ktl-color-white-light: rgba(255, 255, 255, 0.75);
7
+ --ktl-transition-xfast: 100ms;
8
+ --ktl-transition-fast: 300ms;
9
+ --ktl-color-primary-light-theme: #7f52ff;
10
+ --ktl-color-dark-40: rgba(39, 40, 44, 0.4);
11
+ --ktl-light-text-hard: rgba(39, 40, 44, 1);
12
+ --ktl-light-dark-20: rgba(39, 40, 44, 0.2);
13
+ --ktl-overlay-z-index: 900;
14
+ --ktl-top-menu-z-index: 905;
15
+ --ktl-header-z-index: 906;
16
+ --ktl-header-height-mobile: 48px;
17
+ --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
18
+ --rs-font-family-ui: var(--ktl-font-family-inter);
19
+ }
20
+
21
+ .ktl-hero {
22
+ font-family: var(--ktl-font-family-inter);
23
+ color: var(--ktl-light-text-hard);
24
+ font-weight: normal;
25
+ font-size: 42px;
26
+ line-height: 48px;
27
+ letter-spacing: -1px;
28
+ margin: 0;
29
+ }
30
+
31
+ .ktl-hero_theme_dark {
32
+ color: #fff;
33
+ }
34
+
35
+ @media (min-width: 1200px) {
36
+
37
+ .ktl-hero {
38
+ font-size: 64px;
39
+ line-height: 72px;
40
+ letter-spacing: -3px
41
+ }
42
+ }
43
+
44
+ .ktl-h1 {
45
+ font-family: var(--ktl-font-family-inter);
46
+ color: var(--ktl-light-text-hard);
47
+ font-weight: normal;
48
+ font-size: 36px;
49
+ line-height: 44px;
50
+ letter-spacing: -1px;
51
+ margin: 0;
52
+ }
53
+
54
+ .ktl-h1_theme_dark {
55
+ color: #fff;
56
+ }
57
+
58
+ @media (min-width: 1200px) {
59
+
60
+ .ktl-h1 {
61
+ font-size: 43px;
62
+ line-height: 48px
63
+ }
64
+
65
+ }
66
+
67
+ .ktl-h2 {
68
+ font-family: var(--ktl-font-family-inter);
69
+ color: var(--ktl-light-text-hard);
70
+ font-weight: 500;
71
+ font-size: 24px;
72
+ line-height: 32px;
73
+ letter-spacing: -0.5px;
74
+ margin: 0;
75
+
76
+ }
77
+
78
+ .ktl-h2_theme_dark {
79
+ color: #fff;
80
+ }
81
+
82
+ @media (min-width: 1200px) {
83
+
84
+ .ktl-h2 {
85
+ font-size: 31px;
86
+ line-height: 40px
87
+
88
+ }
89
+
90
+ }
91
+
92
+ .ktl-subtitle {
93
+ font-family: var(--ktl-font-family-inter);
94
+ color: var(--ktl-light-text-hard);
95
+ font-weight: normal;
96
+ font-size: 20px;
97
+ line-height: 32px;
98
+ margin: 0;
99
+ }
100
+
101
+ .ktl-subtitle_theme_dark {
102
+ color: #fff;
103
+ }
104
+
105
+ @media (min-width: 1200px) {
106
+
107
+ .ktl-subtitle {
108
+ font-size: 31px;
109
+ line-height: 40px
110
+ }
111
+ }
112
+
113
+ .ktl-h3 {
114
+ font-family: var(--ktl-font-family-inter);
115
+ color: var(--ktl-light-text-hard);
116
+ font-weight: 600;
117
+ font-size: 20px;
118
+ line-height: 32px;
119
+ margin: 0;
120
+ }
121
+
122
+ .ktl-h3_theme_dark {
123
+ color: #fff;
124
+ }
125
+
126
+ .ktl-h4 {
127
+ font-family: var(--ktl-font-family-inter);
128
+ color: var(--ktl-light-text-hard);
129
+ font-weight: 600;
130
+ font-size: 16px;
131
+ line-height: 24px;
132
+ margin: 0;
133
+ }
134
+
135
+ .ktl-h4_theme_dark {
136
+ color: #fff;
137
+ }
138
+
139
+ .ktl-text-1 {
140
+ font-family: var(--ktl-font-family-inter);
141
+ color: var(--ktl-light-text-hard);
142
+ font-weight: normal;
143
+ font-size: 20px;
144
+ line-height: 32px;
145
+ margin: 0;
146
+ }
147
+
148
+ .ktl-text-1_theme_dark {
149
+ color: #fff;
150
+ }
151
+
152
+ .ktl-text-2 {
153
+ font-family: var(--ktl-font-family-inter);
154
+ color: var(--ktl-light-text-hard);
155
+ font-weight: normal;
156
+ font-size: 16px;
157
+ line-height: 24px;
158
+ margin: 0;
159
+ }
160
+
161
+ .ktl-text-2_theme_dark {
162
+ color: #fff;
163
+ }
164
+
165
+ .ktl-text-3 {
166
+ font-family: var(--ktl-font-family-inter);
167
+ color: var(--ktl-light-text-hard);
168
+ font-weight: normal;
169
+ font-size: 13px;
170
+ line-height: 20px;
171
+ margin: 0;
172
+ }
173
+
174
+ .ktl-text-3_theme_dark {
175
+ color: #fff;
176
+ }
@@ -0,0 +1,3 @@
1
+ import './index.css';
2
+ export { createTextCn } from './create-text-cn.js';
3
+ export { useTextStyles } from './hooks.js';
@@ -0,0 +1,119 @@
1
+ :root {
2
+ --ktl-light-grey: #f4f4f4;
3
+ --ktl-dark-100: rgba(39, 40, 44, 1);
4
+ --ktl-dark-bg-hard: rgba(27, 27, 27, 1);
5
+ --ktl-icon-color-dark: rgba(39, 40, 44, 0.75);
6
+ --ktl-color-white-light: rgba(255, 255, 255, 0.75);
7
+ --ktl-transition-xfast: 100ms;
8
+ --ktl-transition-fast: 300ms;
9
+ --ktl-color-primary-light-theme: #7f52ff;
10
+ --ktl-color-dark-40: rgba(39, 40, 44, 0.4);
11
+ --ktl-light-text-hard: rgba(39, 40, 44, 1);
12
+ --ktl-light-dark-20: rgba(39, 40, 44, 0.2);
13
+ --ktl-overlay-z-index: 900;
14
+ --ktl-top-menu-z-index: 905;
15
+ --ktl-header-z-index: 906;
16
+ --ktl-header-height-mobile: 48px;
17
+ --ktl-font-family-inter: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
18
+ --rs-font-family-ui: var(--ktl-font-family-inter);
19
+ }
20
+
21
+ .ktl-youtube-player-module_youtube-player_aSb0a {
22
+ position: relative;
23
+ width: 100%;
24
+ height: 100%;
25
+ background: black;
26
+ display: flex;
27
+ justify-content: center;
28
+ align-items: center;
29
+ cursor: pointer;
30
+ }
31
+
32
+ .ktl-youtube-player-module_preview_SuIdr img {
33
+ vertical-align: top;
34
+ }
35
+
36
+ .ktl-youtube-player-module_preview-playlist_k6-Zp {
37
+ width: 100%;
38
+ }
39
+
40
+ .ktl-youtube-player-module_preview-playlist_k6-Zp::before {
41
+ content: "";
42
+ display: block;
43
+ padding-bottom: 56.25%;
44
+ background: var(--ktl-dark-100);
45
+ }
46
+
47
+ .ktl-youtube-player-module_player_nH-tB {
48
+ position: absolute;
49
+ top: 0;
50
+ left: 0;
51
+ right: 0;
52
+ bottom: 0;
53
+ width: 100%;
54
+ height: 100%;
55
+ display: none;
56
+ }
57
+
58
+ .ktl-youtube-player-module_play-button_SNPG7 {
59
+ padding: 12px;
60
+ position: absolute;
61
+ top: calc(50% - 24px);
62
+ left: calc(50% - 24px);
63
+ border-radius: 50%;
64
+ border: none;
65
+ transition: color var(--ktl-transition-fast);
66
+ cursor: pointer;
67
+ outline: none;
68
+ height: 48px;
69
+ }
70
+
71
+ .ktl-youtube-player-module_play-button_white_jsj-J {
72
+ color: var(--ktl-dark-100);
73
+ background-color: #ffffff;
74
+ }
75
+
76
+ .ktl-youtube-player-module_play-button_black_N4JvM {
77
+ color: #ffffff;
78
+ background-color: var(--ktl-dark-100);
79
+ }
80
+
81
+ .ktl-youtube-player-module_play-button_primary_rk5oW {
82
+ color: #ffffff;
83
+ background: var(--ktl-color-primary-light-theme);
84
+ }
85
+
86
+ .ktl-youtube-player-module_hide_w9Dr2 {
87
+ display: none;
88
+ }
89
+
90
+ .ktl-youtube-player-module_image-preview_qXCFf {
91
+ display: block;
92
+ width: 100%;
93
+ }
94
+
95
+ .ktl-youtube-player-module_show-video_Y1Ri- .ktl-youtube-player-module_player_nH-tB {
96
+ display: block;
97
+ }
98
+
99
+ .ktl-youtube-player-module_show-video_Y1Ri- .ktl-youtube-player-module_image-preview_qXCFf {
100
+ opacity: 0;
101
+ }
102
+
103
+ .ktl-youtube-player-module_icon-loading_9jAhI {
104
+ -webkit-animation: ktl-youtube-player-module_icon-rotating_Zyb5v .7s linear infinite;
105
+ animation: ktl-youtube-player-module_icon-rotating_Zyb5v .7s linear infinite;
106
+ transform-origin: center center;
107
+ }
108
+
109
+ @-webkit-keyframes ktl-youtube-player-module_icon-rotating_Zyb5v {
110
+ to {
111
+ transform: rotate(360deg)
112
+ }
113
+ }
114
+
115
+ @keyframes ktl-youtube-player-module_icon-rotating_Zyb5v {
116
+ to {
117
+ transform: rotate(360deg)
118
+ }
119
+ }
@@ -0,0 +1,3 @@
1
+ import './index.css';
2
+ import { YoutubePlayer } from './youtube-player.js';
3
+ export { YoutubePlayer as default } from './youtube-player.js';
@@ -0,0 +1,31 @@
1
+ import * as React from 'react';
2
+
3
+ var _path;
4
+
5
+ function _extends() {
6
+ _extends = Object.assign || function (target) {
7
+ for (var i = 1; i < arguments.length; i++) {
8
+ var source = arguments[i];
9
+
10
+ for (var key in source) {
11
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
12
+ target[key] = source[key];
13
+ }
14
+ }
15
+ }
16
+
17
+ return target;
18
+ };
19
+
20
+ return _extends.apply(this, arguments);
21
+ }
22
+
23
+ const SvgLoading24 = props => /*#__PURE__*/React.createElement("svg", _extends({
24
+ xmlns: "http://www.w3.org/2000/svg",
25
+ width: 24,
26
+ height: 24
27
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
28
+ d: "M12 3.25A8.76 8.76 0 0 0 3.25 12h1.5A7.25 7.25 0 1 1 12 19.25v1.5a8.75 8.75 0 1 0 0-17.5z"
29
+ })));
30
+
31
+ export { SvgLoading24 as default };
@@ -0,0 +1,31 @@
1
+ import * as React from 'react';
2
+
3
+ var _path;
4
+
5
+ function _extends() {
6
+ _extends = Object.assign || function (target) {
7
+ for (var i = 1; i < arguments.length; i++) {
8
+ var source = arguments[i];
9
+
10
+ for (var key in source) {
11
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
12
+ target[key] = source[key];
13
+ }
14
+ }
15
+ }
16
+
17
+ return target;
18
+ };
19
+
20
+ return _extends.apply(this, arguments);
21
+ }
22
+
23
+ const SvgPlay24 = props => /*#__PURE__*/React.createElement("svg", _extends({
24
+ xmlns: "http://www.w3.org/2000/svg",
25
+ width: 24,
26
+ height: 24
27
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
28
+ d: "M19 12 8 4v16l11-8z"
29
+ })));
30
+
31
+ export { SvgPlay24 as default };
@@ -0,0 +1,28 @@
1
+ const API_URL = 'https://www.youtube.com/iframe_api';
2
+
3
+ function waitForYouTubePlayerApi() {
4
+ return new Promise(resolve => {
5
+ if (window.YT && window.YT.loaded) {
6
+ resolve();
7
+ } else {
8
+ window.onYouTubeIframeAPIReady = resolve;
9
+ }
10
+ });
11
+ }
12
+
13
+ function loadExternalScript(url) {
14
+ return new Promise((resolve, reject) => {
15
+ const script = document.createElement('script');
16
+ script.type = 'text/javascript';
17
+ script.async = true;
18
+ script.src = url;
19
+
20
+ script.onload = () => resolve();
21
+
22
+ script.onerror = () => reject();
23
+
24
+ document.head.appendChild(script);
25
+ });
26
+ }
27
+
28
+ export { API_URL, loadExternalScript, waitForYouTubePlayerApi };
@@ -0,0 +1,152 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState, useRef, useEffect } from 'react';
3
+ import classNames from 'classnames';
4
+ import styles from './youtube-player.module.pcss.js';
5
+ import SvgPlay24 from './play_24.svg.js';
6
+ import SvgLoading24 from './loading_24.svg.js';
7
+ import { loadExternalScript, waitForYouTubePlayerApi, API_URL } from './utils.js';
8
+ var YoutubePlayButtonMode;
9
+
10
+ (function (YoutubePlayButtonMode) {
11
+ YoutubePlayButtonMode[YoutubePlayButtonMode["White"] = 0] = "White";
12
+ YoutubePlayButtonMode[YoutubePlayButtonMode["Black"] = 1] = "Black";
13
+ YoutubePlayButtonMode[YoutubePlayButtonMode["Primary"] = 2] = "Primary";
14
+ })(YoutubePlayButtonMode || (YoutubePlayButtonMode = {}));
15
+
16
+ var YoutubePlayerMode;
17
+
18
+ (function (YoutubePlayerMode) {
19
+ YoutubePlayerMode[YoutubePlayerMode["Single"] = 0] = "Single";
20
+ YoutubePlayerMode[YoutubePlayerMode["Playlist"] = 1] = "Playlist";
21
+ })(YoutubePlayerMode || (YoutubePlayerMode = {}));
22
+
23
+ const YoutubePlayer = ({
24
+ id,
25
+ mode = YoutubePlayerMode.Single,
26
+ startTime,
27
+ autoplay = false,
28
+ width,
29
+ height,
30
+ preview,
31
+ previewImgSrc,
32
+ previewImgAlt,
33
+ playButtonMode = YoutubePlayButtonMode.White,
34
+ className
35
+ }) => {
36
+ const [showVideo, setShowVideo] = useState(autoplay);
37
+ const [videoLoading, setVideoLoading] = useState(false);
38
+ const [isAPILoaded, setAPILoaded] = useState(false);
39
+ const playerWrapperDivRef = useRef(null);
40
+ const playerDivRef = useRef(null);
41
+ const playerInstanceRef = useRef(null);
42
+ let imgPreview = previewImgSrc;
43
+
44
+ if (!previewImgSrc && mode === YoutubePlayerMode.Single) {
45
+ imgPreview = `https://img.youtube.com/vi/${id}/maxresdefault.jpg`;
46
+ }
47
+
48
+ const wrapperStyles = {
49
+ width: width,
50
+ height: height
51
+ };
52
+ useEffect(() => {
53
+ if (!showVideo) {
54
+ return;
55
+ }
56
+
57
+ const loadYouTubePlayerApi = () => {
58
+ if (isAPILoaded) {
59
+ return Promise.resolve(window.YT);
60
+ }
61
+
62
+ return loadExternalScript(API_URL).then(() => waitForYouTubePlayerApi()).then(() => setAPILoaded(true)).then(() => window.YT);
63
+ };
64
+
65
+ loadYouTubePlayerApi().then(youtubeApi => {
66
+ if (!playerWrapperDivRef.current || !playerDivRef.current) {
67
+ return;
68
+ }
69
+
70
+ const {
71
+ width: videoWidth,
72
+ height: videoHeight
73
+ } = playerWrapperDivRef.current.getBoundingClientRect();
74
+ const options = {
75
+ width: videoWidth,
76
+ height: videoHeight,
77
+ playerVars: {
78
+ autoplay: 1,
79
+ rel: 0,
80
+ start: startTime,
81
+ modestbranding: 1
82
+ },
83
+ events: {
84
+ onReady: () => setVideoLoading(false),
85
+ onStateChange: event => {
86
+ if (event.data === 0) {
87
+ setShowVideo(false);
88
+ }
89
+ }
90
+ }
91
+ };
92
+
93
+ if (mode === YoutubePlayerMode.Single) {
94
+ options.videoId = id;
95
+ } else {
96
+ options.playerVars = { ...options.playerVars,
97
+ list: id,
98
+ listType: 'playlist'
99
+ };
100
+ }
101
+
102
+ playerInstanceRef.current = new youtubeApi.Player(playerDivRef.current, options);
103
+ });
104
+ return () => {
105
+ if (playerInstanceRef.current) {
106
+ playerInstanceRef.current.destroy();
107
+ playerInstanceRef.current = null;
108
+ }
109
+ };
110
+ }, [isAPILoaded, showVideo, startTime, id, mode]);
111
+ return jsxs("div", Object.assign({
112
+ ref: playerWrapperDivRef,
113
+ onClick: e => {
114
+ e.preventDefault();
115
+ setShowVideo(true);
116
+ setVideoLoading(true);
117
+ },
118
+ className: classNames(styles.youtubePlayer, className, {
119
+ [styles.showVideo]: showVideo
120
+ }),
121
+ style: wrapperStyles
122
+ }, {
123
+ children: [jsxs("div", Object.assign({
124
+ className: classNames(styles.preview, {
125
+ [styles.previewPlaylist]: !preview && !imgPreview && mode === YoutubePlayerMode.Playlist
126
+ })
127
+ }, {
128
+ children: [preview ? preview : imgPreview && jsx("img", {
129
+ src: imgPreview,
130
+ alt: previewImgAlt ? previewImgAlt : '',
131
+ className: styles.imagePreview
132
+ }, void 0), jsx("button", Object.assign({
133
+ type: "button",
134
+ className: classNames(styles.playButton, {
135
+ [styles.hide]: showVideo && !videoLoading,
136
+ [styles.playButtonWhite]: playButtonMode === YoutubePlayButtonMode.White,
137
+ [styles.playButtonBlack]: playButtonMode === YoutubePlayButtonMode.Black,
138
+ [styles.playButtonPrimary]: playButtonMode === YoutubePlayButtonMode.Primary
139
+ })
140
+ }, {
141
+ children: videoLoading ? jsx(SvgLoading24, {
142
+ className: styles.iconLoading
143
+ }, void 0) : jsx(SvgPlay24, {}, void 0)
144
+ }), void 0)]
145
+ }), void 0), jsx("div", {
146
+ className: styles.player,
147
+ ref: playerDivRef
148
+ }, void 0)]
149
+ }), void 0);
150
+ };
151
+
152
+ export { YoutubePlayButtonMode, YoutubePlayer, YoutubePlayerMode };
@@ -0,0 +1,16 @@
1
+ var styles = {
2
+ "youtubePlayer": "ktl-youtube-player-module_youtube-player_aSb0a",
3
+ "preview": "ktl-youtube-player-module_preview_SuIdr",
4
+ "previewPlaylist": "ktl-youtube-player-module_preview-playlist_k6-Zp",
5
+ "player": "ktl-youtube-player-module_player_nH-tB",
6
+ "playButton": "ktl-youtube-player-module_play-button_SNPG7",
7
+ "playButtonWhite": "ktl-youtube-player-module_play-button_white_jsj-J",
8
+ "playButtonBlack": "ktl-youtube-player-module_play-button_black_N4JvM",
9
+ "playButtonPrimary": "ktl-youtube-player-module_play-button_primary_rk5oW",
10
+ "hide": "ktl-youtube-player-module_hide_w9Dr2",
11
+ "imagePreview": "ktl-youtube-player-module_image-preview_qXCFf",
12
+ "showVideo": "ktl-youtube-player-module_show-video_Y1Ri-",
13
+ "iconLoading": "ktl-youtube-player-module_icon-loading_9jAhI",
14
+ "iconRotating": "ktl-youtube-player-module_icon-rotating_Zyb5v"
15
+ };
16
+ export { styles as default };
@@ -0,0 +1,9 @@
1
+ import { PRIVACY_CONSENT_GET_MESSAGE, PRIVACY_CONSENT_SEND_ACCEPTANCE, PRIVACY_CONSENT_SEND_ACCEPTANCE_NEW } from './urls.js';
2
+ import PrivacyConsentService from './privacy-consent-service.js';
3
+ export { submitToMarketo } from './marketo-submiter.js';
4
+ const privacy = new PrivacyConsentService({
5
+ getMessage: PRIVACY_CONSENT_GET_MESSAGE,
6
+ sendAcceptance: PRIVACY_CONSENT_SEND_ACCEPTANCE,
7
+ newSendAcceptance: PRIVACY_CONSENT_SEND_ACCEPTANCE_NEW
8
+ });
9
+ export { privacy };