@cloudoperators/juno-messages-provider 0.2.33 → 0.2.34

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 (2) hide show
  1. package/build/index.js +74 -70
  2. package/package.json +3 -3
package/build/index.js CHANGED
@@ -21,7 +21,7 @@ const ao = (t) => `${t}-${(+/* @__PURE__ */ new Date() + Math.random()).toString
21
21
  t((e) => ({ ...e, messages: [] }));
22
22
  }
23
23
  }
24
- }), Ea = pe(void 0), Sv = ({ children: t }) => /* @__PURE__ */ q.createElement(Ea.Provider, { value: Ms(Os) }, t), Sa = (t) => {
24
+ }), Ea = pe(void 0), Mv = ({ children: t }) => /* @__PURE__ */ q.createElement(Ea.Provider, { value: Ms(Os) }, t), Sa = (t) => {
25
25
  const n = be(Ea);
26
26
  if (!n)
27
27
  throw new Error("StoreContext not provided");
@@ -8634,25 +8634,29 @@ const Lg = `
8634
8634
  jn:rounded
8635
8635
  jn:leading-5
8636
8636
  jn:overflow-hidden
8637
- jn:items-center
8637
+ jn:items-start
8638
8638
  `, Rg = `
8639
- jn:font-bold
8639
+ jn:mt-2
8640
+ jn:mb-2
8640
8641
  `, _g = `
8641
- jn:py-3
8642
- jn:pr-4
8643
- jn:ml-7
8642
+ jn:font-bold
8644
8643
  `, Hg = `
8644
+ jn:pt-2
8645
+ jn:pb-2.5
8646
+ jn:pr-4
8647
+ jn:ml-2.5
8648
+ `, zg = `
8645
8649
  jn:w-[4px]
8646
8650
  jn:self-stretch
8647
8651
  jn:border-l-4
8648
- jn:mr-6
8652
+ jn:mr-2.5
8649
8653
  jn:shrink-0
8650
- `, zg = `
8654
+ `, Vg = `
8651
8655
  jn:ml-auto
8652
8656
  jn:self-stretch
8653
8657
  jn:flex
8654
8658
  jn:flex-col
8655
- jn:py-2.5
8659
+ jn:py-2
8656
8660
  jn:pr-2.5
8657
8661
  `, Xe = {
8658
8662
  default: "jn:border-theme-message-default",
@@ -8665,7 +8669,7 @@ const Lg = `
8665
8669
  dangerBg: "jn:bg-theme-message-danger",
8666
8670
  success: "jn:border-theme-message-success",
8667
8671
  successBg: "jn:bg-theme-message-success"
