@notificationapi/react 0.0.8 → 0.0.10

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 (27) hide show
  1. package/dist/assets/BellOutlined.js +18 -15
  2. package/dist/assets/Inbox.js +2376 -2270
  3. package/dist/assets/Notification.js +1960 -1340
  4. package/dist/assets/Preferences.js +564 -533
  5. package/dist/assets/PurePanel.js +24 -23
  6. package/dist/assets/button.js +275 -265
  7. package/dist/assets/colors.js +19298 -7652
  8. package/dist/assets/index.js +48 -47
  9. package/dist/assets/index2.js +94 -92
  10. package/dist/assets/index3.js +2990 -2647
  11. package/dist/components/Notifications/Inbox.d.ts +0 -1
  12. package/dist/components/Notifications/InboxHeader.d.ts +2 -3
  13. package/dist/components/Notifications/InboxHeader.js +14 -13
  14. package/dist/components/Notifications/Notification.d.ts +2 -3
  15. package/dist/components/Notifications/NotificationCounter.d.ts +1 -1
  16. package/dist/components/Notifications/NotificationFeed.d.ts +0 -1
  17. package/dist/components/Notifications/NotificationLauncher.d.ts +0 -1
  18. package/dist/components/Notifications/NotificationPopup.d.ts +0 -1
  19. package/dist/components/Notifications/UnreadBadge.d.ts +1 -1
  20. package/dist/components/Preferences/NotificationPreferencesInline.d.ts +2 -3
  21. package/dist/components/Preferences/NotificationPreferencesPopup.d.ts +2 -3
  22. package/dist/components/Preferences/NotificationPreferencesPopup.js +682 -646
  23. package/dist/components/Preferences/PreferenceGroup.d.ts +1 -2
  24. package/dist/components/Preferences/Preferences.d.ts +1 -2
  25. package/dist/components/Provider/index.d.ts +3 -2
  26. package/dist/components/Provider/index.js +102 -96
  27. package/package.json +1 -1
