@elliemae/ds-chat 1.53.4-rc.3 → 1.53.5

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 (195) hide show
  1. package/cjs/index.js +14 -1
  2. package/cjs/index.js.map +1 -1
  3. package/cjs/parts/bubble/ChatBubble.js +8 -1
  4. package/cjs/parts/bubble/ChatBubble.js.map +1 -1
  5. package/cjs/parts/bubble/config/useValidateProps.js +32 -0
  6. package/cjs/parts/bubble/config/useValidateProps.js.map +1 -0
  7. package/cjs/parts/bubble/index.js +4 -1
  8. package/cjs/parts/bubble/index.js.map +1 -1
  9. package/cjs/parts/bubble/props.js +4 -4
  10. package/cjs/parts/bubble/props.js.map +1 -1
  11. package/cjs/parts/bubble/styled.js +1 -1
  12. package/cjs/parts/bubble/styled.js.map +1 -1
  13. package/cjs/parts/chat-card/ChatCard.js +9 -6
  14. package/cjs/parts/chat-card/ChatCard.js.map +1 -1
  15. package/cjs/parts/chat-card/config/useValidateProps.js +12 -0
  16. package/cjs/parts/chat-card/config/useValidateProps.js.map +1 -0
  17. package/cjs/parts/chat-card/index.js +3 -1
  18. package/cjs/parts/chat-card/index.js.map +1 -1
  19. package/cjs/parts/chat-card/props.js +1 -1
  20. package/cjs/parts/chat-card/props.js.map +1 -1
  21. package/cjs/parts/chat-composer/ChatContainerComposer.js +19 -2
  22. package/cjs/parts/chat-composer/ChatContainerComposer.js.map +1 -1
  23. package/cjs/parts/chat-composer/config/useValidateProps.js +12 -0
  24. package/cjs/parts/chat-composer/config/useValidateProps.js.map +1 -0
  25. package/cjs/parts/chat-composer/index.js +2 -0
  26. package/cjs/parts/chat-composer/index.js.map +1 -1
  27. package/cjs/parts/chat-composer/props.js +6 -4
  28. package/cjs/parts/chat-composer/props.js.map +1 -1
  29. package/cjs/parts/chat-composer/styled.js +2 -2
  30. package/cjs/parts/chat-composer/styled.js.map +1 -1
  31. package/cjs/parts/chat-container/ChatContainer.js +10 -1
  32. package/cjs/parts/chat-container/ChatContainer.js.map +1 -1
  33. package/cjs/parts/chat-container/config/useValidateProps.js +12 -0
  34. package/cjs/parts/chat-container/config/useValidateProps.js.map +1 -0
  35. package/cjs/parts/chat-container/index.js +7 -0
  36. package/cjs/parts/chat-container/index.js.map +1 -1
  37. package/cjs/parts/chat-container/props.js +3 -2
  38. package/cjs/parts/chat-container/props.js.map +1 -1
  39. package/cjs/parts/chat-container/styled.js +3 -1
  40. package/cjs/parts/chat-container/styled.js.map +1 -1
  41. package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +70 -11
  42. package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +1 -1
  43. package/cjs/parts/chat-container-messages-list/config/useValidateProps.js +12 -0
  44. package/cjs/parts/chat-container-messages-list/config/useValidateProps.js.map +1 -0
  45. package/cjs/parts/chat-container-messages-list/index.js +5 -0
  46. package/cjs/parts/chat-container-messages-list/index.js.map +1 -1
  47. package/cjs/parts/chat-container-messages-list/props.js +1 -1
  48. package/cjs/parts/chat-container-messages-list/props.js.map +1 -1
  49. package/cjs/parts/chat-container-messages-list/styled.js +9 -1
  50. package/cjs/parts/chat-container-messages-list/styled.js.map +1 -1
  51. package/cjs/parts/chat-empty-state/ChatEmptyState.js +14 -3
  52. package/cjs/parts/chat-empty-state/ChatEmptyState.js.map +1 -1
  53. package/cjs/parts/chat-empty-state/config/useValidateProps.js +12 -0
  54. package/cjs/parts/chat-empty-state/config/useValidateProps.js.map +1 -0
  55. package/cjs/parts/chat-empty-state/props.js +2 -1
  56. package/cjs/parts/chat-empty-state/props.js.map +1 -1
  57. package/cjs/parts/chat-sidebar/SideBarChat.js +12 -8
  58. package/cjs/parts/chat-sidebar/SideBarChat.js.map +1 -1
  59. package/cjs/parts/chat-sidebar/config/useValidateProps.js +12 -0
  60. package/cjs/parts/chat-sidebar/config/useValidateProps.js.map +1 -0
  61. package/cjs/parts/chat-sidebar/index.js +4 -1
  62. package/cjs/parts/chat-sidebar/index.js.map +1 -1
  63. package/cjs/parts/floating-button/FloatingButton.js.map +1 -1
  64. package/cjs/parts/grid-influencer/InfluencerContainer.js +9 -0
  65. package/cjs/parts/grid-influencer/InfluencerContainer.js.map +1 -1
  66. package/cjs/parts/message-delimiter/MessageDelimiter.js +8 -5
  67. package/cjs/parts/message-delimiter/MessageDelimiter.js.map +1 -1
  68. package/cjs/parts/message-delimiter/config/useValidateProps.js +12 -0
  69. package/cjs/parts/message-delimiter/config/useValidateProps.js.map +1 -0
  70. package/cjs/parts/message-delimiter/index.js +2 -0
  71. package/cjs/parts/message-delimiter/index.js.map +1 -1
  72. package/cjs/parts/message-delimiter/props.js +1 -1
  73. package/cjs/parts/message-delimiter/props.js.map +1 -1
  74. package/cjs/parts/sidebar-button/SidebarButton.js.map +1 -1
  75. package/cjs/parts/sidebar-button/styled.js +3 -1
  76. package/cjs/parts/sidebar-button/styled.js.map +1 -1
  77. package/cjs/parts/system-message/SystemMessage.js +7 -4
  78. package/cjs/parts/system-message/SystemMessage.js.map +1 -1
  79. package/cjs/parts/system-message/config/useValidateProps.js +12 -0
  80. package/cjs/parts/system-message/config/useValidateProps.js.map +1 -0
  81. package/cjs/parts/system-message/index.js +2 -0
  82. package/cjs/parts/system-message/index.js.map +1 -1
  83. package/cjs/parts/tile-button/TileButton.js +3 -1
  84. package/cjs/parts/tile-button/TileButton.js.map +1 -1
  85. package/cjs/parts/tile-button/config/useValidateProps.js +12 -0
  86. package/cjs/parts/tile-button/config/useValidateProps.js.map +1 -0
  87. package/cjs/parts/tile-button/index.js +2 -1
  88. package/cjs/parts/tile-button/index.js.map +1 -1
  89. package/cjs/parts/tile-button/props.js +3 -5
  90. package/cjs/parts/tile-button/props.js.map +1 -1
  91. package/cjs/parts/tile-button/styled.js +9 -5
  92. package/cjs/parts/tile-button/styled.js.map +1 -1
  93. package/esm/index.js +14 -2
  94. package/esm/index.js.map +1 -1
  95. package/esm/parts/bubble/ChatBubble.js +8 -2
  96. package/esm/parts/bubble/ChatBubble.js.map +1 -1
  97. package/esm/parts/bubble/config/useValidateProps.js +28 -0
  98. package/esm/parts/bubble/config/useValidateProps.js.map +1 -0
  99. package/esm/parts/bubble/index.js +4 -2
  100. package/esm/parts/bubble/index.js.map +1 -1
  101. package/esm/parts/bubble/props.js +4 -4
  102. package/esm/parts/bubble/props.js.map +1 -1
  103. package/esm/parts/bubble/styled.js +1 -1
  104. package/esm/parts/bubble/styled.js.map +1 -1
  105. package/esm/parts/chat-card/ChatCard.js +9 -6
  106. package/esm/parts/chat-card/ChatCard.js.map +1 -1
  107. package/esm/parts/chat-card/config/useValidateProps.js +8 -0
  108. package/esm/parts/chat-card/config/useValidateProps.js.map +1 -0
  109. package/esm/parts/chat-card/index.js +3 -1
  110. package/esm/parts/chat-card/index.js.map +1 -1
  111. package/esm/parts/chat-card/props.js +1 -1
  112. package/esm/parts/chat-card/props.js.map +1 -1
  113. package/esm/parts/chat-composer/ChatContainerComposer.js +19 -2
  114. package/esm/parts/chat-composer/ChatContainerComposer.js.map +1 -1
  115. package/esm/parts/chat-composer/config/useValidateProps.js +8 -0
  116. package/esm/parts/chat-composer/config/useValidateProps.js.map +1 -0
  117. package/esm/parts/chat-composer/index.js +2 -0
  118. package/esm/parts/chat-composer/index.js.map +1 -1
  119. package/esm/parts/chat-composer/props.js +6 -4
  120. package/esm/parts/chat-composer/props.js.map +1 -1
  121. package/esm/parts/chat-composer/styled.js +2 -2
  122. package/esm/parts/chat-composer/styled.js.map +1 -1
  123. package/esm/parts/chat-container/ChatContainer.js +10 -1
  124. package/esm/parts/chat-container/ChatContainer.js.map +1 -1
  125. package/esm/parts/chat-container/config/useValidateProps.js +8 -0
  126. package/esm/parts/chat-container/config/useValidateProps.js.map +1 -0
  127. package/esm/parts/chat-container/index.js +7 -0
  128. package/esm/parts/chat-container/index.js.map +1 -1
  129. package/esm/parts/chat-container/props.js +3 -2
  130. package/esm/parts/chat-container/props.js.map +1 -1
  131. package/esm/parts/chat-container/styled.js +3 -1
  132. package/esm/parts/chat-container/styled.js.map +1 -1
  133. package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +71 -12
  134. package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +1 -1
  135. package/esm/parts/chat-container-messages-list/config/useValidateProps.js +8 -0
  136. package/esm/parts/chat-container-messages-list/config/useValidateProps.js.map +1 -0
  137. package/esm/parts/chat-container-messages-list/index.js +5 -0
  138. package/esm/parts/chat-container-messages-list/index.js.map +1 -1
  139. package/esm/parts/chat-container-messages-list/props.js +1 -1
  140. package/esm/parts/chat-container-messages-list/props.js.map +1 -1
  141. package/esm/parts/chat-container-messages-list/styled.js +9 -2
  142. package/esm/parts/chat-container-messages-list/styled.js.map +1 -1
  143. package/esm/parts/chat-empty-state/ChatEmptyState.js +14 -4
  144. package/esm/parts/chat-empty-state/ChatEmptyState.js.map +1 -1
  145. package/esm/parts/chat-empty-state/config/useValidateProps.js +8 -0
  146. package/esm/parts/chat-empty-state/config/useValidateProps.js.map +1 -0
  147. package/esm/parts/chat-empty-state/props.js +2 -1
  148. package/esm/parts/chat-empty-state/props.js.map +1 -1
  149. package/esm/parts/chat-sidebar/SideBarChat.js +12 -8
  150. package/esm/parts/chat-sidebar/SideBarChat.js.map +1 -1
  151. package/esm/parts/chat-sidebar/config/useValidateProps.js +8 -0
  152. package/esm/parts/chat-sidebar/config/useValidateProps.js.map +1 -0
  153. package/esm/parts/chat-sidebar/index.js +4 -1
  154. package/esm/parts/chat-sidebar/index.js.map +1 -1
  155. package/esm/parts/floating-button/FloatingButton.js.map +1 -1
  156. package/esm/parts/grid-influencer/InfluencerContainer.js +9 -0
  157. package/esm/parts/grid-influencer/InfluencerContainer.js.map +1 -1
  158. package/esm/parts/message-delimiter/MessageDelimiter.js +8 -5
  159. package/esm/parts/message-delimiter/MessageDelimiter.js.map +1 -1
  160. package/esm/parts/message-delimiter/config/useValidateProps.js +8 -0
  161. package/esm/parts/message-delimiter/config/useValidateProps.js.map +1 -0
  162. package/esm/parts/message-delimiter/index.js +2 -0
  163. package/esm/parts/message-delimiter/index.js.map +1 -1
  164. package/esm/parts/message-delimiter/props.js +1 -1
  165. package/esm/parts/message-delimiter/props.js.map +1 -1
  166. package/esm/parts/sidebar-button/SidebarButton.js.map +1 -1
  167. package/esm/parts/sidebar-button/styled.js +3 -1
  168. package/esm/parts/sidebar-button/styled.js.map +1 -1
  169. package/esm/parts/system-message/SystemMessage.js +7 -4
  170. package/esm/parts/system-message/SystemMessage.js.map +1 -1
  171. package/esm/parts/system-message/config/useValidateProps.js +8 -0
  172. package/esm/parts/system-message/config/useValidateProps.js.map +1 -0
  173. package/esm/parts/system-message/index.js +2 -0
  174. package/esm/parts/system-message/index.js.map +1 -1
  175. package/esm/parts/tile-button/TileButton.js +3 -1
  176. package/esm/parts/tile-button/TileButton.js.map +1 -1
  177. package/esm/parts/tile-button/config/useValidateProps.js +8 -0
  178. package/esm/parts/tile-button/config/useValidateProps.js.map +1 -0
  179. package/esm/parts/tile-button/index.js +2 -1
  180. package/esm/parts/tile-button/index.js.map +1 -1
  181. package/esm/parts/tile-button/props.js +3 -4
  182. package/esm/parts/tile-button/props.js.map +1 -1
  183. package/esm/parts/tile-button/styled.js +9 -5
  184. package/esm/parts/tile-button/styled.js.map +1 -1
  185. package/package.json +5 -5
  186. package/parts/bubble/config/useValidateProps/package.json +10 -0
  187. package/parts/chat-card/config/useValidateProps/package.json +10 -0
  188. package/parts/chat-composer/config/useValidateProps/package.json +10 -0
  189. package/parts/chat-container/config/useValidateProps/package.json +10 -0
  190. package/parts/chat-container-messages-list/config/useValidateProps/package.json +10 -0
  191. package/parts/chat-empty-state/config/useValidateProps/package.json +10 -0
  192. package/parts/chat-sidebar/config/useValidateProps/package.json +10 -0
  193. package/parts/message-delimiter/config/useValidateProps/package.json +10 -0
  194. package/parts/system-message/config/useValidateProps/package.json +10 -0
  195. package/parts/tile-button/config/useValidateProps/package.json +10 -0
