@telegraph/truncate 0.0.10 → 0.0.11
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/CHANGELOG.md +7 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +18 -15
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/TooltipIfTruncated/TooltipIfTruncated.d.ts.map +1 -1
- package/dist/types/TruncatedText/TruncatedText.d.ts.map +1 -1
- package/dist/types/useTruncate/useTruncate.d.ts.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),T=require("@telegraph/helpers"),f=require("@telegraph/tooltip"),l=require("@telegraph/typography"),c=require("react"),a=({tgphRef:t},e=[])=>{const[r,s]=c.useState(!1);return c.useEffect(()=>{if(!t.current)return s(!1);const n=t.current,u=()=>{s(n.scrollWidth>n.clientWidth)};u();const i=new ResizeObserver(u);return i.observe(n),()=>{i.disconnect()}},[t,...e]),{truncated:r}},p=({label:t,children:e,...r})=>{const s=c.useRef(null),{truncated:n}=a({tgphRef:s},[e]),u=c.useMemo(()=>typeof e=="string"?e:c.isValidElement(e)?e.props.children:t,[e,t]);return o.jsx(f.Tooltip,{label:o.jsx(l.Text,{as:"span",size:"1",children:u}),enabled:n,triggerRef:s,...r,children:o.jsx(T.RefToTgphRef,{children:e})})},d=({tooltipProps:t,style:e,...r})=>o.jsx(p,{...t,children:o.jsx(l.Text,{textOverflow:"ellipsis",overflow:"hidden",style:{display:"block",whiteSpace:"nowrap",...e},...r})});exports.TooltipIfTruncated=p;exports.TruncatedText=d;exports.useTruncate=a;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/useTruncate/useTruncate.ts","../../src/TooltipIfTruncated/TooltipIfTruncated.tsx","../../src/TruncatedText/TruncatedText.tsx"],"sourcesContent":["import React from \"react\";\n\ntype UseTruncateParams = {\n tgphRef: React.RefObject<HTMLElement>;\n};\n\nconst useTruncate = (\n { tgphRef }: UseTruncateParams,\n deps: React.DependencyList = [],\n) => {\n const [truncated, setTruncated] = React.useState(false);\n\n React.useEffect(() => {\n if (!tgphRef.current) return setTruncated(false);\n\n const tgphRefElement = tgphRef.current;\n\n const checkTruncation = () => {\n setTruncated(tgphRefElement.scrollWidth > tgphRefElement.clientWidth);\n };\n\n // Initial check\n checkTruncation();\n\n // Add a resize observer to check for truncation when the element is resized\n const resizeObserver = new ResizeObserver(checkTruncation);\n resizeObserver.observe(tgphRefElement);\n\n // Clean up\n return () => {\n resizeObserver.disconnect();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [tgphRef, ...deps]);\n\n return { truncated };\n};\n\nexport { useTruncate };\n","import {\n type Optional,\n RefToTgphRef,\n type TgphComponentProps,\n} from \"@telegraph/helpers\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\nimport { useTruncate } from \"../useTruncate\";\n\ntype TooltipIfTruncatedProps = Optional<\n TgphComponentProps<typeof Tooltip>,\n \"label\"\n>;\n\nconst TooltipIfTruncated = ({\n label,\n children,\n ...props\n}: TooltipIfTruncatedProps) => {\n const truncateRef = React.useRef<HTMLButtonElement>(null);\n const { truncated } = useTruncate({ tgphRef: truncateRef }
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/useTruncate/useTruncate.ts","../../src/TooltipIfTruncated/TooltipIfTruncated.tsx","../../src/TruncatedText/TruncatedText.tsx"],"sourcesContent":["import React from \"react\";\n\ntype UseTruncateParams = {\n tgphRef: React.RefObject<HTMLElement>;\n};\n\nconst useTruncate = (\n { tgphRef }: UseTruncateParams,\n deps: React.DependencyList = [],\n) => {\n const [truncated, setTruncated] = React.useState(false);\n\n React.useEffect(() => {\n if (!tgphRef.current) return setTruncated(false);\n\n const tgphRefElement = tgphRef.current;\n\n const checkTruncation = () => {\n setTruncated(tgphRefElement.scrollWidth > tgphRefElement.clientWidth);\n };\n\n // Initial check\n checkTruncation();\n\n // Add a resize observer to check for truncation when the element is resized\n const resizeObserver = new ResizeObserver(checkTruncation);\n resizeObserver.observe(tgphRefElement);\n\n // Clean up\n return () => {\n resizeObserver.disconnect();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [tgphRef, ...deps]);\n\n return { truncated };\n};\n\nexport { useTruncate };\n","import {\n type Optional,\n RefToTgphRef,\n type TgphComponentProps,\n} from \"@telegraph/helpers\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\nimport { useTruncate } from \"../useTruncate\";\n\ntype TooltipIfTruncatedProps = Optional<\n TgphComponentProps<typeof Tooltip>,\n \"label\"\n>;\n\nconst TooltipIfTruncated = ({\n label,\n children,\n ...props\n}: TooltipIfTruncatedProps) => {\n const truncateRef = React.useRef<HTMLButtonElement>(null);\n const { truncated } = useTruncate(\n { tgphRef: truncateRef as React.RefObject<HTMLElement> },\n [children],\n );\n\n // We extract the text so that we can properly wrap it in the Text component\n const textToDisplayInTooltip = React.useMemo(() => {\n if (typeof children === \"string\") return children;\n if (React.isValidElement(children)) {\n const childProps = children.props as Record<string, unknown>;\n return childProps.children;\n }\n return label;\n }, [children, label]);\n\n return (\n <Tooltip\n label={\n <Text as=\"span\" size=\"1\">\n {textToDisplayInTooltip as React.ReactNode}\n </Text>\n }\n enabled={truncated}\n triggerRef={truncateRef as React.RefObject<HTMLButtonElement>}\n {...props}\n >\n <RefToTgphRef>{children}</RefToTgphRef>\n </Tooltip>\n );\n};\n\nexport { TooltipIfTruncated };\n","import type { TgphComponentProps, TgphElement } from \"@telegraph/helpers\";\nimport { Text } from \"@telegraph/typography\";\n\nimport { TooltipIfTruncated } from \"../TooltipIfTruncated\";\n\ntype TruncatedTextProps<T extends TgphElement> = {\n tooltipProps?: Partial<TgphComponentProps<typeof TooltipIfTruncated>>;\n} & TgphComponentProps<typeof Text<T>>;\n\nconst TruncatedText = <T extends TgphElement>({\n tooltipProps,\n style,\n ...props\n}: TruncatedTextProps<T>) => {\n return (\n <TooltipIfTruncated {...tooltipProps}>\n <Text\n textOverflow=\"ellipsis\"\n overflow=\"hidden\"\n style={{\n display: \"block\",\n whiteSpace: \"nowrap\",\n ...style,\n }}\n {...props}\n />\n </TooltipIfTruncated>\n );\n};\n\nexport { TruncatedText };\n"],"names":["useTruncate","tgphRef","deps","truncated","setTruncated","React","tgphRefElement","checkTruncation","resizeObserver","TooltipIfTruncated","label","children","props","truncateRef","textToDisplayInTooltip","jsx","Tooltip","Text","RefToTgphRef","TruncatedText","tooltipProps","style"],"mappings":"2OAMMA,EAAc,CAClB,CAAE,QAAAC,GACFC,EAA6B,CAAA,IAC1B,CACH,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAM,SAAS,EAAK,EAEtD,OAAAA,EAAM,UAAU,IAAM,CACpB,GAAI,CAACJ,EAAQ,QAAS,OAAOG,EAAa,EAAK,EAE/C,MAAME,EAAiBL,EAAQ,QAEzBM,EAAkB,IAAM,CAC5BH,EAAaE,EAAe,YAAcA,EAAe,WAAW,CACtE,EAGAC,EAAA,EAGA,MAAMC,EAAiB,IAAI,eAAeD,CAAe,EACzD,OAAAC,EAAe,QAAQF,CAAc,EAG9B,IAAM,CACXE,EAAe,WAAA,CACjB,CAEF,EAAG,CAACP,EAAS,GAAGC,CAAI,CAAC,EAEd,CAAE,UAAAC,CAAA,CACX,ECpBMM,EAAqB,CAAC,CAC1B,MAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAA+B,CAC7B,MAAMC,EAAcR,EAAM,OAA0B,IAAI,EAClD,CAAE,UAAAF,GAAcH,EACpB,CAAE,QAASa,CAAA,EACX,CAACF,CAAQ,CAAA,EAILG,EAAyBT,EAAM,QAAQ,IACvC,OAAOM,GAAa,SAAiBA,EACrCN,EAAM,eAAeM,CAAQ,EACZA,EAAS,MACV,SAEbD,EACN,CAACC,EAAUD,CAAK,CAAC,EAEpB,OACEK,EAAAA,IAACC,EAAAA,QAAA,CACC,MACED,EAAAA,IAACE,EAAAA,KAAA,CAAK,GAAG,OAAO,KAAK,IAClB,SAAAH,EACH,EAEF,QAASX,EACT,WAAYU,EACX,GAAGD,EAEJ,SAAAG,EAAAA,IAACG,gBAAc,SAAAP,CAAA,CAAS,CAAA,CAAA,CAG9B,EC1CMQ,EAAgB,CAAwB,CAC5C,aAAAC,EACA,MAAAC,EACA,GAAGT,CACL,IAEIG,EAAAA,IAACN,EAAA,CAAoB,GAAGW,EACtB,SAAAL,EAAAA,IAACE,EAAAA,KAAA,CACC,aAAa,WACb,SAAS,SACT,MAAO,CACL,QAAS,QACT,WAAY,SACZ,GAAGI,CAAA,EAEJ,GAAGT,CAAA,CAAA,EAER"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { RefToTgphRef as
|
|
3
|
-
import { Tooltip as
|
|
4
|
-
import { Text as
|
|
2
|
+
import { RefToTgphRef as f } from "@telegraph/helpers";
|
|
3
|
+
import { Tooltip as p } from "@telegraph/tooltip";
|
|
4
|
+
import { Text as l } from "@telegraph/typography";
|
|
5
5
|
import c from "react";
|
|
6
|
-
const
|
|
6
|
+
const a = ({ tgphRef: t }, e = []) => {
|
|
7
7
|
const [r, o] = c.useState(!1);
|
|
8
8
|
return c.useEffect(() => {
|
|
9
9
|
if (!t.current) return o(!1);
|
|
@@ -16,28 +16,31 @@ const p = ({ tgphRef: t }, e = []) => {
|
|
|
16
16
|
u.disconnect();
|
|
17
17
|
};
|
|
18
18
|
}, [t, ...e]), { truncated: r };
|
|
19
|
-
},
|
|
19
|
+
}, d = ({
|
|
20
20
|
label: t,
|
|
21
21
|
children: e,
|
|
22
22
|
...r
|
|
23
23
|
}) => {
|
|
24
|
-
const o = c.useRef(null), { truncated: n } =
|
|
24
|
+
const o = c.useRef(null), { truncated: n } = a(
|
|
25
|
+
{ tgphRef: o },
|
|
26
|
+
[e]
|
|
27
|
+
), i = c.useMemo(() => typeof e == "string" ? e : c.isValidElement(e) ? e.props.children : t, [e, t]);
|
|
25
28
|
return /* @__PURE__ */ s(
|
|
26
|
-
|
|
29
|
+
p,
|
|
27
30
|
{
|
|
28
|
-
label: /* @__PURE__ */ s(
|
|
31
|
+
label: /* @__PURE__ */ s(l, { as: "span", size: "1", children: i }),
|
|
29
32
|
enabled: n,
|
|
30
33
|
triggerRef: o,
|
|
31
34
|
...r,
|
|
32
|
-
children: /* @__PURE__ */ s(
|
|
35
|
+
children: /* @__PURE__ */ s(f, { children: e })
|
|
33
36
|
}
|
|
34
37
|
);
|
|
35
|
-
},
|
|
38
|
+
}, b = ({
|
|
36
39
|
tooltipProps: t,
|
|
37
40
|
style: e,
|
|
38
41
|
...r
|
|
39
|
-
}) => /* @__PURE__ */ s(
|
|
40
|
-
|
|
42
|
+
}) => /* @__PURE__ */ s(d, { ...t, children: /* @__PURE__ */ s(
|
|
43
|
+
l,
|
|
41
44
|
{
|
|
42
45
|
textOverflow: "ellipsis",
|
|
43
46
|
overflow: "hidden",
|
|
@@ -50,8 +53,8 @@ const p = ({ tgphRef: t }, e = []) => {
|
|
|
50
53
|
}
|
|
51
54
|
) });
|
|
52
55
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
d as TooltipIfTruncated,
|
|
57
|
+
b as TruncatedText,
|
|
58
|
+
a as useTruncate
|
|
56
59
|
};
|
|
57
60
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/useTruncate/useTruncate.ts","../../src/TooltipIfTruncated/TooltipIfTruncated.tsx","../../src/TruncatedText/TruncatedText.tsx"],"sourcesContent":["import React from \"react\";\n\ntype UseTruncateParams = {\n tgphRef: React.RefObject<HTMLElement>;\n};\n\nconst useTruncate = (\n { tgphRef }: UseTruncateParams,\n deps: React.DependencyList = [],\n) => {\n const [truncated, setTruncated] = React.useState(false);\n\n React.useEffect(() => {\n if (!tgphRef.current) return setTruncated(false);\n\n const tgphRefElement = tgphRef.current;\n\n const checkTruncation = () => {\n setTruncated(tgphRefElement.scrollWidth > tgphRefElement.clientWidth);\n };\n\n // Initial check\n checkTruncation();\n\n // Add a resize observer to check for truncation when the element is resized\n const resizeObserver = new ResizeObserver(checkTruncation);\n resizeObserver.observe(tgphRefElement);\n\n // Clean up\n return () => {\n resizeObserver.disconnect();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [tgphRef, ...deps]);\n\n return { truncated };\n};\n\nexport { useTruncate };\n","import {\n type Optional,\n RefToTgphRef,\n type TgphComponentProps,\n} from \"@telegraph/helpers\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\nimport { useTruncate } from \"../useTruncate\";\n\ntype TooltipIfTruncatedProps = Optional<\n TgphComponentProps<typeof Tooltip>,\n \"label\"\n>;\n\nconst TooltipIfTruncated = ({\n label,\n children,\n ...props\n}: TooltipIfTruncatedProps) => {\n const truncateRef = React.useRef<HTMLButtonElement>(null);\n const { truncated } = useTruncate({ tgphRef: truncateRef }
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/useTruncate/useTruncate.ts","../../src/TooltipIfTruncated/TooltipIfTruncated.tsx","../../src/TruncatedText/TruncatedText.tsx"],"sourcesContent":["import React from \"react\";\n\ntype UseTruncateParams = {\n tgphRef: React.RefObject<HTMLElement>;\n};\n\nconst useTruncate = (\n { tgphRef }: UseTruncateParams,\n deps: React.DependencyList = [],\n) => {\n const [truncated, setTruncated] = React.useState(false);\n\n React.useEffect(() => {\n if (!tgphRef.current) return setTruncated(false);\n\n const tgphRefElement = tgphRef.current;\n\n const checkTruncation = () => {\n setTruncated(tgphRefElement.scrollWidth > tgphRefElement.clientWidth);\n };\n\n // Initial check\n checkTruncation();\n\n // Add a resize observer to check for truncation when the element is resized\n const resizeObserver = new ResizeObserver(checkTruncation);\n resizeObserver.observe(tgphRefElement);\n\n // Clean up\n return () => {\n resizeObserver.disconnect();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [tgphRef, ...deps]);\n\n return { truncated };\n};\n\nexport { useTruncate };\n","import {\n type Optional,\n RefToTgphRef,\n type TgphComponentProps,\n} from \"@telegraph/helpers\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport React from \"react\";\n\nimport { useTruncate } from \"../useTruncate\";\n\ntype TooltipIfTruncatedProps = Optional<\n TgphComponentProps<typeof Tooltip>,\n \"label\"\n>;\n\nconst TooltipIfTruncated = ({\n label,\n children,\n ...props\n}: TooltipIfTruncatedProps) => {\n const truncateRef = React.useRef<HTMLButtonElement>(null);\n const { truncated } = useTruncate(\n { tgphRef: truncateRef as React.RefObject<HTMLElement> },\n [children],\n );\n\n // We extract the text so that we can properly wrap it in the Text component\n const textToDisplayInTooltip = React.useMemo(() => {\n if (typeof children === \"string\") return children;\n if (React.isValidElement(children)) {\n const childProps = children.props as Record<string, unknown>;\n return childProps.children;\n }\n return label;\n }, [children, label]);\n\n return (\n <Tooltip\n label={\n <Text as=\"span\" size=\"1\">\n {textToDisplayInTooltip as React.ReactNode}\n </Text>\n }\n enabled={truncated}\n triggerRef={truncateRef as React.RefObject<HTMLButtonElement>}\n {...props}\n >\n <RefToTgphRef>{children}</RefToTgphRef>\n </Tooltip>\n );\n};\n\nexport { TooltipIfTruncated };\n","import type { TgphComponentProps, TgphElement } from \"@telegraph/helpers\";\nimport { Text } from \"@telegraph/typography\";\n\nimport { TooltipIfTruncated } from \"../TooltipIfTruncated\";\n\ntype TruncatedTextProps<T extends TgphElement> = {\n tooltipProps?: Partial<TgphComponentProps<typeof TooltipIfTruncated>>;\n} & TgphComponentProps<typeof Text<T>>;\n\nconst TruncatedText = <T extends TgphElement>({\n tooltipProps,\n style,\n ...props\n}: TruncatedTextProps<T>) => {\n return (\n <TooltipIfTruncated {...tooltipProps}>\n <Text\n textOverflow=\"ellipsis\"\n overflow=\"hidden\"\n style={{\n display: \"block\",\n whiteSpace: \"nowrap\",\n ...style,\n }}\n {...props}\n />\n </TooltipIfTruncated>\n );\n};\n\nexport { TruncatedText };\n"],"names":["useTruncate","tgphRef","deps","truncated","setTruncated","React","tgphRefElement","checkTruncation","resizeObserver","TooltipIfTruncated","label","children","props","truncateRef","textToDisplayInTooltip","jsx","Tooltip","Text","RefToTgphRef","TruncatedText","tooltipProps","style"],"mappings":";;;;;AAMA,MAAMA,IAAc,CAClB,EAAE,SAAAC,KACFC,IAA6B,CAAA,MAC1B;AACH,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAM,SAAS,EAAK;AAEtD,SAAAA,EAAM,UAAU,MAAM;AACpB,QAAI,CAACJ,EAAQ,QAAS,QAAOG,EAAa,EAAK;AAE/C,UAAME,IAAiBL,EAAQ,SAEzBM,IAAkB,MAAM;AAC5B,MAAAH,EAAaE,EAAe,cAAcA,EAAe,WAAW;AAAA,IACtE;AAGA,IAAAC,EAAA;AAGA,UAAMC,IAAiB,IAAI,eAAeD,CAAe;AACzD,WAAAC,EAAe,QAAQF,CAAc,GAG9B,MAAM;AACX,MAAAE,EAAe,WAAA;AAAA,IACjB;AAAA,EAEF,GAAG,CAACP,GAAS,GAAGC,CAAI,CAAC,GAEd,EAAE,WAAAC,EAAA;AACX,GCpBMM,IAAqB,CAAC;AAAA,EAC1B,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAA+B;AAC7B,QAAMC,IAAcR,EAAM,OAA0B,IAAI,GAClD,EAAE,WAAAF,MAAcH;AAAA,IACpB,EAAE,SAASa,EAAA;AAAA,IACX,CAACF,CAAQ;AAAA,EAAA,GAILG,IAAyBT,EAAM,QAAQ,MACvC,OAAOM,KAAa,WAAiBA,IACrCN,EAAM,eAAeM,CAAQ,IACZA,EAAS,MACV,WAEbD,GACN,CAACC,GAAUD,CAAK,CAAC;AAEpB,SACE,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OACE,gBAAAD,EAACE,GAAA,EAAK,IAAG,QAAO,MAAK,KAClB,UAAAH,GACH;AAAA,MAEF,SAASX;AAAA,MACT,YAAYU;AAAA,MACX,GAAGD;AAAA,MAEJ,UAAA,gBAAAG,EAACG,KAAc,UAAAP,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAG9B,GC1CMQ,IAAgB,CAAwB;AAAA,EAC5C,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGT;AACL,MAEI,gBAAAG,EAACN,GAAA,EAAoB,GAAGW,GACtB,UAAA,gBAAAL;AAAA,EAACE;AAAA,EAAA;AAAA,IACC,cAAa;AAAA,IACb,UAAS;AAAA,IACT,OAAO;AAAA,MACL,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,GAAGI;AAAA,IAAA;AAAA,IAEJ,GAAGT;AAAA,EAAA;AAAA,GAER;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipIfTruncated.d.ts","sourceRoot":"","sources":["../../../src/TooltipIfTruncated/TooltipIfTruncated.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EAEb,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAM7C,KAAK,uBAAuB,GAAG,QAAQ,CACrC,kBAAkB,CAAC,OAAO,OAAO,CAAC,EAClC,OAAO,CACR,CAAC;AAEF,QAAA,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"TooltipIfTruncated.d.ts","sourceRoot":"","sources":["../../../src/TooltipIfTruncated/TooltipIfTruncated.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EAEb,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAM7C,KAAK,uBAAuB,GAAG,QAAQ,CACrC,kBAAkB,CAAC,OAAO,OAAO,CAAC,EAClC,OAAO,CACR,CAAC;AAEF,QAAA,MAAM,kBAAkB,GAAI,+BAIzB,uBAAuB,4CA+BzB,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TruncatedText.d.ts","sourceRoot":"","sources":["../../../src/TruncatedText/TruncatedText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,KAAK,kBAAkB,CAAC,CAAC,SAAS,WAAW,IAAI;IAC/C,YAAY,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC;CACvE,GAAG,kBAAkB,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvC,QAAA,MAAM,aAAa,GAAI,CAAC,SAAS,WAAW,
|
|
1
|
+
{"version":3,"file":"TruncatedText.d.ts","sourceRoot":"","sources":["../../../src/TruncatedText/TruncatedText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,KAAK,kBAAkB,CAAC,CAAC,SAAS,WAAW,IAAI;IAC/C,YAAY,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC;CACvE,GAAG,kBAAkB,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvC,QAAA,MAAM,aAAa,GAAI,CAAC,SAAS,WAAW,EAAE,mCAI3C,kBAAkB,CAAC,CAAC,CAAC,4CAevB,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTruncate.d.ts","sourceRoot":"","sources":["../../../src/useTruncate/useTruncate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;CACvC,CAAC;AAEF,QAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"useTruncate.d.ts","sourceRoot":"","sources":["../../../src/useTruncate/useTruncate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;CACvC,CAAC;AAEF,QAAA,MAAM,WAAW,GACf,aAAa,iBAAiB,EAC9B,OAAM,KAAK,CAAC,cAAmB;;CA4BhC,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telegraph/truncate",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "Utility components for detecting and responding to content overflow, truncation, and visibility states in the UI.",
|
|
5
5
|
"repository": "https://github.com/knocklabs/telegraph/tree/main/packages/truncate",
|
|
6
6
|
"author": "@knocklabs",
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@telegraph/helpers": "^0.0.13",
|
|
36
|
-
"@telegraph/tooltip": "^0.0.
|
|
36
|
+
"@telegraph/tooltip": "^0.0.56",
|
|
37
37
|
"@telegraph/typography": "^0.1.23"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@knocklabs/eslint-config": "^0.0.
|
|
40
|
+
"@knocklabs/eslint-config": "^0.0.5",
|
|
41
41
|
"@knocklabs/typescript-config": "^0.0.2",
|
|
42
42
|
"@telegraph/postcss-config": "^0.0.29",
|
|
43
43
|
"@telegraph/prettier-config": "^0.0.7",
|
|
44
44
|
"@telegraph/vite-config": "^0.0.15",
|
|
45
|
-
"@types/react": "^
|
|
45
|
+
"@types/react": "^19.1.11",
|
|
46
46
|
"eslint": "^8.56.0",
|
|
47
|
-
"react": "^
|
|
48
|
-
"react-dom": "^
|
|
49
|
-
"typescript": "^5.
|
|
47
|
+
"react": "^19.1.1",
|
|
48
|
+
"react-dom": "^19.1.1",
|
|
49
|
+
"typescript": "^5.9.2",
|
|
50
50
|
"vite": "^6.0.11"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|