@jetbrains/kotlin-web-site-ui 4.0.0-alpha.0 → 4.0.0-alpha.3

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 (30) hide show
  1. package/out/blocks/formik-wrapper/input.js +3 -3
  2. package/out/blocks/formik-wrapper/privacy-checkbox.js +17 -21
  3. package/out/blocks/formik-wrapper/privacy-notice.js +19 -28
  4. package/out/blocks/formik-wrapper/submit-button.js +3 -3
  5. package/out/components/cta-block/cta-block.js +17 -33
  6. package/out/components/footer/footer.js +30 -48
  7. package/out/components/footer/logo/logo.js +3 -5
  8. package/out/components/footer/nav/nav-item.js +11 -15
  9. package/out/components/footer/nav/nav-list.js +8 -11
  10. package/out/components/footer/social-list/social-item/social-item.js +3 -5
  11. package/out/components/footer/social-list/social-list.js +6 -7
  12. package/out/components/grid/index.css +294 -294
  13. package/out/components/header/header.js +27 -32
  14. package/out/components/header/horizontal-menu/horizontal-menu.js +43 -53
  15. package/out/components/header/index.css +3 -3
  16. package/out/components/header/logo-large/logo-large.js +11 -17
  17. package/out/components/header/logo-small/logo-small.js +11 -17
  18. package/out/components/header/menu-popup/menu-button/menu-button.js +4 -6
  19. package/out/components/header/menu-popup/menu-button/menu-button.module.pcss.js +4 -0
  20. package/out/components/header/menu-popup/menu-popup.js +28 -37
  21. package/out/components/header/search-button/search-button.js +3 -5
  22. package/out/components/popup/popup.js +34 -40
  23. package/out/components/quotes-slider/quites-slider.js +33 -63
  24. package/out/components/top-menu/dropdown-menu/dropdown-menu.js +28 -40
  25. package/out/components/top-menu/horizontal-menu/horizontal-menu.js +13 -17
  26. package/out/components/top-menu/top-menu.js +19 -23
  27. package/out/components/typography/index.css +22 -22
  28. package/out/components/youtube-player/youtube-player.js +24 -31
  29. package/package.json +6 -2
  30. package/out/components/header/menu-popup/menu-button/menu-button.pcss.js +0 -2
@@ -1,4 +1,3 @@
1
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
1
  import React__default, { useState } from 'react';
3
2
  import ReactDOM from 'react-dom';
4
3
  import classNames from 'classnames';
@@ -37,45 +36,34 @@ const DropdownMenu = ({
37
36
 
38
37
  const handleClick = () => setIsExpanded(!isExpanded);
39
38
 
40
- return jsxs(Fragment, {
41
- children: [jsxs("div", Object.assign({
42
- className: classNames(styles.dropdownMenu, {
43
- [styles.dropdownMenuExpanded]: isExpanded
44
- }),
45
- onClick: handleClick
46
- }, {
47
- children: [jsxs("button", Object.assign({
48
- className: classNames(styles.button, textCn('rs-text-2')),
49
- "aria-haspopup": "true"
50
- }, {
51
- children: [jsx("span", {
52
- children: activeItem.title
53
- }, void 0), jsx(SvgArrowDropdownIcon, {
54
- className: styles.icon
55
- }, void 0)]
56
- }), void 0), jsx("nav", Object.assign({
57
- className: classNames(styles.dropdownList, {
58
- [styles.dropdownListDarkTheme]: theme === 'dark'
59
- })
60
- }, {
61
- children: _items.map((item, index) => jsx("a", Object.assign({
62
- href: item.url,
63
- className: classNames(styles.dropdownItem, textCn('rs-text-2'), {
64
- [styles.dropdownItemActive]: index === _activeIndex
65
- }),
66
- onClick: event => linkHandler?.(event, item.url),
67
- target: item.isExternal ? '_blank' : undefined
68
- }, {
69
- children: item.title
70
- }), item.url))
71
- }), void 0)]
72
- }), void 0), !!portalRoot && ReactDOM.createPortal(jsx("div", {
73
- className: classNames(styles.overlay, {
74
- [styles.overlayVisible]: isExpanded
75
- }),
76
- onClick: handleClick
77
- }, void 0), portalRoot)]
78
- }, void 0);
39
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
40
+ className: classNames(styles.dropdownMenu, {
41
+ [styles.dropdownMenuExpanded]: isExpanded
42
+ }),
43
+ onClick: handleClick
44
+ }, React__default.createElement("button", {
45
+ className: classNames(styles.button, textCn('rs-text-2')),
46
+ "aria-haspopup": "true"
47
+ }, React__default.createElement("span", null, activeItem.title), React__default.createElement(SvgArrowDropdownIcon, {
48
+ className: styles.icon
49
+ })), React__default.createElement("nav", {
50
+ className: classNames(styles.dropdownList, {
51
+ [styles.dropdownListDarkTheme]: theme === 'dark'
52
+ })
53
+ }, _items.map((item, index) => React__default.createElement("a", {
54
+ key: item.url,
55
+ href: item.url,
56
+ className: classNames(styles.dropdownItem, textCn('rs-text-2'), {
57
+ [styles.dropdownItemActive]: index === _activeIndex
58
+ }),
59
+ onClick: event => linkHandler?.(event, item.url),
60
+ target: item.isExternal ? '_blank' : undefined
61
+ }, item.title)))), !!portalRoot && ReactDOM.createPortal(React__default.createElement("div", {
62
+ className: classNames(styles.overlay, {
63
+ [styles.overlayVisible]: isExpanded
64
+ }),
65
+ onClick: handleClick
66
+ }), portalRoot));
79
67
  };
