skillgrid 0.0.84 → 0.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/assets/components/Icon/Icon.module-BrJPqMfc.css +1 -0
- package/dist/assets/components/Snackbar/Provider/SnackbarProvider.module-CXp57W1g.css +1 -0
- package/dist/assets/components/Snackbar/Snackbar.module-gnMPmaUr.css +1 -0
- package/dist/assets/components/Trigger/Trigger.module-BWzHgDVC.css +1 -0
- package/dist/assets/components/Typography/Typography.module-53KcIWaI.css +1 -0
- package/dist/assets/styles/link.module--5MF0lZi.css +1 -0
- package/dist/assets/styles/tokens.module-4cm1PUu3.css +1 -0
- package/dist/components/Icon/Icon.module.css.js +105 -105
- package/dist/components/Image/assets/PlaceholderImageIcon.js +3 -3
- package/dist/components/InputBase/assets/GripIcon.js +8 -8
- package/dist/components/Modal/Modal.js +13 -13
- package/dist/components/Snackbar/Provider/SnackbarProvider.js +153 -64
- package/dist/components/Snackbar/Provider/SnackbarProvider.module.css.js +14 -6
- package/dist/components/Snackbar/Provider/SnackbarProvider.type.d.ts +9 -4
- package/dist/components/Snackbar/Snackbar.js +172 -134
- package/dist/components/Snackbar/Snackbar.module.css.js +42 -40
- package/dist/components/Snackbar/Snackbar.type.d.ts +8 -1
- package/dist/components/Trigger/Trigger.js +37 -37
- package/dist/components/Trigger/Trigger.module.css.js +23 -23
- package/dist/components/Typography/Typography.module.css.js +23 -23
- package/dist/index.cjs.js +3 -3
- package/dist/index.css +1 -1
- package/dist/styles/link.module.css.js +1 -1
- package/dist/styles/tokens.module.css.js +1 -1
- package/package.json +1 -1
- package/dist/assets/components/Icon/Icon.module-3tN5PTDn.css +0 -1
- package/dist/assets/components/Snackbar/Provider/SnackbarProvider.module-F1FVM9qU.css +0 -1
- package/dist/assets/components/Snackbar/Snackbar.module-KVPJ2b4w.css +0 -1
- package/dist/assets/components/Trigger/Trigger.module-B91SEgX2.css +0 -1
- package/dist/assets/components/Typography/Typography.module-TJDGpv-d.css +0 -1
- package/dist/assets/styles/link.module-C43y8FoK.css +0 -1
- package/dist/assets/styles/tokens.module-l264od84.css +0 -1
|
@@ -1,76 +1,165 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useReducer as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { nanoid as
|
|
6
|
-
import
|
|
7
|
-
import { Snackbar as
|
|
8
|
-
import { snackbarReducer as
|
|
9
|
-
import { MAX_VISIBLE as
|
|
10
|
-
import { SnackbarContext as
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsx as u, jsxs as M } from "react/jsx-runtime";
|
|
2
|
+
import { useReducer as O, useEffect as v, useRef as T, useState as S, useLayoutEffect as x } from "react";
|
|
3
|
+
import E from "react-dom";
|
|
4
|
+
import N from "classnames";
|
|
5
|
+
import { nanoid as W } from "nanoid";
|
|
6
|
+
import l from "./SnackbarProvider.module.css.js";
|
|
7
|
+
import { Snackbar as C } from "../Snackbar.js";
|
|
8
|
+
import { snackbarReducer as I } from "../lib/snackbarReducer/snackbarReducer.js";
|
|
9
|
+
import { MAX_VISIBLE as k } from "../lib/constants.js";
|
|
10
|
+
import { SnackbarContext as G } from "../lib/useSnackbar.js";
|
|
11
|
+
const f = {
|
|
12
|
+
hug: 0,
|
|
13
|
+
fix: 1,
|
|
14
|
+
fill: 2
|
|
15
|
+
}, H = (n) => n.reduce((d, p) => {
|
|
16
|
+
const t = p.mode ?? "fix";
|
|
17
|
+
return f[t] > f[d] ? t : d;
|
|
18
|
+
}, "hug"), R = ({
|
|
19
|
+
snacks: n,
|
|
20
|
+
dataTestId: d,
|
|
21
|
+
onClose: p
|
|
22
|
+
}) => {
|
|
23
|
+
const t = T(null), [s, h] = S("hug"), [m, g] = S(0), a = H(n), c = n.length > 0 && f[a] > f[s] ? a : s;
|
|
24
|
+
x(() => {
|
|
25
|
+
if (n.length === 0) {
|
|
26
|
+
h("hug"), g(0);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
h((r) => f[a] > f[r] ? a : r);
|
|
30
|
+
}, [n.length, a]), x(() => {
|
|
31
|
+
if (n.length === 0 || c !== "hug")
|
|
32
|
+
return;
|
|
33
|
+
const r = t.current;
|
|
34
|
+
if (!r) return;
|
|
35
|
+
const e = () => {
|
|
36
|
+
const i = r.getBoundingClientRect().width;
|
|
37
|
+
g(
|
|
38
|
+
(y) => Math.max(y, i)
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
e();
|
|
42
|
+
const o = new ResizeObserver(e);
|
|
43
|
+
return o.observe(r), () => o.disconnect();
|
|
44
|
+
}, [c, n.length]);
|
|
45
|
+
const b = n.length > 1;
|
|
46
|
+
return /* @__PURE__ */ u(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
ref: t,
|
|
50
|
+
className: N(l.snackGroup, {
|
|
51
|
+
[l.snackGroupHug]: c === "hug",
|
|
52
|
+
[l.snackGroupFix]: c === "fix",
|
|
53
|
+
[l.snackGroupFill]: c === "fill"
|
|
54
|
+
}),
|
|
55
|
+
style: m > 0 ? {
|
|
56
|
+
/**
|
|
57
|
+
* Сохранённая hug-ширина продолжает действовать
|
|
58
|
+
* и после перехода в fix/fill.
|
|
59
|
+
*
|
|
60
|
+
* Например:
|
|
61
|
+
* hug 820px -> fix не должен уменьшить стек до 600px.
|
|
62
|
+
*/
|
|
63
|
+
minWidth: `min(${m}px, 100%)`
|
|
64
|
+
} : void 0,
|
|
65
|
+
children: n.map((r, e) => {
|
|
66
|
+
const o = (n.length - 1 - e) * -8;
|
|
67
|
+
return /* @__PURE__ */ u(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
"data-testid": d,
|
|
71
|
+
className: l.snackWrapper,
|
|
72
|
+
style: {
|
|
73
|
+
transform: `translateY(${o}px)`
|
|
74
|
+
},
|
|
75
|
+
children: /* @__PURE__ */ u(
|
|
76
|
+
C,
|
|
77
|
+
{
|
|
78
|
+
...r,
|
|
79
|
+
open: !r.exiting,
|
|
80
|
+
isStack: b,
|
|
81
|
+
stretchToStack: !0,
|
|
82
|
+
forceClose: r.exiting,
|
|
83
|
+
onClose: () => p(r.id)
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
},
|
|
87
|
+
r.id
|
|
88
|
+
);
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}, B = (n) => {
|
|
93
|
+
const { children: d, dataTestId: p = "snackbar-wrapper" } = n, [t, s] = O(I, {
|
|
94
|
+
visible: [],
|
|
95
|
+
queue: []
|
|
96
|
+
}), h = (e) => {
|
|
97
|
+
const o = W(), i = {
|
|
98
|
+
...e,
|
|
99
|
+
id: o,
|
|
100
|
+
open: !0
|
|
101
|
+
};
|
|
102
|
+
s({
|
|
103
|
+
type: "ENQUEUE",
|
|
104
|
+
snack: i
|
|
105
|
+
});
|
|
106
|
+
}, m = (e) => {
|
|
107
|
+
s({
|
|
108
|
+
type: "REMOVE",
|
|
109
|
+
id: e
|
|
110
|
+
});
|
|
17
111
|
};
|
|
18
|
-
|
|
112
|
+
v(() => {
|
|
19
113
|
s({ type: "SHOW_NEXT" });
|
|
20
|
-
}, [
|
|
21
|
-
if (
|
|
22
|
-
if (
|
|
23
|
-
const e =
|
|
24
|
-
s({
|
|
114
|
+
}, [t.queue, t.visible]), v(() => {
|
|
115
|
+
if (t.queue.length !== 0)
|
|
116
|
+
if (t.visible.length >= k) {
|
|
117
|
+
const e = t.visible[0];
|
|
118
|
+
s({
|
|
119
|
+
type: "START_EXIT",
|
|
120
|
+
id: e.id
|
|
121
|
+
});
|
|
25
122
|
} else
|
|
26
123
|
s({ type: "SHOW_NEXT" });
|
|
27
|
-
}, [
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const x = t.wasInStack || a ? "fix" : t.mode;
|
|
32
|
-
return /* @__PURE__ */ n(
|
|
33
|
-
"div",
|
|
124
|
+
}, [t.queue]);
|
|
125
|
+
const g = t.visible.filter((e) => !e.parent), a = t.visible.filter((e) => e.parent), c = E.createPortal(
|
|
126
|
+
/* @__PURE__ */ u("div", { className: l.stack, children: /* @__PURE__ */ u(
|
|
127
|
+
R,
|
|
34
128
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
children: /* @__PURE__ */ n(
|
|
41
|
-
w,
|
|
42
|
-
{
|
|
43
|
-
...t,
|
|
44
|
-
open: !t.exiting,
|
|
45
|
-
isStack: a,
|
|
46
|
-
mode: x,
|
|
47
|
-
forceClose: t.exiting,
|
|
48
|
-
onClose: () => S(t.id)
|
|
49
|
-
}
|
|
50
|
-
)
|
|
51
|
-
},
|
|
52
|
-
t.id
|
|
53
|
-
);
|
|
54
|
-
}), b = o.visible.filter((e) => !e.parent), h = o.visible.filter((e) => e.parent), v = d.createPortal(
|
|
55
|
-
/* @__PURE__ */ n("div", { className: i.stack, children: l(b) }),
|
|
129
|
+
snacks: g,
|
|
130
|
+
dataTestId: p,
|
|
131
|
+
onClose: m
|
|
132
|
+
}
|
|
133
|
+
) }),
|
|
56
134
|
document.body
|
|
57
|
-
),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
135
|
+
), b = a.reduce(
|
|
136
|
+
(e, o) => {
|
|
137
|
+
if (!o.parent) return e;
|
|
138
|
+
const i = o.parent.id || `parent-${o.parent.className}`;
|
|
139
|
+
return (e[i] || (e[i] = [])).push(o), e;
|
|
140
|
+
},
|
|
141
|
+
{}
|
|
142
|
+
), r = Object.entries(b).map(([e, o]) => {
|
|
143
|
+
const i = o[0];
|
|
144
|
+
return i.parent ? E.createPortal(
|
|
145
|
+
/* @__PURE__ */ u("div", { className: N(l.stack, l.local), children: /* @__PURE__ */ u(
|
|
146
|
+
R,
|
|
147
|
+
{
|
|
148
|
+
snacks: o,
|
|
149
|
+
dataTestId: p,
|
|
150
|
+
onClose: m
|
|
151
|
+
}
|
|
152
|
+
) }),
|
|
153
|
+
i.parent,
|
|
154
|
+
e
|
|
66
155
|
) : null;
|
|
67
156
|
});
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
157
|
+
return /* @__PURE__ */ M(G.Provider, { value: { show: h }, children: [
|
|
158
|
+
d,
|
|
159
|
+
c,
|
|
160
|
+
r
|
|
72
161
|
] });
|
|
73
162
|
};
|
|
74
163
|
export {
|
|
75
|
-
|
|
164
|
+
B as SnackbarProvider
|
|
76
165
|
};
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import '../../../assets/components/Snackbar/Provider/SnackbarProvider.module-
|
|
2
|
-
stack:
|
|
1
|
+
import '../../../assets/components/Snackbar/Provider/SnackbarProvider.module-CXp57W1g.css';const s = "_stack_184s0_1", c = "_local_184s0_20", a = "_snackGroup_184s0_27", o = "_snackGroupHug_184s0_43", n = "_snackGroupFix_184s0_54", _ = "_snackGroupFill_184s0_64", p = "_snackWrapper_184s0_68", r = {
|
|
2
|
+
stack: s,
|
|
3
3
|
local: c,
|
|
4
|
-
|
|
4
|
+
snackGroup: a,
|
|
5
|
+
snackGroupHug: o,
|
|
6
|
+
snackGroupFix: n,
|
|
7
|
+
snackGroupFill: _,
|
|
8
|
+
snackWrapper: p
|
|
5
9
|
};
|
|
6
10
|
export {
|
|
7
|
-
|
|
11
|
+
r as default,
|
|
8
12
|
c as local,
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
a as snackGroup,
|
|
14
|
+
_ as snackGroupFill,
|
|
15
|
+
n as snackGroupFix,
|
|
16
|
+
o as snackGroupHug,
|
|
17
|
+
p as snackWrapper,
|
|
18
|
+
s as stack
|
|
11
19
|
};
|
|
@@ -3,9 +3,10 @@ import { SnackbarProps } from '../Snackbar.type';
|
|
|
3
3
|
* Параметры, которые можно передать в метод `show()` для отображения Snackbar.
|
|
4
4
|
* Наследует все пропсы Snackbar, кроме управляемых провайдером (`open`, `onClose`).
|
|
5
5
|
*/
|
|
6
|
-
export type ShowSnackbarProps = Omit<SnackbarProps, 'open' | 'onClose' | 'isStack' | 'forceClose'> & {
|
|
6
|
+
export type ShowSnackbarProps = Omit<SnackbarProps, 'open' | 'onClose' | 'isStack' | 'forceClose' | 'stretchToStack'> & {
|
|
7
7
|
/**
|
|
8
|
-
* Контейнер, в котором Snackbar будет показан
|
|
8
|
+
* Контейнер, в котором Snackbar будет показан
|
|
9
|
+
* (по умолчанию — document.body).
|
|
9
10
|
*/
|
|
10
11
|
parent?: HTMLElement;
|
|
11
12
|
};
|
|
@@ -20,8 +21,12 @@ export interface InternalSnackbar extends ShowSnackbarProps {
|
|
|
20
21
|
open: boolean;
|
|
21
22
|
/** Флаг завершения анимации (используется при скрытии). */
|
|
22
23
|
exiting?: boolean;
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
}
|
|
25
|
+
export type StackWidthMode = NonNullable<InternalSnackbar['mode']>;
|
|
26
|
+
export interface SnackbarGroupProps {
|
|
27
|
+
snacks: InternalSnackbar[];
|
|
28
|
+
dataTestId: string;
|
|
29
|
+
onClose: (id: string) => void;
|
|
25
30
|
}
|
|
26
31
|
/**
|
|
27
32
|
* Интерфейс контекста Snackbar-провайдера.
|
|
@@ -1,157 +1,195 @@
|
|
|
1
1
|
import { jsxs as w, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as Z, useRef as s, useState as x, useEffect as a } from "react";
|
|
3
|
+
import S from "classnames";
|
|
3
4
|
import e from "./Snackbar.module.css.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { Typography as _ } from "../Typography/Typography.js";
|
|
5
|
+
import { useSwipe as _ } from "./lib/useSwipe.js";
|
|
6
|
+
import { Typography as $ } from "../Typography/Typography.js";
|
|
7
7
|
import { Button as E } from "../Button/Button.js";
|
|
8
|
-
import { CloseIcon as
|
|
9
|
-
import { stackDurationMap as
|
|
10
|
-
import { Loader as
|
|
8
|
+
import { CloseIcon as tt } from "./assets/close.js";
|
|
9
|
+
import { stackDurationMap as et, durationMap as nt, animationMap as ot } from "./lib/constants.js";
|
|
10
|
+
import { Loader as st } from "../Loader/Loader.js";
|
|
11
11
|
import { InfoIcon as it } from "./assets/info.js";
|
|
12
|
-
import { ErrorIcon as
|
|
13
|
-
import { SuccessIcon as
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
ref: T,
|
|
41
|
-
open: o,
|
|
42
|
-
onClose: c,
|
|
43
|
-
setExiting: m,
|
|
44
|
-
setExitReason: f,
|
|
45
|
-
swiping: q,
|
|
46
|
-
startX: F,
|
|
47
|
-
startY: O,
|
|
48
|
-
currentX: X,
|
|
49
|
-
currentY: Y
|
|
50
|
-
}), a(() => {
|
|
51
|
-
R && c("close");
|
|
52
|
-
}, [R]), a(() => {
|
|
53
|
-
if (o && !h && d !== "loading") {
|
|
54
|
-
const t = setTimeout(() => c("timeout"), S);
|
|
55
|
-
return () => clearTimeout(t);
|
|
56
|
-
}
|
|
57
|
-
}, [o, h, d, S]), a(() => {
|
|
58
|
-
o && (m(!1), f(void 0));
|
|
59
|
-
}, [o]), a(() => {
|
|
60
|
-
const t = L.current;
|
|
61
|
-
t && requestAnimationFrame(() => {
|
|
62
|
-
const r = parseFloat(getComputedStyle(t).lineHeight), I = t.offsetHeight, U = Math.round(I / r);
|
|
63
|
-
z(U > 1);
|
|
64
|
-
});
|
|
65
|
-
}, [v]), a(() => {
|
|
66
|
-
if (!o) return;
|
|
67
|
-
const t = (r) => {
|
|
68
|
-
r.key === "Escape" && c("escape");
|
|
12
|
+
import { ErrorIcon as rt } from "./assets/error.js";
|
|
13
|
+
import { SuccessIcon as ct } from "./assets/success.js";
|
|
14
|
+
const St = Z(
|
|
15
|
+
(M, u) => {
|
|
16
|
+
const {
|
|
17
|
+
open: o,
|
|
18
|
+
variant: d = "info",
|
|
19
|
+
mode: H = "fix",
|
|
20
|
+
onClose: p,
|
|
21
|
+
autoHideDuration: b = 6e3,
|
|
22
|
+
disableAutoHide: h = !1,
|
|
23
|
+
showButtonClose: A = !0,
|
|
24
|
+
showIcon: B = !0,
|
|
25
|
+
content: v,
|
|
26
|
+
classNameSnackbarRoot: D,
|
|
27
|
+
icon: N,
|
|
28
|
+
isStack: k = !1,
|
|
29
|
+
stretchToStack: V = !1,
|
|
30
|
+
forceClose: R,
|
|
31
|
+
linkButtonProps: y,
|
|
32
|
+
closeOnLinkClick: j = !0,
|
|
33
|
+
"data-testid": z = "snackbar"
|
|
34
|
+
} = M, T = s(null), L = s(null), [g, F] = x(!1), [l, m] = x(!1), [C, f] = x(), O = s(0), X = s(0), Y = s(0), q = s(0), K = s(!1), i = s(null), c = (t) => {
|
|
35
|
+
clearTimeout(i.current || 0), i.current = null;
|
|
36
|
+
const r = k ? et[t] : nt[t];
|
|
37
|
+
t === "swipe" || (m(!0), f(t)), i.current = setTimeout(() => {
|
|
38
|
+
p == null || p(), m(!1), f(void 0), i.current = null;
|
|
39
|
+
}, r);
|
|
69
40
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
41
|
+
_({
|
|
42
|
+
ref: L,
|
|
43
|
+
open: o,
|
|
44
|
+
onClose: c,
|
|
45
|
+
setExiting: m,
|
|
46
|
+
setExitReason: f,
|
|
47
|
+
swiping: K,
|
|
48
|
+
startX: O,
|
|
49
|
+
startY: X,
|
|
50
|
+
currentX: Y,
|
|
51
|
+
currentY: q
|
|
52
|
+
}), a(() => {
|
|
53
|
+
R && c("close");
|
|
54
|
+
}, [R]), a(() => {
|
|
55
|
+
if (o && !h && d !== "loading") {
|
|
56
|
+
const t = setTimeout(
|
|
57
|
+
() => c("timeout"),
|
|
58
|
+
b
|
|
59
|
+
);
|
|
60
|
+
return () => clearTimeout(t);
|
|
61
|
+
}
|
|
62
|
+
}, [
|
|
63
|
+
o,
|
|
64
|
+
h,
|
|
65
|
+
d,
|
|
66
|
+
b
|
|
67
|
+
]), a(() => {
|
|
68
|
+
o && (m(!1), f(void 0));
|
|
69
|
+
}, [o]), a(() => {
|
|
70
|
+
const t = T.current;
|
|
71
|
+
t && requestAnimationFrame(() => {
|
|
72
|
+
const r = parseFloat(getComputedStyle(t).lineHeight), I = t.offsetHeight, U = Math.round(I / r);
|
|
73
|
+
F(U > 1);
|
|
74
|
+
});
|
|
75
|
+
}, [v]), a(() => {
|
|
76
|
+
if (!o) return;
|
|
77
|
+
const t = (r) => {
|
|
78
|
+
r.key === "Escape" && c("escape");
|
|
79
|
+
};
|
|
80
|
+
return window.addEventListener("keydown", t), () => {
|
|
81
|
+
window.removeEventListener("keydown", t);
|
|
82
|
+
};
|
|
83
|
+
}, [o]), a(() => () => {
|
|
84
|
+
i.current && (clearTimeout(i.current), i.current = null);
|
|
85
|
+
}, []);
|
|
86
|
+
const P = l && C && e[ot[C]];
|
|
87
|
+
if (!o && !l)
|
|
88
|
+
return null;
|
|
89
|
+
const W = {
|
|
90
|
+
success: /* @__PURE__ */ n(ct, { className: e.icon }),
|
|
91
|
+
error: /* @__PURE__ */ n(rt, { className: e.icon }),
|
|
92
|
+
info: /* @__PURE__ */ n(it, { className: e.icon }),
|
|
93
|
+
loading: /* @__PURE__ */ n(
|
|
94
|
+
st,
|
|
95
|
+
{
|
|
96
|
+
"data-testid": "snackbar-icon-loading",
|
|
97
|
+
variant: "contrast"
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
}, G = S(
|
|
101
|
+
e.snackbar,
|
|
102
|
+
e[H],
|
|
103
|
+
{
|
|
104
|
+
[e.exiting]: l && C
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
[e.snackbarVertical]: g
|
|
108
|
+
},
|
|
109
|
+
D,
|
|
110
|
+
P,
|
|
111
|
+
{
|
|
112
|
+
/*
|
|
113
|
+
* Ширина элемента в provider-стеке теперь не зависит
|
|
114
|
+
* от количества элементов.
|
|
115
|
+
*
|
|
116
|
+
* Даже когда после удаления остаётся один snackbar,
|
|
117
|
+
* он продолжает занимать сохранённую ширину группы.
|
|
118
|
+
*/
|
|
119
|
+
[e.stackWidth]: V,
|
|
120
|
+
[e.snackbarStack]: k && !l,
|
|
121
|
+
[e.exitingStack]: k && l
|
|
122
|
+
}
|
|
123
|
+
), J = (t) => {
|
|
124
|
+
L.current = t, u && (typeof u == "function" ? u(t) : u.current = t);
|
|
125
|
+
}, Q = (t, r) => {
|
|
126
|
+
t == null || t(r);
|
|
127
|
+
};
|
|
128
|
+
return /* @__PURE__ */ w(
|
|
101
129
|
"div",
|
|
102
130
|
{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
131
|
+
ref: J,
|
|
132
|
+
"data-testid": z,
|
|
133
|
+
className: G,
|
|
106
134
|
children: [
|
|
107
|
-
B && /* @__PURE__ */ n("div", { className: e.icon, children: N || P[d] }),
|
|
108
135
|
/* @__PURE__ */ w(
|
|
109
136
|
"div",
|
|
110
137
|
{
|
|
111
|
-
className:
|
|
112
|
-
[e.
|
|
138
|
+
className: S(e.content, {
|
|
139
|
+
[e.contentVertical]: g
|
|
113
140
|
}),
|
|
114
141
|
children: [
|
|
115
|
-
/* @__PURE__ */ n(
|
|
116
|
-
|
|
142
|
+
B && /* @__PURE__ */ n("div", { className: e.icon, children: N || W[d] }),
|
|
143
|
+
/* @__PURE__ */ w(
|
|
144
|
+
"div",
|
|
117
145
|
{
|
|
118
|
-
className: e.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
children:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
146
|
+
className: S(e.textActionsContainer, {
|
|
147
|
+
[e.textActionsContainerVertical]: g
|
|
148
|
+
}),
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ n(
|
|
151
|
+
$.Label,
|
|
152
|
+
{
|
|
153
|
+
className: e.contentText,
|
|
154
|
+
ref: T,
|
|
155
|
+
typographyStyle: "contrast",
|
|
156
|
+
children: v
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
y && /* @__PURE__ */ n(
|
|
160
|
+
E.Link,
|
|
161
|
+
{
|
|
162
|
+
size: "s",
|
|
163
|
+
className: e.buttonLink,
|
|
164
|
+
buttonStyle: "contrast",
|
|
165
|
+
...y,
|
|
166
|
+
onClick: (t) => {
|
|
167
|
+
Q(y.onClick, t), j && c("timeout");
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
]
|
|
134
172
|
}
|
|
135
173
|
)
|
|
136
174
|
]
|
|
137
175
|
}
|
|
176
|
+
),
|
|
177
|
+
A && /* @__PURE__ */ n(
|
|
178
|
+
E,
|
|
179
|
+
{
|
|
180
|
+
iconLeft: /* @__PURE__ */ n(tt, {}),
|
|
181
|
+
onClick: () => c("close"),
|
|
182
|
+
mode: "tertiary",
|
|
183
|
+
size: "l",
|
|
184
|
+
buttonStyle: "contrast",
|
|
185
|
+
style: { padding: "0px" }
|
|
186
|
+
}
|
|
138
187
|
)
|
|
139
188
|
]
|
|
140
189
|
}
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
{
|
|
145
|
-
iconLeft: /* @__PURE__ */ n($, {}),
|
|
146
|
-
onClick: () => c("close"),
|
|
147
|
-
mode: "tertiary",
|
|
148
|
-
size: "l",
|
|
149
|
-
buttonStyle: "contrast",
|
|
150
|
-
style: { padding: "0px" }
|
|
151
|
-
}
|
|
152
|
-
)
|
|
153
|
-
] });
|
|
154
|
-
});
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
);
|
|
155
193
|
export {
|
|
156
|
-
|
|
194
|
+
St as Snackbar
|
|
157
195
|
};
|