@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.
@@ -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: tslib_1.__assign({ display: 'inline-flex', alignItems: 'center' }, 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,6 @@
1
+ export declare const styles: {
2
+ centeredIcon(): string;
3
+ };
4
+ export declare const baseIconStyles: {
5
+ centeredIcon(): string;
6
+ };
@@ -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.6.0",
4
+ "version": "1.7.0",
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"
@@ -1,8 +0,0 @@
1
- /**
2
- * ZERO WIDTH SPACE
3
- *
4
- * Symbol to align to baseline
5
- *
6
- * @see https://www.fileformat.info/info/unicode/char/200b/index.htm
7
- */
8
- export declare const ZERO_WIDTH_SPACE: string;
@@ -1,8 +0,0 @@
1
- /**
2
- * ZERO WIDTH SPACE
3
- *
4
- * Symbol to align to baseline
5
- *
6
- * @see https://www.fileformat.info/info/unicode/char/200b/index.htm
7
- */
8
- export var ZERO_WIDTH_SPACE = String.fromCharCode(0x200b);
@@ -1,8 +0,0 @@
1
- /**
2
- * ZERO WIDTH SPACE
3
- *
4
- * Symbol to align to baseline
5
- *
6
- * @see https://www.fileformat.info/info/unicode/char/200b/index.htm
7
- */
8
- export declare const ZERO_WIDTH_SPACE: string;
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);