skillgrid 0.0.81 → 0.0.83
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/Dialog/Dialog.module-OXi8ThCq.css +1 -0
- package/dist/components/Avatar/AvatarGroup/AvatarGroupRoot.js +5 -5
- package/dist/components/Dialog/Dialog.js +52 -47
- package/dist/components/Dialog/Dialog.module.css.js +13 -13
- package/dist/components/Dialog/lib/index.d.ts +1 -0
- package/dist/components/Dialog/lib/use-visual-viewport-center.d.ts +7 -0
- package/dist/components/Dialog/lib/use-visual-viewport-center.js +41 -0
- package/dist/components/Dialog/lib/use-visual-viewport-center.test.d.ts +1 -0
- package/dist/components/FileUpload/FileUpload.js +1 -1
- package/dist/components/InputBase/Input.js +6 -6
- package/dist/components/Popover/lib/use-popover.js +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +12 -12
- package/dist/components/Tabs/ScrollWrapper.js +1 -1
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +107 -100
- package/dist/index.cjs.js +3 -3
- package/dist/index.css +1 -1
- package/package.json +1 -1
- package/dist/assets/components/Dialog/Dialog.module-COQZK-Ta.css +0 -1
|
@@ -1,153 +1,160 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as o, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { useState as O, useEffect as N } from "react";
|
|
3
|
+
import q from "rc-tooltip";
|
|
4
4
|
import t from "./Tooltip.module.css.js";
|
|
5
|
-
import { clsx as
|
|
6
|
-
import { TOOLTIP_PLACEMENTS_M as
|
|
7
|
-
import { TooltipArrowIcon as
|
|
8
|
-
import { Typography as
|
|
9
|
-
import { mergeTooltipButtonProps as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { getIntInRange as
|
|
12
|
-
const
|
|
13
|
-
const r =
|
|
14
|
-
return
|
|
15
|
-
},
|
|
16
|
-
text:
|
|
17
|
-
title:
|
|
18
|
-
media:
|
|
5
|
+
import { clsx as A } from "clsx";
|
|
6
|
+
import { TOOLTIP_PLACEMENTS_M as C, TOOLTIP_PLACEMENTS_SMALL as D, BUTTON_PRESETS as H } from "./Tooltip.constants.js";
|
|
7
|
+
import { TooltipArrowIcon as U, CrossOutlinedIcon as $ } from "./assets/react-svg-icons.js";
|
|
8
|
+
import { Typography as _ } from "../Typography/Typography.js";
|
|
9
|
+
import { mergeTooltipButtonProps as G } from "./utils/merge-tooltip-button-props.js";
|
|
10
|
+
import { Button as J } from "../Button/Button.js";
|
|
11
|
+
import { getIntInRange as K } from "../../lib/get-int-in-range.js";
|
|
12
|
+
const Q = (y, p, a) => {
|
|
13
|
+
const r = K(p, 1, 3), l = H[a][r];
|
|
14
|
+
return l[Math.min(y, l.length - 1)];
|
|
15
|
+
}, R = ({
|
|
16
|
+
text: y,
|
|
17
|
+
title: p,
|
|
18
|
+
media: a,
|
|
19
19
|
variant: r = "neutral",
|
|
20
|
-
size:
|
|
21
|
-
classNames:
|
|
22
|
-
onClose:
|
|
20
|
+
size: l,
|
|
21
|
+
classNames: n = {},
|
|
22
|
+
onClose: s,
|
|
23
23
|
buttons: m,
|
|
24
|
-
buttonProps:
|
|
24
|
+
buttonProps: E,
|
|
25
25
|
showClose: d
|
|
26
26
|
}) => {
|
|
27
|
-
const
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
const e = ["neutral", "accent"].includes(r) ? "contrast" : "primary", i = l === "m", k = !!(p && i), B = !!(a && i), M = m && !!m.length, w = !!(d && i) || !d && i && !M, u = l === "xs" ? 4 : 3;
|
|
28
|
+
return /* @__PURE__ */ x("div", { className: t.content, children: [
|
|
29
|
+
B && /* @__PURE__ */ o("div", { className: A(t.mediaWrapper, n.mediaWrapper), children: a }),
|
|
30
|
+
/* @__PURE__ */ x("div", { className: n == null ? void 0 : n.textWrapper, children: [
|
|
31
|
+
k && /* @__PURE__ */ o(
|
|
32
|
+
_.Subtitle,
|
|
33
33
|
{
|
|
34
|
-
className:
|
|
34
|
+
className: A(t.typography, t.title, n.typography),
|
|
35
35
|
size: 1,
|
|
36
36
|
as: "h3",
|
|
37
|
-
typographyStyle:
|
|
38
|
-
children:
|
|
37
|
+
typographyStyle: e,
|
|
38
|
+
children: p
|
|
39
39
|
}
|
|
40
40
|
),
|
|
41
41
|
/* @__PURE__ */ o(
|
|
42
|
-
|
|
42
|
+
_.Label,
|
|
43
43
|
{
|
|
44
|
-
className:
|
|
45
|
-
typographyStyle:
|
|
44
|
+
className: A(t.typography, t.text, n.typography),
|
|
45
|
+
typographyStyle: e,
|
|
46
46
|
size: u,
|
|
47
|
-
children:
|
|
47
|
+
children: y
|
|
48
48
|
}
|
|
49
49
|
)
|
|
50
50
|
] }),
|
|
51
|
-
|
|
51
|
+
w && /* @__PURE__ */ o(
|
|
52
52
|
"button",
|
|
53
53
|
{
|
|
54
54
|
type: "button",
|
|
55
|
-
className:
|
|
56
|
-
[t.hasMedia]:
|
|
55
|
+
className: A(t.closeButton, t[r], n.closeButton, {
|
|
56
|
+
[t.hasMedia]: B
|
|
57
57
|
}),
|
|
58
|
-
onClick:
|
|
58
|
+
onClick: s,
|
|
59
59
|
"aria-label": "Закрыть подсказку",
|
|
60
60
|
"data-testid": "tooltip-close-button",
|
|
61
|
-
children: /* @__PURE__ */ o(
|
|
61
|
+
children: /* @__PURE__ */ o($, {})
|
|
62
62
|
}
|
|
63
63
|
),
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
return /* @__PURE__ */ o(
|
|
67
|
-
var
|
|
68
|
-
(
|
|
64
|
+
i && M && /* @__PURE__ */ o("div", { className: t.buttonStack, children: m.map((T, h) => {
|
|
65
|
+
const f = Q(h, m.length, r), I = G(T, f, E), { closeOnClick: S, ...c } = I;
|
|
66
|
+
return /* @__PURE__ */ o(J, { ...c, onClick: (L) => {
|
|
67
|
+
var g;
|
|
68
|
+
(g = c.onClick) == null || g.call(c, L), S && (s == null || s());
|
|
69
69
|
} }, h);
|
|
70
70
|
}) })
|
|
71
71
|
] });
|
|
72
72
|
}, lt = ({
|
|
73
|
-
customContent:
|
|
74
|
-
children:
|
|
75
|
-
placement:
|
|
73
|
+
customContent: y,
|
|
74
|
+
children: p,
|
|
75
|
+
placement: a = "top",
|
|
76
76
|
contentClassNames: r,
|
|
77
|
-
mouseEnterDelay:
|
|
78
|
-
mouseLeaveDelay:
|
|
79
|
-
showArrow:
|
|
77
|
+
mouseEnterDelay: l = 0,
|
|
78
|
+
mouseLeaveDelay: n = 0.1,
|
|
79
|
+
showArrow: s = !0,
|
|
80
80
|
showClose: m = !0,
|
|
81
|
-
trigger:
|
|
81
|
+
trigger: E = "hover",
|
|
82
82
|
variant: d = "neutral",
|
|
83
|
-
size:
|
|
84
|
-
text:
|
|
85
|
-
title:
|
|
86
|
-
media:
|
|
87
|
-
buttons:
|
|
88
|
-
buttonProps:
|
|
83
|
+
size: e = "s",
|
|
84
|
+
text: i,
|
|
85
|
+
title: k,
|
|
86
|
+
media: B,
|
|
87
|
+
buttons: M,
|
|
88
|
+
buttonProps: w,
|
|
89
89
|
onClose: u,
|
|
90
|
-
visible:
|
|
90
|
+
visible: T,
|
|
91
91
|
onVisibleChange: h,
|
|
92
|
-
|
|
92
|
+
classNames: f,
|
|
93
|
+
...I
|
|
93
94
|
}) => {
|
|
94
|
-
const [
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
|
|
95
|
+
const [S, c] = O(!!T), P = T !== void 0, [L, g] = O(!1), W = e === "m" ? C : D, v = () => {
|
|
96
|
+
P || c(!1), u == null || u();
|
|
97
|
+
}, j = (b) => {
|
|
98
|
+
P || c(b), h == null || h(b);
|
|
99
|
+
}, F = y || (e === "m" ? /* @__PURE__ */ o(
|
|
100
|
+
R,
|
|
100
101
|
{
|
|
101
102
|
classNames: r,
|
|
102
|
-
text:
|
|
103
|
+
text: i,
|
|
103
104
|
variant: d,
|
|
104
|
-
size:
|
|
105
|
-
onClose:
|
|
106
|
-
title:
|
|
107
|
-
media:
|
|
105
|
+
size: e,
|
|
106
|
+
onClose: v,
|
|
107
|
+
title: k,
|
|
108
|
+
media: B,
|
|
108
109
|
showClose: m,
|
|
109
|
-
buttons:
|
|
110
|
-
buttonProps:
|
|
110
|
+
buttons: M,
|
|
111
|
+
buttonProps: w
|
|
111
112
|
}
|
|
112
113
|
) : /* @__PURE__ */ o(
|
|
113
|
-
|
|
114
|
+
R,
|
|
114
115
|
{
|
|
115
116
|
classNames: r,
|
|
116
|
-
text:
|
|
117
|
+
text: i,
|
|
117
118
|
variant: d,
|
|
118
|
-
size:
|
|
119
|
-
onClose:
|
|
119
|
+
size: e,
|
|
120
|
+
onClose: v
|
|
120
121
|
}
|
|
121
122
|
));
|
|
122
|
-
return
|
|
123
|
-
if (
|
|
124
|
-
const
|
|
125
|
-
return () => cancelAnimationFrame(
|
|
123
|
+
return N(() => {
|
|
124
|
+
if (S) {
|
|
125
|
+
const b = requestAnimationFrame(() => g(!0));
|
|
126
|
+
return () => cancelAnimationFrame(b);
|
|
126
127
|
}
|
|
127
|
-
|
|
128
|
-
}, [
|
|
129
|
-
|
|
128
|
+
g(!1);
|
|
129
|
+
}, [S]), /* @__PURE__ */ o(
|
|
130
|
+
q,
|
|
130
131
|
{
|
|
131
|
-
visible:
|
|
132
|
-
onVisibleChange:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
overlay: R,
|
|
139
|
-
trigger: k,
|
|
140
|
-
mouseEnterDelay: c,
|
|
141
|
-
mouseLeaveDelay: e,
|
|
132
|
+
visible: P ? T : S,
|
|
133
|
+
onVisibleChange: j,
|
|
134
|
+
placement: a,
|
|
135
|
+
overlay: F,
|
|
136
|
+
trigger: E,
|
|
137
|
+
mouseEnterDelay: l,
|
|
138
|
+
mouseLeaveDelay: n,
|
|
142
139
|
motion: { motionName: "tooltipMotion" },
|
|
143
|
-
builtinPlacements:
|
|
144
|
-
showArrow:
|
|
145
|
-
content: /* @__PURE__ */ o(
|
|
146
|
-
className: `tooltipArrow tooltipArrow-${
|
|
140
|
+
builtinPlacements: W,
|
|
141
|
+
showArrow: s ? {
|
|
142
|
+
content: /* @__PURE__ */ o(U, {}),
|
|
143
|
+
className: `tooltipArrow tooltipArrow-${e}`
|
|
147
144
|
} : !1,
|
|
148
145
|
destroyTooltipOnHide: !0,
|
|
149
|
-
...
|
|
150
|
-
|
|
146
|
+
...I,
|
|
147
|
+
classNames: {
|
|
148
|
+
...f,
|
|
149
|
+
root: A(
|
|
150
|
+
t.root,
|
|
151
|
+
t[d],
|
|
152
|
+
t[e],
|
|
153
|
+
L && t.open,
|
|
154
|
+
f == null ? void 0 : f.root
|
|
155
|
+
)
|
|
156
|
+
},
|
|
157
|
+
children: p
|
|
151
158
|
}
|
|
152
159
|
);
|
|
153
160
|
};
|