@ant-design/icons 4.8.0 → 5.0.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/es/utils.js CHANGED
@@ -63,9 +63,14 @@ export var iconStyles = "\n.anticon {\n display: inline-block;\n color: inheri
63
63
  export var useInsertStyles = function useInsertStyles() {
64
64
  var styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : iconStyles;
65
65
  var _useContext = useContext(IconContext),
66
- csp = _useContext.csp;
66
+ csp = _useContext.csp,
67
+ prefixCls = _useContext.prefixCls;
68
+ var mergedStyleStr = styleStr;
69
+ if (prefixCls) {
70
+ mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
71
+ }
67
72
  useEffect(function () {
68
- updateCSS(styleStr, '@ant-design-icons', {
73
+ updateCSS(mergedStyleStr, '@ant-design-icons', {
69
74
  prepend: true,
70
75
  csp: csp
71
76
  });
package/lib/utils.js CHANGED
@@ -82,9 +82,14 @@ exports.iconStyles = iconStyles;
82
82
  var useInsertStyles = function useInsertStyles() {
83
83
  var styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : iconStyles;
84
84
  var _useContext = (0, _react.useContext)(_Context.default),
85
- csp = _useContext.csp;
85
+ csp = _useContext.csp,
86
+ prefixCls = _useContext.prefixCls;
87
+ var mergedStyleStr = styleStr;
88
+ if (prefixCls) {
89
+ mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
90
+ }
86
91
  (0, _react.useEffect)(function () {
87
- (0, _dynamicCSS.updateCSS)(styleStr, '@ant-design-icons', {
92
+ (0, _dynamicCSS.updateCSS)(mergedStyleStr, '@ant-design-icons', {
88
93
  prepend: true,
89
94
  csp: csp
90
95
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/icons",
3
- "version": "4.8.0",
3
+ "version": "5.0.1",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "unpkg": "./dist/index.umd.js",
@@ -52,6 +52,7 @@
52
52
  "eslint": "^7.1.0",
53
53
  "father": "^2.29.11",
54
54
  "glob": "^7.1.6",
55
+ "history": "^4.9.0",
55
56
  "lodash": "^4.17.15",
56
57
  "mobx": "^5.1.0",
57
58
  "mobx-react": "^6.1.3",
@@ -64,7 +65,7 @@
64
65
  "typescript": "^4.0.2"
65
66
  },
66
67
  "dependencies": {
67
- "@ant-design/colors": "^6.0.0",
68
+ "@ant-design/colors": "^7.0.0",
68
69
  "@ant-design/icons-svg": "^4.2.1",
69
70
  "@babel/runtime": "^7.11.2",
70
71
  "classnames": "^2.2.6",