@skbkontur/icons 1.6.0 → 1.7.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 +22 -0
- package/esm/icons/index.d.ts +298 -298
- package/esm/icons/index.js +302 -299
- 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/icons/index.d.ts +298 -298
- package/icons/index.js +302 -299
- 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/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;
|