@skbkontur/icons 1.7.1 → 1.7.2

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 CHANGED
@@ -3,6 +3,14 @@
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.2](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/icons@1.7.1...@skbkontur/icons@1.7.2) (2023-11-30)
7
+
8
+ **Note:** Version bump only for package @skbkontur/icons
9
+
10
+
11
+
12
+
13
+
6
14
  ## [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
15
 
8
16
  **Note:** Version bump only for package @skbkontur/icons
@@ -1,18 +1,26 @@
1
1
  import { __assign, __rest } from "tslib";
2
2
  /* eslint-disable react/display-name */
3
- import React from 'react';
3
+ import React, { useEffect } from 'react';
4
4
  import { IconDataTids } from './Icon';
5
5
  import { forwardRef } from '../helpers/forwardRef';
6
- import { baseIconStyles } from './BaseIcon.styles';
7
6
  export var BaseIcon = forwardRef('BaseIcon', function (_a, ref) {
8
7
  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"]);
8
+ useEffect(function () {
9
+ var styleId = 'ui-parking-icons-style';
10
+ if (document.getElementById(styleId) === null) {
11
+ var style_1 = document.createElement('style');
12
+ style_1.id = styleId;
13
+ style_1.innerHTML = "\n .ui-parking-icon-centered {\n display: -webkit-inline-box;\n display: inline-flex;\n\n -webkit-box-align: center;\n align-items: center;\n }\n\n .ui-parking-icon-centered::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 ";
14
+ document.getElementsByTagName('head')[0].appendChild(style_1);
15
+ }
16
+ }, []);
9
17
  var icon = (React.createElement("svg", __assign({ "data-tid": IconDataTids.root, ref: ref, width: size || viewBoxSize, height: size || viewBoxSize, style: Object.assign({
10
18
  fill: color !== null && color !== void 0 ? color : 'currentColor',
11
19
  marginBottom: align === 'none' || align === 'center' ? 0 : '-0.1875em',
12
20
  flexShrink: 0,
13
21
  }, align !== 'center' ? style : undefined), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 " + viewBoxSize + " " + viewBoxSize, "aria-hidden": ariaHidden }, rest), children));
14
22
  if (align === 'center') {
15
- return (React.createElement("span", { "aria-hidden": ariaHidden, style: style, className: baseIconStyles.centeredIcon() }, icon));
23
+ return (React.createElement("span", { className: 'ui-parking-icon-centered', "aria-hidden": ariaHidden, style: style }, icon));
16
24
  }
17
25
  return icon;
18
26
  });
@@ -3,19 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseIcon = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  /* eslint-disable react/display-name */
6
- var react_1 = tslib_1.__importDefault(require("react"));
6
+ var react_1 = tslib_1.__importStar(require("react"));
7
7
  var Icon_1 = require("./Icon");
8
8
  var forwardRef_1 = require("../helpers/forwardRef");
9
- var BaseIcon_styles_1 = require("./BaseIcon.styles");
10
9
  exports.BaseIcon = forwardRef_1.forwardRef('BaseIcon', function (_a, ref) {
11
10
  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"]);
11
+ react_1.useEffect(function () {
12
+ var styleId = 'ui-parking-icons-style';
13
+ if (document.getElementById(styleId) === null) {
14
+ var style_1 = document.createElement('style');
15
+ style_1.id = styleId;
16
+ style_1.innerHTML = "\n .ui-parking-icon-centered {\n display: -webkit-inline-box;\n display: inline-flex;\n\n -webkit-box-align: center;\n align-items: center;\n }\n\n .ui-parking-icon-centered::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 ";
17
+ document.getElementsByTagName('head')[0].appendChild(style_1);
18
+ }
19
+ }, []);
12
20
  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({
13
21
  fill: color !== null && color !== void 0 ? color : 'currentColor',
14
22
  marginBottom: align === 'none' || align === 'center' ? 0 : '-0.1875em',
15
23
  flexShrink: 0,
16
24
  }, align !== 'center' ? style : undefined), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 " + viewBoxSize + " " + viewBoxSize, "aria-hidden": ariaHidden }, rest), children));
17
25
  if (align === 'center') {
18
- return (react_1.default.createElement("span", { "aria-hidden": ariaHidden, style: style, className: BaseIcon_styles_1.baseIconStyles.centeredIcon() }, icon));
26
+ return (react_1.default.createElement("span", { className: 'ui-parking-icon-centered', "aria-hidden": ariaHidden, style: style }, icon));
19
27
  }
20
28
  return icon;
21
29
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@skbkontur/icons",
3
3
  "description": "react-ui-icons",
4
- "version": "1.7.1",
4
+ "version": "1.7.2",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
7
7
  },
@@ -10,7 +10,7 @@
10
10
  "sideEffects": false,
11
11
  "license": "UNLICENSED",
12
12
  "scripts": {
13
- "clean": "git clean -fdxqe node_modules",
13
+ "clean": "git clean -fd -X",
14
14
  "prebuild": "yarn run clean && yarn reexport:generate",
15
15
  "build": "yarn tsc && yarn tsc -p tsconfig.esm.json",
16
16
  "lint:fix": "yarn eslint --ext .tsx,.ts --fix . && prettier --write .",
@@ -19,7 +19,6 @@
19
19
  "icons": "yarn icons:generate && yarn lint:fix"
20
20
  },
21
21
  "devDependencies": {
22
- "@skbkontur/react-ui": "4.17.1",
23
22
  "svgo": "2.8.0"
24
23
  },
25
24
  "author": "Kontur"
@@ -1,6 +0,0 @@
1
- export declare const styles: {
2
- centeredIcon(): string;
3
- };
4
- export declare const baseIconStyles: {
5
- centeredIcon(): string;
6
- };
@@ -1,9 +0,0 @@
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;
@@ -1,6 +0,0 @@
1
- export declare const styles: {
2
- centeredIcon(): string;
3
- };
4
- export declare const baseIconStyles: {
5
- centeredIcon(): string;
6
- };
@@ -1,12 +0,0 @@
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;