highsoft-ui 1.0.102 → 1.0.104

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,11 +1,11 @@
1
1
  import { jsx as s, jsxs as l, Fragment as w } from "react/jsx-runtime";
2
2
  import { useState as d, useEffect as C } from "react";
3
3
  import { X as F } from "../../XClose-CCu1vrNS.js";
4
- import { c as m } from "../../clsx-OuTLNxxd.js";
4
+ import { c as p } from "../../clsx-OuTLNxxd.js";
5
5
  import { Button as y } from "../Button/index.js";
6
6
  import { Container as A } from "../Container/index.js";
7
7
  import { NewTag as B } from "../NewTag/index.js";
8
- const E = "MhRkRW_active", j = "MhRkRW_attention", H = "MhRkRW_brand", L = "MhRkRW_carousel", P = "MhRkRW_close", X = "MhRkRW_container", $ = "MhRkRW_content", z = "MhRkRW_danger", D = "MhRkRW_description", S = "MhRkRW_notification", U = "MhRkRW_slide", q = "MhRkRW_success", G = "MhRkRW_title", J = "MhRkRW_titleText", n = {
8
+ const E = "MhRkRW_active", j = "MhRkRW_attention", H = "MhRkRW_brand", L = "MhRkRW_carousel", P = "MhRkRW_close", X = "MhRkRW_container", $ = "MhRkRW_content", z = "MhRkRW_danger", D = "MhRkRW_description", S = "MhRkRW_notification", U = "MhRkRW_slide", q = "MhRkRW_success", G = "MhRkRW_title", J = "MhRkRW_titleText", e = {
9
9
  active: E,
10
10
  attention: j,
11
11
  brand: H,
@@ -22,72 +22,71 @@ const E = "MhRkRW_active", j = "MhRkRW_attention", H = "MhRkRW_brand", L = "MhRk
22
22
  titleText: J
23
23
  };
24
24
  function nt({
25
- id: g,
26
- content: c,
25
+ id: M,
26
+ content: i,
27
27
  variant: r = "brand",
28
- closable: v = !0,
29
- onClose: M
28
+ closable: g = !0,
29
+ onClose: k
30
30
  }) {
31
- const e = Array.isArray(c) ? c : [c], [h, k] = d(
32
- () => e.length > 1 ? Math.floor(Math.random() * e.length) : 0
33
- ), [W, u] = d(!1), [_, R] = d(!1), f = W || _, i = e[h]?.url, N = i ? "a" : "div";
31
+ const n = Array.isArray(i) ? i : [i], [h, v] = d(
32
+ () => n.length > 1 ? Math.floor(Math.random() * n.length) : 0
33
+ ), [W, u] = d(!1), [_, R] = d(!1), f = W || _, c = n[h]?.url, N = c ? "a" : "div";
34
34
  C(() => {
35
- if (e.length <= 1 || f) return;
35
+ if (n.length <= 1 || f) return;
36
36
  const t = window.setInterval(() => {
37
- k((o) => (o + 1) % e.length);
37
+ v((o) => (o + 1) % n.length);
38
38
  }, 15e3);
39
39
  return () => window.clearInterval(t);
40
- }, [e.length, f]);
40
+ }, [n.length, f]);
41
41
  const b = () => u(!0), x = (t) => {
42
42
  t.currentTarget.contains(t.relatedTarget) || u(!1);
43
- }, I = () => R(!0), T = () => R(!1), p = (t, o = !0) => {
43
+ }, I = () => R(!0), T = () => R(!1), m = (t, o = !0) => {
44
44
  const a = /* @__PURE__ */ l(w, { children: [
45
- t.title && /* @__PURE__ */ l("span", { className: n.title, children: [
45
+ t.title && /* @__PURE__ */ l("span", { className: e.title, children: [
46
46
  t.tag === "new" && /* @__PURE__ */ s(B, { variant: r, icon: !1 }),
47
- /* @__PURE__ */ s("span", { className: n.titleText, children: t.title })
47
+ /* @__PURE__ */ s("span", { className: e.titleText, children: t.title })
48
48
  ] }),
49
- t.description && /* @__PURE__ */ s("span", { className: n.description, children: t.description })
49
+ t.description && /* @__PURE__ */ s("span", { className: e.description, children: t.description })
50
50
  ] });
51
- return /* @__PURE__ */ s("div", { className: n.content, "aria-hidden": !o, children: a });
51
+ return /* @__PURE__ */ s("div", { className: e.content, "aria-hidden": !o, children: a });
52
52
  };
53
- return e.length ? /* @__PURE__ */ s(
53
+ return n.length ? /* @__PURE__ */ s(
54
54
  N,
55
55
  {
56
- className: m(n.notification, n[r]),
56
+ className: p(e.notification, e[r]),
57
57
  "data-theme": "light",
58
- ...i ? {
59
- href: i,
58
+ ...c ? {
59
+ href: c,
60
60
  "data-track": "header-banner",
61
61
  "data-track-action": "click",
62
- "data-track-label": g || i
62
+ "data-track-label": M || c
63
63
  } : {},
64
- ...e.length > 1 ? { "aria-live": "polite" } : {},
65
64
  onFocus: b,
66
65
  onBlur: x,
67
66
  onMouseEnter: I,
68
67
  onMouseLeave: T,
69
- children: /* @__PURE__ */ l(A, { className: n.container, children: [
70
- e.length > 1 ? /* @__PURE__ */ s("div", { className: n.carousel, children: e.map((t, o) => {
68
+ children: /* @__PURE__ */ l(A, { className: e.container, children: [
69
+ n.length > 1 ? /* @__PURE__ */ s("div", { className: e.carousel, children: n.map((t, o) => {
71
70
  const a = o === h;
72
71
  return /* @__PURE__ */ s(
73
72
  "div",
74
73
  {
75
- className: m(n.slide, { [n.active]: a }),
74
+ className: p(e.slide, { [e.active]: a }),
76
75
  "aria-hidden": !a,
77
- children: p(t, a)
76
+ children: m(t, a)
78
77
  },
79
78
  `${t.title ?? t.description ?? "item"}-${o}`
80
79
  );
81
- }) }) : p(e[0]),
82
- v && /* @__PURE__ */ s(
80
+ }) }) : m(n[0]),
81
+ g && /* @__PURE__ */ s(
83
82
  y,
84
83
  {
85
84
  variant: r === "brand" ? "brand" : "transparent",
86
85
  size: 100,
87
- className: n.close,
86
+ className: e.close,
88
87
  "aria-label": "Close notification",
89
88
  onClick: (t) => {
90
- t.preventDefault(), t.stopPropagation(), M?.();
89
+ t.preventDefault(), t.stopPropagation(), k?.();
91
90
  },
92
91
  children: /* @__PURE__ */ s(F, {})
93
92
  }
@@ -6,7 +6,7 @@ import { C as Ue } from "../../Check-Cm4roSEj.js";
6
6
  import { _ as yt } from "../../extends-hS2Bh-Yp.js";
7
7
  import { c as Ze } from "../../clsx-OuTLNxxd.js";
8
8
  import { Button as Je } from "../Button/index.js";
9
- import { h as Mt, P as ft, c as oe, u as bt, f as tn, e as en, b as nn, d as st, g as re, i as on, j as rn, R as sn, a as cn, k as an, F as ln, D as fn } from "../../index-CYz8LhDn.js";
9
+ import { h as Mt, P as ft, u as bt, c as oe, f as tn, e as en, b as nn, d as st, g as re, i as on, j as rn, R as sn, a as cn, k as an, F as ln, D as fn } from "../../index-CYz8LhDn.js";
10
10
  import * as un from "react-dom";
11
11
  var dn = function(e) {
12
12
  return /* @__PURE__ */ w("svg", yt({
@@ -1,8 +1,8 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { S as e } from "../../index-9MgBElwS.js";
3
+ import { S as e } from "../../index-Bxju7wvI.js";
4
4
  import "../Button/index.js";
5
- import "../../index-F_QKz-YL.js";
5
+ import "../../index-DThcOQDt.js";
6
6
  import "../../index-hYJmp-0x.js";
7
7
  export {
8
8
  e as Search