@elliemae/ds-chat-bubble 3.60.0-next.3 → 3.60.0-next.30
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 +91 -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/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 +89 -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/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/ChatBubble.js
CHANGED
|
@@ -42,8 +42,7 @@ var import_uid = require("uid");
|
|
|
42
42
|
var import_styled = require("./styled.js");
|
|
43
43
|
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
44
44
|
var import_ChatBubbleArrow = require("./ChatBubbleArrow.js");
|
|
45
|
-
var
|
|
46
|
-
var import_DSChatBubbleDefinitions = require("./DSChatBubbleDefinitions.js");
|
|
45
|
+
var import_constants = require("./constants/index.js");
|
|
47
46
|
const ChatBubble = (props) => {
|
|
48
47
|
const defaultPropsIncludingInstanciatedValues = import_react.default.useMemo(() => {
|
|
49
48
|
const dsId2 = props.dsId || `ds-chat-bubble-${(0, import_uid.uid)(9)}`;
|
|
@@ -53,40 +52,100 @@ const ChatBubble = (props) => {
|
|
|
53
52
|
props,
|
|
54
53
|
defaultPropsIncludingInstanciatedValues
|
|
55
54
|
);
|
|
56
|
-
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.BubblePropTypes,
|
|
55
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.BubblePropTypes, import_constants.DSChatBubbleName);
|
|
57
56
|
const { dsId, type, title, time, body, errorMessage, helpMessage } = propsWithDefault;
|
|
58
57
|
const bodyParts = import_react.default.useMemo(() => typeof body === "string" ? body.split("\n") : [body], [body]);
|
|
59
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
59
|
+
import_styled.StyledWrapper,
|
|
60
|
+
{
|
|
61
|
+
"data-testid": `${import_constants.CHAT_BUBBLE_DATA_TESTID.WRAPPER}-${dsId}`,
|
|
62
|
+
getOwnerProps: () => propsWithDefault,
|
|
63
|
+
getOwnerPropsArguments: () => ({}),
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
66
|
+
import_styled.StyledColoredBubble,
|
|
65
67
|
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
children:
|
|
68
|
+
"data-theming-type": type,
|
|
69
|
+
getOwnerProps: () => propsWithDefault,
|
|
70
|
+
getOwnerPropsArguments: () => ({}),
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
73
|
+
import_styled.StyledTitleBubble,
|
|
74
|
+
{
|
|
75
|
+
cols: ["1fr", "auto"],
|
|
76
|
+
gutter: "xs",
|
|
77
|
+
alignItems: "flex-end",
|
|
78
|
+
className: "sr-only",
|
|
79
|
+
getOwnerProps: () => propsWithDefault,
|
|
80
|
+
getOwnerPropsArguments: () => ({}),
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
|
+
import_styled.StyledTitleLeftBubble,
|
|
84
|
+
{
|
|
85
|
+
"data-testid": `${import_constants.CHAT_BUBBLE_DATA_TESTID.HEADER_LEFT}-${dsId}`,
|
|
86
|
+
getOwnerProps: () => propsWithDefault,
|
|
87
|
+
getOwnerPropsArguments: () => ({}),
|
|
88
|
+
children: title
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
|
+
import_styled.StyledTitleRightBubble,
|
|
93
|
+
{
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
"data-theming-type": type,
|
|
96
|
+
"data-testid": `${import_constants.CHAT_BUBBLE_DATA_TESTID.HEADER_RIGHT}-${dsId}`,
|
|
97
|
+
getOwnerProps: () => propsWithDefault,
|
|
98
|
+
getOwnerPropsArguments: () => ({}),
|
|
99
|
+
children: time
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
106
|
+
import_styled.StyleBodyWrapper,
|
|
107
|
+
{
|
|
108
|
+
"data-testid": `${import_constants.CHAT_BUBBLE_DATA_TESTID.BODY_WRAPPER}-${dsId}`,
|
|
109
|
+
getOwnerProps: () => propsWithDefault,
|
|
110
|
+
getOwnerPropsArguments: () => ({}),
|
|
111
|
+
children: bodyParts.map((item, index) => (
|
|
112
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.default.Fragment, { children: [
|
|
114
|
+
item,
|
|
115
|
+
index < bodyParts.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}) : null
|
|
116
|
+
] }, `body-fragment-${index}-${dsId}`)
|
|
117
|
+
))
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ChatBubbleArrow.ChatBubbleArrow, { ...propsWithDefault })
|
|
121
|
+
]
|
|
70
122
|
}
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
123
|
+
),
|
|
124
|
+
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
|
+
import_styled.StyleErrorMessage,
|
|
126
|
+
{
|
|
127
|
+
"data-testid": `${import_constants.CHAT_BUBBLE_DATA_TESTID.ERROR_MESSAGE}-${dsId}`,
|
|
128
|
+
getOwnerProps: () => propsWithDefault,
|
|
129
|
+
getOwnerPropsArguments: () => ({}),
|
|
130
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_grid.Grid, { cols: ["1fr", "auto"], children: [
|
|
131
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: errorMessage }),
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.WarningCircleFill, {})
|
|
133
|
+
] })
|
|
134
|
+
}
|
|
135
|
+
) : null,
|
|
136
|
+
helpMessage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
+
import_styled.StyleHelpMessage,
|
|
138
|
+
{
|
|
139
|
+
"data-testid": `${import_constants.CHAT_BUBBLE_DATA_TESTID.HELP_MESSAGE}-${dsId}`,
|
|
140
|
+
getOwnerProps: () => propsWithDefault,
|
|
141
|
+
getOwnerPropsArguments: () => ({}),
|
|
142
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: helpMessage })
|
|
143
|
+
}
|
|
144
|
+
) : null
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
);
|
|
88
148
|
};
|
|
89
|
-
ChatBubble.displayName =
|
|
149
|
+
ChatBubble.displayName = import_constants.DSChatBubbleName;
|
|
90
150
|
const ChatBubbleWithSchema = (0, import_ds_props_helpers.describe)(ChatBubble);
|
|
91
|
-
ChatBubbleWithSchema.propTypes = import_react_desc_prop_types.BubblePropTypes;
|
|
92
151
|
//# 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-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;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["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 className=\"sr-only\"\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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["React", "dsId"]
|
|
7
7
|
}
|
|
@@ -33,61 +33,82 @@ __export(ChatBubbleArrow_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(ChatBubbleArrow_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
-
"feColorMatrix",
|
|
62
|
-
{
|
|
63
|
-
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",
|
|
64
|
-
type: "matrix",
|
|
65
|
-
in: "shadowBlurOuter1"
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
] }),
|
|
72
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { transform: "translate(7.500000, 6.000000) scale(-1, 1) translate(-7.500000, -6.000000) ", children: [
|
|
73
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
-
"use",
|
|
75
|
-
{
|
|
76
|
-
fill: "black",
|
|
77
|
-
fillOpacity: "1",
|
|
78
|
-
filter: `url(#arrow-svg-filter-${dsId})`,
|
|
79
|
-
xlinkHref: `#arrow-svg-path-${dsId}`
|
|
80
|
-
}
|
|
81
|
-
),
|
|
82
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("use", { fill: "#FFFFFF", fillRule: "evenodd", xlinkHref: `#arrow-svg-path-${dsId}` })
|
|
83
|
-
] }) })
|
|
84
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { width: "0.692rem", height: "0.615rem", viewBox: "0 0 9 8", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
|
-
"path",
|
|
36
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
37
|
+
var import_constants = require("./constants/index.js");
|
|
38
|
+
const senderArrowPositionStyles = import_ds_system.css`
|
|
39
|
+
right: -0.692rem;
|
|
40
|
+
height: 1.15rem;
|
|
41
|
+
bottom: 0.461rem;
|
|
42
|
+
`;
|
|
43
|
+
const recipientArrowPositionStyles = import_ds_system.css`
|
|
44
|
+
left: -0.846rem;
|
|
45
|
+
bottom: 0.461rem;
|
|
46
|
+
`;
|
|
47
|
+
const StyledBubbleArrow = (0, import_ds_system.styled)("div", {
|
|
48
|
+
name: import_constants.DSChatBubbleName,
|
|
49
|
+
slot: import_constants.CHAT_BUBBLE_SLOTS.ARROW
|
|
50
|
+
})`
|
|
51
|
+
position: absolute;
|
|
52
|
+
fill: ${(props) => props["data-theming-type"] === import_constants.BUBBLE_TYPES.RECIPIENT ? props.theme.colors.neutral["000"] : props.theme.colors.brand["600"]};
|
|
53
|
+
${(props) => {
|
|
54
|
+
if (props["data-theming-type"] === import_constants.BUBBLE_TYPES.RECIPIENT) return recipientArrowPositionStyles;
|
|
55
|
+
return senderArrowPositionStyles;
|
|
56
|
+
}}
|
|
57
|
+
`;
|
|
58
|
+
const BubbleArrowRecipient = (propsWithDefault) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
StyledBubbleArrow,
|
|
86
60
|
{
|
|
87
|
-
|
|
88
|
-
|
|
61
|
+
"data-theming-type": import_constants.BUBBLE_TYPES.RECIPIENT,
|
|
62
|
+
getOwnerProps: () => propsWithDefault,
|
|
63
|
+
getOwnerPropsArguments: () => ({ isRecipientArrow: true }),
|
|
64
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "1.15rem", height: "1.07rem", viewBox: "0 0 15 14", "aria-hidden": "true", children: [
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
66
|
+
"filter",
|
|
67
|
+
{
|
|
68
|
+
id: `filter-${propsWithDefault.dsId}`,
|
|
69
|
+
width: "211.1%",
|
|
70
|
+
height: "225%",
|
|
71
|
+
x: "-55.6%",
|
|
72
|
+
y: "-50%",
|
|
73
|
+
filterUnits: "objectBoundingBox",
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feOffset", { dx: "2.3", dy: "1.2", in: "SourceAlpha", result: "shadowOffsetOuter1" }),
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("feGaussianBlur", { in: "shadowOffsetOuter1", result: "shadowBlurOuter1", stdDeviation: "1.5" }),
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
78
|
+
"feColorMatrix",
|
|
79
|
+
{
|
|
80
|
+
in: "shadowBlurOuter1",
|
|
81
|
+
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"
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
) }),
|
|
87
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { transform: "matrix(-1 0 0 1 15 0)", children: [
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("use", { filter: `url(#filter-${propsWithDefault.dsId})`, href: `#path-${propsWithDefault.dsId}` }),
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
+
"path",
|
|
91
|
+
{
|
|
92
|
+
id: `path-${propsWithDefault.dsId}`,
|
|
93
|
+
d: "M12 8.5c0-.563-.322-1.014-.772-1.304L3 2v8h7.563l.003-.007A1.497 1.497 0 0 0 12 8.5"
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] })
|
|
97
|
+
] })
|
|
89
98
|
}
|
|
90
|
-
)
|
|
91
|
-
const
|
|
92
|
-
|
|
99
|
+
);
|
|
100
|
+
const BubbleArrowSender = (propsWithDefault) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
101
|
+
StyledBubbleArrow,
|
|
102
|
+
{
|
|
103
|
+
"data-theming-type": import_constants.BUBBLE_TYPES.SENDER,
|
|
104
|
+
getOwnerProps: () => propsWithDefault,
|
|
105
|
+
getOwnerPropsArguments: () => ({ isRecipientArrow: false }),
|
|
106
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { width: "0.692rem", height: "0.615rem", viewBox: "0 0 9 8", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime.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" }) }) })
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
const ChatBubbleArrow = (propsWithDefault) => {
|
|
110
|
+
const { type } = propsWithDefault;
|
|
111
|
+
if (type === import_constants.BUBBLE_TYPES.RECIPIENT) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BubbleArrowRecipient, { ...propsWithDefault });
|
|
112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BubbleArrowSender, { ...propsWithDefault });
|
|
113
|
+
};
|
|
93
114
|
//# sourceMappingURL=ChatBubbleArrow.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ChatBubbleArrow.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADsCf;AAtCR,uBAA4B;AAE5B,uBAAkE;AAGlE,MAAM,4BAA4B;AAAA;AAAA;AAAA;AAAA;AAKlC,MAAM,+BAA+B;AAAA;AAAA;AAAA;AAKrC,MAAM,wBAAoB,yBAAO,OAAO;AAAA,EACtC,MAAM;AAAA,EACN,MAAM,mCAAkB;AAC1B,CAAC;AAAA;AAAA,UAES,CAAC,UACP,MAAM,mBAAmB,MAAM,8BAAa,YACxC,MAAM,MAAM,OAAO,QAAQ,KAAK,IAChC,MAAM,MAAM,OAAO,MAAM,KAAK,CAAC;AAAA,IACnC,CAAC,UAAU;AACX,MAAI,MAAM,mBAAmB,MAAM,8BAAa,UAAW,QAAO;AAClE,SAAO;AACT,CAAC;AAAA;AAGH,MAAM,uBAAyE,CAAC,qBAC9E;AAAA,EAAC;AAAA;AAAA,IACC,qBAAmB,8BAAa;AAAA,IAChC,eAAe,MAAM;AAAA,IACrB,wBAAwB,OAAO,EAAE,kBAAkB,KAAK;AAAA,IAExD,uDAAC,SAAI,OAAM,WAAU,QAAO,WAAU,SAAQ,aAAY,eAAY,QACpE;AAAA,kDAAC,UACC;AAAA,QAAC;AAAA;AAAA,UACC,IAAI,UAAU,iBAAiB,IAAI;AAAA,UACnC,OAAM;AAAA,UACN,QAAO;AAAA,UACP,GAAE;AAAA,UACF,GAAE;AAAA,UACF,aAAY;AAAA,UAEZ;AAAA,wDAAC,cAAS,IAAG,OAAM,IAAG,OAAM,IAAG,eAAc,QAAO,sBAAqB;AAAA,YACzE,4CAAC,oBAAe,IAAG,sBAAqB,QAAO,oBAAmB,cAAa,OAAM;AAAA,YACrF;AAAA,cAAC;AAAA;AAAA,gBACC,IAAG;AAAA,gBACH,QAAO;AAAA;AAAA,YACT;AAAA;AAAA;AAAA,MACF,GACF;AAAA,MACA,6CAAC,OAAE,WAAU,yBACX;AAAA,oDAAC,SAAI,QAAQ,eAAe,iBAAiB,IAAI,KAAK,MAAM,SAAS,iBAAiB,IAAI,IAAI;AAAA,QAC9F;AAAA,UAAC;AAAA;AAAA,YACC,IAAI,QAAQ,iBAAiB,IAAI;AAAA,YACjC,GAAE;AAAA;AAAA,QACJ;AAAA,SACF;AAAA,OACF;AAAA;AACF;AAGF,MAAM,oBAAsE,CAAC,qBAC3E;AAAA,EAAC;AAAA;AAAA,IACC,qBAAmB,8BAAa;AAAA,IAChC,eAAe,MAAM;AAAA,IACrB,wBAAwB,OAAO,EAAE,kBAAkB,MAAM;AAAA,IAEzD,sDAAC,SAAI,OAAM,YAAW,QAAO,YAAW,SAAQ,WAAU,eAAY,QACpE,sDAAC,OAAE,QAAO,QAAO,aAAY,KAAI,UAAS,WACxC,sDAAC,UAAK,GAAE,2KAA0K,GACpL,GACF;AAAA;AACF;AAGK,MAAM,kBAAoE,CAAC,qBAAqB;AACrG,QAAM,EAAE,KAAK,IAAI;AACjB,MAAI,SAAS,8BAAa,UAAW,QAAO,4CAAC,wBAAsB,GAAG,kBAAkB;AACxF,SAAO,4CAAC,qBAAmB,GAAG,kBAAkB;AAClD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -26,11 +26,43 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var constants_exports = {};
|
|
30
|
+
__export(constants_exports, {
|
|
31
|
+
BUBBLE_TYPES: () => BUBBLE_TYPES,
|
|
32
|
+
CHAT_BUBBLE_DATA_TESTID: () => CHAT_BUBBLE_DATA_TESTID,
|
|
33
|
+
CHAT_BUBBLE_SLOTS: () => CHAT_BUBBLE_SLOTS,
|
|
34
|
+
DSChatBubbleArrowName: () => DSChatBubbleArrowName,
|
|
31
35
|
DSChatBubbleName: () => DSChatBubbleName
|
|
32
36
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
37
|
+
module.exports = __toCommonJS(constants_exports);
|
|
34
38
|
var React = __toESM(require("react"));
|
|
39
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
35
40
|
const DSChatBubbleName = "DSBubble";
|
|
36
|
-
|
|
41
|
+
const DSChatBubbleArrowName = "DSBubbleArrow";
|
|
42
|
+
const BUBBLE_TYPES = {
|
|
43
|
+
SENDER: "SENDER",
|
|
44
|
+
RECIPIENT: "RECIPIENT",
|
|
45
|
+
DELIMITER: "DELIMITER",
|
|
46
|
+
SYSTEM: "SYSTEM"
|
|
47
|
+
};
|
|
48
|
+
const CHAT_BUBBLE_SLOTS = {
|
|
49
|
+
WRAPPER: "wrapper",
|
|
50
|
+
HEADER: "header",
|
|
51
|
+
HEADER_LEFT: "header-left",
|
|
52
|
+
HEADER_RIGHT: "header-right",
|
|
53
|
+
BODY_WRAPPER: "body-wrapper",
|
|
54
|
+
ERROR_MESSAGE: "error-message",
|
|
55
|
+
HELP_MESSAGE: "help-message",
|
|
56
|
+
ARROW: "arrow",
|
|
57
|
+
COLORED_BUBBLE: "colored-bubble"
|
|
58
|
+
};
|
|
59
|
+
const CHAT_BUBBLE_DATA_TESTID = {
|
|
60
|
+
...(0, import_ds_system.slotObjectToDataTestIds)(DSChatBubbleName, CHAT_BUBBLE_SLOTS),
|
|
61
|
+
WRAPPER: "ds-chat-bubble",
|
|
62
|
+
HEADER_LEFT: "chat-bubble-title",
|
|
63
|
+
BODY_WRAPPER: "chat-bubble-body",
|
|
64
|
+
HEADER_RIGHT: "chat-bubble-time",
|
|
65
|
+
ERROR_MESSAGE: "chat-bubble-error-message",
|
|
66
|
+
HELP_MESSAGE: "chat-bubble-help-message"
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;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,OAAG,0CAAwB,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/cjs/index.js
CHANGED
|
@@ -29,15 +29,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
30
|
var index_exports = {};
|
|
31
31
|
__export(index_exports, {
|
|
32
|
-
BUBBLE_TYPES: () =>
|
|
32
|
+
BUBBLE_TYPES: () => import_constants.BUBBLE_TYPES,
|
|
33
|
+
CHAT_BUBBLE_DATA_TESTID: () => import_constants.CHAT_BUBBLE_DATA_TESTID,
|
|
34
|
+
CHAT_BUBBLE_SLOTS: () => import_constants.CHAT_BUBBLE_SLOTS,
|
|
33
35
|
ChatBubble: () => import_ChatBubble.ChatBubble,
|
|
34
|
-
ChatBubbleDataTestIds: () =>
|
|
35
|
-
ChatBubbleWithSchema: () => import_ChatBubble.ChatBubbleWithSchema
|
|
36
|
+
ChatBubbleDataTestIds: () => import_constants.CHAT_BUBBLE_DATA_TESTID,
|
|
37
|
+
ChatBubbleWithSchema: () => import_ChatBubble.ChatBubbleWithSchema,
|
|
38
|
+
DSChatBubbleName: () => import_constants.DSChatBubbleName
|
|
36
39
|
});
|
|
37
40
|
module.exports = __toCommonJS(index_exports);
|
|
38
41
|
var React = __toESM(require("react"));
|
|
39
42
|
var import_ChatBubble = require("./ChatBubble.js");
|
|
40
|
-
var
|
|
41
|
-
var import_ChatBubbleDataTestIds = require("./ChatBubbleDataTestIds.js");
|
|
43
|
+
var import_constants = require("./constants/index.js");
|
|
42
44
|
__reExport(index_exports, require("./styled.js"), module.exports);
|
|
43
45
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { ChatBubble, ChatBubbleWithSchema } from './ChatBubble.js';\nexport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAiD;
|
|
4
|
+
"sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAiD;AAEjD,uBAMO;AACP,0BAAc,wBATd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,40 +28,37 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var react_desc_prop_types_exports = {};
|
|
30
30
|
__export(react_desc_prop_types_exports, {
|
|
31
|
-
BUBBLE_TYPES: () => BUBBLE_TYPES,
|
|
32
31
|
BubblePropTypes: () => BubblePropTypes,
|
|
33
32
|
defaultProps: () => defaultProps,
|
|
34
33
|
propsArrowBubble: () => propsArrowBubble
|
|
35
34
|
});
|
|
36
35
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
37
36
|
var React = __toESM(require("react"));
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
SENDER: "SENDER",
|
|
41
|
-
RECIPIENT: "RECIPIENT",
|
|
42
|
-
DELIMITER: "DELIMITER",
|
|
43
|
-
SYSTEM: "SYSTEM"
|
|
44
|
-
};
|
|
37
|
+
var import_ds_props_helpers2 = require("@elliemae/ds-props-helpers");
|
|
38
|
+
var import_constants = require("./constants/index.js");
|
|
45
39
|
const defaultProps = {
|
|
46
|
-
type: BUBBLE_TYPES.SENDER,
|
|
40
|
+
type: import_constants.BUBBLE_TYPES.SENDER,
|
|
47
41
|
title: "",
|
|
48
42
|
body: "",
|
|
49
43
|
time: ""
|
|
50
44
|
};
|
|
51
45
|
const BubblePropTypes = {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
...(0, import_ds_props_helpers2.getPropsPerSlotPropTypes)(import_constants.DSChatBubbleName, import_constants.CHAT_BUBBLE_SLOTS),
|
|
47
|
+
...import_ds_props_helpers2.globalAttributesPropTypes,
|
|
48
|
+
...import_ds_props_helpers2.xstyledPropTypes,
|
|
49
|
+
dsId: import_ds_props_helpers2.PropTypes.oneOfType([import_ds_props_helpers2.PropTypes.string, import_ds_props_helpers2.PropTypes.number]).description("Unique id for bubble").defaultValue("a randomly generated (on mount) uid"),
|
|
50
|
+
type: import_ds_props_helpers2.PropTypes.oneOf([import_constants.BUBBLE_TYPES.RECIPIENT, import_constants.BUBBLE_TYPES.SENDER]).isRequired.description("Define bubble type ").defaultValue(defaultProps.type),
|
|
51
|
+
title: import_ds_props_helpers2.PropTypes.string.description("Title of the bubble"),
|
|
52
|
+
time: import_ds_props_helpers2.PropTypes.string.isRequired.description("Time of the bubble"),
|
|
53
|
+
body: import_ds_props_helpers2.PropTypes.oneOfType([import_ds_props_helpers2.PropTypes.string, import_ds_props_helpers2.PropTypes.element]).isRequired.description("Bubble content"),
|
|
54
|
+
errorMessage: import_ds_props_helpers2.PropTypes.oneOfType([import_ds_props_helpers2.PropTypes.string, import_ds_props_helpers2.PropTypes.element]).description(
|
|
58
55
|
"Error message to display at bottom of the bubble"
|
|
59
56
|
),
|
|
60
|
-
helpMessage:
|
|
57
|
+
helpMessage: import_ds_props_helpers2.PropTypes.oneOfType([import_ds_props_helpers2.PropTypes.string, import_ds_props_helpers2.PropTypes.element]).description(
|
|
61
58
|
"Help message to display at bottom of the bubble"
|
|
62
59
|
)
|
|
63
60
|
};
|
|
64
61
|
const propsArrowBubble = {
|
|
65
|
-
type:
|
|
62
|
+
type: import_ds_props_helpers2.PropTypes.oneOf([import_constants.BUBBLE_TYPES.RECIPIENT, import_constants.BUBBLE_TYPES.SENDER]).isRequired.defaultValue(defaultProps.type)
|
|
66
63
|
};
|
|
67
64
|
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import { type DSPropTypesSchema, type GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type React from 'react';\n\nimport { BUBBLE_TYPES, DSChatBubbleName, CHAT_BUBBLE_SLOTS } from './constants/index.js';\n\nexport declare namespace DSChatBubbleT {\n export type BubbleTypesKeys = keyof typeof BUBBLE_TYPES;\n\n export type BubbleTypesValues = (typeof BUBBLE_TYPES)[BubbleTypesKeys];\n\n export interface DefaultProps {\n type: BubbleTypesValues;\n title: string;\n body: string | React.ReactNode;\n time: string;\n }\n\n export interface OptionalProps {\n errorMessage?: string | React.ReactNode;\n helpMessage?: string | React.ReactNode;\n }\n\n export interface RequiredProps {\n dsId: string | number;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n RequiredProps {}\n}\n\nexport const defaultProps: DSChatBubbleT.DefaultProps = {\n type: BUBBLE_TYPES.SENDER,\n title: '',\n body: '',\n time: '',\n};\n\nexport const BubblePropTypes: DSPropTypesSchema<DSChatBubbleT.Props> = {\n ...getPropsPerSlotPropTypes(DSChatBubbleName, CHAT_BUBBLE_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n dsId: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n .description('Unique id for bubble')\n .defaultValue('a randomly generated (on mount) uid'),\n type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER])\n .isRequired.description('Define bubble type ')\n .defaultValue(defaultProps.type),\n title: PropTypes.string.description('Title of the bubble'),\n time: PropTypes.string.isRequired.description('Time of the bubble'),\n body: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired.description('Bubble content'),\n errorMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description(\n 'Error message to display at bottom of the bubble',\n ),\n helpMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description(\n 'Help message to display at bottom of the bubble',\n ),\n};\n\nexport const propsArrowBubble = {\n type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.defaultValue(defaultProps.type),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,IAAAA,2BAKO;AAGP,uBAAkE;AAoC3D,MAAM,eAA2C;AAAA,EACtD,MAAM,8BAAa;AAAA,EACnB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEO,MAAM,kBAA0D;AAAA,EACrE,OAAG,mDAAyB,mCAAkB,kCAAiB;AAAA,EAC/D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,mCAAU,UAAU,CAAC,mCAAU,QAAQ,mCAAU,MAAM,CAAC,EAC3D,YAAY,sBAAsB,EAClC,aAAa,qCAAqC;AAAA,EACrD,MAAM,mCAAU,MAAM,CAAC,8BAAa,WAAW,8BAAa,MAAM,CAAC,EAChE,WAAW,YAAY,qBAAqB,EAC5C,aAAa,aAAa,IAAI;AAAA,EACjC,OAAO,mCAAU,OAAO,YAAY,qBAAqB;AAAA,EACzD,MAAM,mCAAU,OAAO,WAAW,YAAY,oBAAoB;AAAA,EAClE,MAAM,mCAAU,UAAU,CAAC,mCAAU,QAAQ,mCAAU,OAAO,CAAC,EAAE,WAAW,YAAY,gBAAgB;AAAA,EACxG,cAAc,mCAAU,UAAU,CAAC,mCAAU,QAAQ,mCAAU,OAAO,CAAC,EAAE;AAAA,IACvE;AAAA,EACF;AAAA,EACA,aAAa,mCAAU,UAAU,CAAC,mCAAU,QAAQ,mCAAU,OAAO,CAAC,EAAE;AAAA,IACtE;AAAA,EACF;AACF;AAEO,MAAM,mBAAmB;AAAA,EAC9B,MAAM,mCAAU,MAAM,CAAC,8BAAa,WAAW,8BAAa,MAAM,CAAC,EAAE,WAAW,aAAa,aAAa,IAAI;AAChH;",
|
|
6
|
+
"names": ["import_ds_props_helpers"]
|
|
7
7
|
}
|