@elliemae/ds-chat-bubble 3.60.0-next.9 → 3.61.0-rc.2
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 +90 -32
- package/dist/cjs/ChatBubble.js.map +2 -2
- package/dist/cjs/ChatBubbleArrow.js +76 -55
- package/dist/cjs/ChatBubbleArrow.js.map +2 -2
- package/dist/cjs/{DSChatBubbleDefinitions.js → constants/index.js} +36 -4
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +7 -5
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +1 -4
- package/dist/cjs/react-desc-prop-types.js +14 -17
- package/dist/cjs/react-desc-prop-types.js.map +3 -3
- package/dist/cjs/styled.js +35 -37
- package/dist/cjs/styled.js.map +2 -2
- package/dist/esm/ChatBubble.js +88 -30
- package/dist/esm/ChatBubble.js.map +2 -2
- package/dist/esm/ChatBubbleArrow.js +76 -55
- package/dist/esm/ChatBubbleArrow.js.map +2 -2
- package/dist/esm/constants/index.js +38 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +12 -4
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/package.json +1 -4
- package/dist/esm/react-desc-prop-types.js +10 -8
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/styled.js +35 -37
- package/dist/esm/styled.js.map +2 -2
- package/dist/types/ChatBubbleArrow.d.ts +1 -1
- package/dist/types/constants/index.d.ts +30 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/react-desc-prop-types.d.ts +6 -10
- package/dist/types/styled.d.ts +2 -3
- package/package.json +24 -26
- package/dist/cjs/ChatBubbleDataTestIds.js +0 -41
- package/dist/cjs/ChatBubbleDataTestIds.js.map +0 -7
- package/dist/cjs/DSChatBubbleDefinitions.js.map +0 -7
- package/dist/esm/ChatBubbleDataTestIds.js +0 -11
- package/dist/esm/ChatBubbleDataTestIds.js.map +0 -7
- package/dist/esm/DSChatBubbleDefinitions.js +0 -6
- package/dist/esm/DSChatBubbleDefinitions.js.map +0 -7
- package/dist/types/ChatBubbleDataTestIds.d.ts +0 -6
- package/dist/types/DSChatBubbleDefinitions.d.ts +0 -1
package/dist/cjs/styled.js
CHANGED
|
@@ -31,7 +31,6 @@ __export(styled_exports, {
|
|
|
31
31
|
StyleBodyWrapper: () => StyleBodyWrapper,
|
|
32
32
|
StyleErrorMessage: () => StyleErrorMessage,
|
|
33
33
|
StyleHelpMessage: () => StyleHelpMessage,
|
|
34
|
-
StyledBubbleArrow: () => StyledBubbleArrow,
|
|
35
34
|
StyledColoredBubble: () => StyledColoredBubble,
|
|
36
35
|
StyledTitleBubble: () => StyledTitleBubble,
|
|
37
36
|
StyledTitleLeftBubble: () => StyledTitleLeftBubble,
|
|
@@ -42,41 +41,59 @@ module.exports = __toCommonJS(styled_exports);
|
|
|
42
41
|
var React = __toESM(require("react"));
|
|
43
42
|
var import_ds_system = require("@elliemae/ds-system");
|
|
44
43
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
45
|
-
var
|
|
44
|
+
var import_constants = require("./constants/index.js");
|
|
46
45
|
const wrapRules = import_ds_system.css`
|
|
47
46
|
overflow-wrap: break-word;
|
|
48
47
|
white-space: pre-wrap;
|
|
49
48
|
`;
|
|
50
|
-
const StyledWrapper = import_ds_system.styled
|
|
49
|
+
const StyledWrapper = (0, import_ds_system.styled)("div", {
|
|
50
|
+
name: import_constants.DSChatBubbleName,
|
|
51
|
+
slot: import_constants.CHAT_BUBBLE_SLOTS.WRAPPER
|
|
52
|
+
})`
|
|
51
53
|
min-width: 224px;
|
|
52
54
|
border-radius: 10px;
|
|
53
55
|
${wrapRules}
|
|
54
56
|
`;
|
|
55
|
-
const StyledTitleBubble = (0, import_ds_system.styled)(import_ds_grid.Grid
|
|
57
|
+
const StyledTitleBubble = (0, import_ds_system.styled)(import_ds_grid.Grid, {
|
|
58
|
+
name: import_constants.DSChatBubbleName,
|
|
59
|
+
slot: import_constants.CHAT_BUBBLE_SLOTS.HEADER
|
|
60
|
+
})`
|
|
56
61
|
padding-top: 6px;
|
|
57
62
|
padding-left: 10px;
|
|
58
63
|
padding-right: 10px;
|
|
59
64
|
padding-bottom: 4px;
|
|
60
65
|
`;
|
|
61
|
-
const StyledTitleLeftBubble = (0, import_ds_system.styled)("div"
|
|
66
|
+
const StyledTitleLeftBubble = (0, import_ds_system.styled)("div", {
|
|
67
|
+
name: import_constants.DSChatBubbleName,
|
|
68
|
+
slot: import_constants.CHAT_BUBBLE_SLOTS.HEADER_LEFT
|
|
69
|
+
})`
|
|
62
70
|
font-size: 1rem;
|
|
63
71
|
font-weight: 600;
|
|
64
72
|
${wrapRules}
|
|
65
73
|
`;
|
|
66
|
-
const StyledTitleRightBubble = (0, import_ds_system.styled)(import_ds_grid.Grid
|
|
74
|
+
const StyledTitleRightBubble = (0, import_ds_system.styled)(import_ds_grid.Grid, {
|
|
75
|
+
name: import_constants.DSChatBubbleName,
|
|
76
|
+
slot: import_constants.CHAT_BUBBLE_SLOTS.HEADER_RIGHT
|
|
77
|
+
})`
|
|
67
78
|
font-size: 1rem;
|
|
68
79
|
font-weight: 400;
|
|
69
80
|
align-self: flex-start;
|
|
70
|
-
color: ${(props) => props
|
|
81
|
+
color: ${(props) => props["data-theming-type"] === import_constants.BUBBLE_TYPES.SENDER ? "#FFF" : "#657489"};
|
|
71
82
|
`;
|
|
72
|
-
const StyleBodyWrapper = import_ds_system.styled
|
|
83
|
+
const StyleBodyWrapper = (0, import_ds_system.styled)("div", {
|
|
84
|
+
name: import_constants.DSChatBubbleName,
|
|
85
|
+
slot: import_constants.CHAT_BUBBLE_SLOTS.BODY_WRAPPER
|
|
86
|
+
})`
|
|
73
87
|
font-size: 1rem;
|
|
74
88
|
font-weight: 400;
|
|
75
89
|
line-height: 1.15;
|
|
76
90
|
min-height: 18px;
|
|
77
91
|
padding: 0px 10px 8px 10px;
|
|
78
92
|
`;
|
|
79
|
-
const StyleErrorMessage = import_ds_system.styled
|
|
93
|
+
const StyleErrorMessage = (0, import_ds_system.styled)("div", {
|
|
94
|
+
name: import_constants.DSChatBubbleName,
|
|
95
|
+
slot: import_constants.CHAT_BUBBLE_SLOTS.ERROR_MESSAGE
|
|
96
|
+
})`
|
|
80
97
|
font-size: 0.923rem;
|
|
81
98
|
font-weight: 400;
|
|
82
99
|
padding-top: ${(props) => props.theme.space.xxxs};
|
|
@@ -96,7 +113,10 @@ const StyleErrorMessage = import_ds_system.styled.div`
|
|
|
96
113
|
margin-left: 8px;
|
|
97
114
|
}
|
|
98
115
|
`;
|
|
99
|
-
const StyleHelpMessage = (0, import_ds_system.styled)(StyleErrorMessage
|
|
116
|
+
const StyleHelpMessage = (0, import_ds_system.styled)(StyleErrorMessage, {
|
|
117
|
+
name: import_constants.DSChatBubbleName,
|
|
118
|
+
slot: import_constants.CHAT_BUBBLE_SLOTS.HELP_MESSAGE
|
|
119
|
+
})`
|
|
100
120
|
font-size: 0.923rem;
|
|
101
121
|
line-height: 1.15;
|
|
102
122
|
color: ${(props) => props.theme.colors.neutral[600]};
|
|
@@ -108,47 +128,25 @@ const StyleHelpMessage = (0, import_ds_system.styled)(StyleErrorMessage)`
|
|
|
108
128
|
color: ${(props) => props.theme.colors.danger[900]};
|
|
109
129
|
}
|
|
110
130
|
`;
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
bottom: 0.769rem;
|
|
116
|
-
height: 1.15rem;
|
|
117
|
-
`;
|
|
118
|
-
const StyledColoredBubble = import_ds_system.styled.div`
|
|
131
|
+
const StyledColoredBubble = (0, import_ds_system.styled)("div", {
|
|
132
|
+
name: import_constants.DSChatBubbleName,
|
|
133
|
+
slot: import_constants.CHAT_BUBBLE_SLOTS.COLORED_BUBBLE
|
|
134
|
+
})`
|
|
119
135
|
min-width: 224px;
|
|
120
136
|
border-radius: 10px;
|
|
121
137
|
position: relative;
|
|
122
138
|
|
|
123
|
-
${(props) => props
|
|
139
|
+
${(props) => props["data-theming-type"] === import_constants.BUBBLE_TYPES.SENDER ? `
|
|
124
140
|
border: 1px solid ${props.theme.colors.brand["700"]};
|
|
125
141
|
background: ${props.theme.colors.brand[600]};
|
|
126
142
|
color: ${props.theme.colors.neutral["000"]};
|
|
127
|
-
${StyledBubbleArrow}{
|
|
128
|
-
right: -0.692rem;
|
|
129
|
-
bottom: 0.461rem;
|
|
130
|
-
svg{
|
|
131
|
-
fill: ${props.theme.colors.brand[600]};
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
143
|
a {
|
|
136
144
|
color: #FFF;
|
|
137
145
|
}
|
|
138
|
-
|
|
139
146
|
` : `
|
|
140
147
|
box-shadow: 0 1px 3px 0 rgba(53,60,70,0.80);
|
|
141
148
|
background: ${props.theme.colors.neutral["000"]};
|
|
142
149
|
color: ${props.theme.colors.neutral[700]};
|
|
143
|
-
|
|
144
|
-
${StyledBubbleArrow}{
|
|
145
|
-
left: -0.846rem;
|
|
146
|
-
bottom: 0.461rem;
|
|
147
|
-
svg{
|
|
148
|
-
fill: ${props.theme.colors.neutral["000"]};
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
150
|
`}
|
|
153
151
|
`;
|
|
154
152
|
//# sourceMappingURL=styled.js.map
|
package/dist/cjs/styled.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styled.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport { styled, css } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { BUBBLE_TYPES } from './
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport { styled, css } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { BUBBLE_TYPES, CHAT_BUBBLE_SLOTS, DSChatBubbleName } from './constants/index.js';\n\nconst wrapRules = css`\n overflow-wrap: break-word;\n white-space: pre-wrap;\n`;\n// Bubble WRAPPER\nexport const StyledWrapper = styled('div', {\n name: DSChatBubbleName,\n slot: CHAT_BUBBLE_SLOTS.WRAPPER,\n})`\n min-width: 224px;\n border-radius: 10px;\n ${wrapRules}\n`;\n\n// Bubble HEADER\nexport const StyledTitleBubble = styled(Grid, {\n name: DSChatBubbleName,\n slot: CHAT_BUBBLE_SLOTS.HEADER,\n})`\n padding-top: 6px;\n padding-left: 10px;\n padding-right: 10px;\n padding-bottom: 4px;\n`;\n\nexport const StyledTitleLeftBubble = styled('div', {\n name: DSChatBubbleName,\n slot: CHAT_BUBBLE_SLOTS.HEADER_LEFT,\n})`\n font-size: 1rem;\n font-weight: 600;\n ${wrapRules}\n`;\nexport const StyledTitleRightBubble = styled(Grid, {\n name: DSChatBubbleName,\n slot: CHAT_BUBBLE_SLOTS.HEADER_RIGHT,\n})<{ 'data-theming-type': string }>`\n font-size: 1rem;\n font-weight: 400;\n align-self: flex-start;\n color: ${(props) => (props['data-theming-type'] === BUBBLE_TYPES.SENDER ? '#FFF' : '#657489')};\n`;\n\nexport const StyleBodyWrapper = styled('div', {\n name: DSChatBubbleName,\n slot: CHAT_BUBBLE_SLOTS.BODY_WRAPPER,\n})`\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.15;\n min-height: 18px;\n padding: 0px 10px 8px 10px;\n`;\n\nexport const StyleErrorMessage = styled('div', {\n name: DSChatBubbleName,\n slot: CHAT_BUBBLE_SLOTS.ERROR_MESSAGE,\n})`\n font-size: 0.923rem;\n font-weight: 400;\n padding-top: ${(props) => props.theme.space.xxxs};\n color: ${(props) => props.theme.colors.danger[900]};\n align-items: flex-end;\n justify-content: center;\n text-align: right;\n line-height: 1.15;\n svg {\n fill: ${(props) => props.theme.colors.danger[900]};\n }\n a {\n font-size: 0.923rem;\n color: ${(props) => props.theme.colors.danger[900]};\n }\n .em-ds-icon {\n margin-left: 8px;\n }\n`;\n\nexport const StyleHelpMessage = styled(StyleErrorMessage, {\n name: DSChatBubbleName,\n slot: CHAT_BUBBLE_SLOTS.HELP_MESSAGE,\n})`\n font-size: 0.923rem;\n line-height: 1.15;\n color: ${(props) => props.theme.colors.neutral[600]};\n svg {\n fill: ${(props) => props.theme.colors.danger[900]};\n }\n a {\n font-size: 12px;\n color: ${(props) => props.theme.colors.danger[900]};\n }\n`;\n\nexport const StyledColoredBubble = styled('div', {\n name: DSChatBubbleName,\n slot: CHAT_BUBBLE_SLOTS.COLORED_BUBBLE,\n})<{ 'data-theming-type': string }>`\n min-width: 224px;\n border-radius: 10px;\n position: relative;\n\n ${(props) =>\n props['data-theming-type'] === BUBBLE_TYPES.SENDER\n ? `\n border: 1px solid ${props.theme.colors.brand['700']};\n background: ${props.theme.colors.brand[600]};\n color: ${props.theme.colors.neutral['000']};\n a {\n color: #FFF;\n }\n `\n : `\n box-shadow: 0 1px 3px 0 rgba(53,60,70,0.80);\n background: ${props.theme.colors.neutral['000']};\n color: ${props.theme.colors.neutral[700]};\n `}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAA4B;AAC5B,qBAAqB;AACrB,uBAAkE;AAElE,MAAM,YAAY;AAAA;AAAA;AAAA;AAKX,MAAM,oBAAgB,yBAAO,OAAO;AAAA,EACzC,MAAM;AAAA,EACN,MAAM,mCAAkB;AAC1B,CAAC;AAAA;AAAA;AAAA,IAGG,SAAS;AAAA;AAIN,MAAM,wBAAoB,yBAAO,qBAAM;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,mCA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I/C,MAAM,0BAAsB,yBAAO,OAAO;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,mCAAkB;AAC1B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,IAKG,CAAC,UACD,MAAM,mBAAmB,MAAM,8BAAa,SACxC;AAAA,4BACoB,MAAM,MAAM,OAAO,MAAM,KAAK,CAAC;AAAA,sBACrC,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,iBAClC,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA,QAK1C;AAAA;AAAA,sBAEc,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,iBACtC,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,KAC3C;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/ChatBubble.js
CHANGED
|
@@ -17,8 +17,7 @@ import {
|
|
|
17
17
|
} from "./styled.js";
|
|
18
18
|
import { BubblePropTypes, defaultProps } from "./react-desc-prop-types.js";
|
|
19
19
|
import { ChatBubbleArrow } from "./ChatBubbleArrow.js";
|
|
20
|
-
import {
|
|
21
|
-
import { DSChatBubbleName } from "./DSChatBubbleDefinitions.js";
|
|
20
|
+
import { CHAT_BUBBLE_DATA_TESTID, DSChatBubbleName } from "./constants/index.js";
|
|
22
21
|
const ChatBubble = (props) => {
|
|
23
22
|
const defaultPropsIncludingInstanciatedValues = React2.useMemo(() => {
|
|
24
23
|
const dsId2 = props.dsId || `ds-chat-bubble-${uid(9)}`;
|
|
@@ -31,39 +30,98 @@ const ChatBubble = (props) => {
|
|
|
31
30
|
useValidateTypescriptPropTypes(propsWithDefault, BubblePropTypes, DSChatBubbleName);
|
|
32
31
|
const { dsId, type, title, time, body, errorMessage, helpMessage } = propsWithDefault;
|
|
33
32
|
const bodyParts = React2.useMemo(() => typeof body === "string" ? body.split("\n") : [body], [body]);
|
|
34
|
-
return /* @__PURE__ */ jsxs(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
return /* @__PURE__ */ jsxs(
|
|
34
|
+
StyledWrapper,
|
|
35
|
+
{
|
|
36
|
+
"data-testid": `${CHAT_BUBBLE_DATA_TESTID.WRAPPER}-${dsId}`,
|
|
37
|
+
getOwnerProps: () => propsWithDefault,
|
|
38
|
+
getOwnerPropsArguments: () => ({}),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsxs(
|
|
41
|
+
StyledColoredBubble,
|
|
40
42
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
children:
|
|
43
|
+
"data-theming-type": type,
|
|
44
|
+
getOwnerProps: () => propsWithDefault,
|
|
45
|
+
getOwnerPropsArguments: () => ({}),
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsxs(
|
|
48
|
+
StyledTitleBubble,
|
|
49
|
+
{
|
|
50
|
+
cols: ["1fr", "auto"],
|
|
51
|
+
gutter: "xs",
|
|
52
|
+
alignItems: "flex-end",
|
|
53
|
+
getOwnerProps: () => propsWithDefault,
|
|
54
|
+
getOwnerPropsArguments: () => ({}),
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
StyledTitleLeftBubble,
|
|
58
|
+
{
|
|
59
|
+
"data-testid": `${CHAT_BUBBLE_DATA_TESTID.HEADER_LEFT}-${dsId}`,
|
|
60
|
+
getOwnerProps: () => propsWithDefault,
|
|
61
|
+
getOwnerPropsArguments: () => ({}),
|
|
62
|
+
children: title
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
StyledTitleRightBubble,
|
|
67
|
+
{
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
"data-theming-type": type,
|
|
70
|
+
"data-testid": `${CHAT_BUBBLE_DATA_TESTID.HEADER_RIGHT}-${dsId}`,
|
|
71
|
+
getOwnerProps: () => propsWithDefault,
|
|
72
|
+
getOwnerPropsArguments: () => ({}),
|
|
73
|
+
children: time
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
StyleBodyWrapper,
|
|
81
|
+
{
|
|
82
|
+
"data-testid": `${CHAT_BUBBLE_DATA_TESTID.BODY_WRAPPER}-${dsId}`,
|
|
83
|
+
getOwnerProps: () => propsWithDefault,
|
|
84
|
+
getOwnerPropsArguments: () => ({}),
|
|
85
|
+
children: bodyParts.map((item, index) => (
|
|
86
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
87
|
+
/* @__PURE__ */ jsxs(React2.Fragment, { children: [
|
|
88
|
+
item,
|
|
89
|
+
index < bodyParts.length - 1 ? /* @__PURE__ */ jsx("br", {}) : null
|
|
90
|
+
] }, `body-fragment-${index}-${dsId}`)
|
|
91
|
+
))
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ jsx(ChatBubbleArrow, { ...propsWithDefault })
|
|
95
|
+
]
|
|
45
96
|
}
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
97
|
+
),
|
|
98
|
+
errorMessage ? /* @__PURE__ */ jsx(
|
|
99
|
+
StyleErrorMessage,
|
|
100
|
+
{
|
|
101
|
+
"data-testid": `${CHAT_BUBBLE_DATA_TESTID.ERROR_MESSAGE}-${dsId}`,
|
|
102
|
+
getOwnerProps: () => propsWithDefault,
|
|
103
|
+
getOwnerPropsArguments: () => ({}),
|
|
104
|
+
children: /* @__PURE__ */ jsxs(Grid, { cols: ["1fr", "auto"], children: [
|
|
105
|
+
/* @__PURE__ */ jsx("span", { children: errorMessage }),
|
|
106
|
+
/* @__PURE__ */ jsx(WarningCircleFill, {})
|
|
107
|
+
] })
|
|
108
|
+
}
|
|
109
|
+
) : null,
|
|
110
|
+
helpMessage ? /* @__PURE__ */ jsx(
|
|
111
|
+
StyleHelpMessage,
|
|
112
|
+
{
|
|
113
|
+
"data-testid": `${CHAT_BUBBLE_DATA_TESTID.HELP_MESSAGE}-${dsId}`,
|
|
114
|
+
getOwnerProps: () => propsWithDefault,
|
|
115
|
+
getOwnerPropsArguments: () => ({}),
|
|
116
|
+
children: /* @__PURE__ */ jsx("span", { children: helpMessage })
|
|
117
|
+
}
|
|
118
|
+
) : null
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
);
|
|
63
122
|
};
|
|
64
123
|
ChatBubble.displayName = DSChatBubbleName;
|
|
65
124
|
const ChatBubbleWithSchema = describe(ChatBubble);
|
|
66
|
-
ChatBubbleWithSchema.propTypes = BubblePropTypes;
|
|
67
125
|
export {
|
|
68
126
|
ChatBubble,
|
|
69
127
|
ChatBubbleWithSchema
|
|
@@ -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-props-helpers';\nimport { WarningCircleFill } from '@elliemae/ds-icons';\nimport { Grid } from '@elliemae/ds-grid';\nimport { uid } from 'uid';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled.js';\nimport { BubblePropTypes, type DSChatBubbleT, defaultProps } from './react-desc-prop-types.js';\nimport { ChatBubbleArrow } from './ChatBubbleArrow.js';\nimport {
|
|
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-props-helpers';\nimport { WarningCircleFill } from '@elliemae/ds-icons';\nimport { Grid } from '@elliemae/ds-grid';\nimport { uid } from 'uid';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled.js';\nimport { BubblePropTypes, type DSChatBubbleT, defaultProps } from './react-desc-prop-types.js';\nimport { ChatBubbleArrow } from './ChatBubbleArrow.js';\nimport { CHAT_BUBBLE_DATA_TESTID, DSChatBubbleName } from './constants/index.js';\n\nconst ChatBubble: React.ComponentType<DSChatBubbleT.Props> = (props) => {\n const defaultPropsIncludingInstanciatedValues = React.useMemo(() => {\n const dsId = props.dsId || `ds-chat-bubble-${uid(9)}`;\n return { ...defaultProps, dsId };\n }, [props.dsId]);\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatBubbleT.InternalProps>(\n props,\n defaultPropsIncludingInstanciatedValues,\n );\n useValidateTypescriptPropTypes(propsWithDefault, BubblePropTypes, 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\n data-testid={`${CHAT_BUBBLE_DATA_TESTID.WRAPPER}-${dsId}`}\n getOwnerProps={() => propsWithDefault}\n getOwnerPropsArguments={() => ({})}\n >\n <StyledColoredBubble\n data-theming-type={type}\n getOwnerProps={() => propsWithDefault}\n getOwnerPropsArguments={() => ({})}\n >\n <StyledTitleBubble\n cols={['1fr', 'auto']}\n gutter=\"xs\"\n alignItems=\"flex-end\"\n getOwnerProps={() => propsWithDefault}\n getOwnerPropsArguments={() => ({})}\n >\n <StyledTitleLeftBubble\n data-testid={`${CHAT_BUBBLE_DATA_TESTID.HEADER_LEFT}-${dsId}`}\n getOwnerProps={() => propsWithDefault}\n getOwnerPropsArguments={() => ({})}\n >\n {title}\n </StyledTitleLeftBubble>\n <StyledTitleRightBubble\n alignItems=\"center\"\n data-theming-type={type}\n data-testid={`${CHAT_BUBBLE_DATA_TESTID.HEADER_RIGHT}-${dsId}`}\n getOwnerProps={() => propsWithDefault}\n getOwnerPropsArguments={() => ({})}\n >\n {time}\n </StyledTitleRightBubble>\n </StyledTitleBubble>\n <StyleBodyWrapper\n data-testid={`${CHAT_BUBBLE_DATA_TESTID.BODY_WRAPPER}-${dsId}`}\n getOwnerProps={() => propsWithDefault}\n getOwnerPropsArguments={() => ({})}\n >\n {bodyParts.map((item, index) => (\n // eslint-disable-next-line react/no-array-index-key\n <React.Fragment key={`body-fragment-${index}-${dsId}`}>\n {item}\n {index < bodyParts.length - 1 ? <br /> : null}\n </React.Fragment>\n ))}\n </StyleBodyWrapper>\n <ChatBubbleArrow {...propsWithDefault} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage\n data-testid={`${CHAT_BUBBLE_DATA_TESTID.ERROR_MESSAGE}-${dsId}`}\n getOwnerProps={() => propsWithDefault}\n getOwnerPropsArguments={() => ({})}\n >\n <Grid cols={['1fr', 'auto']}>\n <span>{errorMessage}</span>\n <WarningCircleFill />\n </Grid>\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage\n data-testid={`${CHAT_BUBBLE_DATA_TESTID.HELP_MESSAGE}-${dsId}`}\n getOwnerProps={() => propsWithDefault}\n getOwnerPropsArguments={() => ({})}\n >\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\n\nChatBubble.displayName = DSChatBubbleName;\nconst ChatBubbleWithSchema = describe(ChatBubble);\n\nexport { ChatBubble, ChatBubbleWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAA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Ae,MAAM;AAAA,YACrB,wBAAwB,OAAO,CAAC;AAAA,YAEhC,8BAAC,UAAM,uBAAY;AAAA;AAAA,QACrB,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;AAEA,WAAW,cAAc;AACzB,MAAM,uBAAuB,SAAS,UAAU;",
|
|
6
6
|
"names": ["React", "dsId"]
|
|
7
7
|
}
|
|
@@ -1,62 +1,83 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/* @__PURE__ */ jsx(
|
|
28
|
-
"feColorMatrix",
|
|
29
|
-
{
|
|
30
|
-
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",
|
|
31
|
-
type: "matrix",
|
|
32
|
-
in: "shadowBlurOuter1"
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
] }),
|
|
39
|
-
/* @__PURE__ */ jsx("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ jsxs("g", { transform: "translate(7.500000, 6.000000) scale(-1, 1) translate(-7.500000, -6.000000) ", children: [
|
|
40
|
-
/* @__PURE__ */ jsx(
|
|
41
|
-
"use",
|
|
42
|
-
{
|
|
43
|
-
fill: "black",
|
|
44
|
-
fillOpacity: "1",
|
|
45
|
-
filter: `url(#arrow-svg-filter-${dsId})`,
|
|
46
|
-
xlinkHref: `#arrow-svg-path-${dsId}`
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
/* @__PURE__ */ jsx("use", { fill: "#FFFFFF", fillRule: "evenodd", xlinkHref: `#arrow-svg-path-${dsId}` })
|
|
50
|
-
] }) })
|
|
51
|
-
] }) : /* @__PURE__ */ jsx("svg", { width: "0.692rem", height: "0.615rem", viewBox: "0 0 9 8", "aria-hidden": "true", children: /* @__PURE__ */ jsx("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ jsx(
|
|
52
|
-
"path",
|
|
3
|
+
import { styled, css } from "@elliemae/ds-system";
|
|
4
|
+
import { BUBBLE_TYPES, CHAT_BUBBLE_SLOTS, DSChatBubbleName } from "./constants/index.js";
|
|
5
|
+
const senderArrowPositionStyles = css`
|
|
6
|
+
right: -0.692rem;
|
|
7
|
+
height: 1.15rem;
|
|
8
|
+
bottom: 0.461rem;
|
|
9
|
+
`;
|
|
10
|
+
const recipientArrowPositionStyles = css`
|
|
11
|
+
left: -0.846rem;
|
|
12
|
+
bottom: 0.461rem;
|
|
13
|
+
`;
|
|
14
|
+
const StyledBubbleArrow = styled("div", {
|
|
15
|
+
name: DSChatBubbleName,
|
|
16
|
+
slot: CHAT_BUBBLE_SLOTS.ARROW
|
|
17
|
+
})`
|
|
18
|
+
position: absolute;
|
|
19
|
+
fill: ${(props) => props["data-theming-type"] === BUBBLE_TYPES.RECIPIENT ? props.theme.colors.neutral["000"] : props.theme.colors.brand["600"]};
|
|
20
|
+
${(props) => {
|
|
21
|
+
if (props["data-theming-type"] === BUBBLE_TYPES.RECIPIENT) return recipientArrowPositionStyles;
|
|
22
|
+
return senderArrowPositionStyles;
|
|
23
|
+
}}
|
|
24
|
+
`;
|
|
25
|
+
const BubbleArrowRecipient = (propsWithDefault) => /* @__PURE__ */ jsx(
|
|
26
|
+
StyledBubbleArrow,
|
|
53
27
|
{
|
|
54
|
-
|
|
55
|
-
|
|
28
|
+
"data-theming-type": BUBBLE_TYPES.RECIPIENT,
|
|
29
|
+
getOwnerProps: () => propsWithDefault,
|
|
30
|
+
getOwnerPropsArguments: () => ({ isRecipientArrow: true }),
|
|
31
|
+
children: /* @__PURE__ */ jsxs("svg", { width: "1.15rem", height: "1.07rem", viewBox: "0 0 15 14", "aria-hidden": "true", children: [
|
|
32
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
33
|
+
"filter",
|
|
34
|
+
{
|
|
35
|
+
id: `filter-${propsWithDefault.dsId}`,
|
|
36
|
+
width: "211.1%",
|
|
37
|
+
height: "225%",
|
|
38
|
+
x: "-55.6%",
|
|
39
|
+
y: "-50%",
|
|
40
|
+
filterUnits: "objectBoundingBox",
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsx("feOffset", { dx: "2.3", dy: "1.2", in: "SourceAlpha", result: "shadowOffsetOuter1" }),
|
|
43
|
+
/* @__PURE__ */ jsx("feGaussianBlur", { in: "shadowOffsetOuter1", result: "shadowBlurOuter1", stdDeviation: "1.5" }),
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
"feColorMatrix",
|
|
46
|
+
{
|
|
47
|
+
in: "shadowBlurOuter1",
|
|
48
|
+
values: "0 0 0 0 0.207843137 0 0 0 0 0.235294118 0 0 0 0 0.274509804 0 0 0 0.8 0"
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
) }),
|
|
54
|
+
/* @__PURE__ */ jsxs("g", { transform: "matrix(-1 0 0 1 15 0)", children: [
|
|
55
|
+
/* @__PURE__ */ jsx("use", { filter: `url(#filter-${propsWithDefault.dsId})`, href: `#path-${propsWithDefault.dsId}` }),
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
"path",
|
|
58
|
+
{
|
|
59
|
+
id: `path-${propsWithDefault.dsId}`,
|
|
60
|
+
d: "M12 8.5c0-.563-.322-1.014-.772-1.304L3 2v8h7.563l.003-.007A1.497 1.497 0 0 0 12 8.5"
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] })
|
|
64
|
+
] })
|
|
56
65
|
}
|
|
57
|
-
)
|
|
58
|
-
const
|
|
59
|
-
|
|
66
|
+
);
|
|
67
|
+
const BubbleArrowSender = (propsWithDefault) => /* @__PURE__ */ jsx(
|
|
68
|
+
StyledBubbleArrow,
|
|
69
|
+
{
|
|
70
|
+
"data-theming-type": BUBBLE_TYPES.SENDER,
|
|
71
|
+
getOwnerProps: () => propsWithDefault,
|
|
72
|
+
getOwnerPropsArguments: () => ({ isRecipientArrow: false }),
|
|
73
|
+
children: /* @__PURE__ */ jsx("svg", { width: "0.692rem", height: "0.615rem", viewBox: "0 0 9 8", "aria-hidden": "true", children: /* @__PURE__ */ jsx("g", { stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: /* @__PURE__ */ jsx("path", { 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" }) }) })
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
const ChatBubbleArrow = (propsWithDefault) => {
|
|
77
|
+
const { type } = propsWithDefault;
|
|
78
|
+
if (type === BUBBLE_TYPES.RECIPIENT) return /* @__PURE__ */ jsx(BubbleArrowRecipient, { ...propsWithDefault });
|
|
79
|
+
return /* @__PURE__ */ jsx(BubbleArrowSender, { ...propsWithDefault });
|
|
80
|
+
};
|
|
60
81
|
export {
|
|
61
82
|
ChatBubbleArrow
|
|
62
83
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/ChatBubbleArrow.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, css } from '@elliemae/ds-system';\nimport React from 'react';\nimport { BUBBLE_TYPES, CHAT_BUBBLE_SLOTS, DSChatBubbleName } from './constants/index.js';\nimport { type DSChatBubbleT } from './react-desc-prop-types.js';\n\nconst senderArrowPositionStyles = css`\n right: -0.692rem;\n height: 1.15rem;\n bottom: 0.461rem;\n`;\nconst recipientArrowPositionStyles = css`\n left: -0.846rem;\n bottom: 0.461rem;\n`;\n\nconst StyledBubbleArrow = styled('div', {\n name: DSChatBubbleName,\n slot: CHAT_BUBBLE_SLOTS.ARROW,\n})<{ 'data-theming-type': typeof BUBBLE_TYPES.RECIPIENT | typeof BUBBLE_TYPES.SENDER }>`\n position: absolute;\n fill: ${(props) =>\n props['data-theming-type'] === BUBBLE_TYPES.RECIPIENT\n ? props.theme.colors.neutral['000']\n : props.theme.colors.brand['600']};\n ${(props) => {\n if (props['data-theming-type'] === BUBBLE_TYPES.RECIPIENT) return recipientArrowPositionStyles;\n return senderArrowPositionStyles;\n }}\n`;\n\nconst BubbleArrowRecipient: React.ComponentType<DSChatBubbleT.InternalProps> = (propsWithDefault) => (\n <StyledBubbleArrow\n data-theming-type={BUBBLE_TYPES.RECIPIENT}\n getOwnerProps={() => propsWithDefault}\n getOwnerPropsArguments={() => ({ isRecipientArrow: true })}\n >\n <svg width=\"1.15rem\" height=\"1.07rem\" viewBox=\"0 0 15 14\" aria-hidden=\"true\">\n <defs>\n <filter\n id={`filter-${propsWithDefault.dsId}`}\n width=\"211.1%\"\n height=\"225%\"\n x=\"-55.6%\"\n y=\"-50%\"\n filterUnits=\"objectBoundingBox\"\n >\n <feOffset dx=\"2.3\" dy=\"1.2\" in=\"SourceAlpha\" result=\"shadowOffsetOuter1\" />\n <feGaussianBlur in=\"shadowOffsetOuter1\" result=\"shadowBlurOuter1\" stdDeviation=\"1.5\" />\n <feColorMatrix\n in=\"shadowBlurOuter1\"\n values=\"0 0 0 0 0.207843137 0 0 0 0 0.235294118 0 0 0 0 0.274509804 0 0 0 0.8 0\"\n />\n </filter>\n </defs>\n <g transform=\"matrix(-1 0 0 1 15 0)\">\n <use filter={`url(#filter-${propsWithDefault.dsId})`} href={`#path-${propsWithDefault.dsId}`} />\n <path\n id={`path-${propsWithDefault.dsId}`}\n d=\"M12 8.5c0-.563-.322-1.014-.772-1.304L3 2v8h7.563l.003-.007A1.497 1.497 0 0 0 12 8.5\"\n />\n </g>\n </svg>\n </StyledBubbleArrow>\n);\n\nconst BubbleArrowSender: React.ComponentType<DSChatBubbleT.InternalProps> = (propsWithDefault) => (\n <StyledBubbleArrow\n data-theming-type={BUBBLE_TYPES.SENDER}\n getOwnerProps={() => propsWithDefault}\n getOwnerPropsArguments={() => ({ isRecipientArrow: false })}\n >\n <svg width=\"0.692rem\" height=\"0.615rem\" viewBox=\"0 0 9 8\" aria-hidden=\"true\">\n <g stroke=\"none\" strokeWidth=\"1\" fillRule=\"evenodd\">\n <path 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\"></path>\n </g>\n </svg>\n </StyledBubbleArrow>\n);\n\nexport const ChatBubbleArrow: React.ComponentType<DSChatBubbleT.InternalProps> = (propsWithDefault) => {\n const { type } = propsWithDefault;\n if (type === BUBBLE_TYPES.RECIPIENT) return <BubbleArrowRecipient {...propsWithDefault} />;\n return <BubbleArrowSender {...propsWithDefault} />;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACsCf,SAQE,KARF;AAtCR,SAAS,QAAQ,WAAW;AAE5B,SAAS,cAAc,mBAAmB,wBAAwB;AAGlE,MAAM,4BAA4B;AAAA;AAAA;AAAA;AAAA;AAKlC,MAAM,+BAA+B;AAAA;AAAA;AAAA;AAKrC,MAAM,oBAAoB,OAAO,OAAO;A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AA,EAAC;AAAA;AAAA,IACC,qBAAmB,aAAa;AAAA,IAChC,eAAe,MAAM;AAAA,IACrB,wBAAwB,OAAO,EAAE,kBAAkB,MAAM;AAAA,IAEzD,8BAAC,SAAI,OAAM,YAAW,QAAO,YAAW,SAAQ,WAAU,eAAY,QACpE,8BAAC,OAAE,QAAO,QAAO,aAAY,KAAI,UAAS,WACxC,8BAAC,UAAK,GAAE,2KAA0K,GACpL,GACF;AAAA;AACF;AAGK,MAAM,kBAAoE,CAAC,qBAAqB;AACrG,QAAM,EAAE,KAAK,IAAI;AACjB,MAAI,SAAS,aAAa,UAAW,QAAO,oBAAC,wBAAsB,GAAG,kBAAkB;AACxF,SAAO,oBAAC,qBAAmB,GAAG,kBAAkB;AAClD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
3
|
+
const DSChatBubbleName = "DSBubble";
|
|
4
|
+
const DSChatBubbleArrowName = "DSBubbleArrow";
|
|
5
|
+
const BUBBLE_TYPES = {
|
|
6
|
+
SENDER: "SENDER",
|
|
7
|
+
RECIPIENT: "RECIPIENT",
|
|
8
|
+
DELIMITER: "DELIMITER",
|
|
9
|
+
SYSTEM: "SYSTEM"
|
|
10
|
+
};
|
|
11
|
+
const CHAT_BUBBLE_SLOTS = {
|
|
12
|
+
WRAPPER: "wrapper",
|
|
13
|
+
HEADER: "header",
|
|
14
|
+
HEADER_LEFT: "header-left",
|
|
15
|
+
HEADER_RIGHT: "header-right",
|
|
16
|
+
BODY_WRAPPER: "body-wrapper",
|
|
17
|
+
ERROR_MESSAGE: "error-message",
|
|
18
|
+
HELP_MESSAGE: "help-message",
|
|
19
|
+
ARROW: "arrow",
|
|
20
|
+
COLORED_BUBBLE: "colored-bubble"
|
|
21
|
+
};
|
|
22
|
+
const CHAT_BUBBLE_DATA_TESTID = {
|
|
23
|
+
...slotObjectToDataTestIds(DSChatBubbleName, CHAT_BUBBLE_SLOTS),
|
|
24
|
+
WRAPPER: "ds-chat-bubble",
|
|
25
|
+
HEADER_LEFT: "chat-bubble-title",
|
|
26
|
+
BODY_WRAPPER: "chat-bubble-body",
|
|
27
|
+
HEADER_RIGHT: "chat-bubble-time",
|
|
28
|
+
ERROR_MESSAGE: "chat-bubble-error-message",
|
|
29
|
+
HELP_MESSAGE: "chat-bubble-help-message"
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
BUBBLE_TYPES,
|
|
33
|
+
CHAT_BUBBLE_DATA_TESTID,
|
|
34
|
+
CHAT_BUBBLE_SLOTS,
|
|
35
|
+
DSChatBubbleArrowName,
|
|
36
|
+
DSChatBubbleName
|
|
37
|
+
};
|
|
38
|
+
//# 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 DSChatBubbleName = 'DSBubble';\nexport const DSChatBubbleArrowName = 'DSBubbleArrow';\n\nexport const BUBBLE_TYPES = {\n SENDER: 'SENDER',\n RECIPIENT: 'RECIPIENT',\n DELIMITER: 'DELIMITER',\n SYSTEM: 'SYSTEM',\n} as const;\n\nexport const CHAT_BUBBLE_SLOTS = {\n WRAPPER: 'wrapper',\n HEADER: 'header',\n HEADER_LEFT: 'header-left',\n HEADER_RIGHT: 'header-right',\n BODY_WRAPPER: 'body-wrapper',\n ERROR_MESSAGE: 'error-message',\n HELP_MESSAGE: 'help-message',\n ARROW: 'arrow',\n COLORED_BUBBLE: 'colored-bubble',\n} as const;\n\nexport const CHAT_BUBBLE_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSChatBubbleName, CHAT_BUBBLE_SLOTS),\n WRAPPER: 'ds-chat-bubble',\n HEADER_LEFT: 'chat-bubble-title',\n BODY_WRAPPER: 'chat-bubble-body',\n HEADER_RIGHT: 'chat-bubble-time',\n ERROR_MESSAGE: 'chat-bubble-error-message',\n HELP_MESSAGE: 'chat-bubble-help-message',\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,mBAAmB;AACzB,MAAM,wBAAwB;AAE9B,MAAM,eAAe;AAAA,EAC1B,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,WAAW;AAAA,EACX,QAAQ;AACV;AAEO,MAAM,oBAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,cAAc;AAAA,EACd,cAAc;AAAA,EACd,eAAe;AAAA,EACf,cAAc;AAAA,EACd,OAAO;AAAA,EACP,gBAAgB;AAClB;AAEO,MAAM,0BAA0B;AAAA,EACrC,GAAG,wBAAwB,kBAAkB,iBAAiB;AAAA,EAC9D,SAAS;AAAA,EACT,aAAa;AAAA,EACb,cAAc;AAAA,EACd,cAAc;AAAA,EACd,eAAe;AAAA,EACf,cAAc;AAChB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ChatBubble, ChatBubbleWithSchema } from "./ChatBubble.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
CHAT_BUBBLE_DATA_TESTID,
|
|
5
|
+
CHAT_BUBBLE_DATA_TESTID as CHAT_BUBBLE_DATA_TESTID2,
|
|
6
|
+
BUBBLE_TYPES,
|
|
7
|
+
DSChatBubbleName,
|
|
8
|
+
CHAT_BUBBLE_SLOTS
|
|
9
|
+
} from "./constants/index.js";
|
|
5
10
|
export * from "./styled.js";
|
|
6
11
|
export {
|
|
7
12
|
BUBBLE_TYPES,
|
|
13
|
+
CHAT_BUBBLE_DATA_TESTID2 as CHAT_BUBBLE_DATA_TESTID,
|
|
14
|
+
CHAT_BUBBLE_SLOTS,
|
|
8
15
|
ChatBubble,
|
|
9
|
-
ChatBubbleDataTestIds,
|
|
10
|
-
ChatBubbleWithSchema
|
|
16
|
+
CHAT_BUBBLE_DATA_TESTID as ChatBubbleDataTestIds,
|
|
17
|
+
ChatBubbleWithSchema,
|
|
18
|
+
DSChatBubbleName
|
|
11
19
|
};
|
|
12
20
|
//# 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 { ChatBubble, ChatBubbleWithSchema } from './ChatBubble.js';\nexport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,4BAA4B;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { ChatBubble, ChatBubbleWithSchema } from './ChatBubble.js';\nexport { type DSChatBubbleT } from './react-desc-prop-types.js';\nexport {\n CHAT_BUBBLE_DATA_TESTID as ChatBubbleDataTestIds, // LEGACY EXPORT\n CHAT_BUBBLE_DATA_TESTID,\n BUBBLE_TYPES,\n DSChatBubbleName,\n CHAT_BUBBLE_SLOTS,\n} from './constants/index.js';\nexport * from './styled.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,4BAA4B;AAEjD;AAAA,EAC6B;AAAA,EAC3B,2BAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,cAAc;",
|
|
6
|
+
"names": ["CHAT_BUBBLE_DATA_TESTID"]
|
|
7
7
|
}
|