@itilite/lumina-ui 0.0.6 → 0.0.321

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.
Files changed (49) hide show
  1. package/dist/cjs/index.css +1 -1
  2. package/dist/cjs/index.js +754 -396
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/types/components/Button/types.d.ts +0 -2
  5. package/dist/cjs/types/components/Tag/Tag.d.ts +4 -0
  6. package/dist/cjs/types/components/Tag/index.d.ts +1 -0
  7. package/dist/cjs/types/components/Tag/type.d.ts +7 -0
  8. package/dist/cjs/types/components/index.d.ts +1 -0
  9. package/dist/esm/index.css +1 -1
  10. package/dist/esm/index.js +754 -397
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/types/components/Button/types.d.ts +0 -2
  13. package/dist/esm/types/components/Tag/Tag.d.ts +4 -0
  14. package/dist/esm/types/components/Tag/index.d.ts +1 -0
  15. package/dist/esm/types/components/Tag/type.d.ts +7 -0
  16. package/dist/esm/types/components/index.d.ts +1 -0
  17. package/dist/types/components/Button/Button.d.ts +4 -0
  18. package/dist/types/components/Button/Button.test.d.ts +1 -0
  19. package/dist/types/components/Button/index.d.ts +1 -0
  20. package/dist/types/components/Button/types.d.ts +16 -0
  21. package/dist/types/components/Checkbox/Checkbox.d.ts +4 -0
  22. package/dist/types/components/Checkbox/index.d.ts +1 -0
  23. package/dist/types/components/Checkbox/types.d.ts +11 -0
  24. package/dist/types/components/Modal/Modal.d.ts +3 -0
  25. package/dist/types/components/Modal/index.d.ts +1 -0
  26. package/dist/types/components/Modal/types.d.ts +21 -0
  27. package/dist/types/components/Radio/Radio.d.ts +4 -0
  28. package/dist/types/components/Radio/index.d.ts +1 -0
  29. package/dist/types/components/Radio/types.d.ts +11 -0
  30. package/dist/types/components/Switch/Switch.d.ts +4 -0
  31. package/dist/types/components/Switch/index.d.ts +1 -0
  32. package/dist/types/components/Switch/types.d.ts +7 -0
  33. package/dist/types/components/Tag/Tag.d.ts +4 -0
  34. package/dist/types/components/Tag/index.d.ts +1 -0
  35. package/dist/types/components/Tag/type.d.ts +7 -0
  36. package/dist/types/components/Tooltip/Tooltip.d.ts +3 -0
  37. package/dist/types/components/Tooltip/index.d.ts +1 -0
  38. package/dist/types/components/Tooltip/types.d.ts +8 -0
  39. package/dist/types/components/index.d.ts +7 -0
  40. package/dist/types/index.d.ts +1 -0
  41. package/package.json +16 -11
  42. package/src/components/Button/Button.module.scss +4 -10
  43. package/src/components/Button/Button.tsx +0 -7
  44. package/src/components/Button/types.ts +0 -3
  45. package/src/components/Tag/Tag.module.scss +61 -0
  46. package/src/components/Tag/Tag.tsx +34 -0
  47. package/src/components/Tag/index.ts +1 -0
  48. package/src/components/Tag/type.ts +7 -0
  49. package/src/components/index.ts +2 -1
package/dist/cjs/index.js CHANGED
@@ -6,6 +6,7 @@ var React = require('react');
6
6
  var classNames = require('classnames');
7
7
  var reactIs = require('react-is');
8
8
  var ReactDOM = require('react-dom');
9
+ require('scroll-into-view-if-needed');
9
10
 
10
11
  function _interopNamespaceDefault(e) {
11
12
  var n = Object.create(null);
@@ -65,7 +66,7 @@ function isFragment$1(object) {
65
66
  );
66
67
  }
67
68
 
