@elliemae/ds-chat-container-header 3.70.0-next.3 → 3.70.0-next.4

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.
@@ -37,7 +37,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
37
37
  var import_react = __toESM(require("react"));
38
38
  var import_lodash_es = require("lodash-es");
39
39
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
40
- var import_ds_truncated_tooltip_text = require("@elliemae/ds-truncated-tooltip-text");
40
+ var import_TruncatedTooltipText = require("./TruncatedTooltipText.js");
41
41
  var import_styled = require("./styled.js");
42
42
  var import_react_desc_prop_types = require("./react-desc-prop-types.js");
43
43
  var import_ChatContainerHeaderDataTestIds = require("./ChatContainerHeaderDataTestIds.js");
@@ -62,7 +62,7 @@ const ChatContainerHeader = (props) => {
62
62
  "data-testid": import_ChatContainerHeaderDataTestIds.ChatContainerHeaderDataTestIds.HEADER_TITLE,
63
63
  pl: "xxs",
64
64
  pr: "xxs",
65
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_truncated_tooltip_text.SimpleTruncatedTooltipText, { value: title })
65
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TruncatedTooltipText.TruncatedTooltipText, { value: title })
66
66
  }
67
67
  ),
68
68
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/ChatContainerHeader.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { omit } from 'lodash-es';\nimport { describe, useValidateTypescriptPropTypes, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { type DSGridT } from '@elliemae/ds-grid';\nimport {\n StyledChatContainerContentHeader,\n StyledChatContainerContentHeaderLabel,\n StyledChatContainerContentHeaderActions,\n} from './styled.js';\nimport type { DSChatContainerHeaderT } from './react-desc-prop-types.js';\nimport { propTypes } from './react-desc-prop-types.js';\nimport { ChatContainerHeaderDataTestIds } from './ChatContainerHeaderDataTestIds.js';\nimport { DSChatContainerHeaderName } from './DSChatContainerHeaderDefinitions.js';\n\nconst ChatContainerHeader: React.ComponentType<DSChatContainerHeaderT.Props> = (props) => {\n useValidateTypescriptPropTypes(props, propTypes, DSChatContainerHeaderName);\n\n const globalProps = omit(useGetGlobalAttributes<DSChatContainerHeaderT.InternalProps>(props), [\n 'cols',\n 'rows',\n 'wrap',\n 'title',\n ]);\n const { title, children } = props;\n const cols = React.useMemo<DSGridT.Props['cols']>(\n () => ['minmax(calc(100% - 64px), 1fr)', children ? 'auto' : '0px'],\n [children],\n );\n\n return (\n <StyledChatContainerContentHeader alignItems=\"center\" cols={cols} role=\"heading\" aria-level={2} {...globalProps}>\n <StyledChatContainerContentHeaderLabel\n data-testid={ChatContainerHeaderDataTestIds.HEADER_TITLE}\n pl=\"xxs\"\n pr=\"xxs\"\n >\n <SimpleTruncatedTooltipText value={title} />\n </StyledChatContainerContentHeaderLabel>\n <StyledChatContainerContentHeaderActions\n cols={React.Children.toArray(children)\n .filter(Boolean)\n .map(() => '32px')}\n justifyContent=\"flex-end\"\n data-testid={ChatContainerHeaderDataTestIds.HEADER_CHILDREN}\n >\n {children}\n </StyledChatContainerContentHeaderActions>\n </StyledChatContainerContentHeader>\n );\n};\n\nChatContainerHeader.displayName = DSChatContainerHeaderName;\nconst ChatContainerHeaderWithSchema = describe(ChatContainerHeader);\nChatContainerHeaderWithSchema.propTypes = propTypes;\n\nexport { ChatContainerHeader, ChatContainerHeaderWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+BnB;AA/BJ,mBAAkB;AAClB,uBAAqB;AACrB,8BAAiF;AACjF,uCAA2C;AAE3C,oBAIO;AAEP,mCAA0B;AAC1B,4CAA+C;AAC/C,8CAA0C;AAE1C,MAAM,sBAAyE,CAAC,UAAU;AACxF,8DAA+B,OAAO,wCAAW,iEAAyB;AAE1E,QAAM,kBAAc,2BAAK,gDAA6D,KAAK,GAAG;AAAA,IAC5F;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,EAAE,OAAO,SAAS,IAAI;AAC5B,QAAM,OAAO,aAAAA,QAAM;AAAA,IACjB,MAAM,CAAC,kCAAkC,WAAW,SAAS,KAAK;AAAA,IAClE,CAAC,QAAQ;AAAA,EACX;AAEA,SACE,6CAAC,kDAAiC,YAAW,UAAS,MAAY,MAAK,WAAU,cAAY,GAAI,GAAG,aAClG;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,eAAa,qEAA+B;AAAA,QAC5C,IAAG;AAAA,QACH,IAAG;AAAA,QAEH,sDAAC,+DAA2B,OAAO,OAAO;AAAA;AAAA,IAC5C;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,aAAAA,QAAM,SAAS,QAAQ,QAAQ,EAClC,OAAO,OAAO,EACd,IAAI,MAAM,MAAM;AAAA,QACnB,gBAAe;AAAA,QACf,eAAa,qEAA+B;AAAA,QAE3C;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAEA,oBAAoB,cAAc;AAClC,MAAM,oCAAgC,kCAAS,mBAAmB;AAClE,8BAA8B,YAAY;",
4
+ "sourcesContent": ["import React from 'react';\nimport { omit } from 'lodash-es';\nimport { describe, useValidateTypescriptPropTypes, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { TruncatedTooltipText } from './TruncatedTooltipText.js';\nimport { type DSGridT } from '@elliemae/ds-grid';\nimport {\n StyledChatContainerContentHeader,\n StyledChatContainerContentHeaderLabel,\n StyledChatContainerContentHeaderActions,\n} from './styled.js';\nimport type { DSChatContainerHeaderT } from './react-desc-prop-types.js';\nimport { propTypes } from './react-desc-prop-types.js';\nimport { ChatContainerHeaderDataTestIds } from './ChatContainerHeaderDataTestIds.js';\nimport { DSChatContainerHeaderName } from './DSChatContainerHeaderDefinitions.js';\n\nconst ChatContainerHeader: React.ComponentType<DSChatContainerHeaderT.Props> = (props) => {\n useValidateTypescriptPropTypes(props, propTypes, DSChatContainerHeaderName);\n\n const globalProps = omit(useGetGlobalAttributes<DSChatContainerHeaderT.InternalProps>(props), [\n 'cols',\n 'rows',\n 'wrap',\n 'title',\n ]);\n const { title, children } = props;\n const cols = React.useMemo<DSGridT.Props['cols']>(\n () => ['minmax(calc(100% - 64px), 1fr)', children ? 'auto' : '0px'],\n [children],\n );\n\n return (\n <StyledChatContainerContentHeader alignItems=\"center\" cols={cols} role=\"heading\" aria-level={2} {...globalProps}>\n <StyledChatContainerContentHeaderLabel\n data-testid={ChatContainerHeaderDataTestIds.HEADER_TITLE}\n pl=\"xxs\"\n pr=\"xxs\"\n >\n <TruncatedTooltipText value={title} />\n </StyledChatContainerContentHeaderLabel>\n <StyledChatContainerContentHeaderActions\n cols={React.Children.toArray(children)\n .filter(Boolean)\n .map(() => '32px')}\n justifyContent=\"flex-end\"\n data-testid={ChatContainerHeaderDataTestIds.HEADER_CHILDREN}\n >\n {children}\n </StyledChatContainerContentHeaderActions>\n </StyledChatContainerContentHeader>\n );\n};\n\nChatContainerHeader.displayName = DSChatContainerHeaderName;\nconst ChatContainerHeaderWithSchema = describe(ChatContainerHeader);\nChatContainerHeaderWithSchema.propTypes = propTypes;\n\nexport { ChatContainerHeader, ChatContainerHeaderWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+BnB;AA/BJ,mBAAkB;AAClB,uBAAqB;AACrB,8BAAiF;AACjF,kCAAqC;AAErC,oBAIO;AAEP,mCAA0B;AAC1B,4CAA+C;AAC/C,8CAA0C;AAE1C,MAAM,sBAAyE,CAAC,UAAU;AACxF,8DAA+B,OAAO,wCAAW,iEAAyB;AAE1E,QAAM,kBAAc,2BAAK,gDAA6D,KAAK,GAAG;AAAA,IAC5F;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,EAAE,OAAO,SAAS,IAAI;AAC5B,QAAM,OAAO,aAAAA,QAAM;AAAA,IACjB,MAAM,CAAC,kCAAkC,WAAW,SAAS,KAAK;AAAA,IAClE,CAAC,QAAQ;AAAA,EACX;AAEA,SACE,6CAAC,kDAAiC,YAAW,UAAS,MAAY,MAAK,WAAU,cAAY,GAAI,GAAG,aAClG;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,eAAa,qEAA+B;AAAA,QAC5C,IAAG;AAAA,QACH,IAAG;AAAA,QAEH,sDAAC,oDAAqB,OAAO,OAAO;AAAA;AAAA,IACtC;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,aAAAA,QAAM,SAAS,QAAQ,QAAQ,EAClC,OAAO,OAAO,EACd,IAAI,MAAM,MAAM;AAAA,QACnB,gBAAe;AAAA,QACf,eAAa,qEAA+B;AAAA,QAE3C;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAEA,oBAAoB,cAAc;AAClC,MAAM,oCAAgC,kCAAS,mBAAmB;AAClE,8BAA8B,YAAY;",
6
6
  "names": ["React"]
7
7
  }
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var TruncatedTooltipText_exports = {};
30
+ __export(TruncatedTooltipText_exports, {
31
+ TruncatedTooltipText: () => TruncatedTooltipText,
32
+ default: () => TruncatedTooltipText_default
33
+ });
34
+ module.exports = __toCommonJS(TruncatedTooltipText_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var import_react = require("react");
38
+ var import_ds_system = require("@elliemae/ds-system");
39
+ var import_ds_floating_context = require("@elliemae/ds-floating-context");
40
+ const TruncatedSpan = import_ds_system.styled.span`
41
+ text-overflow: ellipsis;
42
+ white-space: nowrap;
43
+ overflow: hidden;
44
+ display: inline-block;
45
+ max-width: 100%;
46
+ `;
47
+ const TooltipContainer = import_ds_system.styled.div`
48
+ text-align: left;
49
+ min-width: ${({ theme }) => theme.space.l};
50
+ max-width: 250px;
51
+ min-height: 30px;
52
+ display: grid;
53
+ align-items: center;
54
+ padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};
55
+ position: relative;
56
+ background-color: white;
57
+ border-radius: 2px;
58
+ font-size: 13px;
59
+ color: ${({ theme }) => theme.colors.neutral[600]};
60
+ pointer-events: none;
61
+ `;
62
+ const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
63
+ const [showTooltip, setShowTooltip] = (0, import_react.useState)(false);
64
+ const { refs, floatingStyles, arrowStyles, context } = (0, import_ds_floating_context.useFloatingContext)({
65
+ placement,
66
+ externallyControlledIsOpen: showTooltip,
67
+ withoutAnimation: true
68
+ });
69
+ const handleMouseEnter = (0, import_react.useCallback)((e) => {
70
+ const el = e.currentTarget;
71
+ setShowTooltip(el.offsetWidth < el.scrollWidth);
72
+ }, []);
73
+ const handleMouseLeave = (0, import_react.useCallback)(() => {
74
+ setShowTooltip(false);
75
+ }, []);
76
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TruncatedSpan, { innerRef: refs.setReference, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: value }),
78
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
79
+ import_ds_floating_context.FloatingWrapper,
80
+ {
81
+ innerRef: refs.setFloating,
82
+ isOpen: showTooltip,
83
+ floatingStyles,
84
+ context,
85
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TooltipContainer, { children: [
86
+ value,
87
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_floating_context.PopoverArrow, { ...arrowStyles })
88
+ ] })
89
+ }
90
+ )
91
+ ] });
92
+ };
93
+ var TruncatedTooltipText_default = TruncatedTooltipText;
94
+ //# sourceMappingURL=TruncatedTooltipText.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/TruncatedTooltipText.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React, { useCallback, useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\n\nconst TruncatedSpan = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\n// Matches DSTooltipV3's StyledTooltipContainer styles for visual consistency\nconst TooltipContainer = styled.div`\n text-align: left;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n font-size: 13px;\n color: ${({ theme }) => theme.colors.neutral[600]};\n pointer-events: none;\n`;\n\ninterface TruncatedTooltipTextProps {\n value?: string;\n placement?: DSHookFloatingContextT.PopperPlacementsT;\n}\n\nconst TruncatedTooltipText = ({ value = '', placement = 'top' }: TruncatedTooltipTextProps) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({\n placement,\n externallyControlledIsOpen: showTooltip,\n withoutAnimation: true,\n });\n\n const handleMouseEnter = useCallback((e: React.MouseEvent<HTMLSpanElement>) => {\n const el = e.currentTarget;\n setShowTooltip(el.offsetWidth < el.scrollWidth);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setShowTooltip(false);\n }, []);\n\n return (\n <>\n <TruncatedSpan innerRef={refs.setReference} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n {value}\n </TruncatedSpan>\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={showTooltip}\n floatingStyles={floatingStyles}\n context={context}\n >\n <TooltipContainer>\n {value}\n <PopoverArrow {...arrowStyles} />\n </TooltipContainer>\n </FloatingWrapper>\n </>\n );\n};\n\nexport { TruncatedTooltipText };\nexport default TruncatedTooltipText;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0DnB;AA1DJ,mBAA6C;AAC7C,uBAAuB;AACvB,iCAKO;AAEP,MAAM,gBAAgB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS7B,MAAM,mBAAmB,wBAAO;AAAA;AAAA,eAEjB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,aAK9B,CAAC,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,EAAE,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,WAKxD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AASnD,MAAM,uBAAuB,CAAC,EAAE,QAAQ,IAAI,YAAY,MAAM,MAAiC;AAC7F,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AAEpD,QAAM,EAAE,MAAM,gBAAgB,aAAa,QAAQ,QAAI,+CAAmB;AAAA,IACxE;AAAA,IACA,4BAA4B;AAAA,IAC5B,kBAAkB;AAAA,EACpB,CAAC;AAED,QAAM,uBAAmB,0BAAY,CAAC,MAAyC;AAC7E,UAAM,KAAK,EAAE;AACb,mBAAe,GAAG,cAAc,GAAG,WAAW;AAAA,EAChD,GAAG,CAAC,CAAC;AAEL,QAAM,uBAAmB,0BAAY,MAAM;AACzC,mBAAe,KAAK;AAAA,EACtB,GAAG,CAAC,CAAC;AAEL,SACE,4EACE;AAAA,gDAAC,iBAAc,UAAU,KAAK,cAAc,cAAc,kBAAkB,cAAc,kBACvF,iBACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,KAAK;AAAA,QACf,QAAQ;AAAA,QACR;AAAA,QACA;AAAA,QAEA,uDAAC,oBACE;AAAA;AAAA,UACD,4CAAC,2CAAc,GAAG,aAAa;AAAA,WACjC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAGA,IAAO,+BAAQ;",
6
+ "names": []
7
+ }
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import React2 from "react";
4
4
  import { omit } from "lodash-es";
