@elliemae/ds-chat 2.0.0-next.0 → 2.0.0-next.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 (91) hide show
  1. package/cjs/parts/bubble/ChatBubble.js +15 -12
  2. package/cjs/parts/bubble/ChatBubbleArrow.js +64 -61
  3. package/cjs/parts/bubble/config/useValidateProps.js +5 -6
  4. package/cjs/parts/bubble/props.js +1 -1
  5. package/cjs/parts/bubble/styled.js +2 -31
  6. package/cjs/parts/chat-card/props.js +2 -2
  7. package/cjs/parts/chat-composer/ChatContainerComposer.js +16 -8
  8. package/cjs/parts/chat-composer/props.js +5 -11
  9. package/cjs/parts/chat-composer/styled.js +4 -4
  10. package/cjs/parts/chat-container/ChatContainer.js +50 -9
  11. package/cjs/parts/chat-container/props.js +2 -12
  12. package/cjs/parts/chat-container/styled.js +1 -1
  13. package/cjs/parts/chat-container-header/ChatContainerHeader.js +3 -3
  14. package/cjs/parts/chat-container-header/helpers.js +31 -0
  15. package/cjs/parts/chat-container-header/styled.js +6 -6
  16. package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +139 -34
  17. package/cjs/parts/chat-container-messages-list/props.js +5 -13
  18. package/cjs/parts/chat-container-messages-list/styled.js +2 -6
  19. package/cjs/parts/chat-empty-state/ChatEmptyState.js +2 -3
  20. package/cjs/parts/chat-sidebar/SideBarChat.js +57 -29
  21. package/cjs/parts/chat-sidebar/props.js +11 -1
  22. package/cjs/parts/chat-sidebar/styled.js +2 -2
  23. package/cjs/parts/floating-button/FloatingButton.js +12 -10
  24. package/cjs/parts/grid-influencer/styled.js +2 -6
  25. package/cjs/parts/message-delimiter/styled.js +1 -1
  26. package/cjs/parts/sidebar-button/SidebarButton.js +6 -1
  27. package/cjs/parts/sidebar-button/props.js +2 -3
  28. package/cjs/parts/system-message/style.js +1 -1
  29. package/cjs/parts/tile-button/TileButton.js +31 -28
  30. package/cjs/parts/tile-button/props.js +12 -8
  31. package/cjs/parts/tile-button/styled.js +7 -3
  32. package/cjs/styled.js +1 -1
  33. package/esm/parts/bubble/ChatBubble.js +14 -11
  34. package/esm/parts/bubble/ChatBubbleArrow.js +64 -61
  35. package/esm/parts/bubble/config/useValidateProps.js +5 -6
  36. package/esm/parts/bubble/props.js +1 -1
  37. package/esm/parts/bubble/styled.js +2 -31
  38. package/esm/parts/chat-card/props.js +2 -2
  39. package/esm/parts/chat-composer/ChatContainerComposer.js +15 -6
  40. package/esm/parts/chat-composer/props.js +5 -11
  41. package/esm/parts/chat-composer/styled.js +2 -2
  42. package/esm/parts/chat-container/ChatContainer.js +50 -9
  43. package/esm/parts/chat-container/props.js +2 -12
  44. package/esm/parts/chat-container/styled.js +1 -1
  45. package/esm/parts/chat-container-header/ChatContainerHeader.js +3 -2
  46. package/esm/parts/chat-container-header/helpers.js +23 -0
  47. package/esm/parts/chat-container-header/styled.js +6 -6
  48. package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +139 -34
  49. package/esm/parts/chat-container-messages-list/props.js +5 -13
  50. package/esm/parts/chat-container-messages-list/styled.js +2 -6
  51. package/esm/parts/chat-empty-state/ChatEmptyState.js +1 -1
  52. package/esm/parts/chat-sidebar/SideBarChat.js +57 -28
  53. package/esm/parts/chat-sidebar/props.js +11 -1
  54. package/esm/parts/chat-sidebar/styled.js +2 -2
  55. package/esm/parts/floating-button/FloatingButton.js +12 -9
  56. package/esm/parts/grid-influencer/styled.js +2 -6
  57. package/esm/parts/message-delimiter/styled.js +1 -1
  58. package/esm/parts/sidebar-button/SidebarButton.js +6 -1
  59. package/esm/parts/sidebar-button/props.js +1 -1
  60. package/esm/parts/system-message/style.js +1 -1
  61. package/esm/parts/tile-button/TileButton.js +32 -27
  62. package/esm/parts/tile-button/props.js +11 -3
  63. package/esm/parts/tile-button/styled.js +7 -4
  64. package/esm/styled.js +1 -1
  65. package/package.json +16 -6
  66. package/types/parts/bubble/styled.d.ts +3 -3
  67. package/types/parts/bubble/tests/ChatBubble.test.d.ts +1 -0
  68. package/types/parts/chat-card/styled.d.ts +1 -1
  69. package/types/parts/chat-composer/ChatContainerComposer.d.ts +2 -0
  70. package/types/parts/chat-composer/props.d.ts +10 -6
  71. package/types/parts/chat-composer/styled.d.ts +2 -2
  72. package/types/parts/chat-composer/tests/ChatContainerComposer.test.d.ts +1 -0
  73. package/types/parts/chat-container/props.d.ts +2 -0
  74. package/types/parts/chat-container/styled.d.ts +2 -2
  75. package/types/parts/chat-container-header/helpers.d.ts +6 -0
  76. package/types/parts/chat-container-header/styled.d.ts +3 -3
  77. package/types/parts/chat-container-messages-list/props.d.ts +6 -0
  78. package/types/parts/chat-empty-state/styled.d.ts +1 -1
  79. package/types/parts/chat-sidebar/SideBarChat.d.ts +3 -0
  80. package/types/parts/chat-sidebar/props.d.ts +8 -1
  81. package/types/parts/chat-sidebar/styled.d.ts +2 -2
  82. package/types/parts/floating-container/styled.d.ts +1 -1
  83. package/types/parts/grid-influencer/styled.d.ts +2 -2
  84. package/types/parts/message-delimiter/styled.d.ts +1 -1
  85. package/types/parts/sidebar-button/styled.d.ts +1 -1
  86. package/types/parts/system-message/style.d.ts +2 -2
  87. package/types/parts/tile-button/TileButton.d.ts +3 -0
  88. package/types/parts/tile-button/props.d.ts +6 -0
  89. package/types/parts/tile-button/styled.d.ts +5 -4
  90. package/cjs/package.json +0 -4
  91. package/esm/package.json +0 -4
