prometeo-design-system 4.3.0 → 4.3.1
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/Avatar.es.js +41 -40
- package/dist/CardProfile-C1F83KJV.js +280 -0
- package/dist/CardProfile.es.js +3 -291
- package/dist/CheckBox.es.js +21 -24
- package/dist/DialogModal.es.js +46 -52
- package/dist/Icons/UserAvatar.es.js +4 -4
- package/dist/Input.es.js +72 -73
- package/dist/NotificationCard.es.js +21 -28
- package/dist/PlainTooltip.es.js +19 -19
- package/dist/PyrionLayout.es.js +810 -916
- package/dist/Scrollable.es.js +177 -322
- package/dist/Select.es.js +47 -47
- package/dist/SelectSearch.es.js +103 -107
- package/dist/TabLinks.es.js +121 -2
- package/dist/TicketCard.es.js +2 -2
- package/dist/Toast.es.js +51 -95
- package/dist/badge-CbqYNrl4.js +87 -0
- package/dist/components/Avatar/Avatar.d.ts +4 -2
- package/dist/components/CardProfile/CardProfile.d.ts +4 -7
- package/dist/components/DropZone/useFileDropzone.d.ts +1 -9
- package/dist/components/Layout/LayoutGeneric.d.ts +6 -0
- package/dist/components/NotificationCard/NotificationCard.d.ts +2 -3
- package/dist/components/PyrionNavigationDrawer/PLNotificationsList.d.ts +2 -5
- package/dist/components/PyrionNavigationDrawer/PLSidebar.d.ts +1 -3
- package/dist/components/PyrionNavigationDrawer/PLSidebarContent.d.ts +0 -2
- package/dist/components/PyrionNavigationDrawer/PLayoutBase.d.ts +0 -2
- package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +1 -4
- package/dist/components/Scrollable/Scrollable.d.ts +0 -29
- package/dist/components/Sidebar/SecondaryBar/SecondaryBar.d.ts +32 -0
- package/dist/components/Sidebar/SecondaryBar/hooks/useSecondaryBarAnimation.d.ts +2 -0
- package/dist/components/Sidebar/SecondaryBar/index.d.ts +1 -0
- package/dist/components/Sidebar/SidebarComposable.d.ts +43 -0
- package/dist/components/Sidebar/components/NavigationLink.d.ts +11 -0
- package/dist/components/Sidebar/components/company-logo.d.ts +5 -0
- package/dist/components/Sidebar/components/nav-actions.d.ts +7 -0
- package/dist/components/Sidebar/components/nav-links.d.ts +7 -0
- package/dist/components/Sidebar/context/SidebarContext.d.ts +13 -0
- package/dist/components/Sidebar/hooks/SidebarProvider.d.ts +3 -0
- package/dist/components/Sidebar/hooks/useNavBarActions.d.ts +9 -0
- package/dist/components/Sidebar/hooks/useNavBarCollapse.d.ts +4 -0
- package/dist/components/Sidebar/hooks/useNavLinks.d.ts +32 -0
- package/dist/components/Sidebar/hooks/useSidebarHook.d.ts +13 -0
- package/dist/components/Sidebar/index.d.ts +12 -0
- package/dist/components/Sidebar/ui/useNavbarAnimation.d.ts +2 -0
- package/dist/components/TabLinks/TabLinks.d.ts +0 -19
- package/dist/components/Toaster/Toaster.d.ts +1 -13
- package/dist/components/UserCard/UserCard.d.ts +2 -3
- package/dist/hooks/useLabelBackground.d.ts +0 -1
- package/dist/index.d.ts +16 -0
- package/dist/prometeo-design-system.es.js +2906 -119
- package/dist/styles.css +1 -1
- package/dist/useLabelBackground-BDIHUdND.js +26 -0
- package/package.json +2 -2
- package/dist/TabLinks-DxqprStp.js +0 -147
- package/dist/UserCard.d.ts +0 -6
- package/dist/UserCard.es.js +0 -28
- package/dist/badge-BEx-0Q-K.js +0 -35
- package/dist/exports/UserCard.d.ts +0 -2
- package/dist/useLabelBackground-D5SzHhl_.js +0 -32
package/dist/Input.es.js
CHANGED
|
@@ -2,13 +2,13 @@ import { j as t } from "./jsx-runtime-GkKLlHH4.js";
|
|
|
2
2
|
import { c as e } from "./cn-B6yFEsav.js";
|
|
3
3
|
import { memo as q, forwardRef as V, useState as F } from "react";
|
|
4
4
|
import ee from "./Spinner.es.js";
|
|
5
|
-
import { u as te } from "./useLabelBackground-
|
|
5
|
+
import { u as te } from "./useLabelBackground-BDIHUdND.js";
|
|
6
6
|
import { H as re } from "./HelperComponent-ljsn0xD6.js";
|
|
7
7
|
import { EyeVisibility as oe } from "./Icons/EyeVisibility.es.js";
|
|
8
8
|
import { EyeVisibilityOff as se } from "./Icons/EyeVisibilityOff.es.js";
|
|
9
9
|
import le from "./Button.es.js";
|
|
10
10
|
import { Close as ae } from "./Icons/Close.es.js";
|
|
11
|
-
const
|
|
11
|
+
const m = {
|
|
12
12
|
default: {
|
|
13
13
|
container: "",
|
|
14
14
|
input: e(
|
|
@@ -44,45 +44,45 @@ const x = {
|
|
|
44
44
|
}
|
|
45
45
|
}, $ = V(
|
|
46
46
|
({
|
|
47
|
-
label:
|
|
48
|
-
icon:
|
|
49
|
-
iconPosition:
|
|
47
|
+
label: x,
|
|
48
|
+
icon: s,
|
|
49
|
+
iconPosition: d = "left",
|
|
50
50
|
onChange: I,
|
|
51
51
|
value: S,
|
|
52
|
-
name:
|
|
52
|
+
name: h,
|
|
53
53
|
width: i = "100%",
|
|
54
|
-
height:
|
|
55
|
-
variant:
|
|
56
|
-
labelVariant:
|
|
54
|
+
height: l,
|
|
55
|
+
variant: a = "default",
|
|
56
|
+
labelVariant: o = "default",
|
|
57
57
|
size: E = "medium",
|
|
58
|
-
disabled:
|
|
58
|
+
disabled: u = !1,
|
|
59
59
|
type: r = "text",
|
|
60
60
|
isFetching: n,
|
|
61
|
-
errorComponent:
|
|
62
|
-
helperComponent:
|
|
61
|
+
errorComponent: b,
|
|
62
|
+
helperComponent: g,
|
|
63
63
|
placeholder: L,
|
|
64
|
-
required:
|
|
65
|
-
onFocus:
|
|
66
|
-
onBlur:
|
|
67
|
-
onKeyDown:
|
|
68
|
-
onKeyUp:
|
|
69
|
-
className:
|
|
70
|
-
style:
|
|
71
|
-
readOnly:
|
|
72
|
-
onClear:
|
|
64
|
+
required: j = !1,
|
|
65
|
+
onFocus: P,
|
|
66
|
+
onBlur: R,
|
|
67
|
+
onKeyDown: k,
|
|
68
|
+
onKeyUp: B,
|
|
69
|
+
className: C,
|
|
70
|
+
style: D,
|
|
71
|
+
readOnly: M = !1,
|
|
72
|
+
onClear: N,
|
|
73
73
|
onClickIcon: z,
|
|
74
74
|
...v
|
|
75
|
-
},
|
|
76
|
-
const [
|
|
77
|
-
let
|
|
78
|
-
|
|
75
|
+
}, O) => {
|
|
76
|
+
const [w, T] = F(!1), { ref: A } = te();
|
|
77
|
+
let f = E;
|
|
78
|
+
l && (f = "customHeight");
|
|
79
79
|
const c = {
|
|
80
80
|
small: {
|
|
81
81
|
container: "text-sm",
|
|
82
82
|
input: "h-10 px-3 text-[1rem] prometeo-fonts-body-large",
|
|
83
83
|
label: ` prometeo-fonts-label-large
|
|
84
84
|
peer-focus:prometeo-fonts-label-large
|
|
85
|
-
peer-placeholder-shown:${
|
|
85
|
+
peer-placeholder-shown:${o === "default" ? "prometeo-fonts-body-large" : "prometeo-fonts-label-large"} peer-placeholder-shown:text-neutral-medium-default peer-focus:text-neutral-medium-default `,
|
|
86
86
|
icon: "w-4 h-4 right-3"
|
|
87
87
|
},
|
|
88
88
|
medium: {
|
|
@@ -90,7 +90,7 @@ const x = {
|
|
|
90
90
|
input: "h-12 px-3 prometeo-fonts-body-large",
|
|
91
91
|
label: ` prometeo-fonts-label-large
|
|
92
92
|
peer-focus:prometeo-fonts-label-large
|
|
93
|
-
peer-placeholder-shown:${
|
|
93
|
+
peer-placeholder-shown:${o === "default" ? "prometeo-fonts-body-large" : "prometeo-fonts-label-large"} peer-placeholder-shown:text-neutral-medium-default text-neutral-medium-default peer-focus:text-neutral-medium-default `,
|
|
94
94
|
icon: "w-5 h-5 right-3"
|
|
95
95
|
},
|
|
96
96
|
large: {
|
|
@@ -106,113 +106,112 @@ const x = {
|
|
|
106
106
|
icon: "w-6 h-6 right-3"
|
|
107
107
|
}
|
|
108
108
|
}, G = () => {
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
i && i !== "100%" && (
|
|
112
|
-
const H =
|
|
109
|
+
T(!w);
|
|
110
|
+
}, y = {};
|
|
111
|
+
i && i !== "100%" && (y.width = i), l && (y.height = l);
|
|
112
|
+
const H = a === "error" && b, J = !H && g, K = r === "password", Q = () => o === "static" ? "-top-1 -translate-y-full left-0 pl-3" : s ? `${p ? "peer-placeholder-shown:top-[calc(50%-12px)]" : "peer-placeholder-shown:top-1/2"} -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1 peer-focus:ml-0 peer-focus:mr-0 ${d === "left" ? "peer-placeholder-shown:ml-6" : "peer-placeholder-shown:mr-6"}` : `${p ? "peer-placeholder-shown:top-[calc(50%-12px)]" : "peer-placeholder-shown:top-1/2"} -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1`, U = () => l ? c.customHeight.label : c[f].label, W = () => l ? { height: l } : {}, X = () => o === "default" ? x : L || x || "", Y = () => K ? s ? d === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : s ? d === "left" ? "pl-10 pr-3" : "pr-10 pl-3" : "", Z = o === "default" && "transition-all duration-200 ease-in-out", p = b || g;
|
|
113
113
|
return /* @__PURE__ */ t.jsxs(
|
|
114
114
|
"div",
|
|
115
115
|
{
|
|
116
116
|
className: e(
|
|
117
117
|
"relative",
|
|
118
|
-
c[
|
|
118
|
+
c[f].container,
|
|
119
119
|
!i && "w-full",
|
|
120
120
|
"bg-inherit",
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
o === "static" && "mt-2",
|
|
122
|
+
C
|
|
123
123
|
),
|
|
124
|
-
style: { ...
|
|
124
|
+
style: { ...D, ...y },
|
|
125
125
|
children: [
|
|
126
126
|
/* @__PURE__ */ t.jsx(
|
|
127
127
|
"input",
|
|
128
128
|
{
|
|
129
|
-
id:
|
|
130
|
-
name:
|
|
131
|
-
ref:
|
|
129
|
+
id: h,
|
|
130
|
+
name: h,
|
|
131
|
+
ref: O,
|
|
132
132
|
value: S,
|
|
133
133
|
placeholder: X(),
|
|
134
|
-
type: r === "password" &&
|
|
134
|
+
type: r === "password" && w ? "text" : r,
|
|
135
135
|
className: e(
|
|
136
136
|
"peer w-full border rounded-lg bg-transparent appearance-none transition-all duration-200 ease-in-out",
|
|
137
137
|
"focus:outline-none px-3",
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
c[
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
138
|
+
o === "default" && "placeholder:text-transparent",
|
|
139
|
+
o === "static" && "placeholder:text-neutral-medium-default ",
|
|
140
|
+
m[a].input,
|
|
141
|
+
c[f].input,
|
|
142
|
+
s && "pr-10",
|
|
143
|
+
u && "bg-transparent opacity-60 border-neutral-strong-default text-neutral-medium-disabled",
|
|
144
|
+
m[a].container,
|
|
145
145
|
Y()
|
|
146
146
|
),
|
|
147
147
|
style: W(),
|
|
148
148
|
onChange: I,
|
|
149
|
-
onFocus:
|
|
150
|
-
onBlur:
|
|
151
|
-
disabled:
|
|
152
|
-
required:
|
|
153
|
-
onKeyDown:
|
|
154
|
-
onKeyUp:
|
|
149
|
+
onFocus: P,
|
|
150
|
+
onBlur: R,
|
|
151
|
+
disabled: u,
|
|
152
|
+
required: j,
|
|
153
|
+
onKeyDown: k,
|
|
154
|
+
onKeyUp: B,
|
|
155
155
|
defaultValue: v.defaultValue,
|
|
156
|
-
readOnly:
|
|
156
|
+
readOnly: M,
|
|
157
157
|
...v
|
|
158
158
|
}
|
|
159
159
|
),
|
|
160
160
|
/* @__PURE__ */ t.jsx(
|
|
161
161
|
"label",
|
|
162
162
|
{
|
|
163
|
-
ref:
|
|
164
|
-
htmlFor:
|
|
163
|
+
ref: A,
|
|
164
|
+
htmlFor: h,
|
|
165
165
|
className: e(
|
|
166
166
|
"absolute left-3 pointer-events-none px-1 z-10",
|
|
167
167
|
Z,
|
|
168
168
|
U(),
|
|
169
|
-
|
|
169
|
+
m[a].label,
|
|
170
170
|
Q(),
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
j && "after:content-['*'] after:text-error-default after:ml-1",
|
|
172
|
+
u && "text-neutral-medium-disabled prometeo-fonts-label-large"
|
|
173
173
|
),
|
|
174
|
-
children:
|
|
174
|
+
children: x
|
|
175
175
|
}
|
|
176
176
|
),
|
|
177
|
-
(
|
|
177
|
+
(s || r === "password" || n) && /* @__PURE__ */ t.jsx(
|
|
178
178
|
"button",
|
|
179
179
|
{
|
|
180
180
|
tabIndex: -1,
|
|
181
181
|
type: "button",
|
|
182
182
|
className: e(
|
|
183
|
-
`absolute ${
|
|
184
|
-
c[
|
|
185
|
-
|
|
183
|
+
`absolute ${p ? "top-[calc(50%-12px)]" : "top-1/2"} -translate-y-1/2 flex items-center justify-center z-10`,
|
|
184
|
+
c[f].icon,
|
|
185
|
+
m[a].icon,
|
|
186
186
|
(r === "password" || z) && !n ? "cursor-pointer" : "pointer-events-none",
|
|
187
|
-
|
|
187
|
+
d === "right" ? "right-3" : "left-3"
|
|
188
188
|
),
|
|
189
189
|
onClick: n ? void 0 : r === "password" ? G : z,
|
|
190
190
|
onMouseDown: (_) => r === "password" && !n && _.preventDefault(),
|
|
191
191
|
children: /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
|
|
192
|
-
n && r !== "password" ? /* @__PURE__ */ t.jsx(ee, { variant: "sync", size: "small", className: "size-5" }) :
|
|
193
|
-
r === "password" && (
|
|
192
|
+
n && r !== "password" ? /* @__PURE__ */ t.jsx(ee, { variant: "sync", size: "small", className: "size-5" }) : s,
|
|
193
|
+
r === "password" && (w ? /* @__PURE__ */ t.jsx(oe, { size: 24, className: "" }) : /* @__PURE__ */ t.jsx(se, { size: 24, className: "" }))
|
|
194
194
|
] })
|
|
195
195
|
}
|
|
196
196
|
),
|
|
197
|
-
|
|
197
|
+
N && /* @__PURE__ */ t.jsx(
|
|
198
198
|
le,
|
|
199
199
|
{
|
|
200
200
|
type: "button",
|
|
201
201
|
className: e(
|
|
202
|
-
`absolute ${
|
|
202
|
+
`absolute ${p ? "top-[calc(50%-12px)]" : "top-1/2"} -translate-y-1/2 flex items-center justify-center z-10 right-1`,
|
|
203
203
|
"size-6 p-1 rounded-full",
|
|
204
204
|
"hover:bg-neutral-medium-hover transition-colors",
|
|
205
|
-
|
|
206
|
-
(o && l === "right" || r === "password" || n) && "mr-9"
|
|
205
|
+
u && "opacity-50 cursor-not-allowed"
|
|
207
206
|
),
|
|
208
|
-
disabled:
|
|
209
|
-
onClick:
|
|
207
|
+
disabled: u,
|
|
208
|
+
onClick: N,
|
|
210
209
|
variant: "text",
|
|
211
210
|
color: "secondary",
|
|
212
211
|
icon: /* @__PURE__ */ t.jsx(ae, { size: 20, className: "" })
|
|
213
212
|
}
|
|
214
213
|
),
|
|
215
|
-
|
|
214
|
+
p && /* @__PURE__ */ t.jsx("div", { className: "min-h-6", children: (H || J) && /* @__PURE__ */ t.jsx(re, { className: "absolute ", variant: a, children: b || g }) })
|
|
216
215
|
]
|
|
217
216
|
}
|
|
218
217
|
);
|
|
@@ -1,57 +1,50 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
-
import { useCallback as h } from "react";
|
|
3
2
|
import { c as o } from "./cn-B6yFEsav.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
[i, t]
|
|
12
|
-
);
|
|
13
|
-
return /* @__PURE__ */ e.jsxs("article", { className: o("flex flex-col gap-3 p-3 rounded-md bg-neutral-default-default ", f), onClick: x, children: [
|
|
14
|
-
/* @__PURE__ */ e.jsxs("div", { className: o("flex flex-col gap-2", i && "cursor-pointer"), children: [
|
|
3
|
+
import x from "./Avatar.es.js";
|
|
4
|
+
import p from "./Button.es.js";
|
|
5
|
+
const v = ({ user: i, body: t, date: a, actions: s, isNew: d, className: m, metadata: r }) => {
|
|
6
|
+
const f = typeof t == "function" ? t(r) : t, c = a instanceof Date ? `${a.toLocaleDateString("es-AR", { day: "2-digit", month: "2-digit", year: "numeric" })} a las ${a.toLocaleTimeString("es-AR", { hour: "2-digit", minute: "2-digit", hour12: !1 })}` : a;
|
|
7
|
+
return /* @__PURE__ */ e.jsxs("article", { className: o("flex flex-col gap-3 p-3 rounded-md bg-neutral-default-default ", m), children: [
|
|
8
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
15
9
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-start w-full", children: [
|
|
16
10
|
/* @__PURE__ */ e.jsxs("div", { className: " relative min-w-max", children: [
|
|
17
|
-
|
|
11
|
+
d && /* @__PURE__ */ e.jsx("div", { className: "size-3 border border-neutral-default bg-(--pyrion-orange-500) rounded-full absolute top-0 left-0 z-20" }),
|
|
18
12
|
/* @__PURE__ */ e.jsx(
|
|
19
|
-
|
|
13
|
+
x,
|
|
20
14
|
{
|
|
21
|
-
imageUrl:
|
|
22
|
-
fallbackText:
|
|
15
|
+
imageUrl: i.profile_picture,
|
|
16
|
+
fallbackText: i.name,
|
|
23
17
|
sizeFallback: "xs",
|
|
24
18
|
sizeImage: "xs"
|
|
25
19
|
}
|
|
26
20
|
)
|
|
27
21
|
] }),
|
|
28
|
-
/* @__PURE__ */ e.jsx("div", { className: "text-neutral-default-default prometeo-fonts-body-medium", children:
|
|
22
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-neutral-default-default prometeo-fonts-body-medium", children: f })
|
|
29
23
|
] }),
|
|
30
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-neutral-medium-default prometeo-fonts-body-xsmall text-right", children:
|
|
24
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-neutral-medium-default prometeo-fonts-body-xsmall text-right", children: c })
|
|
31
25
|
] }),
|
|
32
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2 w-full", children:
|
|
26
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-2 w-full", children: s?.map((l, n) => {
|
|
33
27
|
if (l.hidden)
|
|
34
28
|
return null;
|
|
35
|
-
const
|
|
36
|
-
|
|
29
|
+
const u = () => {
|
|
30
|
+
l.onClick(r);
|
|
37
31
|
};
|
|
38
32
|
return /* @__PURE__ */ e.jsx(
|
|
39
|
-
|
|
33
|
+
p,
|
|
40
34
|
{
|
|
41
|
-
className: o("flex-1 h-8", n === 0 &&
|
|
35
|
+
className: o("flex-1 h-8", n === 0 && s.length > 1 && "order-2"),
|
|
42
36
|
animate: !1,
|
|
43
37
|
animateIcon: !1,
|
|
44
38
|
label: l.label,
|
|
45
|
-
onClick:
|
|
46
|
-
variant: l.variant ||
|
|
39
|
+
onClick: u,
|
|
40
|
+
variant: l.variant || s.length > 1 ? n === 0 ? "fill" : "text" : "fill",
|
|
47
41
|
disabled: l.disabled,
|
|
48
42
|
size: "small"
|
|
49
|
-
}
|
|
50
|
-
l.label + n
|
|
43
|
+
}
|
|
51
44
|
);
|
|
52
45
|
}) })
|
|
53
46
|
] });
|
|
54
47
|
};
|
|
55
48
|
export {
|
|
56
|
-
|
|
49
|
+
v as default
|
|
57
50
|
};
|
package/dist/PlainTooltip.es.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
import { j as y } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
2
|
import { c as _ } from "./cn-B6yFEsav.js";
|
|
3
|
-
import { memo as j, useRef as v, useCallback as A, useEffect as
|
|
3
|
+
import { memo as j, useRef as v, useCallback as A, useEffect as a } from "react";
|
|
4
4
|
import { createPortal as C } from "react-dom";
|
|
5
5
|
const G = ({ title: w, children: p, delayToShow: x = 500, delayToClose: R = 1e3, className: B, attachToParent: d = !1, disabled: D = !1 }) => {
|
|
6
|
-
const s = v(null),
|
|
6
|
+
const s = v(null), r = v(null), n = v(null), o = A(() => {
|
|
7
7
|
if (typeof window > "u")
|
|
8
8
|
return;
|
|
9
|
-
const e =
|
|
9
|
+
const e = r.current, i = s.current;
|
|
10
10
|
if (!e || !i)
|
|
11
11
|
return;
|
|
12
12
|
const l = window.getComputedStyle(e).display, c = e.style.display, m = e.style.visibility, f = e.style.translate, h = l === "none";
|
|
13
13
|
h && (e.style.visibility = "hidden", e.style.display = "block"), f && e.style.removeProperty("translate");
|
|
14
14
|
const E = i.getBoundingClientRect();
|
|
15
15
|
d ? (e.style.removeProperty("position"), e.style.removeProperty("left"), e.style.removeProperty("top")) : (e.style.setProperty("position", "fixed"), e.style.setProperty("left", `${E.right}px`), e.style.setProperty("top", `${E.bottom}px`));
|
|
16
|
-
const
|
|
16
|
+
const u = e.getBoundingClientRect(), I = window.innerWidth, N = window.innerHeight, b = Math.max(0, 0 - u.left), M = Math.max(0, u.right - I), L = Math.max(0, 0 - u.top), P = Math.max(0, u.bottom - N), O = b > 0 ? b + 16 : M > 0 ? -(M + 16) : 0, T = L > 0 ? L + 16 : P > 0 ? -(P + 16) : 0;
|
|
17
17
|
O === 0 && T === 0 ? e.style.removeProperty("translate") : e.style.setProperty("translate", `${O}px ${T}px`), h && (e.style.display = c, e.style.visibility = m);
|
|
18
18
|
}, [d]);
|
|
19
|
-
if (
|
|
20
|
-
const t = s.current, e =
|
|
19
|
+
if (a(() => {
|
|
20
|
+
const t = s.current, e = r.current;
|
|
21
21
|
if (!t || !e)
|
|
22
22
|
return;
|
|
23
23
|
const i = (m, f) => {
|
|
24
|
-
|
|
24
|
+
n.current = setTimeout(() => {
|
|
25
25
|
f();
|
|
26
26
|
}, m);
|
|
27
27
|
}, l = () => {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
n.current && clearTimeout(n.current), o(), i(x, () => {
|
|
29
|
+
r.current?.classList.add("visible");
|
|
30
30
|
});
|
|
31
31
|
}, c = () => {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
n.current && clearTimeout(n.current), i(R, () => {
|
|
33
|
+
r.current?.classList.remove("visible");
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
return t.addEventListener("mouseenter", l), t.addEventListener("mouseleave", c), () => {
|
|
37
37
|
t.removeEventListener("mouseenter", l), t.removeEventListener("mouseleave", c);
|
|
38
38
|
};
|
|
39
|
-
}, [x, R, o]),
|
|
39
|
+
}, [x, R, o]), a(() => {
|
|
40
40
|
o();
|
|
41
|
-
}, [o, w]),
|
|
41
|
+
}, [o, w]), a(() => {
|
|
42
42
|
if (typeof window > "u")
|
|
43
43
|
return;
|
|
44
44
|
const t = () => {
|
|
45
|
-
|
|
45
|
+
r.current && r.current.classList.contains("visible") && o();
|
|
46
46
|
};
|
|
47
47
|
return window.addEventListener("resize", t), window.addEventListener("scroll", t, !0), () => {
|
|
48
48
|
window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0);
|
|
49
49
|
};
|
|
50
|
-
}, [o]),
|
|
51
|
-
|
|
50
|
+
}, [o]), a(() => () => {
|
|
51
|
+
n.current && clearTimeout(n.current);
|
|
52
52
|
}, []), D) return p;
|
|
53
|
-
const g = /* @__PURE__ */ y.jsx("span", { ref:
|
|
53
|
+
const g = /* @__PURE__ */ y.jsx("span", { ref: r, className: _(
|
|
54
54
|
"plain-tooltip ",
|
|
55
55
|
"absolute z-999",
|
|
56
56
|
"bg-neutral-weak-default px-2 py-1 rounded-lg w-max",
|
|
57
|
-
"text-neutral-strong-default prometeo-fonts-body-small
|
|
57
|
+
"text-neutral-strong-default prometeo-fonts-body-small ",
|
|
58
58
|
B,
|
|
59
|
-
|
|
59
|
+
r.current?.innerText?.length && r.current?.innerText?.length > Math.floor(450 / 10) ? "w-max line-clamp-1" : "max-w-[200px] line-clamp-none"
|
|
60
60
|
), children: w });
|
|
61
61
|
return !d && typeof document < "u" ? /* @__PURE__ */ y.jsxs("div", { ref: s, children: [
|
|
62
62
|
p,
|