@skbkontur/icons 1.6.1 → 1.7.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 +19 -0
- package/esm/internal/BaseIcon.js +2 -4
- package/esm/internal/BaseIcon.styles.d.ts +6 -0
- package/esm/internal/BaseIcon.styles.js +9 -0
- package/internal/BaseIcon.js +2 -4
- package/internal/BaseIcon.styles.d.ts +6 -0
- package/internal/BaseIcon.styles.js +12 -0
- package/package.json +2 -1
- package/esm/internal/chars.d.ts +0 -8
- package/esm/internal/chars.js +0 -8
- package/internal/chars.d.ts +0 -8
- package/internal/chars.js +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.7.1](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/icons@1.7.0...@skbkontur/icons@1.7.1) (2023-11-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @skbkontur/icons
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.7.0](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/icons@1.6.1...@skbkontur/icons@1.7.0) (2023-11-10)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **icons:** simplify testing of the package ([56c216b](https://git.skbkontur.ru/ui/ui-parking/commits/56c216ba03c8cdfd5678bb31a0f6fb87a14b5349))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [1.6.1](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/icons@1.6.0...@skbkontur/icons@1.6.1) (2023-11-09)
|
|
7
26
|
|
|
8
27
|
|
package/esm/internal/BaseIcon.js
CHANGED
|
@@ -2,8 +2,8 @@ import { __assign, __rest } from "tslib";
|
|
|
2
2
|
/* eslint-disable react/display-name */
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { IconDataTids } from './Icon';
|
|
5
|
-
import { ZERO_WIDTH_SPACE } from './chars';
|
|
6
5
|
import { forwardRef } from '../helpers/forwardRef';
|
|
6
|
+
import { baseIconStyles } from './BaseIcon.styles';
|
|
7
7
|
export var BaseIcon = forwardRef('BaseIcon', function (_a, ref) {
|
|
8
8
|
var color = _a.color, size = _a.size, style = _a.style, _b = _a["aria-hidden"], ariaHidden = _b === void 0 ? true : _b, _c = _a.viewBoxSize, viewBoxSize = _c === void 0 ? 16 : _c, _d = _a.align, align = _d === void 0 ? 'center' : _d, children = _a.children, rest = __rest(_a, ["color", "size", "style", 'aria-hidden', "viewBoxSize", "align", "children"]);
|
|
9
9
|
var icon = (React.createElement("svg", __assign({ "data-tid": IconDataTids.root, ref: ref, width: size || viewBoxSize, height: size || viewBoxSize, style: Object.assign({
|
|
@@ -12,9 +12,7 @@ export var BaseIcon = forwardRef('BaseIcon', function (_a, ref) {
|
|
|
12
12
|
flexShrink: 0,
|
|
13
13
|
}, align !== 'center' ? style : undefined), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 " + viewBoxSize + " " + viewBoxSize, "aria-hidden": ariaHidden }, rest), children));
|
|
14
14
|
if (align === 'center') {
|
|
15
|
-
return (React.createElement("span", { "aria-hidden": ariaHidden, style:
|
|
16
|
-
ZERO_WIDTH_SPACE,
|
|
17
|
-
icon));
|
|
15
|
+
return (React.createElement("span", { "aria-hidden": ariaHidden, style: style, className: baseIconStyles.centeredIcon() }, icon));
|
|
18
16
|
}
|
|
19
17
|
return icon;
|
|
20
18
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
2
|
+
import { css, memoizeStyle } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
3
|
+
export var styles = {
|
|
4
|
+
centeredIcon: function () {
|
|
5
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n\n &::before {\n /*\n * ZERO WIDTH SPACE\n *\n * Symbol to align to baseline\n *\n * @see https://www.fileformat.info/info/unicode/char/200b/index.htm\n */\n content: '\\200B';\n }\n "], ["\n display: inline-flex;\n align-items: center;\n\n &::before {\n /*\n * ZERO WIDTH SPACE\n *\n * Symbol to align to baseline\n *\n * @see https://www.fileformat.info/info/unicode/char/200b/index.htm\n */\n content: '\\\\200B';\n }\n "])));
|
|
6
|
+
},
|
|
7
|
+
};
|
|
8
|
+
export var baseIconStyles = memoizeStyle(styles);
|
|
9
|
+
var templateObject_1;
|
package/internal/BaseIcon.js
CHANGED
|
@@ -5,8 +5,8 @@ var tslib_1 = require("tslib");
|
|
|
5
5
|
/* eslint-disable react/display-name */
|
|
6
6
|
var react_1 = tslib_1.__importDefault(require("react"));
|
|
7
7
|
var Icon_1 = require("./Icon");
|
|
8
|
-
var chars_1 = require("./chars");
|
|
9
8
|
var forwardRef_1 = require("../helpers/forwardRef");
|
|
9
|
+
var BaseIcon_styles_1 = require("./BaseIcon.styles");
|
|
10
10
|
exports.BaseIcon = forwardRef_1.forwardRef('BaseIcon', function (_a, ref) {
|
|
11
11
|
var color = _a.color, size = _a.size, style = _a.style, _b = _a["aria-hidden"], ariaHidden = _b === void 0 ? true : _b, _c = _a.viewBoxSize, viewBoxSize = _c === void 0 ? 16 : _c, _d = _a.align, align = _d === void 0 ? 'center' : _d, children = _a.children, rest = tslib_1.__rest(_a, ["color", "size", "style", 'aria-hidden', "viewBoxSize", "align", "children"]);
|
|
12
12
|
var icon = (react_1.default.createElement("svg", tslib_1.__assign({ "data-tid": Icon_1.IconDataTids.root, ref: ref, width: size || viewBoxSize, height: size || viewBoxSize, style: Object.assign({
|
|
@@ -15,9 +15,7 @@ exports.BaseIcon = forwardRef_1.forwardRef('BaseIcon', function (_a, ref) {
|
|
|
15
15
|
flexShrink: 0,
|
|
16
16
|
}, align !== 'center' ? style : undefined), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 " + viewBoxSize + " " + viewBoxSize, "aria-hidden": ariaHidden }, rest), children));
|
|
17
17
|
if (align === 'center') {
|
|
18
|
-
return (react_1.default.createElement("span", { "aria-hidden": ariaHidden, style:
|
|
19
|
-
chars_1.ZERO_WIDTH_SPACE,
|
|
20
|
-
icon));
|
|
18
|
+
return (react_1.default.createElement("span", { "aria-hidden": ariaHidden, style: style, className: BaseIcon_styles_1.baseIconStyles.centeredIcon() }, icon));
|
|
21
19
|
}
|
|
22
20
|
return icon;
|
|
23
21
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.baseIconStyles = exports.styles = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var Emotion_1 = require("@skbkontur/react-ui/lib/theming/Emotion");
|
|
6
|
+
exports.styles = {
|
|
7
|
+
centeredIcon: function () {
|
|
8
|
+
return Emotion_1.css(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n\n &::before {\n /*\n * ZERO WIDTH SPACE\n *\n * Symbol to align to baseline\n *\n * @see https://www.fileformat.info/info/unicode/char/200b/index.htm\n */\n content: '\\200B';\n }\n "], ["\n display: inline-flex;\n align-items: center;\n\n &::before {\n /*\n * ZERO WIDTH SPACE\n *\n * Symbol to align to baseline\n *\n * @see https://www.fileformat.info/info/unicode/char/200b/index.htm\n */\n content: '\\\\200B';\n }\n "])));
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
exports.baseIconStyles = Emotion_1.memoizeStyle(exports.styles);
|
|
12
|
+
var templateObject_1;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skbkontur/icons",
|
|
3
3
|
"description": "react-ui-icons",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.7.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
7
7
|
},
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"icons": "yarn icons:generate && yarn lint:fix"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
+
"@skbkontur/react-ui": "4.17.1",
|
|
22
23
|
"svgo": "2.8.0"
|
|
23
24
|
},
|
|
24
25
|
"author": "Kontur"
|
package/esm/internal/chars.d.ts
DELETED
package/esm/internal/chars.js
DELETED
package/internal/chars.d.ts
DELETED
package/internal/chars.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZERO_WIDTH_SPACE = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* ZERO WIDTH SPACE
|
|
6
|
-
*
|
|
7
|
-
* Symbol to align to baseline
|
|
8
|
-
*
|
|
9
|
-
* @see https://www.fileformat.info/info/unicode/char/200b/index.htm
|
|
10
|
-
*/
|
|
11
|
-
exports.ZERO_WIDTH_SPACE = String.fromCharCode(0x200b);
|