@elliemae/ds-chat 2.0.2 → 2.1.0-rc.3

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.
@@ -92,6 +92,9 @@ const ChatComposer = props => {
92
92
  "data-testid": dataTestid
93
93
  }, void 0, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
94
94
  cols: ['1fr', '24px'],
95
+ style: {
96
+ height: heightProps.height
97
+ },
95
98
  justifyContent: "center",
96
99
  alignItems: "flex-end",
97
100
  gutter: "xxs"
@@ -132,8 +135,7 @@ const ChatComposer = props => {
132
135
  width: (_input$current = input.current) === null || _input$current === void 0 ? void 0 : _input$current.clientWidth
133
136
  },
134
137
  onChange: handleChange,
135
- value: inputValue // maxLength={inputMaxLength}
136
-
138
+ value: inputValue
137
139
  }), /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
138
140
  cols: ['1fr', '24px'],
139
141
  justifyContent: "flex-end",
@@ -146,7 +148,7 @@ const ChatComposer = props => {
146
148
  }, void 0, inputMaxLength && hasError ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
147
149
  children: [/*#__PURE__*/_jsx__default["default"](styled.StyledCounterErrorA11y, {
148
150
  role: "alert"
149
- }, void 0, maxLengthMessage || "You have exceeded the character limit by ".concat(inputLength - inputMaxLength)), maxLengthMessage || "Please limit to less than ".concat(inputMaxLength, " characters. ")]
151
+ }, void 0, maxLengthMessage || "You have entered ".concat(inputLength, " characters and have exceeded the limit by ").concat(inputLength - inputMaxLength, ". Please limit to less than ").concat(inputMaxLength, " characters. ")), maxLengthMessage || "Please limit to less than ".concat(inputMaxLength, " characters. ")]
150
152
  }) : '', inputMaxLength ? " ".concat(inputLength, " / ").concat(inputMaxLength) : ''), _Grid || (_Grid = /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {}))));
151
153
  };
152
154
 
@@ -29,7 +29,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
29
29
  var DSIndeterminateProgressIndicator__default = /*#__PURE__*/_interopDefaultLegacy(DSIndeterminateProgressIndicator);
30
30
  var DSBanner__default = /*#__PURE__*/_interopDefaultLegacy(DSBanner);
31
31
 
32
- var _DSIndeterminateProgr, _StyledIndicatorConta;
32
+ var _DSIndeterminateProgr;
33
33
 
34
34
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
35
35
 
@@ -67,18 +67,16 @@ const ChatContainer = props$1 => {
67
67
  });
68
68
  const onResize = React__default["default"].useCallback(height => {
69
69
  if (onComposerResize) onComposerResize(height);
70
-
71
- if (height > 30) {
72
- /*
70
+ /*
73
71
  setTimeout is used to equal the animation duration from the
74
72
  composer text area when increase its size
75
73
  */
76
- setTimeout(() => {
77
- actionRef.current.scrollToIndex(messagesListProps.messages.length - 1, {
78
- align: 'start'
79
- });
80
- }, 50);
81
- }
74
+
75
+ setTimeout(() => {
76
+ actionRef.current.scrollToIndex(messagesListProps.messages.length - 1, {
77
+ align: 'start'
78
+ });
79
+ }, 50);
82
80
  }, [onComposerResize, messagesListProps.messages, actionRef]);
83
81
  const Container = device === 'desktop' ? styled.StyledChatContainerContent : styled.MobileStyledChatContainerContent;
84
82
  const handleTabs = React__default["default"].useCallback(e => {
@@ -86,17 +84,21 @@ const ChatContainer = props$1 => {
86
84
  const ref = actionRef || listRef;
87
85
 
88
86
  if (e.shiftKey && e.key === 'Tab') {
89
- e.preventDefault();
87
+ if (messagesListProps.messages.length > 0) {
88
+ e.preventDefault();
89
+
90
+ if (['top', 'bottom'].includes(bannerPosition)) {
91
+ bannerRef.current.focusOnWrapper();
92
+ } else {
93
+ var _ref$current;
90
94
 
91
- if (['top', 'bottom'].includes(bannerPosition)) {
92
- bannerRef.current.focusOnWrapper();
93
- } else {
94
- const last = ref.current.getMessagesInView().pop();
95
- ref.current.focusToIndexWithoutScroll(last);
95
+ const last = ref.current.getMessagesInView().pop();
96
+ (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focusToIndexWithoutScroll(last);
97
+ }
96
98
  }
97
99
  }
98
100
  }
99
- }, [actionRef, onComposerKeyDown, bannerPosition]); // Map actions
101
+ }, [actionRef, onComposerKeyDown, bannerPosition, messagesListProps.messages.length]); // Map actions
100
102
 
101
103
  React__default["default"].useEffect(() => {
102
104
  if (actionRef && actionRef.current) {
@@ -146,15 +148,15 @@ const ChatContainer = props$1 => {
146
148
  isOpen: true,
147
149
  type: bannerProps.type || DSBanner.BANNER_TYPES.INFO,
148
150
  actionRef: bannerRef
149
- })), sendingMessages && sendingMessages.length > 0 ? _StyledIndicatorConta || (_StyledIndicatorConta = /*#__PURE__*/_jsx__default["default"](styled.StyledIndicatorContainer, {
151
+ })), sendingMessages && sendingMessages.length > 0 ? /*#__PURE__*/_jsx__default["default"](styled.StyledIndicatorContainer, {
150
152
  isLoading: "bottom",
151
153
  linear: true,
152
154
  "data-testid": "ds-chat-loading-indicator"
153
155
  }, void 0, /*#__PURE__*/_jsx__default["default"](DSIndeterminateProgressIndicator__default["default"], {
154
156
  processing: true,
155
- title: "Loading",
157
+ title: sendingText,
156
158
  lineOnly: true
157
- }))) : null), /*#__PURE__*/jsxRuntime.jsx(ChatContainerComposer.ChatComposer, _objectSpread(_objectSpread({}, composerProps), {}, {
159
+ })) : null), /*#__PURE__*/jsxRuntime.jsx(ChatContainerComposer.ChatComposer, _objectSpread(_objectSpread({}, composerProps), {}, {
158
160
  onKeyDown: handleTabs,
159
161
  onResize: onResize,
160
162
  maxHeight: (((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.clientHeight) || 0) / 2,
@@ -18,7 +18,7 @@ const StyledChatContainerContent = /*#__PURE__*/styled__default["default"](dsGri
18
18
  })(["height:100%;min-width:", "px;overflow:hidden;background:", ";position:relative;"], CONTAINER_WIDTH, props => props.theme.colors.neutral['050']);
19
19
  const StyledIndicatorContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
20
20
  componentId: "sc-d732wo-1"
21
- })(["transition:0.4s ease-in-out;position:absolute;visibility:hidden;pointer-events:none;width:100%;padding:0 ", ";left:0;right:0;background:", ";", " ", " & div,a{font-size:13px;}"], props => !props.linear ? props.theme.space.xxs : 0, props => props.theme.colors.neutral['000'], props => props.isLoading === 'top' ? "\n top: -41px;\n transform: translate(0, 41px);\n visibility: visible;\n pointer-events: auto\n " : '', props => props.isLoading === 'bottom' ? "\n bottom: -41px;\n transform: translate(0, -41px);\n visibility: visible;\n pointer-events: auto;\n " : '');
21
+ })(["transition:0.4s ease-in-out;position:absolute;visibility:hidden;pointer-events:none;width:100%;padding:0 ", ";left:0;right:0;background:", ";", " ", " & div,a{font-size:13px;}"], props => !props.linear ? props.theme.space.xxs : 0, props => props.theme.colors.neutral['000'], props => props.isLoading === 'top' ? "\n top: -41px;\n transform: translate(0, 41px);\n visibility: visible;\n pointer-events: auto;\n " : '', props => props.isLoading === 'bottom' ? "\n bottom: -41px;\n transform: translate(0, -41px);\n visibility: visible;\n pointer-events: auto;\n " : '');
22
22
  const MobileStyledChatContainerContent = /*#__PURE__*/styled__default["default"](StyledChatContainerContent).withConfig({
23
23
  componentId: "sc-d732wo-2"
24
24
  })(["", ",", "{font-size:16px;}", "{font-size:13px;}", "{background-color:#fff;box-shadow:-0 1px 3px rgba(53,60,70,0.8);}", ",", "{font-size:16px;text-align:left;}", "{font-size:13px;}", "{font-size:16px;}", "{font-size:16px;}"], styled$1.StyledTitleLeftBubble, styled$1.StyleBodyWrapper, styled$1.StyledTitleRightBubble, style.Wrapper, style.Title, style.Message, style.Time, styled$2.StyledComposerInput, StyledIndicatorContainer);