package/cjs/index.js CHANGED
@@ -17,13 +17,15 @@ var parts_messageDelimiter_MessageDelimiter = require('./parts/message-delimiter
17
17
  var parts_systemMessage_SystemMessage = require('./parts/system-message/SystemMessage.js');
18
18
  var parts_chatCard_ChatCard = require('./parts/chat-card/ChatCard.js');
19
19
  require('react');
20
+ require('react-desc');
20
21
  require('@elliemae/ds-icons/WarningCircleFill');
21
22
  require('./parts/bubble/styled.js');
22
23
  require('styled-components');
23
24
  require('@elliemae/ds-grid');
24
25
  require('prop-types');
25
- require('react-desc');
26
26
  require('lodash');
27
+ require('./parts/bubble/config/useValidateProps.js');
28
+ require('@elliemae/ds-props-helpers');
27
29
  require('./parts/bubble/ChatBubbleArrow.js');
28
30
  require('@elliemae/ds-icons/Comments');
29
31
  require('./parts/floating-button/styled.js');
@@ -32,21 +34,27 @@ require('./styled.js');
32
34
  require('@elliemae/ds-truncated-tooltip-text');
33
35
  require('./parts/chat-container-header/styled.js');
34
36
  require('@elliemae/ds-icons/Communications');
37
+ require('./parts/chat-empty-state/props.js');
35
38
  require('./parts/chat-empty-state/styled.js');
39
+ require('./parts/chat-empty-state/config/useValidateProps.js');
36
40
  require('@babel/runtime/helpers/extends');
37
41
  require('@babel/runtime/helpers/defineProperty');
38
42
  require('react-virtual');
39
43
  require('@elliemae/ds-basic/Button');
40
44
  require('./parts/chat-container-messages-list/styled.js');
41
45
  require('./parts/chat-container-messages-list/props.js');
46
+ require('./parts/chat-container-messages-list/config/useValidateProps.js');
42
47
  require('./parts/message-delimiter/styled.js');
43
48
  require('./parts/message-delimiter/props.js');
49
+ require('./parts/message-delimiter/config/useValidateProps.js');
44
50
  require('./parts/system-message/style.js');
45
51
  require('./parts/system-message/props.js');
52
+ require('./parts/system-message/config/useValidateProps.js');
46
53
  require('@babel/runtime/helpers/slicedToArray');
47
54
  require('@elliemae/ds-icons/PaperAirplane');
48
55
  require('./parts/chat-composer/styled.js');
49
56
  require('@elliemae/ds-button');
57
+ require('./parts/chat-composer/config/useValidateProps.js');
50
58
  require('./parts/chat-composer/props.js');
51
59
  require('@elliemae/ds-icons/MenuExpand');
52
60
  require('@elliemae/ds-icons/MenuCollapse');
@@ -56,20 +64,25 @@ require('@babel/runtime/helpers/objectWithoutProperties');
56
64
  require('./parts/sidebar-button/styled.js');
57
65
  require('./parts/sidebar-button/props.js');
58
66
  require('./parts/chat-sidebar/props.js');
67
+ require('./parts/chat-sidebar/config/useValidateProps.js');
59
68
  require('@elliemae/ds-tooltip');
60
69
  require('@elliemae/ds-icons/CloseXsmall');
61
70
  require('./parts/tile-button/styled.js');
62
71
  require('./parts/tile-button/props.js');
72
+ require('./parts/tile-button/config/useValidateProps.js');
63
73
  require('@elliemae/ds-basic/IndeterminateProgressIndicator');
64
74
  require('@elliemae/ds-banner');
65
75
  require('./parts/chat-container/props.js');
66
76
  require('./parts/chat-container/styled.js');
77
+ require('./parts/chat-container/config/useValidateProps.js');
67
78
  require('./parts/chat-card/props.js');
79
+ require('./parts/chat-card/config/useValidateProps.js');
68
80
  require('./parts/chat-card/styled.js');
69
81
 
70
82
 
71
83
 
72
84
  exports.ChatBubble = parts_bubble_ChatBubble.ChatBubble;
85
+ exports.ChatBubbleWithSchema = parts_bubble_ChatBubble.ChatBubbleWithSchema;
73
86
  exports.BUBBLE_TYPES = parts_bubble_props.BUBBLE_TYPES;
74
87
  exports.FloatingButton = parts_floatingButton_FloatingButton.FloatingButton;
75
88
  exports.StyledFloatingContainer = parts_floatingContainer_styled.StyledFloatingContainer;
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,15 +3,17 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
+ var reactDesc = require('react-desc');
6
7
  var Warning = require('@elliemae/ds-icons/WarningCircleFill');
7
8
  var parts_bubble_styled = require('./styled.js');
8
9
  var parts_bubble_props = require('./props.js');
10
+ var parts_bubble_config_useValidateProps = require('./config/useValidateProps.js');
9
11
  var parts_bubble_ChatBubbleArrow = require('./ChatBubbleArrow.js');
10
12
  require('styled-components');
11
13
  require('@elliemae/ds-grid');
12
14
  require('prop-types');
13
- require('react-desc');
14
15
  require('lodash');
16
+ require('@elliemae/ds-props-helpers');
15
17
 
16
18
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
17
19
 
@@ -19,6 +21,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
19
21
  var Warning__default = /*#__PURE__*/_interopDefaultLegacy(Warning);
20
22
 
21
23
  var ChatBubble = function ChatBubble(props) {
24
+ parts_bubble_config_useValidateProps.useValidateProps(props, ChatBubbleWithSchema.toJSON());
22
25
  var dsId = props.dsId,
23
26
  type = props.type,
24
27
  title = props.title,
@@ -59,7 +62,11 @@ var ChatBubble = function ChatBubble(props) {
59
62
  cols: [1, 'auto']
60
63
  }, /*#__PURE__*/React__default['default'].createElement("span", null, helpMessage)) : null);
61
64
  };
65
+
62
66
  ChatBubble.propTypes = parts_bubble_props.propsBubbles;
67
+ var ChatBubbleWithSchema = reactDesc.describe(ChatBubble);
68
+ ChatBubbleWithSchema.propTypes = parts_bubble_props.propsBubbles;
63
69
 
64
70
  exports.ChatBubble = ChatBubble;
71
+ exports.ChatBubbleWithSchema = ChatBubbleWithSchema;
65
72
  //# sourceMappingURL=ChatBubble.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatBubble.js","sources":["../../../../src/parts/bubble/ChatBubble.tsx"],"sourcesContent":["import React from 'react';\nimport Warning from '@elliemae/ds-icons/WarningCircleFill';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled';\nimport { propsBubbles, BubbleProps } from './props';\nimport { ChatBubbleArrow } from './ChatBubbleArrow';\n\nexport const ChatBubble = (props: BubbleProps): JSX.Element => {\n const { dsId, type, title, time, body, errorMessage, helpMessage } = props;\n return (\n <StyledWrapper data-testid={`ds-chat-bubble-${dsId}`} type={type}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble\n cols={[1, 'auto']}\n gutter=\"xs\"\n alignItems=\"flex-end\"\n className=\"sr-only\"\n >\n <StyledTitleLeftBubble\n alignItems=\"center\"\n data-testid={`chat-bubble-title-${dsId}`}\n >\n {title}\n </StyledTitleLeftBubble>\n <StyledTitleRightBubble\n alignItems=\"center\"\n type={type}\n data-testid={`chat-bubble-time-${dsId}`}\n >\n {time}\n </StyledTitleRightBubble>\n </StyledTitleBubble>\n <StyleBodyWrapper data-testid={`chat-bubble-body-${dsId}`}>\n {body}\n </StyleBodyWrapper>\n <ChatBubbleArrow type={type} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage\n data-testid={`chat-bubble-error-message-${dsId}`}\n p=\"xxs\"\n gutter=\"xxs\"\n cols={[1, 'auto']}\n >\n <span>{errorMessage}</span>\n <Warning />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage\n data-testid={`chat-bubble-help-message-${dsId}`}\n p=\"xxs\"\n gutter=\"xxs\"\n cols={[1, 'auto']}\n >\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\nChatBubble.propTypes = propsBubbles;\n"],"names":["ChatBubble","props","dsId","type","title","time","body","errorMessage","helpMessage","React","StyledWrapper","StyledColoredBubble","StyledTitleBubble","StyledTitleLeftBubble","StyledTitleRightBubble","StyleBodyWrapper","ChatBubbleArrow","St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AC,EAAC,KAFJ;AAGE,IAAA,MAAM,EAAC,KAHT;AAIE,IAAA,IAAI,EAAE,CAAC,CAAD,EAAI,MAAJ;AAJR,kBAMEO,sDAAOF,YAAP,CANF,eAOEE,wCAACS,2BAAD,OAPF,CADW,GAUT,IArCN,EAsCGV,WAAW,gBACVC,wCAACU,oCAAD;AACE,sDAAyCjB,IAAzC,CADF;AAEE,IAAA,CAAC,EAAC,KAFJ;AAGE,IAAA,MAAM,EAAC,KAHT;AAIE,IAAA,IAAI,EAAE,CAAC,CAAD,EAAI,MAAJ;AAJR,kBAMEO,sDAAOD,WAAP,CANF,CADU,GASR,IA/CN,CADF;AAmDD;AACDR,UAAU,CAACoB,SAAX,GAAuBC,+BAAvB;;;;"}
