highsoft-ui 1.0.84 → 1.0.86
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.
- package/dist/components/Header/index.d.ts +2 -3
- package/dist/components/Header/index.js +158 -140
- package/dist/components/Notification/index.d.ts +8 -5
- package/dist/components/Notification/index.js +62 -32
- package/dist/highsoft-ui.css +1 -1
- package/dist/scss/variables.scss +1 -1
- package/package.json +1 -1
|
@@ -1,50 +1,80 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "react";
|
|
3
|
-
import { X as
|
|
4
|
-
import { c as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Container as
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as i, jsxs as l, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p, useEffect as v } from "react";
|
|
3
|
+
import { X as M } from "../../XClose-CCu1vrNS.js";
|
|
4
|
+
import { c as d } from "../../clsx-OuTLNxxd.js";
|
|
5
|
+
import { Button as k } from "../Button/index.js";
|
|
6
|
+
import { Container as W } from "../Container/index.js";
|
|
7
|
+
const _ = "MhRkRW_active", g = "MhRkRW_attention", N = "MhRkRW_carousel", x = "MhRkRW_close", C = "MhRkRW_container", w = "MhRkRW_content", y = "MhRkRW_danger", A = "MhRkRW_description", I = "MhRkRW_notification", b = "MhRkRW_slide", j = "MhRkRW_success", X = "MhRkRW_title", e = {
|
|
8
|
+
active: _,
|
|
9
|
+
attention: g,
|
|
10
|
+
carousel: N,
|
|
11
|
+
close: x,
|
|
12
|
+
container: C,
|
|
13
|
+
content: w,
|
|
14
|
+
danger: y,
|
|
12
15
|
default: "MhRkRW_default",
|
|
13
|
-
description:
|
|
14
|
-
notification:
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
description: A,
|
|
17
|
+
notification: I,
|
|
18
|
+
slide: b,
|
|
19
|
+
success: j,
|
|
20
|
+
title: X
|
|
17
21
|
};
|
|
18
|
-
function
|
|
19
|
-
|
|
22
|
+
function q({
|
|
23
|
+
content: c,
|
|
20
24
|
variant: o = "default",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
onClose: c
|
|
25
|
+
closable: h = !0,
|
|
26
|
+
onClose: R
|
|
24
27
|
}) {
|
|
25
|
-
|
|
28
|
+
const n = Array.isArray(c) ? c : [c], [u, f] = p(
|
|
29
|
+
() => n.length > 1 ? Math.floor(Math.random() * n.length) : 0
|
|
30
|
+
);
|
|
31
|
+
v(() => {
|
|
32
|
+
if (n.length <= 1) return;
|
|
33
|
+
const t = window.setInterval(() => {
|
|
34
|
+
f((s) => (s + 1) % n.length);
|
|
35
|
+
}, 15e3);
|
|
36
|
+
return () => window.clearInterval(t);
|
|
37
|
+
}, [n.length]);
|
|
38
|
+
const a = (t) => {
|
|
39
|
+
const s = /* @__PURE__ */ l(m, { children: [
|
|
40
|
+
t.title && /* @__PURE__ */ i("span", { className: e.title, children: t.title }),
|
|
41
|
+
t.description && /* @__PURE__ */ i("span", { className: e.description, children: t.description })
|
|
42
|
+
] });
|
|
43
|
+
return t.url ? /* @__PURE__ */ i("a", { href: t.url, className: e.content, children: s }) : /* @__PURE__ */ i("div", { className: e.content, children: s });
|
|
44
|
+
};
|
|
45
|
+
return n.length ? /* @__PURE__ */ i(
|
|
26
46
|
"div",
|
|
27
47
|
{
|
|
28
|
-
className:
|
|
48
|
+
className: d(e.notification, e[o]),
|
|
29
49
|
"data-theme": "light",
|
|
30
|
-
children: /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
50
|
+
children: /* @__PURE__ */ l(W, { className: e.container, children: [
|
|
51
|
+
n.length > 1 ? /* @__PURE__ */ i("div", { className: e.carousel, "aria-live": "polite", children: n.map((t, s) => {
|
|
52
|
+
const r = s === u;
|
|
53
|
+
return /* @__PURE__ */ i(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: d(e.slide, { [e.active]: r }),
|
|
57
|
+
"aria-hidden": !r,
|
|
58
|
+
children: a(t)
|
|
59
|
+
},
|
|
60
|
+
`${t.title ?? t.description ?? "item"}-${s}`
|
|
61
|
+
);
|
|
62
|
+
}) }) : a(n[0]),
|
|
63
|
+
h && /* @__PURE__ */ i(
|
|
64
|
+
k,
|
|
35
65
|
{
|
|
36
66
|
variant: o === "default" ? "brand" : "transparent",
|
|
37
67
|
size: 100,
|
|
38
|
-
className:
|
|
68
|
+
className: e.close,
|
|
39
69
|
"aria-label": "Close notification",
|
|
40
|
-
onClick: () =>
|
|
41
|
-
children: /* @__PURE__ */
|
|
70
|
+
onClick: () => R?.(),
|
|
71
|
+
children: /* @__PURE__ */ i(M, {})
|
|
42
72
|
}
|
|
43
73
|
)
|
|
44
74
|
] })
|
|
45
75
|
}
|
|
46
|
-
);
|
|
76
|
+
) : null;
|
|
47
77
|
}
|
|
48
78
|
export {
|
|
49
|
-
|
|
79
|
+
q as Notification
|
|
50
80
|
};
|