@ant-design/icons 6.0.1 → 6.1.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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  import * as React from 'react';
5
- import classNames from 'classnames';
5
+ import { clsx } from 'clsx';
6
6
  import { blue } from '@ant-design/colors';
7
7
  import Context from "./Context";
8
8
  import ReactIcon from "./IconBase";
@@ -32,7 +32,7 @@ const Icon = /*#__PURE__*/React.forwardRef((props, ref) => {
32
32
  prefixCls = 'anticon',
33
33
  rootClassName
34
34
  } = React.useContext(Context);
35
- const classString = classNames(rootClassName, prefixCls, {
35
+ const classString = clsx(rootClassName, prefixCls, {
36
36
  [`${prefixCls}-${icon.name}`]: !!icon.name,
37
37
  [`${prefixCls}-spin`]: !!spin || icon.name === 'loading'
38
38
  }, className);
@@ -60,7 +60,9 @@ const Icon = /*#__PURE__*/React.forwardRef((props, ref) => {
60
60
  style: svgStyle
61
61
  }));
62
62
  });
63
- Icon.displayName = 'AntdIcon';
64
63
  Icon.getTwoToneColor = getTwoToneColor;
65
64
  Icon.setTwoToneColor = setTwoToneColor;
65
+ if (process.env.NODE_ENV !== 'production') {
66
+ Icon.displayName = 'AntdIcon';
67
+ }
66
68
  export default Icon;
@@ -1,7 +1,7 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  // Seems this is used for iconFont
3
3
  import * as React from 'react';
4
- import classNames from 'classnames';
4
+ import { clsx } from 'clsx';
5
5
  import { useComposeRef } from "@rc-component/util/es/ref";
6
6
  import Context from "./Context";
7
7
  import { svgBaseProps, warning, useInsertStyles } from "../utils";
