@elliemae/ds-chat-bubble 3.12.0-rc.1 → 3.12.0-rc.10
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/ChatBubble.js +29 -64
- package/dist/cjs/ChatBubble.js.map +2 -2
- package/dist/cjs/ChatBubbleArrow.js +34 -82
- package/dist/cjs/ChatBubbleArrow.js.map +1 -1
- package/dist/cjs/DSChatBubbleDefinitions.js +32 -0
- package/dist/cjs/DSChatBubbleDefinitions.js.map +7 -0
- package/dist/esm/ChatBubble.js +29 -64
- package/dist/esm/ChatBubble.js.map +2 -2
- package/dist/esm/ChatBubbleArrow.js +34 -82
- package/dist/esm/ChatBubbleArrow.js.map +1 -1
- package/dist/esm/DSChatBubbleDefinitions.js +6 -0
- package/dist/esm/DSChatBubbleDefinitions.js.map +7 -0
- package/package.json +5 -5
package/dist/cjs/ChatBubble.js
CHANGED
|
@@ -37,76 +37,41 @@ var import_styled = require("./styled");
|
|
|
37
37
|
var import_react_desc_prop_types = require("./react-desc-prop-types");
|
|
38
38
|
var import_ChatBubbleArrow = require("./ChatBubbleArrow");
|
|
39
39
|
var import_ChatBubbleDataTestIds = require("./ChatBubbleDataTestIds");
|
|
40
|
+
var import_DSChatBubbleDefinitions = require("./DSChatBubbleDefinitions");
|
|
40
41
|
const ChatBubble = (props) => {
|
|
41
42
|
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultBubbleProps);
|
|
42
|
-
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.BubblesPropTypes);
|
|
43
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.BubblesPropTypes, import_DSChatBubbleDefinitions.DSChatBubbleName);
|
|
43
44
|
const { dsId, type, title, time, body, errorMessage, helpMessage } = propsWithDefault;
|
|
44
45
|
const bodyParts = import_react.default.useMemo(() => typeof body === "string" ? body.split("\n") : [body], [body]);
|
|
45
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledWrapper, {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"data-testid": `chat-bubble-body-${dsId}`,
|
|
72
|
-
children: bodyParts.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.default.Fragment, {
|
|
73
|
-
children: [
|
|
74
|
-
item,
|
|
75
|
-
index < bodyParts.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}) : null
|
|
76
|
-
]
|
|
77
|
-
}, `${item}-${dsId}`))
|
|
78
|
-
}),
|
|
79
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ChatBubbleArrow.ChatBubbleArrow, {
|
|
80
|
-
type
|
|
81
|
-
})
|
|
82
|
-
]
|
|
83
|
-
}),
|
|
84
|
-
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyleErrorMessage, {
|
|
85
|
-
"data-testid": `chat-bubble-error-message-${dsId}`,
|
|
86
|
-
p: "xxs",
|
|
87
|
-
gutter: "xxs",
|
|
88
|
-
cols: [1, "auto"],
|
|
89
|
-
children: [
|
|
90
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
91
|
-
children: errorMessage
|
|
92
|
-
}),
|
|
93
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.WarningCircleFill, {})
|
|
94
|
-
]
|
|
95
|
-
}) : null,
|
|
96
|
-
helpMessage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleHelpMessage, {
|
|
97
|
-
"data-testid": `chat-bubble-help-message-${dsId}`,
|
|
98
|
-
p: "xxs",
|
|
99
|
-
gutter: "xxs",
|
|
100
|
-
cols: [1, "auto"],
|
|
101
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
102
|
-
children: helpMessage
|
|
103
|
-
})
|
|
104
|
-
}) : null
|
|
105
|
-
]
|
|
106
|
-
});
|
|
46
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledWrapper, { "data-testid": `${import_ChatBubbleDataTestIds.ChatBubbleDataTestIds.BUBBLE}-${dsId}`, children: [
|
|
47
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledColoredBubble, { type, children: [
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledTitleBubble, { cols: ["1fr", "auto"], gutter: "xs", alignItems: "flex-end", className: "sr-only", children: [
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledTitleLeftBubble, { alignItems: "center", "data-testid": `${import_ChatBubbleDataTestIds.ChatBubbleDataTestIds.BUBBLE_TITLE}-${dsId}`, children: title }),
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
import_styled.StyledTitleRightBubble,
|
|
52
|
+
{
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
type,
|
|
55
|
+
"data-testid": `${import_ChatBubbleDataTestIds.ChatBubbleDataTestIds.BUBBLE_TIME}-${dsId}`,
|
|
56
|
+
children: time
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleBodyWrapper, { "data-testid": `chat-bubble-body-${dsId}`, children: bodyParts.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.default.Fragment, { children: [
|
|
61
|
+
item,
|
|
62
|
+
index < bodyParts.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}) : null
|
|
63
|
+
] }, `${item}-${dsId}`)) }),
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ChatBubbleArrow.ChatBubbleArrow, { type })
|
|
65
|
+
] }),
|
|
66
|
+
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyleErrorMessage, { "data-testid": `chat-bubble-error-message-${dsId}`, p: "xxs", gutter: "xxs", cols: [1, "auto"], children: [
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: errorMessage }),
|
|
68
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.WarningCircleFill, {})
|
|
69
|
+
] }) : null,
|
|
70
|
+
helpMessage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleHelpMessage, { "data-testid": `chat-bubble-help-message-${dsId}`, p: "xxs", gutter: "xxs", cols: [1, "auto"], children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: helpMessage }) }) : null
|
|
71
|
+
] });
|
|
107
72
|
};
|
|
108
73
|
ChatBubble.propTypes = import_react_desc_prop_types.BubblesPropTypes;
|
|
109
|
-
ChatBubble.displayName =
|
|
74
|
+
ChatBubble.displayName = import_DSChatBubbleDefinitions.DSChatBubbleName;
|
|
110
75
|
const ChatBubbleWithSchema = (0, import_ds_utilities.describe)(ChatBubble);
|
|
111
76
|
ChatBubbleWithSchema.propTypes = import_react_desc_prop_types.BubblesPropTypes;
|
|
112
77
|
//# sourceMappingURL=ChatBubble.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ChatBubble.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { WarningCircleFill } from '@elliemae/ds-icons';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled';\nimport { BubblesPropTypes, type DSChatBubbleT, defaultBubbleProps } from './react-desc-prop-types';\nimport { ChatBubbleArrow } from './ChatBubbleArrow';\nimport { ChatBubbleDataTestIds } from './ChatBubbleDataTestIds';\nconst ChatBubble: React.ComponentType<DSChatBubbleT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultBubbleProps);\n useValidateTypescriptPropTypes(propsWithDefault, BubblesPropTypes);\n\n const { dsId, type, title, time, body, errorMessage, helpMessage } = propsWithDefault;\n const bodyParts = React.useMemo(() => (typeof body === 'string' ? body.split('\\n') : [body]), [body]);\n return (\n <StyledWrapper data-testid={`${ChatBubbleDataTestIds.BUBBLE}-${dsId}`}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble cols={['1fr', 'auto']} gutter=\"xs\" alignItems=\"flex-end\" className=\"sr-only\">\n <StyledTitleLeftBubble alignItems=\"center\" data-testid={`${ChatBubbleDataTestIds.BUBBLE_TITLE}-${dsId}`}>\n {title}\n </StyledTitleLeftBubble>\n <StyledTitleRightBubble\n alignItems=\"center\"\n type={type}\n data-testid={`${ChatBubbleDataTestIds.BUBBLE_TIME}-${dsId}`}\n >\n {time}\n </StyledTitleRightBubble>\n </StyledTitleBubble>\n <StyleBodyWrapper data-testid={`chat-bubble-body-${dsId}`}>\n {bodyParts.map((item, index) => (\n <React.Fragment key={`${item}-${dsId}`}>\n {item}\n {index < bodyParts.length - 1 ? <br /> : null}\n </React.Fragment>\n ))}\n </StyleBodyWrapper>\n <ChatBubbleArrow type={type} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage data-testid={`chat-bubble-error-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{errorMessage}</span>\n <WarningCircleFill />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage data-testid={`chat-bubble-help-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\n\nChatBubble.propTypes = BubblesPropTypes;\nChatBubble.displayName =
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { WarningCircleFill } from '@elliemae/ds-icons';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled';\nimport { BubblesPropTypes, type DSChatBubbleT, defaultBubbleProps } from './react-desc-prop-types';\nimport { ChatBubbleArrow } from './ChatBubbleArrow';\nimport { ChatBubbleDataTestIds } from './ChatBubbleDataTestIds';\nimport { DSChatBubbleName } from './DSChatBubbleDefinitions';\n\nconst ChatBubble: React.ComponentType<DSChatBubbleT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultBubbleProps);\n useValidateTypescriptPropTypes(propsWithDefault, BubblesPropTypes, DSChatBubbleName);\n\n const { dsId, type, title, time, body, errorMessage, helpMessage } = propsWithDefault;\n const bodyParts = React.useMemo(() => (typeof body === 'string' ? body.split('\\n') : [body]), [body]);\n return (\n <StyledWrapper data-testid={`${ChatBubbleDataTestIds.BUBBLE}-${dsId}`}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble cols={['1fr', 'auto']} gutter=\"xs\" alignItems=\"flex-end\" className=\"sr-only\">\n <StyledTitleLeftBubble alignItems=\"center\" data-testid={`${ChatBubbleDataTestIds.BUBBLE_TITLE}-${dsId}`}>\n {title}\n </StyledTitleLeftBubble>\n <StyledTitleRightBubble\n alignItems=\"center\"\n type={type}\n data-testid={`${ChatBubbleDataTestIds.BUBBLE_TIME}-${dsId}`}\n >\n {time}\n </StyledTitleRightBubble>\n </StyledTitleBubble>\n <StyleBodyWrapper data-testid={`chat-bubble-body-${dsId}`}>\n {bodyParts.map((item, index) => (\n <React.Fragment key={`${item}-${dsId}`}>\n {item}\n {index < bodyParts.length - 1 ? <br /> : null}\n </React.Fragment>\n ))}\n </StyleBodyWrapper>\n <ChatBubbleArrow type={type} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage data-testid={`chat-bubble-error-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{errorMessage}</span>\n <WarningCircleFill />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage data-testid={`chat-bubble-help-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\n\nChatBubble.propTypes = BubblesPropTypes;\nChatBubble.displayName = DSChatBubbleName;\nconst ChatBubbleWithSchema = describe(ChatBubble);\nChatBubbleWithSchema.propTypes = BubblesPropTypes;\n\nexport { ChatBubble, ChatBubbleWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2Bf;AA3BR,mBAAkB;AAClB,0BAAuF;AACvF,sBAAkC;AAClC,oBASO;AACP,mCAAyE;AACzE,6BAAgC;AAChC,mCAAsC;AACtC,qCAAiC;AAEjC,MAAM,aAAuD,CAAC,UAAU;AACtE,QAAM,uBAAmB,kDAA6B,OAAO,+CAAkB;AAC/E,0DAA+B,kBAAkB,+CAAkB,+CAAgB;AAEnF,QAAM,EAAE,MAAM,MAAM,OAAO,MAAM,MAAM,cAAc,YAAY,IAAI;AACrE,QAAM,YAAY,aAAAA,QAAM,QAAQ,MAAO,OAAO,SAAS,WAAW,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,GAAI,CAAC,IAAI,CAAC;AACpG,SACE,6CAAC,+BAAc,eAAa,GAAG,mDAAsB,UAAU,QAC7D;AAAA,iDAAC,qCAAoB,MACnB;AAAA,mDAAC,mCAAkB,MAAM,CAAC,OAAO,MAAM,GAAG,QAAO,MAAK,YAAW,YAAW,WAAU,WACpF;AAAA,oDAAC,uCAAsB,YAAW,UAAS,eAAa,GAAG,mDAAsB,gBAAgB,QAC9F,iBACH;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,YAAW;AAAA,YACX;AAAA,YACA,eAAa,GAAG,mDAAsB,eAAe;AAAA,YAEpD;AAAA;AAAA,QACH;AAAA,SACF;AAAA,MACA,4CAAC,kCAAiB,eAAa,oBAAoB,QAChD,oBAAU,IAAI,CAAC,MAAM,UACpB,6CAAC,aAAAA,QAAM,UAAN,EACE;AAAA;AAAA,QACA,QAAQ,UAAU,SAAS,IAAI,4CAAC,QAAG,IAAK;AAAA,WAFtB,GAAG,QAAQ,MAGhC,CACD,GACH;AAAA,MACA,4CAAC,0CAAgB,MAAY;AAAA,OAC/B;AAAA,IACC,eACC,6CAAC,mCAAkB,eAAa,6BAA6B,QAAQ,GAAE,OAAM,QAAO,OAAM,MAAM,CAAC,GAAG,MAAM,GACxG;AAAA,kDAAC,UAAM,wBAAa;AAAA,MACpB,4CAAC,qCAAkB;AAAA,OACrB,IACE;AAAA,IACH,cACC,4CAAC,kCAAiB,eAAa,4BAA4B,QAAQ,GAAE,OAAM,QAAO,OAAM,MAAM,CAAC,GAAG,MAAM,GACtG,sDAAC,UAAM,uBAAY,GACrB,IACE;AAAA,KACN;AAEJ;AAEA,WAAW,YAAY;AACvB,WAAW,cAAc;AACzB,MAAM,2BAAuB,8BAAS,UAAU;AAChD,qBAAqB,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -32,88 +32,40 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
32
32
|
var import_styled = require("./styled");
|
|
33
33
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
34
34
|
var import_react_desc_prop_types = require("./react-desc-prop-types");
|
|
35
|
-
const ChatBubbleArrow = ({ type }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledBubbleArrow, {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
in: "shadowBlurOuter1"
|
|
70
|
-
})
|
|
71
|
-
]
|
|
72
|
-
})
|
|
73
|
-
]
|
|
74
|
-
}),
|
|
75
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", {
|
|
76
|
-
id: "[DSK]-Visual-Design",
|
|
77
|
-
stroke: "none",
|
|
78
|
-
strokeWidth: "1",
|
|
79
|
-
fill: "none",
|
|
80
|
-
fillRule: "evenodd",
|
|
81
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", {
|
|
82
|
-
id: "Path-Copy",
|
|
83
|
-
transform: "translate(7.500000, 6.000000) scale(-1, 1) translate(-7.500000, -6.000000) ",
|
|
84
|
-
children: [
|
|
85
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("use", {
|
|
86
|
-
fill: "black",
|
|
87
|
-
fillOpacity: "1",
|
|
88
|
-
filter: "url(#filter-2)",
|
|
89
|
-
xlinkHref: "#path-chat-bubble"
|
|
90
|
-
}),
|
|
91
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("use", {
|
|
92
|
-
fill: "#FFFFFF",
|
|
93
|
-
fillRule: "evenodd",
|
|
94
|
-
xlinkHref: "#path-chat-bubble"
|
|
95
|
-
})
|
|
96
|
-
]
|
|
97
|
-
})
|
|
98
|
-
})
|
|
99
|
-
]
|
|
100
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
|
|
101
|
-
width: "9px",
|
|
102
|
-
height: "8px",
|
|
103
|
-
viewBox: "0 0 9 8",
|
|
104
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", {
|
|
105
|
-
stroke: "none",
|
|
106
|
-
strokeWidth: "1",
|
|
107
|
-
fill: "none",
|
|
108
|
-
fillRule: "evenodd",
|
|
109
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
|
110
|
-
d: "M9,6.5 C9,5.9373169 8.6782751,5.4856453 8.2282104,5.196228 C8.2286673,5.1967363 0,0 0,0 L0,8 L7.5627441,8 L7.5658569,7.9933472 C8.3630371,7.9580688 9,7.3058472 9,6.5 Z",
|
|
111
|
-
id: "Path",
|
|
112
|
-
fill: "#1E79C2"
|
|
113
|
-
})
|
|
114
|
-
})
|
|
115
|
-
})
|
|
116
|
-
});
|
|
35
|
+
const ChatBubbleArrow = ({ type }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledBubbleArrow, { children: type === import_react_desc_prop_types.BUBBLE_TYPES.RECIPIENT ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "15px", height: "14px", viewBox: "0 0 15 14", children: [
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("defs", { children: [
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
38
|
+
"path",
|
|
39
|
+
{
|
|
40
|
+
d: "M12,8.5 C12,7.9373169 11.6782751,7.4856453 11.2282104,7.196228 C11.2286673,7.1967363 3,2 3,2 L3,10 L10.5627441,10 L10.5658569,9.9933472 C11.3630371,9.9580688 12,9.3058472 12,8.5 Z",
|
|
41
|
+
id: "path-chat-bubble"
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("filter", { x: "-55.6%", y: "-50.0%", width: "211.1%", height: "225.0%", filterUnits: "objectBoundingBox", id: "filter-2", children: [
|
|
45
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feOffset", { dx: "2.3", dy: "1.2", in: "SourceAlpha", result: "shadowOffsetOuter1" }),
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feGaussianBlur", { stdDeviation: "1.5", in: "shadowOffsetOuter1", result: "shadowBlurOuter1" }),
|
|
47
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
|
+
"feColorMatrix",
|
|
49
|
+
{
|
|
50
|
+
values: "0 0 0 0 0.207843137 \n 0 0 0 0 0.235294118 \n 0 0 0 0 0.274509804 \n 0 0 0 0.8 0",
|
|
51
|
+
type: "matrix",
|
|
52
|
+
in: "shadowBlurOuter1"
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
] })
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { id: "[DSK]-Visual-Design", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { id: "Path-Copy", transform: "translate(7.500000, 6.000000) scale(-1, 1) translate(-7.500000, -6.000000) ", children: [
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("use", { fill: "black", fillOpacity: "1", filter: "url(#filter-2)", xlinkHref: "#path-chat-bubble" }),
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("use", { fill: "#FFFFFF", fillRule: "evenodd", xlinkHref: "#path-chat-bubble" })
|
|
60
|
+
] }) })
|
|
61
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { width: "9px", height: "8px", viewBox: "0 0 9 8", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
62
|
+
"path",
|
|
63
|
+
{
|
|
64
|
+
d: "M9,6.5 C9,5.9373169 8.6782751,5.4856453 8.2282104,5.196228 C8.2286673,5.1967363 0,0 0,0 L0,8 L7.5627441,8 L7.5658569,7.9933472 C8.3630371,7.9580688 9,7.3058472 9,6.5 Z",
|
|
65
|
+
id: "Path",
|
|
66
|
+
fill: "#1E79C2"
|
|
67
|
+
}
|
|
68
|
+
) }) }) });
|
|
117
69
|
ChatBubbleArrow.propTypes = import_react_desc_prop_types.propsArrowBubble;
|
|
118
70
|
const ChatBubbleArrowWithSchema = (0, import_ds_utilities.describe)(ChatBubbleArrow);
|
|
119
71
|
ChatBubbleArrowWithSchema.propTypes = import_react_desc_prop_types.propsArrowBubble;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ChatBubbleArrow.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { StyledBubbleArrow } from './styled';\nimport { describe } from '@elliemae/ds-utilities';\nimport { BUBBLE_TYPES, type DSChatBubbleT, propsArrowBubble } from './react-desc-prop-types';\n\nexport const ChatBubbleArrow: React.ComponentType<Pick<DSChatBubbleT.Props, 'type'>> = ({ type }) => (\n <StyledBubbleArrow>\n {type === BUBBLE_TYPES.RECIPIENT ? (\n <svg width=\"15px\" height=\"14px\" viewBox=\"0 0 15 14\">\n <defs>\n <path\n d=\"M12,8.5 C12,7.9373169 11.6782751,7.4856453 11.2282104,7.196228 C11.2286673,7.1967363 3,2 3,2 L3,10 L10.5627441,10 L10.5658569,9.9933472 C11.3630371,9.9580688 12,9.3058472 12,8.5 Z\"\n id=\"path-chat-bubble\"\n ></path>\n <filter x=\"-55.6%\" y=\"-50.0%\" width=\"211.1%\" height=\"225.0%\" filterUnits=\"objectBoundingBox\" id=\"filter-2\">\n <feOffset dx=\"2.3\" dy=\"1.2\" in=\"SourceAlpha\" result=\"shadowOffsetOuter1\"></feOffset>\n <feGaussianBlur stdDeviation=\"1.5\" in=\"shadowOffsetOuter1\" result=\"shadowBlurOuter1\"></feGaussianBlur>\n <feColorMatrix\n values=\"0 0 0 0 0.207843137 \n 0 0 0 0 0.235294118 \n 0 0 0 0 0.274509804 \n 0 0 0 0.8 0\"\n type=\"matrix\"\n in=\"shadowBlurOuter1\"\n ></feColorMatrix>\n </filter>\n </defs>\n <g id=\"[DSK]-Visual-Design\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"Path-Copy\" transform=\"translate(7.500000, 6.000000) scale(-1, 1) translate(-7.500000, -6.000000) \">\n <use fill=\"black\" fillOpacity=\"1\" filter=\"url(#filter-2)\" xlinkHref=\"#path-chat-bubble\"></use>\n <use fill=\"#FFFFFF\" fillRule=\"evenodd\" xlinkHref=\"#path-chat-bubble\"></use>\n </g>\n </g>\n </svg>\n ) : (\n <svg width=\"9px\" height=\"8px\" viewBox=\"0 0 9 8\">\n <g stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <path\n d=\"M9,6.5 C9,5.9373169 8.6782751,5.4856453 8.2282104,5.196228 C8.2286673,5.1967363 0,0 0,0 L0,8 L7.5627441,8 L7.5658569,7.9933472 C8.3630371,7.9580688 9,7.3058472 9,6.5 Z\"\n id=\"Path\"\n fill=\"#1E79C2\"\n ></path>\n </g>\n </svg>\n )}\n </StyledBubbleArrow>\n);\n\nChatBubbleArrow.propTypes = propsArrowBubble;\nconst ChatBubbleArrowWithSchema = describe(ChatBubbleArrow);\nChatBubbleArrowWithSchema.propTypes = propsArrowBubble;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADUb;AATV,oBAAkC;AAClC,0BAAyB;AACzB,mCAAmE;AAE5D,MAAM,kBAA0E,CAAC,EAAE,KAAK,MAC7F,4CAAC
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADUb;AATV,oBAAkC;AAClC,0BAAyB;AACzB,mCAAmE;AAE5D,MAAM,kBAA0E,CAAC,EAAE,KAAK,MAC7F,4CAAC,mCACE,mBAAS,0CAAa,YACrB,6CAAC,SAAI,OAAM,QAAO,QAAO,QAAO,SAAQ,aACtC;AAAA,+CAAC,UACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,GAAE;AAAA,QACF,IAAG;AAAA;AAAA,IACJ;AAAA,IACD,6CAAC,YAAO,GAAE,UAAS,GAAE,UAAS,OAAM,UAAS,QAAO,UAAS,aAAY,qBAAoB,IAAG,YAC9F;AAAA,kDAAC,cAAS,IAAG,OAAM,IAAG,OAAM,IAAG,eAAc,QAAO,sBAAqB;AAAA,MACzE,4CAAC,oBAAe,cAAa,OAAM,IAAG,sBAAqB,QAAO,oBAAmB;AAAA,MACrF;AAAA,QAAC;AAAA;AAAA,UACC,QAAO;AAAA,UAIP,MAAK;AAAA,UACL,IAAG;AAAA;AAAA,MACJ;AAAA,OACH;AAAA,KACF;AAAA,EACA,4CAAC,OAAE,IAAG,uBAAsB,QAAO,QAAO,aAAY,KAAI,MAAK,QAAO,UAAS,WAC7E,uDAAC,OAAE,IAAG,aAAY,WAAU,+EAC1B;AAAA,gDAAC,SAAI,MAAK,SAAQ,aAAY,KAAI,QAAO,kBAAiB,WAAU,qBAAoB;AAAA,IACxF,4CAAC,SAAI,MAAK,WAAU,UAAS,WAAU,WAAU,qBAAoB;AAAA,KACvE,GACF;AAAA,GACF,IAEA,4CAAC,SAAI,OAAM,OAAM,QAAO,OAAM,SAAQ,WACpC,sDAAC,OAAE,QAAO,QAAO,aAAY,KAAI,MAAK,QAAO,UAAS,WACpD;AAAA,EAAC;AAAA;AAAA,IACC,GAAE;AAAA,IACF,IAAG;AAAA,IACH,MAAK;AAAA;AACN,GACH,GACF,GAEJ;AAGF,gBAAgB,YAAY;AAC5B,MAAM,gCAA4B,8BAAS,eAAe;AAC1D,0BAA0B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var DSChatBubbleDefinitions_exports = {};
|
|
26
|
+
__export(DSChatBubbleDefinitions_exports, {
|
|
27
|
+
DSChatBubbleName: () => DSChatBubbleName
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(DSChatBubbleDefinitions_exports);
|
|
30
|
+
var React = __toESM(require("react"));
|
|
31
|
+
const DSChatBubbleName = "DSBubble";
|
|
32
|
+
//# sourceMappingURL=DSChatBubbleDefinitions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSChatBubbleDefinitions.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export const DSChatBubbleName = 'DSBubble';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,mBAAmB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/ChatBubble.js
CHANGED
|
@@ -16,76 +16,41 @@ import {
|
|
|
16
16
|
import { BubblesPropTypes, defaultBubbleProps } from "./react-desc-prop-types";
|
|
17
17
|
import { ChatBubbleArrow } from "./ChatBubbleArrow";
|
|
18
18
|
import { ChatBubbleDataTestIds } from "./ChatBubbleDataTestIds";
|
|
19
|
+
import { DSChatBubbleName } from "./DSChatBubbleDefinitions";
|
|
19
20
|
const ChatBubble = (props) => {
|
|
20
21
|
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultBubbleProps);
|
|
21
|
-
useValidateTypescriptPropTypes(propsWithDefault, BubblesPropTypes);
|
|
22
|
+
useValidateTypescriptPropTypes(propsWithDefault, BubblesPropTypes, DSChatBubbleName);
|
|
22
23
|
const { dsId, type, title, time, body, errorMessage, helpMessage } = propsWithDefault;
|
|
23
24
|
const bodyParts = React2.useMemo(() => typeof body === "string" ? body.split("\n") : [body], [body]);
|
|
24
|
-
return /* @__PURE__ */ jsxs(StyledWrapper, {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"data-testid": `chat-bubble-body-${dsId}`,
|
|
51
|
-
children: bodyParts.map((item, index) => /* @__PURE__ */ jsxs(React2.Fragment, {
|
|
52
|
-
children: [
|
|
53
|
-
item,
|
|
54
|
-
index < bodyParts.length - 1 ? /* @__PURE__ */ jsx("br", {}) : null
|
|
55
|
-
]
|
|
56
|
-
}, `${item}-${dsId}`))
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ jsx(ChatBubbleArrow, {
|
|
59
|
-
type
|
|
60
|
-
})
|
|
61
|
-
]
|
|
62
|
-
}),
|
|
63
|
-
errorMessage ? /* @__PURE__ */ jsxs(StyleErrorMessage, {
|
|
64
|
-
"data-testid": `chat-bubble-error-message-${dsId}`,
|
|
65
|
-
p: "xxs",
|
|
66
|
-
gutter: "xxs",
|
|
67
|
-
cols: [1, "auto"],
|
|
68
|
-
children: [
|
|
69
|
-
/* @__PURE__ */ jsx("span", {
|
|
70
|
-
children: errorMessage
|
|
71
|
-
}),
|
|
72
|
-
/* @__PURE__ */ jsx(WarningCircleFill, {})
|
|
73
|
-
]
|
|
74
|
-
}) : null,
|
|
75
|
-
helpMessage ? /* @__PURE__ */ jsx(StyleHelpMessage, {
|
|
76
|
-
"data-testid": `chat-bubble-help-message-${dsId}`,
|
|
77
|
-
p: "xxs",
|
|
78
|
-
gutter: "xxs",
|
|
79
|
-
cols: [1, "auto"],
|
|
80
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
81
|
-
children: helpMessage
|
|
82
|
-
})
|
|
83
|
-
}) : null
|
|
84
|
-
]
|
|
85
|
-
});
|
|
25
|
+
return /* @__PURE__ */ jsxs(StyledWrapper, { "data-testid": `${ChatBubbleDataTestIds.BUBBLE}-${dsId}`, children: [
|
|
26
|
+
/* @__PURE__ */ jsxs(StyledColoredBubble, { type, children: [
|
|
27
|
+
/* @__PURE__ */ jsxs(StyledTitleBubble, { cols: ["1fr", "auto"], gutter: "xs", alignItems: "flex-end", className: "sr-only", children: [
|
|
28
|
+
/* @__PURE__ */ jsx(StyledTitleLeftBubble, { alignItems: "center", "data-testid": `${ChatBubbleDataTestIds.BUBBLE_TITLE}-${dsId}`, children: title }),
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
StyledTitleRightBubble,
|
|
31
|
+
{
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
type,
|
|
34
|
+
"data-testid": `${ChatBubbleDataTestIds.BUBBLE_TIME}-${dsId}`,
|
|
35
|
+
children: time
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ jsx(StyleBodyWrapper, { "data-testid": `chat-bubble-body-${dsId}`, children: bodyParts.map((item, index) => /* @__PURE__ */ jsxs(React2.Fragment, { children: [
|
|
40
|
+
item,
|
|
41
|
+
index < bodyParts.length - 1 ? /* @__PURE__ */ jsx("br", {}) : null
|
|
42
|
+
] }, `${item}-${dsId}`)) }),
|
|
43
|
+
/* @__PURE__ */ jsx(ChatBubbleArrow, { type })
|
|
44
|
+
] }),
|
|
45
|
+
errorMessage ? /* @__PURE__ */ jsxs(StyleErrorMessage, { "data-testid": `chat-bubble-error-message-${dsId}`, p: "xxs", gutter: "xxs", cols: [1, "auto"], children: [
|
|
46
|
+
/* @__PURE__ */ jsx("span", { children: errorMessage }),
|
|
47
|
+
/* @__PURE__ */ jsx(WarningCircleFill, {})
|
|
48
|
+
] }) : null,
|
|
49
|
+
helpMessage ? /* @__PURE__ */ jsx(StyleHelpMessage, { "data-testid": `chat-bubble-help-message-${dsId}`, p: "xxs", gutter: "xxs", cols: [1, "auto"], children: /* @__PURE__ */ jsx("span", { children: helpMessage }) }) : null
|
|
50
|
+
] });
|
|
86
51
|
};
|
|
87
52
|
ChatBubble.propTypes = BubblesPropTypes;
|
|
88
|
-
ChatBubble.displayName =
|
|
53
|
+
ChatBubble.displayName = DSChatBubbleName;
|
|
89
54
|
const ChatBubbleWithSchema = describe(ChatBubble);
|
|
90
55
|
ChatBubbleWithSchema.propTypes = BubblesPropTypes;
|
|
91
56
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/ChatBubble.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { WarningCircleFill } from '@elliemae/ds-icons';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled';\nimport { BubblesPropTypes, type DSChatBubbleT, defaultBubbleProps } from './react-desc-prop-types';\nimport { ChatBubbleArrow } from './ChatBubbleArrow';\nimport { ChatBubbleDataTestIds } from './ChatBubbleDataTestIds';\nconst ChatBubble: React.ComponentType<DSChatBubbleT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultBubbleProps);\n useValidateTypescriptPropTypes(propsWithDefault, BubblesPropTypes);\n\n const { dsId, type, title, time, body, errorMessage, helpMessage } = propsWithDefault;\n const bodyParts = React.useMemo(() => (typeof body === 'string' ? body.split('\\n') : [body]), [body]);\n return (\n <StyledWrapper data-testid={`${ChatBubbleDataTestIds.BUBBLE}-${dsId}`}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble cols={['1fr', 'auto']} gutter=\"xs\" alignItems=\"flex-end\" className=\"sr-only\">\n <StyledTitleLeftBubble alignItems=\"center\" data-testid={`${ChatBubbleDataTestIds.BUBBLE_TITLE}-${dsId}`}>\n {title}\n </StyledTitleLeftBubble>\n <StyledTitleRightBubble\n alignItems=\"center\"\n type={type}\n data-testid={`${ChatBubbleDataTestIds.BUBBLE_TIME}-${dsId}`}\n >\n {time}\n </StyledTitleRightBubble>\n </StyledTitleBubble>\n <StyleBodyWrapper data-testid={`chat-bubble-body-${dsId}`}>\n {bodyParts.map((item, index) => (\n <React.Fragment key={`${item}-${dsId}`}>\n {item}\n {index < bodyParts.length - 1 ? <br /> : null}\n </React.Fragment>\n ))}\n </StyleBodyWrapper>\n <ChatBubbleArrow type={type} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage data-testid={`chat-bubble-error-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{errorMessage}</span>\n <WarningCircleFill />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage data-testid={`chat-bubble-help-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\n\nChatBubble.propTypes = BubblesPropTypes;\nChatBubble.displayName =
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { WarningCircleFill } from '@elliemae/ds-icons';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled';\nimport { BubblesPropTypes, type DSChatBubbleT, defaultBubbleProps } from './react-desc-prop-types';\nimport { ChatBubbleArrow } from './ChatBubbleArrow';\nimport { ChatBubbleDataTestIds } from './ChatBubbleDataTestIds';\nimport { DSChatBubbleName } from './DSChatBubbleDefinitions';\n\nconst ChatBubble: React.ComponentType<DSChatBubbleT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultBubbleProps);\n useValidateTypescriptPropTypes(propsWithDefault, BubblesPropTypes, DSChatBubbleName);\n\n const { dsId, type, title, time, body, errorMessage, helpMessage } = propsWithDefault;\n const bodyParts = React.useMemo(() => (typeof body === 'string' ? body.split('\\n') : [body]), [body]);\n return (\n <StyledWrapper data-testid={`${ChatBubbleDataTestIds.BUBBLE}-${dsId}`}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble cols={['1fr', 'auto']} gutter=\"xs\" alignItems=\"flex-end\" className=\"sr-only\">\n <StyledTitleLeftBubble alignItems=\"center\" data-testid={`${ChatBubbleDataTestIds.BUBBLE_TITLE}-${dsId}`}>\n {title}\n </StyledTitleLeftBubble>\n <StyledTitleRightBubble\n alignItems=\"center\"\n type={type}\n data-testid={`${ChatBubbleDataTestIds.BUBBLE_TIME}-${dsId}`}\n >\n {time}\n </StyledTitleRightBubble>\n </StyledTitleBubble>\n <StyleBodyWrapper data-testid={`chat-bubble-body-${dsId}`}>\n {bodyParts.map((item, index) => (\n <React.Fragment key={`${item}-${dsId}`}>\n {item}\n {index < bodyParts.length - 1 ? <br /> : null}\n </React.Fragment>\n ))}\n </StyleBodyWrapper>\n <ChatBubbleArrow type={type} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage data-testid={`chat-bubble-error-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{errorMessage}</span>\n <WarningCircleFill />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage data-testid={`chat-bubble-help-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\n\nChatBubble.propTypes = BubblesPropTypes;\nChatBubble.displayName = DSChatBubbleName;\nconst ChatBubbleWithSchema = describe(ChatBubble);\nChatBubbleWithSchema.propTypes = BubblesPropTypes;\n\nexport { ChatBubble, ChatBubbleWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC2Bf,SACE,KADF;AA3BR,OAAOA,YAAW;AAClB,SAAS,UAAU,gCAAgC,oCAAoC;AACvF,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAsC,0BAA0B;AACzE,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AAEjC,MAAM,aAAuD,CAAC,UAAU;AACtE,QAAM,mBAAmB,6BAA6B,OAAO,kBAAkB;AAC/E,iCAA+B,kBAAkB,kBAAkB,gBAAgB;AAEnF,QAAM,EAAE,MAAM,MAAM,OAAO,MAAM,MAAM,cAAc,YAAY,IAAI;AACrE,QAAM,YAAYA,OAAM,QAAQ,MAAO,OAAO,SAAS,WAAW,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,GAAI,CAAC,IAAI,CAAC;AACpG,SACE,qBAAC,iBAAc,eAAa,GAAG,sBAAsB,UAAU,QAC7D;AAAA,yBAAC,uBAAoB,MACnB;AAAA,2BAAC,qBAAkB,MAAM,CAAC,OAAO,MAAM,GAAG,QAAO,MAAK,YAAW,YAAW,WAAU,WACpF;AAAA,4BAAC,yBAAsB,YAAW,UAAS,eAAa,GAAG,sBAAsB,gBAAgB,QAC9F,iBACH;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,YAAW;AAAA,YACX;AAAA,YACA,eAAa,GAAG,sBAAsB,eAAe;AAAA,YAEpD;AAAA;AAAA,QACH;AAAA,SACF;AAAA,MACA,oBAAC,oBAAiB,eAAa,oBAAoB,QAChD,oBAAU,IAAI,CAAC,MAAM,UACpB,qBAACA,OAAM,UAAN,EACE;AAAA;AAAA,QACA,QAAQ,UAAU,SAAS,IAAI,oBAAC,QAAG,IAAK;AAAA,WAFtB,GAAG,QAAQ,MAGhC,CACD,GACH;AAAA,MACA,oBAAC,mBAAgB,MAAY;AAAA,OAC/B;AAAA,IACC,eACC,qBAAC,qBAAkB,eAAa,6BAA6B,QAAQ,GAAE,OAAM,QAAO,OAAM,MAAM,CAAC,GAAG,MAAM,GACxG;AAAA,0BAAC,UAAM,wBAAa;AAAA,MACpB,oBAAC,qBAAkB;AAAA,OACrB,IACE;AAAA,IACH,cACC,oBAAC,oBAAiB,eAAa,4BAA4B,QAAQ,GAAE,OAAM,QAAO,OAAM,MAAM,CAAC,GAAG,MAAM,GACtG,8BAAC,UAAM,uBAAY,GACrB,IACE;AAAA,KACN;AAEJ;AAEA,WAAW,YAAY;AACvB,WAAW,cAAc;AACzB,MAAM,uBAAuB,SAAS,UAAU;AAChD,qBAAqB,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -3,88 +3,40 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { StyledBubbleArrow } from "./styled";
|
|
4
4
|
import { describe } from "@elliemae/ds-utilities";
|
|
5
5
|
import { BUBBLE_TYPES, propsArrowBubble } from "./react-desc-prop-types";
|
|
6
|
-
const ChatBubbleArrow = ({ type }) => /* @__PURE__ */ jsx(StyledBubbleArrow, {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
in: "shadowBlurOuter1"
|
|
41
|
-
})
|
|
42
|
-
]
|
|
43
|
-
})
|
|
44
|
-
]
|
|
45
|
-
}),
|
|
46
|
-
/* @__PURE__ */ jsx("g", {
|
|
47
|
-
id: "[DSK]-Visual-Design",
|
|
48
|
-
stroke: "none",
|
|
49
|
-
strokeWidth: "1",
|
|
50
|
-
fill: "none",
|
|
51
|
-
fillRule: "evenodd",
|
|
52
|
-
children: /* @__PURE__ */ jsxs("g", {
|
|
53
|
-
id: "Path-Copy",
|
|
54
|
-
transform: "translate(7.500000, 6.000000) scale(-1, 1) translate(-7.500000, -6.000000) ",
|
|
55
|
-
children: [
|
|
56
|
-
/* @__PURE__ */ jsx("use", {
|
|
57
|
-
fill: "black",
|
|
58
|
-
fillOpacity: "1",
|
|
59
|
-
filter: "url(#filter-2)",
|
|
60
|
-
xlinkHref: "#path-chat-bubble"
|
|
61
|
-
}),
|
|
62
|
-
/* @__PURE__ */ jsx("use", {
|
|
63
|
-
fill: "#FFFFFF",
|
|
64
|
-
fillRule: "evenodd",
|
|
65
|
-
xlinkHref: "#path-chat-bubble"
|
|
66
|
-
})
|
|
67
|
-
]
|
|
68
|
-
})
|
|
69
|
-
})
|
|
70
|
-
]
|
|
71
|
-
}) : /* @__PURE__ */ jsx("svg", {
|
|
72
|
-
width: "9px",
|
|
73
|
-
height: "8px",
|
|
74
|
-
viewBox: "0 0 9 8",
|
|
75
|
-
children: /* @__PURE__ */ jsx("g", {
|
|
76
|
-
stroke: "none",
|
|
77
|
-
strokeWidth: "1",
|
|
78
|
-
fill: "none",
|
|
79
|
-
fillRule: "evenodd",
|
|
80
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
81
|
-
d: "M9,6.5 C9,5.9373169 8.6782751,5.4856453 8.2282104,5.196228 C8.2286673,5.1967363 0,0 0,0 L0,8 L7.5627441,8 L7.5658569,7.9933472 C8.3630371,7.9580688 9,7.3058472 9,6.5 Z",
|
|
82
|
-
id: "Path",
|
|
83
|
-
fill: "#1E79C2"
|
|
84
|
-
})
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
});
|
|
6
|
+
const ChatBubbleArrow = ({ type }) => /* @__PURE__ */ jsx(StyledBubbleArrow, { children: type === BUBBLE_TYPES.RECIPIENT ? /* @__PURE__ */ jsxs("svg", { width: "15px", height: "14px", viewBox: "0 0 15 14", children: [
|
|
7
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
8
|
+
/* @__PURE__ */ jsx(
|
|
9
|
+
"path",
|
|
10
|
+
{
|
|
11
|
+
d: "M12,8.5 C12,7.9373169 11.6782751,7.4856453 11.2282104,7.196228 C11.2286673,7.1967363 3,2 3,2 L3,10 L10.5627441,10 L10.5658569,9.9933472 C11.3630371,9.9580688 12,9.3058472 12,8.5 Z",
|
|
12
|
+
id: "path-chat-bubble"
|
|
13
|
+
}
|
|
14
|
+
),
|
|
15
|
+
/* @__PURE__ */ jsxs("filter", { x: "-55.6%", y: "-50.0%", width: "211.1%", height: "225.0%", filterUnits: "objectBoundingBox", id: "filter-2", children: [
|
|
16
|
+
/* @__PURE__ */ jsx("feOffset", { dx: "2.3", dy: "1.2", in: "SourceAlpha", result: "shadowOffsetOuter1" }),
|
|
17
|
+
/* @__PURE__ */ jsx("feGaussianBlur", { stdDeviation: "1.5", in: "shadowOffsetOuter1", result: "shadowBlurOuter1" }),
|
|
18
|
+
/* @__PURE__ */ jsx(
|
|
19
|
+
"feColorMatrix",
|
|
20
|
+
{
|
|
21
|
+
values: "0 0 0 0 0.207843137 \n 0 0 0 0 0.235294118 \n 0 0 0 0 0.274509804 \n 0 0 0 0.8 0",
|
|
22
|
+
type: "matrix",
|
|
23
|
+
in: "shadowBlurOuter1"
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ jsx("g", { id: "[DSK]-Visual-Design", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ jsxs("g", { id: "Path-Copy", transform: "translate(7.500000, 6.000000) scale(-1, 1) translate(-7.500000, -6.000000) ", children: [
|
|
29
|
+
/* @__PURE__ */ jsx("use", { fill: "black", fillOpacity: "1", filter: "url(#filter-2)", xlinkHref: "#path-chat-bubble" }),
|
|
30
|
+
/* @__PURE__ */ jsx("use", { fill: "#FFFFFF", fillRule: "evenodd", xlinkHref: "#path-chat-bubble" })
|
|
31
|
+
] }) })
|
|
32
|
+
] }) : /* @__PURE__ */ jsx("svg", { width: "9px", height: "8px", viewBox: "0 0 9 8", children: /* @__PURE__ */ jsx("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ jsx(
|
|
33
|
+
"path",
|
|
34
|
+
{
|
|
35
|
+
d: "M9,6.5 C9,5.9373169 8.6782751,5.4856453 8.2282104,5.196228 C8.2286673,5.1967363 0,0 0,0 L0,8 L7.5627441,8 L7.5658569,7.9933472 C8.3630371,7.9580688 9,7.3058472 9,6.5 Z",
|
|
36
|
+
id: "Path",
|
|
37
|
+
fill: "#1E79C2"
|
|
38
|
+
}
|
|
39
|
+
) }) }) });
|
|
88
40
|
ChatBubbleArrow.propTypes = propsArrowBubble;
|
|
89
41
|
const ChatBubbleArrowWithSchema = describe(ChatBubbleArrow);
|
|
90
42
|
ChatBubbleArrowWithSchema.propTypes = propsArrowBubble;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/ChatBubbleArrow.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { StyledBubbleArrow } from './styled';\nimport { describe } from '@elliemae/ds-utilities';\nimport { BUBBLE_TYPES, type DSChatBubbleT, propsArrowBubble } from './react-desc-prop-types';\n\nexport const ChatBubbleArrow: React.ComponentType<Pick<DSChatBubbleT.Props, 'type'>> = ({ type }) => (\n <StyledBubbleArrow>\n {type === BUBBLE_TYPES.RECIPIENT ? (\n <svg width=\"15px\" height=\"14px\" viewBox=\"0 0 15 14\">\n <defs>\n <path\n d=\"M12,8.5 C12,7.9373169 11.6782751,7.4856453 11.2282104,7.196228 C11.2286673,7.1967363 3,2 3,2 L3,10 L10.5627441,10 L10.5658569,9.9933472 C11.3630371,9.9580688 12,9.3058472 12,8.5 Z\"\n id=\"path-chat-bubble\"\n ></path>\n <filter x=\"-55.6%\" y=\"-50.0%\" width=\"211.1%\" height=\"225.0%\" filterUnits=\"objectBoundingBox\" id=\"filter-2\">\n <feOffset dx=\"2.3\" dy=\"1.2\" in=\"SourceAlpha\" result=\"shadowOffsetOuter1\"></feOffset>\n <feGaussianBlur stdDeviation=\"1.5\" in=\"shadowOffsetOuter1\" result=\"shadowBlurOuter1\"></feGaussianBlur>\n <feColorMatrix\n values=\"0 0 0 0 0.207843137 \n 0 0 0 0 0.235294118 \n 0 0 0 0 0.274509804 \n 0 0 0 0.8 0\"\n type=\"matrix\"\n in=\"shadowBlurOuter1\"\n ></feColorMatrix>\n </filter>\n </defs>\n <g id=\"[DSK]-Visual-Design\" stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <g id=\"Path-Copy\" transform=\"translate(7.500000, 6.000000) scale(-1, 1) translate(-7.500000, -6.000000) \">\n <use fill=\"black\" fillOpacity=\"1\" filter=\"url(#filter-2)\" xlinkHref=\"#path-chat-bubble\"></use>\n <use fill=\"#FFFFFF\" fillRule=\"evenodd\" xlinkHref=\"#path-chat-bubble\"></use>\n </g>\n </g>\n </svg>\n ) : (\n <svg width=\"9px\" height=\"8px\" viewBox=\"0 0 9 8\">\n <g stroke=\"none\" strokeWidth=\"1\" fill=\"none\" fillRule=\"evenodd\">\n <path\n d=\"M9,6.5 C9,5.9373169 8.6782751,5.4856453 8.2282104,5.196228 C8.2286673,5.1967363 0,0 0,0 L0,8 L7.5627441,8 L7.5658569,7.9933472 C8.3630371,7.9580688 9,7.3058472 9,6.5 Z\"\n id=\"Path\"\n fill=\"#1E79C2\"\n ></path>\n </g>\n </svg>\n )}\n </StyledBubbleArrow>\n);\n\nChatBubbleArrow.propTypes = propsArrowBubble;\nconst ChatBubbleArrowWithSchema = describe(ChatBubbleArrow);\nChatBubbleArrowWithSchema.propTypes = propsArrowBubble;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACUb,cAIA,YAJA;AATV,SAAS,yBAAyB;AAClC,SAAS,gBAAgB;AACzB,SAAS,cAAkC,wBAAwB;AAE5D,MAAM,kBAA0E,CAAC,EAAE,KAAK,MAC7F,oBAAC
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACUb,cAIA,YAJA;AATV,SAAS,yBAAyB;AAClC,SAAS,gBAAgB;AACzB,SAAS,cAAkC,wBAAwB;AAE5D,MAAM,kBAA0E,CAAC,EAAE,KAAK,MAC7F,oBAAC,qBACE,mBAAS,aAAa,YACrB,qBAAC,SAAI,OAAM,QAAO,QAAO,QAAO,SAAQ,aACtC;AAAA,uBAAC,UACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,GAAE;AAAA,QACF,IAAG;AAAA;AAAA,IACJ;AAAA,IACD,qBAAC,YAAO,GAAE,UAAS,GAAE,UAAS,OAAM,UAAS,QAAO,UAAS,aAAY,qBAAoB,IAAG,YAC9F;AAAA,0BAAC,cAAS,IAAG,OAAM,IAAG,OAAM,IAAG,eAAc,QAAO,sBAAqB;AAAA,MACzE,oBAAC,oBAAe,cAAa,OAAM,IAAG,sBAAqB,QAAO,oBAAmB;AAAA,MACrF;AAAA,QAAC;AAAA;AAAA,UACC,QAAO;AAAA,UAIP,MAAK;AAAA,UACL,IAAG;AAAA;AAAA,MACJ;AAAA,OACH;AAAA,KACF;AAAA,EACA,oBAAC,OAAE,IAAG,uBAAsB,QAAO,QAAO,aAAY,KAAI,MAAK,QAAO,UAAS,WAC7E,+BAAC,OAAE,IAAG,aAAY,WAAU,+EAC1B;AAAA,wBAAC,SAAI,MAAK,SAAQ,aAAY,KAAI,QAAO,kBAAiB,WAAU,qBAAoB;AAAA,IACxF,oBAAC,SAAI,MAAK,WAAU,UAAS,WAAU,WAAU,qBAAoB;AAAA,KACvE,GACF;AAAA,GACF,IAEA,oBAAC,SAAI,OAAM,OAAM,QAAO,OAAM,SAAQ,WACpC,8BAAC,OAAE,QAAO,QAAO,aAAY,KAAI,MAAK,QAAO,UAAS,WACpD;AAAA,EAAC;AAAA;AAAA,IACC,GAAE;AAAA,IACF,IAAG;AAAA,IACH,MAAK;AAAA;AACN,GACH,GACF,GAEJ;AAGF,gBAAgB,YAAY;AAC5B,MAAM,4BAA4B,SAAS,eAAe;AAC1D,0BAA0B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSChatBubbleDefinitions.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSChatBubbleName = 'DSBubble';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,mBAAmB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-chat-bubble",
|
|
3
|
-
"version": "3.12.0-rc.
|
|
3
|
+
"version": "3.12.0-rc.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Chat",
|
|
6
6
|
"files": [
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"typeSafety": false
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@elliemae/ds-grid": "3.12.0-rc.
|
|
55
|
-
"@elliemae/ds-icons": "3.12.0-rc.
|
|
56
|
-
"@elliemae/ds-system": "3.12.0-rc.
|
|
57
|
-
"@elliemae/ds-utilities": "3.12.0-rc.
|
|
54
|
+
"@elliemae/ds-grid": "3.12.0-rc.10",
|
|
55
|
+
"@elliemae/ds-icons": "3.12.0-rc.10",
|
|
56
|
+
"@elliemae/ds-system": "3.12.0-rc.10",
|
|
57
|
+
"@elliemae/ds-utilities": "3.12.0-rc.10"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@testing-library/dom": "~8.19.0",
|