highsoft-ui 1.0.89 → 1.0.90
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,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as s, jsxs as l, Fragment as w } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d, useEffect as C } from "react";
|
|
3
3
|
import { X as F } from "../../XClose-CCu1vrNS.js";
|
|
4
4
|
import { c as m } from "../../clsx-OuTLNxxd.js";
|
|
5
5
|
import { Button as y } from "../Button/index.js";
|
|
@@ -24,36 +24,36 @@ const E = "MhRkRW_active", j = "MhRkRW_attention", H = "MhRkRW_carousel", L = "M
|
|
|
24
24
|
function et({
|
|
25
25
|
id: v,
|
|
26
26
|
content: c,
|
|
27
|
-
variant:
|
|
27
|
+
variant: r = "brand",
|
|
28
28
|
closable: M = !0,
|
|
29
29
|
onClose: g
|
|
30
30
|
}) {
|
|
31
|
-
const n = Array.isArray(c) ? c : [c], [h, k] =
|
|
31
|
+
const n = Array.isArray(c) ? c : [c], [h, k] = d(
|
|
32
32
|
() => n.length > 1 ? Math.floor(Math.random() * n.length) : 0
|
|
33
|
-
), [W, u] =
|
|
33
|
+
), [W, u] = d(!1), [_, f] = d(!1), R = W || _, i = n[h]?.url, N = i ? "a" : "div";
|
|
34
34
|
C(() => {
|
|
35
35
|
if (n.length <= 1 || R) return;
|
|
36
36
|
const t = window.setInterval(() => {
|
|
37
|
-
k((
|
|
37
|
+
k((o) => (o + 1) % n.length);
|
|
38
38
|
}, 15e3);
|
|
39
39
|
return () => window.clearInterval(t);
|
|
40
40
|
}, [n.length, R]);
|
|
41
41
|
const x = () => u(!0), I = (t) => {
|
|
42
42
|
t.currentTarget.contains(t.relatedTarget) || u(!1);
|
|
43
|
-
},
|
|
44
|
-
const
|
|
45
|
-
t.title && /* @__PURE__ */
|
|
46
|
-
t.tag === "new" && /* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
43
|
+
}, b = () => f(!0), T = () => f(!1), p = (t, o = !0) => {
|
|
44
|
+
const a = /* @__PURE__ */ l(w, { children: [
|
|
45
|
+
t.title && /* @__PURE__ */ l("span", { className: e.title, children: [
|
|
46
|
+
t.tag === "new" && /* @__PURE__ */ s(B, { variant: r, icon: !1 }),
|
|
47
|
+
/* @__PURE__ */ s("span", { className: e.titleText, children: t.title })
|
|
48
48
|
] }),
|
|
49
|
-
t.description && /* @__PURE__ */
|
|
49
|
+
t.description && /* @__PURE__ */ s("span", { className: e.description, children: t.description })
|
|
50
50
|
] });
|
|
51
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ s("div", { className: e.content, "aria-hidden": !o, children: a });
|
|
52
52
|
};
|
|
53
|
-
return n.length ? /* @__PURE__ */
|
|
53
|
+
return n.length ? /* @__PURE__ */ s(
|
|
54
54
|
N,
|
|
55
55
|
{
|
|
56
|
-
className: m(e.notification, e[
|
|
56
|
+
className: m(e.notification, e[r]),
|
|
57
57
|
"data-theme": "light",
|
|
58
58
|
...i ? {
|
|
59
59
|
href: i,
|
|
@@ -63,32 +63,32 @@ function et({
|
|
|
63
63
|
} : {},
|
|
64
64
|
onFocus: x,
|
|
65
65
|
onBlur: I,
|
|
66
|
-
onMouseEnter:
|
|
67
|
-
onMouseLeave:
|
|
68
|
-
children: /* @__PURE__ */
|
|
69
|
-
n.length > 1 ? /* @__PURE__ */
|
|
70
|
-
const
|
|
71
|
-
return /* @__PURE__ */
|
|
66
|
+
onMouseEnter: b,
|
|
67
|
+
onMouseLeave: T,
|
|
68
|
+
children: /* @__PURE__ */ l(A, { className: e.container, children: [
|
|
69
|
+
n.length > 1 ? /* @__PURE__ */ s("div", { className: e.carousel, "aria-live": "polite", children: n.map((t, o) => {
|
|
70
|
+
const a = o === h;
|
|
71
|
+
return /* @__PURE__ */ s(
|
|
72
72
|
"div",
|
|
73
73
|
{
|
|
74
|
-
className: m(e.slide, { [e.active]:
|
|
75
|
-
"aria-hidden": !
|
|
76
|
-
children: p(t,
|
|
74
|
+
className: m(e.slide, { [e.active]: a }),
|
|
75
|
+
"aria-hidden": !a,
|
|
76
|
+
children: p(t, a)
|
|
77
77
|
},
|
|
78
|
-
`${t.title ?? t.description ?? "item"}-${
|
|
78
|
+
`${t.title ?? t.description ?? "item"}-${o}`
|
|
79
79
|
);
|
|
80
80
|
}) }) : p(n[0]),
|
|
81
|
-
M && /* @__PURE__ */
|
|
81
|
+
M && /* @__PURE__ */ s(
|
|
82
82
|
y,
|
|
83
83
|
{
|
|
84
|
-
variant:
|
|
84
|
+
variant: r === "brand" ? "brand" : "transparent",
|
|
85
85
|
size: 100,
|
|
86
86
|
className: e.close,
|
|
87
87
|
"aria-label": "Close notification",
|
|
88
88
|
onClick: (t) => {
|
|
89
89
|
t.preventDefault(), t.stopPropagation(), g?.();
|
|
90
90
|
},
|
|
91
|
-
children: /* @__PURE__ */
|
|
91
|
+
children: /* @__PURE__ */ s(F, {})
|
|
92
92
|
}
|
|
93
93
|
)
|
|
94
94
|
] })
|