68
- function toArray$2(children) {
69
+ function toArray$3(children) {
69
70
  var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
70
71
  var ret = [];
71
72
  React.Children.forEach(children, function (child) {
@@ -73,9 +74,9 @@ function toArray$2(children) {
73
74
  return;
74
75
  }
75
76
  if (Array.isArray(child)) {
76
- ret = ret.concat(toArray$2(child));
77
+ ret = ret.concat(toArray$3(child));
77
78
  } else if (isFragment$1(child) && child.props) {
78
- ret = ret.concat(toArray$2(child.props.children, option));
79
+ ret = ret.concat(toArray$3(child.props.children, option));
79
80
  } else {
80
81
  ret.push(child);
81
82
  }
@@ -1521,7 +1522,7 @@ if (process.env.NODE_ENV !== 'production') {
1521
1522
  var INTERNAL_PREFIX_KEY = 'rc-observer-key';
1522
1523
  function ResizeObserver$1(props, ref) {
1523
1524
  var children = props.children;
1524
- var childNodes = typeof children === 'function' ? [children] : toArray$2(children);
1525
+ var childNodes = typeof children === 'function' ? [children] : toArray$3(children);
1525
1526
  if (process.env.NODE_ENV !== 'production') {
1526
1527
  if (childNodes.length > 1) {
1527
1528
  warning$3(false, 'Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead.');
@@ -4018,10 +4019,9 @@ function resetWarned() {
4018
4019
  deprecatedWarnList = null;
4019
4020
  resetWarned$1();
4020
4021
  }
4021
- // eslint-disable-next-line import/no-mutable-exports
4022
- let warning$2 = noop$1;
4022
+ let _warning = noop$1;
4023
4023
  if (process.env.NODE_ENV !== 'production') {
4024
- warning$2 = (valid, component, message) => {
4024
+ _warning = (valid, component, message) => {
4025
4025
  warningOnce(valid, `[antd: ${component}] ${message}`);
4026
4026
  // StrictMode will inject console which will not throw warning in React 17.
4027
4027
  if (process.env.NODE_ENV === 'test') {
@@ -4029,6 +4029,7 @@ if (process.env.NODE_ENV !== 'production') {
4029
4029
  }
4030
4030
  };
4031
4031
  }
4032
+ const warning$2 = _warning;
4032
4033
  const WarningContext = /*#__PURE__*/React__namespace.createContext({});
4033
4034
  /**
4034
4035
  * This is a hook but we not named as `useWarning`
@@ -5445,7 +5446,6 @@ function derivative(token) {
5445
5446
  return prev;
5446
5447
  }, {});
5447
5448
  }).reduce((prev, cur) => {
5448
- // biome-ignore lint/style/noParameterAssign: it is a reduce
5449
5449
  prev = Object.assign(Object.assign({}, prev), cur);
5450
5450
  return prev;
5451
5451
  }, {});
@@ -6373,7 +6373,7 @@ function genStyleUtils(config) {
6373
6373
 
6374
6374
  const PresetColors = ['blue', 'purple', 'cyan', 'green', 'magenta', 'pink', 'red', 'orange', 'yellow', 'volcano', 'geekblue', 'lime', 'gold'];
6375
6375
 
6376
- var version$1 = '5.25.3';
6376
+ var version$1 = '5.26.5';
6377
6377
 
6378
6378
  function isStableColor(color) {
6379
6379
  return color >= 0 && color <= 255;
@@ -6416,7 +6416,7 @@ function getAlphaColor(frontColor, backgroundColor) {
6416
6416
  }).toRgbString();
6417
6417
  }
6418
6418
 
6419
- var __rest$e = undefined && undefined.__rest || function (s, e) {
6419
+ var __rest$g = undefined && undefined.__rest || function (s, e) {
6420
6420
  var t = {};
6421
6421
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
6422
6422
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -6433,7 +6433,7 @@ function formatToken(derivativeToken) {
6433
6433
  const {
6434
6434
  override
6435
6435
  } = derivativeToken,
6436
- restToken = __rest$e(derivativeToken, ["override"]);
6436
+ restToken = __rest$g(derivativeToken, ["override"]);
6437
6437
  const overrideTokens = Object.assign({}, override);
6438
6438
  Object.keys(seedToken).forEach(token => {
6439
6439
  delete overrideTokens[token];
@@ -6590,7 +6590,7 @@ function formatToken(derivativeToken) {
6590
6590
  return aliasToken;
6591
6591
  }
6592
6592
 
6593
- var __rest$d = undefined && undefined.__rest || function (s, e) {
6593
+ var __rest$f = undefined && undefined.__rest || function (s, e) {
6594
6594
  var t = {};
6595
6595
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
6596
6596
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -6652,7 +6652,7 @@ const getComputedToken = (originToken, overrideToken, theme) => {
6652
6652
  const {
6653
6653
  override
6654
6654
  } = overrideToken,
6655
- components = __rest$d(overrideToken, ["override"]);
6655
+ components = __rest$f(overrideToken, ["override"]);
6656
6656
  // Merge with override
6657
6657
  let mergedDerivativeToken = Object.assign(Object.assign({}, derivativeToken), {
6658
6658
  override
@@ -6664,7 +6664,7 @@ const getComputedToken = (originToken, overrideToken, theme) => {
6664
6664
  const {
6665
6665
  theme: componentTheme
6666
6666
  } = value,
6667
- componentTokens = __rest$d(value, ["theme"]);
6667
+ componentTokens = __rest$f(value, ["theme"]);
6668
6668
  let mergedComponentToken = componentTokens;
6669
6669
  if (componentTheme) {
6670
6670
  mergedComponentToken = getComputedToken(Object.assign(Object.assign({}, mergedDerivativeToken), componentTokens), {
@@ -7774,7 +7774,12 @@ function genCSSMotionList(transitionSupport) {
7774
7774
  }
7775
7775
  genCSSMotionList(supportTransition);
7776
7776
 
7777
+ const MotionCacheContext = /*#__PURE__*/React__namespace.createContext(true);
7778
+ if (process.env.NODE_ENV !== 'production') {
7779
+ MotionCacheContext.displayName = 'MotionCacheContext';
7780
+ }
7777
7781
  function MotionWrapper(props) {
7782
+ const parentMotion = React__namespace.useContext(MotionCacheContext);
7778
7783
  const {
7779
7784
  children
7780
7785
  } = props;
@@ -7783,11 +7788,13 @@ function MotionWrapper(props) {
7783
7788
  motion
7784
7789
  } = token;
7785
7790
  const needWrapMotionProviderRef = React__namespace.useRef(false);
7786
- needWrapMotionProviderRef.current = needWrapMotionProviderRef.current || motion === false;
7791
+ needWrapMotionProviderRef.current || (needWrapMotionProviderRef.current = parentMotion !== motion);
7787
7792
  if (needWrapMotionProviderRef.current) {
7788
- return /*#__PURE__*/React__namespace.createElement(MotionProvider, {
7793
+ return /*#__PURE__*/React__namespace.createElement(MotionCacheContext.Provider, {
7794
+ value: motion
7795
+ }, /*#__PURE__*/React__namespace.createElement(MotionProvider, {
7789
7796
  motion: motion
7790
- }, children);
7797
+ }, children));
7791
7798
  }
7792
7799
  return children;
7793
7800
  }
@@ -7808,7 +7815,7 @@ if (process.env.NODE_ENV !== 'production') {
7808
7815
  }
7809
7816
  var PropWarning$1 = process.env.NODE_ENV !== 'production' ? PropWarning : () => null;
7810
7817
 
7811
- var __rest$c = undefined && undefined.__rest || function (s, e) {
7818
+ var __rest$e = undefined && undefined.__rest || function (s, e) {
7812
7819
  var t = {};
7813
7820
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
7814
7821
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -8138,7 +8145,7 @@ const ProviderChildren = props => {
8138
8145
  components,
8139
8146
  cssVar
8140
8147
  } = _a,
8141
- rest = __rest$c(_a, ["algorithm", "token", "components", "cssVar"]);
8148
+ rest = __rest$e(_a, ["algorithm", "token", "components", "cssVar"]);
8142
8149
  const themeObj = algorithm && (!Array.isArray(algorithm) || algorithm.length > 0) ? createTheme(algorithm) : defaultTheme;
8143
8150
  const parsedComponents = {};
8144
8151
  Object.entries(components || {}).forEach(([componentName, componentToken]) => {
@@ -8702,274 +8709,259 @@ function usePatchElement() {
8702
8709
  return [elements, patchElement];
8703
8710
  }
8704
8711
 
8705
- function _regeneratorRuntime() {
8706
- _regeneratorRuntime = function _regeneratorRuntime() {
8707
- return r;
8708
- };
8709
- var t,
8710
- r = {},
8711
- e = Object.prototype,
8712
- n = e.hasOwnProperty,
8713
- o = "function" == typeof Symbol ? Symbol : {},
8714
- i = o.iterator || "@@iterator",
8715
- a = o.asyncIterator || "@@asyncIterator",
8716
- u = o.toStringTag || "@@toStringTag";
8717
- function c(t, r, e, n) {
8718
- Object.defineProperty(t, r, {
8719
- value: e,
8720
- enumerable: !n,
8721
- configurable: !n,
8722
- writable: !n
8723
- });
8724
- }
8712
+ function _OverloadYield(e, d) {
8713
+ this.v = e, this.k = d;
8714
+ }
8715
+
8716
+ function _regeneratorDefine(e, r, n, t) {
8717
+ var i = Object.defineProperty;
8725
8718
  try {
8726
- c({}, "");
8727
- } catch (t) {
8728
- c = function c(t, r, e) {
8729
- return t[r] = e;
8730
- };
8731
- }
8732
- function h(r, e, n, o) {
8733
- var i = e && e.prototype instanceof Generator ? e : Generator,
8734
- a = Object.create(i.prototype);
8735
- return c(a, "_invoke", function (r, e, n) {
8736
- var o = 1;
8737
- return function (i, a) {
8738
- if (3 === o) throw Error("Generator is already running");
8739
- if (4 === o) {
8740
- if ("throw" === i) throw a;
8741
- return {
8742
- value: t,
8743
- done: true
8744
- };
8745
- }
8746
- for (n.method = i, n.arg = a;;) {
8747
- var u = n.delegate;
8748
- if (u) {
8749
- var c = d(u, n);
8750
- if (c) {
8751
- if (c === f) continue;
8752
- return c;
8753
- }
8719
+ i({}, "", {});
8720
+ } catch (e) {
8721
+ i = 0;
8722
+ }
8723
+ _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
8724
+ if (r) i ? i(e, r, {
8725
+ value: n,
8726
+ enumerable: !t,
8727
+ configurable: !t,
8728
+ writable: !t
8729
+ }) : e[r] = n;else {
8730
+ var o = function o(r, n) {
8731
+ _regeneratorDefine(e, r, function (e) {
8732
+ return this._invoke(r, n, e);
8733
+ });
8734
+ };
8735
+ o("next", 0), o("throw", 1), o("return", 2);
8736
+ }
8737
+ }, _regeneratorDefine(e, r, n, t);
8738
+ }
8739
+
8740
+ function _regenerator() {
8741
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
8742
+ var e,
8743
+ t,
8744
+ r = "function" == typeof Symbol ? Symbol : {},
8745
+ n = r.iterator || "@@iterator",
8746
+ o = r.toStringTag || "@@toStringTag";
8747
+ function i(r, n, o, i) {
8748
+ var c = n && n.prototype instanceof Generator ? n : Generator,
8749
+ u = Object.create(c.prototype);
8750
+ return _regeneratorDefine(u, "_invoke", function (r, n, o) {
8751
+ var i,
8752
+ c,
8753
+ u,
8754
+ f = 0,
8755
+ p = o || [],
8756
+ y = false,
8757
+ G = {
8758
+ p: 0,
8759
+ n: 0,
8760
+ v: e,
8761
+ a: d,
8762
+ f: d.bind(e, 4),
8763
+ d: function d(t, r) {
8764
+ return i = t, c = 0, u = e, G.n = r, a;
8754
8765
  }
8755
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
8756
- if (1 === o) throw o = 4, n.arg;
8757
- n.dispatchException(n.arg);
8758
- } else "return" === n.method && n.abrupt("return", n.arg);
8759
- o = 3;
8760
- var h = s(r, e, n);
8761
- if ("normal" === h.type) {
8762
- if (o = n.done ? 4 : 2, h.arg === f) continue;
8763
- return {
8764
- value: h.arg,
8765
- done: n.done
8766
- };
8766
+ };
8767
+ function d(r, n) {
8768
+ for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
8769
+ var o,
8770
+ i = p[t],
8771
+ d = G.p,
8772
+ l = i[2];
8773
+ r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
8774
+ }
8775
+ if (o || r > 1) return a;
8776
+ throw y = true, n;
8777
+ }
8778
+ return function (o, p, l) {
8779
+ if (f > 1) throw TypeError("Generator is already running");
8780
+ for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
8781
+ i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
8782
+ try {
8783
+ if (f = 2, i) {
8784
+ if (c || (o = "next"), t = i[o]) {
8785
+ if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
8786
+ if (!t.done) return t;
8787
+ u = t.value, c < 2 && (c = 0);
8788
+ } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
8789
+ i = e;
8790
+ } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
8791
+ } catch (t) {
8792
+ i = e, c = 1, u = t;
8793
+ } finally {
8794
+ f = 1;
8767
8795
  }
8768
- "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg);
8769
8796
  }
8797
+ return {
8798
+ value: t,
8799
+ done: y
8800
+ };
8770
8801
  };
8771
- }(r, n, new Context(o || [])), true), a;
8772
- }
8773
- function s(t, r, e) {
8774
- try {
8775
- return {
8776
- type: "normal",
8777
- arg: t.call(r, e)
8778
- };
8779
- } catch (t) {
8780
- return {
8781
- type: "throw",
8782
- arg: t
8783
- };
8784
- }
8802
+ }(r, o, i), true), u;
8785
8803
  }
8786
- r.wrap = h;
8787
- var f = {};
8804
+ var a = {};
8788
8805
  function Generator() {}
8789
8806
  function GeneratorFunction() {}
8790
8807
  function GeneratorFunctionPrototype() {}
8791
- var l = {};
8792
- c(l, i, function () {
8808
+ t = Object.getPrototypeOf;
8809
+ var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
8810
+ return this;
8811
+ }), t),
8812
+ u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
8813
+ function f(e) {
8814
+ return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
8815
+ }
8816
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
8793
8817
  return this;
8794
- });
8795
- var p = Object.getPrototypeOf,
8796
- y = p && p(p(x([])));
8797
- y && y !== e && n.call(y, i) && (l = y);
8798
- var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l);
8799
- function g(t) {
8800
- ["next", "throw", "return"].forEach(function (r) {
8801
- c(t, r, function (t) {
8802
- return this._invoke(r, t);
8818
+ }), _regeneratorDefine(u, "toString", function () {
8819
+ return "[object Generator]";
8820
+ }), (_regenerator = function _regenerator() {
8821
+ return {
8822
+ w: i,
8823
+ m: f
8824
+ };
8825
+ })();
8826
+ }
8827
+
8828
+ function AsyncIterator(t, e) {
8829
+ function n(r, o, i, f) {
8830
+ try {
8831
+ var c = t[r](o),
8832
+ u = c.value;
8833
+ return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) {
8834
+ n("next", t, i, f);
8835
+ }, function (t) {
8836
+ n("throw", t, i, f);
8837
+ }) : e.resolve(u).then(function (t) {
8838
+ c.value = t, i(c);
8839
+ }, function (t) {
8840
+ return n("throw", t, i, f);
8803
8841
  });
8804
- });
8805
- }
8806
- function AsyncIterator(t, r) {
8807
- function e(o, i, a, u) {
8808
- var c = s(t[o], t, i);
8809
- if ("throw" !== c.type) {
8810
- var h = c.arg,
8811
- f = h.value;
8812
- return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) {
8813
- e("next", t, a, u);
8814
- }, function (t) {
8815
- e("throw", t, a, u);
8816
- }) : r.resolve(f).then(function (t) {
8817
- h.value = t, a(h);
8818
- }, function (t) {
8819
- return e("throw", t, a, u);
8820
- });
8821
- }
8822
- u(c.arg);
8823
- }
8824
- var o;
8825
- c(this, "_invoke", function (t, n) {
8826
- function i() {
8827
- return new r(function (r, o) {
8828
- e(t, n, r, o);
8829
- });
8830
- }
8831
- return o = o ? o.then(i, i) : i();
8832
- }, true);
8833
- }
8834
- function d(r, e) {
8835
- var n = e.method,
8836
- o = r.i[n];
8837
- if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f;
8838
- var i = s(o, r.i, e.arg);
8839
- if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f;
8840
- var a = i.arg;
8841
- return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f);
8842
- }
8843
- function w(t) {
8844
- this.tryEntries.push(t);
8845
- }
8846
- function m(r) {
8847
- var e = r[4] || {};
8848
- e.type = "normal", e.arg = t, r[4] = e;
8849
- }
8850
- function Context(t) {
8851
- this.tryEntries = [[-1]], t.forEach(w, this), this.reset(true);
8852
- }
8853
- function x(r) {
8854
- if (null != r) {
8855
- var e = r[i];
8856
- if (e) return e.call(r);
8857
- if ("function" == typeof r.next) return r;
8858
- if (!isNaN(r.length)) {
8859
- var o = -1,
8860
- a = function e() {
8861
- for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = false, e;
8862
- return e.value = t, e.done = true, e;
8863
- };
8864
- return a.next = a;
8865
- }
8842
+ } catch (t) {
8843
+ f(t);
8866
8844
  }
8867
- throw new TypeError(_typeof(r) + " is not iterable");
8868
8845
  }
8869
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), c(GeneratorFunctionPrototype, u, GeneratorFunction.displayName = "GeneratorFunction"), r.isGeneratorFunction = function (t) {
8870
- var r = "function" == typeof t && t.constructor;
8871
- return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name));
8872
- }, r.mark = function (t) {
8873
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t;
8874
- }, r.awrap = function (t) {
8875
- return {
8876
- __await: t
8877
- };
8878
- }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () {
8879
- return this;
8880
- }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) {
8881
- void 0 === i && (i = Promise);
8882
- var a = new AsyncIterator(h(t, e, n, o), i);
8883
- return r.isGeneratorFunction(e) ? a : a.next().then(function (t) {
8884
- return t.done ? t.value : a.next();
8885
- });
8886
- }, g(v), c(v, u, "Generator"), c(v, i, function () {
8846
+ var r;
8847
+ this.next || (_regeneratorDefine(AsyncIterator.prototype), _regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
8887
8848
  return this;
8888
- }), c(v, "toString", function () {
8889
- return "[object Generator]";
8890
- }), r.keys = function (t) {
8891
- var r = Object(t),
8892
- e = [];
8893
- for (var n in r) e.unshift(n);
8894
- return function t() {
8895
- for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = false, t;
8896
- return t.done = true, t;
8897
- };
8898
- }, r.values = x, Context.prototype = {
8899
- constructor: Context,
8900
- reset: function reset(r) {
8901
- if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t);
8902
- },
8903
- stop: function stop() {
8904
- this.done = true;
8905
- var t = this.tryEntries[0][4];
8906
- if ("throw" === t.type) throw t.arg;
8907
- return this.rval;
8908
- },
8909
- dispatchException: function dispatchException(r) {
8910
- if (this.done) throw r;
8911
- var e = this;
8912
- function n(t) {
8913
- a.type = "throw", a.arg = r, e.next = t;
8914
- }
8915
- for (var o = e.tryEntries.length - 1; o >= 0; --o) {
8916
- var i = this.tryEntries[o],
8917
- a = i[4],
8918
- u = this.prev,
8919
- c = i[1],
8920
- h = i[2];
8921
- if (-1 === i[0]) return n("end"), false;
8922
- if (!c && !h) throw Error("try statement without catch or finally");
8923
- if (null != i[0] && i[0] <= u) {
8924
- if (u < c) return this.method = "next", this.arg = t, n(c), true;
8925
- if (u < h) return n(h), false;
8926
- }
8849
+ })), _regeneratorDefine(this, "_invoke", function (t, o, i) {
8850
+ function f() {
8851
+ return new e(function (e, r) {
8852
+ n(t, i, e, r);
8853
+ });
8854
+ }
8855
+ return r = r ? r.then(f, f) : f();
8856
+ }, true);
8857
+ }
8858
+
8859
+ function _regeneratorAsyncGen(r, e, t, o, n) {
8860
+ return new AsyncIterator(_regenerator().w(r, e, t, o), n || Promise);
8861
+ }
8862
+
8863
+ function _regeneratorAsync(n, e, r, t, o) {
8864
+ var a = _regeneratorAsyncGen(n, e, r, t, o);
8865
+ return a.next().then(function (n) {
8866
+ return n.done ? n.value : a.next();
8867
+ });
8868
+ }
8869
+
8870
+ function _regeneratorKeys(e) {
8871
+ var n = Object(e),
8872
+ r = [];
8873
+ for (var t in n) r.unshift(t);
8874
+ return function e() {
8875
+ for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = false, e;
8876
+ return e.done = true, e;
8877
+ };
8878
+ }
8879
+
8880
+ function _regeneratorValues(e) {
8881
+ if (null != e) {
8882
+ var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
8883
+ r = 0;
8884
+ if (t) return t.call(e);
8885
+ if ("function" == typeof e.next) return e;
8886
+ if (!isNaN(e.length)) return {
8887
+ next: function next() {
8888
+ return e && r >= e.length && (e = void 0), {
8889
+ value: e && e[r++],
8890
+ done: !e
8891
+ };
8927
8892
  }
8928
- },
8929
- abrupt: function abrupt(t, r) {
8930
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
8931
- var n = this.tryEntries[e];
8932
- if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) {
8933
- var o = n;
8934
- break;
8893
+ };
8894
+ }
8895
+ throw new TypeError(_typeof(e) + " is not iterable");
8896
+ }
8897
+
8898
+ function _regeneratorRuntime() {
8899
+
8900
+ var r = _regenerator(),
8901
+ e = r.m(_regeneratorRuntime),
8902
+ t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
8903
+ function n(r) {
8904
+ var e = "function" == typeof r && r.constructor;
8905
+ return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
8906
+ }
8907
+ var o = {
8908
+ "throw": 1,
8909
+ "return": 2,
8910
+ "break": 3,
8911
+ "continue": 3
8912
+ };
8913
+ function a(r) {
8914
+ var e, t;
8915
+ return function (n) {
8916
+ e || (e = {
8917
+ stop: function stop() {
8918
+ return t(n.a, 2);
8919
+ },
8920
+ "catch": function _catch() {
8921
+ return n.v;
8922
+ },
8923
+ abrupt: function abrupt(r, e) {
8924
+ return t(n.a, o[r], e);
8925
+ },
8926
+ delegateYield: function delegateYield(r, o, a) {
8927
+ return e.resultName = o, t(n.d, _regeneratorValues(r), a);
8928
+ },
8929
+ finish: function finish(r) {
8930
+ return t(n.f, r);
8935
8931
  }
8936
- }
8937
- o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null);
8938
- var i = o ? o[4] : {};
8939
- return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i);
8940
- },
8941
- complete: function complete(t, r) {
8942
- if ("throw" === t.type) throw t.arg;
8943
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f;
8944
- },
8945
- finish: function finish(t) {
8946
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
8947
- var e = this.tryEntries[r];
8948
- if (e[2] === t) return this.complete(e[4], e[3]), m(e), f;
8949
- }
8950
- },
8951
- "catch": function _catch(t) {
8952
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
8953
- var e = this.tryEntries[r];
8954
- if (e[0] === t) {
8955
- var n = e[4];
8956
- if ("throw" === n.type) {
8957
- var o = n.arg;
8958
- m(e);
8959
- }
8960
- return o;
8932
+ }, t = function t(r, _t, o) {
8933
+ n.p = e.prev, n.n = e.next;
8934
+ try {
8935
+ return r(_t, o);
8936
+ } finally {
8937
+ e.next = n.n;
8961
8938
  }
8939
+ }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
8940
+ try {
8941
+ return r.call(this, e);
8942
+ } finally {
8943
+ n.p = e.prev, n.n = e.next;
8962
8944
  }
8963
- throw Error("illegal catch attempt");
8964
- },
8965
- delegateYield: function delegateYield(r, e, n) {
8966
- return this.delegate = {
8967
- i: x(r),
8968
- r: e,
8969
- n: n
8970
- }, "next" === this.method && (this.arg = t), f;
8971
- }
8972
- }, r;
8945
+ };
8946
+ }
8947
+ return (_regeneratorRuntime = function _regeneratorRuntime() {
8948
+ return {
8949
+ wrap: function wrap(e, t, n, o) {
8950
+ return r.w(a(e), t, n, o && o.reverse());
8951
+ },
8952
+ isGeneratorFunction: n,
8953
+ mark: r.m,
8954
+ awrap: function awrap(r, e) {
8955
+ return new _OverloadYield(r, e);
8956
+ },
8957
+ AsyncIterator: AsyncIterator,
8958
+ async: function async(r, e, t, o, u) {
8959
+ return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
8960
+ },
8961
+ keys: _regeneratorKeys,
8962
+ values: _regeneratorValues
8963
+ };
8964
+ })();
8973
8965
  }
