@elliemae/ds-chat-container-header 3.70.0-next.1 → 3.70.0-next.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/dist/cjs/ChatContainerHeader.js +57 -29
- package/dist/cjs/ChatContainerHeader.js.map +2 -2
- package/dist/cjs/TruncatedTooltipText.js +118 -0
- package/dist/cjs/TruncatedTooltipText.js.map +7 -0
- package/dist/cjs/{DSChatContainerHeaderDefinitions.js → constants/index.js} +22 -4
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +10 -3
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +11 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/styled.js +23 -3
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/{ChatContainerHeaderDataTestIds.js → typescript-testing/slot-props.js} +15 -14
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-chat-container-header-valid.js +22 -5
- package/dist/cjs/typescript-testing/typescript-chat-container-header-valid.js.map +2 -2
- package/dist/esm/ChatContainerHeader.js +64 -30
- package/dist/esm/ChatContainerHeader.js.map +2 -2
- package/dist/esm/TruncatedTooltipText.js +92 -0
- package/dist/esm/TruncatedTooltipText.js.map +7 -0
- package/dist/esm/constants/index.js +24 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +21 -4
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/react-desc-prop-types.js +17 -3
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/styled.js +24 -4
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/typescript-testing/slot-props.js +17 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-chat-container-header-valid.js +22 -5
- package/dist/esm/typescript-testing/typescript-chat-container-header-valid.js.map +2 -2
- package/dist/types/ChatContainerHeader.d.ts +3 -1
- package/dist/types/TruncatedTooltipText.d.ts +10 -0
- package/dist/types/constants/index.d.ts +15 -0
- package/dist/types/index.d.ts +4 -3
- package/dist/types/react-desc-prop-types.d.ts +18 -8
- package/dist/types/styled.d.ts +3 -1
- package/dist/types/tests/DSChatContainerHeader.api.test.d.ts +1 -0
- package/dist/types/tests/DSChatContainerHeader.data-testid.test.d.ts +1 -0
- package/dist/types/tests/DSChatContainerHeader.events.test.d.ts +1 -0
- package/dist/types/tests/DSChatContainerHeader.exports.test.d.ts +1 -0
- package/dist/types/tests/DSChatContainerHeader.get-owner-props-arguments.test.d.ts +1 -0
- package/dist/types/tests/DSChatContainerHeader.keyboard.test.d.ts +1 -0
- package/dist/types/tests/DSChatContainerHeader.pui-17062.test.d.ts +1 -0
- package/dist/types/typescript-testing/slot-props.d.ts +1 -0
- package/package.json +7 -7
- package/dist/cjs/ChatContainerHeaderDataTestIds.js.map +0 -7
- package/dist/cjs/DSChatContainerHeaderDefinitions.js.map +0 -7
- package/dist/esm/ChatContainerHeaderDataTestIds.js +0 -9
- package/dist/esm/ChatContainerHeaderDataTestIds.js.map +0 -7
- package/dist/esm/DSChatContainerHeaderDefinitions.js +0 -6
- package/dist/esm/DSChatContainerHeaderDefinitions.js.map +0 -7
- package/dist/types/ChatContainerHeaderDataTestIds.d.ts +0 -4
- package/dist/types/DSChatContainerHeaderDefinitions.d.ts +0 -1
- /package/dist/types/tests/{ChatContainerHeader.test.d.ts → DSChatContainerHeader.a11y.test.d.ts} +0 -0
|
@@ -2,55 +2,89 @@ import * as React from "react";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React2 from "react";
|
|
4
4
|
import { omit } from "lodash-es";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
describe,
|
|
7
|
+
useValidateTypescriptPropTypes,
|
|
8
|
+
useGetGlobalAttributes,
|
|
9
|
+
useMemoMergePropsWithDefault,
|
|
10
|
+
useOwnerProps
|
|
11
|
+
} from "@elliemae/ds-props-helpers";
|
|
12
|
+
import { TruncatedTooltipText } from "./TruncatedTooltipText.js";
|
|
7
13
|
import {
|
|
8
14
|
StyledChatContainerContentHeader,
|
|
9
15
|
StyledChatContainerContentHeaderLabel,
|
|
10
16
|
StyledChatContainerContentHeaderActions
|
|
11
17
|
} from "./styled.js";
|
|
12
|
-
import { propTypes } from "./react-desc-prop-types.js";
|
|
13
|
-
import {
|
|
14
|
-
import { DSChatContainerHeaderName } from "./DSChatContainerHeaderDefinitions.js";
|
|
18
|
+
import { defaultProps, propTypes } from "./react-desc-prop-types.js";
|
|
19
|
+
import { CHAT_CONTAINER_HEADER_DATA_TESTID, DSChatContainerHeaderName } from "./constants/index.js";
|
|
15
20
|
const ChatContainerHeader = (props) => {
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
22
|
+
useValidateTypescriptPropTypes(propsWithDefault, propTypes, DSChatContainerHeaderName);
|
|
23
|
+
const globalProps = omit(useGetGlobalAttributes(propsWithDefault), [
|
|
18
24
|
"cols",
|
|
19
25
|
"rows",
|
|
20
26
|
"wrap",
|
|
21
27
|
"title"
|
|
22
28
|
]);
|
|
23
|
-
const {
|
|
29
|
+
const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);
|
|
30
|
+
const { title, children, wrapText } = propsWithDefault;
|
|
24
31
|
const cols = React2.useMemo(
|
|
25
32
|
() => ["minmax(calc(100% - 64px), 1fr)", children ? "auto" : "0px"],
|
|
26
33
|
[children]
|
|
27
34
|
);
|
|
28
|
-
return /* @__PURE__ */ jsxs(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
return /* @__PURE__ */ jsxs(
|
|
36
|
+
StyledChatContainerContentHeader,
|
|
37
|
+
{
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
cols,
|
|
40
|
+
role: "heading",
|
|
41
|
+
"aria-level": 2,
|
|
42
|
+
...globalProps,
|
|
43
|
+
getOwnerProps,
|
|
44
|
+
getOwnerPropsArguments,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
47
|
+
StyledChatContainerContentHeaderLabel,
|
|
48
|
+
{
|
|
49
|
+
"data-testid": CHAT_CONTAINER_HEADER_DATA_TESTID.HEADER_TITLE,
|
|
50
|
+
pl: "xxs",
|
|
51
|
+
pr: "xxs",
|
|
52
|
+
$wrapText: wrapText,
|
|
53
|
+
getOwnerProps,
|
|
54
|
+
getOwnerPropsArguments,
|
|
55
|
+
children: wrapText ? title : /* @__PURE__ */ jsx(
|
|
56
|
+
TruncatedTooltipText,
|
|
57
|
+
{
|
|
58
|
+
value: title,
|
|
59
|
+
getOwnerProps,
|
|
60
|
+
getOwnerPropsArguments
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
StyledChatContainerContentHeaderActions,
|
|
67
|
+
{
|
|
68
|
+
cols: React2.Children.toArray(children).filter(Boolean).map(() => "32px"),
|
|
69
|
+
justifyContent: "flex-end",
|
|
70
|
+
"data-testid": CHAT_CONTAINER_HEADER_DATA_TESTID.HEADER_CHILDREN,
|
|
71
|
+
getOwnerProps,
|
|
72
|
+
getOwnerPropsArguments,
|
|
73
|
+
children
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
);
|
|
48
79
|
};
|
|
49
80
|
ChatContainerHeader.displayName = DSChatContainerHeaderName;
|
|
50
81
|
const ChatContainerHeaderWithSchema = describe(ChatContainerHeader);
|
|
51
|
-
|
|
82
|
+
const DSChatContainerHeader = ChatContainerHeader;
|
|
83
|
+
const DSChatContainerHeaderWithSchema = ChatContainerHeaderWithSchema;
|
|
52
84
|
export {
|
|
53
85
|
ChatContainerHeader,
|
|
54
|
-
ChatContainerHeaderWithSchema
|
|
86
|
+
ChatContainerHeaderWithSchema,
|
|
87
|
+
DSChatContainerHeader,
|
|
88
|
+
DSChatContainerHeaderWithSchema
|
|
55
89
|
};
|
|
56
90
|
//# sourceMappingURL=ChatContainerHeader.js.map
|
|
@@ -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 {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { omit } from 'lodash-es';\nimport {\n describe,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n useMemoMergePropsWithDefault,\n useOwnerProps,\n} from '@elliemae/ds-props-helpers';\nimport { type DSGridT } from '@elliemae/ds-grid';\nimport { TruncatedTooltipText } from './TruncatedTooltipText.js';\nimport {\n StyledChatContainerContentHeader,\n StyledChatContainerContentHeaderLabel,\n StyledChatContainerContentHeaderActions,\n} from './styled.js';\nimport type { DSChatContainerHeaderT } from './react-desc-prop-types.js';\nimport { defaultProps, propTypes } from './react-desc-prop-types.js';\nimport { CHAT_CONTAINER_HEADER_DATA_TESTID, DSChatContainerHeaderName } from './constants/index.js';\n\nconst ChatContainerHeader: React.ComponentType<DSChatContainerHeaderT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatContainerHeaderT.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, propTypes, DSChatContainerHeaderName);\n\n // `title` is omitted from globalProps to avoid forwarding it to the DOM as the native `title`\n // attribute (which would produce an unwanted browser tooltip on the header element).\n const globalProps = omit(useGetGlobalAttributes<DSChatContainerHeaderT.InternalProps>(propsWithDefault), [\n 'cols',\n 'rows',\n 'wrap',\n 'title',\n ]);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps<DSChatContainerHeaderT.Props>(propsWithDefault);\n const { title, children, wrapText } = propsWithDefault;\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\n alignItems=\"center\"\n cols={cols}\n role=\"heading\"\n aria-level={2}\n {...globalProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledChatContainerContentHeaderLabel\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={CHAT_CONTAINER_HEADER_DATA_TESTID.HEADER_TITLE}\n pl=\"xxs\"\n pr=\"xxs\"\n $wrapText={wrapText}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {wrapText ? (\n title\n ) : (\n <TruncatedTooltipText\n value={title}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n )}\n </StyledChatContainerContentHeaderLabel>\n <StyledChatContainerContentHeaderActions\n cols={React.Children.toArray(children)\n .filter(Boolean)\n .map(() => '32px')}\n justifyContent=\"flex-end\"\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={CHAT_CONTAINER_HEADER_DATA_TESTID.HEADER_CHILDREN}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {children}\n </StyledChatContainerContentHeaderActions>\n </StyledChatContainerContentHeader>\n );\n};\n\nChatContainerHeader.displayName = DSChatContainerHeaderName;\nconst ChatContainerHeaderWithSchema = describe(ChatContainerHeader);\n\n// DS-prefixed canonical names (modern Dimsum convention) \u2014 ChatContainerHeader kept as alias for backwards compat\nconst DSChatContainerHeader = ChatContainerHeader;\nconst DSChatContainerHeaderWithSchema = ChatContainerHeaderWithSchema;\n\nexport { ChatContainerHeader, ChatContainerHeaderWithSchema, DSChatContainerHeader, DSChatContainerHeaderWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACwCnB,SAqBM,KArBN;AAxCJ,OAAOA,YAAW;AAClB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,cAAc,iBAAiB;AACxC,SAAS,mCAAmC,iCAAiC;AAE7E,MAAM,sBAAyE,CAAC,UAAU;AACxF,QAAM,mBAAmB,6BAAmE,OAAO,YAAY;AAC/G,iCAA+B,kBAAkB,WAAW,yBAAyB;AAIrF,QAAM,cAAc,KAAK,uBAA6D,gBAAgB,GAAG;AAAA,IACvG;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAA4C,gBAAgB;AAC9G,QAAM,EAAE,OAAO,UAAU,SAAS,IAAI;AACtC,QAAM,OAAOA,OAAM;AAAA,IACjB,MAAM,CAAC,kCAAkC,WAAW,SAAS,KAAK;AAAA,IAClE,CAAC,QAAQ;AAAA,EACX;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,YAAW;AAAA,MACX;AAAA,MACA,MAAK;AAAA,MACL,cAAY;AAAA,MACX,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YAEC,eAAa,kCAAkC;AAAA,YAC/C,IAAG;AAAA,YACH,IAAG;AAAA,YACH,WAAW;AAAA,YACX;AAAA,YACA;AAAA,YAEC,qBACC,QAEA;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO;AAAA,gBACP;AAAA,gBACA;AAAA;AAAA,YACF;AAAA;AAAA,QAEJ;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,MAAMA,OAAM,SAAS,QAAQ,QAAQ,EAClC,OAAO,OAAO,EACd,IAAI,MAAM,MAAM;AAAA,YACnB,gBAAe;AAAA,YAEf,eAAa,kCAAkC;AAAA,YAC/C;AAAA,YACA;AAAA,YAEC;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,oBAAoB,cAAc;AAClC,MAAM,gCAAgC,SAAS,mBAAmB;AAGlE,MAAM,wBAAwB;AAC9B,MAAM,kCAAkC;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
import { CHAT_CONTAINER_HEADER_SLOTS, DSChatContainerHeaderName } from "./constants/index.js";
|
|
11
|
+
const TruncatedSpan = styled("span", {
|
|
12
|
+
name: DSChatContainerHeaderName,
|
|
13
|
+
slot: CHAT_CONTAINER_HEADER_SLOTS.TOOLTIP_TEXT
|
|
14
|
+
})`
|
|
15
|
+
text-overflow: ellipsis;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
display: inline-block;
|
|
19
|
+
max-width: 100%;
|
|
20
|
+
`;
|
|
21
|
+
const TooltipContainer = styled("div", {
|
|
22
|
+
name: DSChatContainerHeaderName,
|
|
23
|
+
slot: CHAT_CONTAINER_HEADER_SLOTS.TOOLTIP_CONTAINER
|
|
24
|
+
})`
|
|
25
|
+
text-align: center;
|
|
26
|
+
min-width: ${({ theme }) => theme.space.l};
|
|
27
|
+
max-width: 250px;
|
|
28
|
+
overflow-wrap: break-word;
|
|
29
|
+
word-break: break-word;
|
|
30
|
+
min-height: 30px;
|
|
31
|
+
display: grid;
|
|
32
|
+
align-items: center;
|
|
33
|
+
padding: ${({ theme }) => `${theme.space.xxs} ${theme.space.xs}`};
|
|
34
|
+
position: relative;
|
|
35
|
+
background-color: white;
|
|
36
|
+
border-radius: 2px;
|
|
37
|
+
font-size: 13px;
|
|
38
|
+
color: ${({ theme }) => theme.colors.neutral[600]};
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
`;
|
|
41
|
+
const TruncatedTooltipText = ({
|
|
42
|
+
value = "",
|
|
43
|
+
placement = "top",
|
|
44
|
+
getOwnerProps,
|
|
45
|
+
getOwnerPropsArguments
|
|
46
|
+
}) => {
|
|
47
|
+
const [showTooltip, setShowTooltip] = useState(false);
|
|
48
|
+
const { refs, floatingStyles, arrowStyles, context } = useFloatingContext({
|
|
49
|
+
placement,
|
|
50
|
+
externallyControlledIsOpen: showTooltip,
|
|
51
|
+
withoutAnimation: true
|
|
52
|
+
});
|
|
53
|
+
const handleMouseEnter = useCallback((e) => {
|
|
54
|
+
const el = e.currentTarget;
|
|
55
|
+
setShowTooltip(el.offsetWidth < el.scrollWidth);
|
|
56
|
+
}, []);
|
|
57
|
+
const handleMouseLeave = useCallback(() => {
|
|
58
|
+
setShowTooltip(false);
|
|
59
|
+
}, []);
|
|
60
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
TruncatedSpan,
|
|
63
|
+
{
|
|
64
|
+
innerRef: refs.setReference,
|
|
65
|
+
onMouseEnter: handleMouseEnter,
|
|
66
|
+
onMouseLeave: handleMouseLeave,
|
|
67
|
+
getOwnerProps,
|
|
68
|
+
getOwnerPropsArguments,
|
|
69
|
+
children: value
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
FloatingWrapper,
|
|
74
|
+
{
|
|
75
|
+
innerRef: refs.setFloating,
|
|
76
|
+
isOpen: showTooltip,
|
|
77
|
+
floatingStyles,
|
|
78
|
+
context,
|
|
79
|
+
children: /* @__PURE__ */ jsxs(TooltipContainer, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
80
|
+
value,
|
|
81
|
+
/* @__PURE__ */ jsx(PopoverArrow, { ...arrowStyles })
|
|
82
|
+
] })
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] });
|
|
86
|
+
};
|
|
87
|
+
var TruncatedTooltipText_default = TruncatedTooltipText;
|
|
88
|
+
export {
|
|
89
|
+
TruncatedTooltipText,
|
|
90
|
+
TruncatedTooltipText_default as default
|
|
91
|
+
};
|
|
92
|
+
//# 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';\nimport { CHAT_CONTAINER_HEADER_SLOTS, DSChatContainerHeaderName } from './constants/index.js';\n\nconst TruncatedSpan = styled('span', {\n name: DSChatContainerHeaderName,\n slot: CHAT_CONTAINER_HEADER_SLOTS.TOOLTIP_TEXT,\n})`\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 name: DSChatContainerHeaderName,\n slot: CHAT_CONTAINER_HEADER_SLOTS.TOOLTIP_CONTAINER,\n})`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n overflow-wrap: break-word;\n word-break: break-word;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxs} ${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 getOwnerProps?: () => object;\n getOwnerPropsArguments?: () => object;\n}\n\nconst TruncatedTooltipText = ({\n value = '',\n placement = 'top',\n getOwnerProps,\n getOwnerPropsArguments,\n}: 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\n innerRef={refs.setReference}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {value}\n </TruncatedSpan>\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={showTooltip}\n floatingStyles={floatingStyles}\n context={context}\n >\n <TooltipContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {value}\n <PopoverArrow {...arrowStyles} />\n </TooltipContainer>\n </FloatingWrapper>\n </>\n );\n};\n\nexport { TruncatedTooltipText };\nexport default TruncatedTooltipText;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC0EnB,mBACE,KAeE,YAhBJ;AA1EJ,SAAgB,aAAa,gBAAgB;AAC7C,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,6BAA6B,iCAAiC;AAEvE,MAAM,gBAAgB,OAAO,QAAQ;AAAA,EACnC,MAAM;AAAA,EACN,MAAM,4BAA4B;AACpC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASD,MAAM,mBAAmB,OAAO,OAAO;AAAA,EACrC,MAAM;AAAA,EACN,MAAM,4BAA4B;AACpC,CAAC;AAAA;AAAA,eAEc,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAO9B,CAAC,EAAE,MAAM,MAAM,GAAG,MAAM,MAAM,GAAG,IAAI,MAAM,MAAM,EAAE,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,WAKvD,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAWnD,MAAM,uBAAuB,CAAC;AAAA,EAC5B,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ;AAAA,EACA;AACF,MAAiC;AAC/B,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;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,KAAK;AAAA,QACf,cAAc;AAAA,QACd,cAAc;AAAA,QACd;AAAA,QACA;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,KAAK;AAAA,QACf,QAAQ;AAAA,QACR;AAAA,QACA;AAAA,QAEA,+BAAC,oBAAiB,eAA8B,wBAC7C;AAAA;AAAA,UACD,oBAAC,gBAAc,GAAG,aAAa;AAAA,WACjC;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAGA,IAAO,+BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
3
|
+
const DSChatContainerHeaderName = "DSChatcontainerheader";
|
|
4
|
+
const CHAT_CONTAINER_HEADER_SLOTS = {
|
|
5
|
+
ROOT: "root",
|
|
6
|
+
HEADER_TITLE: "header-title",
|
|
7
|
+
// legacy data-testid override applied below
|
|
8
|
+
HEADER_CHILDREN: "header-children",
|
|
9
|
+
// legacy data-testid override applied below
|
|
10
|
+
TOOLTIP_TEXT: "tooltip-text",
|
|
11
|
+
TOOLTIP_CONTAINER: "tooltip-container"
|
|
12
|
+
};
|
|
13
|
+
const CHAT_CONTAINER_HEADER_DATA_TESTID = {
|
|
14
|
+
...slotObjectToDataTestIds(DSChatContainerHeaderName, CHAT_CONTAINER_HEADER_SLOTS),
|
|
15
|
+
// legacy values — preserved for QA/consumer compatibility, breaking change if removed
|
|
16
|
+
HEADER_TITLE: "chat-header-title",
|
|
17
|
+
HEADER_CHILDREN: "chat-header-children"
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
CHAT_CONTAINER_HEADER_DATA_TESTID,
|
|
21
|
+
CHAT_CONTAINER_HEADER_SLOTS,
|
|
22
|
+
DSChatContainerHeaderName
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSChatContainerHeaderName = 'DSChatcontainerheader';\n\nexport const CHAT_CONTAINER_HEADER_SLOTS = {\n ROOT: 'root',\n HEADER_TITLE: 'header-title', // legacy data-testid override applied below\n HEADER_CHILDREN: 'header-children', // legacy data-testid override applied below\n TOOLTIP_TEXT: 'tooltip-text',\n TOOLTIP_CONTAINER: 'tooltip-container',\n} as const;\n\nexport const CHAT_CONTAINER_HEADER_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSChatContainerHeaderName, CHAT_CONTAINER_HEADER_SLOTS),\n // legacy values \u2014 preserved for QA/consumer compatibility, breaking change if removed\n HEADER_TITLE: 'chat-header-title',\n HEADER_CHILDREN: 'chat-header-children',\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,4BAA4B;AAElC,MAAM,8BAA8B;AAAA,EACzC,MAAM;AAAA,EACN,cAAc;AAAA;AAAA,EACd,iBAAiB;AAAA;AAAA,EACjB,cAAc;AAAA,EACd,mBAAmB;AACrB;AAEO,MAAM,oCAAoC;AAAA,EAC/C,GAAG,wBAAwB,2BAA2B,2BAA2B;AAAA;AAAA,EAEjF,cAAc;AAAA,EACd,iBAAiB;AACnB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
ChatContainerHeader,
|
|
4
|
+
ChatContainerHeaderWithSchema,
|
|
5
|
+
DSChatContainerHeader,
|
|
6
|
+
DSChatContainerHeaderWithSchema
|
|
7
|
+
} from "./ChatContainerHeader.js";
|
|
8
|
+
import { propTypes } from "./react-desc-prop-types.js";
|
|
9
|
+
import {
|
|
10
|
+
CHAT_CONTAINER_HEADER_DATA_TESTID,
|
|
11
|
+
CHAT_CONTAINER_HEADER_DATA_TESTID as CHAT_CONTAINER_HEADER_DATA_TESTID2,
|
|
12
|
+
CHAT_CONTAINER_HEADER_SLOTS,
|
|
13
|
+
DSChatContainerHeaderName
|
|
14
|
+
} from "./constants/index.js";
|
|
4
15
|
export {
|
|
16
|
+
CHAT_CONTAINER_HEADER_DATA_TESTID2 as CHAT_CONTAINER_HEADER_DATA_TESTID,
|
|
17
|
+
CHAT_CONTAINER_HEADER_SLOTS,
|
|
5
18
|
ChatContainerHeader,
|
|
6
|
-
ChatContainerHeaderDataTestIds,
|
|
7
|
-
|
|
19
|
+
CHAT_CONTAINER_HEADER_DATA_TESTID as ChatContainerHeaderDataTestIds,
|
|
20
|
+
propTypes as ChatContainerHeaderPropTypes,
|
|
21
|
+
ChatContainerHeaderWithSchema,
|
|
22
|
+
DSChatContainerHeader,
|
|
23
|
+
DSChatContainerHeaderName,
|
|
24
|
+
DSChatContainerHeaderWithSchema
|
|
8
25
|
};
|
|
9
26
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export {\n ChatContainerHeader,\n ChatContainerHeaderWithSchema,\n DSChatContainerHeader,\n DSChatContainerHeaderWithSchema,\n} from './ChatContainerHeader.js';\nexport { type DSChatContainerHeaderT, propTypes as ChatContainerHeaderPropTypes } from './react-desc-prop-types.js';\nexport {\n CHAT_CONTAINER_HEADER_DATA_TESTID as ChatContainerHeaderDataTestIds, // LEGACY EXPORT\n CHAT_CONTAINER_HEADER_DATA_TESTID,\n CHAT_CONTAINER_HEADER_SLOTS,\n DSChatContainerHeaderName,\n} from './constants/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAmD,iBAAoC;AACvF;AAAA,EACuC;AAAA,EACrC,qCAAAA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
|
|
6
|
+
"names": ["CHAT_CONTAINER_HEADER_DATA_TESTID"]
|
|
7
7
|
}
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
PropTypes,
|
|
4
|
+
getPropsPerSlotPropTypes,
|
|
5
|
+
globalAttributesPropTypes,
|
|
6
|
+
xstyledPropTypes
|
|
7
|
+
} from "@elliemae/ds-props-helpers";
|
|
8
|
+
import { CHAT_CONTAINER_HEADER_SLOTS, DSChatContainerHeaderName } from "./constants/index.js";
|
|
9
|
+
const defaultProps = {
|
|
10
|
+
wrapText: false
|
|
11
|
+
};
|
|
3
12
|
const propTypes = {
|
|
13
|
+
...getPropsPerSlotPropTypes(DSChatContainerHeaderName, CHAT_CONTAINER_HEADER_SLOTS),
|
|
4
14
|
...globalAttributesPropTypes,
|
|
5
15
|
...xstyledPropTypes,
|
|
6
|
-
title: PropTypes.string.isRequired.description(`
|
|
7
|
-
children: PropTypes.node.description("
|
|
16
|
+
title: PropTypes.string.isRequired.description(`Header title`),
|
|
17
|
+
children: PropTypes.node.description("Children rendered in the actions area"),
|
|
18
|
+
wrapText: PropTypes.bool.description(
|
|
19
|
+
"When true, the title wraps onto multiple lines and the built-in truncation tooltip is NOT rendered. When false (default) the title is truncated with an ellipsis and a tooltip is shown on hover/focus."
|
|
20
|
+
).defaultValue(defaultProps.wrapText)
|
|
8
21
|
};
|
|
9
22
|
export {
|
|
23
|
+
defaultProps,
|
|
10
24
|
propTypes
|
|
11
25
|
};
|
|
12
26
|
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport {\n type DSPropTypesSchema,\n type GlobalAttributesT,\n type XstyledProps,\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { CHAT_CONTAINER_HEADER_SLOTS, DSChatContainerHeaderName } from './constants/index.js';\n\nexport declare namespace DSChatContainerHeaderT {\n // hand-written per-slot function argument map \u2014 one entry per slot in CHAT_CONTAINER_HEADER_SLOTS.\n export type SlotFunctionArguments = {\n dsChatcontainerheaderRoot: () => object;\n dsChatcontainerheaderHeaderTitle: () => object;\n dsChatcontainerheaderHeaderChildren: () => object;\n dsChatcontainerheaderTooltipText: () => object;\n dsChatcontainerheaderTooltipContainer: () => object;\n };\n\n export interface RequiredProps {\n title: string;\n }\n\n export interface DefaultProps {\n wrapText: boolean;\n }\n\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSChatContainerHeaderName,\n typeof CHAT_CONTAINER_HEADER_SLOTS\n > {\n children?: React.ReactNode;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSChatContainerHeaderT.DefaultProps = {\n wrapText: false,\n};\n\nexport const propTypes: DSPropTypesSchema<DSChatContainerHeaderT.Props> = {\n ...getPropsPerSlotPropTypes(DSChatContainerHeaderName, CHAT_CONTAINER_HEADER_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n title: PropTypes.string.isRequired.description(`Header title`),\n children: PropTypes.node.description('Children rendered in the actions area'),\n wrapText: PropTypes.bool\n .description(\n 'When true, the title wraps onto multiple lines and the built-in truncation tooltip is NOT rendered. ' +\n 'When false (default) the title is truncated with an ellipsis and a tooltip is shown on hover/focus.',\n )\n .defaultValue(defaultProps.wrapText),\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,6BAA6B,iCAAiC;AA2ChE,MAAM,eAAoD;AAAA,EAC/D,UAAU;AACZ;AAEO,MAAM,YAA6D;AAAA,EACxE,GAAG,yBAAyB,2BAA2B,2BAA2B;AAAA,EAClF,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO,UAAU,OAAO,WAAW,YAAY,cAAc;AAAA,EAC7D,UAAU,UAAU,KAAK,YAAY,uCAAuC;AAAA,EAC5E,UAAU,UAAU,KACjB;AAAA,IACC;AAAA,EAEF,EACC,aAAa,aAAa,QAAQ;AACvC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/styled.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { styled } from "@elliemae/ds-system";
|
|
2
|
+
import { styled, css } from "@elliemae/ds-system";
|
|
3
3
|
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
-
|
|
4
|
+
import { CHAT_CONTAINER_HEADER_SLOTS, DSChatContainerHeaderName } from "./constants/index.js";
|
|
5
|
+
const StyledChatContainerContentHeaderActions = styled(Grid, {
|
|
6
|
+
name: DSChatContainerHeaderName,
|
|
7
|
+
slot: CHAT_CONTAINER_HEADER_SLOTS.HEADER_CHILDREN,
|
|
8
|
+
// legacy data-testid `chat-header-children` is preserved via inline JSX data-testid
|
|
9
|
+
preserveLegacyDataTestId: true
|
|
10
|
+
})`
|
|
5
11
|
max-width: 80px;
|
|
6
12
|
`;
|
|
7
|
-
const StyledChatContainerContentHeader = styled(Grid
|
|
13
|
+
const StyledChatContainerContentHeader = styled(Grid, {
|
|
14
|
+
name: DSChatContainerHeaderName,
|
|
15
|
+
slot: CHAT_CONTAINER_HEADER_SLOTS.ROOT
|
|
16
|
+
})`
|
|
8
17
|
width: 100%;
|
|
9
18
|
min-height: 48px;
|
|
10
19
|
border-bottom: 1px solid ${(props) => props.theme.colors.neutral["200"]};
|
|
@@ -15,13 +24,24 @@ const StyledChatContainerContentHeader = styled(Grid)`
|
|
|
15
24
|
}
|
|
16
25
|
}
|
|
17
26
|
`;
|
|
18
|
-
const
|
|
27
|
+
const wrapTextLabelCss = css`
|
|
28
|
+
overflow-wrap: break-word;
|
|
29
|
+
word-break: break-word;
|
|
30
|
+
white-space: normal;
|
|
31
|
+
`;
|
|
32
|
+
const StyledChatContainerContentHeaderLabel = styled(Grid, {
|
|
33
|
+
name: DSChatContainerHeaderName,
|
|
34
|
+
slot: CHAT_CONTAINER_HEADER_SLOTS.HEADER_TITLE,
|
|
35
|
+
// legacy data-testid `chat-header-title` is preserved via inline JSX data-testid
|
|
36
|
+
preserveLegacyDataTestId: true
|
|
37
|
+
})`
|
|
19
38
|
justify-content: center;
|
|
20
39
|
align-items: center;
|
|
21
40
|
font-weight: 600;
|
|
22
41
|
font-size: 18px;
|
|
23
42
|
color: ${(props) => props.theme.colors.neutral["700"]};
|
|
24
43
|
line-height: 1.6;
|
|
44
|
+
${({ $wrapText }) => $wrapText ? wrapTextLabelCss : ""}
|
|
25
45
|
`;
|
|
26
46
|
export {
|
|
27
47
|
StyledChatContainerContentHeader,
|
package/dist/esm/styled.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styled.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { Grid, type DSGridT } from '@elliemae/ds-grid';\n\nexport const StyledChatContainerContentHeaderActions = styled(Grid)`\n max-width: 80px;\n`;\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const StyledChatContainerContentHeader = styled(Grid)<DSGridT.Props>`\n width: 100%;\n min-height: 48px;\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['200']};\n background: ${(props) => props.theme.colors.neutral['050']};\n ${StyledChatContainerContentHeaderActions} {\n & button {\n background: transparent;\n }\n }\n`;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport const StyledChatContainerContentHeaderLabel = styled(Grid)
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, css } from '@elliemae/ds-system';\nimport { Grid, type DSGridT } from '@elliemae/ds-grid';\nimport { CHAT_CONTAINER_HEADER_SLOTS, DSChatContainerHeaderName } from './constants/index.js';\n\nexport const StyledChatContainerContentHeaderActions = styled(Grid, {\n name: DSChatContainerHeaderName,\n slot: CHAT_CONTAINER_HEADER_SLOTS.HEADER_CHILDREN,\n // legacy data-testid `chat-header-children` is preserved via inline JSX data-testid\n preserveLegacyDataTestId: true,\n})`\n max-width: 80px;\n`;\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const StyledChatContainerContentHeader = styled(Grid, {\n name: DSChatContainerHeaderName,\n slot: CHAT_CONTAINER_HEADER_SLOTS.ROOT,\n})<DSGridT.Props>`\n width: 100%;\n min-height: 48px;\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['200']};\n background: ${(props) => props.theme.colors.neutral['050']};\n ${StyledChatContainerContentHeaderActions} {\n & button {\n background: transparent;\n }\n }\n`;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\n// When wrapText is enabled, the consumer-passed `title` is rendered directly into the label\n// instead of being wrapped by TruncatedTooltipText. We expand the label vertically and break\n// long unbroken words so a long single token cannot overflow horizontally.\nconst wrapTextLabelCss = css`\n overflow-wrap: break-word;\n word-break: break-word;\n white-space: normal;\n`;\n\nexport const StyledChatContainerContentHeaderLabel = styled(Grid, {\n name: DSChatContainerHeaderName,\n slot: CHAT_CONTAINER_HEADER_SLOTS.HEADER_TITLE,\n // legacy data-testid `chat-header-title` is preserved via inline JSX data-testid\n preserveLegacyDataTestId: true,\n})<{ $wrapText?: boolean }>`\n justify-content: center;\n align-items: center;\n font-weight: 600;\n font-size: 18px;\n color: ${(props) => props.theme.colors.neutral['700']};\n line-height: 1.6;\n ${({ $wrapText }) => ($wrapText ? wrapTextLabelCss : '')}\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,WAAW;AAC5B,SAAS,YAA0B;AACnC,SAAS,6BAA6B,iCAAiC;AAEhE,MAAM,0CAA0C,OAAO,MAAM;AAAA,EAClE,MAAM;AAAA,EACN,MAAM,4BAA4B;AAAA;AAAA,EAElC,0BAA0B;AAC5B,CAAC;AAAA;AAAA;AAIM,MAAM,mCAAmC,OAAO,MAAM;AAAA,EAC3D,MAAM;AAAA,EACN,MAAM,4BAA4B;AACpC,CAAC;AAAA;AAAA;AAAA,6BAG4B,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,gBACzD,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,IACxD,uCAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAW3C,MAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAMlB,MAAM,wCAAwC,OAAO,MAAM;AAAA,EAChE,MAAM;AAAA,EACN,MAAM,4BAA4B;AAAA;AAAA,EAElC,0BAA0B;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,WAKU,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA,IAEnD,CAAC,EAAE,UAAU,MAAO,YAAY,mBAAmB,EAAG;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SlotPropsAsObject = {
|
|
3
|
+
dsChatcontainerheaderRoot: { "aria-label": "just a typescript test" },
|
|
4
|
+
dsChatcontainerheaderHeaderTitle: { "aria-label": "just a typescript test" },
|
|
5
|
+
dsChatcontainerheaderHeaderChildren: { "aria-label": "just a typescript test" },
|
|
6
|
+
dsChatcontainerheaderTooltipText: { "aria-label": "just a typescript test" },
|
|
7
|
+
dsChatcontainerheaderTooltipContainer: { "aria-label": "just a typescript test" }
|
|
8
|
+
};
|
|
9
|
+
const SlotPropsAsFunctions = {
|
|
10
|
+
dsChatcontainerheaderRoot: () => ({ "aria-label": "just a typescript test" }),
|
|
11
|
+
dsChatcontainerheaderHeaderTitle: () => ({ "aria-label": "just a typescript test" }),
|
|
12
|
+
dsChatcontainerheaderHeaderChildren: () => ({ "aria-label": "just a typescript test" }),
|
|
13
|
+
dsChatcontainerheaderTooltipText: () => ({ "aria-label": "just a typescript test" }),
|
|
14
|
+
dsChatcontainerheaderTooltipContainer: () => ({ "aria-label": "just a typescript test" })
|
|
15
|
+
};
|
|
16
|
+
const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
|
|
17
|
+
//# sourceMappingURL=slot-props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/slot-props.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { CHAT_CONTAINER_HEADER_SLOTS, DSChatContainerHeaderName } from '../constants/index.js';\nimport type { DSChatContainerHeaderT } from '../index.js';\n\n// One entry per slot \u2014 object form\nconst SlotPropsAsObject: Partial<DSChatContainerHeaderT.Props> = {\n dsChatcontainerheaderRoot: { 'aria-label': 'just a typescript test' },\n dsChatcontainerheaderHeaderTitle: { 'aria-label': 'just a typescript test' },\n dsChatcontainerheaderHeaderChildren: { 'aria-label': 'just a typescript test' },\n dsChatcontainerheaderTooltipText: { 'aria-label': 'just a typescript test' },\n dsChatcontainerheaderTooltipContainer: { 'aria-label': 'just a typescript test' },\n};\n\n// One entry per slot \u2014 function form\nconst SlotPropsAsFunctions: DSChatContainerHeaderT.SlotFunctionArguments = {\n dsChatcontainerheaderRoot: () => ({ 'aria-label': 'just a typescript test' }),\n dsChatcontainerheaderHeaderTitle: () => ({ 'aria-label': 'just a typescript test' }),\n dsChatcontainerheaderHeaderChildren: () => ({ 'aria-label': 'just a typescript test' }),\n dsChatcontainerheaderTooltipText: () => ({ 'aria-label': 'just a typescript test' }),\n dsChatcontainerheaderTooltipContainer: () => ({ 'aria-label': 'just a typescript test' }),\n};\n\n// Exhaustiveness check \u2014 fails compilation if any slot is missing from SlotFunctionArguments\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSChatContainerHeaderName, typeof CHAT_CONTAINER_HEADER_SLOTS>\n> = SlotPropsAsFunctions;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACMvB,MAAM,oBAA2D;AAAA,EAC/D,2BAA2B,EAAE,cAAc,yBAAyB;AAAA,EACpE,kCAAkC,EAAE,cAAc,yBAAyB;AAAA,EAC3E,qCAAqC,EAAE,cAAc,yBAAyB;AAAA,EAC9E,kCAAkC,EAAE,cAAc,yBAAyB;AAAA,EAC3E,uCAAuC,EAAE,cAAc,yBAAyB;AAClF;AAGA,MAAM,uBAAqE;AAAA,EACzE,2BAA2B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC3E,kCAAkC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAClF,qCAAqC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACrF,kCAAkC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAClF,uCAAuC,OAAO,EAAE,cAAc,yBAAyB;AACzF;AAGA,MAAM,6CAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -7,21 +7,36 @@ const testRequiredProps = {
|
|
|
7
7
|
const testOptionalProps = {
|
|
8
8
|
children: /* @__PURE__ */ jsx("div", {})
|
|
9
9
|
};
|
|
10
|
+
const testPartialDefaults = {
|
|
11
|
+
wrapText: false
|
|
12
|
+
};
|
|
10
13
|
const testProps = {
|
|
11
14
|
...testRequiredProps,
|
|
12
|
-
...testOptionalProps
|
|
15
|
+
...testOptionalProps,
|
|
16
|
+
...testPartialDefaults
|
|
13
17
|
};
|
|
14
18
|
const testPropsAsSyntax = {
|
|
15
19
|
...testRequiredProps,
|
|
16
|
-
...testOptionalProps
|
|
20
|
+
...testOptionalProps,
|
|
21
|
+
...testPartialDefaults
|
|
22
|
+
};
|
|
23
|
+
const testCompleteDefaults = {
|
|
24
|
+
wrapText: false
|
|
25
|
+
};
|
|
26
|
+
const testInternalProps = {
|
|
27
|
+
...testRequiredProps,
|
|
28
|
+
...testOptionalProps,
|
|
29
|
+
...testCompleteDefaults
|
|
17
30
|
};
|
|
18
31
|
const testExplicitDefinition = {
|
|
19
32
|
title: "",
|
|
20
|
-
children: /* @__PURE__ */ jsx("div", {})
|
|
33
|
+
children: /* @__PURE__ */ jsx("div", {}),
|
|
34
|
+
wrapText: true
|
|
21
35
|
};
|
|
22
36
|
const testInferedTypeCompatibility = {
|
|
23
37
|
title: "",
|
|
24
|
-
children: /* @__PURE__ */ jsx("div", {})
|
|
38
|
+
children: /* @__PURE__ */ jsx("div", {}),
|
|
39
|
+
wrapText: false
|
|
25
40
|
};
|
|
26
41
|
const testDefinitionAsConst = {
|
|
27
42
|
title: "",
|
|
@@ -31,6 +46,8 @@ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
|
31
46
|
/* @__PURE__ */ jsx(ChatContainerHeader, { ...testExplicitDefinition }),
|
|
32
47
|
/* @__PURE__ */ jsx(ChatContainerHeader, { ...testInferedTypeCompatibility }),
|
|
33
48
|
/* @__PURE__ */ jsx(ChatContainerHeader, { ...testDefinitionAsConst }),
|
|
34
|
-
/* @__PURE__ */ jsx(ChatContainerHeader, { title: "", children: /* @__PURE__ */ jsx("div", {}) })
|
|
49
|
+
/* @__PURE__ */ jsx(ChatContainerHeader, { title: "", children: /* @__PURE__ */ jsx("div", {}) }),
|
|
50
|
+
/* @__PURE__ */ jsx(ChatContainerHeader, { title: "example", wrapText: true }),
|
|
51
|
+
/* @__PURE__ */ jsx(ChatContainerHeader, { title: "example", wrapText: false })
|
|
35
52
|
] });
|
|
36
53
|
//# sourceMappingURL=typescript-chat-container-header-valid.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-chat-container-header-valid.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport type { DSChatContainerHeaderT } from '../index.js';\nimport { ChatContainerHeader } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSChatContainerHeaderT.Props;\ntype ComponentPropsOptionalProps = DSChatContainerHeaderT.OptionalProps;\ntype ComponentPropsRequiredProps = DSChatContainerHeaderT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n title: '',\n};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n children: <div></div>,\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n} as ComponentPropsForApp;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n title: '',\n children: <div></div>,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n title: '',\n children: <div></div>,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n title: '',\n children: <div></div>,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <ChatContainerHeader {...testExplicitDefinition} />\n <ChatContainerHeader {...testInferedTypeCompatibility} />\n <ChatContainerHeader {...testDefinitionAsConst} />\n {/* works with inline values */}\n <ChatContainerHeader title=\"\">\n <div></div>\n </ChatContainerHeader>\n </>\n);\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport type { DSChatContainerHeaderT } from '../index.js';\nimport { ChatContainerHeader } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSChatContainerHeaderT.Props;\ntype ComponentPropsInternals = DSChatContainerHeaderT.InternalProps;\ntype ComponentPropsDefaultProps = DSChatContainerHeaderT.DefaultProps;\ntype ComponentPropsOptionalProps = DSChatContainerHeaderT.OptionalProps;\ntype ComponentPropsRequiredProps = DSChatContainerHeaderT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n title: '',\n};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n children: <div></div>,\n};\n\n// difference between Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n wrapText: false,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n wrapText: false,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n title: '',\n children: <div></div>,\n wrapText: true,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n title: '',\n children: <div></div>,\n wrapText: false,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n title: '',\n children: <div></div>,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <ChatContainerHeader {...testExplicitDefinition} />\n <ChatContainerHeader {...testInferedTypeCompatibility} />\n <ChatContainerHeader {...testDefinitionAsConst} />\n {/* works with inline values */}\n <ChatContainerHeader title=\"\">\n <div></div>\n </ChatContainerHeader>\n {/* wrapText accepted as a boolean and is optional */}\n <ChatContainerHeader title=\"example\" wrapText />\n <ChatContainerHeader title=\"example\" wrapText={false} />\n </>\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACgBX,SAoDV,UApDU,KAoDV,YApDU;AAdZ,SAAS,2BAA2B;AASpC,MAAM,oBAAiD;AAAA,EACrD,OAAO;AACT;AAEA,MAAM,oBAAiD;AAAA,EACrD,UAAU,oBAAC,SAAI;AACjB;AAIA,MAAM,sBAA2D;AAAA,EAC/D,UAAU;AACZ;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,UAAU;AACZ;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,OAAO;AAAA,EACP,UAAU,oBAAC,SAAI;AAAA,EACf,UAAU;AACZ;AAGA,MAAM,+BAA+B;AAAA,EACnC,OAAO;AAAA,EACP,UAAU,oBAAC,SAAI;AAAA,EACf,UAAU;AACZ;AAEA,MAAM,wBAAwB;AAAA,EAC5B,OAAO;AAAA,EACP,UAAU,oBAAC,SAAI;AACjB;AAEA,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,uBAAqB,GAAG,wBAAwB;AAAA,EACjD,oBAAC,uBAAqB,GAAG,8BAA8B;AAAA,EACvD,oBAAC,uBAAqB,GAAG,uBAAuB;AAAA,EAEhD,oBAAC,uBAAoB,OAAM,IACzB,8BAAC,SAAI,GACP;AAAA,EAEA,oBAAC,uBAAoB,OAAM,WAAU,UAAQ,MAAC;AAAA,EAC9C,oBAAC,uBAAoB,OAAM,WAAU,UAAU,OAAO;AAAA,GACxD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,4 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import type { DSChatContainerHeaderT } from './react-desc-prop-types.js';
|
|
3
3
|
declare const ChatContainerHeader: React.ComponentType<DSChatContainerHeaderT.Props>;
|
|
4
4
|
declare const ChatContainerHeaderWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSChatContainerHeaderT.Props>;
|
|
5
|
-
|
|
5
|
+
declare const DSChatContainerHeader: React.FunctionComponent<DSChatContainerHeaderT.Props>;
|
|
6
|
+
declare const DSChatContainerHeaderWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSChatContainerHeaderT.Props>;
|
|
7
|
+
export { ChatContainerHeader, ChatContainerHeaderWithSchema, DSChatContainerHeader, DSChatContainerHeaderWithSchema };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type DSHookFloatingContextT } from '@elliemae/ds-floating-context';
|
|
2
|
+
interface TruncatedTooltipTextProps {
|
|
3
|
+
value?: string;
|
|
4
|
+
placement?: DSHookFloatingContextT.PopperPlacementsT;
|
|
5
|
+
getOwnerProps?: () => object;
|
|
6
|
+
getOwnerPropsArguments?: () => object;
|
|
7
|
+
}
|
|
8
|
+
declare const TruncatedTooltipText: ({ value, placement, getOwnerProps, getOwnerPropsArguments, }: TruncatedTooltipTextProps) => import("react/jsx-runtime.js").JSX.Element;
|
|
9
|
+
export { TruncatedTooltipText };
|
|
10
|
+
export default TruncatedTooltipText;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const DSChatContainerHeaderName = "DSChatcontainerheader";
|
|
2
|
+
export declare const CHAT_CONTAINER_HEADER_SLOTS: {
|
|
3
|
+
readonly ROOT: "root";
|
|
4
|
+
readonly HEADER_TITLE: "header-title";
|
|
5
|
+
readonly HEADER_CHILDREN: "header-children";
|
|
6
|
+
readonly TOOLTIP_TEXT: "tooltip-text";
|
|
7
|
+
readonly TOOLTIP_CONTAINER: "tooltip-container";
|
|
8
|
+
};
|
|
9
|
+
export declare const CHAT_CONTAINER_HEADER_DATA_TESTID: {
|
|
10
|
+
HEADER_TITLE: string;
|
|
11
|
+
HEADER_CHILDREN: string;
|
|
12
|
+
ROOT: "ds-chatcontainerheader-root";
|
|
13
|
+
TOOLTIP_TEXT: "ds-chatcontainerheader-tooltip-text";
|
|
14
|
+
TOOLTIP_CONTAINER: "ds-chatcontainerheader-tooltip-container";
|
|
15
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { ChatContainerHeader, ChatContainerHeaderWithSchema } from './ChatContainerHeader.js';
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
1
|
+
export { ChatContainerHeader, ChatContainerHeaderWithSchema, DSChatContainerHeader, DSChatContainerHeaderWithSchema, } from './ChatContainerHeader.js';
|
|
2
|
+
export { type DSChatContainerHeaderT, propTypes as ChatContainerHeaderPropTypes } from './react-desc-prop-types.js';
|
|
3
|
+
export { CHAT_CONTAINER_HEADER_DATA_TESTID as ChatContainerHeaderDataTestIds, // LEGACY EXPORT
|
|
4
|
+
CHAT_CONTAINER_HEADER_DATA_TESTID, CHAT_CONTAINER_HEADER_SLOTS, DSChatContainerHeaderName, } from './constants/index.js';
|