@elliemae/ds-chat 2.0.0-alpha.0 → 2.0.0-alpha.12

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.
Files changed (168) hide show
  1. package/cjs/ChatDataTestids.js +27 -0
  2. package/cjs/index.js +1 -0
  3. package/cjs/parts/bubble/ChatBubble.js +33 -20
  4. package/cjs/parts/bubble/ChatBubbleArrow.js +64 -61
  5. package/cjs/parts/bubble/config/useValidateProps.js +31 -0
  6. package/cjs/parts/bubble/index.js +1 -0
  7. package/cjs/parts/bubble/props.js +5 -5
  8. package/cjs/parts/bubble/styled.js +12 -41
  9. package/cjs/parts/chat-card/ChatCard.js +26 -20
  10. package/cjs/parts/chat-card/config/useValidateProps.js +11 -0
  11. package/cjs/parts/chat-card/props.js +3 -3
  12. package/cjs/parts/chat-card/styled.js +6 -6
  13. package/cjs/parts/chat-composer/ChatContainerComposer.js +50 -25
  14. package/cjs/parts/chat-composer/config/useValidateProps.js +11 -0
  15. package/cjs/parts/chat-composer/props.js +10 -4
  16. package/cjs/parts/chat-composer/styled.js +8 -8
  17. package/cjs/parts/chat-container/ChatContainer.js +79 -29
  18. package/cjs/parts/chat-container/config/useValidateProps.js +11 -0
  19. package/cjs/parts/chat-container/props.js +12 -7
  20. package/cjs/parts/chat-container/styled.js +5 -5
  21. package/cjs/parts/chat-container-header/ChatContainerHeader.js +7 -7
  22. package/cjs/parts/chat-container-header/helpers.js +31 -0
  23. package/cjs/parts/chat-container-header/styled.js +6 -6
  24. package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +214 -34
  25. package/cjs/parts/chat-container-messages-list/config/useValidateProps.js +11 -0
  26. package/cjs/parts/chat-container-messages-list/props.js +6 -10
  27. package/cjs/parts/chat-container-messages-list/styled.js +11 -14
  28. package/cjs/parts/chat-empty-state/ChatEmptyState.js +22 -12
  29. package/cjs/parts/chat-empty-state/config/useValidateProps.js +11 -0
  30. package/cjs/parts/chat-empty-state/props.js +2 -1
  31. package/cjs/parts/chat-empty-state/styled.js +2 -2
  32. package/cjs/parts/chat-sidebar/SideBarChat.js +70 -36
  33. package/cjs/parts/chat-sidebar/config/useValidateProps.js +11 -0
  34. package/cjs/parts/chat-sidebar/props.js +11 -1
  35. package/cjs/parts/chat-sidebar/styled.js +4 -4
  36. package/cjs/parts/floating-button/FloatingButton.js +18 -10
  37. package/cjs/parts/floating-button/props.js +6 -2
  38. package/cjs/parts/floating-button/styled.js +1 -1
  39. package/cjs/parts/floating-container/styled.js +1 -1
  40. package/cjs/parts/grid-influencer/InfluencerContainer.js +2 -2
  41. package/cjs/parts/grid-influencer/styled.js +4 -8
  42. package/cjs/parts/message-delimiter/MessageDelimiter.js +18 -12
  43. package/cjs/parts/message-delimiter/config/useValidateProps.js +11 -0
  44. package/cjs/parts/message-delimiter/props.js +1 -1
  45. package/cjs/parts/message-delimiter/styled.js +4 -4
  46. package/cjs/parts/sidebar-button/SidebarButton.js +12 -7
  47. package/cjs/parts/sidebar-button/props.js +3 -4
  48. package/cjs/parts/sidebar-button/styled.js +4 -4
  49. package/cjs/parts/system-message/SystemMessage.js +21 -15
  50. package/cjs/parts/system-message/config/useValidateProps.js +11 -0
  51. package/cjs/parts/system-message/style.js +6 -6
  52. package/cjs/parts/tile-button/TileButton.js +40 -34
  53. package/cjs/parts/tile-button/config/useValidateProps.js +11 -0
  54. package/cjs/parts/tile-button/props.js +15 -13
  55. package/cjs/parts/tile-button/styled.js +22 -15
  56. package/cjs/styled.js +1 -1
  57. package/esm/ChatDataTestids.js +23 -0
  58. package/esm/index.js +1 -1
  59. package/esm/parts/bubble/ChatBubble.js +24 -12
  60. package/esm/parts/bubble/ChatBubbleArrow.js +64 -61
  61. package/esm/parts/bubble/config/useValidateProps.js +27 -0
  62. package/esm/parts/bubble/index.js +1 -1
  63. package/esm/parts/bubble/props.js +4 -4
  64. package/esm/parts/bubble/styled.js +3 -32
  65. package/esm/parts/chat-card/ChatCard.js +26 -20
  66. package/esm/parts/chat-card/config/useValidateProps.js +7 -0
  67. package/esm/parts/chat-card/props.js +3 -3
  68. package/esm/parts/chat-composer/ChatContainerComposer.js +33 -7
  69. package/esm/parts/chat-composer/config/useValidateProps.js +7 -0
  70. package/esm/parts/chat-composer/props.js +10 -4
  71. package/esm/parts/chat-composer/styled.js +2 -2
  72. package/esm/parts/chat-container/ChatContainer.js +68 -18
  73. package/esm/parts/chat-container/config/useValidateProps.js +7 -0
  74. package/esm/parts/chat-container/props.js +12 -7
  75. package/esm/parts/chat-container/styled.js +2 -2
  76. package/esm/parts/chat-container-header/ChatContainerHeader.js +3 -2
  77. package/esm/parts/chat-container-header/helpers.js +23 -0
  78. package/esm/parts/chat-container-header/styled.js +6 -6
  79. package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +202 -22
  80. package/esm/parts/chat-container-messages-list/config/useValidateProps.js +7 -0
  81. package/esm/parts/chat-container-messages-list/props.js +6 -10
  82. package/esm/parts/chat-container-messages-list/styled.js +6 -10
  83. package/esm/parts/chat-empty-state/ChatEmptyState.js +16 -6
  84. package/esm/parts/chat-empty-state/config/useValidateProps.js +7 -0
  85. package/esm/parts/chat-empty-state/props.js +2 -1
  86. package/esm/parts/chat-sidebar/SideBarChat.js +69 -34
  87. package/esm/parts/chat-sidebar/config/useValidateProps.js +7 -0
  88. package/esm/parts/chat-sidebar/props.js +11 -1
  89. package/esm/parts/chat-sidebar/styled.js +2 -2
  90. package/esm/parts/floating-button/FloatingButton.js +18 -9
  91. package/esm/parts/floating-button/props.js +6 -2
  92. package/esm/parts/grid-influencer/styled.js +2 -6
  93. package/esm/parts/message-delimiter/MessageDelimiter.js +18 -12
  94. package/esm/parts/message-delimiter/config/useValidateProps.js +7 -0
  95. package/esm/parts/message-delimiter/props.js +1 -1
  96. package/esm/parts/message-delimiter/styled.js +1 -1
  97. package/esm/parts/sidebar-button/SidebarButton.js +6 -1
  98. package/esm/parts/sidebar-button/props.js +1 -1
  99. package/esm/parts/sidebar-button/styled.js +1 -1
  100. package/esm/parts/system-message/SystemMessage.js +21 -15
  101. package/esm/parts/system-message/config/useValidateProps.js +7 -0
  102. package/esm/parts/system-message/style.js +1 -1
  103. package/esm/parts/tile-button/TileButton.js +35 -27
  104. package/esm/parts/tile-button/config/useValidateProps.js +7 -0
  105. package/esm/parts/tile-button/props.js +14 -7
  106. package/esm/parts/tile-button/styled.js +15 -10
  107. package/esm/styled.js +1 -1
  108. package/package.json +69 -6
  109. package/types/ChatDataTestids.d.ts +21 -0
  110. package/types/index.d.ts +1 -1
  111. package/types/parts/bubble/ChatBubble.d.ts +20 -5
  112. package/types/parts/bubble/config/useValidateProps.d.ts +2 -0
  113. package/types/parts/bubble/index.d.ts +1 -1
  114. package/types/parts/bubble/props.d.ts +13 -4
  115. package/types/parts/bubble/styled.d.ts +9 -9
  116. package/types/parts/bubble/tests/ChatBubble.test.d.ts +1 -0
  117. package/types/parts/chat-card/ChatCard.d.ts +25 -5
  118. package/types/parts/chat-card/config/useValidateProps.d.ts +2 -0
  119. package/types/parts/chat-card/props.d.ts +19 -3
  120. package/types/parts/chat-card/styled.d.ts +6 -6
  121. package/types/parts/chat-composer/ChatContainerComposer.d.ts +48 -12
  122. package/types/parts/chat-composer/config/useValidateProps.d.ts +2 -0
  123. package/types/parts/chat-composer/styled.d.ts +117 -24
  124. package/types/parts/chat-composer/tests/ChatContainerComposer.test.d.ts +1 -0
  125. package/types/parts/chat-container/ChatContainer.d.ts +54 -12
  126. package/types/parts/chat-container/config/useValidateProps.d.ts +2 -0
  127. package/types/parts/chat-container/styled.d.ts +4 -4
  128. package/types/parts/chat-container/tests/ChatContainer.test.d.ts +1 -0
  129. package/types/parts/chat-container-header/helpers.d.ts +6 -0
  130. package/types/parts/chat-container-header/styled.d.ts +3 -3
  131. package/types/parts/chat-container-messages-list/ChatContainerMessagesList.d.ts +39 -9
  132. package/types/parts/chat-container-messages-list/config/useValidateProps.d.ts +2 -0
  133. package/types/parts/chat-container-messages-list/styled.d.ts +7 -6
  134. package/types/parts/chat-empty-state/ChatEmptyState.d.ts +19 -1
  135. package/types/parts/chat-empty-state/config/useValidateProps.d.ts +2 -0
  136. package/types/parts/chat-empty-state/props.d.ts +7 -1
  137. package/types/parts/chat-empty-state/styled.d.ts +2 -2
  138. package/types/parts/chat-sidebar/SideBarChat.d.ts +40 -10
  139. package/types/parts/chat-sidebar/config/useValidateProps.d.ts +2 -0
  140. package/types/parts/chat-sidebar/props.d.ts +39 -9
  141. package/types/parts/chat-sidebar/styled.d.ts +2 -2
  142. package/types/parts/floating-button/FloatingButton.d.ts +11 -2
  143. package/types/parts/floating-button/props.d.ts +13 -1
  144. package/types/parts/floating-button/styled.d.ts +1 -1
  145. package/types/parts/floating-container/styled.d.ts +1 -2
  146. package/types/parts/grid-influencer/styled.d.ts +2 -2
  147. package/types/parts/message-delimiter/MessageDelimiter.d.ts +22 -5
  148. package/types/parts/message-delimiter/config/useValidateProps.d.ts +2 -0
  149. package/types/parts/message-delimiter/props.d.ts +16 -3
  150. package/types/parts/message-delimiter/styled.d.ts +3 -3
  151. package/types/parts/sidebar-button/SidebarButton.d.ts +16 -5
  152. package/types/parts/sidebar-button/props.d.ts +16 -5
  153. package/types/parts/sidebar-button/styled.d.ts +3 -3
  154. package/types/parts/system-message/SystemMessage.d.ts +13 -3
  155. package/types/parts/system-message/config/useValidateProps.d.ts +2 -0
  156. package/types/parts/system-message/props.d.ts +7 -1
  157. package/types/parts/system-message/style.d.ts +5 -5
  158. package/types/parts/tile-button/TileButton.d.ts +66 -17
  159. package/types/parts/tile-button/config/useValidateProps.d.ts +2 -0
  160. package/types/parts/tile-button/props.d.ts +64 -16
  161. package/types/parts/tile-button/styled.d.ts +9 -8
  162. package/types/prop-types.d.ts +28 -9
  163. package/types/tests/utils.d.ts +27 -0
  164. package/cjs/package.json +0 -4
  165. package/esm/package.json +0 -4
  166. package/types/parts/chat-composer/props.d.ts +0 -32
  167. package/types/parts/chat-container/props.d.ts +0 -38
  168. package/types/parts/chat-container-messages-list/props.d.ts +0 -31