5
5
  import { describe, useValidateTypescriptPropTypes, useGetGlobalAttributes } from "@elliemae/ds-props-helpers";
6
- import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
6
+ import { TruncatedTooltipText } from "./TruncatedTooltipText.js";
7
7
  import {
8
8
  StyledChatContainerContentHeader,
9
9
  StyledChatContainerContentHeaderLabel,
@@ -32,7 +32,7 @@ const ChatContainerHeader = (props) => {
32
32
  "data-testid": ChatContainerHeaderDataTestIds.HEADER_TITLE,
33
33
  pl: "xxs",
34
34
  pr: "xxs",
35
- children: /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: title })
35
+ children: /* @__PURE__ */ jsx(TruncatedTooltipText, { value: title })
36
36
  }
37
37
  ),
38
38
  /* @__PURE__ */ jsx(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/ChatContainerHeader.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { omit } from 'lodash-es';\nimport { describe, useValidateTypescriptPropTypes, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { type DSGridT } from '@elliemae/ds-grid';\nimport {\n StyledChatContainerContentHeader,\n StyledChatContainerContentHeaderLabel,\n StyledChatContainerContentHeaderActions,\n} from './styled.js';\nimport type { DSChatContainerHeaderT } from './react-desc-prop-types.js';\nimport { propTypes } from './react-desc-prop-types.js';\nimport { ChatContainerHeaderDataTestIds } from './ChatContainerHeaderDataTestIds.js';\nimport { DSChatContainerHeaderName } from './DSChatContainerHeaderDefinitions.js';\n\nconst ChatContainerHeader: React.ComponentType<DSChatContainerHeaderT.Props> = (props) => {\n useValidateTypescriptPropTypes(props, propTypes, DSChatContainerHeaderName);\n\n const globalProps = omit(useGetGlobalAttributes<DSChatContainerHeaderT.InternalProps>(props), [\n 'cols',\n 'rows',\n 'wrap',\n 'title',\n ]);\n const { title, children } = props;\n const cols = React.useMemo<DSGridT.Props['cols']>(\n () => ['minmax(calc(100% - 64px), 1fr)', children ? 'auto' : '0px'],\n [children],\n );\n\n return (\n <StyledChatContainerContentHeader alignItems=\"center\" cols={cols} role=\"heading\" aria-level={2} {...globalProps}>\n <StyledChatContainerContentHeaderLabel\n data-testid={ChatContainerHeaderDataTestIds.HEADER_TITLE}\n pl=\"xxs\"\n pr=\"xxs\"\n >\n <SimpleTruncatedTooltipText value={title} />\n </StyledChatContainerContentHeaderLabel>\n <StyledChatContainerContentHeaderActions\n cols={React.Children.toArray(children)\n .filter(Boolean)\n .map(() => '32px')}\n justifyContent=\"flex-end\"\n data-testid={ChatContainerHeaderDataTestIds.HEADER_CHILDREN}\n >\n {children}\n </StyledChatContainerContentHeaderActions>\n </StyledChatContainerContentHeader>\n );\n};\n\nChatContainerHeader.displayName = DSChatContainerHeaderName;\nconst ChatContainerHeaderWithSchema = describe(ChatContainerHeader);\nChatContainerHeaderWithSchema.propTypes = propTypes;\n\nexport { ChatContainerHeader, ChatContainerHeaderWithSchema };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC+BnB,SAMI,KANJ;AA/BJ,OAAOA,YAAW;AAClB,SAAS,YAAY;AACrB,SAAS,UAAU,gCAAgC,8BAA8B;AACjF,SAAS,kCAAkC;AAE3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB;AAC1B,SAAS,sCAAsC;AAC/C,SAAS,iCAAiC;AAE1C,MAAM,sBAAyE,CAAC,UAAU;AACxF,iCAA+B,OAAO,WAAW,yBAAyB;AAE1E,QAAM,cAAc,KAAK,uBAA6D,KAAK,GAAG;AAAA,IAC5F;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,EAAE,OAAO,SAAS,IAAI;AAC5B,QAAM,OAAOA,OAAM;AAAA,IACjB,MAAM,CAAC,kCAAkC,WAAW,SAAS,KAAK;AAAA,IAClE,CAAC,QAAQ;AAAA,EACX;AAEA,SACE,qBAAC,oCAAiC,YAAW,UAAS,MAAY,MAAK,WAAU,cAAY,GAAI,GAAG,aAClG;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,eAAa,+BAA+B;AAAA,QAC5C,IAAG;AAAA,QACH,IAAG;AAAA,QAEH,8BAAC,8BAA2B,OAAO,OAAO;AAAA;AAAA,IAC5C;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,MAAMA,OAAM,SAAS,QAAQ,QAAQ,EAClC,OAAO,OAAO,EACd,IAAI,MAAM,MAAM;AAAA,QACnB,gBAAe;AAAA,QACf,eAAa,+BAA+B;AAAA,QAE3C;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAEA,oBAAoB,cAAc;AAClC,MAAM,gCAAgC,SAAS,mBAAmB;AAClE,8BAA8B,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { omit } from 'lodash-es';\nimport { describe, useValidateTypescriptPropTypes, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { TruncatedTooltipText } from './TruncatedTooltipText.js';\nimport { type DSGridT } from '@elliemae/ds-grid';\nimport {\n StyledChatContainerContentHeader,\n StyledChatContainerContentHeaderLabel,\n StyledChatContainerContentHeaderActions,\n} from './styled.js';\nimport type { DSChatContainerHeaderT } from './react-desc-prop-types.js';\nimport { propTypes } from './react-desc-prop-types.js';\nimport { ChatContainerHeaderDataTestIds } from './ChatContainerHeaderDataTestIds.js';\nimport { DSChatContainerHeaderName } from './DSChatContainerHeaderDefinitions.js';\n\nconst ChatContainerHeader: React.ComponentType<DSChatContainerHeaderT.Props> = (props) => {\n useValidateTypescriptPropTypes(props, propTypes, DSChatContainerHeaderName);\n\n const globalProps = omit(useGetGlobalAttributes<DSChatContainerHeaderT.InternalProps>(props), [\n 'cols',\n 'rows',\n 'wrap',\n 'title',\n ]);\n const { title, children } = props;\n const cols = React.useMemo<DSGridT.Props['cols']>(\n () => ['minmax(calc(100% - 64px), 1fr)', children ? 'auto' : '0px'],\n [children],\n );\n\n return (\n <StyledChatContainerContentHeader alignItems=\"center\" cols={cols} role=\"heading\" aria-level={2} {...globalProps}>\n <StyledChatContainerContentHeaderLabel\n data-testid={ChatContainerHeaderDataTestIds.HEADER_TITLE}\n pl=\"xxs\"\n pr=\"xxs\"\n >\n <TruncatedTooltipText value={title} />\n </StyledChatContainerContentHeaderLabel>\n <StyledChatContainerContentHeaderActions\n cols={React.Children.toArray(children)\n .filter(Boolean)\n .map(() => '32px')}\n justifyContent=\"flex-end\"\n data-testid={ChatContainerHeaderDataTestIds.HEADER_CHILDREN}\n >\n {children}\n </StyledChatContainerContentHeaderActions>\n </StyledChatContainerContentHeader>\n );\n};\n\nChatContainerHeader.displayName = DSChatContainerHeaderName;\nconst ChatContainerHeaderWithSchema = describe(ChatContainerHeader);\nChatContainerHeaderWithSchema.propTypes = propTypes;\n\nexport { ChatContainerHeader, ChatContainerHeaderWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC+BnB,SAMI,KANJ;AA/BJ,OAAOA,YAAW;AAClB,SAAS,YAAY;AACrB,SAAS,UAAU,gCAAgC,8BAA8B;AACjF,SAAS,4BAA4B;AAErC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB;AAC1B,SAAS,sCAAsC;AAC/C,SAAS,iCAAiC;AAE1C,MAAM,sBAAyE,CAAC,UAAU;AACxF,iCAA+B,OAAO,WAAW,yBAAyB;AAE1E,QAAM,cAAc,KAAK,uBAA6D,KAAK,GAAG;AAAA,IAC5F;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,EAAE,OAAO,SAAS,IAAI;AAC5B,QAAM,OAAOA,OAAM;AAAA,IACjB,MAAM,CAAC,kCAAkC,WAAW,SAAS,KAAK;AAAA,IAClE,CAAC,QAAQ;AAAA,EACX;AAEA,SACE,qBAAC,oCAAiC,YAAW,UAAS,MAAY,MAAK,WAAU,cAAY,GAAI,GAAG,aAClG;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,eAAa,+BAA+B;AAAA,QAC5C,IAAG;AAAA,QACH,IAAG;AAAA,QAEH,8BAAC,wBAAqB,OAAO,OAAO;AAAA;AAAA,IACtC;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,MAAMA,OAAM,SAAS,QAAQ,QAAQ,EAClC,OAAO,OAAO,EACd,IAAI,MAAM,MAAM;AAAA,QACnB,gBAAe;AAAA,QACf,eAAa,+BAA+B;AAAA,QAE3C;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAEA,oBAAoB,cAAc;AAClC,MAAM,gCAAgC,SAAS,mBAAmB;AAClE,8BAA8B,YAAY;",
6
6
  "names": ["React"]
7
7
  }
@@ -0,0 +1,68 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useState } from "react";
4
+ import { styled } from "@elliemae/ds-system";
5
+ import {
6
+ useFloatingContext,
7
+ FloatingWrapper,
8
+ PopoverArrow
9
+ } from "@elliemae/ds-floating-context";
10
+ const TruncatedSpan = styled.span`
11
+ text-overflow: ellipsis;
12
+ white-space: nowrap;
13
+ overflow: hidden;
14
+ display: inline-block;
15
+ max-width: 100%;
16
+ `;
17
+ const TooltipContainer = styled.div`
18
+ text-align: left;
19
+ min-width: ${({ theme }) => theme.space.l};
20
+ max-width: 250px;
21
+ min-height: 30px;
22
+ display: grid;
23
+ align-items: center;
24
+ padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};
25
+ position: relative;
26
+ background-color: white;
27
+ border-radius: 2px;
28
+ font-size: 13px;
29
+ color: ${({ theme }) => theme.colors.neutral[600]};
30
+ pointer-events: none;
31
+ `;
32
+ const TruncatedTooltipText = ({ value = "", placement = "top" }) => {
33
+ const [showTooltip, setShowTooltip] = useState(false);
34
+ const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({
35
+ placement,
36
+ externallyControlledIsOpen: showTooltip,
37
+ withoutAnimation: true
38
+ });
39
+ const handleMouseEnter = useCallback((e) => {
40
+ const el = e.currentTarget;
41
+ setShowTooltip(el.offsetWidth < el.scrollWidth);
42
+ }, []);
43
+ const handleMouseLeave = useCallback(() => {
44
+ setShowTooltip(false);
45
+ }, []);
46
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
47
+ /* @__PURE__ */ jsx(TruncatedSpan, { innerRef: refs.setReference, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: value }),
48
+ /* @__PURE__ */ jsx(
49
+ FloatingWrapper,
50
+ {
51
+ innerRef: refs.setFloating,
52
+ isOpen: showTooltip,
53
+ floatingStyles,
54
+ context,
55
+ children: /* @__PURE__ */ jsxs(TooltipContainer, { children: [
56
+ value,
57
+ /* @__PURE__ */ jsx(PopoverArrow, { ...arrowStyles })
58
+ ] })
59
+ }
60
+ )
61
+ ] });
62
+ };
63
+ var TruncatedTooltipText_default = TruncatedTooltipText;
64
+ export {
65
+ TruncatedTooltipText,
66
+ TruncatedTooltipText_default as default
67
+ };
68
+ //# sourceMappingURL=TruncatedTooltipText.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/TruncatedTooltipText.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useState } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport {\n useFloatingContext,\n FloatingWrapper,\n PopoverArrow,\n type DSHookFloatingContextT,\n} from '@elliemae/ds-floating-context';\n\nconst TruncatedSpan = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\n// Matches DSTooltipV3's StyledTooltipContainer styles for visual consistency\nconst TooltipContainer = styled.div`\n text-align: left;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n font-size: 13px;\n color: ${({ theme }) => theme.colors.neutral[600]};\n pointer-events: none;\n`;\n\ninterface TruncatedTooltipTextProps {\n value?: string;\n placement?: DSHookFloatingContextT.PopperPlacementsT;\n}\n\nconst TruncatedTooltipText = ({ value = '', placement = 'top' }: TruncatedTooltipTextProps) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({\n placement,\n externallyControlledIsOpen: showTooltip,\n withoutAnimation: true,\n });\n\n const handleMouseEnter = useCallback((e: React.MouseEvent<HTMLSpanElement>) => {\n const el = e.currentTarget;\n setShowTooltip(el.offsetWidth < el.scrollWidth);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setShowTooltip(false);\n }, []);\n\n return (\n <>\n <TruncatedSpan innerRef={refs.setReference} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n {value}\n </TruncatedSpan>\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={showTooltip}\n floatingStyles={floatingStyles}\n context={context}\n >\n <TooltipContainer>\n {value}\n <PopoverArrow {...arrowStyles} />\n </TooltipContainer>\n </FloatingWrapper>\n </>\n );\n};\n\nexport { TruncatedTooltipText };\nexport default TruncatedTooltipText;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC0DnB,mBACE,KASE,YAVJ;AA1DJ,SAAgB,aAAa,gBAAgB;AAC7C,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP,MAAM,gBAAgB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS7B,MAAM,mBAAmB,OAAO;AAAA;AAAA,eAEjB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,aAK9B,CAAC,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,EAAE,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,WAKxD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AASnD,MAAM,uBAAuB,CAAC,EAAE,QAAQ,IAAI,YAAY,MAAM,MAAiC;AAC7F,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AAEpD,QAAM,EAAE,MAAM,gBAAgB,aAAa,QAAQ,IAAI,mBAAmB;AAAA,IACxE;AAAA,IACA,4BAA4B;AAAA,IAC5B,kBAAkB;AAAA,EACpB,CAAC;AAED,QAAM,mBAAmB,YAAY,CAAC,MAAyC;AAC7E,UAAM,KAAK,EAAE;AACb,mBAAe,GAAG,cAAc,GAAG,WAAW;AAAA,EAChD,GAAG,CAAC,CAAC;AAEL,QAAM,mBAAmB,YAAY,MAAM;AACzC,mBAAe,KAAK;AAAA,EACtB,GAAG,CAAC,CAAC;AAEL,SACE,iCACE;AAAA,wBAAC,iBAAc,UAAU,KAAK,cAAc,cAAc,kBAAkB,cAAc,kBACvF,iBACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,KAAK;AAAA,QACf,QAAQ;AAAA,QACR;AAAA,QACA;AAAA,QAEA,+BAAC,oBACE;AAAA;AAAA,UACD,oBAAC,gBAAc,GAAG,aAAa;AAAA,WACjC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAGA,IAAO,+BAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ import { type DSHookFloatingContextT } from '@elliemae/ds-floating-context';
2
+ interface TruncatedTooltipTextProps {
3
+ value?: string;
4
+ placement?: DSHookFloatingContextT.PopperPlacementsT;
5
+ }
6
+ declare const TruncatedTooltipText: ({ value, placement }: TruncatedTooltipTextProps) => import("react/jsx-runtime").JSX.Element;
7
+ export { TruncatedTooltipText };
8
+ export default TruncatedTooltipText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-chat-container-header",
3
- "version": "3.70.0-next.3",
3
+ "version": "3.70.0-next.4",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Chat Container Header",
6
6
  "files": [
@@ -36,17 +36,17 @@
36
36
  "typeSafety": true
37
37
  },
38
38
  "dependencies": {
39
- "@elliemae/ds-props-helpers": "3.70.0-next.3",
40
- "@elliemae/ds-grid": "3.70.0-next.3",
41
- "@elliemae/ds-truncated-tooltip-text": "3.70.0-next.3",
42
- "@elliemae/ds-system": "3.70.0-next.3"
39
+ "@elliemae/ds-floating-context": "3.70.0-next.4",
40
+ "@elliemae/ds-props-helpers": "3.70.0-next.4",
41
+ "@elliemae/ds-grid": "3.70.0-next.4",
42
+ "@elliemae/ds-system": "3.70.0-next.4"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/react": "^18.0.0",
46
46
  "jest": "^30.0.0",
47
47
  "styled-components": "~5.3.9",
48
- "@elliemae/ds-test-utils": "3.70.0-next.3",
49
- "@elliemae/ds-monorepo-devops": "3.70.0-next.3"
48
+ "@elliemae/ds-test-utils": "3.70.0-next.4",
49
+ "@elliemae/ds-monorepo-devops": "3.70.0-next.4"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "lodash-es": "^4.17.21",