@@ -19,6 +19,7 @@ var React = require('react');
19
19
  var reactDesc = require('react-desc');
20
20
  var reactVirtual = require('react-virtual');
21
21
  var DSButton = require('@elliemae/ds-button');
22
+ var lodash = require('lodash');
22
23
  var ChatBubble = require('../bubble/ChatBubble.js');
23
24
  var props$1 = require('../bubble/props.js');
24
25
  var MessageDelimiter = require('../message-delimiter/MessageDelimiter.js');
@@ -67,6 +68,7 @@ const ChatContainerMessagesList = props$2 => {
67
68
  isLoading,
68
69
  bannerRef
69
70
  } = props$2;
71
+ const pendingOnScroll = React__default["default"].useRef(false);
70
72
  const loadMoreRef = React__default["default"].useRef(null);
71
73
  const virtualListRef = React__default["default"].useRef(); // estimateSize should not be really required given what was stated on
72
74
  // https://github.com/tannerlinsley/react-virtual/issues/23
@@ -86,9 +88,15 @@ const ChatContainerMessagesList = props$2 => {
86
88
  })), {}, {
87
89
  estimateSize: React__default["default"].useCallback(() => 80, [])
88
90
  }));
89
- const onScrollStop = React__default["default"].useCallback(() => {
91
+ const debouncedScroll = React__default["default"].useMemo(() => lodash.debounce(() => {
90
92
  var _virtualListRef$curre;
91
93
 
94
+ if (document.visibilityState === 'hidden') {
95
+ pendingOnScroll.current = true;
96
+ return [];
97
+ }
98
+
99
+ pendingOnScroll.current = false;
92
100
  const {
93
101
  bottom,
94
102
  top
@@ -97,15 +105,15 @@ const ChatContainerMessagesList = props$2 => {
97
105
  const indexList = [];
98
106
  list.forEach(item => {
99
107
  const {
100
- top: itemTop,
101
- bottom: itemBottom
108
+ top: itemTop
102
109
  } = item.getBoundingClientRect();
103
110
  const itemPadding = 10;
104
- if (itemTop + itemPadding < bottom && itemBottom - itemPadding > top) indexList.push(item.dataset.index);
111
+ if (itemTop + itemPadding < bottom && itemTop + itemPadding > top) indexList.push(item.dataset.index);
105
112
  });
106
113
  if (onScrollEnds) onScrollEnds(indexList);
107
114
  return indexList;
108
- }, [onScrollEnds]);
115
+ }, 500), [onScrollEnds]);
116
+ const onScrollStop = React__default["default"].useCallback(debouncedScroll, [debouncedScroll]);
109
117
  const onlyFocus = React__default["default"].useCallback(index => {
110
118
  setTimeout(() => {
111
119
  virtualListRef.current.querySelector("[data-index=\"".concat(index, "\"]")).focus();
@@ -117,7 +125,8 @@ const ChatContainerMessagesList = props$2 => {
117
125
  };
118
126
  vScroll(index, b);
119
127
  onlyFocus(index);
120
- }, [onlyFocus, vScroll]);
128
+ onScrollStop();
129
+ }, [onScrollStop, onlyFocus, vScroll]);
121
130
  React__default["default"].useEffect(() => {
122
131
  if (actionRef && actionRef.current) {
123
132
  actionRef.current.scrollToIndex = function (a) {
@@ -125,6 +134,7 @@ const ChatContainerMessagesList = props$2 => {
125
134
  align: 'center'
126
135
  };
127
136
  vScroll(a, b);
137
+ onScrollStop();
128
138
  };
129
139
 
130
140
  actionRef.current.getMessagesInView = onScrollStop;
@@ -138,7 +148,7 @@ const ChatContainerMessagesList = props$2 => {
138
148
 
139
149
  actionRef.current.focusToIndexWithoutScroll = onlyFocus;
140
150
 
141
- actionRef.current.focusToList = a => {
151
+ actionRef.current.focusToList = () => {
142
152
  var _virtualListRef$curre2;
143
153
 
144
154
  (_virtualListRef$curre2 = virtualListRef.current) === null || _virtualListRef$curre2 === void 0 ? void 0 : _virtualListRef$curre2.focus();
@@ -155,7 +165,17 @@ const ChatContainerMessagesList = props$2 => {
155
165
  switch (key) {
156
166
  case 'ArrowUp':
157
167
  e.preventDefault();
158
- if (index > 0) virtualListRef.current.querySelector("[data-index=\"".concat(index - 1, "\"]")).focus();
168
+
169
+ if (index > 0) {
170
+ var _virtualListRef$curre3;
171
+
172
+ ((_virtualListRef$curre3 = virtualListRef.current) === null || _virtualListRef$curre3 === void 0 ? void 0 : _virtualListRef$curre3.querySelector("[data-index=\"".concat(index - 1, "\"]"))).focus();
173
+ } else if (hasMoreItems === 'top') {
174
+ var _loadMoreRef$current;
175
+
176
+ (_loadMoreRef$current = loadMoreRef.current) === null || _loadMoreRef$current === void 0 ? void 0 : _loadMoreRef$current.focus();
177
+ }
178
+
159
179
  break;
160
180
 
161
181
  case 'ArrowDown':
@@ -178,31 +198,31 @@ const ChatContainerMessagesList = props$2 => {
178
198
  break;
179
199
 
180
200
  case 'Tab':
181
- e.preventDefault();
182
-
183
201
  if (hasMoreItems === 'bottom' && !e.shiftKey) {
184
- var _loadMoreRef$current;
185
-
186
- (_loadMoreRef$current = loadMoreRef.current) === null || _loadMoreRef$current === void 0 ? void 0 : _loadMoreRef$current.focus();
187
- } else if (hasMoreItems === 'top' && e.shiftKey) {
188
202
  var _loadMoreRef$current2;
189
203
 
204
+ e.preventDefault();
190
205
  (_loadMoreRef$current2 = loadMoreRef.current) === null || _loadMoreRef$current2 === void 0 ? void 0 : _loadMoreRef$current2.focus();
206
+ } else if (hasMoreItems === 'top' && e.shiftKey) {
207
+ var _loadMoreRef$current3;
208
+
209
+ e.preventDefault();
210
+ (_loadMoreRef$current3 = loadMoreRef.current) === null || _loadMoreRef$current3 === void 0 ? void 0 : _loadMoreRef$current3.focus();
191
211
  } else if (!e.shiftKey) {
192
212
  if (bannerPosition) {
213
+ e.preventDefault();
193
214
  bannerRef.current.focusOnWrapper();
194
- } else {
195
- actionRef.current.focusToComposer();
196
215
  }
197
216
  } else {
198
- var _virtualListRef$curre3;
217
+ var _virtualListRef$curre4;
199
218
 
200
- (_virtualListRef$curre3 = virtualListRef.current) === null || _virtualListRef$curre3 === void 0 ? void 0 : _virtualListRef$curre3.focus();
219
+ e.preventDefault();
220
+ (_virtualListRef$curre4 = virtualListRef.current) === null || _virtualListRef$curre4 === void 0 ? void 0 : _virtualListRef$curre4.focus();
201
221
  }
202
222
 
203
223
  break;
204
224
  }
205
- }, [actionRef, hasMoreItems, messages.length, bannerPosition, scrollAndFocus]);
225
+ }, [actionRef, bannerRef, hasMoreItems, messages.length, bannerPosition, scrollAndFocus]);
206
226
  const handleListKey = React__default["default"].useCallback(e => {
207
227
  const {
208
228
  key
@@ -211,12 +231,22 @@ const ChatContainerMessagesList = props$2 => {
211
231
  switch (key) {
212
232
  case 'ArrowUp':
213
233
  e.preventDefault();
214
- onlyFocus(onScrollStop().shift());
234
+
235
+ if (document.activeElement !== loadMoreRef.current) {
236
+ onlyFocus(onScrollStop().shift());
237
+ }
238
+
215
239
  break;
216
240
 
217
241
  case 'ArrowDown':
218
242
  e.preventDefault();
219
- onlyFocus(onScrollStop().pop());
243
+
244
+ if (document.activeElement === loadMoreRef.current) {
245
+ virtualListRef.current.querySelector("[data-index=\"0\"]").focus();
246
+ } else {
247
+ onlyFocus(onScrollStop().pop());
248
+ }
249
+
220
250
  break;
221
251
 
222
252
  case 'Home':
@@ -232,15 +262,15 @@ const ChatContainerMessagesList = props$2 => {
232
262
  case 'Tab':
233
263
  if (document.activeElement !== loadMoreRef.current) {
234
264
  if (hasMoreItems === 'bottom' && !e.shiftKey) {
235
- var _loadMoreRef$current3;
265
+ var _loadMoreRef$current4;
236
266
 
237
267
  e.preventDefault();
238
- (_loadMoreRef$current3 = loadMoreRef.current) === null || _loadMoreRef$current3 === void 0 ? void 0 : _loadMoreRef$current3.focus();
268
+ (_loadMoreRef$current4 = loadMoreRef.current) === null || _loadMoreRef$current4 === void 0 ? void 0 : _loadMoreRef$current4.focus();
239
269
  } else if (hasMoreItems === 'top' && e.shiftKey) {
240
- var _loadMoreRef$current4;
270
+ var _loadMoreRef$current5;
241
271
 
242
272
  e.preventDefault();
243
- (_loadMoreRef$current4 = loadMoreRef.current) === null || _loadMoreRef$current4 === void 0 ? void 0 : _loadMoreRef$current4.focus();
273
+ (_loadMoreRef$current5 = loadMoreRef.current) === null || _loadMoreRef$current5 === void 0 ? void 0 : _loadMoreRef$current5.focus();
244
274
  } else if (!e.shiftKey) {
245
275
  e.preventDefault();
246
276
  actionRef.current.focusToComposer();
@@ -249,15 +279,18 @@ const ChatContainerMessagesList = props$2 => {
249
279
  e.preventDefault();
250
280
  actionRef.current.focusToComposer();
251
281
  } else {
252
- var _virtualListRef$curre4;
282
+ var _virtualListRef$curre5;
253
283
 
254
284
  e.preventDefault();
255
- (_virtualListRef$curre4 = virtualListRef.current) === null || _virtualListRef$curre4 === void 0 ? void 0 : _virtualListRef$curre4.focus();
285
+ (_virtualListRef$curre5 = virtualListRef.current) === null || _virtualListRef$curre5 === void 0 ? void 0 : _virtualListRef$curre5.focus();
256
286
  }
257
287
 
258
288
  break;
259
289
  }
260
290
  }, [actionRef, hasMoreItems, messages.length, onScrollStop, onlyFocus, scrollAndFocus]);
291
+ const checkPendingOnScroll = React__default["default"].useCallback(() => {
292
+ if (pendingOnScroll.current === true) onScrollStop();
293
+ }, [onScrollStop]);
261
294
  React__default["default"].useEffect(() => {
262
295
  let handlerCallback = null;
263
296
  const localVirtualRef = virtualListRef.current;
@@ -271,11 +304,13 @@ const ChatContainerMessagesList = props$2 => {
271
304
  virtualListRef.current.addEventListener('scroll', onScroll);
272
305
  }
273
306
 
307
+ document.addEventListener('visibilitychange', checkPendingOnScroll);
274
308
  return () => {
275
309
  if (handlerCallback) clearTimeout(handlerCallback);
276
310
  if (onScrollEnds) localVirtualRef.removeEventListener('scroll', onScroll);
311
+ document.removeEventListener('visibilitychange', checkPendingOnScroll);
277
312
  };
278
- }, [onScrollStop, onScrollEnds]);
313
+ }, [onScrollStop, onScrollEnds, checkPendingOnScroll]);
279
314
  const render = React__default["default"].useMemo(() => virtualItems.map(virtualItem => {
280
315
  const {
281
316
  index,
@@ -296,14 +331,14 @@ const ChatContainerMessagesList = props$2 => {
296
331
  "data-index": index,
297
332
  style: style,
298
333
  ref: measureRef,
299
- tabIndex: 0,
334
+ tabIndex: -1,
300
335
  onKeyDown: handleKey,
301
336
  role: "listitem",
302
337
  children: /*#__PURE__*/_jsx__default["default"](styled.StyledWrapperListItem, {
303
338
  type: row.type
304
339
  }, void 0, row.type === props$1.BUBBLE_TYPES.SENDER || row.type === props$1.BUBBLE_TYPES.RECIPIENT ?
305
340
  /*#__PURE__*/
306
- // eslint-disable-next-line
341
+ // eslint-disable-next-line eslint-comments/no-unlimited-disable
307
342
  jsxRuntime.jsx(ChatBubble.ChatBubble, _objectSpread(_objectSpread({}, row), {}, {
308
343
  helpMessage: isSending ? sendingText : row.helpMessage
309
344
  })) : null, row.type === props$1.BUBBLE_TYPES.DELIMITER ? /*#__PURE__*/jsxRuntime.jsx(MessageDelimiter.MessageDelimiter, _objectSpread({}, row)) : null, row.type === props$1.BUBBLE_TYPES.SYSTEM ? /*#__PURE__*/jsxRuntime.jsx(SystemMessage.SystemMessage, _objectSpread({}, row)) : null)
@@ -319,7 +354,7 @@ const ChatContainerMessagesList = props$2 => {
319
354
  onKeyDown: handleListKey,
320
355
  children: /*#__PURE__*/_jsx__default["default"](styled.StyledChatContainerContentListScroll, {
321
356
  height: "".concat(totalSize, "px")
322
- }, void 0, render, !isLoading && hasMoreItems ? /*#__PURE__*/_jsx__default["default"](styled.StyledLoadMoreContainer, {
357
+ }, void 0, !isLoading && hasMoreItems ? /*#__PURE__*/_jsx__default["default"](styled.StyledLoadMoreContainer, {
323
358
  hasMoreItems: hasMoreItems
324
359
  }, void 0, /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
325
360
  labelText: "Load More",
@@ -327,7 +362,7 @@ const ChatContainerMessagesList = props$2 => {
327
362
  onClick: getMoreMessages,
328
363
  "data-testid": "ds-chat-load-more-btn",
329
364
  innerRef: loadMoreRef
330
- })) : null)
365
+ })) : null, render)
331
366
  }));
332
367
  };
333
368
 
@@ -82,6 +82,9 @@ const ChatComposer = props => {
82
82
  "data-testid": dataTestid
83
83
  }, void 0, /*#__PURE__*/_jsx(Grid, {
84
84
  cols: ['1fr', '24px'],
85
+ style: {
86
+ height: heightProps.height
87
+ },
85
88
  justifyContent: "center",
86
89
  alignItems: "flex-end",
87
90
  gutter: "xxs"
@@ -122,8 +125,7 @@ const ChatComposer = props => {
122
125
  width: (_input$current = input.current) === null || _input$current === void 0 ? void 0 : _input$current.clientWidth
123
126
  },
124
127
  onChange: handleChange,
125
- value: inputValue // maxLength={inputMaxLength}
126
-
128
+ value: inputValue
127
129
  }), /*#__PURE__*/_jsx(Grid, {
128
130
  cols: ['1fr', '24px'],
129
131
  justifyContent: "flex-end",
@@ -136,7 +138,7 @@ const ChatComposer = props => {
136
138
  }, void 0, inputMaxLength && hasError ? /*#__PURE__*/jsxs(Fragment, {
137
139
  children: [/*#__PURE__*/_jsx(StyledCounterErrorA11y, {
138
140
  role: "alert"
139
- }, void 0, maxLengthMessage || "You have exceeded the character limit by ".concat(inputLength - inputMaxLength)), maxLengthMessage || "Please limit to less than ".concat(inputMaxLength, " characters. ")]
141
+ }, void 0, maxLengthMessage || "You have entered ".concat(inputLength, " characters and have exceeded the limit by ").concat(inputLength - inputMaxLength, ". Please limit to less than ").concat(inputMaxLength, " characters. ")), maxLengthMessage || "Please limit to less than ".concat(inputMaxLength, " characters. ")]
140
142
  }) : '', inputMaxLength ? " ".concat(inputLength, " / ").concat(inputMaxLength) : ''), _Grid || (_Grid = /*#__PURE__*/_jsx(Grid, {}))));
141
143
  };
142
144
 
@@ -17,7 +17,7 @@ import { StyledIndicatorContainer, StyledChatContainerContent, MobileStyledChatC
17
17
  import { useValidateProps } from './config/useValidateProps.js';
18
18
  import { jsxs, jsx } from 'react/jsx-runtime';
19
19
 
20
- var _DSIndeterminateProgr, _StyledIndicatorConta;
20
+ var _DSIndeterminateProgr;
21
21
 
22
22
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
23
 
@@ -55,18 +55,16 @@ const ChatContainer = props => {
55
55
  });
56
56
  const onResize = React.useCallback(height => {
57
57
  if (onComposerResize) onComposerResize(height);
58
-
59
- if (height > 30) {
60
- /*
58
+ /*
61
59
  setTimeout is used to equal the animation duration from the
62
60
  composer text area when increase its size
63
61
  */
64
- setTimeout(() => {
65
- actionRef.current.scrollToIndex(messagesListProps.messages.length - 1, {
66
- align: 'start'
67
- });
68
- }, 50);
69
- }
62
+
63
+ setTimeout(() => {
64
+ actionRef.current.scrollToIndex(messagesListProps.messages.length - 1, {
65
+ align: 'start'
66
+ });
67
+ }, 50);
70
68
  }, [onComposerResize, messagesListProps.messages, actionRef]);
71
69
  const Container = device === 'desktop' ? StyledChatContainerContent : MobileStyledChatContainerContent;
72
70
  const handleTabs = React.useCallback(e => {
@@ -74,17 +72,21 @@ const ChatContainer = props => {
74
72
  const ref = actionRef || listRef;
75
73
 
76
74
  if (e.shiftKey && e.key === 'Tab') {
77
- e.preventDefault();
75
+ if (messagesListProps.messages.length > 0) {
76
+ e.preventDefault();
77
+
78
+ if (['top', 'bottom'].includes(bannerPosition)) {
79
+ bannerRef.current.focusOnWrapper();
80
+ } else {
81
+ var _ref$current;
78
82
 
79
- if (['top', 'bottom'].includes(bannerPosition)) {
80
- bannerRef.current.focusOnWrapper();
81
- } else {
82
- const last = ref.current.getMessagesInView().pop();
83
- ref.current.focusToIndexWithoutScroll(last);
83
+ const last = ref.current.getMessagesInView().pop();
84
+ (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focusToIndexWithoutScroll(last);
85
+ }
84
86
  }
85
87
  }
86
88
  }
87
- }, [actionRef, onComposerKeyDown, bannerPosition]); // Map actions
89
+ }, [actionRef, onComposerKeyDown, bannerPosition, messagesListProps.messages.length]); // Map actions
88
90
 
89
91
  React.useEffect(() => {
90
92
  if (actionRef && actionRef.current) {
@@ -134,15 +136,15 @@ const ChatContainer = props => {
134
136
  isOpen: true,
135
137
  type: bannerProps.type || BANNER_TYPES.INFO,
136
138
  actionRef: bannerRef
137
- })), sendingMessages && sendingMessages.length > 0 ? _StyledIndicatorConta || (_StyledIndicatorConta = /*#__PURE__*/_jsx(StyledIndicatorContainer, {
139
+ })), sendingMessages && sendingMessages.length > 0 ? /*#__PURE__*/_jsx(StyledIndicatorContainer, {
138
140
  isLoading: "bottom",
139
141
  linear: true,
140
142
  "data-testid": "ds-chat-loading-indicator"
141
143
  }, void 0, /*#__PURE__*/_jsx(DSIndeterminateProgressIndicator, {
142
144
  processing: true,
143
- title: "Loading",
145
+ title: sendingText,
144
146
  lineOnly: true
145
- }))) : null), /*#__PURE__*/jsx(ChatComposer, _objectSpread(_objectSpread({}, composerProps), {}, {
147
+ })) : null), /*#__PURE__*/jsx(ChatComposer, _objectSpread(_objectSpread({}, composerProps), {}, {
146
148
  onKeyDown: handleTabs,
147
149
  onResize: onResize,
148
150
  maxHeight: (((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.clientHeight) || 0) / 2,
@@ -10,7 +10,7 @@ const StyledChatContainerContent = /*#__PURE__*/styled(Grid).withConfig({
10
10
  })(["height:100%;min-width:", "px;overflow:hidden;background:", ";position:relative;"], CONTAINER_WIDTH, props => props.theme.colors.neutral['050']);
11
11
  const StyledIndicatorContainer = /*#__PURE__*/styled.div.withConfig({
12
12
  componentId: "sc-d732wo-1"
13
- })(["transition:0.4s ease-in-out;position:absolute;visibility:hidden;pointer-events:none;width:100%;padding:0 ", ";left:0;right:0;background:", ";", " ", " & div,a{font-size:13px;}"], props => !props.linear ? props.theme.space.xxs : 0, props => props.theme.colors.neutral['000'], props => props.isLoading === 'top' ? "\n top: -41px;\n transform: translate(0, 41px);\n visibility: visible;\n pointer-events: auto\n " : '', props => props.isLoading === 'bottom' ? "\n bottom: -41px;\n transform: translate(0, -41px);\n visibility: visible;\n pointer-events: auto;\n " : '');
13
+ })(["transition:0.4s ease-in-out;position:absolute;visibility:hidden;pointer-events:none;width:100%;padding:0 ", ";left:0;right:0;background:", ";", " ", " & div,a{font-size:13px;}"], props => !props.linear ? props.theme.space.xxs : 0, props => props.theme.colors.neutral['000'], props => props.isLoading === 'top' ? "\n top: -41px;\n transform: translate(0, 41px);\n visibility: visible;\n pointer-events: auto;\n " : '', props => props.isLoading === 'bottom' ? "\n bottom: -41px;\n transform: translate(0, -41px);\n visibility: visible;\n pointer-events: auto;\n " : '');
14
14
  const MobileStyledChatContainerContent = /*#__PURE__*/styled(StyledChatContainerContent).withConfig({
15
15
  componentId: "sc-d732wo-2"
16
16
  })(["", ",", "{font-size:16px;}", "{font-size:13px;}", "{background-color:#fff;box-shadow:-0 1px 3px rgba(53,60,70,0.8);}", ",", "{font-size:16px;text-align:left;}", "{font-size:13px;}", "{font-size:16px;}", "{font-size:16px;}"], StyledTitleLeftBubble, StyleBodyWrapper, StyledTitleRightBubble, Wrapper, Title, Message, Time, StyledComposerInput, StyledIndicatorContainer);
@@ -15,6 +15,7 @@ import React from 'react';
15
15
  import { describe } from 'react-desc';
16
16
  import { useVirtual } from 'react-virtual';
17
17
  import DSButton from '@elliemae/ds-button';
18
+ import { debounce } from 'lodash';
18
19
  import { ChatBubble } from '../bubble/ChatBubble.js';
19
20
  import { BUBBLE_TYPES } from '../bubble/props.js';
20
21
  import { MessageDelimiter } from '../message-delimiter/MessageDelimiter.js';
@@ -56,6 +57,7 @@ const ChatContainerMessagesList = props => {
56
57
  isLoading,
57
58
  bannerRef
58
59
  } = props;
60
+ const pendingOnScroll = React.useRef(false);
59
61
  const loadMoreRef = React.useRef(null);
60
62
  const virtualListRef = React.useRef(); // estimateSize should not be really required given what was stated on
61
63
  // https://github.com/tannerlinsley/react-virtual/issues/23
@@ -75,9 +77,15 @@ const ChatContainerMessagesList = props => {
75
77
  })), {}, {
76
78
  estimateSize: React.useCallback(() => 80, [])
77
79
  }));
