@notificationapi/react 0.0.31 → 0.0.32

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.
@@ -1,7 +1,7 @@
1
1
  import * as l from "react";
2
2
  import { useMemo as et, useRef as X } from "react";
3
- import { c as w } from "./index3.js";
4
- import { g as nt, K as z, b as rt, r as it, u as j, m as Ot, a as K, i as st, c as at, d as xt } from "./colors.js";
3
+ import { c as x } from "./presets.js";
4
+ import { g as nt, K as z, b as rt, r as it, u as E, m as Ot, a as K, i as st, c as at, d as xt } from "./colors.js";
5
5
  const wt = new z("antStatusProcessing", {
6
6
  "0%": {
7
7
  transform: "scale(0.8)",
@@ -11,7 +11,7 @@ const wt = new z("antStatusProcessing", {
11
11
  transform: "scale(2.4)",
12
12
  opacity: 0
13
13
  }
14
- }), jt = new z("antZoomBadgeIn", {
14
+ }), Et = new z("antZoomBadgeIn", {
15
15
  "0%": {
16
16
  transform: "scale(0) translate(50%, -50%)",
17
17
  opacity: 0
@@ -19,7 +19,7 @@ const wt = new z("antStatusProcessing", {
19
19
  "100%": {
20
20
  transform: "scale(1) translate(50%, -50%)"
21
21
  }
22
- }), Et = new z("antZoomBadgeOut", {
22
+ }), jt = new z("antZoomBadgeOut", {
23
23
  "0%": {
24
24
  transform: "scale(1) translate(50%, -50%)"
25
25
  },
@@ -57,28 +57,27 @@ const wt = new z("antStatusProcessing", {
57
57
  iconCls: i,
58
58
  antCls: n,
59
59
  badgeShadowSize: o,
60
- motionDurationSlow: d,
61
- textFontSize: a,
62
- textFontSizeSM: h,
60
+ textFontSize: d,
61
+ textFontSizeSM: s,
63
62
  statusSize: y,
64
- dotSize: g,
65
- textFontWeight: m,
66
- indicatorHeight: s,
67
- indicatorHeightSM: c,
68
- marginXS: f,
69
- calc: v
70
- } = t, u = `${n}-scroll-number`, C = rt(t, (b, $) => {
63
+ dotSize: v,
64
+ textFontWeight: C,
65
+ indicatorHeight: c,
66
+ indicatorHeightSM: a,
67
+ marginXS: m,
68
+ calc: b
69
+ } = t, u = `${n}-scroll-number`, S = rt(t, ($, g) => {
71
70
  let {
72
- darkColor: S
73
- } = $;
71
+ darkColor: f
72
+ } = g;
74
73
  return {
75
- [`&${e} ${e}-color-${b}`]: {
76
- background: S,
74
+ [`&${e} ${e}-color-${$}`]: {
75
+ background: f,
77
76
  [`&:not(${e}-count)`]: {
78
- color: S
77
+ color: f
79
78
  },
80
79
  "a:hover &": {
81
- background: S
80
+ background: f
82
81
  }
83
82
  }
84
83
  };
@@ -93,17 +92,17 @@ const wt = new z("antStatusProcessing", {
93
92
  display: "inline-flex",
94
93
  justifyContent: "center",
95
94
  zIndex: t.indicatorZIndex,
96
- minWidth: s,
97
- height: s,
95
+ minWidth: c,
96
+ height: c,
98
97
  color: t.badgeTextColor,
99
- fontWeight: m,
100
- fontSize: a,
101
- lineHeight: j(s),
98
+ fontWeight: C,
99
+ fontSize: d,
100
+ lineHeight: E(c),
102
101
  whiteSpace: "nowrap",
103
102
  textAlign: "center",
104
103
  background: t.badgeColor,
105
- borderRadius: v(s).div(2).equal(),
106
- boxShadow: `0 0 0 ${j(o)} ${t.badgeShadowColor}`,
104
+ borderRadius: b(c).div(2).equal(),
105
+ boxShadow: `0 0 0 ${E(o)} ${t.badgeShadowColor}`,
107
106
  transition: `background ${t.motionDurationMid}`,
108
107
  a: {
109
108
  color: t.badgeTextColor
@@ -116,29 +115,26 @@ const wt = new z("antStatusProcessing", {
116
115
  }
117
116
  },
118
117
  [`${e}-count-sm`]: {
119
- minWidth: c,
120
- height: c,
121
- fontSize: h,
122
- lineHeight: j(c),
123
- borderRadius: v(c).div(2).equal()
118
+ minWidth: a,
119
+ height: a,
120
+ fontSize: s,
121
+ lineHeight: E(a),
122
+ borderRadius: b(a).div(2).equal()
124
123
  },
125
124
  [`${e}-multiple-words`]: {
126
- padding: `0 ${j(t.paddingXS)}`,
125
+ padding: `0 ${E(t.paddingXS)}`,
127
126
  bdi: {
128
127
  unicodeBidi: "plaintext"
129
128
  }
130
129
  },
131
130
  [`${e}-dot`]: {
132
131
  zIndex: t.indicatorZIndex,
133
- width: g,
134
- minWidth: g,
135
- height: g,
132
+ width: v,
133
+ minWidth: v,
134
+ height: v,
136
135
  background: t.badgeColor,
137
136
  borderRadius: "100%",
138
- boxShadow: `0 0 0 ${j(o)} ${t.badgeShadowColor}`
139
- },
140
- [`${e}-dot${u}`]: {
141
- transition: `background ${d}`
137
+ boxShadow: `0 0 0 ${E(o)} ${t.badgeShadowColor}`
142
138
  },
143
139
  [`${e}-count, ${e}-dot, ${u}-custom-component`]: {
144
140
  position: "absolute",
@@ -173,6 +169,7 @@ const wt = new z("antStatusProcessing", {
173
169
  overflow: "visible",
174
170
  color: t.colorInfo,
175
171
  backgroundColor: t.colorInfo,
172
+ borderColor: "currentcolor",
176
173
  "&::after": {
177
174
  position: "absolute",
178
175
  top: 0,
@@ -200,20 +197,20 @@ const wt = new z("antStatusProcessing", {
200
197
  backgroundColor: t.colorWarning
201
198
  },
202
199
  [`${e}-status-text`]: {
203
- marginInlineStart: f,
200
+ marginInlineStart: m,
204
201
  color: t.colorText,
205
202
  fontSize: t.fontSize
206
203
  }
207
204
  }
208
- }), C), {
205
+ }), S), {
209
206
  [`${e}-zoom-appear, ${e}-zoom-enter`]: {
210
- animationName: jt,
207
+ animationName: Et,
211
208
  animationDuration: t.motionDurationSlow,
212
209
  animationTimingFunction: t.motionEaseOutBack,
213
210
  animationFillMode: "both"
214
211
  },
215
212
  [`${e}-zoom-leave`]: {
216
- animationName: Et,
213
+ animationName: jt,
217
214
  animationDuration: t.motionDurationSlow,
218
215
  animationTimingFunction: t.motionEaseOutBack,
219
216
  animationFillMode: "both"
@@ -242,17 +239,18 @@ const wt = new z("antStatusProcessing", {
242
239
  transformOrigin: "50% 50%"
243
240
  }
244
241
  },
245
- [`${u}`]: {
242
+ [u]: {
246
243
  overflow: "hidden",
244
+ transition: `all ${t.motionDurationMid} ${t.motionEaseOutBack}`,
247
245
  [`${u}-only`]: {
248
246
  position: "relative",
249
247
  display: "inline-block",
250
- height: s,
248
+ height: c,
251
249
  transition: `all ${t.motionDurationSlow} ${t.motionEaseOutBack}`,
252
250
  WebkitTransformStyle: "preserve-3d",
253
251
  WebkitBackfaceVisibility: "hidden",
254
252
  [`> p${u}-only-unit`]: {
255
- height: s,
253
+ height: c,
256
254
  margin: 0,
257
255
  WebkitTransformStyle: "preserve-3d",
258
256
  WebkitBackfaceVisibility: "hidden"
@@ -277,13 +275,13 @@ const wt = new z("antStatusProcessing", {
277
275
  lineWidth: i,
278
276
  marginXS: n,
279
277
  colorBorderBg: o
280
- } = t, d = e, a = i, h = t.colorBgContainer, y = t.colorError, g = t.colorErrorHover;
278
+ } = t, d = e, s = i, y = t.colorBgContainer, v = t.colorError, C = t.colorErrorHover;
281
279
  return Ot(t, {
282
280
  badgeFontHeight: d,
283
- badgeShadowSize: a,
284
- badgeTextColor: h,
285
- badgeColor: y,
286
- badgeColorHover: g,
281
+ badgeShadowSize: s,
282
+ badgeTextColor: y,
283
+ badgeColor: v,
284
+ badgeColorHover: C,
287
285
  badgeShadowColor: o,
288
286
  badgeProcessingDuration: "1.2s",
289
287
  badgeRibbonOffset: n,
@@ -318,58 +316,58 @@ const wt = new z("antStatusProcessing", {
318
316
  marginXS: n,
319
317
  badgeRibbonOffset: o,
320
318
  calc: d
321
- } = t, a = `${e}-ribbon`, h = `${e}-ribbon-wrapper`, y = rt(t, (g, m) => {
319
+ } = t, s = `${e}-ribbon`, y = `${e}-ribbon-wrapper`, v = rt(t, (C, c) => {
322
320
  let {
323
- darkColor: s
324
- } = m;
321
+ darkColor: a
322
+ } = c;
325
323
  return {
326
- [`&${a}-color-${g}`]: {
327
- background: s,
328
- color: s
324
+ [`&${s}-color-${C}`]: {
325
+ background: a,
326
+ color: a
329
327
  }
330
328
  };
331
329
  });
332
330
  return {
333
- [`${h}`]: {
331
+ [y]: {
334
332
  position: "relative"
335
333
  },
336
- [`${a}`]: Object.assign(Object.assign(Object.assign(Object.assign({}, it(t)), {
334
+ [s]: Object.assign(Object.assign(Object.assign(Object.assign({}, it(t)), {
337
335
  position: "absolute",
338
336
  top: n,
339
- padding: `0 ${j(t.paddingXS)}`,
337
+ padding: `0 ${E(t.paddingXS)}`,
340
338
  color: t.colorPrimary,
341
- lineHeight: j(i),
339
+ lineHeight: E(i),
342
340
  whiteSpace: "nowrap",
343
341
  backgroundColor: t.colorPrimary,
344
342
  borderRadius: t.borderRadiusSM,
345
- [`${a}-text`]: {
343
+ [`${s}-text`]: {
346
344
  color: t.colorTextLightSolid
347
345
  },
348
- [`${a}-corner`]: {
346
+ [`${s}-corner`]: {
349
347
  position: "absolute",
350
348
  top: "100%",
351
349
  width: o,
352
350
  height: o,
353
351
  color: "currentcolor",
354
- border: `${j(d(o).div(2).equal())} solid`,
352
+ border: `${E(d(o).div(2).equal())} solid`,
355
353
  transform: t.badgeRibbonCornerTransform,
356
354
  transformOrigin: "top",
357
355
  filter: t.badgeRibbonCornerFilter
358
356
  }
359
- }), y), {
360
- [`&${a}-placement-end`]: {
357
+ }), v), {
358
+ [`&${s}-placement-end`]: {
361
359
  insetInlineEnd: d(o).mul(-1).equal(),
362
360
  borderEndEndRadius: 0,
363
- [`${a}-corner`]: {
361
+ [`${s}-corner`]: {
364
362
  insetInlineEnd: 0,
365
363
  borderInlineEndColor: "transparent",
366
364
  borderBlockEndColor: "transparent"
367
365
  }
368
366
  },
369
- [`&${a}-placement-start`]: {
367
+ [`&${s}-placement-start`]: {
370
368
  insetInlineStart: d(o).mul(-1).equal(),
371
369
  borderEndStartRadius: 0,
372
- [`${a}-corner`]: {
370
+ [`${s}-corner`]: {
373
371
  insetInlineStart: 0,
374
372
  borderBlockEndColor: "transparent",
375
373
  borderInlineStartColor: "transparent"
@@ -391,110 +389,105 @@ const wt = new z("antStatusProcessing", {
391
389
  style: n,
392
390
  color: o,
393
391
  children: d,
394
- text: a,
395
- placement: h = "end",
396
- rootClassName: y
392
+ text: s,
393
+ placement: y = "end",
394
+ rootClassName: v
397
395
  } = t, {
398
- getPrefixCls: g,
399
- direction: m
400
- } = l.useContext(K), s = g("ribbon", i), c = `${s}-wrapper`, [f, v, u] = Dt(s, c), C = st(o, !1), b = w(s, `${s}-placement-${h}`, {
401
- [`${s}-rtl`]: m === "rtl",
402
- [`${s}-color-${o}`]: C
403
- }, e), $ = {}, S = {};
404
- return o && !C && ($.background = o, S.color = o), f(/* @__PURE__ */ l.createElement("div", {
405
- className: w(c, y, v, u)
396
+ getPrefixCls: C,
397
+ direction: c
398
+ } = l.useContext(K), a = C("ribbon", i), m = `${a}-wrapper`, [b, u, S] = Dt(a, m), $ = st(o, !1), g = x(a, `${a}-placement-${y}`, {
399
+ [`${a}-rtl`]: c === "rtl",
400
+ [`${a}-color-${o}`]: $
401
+ }, e), f = {}, w = {};
402
+ return o && !$ && (f.background = o, w.color = o), b(/* @__PURE__ */ l.createElement("div", {
403
+ className: x(m, v, u, S)
406
404
  }, d, /* @__PURE__ */ l.createElement("div", {
407
- className: w(b, v),
408
- style: Object.assign(Object.assign({}, $), n)
405
+ className: x(g, u),
406
+ style: Object.assign(Object.assign({}, f), n)
409
407
  }, /* @__PURE__ */ l.createElement("span", {
410
- className: `${s}-text`
411
- }, a), /* @__PURE__ */ l.createElement("div", {
412
- className: `${s}-corner`,
413
- style: S
408
+ className: `${a}-text`
409
+ }, s), /* @__PURE__ */ l.createElement("div", {
410
+ className: `${a}-corner`,
411
+ style: w
414
412
  }))));
415
413
  };
416
414
  process.env.NODE_ENV !== "production" && (dt.displayName = "Ribbon");
417
- function ot(t) {
418
- let {
415
+ const ot = (t) => {
416
+ const {
419
417
  prefixCls: e,
420
418
  value: i,
421
419
  current: n,
422
420
  offset: o = 0
423
- } = t, d;
421
+ } = t;
422
+ let d;
424
423
  return o && (d = {
425
424
  position: "absolute",
426
425
  top: `${o}00%`,
427
426
  left: 0
428
427
  }), /* @__PURE__ */ l.createElement("span", {
429
428
  style: d,
430
- className: w(`${e}-only-unit`, {
429
+ className: x(`${e}-only-unit`, {
431
430
  current: n
432
431
  })
433
432
  }, i);
434
- }
433
+ };
435
434
  function Wt(t, e, i) {
436
435
  let n = t, o = 0;
437
436
  for (; (n + 10) % 10 !== e; )
438
437
  n += i, o += i;
439
438
  return o;
440
439
  }
441
- function Ft(t) {
440
+ const Ft = (t) => {
442
441
  const {
443
442
  prefixCls: e,
444
443
  count: i,
445
444
  value: n
446
- } = t, o = Number(n), d = Math.abs(i), [a, h] = l.useState(o), [y, g] = l.useState(d), m = () => {
447
- h(o), g(d);
445
+ } = t, o = Number(n), d = Math.abs(i), [s, y] = l.useState(o), [v, C] = l.useState(d), c = () => {
446
+ y(o), C(d);
448
447
  };
449
448
  l.useEffect(() => {
450
- const f = setTimeout(() => {
451
- m();
452
- }, 1e3);
453
- return () => {
454
- clearTimeout(f);
455
- };
449
+ const b = setTimeout(c, 1e3);
450
+ return () => clearTimeout(b);
456
451
  }, [o]);
457
- let s, c;
458
- if (a === o || Number.isNaN(o) || Number.isNaN(a))
459
- s = [/* @__PURE__ */ l.createElement(ot, Object.assign({}, t, {
452
+ let a, m;
453
+ if (s === o || Number.isNaN(o) || Number.isNaN(s))
454
+ a = [/* @__PURE__ */ l.createElement(ot, Object.assign({}, t, {
460
455
  key: o,
461
456
  current: !0
462
- }))], c = {
457
+ }))], m = {
463
458
  transition: "none"
464
459
  };
465
460
  else {
466
- s = [];
467
- const f = o + 10, v = [];
468
- for (let b = o; b <= f; b += 1)
469
- v.push(b);
470
- const u = v.findIndex((b) => b % 10 === a);
471
- s = v.map((b, $) => {
472
- const S = b % 10;
461
+ a = [];
462
+ const b = o + 10, u = [];
463
+ for (let g = o; g <= b; g += 1)
464
+ u.push(g);
465
+ const S = u.findIndex((g) => g % 10 === s);
466
+ a = u.map((g, f) => {
467
+ const w = g % 10;
473
468
  return /* @__PURE__ */ l.createElement(ot, Object.assign({}, t, {
474
- key: b,
475
- value: S,
476
- offset: $ - u,
477
- current: $ === u
469
+ key: g,
470
+ value: w,
471
+ offset: f - S,
472
+ current: f === S
478
473
  }));
479
474
  });
480
- const C = y < d ? 1 : -1;
481
- c = {
482
- transform: `translateY(${-Wt(a, o, C)}00%)`
475
+ const $ = v < d ? 1 : -1;
476
+ m = {
477
+ transform: `translateY(${-Wt(s, o, $)}00%)`
483
478
  };
484
479
  }
485
480
  return /* @__PURE__ */ l.createElement("span", {
486
481
  className: `${e}-only`,
487
- style: c,
488
- onTransitionEnd: m
489
- }, s);
490
- }
482
+ style: m,
483
+ onTransitionEnd: c
484
+ }, a);
485
+ };
491
486
  var Ht = function(t, e) {
492
487
  var i = {};
493
- for (var n in t)
494
- Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (i[n] = t[n]);
495
- if (t != null && typeof Object.getOwnPropertySymbols == "function")
496
- for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
497
- e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (i[n[o]] = t[n[o]]);
488
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (i[n] = t[n]);
489
+ if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
490
+ e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (i[n[o]] = t[n[o]]);
498
491
  return i;
499
492
  };
500
493
  const _t = /* @__PURE__ */ l.forwardRef((t, e) => {
@@ -503,151 +496,149 @@ const _t = /* @__PURE__ */ l.forwardRef((t, e) => {
503
496
  count: n,
504
497
  className: o,
505
498
  motionClassName: d,
506
- style: a,
507
- title: h,
508
- show: y,
509
- component: g = "sup",
510
- children: m
511
- } = t, s = Ht(t, ["prefixCls", "count", "className", "motionClassName", "style", "title", "show", "component", "children"]), {
512
- getPrefixCls: c
513
- } = l.useContext(K), f = c("scroll-number", i), v = Object.assign(Object.assign({}, s), {
514
- "data-show": y,
515
- style: a,
516
- className: w(f, o, d),
517
- title: h
499
+ style: s,
500
+ title: y,
501
+ show: v,
502
+ component: C = "sup",
503
+ children: c
504
+ } = t, a = Ht(t, ["prefixCls", "count", "className", "motionClassName", "style", "title", "show", "component", "children"]), {
505
+ getPrefixCls: m
506
+ } = l.useContext(K), b = m("scroll-number", i), u = Object.assign(Object.assign({}, a), {
507
+ "data-show": v,
508
+ style: s,
509
+ className: x(b, o, d),
510
+ title: y
518
511
  });
519
- let u = n;
512
+ let S = n;
520
513
  if (n && Number(n) % 1 === 0) {
521
- const C = String(n).split("");
522
- u = /* @__PURE__ */ l.createElement("bdi", null, C.map((b, $) => /* @__PURE__ */ l.createElement(Ft, {
523
- prefixCls: f,
514
+ const $ = String(n).split("");
515
+ S = /* @__PURE__ */ l.createElement("bdi", null, $.map((g, f) => /* @__PURE__ */ l.createElement(Ft, {
516
+ prefixCls: b,
524
517
  count: Number(n),
525
- value: b,
518
+ value: g,
526
519
  // eslint-disable-next-line react/no-array-index-key
527
- key: C.length - $
520
+ key: $.length - f
528
521
  })));
529
522
  }
530
- return a && a.borderColor && (v.style = Object.assign(Object.assign({}, a), {
531
- boxShadow: `0 0 0 1px ${a.borderColor} inset`
532
- })), m ? at(m, (C) => ({
533
- className: w(`${f}-custom-component`, C == null ? void 0 : C.className, d)
534
- })) : /* @__PURE__ */ l.createElement(g, Object.assign({}, v, {
523
+ return s != null && s.borderColor && (u.style = Object.assign(Object.assign({}, s), {
524
+ boxShadow: `0 0 0 1px ${s.borderColor} inset`
525
+ })), c ? at(c, ($) => ({
526
+ className: x(`${b}-custom-component`, $ == null ? void 0 : $.className, d)
527
+ })) : /* @__PURE__ */ l.createElement(C, Object.assign({}, u, {
535
528
  ref: e
536
- }), u);
529
+ }), S);
537
530
  });
538
- var Zt = function(t, e) {
531
+ var Mt = function(t, e) {
539
532
  var i = {};
540
- for (var n in t)
541
- Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (i[n] = t[n]);
542
- if (t != null && typeof Object.getOwnPropertySymbols == "function")
543
- for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
544
- e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (i[n[o]] = t[n[o]]);
533
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (i[n] = t[n]);
534
+ if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
535
+ e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (i[n[o]] = t[n[o]]);
545
536
  return i;
546
537
  };
547
- const Mt = /* @__PURE__ */ l.forwardRef((t, e) => {
548
- var i, n, o, d, a;
538
+ const Zt = /* @__PURE__ */ l.forwardRef((t, e) => {
539
+ var i, n, o, d, s;
549
540
  const {
550
- prefixCls: h,
551
- scrollNumberPrefixCls: y,
552
- children: g,
553
- status: m,
554
- text: s,
555
- color: c,
556
- count: f = null,
557
- overflowCount: v = 99,
558
- dot: u = !1,
559
- size: C = "default",
560
- title: b,
561
- offset: $,
562
- style: S,
541
+ prefixCls: y,
542
+ scrollNumberPrefixCls: v,
543
+ children: C,
544
+ status: c,
545
+ text: a,
546
+ color: m,
547
+ count: b = null,
548
+ overflowCount: u = 99,
549
+ dot: S = !1,
550
+ size: $ = "default",
551
+ title: g,
552
+ offset: f,
553
+ style: w,
563
554
  className: mt,
564
555
  rootClassName: bt,
565
- classNames: x,
566
- styles: N,
556
+ classNames: O,
557
+ styles: h,
567
558
  showZero: F = !1
568
- } = t, U = Zt(t, ["prefixCls", "scrollNumberPrefixCls", "children", "status", "text", "color", "count", "overflowCount", "dot", "size", "title", "offset", "style", "className", "rootClassName", "classNames", "styles", "showZero"]), {
559
+ } = t, U = Mt(t, ["prefixCls", "scrollNumberPrefixCls", "children", "status", "text", "color", "count", "overflowCount", "dot", "size", "title", "offset", "style", "className", "rootClassName", "classNames", "styles", "showZero"]), {
569
560
  getPrefixCls: Y,
570
561
  direction: H,
571
562
  badge: r
572
- } = l.useContext(K), p = Y("badge", h), [k, gt, ft] = Tt(p), _ = f > v ? `${v}+` : f, T = _ === "0" || _ === 0, pt = f === null || T && !F, Z = (m != null || c != null) && pt, B = u && !T, E = B ? "" : _, P = et(() => (E == null || E === "" || T && !F) && !B, [E, T, F, B]), G = X(f);
573
- P || (G.current = f);
574
- const I = G.current, J = X(E);
575
- P || (J.current = E);
576
- const M = J.current, Q = X(B);
577
- P || (Q.current = B);
563
+ } = l.useContext(K), p = Y("badge", y), [G, gt, ft] = Tt(p), _ = b > u ? `${u}+` : b, T = _ === "0" || _ === 0, pt = b === null || T && !F, M = (c != null || m != null) && pt, B = S && !T, j = B ? "" : _, P = et(() => (j == null || j === "" || T && !F) && !B, [j, T, F, B]), J = X(b);
564
+ P || (J.current = b);
565
+ const I = J.current, Q = X(j);
566
+ P || (Q.current = j);
567
+ const Z = Q.current, k = X(B);
568
+ P || (k.current = B);
578
569
  const R = et(() => {
579
- if (!$)
580
- return Object.assign(Object.assign({}, r == null ? void 0 : r.style), S);
581
- const O = {
582
- marginTop: $[1]
570
+ if (!f)
571
+ return Object.assign(Object.assign({}, r == null ? void 0 : r.style), w);
572
+ const N = {
573
+ marginTop: f[1]
583
574
  };
584
- return H === "rtl" ? O.left = parseInt($[0], 10) : O.right = -parseInt($[0], 10), Object.assign(Object.assign(Object.assign({}, O), r == null ? void 0 : r.style), S);
585
- }, [H, $, S, r == null ? void 0 : r.style]), vt = b ?? (typeof I == "string" || typeof I == "number" ? I : void 0), Ct = P || !s ? null : /* @__PURE__ */ l.createElement("span", {
575
+ return H === "rtl" ? N.left = parseInt(f[0], 10) : N.right = -parseInt(f[0], 10), Object.assign(Object.assign(Object.assign({}, N), r == null ? void 0 : r.style), w);
576
+ }, [H, f, w, r == null ? void 0 : r.style]), vt = g ?? (typeof I == "string" || typeof I == "number" ? I : void 0), Ct = P || !a ? null : /* @__PURE__ */ l.createElement("span", {
586
577
  className: `${p}-status-text`
587
- }, s), $t = !I || typeof I != "object" ? void 0 : at(I, (O) => ({
588
- style: Object.assign(Object.assign({}, R), O.style)
589
- })), D = st(c, !1), yt = w(x == null ? void 0 : x.indicator, (i = r == null ? void 0 : r.classNames) === null || i === void 0 ? void 0 : i.indicator, {
590
- [`${p}-status-dot`]: Z,
591
- [`${p}-status-${m}`]: !!m,
592
- [`${p}-color-${c}`]: D
578
+ }, a), $t = !I || typeof I != "object" ? void 0 : at(I, (N) => ({
579
+ style: Object.assign(Object.assign({}, R), N.style)
580
+ })), D = st(m, !1), yt = x(O == null ? void 0 : O.indicator, (i = r == null ? void 0 : r.classNames) === null || i === void 0 ? void 0 : i.indicator, {
581
+ [`${p}-status-dot`]: M,
582
+ [`${p}-status-${c}`]: !!c,
583
+ [`${p}-color-${m}`]: D
593
584
  }), V = {};
594
- c && !D && (V.color = c, V.background = c);
595
- const tt = w(p, {
596
- [`${p}-status`]: Z,
597
- [`${p}-not-a-wrapper`]: !g,
585
+ m && !D && (V.color = m, V.background = m);
586
+ const tt = x(p, {
587
+ [`${p}-status`]: M,
588
+ [`${p}-not-a-wrapper`]: !C,
598
589
  [`${p}-rtl`]: H === "rtl"
599
- }, mt, bt, r == null ? void 0 : r.className, (n = r == null ? void 0 : r.classNames) === null || n === void 0 ? void 0 : n.root, x == null ? void 0 : x.root, gt, ft);
600
- if (!g && Z) {
601
- const O = R.color;
602
- return k(/* @__PURE__ */ l.createElement("span", Object.assign({}, U, {
590
+ }, mt, bt, r == null ? void 0 : r.className, (n = r == null ? void 0 : r.classNames) === null || n === void 0 ? void 0 : n.root, O == null ? void 0 : O.root, gt, ft);
591
+ if (!C && M) {
592
+ const N = R.color;
593
+ return G(/* @__PURE__ */ l.createElement("span", Object.assign({}, U, {
603
594
  className: tt,
604
- style: Object.assign(Object.assign(Object.assign({}, N == null ? void 0 : N.root), (o = r == null ? void 0 : r.styles) === null || o === void 0 ? void 0 : o.root), R)
595
+ style: Object.assign(Object.assign(Object.assign({}, h == null ? void 0 : h.root), (o = r == null ? void 0 : r.styles) === null || o === void 0 ? void 0 : o.root), R)
605
596
  }), /* @__PURE__ */ l.createElement("span", {
606
597
  className: yt,
607
- style: Object.assign(Object.assign(Object.assign({}, N == null ? void 0 : N.indicator), (d = r == null ? void 0 : r.styles) === null || d === void 0 ? void 0 : d.indicator), V)
608
- }), s && /* @__PURE__ */ l.createElement("span", {
598
+ style: Object.assign(Object.assign(Object.assign({}, h == null ? void 0 : h.indicator), (d = r == null ? void 0 : r.styles) === null || d === void 0 ? void 0 : d.indicator), V)
599
+ }), a && /* @__PURE__ */ l.createElement("span", {
609
600
  style: {
610
- color: O
601
+ color: N
611
602
  },
612
603
  className: `${p}-status-text`
613
- }, s)));
604
+ }, a)));
614
605
  }
615
- return k(/* @__PURE__ */ l.createElement("span", Object.assign({
606
+ return G(/* @__PURE__ */ l.createElement("span", Object.assign({
616
607
  ref: e
617
608
  }, U, {
618
609
  className: tt,
619
- style: Object.assign(Object.assign({}, (a = r == null ? void 0 : r.styles) === null || a === void 0 ? void 0 : a.root), N == null ? void 0 : N.root)
620
- }), g, /* @__PURE__ */ l.createElement(xt, {
610
+ style: Object.assign(Object.assign({}, (s = r == null ? void 0 : r.styles) === null || s === void 0 ? void 0 : s.root), h == null ? void 0 : h.root)
611
+ }), C, /* @__PURE__ */ l.createElement(xt, {
621
612
  visible: !P,
622
613
  motionName: `${p}-zoom`,
623
614
  motionAppear: !1,
624
615
  motionDeadline: 1e3
625
- }, (O) => {
616
+ }, (N) => {
626
617
  let {
627
618
  className: ht
628
- } = O;
619
+ } = N;
629
620
  var A, q;
630
- const St = Y("scroll-number", y), L = Q.current, Nt = w(x == null ? void 0 : x.indicator, (A = r == null ? void 0 : r.classNames) === null || A === void 0 ? void 0 : A.indicator, {
621
+ const St = Y("scroll-number", v), L = k.current, Nt = x(O == null ? void 0 : O.indicator, (A = r == null ? void 0 : r.classNames) === null || A === void 0 ? void 0 : A.indicator, {
631
622
  [`${p}-dot`]: L,
632
623
  [`${p}-count`]: !L,
633
- [`${p}-count-sm`]: C === "small",
634
- [`${p}-multiple-words`]: !L && M && M.toString().length > 1,
635
- [`${p}-status-${m}`]: !!m,
636
- [`${p}-color-${c}`]: D
624
+ [`${p}-count-sm`]: $ === "small",
625
+ [`${p}-multiple-words`]: !L && Z && Z.toString().length > 1,
626
+ [`${p}-status-${c}`]: !!c,
627
+ [`${p}-color-${m}`]: D
637
628
  });
638
- let W = Object.assign(Object.assign(Object.assign({}, N == null ? void 0 : N.indicator), (q = r == null ? void 0 : r.styles) === null || q === void 0 ? void 0 : q.indicator), R);
639
- return c && !D && (W = W || {}, W.background = c), /* @__PURE__ */ l.createElement(_t, {
629
+ let W = Object.assign(Object.assign(Object.assign({}, h == null ? void 0 : h.indicator), (q = r == null ? void 0 : r.styles) === null || q === void 0 ? void 0 : q.indicator), R);
630
+ return m && !D && (W = W || {}, W.background = m), /* @__PURE__ */ l.createElement(_t, {
640
631
  prefixCls: St,
641
632
  show: !P,
642
633
  motionClassName: ht,
643
634
  className: Nt,
644
- count: M,
635
+ count: Z,
645
636
  title: vt,
646
637
  style: W,
647
638
  key: "scrollNumber"
648
639
  }, $t);
649
640
  }), Ct));
650
- }), ut = Mt;
641
+ }), ut = Zt;
651
642
  ut.Ribbon = dt;
652
643
  process.env.NODE_ENV !== "production" && (ut.displayName = "Badge");
653
644
  export {