80
68
 
81
69
  export { DropdownMenu };
@@ -1,5 +1,4 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { useCallback } from 'react';
1
+ import React__default, { useCallback } from 'react';
3
2
  import classNames from 'classnames';
4
3
  import styles from './horizontal-menu.module.pcss.js';
5
4
  import { useTextStyles } from '@rescui/typography';
@@ -11,21 +10,19 @@ const HorizontalMenuItem = ({
11
10
  }) => {
12
11
  const textCn = useTextStyles();
13
12
  const handleLink = useCallback(event => linkHandler(event, item.url), [item]);
14
- return isActive ? jsx("span", Object.assign({
13
+ return isActive ? React__default.createElement("span", {
14
+ key: item.url,
15
15
  className: styles.itemActive
16
- }, {
17
- children: item.title
18
- }), item.url) : jsx("a", Object.assign({
16
+ }, item.title) : React__default.createElement("a", {
19
17
  href: item.url,
18
+ key: item.url,
20
19
  className: classNames(styles.item, textCn('rs-link', {
21
20
  hardness: 'average',
22
21
  mode: 'clear'
23
22
  })),
24
23
  onClick: handleLink,
25
24
  target: item.isExternal ? '_blank' : undefined
26
- }, {
27
- children: item.title
28
- }), item.url);
25
+ }, item.title);
29
26
  };
30
27
 
