@elliemae/ds-chat-bubble 3.27.0-next.2 → 3.27.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ChatBubble.js +12 -9
- package/dist/cjs/ChatBubble.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +17 -19
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/typescript-testing/typescript-chat-bubble-valid.js +109 -0
- package/dist/cjs/typescript-testing/typescript-chat-bubble-valid.js.map +7 -0
- package/dist/esm/ChatBubble.js +13 -10
- package/dist/esm/ChatBubble.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +17 -19
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/typescript-chat-bubble-valid.js +86 -0
- package/dist/esm/typescript-testing/typescript-chat-bubble-valid.js.map +7 -0
- package/dist/types/react-desc-prop-types.d.ts +19 -11
- package/dist/types/typescript-testing/typescript-chat-bubble-valid.d.ts +1 -0
- package/package.json +7 -7
package/dist/cjs/ChatBubble.js
CHANGED
|
@@ -46,16 +46,19 @@ var import_DSChatBubbleDefinitions = require("./DSChatBubbleDefinitions.js");
|
|
|
46
46
|
const ChatBubble = (props) => {
|
|
47
47
|
const defaultPropsIncludingInstanciatedValues = import_react.default.useMemo(() => {
|
|
48
48
|
const dsId2 = props.dsId || `ds-chat-bubble-${(0, import_uid.uid)(9)}`;
|
|
49
|
-
return { ...import_react_desc_prop_types.
|
|
49
|
+
return { ...import_react_desc_prop_types.defaultProps, dsId: dsId2 };
|
|
50
50
|
}, [props.dsId]);
|
|
51
|
-
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(
|
|
52
|
-
|
|
51
|
+
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(
|
|
52
|
+
props,
|
|
53
|
+
defaultPropsIncludingInstanciatedValues
|
|
54
|
+
);
|
|
55
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.BubblePropTypes, import_DSChatBubbleDefinitions.DSChatBubbleName);
|
|
53
56
|
const { dsId, type, title, time, body, errorMessage, helpMessage } = propsWithDefault;
|
|
54
57
|
const bodyParts = import_react.default.useMemo(() => typeof body === "string" ? body.split("\n") : [body], [body]);
|
|
55
58
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledWrapper, { "data-testid": `${import_ChatBubbleDataTestIds.ChatBubbleDataTestIds.BUBBLE}-${dsId}`, children: [
|
|
56
59
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledColoredBubble, { type, children: [
|
|
57
60
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledTitleBubble, { cols: ["1fr", "auto"], gutter: "xs", alignItems: "flex-end", className: "sr-only", children: [
|
|
58
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledTitleLeftBubble, {
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledTitleLeftBubble, { "data-testid": `${import_ChatBubbleDataTestIds.ChatBubbleDataTestIds.BUBBLE_TITLE}-${dsId}`, children: title }),
|
|
59
62
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
63
|
import_styled.StyledTitleRightBubble,
|
|
61
64
|
{
|
|
@@ -69,18 +72,18 @@ const ChatBubble = (props) => {
|
|
|
69
72
|
/* @__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: [
|
|
70
73
|
item,
|
|
71
74
|
index < bodyParts.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}) : null
|
|
72
|
-
] },
|
|
75
|
+
] }, `body-fragment-${index}-${dsId}`)) }),
|
|
73
76
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ChatBubbleArrow.ChatBubbleArrow, { type, dsId })
|
|
74
77
|
] }),
|
|
75
|
-
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyleErrorMessage, { "data-testid": `chat-bubble-error-message-${dsId}`,
|
|
78
|
+
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyleErrorMessage, { "data-testid": `chat-bubble-error-message-${dsId}`, children: [
|
|
76
79
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: errorMessage }),
|
|
77
80
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.WarningCircleFill, {})
|
|
78
81
|
] }) : null,
|
|
79
|
-
helpMessage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleHelpMessage, { "data-testid": `chat-bubble-help-message-${dsId}`,
|
|
82
|
+
helpMessage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyleHelpMessage, { "data-testid": `chat-bubble-help-message-${dsId}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: helpMessage }) }) : null
|
|
80
83
|
] });
|
|
81
84
|
};
|
|
82
|
-
ChatBubble.propTypes = import_react_desc_prop_types.
|
|
85
|
+
ChatBubble.propTypes = import_react_desc_prop_types.BubblePropTypes;
|
|
83
86
|
ChatBubble.displayName = import_DSChatBubbleDefinitions.DSChatBubbleName;
|
|
84
87
|
const ChatBubbleWithSchema = (0, import_ds_props_helpers.describe)(ChatBubble);
|
|
85
|
-
ChatBubbleWithSchema.propTypes = import_react_desc_prop_types.
|
|
88
|
+
ChatBubbleWithSchema.propTypes = import_react_desc_prop_types.BubblePropTypes;
|
|
86
89
|
//# 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 { 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 {
|
|
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 { 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 { ChatBubbleDataTestIds } from './ChatBubbleDataTestIds.js';\nimport { DSChatBubbleName } from './DSChatBubbleDefinitions.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 data-testid={`${ChatBubbleDataTestIds.BUBBLE}-${dsId}`}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble cols={['1fr', 'auto']} gutter=\"xs\" alignItems=\"flex-end\" className=\"sr-only\">\n <StyledTitleLeftBubble 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={`body-fragment-${index}-${dsId}`}>\n {item}\n {index < bodyParts.length - 1 ? <br /> : null}\n </React.Fragment>\n ))}\n </StyleBodyWrapper>\n <ChatBubbleArrow type={type} dsId={dsId} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage data-testid={`chat-bubble-error-message-${dsId}`}>\n <span>{errorMessage}</span>\n <WarningCircleFill />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage data-testid={`chat-bubble-help-message-${dsId}`}>\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\n\nChatBubble.propTypes = BubblePropTypes;\nChatBubble.displayName = DSChatBubbleName;\nconst ChatBubbleWithSchema = describe(ChatBubble);\nChatBubbleWithSchema.propTypes = BubblePropTypes;\n\nexport { ChatBubble, ChatBubbleWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmCf;AAnCR,mBAAkB;AAClB,8BAAuF;AACvF,sBAAkC;AAClC,iBAAoB;AACpB,oBASO;AACP,mCAAkE;AAClE,6BAAgC;AAChC,mCAAsC;AACtC,qCAAiC;AAEjC,MAAM,aAAuD,CAAC,UAAU;AACtE,QAAM,0CAA0C,aAAAA,QAAM,QAAQ,MAAM;AAClE,UAAMC,QAAO,MAAM,QAAQ,sBAAkB,gBAAI,CAAC;AAClD,WAAO,EAAE,GAAG,2CAAc,MAAAA,MAAK;AAAA,EACjC,GAAG,CAAC,MAAM,IAAI,CAAC;AACf,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,8DAA+B,kBAAkB,8CAAiB,+CAAgB;AAElF,QAAM,EAAE,MAAM,MAAM,OAAO,MAAM,MAAM,cAAc,YAAY,IAAI;AACrE,QAAM,YAAY,aAAAD,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,eAAa,GAAG,mDAAsB,gBAAgB,QAC1E,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,iBAAiB,SAAS,MAG/C,CACD,GACH;AAAA,MACA,4CAAC,0CAAgB,MAAY,MAAY;AAAA,OAC3C;AAAA,IACC,eACC,6CAAC,mCAAkB,eAAa,6BAA6B,QAC3D;AAAA,kDAAC,UAAM,wBAAa;AAAA,MACpB,4CAAC,qCAAkB;AAAA,OACrB,IACE;AAAA,IACH,cACC,4CAAC,kCAAiB,eAAa,4BAA4B,QACzD,sDAAC,UAAM,uBAAY,GACrB,IACE;AAAA,KACN;AAEJ;AAEA,WAAW,YAAY;AACvB,WAAW,cAAc;AACzB,MAAM,2BAAuB,kCAAS,UAAU;AAChD,qBAAqB,YAAY;",
|
|
6
6
|
"names": ["React", "dsId"]
|
|
7
7
|
}
|
|
@@ -29,41 +29,39 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var react_desc_prop_types_exports = {};
|
|
30
30
|
__export(react_desc_prop_types_exports, {
|
|
31
31
|
BUBBLE_TYPES: () => BUBBLE_TYPES,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
BubblePropTypes: () => BubblePropTypes,
|
|
33
|
+
defaultProps: () => defaultProps,
|
|
34
34
|
propsArrowBubble: () => propsArrowBubble
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
37
37
|
var React = __toESM(require("react"));
|
|
38
38
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
|
-
function noop(..._args) {
|
|
40
|
-
}
|
|
41
39
|
const BUBBLE_TYPES = {
|
|
42
40
|
SENDER: "SENDER",
|
|
43
41
|
RECIPIENT: "RECIPIENT",
|
|
44
42
|
DELIMITER: "DELIMITER",
|
|
45
43
|
SYSTEM: "SYSTEM"
|
|
46
44
|
};
|
|
47
|
-
const
|
|
48
|
-
dsId: "",
|
|
45
|
+
const defaultProps = {
|
|
49
46
|
type: BUBBLE_TYPES.SENDER,
|
|
50
|
-
|
|
47
|
+
title: "",
|
|
51
48
|
body: "",
|
|
52
|
-
|
|
53
|
-
errorMessage: "",
|
|
54
|
-
helpMessage: ""
|
|
49
|
+
time: ""
|
|
55
50
|
};
|
|
56
|
-
const
|
|
51
|
+
const BubblePropTypes = {
|
|
57
52
|
dsId: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.string, import_ds_props_helpers.PropTypes.number]).description("Unique id for bubble").defaultValue("a randomly generated (on mount) uid"),
|
|
58
|
-
type: import_ds_props_helpers.PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.description("Define bubble type ").defaultValue(
|
|
59
|
-
title: import_ds_props_helpers.PropTypes.string.description("Title of the bubble")
|
|
60
|
-
time: import_ds_props_helpers.PropTypes.string.isRequired.description("Time of the bubble")
|
|
61
|
-
body: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.string, import_ds_props_helpers.PropTypes.element]).isRequired.description("Bubble content")
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
type: import_ds_props_helpers.PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.description("Define bubble type ").defaultValue(defaultProps.type),
|
|
54
|
+
title: import_ds_props_helpers.PropTypes.string.description("Title of the bubble"),
|
|
55
|
+
time: import_ds_props_helpers.PropTypes.string.isRequired.description("Time of the bubble"),
|
|
56
|
+
body: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.string, import_ds_props_helpers.PropTypes.element]).isRequired.description("Bubble content"),
|
|
57
|
+
errorMessage: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.string, import_ds_props_helpers.PropTypes.element]).description(
|
|
58
|
+
"Error message to display at bottom of the bubble"
|
|
59
|
+
),
|
|
60
|
+
helpMessage: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.string, import_ds_props_helpers.PropTypes.element]).description(
|
|
61
|
+
"Help message to display at bottom of the bubble"
|
|
62
|
+
)
|
|
65
63
|
};
|
|
66
64
|
const propsArrowBubble = {
|
|
67
|
-
type: import_ds_props_helpers.PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.defaultValue(
|
|
65
|
+
type: import_ds_props_helpers.PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.defaultValue(defaultProps.type)
|
|
68
66
|
};
|
|
69
67
|
//# 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 { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport type React from 'react';\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA0B;
|
|
4
|
+
"sourcesContent": ["import { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport type React from 'react';\n\nexport const BUBBLE_TYPES = {\n SENDER: 'SENDER',\n RECIPIENT: 'RECIPIENT',\n DELIMITER: 'DELIMITER',\n SYSTEM: 'SYSTEM',\n};\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 = {\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} as WeakValidationMap<unknown>;\n\nexport const propsArrowBubble = {\n type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.defaultValue(defaultProps.type),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA0B;AAKnB,MAAM,eAAe;AAAA,EAC1B,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,WAAW;AAAA,EACX,QAAQ;AACV;AAoCO,MAAM,eAA2C;AAAA,EACtD,MAAM,aAAa;AAAA,EACnB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEO,MAAM,kBAAkB;AAAA,EAC7B,MAAM,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,EAC3D,YAAY,sBAAsB,EAClC,aAAa,qCAAqC;AAAA,EACrD,MAAM,kCAAU,MAAM,CAAC,aAAa,WAAW,aAAa,MAAM,CAAC,EAChE,WAAW,YAAY,qBAAqB,EAC5C,aAAa,aAAa,IAAI;AAAA,EACjC,OAAO,kCAAU,OAAO,YAAY,qBAAqB;AAAA,EACzD,MAAM,kCAAU,OAAO,WAAW,YAAY,oBAAoB;AAAA,EAClE,MAAM,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,OAAO,CAAC,EAAE,WAAW,YAAY,gBAAgB;AAAA,EACxG,cAAc,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,OAAO,CAAC,EAAE;AAAA,IACvE;AAAA,EACF;AAAA,EACA,aAAa,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,OAAO,CAAC,EAAE;AAAA,IACtE;AAAA,EACF;AACF;AAEO,MAAM,mBAAmB;AAAA,EAC9B,MAAM,kCAAU,MAAM,CAAC,aAAa,WAAW,aAAa,MAAM,CAAC,EAAE,WAAW,aAAa,aAAa,IAAI;AAChH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import__ = require("../index.js");
|
|
27
|
+
const testRequiredProps = {
|
|
28
|
+
dsId: ""
|
|
29
|
+
};
|
|
30
|
+
const testOptionalProps = {
|
|
31
|
+
errorMessage: "an error occurred",
|
|
32
|
+
helpMessage: "delivered"
|
|
33
|
+
};
|
|
34
|
+
const testPartialDefaults = {
|
|
35
|
+
type: import__.BUBBLE_TYPES.SENDER,
|
|
36
|
+
time: "4:50pm"
|
|
37
|
+
};
|
|
38
|
+
const testProps = {
|
|
39
|
+
...testRequiredProps,
|
|
40
|
+
...testOptionalProps,
|
|
41
|
+
...testPartialDefaults
|
|
42
|
+
};
|
|
43
|
+
const testPropsAsSyntax = {
|
|
44
|
+
...testRequiredProps,
|
|
45
|
+
...testOptionalProps,
|
|
46
|
+
...testPartialDefaults
|
|
47
|
+
};
|
|
48
|
+
const testCompleteDefaults = {
|
|
49
|
+
type: import__.BUBBLE_TYPES.SENDER,
|
|
50
|
+
title: "Title",
|
|
51
|
+
body: "sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec",
|
|
52
|
+
time: "4:50pm"
|
|
53
|
+
};
|
|
54
|
+
const testInternalProps = {
|
|
55
|
+
...testRequiredProps,
|
|
56
|
+
...testOptionalProps,
|
|
57
|
+
...testCompleteDefaults
|
|
58
|
+
};
|
|
59
|
+
const testInternalPropsAsSyntax = {
|
|
60
|
+
...testRequiredProps,
|
|
61
|
+
...testOptionalProps,
|
|
62
|
+
...testCompleteDefaults
|
|
63
|
+
};
|
|
64
|
+
const testExplicitDefinition = {
|
|
65
|
+
dsId: "1",
|
|
66
|
+
type: import__.BUBBLE_TYPES.SENDER,
|
|
67
|
+
title: "Title",
|
|
68
|
+
body: "sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec",
|
|
69
|
+
time: "4:50pm"
|
|
70
|
+
};
|
|
71
|
+
const testInferedTypeCompatibility = {
|
|
72
|
+
dsId: "2",
|
|
73
|
+
type: import__.BUBBLE_TYPES.SENDER,
|
|
74
|
+
title: "Title",
|
|
75
|
+
body: "sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec",
|
|
76
|
+
time: "4:50pm"
|
|
77
|
+
};
|
|
78
|
+
const testDefinitionAsConst = {
|
|
79
|
+
dsId: "3",
|
|
80
|
+
type: import__.BUBBLE_TYPES.SENDER,
|
|
81
|
+
title: "Title",
|
|
82
|
+
body: "sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec",
|
|
83
|
+
time: "4:50pm"
|
|
84
|
+
};
|
|
85
|
+
const onSingleValueChange = (value) => {
|
|
86
|
+
};
|
|
87
|
+
const onMultipleValueChange = (value) => {
|
|
88
|
+
};
|
|
89
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ChatBubble, { ...testExplicitDefinition }),
|
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ChatBubble, { ...testInferedTypeCompatibility }),
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.ChatBubble, { ...testDefinitionAsConst }),
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
|
+
import__.ChatBubble,
|
|
95
|
+
{
|
|
96
|
+
type: import__.BUBBLE_TYPES.RECIPIENT,
|
|
97
|
+
dsId: "9999",
|
|
98
|
+
title: "Amanda Yates",
|
|
99
|
+
time: "4:50pm",
|
|
100
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
101
|
+
"Text body with links",
|
|
102
|
+
" ",
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { href: "http://google.com", target: "_blank", children: "Website" })
|
|
104
|
+
] }),
|
|
105
|
+
helpMessage: "delivered"
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
] });
|
|
109
|
+
//# sourceMappingURL=typescript-chat-bubble-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-chat-bubble-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { BUBBLE_TYPES, ChatBubble } from '../index.js';\nimport type { DSChatBubbleT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSChatBubbleT.Props;\ntype ComponentPropsInternals = DSChatBubbleT.InternalProps;\ntype ComponentPropsDefaultProps = DSChatBubbleT.DefaultProps;\ntype ComponentPropsOptionalProps = DSChatBubbleT.OptionalProps;\ntype ComponentPropsRequiredProps = DSChatBubbleT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n dsId: '',\n};\nconst testOptionalProps: ComponentPropsOptionalProps = {\n errorMessage: 'an error occurred',\n helpMessage: 'delivered',\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n type: BUBBLE_TYPES.SENDER,\n time: '4:50pm',\n};\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n type: BUBBLE_TYPES.SENDER,\n title: 'Title',\n body: 'sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec',\n time: '4:50pm',\n};\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n dsId: '1',\n type: BUBBLE_TYPES.SENDER,\n title: 'Title',\n body: 'sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec',\n time: '4:50pm',\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n dsId: '2',\n type: BUBBLE_TYPES.SENDER,\n title: 'Title',\n body: 'sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec',\n time: '4:50pm',\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n dsId: '3',\n type: BUBBLE_TYPES.SENDER,\n title: 'Title',\n body: 'sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec',\n time: '4:50pm',\n} as const;\n\nconst onSingleValueChange = (value: number) => {};\nconst onMultipleValueChange = (value: [number, number]) => {};\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <ChatBubble {...testExplicitDefinition} />\n <ChatBubble {...testInferedTypeCompatibility} />\n <ChatBubble {...testDefinitionAsConst} />\n {/* works with inline values */}\n <ChatBubble\n type={BUBBLE_TYPES.RECIPIENT}\n dsId=\"9999\"\n title=\"Amanda Yates\"\n time=\"4:50pm\"\n body={\n <>\n Text body with links{' '}\n <a href=\"http://google.com\" target=\"_blank\">\n Website\n </a>\n </>\n }\n helpMessage=\"delivered\"\n />\n </>\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACqFnB;AApFJ,eAAyC;AAUzC,MAAM,oBAAiD;AAAA,EACrD,MAAM;AACR;AACA,MAAM,oBAAiD;AAAA,EACrD,cAAc;AAAA,EACd,aAAa;AACf;AAIA,MAAM,sBAA2D;AAAA,EAC/D,MAAM,sBAAa;AAAA,EACnB,MAAM;AACR;AACA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,uBAA6D;AAAA,EACjE,MAAM,sBAAa;AAAA,EACnB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AACA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,sBAAa;AAAA,EACnB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAGA,MAAM,+BAA+B;AAAA,EACnC,MAAM;AAAA,EACN,MAAM,sBAAa;AAAA,EACnB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,wBAAwB;AAAA,EAC5B,MAAM;AAAA,EACN,MAAM,sBAAa;AAAA,EACnB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,sBAAsB,CAAC,UAAkB;AAAC;AAChD,MAAM,wBAAwB,CAAC,UAA4B;AAAC;AAE5D,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,uBAAY,GAAG,wBAAwB;AAAA,EACxC,4CAAC,uBAAY,GAAG,8BAA8B;AAAA,EAC9C,4CAAC,uBAAY,GAAG,uBAAuB;AAAA,EAEvC;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,sBAAa;AAAA,MACnB,MAAK;AAAA,MACL,OAAM;AAAA,MACN,MAAK;AAAA,MACL,MACE,4EAAE;AAAA;AAAA,QACqB;AAAA,QACrB,4CAAC,OAAE,MAAK,qBAAoB,QAAO,UAAS,qBAE5C;AAAA,SACF;AAAA,MAEF,aAAY;AAAA;AAAA,EACd;AAAA,GACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/ChatBubble.js
CHANGED
|
@@ -14,23 +14,26 @@ import {
|
|
|
14
14
|
StyleErrorMessage,
|
|
15
15
|
StyleHelpMessage
|
|
16
16
|
} from "./styled.js";
|
|
17
|
-
import {
|
|
17
|
+
import { BubblePropTypes, defaultProps } from "./react-desc-prop-types.js";
|
|
18
18
|
import { ChatBubbleArrow } from "./ChatBubbleArrow.js";
|
|
19
19
|
import { ChatBubbleDataTestIds } from "./ChatBubbleDataTestIds.js";
|
|
20
20
|
import { DSChatBubbleName } from "./DSChatBubbleDefinitions.js";
|
|
21
21
|
const ChatBubble = (props) => {
|
|
22
22
|
const defaultPropsIncludingInstanciatedValues = React2.useMemo(() => {
|
|
23
23
|
const dsId2 = props.dsId || `ds-chat-bubble-${uid(9)}`;
|
|
24
|
-
return { ...
|
|
24
|
+
return { ...defaultProps, dsId: dsId2 };
|
|
25
25
|
}, [props.dsId]);
|
|
26
|
-
const propsWithDefault = useMemoMergePropsWithDefault(
|
|
27
|
-
|
|
26
|
+
const propsWithDefault = useMemoMergePropsWithDefault(
|
|
27
|
+
props,
|
|
28
|
+
defaultPropsIncludingInstanciatedValues
|
|
29
|
+
);
|
|
30
|
+
useValidateTypescriptPropTypes(propsWithDefault, BubblePropTypes, DSChatBubbleName);
|
|
28
31
|
const { dsId, type, title, time, body, errorMessage, helpMessage } = propsWithDefault;
|
|
29
32
|
const bodyParts = React2.useMemo(() => typeof body === "string" ? body.split("\n") : [body], [body]);
|
|
30
33
|
return /* @__PURE__ */ jsxs(StyledWrapper, { "data-testid": `${ChatBubbleDataTestIds.BUBBLE}-${dsId}`, children: [
|
|
31
34
|
/* @__PURE__ */ jsxs(StyledColoredBubble, { type, children: [
|
|
32
35
|
/* @__PURE__ */ jsxs(StyledTitleBubble, { cols: ["1fr", "auto"], gutter: "xs", alignItems: "flex-end", className: "sr-only", children: [
|
|
33
|
-
/* @__PURE__ */ jsx(StyledTitleLeftBubble, {
|
|
36
|
+
/* @__PURE__ */ jsx(StyledTitleLeftBubble, { "data-testid": `${ChatBubbleDataTestIds.BUBBLE_TITLE}-${dsId}`, children: title }),
|
|
34
37
|
/* @__PURE__ */ jsx(
|
|
35
38
|
StyledTitleRightBubble,
|
|
36
39
|
{
|
|
@@ -44,20 +47,20 @@ const ChatBubble = (props) => {
|
|
|
44
47
|
/* @__PURE__ */ jsx(StyleBodyWrapper, { "data-testid": `chat-bubble-body-${dsId}`, children: bodyParts.map((item, index) => /* @__PURE__ */ jsxs(React2.Fragment, { children: [
|
|
45
48
|
item,
|
|
46
49
|
index < bodyParts.length - 1 ? /* @__PURE__ */ jsx("br", {}) : null
|
|
47
|
-
] },
|
|
50
|
+
] }, `body-fragment-${index}-${dsId}`)) }),
|
|
48
51
|
/* @__PURE__ */ jsx(ChatBubbleArrow, { type, dsId })
|
|
49
52
|
] }),
|
|
50
|
-
errorMessage ? /* @__PURE__ */ jsxs(StyleErrorMessage, { "data-testid": `chat-bubble-error-message-${dsId}`,
|
|
53
|
+
errorMessage ? /* @__PURE__ */ jsxs(StyleErrorMessage, { "data-testid": `chat-bubble-error-message-${dsId}`, children: [
|
|
51
54
|
/* @__PURE__ */ jsx("span", { children: errorMessage }),
|
|
52
55
|
/* @__PURE__ */ jsx(WarningCircleFill, {})
|
|
53
56
|
] }) : null,
|
|
54
|
-
helpMessage ? /* @__PURE__ */ jsx(StyleHelpMessage, { "data-testid": `chat-bubble-help-message-${dsId}`,
|
|
57
|
+
helpMessage ? /* @__PURE__ */ jsx(StyleHelpMessage, { "data-testid": `chat-bubble-help-message-${dsId}`, children: /* @__PURE__ */ jsx("span", { children: helpMessage }) }) : null
|
|
55
58
|
] });
|
|
56
59
|
};
|
|
57
|
-
ChatBubble.propTypes =
|
|
60
|
+
ChatBubble.propTypes = BubblePropTypes;
|
|
58
61
|
ChatBubble.displayName = DSChatBubbleName;
|
|
59
62
|
const ChatBubbleWithSchema = describe(ChatBubble);
|
|
60
|
-
ChatBubbleWithSchema.propTypes =
|
|
63
|
+
ChatBubbleWithSchema.propTypes = BubblePropTypes;
|
|
61
64
|
export {
|
|
62
65
|
ChatBubble,
|
|
63
66
|
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 { 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 {
|
|
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 { 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 { ChatBubbleDataTestIds } from './ChatBubbleDataTestIds.js';\nimport { DSChatBubbleName } from './DSChatBubbleDefinitions.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 data-testid={`${ChatBubbleDataTestIds.BUBBLE}-${dsId}`}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble cols={['1fr', 'auto']} gutter=\"xs\" alignItems=\"flex-end\" className=\"sr-only\">\n <StyledTitleLeftBubble 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={`body-fragment-${index}-${dsId}`}>\n {item}\n {index < bodyParts.length - 1 ? <br /> : null}\n </React.Fragment>\n ))}\n </StyleBodyWrapper>\n <ChatBubbleArrow type={type} dsId={dsId} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage data-testid={`chat-bubble-error-message-${dsId}`}>\n <span>{errorMessage}</span>\n <WarningCircleFill />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage data-testid={`chat-bubble-help-message-${dsId}`}>\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\n\nChatBubble.propTypes = BubblePropTypes;\nChatBubble.displayName = DSChatBubbleName;\nconst ChatBubbleWithSchema = describe(ChatBubble);\nChatBubbleWithSchema.propTypes = BubblePropTypes;\n\nexport { ChatBubble, ChatBubbleWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmCf,SACE,KADF;AAnCR,OAAOA,YAAW;AAClB,SAAS,UAAU,gCAAgC,oCAAoC;AACvF,SAAS,yBAAyB;AAClC,SAAS,WAAW;AACpB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAqC,oBAAoB;AAClE,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AAEjC,MAAM,aAAuD,CAAC,UAAU;AACtE,QAAM,0CAA0CA,OAAM,QAAQ,MAAM;AAClE,UAAMC,QAAO,MAAM,QAAQ,kBAAkB,IAAI,CAAC;AAClD,WAAO,EAAE,GAAG,cAAc,MAAAA,MAAK;AAAA,EACjC,GAAG,CAAC,MAAM,IAAI,CAAC;AACf,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,iCAA+B,kBAAkB,iBAAiB,gBAAgB;AAElF,QAAM,EAAE,MAAM,MAAM,OAAO,MAAM,MAAM,cAAc,YAAY,IAAI;AACrE,QAAM,YAAYD,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,eAAa,GAAG,sBAAsB,gBAAgB,QAC1E,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,iBAAiB,SAAS,MAG/C,CACD,GACH;AAAA,MACA,oBAAC,mBAAgB,MAAY,MAAY;AAAA,OAC3C;AAAA,IACC,eACC,qBAAC,qBAAkB,eAAa,6BAA6B,QAC3D;AAAA,0BAAC,UAAM,wBAAa;AAAA,MACpB,oBAAC,qBAAkB;AAAA,OACrB,IACE;AAAA,IACH,cACC,oBAAC,oBAAiB,eAAa,4BAA4B,QACzD,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", "dsId"]
|
|
7
7
|
}
|
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
-
function noop(..._args) {
|
|
4
|
-
}
|
|
5
3
|
const BUBBLE_TYPES = {
|
|
6
4
|
SENDER: "SENDER",
|
|
7
5
|
RECIPIENT: "RECIPIENT",
|
|
8
6
|
DELIMITER: "DELIMITER",
|
|
9
7
|
SYSTEM: "SYSTEM"
|
|
10
8
|
};
|
|
11
|
-
const
|
|
12
|
-
dsId: "",
|
|
9
|
+
const defaultProps = {
|
|
13
10
|
type: BUBBLE_TYPES.SENDER,
|
|
14
|
-
|
|
11
|
+
title: "",
|
|
15
12
|
body: "",
|
|
16
|
-
|
|
17
|
-
errorMessage: "",
|
|
18
|
-
helpMessage: ""
|
|
13
|
+
time: ""
|
|
19
14
|
};
|
|
20
|
-
const
|
|
15
|
+
const BubblePropTypes = {
|
|
21
16
|
dsId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description("Unique id for bubble").defaultValue("a randomly generated (on mount) uid"),
|
|
22
|
-
type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.description("Define bubble type ").defaultValue(
|
|
23
|
-
title: PropTypes.string.description("Title of the bubble")
|
|
24
|
-
time: PropTypes.string.isRequired.description("Time of the bubble")
|
|
25
|
-
body: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired.description("Bubble content")
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.description("Define bubble type ").defaultValue(defaultProps.type),
|
|
18
|
+
title: PropTypes.string.description("Title of the bubble"),
|
|
19
|
+
time: PropTypes.string.isRequired.description("Time of the bubble"),
|
|
20
|
+
body: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired.description("Bubble content"),
|
|
21
|
+
errorMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description(
|
|
22
|
+
"Error message to display at bottom of the bubble"
|
|
23
|
+
),
|
|
24
|
+
helpMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description(
|
|
25
|
+
"Help message to display at bottom of the bubble"
|
|
26
|
+
)
|
|
29
27
|
};
|
|
30
28
|
const propsArrowBubble = {
|
|
31
|
-
type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.defaultValue(
|
|
29
|
+
type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.defaultValue(defaultProps.type)
|
|
32
30
|
};
|
|
33
31
|
export {
|
|
34
32
|
BUBBLE_TYPES,
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
BubblePropTypes,
|
|
34
|
+
defaultProps,
|
|
37
35
|
propsArrowBubble
|
|
38
36
|
};
|
|
39
37
|
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport type React from 'react';\n\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport type React from 'react';\n\nexport const BUBBLE_TYPES = {\n SENDER: 'SENDER',\n RECIPIENT: 'RECIPIENT',\n DELIMITER: 'DELIMITER',\n SYSTEM: 'SYSTEM',\n};\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 = {\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} as WeakValidationMap<unknown>;\n\nexport const propsArrowBubble = {\n type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.defaultValue(defaultProps.type),\n} as WeakValidationMap<unknown>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAKnB,MAAM,eAAe;AAAA,EAC1B,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,WAAW;AAAA,EACX,QAAQ;AACV;AAoCO,MAAM,eAA2C;AAAA,EACtD,MAAM,aAAa;AAAA,EACnB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEO,MAAM,kBAAkB;AAAA,EAC7B,MAAM,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAC3D,YAAY,sBAAsB,EAClC,aAAa,qCAAqC;AAAA,EACrD,MAAM,UAAU,MAAM,CAAC,aAAa,WAAW,aAAa,MAAM,CAAC,EAChE,WAAW,YAAY,qBAAqB,EAC5C,aAAa,aAAa,IAAI;AAAA,EACjC,OAAO,UAAU,OAAO,YAAY,qBAAqB;AAAA,EACzD,MAAM,UAAU,OAAO,WAAW,YAAY,oBAAoB;AAAA,EAClE,MAAM,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,CAAC,EAAE,WAAW,YAAY,gBAAgB;AAAA,EACxG,cAAc,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,CAAC,EAAE;AAAA,IACvE;AAAA,EACF;AAAA,EACA,aAAa,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,CAAC,EAAE;AAAA,IACtE;AAAA,EACF;AACF;AAEO,MAAM,mBAAmB;AAAA,EAC9B,MAAM,UAAU,MAAM,CAAC,aAAa,WAAW,aAAa,MAAM,CAAC,EAAE,WAAW,aAAa,aAAa,IAAI;AAChH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { BUBBLE_TYPES, ChatBubble } from "../index.js";
|
|
4
|
+
const testRequiredProps = {
|
|
5
|
+
dsId: ""
|
|
6
|
+
};
|
|
7
|
+
const testOptionalProps = {
|
|
8
|
+
errorMessage: "an error occurred",
|
|
9
|
+
helpMessage: "delivered"
|
|
10
|
+
};
|
|
11
|
+
const testPartialDefaults = {
|
|
12
|
+
type: BUBBLE_TYPES.SENDER,
|
|
13
|
+
time: "4:50pm"
|
|
14
|
+
};
|
|
15
|
+
const testProps = {
|
|
16
|
+
...testRequiredProps,
|
|
17
|
+
...testOptionalProps,
|
|
18
|
+
...testPartialDefaults
|
|
19
|
+
};
|
|
20
|
+
const testPropsAsSyntax = {
|
|
21
|
+
...testRequiredProps,
|
|
22
|
+
...testOptionalProps,
|
|
23
|
+
...testPartialDefaults
|
|
24
|
+
};
|
|
25
|
+
const testCompleteDefaults = {
|
|
26
|
+
type: BUBBLE_TYPES.SENDER,
|
|
27
|
+
title: "Title",
|
|
28
|
+
body: "sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec",
|
|
29
|
+
time: "4:50pm"
|
|
30
|
+
};
|
|
31
|
+
const testInternalProps = {
|
|
32
|
+
...testRequiredProps,
|
|
33
|
+
...testOptionalProps,
|
|
34
|
+
...testCompleteDefaults
|
|
35
|
+
};
|
|
36
|
+
const testInternalPropsAsSyntax = {
|
|
37
|
+
...testRequiredProps,
|
|
38
|
+
...testOptionalProps,
|
|
39
|
+
...testCompleteDefaults
|
|
40
|
+
};
|
|
41
|
+
const testExplicitDefinition = {
|
|
42
|
+
dsId: "1",
|
|
43
|
+
type: BUBBLE_TYPES.SENDER,
|
|
44
|
+
title: "Title",
|
|
45
|
+
body: "sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec",
|
|
46
|
+
time: "4:50pm"
|
|
47
|
+
};
|
|
48
|
+
const testInferedTypeCompatibility = {
|
|
49
|
+
dsId: "2",
|
|
50
|
+
type: BUBBLE_TYPES.SENDER,
|
|
51
|
+
title: "Title",
|
|
52
|
+
body: "sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec",
|
|
53
|
+
time: "4:50pm"
|
|
54
|
+
};
|
|
55
|
+
const testDefinitionAsConst = {
|
|
56
|
+
dsId: "3",
|
|
57
|
+
type: BUBBLE_TYPES.SENDER,
|
|
58
|
+
title: "Title",
|
|
59
|
+
body: "sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec",
|
|
60
|
+
time: "4:50pm"
|
|
61
|
+
};
|
|
62
|
+
const onSingleValueChange = (value) => {
|
|
63
|
+
};
|
|
64
|
+
const onMultipleValueChange = (value) => {
|
|
65
|
+
};
|
|
66
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
67
|
+
/* @__PURE__ */ jsx(ChatBubble, { ...testExplicitDefinition }),
|
|
68
|
+
/* @__PURE__ */ jsx(ChatBubble, { ...testInferedTypeCompatibility }),
|
|
69
|
+
/* @__PURE__ */ jsx(ChatBubble, { ...testDefinitionAsConst }),
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
ChatBubble,
|
|
72
|
+
{
|
|
73
|
+
type: BUBBLE_TYPES.RECIPIENT,
|
|
74
|
+
dsId: "9999",
|
|
75
|
+
title: "Amanda Yates",
|
|
76
|
+
time: "4:50pm",
|
|
77
|
+
body: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
78
|
+
"Text body with links",
|
|
79
|
+
" ",
|
|
80
|
+
/* @__PURE__ */ jsx("a", { href: "http://google.com", target: "_blank", children: "Website" })
|
|
81
|
+
] }),
|
|
82
|
+
helpMessage: "delivered"
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] });
|
|
86
|
+
//# sourceMappingURL=typescript-chat-bubble-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-chat-bubble-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { BUBBLE_TYPES, ChatBubble } from '../index.js';\nimport type { DSChatBubbleT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSChatBubbleT.Props;\ntype ComponentPropsInternals = DSChatBubbleT.InternalProps;\ntype ComponentPropsDefaultProps = DSChatBubbleT.DefaultProps;\ntype ComponentPropsOptionalProps = DSChatBubbleT.OptionalProps;\ntype ComponentPropsRequiredProps = DSChatBubbleT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n dsId: '',\n};\nconst testOptionalProps: ComponentPropsOptionalProps = {\n errorMessage: 'an error occurred',\n helpMessage: 'delivered',\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n type: BUBBLE_TYPES.SENDER,\n time: '4:50pm',\n};\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n type: BUBBLE_TYPES.SENDER,\n title: 'Title',\n body: 'sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec',\n time: '4:50pm',\n};\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n dsId: '1',\n type: BUBBLE_TYPES.SENDER,\n title: 'Title',\n body: 'sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec',\n time: '4:50pm',\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n dsId: '2',\n type: BUBBLE_TYPES.SENDER,\n title: 'Title',\n body: 'sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec',\n time: '4:50pm',\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n dsId: '3',\n type: BUBBLE_TYPES.SENDER,\n title: 'Title',\n body: 'sum dolor sit amet, consectetur adipiscing elit. Sed nisi orci, eleifend quis dui nec',\n time: '4:50pm',\n} as const;\n\nconst onSingleValueChange = (value: number) => {};\nconst onMultipleValueChange = (value: [number, number]) => {};\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <ChatBubble {...testExplicitDefinition} />\n <ChatBubble {...testInferedTypeCompatibility} />\n <ChatBubble {...testDefinitionAsConst} />\n {/* works with inline values */}\n <ChatBubble\n type={BUBBLE_TYPES.RECIPIENT}\n dsId=\"9999\"\n title=\"Amanda Yates\"\n time=\"4:50pm\"\n body={\n <>\n Text body with links{' '}\n <a href=\"http://google.com\" target=\"_blank\">\n Website\n </a>\n </>\n }\n helpMessage=\"delivered\"\n />\n </>\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACqFnB,SAUI,UAVJ,KAUI,YAVJ;AApFJ,SAAS,cAAc,kBAAkB;AAUzC,MAAM,oBAAiD;AAAA,EACrD,MAAM;AACR;AACA,MAAM,oBAAiD;AAAA,EACrD,cAAc;AAAA,EACd,aAAa;AACf;AAIA,MAAM,sBAA2D;AAAA,EAC/D,MAAM,aAAa;AAAA,EACnB,MAAM;AACR;AACA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,uBAA6D;AAAA,EACjE,MAAM,aAAa;AAAA,EACnB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AACA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,aAAa;AAAA,EACnB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAGA,MAAM,+BAA+B;AAAA,EACnC,MAAM;AAAA,EACN,MAAM,aAAa;AAAA,EACnB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,wBAAwB;AAAA,EAC5B,MAAM;AAAA,EACN,MAAM,aAAa;AAAA,EACnB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,sBAAsB,CAAC,UAAkB;AAAC;AAChD,MAAM,wBAAwB,CAAC,UAA4B;AAAC;AAE5D,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,cAAY,GAAG,wBAAwB;AAAA,EACxC,oBAAC,cAAY,GAAG,8BAA8B;AAAA,EAC9C,oBAAC,cAAY,GAAG,uBAAuB;AAAA,EAEvC;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,aAAa;AAAA,MACnB,MAAK;AAAA,MACL,OAAM;AAAA,MACN,MAAK;AAAA,MACL,MACE,iCAAE;AAAA;AAAA,QACqB;AAAA,QACrB,oBAAC,OAAE,MAAK,qBAAoB,QAAO,UAAS,qBAE5C;AAAA,SACF;AAAA,MAEF,aAAY;AAAA;AAAA,EACd;AAAA,GACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GlobalAttributesT } from '@elliemae/ds-props-helpers';
|
|
1
2
|
import type { WeakValidationMap } from 'react';
|
|
2
3
|
import type React from 'react';
|
|
3
4
|
export declare const BUBBLE_TYPES: {
|
|
@@ -7,19 +8,26 @@ export declare const BUBBLE_TYPES: {
|
|
|
7
8
|
SYSTEM: string;
|
|
8
9
|
};
|
|
9
10
|
export declare namespace DSChatBubbleT {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
type BubbleTypesKeys = keyof typeof BUBBLE_TYPES;
|
|
12
|
+
type BubbleTypesValues = (typeof BUBBLE_TYPES)[BubbleTypesKeys];
|
|
13
|
+
interface DefaultProps {
|
|
12
14
|
type: BubbleTypesValues;
|
|
13
|
-
title
|
|
14
|
-
body: string;
|
|
15
|
+
title: string;
|
|
16
|
+
body: string | React.ReactNode;
|
|
15
17
|
time: string;
|
|
16
|
-
errorMessage: string | React.ReactChild;
|
|
17
|
-
helpMessage: string | React.ReactChild;
|
|
18
|
-
onClick: (id: string | number) => void;
|
|
19
18
|
}
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
interface OptionalProps {
|
|
20
|
+
errorMessage?: string | React.ReactNode;
|
|
21
|
+
helpMessage?: string | React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
interface RequiredProps {
|
|
24
|
+
dsId: string | number;
|
|
25
|
+
}
|
|
26
|
+
interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>, RequiredProps {
|
|
27
|
+
}
|
|
28
|
+
interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>, RequiredProps {
|
|
29
|
+
}
|
|
22
30
|
}
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const
|
|
31
|
+
export declare const defaultProps: DSChatBubbleT.DefaultProps;
|
|
32
|
+
export declare const BubblePropTypes: WeakValidationMap<unknown>;
|
|
25
33
|
export declare const propsArrowBubble: WeakValidationMap<unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-chat-bubble",
|
|
3
|
-
"version": "3.27.0-next.
|
|
3
|
+
"version": "3.27.0-next.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Chat",
|
|
6
6
|
"files": [
|
|
@@ -48,19 +48,19 @@
|
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public",
|
|
51
|
-
"typeSafety":
|
|
51
|
+
"typeSafety": true
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"uid": "2.0.1",
|
|
55
|
-
"@elliemae/ds-
|
|
56
|
-
"@elliemae/ds-
|
|
57
|
-
"@elliemae/ds-
|
|
58
|
-
"@elliemae/ds-system": "3.27.0-next.
|
|
55
|
+
"@elliemae/ds-grid": "3.27.0-next.4",
|
|
56
|
+
"@elliemae/ds-icons": "3.27.0-next.4",
|
|
57
|
+
"@elliemae/ds-props-helpers": "3.27.0-next.4",
|
|
58
|
+
"@elliemae/ds-system": "3.27.0-next.4"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
62
62
|
"styled-components": "~5.3.9",
|
|
63
|
-
"@elliemae/ds-monorepo-devops": "3.27.0-next.
|
|
63
|
+
"@elliemae/ds-monorepo-devops": "3.27.0-next.4"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"lodash": "^4.17.21",
|