@jetbrains/kotlin-web-site-ui 4.3.0-next-layout.7 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/out/blocks/formik-wrapper/input.js +3 -2
- package/out/blocks/formik-wrapper/submit-button.js +2 -2
- package/out/components/header/horizontal-menu/horizontal-menu.js +12 -11
- package/out/components/header/menu-popup/menu-popup.js +5 -5
- package/out/components/popup/popup.js +4 -4
- package/package.json +15 -8
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
## 4.3.0 (December 1, 2022)
|
|
2
|
+
|
|
3
|
+
### New breakpoints system
|
|
4
|
+
|
|
5
|
+
Add [`break points`](https://github.com/JetBrains/kotlin-web-site-ui/blob/c1b5f8f69c692b9e4041a1b3d1685a818ecef197/src/components/breakpoints/constants.ts#L1-L9) based on different typ devices width:
|
|
6
|
+
- Mobile small (**MS**)
|
|
7
|
+
- Mobile medium (**MM**)
|
|
8
|
+
- Tablet small (**TS**)
|
|
9
|
+
- Tablet medium (**TM**)
|
|
10
|
+
- Tablet large (**TL**)
|
|
11
|
+
- Desktop small (**DS**)
|
|
12
|
+
- Desktop medium (**DM**)
|
|
13
|
+
|
|
14
|
+
* `BREAKPOINTS`, `BREAKPOINTS_MAX_MEDIA` and `BREAKPOINTS_MIN_MEDIA` constants exported for inline JSX usage:
|
|
15
|
+
```jsx
|
|
16
|
+
function FlowerAdaptiveImg () {
|
|
17
|
+
return (
|
|
18
|
+
<picture>
|
|
19
|
+
<source media={BREAKPOINTS_MAX_MEDIA.MM} srcset="flowers-mobile.jpg">
|
|
20
|
+
<source media={BREAKPOINTS_MIN_MEDIA.TS && BREAKPOINTS_MAX_MEDIA.TL} srcset="flowers-tablet.jpg">
|
|
21
|
+
<img src="flowers-desktop.jpg" alt="Flowers">
|
|
22
|
+
</picture>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
* New breakpoint [**hooks**](https://github.com/JetBrains/kotlin-web-site-ui/blob/c1b5f8f69c692b9e4041a1b3d1685a818ecef197/src/components/breakpoints/hooks.ts#L5-L31) provide adaptive browser templates:
|
|
27
|
+
```jsx
|
|
28
|
+
function FlowerAdaptiveImg () {
|
|
29
|
+
const isMM = useMM();
|
|
30
|
+
const size = isMM ? 'small' : 'large';
|
|
31
|
+
return <img src={`flowers-${size}.jpg`} alt="Flowers">;
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### New pages layout
|
|
36
|
+
|
|
37
|
+
Motivation of next layout is reduce type layouts and use fix counts of resolutions without pixel-by-pixel fluid container.
|
|
38
|
+
|
|
39
|
+
* Providing new classes `ktl-layout`, `ktl-layout--center`, `ktl-layout--spacing` for fluid grid. More information in storybook.
|
|
40
|
+
* Providing new postcss `custom media` with device type like:
|
|
41
|
+
```css
|
|
42
|
+
@media (--ktl-ds) {
|
|
43
|
+
// ...
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media (--ktl-mm-min) {
|
|
47
|
+
// ...
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
Medias without postfix used `max-width: $size`, medias with `-min` postfix used `min-width: $size`.
|
|
51
|
+
|
|
52
|
+
For use medias in your project it should provide [postcss-custom-media](https://github.com/csstools/postcss-custom-media):
|
|
53
|
+
```js
|
|
54
|
+
require("@webteam/postcss-preset")({
|
|
55
|
+
customMedia: [
|
|
56
|
+
// ...
|
|
57
|
+
'@jetbrains/kotlin-web-site-ui/out/components/breakpoints/media.pcss'
|
|
58
|
+
],
|
|
59
|
+
// ...
|
|
60
|
+
})
|
|
61
|
+
```
|
|
@@ -15,7 +15,8 @@ const FormikInput = ({
|
|
|
15
15
|
isSubmitting,
|
|
16
16
|
submitCount
|
|
17
17
|
} = useFormikContext();
|
|
18
|
-
return React.createElement(Input,
|
|
18
|
+
return React.createElement(Input, { ...restProps,
|
|
19
|
+
...formikProps,
|
|
19
20
|
onBlur: e => {
|
|
20
21
|
if (onBlur) {
|
|
21
22
|
onBlur(e);
|
|
@@ -32,7 +33,7 @@ const FormikInput = ({
|
|
|
32
33
|
},
|
|
33
34
|
disabled: isSubmitting || status && (status.disabled || status.submitted) || disabled,
|
|
34
35
|
error: (meta.touched || submitCount > 0) && meta.error
|
|
35
|
-
})
|
|
36
|
+
});
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
export { FormikInput };
|
|
@@ -11,11 +11,11 @@ const FormikSubmitButton = ({
|
|
|
11
11
|
isValid,
|
|
12
12
|
isSubmitting
|
|
13
13
|
} = useFormikContext();
|
|
14
|
-
return React.createElement(Button,
|
|
14
|
+
return React.createElement(Button, { ...restProps,
|
|
15
15
|
disabled: !isValid || disabled,
|
|
16
16
|
busy: isSubmitting || busy,
|
|
17
17
|
type: 'submit'
|
|
18
|
-
})
|
|
18
|
+
});
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export { FormikSubmitButton };
|
|
@@ -19,14 +19,15 @@ const DropdownMenu = ({
|
|
|
19
19
|
const Tag = !item.isActive && item.url ? 'a' : 'span';
|
|
20
20
|
return React__default.createElement("li", {
|
|
21
21
|
key: key
|
|
22
|
-
}, React__default.createElement(Tag,
|
|
22
|
+
}, React__default.createElement(Tag, {
|
|
23
23
|
className: classNames(styles.dropdownMenuItem, {
|
|
24
24
|
[styles.active]: item.isActive
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
}),
|
|
26
|
+
...(item.url ? {
|
|
27
|
+
href: item.url,
|
|
28
|
+
onClick: linkHandler ? event => item.url && linkHandler(event, item.url) : undefined
|
|
29
|
+
} : {})
|
|
30
|
+
}, item.title));
|
|
30
31
|
}));
|
|
31
32
|
};
|
|
32
33
|
|
|
@@ -47,16 +48,16 @@ const HorizontalMenuItem = ({
|
|
|
47
48
|
className: styles.menuItemWrap,
|
|
48
49
|
onMouseEnter: handleEnter,
|
|
49
50
|
onMouseLeave: onMouseLeave
|
|
50
|
-
}, React__default.createElement(Tag,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
}, React__default.createElement(Tag, { ...(item.url ? {
|
|
52
|
+
href: item.url,
|
|
53
|
+
onClick: linkHandler ? event => item.url && linkHandler(event, item.url) : undefined
|
|
54
|
+
} : {}),
|
|
54
55
|
key: item.title,
|
|
55
56
|
className: classNames(styles.menuItem, textCn('rs-text-2'), {
|
|
56
57
|
[styles.itemActive]: item.isActive,
|
|
57
58
|
[styles.expanded]: isExpanded && !!item.items?.length
|
|
58
59
|
})
|
|
59
|
-
}
|
|
60
|
+
}, item.title), !!item.items?.length && React__default.createElement(DropdownMenu, {
|
|
60
61
|
items: item.items,
|
|
61
62
|
isExpanded: isExpanded,
|
|
62
63
|
alignRight: isLast,
|
|
@@ -15,17 +15,17 @@ const MenuListItem = ({
|
|
|
15
15
|
'--level': level
|
|
16
16
|
};
|
|
17
17
|
const handleClick = useCallback(event => linkHandler && item.url && linkHandler(event, item.url), []);
|
|
18
|
-
return React__default.createElement(Tag,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
return React__default.createElement(Tag, { ...(item.url ? {
|
|
19
|
+
href: item.url,
|
|
20
|
+
onClick: handleClick
|
|
21
|
+
} : {}),
|
|
22
22
|
className: classNames(styles.menuItem, {
|
|
23
23
|
[styles.menuItemRoot]: level === 0,
|
|
24
24
|
[styles.active]: item.isActive,
|
|
25
25
|
[styles.activeWithChild]: item.items && item.items.length
|
|
26
26
|
}),
|
|
27
27
|
style: style
|
|
28
|
-
}
|
|
28
|
+
}, item.title);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
const MenuList = ({
|
|
@@ -21,21 +21,21 @@ const Popup = ({
|
|
|
21
21
|
popupZIndex
|
|
22
22
|
}) => React.createElement(LayeringProvider, {
|
|
23
23
|
baseLayer: "popup"
|
|
24
|
-
}, React.createElement(ReactModal,
|
|
24
|
+
}, React.createElement(ReactModal, {
|
|
25
25
|
isOpen: isOpen,
|
|
26
26
|
className: styles.popup,
|
|
27
27
|
overlayClassName: styles.overlay,
|
|
28
28
|
onRequestClose: onRequestClose,
|
|
29
29
|
shouldCloseOnOverlayClick: shouldCloseOnOverlayClick,
|
|
30
|
-
shouldCloseOnEsc: shouldCloseOnEsc
|
|
31
|
-
|
|
30
|
+
shouldCloseOnEsc: shouldCloseOnEsc,
|
|
31
|
+
...restProps,
|
|
32
32
|
ariaHideApp: ariaHideApp,
|
|
33
33
|
style: {
|
|
34
34
|
overlay: {
|
|
35
35
|
zIndex: popupZIndex
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
}, !busy && showOuterCloseButton && React.createElement(Button, {
|
|
39
39
|
mode: 'rock',
|
|
40
40
|
theme: 'light',
|
|
41
41
|
icon: React.createElement(CloseIcon, null),
|
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.3.0
|
|
4
|
+
"version": "4.3.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "JetBrains",
|
|
7
7
|
"files": [
|
|
@@ -59,22 +59,26 @@
|
|
|
59
59
|
"@rollup/plugin-babel": "^5.3.1",
|
|
60
60
|
"@rollup/plugin-json": "^4.1.0",
|
|
61
61
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
62
|
-
"@storybook/addon-actions": "^6.
|
|
63
|
-
"@storybook/addon-essentials": "^6.
|
|
64
|
-
"@storybook/addon-links": "^6.
|
|
65
|
-
"@storybook/builder-webpack5": "^6.
|
|
66
|
-
"@storybook/
|
|
62
|
+
"@storybook/addon-actions": "^6.5.13",
|
|
63
|
+
"@storybook/addon-essentials": "^6.5.13",
|
|
64
|
+
"@storybook/addon-links": "^6.5.13",
|
|
65
|
+
"@storybook/builder-webpack5": "^6.5.13",
|
|
66
|
+
"@storybook/manager-webpack5": "^6.5.13",
|
|
67
|
+
"@storybook/react": "^6.5.13",
|
|
67
68
|
"@svgr/rollup": "^6.2.1",
|
|
68
69
|
"@svgr/webpack": "^5.5.0",
|
|
69
70
|
"@types/body-scroll-lock": "^3.1.0",
|
|
70
71
|
"@types/cookie": "^0.4.1",
|
|
71
72
|
"@types/fs-extra": "^9.0.13",
|
|
73
|
+
"@types/node": "^18.11.9",
|
|
74
|
+
"@types/postcss-import": "^14.0.0",
|
|
72
75
|
"@types/react": "^17.0.0",
|
|
73
76
|
"@types/react-dom": "^17.0.0",
|
|
74
77
|
"@types/react-modal": "^3.13.1",
|
|
75
78
|
"@types/react-outside-click-handler": "^1.3.1",
|
|
76
79
|
"@types/react-swipeable-views": "^0.13.1",
|
|
77
80
|
"@types/sha.js": "^2.4.0",
|
|
81
|
+
"@types/webpack": "^5.28.0",
|
|
78
82
|
"@types/youtube": "^0.0.45",
|
|
79
83
|
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
|
80
84
|
"@typescript-eslint/parser": "^4.22.0",
|
|
@@ -99,7 +103,7 @@
|
|
|
99
103
|
"formik": "^2.2.9",
|
|
100
104
|
"fs-extra": "^10.0.1",
|
|
101
105
|
"mini-css-extract-plugin": "1.4.0",
|
|
102
|
-
"postcss": "^8.
|
|
106
|
+
"postcss": "^8.4.19",
|
|
103
107
|
"postcss-custom-media": "^8.0.0",
|
|
104
108
|
"postcss-for": "^2.1.1",
|
|
105
109
|
"postcss-import": "^14.1.0",
|
|
@@ -108,14 +112,17 @@
|
|
|
108
112
|
"postcss-nested": "^5.0.5",
|
|
109
113
|
"postcss-remove-global": "^0.1.1",
|
|
110
114
|
"prettier": "2.2.1",
|
|
115
|
+
"prop-types": "^15.8.1",
|
|
111
116
|
"query-string": "^7.0.1",
|
|
112
117
|
"react": "^16.8.6",
|
|
118
|
+
"react-cache": "^2.0.0-alpha.1",
|
|
113
119
|
"react-dom": "^16.8.6",
|
|
114
120
|
"react-modal": "^3.14.4",
|
|
115
121
|
"react-outside-click-handler": "^1.3.0",
|
|
116
122
|
"react-remove-scroll-bar": "^2.2.0",
|
|
117
123
|
"react-scrollbar-size": "^5.0.0",
|
|
118
124
|
"react-swipeable-views": "^0.14.0",
|
|
125
|
+
"require-from-string": "^2.0.2",
|
|
119
126
|
"rollup": "^2.70.1",
|
|
120
127
|
"rollup-plugin-node-externals": "^4.0.0",
|
|
121
128
|
"rollup-plugin-postcss": "^4.0.2",
|
|
@@ -125,7 +132,7 @@
|
|
|
125
132
|
"svgo-loader": "^3.0.0",
|
|
126
133
|
"the-platform": "^0.10.1",
|
|
127
134
|
"ts-node": "^10.9.1",
|
|
128
|
-
"typescript": "^4.
|
|
135
|
+
"typescript": "^4.9.3",
|
|
129
136
|
"webpack": "^5.30.0",
|
|
130
137
|
"webpack-cli": "^4.6.0",
|
|
131
138
|
"whatwg-fetch": "^3.6.2"
|