@@ -20,7 +20,7 @@ const Icon = /*#__PURE__*/React.forwardRef((props, ref) => {
20
20
  children,
21
21
  ...restProps
22
22
  } = props;
23
- const iconRef = React.useRef();
23
+ const iconRef = React.useRef(null);
24
24
  const mergedRef = useComposeRef(iconRef, ref);
25
25
  warning(Boolean(Component || children), 'Should have `component` prop or `children`.');
26
26
  useInsertStyles(iconRef);
@@ -28,10 +28,10 @@ const Icon = /*#__PURE__*/React.forwardRef((props, ref) => {
28
28
  prefixCls = 'anticon',
29
29
  rootClassName
30
30
  } = React.useContext(Context);
31
- const classString = classNames(rootClassName, prefixCls, {
31
+ const classString = clsx(rootClassName, prefixCls, {
32
32
  [`${prefixCls}-spin`]: !!spin && !!Component
33
33
  }, className);
34
- const svgClassString = classNames({
34
+ const svgClassString = clsx({
35
35
  [`${prefixCls}-spin`]: !!spin
36
36
  });
37
37
  const svgStyle = rotate ? {
@@ -74,5 +74,7 @@ const Icon = /*#__PURE__*/React.forwardRef((props, ref) => {
74
74
  className: classString
75
75
  }), renderInnerNode());
76
76
  });
77
- Icon.displayName = 'AntdIcon';
77
+ if (process.env.NODE_ENV !== 'production') {
78
+ Icon.displayName = 'AntdIcon';
79
+ }
78
80
  export default Icon;
@@ -28,7 +28,7 @@ const IconBase = props => {
28
28
  secondaryColor,
29
29
  ...restProps
30
30
  } = props;
31
- const svgRef = React.useRef();
31
+ const svgRef = React.useRef(null);
32
32
  let colors = twoToneColorPalette;
33
33
  if (primaryColor) {
34
34
  colors = {
package/es/utils.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { generate as generateColor } from '@ant-design/colors';
2
2
  import { updateCSS } from "@rc-component/util/es/Dom/dynamicCSS";
3
3
  import { getShadowRoot } from "@rc-component/util/es/Dom/shadow";
4
- import warn from "@rc-component/util/es/warning";
4
+ import { warningOnce } from "@rc-component/util/es/warning";
5
5
  import React, { useContext, useEffect } from 'react';
6
6
  import IconContext from "./components/Context";
7
7
  function camelCase(input) {
8
8
  return input.replace(/-(.)/g, (match, g) => g.toUpperCase());
9
9
  }
10
10
  export function warning(valid, message) {
11
- warn(valid, `[@ant-design/icons] ${message}`);
11
+ warningOnce(valid, `[@ant-design/icons] ${message}`);
12
12
  }
13
13
  export function isIconDefinition(target) {
14
14
  return typeof target === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (typeof target.icon === 'object' || typeof target.icon === 'function');
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var React = _interopRequireWildcard(require("react"));
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _clsx = require("clsx");
10
10
  var _colors = require("@ant-design/colors");
11
11
  var _Context = _interopRequireDefault(require("./Context"));
12
12
  var _IconBase = _interopRequireDefault(require("./IconBase"));
@@ -40,7 +40,7 @@ const Icon = /*#__PURE__*/React.forwardRef((props, ref) => {
40
40
  prefixCls = 'anticon',
41
41
  rootClassName
42
42
  } = React.useContext(_Context.default);
43
- const classString = (0, _classnames.default)(rootClassName, prefixCls, {
43
+ const classString = (0, _clsx.clsx)(rootClassName, prefixCls, {
44
44
  [`${prefixCls}-${icon.name}`]: !!icon.name,
45
45
  [`${prefixCls}-spin`]: !!spin || icon.name === 'loading'
46
46
  }, className);
@@ -68,7 +68,9 @@ const Icon = /*#__PURE__*/React.forwardRef((props, ref) => {
68
68
  style: svgStyle
69
69
  }));
70
70
  });
71
- Icon.displayName = 'AntdIcon';
72
71
  Icon.getTwoToneColor = _twoTonePrimaryColor.getTwoToneColor;
73
72
  Icon.setTwoToneColor = _twoTonePrimaryColor.setTwoToneColor;
73
+ if (process.env.NODE_ENV !== 'production') {
74
+ Icon.displayName = 'AntdIcon';
75
+ }
74
76
  var _default = exports.default = Icon;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
- var _classnames = _interopRequireDefault(require("classnames"));
8
+ var _clsx = require("clsx");
9
9
  var _ref = require("@rc-component/util/lib/ref");
10
10
  var _Context = _interopRequireDefault(require("./Context"));
11
11
  var _utils = require("../utils");
@@ -28,7 +28,7 @@ const Icon = /*#__PURE__*/React.forwardRef((props, ref) => {
28
28
  children,
29
29
  ...restProps
30
30
  } = props;
31
- const iconRef = React.useRef();
31
+ const iconRef = React.useRef(null);
32
32
  const mergedRef = (0, _ref.useComposeRef)(iconRef, ref);
33
33
  (0, _utils.warning)(Boolean(Component || children), 'Should have `component` prop or `children`.');
34
34
  (0, _utils.useInsertStyles)(iconRef);
@@ -36,10 +36,10 @@ const Icon = /*#__PURE__*/React.forwardRef((props, ref) => {
36
36
  prefixCls = 'anticon',
37
37
  rootClassName
38
38
  } = React.useContext(_Context.default);
39
- const classString = (0, _classnames.default)(rootClassName, prefixCls, {
39
+ const classString = (0, _clsx.clsx)(rootClassName, prefixCls, {
40
40
  [`${prefixCls}-spin`]: !!spin && !!Component
41
41
  }, className);
42
- const svgClassString = (0, _classnames.default)({
42
+ const svgClassString = (0, _clsx.clsx)({
43
43
  [`${prefixCls}-spin`]: !!spin
44
44
  });
45
45
  const svgStyle = rotate ? {
@@ -82,5 +82,7 @@ const Icon = /*#__PURE__*/React.forwardRef((props, ref) => {
82
82
  className: classString
83
83
  }), renderInnerNode());
84
84
  });
85
- Icon.displayName = 'AntdIcon';
85
+ if (process.env.NODE_ENV !== 'production') {
86
+ Icon.displayName = 'AntdIcon';
87
+ }
86
88
  var _default = exports.default = Icon;
@@ -36,7 +36,7 @@ const IconBase = props => {
36
36
  secondaryColor,
37
37
  ...restProps
38
38
  } = props;
39
- const svgRef = React.useRef();
39
+ const svgRef = React.useRef(null);
40
40
  let colors = twoToneColorPalette;
41
41
  if (primaryColor) {
42
42
  colors = {
package/lib/utils.js CHANGED
@@ -14,17 +14,17 @@ exports.warning = warning;
14
14
  var _colors = require("@ant-design/colors");
15
15
  var _dynamicCSS = require("@rc-component/util/lib/Dom/dynamicCSS");
16
16
  var _shadow = require("@rc-component/util/lib/Dom/shadow");
17
- var _warning = _interopRequireDefault(require("@rc-component/util/lib/warning"));
17
+ var _warning = require("@rc-component/util/lib/warning");
18
18
  var _react = _interopRequireWildcard(require("react"));
19
19
  var _Context = _interopRequireDefault(require("./components/Context"));
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
21
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
21
22
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
  function camelCase(input) {
24
24
  return input.replace(/-(.)/g, (match, g) => g.toUpperCase());
25
25
  }
26
26
  function warning(valid, message) {
27
- (0, _warning.default)(valid, `[@ant-design/icons] ${message}`);
27
+ (0, _warning.warningOnce)(valid, `[@ant-design/icons] ${message}`);
28
28
  }
29
29
  function isIconDefinition(target) {
30
30
  return typeof target === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (typeof target.icon === 'object' || typeof target.icon === 'function');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/icons",
3
- "version": "6.0.1",
3
+ "version": "6.1.0",
4
4
  "repository": "https://github.com/ant-design/ant-design-icons/tree/master/packages/icons-react",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -27,25 +27,23 @@
27
27
  "dependencies": {
28
28
  "@ant-design/colors": "^8.0.0",
29
29
  "@ant-design/icons-svg": "^4.4.0",
30
- "classnames": "^2.2.6",
31
- "@rc-component/util": "^1.2.1"
30
+ "@rc-component/util": "^1.3.0",
31
+ "clsx": "^2.1.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@rc-component/father-plugin": "^2.0.4",
35
35
  "@rc-component/np": "^1.0.0",
36
36
  "@swc/core": "^1.3.53",
37
37
  "@testing-library/react": "^12",
38
- "@types/classnames": "^2.2.9",
39
38
  "@types/enzyme": "^3.10.3",
40
39
  "@types/jest": "^24.9.1",
41
40
  "@types/lodash": "^4.14.136",
42
- "@types/node": "^13.9.3",
41
+ "@types/node": "^24.6.0",
43
42
  "@types/react": "^18.3.3",
44
43
  "@types/react-dom": "^18.3.0",
45
44
  "@typescript-eslint/eslint-plugin": "^5.59.7",
46
45
  "@umijs/fabric": "^3.0.0",
47
46
  "antd": "^4.8.2",
48
- "cross-env": "^5.2.0",
49
47
  "dumi": "^1.1.4",
50
48
  "enzyme": "^3.10.0",
51
49
  "enzyme-adapter-react-16": "^1.15.7",
@@ -60,7 +58,7 @@
60
58
  "history": "^4.9.0",
61
59
  "lodash": "^4.17.21",
62
60
  "pkg-dir": "4.0.0",
63
- "prettier": "^2.2.1",
61
+ "prettier": "^3.6.2",
64
62
  "rc-test": "^7.0.15",
65
63
  "react": "^16.4.2",
66
64
  "react-dom": "^16.4.2",
@@ -73,9 +71,6 @@
73
71
  "react": ">=16.0.0",
74
72
  "react-dom": ">=16.0.0"
75
73
  },
76
- "resolutions": {
77
- "cheerio": "1.0.0-rc.12"
78
- },
79
74
  "engines": {
80
75
  "node": ">=8"
81
76
  },