@unicom-cloud/ui 0.8.94 → 0.8.96

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 (46) hide show
  1. package/Tooltip.js +1 -1
  2. package/alert/index.js +50 -49
  3. package/badge/index.js +11 -11
  4. package/color-picker/InputHex.js +1 -1
  5. package/color-picker/InputRgb.js +1 -1
  6. package/color-picker/Palette.js +1 -1
  7. package/color-picker/Panel.js +1 -1
  8. package/color-picker/colors.js +1 -1
  9. package/color-picker/hooks/useColorPicker.js +1 -1
  10. package/color-picker/utils.js +1 -1
  11. package/components/common/empty/index.js +33 -13
  12. package/components/common/hooks/useForceUpdate.js +6 -2
  13. package/components/common/hooks/useId.js +8 -8
  14. package/components/common/space/index.js +1 -1
  15. package/components/common/utils/setPrimaryColor.js +21 -21
  16. package/components/common/utils/setTheme.js +23 -23
  17. package/details/index.js +32 -31
  18. package/dist/tinycolor/chunk/{DGZSWe7E.js → BOzCVdr0.js} +43 -43
  19. package/dist/tinycolor/customize/index.js +1 -1
  20. package/hooks/index.js +50 -52
  21. package/index.js +674 -680
  22. package/package.json +1 -1
  23. package/rate/index.js +1 -1
  24. package/slider/index.js +1 -1
  25. package/slider/util.js +1 -1
  26. package/style.css +1 -1
  27. package/table/Table.js +145 -145
  28. package/tag/index.js +24 -24
  29. package/tooltip/index.js +1 -1
  30. package/types/common/utils/math.d.ts +1 -1
  31. package/types/pc/alert/interface.d.ts +2 -2
  32. package/types/pc/badge/interface.d.ts +1 -1
  33. package/types/pc/details/interface.d.ts +2 -2
  34. package/types/pc/hooks/index.d.ts +0 -1
  35. package/types/pc/menu/context.d.ts +1 -1
  36. package/types/pc/utils/math.d.ts +1 -1
  37. package/typography/Ellipsis.js +1 -1
  38. package/utils/color.js +1 -1
  39. package/utils/index.js +174 -178
  40. package/utils/math.js +7 -11
  41. package/utils/tinycolor.js +1 -1
  42. package/version/index.js +1 -1
  43. package/components/common/hooks/useComputedState.js +0 -11
  44. package/hooks/useComputedState.js +0 -4
  45. package/types/common/hooks/useComputedState.d.ts +0 -4
  46. package/types/pc/hooks/useComputedState.d.ts +0 -1
package/Tooltip.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import "./dist/tinycolor/chunk/DGZSWe7E.js";
2
+ import "./dist/tinycolor/chunk/BOzCVdr0.js";
3
3
  import "./dist/tinycolor/src/index.js";
4
4
  import "lodash/isFunction";
5
5
  import "react";
package/alert/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { jsx as e, jsxs as f } from "react/jsx-runtime";
2
- import k from "@unicom-cloud/icons/IconUiCheckCircleFill";
3
- import P from "@unicom-cloud/icons/IconUiClose";
4
- import R from "@unicom-cloud/icons/IconUiCloseCircleFill";
5
- import T from "@unicom-cloud/icons/IconUiExclamationCircleFill";
6
- import _ from "@unicom-cloud/icons/IconUiInfoCircleFill";
1
+ import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
+ import P from "@unicom-cloud/icons/IconUiCheckCircleFill";
3
+ import R from "@unicom-cloud/icons/IconUiClose";
4
+ import T from "@unicom-cloud/icons/IconUiCloseCircleFill";
5
+ import _ from "@unicom-cloud/icons/IconUiExclamationCircleFill";
6
+ import f from "@unicom-cloud/icons/IconUiInfoCircleFill";
7
7
  import { forwardRef as g, useRef as q, useContext as z, useState as H } from "react";
8
8
  import "../config-provider/ConfigProvider.js";
9
9
  import M from "../components/common/hooks/useMergeProps.js";
@@ -12,81 +12,82 @@ import { PqbCSSTransition as V } from "../components/common/utils/PqbCSSTransiti
12
12
  import B from "../config-provider/context.js";
13
13
  const D = {
14
14
  showIcon: !0,
15
- type: "info"
15
+ type: "default"
16
16
  };
