@gravity-ui/page-constructor 1.17.0 → 1.18.1
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 +14 -0
- package/build/cjs/components/Button/Button.css +2 -0
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +1 -3
- package/build/cjs/navigation/components/NavigationItem/components/GithubStars/GithubStars.css +4 -0
- package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.css +6 -0
- package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js +3 -3
- package/build/cjs/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.css +4 -0
- package/build/cjs/navigation/components/NavigationItem/mixins.css +0 -0
- package/build/esm/components/Button/Button.css +2 -0
- package/build/esm/navigation/components/NavigationItem/NavigationItem.d.ts +0 -1
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +1 -4
- package/build/esm/navigation/components/NavigationItem/components/GithubStars/GithubStars.css +4 -0
- package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.css +6 -0
- package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js +3 -3
- package/build/esm/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.css +4 -0
- package/build/esm/navigation/components/NavigationItem/mixins.css +0 -0
- package/package.json +1 -1
- package/styles/mixins.scss +10 -0
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.css +0 -6
- package/build/esm/navigation/components/NavigationItem/NavigationItem.css +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.18.1](https://github.com/gravity-ui/page-constructor/compare/v1.18.0...v1.18.1) (2023-02-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* add mixin for navigation item and refactor ([#179](https://github.com/gravity-ui/page-constructor/issues/179)) ([3709fcd](https://github.com/gravity-ui/page-constructor/commit/3709fcdcaa2149ed287fb9ef0250dfca1181c842))
|
|
9
|
+
|
|
10
|
+
## [1.18.0](https://github.com/gravity-ui/page-constructor/compare/v1.17.0...v1.18.0) (2023-02-28)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* monochrome mixin moved from 'Button.css' to 'mixins.css' ([#173](https://github.com/gravity-ui/page-constructor/issues/173)) ([6bb35cf](https://github.com/gravity-ui/page-constructor/commit/6bb35cfea50f7c62682404da02f594dd4f90a011))
|
|
16
|
+
|
|
3
17
|
## [1.17.0](https://github.com/gravity-ui/page-constructor/compare/v1.16.4...v1.17.0) (2023-02-28)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
-
const utils_1 = require("../../../utils");
|
|
6
5
|
const models_1 = require("../../../models");
|
|
7
6
|
const SocialIcon_1 = tslib_1.__importDefault(require("../SocialIcon/SocialIcon"));
|
|
8
7
|
const NavigationButton_1 = require("./components/NavigationButton/NavigationButton");
|
|
9
8
|
const NavigationDropdown_1 = require("./components/NavigationDropdown/NavigationDropdown");
|
|
10
9
|
const NavigationLink_1 = require("./components/NavigationLink/NavigationLink");
|
|
11
10
|
const GithubStars_1 = require("./components/GithubStars/GithubStars");
|
|
12
|
-
const b = (0, utils_1.block)('navigation-item');
|
|
13
11
|
//todo: add types support form component in map
|
|
14
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
13
|
const NavigationItemsMap = {
|
|
@@ -23,7 +21,7 @@ const NavigationItem = (_a) => {
|
|
|
23
21
|
var { data, className } = _a, props = tslib_1.__rest(_a, ["data", "className"]);
|
|
24
22
|
const { type = models_1.NavigationItemType.Link } = data;
|
|
25
23
|
const Component = NavigationItemsMap[type];
|
|
26
|
-
const componentProps = (0, react_1.useMemo)(() => (Object.assign(Object.assign({ className
|
|
24
|
+
const componentProps = (0, react_1.useMemo)(() => (Object.assign(Object.assign({ className }, data), props)), [className, data, props]);
|
|
27
25
|
return react_1.default.createElement(Component, Object.assign({}, componentProps));
|
|
28
26
|
};
|
|
29
27
|
exports.default = NavigationItem;
|
|
@@ -10,10 +10,10 @@ const utils_2 = require("../../../../../components/Media/Image/utils");
|
|
|
10
10
|
const b = (0, utils_1.block)('navigation-dropdown');
|
|
11
11
|
const TOGGLE_ARROW_SIZE = 12;
|
|
12
12
|
const NavigationDropdown = (_a) => {
|
|
13
|
-
var { text, icon, isOpened } = _a, props = tslib_1.__rest(_a, ["text", "icon", "isOpened"]);
|
|
13
|
+
var { text, icon, isOpened, className } = _a, props = tslib_1.__rest(_a, ["text", "icon", "isOpened", "className"]);
|
|
14
14
|
const iconData = icon && (0, utils_2.getMediaImage)(icon);
|
|
15
|
-
return (react_1.default.createElement("span", Object.assign({}, props),
|
|
15
|
+
return (react_1.default.createElement("span", Object.assign({}, props, { className: b(null, className) }),
|
|
16
16
|
react_1.default.createElement(ContentWrapper_1.ContentWrapper, { text: text, icon: iconData }),
|
|
17
|
-
react_1.default.createElement(components_1.ToggleArrow, { className: b(), size: TOGGLE_ARROW_SIZE, type: 'vertical', iconType: "navigation", open: isOpened })));
|
|
17
|
+
react_1.default.createElement(components_1.ToggleArrow, { className: b('arrow'), size: TOGGLE_ARROW_SIZE, type: 'vertical', iconType: "navigation", open: isOpened })));
|
|
18
18
|
};
|
|
19
19
|
exports.NavigationDropdown = NavigationDropdown;
|
package/build/cjs/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.css
CHANGED
|
@@ -5,6 +5,10 @@ unpredictable css rules order in build */
|
|
|
5
5
|
color: inherit;
|
|
6
6
|
text-decoration: none;
|
|
7
7
|
outline: none;
|
|
8
|
+
position: relative;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
white-space: nowrap;
|
|
8
12
|
}
|
|
9
13
|
.utilityfocus .pc-navigation-link:focus {
|
|
10
14
|
outline: 2px solid #ffdb4d;
|
|
File without changes
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import { block } from '../../../utils';
|
|
4
3
|
import { NavigationItemType } from '../../../models';
|
|
5
4
|
import SocialIcon from '../SocialIcon/SocialIcon';
|
|
6
5
|
import { NavigationButton } from './components/NavigationButton/NavigationButton';
|
|
7
6
|
import { NavigationDropdown } from './components/NavigationDropdown/NavigationDropdown';
|
|
8
7
|
import { NavigationLink } from './components/NavigationLink/NavigationLink';
|
|
9
8
|
import { GithubStars } from './components/GithubStars/GithubStars';
|
|
10
|
-
import './NavigationItem.css';
|
|
11
|
-
const b = block('navigation-item');
|
|
12
9
|
//todo: add types support form component in map
|
|
13
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
11
|
const NavigationItemsMap = {
|
|
@@ -22,7 +19,7 @@ const NavigationItem = (_a) => {
|
|
|
22
19
|
var { data, className } = _a, props = __rest(_a, ["data", "className"]);
|
|
23
20
|
const { type = NavigationItemType.Link } = data;
|
|
24
21
|
const Component = NavigationItemsMap[type];
|
|
25
|
-
const componentProps = useMemo(() => (Object.assign(Object.assign({ className
|
|
22
|
+
const componentProps = useMemo(() => (Object.assign(Object.assign({ className }, data), props)), [className, data, props]);
|
|
26
23
|
return React.createElement(Component, Object.assign({}, componentProps));
|
|
27
24
|
};
|
|
28
25
|
export default NavigationItem;
|
|
@@ -8,9 +8,9 @@ import './NavigationDropdown.css';
|
|
|
8
8
|
const b = block('navigation-dropdown');
|
|
9
9
|
const TOGGLE_ARROW_SIZE = 12;
|
|
10
10
|
export const NavigationDropdown = (_a) => {
|
|
11
|
-
var { text, icon, isOpened } = _a, props = __rest(_a, ["text", "icon", "isOpened"]);
|
|
11
|
+
var { text, icon, isOpened, className } = _a, props = __rest(_a, ["text", "icon", "isOpened", "className"]);
|
|
12
12
|
const iconData = icon && getMediaImage(icon);
|
|
13
|
-
return (React.createElement("span", Object.assign({}, props),
|
|
13
|
+
return (React.createElement("span", Object.assign({}, props, { className: b(null, className) }),
|
|
14
14
|
React.createElement(ContentWrapper, { text: text, icon: iconData }),
|
|
15
|
-
React.createElement(ToggleArrow, { className: b(), size: TOGGLE_ARROW_SIZE, type: 'vertical', iconType: "navigation", open: isOpened })));
|
|
15
|
+
React.createElement(ToggleArrow, { className: b('arrow'), size: TOGGLE_ARROW_SIZE, type: 'vertical', iconType: "navigation", open: isOpened })));
|
|
16
16
|
};
|
package/build/esm/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.css
CHANGED
|
@@ -5,6 +5,10 @@ unpredictable css rules order in build */
|
|
|
5
5
|
color: inherit;
|
|
6
6
|
text-decoration: none;
|
|
7
7
|
outline: none;
|
|
8
|
+
position: relative;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
white-space: nowrap;
|
|
8
12
|
}
|
|
9
13
|
.utilityfocus .pc-navigation-link:focus {
|
|
10
14
|
outline: 2px solid #ffdb4d;
|
|
File without changes
|
package/package.json
CHANGED
package/styles/mixins.scss
CHANGED
|
@@ -480,3 +480,13 @@ unpredictable css rules order in build */
|
|
|
480
480
|
color: var(--yc-color-text-link);
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
+
|
|
484
|
+
@mixin monochromeButton() {
|
|
485
|
+
--yc-button-background-color: var(--pc-monochrome-button-background-color);
|
|
486
|
+
--yc-button-background-color-hover: var(--pc-monochrome-button-background-color-hover);
|
|
487
|
+
color: var(--pc-monochrome-button-color);
|
|
488
|
+
|
|
489
|
+
&:hover {
|
|
490
|
+
color: var(--pc-monochrome-button-color);
|
|
491
|
+
}
|
|
492
|
+
}
|