8668
- }, Vg = (t) => {
8672
+ }, Wg = (t) => {
8669
8673
  switch (t) {
8670
8674
  case "error":
8671
8675
  return Xe.errorBg;
@@ -8680,7 +8684,7 @@ const Lg = `
8680
8684
  default:
8681
8685
  return Xe.defaultBg;
8682
8686
  }
8683
- }, Wg = (t) => {
8687
+ }, $g = (t) => {
8684
8688
  switch (t) {
8685
8689
  case "error":
8686
8690
  return Xe.error;
@@ -8695,7 +8699,7 @@ const Lg = `
8695
8699
  default:
8696
8700
  return Xe.default;
8697
8701
  }
8698
- }, $g = (t) => new Set(Object.values(gi)).has(t), Bg = (t) => t === "error" ? "dangerous" : $g(t) ? t : "default", Yg = (t) => {
8702
+ }, Bg = (t) => new Set(Object.values(gi)).has(t), Yg = (t) => t === "error" ? "dangerous" : Bg(t) ? t : "default", Kg = (t) => {
8699
8703
  switch (t) {
8700
8704
  case "info":
8701
8705
  return "jn:text-theme-info jn:shrink-0";
@@ -8710,13 +8714,13 @@ const Lg = `
8710
8714
  default:
8711
8715
  return "jn:text-theme-info jn:shrink-0";
8712
8716
  }
8713
- }, Kg = (t, n, e, r) => {
8717
+ }, Ug = (t, n, e, r) => {
8714
8718
  !t || n < 1 || (r.current !== null && clearTimeout(r.current), r.current = window.setTimeout(() => {
8715
8719
  e();
8716
8720
  }, n));
8717
- }, Ug = (t) => {
8721
+ }, Zg = (t) => {
8718
8722
  t.current !== null && (clearTimeout(t.current), t.current = null);
8719
- }, Zg = ({
8723
+ }, qg = ({
8720
8724
  title: t,
8721
8725
  variant: n = "info",
8722
8726
  dismissible: e = !1,
@@ -8730,24 +8734,24 @@ const Lg = `
8730
8734
  u(!1), o && o();
8731
8735
  };
8732
8736
  if (ye(() => () => {
8733
- Ug(c);
8737
+ Zg(c);
8734
8738
  }, []), ye(() => {
8735
- Kg(r, i, p, c);
8739
+ Ug(r, i, p, c);
8736
8740
  }, [r, i]), !s) return null;
8737
- const v = Bg(n), b = Vg(n), x = Wg(n);
8741
+ const v = Yg(n), b = Wg(n), x = $g(n);
8738
8742
  return /* @__PURE__ */ H.jsxs(
8739
8743
  "div",
8740
8744
  {
8741
8745
  className: `juno-message juno-message-${n} ${Lg} ${b} ${a}`,
8742
8746
  ...l,
8743
8747
  children: [
8744
- /* @__PURE__ */ H.jsx("div", { className: `juno-message-border ${Hg} ${x}` }),
8745
- /* @__PURE__ */ H.jsx(Wn, { icon: v, className: `${Yg(n)}` }),
8746
- /* @__PURE__ */ H.jsxs("div", { className: `juno-message-content ${_g}`, children: [
8747
- t && /* @__PURE__ */ H.jsx("h1", { className: Rg, children: t }),
8748
+ /* @__PURE__ */ H.jsx("div", { className: `juno-message-border ${zg} ${x}` }),
8749
+ /* @__PURE__ */ H.jsx(Wn, { icon: v, size: 21, className: `${Kg(n)} ${Rg}` }),
8750
+ /* @__PURE__ */ H.jsxs("div", { className: `juno-message-content ${Hg}`, children: [
8751
+ t && /* @__PURE__ */ H.jsx("h1", { className: _g, children: t }),
8748
8752
  /* @__PURE__ */ H.jsx("div", { children: m || g })
8749
8753
  ] }),
8750
- e && /* @__PURE__ */ H.jsx("div", { className: zg, children: /* @__PURE__ */ H.jsx(
8754
+ e && /* @__PURE__ */ H.jsx("div", { className: Vg, children: /* @__PURE__ */ H.jsx(
8751
8755
  Wn,
8752
8756
  {
8753
8757
  icon: "close",
@@ -8765,7 +8769,7 @@ function fi(t, n) {
8765
8769
  for (var e = 0, r = Array(n); e < n; e++) r[e] = t[e];
8766
8770
  return r;
8767
8771
  }
8768
- function qg(t) {
8772
+ function Gg(t) {
8769
8773
  if (Array.isArray(t)) return fi(t);
8770
8774
  }
8771
8775
  function va(t, n) {
@@ -8815,18 +8819,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8815
8819
  }
8816
8820
  };
8817
8821
  }
8818
- function Gg(t, n, e) {
8819
- return (n = tv(n)) in t ? Object.defineProperty(t, n, {
8822
+ function Qg(t, n, e) {
8823
+ return (n = nv(n)) in t ? Object.defineProperty(t, n, {
8820
8824
  value: e,
8821
8825
  enumerable: !0,
8822
8826
  configurable: !0,
8823
8827
  writable: !0
8824
8828
  }) : t[n] = e, t;
8825
8829
  }
8826
- function Qg(t) {
8830
+ function Xg(t) {
8827
8831
  if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t);
8828
8832
  }
8829
- function Xg() {
8833
+ function Jg() {
8830
8834
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
8831
8835
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
8832
8836
  }
@@ -8844,17 +8848,17 @@ function wa(t) {
8844
8848
  for (var n = 1; n < arguments.length; n++) {
8845
8849
  var e = arguments[n] != null ? arguments[n] : {};
8846
8850
  n % 2 ? ba(Object(e), !0).forEach(function(r) {
8847
- Gg(t, r, e[r]);
8851
+ Qg(t, r, e[r]);
8848
8852
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(e)) : ba(Object(e)).forEach(function(r) {
8849
8853
  Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(e, r));
8850
8854
  });
8851
8855
  }
8852
8856
  return t;
8853
8857
  }
8854
- function Jg(t) {
8855
- return qg(t) || Qg(t) || Ql(t) || Xg();
8858
+ function ev(t) {
8859
+ return Gg(t) || Xg(t) || Ql(t) || Jg();
8856
8860
  }
8857
- function ev(t, n) {
8861
+ function tv(t, n) {
8858
8862
  if (typeof t != "object" || !t) return t;
8859
8863
  var e = t[Symbol.toPrimitive];
8860
8864
  if (e !== void 0) {
@@ -8864,8 +8868,8 @@ function ev(t, n) {
8864
8868
  }
8865
8869
  return (n === "string" ? String : Number)(t);
8866
8870
  }
8867
- function tv(t) {
8868
- var n = ev(t, "string");
8871
+ function nv(t) {
8872
+ var n = tv(t, "string");
8869
8873
  return typeof n == "symbol" ? n : n + "";
8870
8874
  }
8871
8875
  function Ql(t, n) {
@@ -8902,15 +8906,15 @@ var ct = {
8902
8906
  var n = ct.getActiveTrap(t);
8903
8907
  n && !n._isManuallyPaused() && n._setPausedState(!1);
8904
8908
  }
8905
- }, nv = function(t) {
8906
- return t.tagName && t.tagName.toLowerCase() === "input" && typeof t.select == "function";
8907
8909
  }, rv = function(t) {
8910
+ return t.tagName && t.tagName.toLowerCase() === "input" && typeof t.select == "function";
8911
+ }, iv = function(t) {
8908
8912
  return t?.key === "Escape" || t?.key === "Esc" || t?.keyCode === 27;
8909
8913
  }, sn = function(t) {
8910
8914
  return t?.key === "Tab" || t?.keyCode === 9;
8911
- }, iv = function(t) {
8912
- return sn(t) && !t.shiftKey;
8913
8915
  }, ov = function(t) {
8916
+ return sn(t) && !t.shiftKey;
8917
+ }, av = function(t) {
8914
8918
  return sn(t) && t.shiftKey;
8915
8919
  }, ya = function(t) {
8916
8920
  return setTimeout(t, 0);
@@ -8920,14 +8924,14 @@ var ct = {
8920
8924
  return typeof t == "function" ? t.apply(void 0, e) : t;
8921
8925
  }, Ln = function(t) {
8922
8926
  return t.target.shadowRoot && typeof t.composedPath == "function" ? t.composedPath()[0] : t.target;
8923
- }, av = [], lv = function(t, n) {
8924
- var e = n?.document || document, r = n?.trapStack || av, i = wa({
8927
+ }, lv = [], sv = function(t, n) {
8928
+ var e = n?.document || document, r = n?.trapStack || lv, i = wa({
8925
8929
  returnFocusOnDeactivate: !0,
8926
8930
  escapeDeactivates: !0,
8927
8931
  delayInitialFocus: !0,
8928
8932
  isolateSubtrees: !1,
8929
- isKeyForward: iv,
8930
- isKeyBackward: ov
8933
+ isKeyForward: ov,
8934
+ isKeyBackward: av
8931
8935
  }, n), o = {
8932
8936
  // containers given to createFocusTrap()
8933
8937
  /** @type {Array<HTMLElement>} */
@@ -8984,7 +8988,7 @@ var ct = {
8984
8988
  });
8985
8989
  }, u = function(w) {
8986
8990
  var E = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, R = E.hasFallback, A = R === void 0 ? !1 : R, V = E.params, Z = V === void 0 ? [] : V, D = i[w];
8987
- if (typeof D == "function" && (D = D.apply(void 0, Jg(Z))), D === !0 && (D = void 0), !D) {
8991
+ if (typeof D == "function" && (D = D.apply(void 0, ev(Z))), D === !0 && (D = void 0), !D) {
8988
8992
  if (D === void 0 || D === !1)
8989
8993
  return D;
8990
8994
  throw new Error("`".concat(w, "` was specified but was not a node, or did not return a node"));
@@ -9084,7 +9088,7 @@ var ct = {
9084
9088
  }
9085
9089
  w.focus({
9086
9090
  preventScroll: !!i.preventScroll
9087
- }), o.mostRecentlyFocusedNode = w, nv(w) && w.select();
9091
+ }), o.mostRecentlyFocusedNode = w, rv(w) && w.select();
9088
9092
  }
9089
9093
  }, v = function(w) {
9090
9094
  var E = u("setReturnFocus", {
@@ -9181,7 +9185,7 @@ var ct = {
9181
9185
  }, k = function(w) {
9182
9186
  (i.isKeyForward(w) || i.isKeyBackward(w)) && C(w, i.isKeyBackward(w));
9183
9187
  }, L = function(w) {
9184
- rv(w) && en(i.escapeDeactivates, w) !== !1 && (w.preventDefault(), a.deactivate());
9188
+ iv(w) && en(i.escapeDeactivates, w) !== !1 && (w.preventDefault(), a.deactivate());
9185
9189
  }, _ = function(w) {
9186
9190
  var E = Ln(w);
9187
9191
  s(E, w) >= 0 || en(i.clickOutsideDeactivates, w) || en(i.allowOutsideClick, w) || (w.preventDefault(), w.stopImmediatePropagation());
@@ -9346,12 +9350,12 @@ var ct = {
9346
9350
  }
9347
9351
  }), a.updateContainerElements(t), a;
9348
9352
  };
9349
- const sv = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9353
+ const cv = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9350
9354
  __proto__: null,
9351
- createFocusTrap: lv
9352
- }, Symbol.toStringTag, { value: "Module" })), cv = /* @__PURE__ */ Ma(sv), uv = /* @__PURE__ */ Ma(Bp);
9355
+ createFocusTrap: sv
9356
+ }, Symbol.toStringTag, { value: "Module" })), uv = /* @__PURE__ */ Ma(cv), dv = /* @__PURE__ */ Ma(Bp);
9353
9357
  var xa;
9354
- function dv() {
9358
+ function fv() {
9355
9359
  if (xa) return Fn.exports;
9356
9360
  xa = 1;
9357
9361
  function t(N) {
@@ -9428,7 +9432,7 @@ function dv() {
9428
9432
  }
9429
9433
  return (I === "string" ? String : Number)(N);
9430
9434
  }
9431
- var x = q, M = cv, C = M.createFocusTrap, k = uv, L = k.isFocusable, _ = parseInt((n = (e = /^(\d+)\./.exec(x.version)) === null || e === void 0 ? void 0 : e[1]) !== null && n !== void 0 ? n : 0, 10), P = /* @__PURE__ */ (function(N) {
9435
+ var x = q, M = uv, C = M.createFocusTrap, k = dv, L = k.isFocusable, _ = parseInt((n = (e = /^(\d+)\./.exec(x.version)) === null || e === void 0 ? void 0 : e[1]) !== null && n !== void 0 ? n : 0, 10), P = /* @__PURE__ */ (function(N) {
9432
9436
  function I(F) {
9433
9437
  var S;
9434
9438
  r(this, I), S = a(this, I, [F]), p(S, "getNodeForOption", function(E) {
@@ -9621,27 +9625,27 @@ function dv() {
9621
9625
  _createFocusTrap: C
9622
9626
  }, Fn.exports = P, Fn.exports.FocusTrap = P, Fn.exports;
9623
9627
  }
9624
- dv();
9628
+ fv();
9625
9629
  pe(void 0);
9626
9630
  pe(null);
9627
9631
  pe({});
9628
- const fv = `
9632
+ const pv = `
9629
9633
  jn:h-px
9630
9634
  jn:w-full
9631
9635
  jn:bg-theme-background-lvl-3
9632
- `, pv = U(
9633
- ({ className: t = "", ...n }, e) => /* @__PURE__ */ H.jsx("div", { className: `juno-select-divider ${fv} ${t}`, ref: e, ...n })
9636
+ `, mv = U(
9637
+ ({ className: t = "", ...n }, e) => /* @__PURE__ */ H.jsx("div", { className: `juno-select-divider ${pv} ${t}`, ref: e, ...n })
9634
9638
  );
9635
- pv.displayName = "SelectDivider";
9639
+ mv.displayName = "SelectDivider";
9636
9640
  pe(void 0);
9637
9641
  pe(0);
9638
9642
  pe(void 0);
9639
- const mv = pe(null), Xl = () => {
9640
- const t = be(mv);
9643
+ const hv = pe(null), Xl = () => {
9644
+ const t = be(hv);
9641
9645
  if (t == null)
9642
9646
  throw new Error("Tooltip components must be wrapped in <Tooltip />");
9643
9647
  return t;
9644
- }, hv = `
9648
+ }, gv = `
9645
9649
  jn:bg-theme-background-lvl-1
9646
9650
  jn:text-theme-high
9647
9651
  jn:inline-flex
@@ -9649,18 +9653,18 @@ const mv = pe(null), Xl = () => {
9649
9653
  jn:p-2
9650
9654
  jn:rounded
9651
9655
  jn:drop-shadow-[0_0_4px_rgba(0,0,0,0.15)]
9652
- `, gv = `
9656
+ `, vv = `
9653
9657
  jn:mx-4
9654
9658
  jn:max-w-full
9655
- `, vv = `
9659
+ `, bv = `
9656
9660
  jn:shrink-0
9657
- `, bv = (t) => t === "error" ? "dangerous" : t;
9661
+ `, wv = (t) => t === "error" ? "dangerous" : t;
9658
9662
  U(function({ className: t = "", children: n, ...e }, r) {
9659
9663
  const i = Xl(), o = ui([i.refs?.setFloating ?? null, r]), a = i.variant;
9660
9664
  return i.disabled ? null : /* @__PURE__ */ H.jsx(H.Fragment, { children: i.open && /* @__PURE__ */ H.jsxs(
9661
9665
  "div",
9662
9666
  {
9663
- className: `juno-tooltip juno-tooltip-${a} ${hv} ${t}`,
9667
+ className: `juno-tooltip juno-tooltip-${a} ${gv} ${t}`,
9664
9668
  ref: o,
9665
9669
  style: {
9666
9670
  ...i.floatingStyles
@@ -9670,12 +9674,12 @@ U(function({ className: t = "", children: n, ...e }, r) {
9670
9674
  a && /* @__PURE__ */ H.jsx(
9671
9675
  Wn,
9672
9676
  {
9673
- icon: bv(a),
9677
+ icon: wv(a),
9674
9678
  color: `jn:text-theme-${a}`,
9675
- className: `juno-tooltip-popover-icon ${vv}`
9679
+ className: `juno-tooltip-popover-icon ${bv}`
9676
9680
  }
9677
9681
  ),
9678
- /* @__PURE__ */ H.jsx("p", { className: `${gv}`, children: n })
9682
+ /* @__PURE__ */ H.jsx("p", { className: `${vv}`, children: n })
9679
9683
  ]
9680
9684
  }
9681
9685
  ) });
@@ -9703,21 +9707,21 @@ U(function({ children: t, asChild: n = !1, className: e = "", ...r }, i) {
9703
9707
  }
9704
9708
  );
9705
9709
  });
9706
- const wv = (t) => t === "info" || t === "success", Mv = ({ className: t }) => {
9710
+ const yv = (t) => t === "info" || t === "success", Cv = ({ className: t }) => {
9707
9711
  const n = Ds(), { removeMessage: e } = Ts(), r = (i) => {
9708
9712
  e(i);
9709
9713
  };
9710
9714
  return /* @__PURE__ */ q.createElement(q.Fragment, null, n && n.length > 0 && /* @__PURE__ */ q.createElement("div", { role: "group", className: `juno-message-provider ${t || ""}` }, n.map((i, o) => {
9711
9715
  const { id: a, variant: l, text: s, ...u } = i;
9712
9716
  return /* @__PURE__ */ q.createElement(
9713
- Zg,
9717
+ qg,
9714
9718
  {
9715
9719
  role: "alert",
9716
9720
  key: a,
9717
9721
  className: o > 0 ? "mt-4" : "",
9718
9722
  variant: l,
9719
9723
  dismissible: !0,
9720
- autoDismiss: wv(l),
9724
+ autoDismiss: yv(l),
9721
9725
  onDismiss: () => r(a),
9722
9726
  ...u
9723
9727
  },
@@ -9726,8 +9730,8 @@ const wv = (t) => t === "info" || t === "success", Mv = ({ className: t }) => {
9726
9730
  })));
9727
9731
  };
9728
9732
  export {
9729
- Mv as Messages,
9730
- Sv as MessagesProvider,
9733
+ Cv as Messages,
9734
+ Mv as MessagesProvider,
9731
9735
  Ts as useActions,
9732
9736
  Ds as useMessages
9733
9737
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudoperators/juno-messages-provider",
3
- "version": "0.2.33",
3
+ "version": "0.2.34",
4
4
  "description": "Messages provider",
5
5
  "author": "UI-Team",
6
6
  "repository": "https://github.com/cloudoperators/juno/tree/main/packages/messages-provider",
@@ -28,14 +28,14 @@
28
28
  "react": "19.2.4",
29
29
  "react-dom": "19.2.4",
30
30
  "typescript": "5.9.3",
31
- "vite": "7.3.1",
31
+ "vite": "7.3.2",
32
32
  "vite-plugin-dts": "4.5.4",
33
33
  "vitest": "3.2.4",
34
34
  "zustand": "5.0.11",
35
35
  "@cloudoperators/juno-config": "0.0.6"
36
36
  },
37
37
  "dependencies": {
38
- "@cloudoperators/juno-ui-components": "6.2.0"
38
+ "@cloudoperators/juno-ui-components": "6.2.1"
39
39
  },
40
40
  "jest": {
41
41
  "testEnvironment": "jsdom",