31
28
  const HorizontalMenu = ({
@@ -34,15 +31,14 @@ const HorizontalMenu = ({
34
31
  linkHandler
35
32
  }) => {
36
33
  const textCn = useTextStyles();
37
- return jsx("nav", Object.assign({
34
+ return React__default.createElement("nav", {
38
35
  className: classNames(styles.horizontalMenu, textCn('rs-text-2'))
39
- }, {
40
- children: items.map((item, index) => jsx(HorizontalMenuItem, {
41
- isActive: index === activeIndex,
42
- item: item,
43
- linkHandler: linkHandler
44
- }, item.url))
45
- }), void 0);
36
+ }, items.map((item, index) => React__default.createElement(HorizontalMenuItem, {
37
+ key: item.url,
38
+ isActive: index === activeIndex,
39
+ item: item,
40
+ linkHandler: linkHandler
41
+ })));
46
42
  };
47
43
 
48
44
  export { HorizontalMenu };
@@ -1,4 +1,4 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import React__default from 'react';
2
2
  import { useTheme } from '@rescui/ui-contexts';
3
3
  import classNames from 'classnames';
4
4
  import styles from './top-menu.module.pcss.js';
@@ -20,32 +20,28 @@ const TopMenu = ({
20
20
  }) => {
21
21
  const theme = useTheme();
22
22
  const textCn = useTextStyles();
23
- return jsxs("div", Object.assign({
23
+ return React__default.createElement("div", {
24
24
  className: classNames(styles.topMenu, className, {
25
25
  [styles.topMenuDarkTheme]: theme === 'dark'
26
26
  }),
27
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);
28
+ }, React__default.createElement("a", {
29
+ href: homeUrl,
30
+ className: classNames(styles.logo, textCn('rs-h3')),
31
+ onClick: event => linkHandler(event, homeUrl)
32
+ }, title), React__default.createElement(DropdownMenu, {
33
+ items: items,
34
+ activeIndex: activeIndex,
35
+ linkHandler: linkHandler,
36
+ title: title,
37
+ mobileTitle: mobileTitle,
38
+ homeUrl: homeUrl,
39
+ mobileOverview: mobileOverview
40
+ }), React__default.createElement(HorizontalMenu, {
41
+ items: items,
42
+ activeIndex: activeIndex,
43
+ linkHandler: linkHandler
44
+ }), children);
49
45
  };
50
46
 
51
47
  export { TopMenu };
@@ -18,7 +18,7 @@
18
18
  --rs-font-family-ui: var(--ktl-font-family-inter);
19
19
  }
20
20
 
21
- :global .ktl-hero {
21
+ .ktl-hero {
22
22
  font-family: var(--ktl-font-family-inter);
23
23
  color: var(--ktl-light-text-hard);
24
24
  font-weight: normal;
@@ -28,20 +28,20 @@
28
28
  margin: 0;
29
29
  }
30
30
 
31
- :global .ktl-hero_theme_dark {
31
+ .ktl-hero_theme_dark {
32
32
  color: #fff;
33
33
  }
34
34
 
35
35
  @media (min-width: 1200px) {
36
36
 
37
- :global .ktl-hero {
37
+ .ktl-hero {
38
38
  font-size: 64px;
39
39
  line-height: 72px;
40
40
  letter-spacing: -3px
41
41
  }
42
42
  }
43
43
 
44
- :global .ktl-h1 {
44
+ .ktl-h1 {
45
45
  font-family: var(--ktl-font-family-inter);
46
46
  color: var(--ktl-light-text-hard);
47
47
  font-weight: normal;
@@ -51,20 +51,20 @@
51
51
  margin: 0;
52
52
  }
53
53
 
54
- :global .ktl-h1_theme_dark {
54
+ .ktl-h1_theme_dark {
55
55
  color: #fff;
56
56
  }
57
57
 
58
58
  @media (min-width: 1200px) {
59
59
 
60
- :global .ktl-h1 {
60
+ .ktl-h1 {
61
61
  font-size: 43px;
62
62
  line-height: 48px
63
63
  }
64
64
 
65
65
  }
66
66
 
67
- :global .ktl-h2 {
67
+ .ktl-h2 {
68
68
  font-family: var(--ktl-font-family-inter);
69
69
  color: var(--ktl-light-text-hard);
70
70
  font-weight: 500;
@@ -75,13 +75,13 @@
75
75
 
76
76
  }
77
77
 
78
- :global .ktl-h2_theme_dark {
78
+ .ktl-h2_theme_dark {
79
79
  color: #fff;
80
80
  }
81
81
 
82
82
  @media (min-width: 1200px) {
83
83
 
84
- :global .ktl-h2 {
84
+ .ktl-h2 {
85
85
  font-size: 31px;
86
86
  line-height: 40px
87
87
 
@@ -89,7 +89,7 @@
89
89
 
90
90
  }
91
91
 
92
- :global .ktl-subtitle {
92
+ .ktl-subtitle {
93
93
  font-family: var(--ktl-font-family-inter);
94
94
  color: var(--ktl-light-text-hard);
95
95
  font-weight: normal;
@@ -98,19 +98,19 @@
98
98
  margin: 0;
99
99
  }
100
100
 
101
- :global .ktl-subtitle_theme_dark {
101
+ .ktl-subtitle_theme_dark {
102
102
  color: #fff;
103
103
  }
104
104
 
105
105
  @media (min-width: 1200px) {
106
106
 
107
- :global .ktl-subtitle {
107
+ .ktl-subtitle {
108
108
  font-size: 31px;
109
109
  line-height: 40px
110
110
  }
111
111
  }
112
112
 
113
- :global .ktl-h3 {
113
+ .ktl-h3 {
114
114
  font-family: var(--ktl-font-family-inter);
115
115
  color: var(--ktl-light-text-hard);
116
116
  font-weight: 600;
@@ -119,11 +119,11 @@
119
119
  margin: 0;
120
120
  }
121
121
 
122
- :global .ktl-h3_theme_dark {
122
+ .ktl-h3_theme_dark {
123
123
  color: #fff;
124
124
  }
125
125
 
126
- :global .ktl-h4 {
126
+ .ktl-h4 {
127
127
  font-family: var(--ktl-font-family-inter);
128
128
  color: var(--ktl-light-text-hard);
129
129
  font-weight: 600;
@@ -132,11 +132,11 @@
132
132
  margin: 0;
133
133
  }
134
134
 
135
- :global .ktl-h4_theme_dark {
135
+ .ktl-h4_theme_dark {
136
136
  color: #fff;
137
137
  }
138
138
 
139
- :global .ktl-text-1 {
139
+ .ktl-text-1 {
140
140
  font-family: var(--ktl-font-family-inter);
141
141
  color: var(--ktl-light-text-hard);
142
142
  font-weight: normal;
@@ -145,11 +145,11 @@
145
145
  margin: 0;
146
146
  }
147
147
 
148
- :global .ktl-text-1_theme_dark {
148
+ .ktl-text-1_theme_dark {
149
149
  color: #fff;
150
150
  }
151
151
 
152
- :global .ktl-text-2 {
152
+ .ktl-text-2 {
153
153
  font-family: var(--ktl-font-family-inter);
154
154
  color: var(--ktl-light-text-hard);
155
155
  font-weight: normal;
@@ -158,11 +158,11 @@
158
158
  margin: 0;
159
159
  }
160
160
 
161
- :global .ktl-text-2_theme_dark {
161
+ .ktl-text-2_theme_dark {
162
162
  color: #fff;
163
163
  }
164
164
 
165
- :global .ktl-text-3 {
165
+ .ktl-text-3 {
166
166
  font-family: var(--ktl-font-family-inter);
167
167
  color: var(--ktl-light-text-hard);
168
168
  font-weight: normal;
@@ -171,6 +171,6 @@
171
171
  margin: 0;
172
172
  }
173
173
 
174
- :global .ktl-text-3_theme_dark {
174
+ .ktl-text-3_theme_dark {
175
175
  color: #fff;
176
176
  }
@@ -1,5 +1,4 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { useState, useRef, useEffect } from 'react';
1
+ import React__default, { useState, useRef, useEffect } from 'react';
3
2
  import classNames from 'classnames';
4
3
  import styles from './youtube-player.module.pcss.js';
5
4
  import SvgPlay24 from './play_24.svg.js';
@@ -108,7 +107,7 @@ const YoutubePlayer = ({
108
107
  }
109
108
  };
110
109
  }, [isAPILoaded, showVideo, startTime, id, mode]);
111
- return jsxs("div", Object.assign({
110
+ return React__default.createElement("div", {
112
111
  ref: playerWrapperDivRef,
113
112
  onClick: e => {
114
113
  e.preventDefault();
@@ -119,34 +118,28 @@ const YoutubePlayer = ({
119
118
  [styles.showVideo]: showVideo
120
119
  }),
121
120
  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);
121
+ }, React__default.createElement("div", {
122
+ className: classNames(styles.preview, {
123
+ [styles.previewPlaylist]: !preview && !imgPreview && mode === YoutubePlayerMode.Playlist
124
+ })
125
+ }, preview ? preview : imgPreview && React__default.createElement("img", {
126
+ src: imgPreview,
127
+ alt: previewImgAlt ? previewImgAlt : '',
128
+ className: styles.imagePreview
129
+ }), React__default.createElement("button", {
130
+ type: "button",
131
+ className: classNames(styles.playButton, {
132
+ [styles.hide]: showVideo && !videoLoading,
133
+ [styles.playButtonWhite]: playButtonMode === YoutubePlayButtonMode.White,
134
+ [styles.playButtonBlack]: playButtonMode === YoutubePlayButtonMode.Black,
135
+ [styles.playButtonPrimary]: playButtonMode === YoutubePlayButtonMode.Primary
136
+ })
137
+ }, videoLoading ? React__default.createElement(SvgLoading24, {
138
+ className: styles.iconLoading
139
+ }) : React__default.createElement(SvgPlay24, null))), React__default.createElement("div", {
140
+ className: styles.player,
141
+ ref: playerDivRef
142
+ }));
150
143
  };
151
144
 
152
145
  export { YoutubePlayButtonMode, YoutubePlayer, YoutubePlayerMode };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jetbrains/kotlin-web-site-ui",
3
3
  "description": "UI components for Kotlin web sites development",
4
- "version": "4.0.0-alpha.0",
4
+ "version": "4.0.0-alpha.3",
5
5
  "license": "Apache-2.0",
6
6
  "author": "JetBrains",
7
7
  "files": [
@@ -33,10 +33,13 @@
33
33
  "@rescui/ui-contexts": "0.x",
34
34
  "formik": "2.x",
35
35
  "react": ">= 16.8.6 < 18",
36
- "react-dom": ">= 16.8.6 < 18"
36
+ "react-dom": ">= 16.8.6 < 18",
37
+ "react-swipeable-views": "0.x",
38
+ "sha.js": "2.x"
37
39
  },
38
40
  "devDependencies": {
39
41
  "@babel/core": "^7.11.6",
42
+ "@babel/plugin-transform-runtime": "^7.17.0",
40
43
  "@babel/preset-env": "^7.11.5",
41
44
  "@babel/preset-react": "^7.13.13",
42
45
  "@babel/preset-typescript": "^7.13.0",
@@ -97,6 +100,7 @@
97
100
  "postcss-loader": "^5.2.0",
98
101
  "postcss-mixins": "^7.0.3",
99
102
  "postcss-nested": "^5.0.5",
103
+ "postcss-remove-global": "^0.1.1",
100
104
  "prettier": "2.2.1",
101
105
  "query-string": "^7.0.1",
102
106
  "react": "^16.8.6",
@@ -1,2 +0,0 @@
1
- var styles = undefined;
2
- export { styles as default };