mimir-ui-kit 1.66.0 → 1.66.2

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.
@@ -0,0 +1,67 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { c as u } from "./index-DIxK0V-G.js";
3
+ import { memo as q, useRef as e, useEffect as f } from "react";
4
+ import { DEFAULT_TOAST_DURATION as g, EToastVariant as b } from "./components/Toasts/constants.js";
5
+ import './assets/ProgressBar.css';const d = "_title_lqoti_37", A = "_timer_lqoti_41", T = "_seconds_lqoti_51", h = "_message_lqoti_61", w = "_progress_lqoti_69", D = "_success_lqoti_100", F = "_alarm_lqoti_105", R = "_error_lqoti_110", E = "_purple_lqoti_115", s = {
6
+ "toast-list": "_toast-list_lqoti_2",
7
+ "toast-wrapper": "_toast-wrapper_lqoti_24",
8
+ title: d,
9
+ timer: A,
10
+ "timer-title": "_timer-title_lqoti_49",
11
+ seconds: T,
12
+ message: h,
13
+ progress: w,
14
+ "progress-bar": "_progress-bar_lqoti_78",
15
+ "close-button": "_close-button_lqoti_89",
16
+ default: "_default_lqoti_95",
17
+ success: D,
18
+ alarm: F,
19
+ error: R,
20
+ purple: E,
21
+ "top-right": "_top-right_lqoti_120",
22
+ "top-center": "_top-center_lqoti_126",
23
+ "top-left": "_top-left_lqoti_132",
24
+ "bottom-left": "_bottom-left_lqoti_137",
25
+ "bottom-center": "_bottom-center_lqoti_142",
26
+ "bottom-right": "_bottom-right_lqoti_148",
27
+ "toast-in": "_toast-in_lqoti_180",
28
+ "toast-out": "_toast-out_lqoti_184"
29
+ }, L = q(
30
+ ({
31
+ duration: _ = g,
32
+ variant: m = b.DEFAULT,
33
+ isPaused: i = !1
34
+ }) => {
35
+ const t = e(), o = e(null), n = e(Date.now()), r = e(0);
36
+ return f(() => {
37
+ if (i)
38
+ t.current && cancelAnimationFrame(t.current);
39
+ else {
40
+ n.current = Date.now() - r.current;
41
+ const c = () => {
42
+ const p = Date.now();
43
+ r.current = p - n.current;
44
+ const a = Math.min(
45
+ r.current / _ * 100,
46
+ 100
47
+ );
48
+ o.current && (o.current.style.width = `${a}%`), a < 100 && (t.current = requestAnimationFrame(c));
49
+ };
50
+ t.current = requestAnimationFrame(c);
51
+ }
52
+ return () => {
53
+ t.current && cancelAnimationFrame(t.current);
54
+ };
55
+ }, [_, i]), /* @__PURE__ */ l("div", { className: s.progress, "data-testid": "progress-bar", children: /* @__PURE__ */ l(
56
+ "div",
57
+ {
58
+ ref: o,
59
+ className: u(s["progress-bar"], s[m])
60
+ }
61
+ ) });
62
+ }
63
+ );
64
+ export {
65
+ L as P,
66
+ s as c
67
+ };
@@ -1 +1 @@
1
- ._toast-list_14r7q_2{position:fixed;z-index:var(--mimir-zindex-toasts-list);width:100vw;max-width:515px;max-height:100vh;padding:var(--mimir-space-m);overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._toast-list_14r7q_2::-webkit-scrollbar{display:none}._toast-list_14r7q_2::-webkit-scrollbar-track{background-color:transparent}._toast-list_14r7q_2::-webkit-scrollbar-thumb{background-color:transparent}._toast-list_14r7q_2::-webkit-scrollbar-thumb:window-inactive{background-color:transparent}._toast-wrapper_14r7q_24{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding:var(--mimir-space-m);background-color:var(--toast-bg-color);border-radius:var(--mimir-control-radius);-webkit-transition:all .3s ease;transition:all .3s ease}._toast-wrapper_14r7q_24:not(:last-child){margin-bottom:var(--mimir-space-s)}._title_14r7q_37:not(:last-child){margin-bottom:var(--mimir-space-xs)}._timer_14r7q_41{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}._timer_14r7q_41:not(:last-child){margin-bottom:var(--mimir-space-2xs)}._timer-title_14r7q_49,._title_14r7q_37,._seconds_14r7q_51{color:var(--black-60);font-size:var(--mimir-size-text-m);line-height:var(--mimir-line-height-text-xxs)}._seconds_14r7q_51{color:var(--black-100)}._message_14r7q_61{font-size:var(--mimir-size-text-l);line-height:var(--mimir-line-height-text-s1)}._message_14r7q_61:not(:last-child){margin-bottom:var(--mimir-space-xs)}._progress_14r7q_69{position:relative;width:100%;height:8px;overflow:hidden;background-color:var(--black-5);border-radius:var(--mimir-control-radius-xs)}._progress-bar_14r7q_78{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;background-color:var(--progress-bg-color);border-radius:var(--mimir-control-radius-xs)}._close-button_14r7q_89{position:absolute;top:var(--mimir-space-s);right:var(--mimir-space-s)}._slot_14r7q_95{margin-top:var(--mimir-space-xl)}._default_14r7q_99{--toast-bg-color: var(--white);--progress-bg-color: var(--sapphire-100)}._success_14r7q_104{--toast-bg-color: var(--success-bg-active);--progress-bg-color: var(--success-normal)}._alarm_14r7q_109{--toast-bg-color: var(--alarm-bg-active);--progress-bg-color: var(--alarm-normal)}._error_14r7q_114{--toast-bg-color: var(--error-bg-active);--progress-bg-color: var(--error-normal)}._purple_14r7q_119{--toast-bg-color: var(--purple-bg-active);--progress-bg-color: var(--purple-normal)}._top-right_14r7q_124{top:0;right:0;-webkit-transition:all .3s ease;transition:all .3s ease}._top-center_14r7q_130{top:0;right:50%;-webkit-transform:translateX(50%);transform:translate(50%)}._top-left_14r7q_136{top:0;left:0}._bottom-left_14r7q_141{bottom:0;left:0}._bottom-center_14r7q_146{right:50%;bottom:0;-webkit-transform:translateX(50%);transform:translate(50%)}._bottom-right_14r7q_152{right:0;bottom:0}@-webkit-keyframes _toast-in_14r7q_184{0%{-webkit-transform:var(--elm-translate);transform:var(--elm-translate);opacity:.7}80%{-webkit-transform:translate(0);transform:translate(0);opacity:.7}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes _toast-in_14r7q_184{0%{-webkit-transform:var(--elm-translate);transform:var(--elm-translate);opacity:.7}80%{-webkit-transform:translate(0);transform:translate(0);opacity:.7}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@-webkit-keyframes _toast-out_14r7q_188{0%{opacity:1}20%{-webkit-transform:translate(0);transform:translate(0);opacity:.7}to{-webkit-transform:var(--elm-translate);transform:var(--elm-translate);opacity:.7}}@keyframes _toast-out_14r7q_188{0%{opacity:1}20%{-webkit-transform:translate(0);transform:translate(0);opacity:.7}to{-webkit-transform:var(--elm-translate);transform:var(--elm-translate);opacity:.7}}._toast-in_14r7q_184{-webkit-animation:_toast-in_14r7q_184 .3s both;animation:_toast-in_14r7q_184 .3s both}._toast-out_14r7q_188{-webkit-animation:_toast-out_14r7q_188 .8s both;animation:_toast-out_14r7q_188 .8s both}
1
+ ._toast-list_lqoti_2{position:fixed;z-index:var(--mimir-zindex-toasts-list);width:100vw;max-width:515px;max-height:100vh;padding:var(--mimir-space-m);overflow-x:hidden;overflow-y:auto;overflow:hidden auto}._toast-list_lqoti_2::-webkit-scrollbar{display:none}._toast-list_lqoti_2::-webkit-scrollbar-track{background-color:transparent}._toast-list_lqoti_2::-webkit-scrollbar-thumb{background-color:transparent}._toast-list_lqoti_2::-webkit-scrollbar-thumb:window-inactive{background-color:transparent}._toast-wrapper_lqoti_24{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding:var(--mimir-space-m);background-color:var(--toast-bg-color);border-radius:var(--mimir-control-radius);-webkit-transition:all .3s ease;transition:all .3s ease}._toast-wrapper_lqoti_24:not(:last-child){margin-bottom:var(--mimir-space-s)}._title_lqoti_37:not(:last-child){margin-bottom:var(--mimir-space-xs)}._timer_lqoti_41{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}._timer_lqoti_41:not(:last-child){margin-bottom:var(--mimir-space-2xs)}._timer-title_lqoti_49,._title_lqoti_37,._seconds_lqoti_51{color:var(--black-60);font-size:var(--mimir-size-text-m);line-height:var(--mimir-line-height-text-xxs)}._seconds_lqoti_51{color:var(--black-100)}._message_lqoti_61{font-size:var(--mimir-size-text-l);line-height:var(--mimir-line-height-text-s1)}._message_lqoti_61:not(:last-child){margin-bottom:var(--mimir-space-xs)}._progress_lqoti_69{position:relative;width:100%;height:8px;overflow:hidden;background-color:var(--black-5);border-radius:var(--mimir-control-radius-xs)}._progress-bar_lqoti_78{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;background-color:var(--progress-bg-color);border-radius:var(--mimir-control-radius-xs)}._close-button_lqoti_89{position:absolute;top:var(--mimir-space-s);right:var(--mimir-space-s)}._default_lqoti_95{--toast-bg-color: var(--white);--progress-bg-color: var(--sapphire-100)}._success_lqoti_100{--toast-bg-color: var(--success-bg-active);--progress-bg-color: var(--success-normal)}._alarm_lqoti_105{--toast-bg-color: var(--alarm-bg-active);--progress-bg-color: var(--alarm-normal)}._error_lqoti_110{--toast-bg-color: var(--error-bg-active);--progress-bg-color: var(--error-normal)}._purple_lqoti_115{--toast-bg-color: var(--purple-bg-active);--progress-bg-color: var(--purple-normal)}._top-right_lqoti_120{top:0;right:0;-webkit-transition:all .3s ease;transition:all .3s ease}._top-center_lqoti_126{top:0;right:50%;-webkit-transform:translateX(50%);transform:translate(50%)}._top-left_lqoti_132{top:0;left:0}._bottom-left_lqoti_137{bottom:0;left:0}._bottom-center_lqoti_142{right:50%;bottom:0;-webkit-transform:translateX(50%);transform:translate(50%)}._bottom-right_lqoti_148{right:0;bottom:0}@-webkit-keyframes _toast-in_lqoti_180{0%{-webkit-transform:var(--elm-translate);transform:var(--elm-translate);opacity:.7}80%{-webkit-transform:translate(0);transform:translate(0);opacity:.7}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes _toast-in_lqoti_180{0%{-webkit-transform:var(--elm-translate);transform:var(--elm-translate);opacity:.7}80%{-webkit-transform:translate(0);transform:translate(0);opacity:.7}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@-webkit-keyframes _toast-out_lqoti_184{0%{opacity:1}20%{-webkit-transform:translate(0);transform:translate(0);opacity:.7}to{-webkit-transform:var(--elm-translate);transform:var(--elm-translate);opacity:.7}}@keyframes _toast-out_lqoti_184{0%{opacity:1}20%{-webkit-transform:translate(0);transform:translate(0);opacity:.7}to{-webkit-transform:var(--elm-translate);transform:var(--elm-translate);opacity:.7}}._toast-in_lqoti_180{-webkit-animation:_toast-in_lqoti_180 .3s both;animation:_toast-in_lqoti_180 .3s both}._toast-out_lqoti_184{-webkit-animation:_toast-out_lqoti_184 .8s both;animation:_toast-out_lqoti_184 .8s both}
@@ -1,8 +1,8 @@
1
- import { jsxs as o, jsx as i, Fragment as k } from "react/jsx-runtime";
2
- import { c as p } from "../../index-DIxK0V-G.js";
1
+ import { jsxs as o, jsx as a, Fragment as k } from "react/jsx-runtime";
2
+ import { c as l } from "../../index-DIxK0V-G.js";
3
3
  import { memo as K, useState as T, useEffect as Q } from "react";
4
4
  import { EInputRangeSliderPositions as y, EInputRangeSliderBorderState as L, DEFAULT_STEP as X, DEFAULT_WIDTH as w } from "./constants.js";
5
- import '../../assets/InputRangeSlider.css';const Y = "_wrapper_1kfjr_8", Z = "_input_1kfjr_18", V = "_rail_1kfjr_115", C = "_off_1kfjr_124", S = "_right_1kfjr_124", rr = "_left_1kfjr_145", tr = "_control_1kfjr_36", nr = "_disabled_1kfjr_170", r = {
5
+ import '../../assets/InputRangeSlider.css';const Y = "_wrapper_1kfjr_8", Z = "_input_1kfjr_18", V = "_rail_1kfjr_115", C = "_off_1kfjr_124", S = "_right_1kfjr_124", rr = "_left_1kfjr_145", tr = "_control_1kfjr_36", sr = "_disabled_1kfjr_170", r = {
6
6
  "main-wrapper": "_main-wrapper_1kfjr_2",
7
7
  wrapper: Y,
8
8
  "input-wrapper": "_input-wrapper_1kfjr_18",
@@ -18,154 +18,154 @@ import '../../assets/InputRangeSlider.css';const Y = "_wrapper_1kfjr_8", Z = "_i
18
18
  "inner-rail": "_inner-rail_1kfjr_134",
19
19
  left: rr,
20
20
  control: tr,
21
- disabled: nr
22
- }, er = K(
21
+ disabled: sr
22
+ }, cr = K(
23
23
  ({
24
- min: l,
24
+ min: p,
25
25
  max: j,
26
- value: t,
26
+ value: s,
27
27
  disabled: N,
28
28
  isMinEqualMax: $ = !1,
29
- isSingleSlider: a = !0,
29
+ isSingleSlider: i = !0,
30
30
  onChange: f,
31
- step: x = X,
32
- borderState: h = L.ON,
31
+ step: h = X,
32
+ borderState: x = L.ON,
33
33
  positions: b = y.LEFT,
34
34
  minMaxDescriptions: q,
35
35
  onChangeValue: _,
36
36
  wrapperClassName: O,
37
37
  ...W
38
38
  }) => {
39
- const [m, D] = T(() => (t == null ? void 0 : t.min) ?? l), [d, F] = T(() => (t == null ? void 0 : t.max) ?? j), {
39
+ const [m, D] = T(() => (s == null ? void 0 : s.min) ?? p), [d, F] = T(() => (s == null ? void 0 : s.max) ?? j), {
40
40
  max: I,
41
41
  min: R,
42
- maxClassName: A,
43
- minClassName: U
42
+ maxClassName: v,
43
+ minClassName: A
44
44
  } = q ?? {};
45
45
  Q(() => {
46
- t && (t.min && D(t.min), t.max && F(t.max));
47
- }, [t]);
48
- const g = (n) => {
49
- n.preventDefault();
50
- const s = Math.min(
51
- +n.target.value,
52
- a || $ ? d : d - x
46
+ s && (D(s.min), F(s.max));
47
+ }, [s]);
48
+ const U = (t) => {
49
+ t.preventDefault();
50
+ const n = Math.min(
51
+ +t.target.value,
52
+ i || $ ? d : d - h
53
53
  );
54
- t || D(s), _ == null || _({ min: s, max: d }), f == null || f(n);
55
- }, B = (n) => {
56
- n.preventDefault();
57
- const s = Math.max(
58
- +n.target.value,
59
- $ ? m : m + x
54
+ s || D(n), _ == null || _({ min: n, max: d }), f == null || f(t);
55
+ }, g = (t) => {
56
+ t.preventDefault();
57
+ const n = Math.max(
58
+ +t.target.value,
59
+ $ ? m : m + h
60
60
  );
61
- t || F(s), _ == null || _({ min: m, max: s }), f == null || f(n);
62
- }, E = (m - l) / (j - l) * w, c = (d - l) / (j - l) * w, e = b === y.LEFT, H = m === d && c !== 0, M = h === L.OFF, v = () => {
63
- const n = {
61
+ s || F(n), _ == null || _({ min: m, max: n }), f == null || f(t);
62
+ }, E = (m - p) / (j - p) * w, e = (d - p) / (j - p) * w, c = b === y.LEFT, B = m === d && e !== 0, M = x === L.OFF, H = () => {
63
+ const t = {
64
64
  ...W,
65
65
  type: "range",
66
- min: l,
66
+ min: p,
67
67
  max: j,
68
- step: x
69
- }, s = /* @__PURE__ */ i(
68
+ step: h
69
+ }, n = /* @__PURE__ */ a(
70
70
  "input",
71
71
  {
72
- ...n,
73
- className: p(r.input, {
74
- [r["equal-value"]]: H,
75
- [r["is-double-range"]]: !a
72
+ ...t,
73
+ className: l(r.input, {
74
+ [r["equal-value"]]: B,
75
+ [r["is-double-range"]]: !i
76
76
  }),
77
77
  disabled: N,
78
78
  value: m,
79
- onChange: g
79
+ onChange: U
80
80
  }
81
- ), u = /* @__PURE__ */ i(
81
+ ), u = /* @__PURE__ */ a(
82
82
  "input",
83
83
  {
84
- ...n,
85
- className: p(r.input, {
86
- [r["is-double-range"]]: !a
84
+ ...t,
85
+ className: l(r.input, {
86
+ [r["is-double-range"]]: !i
87
87
  }),
88
88
  disabled: N,
89
89
  value: d,
90
- onChange: B
90
+ onChange: g
91
91
  }
92
92
  );
93
- return a ? e ? s : u : /* @__PURE__ */ o(k, { children: [
94
- s,
93
+ return i ? c ? n : u : /* @__PURE__ */ o(k, { children: [
94
+ n,
95
95
  u
96
96
  ] });
97
97
  }, z = () => {
98
- const n = /* @__PURE__ */ i(
98
+ const t = /* @__PURE__ */ a(
99
99
  "div",
100
100
  {
101
- className: p(r.control, {
101
+ className: l(r.control, {
102
102
  [r.disabled]: N
103
103
  }),
104
104
  style: {
105
105
  left: `${E}%`
106
106
  }
107
107
  }
108
- ), s = /* @__PURE__ */ i(
108
+ ), n = /* @__PURE__ */ a(
109
109
  "div",
110
110
  {
111
- className: p(r.control, {
111
+ className: l(r.control, {
112
112
  [r.disabled]: N
113
113
  }),
114
114
  style: {
115
- left: `${c}%`
115
+ left: `${e}%`
116
116
  }
117
117
  }
118
- ), u = () => M ? e ? `${E}%` : `${w - c}%` : e ? void 0 : `${w - c}%`, G = a && !e ? "0%" : `${w - c}%`, J = a && !e ? u() : `${c - E}%`, P = /* @__PURE__ */ o(k, { children: [
119
- /* @__PURE__ */ i(
118
+ ), u = () => M ? c ? `${E}%` : `${w - e}%` : c ? void 0 : `${w - e}%`, G = i && !c ? "0%" : `${w - e}%`, J = i && !c ? u() : `${e - E}%`, P = /* @__PURE__ */ o(k, { children: [
119
+ /* @__PURE__ */ a(
120
120
  "div",
121
121
  {
122
122
  style: {
123
- width: !M && !e ? `${c}%` : u()
123
+ width: !M && !c ? `${e}%` : u()
124
124
  },
125
- className: p(r.rail, r[h], r[b], {
126
- [r["double-range"]]: !a
125
+ className: l(r.rail, r[x], r[b], {
126
+ [r["double-range"]]: !i
127
127
  })
128
128
  }
129
129
  ),
130
- /* @__PURE__ */ i(
130
+ /* @__PURE__ */ a(
131
131
  "div",
132
132
  {
133
133
  style: {
134
134
  right: G,
135
135
  width: J
136
136
  },
137
- className: p(
137
+ className: l(
138
138
  r["inner-rail"],
139
- r[h],
139
+ r[x],
140
140
  r[b],
141
141
  {
142
- [r["double-range"]]: !a
142
+ [r["double-range"]]: !i
143
143
  }
144
144
  )
145
145
  }
146
146
  )
147
147
  ] });
148
- return a ? /* @__PURE__ */ o(k, { children: [
149
- e ? n : s,
148
+ return i ? /* @__PURE__ */ o(k, { children: [
149
+ c ? t : n,
150
150
  P
151
151
  ] }) : /* @__PURE__ */ o(k, { children: [
152
- n,
152
+ t,
153
153
  P,
154
- s
154
+ n
155
155
  ] });
156
156
  };
157
- return /* @__PURE__ */ o("div", { className: p(r["main-wrapper"], O), children: [
157
+ return /* @__PURE__ */ o("div", { className: l(r["main-wrapper"], O), children: [
158
158
  /* @__PURE__ */ o("div", { className: r["info-wrapper"], children: [
159
- !!R && /* @__PURE__ */ i("div", { className: U, children: R }),
160
- !!I && /* @__PURE__ */ i("div", { className: A, children: I })
159
+ !!R && /* @__PURE__ */ a("div", { className: A, children: R }),
160
+ !!I && /* @__PURE__ */ a("div", { className: v, children: I })
161
161
  ] }),
162
162
  /* @__PURE__ */ o("div", { className: r.wrapper, children: [
163
- /* @__PURE__ */ i("div", { className: r["control-wrapper"], children: z() }),
164
- /* @__PURE__ */ i("div", { className: r["input-wrapper"], children: v() })
163
+ /* @__PURE__ */ a("div", { className: r["control-wrapper"], children: z() }),
164
+ /* @__PURE__ */ a("div", { className: r["input-wrapper"], children: H() })
165
165
  ] })
166
166
  ] });
167
167
  }
168
168
  );
169
169
  export {
170
- er as InputRangeSlider
170
+ cr as InputRangeSlider
171
171
  };
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "../../index-DIxK0V-G.js";
3
3
  import "react";
4
4
  import "./constants.js";
5
- import { P as s } from "../../ProgressBar-F970LqqJ.js";
5
+ import { P as s } from "../../ProgressBar-BtLMbQrP.js";
6
6
  export {
7
7
  s as ProgressBar
8
8
  };
@@ -1,72 +1,72 @@
1
- import { jsxs as t, jsx as a } from "react/jsx-runtime";
2
- import { c as S } from "../../index-DIxK0V-G.js";
3
- import { memo as w, useRef as y, useState as O } from "react";
4
- import { ANIMATION_VARIABLES_MAP as U, EToastPosition as j, EToastVariant as x, DEFAULT_TOAST_DURATION as F } from "./constants.js";
5
- import { c as s, P as V } from "../../ProgressBar-F970LqqJ.js";
6
- import { useTimer as b } from "../../hooks/useTimer/index.js";
1
+ import { jsxs as l, jsx as a, Fragment as S } from "react/jsx-runtime";
2
+ import { c as w } from "../../index-DIxK0V-G.js";
3
+ import { memo as y, useRef as F, useState as O } from "react";
4
+ import { ANIMATION_VARIABLES_MAP as U, EToastPosition as j, EToastVariant as x, DEFAULT_TOAST_DURATION as V } from "./constants.js";
5
+ import { c as r, P as b } from "../../ProgressBar-BtLMbQrP.js";
6
+ import { useTimer as g } from "../../hooks/useTimer/index.js";
7
7
  import { Button as G } from "../Button/Button.js";
8
- const Q = w(
8
+ const W = y(
9
9
  ({
10
10
  id: i,
11
- title: m = "",
12
- message: u,
11
+ title: u = "",
12
+ message: d,
13
13
  position: P = j.TOP_RIGHT,
14
14
  variant: h = x.DEFAULT,
15
- duration: c = F,
15
+ duration: c = V,
16
16
  autoClose: p = !0,
17
17
  needProgress: N = !0,
18
18
  needTimer: A = !0,
19
19
  needCloseButton: L = !0,
20
- onToastRemove: r,
20
+ onToastRemove: s,
21
21
  onExpire: f,
22
- onButtonRemoveClick: d,
22
+ onButtonRemoveClick: m,
23
23
  slot: e,
24
- pauseOnHover: I = !1
24
+ pauseOnHover: n = !1
25
25
  }) => {
26
- const l = y(null), [n, M] = O(!1), { seconds: _ } = b({
26
+ const t = F(null), [I, M] = O(!1), { seconds: _ } = g({
27
27
  expiryTimestamp: Date.now() + c,
28
28
  autoStart: p,
29
29
  onExpire: p ? () => {
30
- r == null || r(i, l), f == null || f();
30
+ s == null || s(i, t), f == null || f();
31
31
  } : void 0,
32
- isPaused: n
32
+ isPaused: I
33
33
  }), D = () => {
34
- I && M(!0);
34
+ n && M(!0);
35
35
  }, E = () => {
36
- I && M(!1);
36
+ n && M(!1);
37
37
  };
38
- return /* @__PURE__ */ t(
38
+ return /* @__PURE__ */ l(
39
39
  "div",
40
40
  {
41
41
  style: {
42
42
  "--elm-translate": U[P]
43
43
  },
44
- className: S(
45
- s["toast-in"],
46
- s["toast-wrapper"],
47
- s[h]
44
+ className: w(
45
+ r["toast-in"],
46
+ r["toast-wrapper"],
47
+ r[h]
48
48
  ),
49
- ref: l,
49
+ ref: t,
50
50
  role: "alert",
51
51
  onMouseEnter: D,
52
52
  onMouseLeave: E,
53
53
  children: [
54
- m && /* @__PURE__ */ a("h3", { className: s.title, children: m }),
55
- u && /* @__PURE__ */ a("div", { className: s.message, children: u }),
56
- (A || N) && /* @__PURE__ */ t("div", { children: [
57
- !!c && A && /* @__PURE__ */ t("div", { className: s.timer, children: [
58
- /* @__PURE__ */ a("h4", { className: s["timer-title"], children: "Осталось" }),
59
- /* @__PURE__ */ t("p", { className: s.seconds, children: [
54
+ u && /* @__PURE__ */ a("h3", { className: r.title, children: u }),
55
+ d && /* @__PURE__ */ a("div", { className: r.message, children: d }),
56
+ (A || N) && /* @__PURE__ */ l("div", { children: [
57
+ !!c && A && /* @__PURE__ */ l("div", { className: r.timer, children: [
58
+ /* @__PURE__ */ a("h4", { className: r["timer-title"], children: "Осталось" }),
59
+ /* @__PURE__ */ l("p", { className: r.seconds, children: [
60
60
  _,
61
61
  " сек"
62
62
  ] })
63
63
  ] }),
64
64
  !!c && N && /* @__PURE__ */ a(
65
- V,
65
+ b,
66
66
  {
67
67
  variant: h,
68
68
  duration: c,
69
- isPaused: n
69
+ isPaused: I
70
70
  }
71
71
  )
72
72
  ] }),
@@ -74,17 +74,17 @@ const Q = w(
74
74
  G,
75
75
  {
76
76
  onClick: () => {
77
- r == null || r(i, l), d == null || d();
77
+ s == null || s(i, t), m == null || m();
78
78
  },
79
79
  clear: !0,
80
80
  isIconButton: !0,
81
- className: s["close-button"],
81
+ className: r["close-button"],
82
82
  iconName: "Close24px"
83
83
  }
84
84
  ),
85
- e && /* @__PURE__ */ a("div", { className: s.slot, children: typeof e == "function" ? e({
85
+ e && /* @__PURE__ */ a(S, { children: typeof e == "function" ? e({
86
86
  handleToastRemove: () => {
87
- r == null || r(i, l);
87
+ s == null || s(i, t);
88
88
  }
89
89
  }) : e })
90
90
  ]
@@ -93,5 +93,5 @@ const Q = w(
93
93
  }
94
94
  );
95
95
  export {
96
- Q as Toast
96
+ W as Toast
97
97
  };
@@ -2,7 +2,7 @@ import { jsx as i } from "react/jsx-runtime";
2
2
  import { c as a } from "../../index-DIxK0V-G.js";
3
3
  import { memo as e, useRef as f, useCallback as T, useEffect as u } from "react";
4
4
  import { EToastPosition as c } from "./constants.js";
5
- import { c as l } from "../../ProgressBar-F970LqqJ.js";
5
+ import { c as l } from "../../ProgressBar-BtLMbQrP.js";
6
6
  import { Toast as d } from "./Toast.js";
7
7
  import { Portal as p } from "../Portal/Portal.js";
8
8
  const x = e(
@@ -3,7 +3,7 @@ import { useReducer as u, useCallback as m, useMemo as E } from "react";
3
3
  import { EToastVariant as o } from "./constants.js";
4
4
  import { ToastContext as l } from "./hooks.js";
5
5
  import { reducer as L, initialState as A, actionCreators as c } from "./store.js";
6
- import { c as C } from "../../ProgressBar-F970LqqJ.js";
6
+ import { c as C } from "../../ProgressBar-BtLMbQrP.js";
7
7
  import { ToastList as S } from "./ToastList.js";
8
8
  const F = ({ children: d }) => {
9
9
  const [i, r] = u(L, A), a = m((t) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.66.0",
4
+ "version": "1.66.2",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
@@ -1,68 +0,0 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { c as u } from "./index-DIxK0V-G.js";
3
- import { memo as q, useRef as r, useEffect as f } from "react";
4
- import { DEFAULT_TOAST_DURATION as g, EToastVariant as b } from "./components/Toasts/constants.js";
5
- import './assets/ProgressBar.css';const d = "_title_14r7q_37", A = "_timer_14r7q_41", T = "_seconds_14r7q_51", h = "_message_14r7q_61", w = "_progress_14r7q_69", D = "_slot_14r7q_95", F = "_success_14r7q_104", R = "_alarm_14r7q_109", E = "_error_14r7q_114", N = "_purple_14r7q_119", o = {
6
- "toast-list": "_toast-list_14r7q_2",
7
- "toast-wrapper": "_toast-wrapper_14r7q_24",
8
- title: d,
9
- timer: A,
10
- "timer-title": "_timer-title_14r7q_49",
11
- seconds: T,
12
- message: h,
13
- progress: w,
14
- "progress-bar": "_progress-bar_14r7q_78",
15
- "close-button": "_close-button_14r7q_89",
16
- slot: D,
17
- default: "_default_14r7q_99",
18
- success: F,
19
- alarm: R,
20
- error: E,
21
- purple: N,
22
- "top-right": "_top-right_14r7q_124",
23
- "top-center": "_top-center_14r7q_130",
24
- "top-left": "_top-left_14r7q_136",
25
- "bottom-left": "_bottom-left_14r7q_141",
26
- "bottom-center": "_bottom-center_14r7q_146",
27
- "bottom-right": "_bottom-right_14r7q_152",
28
- "toast-in": "_toast-in_14r7q_184",
29
- "toast-out": "_toast-out_14r7q_188"
30
- }, O = q(
31
- ({
32
- duration: _ = g,
33
- variant: l = b.DEFAULT,
34
- isPaused: n = !1
35
- }) => {
36
- const t = r(), e = r(null), c = r(Date.now()), s = r(0);
37
- return f(() => {
38
- if (n)
39
- t.current && cancelAnimationFrame(t.current);
40
- else {
41
- c.current = Date.now() - s.current;
42
- const a = () => {
43
- const p = Date.now();
44
- s.current = p - c.current;
45
- const i = Math.min(
46
- s.current / _ * 100,
47
- 100
48
- );
49
- e.current && (e.current.style.width = `${i}%`), i < 100 && (t.current = requestAnimationFrame(a));
50
- };
51
- t.current = requestAnimationFrame(a);
52
- }
53
- return () => {
54
- t.current && cancelAnimationFrame(t.current);
55
- };
56
- }, [_, n]), /* @__PURE__ */ m("div", { className: o.progress, "data-testid": "progress-bar", children: /* @__PURE__ */ m(
57
- "div",
58
- {
59
- ref: e,
60
- className: u(o["progress-bar"], o[l])
61
- }
62
- ) });
63
- }
64
- );
65
- export {
66
- O as P,
67
- o as c
68
- };