@tipp/ui 0.1.21 → 0.1.22
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/atoms/ellipsis-tooltip.cjs +129 -0
- package/dist/atoms/ellipsis-tooltip.cjs.map +1 -0
- package/dist/atoms/ellipsis-tooltip.d.cts +11 -0
- package/dist/atoms/ellipsis-tooltip.d.ts +11 -0
- package/dist/atoms/ellipsis-tooltip.js +10 -0
- package/dist/atoms/ellipsis-tooltip.js.map +1 -0
- package/dist/atoms/index.cjs +44 -0
- package/dist/atoms/index.cjs.map +1 -1
- package/dist/atoms/index.d.cts +1 -0
- package/dist/atoms/index.d.ts +1 -0
- package/dist/atoms/index.js +14 -10
- package/dist/chunk-2A2IJOVV.js +60 -0
- package/dist/chunk-2A2IJOVV.js.map +1 -0
- package/dist/chunk-2JZ3UQAX.js +48 -0
- package/dist/chunk-2JZ3UQAX.js.map +1 -0
- package/dist/chunk-2TGD62PR.js +59 -0
- package/dist/chunk-2TGD62PR.js.map +1 -0
- package/dist/chunk-3427FUJN.js +46 -0
- package/dist/chunk-3427FUJN.js.map +1 -0
- package/dist/chunk-34P2PUMC.js +60 -0
- package/dist/chunk-34P2PUMC.js.map +1 -0
- package/dist/chunk-3I5CDBFN.js +104 -0
- package/dist/chunk-3I5CDBFN.js.map +1 -0
- package/dist/chunk-3KIARYD6.js +47 -0
- package/dist/chunk-3KIARYD6.js.map +1 -0
- package/dist/chunk-4IKPNQV5.js +58 -0
- package/dist/chunk-4IKPNQV5.js.map +1 -0
- package/dist/chunk-4RIBUNMS.js +49 -0
- package/dist/chunk-4RIBUNMS.js.map +1 -0
- package/dist/chunk-4ZQHR3JI.js +47 -0
- package/dist/chunk-4ZQHR3JI.js.map +1 -0
- package/dist/chunk-6BXAZV7N.js +63 -0
- package/dist/chunk-6BXAZV7N.js.map +1 -0
- package/dist/chunk-6GHADQAU.js +59 -0
- package/dist/chunk-6GHADQAU.js.map +1 -0
- package/dist/chunk-6SGXBZAF.js +62 -0
- package/dist/chunk-6SGXBZAF.js.map +1 -0
- package/dist/chunk-6ZEM4FBF.js +64 -0
- package/dist/chunk-6ZEM4FBF.js.map +1 -0
- package/dist/chunk-754LMJ5L.js +48 -0
- package/dist/chunk-754LMJ5L.js.map +1 -0
- package/dist/chunk-7VCJMEPY.js +60 -0
- package/dist/chunk-7VCJMEPY.js.map +1 -0
- package/dist/chunk-AD4LGJER.js +60 -0
- package/dist/chunk-AD4LGJER.js.map +1 -0
- package/dist/chunk-AS6NXGBN.js +59 -0
- package/dist/chunk-AS6NXGBN.js.map +1 -0
- package/dist/chunk-BH2MBAAY.js +59 -0
- package/dist/chunk-BH2MBAAY.js.map +1 -0
- package/dist/chunk-C5QSBSVB.js +59 -0
- package/dist/chunk-C5QSBSVB.js.map +1 -0
- package/dist/chunk-C7BS7VPF.js +46 -0
- package/dist/chunk-C7BS7VPF.js.map +1 -0
- package/dist/chunk-CC3GT7LT.js +53 -0
- package/dist/chunk-CC3GT7LT.js.map +1 -0
- package/dist/chunk-CHHLIPDN.js +23 -0
- package/dist/chunk-CHHLIPDN.js.map +1 -0
- package/dist/chunk-CMPIGFPT.js +60 -0
- package/dist/chunk-CMPIGFPT.js.map +1 -0
- package/dist/chunk-CODQBUIC.js +59 -0
- package/dist/chunk-CODQBUIC.js.map +1 -0
- package/dist/chunk-CVOLVQKD.js +60 -0
- package/dist/chunk-CVOLVQKD.js.map +1 -0
- package/dist/chunk-CXFAL52D.js +60 -0
- package/dist/chunk-CXFAL52D.js.map +1 -0
- package/dist/chunk-E6EPYWFL.js +53 -0
- package/dist/chunk-E6EPYWFL.js.map +1 -0
- package/dist/chunk-EJWIO6NJ.js +104 -0
- package/dist/chunk-EJWIO6NJ.js.map +1 -0
- package/dist/chunk-EM57H7XC.js +48 -0
- package/dist/chunk-EM57H7XC.js.map +1 -0
- package/dist/chunk-FHXW7BLD.js +61 -0
- package/dist/chunk-FHXW7BLD.js.map +1 -0
- package/dist/chunk-FVSPOU5C.js +48 -0
- package/dist/chunk-FVSPOU5C.js.map +1 -0
- package/dist/chunk-GOKKEO23.js +53 -0
- package/dist/chunk-GOKKEO23.js.map +1 -0
- package/dist/chunk-HRQSHRGQ.js +59 -0
- package/dist/chunk-HRQSHRGQ.js.map +1 -0
- package/dist/chunk-HVMWNAXK.js +60 -0
- package/dist/chunk-HVMWNAXK.js.map +1 -0
- package/dist/chunk-I6D4HPRN.js +60 -0
- package/dist/chunk-I6D4HPRN.js.map +1 -0
- package/dist/chunk-I7YPDRXO.js +62 -0
- package/dist/chunk-I7YPDRXO.js.map +1 -0
- package/dist/chunk-JJ5IIAB2.js +119 -0
- package/dist/chunk-JJ5IIAB2.js.map +1 -0
- package/dist/chunk-KFAG5R3H.js +64 -0
- package/dist/chunk-KFAG5R3H.js.map +1 -0
- package/dist/chunk-KGN7AVRJ.js +45 -0
- package/dist/chunk-KGN7AVRJ.js.map +1 -0
- package/dist/chunk-KXJM7U4I.js +47 -0
- package/dist/chunk-KXJM7U4I.js.map +1 -0
- package/dist/chunk-LA6FLXGE.js +47 -0
- package/dist/chunk-LA6FLXGE.js.map +1 -0
- package/dist/chunk-MASTHXWN.js +1 -0
- package/dist/chunk-MASTHXWN.js.map +1 -0
- package/dist/chunk-NFGNQEVV.js +46 -0
- package/dist/chunk-NFGNQEVV.js.map +1 -0
- package/dist/chunk-O4GMX5TL.js +55 -0
- package/dist/chunk-O4GMX5TL.js.map +1 -0
- package/dist/chunk-OJ5XUBZN.js +46 -0
- package/dist/chunk-OJ5XUBZN.js.map +1 -0
- package/dist/chunk-PLG3AXHM.js +59 -0
- package/dist/chunk-PLG3AXHM.js.map +1 -0
- package/dist/chunk-PQBRLX37.js +48 -0
- package/dist/chunk-PQBRLX37.js.map +1 -0
- package/dist/chunk-QIKFIRGO.js +59 -0
- package/dist/chunk-QIKFIRGO.js.map +1 -0
- package/dist/chunk-RAJAKQXU.js +59 -0
- package/dist/chunk-RAJAKQXU.js.map +1 -0
- package/dist/chunk-RNB2T5NJ.js +48 -0
- package/dist/chunk-RNB2T5NJ.js.map +1 -0
- package/dist/chunk-TBXRPM4O.js +59 -0
- package/dist/chunk-TBXRPM4O.js.map +1 -0
- package/dist/chunk-TJGELI4L.js +53 -0
- package/dist/chunk-TJGELI4L.js.map +1 -0
- package/dist/chunk-TVJ4Z7MD.js +46 -0
- package/dist/chunk-TVJ4Z7MD.js.map +1 -0
- package/dist/chunk-UCEASXHW.js +47 -0
- package/dist/chunk-UCEASXHW.js.map +1 -0
- package/dist/chunk-UGSJR77F.js +48 -0
- package/dist/chunk-UGSJR77F.js.map +1 -0
- package/dist/chunk-UQPA2QGC.js +45 -0
- package/dist/chunk-UQPA2QGC.js.map +1 -0
- package/dist/chunk-V2AYMNSS.js +46 -0
- package/dist/chunk-V2AYMNSS.js.map +1 -0
- package/dist/chunk-VC2TT56B.js +46 -0
- package/dist/chunk-VC2TT56B.js.map +1 -0
- package/dist/chunk-VCOQG6JF.js +119 -0
- package/dist/chunk-VCOQG6JF.js.map +1 -0
- package/dist/chunk-VOR32EFU.js +59 -0
- package/dist/chunk-VOR32EFU.js.map +1 -0
- package/dist/chunk-W6Z2XJJ2.js +45 -0
- package/dist/chunk-W6Z2XJJ2.js.map +1 -0
- package/dist/chunk-WG7AQQRT.js +59 -0
- package/dist/chunk-WG7AQQRT.js.map +1 -0
- package/dist/chunk-WZZEI2W4.js +59 -0
- package/dist/chunk-WZZEI2W4.js.map +1 -0
- package/dist/chunk-XDCANCKF.js +59 -0
- package/dist/chunk-XDCANCKF.js.map +1 -0
- package/dist/chunk-XZN2SS2K.js +119 -0
- package/dist/chunk-XZN2SS2K.js.map +1 -0
- package/dist/chunk-YGS4JU4E.js +60 -0
- package/dist/chunk-YGS4JU4E.js.map +1 -0
- package/dist/chunk-YKEXHUPR.js +48 -0
- package/dist/chunk-YKEXHUPR.js.map +1 -0
- package/dist/index.cjs +79 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20 -16
- package/dist/molecules/expand-table/index.cjs +37 -33
- package/dist/molecules/expand-table/index.cjs.map +1 -1
- package/dist/molecules/expand-table/index.js +5 -4
- package/dist/molecules/expand-table/row.cjs +13 -9
- package/dist/molecules/expand-table/row.cjs.map +1 -1
- package/dist/molecules/expand-table/row.js +5 -4
- package/dist/molecules/index.cjs +37 -33
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.js +5 -4
- package/package.json +1 -1
- package/src/atoms/ellipsis-tooltip.tsx +57 -0
- package/src/atoms/index.ts +2 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip
|
|
3
|
+
} from "./chunk-ACVANQJ4.js";
|
|
4
|
+
import {
|
|
5
|
+
Typo
|
|
6
|
+
} from "./chunk-O3XTRD7R.js";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-N552FDTV.js";
|
|
12
|
+
|
|
13
|
+
// src/atoms/ellipsis-tooltip.tsx
|
|
14
|
+
import { useEffect, useRef, useState } from "react";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
function EllipsisTooltip(props) {
|
|
17
|
+
const _a = props, { children, style, lineClamp = 2 } = _a, rest = __objRest(_a, ["children", "style", "lineClamp"]);
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
const [tooltipDisplay, setTooltipDisplay] = useState(
|
|
20
|
+
"none"
|
|
21
|
+
);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (ref.current) {
|
|
24
|
+
const typo = ref.current;
|
|
25
|
+
if (typo.scrollWidth > typo.clientWidth) {
|
|
26
|
+
setTooltipDisplay("block");
|
|
27
|
+
} else {
|
|
28
|
+
setTooltipDisplay("none");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}, []);
|
|
32
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: children, style: { display: tooltipDisplay }, children: /* @__PURE__ */ jsx(
|
|
33
|
+
Typo,
|
|
34
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
35
|
+
ref,
|
|
36
|
+
style: __spreadValues({
|
|
37
|
+
width: "100%",
|
|
38
|
+
textOverflow: "ellipsis",
|
|
39
|
+
overflow: "hidden",
|
|
40
|
+
WebkitLineClamp: lineClamp,
|
|
41
|
+
display: "-webkit-box",
|
|
42
|
+
WebkitBoxOrient: "vertical",
|
|
43
|
+
wordBreak: "break-word"
|
|
44
|
+
}, style),
|
|
45
|
+
children
|
|
46
|
+
})
|
|
47
|
+
) });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
EllipsisTooltip
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=chunk-CC3GT7LT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/ellipsis-tooltip.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport { Tooltip } from './tooltip';\nimport { Typo, type TypoProps } from './typo';\n\nexport type EllipsisTooltipProps = TypoProps & {\n lineClamp?: number;\n};\n\nexport function EllipsisTooltip(props: EllipsisTooltipProps): React.ReactNode {\n const { children, style, lineClamp = 2, ...rest } = props;\n const ref = useRef<HTMLSpanElement>(null);\n \n const [tooltipDisplay, setTooltipDisplay] = useState<'none' | 'block'>(\n 'none'\n );\n\n useEffect(() => {\n if (ref.current) {\n const typo = ref.current;\n if (typo.scrollWidth > typo.clientWidth) {\n setTooltipDisplay('block');\n } else {\n setTooltipDisplay('none');\n }\n }\n }, []);\n\n return (\n <Tooltip content={children} style={{ display: tooltipDisplay }}>\n <Typo\n {...rest}\n ref={ref}\n style={{\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n WebkitLineClamp: lineClamp,\n\n display:'-webkit-box',\n WebkitBoxOrient: 'vertical',\n wordBreak: 'break-word',\n ...style,\n }}\n >\n {children}\n </Typo>\n </Tooltip>\n );\n} "],"mappings":";;;;;;;;;;;;;AAAA,SAA4B,WAAW,QAAQ,gBAAgB;AA6BzD;AArBC,SAAS,gBAAgB,OAA8C;AAC5E,QAAoD,YAA5C,YAAU,OAAO,YAAY,EATvC,IASsD,IAAT,iBAAS,IAAT,CAAnC,YAAU,SAAO;AACzB,QAAM,MAAM,OAAwB,IAAI;AAExC,QAAM,CAAC,gBAAgB,iBAAiB,IAAI;AAAA,IAC1C;AAAA,EACF;AAEA,YAAU,MAAM;AACd,QAAI,IAAI,SAAS;AACf,YAAM,OAAO,IAAI;AACjB,UAAI,KAAK,cAAc,KAAK,aAAa;AACvC,0BAAkB,OAAO;AAAA,MAC3B,OAAO;AACL,0BAAkB,MAAM;AAAA,MAC1B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SACE,oBAAC,WAAQ,SAAS,UAAU,OAAO,EAAE,SAAS,eAAe,GAC3D;AAAA,IAAC;AAAA,qCACK,OADL;AAAA,MAEC;AAAA,MACA,OAAO;AAAA,QACL,OAAO;AAAA,QACP,cAAc;AAAA,QACd,UAAU;AAAA,QACV,iBAAiB;AAAA,QAEjB,SAAQ;AAAA,QACR,iBAAiB;AAAA,QACjB,WAAW;AAAA,SACR;AAAA,MAGJ;AAAA;AAAA,EACH,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
import {
|
|
5
|
+
Typo
|
|
6
|
+
} from "./chunk-O3XTRD7R.js";
|
|
7
|
+
|
|
8
|
+
// src/atoms/field-error-wrapper.tsx
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
function FieldErrorWrapper({
|
|
11
|
+
children,
|
|
12
|
+
error
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "1", children: [
|
|
15
|
+
children,
|
|
16
|
+
error ? /* @__PURE__ */ jsx(Typo, { color: "red", variant: "caption", children: error }) : null
|
|
17
|
+
] });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
FieldErrorWrapper
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=chunk-CHHLIPDN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/field-error-wrapper.tsx"],"sourcesContent":["import React from 'react';\nimport { Flex } from './flex';\nimport { Typo } from './typo';\n\nexport interface FieldErrorWrapperProps {\n children?: React.ReactNode;\n error?: React.ReactNode;\n}\n\nexport function FieldErrorWrapper({\n children,\n error,\n}: FieldErrorWrapperProps): JSX.Element {\n return (\n <Flex direction=\"column\" gap=\"1\">\n {children}\n {error ? (\n <Typo color=\"red\" variant=\"caption\">\n {error}\n </Typo>\n ) : null}\n </Flex>\n );\n}\n"],"mappings":";;;;;;;;AAcI,SAGI,KAHJ;AALG,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AACF,GAAwC;AACtC,SACE,qBAAC,QAAK,WAAU,UAAS,KAAI,KAC1B;AAAA;AAAA,IACA,QACC,oBAAC,QAAK,OAAM,OAAM,SAAQ,WACvB,iBACH,IACE;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip
|
|
3
|
+
} from "./chunk-ACVANQJ4.js";
|
|
4
|
+
import {
|
|
5
|
+
Typo
|
|
6
|
+
} from "./chunk-O3XTRD7R.js";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-N552FDTV.js";
|
|
12
|
+
|
|
13
|
+
// src/atoms/ellipsis-tooltip.tsx
|
|
14
|
+
import { useEffect, useRef, useState } from "react";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
function EllipsisTooltip(props) {
|
|
17
|
+
const _a = props, { children, style, lineClamp = 2 } = _a, rest = __objRest(_a, ["children", "style", "lineClamp"]);
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
const [tooltipDisplay, setTooltipDisplay] = useState(
|
|
20
|
+
"none"
|
|
21
|
+
);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
var _a2, _b;
|
|
24
|
+
const mouseOver = () => {
|
|
25
|
+
if (ref.current) {
|
|
26
|
+
const typo = ref.current;
|
|
27
|
+
console.log(typo.scrollWidth, typo.clientWidth);
|
|
28
|
+
if (typo.innerText > children) {
|
|
29
|
+
setTooltipDisplay("block");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const mouseOut = () => {
|
|
34
|
+
setTooltipDisplay("none");
|
|
35
|
+
};
|
|
36
|
+
(_a2 = ref.current) == null ? void 0 : _a2.addEventListener("mouseenter", mouseOver);
|
|
37
|
+
(_b = ref.current) == null ? void 0 : _b.addEventListener("mouseleave", mouseOut);
|
|
38
|
+
}, [ref]);
|
|
39
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: children, style: { display: tooltipDisplay }, children: /* @__PURE__ */ jsx(
|
|
40
|
+
Typo,
|
|
41
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
42
|
+
ref,
|
|
43
|
+
style: __spreadValues({
|
|
44
|
+
width: "100%",
|
|
45
|
+
textOverflow: "ellipsis",
|
|
46
|
+
overflow: "hidden",
|
|
47
|
+
WebkitLineClamp: lineClamp,
|
|
48
|
+
display: "-webkit-box",
|
|
49
|
+
WebkitBoxOrient: "vertical",
|
|
50
|
+
wordBreak: "break-word"
|
|
51
|
+
}, style),
|
|
52
|
+
children
|
|
53
|
+
})
|
|
54
|
+
) });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
EllipsisTooltip
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=chunk-CMPIGFPT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/ellipsis-tooltip.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Tooltip } from './tooltip';\nimport { Typo, type TypoProps } from './typo';\n\nexport type EllipsisTooltipProps = TypoProps & {\n lineClamp?: number;\n children?: string;\n};\n\nexport function EllipsisTooltip(props: EllipsisTooltipProps): React.ReactNode {\n const { children, style, lineClamp = 2, ...rest } = props;\n const ref = useRef<HTMLSpanElement>(null);\n\n const [tooltipDisplay, setTooltipDisplay] = useState<'none' | 'block'>(\n 'none'\n );\n\n useEffect(() => {\n const mouseOver = ():void=>{\n if (ref.current) {\n const typo = ref.current;\n console.log(typo.scrollWidth, typo.clientWidth);\n if (typo.innerText > children) {\n setTooltipDisplay('block');\n }\n }\n }\n\n const mouseOut = ():void=>{\n setTooltipDisplay('none');\n }\n\n ref.current?.addEventListener('mouseenter',mouseOver);\n ref.current?.addEventListener('mouseleave',mouseOut);\n }, [ref]);\n\n return (\n <Tooltip content={children} style={{ display: tooltipDisplay }}>\n <Typo\n {...rest}\n ref={ref}\n style={{\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n WebkitLineClamp: lineClamp,\n\n display:'-webkit-box',\n WebkitBoxOrient: 'vertical',\n wordBreak: 'break-word',\n ...style,\n }}\n >\n {children}\n </Typo>\n </Tooltip>\n );\n}"],"mappings":";;;;;;;;;;;;;AAAA,SAAgB,WAAW,QAAQ,gBAAgB;AAsC7C;AA7BC,SAAS,gBAAgB,OAA8C;AAC5E,QAAoD,YAA5C,YAAU,OAAO,YAAY,EAVvC,IAUsD,IAAT,iBAAS,IAAT,CAAnC,YAAU,SAAO;AACzB,QAAM,MAAM,OAAwB,IAAI;AAExC,QAAM,CAAC,gBAAgB,iBAAiB,IAAI;AAAA,IAC1C;AAAA,EACF;AAEA,YAAU,MAAM;AAjBlB,QAAAA,KAAA;AAkBI,UAAM,YAAY,MAAS;AACzB,UAAI,IAAI,SAAS;AACf,cAAM,OAAO,IAAI;AACjB,gBAAQ,IAAI,KAAK,aAAa,KAAK,WAAW;AAC9C,YAAI,KAAK,YAAY,UAAU;AAC7B,4BAAkB,OAAO;AAAA,QAC3B;AAAA,MACF;AAAA,IACF;AAEA,UAAM,WAAW,MAAS;AACxB,wBAAkB,MAAM;AAAA,IAC1B;AAED,KAAAA,MAAA,IAAI,YAAJ,gBAAAA,IAAa,iBAAiB,cAAa;AAC3C,cAAI,YAAJ,mBAAa,iBAAiB,cAAa;AAAA,EAC5C,GAAG,CAAC,GAAG,CAAC;AAER,SACE,oBAAC,WAAQ,SAAS,UAAU,OAAO,EAAE,SAAS,eAAe,GAC3D;AAAA,IAAC;AAAA,qCACK,OADL;AAAA,MAEC;AAAA,MACA,OAAO;AAAA,QACL,OAAO;AAAA,QACP,cAAc;AAAA,QACd,UAAU;AAAA,QACV,iBAAiB;AAAA,QAEjB,SAAQ;AAAA,QACR,iBAAiB;AAAA,QACjB,WAAW;AAAA,SACR;AAAA,MAGJ;AAAA;AAAA,EACH,GACF;AAEJ;","names":["_a"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip
|
|
3
|
+
} from "./chunk-ACVANQJ4.js";
|
|
4
|
+
import {
|
|
5
|
+
Typo
|
|
6
|
+
} from "./chunk-O3XTRD7R.js";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-N552FDTV.js";
|
|
12
|
+
|
|
13
|
+
// src/atoms/ellipsis-tooltip.tsx
|
|
14
|
+
import { useEffect, useRef, useState } from "react";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
function EllipsisTooltip(props) {
|
|
17
|
+
const _a = props, { children, style, lineClamp = 2 } = _a, rest = __objRest(_a, ["children", "style", "lineClamp"]);
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
const [tooltipDisplay, setTooltipDisplay] = useState(
|
|
20
|
+
"none"
|
|
21
|
+
);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
var _a2, _b;
|
|
24
|
+
const mouseOver = () => {
|
|
25
|
+
if (ref.current) {
|
|
26
|
+
const typo = ref.current;
|
|
27
|
+
if (typo.clientHeight < typo.scrollHeight) {
|
|
28
|
+
setTooltipDisplay("block");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const mouseOut = () => {
|
|
33
|
+
setTooltipDisplay("none");
|
|
34
|
+
};
|
|
35
|
+
(_a2 = ref.current) == null ? void 0 : _a2.addEventListener("mouseenter", mouseOver);
|
|
36
|
+
(_b = ref.current) == null ? void 0 : _b.addEventListener("mouseleave", mouseOut);
|
|
37
|
+
}, [children]);
|
|
38
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: children, style: { display: tooltipDisplay }, children: /* @__PURE__ */ jsx(
|
|
39
|
+
Typo,
|
|
40
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
41
|
+
ref,
|
|
42
|
+
style: __spreadValues({
|
|
43
|
+
width: "100%",
|
|
44
|
+
textOverflow: "ellipsis",
|
|
45
|
+
overflow: "hidden",
|
|
46
|
+
WebkitLineClamp: lineClamp,
|
|
47
|
+
display: "-webkit-box",
|
|
48
|
+
WebkitBoxOrient: "vertical",
|
|
49
|
+
wordBreak: "break-word"
|
|
50
|
+
}, style),
|
|
51
|
+
children
|
|
52
|
+
})
|
|
53
|
+
) });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
EllipsisTooltip
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=chunk-CODQBUIC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/ellipsis-tooltip.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Tooltip } from './tooltip';\nimport { Typo, type TypoProps } from './typo';\n\nexport type EllipsisTooltipProps = TypoProps & {\n lineClamp?: number;\n children?: string;\n};\n\nexport function EllipsisTooltip(props: EllipsisTooltipProps): React.ReactNode {\n const { children, style, lineClamp = 2, ...rest } = props;\n const ref = useRef<HTMLSpanElement>(null);\n\n const [tooltipDisplay, setTooltipDisplay] = useState<'none' | 'block'>(\n 'none'\n );\n\n useEffect(() => {\n const mouseOver = ():void=>{\n if (ref.current ) {\n const typo = ref.current;\n if (typo.clientHeight < typo.scrollHeight) {\n setTooltipDisplay('block');\n }\n }\n }\n\n const mouseOut = ():void=>{\n setTooltipDisplay('none');\n }\n\n ref.current?.addEventListener('mouseenter',mouseOver);\n ref.current?.addEventListener('mouseleave',mouseOut);\n\n }, [children]);\n\n return (\n <Tooltip content={children} style={{ display: tooltipDisplay }}>\n <Typo\n {...rest}\n ref={ref}\n style={{\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n WebkitLineClamp: lineClamp,\n\n display:'-webkit-box',\n WebkitBoxOrient: 'vertical',\n wordBreak: 'break-word',\n ...style,\n }}\n >\n {children}\n </Typo>\n </Tooltip>\n );\n}"],"mappings":";;;;;;;;;;;;;AAAA,SAAgB,WAAW,QAAQ,gBAAgB;AAsC7C;AA7BC,SAAS,gBAAgB,OAA8C;AAC5E,QAAoD,YAA5C,YAAU,OAAO,YAAY,EAVvC,IAUsD,IAAT,iBAAS,IAAT,CAAnC,YAAU,SAAO;AACzB,QAAM,MAAM,OAAwB,IAAI;AAExC,QAAM,CAAC,gBAAgB,iBAAiB,IAAI;AAAA,IAC1C;AAAA,EACF;AAEA,YAAU,MAAM;AAjBlB,QAAAA,KAAA;AAkBI,UAAM,YAAY,MAAS;AACzB,UAAI,IAAI,SAAU;AAChB,cAAM,OAAO,IAAI;AACjB,YAAI,KAAK,eAAe,KAAK,cAAc;AACzC,4BAAkB,OAAO;AAAA,QAC3B;AAAA,MACF;AAAA,IACF;AAEA,UAAM,WAAW,MAAS;AACxB,wBAAkB,MAAM;AAAA,IAC1B;AAED,KAAAA,MAAA,IAAI,YAAJ,gBAAAA,IAAa,iBAAiB,cAAa;AAC3C,cAAI,YAAJ,mBAAa,iBAAiB,cAAa;AAAA,EAE5C,GAAG,CAAC,QAAQ,CAAC;AAEb,SACE,oBAAC,WAAQ,SAAS,UAAU,OAAO,EAAE,SAAS,eAAe,GAC3D;AAAA,IAAC;AAAA,qCACK,OADL;AAAA,MAEC;AAAA,MACA,OAAO;AAAA,QACL,OAAO;AAAA,QACP,cAAc;AAAA,QACd,UAAU;AAAA,QACV,iBAAiB;AAAA,QAEjB,SAAQ;AAAA,QACR,iBAAiB;AAAA,QACjB,WAAW;AAAA,SACR;AAAA,MAGJ;AAAA;AAAA,EACH,GACF;AAEJ;","names":["_a"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip
|
|
3
|
+
} from "./chunk-ACVANQJ4.js";
|
|
4
|
+
import {
|
|
5
|
+
Typo
|
|
6
|
+
} from "./chunk-O3XTRD7R.js";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-N552FDTV.js";
|
|
12
|
+
|
|
13
|
+
// src/atoms/ellipsis-tooltip.tsx
|
|
14
|
+
import { useEffect, useRef, useState } from "react";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
function EllipsisTooltip(props) {
|
|
17
|
+
const _a = props, { children, style, lineClamp = 2 } = _a, rest = __objRest(_a, ["children", "style", "lineClamp"]);
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
const [tooltipDisplay, setTooltipDisplay] = useState(
|
|
20
|
+
"none"
|
|
21
|
+
);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
var _a2, _b;
|
|
24
|
+
const mouseOver = () => {
|
|
25
|
+
if (ref.current && children) {
|
|
26
|
+
const typo = ref.current;
|
|
27
|
+
console.log(typo.innerText);
|
|
28
|
+
if (typo.innerText !== typo.textContent) {
|
|
29
|
+
setTooltipDisplay("block");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const mouseOut = () => {
|
|
34
|
+
setTooltipDisplay("none");
|
|
35
|
+
};
|
|
36
|
+
(_a2 = ref.current) == null ? void 0 : _a2.addEventListener("mouseenter", mouseOver);
|
|
37
|
+
(_b = ref.current) == null ? void 0 : _b.addEventListener("mouseleave", mouseOut);
|
|
38
|
+
}, [children]);
|
|
39
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: children, style: { display: tooltipDisplay }, children: /* @__PURE__ */ jsx(
|
|
40
|
+
Typo,
|
|
41
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
42
|
+
ref,
|
|
43
|
+
style: __spreadValues({
|
|
44
|
+
width: "100%",
|
|
45
|
+
textOverflow: "ellipsis",
|
|
46
|
+
overflow: "hidden",
|
|
47
|
+
WebkitLineClamp: lineClamp,
|
|
48
|
+
display: "-webkit-box",
|
|
49
|
+
WebkitBoxOrient: "vertical",
|
|
50
|
+
wordBreak: "break-word"
|
|
51
|
+
}, style),
|
|
52
|
+
children
|
|
53
|
+
})
|
|
54
|
+
) });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
EllipsisTooltip
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=chunk-CVOLVQKD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/ellipsis-tooltip.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Tooltip } from './tooltip';\nimport { Typo, type TypoProps } from './typo';\n\nexport type EllipsisTooltipProps = TypoProps & {\n lineClamp?: number;\n children?: string;\n};\n\nexport function EllipsisTooltip(props: EllipsisTooltipProps): React.ReactNode {\n const { children, style, lineClamp = 2, ...rest } = props;\n const ref = useRef<HTMLSpanElement>(null);\n\n const [tooltipDisplay, setTooltipDisplay] = useState<'none' | 'block'>(\n 'none'\n );\n\n useEffect(() => {\n const mouseOver = ():void=>{\n if (ref.current && children) {\n const typo = ref.current;\n console.log(typo.innerText);\n if (typo.innerText !== typo.textContent) {\n setTooltipDisplay('block');\n }\n }\n }\n\n const mouseOut = ():void=>{\n setTooltipDisplay('none');\n }\n\n ref.current?.addEventListener('mouseenter',mouseOver);\n ref.current?.addEventListener('mouseleave',mouseOut);\n }, [children]);\n\n return (\n <Tooltip content={children} style={{ display: tooltipDisplay }}>\n <Typo\n {...rest}\n ref={ref}\n style={{\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n WebkitLineClamp: lineClamp,\n\n display:'-webkit-box',\n WebkitBoxOrient: 'vertical',\n wordBreak: 'break-word',\n ...style,\n }}\n >\n {children}\n </Typo>\n </Tooltip>\n );\n}"],"mappings":";;;;;;;;;;;;;AAAA,SAAgB,WAAW,QAAQ,gBAAgB;AAsC7C;AA7BC,SAAS,gBAAgB,OAA8C;AAC5E,QAAoD,YAA5C,YAAU,OAAO,YAAY,EAVvC,IAUsD,IAAT,iBAAS,IAAT,CAAnC,YAAU,SAAO;AACzB,QAAM,MAAM,OAAwB,IAAI;AAExC,QAAM,CAAC,gBAAgB,iBAAiB,IAAI;AAAA,IAC1C;AAAA,EACF;AAEA,YAAU,MAAM;AAjBlB,QAAAA,KAAA;AAkBI,UAAM,YAAY,MAAS;AACzB,UAAI,IAAI,WAAW,UAAU;AAC3B,cAAM,OAAO,IAAI;AACjB,gBAAQ,IAAI,KAAK,SAAS;AAC1B,YAAI,KAAK,cAAc,KAAK,aAAa;AACvC,4BAAkB,OAAO;AAAA,QAC3B;AAAA,MACF;AAAA,IACF;AAEA,UAAM,WAAW,MAAS;AACxB,wBAAkB,MAAM;AAAA,IAC1B;AAED,KAAAA,MAAA,IAAI,YAAJ,gBAAAA,IAAa,iBAAiB,cAAa;AAC3C,cAAI,YAAJ,mBAAa,iBAAiB,cAAa;AAAA,EAC5C,GAAG,CAAC,QAAQ,CAAC;AAEb,SACE,oBAAC,WAAQ,SAAS,UAAU,OAAO,EAAE,SAAS,eAAe,GAC3D;AAAA,IAAC;AAAA,qCACK,OADL;AAAA,MAEC;AAAA,MACA,OAAO;AAAA,QACL,OAAO;AAAA,QACP,cAAc;AAAA,QACd,UAAU;AAAA,QACV,iBAAiB;AAAA,QAEjB,SAAQ;AAAA,QACR,iBAAiB;AAAA,QACjB,WAAW;AAAA,SACR;AAAA,MAGJ;AAAA;AAAA,EACH,GACF;AAEJ;","names":["_a"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip
|
|
3
|
+
} from "./chunk-ACVANQJ4.js";
|
|
4
|
+
import {
|
|
5
|
+
Typo
|
|
6
|
+
} from "./chunk-O3XTRD7R.js";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-N552FDTV.js";
|
|
12
|
+
|
|
13
|
+
// src/atoms/ellipsis-tooltip.tsx
|
|
14
|
+
import { useEffect, useRef, useState } from "react";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
function EllipsisTooltip(props) {
|
|
17
|
+
const _a = props, { children, style, lineClamp = 2 } = _a, rest = __objRest(_a, ["children", "style", "lineClamp"]);
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
const [tooltipDisplay, setTooltipDisplay] = useState(
|
|
20
|
+
"none"
|
|
21
|
+
);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
var _a2, _b;
|
|
24
|
+
const mouseOver = () => {
|
|
25
|
+
if (ref.current && children) {
|
|
26
|
+
const typo = ref.current;
|
|
27
|
+
console.log(typo.innerText);
|
|
28
|
+
if (typo.innerText !== children) {
|
|
29
|
+
setTooltipDisplay("block");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const mouseOut = () => {
|
|
34
|
+
setTooltipDisplay("none");
|
|
35
|
+
};
|
|
36
|
+
(_a2 = ref.current) == null ? void 0 : _a2.addEventListener("mouseenter", mouseOver);
|
|
37
|
+
(_b = ref.current) == null ? void 0 : _b.addEventListener("mouseleave", mouseOut);
|
|
38
|
+
}, [children]);
|
|
39
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: children, style: { display: tooltipDisplay }, children: /* @__PURE__ */ jsx(
|
|
40
|
+
Typo,
|
|
41
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
42
|
+
ref,
|
|
43
|
+
style: __spreadValues({
|
|
44
|
+
width: "100%",
|
|
45
|
+
textOverflow: "ellipsis",
|
|
46
|
+
overflow: "hidden",
|
|
47
|
+
WebkitLineClamp: lineClamp,
|
|
48
|
+
display: "-webkit-box",
|
|
49
|
+
WebkitBoxOrient: "vertical",
|
|
50
|
+
wordBreak: "break-word"
|
|
51
|
+
}, style),
|
|
52
|
+
children
|
|
53
|
+
})
|
|
54
|
+
) });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
EllipsisTooltip
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=chunk-CXFAL52D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/ellipsis-tooltip.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Tooltip } from './tooltip';\nimport { Typo, type TypoProps } from './typo';\n\nexport type EllipsisTooltipProps = TypoProps & {\n lineClamp?: number;\n children?: string;\n};\n\nexport function EllipsisTooltip(props: EllipsisTooltipProps): React.ReactNode {\n const { children, style, lineClamp = 2, ...rest } = props;\n const ref = useRef<HTMLSpanElement>(null);\n\n const [tooltipDisplay, setTooltipDisplay] = useState<'none' | 'block'>(\n 'none'\n );\n\n useEffect(() => {\n const mouseOver = ():void=>{\n if (ref.current && children) {\n const typo = ref.current;\n console.log(typo.innerText);\n if (typo.innerText !== children ) {\n setTooltipDisplay('block');\n }\n }\n }\n\n const mouseOut = ():void=>{\n setTooltipDisplay('none');\n }\n\n ref.current?.addEventListener('mouseenter',mouseOver);\n ref.current?.addEventListener('mouseleave',mouseOut);\n }, [children]);\n\n return (\n <Tooltip content={children} style={{ display: tooltipDisplay }}>\n <Typo\n {...rest}\n ref={ref}\n style={{\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n WebkitLineClamp: lineClamp,\n\n display:'-webkit-box',\n WebkitBoxOrient: 'vertical',\n wordBreak: 'break-word',\n ...style,\n }}\n >\n {children}\n </Typo>\n </Tooltip>\n );\n}"],"mappings":";;;;;;;;;;;;;AAAA,SAAgB,WAAW,QAAQ,gBAAgB;AAsC7C;AA7BC,SAAS,gBAAgB,OAA8C;AAC5E,QAAoD,YAA5C,YAAU,OAAO,YAAY,EAVvC,IAUsD,IAAT,iBAAS,IAAT,CAAnC,YAAU,SAAO;AACzB,QAAM,MAAM,OAAwB,IAAI;AAExC,QAAM,CAAC,gBAAgB,iBAAiB,IAAI;AAAA,IAC1C;AAAA,EACF;AAEA,YAAU,MAAM;AAjBlB,QAAAA,KAAA;AAkBI,UAAM,YAAY,MAAS;AACzB,UAAI,IAAI,WAAW,UAAU;AAC3B,cAAM,OAAO,IAAI;AACjB,gBAAQ,IAAI,KAAK,SAAS;AAC1B,YAAI,KAAK,cAAc,UAAW;AAChC,4BAAkB,OAAO;AAAA,QAC3B;AAAA,MACF;AAAA,IACF;AAEA,UAAM,WAAW,MAAS;AACxB,wBAAkB,MAAM;AAAA,IAC1B;AAED,KAAAA,MAAA,IAAI,YAAJ,gBAAAA,IAAa,iBAAiB,cAAa;AAC3C,cAAI,YAAJ,mBAAa,iBAAiB,cAAa;AAAA,EAC5C,GAAG,CAAC,QAAQ,CAAC;AAEb,SACE,oBAAC,WAAQ,SAAS,UAAU,OAAO,EAAE,SAAS,eAAe,GAC3D;AAAA,IAAC;AAAA,qCACK,OADL;AAAA,MAEC;AAAA,MACA,OAAO;AAAA,QACL,OAAO;AAAA,QACP,cAAc;AAAA,QACd,UAAU;AAAA,QACV,iBAAiB;AAAA,QAEjB,SAAQ;AAAA,QACR,iBAAiB;AAAA,QACjB,WAAW;AAAA,SACR;AAAA,MAGJ;AAAA;AAAA,EACH,GACF;AAEJ;","names":["_a"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip
|
|
3
|
+
} from "./chunk-ACVANQJ4.js";
|
|
4
|
+
import {
|
|
5
|
+
Typo
|
|
6
|
+
} from "./chunk-O3XTRD7R.js";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-N552FDTV.js";
|
|
12
|
+
|
|
13
|
+
// src/atoms/ellipsis-tooltip.tsx
|
|
14
|
+
import { useEffect, useRef, useState } from "react";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
function EllipsisTooltip(props) {
|
|
17
|
+
const _a = props, { children, style, lineClamp = 2 } = _a, rest = __objRest(_a, ["children", "style", "lineClamp"]);
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
const [tooltipDisplay, setTooltipDisplay] = useState(
|
|
20
|
+
"none"
|
|
21
|
+
);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (ref.current) {
|
|
24
|
+
const typo = ref.current;
|
|
25
|
+
if (typo.scrollWidth > typo.clientWidth) {
|
|
26
|
+
setTooltipDisplay("block");
|
|
27
|
+
} else {
|
|
28
|
+
setTooltipDisplay("none");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}, []);
|
|
32
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: children, style: { display: tooltipDisplay }, children: /* @__PURE__ */ jsx(
|
|
33
|
+
Typo,
|
|
34
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
35
|
+
ref: typoRef,
|
|
36
|
+
style: __spreadValues({
|
|
37
|
+
width: "100%",
|
|
38
|
+
textOverflow: "ellipsis",
|
|
39
|
+
overflow: "hidden",
|
|
40
|
+
WebkitLineClamp: lineClamp,
|
|
41
|
+
display: "-webkit-box",
|
|
42
|
+
WebkitBoxOrient: "vertical",
|
|
43
|
+
wordBreak: "break-word"
|
|
44
|
+
}, style),
|
|
45
|
+
children
|
|
46
|
+
})
|
|
47
|
+
) });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
EllipsisTooltip
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=chunk-E6EPYWFL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/ellipsis-tooltip.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport { Tooltip } from './tooltip';\nimport { Typo, type TypoProps } from './typo';\n\nexport type EllipsisTooltipProps = TypoProps & {\n lineClamp?: number;\n};\n\nexport function EllipsisTooltip(props: EllipsisTooltipProps): React.ReactNode {\n const { children, style, lineClamp = 2, ...rest } = props;\n const ref = useRef<HTMLSpanElement>(null);\n \n const [tooltipDisplay, setTooltipDisplay] = useState<'none' | 'block'>(\n 'none'\n );\n\n useEffect(() => {\n if (ref.current) {\n const typo = ref.current;\n if (typo.scrollWidth > typo.clientWidth) {\n setTooltipDisplay('block');\n } else {\n setTooltipDisplay('none');\n }\n }\n }, []);\n\n return (\n <Tooltip content={children} style={{ display: tooltipDisplay }}>\n <Typo\n {...rest}\n ref={typoRef}\n style={{\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n WebkitLineClamp: lineClamp,\n\n display:'-webkit-box',\n WebkitBoxOrient: 'vertical',\n wordBreak: 'break-word',\n ...style,\n }}\n >\n {children}\n </Typo>\n </Tooltip>\n );\n} "],"mappings":";;;;;;;;;;;;;AAAA,SAA4B,WAAW,QAAQ,gBAAgB;AA6BzD;AArBC,SAAS,gBAAgB,OAA8C;AAC5E,QAAoD,YAA5C,YAAU,OAAO,YAAY,EATvC,IASsD,IAAT,iBAAS,IAAT,CAAnC,YAAU,SAAO;AACzB,QAAM,MAAM,OAAwB,IAAI;AAExC,QAAM,CAAC,gBAAgB,iBAAiB,IAAI;AAAA,IAC1C;AAAA,EACF;AAEA,YAAU,MAAM;AACd,QAAI,IAAI,SAAS;AACf,YAAM,OAAO,IAAI;AACjB,UAAI,KAAK,cAAc,KAAK,aAAa;AACvC,0BAAkB,OAAO;AAAA,MAC3B,OAAO;AACL,0BAAkB,MAAM;AAAA,MAC1B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SACE,oBAAC,WAAQ,SAAS,UAAU,OAAO,EAAE,SAAS,eAAe,GAC3D;AAAA,IAAC;AAAA,qCACK,OADL;AAAA,MAEC,KAAK;AAAA,MACL,OAAO;AAAA,QACL,OAAO;AAAA,QACP,cAAc;AAAA,QACd,UAAU;AAAA,QACV,iBAAiB;AAAA,QAEjB,SAAQ;AAAA,QACR,iBAAiB;AAAA,QACjB,WAAW;AAAA,SACR;AAAA,MAGJ;AAAA;AAAA,EACH,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Typo
|
|
3
|
+
} from "./chunk-O3XTRD7R.js";
|
|
4
|
+
import {
|
|
5
|
+
Flex
|
|
6
|
+
} from "./chunk-25HMMI7R.js";
|
|
7
|
+
import {
|
|
8
|
+
IconButton
|
|
9
|
+
} from "./chunk-O3DNDMV3.js";
|
|
10
|
+
import {
|
|
11
|
+
ChevronLeftIcon,
|
|
12
|
+
ChevronRightIcon
|
|
13
|
+
} from "./chunk-MMAV5BRZ.js";
|
|
14
|
+
import {
|
|
15
|
+
__spreadProps,
|
|
16
|
+
__spreadValues
|
|
17
|
+
} from "./chunk-N552FDTV.js";
|
|
18
|
+
|
|
19
|
+
// src/atoms/pagination.tsx
|
|
20
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
21
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
function Pagination(props) {
|
|
23
|
+
const { onChange, count = 0 } = props;
|
|
24
|
+
const siblingCount = 2;
|
|
25
|
+
const [page, setPage] = useState(() => props.page || props.defaultPage || 1);
|
|
26
|
+
const visibleItems = useMemo(() => {
|
|
27
|
+
let start = Math.max(1, page - siblingCount);
|
|
28
|
+
let end = Math.min(count, page + siblingCount);
|
|
29
|
+
if (page - siblingCount <= 0 && end < count) {
|
|
30
|
+
end = Math.min(count, end + Math.abs(page - siblingCount) + 1);
|
|
31
|
+
} else if (page + siblingCount > count && start > 1) {
|
|
32
|
+
start = Math.max(1, start - (page + siblingCount - count));
|
|
33
|
+
}
|
|
34
|
+
return Array.from({ length: end - start + 1 }, (_, i) => i + start);
|
|
35
|
+
}, [count, page]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
onChange == null ? void 0 : onChange(page);
|
|
38
|
+
}, [onChange, page]);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (props.page) {
|
|
41
|
+
setPage(props.page);
|
|
42
|
+
}
|
|
43
|
+
}, [props.page]);
|
|
44
|
+
const onClickPrev = useCallback(() => {
|
|
45
|
+
setPage((prev) => Math.max(1, prev - 1));
|
|
46
|
+
}, []);
|
|
47
|
+
const onClickNext = useCallback(() => {
|
|
48
|
+
setPage((prev) => Math.min(count, prev + 1));
|
|
49
|
+
}, [count]);
|
|
50
|
+
const moveButtonProps = {
|
|
51
|
+
variant: "ghost",
|
|
52
|
+
size: "3",
|
|
53
|
+
style: { borderRadius: "50%" }
|
|
54
|
+
};
|
|
55
|
+
const iconSize = {
|
|
56
|
+
height: 24,
|
|
57
|
+
width: 24
|
|
58
|
+
};
|
|
59
|
+
const prevDisabled = useMemo(() => {
|
|
60
|
+
return page - siblingCount <= 1;
|
|
61
|
+
}, [page]);
|
|
62
|
+
const nextDisabled = useMemo(() => {
|
|
63
|
+
return page + siblingCount >= count;
|
|
64
|
+
}, [count, page]);
|
|
65
|
+
return /* @__PURE__ */ jsxs(Flex, { align: "center", className: "tipp-pagination", gap: "4", children: [
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
IconButton,
|
|
68
|
+
__spreadProps(__spreadValues({
|
|
69
|
+
disabled: prevDisabled,
|
|
70
|
+
onClick: onClickPrev
|
|
71
|
+
}, moveButtonProps), {
|
|
72
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, __spreadValues({}, iconSize))
|
|
73
|
+
})
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ jsx(Flex, { gap: "1", children: visibleItems.map((item) => {
|
|
76
|
+
return /* @__PURE__ */ jsx(
|
|
77
|
+
"button",
|
|
78
|
+
{
|
|
79
|
+
className: `page-button ${item === page ? "active" : ""}`,
|
|
80
|
+
onClick: () => {
|
|
81
|
+
setPage(item);
|
|
82
|
+
},
|
|
83
|
+
type: "button",
|
|
84
|
+
children: /* @__PURE__ */ jsx(Typo, { variant: "body", children: item })
|
|
85
|
+
},
|
|
86
|
+
item
|
|
87
|
+
);
|
|
88
|
+
}) }),
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
IconButton,
|
|
91
|
+
__spreadProps(__spreadValues({
|
|
92
|
+
disabled: nextDisabled,
|
|
93
|
+
onClick: onClickNext
|
|
94
|
+
}, moveButtonProps), {
|
|
95
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, __spreadValues({}, iconSize))
|
|
96
|
+
})
|
|
97
|
+
)
|
|
98
|
+
] });
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export {
|
|
102
|
+
Pagination
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=chunk-EJWIO6NJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/pagination.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { ChevronLeftIcon, ChevronRightIcon } from '../icon';\nimport type { IconButtonProps } from './icon-button';\nimport { IconButton } from './icon-button';\nimport { Flex } from './flex';\nimport { Typo } from './typo';\n\nexport interface PaginationProps {\n /** 현재 선택된 페이지 */\n page?: number;\n /** 기본 선택 페이지, page보다 낮은 우선 순위를 갖는다 */\n defaultPage?: number;\n /** 선택한 페이지 변경 이벤트 cb */\n onChange?: (page: number) => void;\n /** 전체 페이지의 수 */\n count?: number;\n}\n\nexport function Pagination(props: PaginationProps): React.ReactNode {\n const { onChange, count = 0 } = props;\n const siblingCount = 2;\n\n const [page, setPage] = useState(() => props.page || props.defaultPage || 1);\n\n const visibleItems = useMemo(() => {\n let start = Math.max(1, page - siblingCount);\n let end = Math.min(count, page + siblingCount);\n if (page - siblingCount <= 0 && end < count) {\n end = Math.min(count, end + Math.abs(page - siblingCount) + 1);\n } else if (page + siblingCount > count && start > 1) {\n start = Math.max(1, start - (page + siblingCount - count));\n }\n\n return Array.from({ length: end - start + 1 }, (_, i) => i + start);\n }, [count, page]);\n\n useEffect(() => {\n onChange?.(page);\n }, [onChange, page]);\n\n useEffect(() => {\n if (props.page) {\n setPage(props.page);\n }\n }, [props.page]);\n\n const onClickPrev = useCallback(() => {\n setPage((prev) => Math.max(1, prev - 1));\n }, []);\n\n const onClickNext = useCallback(() => {\n setPage((prev) => Math.min(count, prev + 1));\n }, [count]);\n\n const moveButtonProps: IconButtonProps = {\n variant: 'ghost',\n size: '3',\n style: { borderRadius: '50%' },\n };\n\n const iconSize = {\n height: 24,\n width: 24,\n };\n\n const prevDisabled = useMemo(() => {\n return page - siblingCount <= 1;\n }, [page]);\n\n const nextDisabled = useMemo(() => {\n return page + siblingCount >= count;\n }, [count, page]);\n\n return (\n <Flex align=\"center\" className=\"tipp-pagination\" gap=\"4\">\n <IconButton\n disabled={prevDisabled}\n onClick={onClickPrev}\n {...moveButtonProps}\n >\n <ChevronLeftIcon {...iconSize} />\n </IconButton>\n <Flex gap=\"1\">\n {visibleItems.map((item) => {\n return (\n <button\n className={`page-button ${item === page ? 'active' : ''}`}\n key={item}\n onClick={() => {\n setPage(item);\n }}\n type=\"button\"\n >\n <Typo variant=\"body\">{item}</Typo>\n </button>\n );\n })}\n </Flex>\n <IconButton\n disabled={nextDisabled}\n onClick={onClickNext}\n {...moveButtonProps}\n >\n <ChevronRightIcon {...iconSize} />\n </IconButton>\n </Flex>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,SAAgB,aAAa,WAAW,SAAS,gBAAgB;AA0E7D,SAMI,KANJ;AAxDG,SAAS,WAAW,OAAyC;AAClE,QAAM,EAAE,UAAU,QAAQ,EAAE,IAAI;AAChC,QAAM,eAAe;AAErB,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,MAAM,MAAM,QAAQ,MAAM,eAAe,CAAC;AAE3E,QAAM,eAAe,QAAQ,MAAM;AACjC,QAAI,QAAQ,KAAK,IAAI,GAAG,OAAO,YAAY;AAC3C,QAAI,MAAM,KAAK,IAAI,OAAO,OAAO,YAAY;AAC7C,QAAI,OAAO,gBAAgB,KAAK,MAAM,OAAO;AAC3C,YAAM,KAAK,IAAI,OAAO,MAAM,KAAK,IAAI,OAAO,YAAY,IAAI,CAAC;AAAA,IAC/D,WAAW,OAAO,eAAe,SAAS,QAAQ,GAAG;AACnD,cAAQ,KAAK,IAAI,GAAG,SAAS,OAAO,eAAe,MAAM;AAAA,IAC3D;AAEA,WAAO,MAAM,KAAK,EAAE,QAAQ,MAAM,QAAQ,EAAE,GAAG,CAAC,GAAG,MAAM,IAAI,KAAK;AAAA,EACpE,GAAG,CAAC,OAAO,IAAI,CAAC;AAEhB,YAAU,MAAM;AACd,yCAAW;AAAA,EACb,GAAG,CAAC,UAAU,IAAI,CAAC;AAEnB,YAAU,MAAM;AACd,QAAI,MAAM,MAAM;AACd,cAAQ,MAAM,IAAI;AAAA,IACpB;AAAA,EACF,GAAG,CAAC,MAAM,IAAI,CAAC;AAEf,QAAM,cAAc,YAAY,MAAM;AACpC,YAAQ,CAAC,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,CAAC;AAAA,EACzC,GAAG,CAAC,CAAC;AAEL,QAAM,cAAc,YAAY,MAAM;AACpC,YAAQ,CAAC,SAAS,KAAK,IAAI,OAAO,OAAO,CAAC,CAAC;AAAA,EAC7C,GAAG,CAAC,KAAK,CAAC;AAEV,QAAM,kBAAmC;AAAA,IACvC,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO,EAAE,cAAc,MAAM;AAAA,EAC/B;AAEA,QAAM,WAAW;AAAA,IACf,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAEA,QAAM,eAAe,QAAQ,MAAM;AACjC,WAAO,OAAO,gBAAgB;AAAA,EAChC,GAAG,CAAC,IAAI,CAAC;AAET,QAAM,eAAe,QAAQ,MAAM;AACjC,WAAO,OAAO,gBAAgB;AAAA,EAChC,GAAG,CAAC,OAAO,IAAI,CAAC;AAEhB,SACE,qBAAC,QAAK,OAAM,UAAS,WAAU,mBAAkB,KAAI,KACnD;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV,SAAS;AAAA,SACL,kBAHL;AAAA,QAKC,8BAAC,oCAAoB,SAAU;AAAA;AAAA,IACjC;AAAA,IACA,oBAAC,QAAK,KAAI,KACP,uBAAa,IAAI,CAAC,SAAS;AAC1B,aACE;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,eAAe,SAAS,OAAO,WAAW,EAAE;AAAA,UAEvD,SAAS,MAAM;AACb,oBAAQ,IAAI;AAAA,UACd;AAAA,UACA,MAAK;AAAA,UAEL,8BAAC,QAAK,SAAQ,QAAQ,gBAAK;AAAA;AAAA,QANtB;AAAA,MAOP;AAAA,IAEJ,CAAC,GACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV,SAAS;AAAA,SACL,kBAHL;AAAA,QAKC,8BAAC,qCAAqB,SAAU;AAAA;AAAA,IAClC;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip
|
|
3
|
+
} from "./chunk-ACVANQJ4.js";
|
|
4
|
+
import {
|
|
5
|
+
Typo
|
|
6
|
+
} from "./chunk-O3XTRD7R.js";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-N552FDTV.js";
|
|
12
|
+
|
|
13
|
+
// src/atoms/ellipsis-tooltip.tsx
|
|
14
|
+
import { forwardRef, useEffect, useRef, useState } from "react";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
var EllipsisTooltip = forwardRef((props, maybeRef) => {
|
|
17
|
+
const _a = props, { children, style, lineClamp = 2 } = _a, rest = __objRest(_a, ["children", "style", "lineClamp"]);
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
const typoRef = maybeRef || ref;
|
|
20
|
+
const [tooltipDisplay, setTooltipDisplay] = useState(
|
|
21
|
+
"none"
|
|
22
|
+
);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
}, []);
|
|
25
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: children, style: { display: tooltipDisplay }, children: /* @__PURE__ */ jsx(
|
|
26
|
+
Typo,
|
|
27
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
28
|
+
ref: typoRef,
|
|
29
|
+
style: __spreadValues({
|
|
30
|
+
width: "100%",
|
|
31
|
+
textOverflow: "ellipsis",
|
|
32
|
+
overflow: "hidden",
|
|
33
|
+
display: "-webkit-box",
|
|
34
|
+
WebkitLineClamp: lineClamp,
|
|
35
|
+
wordBreak: "break-word",
|
|
36
|
+
lineHeight: "1.5",
|
|
37
|
+
height: "calc(1.5 * 1em * 2)"
|
|
38
|
+
}, style),
|
|
39
|
+
children
|
|
40
|
+
})
|
|
41
|
+
) });
|
|
42
|
+
});
|
|
43
|
+
EllipsisTooltip.displayName = "EllipsisTooltip";
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
EllipsisTooltip
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=chunk-EM57H7XC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/ellipsis-tooltip.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport { Tooltip } from './tooltip';\nimport { Typo, type TypoProps } from './typo';\n\nexport type EllipsisTooltipProps = TypoProps & {\n lineClamp?: number;\n};\n\nexport const EllipsisTooltip = forwardRef<\n HTMLSpanElement,\n EllipsisTooltipProps\n>((props: EllipsisTooltipProps, maybeRef): React.ReactNode => {\n const { children, style, lineClamp = 2, ...rest } = props;\n const ref = useRef<HTMLSpanElement>(null);\n const typoRef = maybeRef || ref;\n const [tooltipDisplay, setTooltipDisplay] = useState<'none' | 'block'>(\n 'none'\n );\n\n useEffect(() => {\n // if (maybeRef) {\n // const typo = typoRef;\n // if (typo.scrollWidth > typo.clientWidth) {\n // setTooltipDisplay('block');\n // } else {\n // setTooltipDisplay('none');\n // }\n // }\n }, []);\n\n return (\n <Tooltip content={children} style={{ display: tooltipDisplay }}>\n <Typo\n {...rest}\n ref={typoRef}\n style={{\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n display:'-webkit-box',\n \n WebkitLineClamp: lineClamp,\n wordBreak: 'break-word',\n\n\n lineHeight: '1.5',\n height: 'calc(1.5 * 1em * 2)',\n ...style,\n }}\n >\n {children}\n </Typo>\n </Tooltip>\n );\n});\n\nEllipsisTooltip.displayName = 'EllipsisTooltip';\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAgB,YAAY,WAAW,QAAQ,gBAAgB;AAgCzD;AAxBC,IAAM,kBAAkB,WAG7B,CAAC,OAA6B,aAA8B;AAC5D,QAAoD,YAA5C,YAAU,OAAO,YAAY,EAZvC,IAYsD,IAAT,iBAAS,IAAT,CAAnC,YAAU,SAAO;AACzB,QAAM,MAAM,OAAwB,IAAI;AACxC,QAAM,UAAU,YAAY;AAC5B,QAAM,CAAC,gBAAgB,iBAAiB,IAAI;AAAA,IAC1C;AAAA,EACF;AAEA,YAAU,MAAM;AAAA,EAShB,GAAG,CAAC,CAAC;AAEL,SACE,oBAAC,WAAQ,SAAS,UAAU,OAAO,EAAE,SAAS,eAAe,GAC3D;AAAA,IAAC;AAAA,qCACK,OADL;AAAA,MAEC,KAAK;AAAA,MACL,OAAO;AAAA,QACL,OAAO;AAAA,QACP,cAAc;AAAA,QACd,UAAU;AAAA,QACV,SAAQ;AAAA,QAER,iBAAiB;AAAA,QACjB,WAAW;AAAA,QAGX,YAAY;AAAA,QACZ,QAAQ;AAAA,SACL;AAAA,MAGJ;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;AAED,gBAAgB,cAAc;","names":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip
|
|
3
|
+
} from "./chunk-ACVANQJ4.js";
|
|
4
|
+
import {
|
|
5
|
+
Typo
|
|
6
|
+
} from "./chunk-O3XTRD7R.js";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-N552FDTV.js";
|
|
12
|
+
|
|
13
|
+
// src/atoms/ellipsis-tooltip.tsx
|
|
14
|
+
import { useEffect, useRef, useState } from "react";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
function EllipsisTooltip(props) {
|
|
17
|
+
const _a = props, { children, style, lineClamp = 2 } = _a, rest = __objRest(_a, ["children", "style", "lineClamp"]);
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
const [tooltipDisplay, setTooltipDisplay] = useState(
|
|
20
|
+
"none"
|
|
21
|
+
);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
var _a2, _b;
|
|
24
|
+
const mouseOver = () => {
|
|
25
|
+
if (ref.current && children) {
|
|
26
|
+
const typo = ref.current;
|
|
27
|
+
console.log(typo.innerText);
|
|
28
|
+
console.log(typo.textContent);
|
|
29
|
+
if (typo.innerText !== typo.textContent) {
|
|
30
|
+
setTooltipDisplay("block");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const mouseOut = () => {
|
|
35
|
+
setTooltipDisplay("none");
|
|
36
|
+
};
|
|
37
|
+
(_a2 = ref.current) == null ? void 0 : _a2.addEventListener("mouseenter", mouseOver);
|
|
38
|
+
(_b = ref.current) == null ? void 0 : _b.addEventListener("mouseleave", mouseOut);
|
|
39
|
+
}, [children]);
|
|
40
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: children, style: { display: tooltipDisplay }, children: /* @__PURE__ */ jsx(
|
|
41
|
+
Typo,
|
|
42
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
43
|
+
ref,
|
|
44
|
+
style: __spreadValues({
|
|
45
|
+
width: "100%",
|
|
46
|
+
textOverflow: "ellipsis",
|
|
47
|
+
overflow: "hidden",
|
|
48
|
+
WebkitLineClamp: lineClamp,
|
|
49
|
+
display: "-webkit-box",
|
|
50
|
+
WebkitBoxOrient: "vertical",
|
|
51
|
+
wordBreak: "break-word"
|
|
52
|
+
}, style),
|
|
53
|
+
children
|
|
54
|
+
})
|
|
55
|
+
) });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
EllipsisTooltip
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=chunk-FHXW7BLD.js.map
|