@@ -3,26 +3,28 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _jsx = require('@babel/runtime/helpers/jsx');
6
+ require('core-js/modules/web.url.to-json.js');
6
7
  var React = require('react');
7
8
  var reactDesc = require('react-desc');
8
- var DSTooltip = require('@elliemae/ds-tooltip');
9
+ var dsTooltip = require('@elliemae/ds-tooltip');
9
10
  var dsGrid = require('@elliemae/ds-grid');
10
- var CloseXsmall = require('@elliemae/ds-icons/CloseXsmall');
11
+ var dsIcons = require('@elliemae/ds-icons');
11
12
  var styled = require('./styled.js');
12
13
  var props = require('./props.js');
14
+ var useValidateProps = require('./config/useValidateProps.js');
15
+ var jsxRuntime = require('react/jsx-runtime');
13
16
 
14
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
18
 
16
19
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
17
20
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
18
- var DSTooltip__default = /*#__PURE__*/_interopDefaultLegacy(DSTooltip);
19
- var CloseXsmall__default = /*#__PURE__*/_interopDefaultLegacy(CloseXsmall);
20
21
 
21
22
  var _StyledWrapperLeftBor, _CloseXsmall;
22
23
 
23
24
  const TileButton = props => {
24
- var _Icon, _StyledStatusBadge, _StyledTileButtonLabe;
25
+ var _Icon, _StyledTileButtonLabe, _span;
25
26
 
27
+ useValidateProps.useValidateProps(props, TileButtonWithSchema.toJSON());
26
28
  const {
27
29
  label,
28
30
  title,
@@ -39,33 +41,38 @@ const TileButton = props => {
39
41
  disabled,
40
42
  selected,
41
43
  isHeader,
42
- ariaLabel
44
+ ariaLabel,
45
+ tooltipPlacement,
46
+ disableTooltip,
47
+ innerRef
43
48
  } = props;
44
- const handleClick = React__default['default'].useCallback(() => {
49
+ const handleClick = React__default["default"].useCallback(() => {
45
50
  onClick(dsId, title);
46
51
  }, [dsId, onClick, title]);
47
- const MainContent = React__default['default'].useMemo(() => /*#__PURE__*/_jsx__default['default'](styled.StyledWrapperCentralContent, {
52
+ const MainContent = React__default["default"].useMemo(() => /*#__PURE__*/_jsx__default["default"](styled.StyledWrapperCentralContent, {
48
53
  alignItems: isHeader ? 'center' : undefined
49
- }, void 0, /*#__PURE__*/_jsx__default['default'](dsGrid.Grid, {
54
+ }, void 0, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
50
55
  width: "100%",
51
56
  alignItems: "center",
52
57
  justifyContent: "center"
53
- }, void 0, /*#__PURE__*/_jsx__default['default'](styled.StyledTileButtonIcon, {
58
+ }, void 0, /*#__PURE__*/_jsx__default["default"](styled.StyledTileButtonIcon, {
54
59
  alignItems: "center",
55
60
  justifyContent: "center"
56
- }, void 0, _Icon || (_Icon = /*#__PURE__*/_jsx__default['default'](Icon, {
61
+ }, void 0, _Icon || (_Icon = /*#__PURE__*/_jsx__default["default"](Icon, {
57
62
  size: "m"
58
- })), badge ? _StyledStatusBadge || (_StyledStatusBadge = /*#__PURE__*/_jsx__default['default'](styled.StyledStatusBadge, {
63
+ })), badge ? /*#__PURE__*/_jsx__default["default"](styled.StyledStatusBadge, {
59
64
  badgeColor: badgeColor,
60
- badgePosition: badgePosition
61
- })) : null)), !isHeader ? /*#__PURE__*/_jsx__default['default'](dsGrid.Grid, {
65
+ badgePosition: badgePosition,
66
+ "data-testid": "tile-badge-".concat(dsId)
67
+ }) : null)), !isHeader ? /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
62
68
  width: "100%",
63
69
  justifyContent: "center"
64
- }, void 0, label ? _StyledTileButtonLabe || (_StyledTileButtonLabe = /*#__PURE__*/_jsx__default['default'](styled.StyledTileButtonLabel, {}, void 0, label)) : null) : null), [isHeader, Icon, badge, badgeColor, badgePosition, label]);
65
- return /*#__PURE__*/_jsx__default['default'](styled.StyledTileButton, {
70
+ }, void 0, label ? _StyledTileButtonLabe || (_StyledTileButtonLabe = /*#__PURE__*/_jsx__default["default"](styled.StyledTileButtonLabel, {}, void 0, label)) : null) : null), [isHeader, Icon, badge, badgeColor, badgePosition, label]);
71
+ const Btn = React__default["default"].useMemo(() => /*#__PURE__*/jsxRuntime.jsx(styled.StyledTileButton, {
66
72
  isHeader: isHeader,
67
73
  value: dsId,
68
- "data-testid": `tile-button-${dsId}`,
74
+ "data-testid": "tile-button-".concat(dsId),
75
+ "data-key": dsId,
69
76
  onClick: handleClick,
70
77
  onFocus: onFocus,
71
78
  onBlur: onBlur,
@@ -74,23 +81,22 @@ const TileButton = props => {
74
81
  badgeColor: badgeColor,
75
82
  badgePosition: badgePosition,
76
83
  "aria-pressed": selected,
77
- "aria-label": ariaLabel
78
- }, dsId, /*#__PURE__*/_jsx__default['default'](styled.StyledWrapper, {
79
- alignItems: "center",
80
- justifyContent: "center"
81
- }, void 0, title ? /*#__PURE__*/_jsx__default['default'](DSTooltip__default['default'], {
82
- containerProps: {
83
- id: `ds-chat-tile-tooltip-button-${dsId}`,
84
- 'data-testid': `ds-chat-tile-tooltip-button-${dsId}`
85
- },
86
- interactionType: "hover",
87
- title: title,
88
- triggerComponent: /*#__PURE__*/_jsx__default['default']("span", {}, void 0, MainContent),
89
- placement: "bottom"
90
- }) : MainContent, _StyledWrapperLeftBor || (_StyledWrapperLeftBor = /*#__PURE__*/_jsx__default['default'](styled.StyledWrapperLeftBorder, {})), showClose && !disabled ? /*#__PURE__*/_jsx__default['default'](styled.CloseButton, {
91
- onClick: onClose,
92
- value: dsId
93
- }, void 0, _CloseXsmall || (_CloseXsmall = /*#__PURE__*/_jsx__default['default'](CloseXsmall__default['default'], {}))) : null));
84
+ "aria-label": ariaLabel,
85
+ ref: innerRef,
86
+ children: /*#__PURE__*/_jsx__default["default"](styled.StyledWrapper, {
87
+ alignItems: "center",
88
+ justifyContent: "center"
89
+ }, void 0, _span || (_span = /*#__PURE__*/_jsx__default["default"]("span", {}, void 0, MainContent)), _StyledWrapperLeftBor || (_StyledWrapperLeftBor = /*#__PURE__*/_jsx__default["default"](styled.StyledWrapperLeftBorder, {})), showClose && !disabled ? /*#__PURE__*/_jsx__default["default"](styled.CloseButton, {
90
+ onClick: onClose,
91
+ value: dsId,
92
+ "data-testid": "tile-close-btn-".concat(dsId)
93
+ }, void 0, _CloseXsmall || (_CloseXsmall = /*#__PURE__*/_jsx__default["default"](dsIcons.CloseXsmall, {}))) : null)
94
+ }, dsId), [MainContent, ariaLabel, badgeColor, badgePosition, disabled, dsId, handleClick, isHeader, onBlur, onClose, onFocus, selected, showClose, innerRef]);
95
+ return title && !disableTooltip ? /*#__PURE__*/_jsx__default["default"](styled.StyledTooltipV3ButtonWrapper, {}, void 0, /*#__PURE__*/_jsx__default["default"](dsTooltip.DSTooltipV3, {
96
+ id: "ds-chat-tile-tooltip-button-".concat(dsId),
97
+ text: title,
98
+ startPlacementPreference: tooltipPlacement
99
+ }, void 0, Btn)) : Btn;
94
100
  };