@@ -12,14 +12,10 @@ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
12
12
 
13
13
  const StyledChatContainer = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
14
14
  componentId: "sc-b6t5vk-0"
15
- })(["height:100%;width:", ";background:", ";box-shadow:-1px 0 0 0 ", ";transition:width ", " 350ms;"], props => props.expanded ? `${props.expandedWidth}px` : `${styled$1.MIN_WIDTH_SIDEBAR}px`, props => props.theme.colors.neutral['050'], props => props.theme.colors.neutral[100], props => props.expanded ? 'ease-out' : 'ease-in');
15
+ })(["height:100%;width:", ";background:", ";box-shadow:-1px 0 0 0 ", ";transition:width ", " 350ms;"], props => props.expanded ? "".concat(props.expandedWidth, "px") : "".concat(styled$1.MIN_WIDTH_SIDEBAR, "px"), props => props.theme.colors.neutral['050'], props => props.theme.colors.neutral[100], props => props.expanded ? 'ease-out' : 'ease-in');
16
16
  const StyledChatContainerContent = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
17
17
  componentId: "sc-b6t5vk-1"
18
- })(["height:100%;overflow:hidden;background:", ";", ""], props => props.theme.colors.neutral['050'], props => props.floating ? `
19
- width: ${props.expandedWidth}px;
20
- ` : `
21
- width: ${props.expandedWidth - styled$1.MIN_WIDTH_SIDEBAR}px;
22
- `);
18
+ })(["height:100%;overflow:hidden;background:", ";", ""], props => props.theme.colors.neutral['050'], props => props.floating ? "\n width: ".concat(props.expandedWidth, "px;\n") : "\n width: ".concat(props.expandedWidth - styled$1.MIN_WIDTH_SIDEBAR, "px;\n"));
23
19
 