1
+ {"version":3,"file":"ChatBubble.js","sources":["../../../../src/parts/bubble/ChatBubble.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\nimport Warning from '@elliemae/ds-icons/WarningCircleFill';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled';\nimport { propsBubbles, BubbleProps } from './props';\nimport { useValidateProps } from './config/useValidateProps';\nimport { ChatBubbleArrow } from './ChatBubbleArrow';\n\nconst ChatBubble = (props: BubbleProps): JSX.Element => {\n useValidateProps(props, ChatBubbleWithSchema.toJSON());\n\n const { dsId, type, title, time, body, errorMessage, helpMessage } = props;\n return (\n <StyledWrapper data-testid={`ds-chat-bubble-${dsId}`} type={type}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble cols={[1, 'auto']} gutter=\"xs\" alignItems=\"flex-end\" className=\"sr-only\">\n <StyledTitleLeftBubble alignItems=\"center\" data-testid={`chat-bubble-title-${dsId}`}>\n {title}\n </StyledTitleLeftBubble>\n <StyledTitleRightBubble alignItems=\"center\" type={type} data-testid={`chat-bubble-time-${dsId}`}>\n {time}\n </StyledTitleRightBubble>\n </StyledTitleBubble>\n <StyleBodyWrapper data-testid={`chat-bubble-body-${dsId}`}>{body}</StyleBodyWrapper>\n <ChatBubbleArrow type={type} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage data-testid={`chat-bubble-error-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{errorMessage}</span>\n <Warning />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage data-testid={`chat-bubble-help-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\nChatBubble.propTypes = propsBubbles;\n\nconst ChatBubbleWithSchema = describe(ChatBubble);\nChatBubbleWithSchema.propTypes = propsBubbles;\n\nexport { ChatBubble, ChatBubbleWithSchema };\n"],"names":["ChatBubble","props","useValidateProps","ChatBubbleWithSchema","toJSON","dsId","type","title","time","body","errorMessage","helpMessage","React","StyledWrapper","StyledColoredBubble","StyledTitleBubble","StyledTitleLeftBubble","StyledTitleRightBubble","StyleBodyWrapper","ChatBubbleArrow","StyleErrorMessage","Warning","StyleHelpMessage","propTypes","propsBubbles","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAiBMA,UAAU,GAAG,SAAbA,UAAa,CAACC,KAAD,EAAqC;AACtDC,EAAAA,qDAAgB,CAACD,KAAD,EAAQE,oBAAoB,CAACC,MAArB,EAAR,CAAhB;AAEA,MAAQC,IAAR,GAAqEJ,KAArE,CAAQI,IAAR;AAAA,MAAcC,IAAd,GAAqEL,KAArE,CAAcK,IAAd;AAAA,MAAoBC,KAApB,GAAqEN,KAArE,CAAoBM,KAApB;AAAA,MAA2BC,IAA3B,GAAqEP,KAArE,CAA2BO,IAA3B;AAAA,MAAiCC,IAAjC,GAAqER,KAArE,CAAiCQ,IAAjC;AAAA,MAAuCC,YAAvC,GAAqET,KAArE,CAAuCS,YAAv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ADU,GAIR,IAvBN,CADF;AA2BD;;AACDX,UAAU,CAACuB,SAAX,GAAuBC,+BAAvB;IAEMrB,oBAAoB,GAAGsB,kBAAQ,CAACzB,UAAD;AACrCG,oBAAoB,CAACoB,SAArB,GAAiCC,+BAAjC;;;;;"}
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var dsPropsHelpers = require('@elliemae/ds-props-helpers');
6
+
7
+ var throwError = function throwError(message) {
8
+ throw new Error("Bubble:: ".concat(message, "\n "));
9
+ };
10
+
11
+ var useValidateProps = function useValidateProps(props, schema) {
12
+ dsPropsHelpers.useValidatePropTypes(props, schema);
13
+
14
+ if (typeof props.title === 'undefined') {
15
+ throwError("Please provide a title property to use this component.");
16
+ }
17
+
18
+ if (typeof props.time === 'undefined') {
19
+ throwError("Please provide a time property to use this component.");
20
+ }
21
+
22
+ if (typeof props.body === 'undefined') {
23
+ throwError("Please provide a body property to use this component.");
24
+ }
25
+
26
+ if (typeof props.type === 'undefined') {
27
+ throwError("Please provide a type property to use this component.");
28
+ }
29
+ };
30
+
31
+ exports.useValidateProps = useValidateProps;
32
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/bubble/config/useValidateProps.tsx"],"sourcesContent":["import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { BubbleProps } from '../props';\n\nconst throwError = (message: string): void => {\n throw new Error(\n `Bubble:: ${message}\n `,\n );\n};\n\nexport const useValidateProps = (props: BubbleProps, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n if (typeof props.title === 'undefined') {\n throwError(`Please provide a title property to use this component.`);\n }\n if (typeof props.time === 'undefined') {\n throwError(`Please provide a time property to use this component.`);\n }\n if (typeof props.body === 'undefined') {\n throwError(`Please provide a body property to use this component.`);\n }\n if (typeof props.type === 'undefined') {\n throwError(`Please provide a type property to use this component.`);\n }\n};\n"],"names":["throwError","message","Error","useValidateProps","props","schema","useValidatePropTypes","title","time","body","type"],"mappings":";;;;;;AAGA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,OAAD,EAA2B;AAC5C,QAAM,IAAIC,KAAJ,oBACQD,OADR,UAAN;AAID,CALD;;IAOaE,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAqBC,MAArB,EAA+C;AAC7EC,EAAAA,mCAAoB,CAACF,KAAD,EAAQC,MAAR,CAApB;;AACA,MAAI,OAAOD,KAAK,CAACG,KAAb,KAAuB,WAA3B,EAAwC;AACtCP,IAAAA,UAAU,0DAAV;AACD;;AACD,MAAI,OAAOI,KAAK,CAACI,IAAb,KAAsB,WAA1B,EAAuC;AACrCR,IAAAA,UAAU,yDAAV;AACD;;AACD,MAAI,OAAOI,KAAK,CAACK,IAAb,KAAsB,WAA1B,EAAuC;AACrCT,IAAAA,UAAU,yDAAV;AACD;;AACD,MAAI,OAAOI,KAAK,CAACM,IAAb,KAAsB,WAA1B,EAAuC;AACrCV,IAAAA,UAAU,yDAAV;AACD;AACF;;;;"}
@@ -5,17 +5,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var parts_bubble_ChatBubble = require('./ChatBubble.js');
6
6
  var parts_bubble_props = require('./props.js');
7
7
  require('react');
8
+ require('react-desc');
8
9
  require('@elliemae/ds-icons/WarningCircleFill');
9
10
  require('./styled.js');
10
11
  require('styled-components');
11
12
  require('@elliemae/ds-grid');
12
13
  require('prop-types');
13
- require('react-desc');
14
14
  require('lodash');
15
+ require('./config/useValidateProps.js');
16
+ require('@elliemae/ds-props-helpers');
15
17
  require('./ChatBubbleArrow.js');
16
18
 
17
19
 
18
20
 
19
21
  exports.ChatBubble = parts_bubble_ChatBubble.ChatBubble;
22
+ exports.ChatBubbleWithSchema = parts_bubble_ChatBubble.ChatBubbleWithSchema;
20
23
  exports.BUBBLE_TYPES = parts_bubble_props.BUBBLE_TYPES;
21
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -33,10 +33,10 @@ var defaultBubbleProps = {
33
33
  };
34
34
  var propsBubbles = {
35
35
  dsId: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number]).description('Unique id for bubble').defaultValue(defaultBubbleProps.dsId),
36
- type: reactDesc.PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).description('Define bubble type ').defaultValue(defaultBubbleProps.type),
37
- title: reactDesc.PropTypes.string.description('Title of the bubble').defaultValue(defaultBubbleProps.title),
38
- time: reactDesc.PropTypes.string.description('Time of the bubble').defaultValue(defaultBubbleProps.title),
39
- body: reactDesc.PropTypes.string.description('Bubble content').defaultValue(defaultBubbleProps.body),
36
+ type: reactDesc.PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.description('Define bubble type ').defaultValue(defaultBubbleProps.type),
37
+ title: reactDesc.PropTypes.string.isRequired.description('Title of the bubble').defaultValue(defaultBubbleProps.title),
38
+ time: reactDesc.PropTypes.string.isRequired.description('Time of the bubble').defaultValue(defaultBubbleProps.title),
39
+ body: reactDesc.PropTypes.oneOf(['string', 'element']).isRequired.description('Bubble content').defaultValue(defaultBubbleProps.body),
40
40
  onClick: reactDesc.PropTypes.string.description('Callback when the bubble is tapped').defaultValue(defaultBubbleProps.onClick),
41
41
  errorMessage: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.element]).description('Error message to display at bottom of the bubble').defaultValue(defaultBubbleProps.onClick),
42
42
  helpMessage: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.element]).description('Help message to display at bottom of the bubble').defaultValue(defaultBubbleProps.onClick)