95
101
 
96
102
  TileButton.defaultProps = props.defaultTileButton;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var dsPropsHelpers = require('@elliemae/ds-props-helpers');
6
+
7
+ const useValidateProps = (props, schema) => {
8
+ dsPropsHelpers.useValidatePropTypes(props, schema);
9
+ };
10
+
11
+ exports.useValidateProps = useValidateProps;
@@ -2,18 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var propsTypes = require('prop-types');
6
5
  var reactDesc = require('react-desc');
7
6
  var lodash = require('lodash');
8
- var Comments = require('@elliemae/ds-icons/Comments');
9
-
10
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
-
12
- var propsTypes__default = /*#__PURE__*/_interopDefaultLegacy(propsTypes);
13
- var Comments__default = /*#__PURE__*/_interopDefaultLegacy(Comments);
7
+ var dsIcons = require('@elliemae/ds-icons');
14
8
 
15
9
  const defaultTileButton = {
16
- Icon: Comments__default['default'],
10
+ Icon: dsIcons.Comments,
17
11
  dsId: undefined,
18
12
  label: '',
19
13
  onClick: lodash.noop,
@@ -28,11 +22,14 @@ const defaultTileButton = {
28
22
  disabled: false,
29
23
  selected: false,
30
24
  isHeader: false,
31
- ariaLabel: 'Tile button'
25
+ ariaLabel: 'Tile button',
26
+ tooltipPlacement: 'right',
27
+ disableTooltip: false,
28
+ innerRef: lodash.noop
32
29
  };
33
30
  const propsTileButton = {
34
- Icon: reactDesc.PropTypes.element.description('Icon component').defaultValue(defaultTileButton.Icon),
35
- dsId: reactDesc.PropTypes.oneOfType([propsTypes__default['default'].number, propsTypes__default['default'].string]).description('Unique id for the button').defaultValue(defaultTileButton.dsId),
31
+ Icon: reactDesc.PropTypes.func.description('Icon component').defaultValue(defaultTileButton.Icon),
32
+ dsId: reactDesc.PropTypes.oneOf(['number', 'string']).description('Unique id for the button').defaultValue(defaultTileButton.dsId),
36
33
  label: reactDesc.PropTypes.string.description('It will display under the icon').defaultValue(defaultTileButton.label),
37
34
  title: reactDesc.PropTypes.string.description('Tooltip').defaultValue(defaultTileButton.title),
38
35
  onClick: reactDesc.PropTypes.func.description('The function to call when is clicked').defaultValue(defaultTileButton.onClick),
@@ -42,11 +39,16 @@ const propsTileButton = {
42
39
  showClose: reactDesc.PropTypes.bool.description('It will display the X').defaultValue(defaultTileButton.showClose),
43
40
  badge: reactDesc.PropTypes.bool.description('It will display the badge').defaultValue(defaultTileButton.badge),
44
41
  badgeColor: reactDesc.PropTypes.oneOf(['blue', 'green']).description('Color badge: blue or green').defaultValue(defaultTileButton.badgeColor),
45
- badgePosition: reactDesc.PropTypes.oneOf(['blue', 'green']).description('Color badge: blue or green').defaultValue(defaultTileButton.badgePosition),
42
+ badgePosition: reactDesc.PropTypes.oneOf(['left', 'right']).description('Color badge: blue or green').defaultValue(defaultTileButton.badgePosition),
46
43
  disabled: reactDesc.PropTypes.bool.description('It will disabled the button').defaultValue(defaultTileButton.disabled),
47
44
  selected: reactDesc.PropTypes.bool.description('Indicate that the button is selected').defaultValue(defaultTileButton.disabled),
48
45
  isHeader: reactDesc.PropTypes.bool.description("It won't render the label").defaultValue(defaultTileButton.disabled),
49
- ariaLabel: reactDesc.PropTypes.string.description('aria-label attribute').defaultValue(defaultTileButton.ariaLabel)
46
+ ariaLabel: reactDesc.PropTypes.string.description('aria-label attribute').defaultValue(defaultTileButton.ariaLabel),
47
+ tooltipPlacement: reactDesc.PropTypes.oneOf(['top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']).description('start placement preferences, as per popperjs placement option').defaultValue("'right'"),
48
+ disableTooltip: reactDesc.PropTypes.bool.description('Disable tooltip option').defaultValue(defaultTileButton.disableTooltip),
49
+ innerRef: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.func, reactDesc.PropTypes.shape({
50
+ current: reactDesc.PropTypes.any
51
+ })]).description('reference to the component')
50
52
  };