24
20
  exports.StyledChatContainer = StyledChatContainer;
25
21
  exports.StyledChatContainerContent = StyledChatContainerContent;
@@ -17,7 +17,7 @@ const Line = /*#__PURE__*/styled__default["default"].span.withConfig({
17
17
  })(["border-top:1px solid ", ";"], props => props.theme.colors.neutral['400']);
18
18
  const Text = /*#__PURE__*/styled__default["default"].p.withConfig({
19
19
  componentId: "sc-upz0rt-2"
20
- })(["color:", ";font-size:", ";font-weight:", ";margin:", ";"], props => props.theme.colors.neutral['600'], props => props.size === 's' ? '12px' : '14px', props => props.theme.fontWeights.semibold, props => typeof props.verticalMargin === 'number' ? `${props.verticalMargin}px 8px` : `${props.verticalMargin} 8px`);
20
+ })(["color:", ";font-size:", ";font-weight:", ";margin:", ";"], props => props.theme.colors.neutral['600'], props => props.size === 's' ? '12px' : '14px', props => props.theme.fontWeights.semibold, props => typeof props.verticalMargin === 'number' ? "".concat(props.verticalMargin, "px 8px") : "".concat(props.verticalMargin, " 8px"));
21
21
 
22
22
  exports.Line = Line;
23
23
  exports.Text = Text;
@@ -2,6 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ require('core-js/modules/esnext.async-iterator.filter.js');
6
+ require('core-js/modules/esnext.iterator.constructor.js');
7
+ require('core-js/modules/esnext.iterator.filter.js');
8
+ require('core-js/modules/esnext.async-iterator.for-each.js');
9
+ require('core-js/modules/esnext.iterator.for-each.js');
5
10
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
11
  var _jsx = require('@babel/runtime/helpers/jsx');
7
12
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
@@ -35,7 +40,7 @@ const SidebarButton = _ref => {
35
40
  onClick(dsId);
36
41
  }, [onClick, dsId]);