78
- const onScrollStop = React.useCallback(() => {
80
+ const debouncedScroll = React.useMemo(() => debounce(() => {
79
81
  var _virtualListRef$curre;
80
82
 
83
+ if (document.visibilityState === 'hidden') {
84
+ pendingOnScroll.current = true;
85
+ return [];
86
+ }
87
+
88
+ pendingOnScroll.current = false;
81
89
  const {
82
90
  bottom,
83
91
  top
@@ -86,15 +94,15 @@ const ChatContainerMessagesList = props => {
86
94
  const indexList = [];
87
95
  list.forEach(item => {
88
96
  const {
89
- top: itemTop,
90
- bottom: itemBottom
97
+ top: itemTop
91
98
  } = item.getBoundingClientRect();
92
99
  const itemPadding = 10;
93
- if (itemTop + itemPadding < bottom && itemBottom - itemPadding > top) indexList.push(item.dataset.index);
100
+ if (itemTop + itemPadding < bottom && itemTop + itemPadding > top) indexList.push(item.dataset.index);
94
101
  });
95
102
  if (onScrollEnds) onScrollEnds(indexList);
96
103
  return indexList;
97
- }, [onScrollEnds]);
104
+ }, 500), [onScrollEnds]);
105
+ const onScrollStop = React.useCallback(debouncedScroll, [debouncedScroll]);
98
106
  const onlyFocus = React.useCallback(index => {
99
107
  setTimeout(() => {
100
108
  virtualListRef.current.querySelector("[data-index=\"".concat(index, "\"]")).focus();
@@ -106,7 +114,8 @@ const ChatContainerMessagesList = props => {
106
114
  };
107
115
  vScroll(index, b);
108
116
  onlyFocus(index);
109
- }, [onlyFocus, vScroll]);
117
+ onScrollStop();
118
+ }, [onScrollStop, onlyFocus, vScroll]);
110
119
  React.useEffect(() => {
111
120
  if (actionRef && actionRef.current) {
112
121
  actionRef.current.scrollToIndex = function (a) {
@@ -114,6 +123,7 @@ const ChatContainerMessagesList = props => {
114
123
  align: 'center'
115
124
  };
116
125
  vScroll(a, b);
126
+ onScrollStop();
117
127
  };
118
128
 
119
129
  actionRef.current.getMessagesInView = onScrollStop;
@@ -127,7 +137,7 @@ const ChatContainerMessagesList = props => {
127
137
 
128
138
  actionRef.current.focusToIndexWithoutScroll = onlyFocus;
129
139
 
130
- actionRef.current.focusToList = a => {
140
+ actionRef.current.focusToList = () => {
131
141
  var _virtualListRef$curre2;
132
142
 
133
143
  (_virtualListRef$curre2 = virtualListRef.current) === null || _virtualListRef$curre2 === void 0 ? void 0 : _virtualListRef$curre2.focus();
@@ -144,7 +154,17 @@ const ChatContainerMessagesList = props => {
144
154
  switch (key) {
145
155
  case 'ArrowUp':
146
156
  e.preventDefault();
147
- if (index > 0) virtualListRef.current.querySelector("[data-index=\"".concat(index - 1, "\"]")).focus();
157
+
158
+ if (index > 0) {
159
+ var _virtualListRef$curre3;
160
+
161
+ ((_virtualListRef$curre3 = virtualListRef.current) === null || _virtualListRef$curre3 === void 0 ? void 0 : _virtualListRef$curre3.querySelector("[data-index=\"".concat(index - 1, "\"]"))).focus();
162
+ } else if (hasMoreItems === 'top') {
163
+ var _loadMoreRef$current;
164
+
165
+ (_loadMoreRef$current = loadMoreRef.current) === null || _loadMoreRef$current === void 0 ? void 0 : _loadMoreRef$current.focus();
166
+ }
167
+
148
168
  break;
149
169
 
150
170
  case 'ArrowDown':
@@ -167,31 +187,31 @@ const ChatContainerMessagesList = props => {
167
187
  break;
168
188
 
169
189
  case 'Tab':
170
- e.preventDefault();
171
-
172
190
  if (hasMoreItems === 'bottom' && !e.shiftKey) {
173
- var _loadMoreRef$current;
174
-
175
- (_loadMoreRef$current = loadMoreRef.current) === null || _loadMoreRef$current === void 0 ? void 0 : _loadMoreRef$current.focus();
176
- } else if (hasMoreItems === 'top' && e.shiftKey) {
177
191
  var _loadMoreRef$current2;
178
192
 
193
+ e.preventDefault();
179
194
  (_loadMoreRef$current2 = loadMoreRef.current) === null || _loadMoreRef$current2 === void 0 ? void 0 : _loadMoreRef$current2.focus();
195
+ } else if (hasMoreItems === 'top' && e.shiftKey) {
196
+ var _loadMoreRef$current3;
197
+
198
+ e.preventDefault();
199
+ (_loadMoreRef$current3 = loadMoreRef.current) === null || _loadMoreRef$current3 === void 0 ? void 0 : _loadMoreRef$current3.focus();
180
200
  } else if (!e.shiftKey) {
181
201
  if (bannerPosition) {
202
+ e.preventDefault();
182
203
  bannerRef.current.focusOnWrapper();
183
- } else {
184
- actionRef.current.focusToComposer();
185
204
  }
186
205
  } else {
187
- var _virtualListRef$curre3;
206
+ var _virtualListRef$curre4;
188
207
 
189
- (_virtualListRef$curre3 = virtualListRef.current) === null || _virtualListRef$curre3 === void 0 ? void 0 : _virtualListRef$curre3.focus();
208
+ e.preventDefault();
209
+ (_virtualListRef$curre4 = virtualListRef.current) === null || _virtualListRef$curre4 === void 0 ? void 0 : _virtualListRef$curre4.focus();
190
210
  }
191
211
 
192
212
  break;
193
213
  }
194
- }, [actionRef, hasMoreItems, messages.length, bannerPosition, scrollAndFocus]);
214
+ }, [actionRef, bannerRef, hasMoreItems, messages.length, bannerPosition, scrollAndFocus]);
195
215
  const handleListKey = React.useCallback(e => {
196
216
  const {
197
217
  key
@@ -200,12 +220,22 @@ const ChatContainerMessagesList = props => {
200
220
  switch (key) {
201
221
  case 'ArrowUp':
202
222
  e.preventDefault();
203
- onlyFocus(onScrollStop().shift());
223
+
224
+ if (document.activeElement !== loadMoreRef.current) {
225
+ onlyFocus(onScrollStop().shift());
226
+ }
227
+
204
228
  break;
205
229
 
206
230
  case 'ArrowDown':
207
231
  e.preventDefault();
208
- onlyFocus(onScrollStop().pop());
232
+
233
+ if (document.activeElement === loadMoreRef.current) {
234
+ virtualListRef.current.querySelector("[data-index=\"0\"]").focus();
235
+ } else {
236
+ onlyFocus(onScrollStop().pop());
237
+ }
238
+
209
239
  break;
210
240
 
211
241
  case 'Home':
@@ -221,15 +251,15 @@ const ChatContainerMessagesList = props => {
221
251
  case 'Tab':
222
252
  if (document.activeElement !== loadMoreRef.current) {
223
253
  if (hasMoreItems === 'bottom' && !e.shiftKey) {
224
- var _loadMoreRef$current3;
254
+ var _loadMoreRef$current4;
225
255
 
226
256
  e.preventDefault();
227
- (_loadMoreRef$current3 = loadMoreRef.current) === null || _loadMoreRef$current3 === void 0 ? void 0 : _loadMoreRef$current3.focus();
257
+ (_loadMoreRef$current4 = loadMoreRef.current) === null || _loadMoreRef$current4 === void 0 ? void 0 : _loadMoreRef$current4.focus();
228
258
  } else if (hasMoreItems === 'top' && e.shiftKey) {
229
- var _loadMoreRef$current4;
259
+ var _loadMoreRef$current5;
230
260
 
231
261
  e.preventDefault();
232
- (_loadMoreRef$current4 = loadMoreRef.current) === null || _loadMoreRef$current4 === void 0 ? void 0 : _loadMoreRef$current4.focus();
262
+ (_loadMoreRef$current5 = loadMoreRef.current) === null || _loadMoreRef$current5 === void 0 ? void 0 : _loadMoreRef$current5.focus();
233
263
  } else if (!e.shiftKey) {
234
264
  e.preventDefault();
235
265
  actionRef.current.focusToComposer();
@@ -238,15 +268,18 @@ const ChatContainerMessagesList = props => {
238
268
  e.preventDefault();
239
269
  actionRef.current.focusToComposer();
240
270
  } else {
241
- var _virtualListRef$curre4;
271
+ var _virtualListRef$curre5;
242
272
 
243
273
  e.preventDefault();
244
- (_virtualListRef$curre4 = virtualListRef.current) === null || _virtualListRef$curre4 === void 0 ? void 0 : _virtualListRef$curre4.focus();
274
+ (_virtualListRef$curre5 = virtualListRef.current) === null || _virtualListRef$curre5 === void 0 ? void 0 : _virtualListRef$curre5.focus();
245
275
  }
246
276
 
247
277
  break;
248
278
  }
249
279
  }, [actionRef, hasMoreItems, messages.length, onScrollStop, onlyFocus, scrollAndFocus]);
280
+ const checkPendingOnScroll = React.useCallback(() => {
281
+ if (pendingOnScroll.current === true) onScrollStop();
282
+ }, [onScrollStop]);
250
283
  React.useEffect(() => {
251
284
  let handlerCallback = null;
252
285
  const localVirtualRef = virtualListRef.current;
@@ -260,11 +293,13 @@ const ChatContainerMessagesList = props => {
260
293
  virtualListRef.current.addEventListener('scroll', onScroll);
261
294
  }
262
295
 
296
+ document.addEventListener('visibilitychange', checkPendingOnScroll);
263
297
  return () => {
264
298
  if (handlerCallback) clearTimeout(handlerCallback);
265
299
  if (onScrollEnds) localVirtualRef.removeEventListener('scroll', onScroll);
300
+ document.removeEventListener('visibilitychange', checkPendingOnScroll);
266
301
  };
267
- }, [onScrollStop, onScrollEnds]);
302
+ }, [onScrollStop, onScrollEnds, checkPendingOnScroll]);
268
303
  const render = React.useMemo(() => virtualItems.map(virtualItem => {
269
304
  const {
270
305
  index,
@@ -285,14 +320,14 @@ const ChatContainerMessagesList = props => {
285
320
  "data-index": index,
286
321
  style: style,
287
322
  ref: measureRef,
288
- tabIndex: 0,
323
+ tabIndex: -1,
289
324
  onKeyDown: handleKey,
290
325
  role: "listitem",
291
326
  children: /*#__PURE__*/_jsx(StyledWrapperListItem, {
292
327
  type: row.type
293
328
  }, void 0, row.type === BUBBLE_TYPES.SENDER || row.type === BUBBLE_TYPES.RECIPIENT ?
294
329
  /*#__PURE__*/
295
- // eslint-disable-next-line
330
+ // eslint-disable-next-line eslint-comments/no-unlimited-disable
296
331
  jsx(ChatBubble, _objectSpread(_objectSpread({}, row), {}, {
297
332
  helpMessage: isSending ? sendingText : row.helpMessage
298
333
  })) : null, row.type === BUBBLE_TYPES.DELIMITER ? /*#__PURE__*/jsx(MessageDelimiter, _objectSpread({}, row)) : null, row.type === BUBBLE_TYPES.SYSTEM ? /*#__PURE__*/jsx(SystemMessage, _objectSpread({}, row)) : null)
@@ -308,7 +343,7 @@ const ChatContainerMessagesList = props => {
308
343
  onKeyDown: handleListKey,
309
344
  children: /*#__PURE__*/_jsx(StyledChatContainerContentListScroll, {
310
345
  height: "".concat(totalSize, "px")
311
- }, void 0, render, !isLoading && hasMoreItems ? /*#__PURE__*/_jsx(StyledLoadMoreContainer, {
346
+ }, void 0, !isLoading && hasMoreItems ? /*#__PURE__*/_jsx(StyledLoadMoreContainer, {
312
347
  hasMoreItems: hasMoreItems
313
348
  }, void 0, /*#__PURE__*/_jsx(DSButton, {
314
349
  labelText: "Load More",
@@ -316,7 +351,7 @@ const ChatContainerMessagesList = props => {
316
351
  onClick: getMoreMessages,
317
352
  "data-testid": "ds-chat-load-more-btn",
318
353
  innerRef: loadMoreRef
319
- })) : null)
354
+ })) : null, render)
320
355
  }));
321
356
  };
322
357
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-chat",
3
- "version": "2.0.2",
3
+ "version": "2.1.0-rc.3",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Chat",
6
6
  "module": "./esm/index.js",
@@ -305,22 +305,22 @@
305
305
  "generateSubmodules": true
306
306
  },
307
307
  "dependencies": {
308
- "@elliemae/ds-banner": "2.0.2",
309
- "@elliemae/ds-button": "2.0.2",
310
- "@elliemae/ds-grid": "2.0.2",
311
- "@elliemae/ds-icons": "2.0.2",
312
- "@elliemae/ds-indeterminate-progress-indicator": "2.0.2",
313
- "@elliemae/ds-props-helpers": "2.0.2",
314
- "@elliemae/ds-system": "2.0.2",
315
- "@elliemae/ds-tooltip": "2.0.2",
316
- "@elliemae/ds-truncated-tooltip-text": "2.0.2",
308
+ "@elliemae/ds-banner": "2.1.0-rc.3",
309
+ "@elliemae/ds-button": "2.1.0-rc.3",
310
+ "@elliemae/ds-grid": "2.1.0-rc.3",
311
+ "@elliemae/ds-icons": "2.1.0-rc.3",
312
+ "@elliemae/ds-indeterminate-progress-indicator": "2.1.0-rc.3",
313
+ "@elliemae/ds-props-helpers": "2.1.0-rc.3",
314
+ "@elliemae/ds-system": "2.1.0-rc.3",
315
+ "@elliemae/ds-tooltip": "2.1.0-rc.3",
316
+ "@elliemae/ds-truncated-tooltip-text": "2.1.0-rc.3",
317
317
  "prop-types": "~15.7.2",
318
318
  "react-desc": "~4.1.2",
319
319
  "react-virtual": "~2.3.2"
320
320
  },
321
321
  "devDependencies": {
322
322
  "@testing-library/dom": "~8.11.1",
323
- "@testing-library/jest-dom": "~5.15.1",
323
+ "@testing-library/jest-dom": "~5.15.0",
324
324
  "@testing-library/react": "~12.1.2",
325
325
  "@testing-library/user-event": "~13.5.0",
326
326
  "styled-components": "~5.3.3"
@@ -6,22 +6,22 @@ declare const ChatCard: {
6
6
  propTypes: {
7
7
  title: any;
8
8
  content: {
9
- defaultValue<T = unknown>(arg: T): {
9
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
10
10
  deprecated: import("react-desc").PropTypesDescValidator;
11
11
  };
12
- isRequired: import("react-desc").PropTypesDescValidator;
12
+ isRequired: import("react-desc").PropTypesDescValue;
13
13
  };
14
14
  time: {
15
- defaultValue<T = unknown>(arg: T): {
15
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
16
16
  deprecated: import("react-desc").PropTypesDescValidator;
17
17
  };
18
- isRequired: import("react-desc").PropTypesDescValidator;
18
+ isRequired: import("react-desc").PropTypesDescValue;
19
19
  };
20
20
  rightAddon: {
21
- defaultValue<T = unknown>(arg: T): {
21
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
22
22
  deprecated: import("react-desc").PropTypesDescValidator;
23
23
  };
24
- isRequired: import("react-desc").PropTypesDescValidator;
24
+ isRequired: import("react-desc").PropTypesDescValue;
25
25
  };
26
26
  };
27
27
  };
@@ -3,22 +3,22 @@
3
3
  export declare const propTypes: {
4
4
  title: any;
5
5
  content: {
6
- defaultValue<T = unknown>(arg: T): {
6
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
7
7
  deprecated: import("react-desc").PropTypesDescValidator;
8
8
  };
9
- isRequired: import("react-desc").PropTypesDescValidator;
9
+ isRequired: import("react-desc").PropTypesDescValue;
10
10
  };
11
11
  time: {
12
- defaultValue<T = unknown>(arg: T): {
12
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
13
13
  deprecated: import("react-desc").PropTypesDescValidator;
14
14
  };
15
- isRequired: import("react-desc").PropTypesDescValidator;
15
+ isRequired: import("react-desc").PropTypesDescValue;
16
16
  };
17
17
  rightAddon: {
18
- defaultValue<T = unknown>(arg: T): {
18
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
19
19
  deprecated: import("react-desc").PropTypesDescValidator;
20
20
  };
21
- isRequired: import("react-desc").PropTypesDescValidator;
21
+ isRequired: import("react-desc").PropTypesDescValue;
22
22
  };
23
23
  };
24
24
  export interface CardPropTypes {
@@ -1,157 +1,5 @@
1
- /// <reference path="../../../../../../shared/typings/react-desc.d.ts" />
2
- /// <reference types="react" />
3
- export declare const StyledChatContainerContentComposer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
1
+ export declare const StyledChatContainerContentComposer: import("styled-components").StyledComponent<any, import("styled-components").DefaultTheme, object, string | number | symbol>;
4
2
  export declare const StyledComposerInput: import("styled-components").StyledComponent<"textarea", import("styled-components").DefaultTheme, any, never>;
5
- export declare const StyledComposerButton: import("styled-components").StyledComponent<{
6
- ({ innerRef, disabled, buttonType, fluidWidth, size, labelText, icon, onBlur, onClick, onKeyPress, leftIcon, tabIndex, variant, intent, containerProps, className, as: Component, type, ...rest }: {
7
- [x: string]: any;
8
- innerRef: any;
9
- disabled: any;
10
- buttonType: any;
11
- fluidWidth: any;
12
- size: any;
13
- labelText: any;
14
- icon: any;
15
- onBlur: any;
16
- onClick: any;
17
- onKeyPress: any;
18
- leftIcon: any;
19
- tabIndex: any;
20
- variant: any;
21
- intent: any;
22
- containerProps: any;
23
- className: any;
24
- as: any;
25
- type: any;
26
- }): JSX.Element;
27
- defaultProps: {
28
- disabled: boolean;
29
- fluidWidth: boolean;
30
- labelText: string;
31
- icon: null;
32
- onBlur: () => null;
33
- onClick: () => null;
34
- onKeyPress: () => null;
35
- leftIcon: null;
36
- tabIndex: number;
37
- variant: string;
38
- containerProps: {};
39
- as: string;
40
- type: string;
41
- };
42
- propTypes: {
43
- tabIndex: {
44
- defaultValue<T = unknown>(arg: T): {
45
- deprecated: import("react-desc").PropTypesDescValidator;
46
- };
47
- isRequired: import("react-desc").PropTypesDescValidator;
48
- };
49
- className: {
50
- defaultValue<T_1 = unknown>(arg: T_1): {
51
- deprecated: import("react-desc").PropTypesDescValidator;
52
- };
53
- isRequired: import("react-desc").PropTypesDescValidator;
54
- };
55
- 'aria-disabled': {
56
- defaultValue<T_2 = unknown>(arg: T_2): {
57
- deprecated: import("react-desc").PropTypesDescValidator;
58
- };
59
- isRequired: import("react-desc").PropTypesDescValidator;
60
- };
61
- as: {
62
- deprecated: import("react-desc").PropTypesDescValidator;
63
- };
64
- disabled: {
65
- defaultValue<T_3 = unknown>(arg: T_3): {
66
- deprecated: import("react-desc").PropTypesDescValidator;
67
- };
68
- isRequired: import("react-desc").PropTypesDescValidator;
69
- };
70
- fluidWidth: {
71
- defaultValue<T_4 = unknown>(arg: T_4): {
72
- deprecated: import("react-desc").PropTypesDescValidator;
73
- };
74
- isRequired: import("react-desc").PropTypesDescValidator;
75
- };
76
- labelText: {
77
- defaultValue<T_5 = unknown>(arg: T_5): {
78
- deprecated: import("react-desc").PropTypesDescValidator;
79
- };
80
- isRequired: import("react-desc").PropTypesDescValidator;
81
- };
82
- icon: {
83
- defaultValue<T_6 = unknown>(arg: T_6): {
84
- deprecated: import("react-desc").PropTypesDescValidator;
85
- };
86
- isRequired: import("react-desc").PropTypesDescValidator;
87
- };
88
- leftIcon: {
89
- defaultValue<T_7 = unknown>(arg: T_7): {
90
- deprecated: import("react-desc").PropTypesDescValidator;
91
- };
92
- isRequired: import("react-desc").PropTypesDescValidator;
93
- };
94
- buttonType: {
95
- defaultValue<T_8 = unknown>(arg: T_8): {
96
- deprecated: import("react-desc").PropTypesDescValidator;
97
- };
98
- isRequired: import("react-desc").PropTypesDescValidator;
99
- };
100
- size: {
101
- defaultValue<T_9 = unknown>(arg: T_9): {
102
- deprecated: import("react-desc").PropTypesDescValidator;
103
- };
104
- isRequired: import("react-desc").PropTypesDescValidator;
105
- };
106
- type: {
107
- defaultValue<T_10 = unknown>(arg: T_10): {
108
- deprecated: import("react-desc").PropTypesDescValidator;
109
- };
110
- isRequired: import("react-desc").PropTypesDescValidator;
111
- };
112
- variant: {
113
- defaultValue<T_11 = unknown>(arg: T_11): {
114
- deprecated: import("react-desc").PropTypesDescValidator;
115
- };
116
- isRequired: import("react-desc").PropTypesDescValidator;
117
- };
118
- innerRef: {
119
- defaultValue<T_12 = unknown>(arg: T_12): {
120
- deprecated: import("react-desc").PropTypesDescValidator;
121
- };
122
- isRequired: import("react-desc").PropTypesDescValidator;
123
- };
124
- onBlur: {
125
- defaultValue<T_13 = unknown>(arg: T_13): {
126
- deprecated: import("react-desc").PropTypesDescValidator;
127
- };
128
- isRequired: import("react-desc").PropTypesDescValidator;
129
- };
130
- intent: {
131
- defaultValue<T_14 = unknown>(arg: T_14): {
132
- deprecated: import("react-desc").PropTypesDescValidator;
133
- };
134
- isRequired: import("react-desc").PropTypesDescValidator;
135
- };
136
- containerProps: {
137
- defaultValue<T_15 = unknown>(arg: T_15): {
138
- deprecated: import("react-desc").PropTypesDescValidator;
139
- };
140
- isRequired: import("react-desc").PropTypesDescValidator;
141
- };
142
- onClick: {
143
- defaultValue<T_16 = unknown>(arg: T_16): {
144
- deprecated: import("react-desc").PropTypesDescValidator;
145
- };
146
- isRequired: import("react-desc").PropTypesDescValidator;
147
- };
148
- onKeyPress: {
149
- defaultValue<T_17 = unknown>(arg: T_17): {
150
- deprecated: import("react-desc").PropTypesDescValidator;
151
- };
152
- isRequired: import("react-desc").PropTypesDescValidator;
153
- };
154
- };
155
- }, import("styled-components").DefaultTheme, {}, never>;
156
- export declare const StyledCounterArea: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const StyledComposerButton: import("styled-components").StyledComponent<any, import("styled-components").DefaultTheme, object, string | number | symbol>;
4
+ export declare const StyledCounterArea: import("styled-components").StyledComponent<any, import("styled-components").DefaultTheme, object, string | number | symbol>;
157
5
  export declare const StyledCounterErrorA11y: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
@@ -17,25 +17,25 @@ declare const ChatContainer: {
17
17
  deprecated: import("react-desc").PropTypesDescValidator;
18
18
  };
19
19
  isLoading: {
20
- defaultValue<T = unknown>(arg: T): {
20
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
21
21
  deprecated: import("react-desc").PropTypesDescValidator;
22
22
  };
23
- isRequired: import("react-desc").PropTypesDescValidator;
23
+ isRequired: import("react-desc").PropTypesDescValue;
24
24
  };
25
25
  hasMoreItems: {
26
- defaultValue<T = unknown>(arg: T): {
26
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
27
27
  deprecated: import("react-desc").PropTypesDescValidator;
28
28
  };
29
- isRequired: import("react-desc").PropTypesDescValidator;
29
+ isRequired: import("react-desc").PropTypesDescValue;
30
30
  };
31
31
  getMoreMessages: {
32
32
  deprecated: import("react-desc").PropTypesDescValidator;
33
33
  };
34
34
  bannerPosition: {
35
- defaultValue<T = unknown>(arg: T): {
35
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
36
36
  deprecated: import("react-desc").PropTypesDescValidator;
37
37
  };
38
- isRequired: import("react-desc").PropTypesDescValidator;
38
+ isRequired: import("react-desc").PropTypesDescValue;
39
39
  };
40
40
  bannerProps: {
41
41
  deprecated: import("react-desc").PropTypesDescValidator;
@@ -11,22 +11,22 @@ declare const ChatContainerMessagesList: {
11
11
  deprecated: import("react-desc").PropTypesDescValidator;
12
12
  };
13
13
  onScrollEnds: {
14
- defaultValue<T = unknown>(arg: T): {
14
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
15
15
  deprecated: import("react-desc").PropTypesDescValidator;
16
16
  };
17
- isRequired: import("react-desc").PropTypesDescValidator;
17
+ isRequired: import("react-desc").PropTypesDescValue;
18
18
  };
19
19
  isLoading: {
20
- defaultValue<T = unknown>(arg: T): {
20
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
21
21
  deprecated: import("react-desc").PropTypesDescValidator;
22
22
  };
23
- isRequired: import("react-desc").PropTypesDescValidator;
23
+ isRequired: import("react-desc").PropTypesDescValue;
24
24
  };
25
25
  hasMoreItems: {
26
- defaultValue<T = unknown>(arg: T): {
26
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
27
27
  deprecated: import("react-desc").PropTypesDescValidator;
28
28
  };
29
- isRequired: import("react-desc").PropTypesDescValidator;
29
+ isRequired: import("react-desc").PropTypesDescValue;
30
30
  };
31
31
  getMoreMessages: {
32
32
  deprecated: import("react-desc").PropTypesDescValidator;
@@ -10,16 +10,16 @@ declare const MessageDelimiter: {
10
10
  deprecated: import("react-desc").PropTypesDescValidator;
11
11
  };
12
12
  extraProps: {
13
- defaultValue<T = unknown>(arg: T): {
13
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
14
14
  deprecated: import("react-desc").PropTypesDescValidator;
15
15
  };
16
- isRequired: import("react-desc").PropTypesDescValidator;
16
+ isRequired: import("react-desc").PropTypesDescValue;
17
17
  };
18
18
  verticalMargin: {
19
- defaultValue<T = unknown>(arg: T): {
19
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
20
20
  deprecated: import("react-desc").PropTypesDescValidator;
21
21
  };
22
- isRequired: import("react-desc").PropTypesDescValidator;
22
+ isRequired: import("react-desc").PropTypesDescValue;
23
23
  };
24
24
  };
25
25
  };
@@ -12,15 +12,15 @@ export declare const messageDelimiterProps: {
12
12
  deprecated: import("react-desc").PropTypesDescValidator;
13
13
  };
14
14
  extraProps: {
15
- defaultValue<T = unknown>(arg: T): {
15
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
16
16
  deprecated: import("react-desc").PropTypesDescValidator;
17
17
  };
18
- isRequired: import("react-desc").PropTypesDescValidator;
18
+ isRequired: import("react-desc").PropTypesDescValue;
19
19
  };
20
20
  verticalMargin: {
21
- defaultValue<T = unknown>(arg: T): {
21
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
22
22
  deprecated: import("react-desc").PropTypesDescValidator;
23
23
  };
24
- isRequired: import("react-desc").PropTypesDescValidator;
24
+ isRequired: import("react-desc").PropTypesDescValue;
25
25
  };
26
26
  };
@@ -7,10 +7,10 @@ declare const SystemMessage: {
7
7
  propTypes: {
8
8
  title: any;
9
9
  time: {
10
- defaultValue<T = unknown>(arg: T): {
10
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
11
11
  deprecated: import("react-desc").PropTypesDescValidator;
12
12
  };
13
- isRequired: import("react-desc").PropTypesDescValidator;
13
+ isRequired: import("react-desc").PropTypesDescValue;
14
14
  };
15
15
  body: any;
16
16
  };
@@ -8,10 +8,10 @@ export declare const defaultProps: SystemMessageProps;
8
8
  export declare const systemMessageProps: {
9
9
  title: any;
10
10
  time: {
11
- defaultValue<T = unknown>(arg: T): {
11
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
12
12
  deprecated: import("react-desc").PropTypesDescValidator;
13
13
  };
14
- isRequired: import("react-desc").PropTypesDescValidator;
14
+ isRequired: import("react-desc").PropTypesDescValue;
15
15
  };
16
16
  body: any;
17
17
  };
@@ -59,10 +59,10 @@ declare const TileButton: {
59
59
  deprecated: import("react-desc").PropTypesDescValidator;
60
60
  };
61
61
  innerRef: {
62
- defaultValue<T = unknown>(arg: T): {
62
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
63
63
  deprecated: import("react-desc").PropTypesDescValidator;
64
64
  };
65
- isRequired: import("react-desc").PropTypesDescValidator;
65
+ isRequired: import("react-desc").PropTypesDescValue;
66
66
  };
67
67
  };
68
68
  defaultProps: TileButtonProps;
@@ -80,9 +80,9 @@ export declare const propsTileButton: {
80
80
  deprecated: import("react-desc").PropTypesDescValidator;
81
81
  };
82
82
  innerRef: {
83
- defaultValue<T = unknown>(arg: T): {
83
+ defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
84
84
  deprecated: import("react-desc").PropTypesDescValidator;
85
85
  };
86
- isRequired: import("react-desc").PropTypesDescValidator;
86
+ isRequired: import("react-desc").PropTypesDescValue;
87
87
  };
88
88
  };