51
53
 
52
54
  exports.defaultTileButton = defaultTileButton;
@@ -2,21 +2,24 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
5
6
  var styled = require('styled-components');
7
+ var dsSystem = require('@elliemae/ds-system');
6
8
  var dsGrid = require('@elliemae/ds-grid');
7
9
 
8
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
11
 
12
+ var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
10
13
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
14
 
12
- /* eslint-disable indent */
15
+ var _templateObject;
13
16
  const MIN_WIDTH_SIDEBAR = 48;
14
17
  const BUTTON_SIDEBAR_HEIGHT = 48; // Buttons
15
18
 
16
- const StyledWrapperLeftBorder = /*#__PURE__*/styled__default['default'](dsGrid.Grid).withConfig({
19
+ const StyledWrapperLeftBorder = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
17
20
  componentId: "sc-1ebp1zs-0"
18
21
  })(["height:100%;width:4px;position:absolute;top:0;left:0;"]);
19
- const StyledStatusBadge = /*#__PURE__*/styled__default['default'].div.withConfig({
22
+ const StyledStatusBadge = /*#__PURE__*/styled__default["default"].div.withConfig({
20
23
  componentId: "sc-1ebp1zs-1"
21
24
  })(["height:8px;width:8px;position:absolute;top:0;background:", ";", ";border-radius:50%;box-sizing:content-box;"], props => {
22
25
  switch (props.badgeColor) {
@@ -41,22 +44,25 @@ const StyledStatusBadge = /*#__PURE__*/styled__default['default'].div.withConfig
41
44
  return 'left: -4px;';
42
45
  }
43
46
  });
44
- const StyledWrapperCentralContent = /*#__PURE__*/styled__default['default'](dsGrid.Grid).withConfig({
47
+ const StyledWrapperCentralContent = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
45
48
  componentId: "sc-1ebp1zs-2"
46
49
  })(["width:24px;height:40px;"]);
47
- const StyledTileButtonIcon = /*#__PURE__*/styled__default['default'](dsGrid.Grid).withConfig({
50
+ const StyledTileButtonIcon = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
48
51
  componentId: "sc-1ebp1zs-3"
49
- })(["position:relative;height:24px;width:24px;svg{fill:", ";}"], props => props.theme.colors.neutral[500]);
50
- const StyledTileButtonLabel = /*#__PURE__*/styled__default['default'].div.withConfig({
52
+ })(["position:relative;height:24px;width:24px;svg{fill:", ";}&:focus{svg{fill:", ";}}"], props => props.theme.colors.neutral[500], props => props.theme.colors.brand[800]);
53
+ const StyledTileButtonLabel = /*#__PURE__*/styled__default["default"].div.withConfig({
51
54
  componentId: "sc-1ebp1zs-4"
52
55
  })(["width:24px;height:", ";text-transform:uppercase;overflow:hidden;text-align:center;font-size:13px;color:", ";line-height:17px;"], props => props.theme.space.xs, props => props.theme.colors.neutral[600]);
53
- const CloseButton = /*#__PURE__*/styled__default['default'].button.withConfig({
56
+ const CloseButton = /*#__PURE__*/styled__default["default"].button.withConfig({
54
57
  componentId: "sc-1ebp1zs-5"
55
58
  })(["outline:none;background:none;height:9px;width:9px;position:absolute;top:1px;right:1px;overflow:hidden;padding:0;border:none;span{position:absolute;left:-3px;top:-4px;}&:focus,&:hover{svg{fill:", ";}&:after{display:block;content:'';position:absolute;top:0;left:0;width:100%;height:100%;border:solid 1px ", ";border-radius:2px;}}cursor:pointer;"], props => props.theme.colors.brand[600], props => props.theme.colors.brand[600]); // MAIN WRAPPER
56
59
 
57
- const StyledTileButton = /*#__PURE__*/styled__default['default'].button.withConfig({
60
+ const StyledTooltipV3ButtonWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
58
61
  componentId: "sc-1ebp1zs-6"
59
- })(["outline:none;background:transparent;height:", "px;width:", "px;position:relative;padding:0;border:none;cursor:pointer;border-bottom:", ";&:focus,&:hover,&:active,&:disabled{background:", ";& ", "{border:2px solid ", ";margin-top:-2px;", ";}}&:focus,&:hover{& ", "{background:", ";}& ", "{color:", ";}}&:active:not(:disabled){background:", ";& ", "{background:", ";}& ", "{color:", ";font-weight:600;}& svg{fill:", ";}& ", "{border:2px solid ", ";}}&:disabled{background:", ";", "{background:", ";}& ", "{background:", ";border:2px solid ", ";}", "{svg{fill:", ";}}", "{color:", ";}}", ""], BUTTON_SIDEBAR_HEIGHT, MIN_WIDTH_SIDEBAR, props => props.isHeader ? `1px solid ${props.theme.colors.neutral['200']}` : 'none', props => props.theme.colors.neutral['080'], StyledStatusBadge, props => props.theme.colors.neutral['080'], props => {
62
+ })(["height:", "px;width:", "px;"], BUTTON_SIDEBAR_HEIGHT, MIN_WIDTH_SIDEBAR);
63
+ const StyledTileButton = /*#__PURE__*/styled__default["default"].button.withConfig({
64
+ componentId: "sc-1ebp1zs-7"
65
+ })(["outline:none;background:transparent;height:", "px;width:", "px;position:relative;padding:0;border:none;cursor:pointer;border-bottom:", ";&:focus,&:hover,&:active,&:disabled{background:", ";& ", "{border:2px solid ", ";margin-top:-2px;", ";}}&:focus,&:hover{& ", "{background:", ";}& ", "{color:", ";}& svg{fill:", ";}}&:active:not(:disabled){background:", ";& ", "{background:", ";}& ", "{color:", ";font-weight:600;}& svg{fill:", ";}& ", "{border:2px solid ", ";}}&:disabled{background:", ";", "{background:", ";}& ", "{background:", ";border:2px solid ", ";}", "{svg{fill:", ";}}", "{color:", ";}}", ""], BUTTON_SIDEBAR_HEIGHT, MIN_WIDTH_SIDEBAR, props => props.isHeader ? "1px solid ".concat(props.theme.colors.neutral['200']) : 'none', props => props.theme.colors.neutral['080'], StyledStatusBadge, props => props.theme.colors.neutral['080'], props => {
60
66
  switch (props.badgePosition) {
61
67
  case 'left':
62
68
  return 'margin-left: -2px;';
@@ -67,22 +73,23 @@ const StyledTileButton = /*#__PURE__*/styled__default['default'].button.withConf
67
73
  default:
68
74
  return 'margin-left: -2px;';
69
75
  }
70
- }, StyledWrapperLeftBorder, props => props.theme.colors.brand[800], StyledTileButtonLabel, props => props.theme.colors.neutral[600], props => props.theme.colors.neutral['050'], StyledWrapperLeftBorder, props => props.theme.colors.brand[600], StyledTileButtonLabel, props => props.theme.colors.neutral[600], props => props.theme.colors.brand[600], StyledStatusBadge, props => props.theme.colors.neutral['050'], props => props.theme.colors.neutral['080'], StyledWrapperLeftBorder, props => props.theme.colors.neutral['400'], StyledStatusBadge, props => props.theme.colors.neutral['500'], props => props.theme.colors.neutral['080'], StyledTileButtonIcon, props => props.theme.colors.neutral[400], StyledTileButtonLabel, props => props.theme.colors.neutral[400], props => {
76
+ }, StyledWrapperLeftBorder, props => props.theme.colors.brand[800], StyledTileButtonLabel, props => props.theme.colors.neutral[600], props => props.theme.colors.brand[800], props => props.theme.colors.neutral['050'], StyledWrapperLeftBorder, props => props.theme.colors.brand[600], StyledTileButtonLabel, props => props.theme.colors.neutral[600], props => props.theme.colors.brand[600], StyledStatusBadge, props => props.theme.colors.neutral['050'], props => props.theme.colors.neutral['080'], StyledWrapperLeftBorder, props => props.theme.colors.neutral['400'], StyledStatusBadge, props => props.theme.colors.neutral['500'], props => props.theme.colors.neutral['080'], StyledTileButtonIcon, props => props.theme.colors.neutral[400], StyledTileButtonLabel, props => props.theme.colors.neutral[400], props => {
71
77
  if (props.selected) {
72
- return styled.css(["& ", "{background:", ";}"], StyledWrapperLeftBorder, nestedProps => nestedProps.theme.colors.brand[600]);
78
+ return dsSystem.css(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n & ", " {\n background: ", ";\n }\n "])), StyledWrapperLeftBorder, nestedProps => nestedProps.theme.colors.brand[600]);
73
79
  }
74
80
 
75
81
  return '';
76
82
  });
77
- const StyledWrapper = /*#__PURE__*/styled__default['default'](dsGrid.Grid).withConfig({
78
- componentId: "sc-1ebp1zs-7"
79
- })(["height:100%;width:100%;position:relative;&:hover{svg{fill:", ";}}"], props => props.theme.colors.brand[800]);
83
+ const StyledWrapper = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
84
+ componentId: "sc-1ebp1zs-8"
85
+ })(["height:100%;width:100%;position:relative;"]);
80
86
 
81
87
  exports.CloseButton = CloseButton;
82
88
  exports.StyledStatusBadge = StyledStatusBadge;
83
89
  exports.StyledTileButton = StyledTileButton;
84
90
  exports.StyledTileButtonIcon = StyledTileButtonIcon;
85
91
  exports.StyledTileButtonLabel = StyledTileButtonLabel;
92
+ exports.StyledTooltipV3ButtonWrapper = StyledTooltipV3ButtonWrapper;
86
93
  exports.StyledWrapper = StyledWrapper;
87
94
  exports.StyledWrapperCentralContent = StyledWrapperCentralContent;
88
95
  exports.StyledWrapperLeftBorder = StyledWrapperLeftBorder;
package/cjs/styled.js CHANGED
@@ -7,7 +7,7 @@ const BUTTON_SIDEBAR_HEIGHT = 48;
7
7
  const BUTTON_FLOATING = 56;
8
8
  const BOX_SHADOW = '0 5px 8px 0 rgba(53,60,70,0.55)';
9
9
  const BOX_SHADOW_FLOATING = '0 5px 8px 0 rgba(53,60,70,0.35)';
10
- const BOX_SHADOW_INSET = `inset 100px 3px 4px 0 rgba(53,60,70,0.50)`;
10
+ const BOX_SHADOW_INSET = "inset 100px 3px 4px 0 rgba(53,60,70,0.50)";
11
11
 
12
12
  exports.BOX_SHADOW = BOX_SHADOW;
13
13
  exports.BOX_SHADOW_FLOATING = BOX_SHADOW_FLOATING;
@@ -0,0 +1,23 @@
1
+ const ChatDataTestIds = {
2
+ COMPOSER_TEXTAREA: 'chat-composer-textarea',
3
+ COMPOSER_SEND_BUTTON: 'chat-composer-send-button',
4
+ CARD_TITLE: 'chat-card-title',
5
+ CARD_WRAPPER: 'chat-card-wrapper',
6
+ CARD_TIME: 'chat-card-time',
7
+ CARD_RIGHT_ADDON: 'chat-right-addon',
8
+ CARD_CONTENT: 'chat-card-content',
9
+ LOADING_INDICATOR: 'ds-chat-loading-indicator',
10
+ HEADER_TITLE: 'chat-header-title',
11
+ HEADER_CHILDREN: 'chat-header-children',
12
+ THREAD_CONTAINER: 'chat-thread-container',
13
+ LOAD_MORE_BUTTON: 'ds-chat-load-more-btn',
14
+ FLOATING_BUTTON: 'chat-floating-button',
15
+ SYSTEM_MSG_TITLE: 'chat-system-message-title',
16
+ SYSTEM_MSG_BODY: 'chat-system-message-body',
17
+ SYSTEM_MSG_TIME: 'chat-system-message-time',
18
+ BUBBLE: 'ds-chat-bubble',
19
+ BUBBLE_TITLE: 'chat-bubble-title',
20
+ BUBBLE_BODY: 'chat-bubble-body'
21
+ };
22
+
23
+ export { ChatDataTestIds };
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { ChatBubble } from './parts/bubble/ChatBubble.js';
1
+ export { ChatBubble, ChatBubbleWithSchema } from './parts/bubble/ChatBubble.js';
2
2
  export { BUBBLE_TYPES } from './parts/bubble/props.js';
3
3
  export { FloatingButton } from './parts/floating-button/FloatingButton.js';
4
4
  export { StyledFloatingContainer } from './parts/floating-container/styled.js';
@@ -1,11 +1,19 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
- import 'react';
3
- import Warning from '@elliemae/ds-icons/WarningCircleFill';
2
+ import 'core-js/modules/web.url.to-json.js';
3
+ import 'core-js/modules/esnext.async-iterator.map.js';
4
+ import 'core-js/modules/esnext.iterator.map.js';
5
+ import React from 'react';
6
+ import { describe } from 'react-desc';
7
+ import { WarningCircleFill } from '@elliemae/ds-icons';
4
8
  import { StyledWrapper, StyledColoredBubble, StyledTitleBubble, StyledTitleLeftBubble, StyledTitleRightBubble, StyleBodyWrapper, StyleErrorMessage, StyleHelpMessage } from './styled.js';
9
+ import { propsBubbles } from './props.js';
10
+ import { useValidateProps } from './config/useValidateProps.js';
5
11
  import { ChatBubbleArrow } from './ChatBubbleArrow.js';
6
12
 
7
- var _Warning;
13
+ var _br, _WarningCircleFill;
14
+
8
15
  const ChatBubble = props => {
16
+ useValidateProps(props, ChatBubbleWithSchema.toJSON());
9
17
  const {
10
18
  dsId,
11
19
  type,
@@ -15,8 +23,9 @@ const ChatBubble = props => {
15
23
  errorMessage,
16
24
  helpMessage
17
25
  } = props;
26
+ const bodyParts = React.useMemo(() => typeof body === 'string' ? body.split('\n') : [body], [body]);
18
27
  return /*#__PURE__*/_jsx(StyledWrapper, {
19
- "data-testid": `ds-chat-bubble-${dsId}`,
28
+ "data-testid": "ds-chat-bubble-".concat(dsId),
20
29
  type: type
21
30
  }, void 0, /*#__PURE__*/_jsx(StyledColoredBubble, {
22
31
  type: type
@@ -27,26 +36,29 @@ const ChatBubble = props => {
27
36
  className: "sr-only"
28
37
  }, void 0, /*#__PURE__*/_jsx(StyledTitleLeftBubble, {
29
38
  alignItems: "center",
30
- "data-testid": `chat-bubble-title-${dsId}`
39
+ "data-testid": "chat-bubble-title-".concat(dsId)
31
40
  }, void 0, title), /*#__PURE__*/_jsx(StyledTitleRightBubble, {
32
41
  alignItems: "center",
33
42
  type: type,
34
- "data-testid": `chat-bubble-time-${dsId}`
43
+ "data-testid": "chat-bubble-time-".concat(dsId)
35
44
  }, void 0, time)), /*#__PURE__*/_jsx(StyleBodyWrapper, {
36
- "data-testid": `chat-bubble-body-${dsId}`
37
- }, void 0, body), /*#__PURE__*/_jsx(ChatBubbleArrow, {
45
+ "data-testid": "chat-bubble-body-".concat(dsId)
46
+ }, void 0, bodyParts.map((item, index) => /*#__PURE__*/_jsx(React.Fragment, {}, "".concat(item, "-").concat(index), item, index < bodyParts.length - 1 ? _br || (_br = /*#__PURE__*/_jsx("br", {})) : null))), /*#__PURE__*/_jsx(ChatBubbleArrow, {
38
47
  type: type
39
48
  })), errorMessage ? /*#__PURE__*/_jsx(StyleErrorMessage, {
40
- "data-testid": `chat-bubble-error-message-${dsId}`,
49
+ "data-testid": "chat-bubble-error-message-".concat(dsId),
41
50
  p: "xxs",
42
51
  gutter: "xxs",
43
52
  cols: [1, 'auto']
44
- }, void 0, /*#__PURE__*/_jsx("span", {}, void 0, errorMessage), _Warning || (_Warning = /*#__PURE__*/_jsx(Warning, {}))) : null, helpMessage ? /*#__PURE__*/_jsx(StyleHelpMessage, {
45
- "data-testid": `chat-bubble-help-message-${dsId}`,
53
+ }, void 0, /*#__PURE__*/_jsx("span", {}, void 0, errorMessage), _WarningCircleFill || (_WarningCircleFill = /*#__PURE__*/_jsx(WarningCircleFill, {}))) : null, helpMessage ? /*#__PURE__*/_jsx(StyleHelpMessage, {
54
+ "data-testid": "chat-bubble-help-message-".concat(dsId),
46
55
  p: "xxs",
47
56
  gutter: "xxs",
48
57
  cols: [1, 'auto']
49
58
  }, void 0, /*#__PURE__*/_jsx("span", {}, void 0, helpMessage)) : null);
50
59
  };
51
60
 
52
- export { ChatBubble };
61
+ const ChatBubbleWithSchema = describe(ChatBubble);
62
+ ChatBubbleWithSchema.propTypes = propsBubbles;
63
+
64
+ export { ChatBubble, ChatBubbleWithSchema };
@@ -4,66 +4,69 @@ import { StyledBubbleArrow } from './styled.js';
4
4
  import { BUBBLE_TYPES } from './props.js';
5
5
 
6
6
  var _svg, _svg2;
7
- const ChatBubbleArrow = ({
8
- type
9
- }) => /*#__PURE__*/_jsx(StyledBubbleArrow, {}, void 0, type === BUBBLE_TYPES.RECIPIENT ? _svg || (_svg = /*#__PURE__*/_jsx("svg", {
10
- width: "15px",
11
- height: "14px",
12
- viewBox: "0 0 15 14"
13
- }, void 0, /*#__PURE__*/_jsx("defs", {}, void 0, /*#__PURE__*/_jsx("path", {
14
- d: "M12,8.5 C12,7.9373169 11.6782751,7.4856453 11.2282104,7.196228 C11.2286673,7.1967363 3,2 3,2 L3,10 L10.5627441,10 L10.5658569,9.9933472 C11.3630371,9.9580688 12,9.3058472 12,8.5 Z",
15
- id: "path-1"
16
- }), /*#__PURE__*/_jsx("filter", {
17
- x: "-55.6%",
18
- y: "-50.0%",
19
- width: "211.1%",
20
- height: "225.0%",
21
- filterUnits: "objectBoundingBox",
22
- id: "filter-2"
23
- }, void 0, /*#__PURE__*/_jsx("feOffset", {
24
- dx: "2.3",
25
- dy: "1.2",
26
- in: "SourceAlpha",
27
- result: "shadowOffsetOuter1"
28
- }), /*#__PURE__*/_jsx("feGaussianBlur", {
29
- stdDeviation: "1.5",
30
- in: "shadowOffsetOuter1",
31
- result: "shadowBlurOuter1"
32
- }), /*#__PURE__*/_jsx("feColorMatrix", {
33
- 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",
34
- type: "matrix",
35
- in: "shadowBlurOuter1"
36
- }))), /*#__PURE__*/_jsx("g", {
37
- id: "[DSK]-Visual-Design",
38
- stroke: "none",
39
- strokeWidth: "1",
40
- fill: "none",
41
- fillRule: "evenodd"
42
- }, void 0, /*#__PURE__*/_jsx("g", {
43
- id: "Path-Copy",
44
- transform: "translate(7.500000, 6.000000) scale(-1, 1) translate(-7.500000, -6.000000) "
45
- }, void 0, /*#__PURE__*/_jsx("use", {
46
- fill: "black",
47
- fillOpacity: "1",
48
- filter: "url(#filter-2)",
49
- xlinkHref: "#path-1"
50
- }), /*#__PURE__*/_jsx("use", {
51
- fill: "#FFFFFF",
52
- fillRule: "evenodd",
53
- xlinkHref: "#path-1"
54
- }))))) : _svg2 || (_svg2 = /*#__PURE__*/_jsx("svg", {
55
- width: "9px",
56
- height: "8px",
57
- viewBox: "0 0 9 8"
58
- }, void 0, /*#__PURE__*/_jsx("g", {
59
- stroke: "none",
60
- strokeWidth: "1",
61
- fill: "none",
62
- fillRule: "evenodd"
63
- }, void 0, /*#__PURE__*/_jsx("path", {
64
- d: "M9,6.5 C9,5.9373169 8.6782751,5.4856453 8.2282104,5.196228 C8.2286673,5.1967363 0,0 0,0 L0,8 L7.5627441,8 L7.5658569,7.9933472 C8.3630371,7.9580688 9,7.3058472 9,6.5 Z",
65
- id: "Path",
66
- fill: "#1E79C2"
67
- })))));
7
+ const ChatBubbleArrow = _ref => {
8
+ let {
9
+ type
10
+ } = _ref;
11
+ return /*#__PURE__*/_jsx(StyledBubbleArrow, {}, void 0, type === BUBBLE_TYPES.RECIPIENT ? _svg || (_svg = /*#__PURE__*/_jsx("svg", {
12
+ width: "15px",
13
+ height: "14px",
14
+ viewBox: "0 0 15 14"
15
+ }, void 0, /*#__PURE__*/_jsx("defs", {}, void 0, /*#__PURE__*/_jsx("path", {
16
+ d: "M12,8.5 C12,7.9373169 11.6782751,7.4856453 11.2282104,7.196228 C11.2286673,7.1967363 3,2 3,2 L3,10 L10.5627441,10 L10.5658569,9.9933472 C11.3630371,9.9580688 12,9.3058472 12,8.5 Z",
17
+ id: "path-chat-bubble"
18
+ }), /*#__PURE__*/_jsx("filter", {
19
+ x: "-55.6%",
20
+ y: "-50.0%",
21
+ width: "211.1%",
22
+ height: "225.0%",
23
+ filterUnits: "objectBoundingBox",
24
+ id: "filter-2"
25
+ }, void 0, /*#__PURE__*/_jsx("feOffset", {
26
+ dx: "2.3",
27
+ dy: "1.2",
28
+ in: "SourceAlpha",
29
+ result: "shadowOffsetOuter1"
30
+ }), /*#__PURE__*/_jsx("feGaussianBlur", {
31
+ stdDeviation: "1.5",
32
+ in: "shadowOffsetOuter1",
33
+ result: "shadowBlurOuter1"
34
+ }), /*#__PURE__*/_jsx("feColorMatrix", {
35
+ 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",
36
+ type: "matrix",
37
+ in: "shadowBlurOuter1"
38
+ }))), /*#__PURE__*/_jsx("g", {
39
+ id: "[DSK]-Visual-Design",
40
+ stroke: "none",
41
+ strokeWidth: "1",
42
+ fill: "none",
43
+ fillRule: "evenodd"
44
+ }, void 0, /*#__PURE__*/_jsx("g", {
45
+ id: "Path-Copy",
46
+ transform: "translate(7.500000, 6.000000) scale(-1, 1) translate(-7.500000, -6.000000) "
47
+ }, void 0, /*#__PURE__*/_jsx("use", {
48
+ fill: "black",
49
+ fillOpacity: "1",
50
+ filter: "url(#filter-2)",
51
+ xlinkHref: "#path-chat-bubble"
52
+ }), /*#__PURE__*/_jsx("use", {
53
+ fill: "#FFFFFF",
54
+ fillRule: "evenodd",
55
+ xlinkHref: "#path-chat-bubble"
56
+ }))))) : _svg2 || (_svg2 = /*#__PURE__*/_jsx("svg", {
57
+ width: "9px",
58
+ height: "8px",
59
+ viewBox: "0 0 9 8"
60
+ }, void 0, /*#__PURE__*/_jsx("g", {
61
+ stroke: "none",
62
+ strokeWidth: "1",
63
+ fill: "none",
64
+ fillRule: "evenodd"
65
+ }, void 0, /*#__PURE__*/_jsx("path", {
66
+ 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",
67
+ id: "Path",
68
+ fill: "#1E79C2"
69
+ })))));
70
+ };
68
71
 
69
72
  export { ChatBubbleArrow };
@@ -0,0 +1,27 @@
1
+ import { useValidatePropTypes } from '@elliemae/ds-props-helpers';
2
+
3
+ const throwError = message => {
4
+ throw new Error("Bubble:: ".concat(message, "\n "));
5
+ };
6
+
7
+ const useValidateProps = (props, schema) => {
8
+ useValidatePropTypes(props, schema);
9
+
10
+ if (typeof props.title === 'undefined') {
11
+ throwError("Please provide a title property to use this component.");
12
+ }
13
+
14
+ if (typeof props.time === 'undefined') {
15
+ throwError("Please provide a time property to use this component.");
16
+ }
17
+
18
+ if (typeof props.body === 'undefined') {
19
+ throwError("Please provide a body property to use this component.");
20
+ }
21
+
22
+ if (typeof props.type === 'undefined') {
23
+ throwError("Please provide a type property to use this component.");
24
+ }
25
+ };
26
+
27
+ export { useValidateProps };
@@ -1,2 +1,2 @@
1
- export { ChatBubble } from './ChatBubble.js';
1
+ export { ChatBubble, ChatBubbleWithSchema } from './ChatBubble.js';
2
2
  export { BUBBLE_TYPES } from './props.js';
@@ -25,10 +25,10 @@ const defaultBubbleProps = {
25
25
  };
26
26
  const propsBubbles = {
27
27
  dsId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Unique id for bubble').defaultValue(defaultBubbleProps.dsId),
28
- type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).description('Define bubble type ').defaultValue(defaultBubbleProps.type),
29
- title: PropTypes.string.description('Title of the bubble').defaultValue(defaultBubbleProps.title),
30
- time: PropTypes.string.description('Time of the bubble').defaultValue(defaultBubbleProps.title),
31
- body: PropTypes.string.description('Bubble content').defaultValue(defaultBubbleProps.body),
28
+ type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.description('Define bubble type ').defaultValue(defaultBubbleProps.type),
29
+ title: PropTypes.string.isRequired.description('Title of the bubble').defaultValue(defaultBubbleProps.title),
30
+ time: PropTypes.string.isRequired.description('Time of the bubble').defaultValue(defaultBubbleProps.title),
31
+ body: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired.description('Bubble content').defaultValue(defaultBubbleProps.body),
32
32
  onClick: PropTypes.string.description('Callback when the bubble is tapped').defaultValue(defaultBubbleProps.onClick),
33
33
  errorMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description('Error message to display at bottom of the bubble').defaultValue(defaultBubbleProps.onClick),
34
34
  helpMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description('Help message to display at bottom of the bubble').defaultValue(defaultBubbleProps.onClick)