@ant-design/icons 5.5.2 → 5.6.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.
@@ -5,6 +5,7 @@ export interface IconContextProps {
5
5
  csp?: {
6
6
  nonce?: string;
7
7
  };
8
+ layer?: string;
8
9
  }
9
10
  declare const IconContext: import("react").Context<IconContextProps>;
10
11
  export default IconContext;
package/es/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { AbstractNode, IconDefinition } from '@ant-design/icons-svg/lib/types';
2
- import React from 'react';
3
2
  import type { CSSProperties, MouseEventHandler, MutableRefObject, ReactNode } from 'react';
3
+ import React from 'react';
4
4
  export declare function warning(valid: boolean, message: string): void;
5
5
  export declare function isIconDefinition(target: any): target is IconDefinition;
6
6
  export declare function normalizeAttrs(attrs?: Attrs): Attrs;
package/es/utils.js CHANGED
@@ -71,16 +71,20 @@ export var iconStyles = "\n.anticon {\n display: inline-flex;\n align-items: c
71
71
  export var useInsertStyles = function useInsertStyles(eleRef) {
72
72
  var _useContext = useContext(IconContext),
73
73
  csp = _useContext.csp,
74
- prefixCls = _useContext.prefixCls;
74
+ prefixCls = _useContext.prefixCls,
75
+ layer = _useContext.layer;
75
76
  var mergedStyleStr = iconStyles;
76
77
  if (prefixCls) {
77
78
  mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
78
79
  }
80
+ if (layer) {
81
+ mergedStyleStr = "@layer ".concat(layer, " {\n").concat(mergedStyleStr, "\n}");
82
+ }
79
83
  useEffect(function () {
80
84
  var ele = eleRef.current;
81
85
  var shadowRoot = getShadowRoot(ele);
82
86
  updateCSS(mergedStyleStr, '@ant-design-icons', {
83
- prepend: true,
87
+ prepend: !layer,
84
88
  csp: csp,
85
89
  attachTo: shadowRoot
86
90
  });
@@ -5,6 +5,7 @@ export interface IconContextProps {
5
5
  csp?: {
6
6
  nonce?: string;
7
7
  };
8
+ layer?: string;
8
9
  }
9
10
  declare const IconContext: import("react").Context<IconContextProps>;
10
11
  export default IconContext;
package/lib/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { AbstractNode, IconDefinition } from '@ant-design/icons-svg/lib/types';
2
- import React from 'react';
3
2
  import type { CSSProperties, MouseEventHandler, MutableRefObject, ReactNode } from 'react';
3
+ import React from 'react';
4
4
  export declare function warning(valid: boolean, message: string): void;
5
5
  export declare function isIconDefinition(target: any): target is IconDefinition;
6
6
  export declare function normalizeAttrs(attrs?: Attrs): Attrs;
package/lib/utils.js CHANGED
@@ -86,16 +86,20 @@ var iconStyles = exports.iconStyles = "\n.anticon {\n display: inline-flex;\n
86
86
  var useInsertStyles = exports.useInsertStyles = function useInsertStyles(eleRef) {
87
87
  var _useContext = (0, _react.useContext)(_Context.default),
88
88
  csp = _useContext.csp,
89
- prefixCls = _useContext.prefixCls;
89
+ prefixCls = _useContext.prefixCls,
90
+ layer = _useContext.layer;
90
91
  var mergedStyleStr = iconStyles;
91
92
  if (prefixCls) {
92
93
  mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
93
94
  }
95
+ if (layer) {
96
+ mergedStyleStr = "@layer ".concat(layer, " {\n").concat(mergedStyleStr, "\n}");
97
+ }
94
98
  (0, _react.useEffect)(function () {
95
99
  var ele = eleRef.current;
96
100
  var shadowRoot = (0, _shadow.getShadowRoot)(ele);
97
101
  (0, _dynamicCSS.updateCSS)(mergedStyleStr, '@ant-design-icons', {
98
- prepend: true,
102
+ prepend: !layer,
99
103
  csp: csp,
100
104
  attachTo: shadowRoot
101
105
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/icons",
3
- "version": "5.5.2",
3
+ "version": "5.6.1",
4
4
  "repository": "https://github.com/ant-design/ant-design-icons/tree/master/packages/icons-react",
5
5
  "license": "MIT",
6
6
  "contributors": [