@@ -1 +1 @@
1
- {"version":3,"file":"props.js","sources":["../../../../src/parts/bubble/props.ts"],"sourcesContent":["import propTypes from 'prop-types';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport React from 'react';\n\n/**\n *\n * BUBBLE\n *\n */\nexport const BUBBLE_TYPES = {\n SENDER: 'SENDER',\n RECIPIENT: 'RECIPIENT',\n DELIMITER: 'DELIMITER',\n SYSTEM: 'SYSTEM',\n};\n\nexport type BubbleTypesKeys = keyof typeof BUBBLE_TYPES;\nexport type BubbleTypesValues = typeof BUBBLE_TYPES[BubbleTypesKeys];\n\nexport interface BubbleProps {\n dsId: string | number;\n type: BubbleTypesValues;\n title: string;\n body: string;\n time: string;\n errorMessage: string | React.ReactChild;\n helpMessage: string | React.ReactChild;\n onClick: (id: string | number) => void;\n}\n\nexport const defaultBubbleProps: BubbleProps = {\n dsId: undefined,\n type: BUBBLE_TYPES.SENDER,\n title: undefined,\n time: undefined,\n body: undefined,\n onClick: noop,\n errorMessage: undefined,\n helpMessage: undefined,\n};\n\nexport const propsBubbles = {\n dsId: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n .description('Unique id for bubble')\n .defaultValue(defaultBubbleProps.dsId),\n type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER])\n .description('Define bubble type ')\n .defaultValue(defaultBubbleProps.type),\n title: PropTypes.string.description('Title of the bubble').defaultValue(defaultBubbleProps.title),\n time: PropTypes.string.description('Time of the bubble').defaultValue(defaultBubbleProps.title),\n body: PropTypes.string.description('Bubble content').defaultValue(defaultBubbleProps.body),\n onClick: PropTypes.string.description('Callback when the bubble is tapped').defaultValue(defaultBubbleProps.onClick),\n errorMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element])\n .description('Error message to display at bottom of the bubble')\n .defaultValue(defaultBubbleProps.onClick),\n helpMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element])\n .description('Help message to display at bottom of the bubble')\n .defaultValue(defaultBubbleProps.onClick),\n};\n\n/**\n *\n * BUBBLE ARROW\n *\n */\nexport const propsArrowBubble = {\n type: propTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]),\n};\n"],"names":["BUBBLE_TYPES","SENDER","RECIPIENT","DELIMITER","SYSTEM","defaultBubbleProps","dsId","undefined","type","title","time","body","onClick","noop","errorMessage","helpMessage","propsBubbles","PropTypes","oneOfType","string","number","description","defaultValue","oneOf","element","propsArrowBubble","propTypes"],"mappings":";;;;;;;;;;;;AAKA;AACA;AACA;AACA;AACA;IACaA,YAAY,GAAG;AAC1BC,EAAAA,MAAM,EAAE,QADkB;AAE1BC,EAAAA,SAAS,EAAE,WAFe;AAG1BC,EAAAA,SAAS,EAAE,WAHe;AAI1BC,EAAAA,MAAM,EAAE;AAJkB;IAqBfC,kBAA+B,GAAG;AAC7CC,EAAAA,IAAI,EAAEC,SADuC;AAE7CC,EAAAA,IAAI,EAAER,YAAY,CAACC,MAF0B;AAG7CQ,EAAAA,KAAK,EAAEF,SAHsC;AAI7CG,EAAAA,IAAI,EAAEH,SAJuC;AAK7CI,EAAAA,IAAI,EAAEJ,SALuC;AAM7CK,EAAAA,OAAO,EAAEC,WANoC;AAO7CC,EAAAA,YAAY,EAAEP,SAP+B;AAQ7CQ,EAAAA,WAAW,EAAER;AARgC;IAWlCS,YAAY,GAAG;AAC1BV,EAAAA,IAAI,EAAEW,mBAAS,CAACC,SAAV,CAAoB,CAACD,mBAAS,CAACE,MAAX,EAAmBF,mBAAS,CAACG,MAA7B,CAApB,EACHC,WADG,CACS,sBADT,EAEHC,YAFG,CAEUjB,kBAAkB,CAACC,IAF7B,CADoB;AAI1BE,EAAAA,IAAI,EAAES,mBAAS,CAACM,KAAV,CAAgB,CAACvB,YAAY,CAACE,SAAd,EAAyBF,YAAY,CAACC,MAAtC,CAAhB,EACHoB,WADG,CACS,qBADT,EAEHC,YAFG,CAEUjB,kBAAkB,CAACG,IAF7B,CAJoB;AAO1BC,EAAAA,KAAK,EAAEQ,mBAAS,CAACE,MAAV,CAAiBE,WAAjB,CAA6B,qBAA7B,EAAoDC,YAApD,CAAiEjB,kBAAkB,CAACI,KAApF,CAPmB;AAQ1BC,EAAAA,IAAI,EAAEO,mBAAS,CAACE,MAAV,CAAiBE,WAAjB,CAA6B,oBAA7B,EAAmDC,YAAnD,CAAgEjB,kBAAkB,CAACI,KAAnF,CARoB;AAS1BE,EAAAA,IAAI,EAAEM,mBAAS,CAACE,MAAV,CAAiBE,WAAjB,CAA6B,gBAA7B,EAA+CC,YAA/C,CAA4DjB,kBAAkB,CAACM,IAA/E,CAToB;AAU1BC,EAAAA,OAAO,EAAEK,mBAAS,CAACE,MAAV,CAAiBE,WAAjB,CAA6B,oCAA7B,EAAmEC,YAAnE,CAAgFjB,kBAAkB,CAACO,OAAnG,CAViB;AAW1BE,EAAAA,YAAY,EAAEG,mBAAS,CAACC,SAAV,CAAoB,CAACD,mBAAS,CAACE,MAAX,EAAmBF,mBAAS,CAACO,OAA7B,CAApB,EACXH,WADW,CACC,kDADD,EAEXC,YAFW,CAEEjB,kBAAkB,CAACO,OAFrB,CAXY;AAc1BG,EAAAA,WAAW,EAAEE,mBAAS,CAACC,SAAV,CAAoB,CAACD,mBAAS,CAACE,MAAX,EAAmBF,mBAAS,CAACO,OAA7B,CAApB,EACVH,WADU,CACE,iDADF,EAEVC,YAFU,CAEGjB,kBAAkB,CAACO,OAFtB;AAda;AAmB5B;AACA;AACA;AACA;AACA;;IACaa,gBAAgB,GAAG;AAC9BjB,EAAAA,IAAI,EAAEkB,8BAAS,CAACH,KAAV,CAAgB,CAACvB,YAAY,CAACE,SAAd,EAAyBF,YAAY,CAACC,MAAtC,CAAhB;AADwB;;;;;;;"}
1
+ {"version":3,"file":"props.js","sources":["../../../../src/parts/bubble/props.ts"],"sourcesContent":["import propTypes from 'prop-types';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport React from 'react';\n\n/**\n *\n * BUBBLE\n *\n */\nexport const BUBBLE_TYPES = {\n SENDER: 'SENDER',\n RECIPIENT: 'RECIPIENT',\n DELIMITER: 'DELIMITER',\n SYSTEM: 'SYSTEM',\n};\n\nexport type BubbleTypesKeys = keyof typeof BUBBLE_TYPES;\nexport type BubbleTypesValues = typeof BUBBLE_TYPES[BubbleTypesKeys];\n\nexport interface BubbleProps {\n dsId: string | number;\n type: BubbleTypesValues;\n title: string;\n body: string;\n time: string;\n errorMessage: string | React.ReactChild;\n helpMessage: string | React.ReactChild;\n onClick: (id: string | number) => void;\n}\n\nexport const defaultBubbleProps: BubbleProps = {\n dsId: undefined,\n type: BUBBLE_TYPES.SENDER,\n title: undefined,\n time: undefined,\n body: undefined,\n onClick: noop,\n errorMessage: undefined,\n helpMessage: undefined,\n};\n\nexport const propsBubbles = {\n dsId: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n .description('Unique id for bubble')\n .defaultValue(defaultBubbleProps.dsId),\n type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER])\n .isRequired.description('Define bubble type ')\n .defaultValue(defaultBubbleProps.type),\n title: PropTypes.string.isRequired.description('Title of the bubble').defaultValue(defaultBubbleProps.title),\n time: PropTypes.string.isRequired.description('Time of the bubble').defaultValue(defaultBubbleProps.title),\n body: PropTypes.oneOf(['string', 'element'])\n .isRequired.description('Bubble content')\n .defaultValue(defaultBubbleProps.body),\n onClick: PropTypes.string.description('Callback when the bubble is tapped').defaultValue(defaultBubbleProps.onClick),\n errorMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element])\n .description('Error message to display at bottom of the bubble')\n .defaultValue(defaultBubbleProps.onClick),\n helpMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element])\n .description('Help message to display at bottom of the bubble')\n .defaultValue(defaultBubbleProps.onClick),\n};\n\n/**\n *\n * BUBBLE ARROW\n *\n */\nexport const propsArrowBubble = {\n type: propTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]),\n};\n"],"names":["BUBBLE_TYPES","SENDER","RECIPIENT","DELIMITER","SYSTEM","defaultBubbleProps","dsId","undefined","type","title","time","body","onClick","noop","errorMessage","helpMessage","propsBubbles","PropTypes","oneOfType","string","number","description","defaultValue","oneOf","isRequired","element","propsArrowBubble","propTypes"],"mappings":";;;;;;;;;;;;AAKA;AACA;AACA;AACA;AACA;IACaA,YAAY,GAAG;AAC1BC,EAAAA,MAAM,EAAE,QADkB;AAE1BC,EAAAA,SAAS,EAAE,WAFe;AAG1BC,EAAAA,SAAS,EAAE,WAHe;AAI1BC,EAAAA,MAAM,EAAE;AAJkB;IAqBfC,kBAA+B,GAAG;AAC7CC,EAAAA,IAAI,EAAEC,SADuC;AAE7CC,EAAAA,IAAI,EAAER,YAAY,CAACC,MAF0B;AAG7CQ,EAAAA,KAAK,EAAEF,SAHsC;AAI7CG,EAAAA,IAAI,EAAEH,SAJuC;AAK7CI,EAAAA,IAAI,EAAEJ,SALuC;AAM7CK,EAAAA,OAAO,EAAEC,WANoC;AAO7CC,EAAAA,YAAY,EAAEP,SAP+B;AAQ7CQ,EAAAA,WAAW,EAAER;AARgC;IAWlCS,YAAY,GAAG;AAC1BV,EAAAA,IAAI,EAAEW,mBAAS,CAACC,SAAV,CAAoB,CAACD,mBAAS,CAACE,MAAX,EAAmBF,mBAAS,CAACG,MAA7B,CAApB,EACHC,WADG,CACS,sBADT,EAEHC,YAFG,CAEUjB,kBAAkB,CAACC,IAF7B,CADoB;AAI1BE,EAAAA,IAAI,EAAES,mBAAS,CAACM,KAAV,CAAgB,CAACvB,YAAY,CAACE,SAAd,EAAyBF,YAAY,CAACC,MAAtC,CAAhB,EACHuB,UADG,CACQH,WADR,CACoB,qBADpB,EAEHC,YAFG,CAEUjB,kBAAkB,CAACG,IAF7B,CAJoB;AAO1BC,EAAAA,KAAK,EAAEQ,mBAAS,CAACE,MAAV,CAAiBK,UAAjB,CAA4BH,WAA5B,CAAwC,qBAAxC,EAA+DC,YAA/D,CAA4EjB,kBAAkB,CAACI,KAA/F,CAPmB;AAQ1BC,EAAAA,IAAI,EAAEO,mBAAS,CAACE,MAAV,CAAiBK,UAAjB,CAA4BH,WAA5B,CAAwC,oBAAxC,EAA8DC,YAA9D,CAA2EjB,kBAAkB,CAACI,KAA9F,CARoB;AAS1BE,EAAAA,IAAI,EAAEM,mBAAS,CAACM,KAAV,CAAgB,CAAC,QAAD,EAAW,SAAX,CAAhB,EACHC,UADG,CACQH,WADR,CACoB,gBADpB,EAEHC,YAFG,CAEUjB,kBAAkB,CAACM,IAF7B,CAToB;AAY1BC,EAAAA,OAAO,EAAEK,mBAAS,CAACE,MAAV,CAAiBE,WAAjB,CAA6B,oCAA7B,EAAmEC,YAAnE,CAAgFjB,kBAAkB,CAACO,OAAnG,CAZiB;AAa1BE,EAAAA,YAAY,EAAEG,mBAAS,CAACC,SAAV,CAAoB,CAACD,mBAAS,CAACE,MAAX,EAAmBF,mBAAS,CAACQ,OAA7B,CAApB,EACXJ,WADW,CACC,kDADD,EAEXC,YAFW,CAEEjB,kBAAkB,CAACO,OAFrB,CAbY;AAgB1BG,EAAAA,WAAW,EAAEE,mBAAS,CAACC,SAAV,CAAoB,CAACD,mBAAS,CAACE,MAAX,EAAmBF,mBAAS,CAACQ,OAA7B,CAApB,EACVJ,WADU,CACE,iDADF,EAEVC,YAFU,CAEGjB,kBAAkB,CAACO,OAFtB;AAhBa;AAqB5B;AACA;AACA;AACA;AACA;;IACac,gBAAgB,GAAG;AAC9BlB,EAAAA,IAAI,EAAEmB,8BAAS,CAACJ,KAAV,CAAgB,CAACvB,YAAY,CAACE,SAAd,EAAyBF,YAAY,CAACC,MAAtC,CAAhB;AADwB;;;;;;;"}
@@ -62,7 +62,7 @@ var StyledBubbleArrow = /*#__PURE__*/styled__default['default'].div.withConfig({
62
62
  var StyledColoredBubble = /*#__PURE__*/styled__default['default'].div.withConfig({
63
63
  componentId: "sc-fe8e9o-8"
64
64
  })(["min-width:224px;border-radius:10px;position:relative;", ""], function (props) {
65
- return props.type === parts_bubble_props.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 ") : "\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
+ return props.type === parts_bubble_props.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 ");
66
66
  });
67
67
 
68
68
  exports.StyleBodyWrapper = StyleBodyWrapper;
@@ -1 +1 @@
1
- {"version":3,"file":"styled.js","sources":["../../../../src/parts/bubble/styled.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { BUBBLE_TYPES } from './props';\n\n// Bubble WRAPPER\nexport const StyledWrapper = styled.div<any>`\n min-width: 224px;\n border-radius: 10px;\n`;\n\n// Bubble HEADER\nexport const StyledTitleBubble = styled(Grid)`\n padding-top: 6px;\n padding-left: 10px;\n padding-right: 10px;\n padding-bottom: 4px;\n`;\n\nexport const StyledTitleLeftBubble = styled(Grid)`\n font-size: 13px;\n font-weight: 600;\n`;\nexport const StyledTitleRightBubble = styled(Grid)`\n font-size: 13px;\n font-weight: 400;\n color: ${(props) => (props.type === BUBBLE_TYPES.SENDER ? '#FFF' : '#657489')};\n`;\n\nexport const StyleBodyWrapper = styled.div<any>`\n font-size: 13px;\n font-weight: 400;\n line-height: 15px;\n min-height: 32px;\n padding: 0px 10px 8px 10px;\n`;\n\nexport const StyleErrorMessage = styled.div<any>`\n font-size: 12px;\n font-weight: 400;\n padding-top: ${(props) => props.theme.space.xxxs};\n padding-bottom: ${(props) => props.theme.space.xxxs};\n color: ${(props) => props.theme.colors.danger[900]};\n align-items: flex-end;\n justify-content: center;\n text-align: right;\n line-height: 15px;\n svg {\n fill: ${(props) => props.theme.colors.danger[900]};\n }\n a {\n font-size: 12px;\n color: ${(props) => props.theme.colors.danger[900]};\n }\n .em-ds-icon {\n margin-left: 8px;\n }\n`;\n\nexport const StyleHelpMessage = styled(StyleErrorMessage)`\n font-size: 12px;\n line-height: 15px;\n color: ${(props) => props.theme.colors.neutral[500]};\n svg {\n fill: ${(props) => props.theme.colors.danger[500]};\n }\n a {\n font-size: 12px;\n color: ${(props) => props.theme.colors.danger[500]};\n }\n`;\n\n// bubble sender/ recipient\nexport const StyledBubbleArrow = styled.div<any>`\n display: block;\n content: '';\n position: absolute;\n bottom: 10px;\n height: 15px;\n`;\n\nexport const StyledColoredBubble = styled.div<any>`\n min-width: 224px;\n border-radius: 10px;\n position: relative;\n\n ${(props) =>\n props.type === BUBBLE_TYPES.SENDER\n ? `\n border: 1px solid ${props.theme.colors.brand['700']};\n background: ${props.theme.colors.brand[600]};\n color: ${props.theme.colors.neutral['000']};\n ${StyledBubbleArrow}{ \n right: -9px;\n bottom: 6px;\n svg{\n fill: ${props.theme.colors.brand[600]};\n }\n }\n\n `\n : `\n box-shadow: 0 1px 3px 0 rgba(53,60,70,0.80);\n background: ${props.theme.colors.neutral['000']};\n color: ${props.theme.colors.neutral[700]};\n\n ${StyledBubbleArrow}{ \n left: -11px;\n bottom: 6px;\n svg{\n fill: ${props.theme.colors.neutral['000']};\n }\n }\n\n `}\n`;\n"],"names":["StyledWrapper","styled","div","StyledTitleBubble","Grid","StyledTitleLeftBubble","StyledTitleRightBubble","props","type","BUBBLE_TYPES","SENDER","StyleBodyWrapper","StyleErrorMessage","theme","space","xxxs","colors","danger","StyleHelpMessage","neutral","StyledBubbleArrow","StyledColoredBubble","brand"],"mappings":";;;;;;;;;;;;;;;AAAA;;IAMaA,aAAa,gBAAGC,0BAAM,CAACC,GAAV;AAAA;AAAA;;IAMbC,iBAAiB,gBAAGF,0BAAM,CAACG,WAAD,CAAT;AAAA;AAAA;IAOjBC,qBAAqB,gBAAGJ,0BAAM,CAACG,WAAD,CAAT;AAAA;AAAA;IAIrBE,sBAAsB,gBAAGL,0BAAM,CAACG,WAAD,CAAT;AAAA;AAAA,mDAGxB,UAACG,KAAD;AAAA,SAAYA,KAAK,CAACC,IAAN,KAAeC,+BAAY,CAACC,MAA5B,GAAqC,MAArC,GAA8C,SAA1D;AAAA,CAHwB;IAMtBC,gBAAgB,gBAAGV,0BAAM,CAACC,GAAV;AAAA;AAAA;IAQhBU,iBAAiB,gBAAGX,0BAAM,CAACC,GAAV;AAAA;AAAA,+OAGb,UAACK,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,CAAYC,KAAZ,CAAkBC,IAA7B;AAAA,CAHa,EAIV,UAACR,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,CAAYC,KAAZ,CAAkBC,IAA7B;AAAA,CAJU,EAKnB,UAACR,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBC,MAAnB,CAA0B,GAA1B,CAAX;AAAA,CALmB,EAWlB,UAACV,KAAD;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AAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBG,OAAnB,CAA2B,GAA3B,CAjBb,0BAmBMC,iBAnBN,wHAuBoBb,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBG,OAAnB,CAA2B,KAA3B,CAvBpB,wCADA;AAAA,CAL4B;;;;;;;;;;;;"}
1
+ {"version":3,"file":"styled.js","sources":["../../../../src/parts/bubble/styled.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { BUBBLE_TYPES } from './props';\n\n// Bubble WRAPPER\nexport const StyledWrapper = styled.div<any>`\n min-width: 224px;\n border-radius: 10px;\n`;\n\n// Bubble HEADER\nexport const StyledTitleBubble = styled(Grid)`\n padding-top: 6px;\n padding-left: 10px;\n padding-right: 10px;\n padding-bottom: 4px;\n`;\n\nexport const StyledTitleLeftBubble = styled(Grid)`\n font-size: 13px;\n font-weight: 600;\n`;\nexport const StyledTitleRightBubble = styled(Grid)`\n font-size: 13px;\n font-weight: 400;\n color: ${(props) => (props.type === BUBBLE_TYPES.SENDER ? '#FFF' : '#657489')};\n`;\n\nexport const StyleBodyWrapper = styled.div<any>`\n font-size: 13px;\n font-weight: 400;\n line-height: 15px;\n min-height: 32px;\n padding: 0px 10px 8px 10px;\n`;\n\nexport const StyleErrorMessage = styled.div<any>`\n font-size: 12px;\n font-weight: 400;\n padding-top: ${(props) => props.theme.space.xxxs};\n padding-bottom: ${(props) => props.theme.space.xxxs};\n color: ${(props) => props.theme.colors.danger[900]};\n align-items: flex-end;\n justify-content: center;\n text-align: right;\n line-height: 15px;\n svg {\n fill: ${(props) => props.theme.colors.danger[900]};\n }\n a {\n font-size: 12px;\n color: ${(props) => props.theme.colors.danger[900]};\n }\n .em-ds-icon {\n margin-left: 8px;\n }\n`;\n\nexport const StyleHelpMessage = styled(StyleErrorMessage)`\n font-size: 12px;\n line-height: 15px;\n color: ${(props) => props.theme.colors.neutral[500]};\n svg {\n fill: ${(props) => props.theme.colors.danger[500]};\n }\n a {\n font-size: 12px;\n color: ${(props) => props.theme.colors.danger[500]};\n }\n`;\n\n// bubble sender/ recipient\nexport const StyledBubbleArrow = styled.div<any>`\n display: block;\n content: '';\n position: absolute;\n bottom: 10px;\n height: 15px;\n`;\n\nexport const StyledColoredBubble = styled.div<any>`\n min-width: 224px;\n border-radius: 10px;\n position: relative;\n\n ${(props) =>\n props.type === BUBBLE_TYPES.SENDER\n ? `\n border: 1px solid ${props.theme.colors.brand['700']};\n background: ${props.theme.colors.brand[600]};\n color: ${props.theme.colors.neutral['000']};\n ${StyledBubbleArrow}{ \n right: -9px;\n bottom: 6px;\n svg{\n fill: ${props.theme.colors.brand[600]};\n }\n }\n\n a {\n color: #FFF;\n }\n\n `\n : `\n box-shadow: 0 1px 3px 0 rgba(53,60,70,0.80);\n background: ${props.theme.colors.neutral['000']};\n color: ${props.theme.colors.neutral[700]};\n\n ${StyledBubbleArrow}{ \n left: -11px;\n bottom: 6px;\n svg{\n fill: ${props.theme.colors.neutral['000']};\n }\n }\n\n `}\n`;\n"],"names":["StyledWrapper","styled","div","StyledTitleBubble","Grid","StyledTitleLeftBubble","StyledTitleRightBubble","props","type","BUBBLE_TYPES","SENDER","StyleBodyWrapper","StyleErrorMessage","theme","space","xxxs","colors","danger","StyleHelpMessage","neutral","StyledBubbleArrow","StyledColoredBubble","brand"],"mappings":";;;;;;;;;;;;;;;AAAA;;IAMaA,aAAa,gBAAGC,0BAAM,CAACC,GAAV;AAAA;AAAA;;IAMbC,iBAAiB,gBAAGF,0BAAM,CAACG,WAAD,CAAT;AAAA;AAAA;IAOjBC,qBAAqB,gBAAGJ,0BAAM,CAACG,WAAD,CAAT;AAAA;AAAA;IAIrBE,sBAAsB,gBAAGL,0BAAM,CAACG,WAAD,CAAT;AAAA;AAAA,mDAGxB,UAACG,KAAD;AAAA,SAAYA,KAAK,CAACC,IAAN,KAAeC,+BAAY,CAACC,MAA5B,GAAqC,MAArC,GAA8C,SAA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AeC,+BAAY,CAACC,MAA5B,yCAEwBH,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBM,KAAnB,CAAyB,KAAzB,CAFxB,oCAGkBf,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBM,KAAnB,CAAyB,GAAzB,CAHlB,+BAIaf,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBG,OAAnB,CAA2B,KAA3B,CAJb,wBAKMC,iBALN,wHASoBb,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBM,KAAnB,CAAyB,GAAzB,CATpB,mLAoBkBf,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBG,OAAnB,CAA2B,KAA3B,CApBlB,+BAqBaZ,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBG,OAAnB,CAA2B,GAA3B,CArBb,0BAuBMC,iBAvBN,wHA2BoBb,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBG,OAAnB,CAA2B,KAA3B,CA3BpB,wCADA;AAAA,CAL4B;;;;;;;;;;;;"}
@@ -4,9 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var reactDesc = require('react-desc');
7
- var parts_chatCard_props = require('./props.js');
8
7
  var dsTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
8
+ var parts_chatCard_props = require('./props.js');
9
+ var parts_chatCard_config_useValidateProps = require('./config/useValidateProps.js');
9
10
  var parts_chatCard_styled = require('./styled.js');
11
+ require('@elliemae/ds-props-helpers');
10
12
  require('styled-components');
11
13
  require('@elliemae/ds-grid');
12
14
 
@@ -14,11 +16,12 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
14
16
 
15
17
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
18
 
17
- var ChatCard = function ChatCard(_ref) {
18
- var title = _ref.title,
19
- content = _ref.content,
20
- time = _ref.time,
21
- rightAddon = _ref.rightAddon;
19
+ var ChatCard = function ChatCard(props) {
20
+ parts_chatCard_config_useValidateProps.useValidateProps(props, ChatCardWithSchema.toJSON());
21
+ var title = props.title,
22
+ content = props.content,
23
+ time = props.time,
24
+ rightAddon = props.rightAddon;
22
25
  return /*#__PURE__*/React__default['default'].createElement(parts_chatCard_styled.Wrapper, {
23
26
  cols: ['1fr', 'auto'],
24
27
  "data-testid": "chat-card-wrapper"
@@ -1 +1 @@
1
- {"version":3,"file":"ChatCard.js","sources":["../../../../src/parts/chat-card/ChatCard.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\nimport { propTypes, CardPropTypes } from './props';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport {\n Wrapper,\n MainContent,\n Title,\n Content,\n Time,\n RightAddon,\n} from './styled';\n\nconst ChatCard = ({\n title,\n content,\n time,\n rightAddon,\n}: CardPropTypes): JSX.Element => (\n <Wrapper cols={['1fr', 'auto']} data-testid=\"chat-card-wrapper\">\n <MainContent>\n <Title data-testid=\"chat-card-title\">{title}</Title>\n <Content data-testid=\"chat-card-content\">\n <SimpleTruncatedTooltipText value={content} />\n </Content>\n {time && <Time data-testid=\"chat-card-time\">{time}</Time>}\n </MainContent>\n {rightAddon && <RightAddon data-testid=\"chat-card-right-addon\">{rightAddon}</RightAddon>}\n </Wrapper>\n);\n\nChatCard.propTypes = propTypes;\nconst ChatCardWithSchema = describe(ChatCard);\nChatCardWithSchema.propTypes = propTypes;\n\nexport { ChatCard, ChatCardWithSchema };\n"],"names":["ChatCard","title","content","time","rightAddon","React","Wrapper","MainContent","Title","Content","SimpleTruncatedTooltipText","Time","RightAddon","propTypes","ChatCardWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;IAaMA,QAAQ,GAAG,SAAXA,QAAW;AAAA,MACfC,KADe,QACfA,KADe;AAAA,MAEfC,OAFe,QAEfA,OAFe;AAAA,MAGfC,IAHe,QAGfA,IAHe;AAAA,MAIfC,UAJe,QAIfA,UAJe;AAAA,sBAMfC,wCAACC,6BAAD;AAAS,IAAA,IAAI,EAAE,CAAC,KAAD,EAAQ,MAAR,CAAf;AAAgC,mBAAY;AAA5C,kBACED,wCAACE,iCAAD,qBACEF,wCAACG,2BAAD;AAAO,mBAAY;AAAnB,KAAsCP,KAAtC,CADF,eAEEI,wCAACI,6BAAD;AAAS,mBAAY;AAArB,kBACEJ,wCAACK,iDAAD;AAA4B,IAAA,KAAK,EAAER;AAAnC,IADF,CAFF,EAKGC,IAAI,iBAAIE,wCAACM,0BAAD;AAAM,mBAAY;AAAlB,KAAoCR,IAApC,CALX,CADF,EAQGC,UAAU,iBAAIC,wCAACO,gCAAD;AAAY,mBAAY;AAAxB,KAAiDR,UAAjD,CARjB,CANe;AAAA;;AAkBjBJ,QAAQ,CAACa,SAAT,GAAqBA,8BAArB;IACMC,kBAAkB,GAAGC,kBAAQ,CAACf,QAAD;AACnCc,kBAAkB,CAACD,SAAnB,GAA+BA,8BAA/B;;;;;"}
1
+ {"version":3,"file":"ChatCard.js","sources":["../../../../src/parts/chat-card/ChatCard.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\n\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { propTypes, CardPropTypes } from './props';\nimport { useValidateProps } from './config/useValidateProps';\nimport { Wrapper, MainContent, Title, Content, Time, RightAddon } from './styled';\n\nconst ChatCard = (props: CardPropTypes): JSX.Element => {\n useValidateProps(props, ChatCardWithSchema.toJSON());\n const { title, content, time, rightAddon } = props;\n return (\n <Wrapper cols={['1fr', 'auto']} data-testid=\"chat-card-wrapper\">\n <MainContent>\n <Title data-testid=\"chat-card-title\">{title}</Title>\n <Content data-testid=\"chat-card-content\">\n <SimpleTruncatedTooltipText value={content} />\n </Content>\n {time && <Time data-testid=\"chat-card-time\">{time}</Time>}\n </MainContent>\n {rightAddon && <RightAddon data-testid=\"chat-card-right-addon\">{rightAddon}</RightAddon>}\n </Wrapper>\n );\n};\n\nChatCard.propTypes = propTypes;\nconst ChatCardWithSchema = describe(ChatCard);\nChatCardWithSchema.propTypes = propTypes;\n\nexport { ChatCard, ChatCardWithSchema };\n"],"names":["ChatCard","props","useValidateProps","ChatCardWithSchema","toJSON","title","content","time","rightAddon","React","Wrapper","MainContent","Title","Content","SimpleTruncatedTooltipText","Time","RightAddon","propTypes","describe"],"mappings":";;;;;;;;;;;;;;;;;;IAQMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAuC;AACtDC,EAAAA,uDAAgB,CAACD,KAAD,EAAQE,kBAAkB,CAACC,MAAnB,EAAR,CAAhB;AACA,MAAQC,KAAR,GAA6CJ,KAA7C,CAAQI,KAAR;AAAA,MAAeC,OAAf,GAA6CL,KAA7C,CAAeK,OAAf;AAAA,MAAwBC,IAAxB,GAA6CN,KAA7C,CAAwBM,IAAxB;AAAA,MAA8BC,UAA9B,GAA6CP,KAA7C,CAA8BO,UAA9B;AACA,sBACEC,wCAACC,6BAAD;AAAS,IAAA,IAAI,EAAE,CAAC,KAAD,EAAQ,MAAR,CAAf;AAAgC,mBAAY;AAA5C,kBACED,wCAACE,iCAAD,qBACEF,wCAACG,2BAAD;AAAO,mBAAY;AAAnB,KAAsCP,KAAtC,CADF,eAEEI,wCAACI,6BAAD;AAAS,mBAAY;AAArB,kBACEJ,wCAACK,iDAAD;AAA4B,IAAA,KAAK,EAAER;AAAnC,IADF,CAFF,EAKGC,IAAI,iBAAIE,wCAACM,0BAAD;AAAM,mBAAY;AAAlB,KAAoCR,IAApC,CALX,CADF,EAQGC,UAAU,iBAAIC,wCAACO,gCAAD;AAAY,mBAAY;AAAxB,KAAiDR,UAAjD,CARjB,CADF;AAYD;;AAEDR,QAAQ,CAACiB,SAAT,GAAqBA,8BAArB;IACMd,kBAAkB,GAAGe,kBAAQ,CAAClB,QAAD;AACnCG,kBAAkB,CAACc,SAAnB,GAA+BA,8BAA/B;;;;;"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var dsPropsHelpers = require('@elliemae/ds-props-helpers');
6
+
7
+ var useValidateProps = function useValidateProps(props, schema) {
8
+ dsPropsHelpers.useValidatePropTypes(props, schema);
9
+ };
10
+
11
+ exports.useValidateProps = useValidateProps;
12
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/chat-card/config/useValidateProps.tsx"],"sourcesContent":["import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { CardPropTypes } from '../props';\n\nexport const useValidateProps = (props: CardPropTypes, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n};\n"],"names":["useValidateProps","props","schema","useValidatePropTypes"],"mappings":";;;;;;IAGaA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAuBC,MAAvB,EAAiD;AAC/EC,EAAAA,mCAAoB,CAACF,KAAD,EAAQC,MAAR,CAApB;AACD;;;;"}
@@ -5,8 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var parts_chatCard_ChatCard = require('./ChatCard.js');
6
6
  require('react');
7
7
  require('react-desc');
8
- require('./props.js');
9
8
  require('@elliemae/ds-truncated-tooltip-text');
9
+ require('./props.js');
10
+ require('./config/useValidateProps.js');
11
+ require('@elliemae/ds-props-helpers');
10
12
  require('./styled.js');
11
13
  require('styled-components');
12
14
  require('@elliemae/ds-grid');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -8,7 +8,7 @@ var propTypes = {
8
8
  title: reactDesc.PropTypes.string.isRequired.description("Card's title"),
9
9
  content: reactDesc.PropTypes.string.description("Card's content"),
10
10
  time: reactDesc.PropTypes.string.description('Time'),
11
- rightAddon: reactDesc.PropTypes.node.description('Right addon, badge or icon')
11
+ rightAddon: reactDesc.PropTypes.element.description('Right addon, badge or icon')
12
12
  };
13
13
 
14
14
  exports.propTypes = propTypes;
@@ -1 +1 @@
1
- {"version":3,"file":"props.js","sources":["../../../../src/parts/chat-card/props.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n title: PropTypes.string.isRequired.description(`Card's title`),\n content: PropTypes.string.description(`Card's content`),\n time: PropTypes.string.description('Time'),\n rightAddon: PropTypes.node.description('Right addon, badge or icon'),\n};\n\nexport interface CardPropTypes {\n title: string;\n content: string;\n time: string;\n rightAddon: JSX.Element;\n}\n"],"names":["propTypes","title","PropTypes","string","isRequired","description","content","time","rightAddon","node"],"mappings":";;;;;;IAEaA,SAAS,GAAG;AACvBC,EAAAA,KAAK,EAAEC,mBAAS,CAACC,MAAV,CAAiBC,UAAjB,CAA4BC,WAA5B,gBADgB;AAEvBC,EAAAA,OAAO,EAAEJ,mBAAS,CAACC,MAAV,CAAiBE,WAAjB,kBAFc;AAGvBE,EAAAA,IAAI,EAAEL,mBAAS,CAACC,MAAV,CAAiBE,WAAjB,CAA6B,MAA7B,CAHiB;AAIvBG,EAAAA,UAAU,EAAEN,mBAAS,CAACO,IAAV,CAAeJ,WAAf,CAA2B,4BAA3B;AAJW;;;;"}
1
+ {"version":3,"file":"props.js","sources":["../../../../src/parts/chat-card/props.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n title: PropTypes.string.isRequired.description(`Card's title`),\n content: PropTypes.string.description(`Card's content`),\n time: PropTypes.string.description('Time'),\n rightAddon: PropTypes.element.description('Right addon, badge or icon'),\n};\n\nexport interface CardPropTypes {\n title: string;\n content: string;\n time: string;\n rightAddon: JSX.Element;\n}\n"],"names":["propTypes","title","PropTypes","string","isRequired","description","content","time","rightAddon","element"],"mappings":";;;;;;IAEaA,SAAS,GAAG;AACvBC,EAAAA,KAAK,EAAEC,mBAAS,CAACC,MAAV,CAAiBC,UAAjB,CAA4BC,WAA5B,gBADgB;AAEvBC,EAAAA,OAAO,EAAEJ,mBAAS,CAACC,MAAV,CAAiBE,WAAjB,kBAFc;AAGvBE,EAAAA,IAAI,EAAEL,mBAAS,CAACC,MAAV,CAAiBE,WAAjB,CAA6B,MAA7B,CAHiB;AAIvBG,EAAAA,UAAU,EAAEN,mBAAS,CAACO,OAAV,CAAkBJ,WAAlB,CAA8B,4BAA9B;AAJW;;;;"}
@@ -9,9 +9,11 @@ var dsGrid = require('@elliemae/ds-grid');
9
9
  var reactDesc = require('react-desc');
10
10
  var PaperAirplane = require('@elliemae/ds-icons/PaperAirplane');
11
11
  var parts_chatComposer_styled = require('./styled.js');
12
+ var parts_chatComposer_config_useValidateProps = require('./config/useValidateProps.js');
12
13
  var parts_chatComposer_props = require('./props.js');
13
14
  require('styled-components');
14
15
  require('@elliemae/ds-button');
16
+ require('@elliemae/ds-props-helpers');
15
17
  require('lodash');
16
18
 
17
19
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -28,6 +30,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
28
30
  var ChatComposer = function ChatComposer(props) {
29
31
  var _input$current;
30
32
 
33
+ parts_chatComposer_config_useValidateProps.useValidateProps(props, ChatComposerWithSchema.toJSON());
31
34
  var inputValue = props.inputValue,
32
35
  onChange = props.onChange,
33
36
  onResize = props.onResize,
@@ -39,9 +42,11 @@ var ChatComposer = function ChatComposer(props) {
39
42
  placeholder = props.placeholder,
40
43
  inputMaxLength = props.inputMaxLength,
41
44
  buttonDisabled = props.buttonDisabled,
42
- dataTestid = props.dataTestid;
45
+ dataTestid = props.dataTestid,
46
+ actionRef = props.actionRef;
43
47
  var input = React__default['default'].useRef();
44
48
  var inputSize = React__default['default'].useRef();
49
+ var inputSend = React__default['default'].useRef();
45
50
 
46
51
  var _React$useState = React__default['default'].useState(32),
47
52
  _React$useState2 = _slicedToArray__default['default'](_React$useState, 2),
@@ -65,6 +70,17 @@ var ChatComposer = function ChatComposer(props) {
65
70
  setHeight(newHeight);
66
71
  setShowScroll(((_inputSize$current3 = inputSize.current) === null || _inputSize$current3 === void 0 ? void 0 : _inputSize$current3.scrollHeight) - ((_inputSize$current4 = inputSize.current) === null || _inputSize$current4 === void 0 ? void 0 : _inputSize$current4.clientHeight) > 5);
67
72
  }, [inputValue, internalMaxHeight]);
73
+ React__default['default'].useEffect(function () {
74
+ if (actionRef && actionRef.current) {
75
+ actionRef.current.focusToComposer = function () {
76
+ input.current.focus();
77
+ };
78
+
79
+ actionRef.current.focusToSend = function () {
80
+ inputSend.current.focus();
81
+ };
82
+ }
83
+ }, [actionRef.current]);
68
84
  var handleChange = React__default['default'].useCallback(function (e) {
69
85
  onChange(e.target.value);
70
86
  }, [onChange]);
@@ -108,7 +124,8 @@ var ChatComposer = function ChatComposer(props) {
108
124
  size: "s",
109
125
  disabled: !inputValue || buttonDisabled || hasError,
110
126
  "data-testid": "chat-composer-send-button",
111
- "aria-label": "Send"
127
+ "aria-label": "Send",
128
+ innerRef: inputSend
112
129
  }))), /*#__PURE__*/React__default['default'].createElement(parts_chatComposer_styled.StyledComposerInput, {
113
130
  ref: inputSize,
114
131
  style: {
@@ -1 +1 @@
1
- {"version":3,"file":"ChatContainerComposer.js","sources":["../../../../src/parts/chat-composer/ChatContainerComposer.tsx"],"sourcesContent":["import React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from 'react-desc';\nimport PaperAirplane from '@elliemae/ds-icons/PaperAirplane';\nimport {\n StyledChatContainerContentComposer,\n StyledComposerInput,\n StyledComposerButton,\n StyledCounterArea,\n StyledCounterErrorA11y,\n} from './styled';\nimport { defaultComposerPros, composerProps, ChatComposerProps } from './props';\n\nconst ChatComposer = (props: ChatComposerProps): JSX.Element => {\n const {\n inputValue,\n onChange,\n onResize,\n onSend,\n onFocus,\n onBlur,\n maxHeight = 300,\n placeholder,\n inputMaxLength,\n buttonDisabled,\n dataTestid,\n } = props;\n\n const input = React.useRef<HTMLTextAreaElement>();\n const inputSize = React.useRef<HTMLTextAreaElement>();\n const [height, setHeight] = React.useState(32);\n const internalMaxHeight = React.useMemo(() => maxHeight - 24, [maxHeight]);\n const [showScroll, setShowScroll] = React.useState(true);\n\n React.useEffect(() => {\n const newHeight =\n inputSize.current?.scrollHeight > internalMaxHeight ? internalMaxHeight : inputSize.current?.scrollHeight;\n onResize(newHeight);\n setHeight(newHeight);\n setShowScroll(inputSize.current?.scrollHeight - inputSize.current?.clientHeight > 5);\n }, [inputValue, internalMaxHeight]);\n\n const handleChange = React.useCallback(\n (e) => {\n onChange(e.target.value);\n },\n [onChange],\n );\n const heightProps = { height, overflow: showScroll ? 'auto' : 'hidden' };\n\n const inputLength = String(inputValue || '').length;\n const hasError = React.useMemo(() => inputLength > inputMaxLength, [inputLength, inputMaxLength]);\n\n return (\n <StyledChatContainerContentComposer rows={['auto', '15px']} maxHeight={`${maxHeight}px`} data-testid={dataTestid}>\n <Grid cols={['1fr', '24px']} justifyContent=\"center\" alignItems=\"flex-end\" gutter=\"xxs\">\n <StyledComposerInput\n ref={input}\n onChange={handleChange}\n style={{ ...heightProps }}\n value={inputValue}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n aria-label=\"Message to send\"\n data-testid=\"chat-composer-textarea\"\n />\n\n <Grid height=\"32px\" alignItems=\"center\">\n <StyledComposerButton\n buttonType=\"text\"\n icon={<PaperAirplane width={18} height={18} />}\n onClick={onSend}\n size=\"s\"\n disabled={!inputValue || buttonDisabled || hasError}\n data-testid=\"chat-composer-send-button\"\n aria-label=\"Send\"\n />\n </Grid>\n </Grid>\n <StyledComposerInput\n ref={inputSize}\n style={{\n height: 32,\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: input.current?.clientWidth,\n }}\n onChange={handleChange}\n value={inputValue}\n // maxLength={inputMaxLength}\n />\n <Grid cols={['1fr', '24px']} justifyContent=\"flex-end\" alignItems=\"center\" gutter=\"xxs\" pb=\"xxs\">\n <StyledCounterArea hasError={hasError} data-testid=\"composer-counter-area\">\n {inputMaxLength && hasError ? (\n <>\n <StyledCounterErrorA11y role=\"alert\">\n You have exceeded the character limit by {inputLength - inputMaxLength}\n </StyledCounterErrorA11y>\n Please limit to less than {inputMaxLength} characters.{' '}\n </>\n ) : (\n ''\n )}\n {inputMaxLength ? `${inputLength} / ${inputMaxLength}` : ''}\n </StyledCounterArea>\n <Grid />\n </Grid>\n </StyledChatContainerContentComposer>\n );\n};\n\nChatComposer.propTypes = composerProps;\nChatComposer.defaultProps = defaultComposerPros;\nconst ChatComposerWithSchema = describe(ChatComposer);\nChatComposerWithSchema.propTypes = composerProps;\n\nexport { ChatComposer, ChatComposerWithSchema };\n"],"names":["ChatComposer","props","inputValue","onChange","onResize","onSend","onFocus","onBlur","maxHeight","placeholder","inputMaxLength","buttonDisabled","dataTestid","input","React","useRef","inputSize","useState","height","setHeight","internalMaxHeight","useMemo","showScroll","setShowScroll","useEffect","newHeight","current","scrollHeight","clientHeight","handleChange","useCallback","e","target","value","heightProps","overflow","inputLength","String","length","hasError","StyledChatContainerContentComposer","Grid","StyledComposerInput","StyledComposerButton","PaperAirplane","visibility","pointerEvents","position","top","width","clientWidth","StyledCounterArea","StyledCounterErrorA11y","propTypes","composerProps","defaultProps","defaultComposerPros","ChatComposerWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;IAaMA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAA2C;AAAA;;AAC9D,MACEC,UADF,GAYID,KAZJ,CACEC,UADF;AAAA,MAEEC,QAFF,GAYIF,KAZJ,CAEEE,QAFF;AAAA,MAGEC,QAHF,GAYIH,KAZJ,CAGEG,QAHF;AAAA,MAIEC,MAJF,GAYIJ,KAZJ,CAIEI,MAJF;AAAA,MAKEC,OALF,GAYIL,KAZJ,CAKEK,OALF;AAAA,MAMEC,MANF,GAYIN,KAZJ,CAMEM,MANF;AAAA,yBAYIN,K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AdF,CAxCF,CADF;AA2DD;;AAEDzC,YAAY,CAACqD,SAAb,GAAyBC,sCAAzB;AACAtD,YAAY,CAACuD,YAAb,GAA4BC,4CAA5B;IACMC,sBAAsB,GAAGC,kBAAQ,CAAC1D,YAAD;AACvCyD,sBAAsB,CAACJ,SAAvB,GAAmCC,sCAAnC;;;;;"}
1
+ {"version":3,"file":"ChatContainerComposer.js","sources":["../../../../src/parts/chat-composer/ChatContainerComposer.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from 'react-desc';\nimport PaperAirplane from '@elliemae/ds-icons/PaperAirplane';\nimport {\n StyledChatContainerContentComposer,\n StyledComposerInput,\n StyledComposerButton,\n StyledCounterArea,\n StyledCounterErrorA11y,\n} from './styled';\nimport { useValidateProps } from './config/useValidateProps';\n\nimport { defaultComposerPros, composerProps, ChatComposerProps } from './props';\n\nconst ChatComposer = (props: ChatComposerProps): JSX.Element => {\n useValidateProps(props, ChatComposerWithSchema.toJSON());\n\n const {\n inputValue,\n onChange,\n onResize,\n onSend,\n onFocus,\n onBlur,\n maxHeight = 300,\n placeholder,\n inputMaxLength,\n buttonDisabled,\n dataTestid,\n actionRef,\n } = props;\n\n const input = React.useRef<HTMLTextAreaElement>();\n const inputSize = React.useRef<HTMLTextAreaElement>();\n const inputSend = React.useRef<HTMLButtonElement>();\n const [height, setHeight] = React.useState(32);\n const internalMaxHeight = React.useMemo(() => maxHeight - 24, [maxHeight]);\n const [showScroll, setShowScroll] = React.useState(true);\n\n React.useEffect(() => {\n const newHeight =\n inputSize.current?.scrollHeight > internalMaxHeight ? internalMaxHeight : inputSize.current?.scrollHeight;\n onResize(newHeight);\n setHeight(newHeight);\n setShowScroll(inputSize.current?.scrollHeight - inputSize.current?.clientHeight > 5);\n }, [inputValue, internalMaxHeight]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToComposer = () => {\n input.current.focus();\n };\n actionRef.current.focusToSend = () => {\n inputSend.current.focus();\n };\n }\n }, [actionRef.current]);\n\n const handleChange = React.useCallback(\n (e) => {\n onChange(e.target.value);\n },\n [onChange],\n );\n const heightProps = { height, overflow: showScroll ? 'auto' : 'hidden' };\n\n const inputLength = String(inputValue || '').length;\n const hasError = React.useMemo(() => inputLength > inputMaxLength, [inputLength, inputMaxLength]);\n\n return (\n <StyledChatContainerContentComposer rows={['auto', '15px']} maxHeight={`${maxHeight}px`} data-testid={dataTestid}>\n <Grid cols={['1fr', '24px']} justifyContent=\"center\" alignItems=\"flex-end\" gutter=\"xxs\">\n <StyledComposerInput\n ref={input}\n onChange={handleChange}\n style={{ ...heightProps }}\n value={inputValue}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n aria-label=\"Message to send\"\n data-testid=\"chat-composer-textarea\"\n />\n\n <Grid height=\"32px\" alignItems=\"center\">\n <StyledComposerButton\n buttonType=\"text\"\n icon={<PaperAirplane width={18} height={18} />}\n onClick={onSend}\n size=\"s\"\n disabled={!inputValue || buttonDisabled || hasError}\n data-testid=\"chat-composer-send-button\"\n aria-label=\"Send\"\n innerRef={inputSend}\n />\n </Grid>\n </Grid>\n <StyledComposerInput\n ref={inputSize}\n style={{\n height: 32,\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: input.current?.clientWidth,\n }}\n onChange={handleChange}\n value={inputValue}\n // maxLength={inputMaxLength}\n />\n <Grid cols={['1fr', '24px']} justifyContent=\"flex-end\" alignItems=\"center\" gutter=\"xxs\" pb=\"xxs\">\n <StyledCounterArea hasError={hasError} data-testid=\"composer-counter-area\">\n {inputMaxLength && hasError ? (\n <>\n <StyledCounterErrorA11y role=\"alert\">\n You have exceeded the character limit by {inputLength - inputMaxLength}\n </StyledCounterErrorA11y>\n Please limit to less than {inputMaxLength} characters.{' '}\n </>\n ) : (\n ''\n )}\n {inputMaxLength ? `${inputLength} / ${inputMaxLength}` : ''}\n </StyledCounterArea>\n <Grid />\n </Grid>\n </StyledChatContainerContentComposer>\n );\n};\n\nChatComposer.propTypes = composerProps;\nChatComposer.defaultProps = defaultComposerPros;\nconst ChatComposerWithSchema = describe(ChatComposer);\nChatComposerWithSchema.propTypes = composerProps;\n\nexport { ChatComposer, ChatComposerWithSchema };\n"],"names":["ChatComposer","props","useValidateProps","ChatComposerWithSchema","toJSON","inputValue","onChange","onResize","onSend","onFocus","onBlur","maxHeight","placeholder","inputMaxLength","buttonDisabled","dataTestid","actionRef","input","React","useRef","inputSize","inputSend","useState","height","setHeight","internalMaxHeight","useMemo","showScroll","setShowScroll","useEffect","newHeight","current","scrollHeight","clientHeight","focusToComposer","focus","focusToSend","handleChange","useCallback","e","target","value","heightProps","overflow","inputLength","String","length","hasError","StyledChatContainerContentComposer","Grid","StyledComposerInput","StyledComposerButton","PaperAirplane","visibility","pointerEvents","position","top","width","clientWidth","StyledCounterArea","StyledCounterErrorA11y","propTypes","composerProps","defaultProps","defaultComposerPros","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgBMA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAA2C;AAAA;;AAC9DC,EAAAA,2DAAgB,CAACD,KAAD,EAAQE,sBAAsB,CAACC,MAAvB,EAAR,CAAhB;AAEA,MACEC,UADF,GAaIJ,KAbJ,CACEI,UADF;AAAA,MAEEC,QAFF,GAaIL,KAbJ,CAEEK,QAFF;AAAA,MAGEC,QAHF,GAaIN,KAbJ,CAGEM,QAHF;AAAA,MAIEC,MAJF,GAaIP,KAbJ,CAIEO,MAJF;AAAA,MAKEC,OALF,GAaIR,KAbJ,CAKEQ,OALF;AAAA,MAMEC,MANF,GAaIT,KAbJ,CAMES,MANF;AAAA,yBAaIT,KAbJ,CAOEU,SAPF;AAAA,MAOEA,SAPF,iCAOc,GAPd;AAAA,MAQEC,WARF,GAaIX,KAbJ,CAQEW,WARF;AAAA,MASEC,cATF,GAaIZ,KAbJ,CASEY,cATF;AAAA,MAUEC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AAE,EAAC;AAA3F,kBACE/B,wCAACyC,2CAAD;AAAmB,IAAA,QAAQ,EAAEZ,QAA7B;AAAuC,mBAAY;AAAnD,KACGlC,cAAc,IAAIkC,QAAlB,gBACC7B,+FACEA,wCAAC0C,gDAAD;AAAwB,IAAA,IAAI,EAAC;AAA7B,kDAC4ChB,WAAW,GAAG/B,cAD1D,CADF,gCAI6BA,cAJ7B,kBAIyD,GAJzD,CADD,GAQC,EATJ,EAWGA,cAAc,aAAM+B,WAAN,gBAAuB/B,cAAvB,IAA0C,EAX3D,CADF,eAcEK,wCAAC+B,WAAD,OAdF,CAzCF,CADF;AA4DD;;AAEDjD,YAAY,CAAC6D,SAAb,GAAyBC,sCAAzB;AACA9D,YAAY,CAAC+D,YAAb,GAA4BC,4CAA5B;IACM7D,sBAAsB,GAAG8D,kBAAQ,CAACjE,YAAD;AACvCG,sBAAsB,CAAC0D,SAAvB,GAAmCC,sCAAnC;;;;;"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var dsPropsHelpers = require('@elliemae/ds-props-helpers');
6
+
7
+ var useValidateProps = function useValidateProps(props, schema) {
8
+ dsPropsHelpers.useValidatePropTypes(props, schema);
9
+ };
10
+
11
+ exports.useValidateProps = useValidateProps;
12
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/chat-composer/config/useValidateProps.tsx"],"sourcesContent":["import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { ChatComposerProps } from '../props';\n\nexport const useValidateProps = (props: ChatComposerProps, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n};\n"],"names":["useValidateProps","props","schema","useValidatePropTypes"],"mappings":";;;;;;IAGaA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAA2BC,MAA3B,EAAqD;AACnFC,EAAAA,mCAAoB,CAACF,KAAD,EAAQC,MAAR,CAApB;AACD;;;;"}
@@ -12,6 +12,8 @@ require('@elliemae/ds-icons/PaperAirplane');
12
12
  require('./styled.js');
13
13
  require('styled-components');
14
14
  require('@elliemae/ds-button');
15
+ require('./config/useValidateProps.js');
16
+ require('@elliemae/ds-props-helpers');
15
17
  require('./props.js');
16
18
  require('lodash');
17
19
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -16,7 +16,8 @@ var defaultComposerPros = {
16
16
  maxHeight: 0,
17
17
  inputMaxLength: undefined,
18
18
  buttonDisabled: false,
19
- dataTestid: 'ds-chat-composer'
19
+ dataTestid: 'ds-chat-composer',
20
+ actionRef: lodash.noop
20
21
  };
21
22
  var composerProps = {
22
23
  placeholder: reactDesc.PropTypes.string.description('Input Placeholder').defaultValue(defaultComposerPros.placeholder),
@@ -25,11 +26,12 @@ var composerProps = {
25
26
  onResize: reactDesc.PropTypes.func.description('Called the input changes his height').defaultValue(defaultComposerPros.onResize),
26
27
  onSend: reactDesc.PropTypes.func.description('Called when the click send').defaultValue(defaultComposerPros.onSend),
27
28
  onFocus: reactDesc.PropTypes.func.description('Input focus').defaultValue(defaultComposerPros.onFocus),
28
- onBlur: reactDesc.PropTypes.string.description('Input blur').defaultValue(defaultComposerPros.onBlur),
29
+ onBlur: reactDesc.PropTypes.func.description('Input blur').defaultValue(defaultComposerPros.onBlur),
29
30
  maxHeight: reactDesc.PropTypes.number.description('Max height of the composer. Use 0 for no limit').defaultValue(defaultComposerPros.onBlur),
30
31
  inputMaxLength: reactDesc.PropTypes.number.description('Max length of the composer. `undefined` for no limit').defaultValue(defaultComposerPros.inputMaxLength),
31
- buttonDisabled: reactDesc.PropTypes.number.description('Control the disabled for the send button').defaultValue(defaultComposerPros.buttonDisabled),
32
- dataTestid: reactDesc.PropTypes.string.description('Data testid').defaultValue(defaultComposerPros.placeholder)
32
+ buttonDisabled: reactDesc.PropTypes.bool.description('Control the disabled for the send button').defaultValue(defaultComposerPros.buttonDisabled),
33
+ dataTestid: reactDesc.PropTypes.string.description('Data testid').defaultValue(defaultComposerPros.placeholder),
34
+ actionRef: reactDesc.PropTypes.object.description("Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n ").defaultValue(defaultComposerPros.actionRef)
33
35
  };
34
36
 
35
37
  exports.composerProps = composerProps;
@@ -1 +1 @@
1
- {"version":3,"file":"props.js","sources":["../../../../src/parts/chat-composer/props.tsx"],"sourcesContent":["import React from 'react';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\n\nexport interface TextAreaProps {\n height: string | number;\n style: React.CSSProperties;\n}\n\nexport const defaultComposerPros: ChatComposerProps = {\n placeholder: 'Type your message',\n inputValue: '',\n onChange: noop,\n onResize: noop,\n onSend: noop,\n onFocus: noop,\n onBlur: noop,\n maxHeight: 0,\n inputMaxLength: undefined,\n buttonDisabled: false,\n dataTestid: 'ds-chat-composer',\n};\n\nexport interface ChatComposerProps {\n placeholder: 'Type your message';\n inputValue: '';\n onChange: (value: string) => void;\n onResize: (value: number) => void;\n onSend: (value: string) => void;\n onFocus: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onBlur: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n maxHeight: number;\n inputMaxLength: number | undefined;\n buttonDisabled: boolean;\n dataTestid?: string;\n}\n\nexport const composerProps = {\n placeholder: PropTypes.string.description('Input Placeholder').defaultValue(defaultComposerPros.placeholder),\n inputValue: PropTypes.string.description('Input value').defaultValue(defaultComposerPros.inputValue),\n onChange: PropTypes.func.description('Called when the user types').defaultValue(defaultComposerPros.onChange),\n onResize: PropTypes.func\n .description('Called the input changes his height')\n .defaultValue(defaultComposerPros.onResize),\n onSend: PropTypes.func.description('Called when the click send').defaultValue(defaultComposerPros.onSend),\n onFocus: PropTypes.func.description('Input focus').defaultValue(defaultComposerPros.onFocus),\n onBlur: PropTypes.string.description('Input blur').defaultValue(defaultComposerPros.onBlur),\n maxHeight: PropTypes.number\n .description('Max height of the composer. Use 0 for no limit')\n .defaultValue(defaultComposerPros.onBlur),\n inputMaxLength: PropTypes.number\n .description('Max length of the composer. `undefined` for no limit')\n .defaultValue(defaultComposerPros.inputMaxLength),\n buttonDisabled: PropTypes.number\n .description('Control the disabled for the send button')\n .defaultValue(defaultComposerPros.buttonDisabled),\n dataTestid: PropTypes.string.description('Data testid').defaultValue(defaultComposerPros.placeholder),\n};\n"],"names":["defaultComposerPros","placeholder","inputValue","onChange","noop","onResize","onSend","onFocus","onBlur","maxHeight","inputMaxLength","undefined","buttonDisabled","dataTestid","composerProps","PropTypes","string","description","defaultValue","func","number"],"mappings":";;;;;;;IASaA,mBAAsC,GAAG;AACpDC,EAAAA,WAAW,EAAE,mBADuC;AAEpDC,EAAAA,UAAU,EAAE,EAFwC;AAGpDC,EAAAA,QAAQ,EAAEC,WAH0C;AAIpDC,EAAAA,QAAQ,EAAED,WAJ0C;AAKpDE,EAAAA,MAAM,EAAEF,WAL4C;AAMpDG,EAAAA,OAAO,EAAEH,WAN2C;AAOpDI,EAAAA,MAAM,EAAEJ,WAP4C;AAQpDK,EAAAA,SAAS,EAAE,CARyC;AASpDC,EAAAA,cAAc,EAAEC,SAToC;AAUpDC,EAAAA,cAAc,EAAE,KAVoC;AAWpDC,EAAAA,UAAU,EAAE;AAXwC;IA4BzCC,aAAa,GAAG;AAC3Bb,EAAAA,WAAW,EAAEc,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,mBAA7B,EAAkDC,YAAlD,CAA+DlB,mBAAmB,CAACC,WAAnF,CADc;AAE3BC,EAAAA,UAAU,EAAEa,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,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file":"props.js","sources":["../../../../src/parts/chat-composer/props.tsx"],"sourcesContent":["import React from 'react';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\n\nexport interface TextAreaProps {\n height: string | number;\n style: React.CSSProperties;\n}\n\nexport const defaultComposerPros: ChatComposerProps = {\n placeholder: 'Type your message',\n inputValue: '',\n onChange: noop,\n onResize: noop,\n onSend: noop,\n onFocus: noop,\n onBlur: noop,\n maxHeight: 0,\n inputMaxLength: undefined,\n buttonDisabled: false,\n dataTestid: 'ds-chat-composer',\n actionRef: noop,\n};\n\nexport interface ChatComposerProps {\n placeholder: 'Type your message';\n inputValue: '';\n onChange: (value: string) => void;\n onResize: (value: number) => void;\n onSend: (value: string) => void;\n onFocus: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onBlur: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n maxHeight: number;\n inputMaxLength: number | undefined;\n buttonDisabled: boolean;\n dataTestid?: string;\n actionRef: PropTypes.func;\n}\n\nexport const composerProps = {\n placeholder: PropTypes.string.description('Input Placeholder').defaultValue(defaultComposerPros.placeholder),\n inputValue: PropTypes.string.description('Input value').defaultValue(defaultComposerPros.inputValue),\n onChange: PropTypes.func.description('Called when the user types').defaultValue(defaultComposerPros.onChange),\n onResize: PropTypes.func\n .description('Called the input changes his height')\n .defaultValue(defaultComposerPros.onResize),\n onSend: PropTypes.func.description('Called when the click send').defaultValue(defaultComposerPros.onSend),\n onFocus: PropTypes.func.description('Input focus').defaultValue(defaultComposerPros.onFocus),\n onBlur: PropTypes.func.description('Input blur').defaultValue(defaultComposerPros.onBlur),\n maxHeight: PropTypes.number\n .description('Max height of the composer. Use 0 for no limit')\n .defaultValue(defaultComposerPros.onBlur),\n inputMaxLength: PropTypes.number\n .description('Max length of the composer. `undefined` for no limit')\n .defaultValue(defaultComposerPros.inputMaxLength),\n buttonDisabled: PropTypes.bool\n .description('Control the disabled for the send button')\n .defaultValue(defaultComposerPros.buttonDisabled),\n dataTestid: PropTypes.string.description('Data testid').defaultValue(defaultComposerPros.placeholder),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultComposerPros.actionRef),\n};\n"],"names":["defaultComposerPros","placeholder","inputValue","onChange","noop","onResize","onSend","onFocus","onBlur","maxHeight","inputMaxLength","undefined","buttonDisabled","dataTestid","actionRef","composerProps","PropTypes","string","description","defaultValue","func","number","bool","object"],"mappings":";;;;;;;IASaA,mBAAsC,GAAG;AACpDC,EAAAA,WAAW,EAAE,mBADuC;AAEpDC,EAAAA,UAAU,EAAE,EAFwC;AAGpDC,EAAAA,QAAQ,EAAEC,WAH0C;AAIpDC,EAAAA,QAAQ,EAAED,WAJ0C;AAKpDE,EAAAA,MAAM,EAAEF,WAL4C;AAMpDG,EAAAA,OAAO,EAAEH,WAN2C;AAOpDI,EAAAA,MAAM,EAAEJ,WAP4C;AAQpDK,EAAAA,SAAS,EAAE,CARyC;AASpDC,EAAAA,cAAc,EAAEC,SAToC;AAUpDC,EAAAA,cAAc,EAAE,KAVoC;AAWpDC,EAAAA,UAAU,EAAE,kBAXwC;AAYpDC,EAAAA,SAAS,EAAEV;AAZyC;IA8BzCW,aAAa,GAAG;AAC3Bd,EAAAA,WAAW,EAAEe,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,mBAA7B,EAAkDC,YAAlD,CAA+DnB,mBAAmB,CAACC,WAAnF,CADc;AAE3BC,EAAAA,UAAU,EAAEc,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,aAA7B,EAA4CC,YAA5C,CAAyDnB,mBAAmB,CAACE,UAA7E,CAFe;AAG3BC,EAAAA,QAAQ,EAAEa,mBAAS,CAACI,IAAV,CAAeF,WAAf,CAA2B,4BAA3B,EAAyDC,YAAzD,CAAsEnB,mBA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
  var StyledComposerInput = /*#__PURE__*/styled__default['default'].textarea.withConfig({
26
26
  componentId: "sc-1ahwpce-1"
27
- })(["padding:", ";resize:none;min-height:32px;border-radius:2px;border:solid 1px #cbcfd7;color:#25292f;height:", ";min-width:244px;overflow-y:auto;font-size:1rem;font-weight:400;line-height:1;transition:height 0.3s;&:focus{outline:none;border:1px solid ", ";box-shadow:inset 0 0 0 1px #8cc2ed;border-radius:2px;}"], function (props) {
27
+ })(["padding:", ";resize:none;min-height:32px;border-radius:2px;border:solid 1px #cbcfd7;color:#25292f;height:", ";min-width:244px;overflow-y:auto;font-size:13px;font-weight:400;line-height:1;transition:height 0.3s;&:focus{outline:none;border:1px solid ", ";box-shadow:inset 0 0 0 1px #8cc2ed;border-radius:2px;}"], function (props) {
28
28
  return props.theme.space.xxs;
29
29
  }, function (props) {
30
30
  return typeof props.height === 'number' ? "".concat(props.height, "px") : props.height;
@@ -33,7 +33,7 @@ var StyledComposerInput = /*#__PURE__*/styled__default['default'].textarea.withC
33
33
  });
34
34
  var StyledComposerButton = /*#__PURE__*/styled__default['default'](dsButton.DSButton).withConfig({
35
35
  componentId: "sc-1ahwpce-2"
36
- })(["background:none;&:disabled{svg{fill:#5d6775;}}svg{fill:", ";}&:focus{background:", ";}"], function (props) {
36
+ })(["&:disabled{background:none;svg{fill:#5d6775;}}svg{fill:", ";}&:focus{background:", ";}"], function (props) {
37
37
  return props.theme.colors.brand[600];
38
38
  }, function (props) {
39
39
  return props.theme.colors.brand[200];