17
- function G(d, r) {
17
+ function G(u, r) {
18
18
  r || (r = q());
19
- const { getPrefixCls: t, componentConfig: n, rtl: u } = z(B), c = M(
20
- d,
19
+ const { getPrefixCls: t, componentConfig: l, rtl: N } = z(B), c = M(
20
+ u,
21
21
  D,
22
- n == null ? void 0 : n.Alert
22
+ l == null ? void 0 : l.Alert
23
23
  ), {
24
- style: N,
25
- className: b,
24
+ style: b,
25
+ className: h,
26
26
  action: a,
27
- type: m = "info",
28
- title: i,
27
+ type: m,
28
+ title: n,
29
29
  content: p,
30
- icon: h,
31
- showIcon: $,
32
- closable: C,
33
- closeable: I,
34
- afterClose: s,
35
- onClose: l,
36
- closeElement: x,
37
- banner: v,
38
- ...w
39
- } = c, o = t == null ? void 0 : t("alert"), [y, U] = H(!0), A = h || {
40
- info: /* @__PURE__ */ e(_, {}),
41
- success: /* @__PURE__ */ e(k, {}),
42
- warning: /* @__PURE__ */ e(T, {}),
43
- error: /* @__PURE__ */ e(R, {})
30
+ icon: $,
31
+ showIcon: C,
32
+ closable: I,
33
+ closeable: x,
34
+ afterClose: i,
35
+ onClose: s,
36
+ closeElement: v,
37
+ banner: w,
38
+ ...y
39
+ } = c, o = t == null ? void 0 : t("alert"), [U, A] = H(!0), E = $ || {
40
+ default: /* @__PURE__ */ e(f, {}),
41
+ info: /* @__PURE__ */ e(f, {}),
42
+ success: /* @__PURE__ */ e(P, {}),
43
+ warning: /* @__PURE__ */ e(_, {}),
44
+ error: /* @__PURE__ */ e(T, {})
44
45
  }[m];
45
- function E(j) {
46
- U(!1), l == null || l(j);
46
+ function F(k) {
47
+ A(!1), s == null || s(k);
47
48
  }
48
- const F = O(
49
+ const S = O(
49
50
  o,
50
51
  `${o}-${m}`,
51
52
  {
52
- [`${o}-with-title`]: i,
53
- [`${o}-banner`]: v,
54
- [`${o}-rtl`]: u
53
+ [`${o}-with-title`]: n,
54
+ [`${o}-banner`]: w,
55
+ [`${o}-rtl`]: N
55
56
  },
56
- b
57
- ), S = "closeable" in c ? I : C;
57
+ h
58
+ ), j = "closeable" in c ? x : I;
58
59
  return /* @__PURE__ */ e(
59
60
  V,
60
61
  {
61
- in: y,
62
+ in: U,
62
63
  timeout: 300,
63
64
  classNames: "zoomInTop",
64
65
  unmountOnExit: !0,
65
66
  onExited: () => {
66
- s == null || s();
67
+ i == null || i();
67
68
  },
68
- children: /* @__PURE__ */ f(
69
+ children: /* @__PURE__ */ d(
69
70
  "div",
70
71
  {
71
72
  ref: r,
72
- style: N,
73
- className: F,
73
+ style: b,
74
+ className: S,
74
75
  role: "alert",
75
- ...w,
76
+ ...y,
76
77
  children: [
77
- $ && /* @__PURE__ */ e("div", { className: `${o}-icon-wrapper`, children: A }),
78
- /* @__PURE__ */ f("div", { className: `${o}-content-wrapper`, children: [
79
- i && /* @__PURE__ */ e("div", { className: `${o}-title`, children: i }),
78
+ C && /* @__PURE__ */ e("div", { className: `${o}-icon-wrapper`, children: E }),
79
+ /* @__PURE__ */ d("div", { className: `${o}-content-wrapper`, children: [
80
+ n && /* @__PURE__ */ e("div", { className: `${o}-title`, children: n }),
80
81
  p && /* @__PURE__ */ e("div", { className: `${o}-content`, children: p })
81
82
  ] }),
82
83
  a && /* @__PURE__ */ e("div", { className: `${o}-action`, children: a }),
83
- S && /* @__PURE__ */ e(
84
+ j && /* @__PURE__ */ e(
84
85
  "button",
85
86
  {
86
87
  type: "button",
87
- onClick: E,
88
+ onClick: F,
88
89
  className: `${o}-close-btn`,
89
- children: x || /* @__PURE__ */ e(P, {})
90
+ children: v || /* @__PURE__ */ e(R, {})
90
91
  }
91
92
  )
92
93
  ]
package/badge/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { jsxs as x, jsx as s } from "react/jsx-runtime";
2
2
  import R from "lodash/isPlainObject";
3
- import { forwardRef as q, useContext as G } from "react";
3
+ import { forwardRef as G, useContext as _ } from "react";
4
4
  import "../config-provider/ConfigProvider.js";
5
- import _ from "../components/common/hooks/useMergeProps.js";
6
- import { PqbCSSTransition as k } from "../components/common/utils/PqbCSSTransition.js";
5
+ import k from "../components/common/hooks/useMergeProps.js";
6
+ import { PqbCSSTransition as q } from "../components/common/utils/PqbCSSTransition.js";
7
7
  import a from "@unicom-cloud/utils/class-name";
8
8
  import y from "./Count.js";
9
9
  import z from "../config-provider/context.js";
@@ -15,7 +15,7 @@ const N = [
15
15
  "lime",
16
16
  "green",
17
17
  "cyan",
18
- "pqbblue",
18
+ "primary",
19
19
  "purple",
20
20
  "magenta",
21
21
  "gray"
@@ -23,9 +23,9 @@ const N = [
23
23
  count: 0,
24
24
  maxCount: 99
25
25
  };
26
- function L(b, h) {
27
- const { getPrefixCls: c, componentConfig: i, rtl: S } = G(z), O = _(
28
- b,
26
+ function L(h, S) {
27
+ const { getPrefixCls: c, componentConfig: i, rtl: b } = _(z), O = k(
28
+ h,
29
29
  I,
30
30
  i == null ? void 0 : i.Badge
31
31
  ), {
@@ -83,7 +83,7 @@ function L(b, h) {
83
83
  ),
84
84
  !!m && /* @__PURE__ */ s("span", { className: `${t}-status-text`, children: m })
85
85
  ] }) : (d || e) && typeof o == "number" && o > 0 ? /* @__PURE__ */ s(
86
- k,
86
+ q,
87
87
  {
88
88
  classNames: "badge-zoom",
89
89
  in: d || !!e,
@@ -124,11 +124,11 @@ function L(b, h) {
124
124
  {
125
125
  [`${t}-status`]: l,
126
126
  [`${t}-no-children`]: !f,
127
- [`${t}-rtl`]: S
127
+ [`${t}-rtl`]: b
128
128
  },
129
129
  B
130
130
  ),
131
- ref: h,
131
+ ref: S,
132
132
  style: P,
133
133
  ...j,
134
134
  children: [
@@ -138,7 +138,7 @@ function L(b, h) {
138
138
  }
139
139
  );
140
140
  }
141
- const C = q(L);
141
+ const C = G(L);
142
142
  C.displayName = "Badge";
143
143
  C.Count = y;
144
144
  const W = N, X = ["default", "processing", "success", "warning", "error"];
@@ -1,5 +1,5 @@
1
1
  import { jsxs as v, jsx as c } from "react/jsx-runtime";
2
- import "../dist/tinycolor/chunk/DGZSWe7E.js";
2
+ import "../dist/tinycolor/chunk/BOzCVdr0.js";
3
3
  import { TinyColor as u } from "../dist/tinycolor/src/index.js";
4
4
  import { useContext as I, useState as j, useEffect as D } from "react";
5
5
  import "../config-provider/ConfigProvider.js";
@@ -1,5 +1,5 @@
1
1
  import { jsxs as l, jsx as n } from "react/jsx-runtime";
2
- import "../dist/tinycolor/chunk/DGZSWe7E.js";
2
+ import "../dist/tinycolor/chunk/BOzCVdr0.js";
3
3
  import { TinyColor as f } from "../dist/tinycolor/src/index.js";
4
4
  import { useContext as x } from "react";
5
5
  import "../config-provider/ConfigProvider.js";
@@ -1,5 +1,5 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
- import "../dist/tinycolor/chunk/DGZSWe7E.js";
2
+ import "../dist/tinycolor/chunk/BOzCVdr0.js";
3
3
  import { TinyColor as d } from "../dist/tinycolor/src/index.js";
4
4
  import { useContext as h, useMemo as C } from "react";
5
5
  import "../config-provider/ConfigProvider.js";
@@ -1,5 +1,5 @@
1
1
  import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
- import "../dist/tinycolor/chunk/DGZSWe7E.js";
2
+ import "../dist/tinycolor/chunk/BOzCVdr0.js";
3
3
  import { TinyColor as m } from "../dist/tinycolor/src/index.js";
4
4
  import { useContext as ar, useState as lr, useMemo as sr } from "react";
5
5
  import "../config-provider/ConfigProvider.js";
@@ -1,4 +1,4 @@
1
- import { a as e } from "../dist/tinycolor/chunk/DGZSWe7E.js";
1
+ import { a as e } from "../dist/tinycolor/chunk/BOzCVdr0.js";
2
2
  import { TinyColor as l } from "../dist/tinycolor/src/index.js";
3
3
  new l("#eee");
4
4
  const i = [
@@ -1,4 +1,4 @@
1
- import "../../dist/tinycolor/chunk/DGZSWe7E.js";
1
+ import "../../dist/tinycolor/chunk/BOzCVdr0.js";
2
2
  import { TinyColor as F } from "../../dist/tinycolor/src/index.js";
3
3
  import { useState as v, useRef as q, useMemo as M, useCallback as E, useEffect as y } from "react";
4
4
  import w from "../../components/common/hooks/useIsFirstRender.js";
@@ -1,4 +1,4 @@
1
- import "../dist/tinycolor/chunk/DGZSWe7E.js";
1
+ import "../dist/tinycolor/chunk/BOzCVdr0.js";
2
2
  import { TinyColor as s } from "../dist/tinycolor/src/index.js";
3
3
  const G = (t) => t.sort((r, n) => r.percent - n.percent), H = (t, r, n) => Object.keys(t).reduce(
4
4
  (e, o) => ({
@@ -1,17 +1,37 @@
1
- import { jsx as s, jsxs as f } from "react/jsx-runtime";
2
- import N from "@unicom-cloud/icons/IconUiEmpty";
1
+ import { jsxs as N, jsx as t } from "react/jsx-runtime";
2
+ import $ from "@unicom-cloud/icons/IconUiEmpty";
3
3
  import { UI_COMMON_PREFIX as y } from "@unicom-cloud/utils/constant/ui";
4
- import { memo as x, forwardRef as $ } from "react";
5
- import g from "@unicom-cloud/utils/class-name";
6
- function h(i, t) {
7
- const { style: o, className: a, description: m, icon: c, imgSrc: r, prefixCls: p, ...n } = i, e = p ?? `${y}-empty`, l = g(e, a), d = typeof m == "string" ? m : "empty";
8
- return /* @__PURE__ */ s("div", { ref: t, className: l, style: o, ...n, children: /* @__PURE__ */ f("div", { className: `${e}-wrapper`, children: [
9
- /* @__PURE__ */ s("div", { className: `${e}-image`, children: r ? /* @__PURE__ */ s("img", { alt: d, src: r }) : c || /* @__PURE__ */ s(N, {}) }),
10
- /* @__PURE__ */ s("div", { className: `${e}-description`, children: m || "无数据" })
11
- ] }) });
4
+ import { memo as g, forwardRef as x } from "react";
5
+ import { SpaceVertical as u } from "../space/index.js";
6
+ import s from "@unicom-cloud/utils/class-name";
7
+ function C(c, n) {
8
+ const { style: a, className: p, description: m, icon: o, imgSrc: r, prefixCls: l, ...f } = c, e = `${y}-empty`, i = l ?? e, d = typeof m == "string" ? m : "empty";
9
+ return /* @__PURE__ */ N(
10
+ u,
11
+ {
12
+ ref: n,
13
+ className: s(e, i, p),
14
+ style: a,
15
+ justifyContent: "center",
16
+ alignItems: "center",
17
+ gap: 5,
18
+ ...f,
19
+ children: [
20
+ r ? /* @__PURE__ */ t(
21
+ "img",
22
+ {
23
+ className: s(`${e}-img`, `${i}-img`),
24
+ alt: d,
25
+ src: r
26
+ }
27
+ ) : o ? /* @__PURE__ */ t("div", { className: s(`${e}-icon`, `${i}-icon`), children: o }) : /* @__PURE__ */ t($, { className: s(`${e}-icon`, `${i}-icon`) }),
28
+ /* @__PURE__ */ t("div", { className: s(`${e}-description`, `${i}-description`), children: m || "无数据" })
29
+ ]
30
+ }
31
+ );
12
32
  }
13
- const v = x($(h));
14
- v.displayName = "Empty";
33
+ const E = g(x(C));
34
+ E.displayName = "Empty";
15
35
  export {
16
- v as default
36
+ E as default
17
37
  };
@@ -1,7 +1,11 @@
1
1
  import { useReducer as r } from "react";
2
2
  function c() {
3
- const [n, e] = r((t) => (t + 1) % 27, 0);
4
- return e;
3
+ const [n, t] = r(
4
+ (e) => (e + 1) % 27,
5
+ 0,
6
+ (e) => e
7
+ );
8
+ return t;
5
9
  }
6
10
  export {
7
11
  c as default
@@ -1,11 +1,11 @@
1
- import { useState as e, useEffect as u } from "react";
2
- const n = {};
3
- function d(t) {
4
- const [o, s] = e();
5
- return u(() => {
6
- n[t] = t in n ? n[t] : 0, s(n[t]), n[t] += 1;
7
- }, []), typeof o == "number" ? `${t}${o}` : void 0;
1
+ import { useState as d, useEffect as n } from "react";
2
+ const o = {};
3
+ function e(t) {
4
+ const [u, s] = d();
5
+ return n(() => {
6
+ o[t] ?? (o[t] = 0), s(o[t]), o[t] += 1;
7
+ }, []), typeof u == "number" ? `${t}${u}` : void 0;
8
8
  }
9
9
  export {
10
- d as default
10
+ e as default
11
11
  };
@@ -3,7 +3,7 @@ import { UI_COMMON_PREFIX as C } from "@unicom-cloud/utils/constant/ui";
3
3
  import { forwardRef as c } from "react";
4
4
  import "@unicom-cloud/utils/case-name";
5
5
  import _ from "@unicom-cloud/utils/class-name";
6
- import "../../../dist/tinycolor/chunk/DGZSWe7E.js";
6
+ import "../../../dist/tinycolor/chunk/BOzCVdr0.js";
7
7
  import "@unicom-cloud/utils/clipboard-copy";
8
8
  import "../utils/dayjs.js";
9
9
  import "../utils/dom.js";
@@ -1,30 +1,30 @@
1
- import { a as e } from "../../../dist/tinycolor/chunk/DGZSWe7E.js";
2
- import { TinyColor as c } from "../../../dist/tinycolor/src/index.js";
3
- import { UI_PC_PREFIX as u } from "@unicom-cloud/utils/constant/ui";
4
- import { CSS_VARIABLE_ELEMENT as y } from "./constant.js";
5
- function g(m) {
1
+ import { a as o } from "../../../dist/tinycolor/chunk/BOzCVdr0.js";
2
+ import { TinyColor as y } from "../../../dist/tinycolor/src/index.js";
3
+ import { UI_PC_PREFIX as c } from "@unicom-cloud/utils/constant/ui";
4
+ import { CSS_VARIABLE_ELEMENT as E } from "./constant.js";
5
+ function v(l) {
6
6
  const {
7
- color: o,
8
- element: t = y,
7
+ color: e,
8
+ element: a = E,
9
9
  isDark: f = !1,
10
- prefix: a = u
11
- } = m ?? {}, l = {
12
- color: o
13
- }, n = f ? e.generateDark(l) : e.generate(l);
14
- new c(o).equals(e.pqbblue.value) ? s() : n.forEach((i, r, p) => {
15
- t.style.setProperty(
16
- `--${a}-pqbblue-${r + 1}`,
17
- i.toRgbArrayString()
10
+ prefix: t = c
11
+ } = l ?? {}, i = {
12
+ color: e
13
+ }, m = f ? o.generateDark(i) : o.generate(i);
14
+ new y(e).equals(o.primary.value) ? n() : m.forEach((s, r, p) => {
15
+ a.style.setProperty(
16
+ `--${t}-primary-${r + 1}`,
17
+ s.toRgbArrayString()
18
18
  );
19
19
  });
20
- function s() {
21
- n.forEach((i, r, p) => {
22
- t.style.removeProperty(`--${a}-pqbblue-${r + 1}`);
20
+ function n() {
21
+ m.forEach((s, r, p) => {
22
+ a.style.removeProperty(`--${t}-primary-${r + 1}`);
23
23
  });
24
24
  }
25
- return s;
25
+ return n;
26
26
  }
27
27
  export {
28
- g as default,
29
- g as setPrimaryColor
28
+ v as default,
29
+ v as setPrimaryColor
30
30
  };
@@ -1,15 +1,15 @@
1
1
  import { UI_PC_PREFIX as f } from "@unicom-cloud/utils/constant/ui.js";
2
2
  import p from "lodash/isPlainObject";
3
3
  import { CSS_VARIABLE_ELEMENT as $ } from "./constant.js";
4
- import "../../../dist/tinycolor/chunk/DGZSWe7E.js";
5
- import { TinyColor as a } from "../../../dist/tinycolor/src/index.js";
6
- function P(l) {
7
- if (!p(l)) return;
8
- const { prefix: e = f, ...n } = l, s = {
4
+ import "../../../dist/tinycolor/chunk/BOzCVdr0.js";
5
+ import { TinyColor as n } from "../../../dist/tinycolor/src/index.js";
6
+ function b(s) {
7
+ if (!p(s)) return;
8
+ const { prefix: e = f, ...i } = s, c = {
9
9
  primary: {
10
- default: `--${e}-pqbblue-6`,
11
- hover: `--${e}-pqbblue-5`,
12
- active: `--${e}-pqbblue-7`
10
+ default: `--${e}-primary-6`,
11
+ hover: `--${e}-primary-5`,
12
+ active: `--${e}-primary-7`
13
13
  },
14
14
  success: {
15
15
  default: `--${e}-green-6`,
@@ -17,9 +17,9 @@ function P(l) {
17
17
  active: `--${e}-green-7`
18
18
  },
19
19
  info: {
20
- default: `--${e}-pqbblue-6`,
21
- hover: `--${e}-pqbblue-5`,
22
- active: `--${e}-pqbblue-7`
20
+ default: `--${e}-primary-6`,
21
+ hover: `--${e}-primary-5`,
22
+ active: `--${e}-primary-7`
23
23
  },
24
24
  // warning: {
25
25
  // default: `--${prefix}-orangered-6`,
@@ -37,19 +37,19 @@ function P(l) {
37
37
  active: `--${e}-red-7`
38
38
  }
39
39
  };
40
- Object.entries(s).forEach(([o, r], u, y) => {
41
- s[`${o}Color`] = r;
42
- const c = n[o];
43
- if (!c) return;
44
- const i = new a(c), t = $;
45
- t.style.setProperty(r.default, i.toRgbArrayString());
46
- const g = n[`${o}Hover`];
47
- g ? t.style.setProperty(r.hover, new a(g).toRgbArrayString()) : t.style.setProperty(r.hover, i.lighten(10).toRgbArrayString());
48
- const b = n[`${o}Active`];
49
- b ? t.style.setProperty(r.active, new a(b).toRgbArrayString()) : t.style.setProperty(r.active, i.lighten(-10).toRgbArrayString());
40
+ Object.entries(c).forEach(([o, r], m, h) => {
41
+ c[`${o}Color`] = r;
42
+ const l = i[o];
43
+ if (!l) return;
44
+ const a = new n(l), t = $;
45
+ t.style.setProperty(r.default, a.toRgbArrayString());
46
+ const y = i[`${o}Hover`];
47
+ y ? t.style.setProperty(r.hover, new n(y).toRgbArrayString()) : t.style.setProperty(r.hover, a.lighten(10).toRgbArrayString());
48
+ const g = i[`${o}Active`];
49
+ g ? t.style.setProperty(r.active, new n(g).toRgbArrayString()) : t.style.setProperty(r.active, a.lighten(-10).toRgbArrayString());
50
50
  });
51
51
  }
52
52
  export {
53
- P as default,
54
- P as setTheme
53
+ b as default,
54
+ b as setTheme
55
55
  };
package/details/index.js CHANGED
@@ -1,71 +1,72 @@
1
1
  import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
- import F from "@unicom-cloud/icons/IconUiCheckCircleFill";
3
- import b from "@unicom-cloud/icons/IconUiCloseCircleFill";
4
- import j from "@unicom-cloud/icons/IconUiDown";
5
- import S from "@unicom-cloud/icons/IconUiExclamationCircleFill";
6
- import k from "@unicom-cloud/icons/IconUiInfoCircleFill";
2
+ import b from "@unicom-cloud/icons/IconUiCheckCircleFill";
3
+ import j from "@unicom-cloud/icons/IconUiCloseCircleFill";
4
+ import S from "@unicom-cloud/icons/IconUiDown";
5
+ import k from "@unicom-cloud/icons/IconUiExclamationCircleFill";
6
+ import d from "@unicom-cloud/icons/IconUiInfoCircleFill";
7
7
  import { forwardRef as E, useContext as M, useState as P } from "react";
8
8
  import "../config-provider/ConfigProvider.js";
9
9
  import R from "../components/common/hooks/useMergeProps.js";
10
- import d from "@unicom-cloud/utils/class-name";
10
+ import u from "@unicom-cloud/utils/class-name";
11
11
  import T from "../config-provider/context.js";
12
12
  const _ = {
13
- type: "info"
13
+ type: "default"
14
14
  };
15
15
  function q(N, $) {
16
- const { getPrefixCls: t, componentConfig: s, rtl: u } = M(T), C = R(
16
+ const { getPrefixCls: t, componentConfig: s, rtl: C } = M(T), h = R(
17
17
  N,
18
18
  _,
19
19
  s == null ? void 0 : s.Details
20
20
  ), {
21
- style: h,
22
- className: x,
23
- type: r = "info",
21
+ style: x,
22
+ className: y,
23
+ type: r,
24
24
  title: i,
25
25
  content: n,
26
- icon: y,
27
- banner: I,
28
- ...g
29
- } = C, e = t == null ? void 0 : t("details"), [w, D] = P({}), l = y || {
30
- info: /* @__PURE__ */ o(k, {}),
31
- success: /* @__PURE__ */ o(F, {}),
32
- warning: /* @__PURE__ */ o(S, {}),
33
- error: /* @__PURE__ */ o(b, {})
34
- }[r], U = d(
26
+ icon: I,
27
+ banner: g,
28
+ ...w
29
+ } = h, e = t == null ? void 0 : t("details"), [D, U] = P({}), l = I || {
30
+ default: /* @__PURE__ */ o(d, {}),
31
+ info: /* @__PURE__ */ o(d, {}),
32
+ success: /* @__PURE__ */ o(b, {}),
33
+ warning: /* @__PURE__ */ o(k, {}),
34
+ error: /* @__PURE__ */ o(j, {})
35
+ }[r], v = u(
35
36
  e,
36
37
  `${e}-${r}`,
37
38
  {
38
- [`${e}-banner`]: I,
39
- [`${e}-rtl`]: u
39
+ [`${e}-banner`]: g,
40
+ [`${e}-rtl`]: C
40
41
  },
41
- x
42
+ y
42
43
  );
43
44
  return /* @__PURE__ */ f(
44
45
  "details",
45
46
  {
46
47
  ref: $,
47
- style: h,
48
- className: U,
48
+ style: x,
49
+ className: v,
49
50
  role: "details",
50
51
  onToggle: (a) => {
51
52
  var c;
52
- (c = a.target) != null && c.open, D((v) => {
53
+ (c = a.target) != null && c.open, U((F) => {
53
54
  var p;
54
- const m = { ...v };
55
+ const m = { ...F };
55
56
  return m.open = (p = a.target) == null ? void 0 : p.open, m;
56
57
  });
57
58
  },
58
- ...g,
59
+ ...w,
59
60
  children: [
60
61
  /* @__PURE__ */ f("summary", { className: `${e}-summary-wrapper`, children: [
61
62
  l && /* @__PURE__ */ o("div", { className: `${e}-icon`, children: l }),
62
63
  i && /* @__PURE__ */ o("div", { className: `${e}-title`, children: i }),
63
64
  /* @__PURE__ */ o(
64
- j,
65
+ S,
65
66
  {
66
- className: d(
67
+ className: u(
67
68
  `${e}-collapse-icon`,
68
- w.open && `${e}-collapse-icon-open`
69
+ D.open && `${e}-collapse-icon-open`
69
70
  )
70
71
  }
71
72
  )