37
42
  return /*#__PURE__*/jsxRuntime.jsxs(styled.StyledSidebarButton, _objectSpread(_objectSpread({
38
- "data-testid": `sidebar-button-${dsId}`,
43
+ "data-testid": "sidebar-button-".concat(dsId),
39
44
  onClick: handleClick
40
45
  }, rest), {}, {
41
46
  children: [/*#__PURE__*/_jsx__default["default"](styled.StyledSidebarButtonIcon, {
@@ -5,15 +5,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var propsTypes = require('prop-types');
6
6
  var reactDesc = require('react-desc');
7
7
  var lodash = require('lodash');
8
- var Comments = require('@elliemae/ds-icons/Comments');
8
+ var dsIcons = require('@elliemae/ds-icons');
9
9
 
10
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
11
 
12
12
  var propsTypes__default = /*#__PURE__*/_interopDefaultLegacy(propsTypes);
13
- var Comments__default = /*#__PURE__*/_interopDefaultLegacy(Comments);
14
13
 
15
14
  const defaultSidebarButton = {
16
- Icon: Comments__default["default"],
15
+ Icon: dsIcons.Comments,
17
16
  dsId: undefined,
18
17
  label: '',
19
18
  onClick: lodash.noop,
@@ -11,7 +11,7 @@ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
11
 
12
12
  const Wrapper = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
13
13
  componentId: "sc-80w41d-0"
14
- })(["align-items:center;justify-content:center;min-width:268px;max-width:100%;padding:0 8px 8px;border:1px solid ", ";border-radius:10px;background-color:", ";box-shadow:none;"], props => props.theme.colors.neutral['100'], props => props.theme.colors.neutral['080']);
14
+ })(["align-items:center;justify-content:center;max-width:100%;padding:0 8px 8px;border:1px solid ", ";border-radius:10px;background-color:", ";box-shadow:none;"], props => props.theme.colors.neutral['100'], props => props.theme.colors.neutral['080']);
15
15
  const Header = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
16
16
  componentId: "sc-80w41d-1"
17
17
  })(["align-items:center;height:36px;"]);
@@ -6,24 +6,23 @@ var _jsx = require('@babel/runtime/helpers/jsx');
6
6
  require('core-js/modules/web.url.to-json.js');
7
7
  var React = require('react');
8
8
  var reactDesc = require('react-desc');
9
- var DSTooltip = require('@elliemae/ds-tooltip');
9
+ var dsTooltip = require('@elliemae/ds-tooltip');
10
10
  var dsGrid = require('@elliemae/ds-grid');
11
- var CloseXsmall = require('@elliemae/ds-icons/CloseXsmall');
11
+ var dsIcons = require('@elliemae/ds-icons');
12
12
  var styled = require('./styled.js');
13
13
  var props = require('./props.js');
14
14
  var useValidateProps = require('./config/useValidateProps.js');
15
+ var jsxRuntime = require('react/jsx-runtime');
15
16
 
16
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
17
18
 
18
19
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
19
20
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
20
- var DSTooltip__default = /*#__PURE__*/_interopDefaultLegacy(DSTooltip);
21
- var CloseXsmall__default = /*#__PURE__*/_interopDefaultLegacy(CloseXsmall);
22
21
 
23
22
  var _StyledWrapperLeftBor, _CloseXsmall;
24
23
 
25
24
  const TileButton = props => {
26
- var _Icon, _StyledStatusBadge, _StyledTileButtonLabe;
25
+ var _Icon, _StyledTileButtonLabe, _span;
27
26
 
28
27
  useValidateProps.useValidateProps(props, TileButtonWithSchema.toJSON());
29
28
  const {
@@ -42,7 +41,10 @@ const TileButton = props => {
42
41
  disabled,
43
42
  selected,
44
43
  isHeader,
45
- ariaLabel
44
+ ariaLabel,
45
+ tooltipPlacement,
46
+ disableTooltip,
47
+ innerRef
46
48
  } = props;
47
49
  const handleClick = React__default["default"].useCallback(() => {
48
50
  onClick(dsId, title);
@@ -58,17 +60,19 @@ const TileButton = props => {
58
60
  justifyContent: "center"
59
61
  }, void 0, _Icon || (_Icon = /*#__PURE__*/_jsx__default["default"](Icon, {
60
62
  size: "m"
61
- })), badge ? _StyledStatusBadge || (_StyledStatusBadge = /*#__PURE__*/_jsx__default["default"](styled.StyledStatusBadge, {
63
+ })), badge ? /*#__PURE__*/_jsx__default["default"](styled.StyledStatusBadge, {
62
64
  badgeColor: badgeColor,
63
- badgePosition: badgePosition
64
- })) : 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, {
65
68
  width: "100%",
66
69
  justifyContent: "center"
67
70
  }, void 0, label ? _StyledTileButtonLabe || (_StyledTileButtonLabe = /*#__PURE__*/_jsx__default["default"](styled.StyledTileButtonLabel, {}, void 0, label)) : null) : null), [isHeader, Icon, badge, badgeColor, badgePosition, label]);
68
- return /*#__PURE__*/_jsx__default["default"](styled.StyledTileButton, {
71
+ const Btn = React__default["default"].useMemo(() => /*#__PURE__*/jsxRuntime.jsx(styled.StyledTileButton, {
69
72
  isHeader: isHeader,
70
73
  value: dsId,
71
- "data-testid": `tile-button-${dsId}`,
74
+ "data-testid": "tile-button-".concat(dsId),
75
+ "data-key": dsId,
72
76
  onClick: handleClick,
73
77
  onFocus: onFocus,
74
78
  onBlur: onBlur,
@@ -77,23 +81,22 @@ const TileButton = props => {
77
81
  badgeColor: badgeColor,
78
82
  badgePosition: badgePosition,
79
83
  "aria-pressed": selected,
80
- "aria-label": ariaLabel
81
- }, dsId, /*#__PURE__*/_jsx__default["default"](styled.StyledWrapper, {
82
- alignItems: "center",
83
- justifyContent: "center"
84
- }, void 0, title ? /*#__PURE__*/_jsx__default["default"](DSTooltip__default["default"], {
85
- containerProps: {
86
- id: `ds-chat-tile-tooltip-button-${dsId}`,
87
- 'data-testid': `ds-chat-tile-tooltip-button-${dsId}`
88
- },
89
- interactionType: "hover",
90
- title: title,
91
- triggerComponent: /*#__PURE__*/_jsx__default["default"]("span", {}, void 0, MainContent),
92
- placement: "bottom"
93
- }) : MainContent, _StyledWrapperLeftBor || (_StyledWrapperLeftBor = /*#__PURE__*/_jsx__default["default"](styled.StyledWrapperLeftBorder, {})), showClose && !disabled ? /*#__PURE__*/_jsx__default["default"](styled.CloseButton, {
94
- onClick: onClose,
95
- value: dsId
96
- }, 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;
97
100
  };
98
101
 
99
102
  TileButton.defaultProps = props.defaultTileButton;
@@ -4,14 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var reactDesc = require('react-desc');
6
6
  var lodash = require('lodash');
7
- var Comments = require('@elliemae/ds-icons/Comments');
8
-
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
-
11
- var Comments__default = /*#__PURE__*/_interopDefaultLegacy(Comments);
7
+ var dsIcons = require('@elliemae/ds-icons');
12
8
 
13
9
  const defaultTileButton = {
14
- Icon: Comments__default["default"],
10
+ Icon: dsIcons.Comments,
15
11
  dsId: undefined,
16
12
  label: '',
17
13
  onClick: lodash.noop,
@@ -26,7 +22,10 @@ const defaultTileButton = {
26
22
  disabled: false,
27
23
  selected: false,
28
24
  isHeader: false,
29
- ariaLabel: 'Tile button'
25
+ ariaLabel: 'Tile button',
26
+ tooltipPlacement: 'right',
27
+ disableTooltip: false,
28
+ innerRef: lodash.noop
30
29
  };
31
30
  const propsTileButton = {
32
31
  Icon: reactDesc.PropTypes.func.description('Icon component').defaultValue(defaultTileButton.Icon),
@@ -44,7 +43,12 @@ const propsTileButton = {
44
43
  disabled: reactDesc.PropTypes.bool.description('It will disabled the button').defaultValue(defaultTileButton.disabled),
45
44
  selected: reactDesc.PropTypes.bool.description('Indicate that the button is selected').defaultValue(defaultTileButton.disabled),
46
45
  isHeader: reactDesc.PropTypes.bool.description("It won't render the label").defaultValue(defaultTileButton.disabled),
47
- 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')
48
52
  };
49
53
 
50
54
  exports.defaultTileButton = defaultTileButton;
@@ -54,9 +54,12 @@ const CloseButton = /*#__PURE__*/styled__default["default"].button.withConfig({
54
54
  componentId: "sc-1ebp1zs-5"
55
55
  })(["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
56
 
57
- const StyledTileButton = /*#__PURE__*/styled__default["default"].button.withConfig({
57
+ const StyledTooltipV3ButtonWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
58
58
  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:", ";}& 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 ${props.theme.colors.neutral['200']}` : 'none', props => props.theme.colors.neutral['080'], StyledStatusBadge, props => props.theme.colors.neutral['080'], props => {
59
+ })(["height:", "px;width:", "px;"], BUTTON_SIDEBAR_HEIGHT, MIN_WIDTH_SIDEBAR);
60
+ const StyledTileButton = /*#__PURE__*/styled__default["default"].button.withConfig({
61
+ componentId: "sc-1ebp1zs-7"
62
+ })(["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
63
  switch (props.badgePosition) {
61
64
  case 'left':
62
65
  return 'margin-left: -2px;';
@@ -75,7 +78,7 @@ const StyledTileButton = /*#__PURE__*/styled__default["default"].button.withConf
75
78
  return '';
76
79
  });
77
80
  const StyledWrapper = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
78
- componentId: "sc-1ebp1zs-7"
81
+ componentId: "sc-1ebp1zs-8"
79
82
  })(["height:100%;width:100%;position:relative;"]);
80
83
 
81
84
  exports.CloseButton = CloseButton;
@@ -83,6 +86,7 @@ exports.StyledStatusBadge = StyledStatusBadge;
83
86
  exports.StyledTileButton = StyledTileButton;
84
87
  exports.StyledTileButtonIcon = StyledTileButtonIcon;
85
88
  exports.StyledTileButtonLabel = StyledTileButtonLabel;
89
+ exports.StyledTooltipV3ButtonWrapper = StyledTooltipV3ButtonWrapper;
86
90
  exports.StyledWrapper = StyledWrapper;
87
91
  exports.StyledWrapperCentralContent = StyledWrapperCentralContent;
88
92
  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;
@@ -1,14 +1,16 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import 'core-js/modules/web.url.to-json.js';
3
- import 'react';
3
+ import 'core-js/modules/esnext.async-iterator.map.js';
4
+ import 'core-js/modules/esnext.iterator.map.js';
5
+ import React from 'react';
4
6
  import { describe } from 'react-desc';
5
- import Warning from '@elliemae/ds-icons/WarningCircleFill';
7
+ import { WarningCircleFill } from '@elliemae/ds-icons';
6
8
  import { StyledWrapper, StyledColoredBubble, StyledTitleBubble, StyledTitleLeftBubble, StyledTitleRightBubble, StyleBodyWrapper, StyleErrorMessage, StyleHelpMessage } from './styled.js';
7
9
  import { propsBubbles } from './props.js';
8
10
  import { useValidateProps } from './config/useValidateProps.js';
9
11
  import { ChatBubbleArrow } from './ChatBubbleArrow.js';
10
12
 
11
- var _Warning;
13
+ var _br, _WarningCircleFill;
12
14
 
13
15
  const ChatBubble = props => {
14
16
  useValidateProps(props, ChatBubbleWithSchema.toJSON());
@@ -21,8 +23,9 @@ const ChatBubble = props => {
21
23
  errorMessage,
22
24
  helpMessage
23
25
  } = props;
26
+ const bodyParts = React.useMemo(() => typeof body === 'string' ? body.split('\n') : [body], [body]);
24
27
  return /*#__PURE__*/_jsx(StyledWrapper, {
25
- "data-testid": `ds-chat-bubble-${dsId}`,
28
+ "data-testid": "ds-chat-bubble-".concat(dsId),
26
29
  type: type
27
30
  }, void 0, /*#__PURE__*/_jsx(StyledColoredBubble, {
28
31
  type: type
@@ -33,22 +36,22 @@ const ChatBubble = props => {
33
36
  className: "sr-only"
34
37
  }, void 0, /*#__PURE__*/_jsx(StyledTitleLeftBubble, {
35
38
  alignItems: "center",
36
- "data-testid": `chat-bubble-title-${dsId}`
39
+ "data-testid": "chat-bubble-title-".concat(dsId)
37
40
  }, void 0, title), /*#__PURE__*/_jsx(StyledTitleRightBubble, {
38
41
  alignItems: "center",
39
42
  type: type,
40
- "data-testid": `chat-bubble-time-${dsId}`
43
+ "data-testid": "chat-bubble-time-".concat(dsId)
41
44
  }, void 0, time)), /*#__PURE__*/_jsx(StyleBodyWrapper, {
42
- "data-testid": `chat-bubble-body-${dsId}`
43
- }, 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, {
44
47
  type: type
45
48
  })), errorMessage ? /*#__PURE__*/_jsx(StyleErrorMessage, {
46
- "data-testid": `chat-bubble-error-message-${dsId}`,
49
+ "data-testid": "chat-bubble-error-message-".concat(dsId),
47
50
  p: "xxs",
48
51
  gutter: "xxs",
49
52
  cols: [1, 'auto']
50
- }, void 0, /*#__PURE__*/_jsx("span", {}, void 0, errorMessage), _Warning || (_Warning = /*#__PURE__*/_jsx(Warning, {}))) : null, helpMessage ? /*#__PURE__*/_jsx(StyleHelpMessage, {
51
- "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),
52
55
  p: "xxs",
53
56
  gutter: "xxs",
54
57
  cols: [1, 'auto']
@@ -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-1"
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-1"
52
+ }), /*#__PURE__*/_jsx("use", {
53
+ fill: "#FFFFFF",
54
+ fillRule: "evenodd",
55
+ xlinkHref: "#path-1"
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 };
@@ -1,27 +1,26 @@
1
1
  import { useValidatePropTypes } from '@elliemae/ds-props-helpers';
2
2
 
3
3
  const throwError = message => {
4
- throw new Error(`Bubble:: ${message}
5
- `);
4
+ throw new Error("Bubble:: ".concat(message, "\n "));
6
5
  };
7
6
 
8
7
  const useValidateProps = (props, schema) => {
9
8
  useValidatePropTypes(props, schema);
10
9
 
11
10
  if (typeof props.title === 'undefined') {
12
- throwError(`Please provide a title property to use this component.`);
11
+ throwError("Please provide a title property to use this component.");
13
12
  }
14
13
 
15
14
  if (typeof props.time === 'undefined') {
16
- throwError(`Please provide a time property to use this component.`);
15
+ throwError("Please provide a time property to use this component.");
17
16
  }
18
17
 
19
18
  if (typeof props.body === 'undefined') {
20
- throwError(`Please provide a body property to use this component.`);
19
+ throwError("Please provide a body property to use this component.");
21
20
  }
22
21
 
23
22
  if (typeof props.type === 'undefined') {
24
- throwError(`Please provide a type property to use this component.`);
23
+ throwError("Please provide a type property to use this component.");
25
24
  }
26
25
  };
27
26
 
@@ -28,7 +28,7 @@ const propsBubbles = {
28
28
  type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.description('Define bubble type ').defaultValue(defaultBubbleProps.type),
29
29
  title: PropTypes.string.isRequired.description('Title of the bubble').defaultValue(defaultBubbleProps.title),
30
30
  time: PropTypes.string.isRequired.description('Time of the bubble').defaultValue(defaultBubbleProps.title),
31
- body: PropTypes.oneOf(['string', 'element']).isRequired.description('Bubble content').defaultValue(defaultBubbleProps.body),
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)
@@ -22,7 +22,7 @@ const StyleBodyWrapper = /*#__PURE__*/styled.div.withConfig({
22
22
  })(["font-size:13px;font-weight:400;line-height:15px;min-height:18px;padding:0px 10px 8px 10px;"]);
23
23
  const StyleErrorMessage = /*#__PURE__*/styled.div.withConfig({
24
24
  componentId: "sc-fe8e9o-5"
25
- })(["font-size:12px;font-weight:400;padding-top:", ";padding-bottom:", ";color:", ";align-items:flex-end;justify-content:center;text-align:right;line-height:15px;svg{fill:", ";}a{font-size:12px;color:", ";}.em-ds-icon{margin-left:8px;}"], props => props.theme.space.xxxs, props => props.theme.space.xxxs, props => props.theme.colors.danger[900], props => props.theme.colors.danger[900], props => props.theme.colors.danger[900]);
25
+ })(["font-size:12px;font-weight:400;padding-top:", ";color:", ";align-items:flex-end;justify-content:center;text-align:right;line-height:15px;svg{fill:", ";}a{font-size:12px;color:", ";}.em-ds-icon{margin-left:8px;}"], props => props.theme.space.xxxs, props => props.theme.colors.danger[900], props => props.theme.colors.danger[900], props => props.theme.colors.danger[900]);
26
26
  const StyleHelpMessage = /*#__PURE__*/styled(StyleErrorMessage).withConfig({
27
27
  componentId: "sc-fe8e9o-6"
28
28
  })(["font-size:12px;line-height:15px;color:", ";svg{fill:", ";}a{font-size:12px;color:", ";}"], props => props.theme.colors.neutral[500], props => props.theme.colors.danger[500], props => props.theme.colors.danger[500]); // bubble sender/ recipient
@@ -32,35 +32,6 @@ const StyledBubbleArrow = /*#__PURE__*/styled.div.withConfig({
32
32
  })(["display:block;content:'';position:absolute;bottom:10px;height:15px;"]);
33
33
  const StyledColoredBubble = /*#__PURE__*/styled.div.withConfig({
34
34
  componentId: "sc-fe8e9o-8"
35
- })(["min-width:224px;border-radius:10px;position:relative;", ""], props => props.type === BUBBLE_TYPES.SENDER ? `
36
- border: 1px solid ${props.theme.colors.brand['700']};
37
- background: ${props.theme.colors.brand[600]};
38
- color: ${props.theme.colors.neutral['000']};
39
- ${StyledBubbleArrow}{
40
- right: -9px;
41
- bottom: 6px;
42
- svg{
43
- fill: ${props.theme.colors.brand[600]};
44
- }
45
- }
46
-
47
- a {
48
- color: #FFF;
49
- }
50
-
51
- ` : `
52
- box-shadow: 0 1px 3px 0 rgba(53,60,70,0.80);
53
- background: ${props.theme.colors.neutral['000']};
54
- color: ${props.theme.colors.neutral[700]};
55
-
56
- ${StyledBubbleArrow}{
57
- left: -11px;
58
- bottom: 6px;
59
- svg{
60
- fill: ${props.theme.colors.neutral['000']};
61
- }
62
- }
63
-
64
- `);
35
+ })(["min-width:224px;border-radius:10px;position:relative;", ""], props => props.type === BUBBLE_TYPES.SENDER ? "\n border: 1px solid ".concat(props.theme.colors.brand['700'], ";\n background: ").concat(props.theme.colors.brand[600], ";\n color: ").concat(props.theme.colors.neutral['000'], ";\n ").concat(StyledBubbleArrow, "{ \n right: -9px;\n bottom: 6px;\n svg{\n fill: ").concat(props.theme.colors.brand[600], ";\n }\n }\n\n a {\n color: #FFF;\n }\n\n ") : "\n box-shadow: 0 1px 3px 0 rgba(53,60,70,0.80);\n background: ".concat(props.theme.colors.neutral['000'], ";\n color: ").concat(props.theme.colors.neutral[700], ";\n\n ").concat(StyledBubbleArrow, "{ \n left: -11px;\n bottom: 6px;\n svg{\n fill: ").concat(props.theme.colors.neutral['000'], ";\n }\n }\n\n "));
65
36
 
66
37
  export { StyleBodyWrapper, StyleErrorMessage, StyleHelpMessage, StyledBubbleArrow, StyledColoredBubble, StyledTitleBubble, StyledTitleLeftBubble, StyledTitleRightBubble, StyledWrapper };
@@ -1,8 +1,8 @@
1
1
  import { PropTypes } from 'react-desc';
2
2
 
3
3
  const propTypes = {
4
- title: PropTypes.string.isRequired.description(`Card's title`),
5
- content: PropTypes.string.description(`Card's content`),
4
+ title: PropTypes.string.isRequired.description("Card's title"),
5
+ content: PropTypes.string.description("Card's content"),
6
6
  time: PropTypes.string.description('Time'),
7
7
  rightAddon: PropTypes.element.description('Right addon, badge or icon')
8
8
  };