@@ -1,108 +1,112 @@
1
- import * as z from "react";
2
- import a, { forwardRef as So, useContext as D, useMemo as _o, useState as uo, Children as Fo, useEffect as go, createRef as Vo } from "react";
3
- import { a as ho, h as qo, c as $, b as Xo, j as Uo, f as Jo, m as L, k as M, g as Ko, u as I, l as Qo, n as Yo, D as Zo, o as ko } from "./colors.js";
4
- import { e as oe, f as ee, h as te, j as re, o as ne, W as le } from "./index3.js";
5
- var ie = function(o, e) {
1
+ import * as j from "react";
2
+ import a, { forwardRef as Co, useContext as _, useMemo as Fo, useState as mo, Children as Vo, useEffect as po, createRef as qo } from "react";
3
+ import { a as yo, h as Xo, j as vo, c as O, b as Uo, k as Jo, f as Ko, m as L, l as M, g as Qo, u as I, n as Yo, o as Zo, D as ko, p as oe } from "./colors.js";
4
+ import { e as ee, f as te, h as ne, j as re, o as ie, W as le } from "./index3.js";
5
+ var ae = function(o, e) {
6
6
  var t = {};
7
- for (var r in o)
8
- Object.prototype.hasOwnProperty.call(o, r) && e.indexOf(r) < 0 && (t[r] = o[r]);
7
+ for (var n in o)
8
+ Object.prototype.hasOwnProperty.call(o, n) && e.indexOf(n) < 0 && (t[n] = o[n]);
9
9
  if (o != null && typeof Object.getOwnPropertySymbols == "function")
10
- for (var n = 0, r = Object.getOwnPropertySymbols(o); n < r.length; n++)
11
- e.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(o, r[n]) && (t[r[n]] = o[r[n]]);
10
+ for (var r = 0, n = Object.getOwnPropertySymbols(o); r < n.length; r++)
11
+ e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(o, n[r]) && (t[n[r]] = o[n[r]]);
12
12
  return t;
13
13
  };
14
- const Co = /* @__PURE__ */ z.createContext(void 0), ae = (o) => {
14
+ const $o = /* @__PURE__ */ j.createContext(void 0), ce = (o) => {
15
15
  const {
16
16
  getPrefixCls: e,
17
17
  direction: t
18
- } = z.useContext(ho), {
19
- prefixCls: r,
20
- size: n,
21
- className: l
22
- } = o, i = ie(o, ["prefixCls", "size", "className"]), c = e("btn-group", r), [, , m] = qo();
23
- let d = "";
24
- switch (n) {
18
+ } = j.useContext(yo), {
19
+ prefixCls: n,
20
+ size: r,
21
+ className: i
22
+ } = o, l = ae(o, ["prefixCls", "size", "className"]), c = e("btn-group", n), [, , m] = Xo();
23
+ let u = "";
24
+ switch (r) {
25
25
  case "large":
26
- d = "lg";
26
+ u = "lg";
27
27
  break;
28
28
  case "small":
29
- d = "sm";
29
+ u = "sm";
30
30
  break;
31
31
  }
32
- const b = $(c, {
33
- [`${c}-${d}`]: d,
32
+ if (process.env.NODE_ENV !== "production") {
33
+ const f = vo("Button.Group");
34
+ process.env.NODE_ENV !== "production" && f(!r || ["large", "small", "middle"].includes(r), "usage", "Invalid prop `size`.");
35
+ }
36
+ const p = O(c, {
37
+ [`${c}-${u}`]: u,
34
38
  [`${c}-rtl`]: t === "rtl"
35
- }, l, m);
36
- return /* @__PURE__ */ z.createElement(Co.Provider, {
37
- value: n
38
- }, /* @__PURE__ */ z.createElement("div", Object.assign({}, i, {
39
- className: b
39
+ }, i, m);
40
+ return /* @__PURE__ */ j.createElement($o.Provider, {
41
+ value: r
42
+ }, /* @__PURE__ */ j.createElement("div", Object.assign({}, l, {
43
+ className: p
40
44
  })));
41
- }, mo = /^[\u4e00-\u9fa5]{2}$/, q = mo.test.bind(mo);
42
- function Re(o) {
45
+ }, bo = /^[\u4e00-\u9fa5]{2}$/, q = bo.test.bind(bo);
46
+ function Ae(o) {
43
47
  return o === "danger" ? {
44
48
  danger: !0
45
49
  } : {
46
50
  type: o
47
51
  };
48
52
  }
49
- function bo(o) {
53
+ function fo(o) {
50
54
  return typeof o == "string";
51
55
  }
52
- function _(o) {
56
+ function z(o) {
53
57
  return o === "text" || o === "link";
54
58
  }
55
- function ce(o, e) {
59
+ function se(o, e) {
56
60
  if (o == null)
57
61
  return;
58
62
  const t = e ? " " : "";
59
- return typeof o != "string" && typeof o != "number" && bo(o.type) && q(o.props.children) ? Xo(o, {
63
+ return typeof o != "string" && typeof o != "number" && fo(o.type) && q(o.props.children) ? Uo(o, {
60
64
  children: o.props.children.split("").join(t)
61
- }) : bo(o) ? q(o) ? /* @__PURE__ */ a.createElement("span", null, o.split("").join(t)) : /* @__PURE__ */ a.createElement("span", null, o) : Uo(o) ? /* @__PURE__ */ a.createElement("span", null, o) : o;
65
+ }) : fo(o) ? q(o) ? /* @__PURE__ */ a.createElement("span", null, o.split("").join(t)) : /* @__PURE__ */ a.createElement("span", null, o) : Jo(o) ? /* @__PURE__ */ a.createElement("span", null, o) : o;
62
66
  }
63
- function se(o, e) {
67
+ function de(o, e) {
64
68
  let t = !1;
65
- const r = [];
66
- return a.Children.forEach(o, (n) => {
67
- const l = typeof n, i = l === "string" || l === "number";
68
- if (t && i) {
69
- const c = r.length - 1, m = r[c];
70
- r[c] = `${m}${n}`;
69
+ const n = [];
70
+ return a.Children.forEach(o, (r) => {
71
+ const i = typeof r, l = i === "string" || i === "number";
72
+ if (t && l) {
73
+ const c = n.length - 1, m = n[c];
74
+ n[c] = `${m}${r}`;
71
75
  } else
72
- r.push(n);
73
- t = i;
74
- }), a.Children.map(r, (n) => ce(n, e));
76
+ n.push(r);
77
+ t = l;
78
+ }), a.Children.map(n, (r) => se(r, e));
75
79
  }
76
- const yo = /* @__PURE__ */ So((o, e) => {
80
+ const Bo = /* @__PURE__ */ Co((o, e) => {
77
81
  const {
78
82
  className: t,
79
- style: r,
80
- children: n,
81
- prefixCls: l
82
- } = o, i = $(`${l}-icon`, t);
83
+ style: n,
84
+ children: r,
85
+ prefixCls: i
86
+ } = o, l = O(`${i}-icon`, t);
83
87
  return /* @__PURE__ */ a.createElement("span", {
84
88
  ref: e,
85
- className: i,
86
- style: r
87
- }, n);
88
- }), po = /* @__PURE__ */ So((o, e) => {
89
+ className: l,
90
+ style: n
91
+ }, r);
92
+ }), ho = /* @__PURE__ */ Co((o, e) => {
89
93
  const {
90
94
  prefixCls: t,
91
- className: r,
92
- style: n,
93
- iconClassName: l,
94
- iconPosition: i = "start"
95
- } = o, c = $(r, {
96
- [`${t}-loading-icon-end`]: i === "end",
97
- [`${t}-loading-icon`]: i === "start"
95
+ className: n,
96
+ style: r,
97
+ iconClassName: i,
98
+ iconPosition: l = "start"
99
+ } = o, c = O(n, {
100
+ [`${t}-loading-icon-end`]: l === "end",
101
+ [`${t}-loading-icon`]: l === "start"
98
102
  });
99
- return /* @__PURE__ */ a.createElement(yo, {
103
+ return /* @__PURE__ */ a.createElement(Bo, {
100
104
  prefixCls: t,
101
105
  className: c,
102
- style: n,
106
+ style: r,
103
107
  ref: e
104
- }, /* @__PURE__ */ a.createElement(oe, {
105
- className: l
108
+ }, /* @__PURE__ */ a.createElement(ee, {
109
+ className: i
106
110
  }));
107
111
  }), F = () => ({
108
112
  width: 0,
@@ -112,21 +116,21 @@ const yo = /* @__PURE__ */ So((o, e) => {
112
116
  width: o.scrollWidth,
113
117
  opacity: 1,
114
118
  transform: "scale(1)"
115
- }), de = (o) => {
119
+ }), ue = (o) => {
116
120
  const {
117
121
  prefixCls: e,
118
122
  loading: t,
119
- existIcon: r,
120
- className: n,
121
- style: l,
122
- iconPosition: i
123
+ existIcon: n,
124
+ className: r,
125
+ style: i,
126
+ iconPosition: l
123
127
  } = o, c = !!t;
124
- return r ? /* @__PURE__ */ a.createElement(po, {
128
+ return n ? /* @__PURE__ */ a.createElement(ho, {
125
129
  prefixCls: e,
126
- className: n,
127
- style: l,
128
- iconPosition: i
129
- }) : /* @__PURE__ */ a.createElement(Jo, {
130
+ className: r,
131
+ style: i,
132
+ iconPosition: l
133
+ }) : /* @__PURE__ */ a.createElement(Ko, {
130
134
  visible: c,
131
135
  // We do not really use this motionName
132
136
  motionName: `${e}-loading-icon-motion`,
@@ -138,21 +142,21 @@ const yo = /* @__PURE__ */ So((o, e) => {
138
142
  onEnterActive: V,
139
143
  onLeaveStart: V,
140
144
  onLeaveActive: F
141
- }, (m, d) => {
145
+ }, (m, u) => {
142
146
  let {
143
- className: b,
144
- style: S
147
+ className: p,
148
+ style: f
145
149
  } = m;
146
- return /* @__PURE__ */ a.createElement(po, {
150
+ return /* @__PURE__ */ a.createElement(ho, {
147
151
  prefixCls: e,
148
- className: n,
149
- style: Object.assign(Object.assign({}, l), S),
150
- ref: d,
151
- iconClassName: b,
152
- iconPosition: i
152
+ className: r,
153
+ style: Object.assign(Object.assign({}, i), f),
154
+ ref: u,
155
+ iconClassName: p,
156
+ iconPosition: l
153
157
  });
154
158
  });
155
- }, fo = (o, e) => ({
159
+ }, So = (o, e) => ({
156
160
  // Border
157
161
  [`> span, > ${o}`]: {
158
162
  "&:not(:last-child)": {
@@ -170,13 +174,13 @@ const yo = /* @__PURE__ */ So((o, e) => {
170
174
  }
171
175
  }
172
176
  }
173
- }), ue = (o) => {
177
+ }), ge = (o) => {
174
178
  const {
175
179
  componentCls: e,
176
180
  fontSize: t,
177
- lineWidth: r,
178
- groupBorderColor: n,
179
- colorErrorHover: l
181
+ lineWidth: n,
182
+ groupBorderColor: r,
183
+ colorErrorHover: i
180
184
  } = o;
181
185
  return {
182
186
  [`${e}-group`]: [
@@ -192,7 +196,7 @@ const yo = /* @__PURE__ */ So((o, e) => {
192
196
  }
193
197
  },
194
198
  "&:not(:first-child)": {
195
- marginInlineStart: o.calc(r).mul(-1).equal(),
199
+ marginInlineStart: o.calc(n).mul(-1).equal(),
196
200
  [`&, & > ${e}`]: {
197
201
  borderStartStartRadius: 0,
198
202
  borderEndStartRadius: 0
@@ -214,24 +218,24 @@ const yo = /* @__PURE__ */ So((o, e) => {
214
218
  }
215
219
  },
216
220
  // Border Color
217
- fo(`${e}-primary`, n),
218
- fo(`${e}-danger`, l)
221
+ So(`${e}-primary`, r),
222
+ So(`${e}-danger`, i)
219
223
  ]
220
224
  };
221
- }, vo = (o) => {
225
+ }, Oo = (o) => {
222
226
  const {
223
227
  paddingInline: e,
224
228
  onlyIconSize: t,
225
- paddingBlock: r
229
+ paddingBlock: n
226
230
  } = o;
227
231
  return L(o, {
228
232
  buttonPaddingHorizontal: e,
229
- buttonPaddingVertical: r,
233
+ buttonPaddingVertical: n,
230
234
  buttonIconOnlyFontSize: t
231
235
  });
232
- }, $o = (o) => {
233
- var e, t, r, n, l, i;
234
- const c = (e = o.contentFontSize) !== null && e !== void 0 ? e : o.fontSize, m = (t = o.contentFontSizeSM) !== null && t !== void 0 ? t : o.fontSize, d = (r = o.contentFontSizeLG) !== null && r !== void 0 ? r : o.fontSizeLG, b = (n = o.contentLineHeight) !== null && n !== void 0 ? n : M(c), S = (l = o.contentLineHeightSM) !== null && l !== void 0 ? l : M(m), y = (i = o.contentLineHeightLG) !== null && i !== void 0 ? i : M(d);
236
+ }, Eo = (o) => {
237
+ var e, t, n, r, i, l;
238
+ const c = (e = o.contentFontSize) !== null && e !== void 0 ? e : o.fontSize, m = (t = o.contentFontSizeSM) !== null && t !== void 0 ? t : o.fontSize, u = (n = o.contentFontSizeLG) !== null && n !== void 0 ? n : o.fontSizeLG, p = (r = o.contentLineHeight) !== null && r !== void 0 ? r : M(c), f = (i = o.contentLineHeightSM) !== null && i !== void 0 ? i : M(m), v = (l = o.contentLineHeightLG) !== null && l !== void 0 ? l : M(u);
235
239
  return {
236
240
  fontWeight: 400,
237
241
  defaultShadow: `0 ${o.controlOutlineWidth}px 0 ${o.controlTmpOutline}`,
@@ -264,26 +268,26 @@ const yo = /* @__PURE__ */ So((o, e) => {
264
268
  defaultActiveBorderColor: o.colorPrimaryActive,
265
269
  contentFontSize: c,
266
270
  contentFontSizeSM: m,
267
- contentFontSizeLG: d,
268
- contentLineHeight: b,
269
- contentLineHeightSM: S,
270
- contentLineHeightLG: y,
271
- paddingBlock: Math.max((o.controlHeight - c * b) / 2 - o.lineWidth, 0),
272
- paddingBlockSM: Math.max((o.controlHeightSM - m * S) / 2 - o.lineWidth, 0),
273
- paddingBlockLG: Math.max((o.controlHeightLG - d * y) / 2 - o.lineWidth, 0)
271
+ contentFontSizeLG: u,
272
+ contentLineHeight: p,
273
+ contentLineHeightSM: f,
274
+ contentLineHeightLG: v,
275
+ paddingBlock: Math.max((o.controlHeight - c * p) / 2 - o.lineWidth, 0),
276
+ paddingBlockSM: Math.max((o.controlHeightSM - m * f) / 2 - o.lineWidth, 0),
277
+ paddingBlockLG: Math.max((o.controlHeightLG - u * v) / 2 - o.lineWidth, 0)
274
278
  };
275
- }, ge = (o) => {
279
+ }, me = (o) => {
276
280
  const {
277
281
  componentCls: e,
278
282
  iconCls: t,
279
- fontWeight: r
283
+ fontWeight: n
280
284
  } = o;
281
285
  return {
282
286
  [e]: {
283
287
  outline: "none",
284
288
  position: "relative",
285
289
  display: "inline-block",
286
- fontWeight: r,
290
+ fontWeight: n,
287
291
  whiteSpace: "nowrap",
288
292
  textAlign: "center",
289
293
  backgroundImage: "none",
@@ -322,7 +326,7 @@ const yo = /* @__PURE__ */ So((o, e) => {
322
326
  "> a": {
323
327
  color: "currentColor"
324
328
  },
325
- "&:not(:disabled)": Object.assign({}, Qo(o)),
329
+ "&:not(:disabled)": Object.assign({}, Yo(o)),
326
330
  [`&${e}-two-chinese-chars::first-letter`]: {
327
331
  letterSpacing: "0.34em"
328
332
  },
@@ -336,12 +340,12 @@ const yo = /* @__PURE__ */ So((o, e) => {
336
340
  }
337
341
  }
338
342
  };
339
- }, f = (o, e, t) => ({
343
+ }, h = (o, e, t) => ({
340
344
  [`&:not(:disabled):not(${o}-disabled)`]: {
341
345
  "&:hover": e,
342
346
  "&:active": t
343
347
  }
344
- }), me = (o) => ({
348
+ }), pe = (o) => ({
345
349
  minWidth: o.controlHeight,
346
350
  paddingInlineStart: 0,
347
351
  paddingInlineEnd: 0,
@@ -350,42 +354,42 @@ const yo = /* @__PURE__ */ So((o, e) => {
350
354
  borderRadius: o.controlHeight,
351
355
  paddingInlineStart: o.calc(o.controlHeight).div(2).equal(),
352
356
  paddingInlineEnd: o.calc(o.controlHeight).div(2).equal()
353
- }), pe = (o) => ({
357
+ }), fe = (o) => ({
354
358
  cursor: "not-allowed",
355
359
  borderColor: o.borderColorDisabled,
356
360
  color: o.colorTextDisabled,
357
361
  background: o.colorBgContainerDisabled,
358
362
  boxShadow: "none"
359
- }), H = (o, e, t, r, n, l, i, c) => ({
363
+ }), H = (o, e, t, n, r, i, l, c) => ({
360
364
  [`&${o}-background-ghost`]: Object.assign(Object.assign({
361
365
  color: t || void 0,
362
366
  background: e,
363
- borderColor: r || void 0,
367
+ borderColor: n || void 0,
364
368
  boxShadow: "none"
365
- }, f(o, Object.assign({
369
+ }, h(o, Object.assign({
366
370
  background: e
367
- }, i), Object.assign({
371
+ }, l), Object.assign({
368
372
  background: e
369
373
  }, c))), {
370
374
  "&:disabled": {
371
375
  cursor: "not-allowed",
372
- color: n || void 0,
373
- borderColor: l || void 0
376
+ color: r || void 0,
377
+ borderColor: i || void 0
374
378
  }
375
379
  })
376
380
  }), X = (o) => ({
377
- [`&:disabled, &${o.componentCls}-disabled`]: Object.assign({}, pe(o))
378
- }), Bo = (o) => Object.assign({}, X(o)), j = (o) => ({
381
+ [`&:disabled, &${o.componentCls}-disabled`]: Object.assign({}, fe(o))
382
+ }), xo = (o) => Object.assign({}, X(o)), N = (o) => ({
379
383
  [`&:disabled, &${o.componentCls}-disabled`]: {
380
384
  cursor: "not-allowed",
381
385
  color: o.colorTextDisabled
382
386
  }
383
- }), Oo = (o) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, Bo(o)), {
387
+ }), Io = (o) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, xo(o)), {
384
388
  background: o.defaultBg,
385
389
  borderColor: o.defaultBorderColor,
386
390
  color: o.defaultColor,
387
391
  boxShadow: o.defaultShadow
388
- }), f(o.componentCls, {
392
+ }), h(o.componentCls, {
389
393
  color: o.defaultHoverColor,
390
394
  borderColor: o.defaultHoverBorderColor,
391
395
  background: o.defaultHoverBg
@@ -397,18 +401,18 @@ const yo = /* @__PURE__ */ So((o, e) => {
397
401
  [`&${o.componentCls}-dangerous`]: Object.assign(Object.assign(Object.assign({
398
402
  color: o.colorError,
399
403
  borderColor: o.colorError
400
- }, f(o.componentCls, {
404
+ }, h(o.componentCls, {
401
405
  color: o.colorErrorHover,
402
406
  borderColor: o.colorErrorBorderHover
403
407
  }, {
404
408
  color: o.colorErrorActive,
405
409
  borderColor: o.colorErrorActive
406
410
  })), H(o.componentCls, o.ghostBg, o.colorError, o.colorError, o.colorTextDisabled, o.colorBorder)), X(o))
407
- }), fe = (o) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, Bo(o)), {
411
+ }), he = (o) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, xo(o)), {
408
412
  color: o.primaryColor,
409
413
  background: o.colorPrimary,
410
414
  boxShadow: o.primaryShadow
411
- }), f(o.componentCls, {
415
+ }), h(o.componentCls, {
412
416
  color: o.colorTextLightSolid,
413
417
  background: o.colorPrimaryHover
414
418
  }, {
@@ -425,7 +429,7 @@ const yo = /* @__PURE__ */ So((o, e) => {
425
429
  background: o.colorError,
426
430
  boxShadow: o.dangerShadow,
427
431
  color: o.dangerColor
428
- }, f(o.componentCls, {
432
+ }, h(o.componentCls, {
429
433
  background: o.colorErrorHover
430
434
  }, {
431
435
  background: o.colorErrorActive
@@ -436,76 +440,76 @@ const yo = /* @__PURE__ */ So((o, e) => {
436
440
  color: o.colorErrorActive,
437
441
  borderColor: o.colorErrorActive
438
442
  })), X(o))
439
- }), Se = (o) => Object.assign(Object.assign({}, Oo(o)), {
443
+ }), Se = (o) => Object.assign(Object.assign({}, Io(o)), {
440
444
  borderStyle: "dashed"
441
- }), he = (o) => Object.assign(Object.assign(Object.assign({
445
+ }), Ce = (o) => Object.assign(Object.assign(Object.assign({
442
446
  color: o.colorLink
443
- }, f(o.componentCls, {
447
+ }, h(o.componentCls, {
444
448
  color: o.colorLinkHover,
445
449
  background: o.linkHoverBg
446
450
  }, {
447
451
  color: o.colorLinkActive
448
- })), j(o)), {
452
+ })), N(o)), {
449
453
  [`&${o.componentCls}-dangerous`]: Object.assign(Object.assign({
450
454
  color: o.colorError
451
- }, f(o.componentCls, {
455
+ }, h(o.componentCls, {
452
456
  color: o.colorErrorHover
453
457
  }, {
454
458
  color: o.colorErrorActive
455
- })), j(o))
456
- }), Ce = (o) => Object.assign(Object.assign(Object.assign({}, f(o.componentCls, {
459
+ })), N(o))
460
+ }), ye = (o) => Object.assign(Object.assign(Object.assign({}, h(o.componentCls, {
457
461
  color: o.colorText,
458
462
  background: o.textHoverBg
459
463
  }, {
460
464
  color: o.colorText,
461
465
  background: o.colorBgTextActive
462
- })), j(o)), {
466
+ })), N(o)), {
463
467
  [`&${o.componentCls}-dangerous`]: Object.assign(Object.assign({
464
468
  color: o.colorError
465
- }, j(o)), f(o.componentCls, {
469
+ }, N(o)), h(o.componentCls, {
466
470
  color: o.colorErrorHover,
467
471
  background: o.colorErrorBg
468
472
  }, {
469
473
  color: o.colorErrorHover,
470
474
  background: o.colorErrorBgActive
471
475
  }))
472
- }), ye = (o) => {
476
+ }), ve = (o) => {
473
477
  const {
474
478
  componentCls: e
475
479
  } = o;
476
480
  return {
477
- [`${e}-default`]: Oo(o),
478
- [`${e}-primary`]: fe(o),
481
+ [`${e}-default`]: Io(o),
482
+ [`${e}-primary`]: he(o),
479
483
  [`${e}-dashed`]: Se(o),
480
- [`${e}-link`]: he(o),
481
- [`${e}-text`]: Ce(o),
484
+ [`${e}-link`]: Ce(o),
485
+ [`${e}-text`]: ye(o),
482
486
  [`${e}-ghost`]: H(o.componentCls, o.ghostBg, o.colorBgContainer, o.colorBgContainer, o.colorTextDisabled, o.colorBorder)
483
487
  };
484
488
  }, U = function(o) {
485
489
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
486
490
  const {
487
491
  componentCls: t,
488
- controlHeight: r,
489
- fontSize: n,
490
- lineHeight: l,
491
- borderRadius: i,
492
+ controlHeight: n,
493
+ fontSize: r,
494
+ lineHeight: i,
495
+ borderRadius: l,
492
496
  buttonPaddingHorizontal: c,
493
497
  iconCls: m,
494
- buttonPaddingVertical: d
495
- } = o, b = `${t}-icon-only`;
498
+ buttonPaddingVertical: u
499
+ } = o, p = `${t}-icon-only`;
496
500
  return [
497
501
  {
498
502
  [`${e}`]: {
499
- fontSize: n,
500
- lineHeight: l,
501
- height: r,
502
- padding: `${I(d)} ${I(c)}`,
503
- borderRadius: i,
504
- [`&${b}`]: {
503
+ fontSize: r,
504
+ lineHeight: i,
505
+ height: n,
506
+ padding: `${I(u)} ${I(c)}`,
507
+ borderRadius: l,
508
+ [`&${p}`]: {
505
509
  display: "inline-flex",
506
510
  alignItems: "center",
507
511
  justifyContent: "center",
508
- width: r,
512
+ width: n,
509
513
  paddingInlineStart: 0,
510
514
  paddingInlineEnd: 0,
511
515
  [`&${t}-round`]: {
@@ -527,19 +531,19 @@ const yo = /* @__PURE__ */ So((o, e) => {
527
531
  },
528
532
  // Shape - patch prefixCls again to override solid border radius style
529
533
  {
530
- [`${t}${t}-circle${e}`]: me(o)
534
+ [`${t}${t}-circle${e}`]: pe(o)
531
535
  },
532
536
  {
533
537
  [`${t}${t}-round${e}`]: be(o)
534
538
  }
535
539
  ];
536
- }, ve = (o) => {
540
+ }, $e = (o) => {
537
541
  const e = L(o, {
538
542
  fontSize: o.contentFontSize,
539
543
  lineHeight: o.contentLineHeight
540
544
  });
541
545
  return U(e, o.componentCls);
542
- }, $e = (o) => {
546
+ }, Be = (o) => {
543
547
  const e = L(o, {
544
548
  controlHeight: o.controlHeightSM,
545
549
  fontSize: o.contentFontSizeSM,
@@ -551,7 +555,7 @@ const yo = /* @__PURE__ */ So((o, e) => {
551
555
  buttonIconOnlyFontSize: o.onlyIconSizeSM
552
556
  });
553
557
  return U(e, `${o.componentCls}-sm`);
554
- }, Be = (o) => {
558
+ }, Oe = (o) => {
555
559
  const e = L(o, {
556
560
  controlHeight: o.controlHeightLG,
557
561
  fontSize: o.contentFontSizeLG,
@@ -562,7 +566,7 @@ const yo = /* @__PURE__ */ So((o, e) => {
562
566
  buttonIconOnlyFontSize: o.onlyIconSizeLG
563
567
  });
564
568
  return U(e, `${o.componentCls}-lg`);
565
- }, Oe = (o) => {
569
+ }, Ee = (o) => {
566
570
  const {
567
571
  componentCls: e
568
572
  } = o;
@@ -573,23 +577,23 @@ const yo = /* @__PURE__ */ So((o, e) => {
573
577
  }
574
578
  }
575
579
  };
576
- }, xe = Ko("Button", (o) => {
577
- const e = vo(o);
580
+ }, xe = Qo("Button", (o) => {
581
+ const e = Oo(o);
578
582
  return [
579
583
  // Shared
580
- ge(e),
584
+ me(e),
581
585
  // Size
582
- ve(e),
583
586
  $e(e),
584
587
  Be(e),
585
- // Block
586
588
  Oe(e),
589
+ // Block
590
+ Ee(e),
587
591
  // Group (type, ghost, danger, loading)
588
- ye(e),
592
+ ve(e),
589
593
  // Button Group
590
- ue(e)
594
+ ge(e)
591
595
  ];
592
- }, $o, {
596
+ }, Eo, {
593
597
  unitless: {
594
598
  fontWeight: !0,
595
599
  contentLineHeight: !0,
@@ -597,7 +601,7 @@ const yo = /* @__PURE__ */ So((o, e) => {
597
601
  contentLineHeightLG: !0
598
602
  }
599
603
  });
600
- function Ee(o, e) {
604
+ function Ie(o, e) {
601
605
  return {
602
606
  // border collapse
603
607
  [`&-item:not(${e}-last-item)`]: {
@@ -613,7 +617,7 @@ function Ee(o, e) {
613
617
  }
614
618
  };
615
619
  }
616
- function Ie(o, e) {
620
+ function He(o, e) {
617
621
  return {
618
622
  [`&-item:not(${e}-first-item):not(${e}-last-item)`]: {
619
623
  borderRadius: 0
@@ -632,13 +636,13 @@ function Ie(o, e) {
632
636
  }
633
637
  };
634
638
  }
635
- function He(o) {
639
+ function ze(o) {
636
640
  const e = `${o.componentCls}-compact-vertical`;
637
641
  return {
638
- [e]: Object.assign(Object.assign({}, Ee(o, e)), Ie(o.componentCls, e))
642
+ [e]: Object.assign(Object.assign({}, Ie(o, e)), He(o.componentCls, e))
639
643
  };
640
644
  }
641
- const ze = (o) => {
645
+ const je = (o) => {
642
646
  const {
643
647
  componentCls: e,
644
648
  calc: t
@@ -681,22 +685,22 @@ const ze = (o) => {
681
685
  }
682
686
  }
683
687
  };
684
- }, je = Yo(["Button", "compact"], (o) => {
685
- const e = vo(o);
688
+ }, Ne = Zo(["Button", "compact"], (o) => {
689
+ const e = Oo(o);
686
690
  return [
687
691
  // Space Compact
688
- ee(e),
689
- He(e),
690
- ze(e)
692
+ te(e),
693
+ ze(e),
694
+ je(e)
691
695
  ];
692
- }, $o);
696
+ }, Eo);
693
697
  var Le = function(o, e) {
694
698
  var t = {};
695
- for (var r in o)
696
- Object.prototype.hasOwnProperty.call(o, r) && e.indexOf(r) < 0 && (t[r] = o[r]);
699
+ for (var n in o)
700
+ Object.prototype.hasOwnProperty.call(o, n) && e.indexOf(n) < 0 && (t[n] = o[n]);
697
701
  if (o != null && typeof Object.getOwnPropertySymbols == "function")
698
- for (var n = 0, r = Object.getOwnPropertySymbols(o); n < r.length; n++)
699
- e.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(o, r[n]) && (t[r[n]] = o[r[n]]);
702
+ for (var r = 0, n = Object.getOwnPropertySymbols(o); r < n.length; r++)
703
+ e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(o, n[r]) && (t[n[r]] = o[n[r]]);
700
704
  return t;
701
705
  };
702
706
  function Pe(o) {
@@ -713,120 +717,126 @@ function Pe(o) {
713
717
  };
714
718
  }
715
719
  const Te = /* @__PURE__ */ a.forwardRef((o, e) => {
716
- var t, r, n;
720
+ var t, n, r;
717
721
  const {
718
- loading: l = !1,
719
- prefixCls: i,
722
+ loading: i = !1,
723
+ prefixCls: l,
720
724
  type: c,
721
725
  danger: m,
722
- shape: d = "default",
723
- size: b,
724
- styles: S,
725
- disabled: y,
726
- className: Eo,
727
- rootClassName: Io,
728
- children: h,
729
- icon: B,
726
+ shape: u = "default",
727
+ size: p,
728
+ styles: f,
729
+ disabled: v,
730
+ className: Ho,
731
+ rootClassName: zo,
732
+ children: S,
733
+ icon: C,
730
734
  iconPosition: P = "start",
731
- ghost: Ho = !1,
732
- block: zo = !1,
735
+ ghost: K = !1,
736
+ block: jo = !1,
733
737
  // React does not recognize the `htmlType` prop on a DOM element. Here we pick it out of `rest`.
734
- htmlType: jo = "button",
738
+ htmlType: No = "button",
735
739
  classNames: T,
736
740
  style: Lo = {},
737
741
  autoInsertSpace: w
738
- } = o, J = Le(o, ["loading", "prefixCls", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "iconPosition", "ghost", "block", "htmlType", "classNames", "style", "autoInsertSpace"]), O = c || "default", {
742
+ } = o, Q = Le(o, ["loading", "prefixCls", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "iconPosition", "ghost", "block", "htmlType", "classNames", "style", "autoInsertSpace"]), $ = c || "default", {
739
743
  getPrefixCls: Po,
740
- direction: K,
741
- button: u
742
- } = D(ho), N = (t = w ?? (u == null ? void 0 : u.autoInsertSpace)) !== null && t !== void 0 ? t : !0, s = Po("btn", i), [Q, To, wo] = xe(s), No = D(Zo), x = y ?? No, Wo = D(Co), E = _o(() => Pe(l), [l]), [C, Y] = uo(E.loading), [W, Z] = uo(!1), v = ko(e, /* @__PURE__ */ Vo()), k = Fo.count(h) === 1 && !B && !_(O);
743
- go(() => {
744
- let g = null;
745
- E.delay > 0 ? g = setTimeout(() => {
746
- g = null, Y(!0);
747
- }, E.delay) : Y(E.loading);
748
- function p() {
749
- g && (clearTimeout(g), g = null);
744
+ direction: Y,
745
+ button: g
746
+ } = _(yo), W = (t = w ?? (g == null ? void 0 : g.autoInsertSpace)) !== null && t !== void 0 ? t : !0, s = Po("btn", l), [Z, To, wo] = xe(s), Wo = _(ko), E = v ?? Wo, Do = _($o), x = Fo(() => Pe(i), [i]), [y, k] = mo(x.loading), [D, oo] = mo(!1), B = oe(e, /* @__PURE__ */ qo()), eo = Vo.count(S) === 1 && !C && !z($);
747
+ po(() => {
748
+ let d = null;
749
+ x.delay > 0 ? d = setTimeout(() => {
750
+ d = null, k(!0);
751
+ }, x.delay) : k(x.loading);
752
+ function b() {
753
+ d && (clearTimeout(d), d = null);
750
754
  }
751
- return p;
752
- }, [E]), go(() => {
753
- if (!v || !v.current || !N)
755
+ return b;
756
+ }, [x]), po(() => {
757
+ if (!B || !B.current || !W)
754
758
  return;
755
- const g = v.current.textContent;
756
- k && q(g) ? W || Z(!0) : W && Z(!1);
757
- }, [v]);
758
- const oo = (g) => {
759
+ const d = B.current.textContent;
760
+ eo && q(d) ? D || oo(!0) : D && oo(!1);
761
+ }, [B]);
762
+ const to = (d) => {
759
763
  const {
760
- onClick: p
764
+ onClick: b
761
765
  } = o;
762
- if (C || x) {
763
- g.preventDefault();
766
+ if (y || E) {
767
+ d.preventDefault();
764
768
  return;
765
769
  }
766
- p == null || p(g);
767
- }, {
768
- compactSize: Ao,
769
- compactItemClassnames: eo
770
- } = te(s, K), Ro = {
770
+ b == null || b(d);
771
+ };
772
+ if (process.env.NODE_ENV !== "production") {
773
+ const d = vo("Button");
774
+ process.env.NODE_ENV !== "production" && d(!(typeof C == "string" && C.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${C}\` at https://ant.design/components/icon`), process.env.NODE_ENV !== "production" && d(!(K && z($)), "usage", "`link` or `text` button can't be a `ghost` button.");
775
+ }
776
+ const {
777
+ compactSize: Ro,
778
+ compactItemClassnames: no
779
+ } = ne(s, Y), Ao = {
771
780
  large: "lg",
772
781
  small: "sm",
773
782
  middle: void 0
774
- }, to = re((g) => {
775
- var p, G;
776
- return (G = (p = b ?? Ao) !== null && p !== void 0 ? p : Wo) !== null && G !== void 0 ? G : g;
777
- }), ro = to && Ro[to] || "", no = C ? "loading" : B, A = ne(J, ["navigate"]), lo = $(s, To, wo, {
778
- [`${s}-${d}`]: d !== "default" && d,
779
- [`${s}-${O}`]: O,
780
- [`${s}-${ro}`]: ro,
781
- [`${s}-icon-only`]: !h && h !== 0 && !!no,
782
- [`${s}-background-ghost`]: Ho && !_(O),
783
- [`${s}-loading`]: C,
784
- [`${s}-two-chinese-chars`]: W && N && !C,
785
- [`${s}-block`]: zo,
783
+ }, ro = re((d) => {
784
+ var b, G;
785
+ return (G = (b = p ?? Ro) !== null && b !== void 0 ? b : Do) !== null && G !== void 0 ? G : d;
786
+ }), io = ro && Ao[ro] || "", lo = y ? "loading" : C, R = ie(Q, ["navigate"]), ao = O(s, To, wo, {
787
+ [`${s}-${u}`]: u !== "default" && u,
788
+ [`${s}-${$}`]: $,
789
+ [`${s}-${io}`]: io,
790
+ [`${s}-icon-only`]: !S && S !== 0 && !!lo,
791
+ [`${s}-background-ghost`]: K && !z($),
792
+ [`${s}-loading`]: y,
793
+ [`${s}-two-chinese-chars`]: D && W && !y,
794
+ [`${s}-block`]: jo,
786
795
  [`${s}-dangerous`]: !!m,
787
- [`${s}-rtl`]: K === "rtl"
788
- }, eo, Eo, Io, u == null ? void 0 : u.className), io = Object.assign(Object.assign({}, u == null ? void 0 : u.style), Lo), Go = P === "end" && h && h !== 0 && no, Do = $(T == null ? void 0 : T.icon, (r = u == null ? void 0 : u.classNames) === null || r === void 0 ? void 0 : r.icon, {
796
+ [`${s}-rtl`]: Y === "rtl"
797
+ }, no, Ho, zo, g == null ? void 0 : g.className), co = Object.assign(Object.assign({}, g == null ? void 0 : g.style), Lo), Go = P === "end" && S && S !== 0 && lo, _o = O(T == null ? void 0 : T.icon, (n = g == null ? void 0 : g.classNames) === null || n === void 0 ? void 0 : n.icon, {
789
798
  [`${s}-icon-end`]: Go
790
- }), Mo = Object.assign(Object.assign({}, (S == null ? void 0 : S.icon) || {}), ((n = u == null ? void 0 : u.styles) === null || n === void 0 ? void 0 : n.icon) || {}), ao = B && !C ? /* @__PURE__ */ a.createElement(yo, {
799
+ }), Mo = Object.assign(Object.assign({}, (f == null ? void 0 : f.icon) || {}), ((r = g == null ? void 0 : g.styles) === null || r === void 0 ? void 0 : r.icon) || {}), so = C && !y ? /* @__PURE__ */ a.createElement(Bo, {
791
800
  prefixCls: s,
792
- className: Do,
801
+ className: _o,
793
802
  style: Mo
794
- }, B) : /* @__PURE__ */ a.createElement(de, {
795
- existIcon: !!B,
803
+ }, C) : /* @__PURE__ */ a.createElement(ue, {
804
+ existIcon: !!C,
796
805
  prefixCls: s,
797
- loading: !!C,
806
+ loading: !!y,
798
807
  iconPosition: P
799
- }), co = h || h === 0 ? se(h, k && N) : null, so = (g, p) => P === "start" ? /* @__PURE__ */ a.createElement(a.Fragment, null, g, p) : /* @__PURE__ */ a.createElement(a.Fragment, null, p, g);
800
- if (A.href !== void 0)
801
- return Q(/* @__PURE__ */ a.createElement("a", Object.assign({}, A, {
802
- className: $(lo, {
803
- [`${s}-disabled`]: x
808
+ }), uo = S || S === 0 ? de(S, eo && W) : null, go = (d, b) => P === "start" ? /* @__PURE__ */ a.createElement(a.Fragment, null, d, b) : /* @__PURE__ */ a.createElement(a.Fragment, null, b, d);
809
+ if (R.href !== void 0)
810
+ return Z(/* @__PURE__ */ a.createElement("a", Object.assign({}, R, {
811
+ className: O(ao, {
812
+ [`${s}-disabled`]: E
804
813
  }),
805
- href: x ? void 0 : A.href,
806
- style: io,
807
- onClick: oo,
808
- ref: v,
809
- tabIndex: x ? -1 : 0
810
- }), so(ao, co)));
811
- let R = /* @__PURE__ */ a.createElement("button", Object.assign({}, J, {
812
- type: jo,
813
- className: lo,
814
- style: io,
815
- onClick: oo,
816
- disabled: x,
817
- ref: v
818
- }), so(ao, co), !!eo && /* @__PURE__ */ a.createElement(je, {
814
+ href: E ? void 0 : R.href,
815
+ style: co,
816
+ onClick: to,
817
+ ref: B,
818
+ tabIndex: E ? -1 : 0
819
+ }), go(so, uo)));
820
+ let A = /* @__PURE__ */ a.createElement("button", Object.assign({}, Q, {
821
+ type: No,
822
+ className: ao,
823
+ style: co,
824
+ onClick: to,
825
+ disabled: E,
826
+ ref: B
827
+ }), go(so, uo), !!no && /* @__PURE__ */ a.createElement(Ne, {
819
828
  key: "compact",
820
829
  prefixCls: s
821
830
  }));
822
- return _(O) || (R = /* @__PURE__ */ a.createElement(le, {
831
+ return z($) || (A = /* @__PURE__ */ a.createElement(le, {
823
832
  component: "Button",
824
- disabled: !!C
825
- }, R)), Q(R);
826
- }), xo = Te;
827
- xo.Group = ae;
828
- xo.__ANT_BUTTON = !0;
833
+ disabled: !!y
834
+ }, A)), Z(A);
835
+ }), J = Te;
836
+ J.Group = ce;
837
+ J.__ANT_BUTTON = !0;
838
+ process.env.NODE_ENV !== "production" && (J.displayName = "Button");
829
839
  export {
830
- xo as B,
831
- Re as c
840
+ J as B,
841
+ Ae as c
832
842
  };