8974
8966
 
8975
8967
  function asyncGeneratorStep(n, t, e, r, o, a, c) {
@@ -9185,7 +9177,7 @@ const genWaveStyle = token => {
9185
9177
  }
9186
9178
  };
9187
9179
  };
9188
- var useStyle$7 = genComponentStyleHook('Wave', token => [genWaveStyle(token)]);
9180
+ var useStyle$8 = genComponentStyleHook('Wave', token => [genWaveStyle(token)]);
9189
9181
 
9190
9182
  const TARGET_CLS = `${defaultPrefixCls}-wave-target`;
9191
9183
 
@@ -9390,7 +9382,7 @@ const Wave = props => {
9390
9382
  const containerRef = React.useRef(null);
9391
9383
  // ============================== Style ===============================
9392
9384
  const prefixCls = getPrefixCls('wave');
9393
- const [, hashId] = useStyle$7(prefixCls);
9385
+ const [, hashId] = useStyle$8(prefixCls);
9394
9386
  // =============================== Wave ===============================
9395
9387
  const showWave = useWave(containerRef, classNames(prefixCls, hashId), component);
9396
9388
  // ============================== Effect ==============================
@@ -9487,7 +9479,7 @@ const NoCompactStyle = props => {
9487
9479
  }, children);
9488
9480
  };
9489
9481
 
