@pibit.ai/cure-design-system 0.3.15 → 0.3.17
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/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -18
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +387 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +313 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +132 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +105 -0
- package/dist/patterns/table/TableWrapper.d.ts +0 -11
- package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
- package/dist/patterns/table/TableWrapper.js +72 -150
- package/dist/patterns/table/index.d.ts +2 -1
- package/dist/patterns/table/index.d.ts.map +1 -1
- package/dist/patterns/table/table.d.ts.map +1 -1
- package/dist/patterns/table/table.js +50 -44
- package/dist/patterns/tree-view/tree-view.d.ts +7 -1
- package/dist/patterns/tree-view/tree-view.d.ts.map +1 -1
- package/dist/patterns/tree-view/tree-view.js +77 -70
- package/dist/primitives/button/button-utility.js +7 -7
- package/dist/primitives/button/button.js +2 -2
- package/dist/primitives/tooltip/ellipsis-content.d.ts +12 -0
- package/dist/primitives/tooltip/ellipsis-content.d.ts.map +1 -0
- package/dist/primitives/tooltip/ellipsis-content.js +113 -0
- package/dist/primitives/tooltip/index.d.ts +1 -0
- package/dist/primitives/tooltip/index.d.ts.map +1 -1
- package/dist/styles/components.css +1 -1
- package/package.json +2 -1
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import { jsxs as A, jsx as r, Fragment as
|
|
1
|
+
import { jsxs as A, jsx as r, Fragment as E } from "react/jsx-runtime";
|
|
2
2
|
import { useState as $ } from "react";
|
|
3
3
|
import { SearchSm as T, ChevronDown as K, ChevronRight as V } from "@untitledui/icons";
|
|
4
4
|
import { cn as k } from "../../utils/cn.js";
|
|
5
5
|
import { Input as _ } from "../../primitives/input/input.js";
|
|
6
6
|
const N = 10;
|
|
7
|
-
function C(e,
|
|
7
|
+
function C(e, l, s = "") {
|
|
8
8
|
const {
|
|
9
|
-
labelKey:
|
|
9
|
+
labelKey: m,
|
|
10
10
|
childrenKey: n,
|
|
11
|
-
dataKey:
|
|
12
|
-
typeKey:
|
|
13
|
-
idKey:
|
|
14
|
-
maxDepth: i
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
dataKey: f = "metadata",
|
|
12
|
+
typeKey: x = "type",
|
|
13
|
+
idKey: h,
|
|
14
|
+
maxDepth: i,
|
|
15
|
+
defaultExpanded: g
|
|
16
|
+
} = l, v = s ? s.split(".").length : 0;
|
|
17
|
+
return i != null && v >= i ? [] : (Array.isArray(e) ? e : Object.values(e)).map((t, w) => {
|
|
18
|
+
const b = h != null ? t[h] : void 0, a = String(b ?? w), d = s ? `${s}.${a}` : a, c = t[n], o = Array.isArray(c) ? c : c != null ? Object.values(c) : [];
|
|
18
19
|
return {
|
|
19
|
-
id:
|
|
20
|
-
label:
|
|
21
|
-
type:
|
|
22
|
-
isOpen: !1,
|
|
23
|
-
children:
|
|
24
|
-
[
|
|
20
|
+
id: d,
|
|
21
|
+
label: t[m] ?? "Untitled",
|
|
22
|
+
type: t[x] ?? "Untitled",
|
|
23
|
+
isOpen: t.isOpen ?? g ?? !1,
|
|
24
|
+
children: o.length > 0 ? C(o, l, d) : [],
|
|
25
|
+
[f]: t
|
|
25
26
|
};
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
function O(e,
|
|
29
|
-
const s = e.label ?? "",
|
|
30
|
-
return s.toLowerCase().includes(
|
|
29
|
+
function O(e, l) {
|
|
30
|
+
const s = e.label ?? "", m = Array.isArray(e.children) ? e.children : [];
|
|
31
|
+
return s.toLowerCase().includes(l.toLowerCase()) ? !0 : m.some((n) => O(n, l));
|
|
31
32
|
}
|
|
32
33
|
const D = () => /* @__PURE__ */ r("div", { className: "flex h-[28px] items-center px-[13px] shrink-0", children: /* @__PURE__ */ r("div", { className: "relative h-full w-0 shrink-0", children: /* @__PURE__ */ r(
|
|
33
34
|
"div",
|
|
@@ -35,83 +36,89 @@ const D = () => /* @__PURE__ */ r("div", { className: "flex h-[28px] items-cente
|
|
|
35
36
|
className: "absolute inset-y-0 bg-(--color-border-secondary)",
|
|
36
37
|
style: { left: "-0.5px", width: 1 }
|
|
37
38
|
}
|
|
38
|
-
) }) }),
|
|
39
|
+
) }) }), I = ({
|
|
39
40
|
data: e,
|
|
40
|
-
config:
|
|
41
|
+
config: l,
|
|
41
42
|
CustomNode: s,
|
|
42
|
-
onNodeClick:
|
|
43
|
+
onNodeClick: m,
|
|
43
44
|
selectedNodeId: n,
|
|
44
|
-
showSearch:
|
|
45
|
-
searchPlaceholder:
|
|
46
|
-
searchClassName:
|
|
47
|
-
searchInputClassName: i
|
|
45
|
+
showSearch: f = !1,
|
|
46
|
+
searchPlaceholder: x = "Search...",
|
|
47
|
+
searchClassName: h,
|
|
48
|
+
searchInputClassName: i,
|
|
49
|
+
defaultExpanded: g
|
|
48
50
|
}) => {
|
|
49
|
-
const [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
const [v, y] = $(
|
|
52
|
+
() => C(e, {
|
|
53
|
+
...l,
|
|
54
|
+
defaultExpanded: g ?? l.defaultExpanded
|
|
55
|
+
})
|
|
56
|
+
), [t, w] = $("");
|
|
57
|
+
function b(a, d) {
|
|
58
|
+
const c = structuredClone(v), o = d.split("-"), p = Number(o[0]);
|
|
59
|
+
o.shift();
|
|
60
|
+
let u = c[p];
|
|
61
|
+
o.length > 0 && (u = o.reduce((L, j) => L.children[Number(j)], c[p])), u.isOpen = !u.isOpen, y(c);
|
|
55
62
|
}
|
|
56
63
|
return /* @__PURE__ */ A("div", { className: "min-w-max", children: [
|
|
57
|
-
|
|
64
|
+
f && /* @__PURE__ */ r("div", { className: k("mb-2", h), children: /* @__PURE__ */ r(
|
|
58
65
|
_,
|
|
59
66
|
{
|
|
60
67
|
type: "search",
|
|
61
|
-
placeholder:
|
|
62
|
-
value:
|
|
63
|
-
onChange: (
|
|
68
|
+
placeholder: x,
|
|
69
|
+
value: t,
|
|
70
|
+
onChange: (a) => w(a),
|
|
64
71
|
size: "sm",
|
|
65
72
|
className: i,
|
|
66
73
|
icon: T
|
|
67
74
|
}
|
|
68
75
|
) }),
|
|
69
|
-
/* @__PURE__ */ r("div", { className: "flex flex-col", children:
|
|
76
|
+
/* @__PURE__ */ r("div", { className: "flex flex-col", children: v.map((a, d) => /* @__PURE__ */ r(
|
|
70
77
|
S,
|
|
71
78
|
{
|
|
72
|
-
node:
|
|
73
|
-
parentId: String(
|
|
79
|
+
node: a,
|
|
80
|
+
parentId: String(d),
|
|
74
81
|
depth: 0,
|
|
75
|
-
handleToggle:
|
|
76
|
-
onNodeClick:
|
|
82
|
+
handleToggle: b,
|
|
83
|
+
onNodeClick: m,
|
|
77
84
|
selectedNodeId: n,
|
|
78
85
|
CustomNode: s,
|
|
79
|
-
query:
|
|
86
|
+
query: t
|
|
80
87
|
},
|
|
81
|
-
|
|
88
|
+
a.id || d
|
|
82
89
|
)) })
|
|
83
90
|
] });
|
|
84
91
|
};
|
|
85
|
-
|
|
92
|
+
I.displayName = "TreeView";
|
|
86
93
|
const S = ({
|
|
87
94
|
node: e,
|
|
88
|
-
parentId:
|
|
95
|
+
parentId: l,
|
|
89
96
|
depth: s = 0,
|
|
90
|
-
handleToggle:
|
|
97
|
+
handleToggle: m,
|
|
91
98
|
onNodeClick: n,
|
|
92
|
-
selectedNodeId:
|
|
93
|
-
CustomNode:
|
|
94
|
-
query:
|
|
99
|
+
selectedNodeId: f,
|
|
100
|
+
CustomNode: x,
|
|
101
|
+
query: h
|
|
95
102
|
}) => {
|
|
96
|
-
const i =
|
|
97
|
-
if (i && !O(e,
|
|
103
|
+
const i = h.length > 0, g = Array.isArray(e.children) ? e.children : [], v = e.label ?? "";
|
|
104
|
+
if (i && !O(e, h))
|
|
98
105
|
return null;
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
},
|
|
106
|
+
const y = g.length > 0, t = f != null && e.id === f, w = y && (i || (e.isOpen ?? !1)), b = (p) => {
|
|
107
|
+
p.stopPropagation(), y && (i || m(e, l), n == null || n(e));
|
|
108
|
+
}, a = s === 0 ? "pl-[6px]" : "", d = s === 0 ? "pl-[2px]" : "pl-[8px]", c = i && v.toLowerCase().includes(h.toLowerCase()), o = i ? !0 : e.isOpen;
|
|
102
109
|
return /* @__PURE__ */ A("div", { className: "relative", children: [
|
|
103
110
|
/* @__PURE__ */ A(
|
|
104
111
|
"div",
|
|
105
112
|
{
|
|
106
|
-
className: `flex h-[28px] w-full items-center pr-[8px] rounded-sm ${
|
|
107
|
-
onClick:
|
|
113
|
+
className: `flex h-[28px] w-full items-center pr-[8px] rounded-sm ${a} ${c ? "bg-(--color-bg-secondary)" : ""} ${y ? "cursor-pointer hover:bg-(--color-bg-secondary)" : ""}`,
|
|
114
|
+
onClick: b,
|
|
108
115
|
children: [
|
|
109
|
-
s > 0 && Array.from({ length: s }).map((
|
|
110
|
-
|
|
116
|
+
s > 0 && Array.from({ length: s }).map((p, u) => /* @__PURE__ */ r(D, {}, u)),
|
|
117
|
+
y ? /* @__PURE__ */ r(
|
|
111
118
|
"div",
|
|
112
119
|
{
|
|
113
|
-
className: `flex flex-col h-full items-center shrink-0 ${
|
|
114
|
-
children:
|
|
120
|
+
className: `flex flex-col h-full items-center shrink-0 ${d} ${o ? "justify-end" : "justify-center"}`,
|
|
121
|
+
children: o ? /* @__PURE__ */ A(E, { children: [
|
|
115
122
|
/* @__PURE__ */ r(
|
|
116
123
|
K,
|
|
117
124
|
{
|
|
@@ -135,27 +142,27 @@ const S = ({
|
|
|
135
142
|
)
|
|
136
143
|
}
|
|
137
144
|
) : s > 0 ? /* @__PURE__ */ r("div", { className: "h-full w-[6px] shrink-0" }) : null,
|
|
138
|
-
/* @__PURE__ */ r("div", { className: "flex flex-1 h-full items-center min-w-0 pl-[2px]", children: /* @__PURE__ */ r(
|
|
145
|
+
/* @__PURE__ */ r("div", { className: "flex flex-1 h-full items-center min-w-0 pl-[2px]", children: /* @__PURE__ */ r(x, { node: e, isSelected: t }) })
|
|
139
146
|
]
|
|
140
147
|
}
|
|
141
148
|
),
|
|
142
|
-
w && /* @__PURE__ */ r("div", { className: "relative", children:
|
|
149
|
+
w && /* @__PURE__ */ r("div", { className: "relative", children: g.map((p, u) => /* @__PURE__ */ r(
|
|
143
150
|
S,
|
|
144
151
|
{
|
|
145
|
-
node:
|
|
146
|
-
parentId: `${
|
|
152
|
+
node: p,
|
|
153
|
+
parentId: `${l}-${u}`,
|
|
147
154
|
depth: s + 1,
|
|
148
|
-
handleToggle:
|
|
155
|
+
handleToggle: m,
|
|
149
156
|
onNodeClick: n,
|
|
150
|
-
selectedNodeId:
|
|
151
|
-
CustomNode:
|
|
152
|
-
query:
|
|
157
|
+
selectedNodeId: f,
|
|
158
|
+
CustomNode: x,
|
|
159
|
+
query: h
|
|
153
160
|
},
|
|
154
|
-
|
|
161
|
+
p.id || `${l}-${u}`
|
|
155
162
|
)) })
|
|
156
163
|
] });
|
|
157
164
|
};
|
|
158
165
|
export {
|
|
159
|
-
|
|
166
|
+
I as TreeView,
|
|
160
167
|
C as buildTreeViewNodes
|
|
161
168
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as x, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { isValidElement as m } from "react";
|
|
3
|
-
import { Link as p, Button as
|
|
4
|
-
import { Tooltip as
|
|
5
|
-
import { cx as
|
|
3
|
+
import { Link as p, Button as y } from "react-aria-components";
|
|
4
|
+
import { Tooltip as b } from "../tooltip/tooltip.js";
|
|
5
|
+
import { cx as h } from "../../utils/cn.js";
|
|
6
6
|
import { isReactComponent as v } from "../../utils/is-react-component.js";
|
|
7
7
|
const g = {
|
|
8
8
|
secondary: "bg-primary text-fg-quaternary shadow-xs-skeumorphic ring-1 ring-secondary ring-inset hover:bg-primary_hover hover:text-fg-quaternary_hover disabled:shadow-xs disabled:ring-disabled_subtle",
|
|
@@ -27,7 +27,7 @@ const g = {
|
|
|
27
27
|
tooltipPlacement: u = "top",
|
|
28
28
|
...e
|
|
29
29
|
}) => {
|
|
30
|
-
const o = "href" in e ? e.href : void 0, f = o ? p :
|
|
30
|
+
const o = "href" in e ? e.href : void 0, f = o ? p : y;
|
|
31
31
|
let a = {};
|
|
32
32
|
o ? a = {
|
|
33
33
|
...e,
|
|
@@ -46,8 +46,8 @@ const g = {
|
|
|
46
46
|
{
|
|
47
47
|
"aria-label": i,
|
|
48
48
|
...a,
|
|
49
|
-
className:
|
|
50
|
-
"group relative inline-flex h-max cursor-pointer items-center justify-center rounded-md outline-focus-ring transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:text-fg-disabled_subtle",
|
|
49
|
+
className: h(
|
|
50
|
+
"group relative inline-flex h-max cursor-pointer items-center justify-center rounded-md outline-focus-ring transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50 disabled:text-fg-disabled_subtle",
|
|
51
51
|
g[l],
|
|
52
52
|
_[n],
|
|
53
53
|
// Icon styles
|
|
@@ -62,7 +62,7 @@ const g = {
|
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
64
|
return i ? /* @__PURE__ */ d(
|
|
65
|
-
|
|
65
|
+
b,
|
|
66
66
|
{
|
|
67
67
|
title: i,
|
|
68
68
|
placement: u,
|
|
@@ -10,7 +10,7 @@ const t = q({
|
|
|
10
10
|
// When button is used within `InputGroup`
|
|
11
11
|
"in-data-input-wrapper:focus:!z-50 in-data-input-wrapper:in-data-leading:-mr-px in-data-input-wrapper:in-data-leading:rounded-r-none in-data-input-wrapper:in-data-leading:before:rounded-r-none in-data-input-wrapper:in-data-trailing:-ml-px in-data-input-wrapper:in-data-trailing:rounded-l-none in-data-input-wrapper:in-data-trailing:before:rounded-l-none",
|
|
12
12
|
// Disabled styles
|
|
13
|
-
"disabled:cursor-not-allowed disabled:text-fg-disabled",
|
|
13
|
+
"disabled:cursor-not-allowed disabled:opacity-50 disabled:text-fg-disabled",
|
|
14
14
|
// Icon styles
|
|
15
15
|
"disabled:*:data-icon:text-fg-disabled_subtle",
|
|
16
16
|
// Same as `icon` but for SSR icons that cannot be passed to the client as functions.
|
|
@@ -63,7 +63,7 @@ const t = q({
|
|
|
63
63
|
root: [
|
|
64
64
|
"bg-primary text-secondary ring-1 ring-secondary ring-inset hover:bg-primary_hover hover:text-secondary_hover data-loading:bg-primary_hover",
|
|
65
65
|
// Disabled styles
|
|
66
|
-
"disabled:ring-disabled_subtle",
|
|
66
|
+
"disabled:bg-disabled_subtle disabled:ring-disabled_subtle",
|
|
67
67
|
// Icon styles
|
|
68
68
|
"*:data-icon:text-fg-quaternary hover:*:data-icon:text-fg-quaternary_hover"
|
|
69
69
|
].join(" ")
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type EllipsisContentWithTooltipProps = {
|
|
2
|
+
content: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
link?: boolean;
|
|
5
|
+
tooltipPosition?: "start" | "center" | "end";
|
|
6
|
+
tooltipSide?: "above" | "below";
|
|
7
|
+
textClassName?: string;
|
|
8
|
+
tooltipClassName?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const EllipsisContentWithTooltip: ({ content, className, link, textClassName, tooltipClassName, }: EllipsisContentWithTooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const createEllipsisContent: (content: string, className?: string, link?: boolean, tooltipPosition?: "start" | "center" | "end", tooltipSide?: "above" | "below", placeholder?: string, textClassName?: string, tooltipClassName?: string) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=ellipsis-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ellipsis-content.d.ts","sourceRoot":"","sources":["../../../src/primitives/tooltip/ellipsis-content.tsx"],"names":[],"mappings":"AAWA,MAAM,MAAM,+BAA+B,GAAG;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC7C,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,gEAMxC,+BAA+B,4CA4HjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,SAAS,MAAM,EACf,YAAW,MAAW,EACtB,OAAO,OAAO,EACd,kBAAiB,OAAO,GAAG,QAAQ,GAAG,KAAe,EACrD,cAAc,OAAO,GAAG,OAAO,EAC/B,cAAc,MAAM,EACpB,gBAAgB,MAAM,EACtB,mBAAmB,MAAM,4CAmB1B,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsxs as v, Fragment as y, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useRef as x, useEffect as b } from "react";
|
|
3
|
+
import { createPortal as P } from "react-dom";
|
|
4
|
+
import { computePosition as M, offset as $, autoPlacement as E, size as R, shift as W } from "../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js";
|
|
5
|
+
import { cx as T } from "../../utils/cn.js";
|
|
6
|
+
const j = ({
|
|
7
|
+
content: e,
|
|
8
|
+
className: c = "",
|
|
9
|
+
link: f = !1,
|
|
10
|
+
textClassName: m = "",
|
|
11
|
+
tooltipClassName: h = ""
|
|
12
|
+
}) => {
|
|
13
|
+
const [i, a] = w(!1), [p, g] = w({ top: -9999, left: -9999 }), o = x(null), s = x(null), n = x(null);
|
|
14
|
+
return b(() => () => {
|
|
15
|
+
n.current != null && clearTimeout(n.current);
|
|
16
|
+
}, []), b(() => {
|
|
17
|
+
if (!i || !o.current || !s.current) return;
|
|
18
|
+
let t = !1;
|
|
19
|
+
return M(o.current, s.current, {
|
|
20
|
+
middleware: [
|
|
21
|
+
$(8),
|
|
22
|
+
E({
|
|
23
|
+
allowedPlacements: [
|
|
24
|
+
"top-start",
|
|
25
|
+
"top",
|
|
26
|
+
"top-end",
|
|
27
|
+
"bottom-start",
|
|
28
|
+
"bottom",
|
|
29
|
+
"bottom-end"
|
|
30
|
+
]
|
|
31
|
+
}),
|
|
32
|
+
R({
|
|
33
|
+
padding: 8,
|
|
34
|
+
apply({ availableWidth: r, availableHeight: l, elements: d }) {
|
|
35
|
+
Object.assign(d.floating.style, {
|
|
36
|
+
maxWidth: `${Math.min(r, 512)}px`,
|
|
37
|
+
maxHeight: `${Math.min(l, window.innerHeight * 0.4)}px`
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}),
|
|
41
|
+
W({ padding: 8 })
|
|
42
|
+
]
|
|
43
|
+
}).then(({ x: r, y: l }) => {
|
|
44
|
+
t || g({ top: l, left: r });
|
|
45
|
+
}), () => {
|
|
46
|
+
t = !0;
|
|
47
|
+
};
|
|
48
|
+
}, [i]), /* @__PURE__ */ v(y, { children: [
|
|
49
|
+
/* @__PURE__ */ u(
|
|
50
|
+
"span",
|
|
51
|
+
{
|
|
52
|
+
ref: o,
|
|
53
|
+
className: T(
|
|
54
|
+
"whitespace-nowrap overflow-hidden text-ellipsis w-full block",
|
|
55
|
+
m,
|
|
56
|
+
c,
|
|
57
|
+
f ? "!text-[var(--color-brand-600)]" : ""
|
|
58
|
+
),
|
|
59
|
+
onMouseEnter: () => {
|
|
60
|
+
!o.current || !(o.current.scrollWidth > o.current.clientWidth) || (g({ top: -9999, left: -9999 }), a(!0));
|
|
61
|
+
},
|
|
62
|
+
onMouseLeave: (t) => {
|
|
63
|
+
var r;
|
|
64
|
+
(r = s.current) != null && r.contains(t.relatedTarget) || (n.current != null && clearTimeout(n.current), n.current = setTimeout(() => {
|
|
65
|
+
var l, d;
|
|
66
|
+
n.current = null, !((l = s.current) != null && l.matches(":hover")) && !((d = o.current) != null && d.matches(":hover")) && a(!1);
|
|
67
|
+
}, 100));
|
|
68
|
+
},
|
|
69
|
+
children: f ? /* @__PURE__ */ u("a", { href: e, target: "_blank", rel: "noopener noreferrer", children: e }) : e
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
i && P(
|
|
73
|
+
/* @__PURE__ */ u(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
"data-react-aria-top-layer": "true",
|
|
77
|
+
role: "tooltip",
|
|
78
|
+
ref: s,
|
|
79
|
+
className: T(
|
|
80
|
+
"fixed px-3 py-2 text-xs font-semibold text-white bg-primary-solid rounded-lg shadow-lg z-[9999] max-w-lg max-h-[40vh] overflow-y-auto break-words whitespace-normal",
|
|
81
|
+
h
|
|
82
|
+
),
|
|
83
|
+
style: {
|
|
84
|
+
top: `${p.top}px`,
|
|
85
|
+
left: `${p.left}px`
|
|
86
|
+
},
|
|
87
|
+
onClick: (t) => t.stopPropagation(),
|
|
88
|
+
onMouseLeave: (t) => {
|
|
89
|
+
var r;
|
|
90
|
+
(r = o.current) != null && r.contains(t.relatedTarget) || a(!1);
|
|
91
|
+
},
|
|
92
|
+
children: e
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
document.body
|
|
96
|
+
)
|
|
97
|
+
] });
|
|
98
|
+
}, N = (e, c = "", f, m = "start", h, i, a, p) => e === "" || e === "-" ? /* @__PURE__ */ u("span", { className: `text-left ${c}`, children: e || i || "-" }) : /* @__PURE__ */ u(
|
|
99
|
+
j,
|
|
100
|
+
{
|
|
101
|
+
content: e,
|
|
102
|
+
className: c,
|
|
103
|
+
link: f,
|
|
104
|
+
tooltipPosition: m,
|
|
105
|
+
tooltipSide: h,
|
|
106
|
+
textClassName: a,
|
|
107
|
+
tooltipClassName: p
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
export {
|
|
111
|
+
j as EllipsisContentWithTooltip,
|
|
112
|
+
N as createEllipsisContent
|
|
113
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,KAAK,+BAA+B,GACrC,MAAM,oBAAoB,CAAC"}
|