9490
- var __rest$b = undefined && undefined.__rest || function (s, e) {
9482
+ var __rest$d = undefined && undefined.__rest || function (s, e) {
9491
9483
  var t = {};
9492
9484
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
9493
9485
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -9506,7 +9498,7 @@ const ButtonGroup = props => {
9506
9498
  size,
9507
9499
  className
9508
9500
  } = props,
9509
- others = __rest$b(props, ["prefixCls", "size", "className"]);
9501
+ others = __rest$d(props, ["prefixCls", "size", "className"]);
9510
9502
  const prefixCls = getPrefixCls('btn-group', customizePrefixCls);
9511
9503
  const [,, hashId] = useToken();
9512
9504
  const sizeCls = React__namespace.useMemo(() => {
@@ -10741,7 +10733,7 @@ const isBright = (value, bgColorToken) => {
10741
10733
  return r * 0.299 + g * 0.587 + b * 0.114 > 192;
10742
10734
  };
10743
10735
 
10744
- const prepareToken$1 = token => {
10736
+ const prepareToken$2 = token => {
10745
10737
  const {
10746
10738
  paddingInline,
10747
10739
  onlyIconSize
@@ -10753,7 +10745,7 @@ const prepareToken$1 = token => {
10753
10745
  });
10754
10746
  return buttonToken;
10755
10747
  };
10756
- const prepareComponentToken$5 = token => {
10748
+ const prepareComponentToken$6 = token => {
10757
10749
  var _a, _b, _c, _d, _e, _f;
10758
10750
  const contentFontSize = (_a = token.contentFontSize) !== null && _a !== void 0 ? _a : token.fontSize;
10759
10751
  const contentFontSizeSM = (_b = token.contentFontSizeSM) !== null && _b !== void 0 ? _b : token.fontSize;
@@ -11256,8 +11248,8 @@ const genBlockButtonStyle = token => {
11256
11248
  };
11257
11249
  };
11258
11250
  // ============================== Export ==============================
11259
- var useStyle$6 = genStyleHooks('Button', token => {
11260
- const buttonToken = prepareToken$1(token);
11251
+ var useStyle$7 = genStyleHooks('Button', token => {
11252
+ const buttonToken = prepareToken$2(token);
11261
11253
  return [
11262
11254
  // Shared
11263
11255
  genSharedButtonStyle(buttonToken),
@@ -11271,7 +11263,7 @@ var useStyle$6 = genStyleHooks('Button', token => {
11271
11263
  genCompatibleButtonStyle(buttonToken),
11272
11264
  // Button Group
11273
11265
  genGroupStyle(buttonToken)];
11274
- }, prepareComponentToken$5, {
11266
+ }, prepareComponentToken$6, {
11275
11267
  unitless: {
11276
11268
  fontWeight: true,
11277
11269
  contentLineHeight: true,
@@ -11413,13 +11405,13 @@ const genButtonCompactStyle = token => {
11413
11405
  };
11414
11406
  // ============================== Export ==============================
11415
11407
  var Compact = genSubStyleComponent(['Button', 'compact'], token => {
11416
- const buttonToken = prepareToken$1(token);
11408
+ const buttonToken = prepareToken$2(token);
11417
11409
  return [
11418
11410
  // Space Compact
11419
11411
  genCompactItemStyle(buttonToken), genCompactItemVerticalStyle(buttonToken), genButtonCompactStyle(buttonToken)];
11420
- }, prepareComponentToken$5);
11412
+ }, prepareComponentToken$6);
11421
11413
 
11422
- var __rest$a = undefined && undefined.__rest || function (s, e) {
11414
+ var __rest$c = undefined && undefined.__rest || function (s, e) {
11423
11415
  var t = {};
11424
11416
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
11425
11417
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -11476,7 +11468,7 @@ const InternalCompoundedButton = /*#__PURE__*/React.forwardRef((props, ref) => {
11476
11468
  autoInsertSpace,
11477
11469
  autoFocus
11478
11470
  } = props,
11479
- rest = __rest$a(props, ["loading", "prefixCls", "color", "variant", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "iconPosition", "ghost", "block", "htmlType", "classNames", "style", "autoInsertSpace", "autoFocus"]);
11471
+ rest = __rest$c(props, ["loading", "prefixCls", "color", "variant", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "iconPosition", "ghost", "block", "htmlType", "classNames", "style", "autoInsertSpace", "autoFocus"]);
11480
11472
  // https://github.com/ant-design/ant-design/issues/47605
11481
11473
  // Compatible with original `type` behavior
11482
11474
  const mergedType = type || 'default';
@@ -11516,7 +11508,7 @@ const InternalCompoundedButton = /*#__PURE__*/React.forwardRef((props, ref) => {
11516
11508
  } = useComponentConfig('button');
11517
11509
  const mergedInsertSpace = (_a = autoInsertSpace !== null && autoInsertSpace !== void 0 ? autoInsertSpace : contextAutoInsertSpace) !== null && _a !== void 0 ? _a : true;
11518
11510
  const prefixCls = getPrefixCls('btn', customizePrefixCls);
11519
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$6(prefixCls);
11511
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$7(prefixCls);
11520
11512
  const disabled = React.useContext(DisabledContext);
11521
11513
  const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
11522
11514
  const groupSize = React.useContext(GroupSizeContext);
@@ -11537,8 +11529,9 @@ const InternalCompoundedButton = /*#__PURE__*/React.forwardRef((props, ref) => {
11537
11529
  };
11538
11530
  }, []);
11539
11531
  // ========================= Effect =========================
11540
- // Loading
11541
- React.useEffect(() => {
11532
+ // Loading. Should use `useLayoutEffect` to avoid low perf multiple click issue.
11533
+ // https://github.com/ant-design/ant-design/issues/51325
11534
+ React.useLayoutEffect(() => {
11542
11535
  let delayTimer = null;
11543
11536
  if (loadingOrDelay.delay > 0) {
11544
11537
  delayTimer = setTimeout(() => {
@@ -11555,7 +11548,7 @@ const InternalCompoundedButton = /*#__PURE__*/React.forwardRef((props, ref) => {
11555
11548
  }
11556
11549
  }
11557
11550
  return cleanupTimer;
11558
- }, [loadingOrDelay]);
11551
+ }, [loadingOrDelay.delay, loadingOrDelay.loading]);
11559
11552
  // Two chinese characters check
11560
11553
  React.useEffect(() => {
11561
11554
  // FIXME: for HOC usage like <FormatMessage />
@@ -12696,7 +12689,7 @@ var Context = /*#__PURE__*/React__namespace.createContext({
12696
12689
 
12697
12690
  var ListContext = /*#__PURE__*/React__namespace.createContext(null);
12698
12691
 
12699
- function toArray$1(value) {
12692
+ function toArray$2(value) {
12700
12693
  if (value === undefined || value === null) {
12701
12694
  return [];
12702
12695
  }
@@ -14162,7 +14155,7 @@ function _finishOnFirstFailed() {
14162
14155
  * ['a', 123] => ['a', 123]
14163
14156
  */
14164
14157
  function getNamePath(path) {
14165
- return toArray$1(path);
14158
+ return toArray$2(path);
14166
14159
  }
14167
14160
  function cloneByNamePathList(store, namePathList) {
14168
14161
  var newStore = {};
@@ -14523,7 +14516,7 @@ var Field = /*#__PURE__*/function (_React$Component) {
14523
14516
  if (!validateTrigger) {
14524
14517
  return true;
14525
14518
  }
14526
- var triggerList = toArray$1(validateTrigger);
14519
+ var triggerList = toArray$2(validateTrigger);
14527
14520
  return triggerList.includes(triggerName);
14528
14521
  });
14529
14522
  }
@@ -14653,7 +14646,7 @@ var Field = /*#__PURE__*/function (_React$Component) {
14653
14646
  }
14654
14647
 
14655
14648
  // Filed element only
14656
- var childList = toArray$2(children);
14649
+ var childList = toArray$3(children);
14657
14650
  if (childList.length !== 1 || ! /*#__PURE__*/React__namespace.isValidElement(childList[0])) {
14658
14651
  return {
14659
14652
  child: childList,
@@ -14734,7 +14727,7 @@ var Field = /*#__PURE__*/function (_React$Component) {
14734
14727
  };
14735
14728
 
14736
14729
  // Add validateTrigger
14737
- var validateTriggerList = toArray$1(mergedValidateTrigger || []);
14730
+ var validateTriggerList = toArray$2(mergedValidateTrigger || []);
14738
14731
  validateTriggerList.forEach(function (triggerName) {
14739
14732
  // Wrap additional function of component, so that we can get latest value from store
14740
14733
  var originTrigger = control[triggerName];
@@ -16408,6 +16401,7 @@ function useClosable(propCloseCollection, contextCloseCollection, fallbackCloseC
16408
16401
  }, [propCloseConfig, contextCloseConfig, mergedFallbackCloseCollection]);
16409
16402
  // Calculate the final closeIcon
16410
16403
  return React.useMemo(() => {
16404
+ var _a, _b;
16411
16405
  if (mergedClosableConfig === false) {
16412
16406
  return [false, null, closeBtnIsDisabled, {}];
16413
16407
  }
@@ -16425,9 +16419,9 @@ function useClosable(propCloseCollection, contextCloseCollection, fallbackCloseC
16425
16419
  if (closeIconRender) {
16426
16420
  mergedCloseIcon = closeIconRender(closeIcon);
16427
16421
  }
16428
- mergedCloseIcon = /*#__PURE__*/React.isValidElement(mergedCloseIcon) ? (/*#__PURE__*/React.cloneElement(mergedCloseIcon, Object.assign({
16429
- 'aria-label': contextLocale.close
16430
- }, ariaOrDataProps))) : (/*#__PURE__*/React.createElement("span", Object.assign({
16422
+ mergedCloseIcon = /*#__PURE__*/React.isValidElement(mergedCloseIcon) ? (/*#__PURE__*/React.cloneElement(mergedCloseIcon, Object.assign(Object.assign(Object.assign({}, mergedCloseIcon.props), {
16423
+ 'aria-label': (_b = (_a = mergedCloseIcon.props) === null || _a === void 0 ? void 0 : _a['aria-label']) !== null && _b !== void 0 ? _b : contextLocale.close
16424
+ }), ariaOrDataProps))) : (/*#__PURE__*/React.createElement("span", Object.assign({
16431
16425
  "aria-label": contextLocale.close
16432
16426
  }, ariaOrDataProps), mergedCloseIcon));
16433
16427
  }
@@ -16615,7 +16609,7 @@ const genSkeletonElementButton = token => {
16615
16609
  }), genSkeletonElementButtonShape(token, controlHeightSM, `${skeletonButtonCls}-sm`));
16616
16610
  };
16617
16611
  // =============================== Base ===============================
16618
- const genBaseStyle = token => {
16612
+ const genBaseStyle$1 = token => {
16619
16613
  const {
16620
16614
  componentCls,
16621
16615
  skeletonAvatarCls,
@@ -16733,7 +16727,7 @@ const genBaseStyle = token => {
16733
16727
  };
16734
16728
  };
16735
16729
  // ============================== Export ==============================
16736
- const prepareComponentToken$4 = token => {
16730
+ const prepareComponentToken$5 = token => {
16737
16731
  const {
16738
16732
  colorFillContent,
16739
16733
  colorFill
@@ -16751,7 +16745,7 @@ const prepareComponentToken$4 = token => {
16751
16745
  paragraphLiHeight: token.controlHeight / 2
16752
16746
  };
16753
16747
  };
16754
- var useStyle$5 = genStyleHooks('Skeleton', token => {
16748
+ var useStyle$6 = genStyleHooks('Skeleton', token => {
16755
16749
  const {
16756
16750
  componentCls,
16757
16751
  calc
@@ -16769,8 +16763,8 @@ var useStyle$5 = genStyleHooks('Skeleton', token => {
16769
16763
  skeletonLoadingBackground: `linear-gradient(90deg, ${token.gradientFromColor} 25%, ${token.gradientToColor} 37%, ${token.gradientFromColor} 63%)`,
16770
16764
  skeletonLoadingMotionDuration: '1.4s'
16771
16765
  });
16772
- return [genBaseStyle(skeletonToken)];
16773
- }, prepareComponentToken$4, {
16766
+ return [genBaseStyle$1(skeletonToken)];
16767
+ }, prepareComponentToken$5, {
16774
16768
  deprecatedTokens: [['color', 'gradientFromColor'], ['colorGradientEnd', 'gradientToColor']]
16775
16769
  });
16776
16770
 
@@ -16787,7 +16781,7 @@ const SkeletonAvatar = props => {
16787
16781
  getPrefixCls
16788
16782
  } = React__namespace.useContext(ConfigContext);
16789
16783
  const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
16790
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$5(prefixCls);
16784
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$6(prefixCls);
16791
16785
  const otherProps = omit(props, ['prefixCls', 'className']);
16792
16786
  const cls = classNames(prefixCls, `${prefixCls}-element`, {
16793
16787
  [`${prefixCls}-active`]: active
@@ -16814,7 +16808,7 @@ const SkeletonButton = props => {
16814
16808
  getPrefixCls
16815
16809
  } = React__namespace.useContext(ConfigContext);
16816
16810
  const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
16817
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$5(prefixCls);
16811
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$6(prefixCls);
16818
16812
  const otherProps = omit(props, ['prefixCls']);
16819
16813
  const cls = classNames(prefixCls, `${prefixCls}-element`, {
16820
16814
  [`${prefixCls}-active`]: active,
@@ -16841,7 +16835,7 @@ const SkeletonImage = props => {
16841
16835
  getPrefixCls
16842
16836
  } = React__namespace.useContext(ConfigContext);
16843
16837
  const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
16844
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$5(prefixCls);
16838
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$6(prefixCls);
16845
16839
  const cls = classNames(prefixCls, `${prefixCls}-element`, {
16846
16840
  [`${prefixCls}-active`]: active
16847
16841
  }, className, rootClassName, hashId, cssVarCls);
@@ -16873,7 +16867,7 @@ const SkeletonInput = props => {
16873
16867
  getPrefixCls
16874
16868
  } = React__namespace.useContext(ConfigContext);
16875
16869
  const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
16876
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$5(prefixCls);
16870
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$6(prefixCls);
16877
16871
  const otherProps = omit(props, ['prefixCls']);
16878
16872
  const cls = classNames(prefixCls, `${prefixCls}-element`, {
16879
16873
  [`${prefixCls}-active`]: active,
@@ -16900,7 +16894,7 @@ const SkeletonNode = props => {
16900
16894
  getPrefixCls
16901
16895
  } = React__namespace.useContext(ConfigContext);
16902
16896
  const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
16903
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$5(prefixCls);
16897
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$6(prefixCls);
16904
16898
  const cls = classNames(prefixCls, `${prefixCls}-element`, {
16905
16899
  [`${prefixCls}-active`]: active
16906
16900
  }, hashId, className, rootClassName, cssVarCls);
@@ -17032,7 +17026,7 @@ const Skeleton = props => {
17032
17026
  style: contextStyle
17033
17027
  } = useComponentConfig('skeleton');
17034
17028
  const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
17035
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$5(prefixCls);
17029
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$6(prefixCls);
17036
17030
  if (loading || !('loading' in props)) {
17037
17031
  const hasAvatar = !!avatar;
17038
17032
  const hasTitle = !!title;
@@ -17582,23 +17576,30 @@ const genResponsiveWidthStyle = token => {
17582
17576
  const {
17583
17577
  componentCls
17584
17578
  } = token;
17585
- const gridMediaSizesMap = getMediaSize(token);
17579
+ const oriGridMediaSizesMap = getMediaSize(token);
17580
+ const gridMediaSizesMap = Object.assign({}, oriGridMediaSizesMap);
17586
17581
  delete gridMediaSizesMap.xs;
17582
+ const cssVarPrefix = `--${componentCls.replace('.', '')}-`;
17587
17583
  const responsiveStyles = Object.keys(gridMediaSizesMap).map(key => ({
17588
17584
  [`@media (min-width: ${unit$1(gridMediaSizesMap[key])})`]: {
17589
- width: `var(--${componentCls.replace('.', '')}-${key}-width)`
17585
+ width: `var(${cssVarPrefix}${key}-width)`
17590
17586
  }
17591
17587
  }));
17592
17588
  return {
17593
17589
  [`${componentCls}-root`]: {
17594
- [componentCls]: [{
17595
- width: `var(--${componentCls.replace('.', '')}-xs-width)`
17596
- }].concat(_toConsumableArray(responsiveStyles))
17590
+ [componentCls]: [].concat(_toConsumableArray(Object.keys(oriGridMediaSizesMap).map((currentKey, index) => {
17591
+ const previousKey = Object.keys(oriGridMediaSizesMap)[index - 1];
17592
+ return previousKey ? {
17593
+ [`${cssVarPrefix}${currentKey}-width`]: `var(${cssVarPrefix}${previousKey}-width)`
17594
+ } : null;
17595
+ })), [{
17596
+ width: `var(${cssVarPrefix}xs-width)`
17597
+ }], _toConsumableArray(responsiveStyles))
17597
17598
  }
17598
17599
  };
17599
17600
  };
17600
17601
  // ============================== Export ==============================
17601
- const prepareToken = token => {
17602
+ const prepareToken$1 = token => {
17602
17603
  const headerPaddingVertical = token.padding;
17603
17604
  const headerFontSize = token.fontSizeHeading5;
17604
17605
  const headerLineHeight = token.lineHeightHeading5;
@@ -17615,7 +17616,7 @@ const prepareToken = token => {
17615
17616
  });
17616
17617
  return modalToken;
17617
17618
  };
17618
- const prepareComponentToken$3 = token => ({
17619
+ const prepareComponentToken$4 = token => ({
17619
17620
  footerBg: 'transparent',
17620
17621
  headerBg: token.colorBgElevated,
17621
17622
  titleLineHeight: token.lineHeightHeading5,
@@ -17636,16 +17637,16 @@ const prepareComponentToken$3 = token => ({
17636
17637
  confirmIconMarginInlineEnd: token.wireframe ? token.margin : token.marginSM,
17637
17638
  confirmBtnsMarginTop: token.wireframe ? token.marginLG : token.marginSM
17638
17639
  });
17639
- var useStyle$4 = genStyleHooks('Modal', token => {
17640
- const modalToken = prepareToken(token);
17640
+ var useStyle$5 = genStyleHooks('Modal', token => {
17641
+ const modalToken = prepareToken$1(token);
17641
17642
  return [genModalStyle(modalToken), genRTLStyle(modalToken), genModalMaskStyle(modalToken), initZoomMotion(modalToken, 'zoom'), genResponsiveWidthStyle(modalToken)];
17642
- }, prepareComponentToken$3, {
17643
+ }, prepareComponentToken$4, {
17643
17644
  unitless: {
17644
17645
  titleLineHeight: true
17645
17646
  }
17646
17647
  });
17647
17648
 
17648
- var __rest$9 = undefined && undefined.__rest || function (s, e) {
17649
+ var __rest$b = undefined && undefined.__rest || function (s, e) {
17649
17650
  var t = {};
17650
17651
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
17651
17652
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -17698,7 +17699,7 @@ const Modal$2 = props => {
17698
17699
  destroyOnHidden,
17699
17700
  destroyOnClose
17700
17701
  } = props,
17701
- restProps = __rest$9(props, ["prefixCls", "className", "rootClassName", "open", "wrapClassName", "centered", "getContainer", "focusTriggerAfterClose", "style", "visible", "width", "footer", "classNames", "styles", "children", "loading", "confirmLoading", "zIndex", "mousePosition", "onOk", "onCancel", "destroyOnHidden", "destroyOnClose"]);
17702
+ restProps = __rest$b(props, ["prefixCls", "className", "rootClassName", "open", "wrapClassName", "centered", "getContainer", "focusTriggerAfterClose", "style", "visible", "width", "footer", "classNames", "styles", "children", "loading", "confirmLoading", "zIndex", "mousePosition", "onOk", "onCancel", "destroyOnHidden", "destroyOnClose"]);
17702
17703
  const {
17703
17704
  getPopupContainer: getContextPopupContainer,
17704
17705
  getPrefixCls,
@@ -17724,7 +17725,7 @@ const Modal$2 = props => {
17724
17725
  const rootPrefixCls = getPrefixCls();
17725
17726
  // Style
17726
17727
  const rootCls = useCSSVarCls(prefixCls);
17727
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$4(prefixCls, rootCls);
17728
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$5(prefixCls, rootCls);
17728
17729
  const wrapClassNameExtended = classNames(wrapClassName, {
17729
17730
  [`${prefixCls}-centered`]: centered !== null && centered !== void 0 ? centered : modalContext === null || modalContext === void 0 ? void 0 : modalContext.centered,
17730
17731
  [`${prefixCls}-wrap-rtl`]: direction === 'rtl'
@@ -17900,14 +17901,14 @@ const genModalConfirmStyle = token => {
17900
17901
  };
17901
17902
  // ============================== Export ==============================
17902
17903
  var Confirm = genSubStyleComponent(['Modal', 'confirm'], token => {
17903
- const modalToken = prepareToken(token);
17904
+ const modalToken = prepareToken$1(token);
17904
17905
  return [genModalConfirmStyle(modalToken)];
17905
- }, prepareComponentToken$3, {
17906
+ }, prepareComponentToken$4, {
17906
17907
  // confirm is weak than modal since no conflict here
17907
17908
  order: -1e3
17908
17909
  });
17909
17910
 
17910
- var __rest$8 = undefined && undefined.__rest || function (s, e) {
17911
+ var __rest$a = undefined && undefined.__rest || function (s, e) {
17911
17912
  var t = {};
17912
17913
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
17913
17914
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -17928,7 +17929,7 @@ function ConfirmContent(props) {
17928
17929
  // Legacy for static function usage
17929
17930
  locale: staticLocale
17930
17931
  } = props,
17931
- resetProps = __rest$8(props, ["prefixCls", "icon", "okText", "cancelText", "confirmPrefixCls", "type", "okCancel", "footer", "locale"]);
17932
+ resetProps = __rest$a(props, ["prefixCls", "icon", "okText", "cancelText", "confirmPrefixCls", "type", "okCancel", "footer", "locale"]);
17932
17933
  if (process.env.NODE_ENV !== 'production') {
17933
17934
  const warning = devUseWarning('Modal');
17934
17935
  process.env.NODE_ENV !== "production" ? warning(!(typeof icon === 'string' && icon.length > 2), 'breaking', `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`) : void 0;
@@ -18228,7 +18229,7 @@ function modalGlobalConfig({
18228
18229
  defaultRootPrefixCls = rootPrefixCls;
18229
18230
  }
18230
18231
 
18231
- var __rest$7 = undefined && undefined.__rest || function (s, e) {
18232
+ var __rest$9 = undefined && undefined.__rest || function (s, e) {
18232
18233
  var t = {};
18233
18234
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
18234
18235
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -18242,7 +18243,7 @@ const HookModal = (_a, ref) => {
18242
18243
  afterClose: hookAfterClose,
18243
18244
  config
18244
18245
  } = _a,
18245
- restProps = __rest$7(_a, ["afterClose", "config"]);
18246
+ restProps = __rest$9(_a, ["afterClose", "config"]);
18246
18247
  const [open, setOpen] = React__namespace.useState(true);
18247
18248
  const [innerConfig, setInnerConfig] = React__namespace.useState(config);
18248
18249
  const {
@@ -18268,7 +18269,10 @@ const HookModal = (_a, ref) => {
18268
18269
  React__namespace.useImperativeHandle(ref, () => ({
18269
18270
  destroy: close,
18270
18271
  update: newConfig => {
18271
- setInnerConfig(originConfig => Object.assign(Object.assign({}, originConfig), newConfig));
18272
+ setInnerConfig(originConfig => {
18273
+ const nextConfig = typeof newConfig === 'function' ? newConfig(originConfig) : newConfig;
18274
+ return Object.assign(Object.assign({}, originConfig), nextConfig);
18275
+ });
18272
18276
  }
18273
18277
  }));
18274
18278
  const mergedOkCancel = (_b = innerConfig.okCancel) !== null && _b !== void 0 ? _b : innerConfig.type === 'confirm';
@@ -18683,13 +18687,13 @@ if (process.env.NODE_ENV !== 'production') {
18683
18687
 
18684
18688
  var TriggerContext = /*#__PURE__*/React__namespace.createContext(null);
18685
18689
 
18686
- function toArray(val) {
18690
+ function toArray$1(val) {
18687
18691
  return val ? Array.isArray(val) ? val : [val] : [];
18688
18692
  }
18689
18693
  function useAction(mobile, action, showAction, hideAction) {
18690
18694
  return React__namespace.useMemo(function () {
18691
- var mergedShowAction = toArray(showAction !== null && showAction !== void 0 ? showAction : action);
18692
- var mergedHideAction = toArray(hideAction !== null && hideAction !== void 0 ? hideAction : action);
18695
+ var mergedShowAction = toArray$1(showAction !== null && showAction !== void 0 ? showAction : action);
18696
+ var mergedHideAction = toArray$1(hideAction !== null && hideAction !== void 0 ? hideAction : action);
18693
18697
  var showActionSet = new Set(mergedShowAction);
18694
18698
  var hideActionSet = new Set(mergedHideAction);
18695
18699
  if (mobile) {
@@ -18965,8 +18969,6 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
18965
18969
  var doc = popupElement.ownerDocument;
18966
18970
  var win = getWin(popupElement);
18967
18971
  var _win$getComputedStyle = win.getComputedStyle(popupElement),
18968
- width = _win$getComputedStyle.width,
18969
- height = _win$getComputedStyle.height,
18970
18972
  popupPosition = _win$getComputedStyle.position;
18971
18973
  var originLeft = popupElement.style.left;
18972
18974
  var originTop = popupElement.style.top;
@@ -19015,6 +19017,9 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
19015
19017
  };
19016
19018
  }
19017
19019
  var popupRect = popupElement.getBoundingClientRect();
19020
+ var _win$getComputedStyle2 = win.getComputedStyle(popupElement),
19021
+ height = _win$getComputedStyle2.height,
19022
+ width = _win$getComputedStyle2.width;
19018
19023
  popupRect.x = (_popupRect$x = popupRect.x) !== null && _popupRect$x !== void 0 ? _popupRect$x : popupRect.left;
19019
19024
  popupRect.y = (_popupRect$y = popupRect.y) !== null && _popupRect$y !== void 0 ? _popupRect$y : popupRect.top;
19020
19025
  var _doc$documentElement = doc.documentElement,
@@ -20675,7 +20680,7 @@ const genTooltipStyle = token => {
20675
20680
  }];
20676
20681
  };
20677
20682
  // ============================== Export ==============================
20678
- const prepareComponentToken$2 = token => Object.assign(Object.assign({
20683
+ const prepareComponentToken$3 = token => Object.assign(Object.assign({
20679
20684
  zIndexPopup: token.zIndexPopupBase + 70
20680
20685
  }, getArrowOffsetToken({
20681
20686
  contentRadius: token.borderRadius,
@@ -20683,7 +20688,7 @@ const prepareComponentToken$2 = token => Object.assign(Object.assign({
20683
20688
  })), getArrowToken(merge(token, {
20684
20689
  borderRadiusOuter: Math.min(token.borderRadiusOuter, 4)
20685
20690
  })));
20686
- var useStyle$3 = (prefixCls, injectStyle = true) => {
20691
+ var useStyle$4 = (prefixCls, injectStyle = true) => {
20687
20692
  const useStyle = genStyleHooks('Tooltip', token => {
20688
20693
  const {
20689
20694
  borderRadius,
@@ -20698,7 +20703,7 @@ var useStyle$3 = (prefixCls, injectStyle = true) => {
20698
20703
  tooltipBg: colorBgSpotlight
20699
20704
  });
20700
20705
  return [genTooltipStyle(TooltipToken), initZoomMotion(token, 'zoom-big-fast')];
20701
- }, prepareComponentToken$2, {
20706
+ }, prepareComponentToken$3, {
20702
20707
  resetStyle: false,
20703
20708
  // Popover use Tooltip as internal component. We do not need to handle this.
20704
20709
  injectStyle
@@ -20707,6 +20712,7 @@ var useStyle$3 = (prefixCls, injectStyle = true) => {
20707
20712
  };
20708
20713
 
20709
20714
  const inverseColors = PresetColors.map(color => `${color}-inverse`);
20715
+ const PresetStatusColorTypes = ['success', 'processing', 'error', 'default', 'warning'];
20710
20716
  /**
20711
20717
  * determine if the color keyword belongs to the `Ant Design` {@link PresetColors}.
20712
20718
  * @param color color to be judged
@@ -20718,6 +20724,9 @@ function isPresetColor(color, includeInverse = true) {
20718
20724
  }
20719
20725
  return PresetColors.includes(color);
20720
20726
  }
20727
+ function isPresetStatusColor(color) {
20728
+ return PresetStatusColorTypes.includes(color);
20729
+ }
20721
20730
 
20722
20731
  function parseColor(prefixCls, color) {
20723
20732
  const isInternalColor = isPresetColor(color);
@@ -20752,7 +20761,7 @@ const PurePanel$2 = props => {
20752
20761
  getPrefixCls
20753
20762
  } = React__namespace.useContext(ConfigContext);
20754
20763
  const prefixCls = getPrefixCls('tooltip', customizePrefixCls);
20755
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$3(prefixCls);
20764
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$4(prefixCls);
20756
20765
  // Color
20757
20766
  const colorInfo = parseColor(prefixCls, color);
20758
20767
  const arrowContentStyle = colorInfo.arrowStyle;
@@ -20770,7 +20779,7 @@ const PurePanel$2 = props => {
20770
20779
  }), title)));
20771
20780
  };
20772
20781
 
20773
- var __rest$6 = undefined && undefined.__rest || function (s, e) {
20782
+ var __rest$8 = undefined && undefined.__rest || function (s, e) {
20774
20783
  var t = {};
20775
20784
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
20776
20785
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -20808,7 +20817,7 @@ const InternalTooltip = /*#__PURE__*/React__namespace.forwardRef((props, ref) =>
20808
20817
  styles,
20809
20818
  classNames: tooltipClassNames
20810
20819
  } = props,
20811
- restProps = __rest$6(props, ["prefixCls", "openClassName", "getTooltipContainer", "color", "overlayInnerStyle", "children", "afterOpenChange", "afterVisibleChange", "destroyTooltipOnHide", "destroyOnHidden", "arrow", "title", "overlay", "builtinPlacements", "arrowPointAtCenter", "autoAdjustOverflow", "motion", "getPopupContainer", "placement", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "rootClassName", "overlayClassName", "styles", "classNames"]);
20820
+ restProps = __rest$8(props, ["prefixCls", "openClassName", "getTooltipContainer", "color", "overlayInnerStyle", "children", "afterOpenChange", "afterVisibleChange", "destroyTooltipOnHide", "destroyOnHidden", "arrow", "title", "overlay", "builtinPlacements", "arrowPointAtCenter", "autoAdjustOverflow", "motion", "getPopupContainer", "placement", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "rootClassName", "overlayClassName", "styles", "classNames"]);
20812
20821
  const mergedShowArrow = !!arrow;
20813
20822
  const [, token] = useToken();
20814
20823
  const {
@@ -20896,7 +20905,7 @@ const InternalTooltip = /*#__PURE__*/React__namespace.forwardRef((props, ref) =>
20896
20905
  const childProps = child.props;
20897
20906
  const childCls = !childProps.className || typeof childProps.className === 'string' ? classNames(childProps.className, openClassName || `${prefixCls}-open`) : childProps.className;
20898
20907
  // Style
20899
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$3(prefixCls, !injectFromPopover);
20908
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$4(prefixCls, !injectFromPopover);
20900
20909
  // Color
20901
20910
  const colorInfo = parseColor(prefixCls, color);
20902
20911
  const arrowContentStyle = colorInfo.arrowStyle;
@@ -21458,7 +21467,7 @@ const getRadioButtonStyle = token => {
21458
21467
  };
21459
21468
  };
21460
21469
  // ============================== Export ==============================
21461
- const prepareComponentToken$1 = token => {
21470
+ const prepareComponentToken$2 = token => {
21462
21471
  const {
21463
21472
  wireframe,
21464
21473
  padding,
@@ -21500,7 +21509,7 @@ const prepareComponentToken$1 = token => {
21500
21509
  radioBgColor: wireframe ? colorBgContainer : colorPrimary
21501
21510
  };
21502
21511
  };
21503
- var useStyle$2 = genStyleHooks('Radio', token => {
21512
+ var useStyle$3 = genStyleHooks('Radio', token => {
21504
21513
  const {
21505
21514
  controlOutline,
21506
21515
  controlOutlineWidth
@@ -21512,14 +21521,14 @@ var useStyle$2 = genStyleHooks('Radio', token => {
21512
21521
  radioButtonFocusShadow
21513
21522
  });
21514
21523
  return [getGroupRadioStyle(radioToken), getRadioBasicStyle(radioToken), getRadioButtonStyle(radioToken)];
21515
- }, prepareComponentToken$1, {
21524
+ }, prepareComponentToken$2, {
21516
21525
  unitless: {
21517
21526
  radioSize: true,
21518
21527
  dotSize: true
21519
21528
  }
21520
21529
  });
21521
21530
 
21522
- var __rest$5 = undefined && undefined.__rest || function (s, e) {
21531
+ var __rest$7 = undefined && undefined.__rest || function (s, e) {
21523
21532
  var t = {};
21524
21533
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
21525
21534
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -21558,13 +21567,13 @@ const InternalRadio = (props, ref) => {
21558
21567
  style,
21559
21568
  title
21560
21569
  } = props,
21561
- restProps = __rest$5(props, ["prefixCls", "className", "rootClassName", "children", "style", "title"]);
21570
+ restProps = __rest$7(props, ["prefixCls", "className", "rootClassName", "children", "style", "title"]);
21562
21571
  const radioPrefixCls = getPrefixCls('radio', customizePrefixCls);
21563
21572
  const isButtonType = ((groupContext === null || groupContext === void 0 ? void 0 : groupContext.optionType) || radioOptionTypeContext) === 'button';
21564
21573
  const prefixCls = isButtonType ? `${radioPrefixCls}-button` : radioPrefixCls;
21565
21574
  // Style
21566
21575
  const rootCls = useCSSVarCls(radioPrefixCls);
21567
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$2(radioPrefixCls, rootCls);
21576
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$3(radioPrefixCls, rootCls);
21568
21577
  const radioProps = Object.assign({}, restProps);
21569
21578
  // ===================== Disabled =====================
21570
21579
  const disabled = React__namespace.useContext(DisabledContext);
@@ -21612,12 +21621,35 @@ if (process.env.NODE_ENV !== 'production') {
21612
21621
  Radio$2.displayName = 'Radio';
21613
21622
  }
21614
21623
 
21624
+ // form item name black list. in form ,you can use form.id get the form item element.
21625
+ // use object hasOwnProperty will get better performance if black list is longer.
21626
+ function toArray(candidate) {
21627
+ if (candidate === undefined || candidate === false) return [];
21628
+ return Array.isArray(candidate) ? candidate : [candidate];
21629
+ }
21630
+
21631
+ undefined && undefined.__rest || function (s, e) {
21632
+ var t = {};
21633
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
21634
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
21635
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
21636
+ }
21637
+ return t;
21638
+ };
21639
+ function toNamePathStr(name) {
21640
+ const namePath = toArray(name);
21641
+ return namePath.join('_');
21642
+ }
21643
+
21615
21644
  const RadioGroup = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
21616
21645
  const {
21617
21646
  getPrefixCls,
21618
21647
  direction
21619
21648
  } = React__namespace.useContext(ConfigContext);
21620
- const defaultName = useId();
21649
+ const {
21650
+ name: formItemName
21651
+ } = React__namespace.useContext(FormItemInputContext);
21652
+ const defaultName = useId(toNamePathStr(formItemName));
21621
21653
  const {
21622
21654
  prefixCls: customizePrefixCls,
21623
21655
  className,
@@ -21657,7 +21689,7 @@ const RadioGroup = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
21657
21689
  const groupPrefixCls = `${prefixCls}-group`;
21658
21690
  // Style
21659
21691
  const rootCls = useCSSVarCls(prefixCls);
21660
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$2(prefixCls, rootCls);
21692
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$3(prefixCls, rootCls);
21661
21693
  let childrenToRender = children;
21662
21694
  // 如果存在 options, 优先使用
21663
21695
  if (options && options.length > 0) {
@@ -21719,7 +21751,7 @@ const RadioGroup = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
21719
21751
  });
21720
21752
  var Group = /*#__PURE__*/React__namespace.memo(RadioGroup);
21721
21753
 
21722
- var __rest$4 = undefined && undefined.__rest || function (s, e) {
21754
+ var __rest$6 = undefined && undefined.__rest || function (s, e) {
21723
21755
  var t = {};
21724
21756
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
21725
21757
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -21734,7 +21766,7 @@ const RadioButton = (props, ref) => {
21734
21766
  const {
21735
21767
  prefixCls: customizePrefixCls
21736
21768
  } = props,
21737
- radioProps = __rest$4(props, ["prefixCls"]);
21769
+ radioProps = __rest$6(props, ["prefixCls"]);
21738
21770
  const prefixCls = getPrefixCls('radio', customizePrefixCls);
21739
21771
  return /*#__PURE__*/React__namespace.createElement(RadioOptionTypeContextProvider, {
21740
21772
  value: "button"
@@ -21903,26 +21935,28 @@ const genCheckboxStyle = token => {
21903
21935
  {
21904
21936
  [checkboxCls]: {
21905
21937
  '&-indeterminate': {
21906
- // Wrapper > Checkbox > inner
21907
- [`${checkboxCls}-inner`]: {
21908
- backgroundColor: `${token.colorBgContainer} !important`,
21909
- borderColor: `${token.colorBorder} !important`,
21910
- '&:after': {
21911
- top: '50%',
21912
- insetInlineStart: '50%',
21913
- width: token.calc(token.fontSizeLG).div(2).equal(),
21914
- height: token.calc(token.fontSizeLG).div(2).equal(),
21915
- backgroundColor: token.colorPrimary,
21916
- border: 0,
21917
- transform: 'translate(-50%, -50%) scale(1)',
21918
- opacity: 1,
21919
- content: '""'
21938
+ '&': {
21939
+ // Wrapper > Checkbox > inner
21940
+ [`${checkboxCls}-inner`]: {
21941
+ backgroundColor: `${token.colorBgContainer}`,
21942
+ borderColor: `${token.colorBorder}`,
21943
+ '&:after': {
21944
+ top: '50%',
21945
+ insetInlineStart: '50%',
21946
+ width: token.calc(token.fontSizeLG).div(2).equal(),
21947
+ height: token.calc(token.fontSizeLG).div(2).equal(),
21948
+ backgroundColor: token.colorPrimary,
21949
+ border: 0,
21950
+ transform: 'translate(-50%, -50%) scale(1)',
21951
+ opacity: 1,
21952
+ content: '""'
21953
+ }
21954
+ },
21955
+ // https://github.com/ant-design/ant-design/issues/50074
21956
+ [`&:hover ${checkboxCls}-inner`]: {
21957
+ backgroundColor: `${token.colorBgContainer}`,
21958
+ borderColor: `${token.colorPrimary}`
21920
21959
  }
21921
- },
21922
- // https://github.com/ant-design/ant-design/issues/50074
21923
- [`&:hover ${checkboxCls}-inner`]: {
21924
- backgroundColor: `${token.colorBgContainer} !important`,
21925
- borderColor: `${token.colorPrimary} !important`
21926
21960
  }
21927
21961
  }
21928
21962
  }
@@ -21970,13 +22004,13 @@ function getStyle(prefixCls, token) {
21970
22004
  });
21971
22005
  return [genCheckboxStyle(checkboxToken)];
21972
22006
  }
21973
- var useStyle$1 = genStyleHooks('Checkbox', (token, {
22007
+ var useStyle$2 = genStyleHooks('Checkbox', (token, {
21974
22008
  prefixCls
21975
22009
  }) => [getStyle(prefixCls, token)]);
21976
22010
 
21977
22011
  const GroupContext = /*#__PURE__*/React.createContext(null);
21978
22012
 
21979
- var __rest$3 = undefined && undefined.__rest || function (s, e) {
22013
+ var __rest$5 = undefined && undefined.__rest || function (s, e) {
21980
22014
  var t = {};
21981
22015
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
21982
22016
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -21998,7 +22032,7 @@ const InternalCheckbox = (props, ref) => {
21998
22032
  skipGroup = false,
21999
22033
  disabled
22000
22034
  } = props,
22001
- restProps = __rest$3(props, ["prefixCls", "className", "rootClassName", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]);
22035
+ restProps = __rest$5(props, ["prefixCls", "className", "rootClassName", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]);
22002
22036
  const {
22003
22037
  getPrefixCls,
22004
22038
  direction,
@@ -22039,7 +22073,7 @@ const InternalCheckbox = (props, ref) => {
22039
22073
  }, [indeterminate]);
22040
22074
  const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
22041
22075
  const rootCls = useCSSVarCls(prefixCls);
22042
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$1(prefixCls, rootCls);
22076
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$2(prefixCls, rootCls);
22043
22077
  const checkboxProps = Object.assign({}, restProps);
22044
22078
  if (checkboxGroup && !skipGroup) {
22045
22079
  checkboxProps.onChange = (...args) => {
@@ -22092,7 +22126,7 @@ if (process.env.NODE_ENV !== 'production') {
22092
22126
  Checkbox$2.displayName = 'Checkbox';
22093
22127
  }
22094
22128
 
22095
- var __rest$2 = undefined && undefined.__rest || function (s, e) {
22129
+ var __rest$4 = undefined && undefined.__rest || function (s, e) {
22096
22130
  var t = {};
22097
22131
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
22098
22132
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -22111,7 +22145,7 @@ const CheckboxGroup = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
22111
22145
  style,
22112
22146
  onChange
22113
22147
  } = props,
22114
- restProps = __rest$2(props, ["defaultValue", "children", "options", "prefixCls", "className", "rootClassName", "style", "onChange"]);
22148
+ restProps = __rest$4(props, ["defaultValue", "children", "options", "prefixCls", "className", "rootClassName", "style", "onChange"]);
22115
22149
  const {
22116
22150
  getPrefixCls,
22117
22151
  direction
@@ -22158,7 +22192,7 @@ const CheckboxGroup = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
22158
22192
  const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
22159
22193
  const groupPrefixCls = `${prefixCls}-group`;
22160
22194
  const rootCls = useCSSVarCls(prefixCls);
22161
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$1(prefixCls, rootCls);
22195
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$2(prefixCls, rootCls);
22162
22196
  const domProps = omit(restProps, ['value', 'disabled']);
22163
22197
  const childrenNode = options.length ? memoizedOptions.map(option => (/*#__PURE__*/React__namespace.createElement(Checkbox$2, {
22164
22198
  prefixCls: prefixCls,
@@ -22202,7 +22236,7 @@ if (process.env.NODE_ENV !== 'production') {
22202
22236
  Checkbox$1.displayName = 'Checkbox';
22203
22237
  }
22204
22238
 
22205
- var __rest$1 = undefined && undefined.__rest || function (s, e) {
22239
+ var __rest$3 = undefined && undefined.__rest || function (s, e) {
22206
22240
  var t = {};
22207
22241
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
22208
22242
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -22221,14 +22255,14 @@ const PurePanel = props => {
22221
22255
  children,
22222
22256
  footer
22223
22257
  } = props,
22224
- restProps = __rest$1(props, ["prefixCls", "className", "closeIcon", "closable", "type", "title", "children", "footer"]);
22258
+ restProps = __rest$3(props, ["prefixCls", "className", "closeIcon", "closable", "type", "title", "children", "footer"]);
22225
22259
  const {
22226
22260
  getPrefixCls
22227
22261
  } = React__namespace.useContext(ConfigContext);
22228
22262
  const rootPrefixCls = getPrefixCls();
22229
22263
  const prefixCls = customizePrefixCls || getPrefixCls('modal');
22230
22264
  const rootCls = useCSSVarCls(rootPrefixCls);
22231
- const [wrapCSSVar, hashId, cssVarCls] = useStyle$4(prefixCls, rootCls);
22265
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$5(prefixCls, rootCls);
22232
22266
  const confirmPrefixCls = `${prefixCls}-confirm`;
22233
22267
  // Choose target props by confirm mark
22234
22268
  let additionalProps = {};
@@ -22624,7 +22658,7 @@ const genSwitchStyle = token => {
22624
22658
  };
22625
22659
  };
22626
22660
  // ============================== Export ==============================
22627
- const prepareComponentToken = token => {
22661
+ const prepareComponentToken$1 = token => {
22628
22662
  const {
22629
22663
  fontSize,
22630
22664
  lineHeight,
@@ -22653,7 +22687,7 @@ const prepareComponentToken = token => {
22653
22687
  innerMaxMarginSM: handleSizeSM + padding + padding * 2
22654
22688
  };
22655
22689
  };
22656
- var useStyle = genStyleHooks('Switch', token => {
22690
+ var useStyle$1 = genStyleHooks('Switch', token => {
22657
22691
  const switchToken = merge(token, {
22658
22692
  switchDuration: token.motionDurationMid,
22659
22693
  switchColor: token.colorPrimary,
@@ -22671,9 +22705,9 @@ var useStyle = genStyleHooks('Switch', token => {
22671
22705
  genSwitchLoadingStyle(switchToken),
22672
22706
  // small style
22673
22707
  genSwitchSmallStyle(switchToken)];
22674
- }, prepareComponentToken);
22708
+ }, prepareComponentToken$1);
22675
22709
 
22676
- var __rest = undefined && undefined.__rest || function (s, e) {
22710
+ var __rest$2 = undefined && undefined.__rest || function (s, e) {
22677
22711
  var t = {};
22678
22712
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
22679
22713
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
@@ -22696,7 +22730,7 @@ const InternalSwitch = /*#__PURE__*/React__namespace.forwardRef((props, ref) =>
22696
22730
  defaultValue,
22697
22731
  onChange
22698
22732
  } = props,
22699
- restProps = __rest(props, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style", "checked", "value", "defaultChecked", "defaultValue", "onChange"]);
22733
+ restProps = __rest$2(props, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style", "checked", "value", "defaultChecked", "defaultValue", "onChange"]);
22700
22734
  const [checked, setChecked] = useMergedState(false, {
22701
22735
  value: checkedProp !== null && checkedProp !== void 0 ? checkedProp : value,
22702
22736
  defaultValue: defaultCheckedProp !== null && defaultCheckedProp !== void 0 ? defaultCheckedProp : defaultValue
@@ -22716,7 +22750,7 @@ const InternalSwitch = /*#__PURE__*/React__namespace.forwardRef((props, ref) =>
22716
22750
  className: `${prefixCls}-loading-icon`
22717
22751
  }));
22718
22752
  // Style
22719
- const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
22753
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle$1(prefixCls);
22720
22754
  const mergedSize = useSize(customizeSize);
22721
22755
  const classes = classNames(SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.className, {
22722
22756
  [`${prefixCls}-small`]: mergedSize === 'small',
@@ -22747,12 +22781,327 @@ if (process.env.NODE_ENV !== 'production') {
22747
22781
  Switch$1.displayName = 'Switch';
22748
22782
  }
22749
22783
 
22784
+ // ============================== Styles ==============================
22785
+ const genBaseStyle = token => {
22786
+ const {
22787
+ paddingXXS,
22788
+ lineWidth,
22789
+ tagPaddingHorizontal,
22790
+ componentCls,
22791
+ calc
22792
+ } = token;
22793
+ const paddingInline = calc(tagPaddingHorizontal).sub(lineWidth).equal();
22794
+ const iconMarginInline = calc(paddingXXS).sub(lineWidth).equal();
22795
+ return {
22796
+ // Result
22797
+ [componentCls]: Object.assign(Object.assign({}, resetComponent(token)), {
22798
+ display: 'inline-block',
22799
+ height: 'auto',
22800
+ // https://github.com/ant-design/ant-design/pull/47504
22801
+ marginInlineEnd: token.marginXS,
22802
+ paddingInline,
22803
+ fontSize: token.tagFontSize,
22804
+ lineHeight: token.tagLineHeight,
22805
+ whiteSpace: 'nowrap',
22806
+ background: token.defaultBg,
22807
+ border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
22808
+ borderRadius: token.borderRadiusSM,
22809
+ opacity: 1,
22810
+ transition: `all ${token.motionDurationMid}`,
22811
+ textAlign: 'start',
22812
+ position: 'relative',
22813
+ // RTL
22814
+ [`&${componentCls}-rtl`]: {
22815
+ direction: 'rtl'
22816
+ },
22817
+ '&, a, a:hover': {
22818
+ color: token.defaultColor
22819
+ },
22820
+ [`${componentCls}-close-icon`]: {
22821
+ marginInlineStart: iconMarginInline,
22822
+ fontSize: token.tagIconSize,
22823
+ color: token.colorIcon,
22824
+ cursor: 'pointer',
22825
+ transition: `all ${token.motionDurationMid}`,
22826
+ '&:hover': {
22827
+ color: token.colorTextHeading
22828
+ }
22829
+ },
22830
+ [`&${componentCls}-has-color`]: {
22831
+ borderColor: 'transparent',
22832
+ [`&, a, a:hover, ${token.iconCls}-close, ${token.iconCls}-close:hover`]: {
22833
+ color: token.colorTextLightSolid
22834
+ }
22835
+ },
22836
+ '&-checkable': {
22837
+ backgroundColor: 'transparent',
22838
+ borderColor: 'transparent',
22839
+ cursor: 'pointer',
22840
+ [`&:not(${componentCls}-checkable-checked):hover`]: {
22841
+ color: token.colorPrimary,
22842
+ backgroundColor: token.colorFillSecondary
22843
+ },
22844
+ '&:active, &-checked': {
22845
+ color: token.colorTextLightSolid
22846
+ },
22847
+ '&-checked': {
22848
+ backgroundColor: token.colorPrimary,
22849
+ '&:hover': {
22850
+ backgroundColor: token.colorPrimaryHover
22851
+ }
22852
+ },
22853
+ '&:active': {
22854
+ backgroundColor: token.colorPrimaryActive
22855
+ }
22856
+ },
22857
+ '&-hidden': {
22858
+ display: 'none'
22859
+ },
22860
+ // To ensure that a space will be placed between character and `Icon`.
22861
+ [`> ${token.iconCls} + span, > span + ${token.iconCls}`]: {
22862
+ marginInlineStart: paddingInline
22863
+ }
22864
+ }),
22865
+ [`${componentCls}-borderless`]: {
22866
+ borderColor: 'transparent',
22867
+ background: token.tagBorderlessBg
22868
+ }
22869
+ };
22870
+ };
22871
+ // ============================== Export ==============================
22872
+ const prepareToken = token => {
22873
+ const {
22874
+ lineWidth,
22875
+ fontSizeIcon,
22876
+ calc
22877
+ } = token;
22878
+ const tagFontSize = token.fontSizeSM;
22879
+ const tagToken = merge(token, {
22880
+ tagFontSize,
22881
+ tagLineHeight: unit$1(calc(token.lineHeightSM).mul(tagFontSize).equal()),
22882
+ tagIconSize: calc(fontSizeIcon).sub(calc(lineWidth).mul(2)).equal(),
22883
+ // Tag icon is much smaller
22884
+ tagPaddingHorizontal: 8,
22885
+ // Fixed padding.
22886
+ tagBorderlessBg: token.defaultBg
22887
+ });
22888
+ return tagToken;
22889
+ };
22890
+ const prepareComponentToken = token => ({
22891
+ defaultBg: new FastColor(token.colorFillQuaternary).onBackground(token.colorBgContainer).toHexString(),
22892
+ defaultColor: token.colorText
22893
+ });
22894
+ var useStyle = genStyleHooks('Tag', token => {
22895
+ const tagToken = prepareToken(token);
22896
+ return genBaseStyle(tagToken);
22897
+ }, prepareComponentToken);
22898
+
22899
+ var __rest$1 = undefined && undefined.__rest || function (s, e) {
22900
+ var t = {};
22901
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
22902
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22903
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
22904
+ }
22905
+ return t;
22906
+ };
22907
+ const CheckableTag = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
22908
+ const {
22909
+ prefixCls: customizePrefixCls,
22910
+ style,
22911
+ className,
22912
+ checked,
22913
+ onChange,
22914
+ onClick
22915
+ } = props,
22916
+ restProps = __rest$1(props, ["prefixCls", "style", "className", "checked", "onChange", "onClick"]);
22917
+ const {
22918
+ getPrefixCls,
22919
+ tag
22920
+ } = React__namespace.useContext(ConfigContext);
22921
+ const handleClick = e => {
22922
+ onChange === null || onChange === void 0 ? void 0 : onChange(!checked);
22923
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
22924
+ };
22925
+ const prefixCls = getPrefixCls('tag', customizePrefixCls);
22926
+ // Style
22927
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
22928
+ const cls = classNames(prefixCls, `${prefixCls}-checkable`, {
22929
+ [`${prefixCls}-checkable-checked`]: checked
22930
+ }, tag === null || tag === void 0 ? void 0 : tag.className, className, hashId, cssVarCls);
22931
+ return wrapCSSVar(/*#__PURE__*/React__namespace.createElement("span", Object.assign({}, restProps, {
22932
+ ref: ref,
22933
+ style: Object.assign(Object.assign({}, style), tag === null || tag === void 0 ? void 0 : tag.style),
22934
+ className: cls,
22935
+ onClick: handleClick
22936
+ })));
22937
+ });
22938
+
22939
+ // Style as status component
22940
+ // ============================== Preset ==============================
22941
+ const genPresetStyle = token => genPresetColor(token, (colorKey, {
22942
+ textColor,
22943
+ lightBorderColor,
22944
+ lightColor,
22945
+ darkColor
22946
+ }) => ({
22947
+ [`${token.componentCls}${token.componentCls}-${colorKey}`]: {
22948
+ color: textColor,
22949
+ background: lightColor,
22950
+ borderColor: lightBorderColor,
22951
+ // Inverse color
22952
+ '&-inverse': {
22953
+ color: token.colorTextLightSolid,
22954
+ background: darkColor,
22955
+ borderColor: darkColor
22956
+ },
22957
+ [`&${token.componentCls}-borderless`]: {
22958
+ borderColor: 'transparent'
22959
+ }
22960
+ }
22961
+ }));
22962
+ // ============================== Export ==============================
22963
+ var PresetCmp = genSubStyleComponent(['Tag', 'preset'], token => {
22964
+ const tagToken = prepareToken(token);
22965
+ return genPresetStyle(tagToken);
22966
+ }, prepareComponentToken);
22967
+
22968
+ function capitalize(str) {
22969
+ if (typeof str !== 'string') {
22970
+ return str;
22971
+ }
22972
+ const ret = str.charAt(0).toUpperCase() + str.slice(1);
22973
+ return ret;
22974
+ }
22975
+
22976
+ const genTagStatusStyle = (token, status, cssVariableType) => {
22977
+ const capitalizedCssVariableType = capitalize(cssVariableType);
22978
+ return {
22979
+ [`${token.componentCls}${token.componentCls}-${status}`]: {
22980
+ color: token[`color${cssVariableType}`],
22981
+ background: token[`color${capitalizedCssVariableType}Bg`],
22982
+ borderColor: token[`color${capitalizedCssVariableType}Border`],
22983
+ [`&${token.componentCls}-borderless`]: {
22984
+ borderColor: 'transparent'
22985
+ }
22986
+ }
22987
+ };
22988
+ };
22989
+ // ============================== Export ==============================
22990
+ var StatusCmp = genSubStyleComponent(['Tag', 'status'], token => {
22991
+ const tagToken = prepareToken(token);
22992
+ return [genTagStatusStyle(tagToken, 'success', 'Success'), genTagStatusStyle(tagToken, 'processing', 'Info'), genTagStatusStyle(tagToken, 'error', 'Error'), genTagStatusStyle(tagToken, 'warning', 'Warning')];
22993
+ }, prepareComponentToken);
22994
+
22995
+ var __rest = undefined && undefined.__rest || function (s, e) {
22996
+ var t = {};
22997
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
22998
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22999
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
23000
+ }
23001
+ return t;
23002
+ };
23003
+ const InternalTag = /*#__PURE__*/React__namespace.forwardRef((tagProps, ref) => {
23004
+ const {
23005
+ prefixCls: customizePrefixCls,
23006
+ className,
23007
+ rootClassName,
23008
+ style,
23009
+ children,
23010
+ icon,
23011
+ color,
23012
+ onClose,
23013
+ bordered = true,
23014
+ visible: deprecatedVisible
23015
+ } = tagProps,
23016
+ props = __rest(tagProps, ["prefixCls", "className", "rootClassName", "style", "children", "icon", "color", "onClose", "bordered", "visible"]);
23017
+ const {
23018
+ getPrefixCls,
23019
+ direction,
23020
+ tag: tagContext
23021
+ } = React__namespace.useContext(ConfigContext);
23022
+ const [visible, setVisible] = React__namespace.useState(true);
23023
+ const domProps = omit(props, ['closeIcon', 'closable']);
23024
+ // Warning for deprecated usage
23025
+ if (process.env.NODE_ENV !== 'production') {
23026
+ const warning = devUseWarning('Tag');
23027
+ warning.deprecated(!('visible' in tagProps), 'visible', 'visible && <Tag />');
23028
+ }
23029
+ React__namespace.useEffect(() => {
23030
+ if (deprecatedVisible !== undefined) {
23031
+ setVisible(deprecatedVisible);
23032
+ }
23033
+ }, [deprecatedVisible]);
23034
+ const isPreset = isPresetColor(color);
23035
+ const isStatus = isPresetStatusColor(color);
23036
+ const isInternalColor = isPreset || isStatus;
23037
+ const tagStyle = Object.assign(Object.assign({
23038
+ backgroundColor: color && !isInternalColor ? color : undefined
23039
+ }, tagContext === null || tagContext === void 0 ? void 0 : tagContext.style), style);
23040
+ const prefixCls = getPrefixCls('tag', customizePrefixCls);
23041
+ const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
23042
+ // Style
23043
+ const tagClassName = classNames(prefixCls, tagContext === null || tagContext === void 0 ? void 0 : tagContext.className, {
23044
+ [`${prefixCls}-${color}`]: isInternalColor,
23045
+ [`${prefixCls}-has-color`]: color && !isInternalColor,
23046
+ [`${prefixCls}-hidden`]: !visible,
23047
+ [`${prefixCls}-rtl`]: direction === 'rtl',
23048
+ [`${prefixCls}-borderless`]: !bordered
23049
+ }, className, rootClassName, hashId, cssVarCls);
23050
+ const handleCloseClick = e => {
23051
+ e.stopPropagation();
23052
+ onClose === null || onClose === void 0 ? void 0 : onClose(e);
23053
+ if (e.defaultPrevented) {
23054
+ return;
23055
+ }
23056
+ setVisible(false);
23057
+ };
23058
+ const [, mergedCloseIcon] = useClosable(pickClosable(tagProps), pickClosable(tagContext), {
23059
+ closable: false,
23060
+ closeIconRender: iconNode => {
23061
+ const replacement = /*#__PURE__*/React__namespace.createElement("span", {
23062
+ className: `${prefixCls}-close-icon`,
23063
+ onClick: handleCloseClick
23064
+ }, iconNode);
23065
+ return replaceElement(iconNode, replacement, originProps => ({
23066
+ onClick: e => {
23067
+ var _a;
23068
+ (_a = originProps === null || originProps === void 0 ? void 0 : originProps.onClick) === null || _a === void 0 ? void 0 : _a.call(originProps, e);
23069
+ handleCloseClick(e);
23070
+ },
23071
+ className: classNames(originProps === null || originProps === void 0 ? void 0 : originProps.className, `${prefixCls}-close-icon`)
23072
+ }));
23073
+ }
23074
+ });
23075
+ const isNeedWave = typeof props.onClick === 'function' || children && children.type === 'a';
23076
+ const iconNode = icon || null;
23077
+ const kids = iconNode ? (/*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, iconNode, children && /*#__PURE__*/React__namespace.createElement("span", null, children))) : children;
23078
+ const tagNode = /*#__PURE__*/React__namespace.createElement("span", Object.assign({}, domProps, {
23079
+ ref: ref,
23080
+ className: tagClassName,
23081
+ style: tagStyle
23082
+ }), kids, mergedCloseIcon, isPreset && /*#__PURE__*/React__namespace.createElement(PresetCmp, {
23083
+ key: "preset",
23084
+ prefixCls: prefixCls
23085
+ }), isStatus && /*#__PURE__*/React__namespace.createElement(StatusCmp, {
23086
+ key: "status",
23087
+ prefixCls: prefixCls
23088
+ }));
23089
+ return wrapCSSVar(isNeedWave ? /*#__PURE__*/React__namespace.createElement(Wave, {
23090
+ component: "Tag"
23091
+ }, tagNode) : tagNode);
23092
+ });
23093
+ const Tag$1 = InternalTag;
23094
+ if (process.env.NODE_ENV !== 'production') {
23095
+ Tag$1.displayName = 'Tag';
23096
+ }
23097
+ Tag$1.CheckableTag = CheckableTag;
23098
+
22750
23099
  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
22751
23100
 
22752
- var classes$5 = {"button":"Button-module__button___18Bed","size_large":"Button-module__size_large___Gohrm","shape_circle":"Button-module__shape_circle___1CtM2","size_normal":"Button-module__size_normal___Ym8Ah","size_small":"Button-module__size_small___mGHht","type_primary":"Button-module__type_primary___WbRH0","variant_subtle":"Button-module__variant_subtle___G4bvs","variant_text":"Button-module__variant_text___r7oFS","variant_link":"Button-module__variant_link___mo-UB","type_secondary":"Button-module__type_secondary___HXHdT","type_critical":"Button-module__type_critical___Y0vJw","onHoverUnderline":"Button-module__onHoverUnderline___OyHzj"};
23101
+ var classes$6 = {"button":"Button-module__button___18Bed","size_large":"Button-module__size_large___Gohrm","shape_circle":"Button-module__shape_circle___1CtM2","size_normal":"Button-module__size_normal___Ym8Ah","size_small":"Button-module__size_small___mGHht","type_primary":"Button-module__type_primary___WbRH0","variant_subtle":"Button-module__variant_subtle___G4bvs","variant_text":"Button-module__variant_text___r7oFS","variant_link":"Button-module__variant_link___mo-UB","type_secondary":"Button-module__type_secondary___HXHdT","type_critical":"Button-module__type_critical___Y0vJw","onHoverUnderline":"Button-module__onHoverUnderline___OyHzj"};
22753
23102
 
22754
23103
  const Button = (props) => {
22755
- const { type = "primary", variant = "default", size = "normal", shape = "default", className = "", icon = null, iconPosition = "start", children, onClick = () => { }, href = "", disabled = false, loading = false, onHoverUnderline = false, id = "", name = "" } = props;
23104
+ const { type = "primary", variant = "default", size = "normal", shape = "default", className = "", icon = null, iconPosition = "start", children, onClick = () => { }, href = "", disabled = false, loading = false, onHoverUnderline = false, } = props;
22756
23105
  const buttonMap = {
22757
23106
  default: "primary",
22758
23107
  subtle: "default",
@@ -22765,10 +23114,10 @@ const Button = (props) => {
22765
23114
  normal: "middle", // Map "default" to "middle"
22766
23115
  large: "large",
22767
23116
  };
22768
- return (jsxRuntime.jsx(Button$2, { id: id, name: name, className: clsx(classes$5.button, classes$5[`size_${size}`], classes$5[`variant_${variant}`], classes$5[`shape_${shape}`], classes$5[`type_${type}`], `size_${size}`, `variant_${variant}`, `shape_${shape}`, `type_${type}`, className, {
23117
+ return (jsxRuntime.jsx(Button$2, { className: clsx(classes$6.button, classes$6[`size_${size}`], classes$6[`variant_${variant}`], classes$6[`shape_${shape}`], classes$6[`type_${type}`], `size_${size}`, `variant_${variant}`, `shape_${shape}`, `type_${type}`, className, {
22769
23118
  "tw-cursor-not-allowed": disabled,
22770
23119
  "tw-opacity-40": disabled,
22771
- }, disabled && classes$5.disabled, onHoverUnderline && classes$5.onHoverUnderline), icon: icon, iconPosition: iconPosition, onClick: onClick, size: sizeMap[size], shape: shape, type: buttonMap[variant], disabled: disabled, loading: loading, href: href || undefined, "data-testid": 'lumina-button', children: children }));
23120
+ }, disabled && classes$6.disabled, onHoverUnderline && classes$6.onHoverUnderline), icon: icon, iconPosition: iconPosition, onClick: onClick, size: sizeMap[size], shape: shape, type: buttonMap[variant], disabled: disabled, loading: loading, href: href || undefined, "data-testid": 'lumina-button', children: children }));
22772
23121
  };
22773
23122
  Button.propTypes = {
22774
23123
  type: PropTypes.oneOf(["primary", "secondary", "critical"]),
@@ -22786,10 +23135,10 @@ Button.propTypes = {
22786
23135
  };
22787
23136
  Button.displayName = "Button";
22788
23137
 
22789
- var classes$4 = {"switch":"Switch-module__switch___PKzsW"};
23138
+ var classes$5 = {"switch":"Switch-module__switch___PKzsW"};
22790
23139
 
22791
23140
  const Switch = ({ className, onChange = () => { }, size = "default", disabled = false, checked = false, ...rest }) => {
22792
- return (jsxRuntime.jsx(Switch$1, { className: clsx(className, classes$4.switch, classes$4[size]), onChange: onChange, size: size, disabled: disabled, checked: checked, ...rest }));
23141
+ return (jsxRuntime.jsx(Switch$1, { className: clsx(className, classes$5.switch, classes$5[size]), onChange: onChange, size: size, disabled: disabled, checked: checked, ...rest }));
22793
23142
  };
22794
23143
  Switch.propTypes = {
22795
23144
  onChange: PropTypes.func,
@@ -22799,13 +23148,13 @@ Switch.propTypes = {
22799
23148
  };
22800
23149
  Switch.displayName = "Switch";
22801
23150
 
22802
- var classes$3 = {"modal":"Modal-module__modal___yNG-7"};
23151
+ var classes$4 = {"modal":"Modal-module__modal___yNG-7"};
22803
23152
 
22804
23153
  const Close = ({ size = 14, color = "#B6BAC3", ...rest }) => {
22805
23154
  return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...rest, children: jsxRuntime.jsx("path", { d: "M0.292893 0.292893C0.683417 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L7 5.58579L12.2929 0.292893C12.6834 -0.0976311 13.3166 -0.0976311 13.7071 0.292893C14.0976 0.683417 14.0976 1.31658 13.7071 1.70711L8.41421 7L13.7071 12.2929C14.0976 12.6834 14.0976 13.3166 13.7071 13.7071C13.3166 14.0976 12.6834 14.0976 12.2929 13.7071L7 8.41421L1.70711 13.7071C1.31658 14.0976 0.683417 14.0976 0.292893 13.7071C-0.0976311 13.3166 -0.0976311 12.6834 0.292893 12.2929L5.58579 7L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z", fill: color }) }));
22806
23155
  };
22807
23156
  const Modal = ({ className = "", title = "", children, open = false, handleOk, handleCancel, okText = "", cancelText = "", closeIcon = jsxRuntime.jsx(Close, { color: "#6B7280" }), bodyClassName = "modalBody", outsideClickDisable = false, hideCross = false, okButtonLoading = false, okButtonDisabled = false, variant = "primary", okBtnClasses = "", cancelButtonAnalytics = {}, okButtonAnalytics = {}, footerMargintopDisable = true, ...rest }) => {
22808
- return (jsxRuntime.jsx("div", { onClick: (e) => e.stopPropagation(), children: jsxRuntime.jsx(Modal$1, { title: title, open: open, onOk: handleOk, onCancel: handleCancel, className: clsx(classes$3.modal, className, {
23157
+ return (jsxRuntime.jsx("div", { onClick: (e) => e.stopPropagation(), children: jsxRuntime.jsx(Modal$1, { title: title, open: open, onOk: handleOk, onCancel: handleCancel, className: clsx(classes$4.modal, className, {
22809
23158
  footerMargintopDisable: footerMargintopDisable,
22810
23159
  }), okText: okText, cancelText: cancelText, closeIcon: closeIcon, closable: !hideCross, maskClosable: !outsideClickDisable, footer: okText || cancelText ? (jsxRuntime.jsxs("div", { className: clsx({
22811
23160
  primaryFooter: variant === "primary",
@@ -22813,17 +23162,17 @@ const Modal = ({ className = "", title = "", children, open = false, handleOk, h
22813
23162
  }), children: [cancelText && (jsxRuntime.jsx(Button, { onClick: handleCancel, type: "secondary", className: "cancelBtn", variant: 'subtle', ...cancelButtonAnalytics, children: cancelText })), okText && (jsxRuntime.jsx(Button, { onClick: handleOk, className: clsx(okBtnClasses, "okBtn"), loading: okButtonLoading, disabled: okButtonDisabled, ...okButtonAnalytics, children: okText }))] })) : null, ...rest, children: jsxRuntime.jsx("div", { className: bodyClassName, children: children }) }) }));
22814
23163
  };
22815
23164
 
22816
- var classes$2 = {"light":"Tooltip-module__light___KHW7i"};
23165
+ var classes$3 = {"light":"Tooltip-module__light___KHW7i"};
22817
23166
 
22818
23167
  const Tooltip = ({ children, title = "", placement = "top", color = "#1F2937", className, mode = "dark", ...rest }) => {
22819
- return (jsxRuntime.jsx(Tooltip$1, { className: className, color: color, title: title, placement: placement, overlayClassName: mode === "light" ? classes$2.light : "", ...rest, children: children }));
23168
+ return (jsxRuntime.jsx(Tooltip$1, { className: className, color: color, title: title, placement: placement, overlayClassName: mode === "light" ? classes$3.light : "", ...rest, children: children }));
22820
23169
  };
22821
23170
 
22822
- var classes$1 = {"checkbox":"Checkbox-module__checkbox___D0D4S","size_small":"Checkbox-module__size_small___xrnwa","size_medium":"Checkbox-module__size_medium___V0L7S","size_large":"Checkbox-module__size_large___3FuMo","type_checked":"Checkbox-module__type_checked___pQSFb","disabled":"Checkbox-module__disabled___WagIC","type_unchecked":"Checkbox-module__type_unchecked___nhedk","variant_normal":"Checkbox-module__variant_normal___2gugg","variant_emphasized":"Checkbox-module__variant_emphasized___tLXw0","variant_indeterminate":"Checkbox-module__variant_indeterminate___swxxo"};
23171
+ var classes$2 = {"checkbox":"Checkbox-module__checkbox___D0D4S","size_small":"Checkbox-module__size_small___xrnwa","size_medium":"Checkbox-module__size_medium___V0L7S","size_large":"Checkbox-module__size_large___3FuMo","type_checked":"Checkbox-module__type_checked___pQSFb","disabled":"Checkbox-module__disabled___WagIC","type_unchecked":"Checkbox-module__type_unchecked___nhedk","variant_normal":"Checkbox-module__variant_normal___2gugg","variant_emphasized":"Checkbox-module__variant_emphasized___tLXw0","variant_indeterminate":"Checkbox-module__variant_indeterminate___swxxo"};
22823
23172
 
22824
23173
  const Checkbox = (props) => {
22825
23174
  const { className = "", children = null, onChange = () => { }, checked = false, disabled = false, size = "small", variant = "normal", indeterminate = false, ...rest } = props;
22826
- return (jsxRuntime.jsx(Checkbox$1, { className: clsx(classes$1.checkbox, classes$1[`size_${size}`], classes$1[`variant_${variant}`], checked ? classes$1.type_checked : classes$1.type_unchecked, disabled && classes$1.disabled, indeterminate && classes$1[`variant_indeterminate`], className), onChange: onChange, checked: checked, disabled: disabled, indeterminate: indeterminate, ...rest, children: children }));
23175
+ return (jsxRuntime.jsx(Checkbox$1, { className: clsx(classes$2.checkbox, classes$2[`size_${size}`], classes$2[`variant_${variant}`], checked ? classes$2.type_checked : classes$2.type_unchecked, disabled && classes$2.disabled, indeterminate && classes$2[`variant_indeterminate`], className), onChange: onChange, checked: checked, disabled: disabled, indeterminate: indeterminate, ...rest, children: children }));
22827
23176
  };
22828
23177
  Checkbox.propTypes = {
22829
23178
  checked: PropTypes.bool,
@@ -22837,9 +23186,9 @@ Checkbox.propTypes = {
22837
23186
  };
22838
23187
  Checkbox.displayName = "Checkbox";
22839
23188
 
22840
- var classes = {"radio":"Radio-module__radio___qhO7H","size_small":"Radio-module__size_small___SUyKK","size_medium":"Radio-module__size_medium___ew0Kp","size_large":"Radio-module__size_large___DOsUo","type_checked":"Radio-module__type_checked___amYVs","disabled":"Radio-module__disabled___RZ0be","type_unchecked":"Radio-module__type_unchecked___GQtug","variant_normal":"Radio-module__variant_normal___fJgIP","variant_emphasized":"Radio-module__variant_emphasized___Ih1mU"};
23189
+ var classes$1 = {"radio":"Radio-module__radio___qhO7H","size_small":"Radio-module__size_small___SUyKK","size_medium":"Radio-module__size_medium___ew0Kp","size_large":"Radio-module__size_large___DOsUo","type_checked":"Radio-module__type_checked___amYVs","disabled":"Radio-module__disabled___RZ0be","type_unchecked":"Radio-module__type_unchecked___GQtug","variant_normal":"Radio-module__variant_normal___fJgIP","variant_emphasized":"Radio-module__variant_emphasized___Ih1mU"};
22841
23190
 
22842
- const Radio = ({ checked = true, className = "", size = "small", variant = "normal", children, onChange = () => { }, disabled = false, extra = null, ...rest }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Radio$1, { className: clsx(classes.radio, classes[`size_${size}`], classes[`variant_${variant}`], checked ? classes.type_checked : classes.type_unchecked, disabled && classes.disabled, className), onChange: onChange, checked: checked, disabled: disabled, ...rest, children: children }), checked && extra] }));
23191
+ const Radio = ({ checked = true, className = "", size = "small", variant = "normal", children, onChange = () => { }, disabled = false, extra = null, ...rest }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Radio$1, { className: clsx(classes$1.radio, classes$1[`size_${size}`], classes$1[`variant_${variant}`], checked ? classes$1.type_checked : classes$1.type_unchecked, disabled && classes$1.disabled, className), onChange: onChange, checked: checked, disabled: disabled, ...rest, children: children }), checked && extra] }));
22843
23192
  Radio.propTypes = {
22844
23193
  checked: PropTypes.bool,
22845
23194
  className: PropTypes.string,
@@ -22852,10 +23201,19 @@ Radio.propTypes = {
22852
23201
  };
22853
23202
  Radio.displayName = "Radio";
22854
23203
 
23204
+ var classes = {"tag":"Tag-module__tag___0Cfjz","small":"Tag-module__small___-vgjh","success":"Tag-module__success___Lq3l5","blue":"Tag-module__blue___OZprV","warning":"Tag-module__warning___QjEQv","processing":"Tag-module__processing___IKFXM","bookingConfirmed":"Tag-module__bookingConfirmed___j8eIs","bookingRescheduled":"Tag-module__bookingRescheduled___tZRjg","bookingRescheduledPending":"Tag-module__bookingRescheduledPending___4N6Vl","failed":"Tag-module__failed___3CqXv","bookingPending":"Tag-module__bookingPending___3i6Ai"};
23205
+
23206
+ const Tag = (props) => {
23207
+ const { type = "success", className = "", title = "", icon = null, size = "", ...rest } = props;
23208
+ return (jsxRuntime.jsx(Tag$1, { className: clsx(classes.tag, size === "small" && classes.small, classes[type], className), icon: icon, ...rest, children: title }));
23209
+ };
23210
+ Tag.displayName = "Tag";
23211
+
22855
23212
  exports.Button = Button;
22856
23213
  exports.Checkbox = Checkbox;
22857
23214
  exports.Modal = Modal;
22858
23215
  exports.Radio = Radio;
22859
23216
  exports.Switch = Switch;
23217
+ exports.Tag = Tag;
22860
23218
  exports.Tooltip = Tooltip;
22861
23219
  //# sourceMappingURL=index.js.map