@elliemae/ds-chat 2.3.0-next.6 → 2.3.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{parts → exported-related}/bubble/ChatBubble.js +8 -10
- package/cjs/{parts → exported-related}/bubble/ChatBubbleArrow.js +0 -0
- package/cjs/{parts → exported-related}/bubble/index.js +0 -0
- package/cjs/exported-related/bubble/props.js +43 -0
- package/cjs/{parts → exported-related}/bubble/styled.js +9 -9
- package/cjs/{parts → exported-related}/chat-card/ChatCard.js +6 -7
- package/cjs/{parts → exported-related}/chat-card/index.js +0 -0
- package/cjs/exported-related/chat-card/props.js +22 -0
- package/cjs/{parts → exported-related}/chat-card/styled.js +6 -6
- package/cjs/{parts → exported-related}/chat-container-header/ChatContainerHeader.js +10 -4
- package/cjs/{parts → exported-related}/chat-container-header/helpers.js +0 -0
- package/cjs/exported-related/chat-container-header/props.js +18 -0
- package/cjs/{parts → exported-related}/chat-container-header/styled.js +4 -4
- package/cjs/{parts → exported-related}/chat-empty-state/ChatEmptyState.js +8 -10
- package/cjs/exported-related/chat-empty-state/props.js +18 -0
- package/cjs/{parts → exported-related}/chat-empty-state/styled.js +2 -2
- package/cjs/{parts → exported-related}/chat-sidebar/SideBarChat.js +10 -11
- package/cjs/{parts → exported-related}/chat-sidebar/index.js +0 -0
- package/cjs/{parts → exported-related}/chat-sidebar/props.js +2 -5
- package/cjs/{parts → exported-related/chat-sidebar}/sidebar-button/SidebarButton.js +1 -1
- package/cjs/{parts → exported-related/chat-sidebar}/sidebar-button/index.js +0 -0
- package/cjs/exported-related/chat-sidebar/sidebar-button/props.js +25 -0
- package/cjs/{parts → exported-related/chat-sidebar}/sidebar-button/styled.js +4 -4
- package/cjs/{parts → exported-related}/chat-sidebar/styled.js +2 -2
- package/cjs/{parts → exported-related}/floating-button/FloatingButton.js +13 -6
- package/cjs/{parts → exported-related}/floating-button/index.js +1 -0
- package/cjs/{parts → exported-related}/floating-button/props.js +0 -0
- package/cjs/{parts → exported-related}/floating-button/styled.js +1 -1
- package/cjs/{parts → exported-related}/floating-container/styled.js +1 -1
- package/cjs/{parts → exported-related}/grid-influencer/InfluencerContainer.js +1 -1
- package/cjs/{parts → exported-related}/grid-influencer/styled.js +2 -2
- package/cjs/exported-related/index.js +37 -0
- package/cjs/exported-related/message-delimiter/MessageDelimiter.js +53 -0
- package/cjs/{parts → exported-related}/message-delimiter/index.js +0 -0
- package/cjs/exported-related/message-delimiter/props.js +33 -0
- package/cjs/{parts → exported-related}/message-delimiter/styled.js +3 -3
- package/cjs/{parts → exported-related}/system-message/SystemMessage.js +6 -8
- package/cjs/{parts → exported-related}/system-message/index.js +0 -0
- package/cjs/{parts → exported-related}/system-message/props.js +0 -0
- package/cjs/{parts → exported-related}/system-message/style.js +5 -5
- package/cjs/{parts → exported-related}/tile-button/TileButton.js +7 -9
- package/cjs/{parts → exported-related}/tile-button/index.js +0 -0
- package/cjs/exported-related/tile-button/props.js +55 -0
- package/cjs/{parts → exported-related}/tile-button/styled.js +9 -9
- package/cjs/index.js +29 -18
- package/cjs/parts/chat-composer/ChatContainerComposer.js +7 -9
- package/cjs/parts/chat-container/ChatContainer.js +18 -20
- package/cjs/parts/chat-container/styled.js +2 -2
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +83 -70
- package/cjs/parts/chat-container-messages-list/styled.js +9 -5
- package/cjs/parts/chat-container-messages-list/useGetNewMessages.js +28 -0
- package/cjs/parts/index.js +16 -0
- package/cjs/react-desc-prop-types.js +116 -0
- package/esm/{parts → exported-related}/bubble/ChatBubble.js +7 -9
- package/esm/{parts → exported-related}/bubble/ChatBubbleArrow.js +0 -0
- package/esm/{parts → exported-related}/bubble/index.js +0 -0
- package/esm/{parts → exported-related}/bubble/props.js +14 -24
- package/esm/{parts → exported-related}/bubble/styled.js +9 -9
- package/esm/{parts → exported-related}/chat-card/ChatCard.js +4 -5
- package/esm/{parts → exported-related}/chat-card/index.js +0 -0
- package/esm/{parts → exported-related}/chat-card/props.js +9 -2
- package/esm/{parts → exported-related}/chat-card/styled.js +6 -6
- package/esm/{parts → exported-related}/chat-container-header/ChatContainerHeader.js +9 -4
- package/esm/{parts → exported-related}/chat-container-header/helpers.js +0 -0
- package/esm/exported-related/chat-container-header/props.js +13 -0
- package/esm/{parts → exported-related}/chat-container-header/styled.js +4 -4
- package/esm/{parts → exported-related}/chat-empty-state/ChatEmptyState.js +7 -9
- package/esm/exported-related/chat-empty-state/props.js +13 -0
- package/esm/{parts → exported-related}/chat-empty-state/styled.js +2 -2
- package/esm/{parts → exported-related}/chat-sidebar/SideBarChat.js +8 -9
- package/esm/{parts → exported-related}/chat-sidebar/index.js +0 -0
- package/esm/{parts → exported-related}/chat-sidebar/props.js +2 -5
- package/esm/{parts → exported-related/chat-sidebar}/sidebar-button/SidebarButton.js +1 -1
- package/esm/{parts → exported-related/chat-sidebar}/sidebar-button/index.js +0 -0
- package/esm/{parts → exported-related/chat-sidebar}/sidebar-button/props.js +3 -4
- package/esm/{parts → exported-related/chat-sidebar}/sidebar-button/styled.js +4 -4
- package/esm/{parts → exported-related}/chat-sidebar/styled.js +2 -2
- package/esm/exported-related/floating-button/FloatingButton.js +33 -0
- package/esm/exported-related/floating-button/index.js +1 -0
- package/esm/{parts → exported-related}/floating-button/props.js +0 -0
- package/esm/{parts → exported-related}/floating-button/styled.js +1 -1
- package/esm/{parts → exported-related}/floating-container/styled.js +1 -1
- package/esm/{parts → exported-related}/grid-influencer/InfluencerContainer.js +1 -1
- package/esm/{parts → exported-related}/grid-influencer/styled.js +2 -2
- package/esm/exported-related/index.js +11 -0
- package/esm/exported-related/message-delimiter/MessageDelimiter.js +43 -0
- package/esm/{parts → exported-related}/message-delimiter/index.js +0 -0
- package/esm/exported-related/message-delimiter/props.js +24 -0
- package/esm/{parts → exported-related}/message-delimiter/styled.js +3 -3
- package/esm/{parts → exported-related}/system-message/SystemMessage.js +4 -6
- package/esm/{parts → exported-related}/system-message/index.js +0 -0
- package/esm/{parts → exported-related}/system-message/props.js +0 -0
- package/esm/{parts → exported-related}/system-message/style.js +5 -5
- package/esm/{parts → exported-related}/tile-button/TileButton.js +5 -7
- package/esm/{parts → exported-related}/tile-button/index.js +0 -0
- package/esm/{parts → exported-related}/tile-button/props.js +3 -3
- package/esm/{parts → exported-related}/tile-button/styled.js +9 -9
- package/esm/index.js +14 -12
- package/esm/parts/chat-composer/ChatContainerComposer.js +9 -11
- package/esm/parts/chat-container/ChatContainer.js +16 -18
- package/esm/parts/chat-container/styled.js +2 -2
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +81 -68
- package/esm/parts/chat-container-messages-list/styled.js +9 -6
- package/esm/parts/chat-container-messages-list/useGetNewMessages.js +24 -0
- package/esm/parts/index.js +3 -0
- package/esm/react-desc-prop-types.js +103 -0
- package/package.json +176 -216
- package/types/exported-related/bubble/ChatBubble.d.ts +5 -0
- package/types/{parts → exported-related}/bubble/ChatBubbleArrow.d.ts +1 -1
- package/types/{parts → exported-related}/bubble/index.d.ts +0 -0
- package/types/exported-related/bubble/props.d.ts +33 -0
- package/types/{parts → exported-related}/bubble/styled.d.ts +11 -7
- package/types/{parts → exported-related}/bubble/tests/ChatBubble.test.d.ts +0 -0
- package/types/exported-related/chat-card/ChatCard.d.ts +5 -0
- package/types/{parts → exported-related}/chat-card/index.d.ts +0 -0
- package/types/exported-related/chat-card/props.d.ts +14 -0
- package/types/{parts → exported-related}/chat-card/styled.d.ts +0 -0
- package/types/exported-related/chat-container-header/ChatContainerHeader.d.ts +5 -0
- package/types/{parts → exported-related}/chat-container-header/helpers.d.ts +2 -2
- package/types/exported-related/chat-container-header/props.d.ts +10 -0
- package/types/{parts → exported-related}/chat-container-header/styled.d.ts +0 -0
- package/types/exported-related/chat-container-header/tests/ChatContainerHeader.test.d.ts +1 -0
- package/types/exported-related/chat-empty-state/ChatEmptyState.d.ts +5 -0
- package/types/exported-related/chat-empty-state/props.d.ts +10 -0
- package/types/{parts → exported-related}/chat-empty-state/styled.d.ts +0 -0
- package/types/exported-related/chat-sidebar/SideBarChat.d.ts +5 -0
- package/types/{parts → exported-related}/chat-sidebar/index.d.ts +0 -0
- package/types/{parts → exported-related}/chat-sidebar/props.d.ts +4 -4
- package/types/exported-related/chat-sidebar/sidebar-button/SidebarButton.d.ts +13 -0
- package/types/{parts → exported-related/chat-sidebar}/sidebar-button/index.d.ts +0 -0
- package/types/exported-related/chat-sidebar/sidebar-button/props.d.ts +18 -0
- package/types/{parts → exported-related/chat-sidebar}/sidebar-button/styled.d.ts +0 -0
- package/types/{parts → exported-related}/chat-sidebar/styled.d.ts +0 -0
- package/types/exported-related/floating-button/FloatingButton.d.ts +5 -0
- package/types/{parts → exported-related}/floating-button/index.d.ts +0 -0
- package/types/{parts → exported-related}/floating-button/props.d.ts +0 -0
- package/types/{parts → exported-related}/floating-button/styled.d.ts +0 -0
- package/types/exported-related/floating-container/styled.d.ts +2 -0
- package/types/{parts → exported-related}/grid-influencer/InfluencerContainer.d.ts +0 -0
- package/types/{parts → exported-related}/grid-influencer/styled.d.ts +0 -0
- package/types/exported-related/index.d.ts +10 -0
- package/types/exported-related/message-delimiter/MessageDelimiter.d.ts +5 -0
- package/types/{parts → exported-related}/message-delimiter/index.d.ts +0 -0
- package/types/exported-related/message-delimiter/props.d.ts +371 -0
- package/types/{parts → exported-related}/message-delimiter/styled.d.ts +0 -0
- package/types/exported-related/system-message/SystemMessage.d.ts +5 -0
- package/types/{parts → exported-related}/system-message/index.d.ts +0 -0
- package/types/{parts → exported-related}/system-message/props.d.ts +0 -0
- package/types/{parts → exported-related}/system-message/style.d.ts +0 -0
- package/types/exported-related/tile-button/TileButton.d.ts +5 -0
- package/types/{parts → exported-related}/tile-button/index.d.ts +0 -0
- package/types/exported-related/tile-button/props.d.ts +46 -0
- package/types/{parts → exported-related}/tile-button/styled.d.ts +1 -1
- package/types/index.d.ts +4 -13
- package/types/parts/chat-composer/ChatContainerComposer.d.ts +4 -59
- package/types/parts/chat-composer/styled.d.ts +4 -3
- package/types/parts/chat-container/ChatContainer.d.ts +4 -62
- package/types/parts/chat-container-messages-list/ChatContainerMessagesList.d.ts +4 -47
- package/types/parts/chat-container-messages-list/index.d.ts +1 -1
- package/types/parts/chat-container-messages-list/styled.d.ts +2 -2
- package/types/parts/chat-container-messages-list/useGetNewMessages.d.ts +2 -0
- package/types/parts/index.d.ts +3 -0
- package/types/react-desc-prop-types.d.ts +838 -0
- package/cjs/index.d.js +0 -2
- package/cjs/parts/bubble/config/useValidateProps.js +0 -31
- package/cjs/parts/bubble/props.js +0 -57
- package/cjs/parts/chat-card/config/useValidateProps.js +0 -11
- package/cjs/parts/chat-card/props.js +0 -14
- package/cjs/parts/chat-composer/config/useValidateProps.js +0 -11
- package/cjs/parts/chat-composer/props.js +0 -44
- package/cjs/parts/chat-container/config/useValidateProps.js +0 -11
- package/cjs/parts/chat-container/index.js +0 -10
- package/cjs/parts/chat-container/props.js +0 -49
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js +0 -11
- package/cjs/parts/chat-container-messages-list/props.js +0 -30
- package/cjs/parts/chat-empty-state/config/useValidateProps.js +0 -11
- package/cjs/parts/chat-empty-state/props.js +0 -17
- package/cjs/parts/chat-sidebar/config/useValidateProps.js +0 -11
- package/cjs/parts/message-delimiter/MessageDelimiter.js +0 -41
- package/cjs/parts/message-delimiter/config/useValidateProps.js +0 -11
- package/cjs/parts/message-delimiter/props.js +0 -23
- package/cjs/parts/sidebar-button/props.js +0 -30
- package/cjs/parts/system-message/config/useValidateProps.js +0 -11
- package/cjs/parts/tile-button/config/useValidateProps.js +0 -11
- package/cjs/parts/tile-button/props.js +0 -55
- package/cjs/prop-types.js +0 -33
- package/esm/index.d.js +0 -1
- package/esm/parts/bubble/config/useValidateProps.js +0 -27
- package/esm/parts/chat-card/config/useValidateProps.js +0 -7
- package/esm/parts/chat-composer/config/useValidateProps.js +0 -7
- package/esm/parts/chat-composer/props.js +0 -39
- package/esm/parts/chat-container/config/useValidateProps.js +0 -7
- package/esm/parts/chat-container/index.js +0 -1
- package/esm/parts/chat-container/props.js +0 -44
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js +0 -7
- package/esm/parts/chat-container-messages-list/props.js +0 -25
- package/esm/parts/chat-empty-state/config/useValidateProps.js +0 -7
- package/esm/parts/chat-empty-state/props.js +0 -12
- package/esm/parts/chat-sidebar/config/useValidateProps.js +0 -7
- package/esm/parts/floating-button/FloatingButton.js +0 -27
- package/esm/parts/floating-button/index.js +0 -1
- package/esm/parts/message-delimiter/MessageDelimiter.js +0 -32
- package/esm/parts/message-delimiter/config/useValidateProps.js +0 -7
- package/esm/parts/message-delimiter/props.js +0 -18
- package/esm/parts/system-message/config/useValidateProps.js +0 -7
- package/esm/parts/tile-button/config/useValidateProps.js +0 -7
- package/esm/prop-types.js +0 -28
- package/types/index.d.d.ts +0 -37
- package/types/parts/bubble/ChatBubble.d.ts +0 -30
- package/types/parts/bubble/config/useValidateProps.d.ts +0 -2
- package/types/parts/bubble/props.d.ts +0 -52
- package/types/parts/chat-card/ChatCard.d.ts +0 -33
- package/types/parts/chat-card/config/useValidateProps.d.ts +0 -2
- package/types/parts/chat-card/props.d.ts +0 -29
- package/types/parts/chat-composer/config/useValidateProps.d.ts +0 -2
- package/types/parts/chat-container/config/useValidateProps.d.ts +0 -2
- package/types/parts/chat-container/index.d.ts +0 -1
- package/types/parts/chat-container-header/ChatContainerHeader.d.ts +0 -2
- package/types/parts/chat-container-messages-list/config/useValidateProps.d.ts +0 -2
- package/types/parts/chat-empty-state/ChatEmptyState.d.ts +0 -21
- package/types/parts/chat-empty-state/config/useValidateProps.d.ts +0 -2
- package/types/parts/chat-empty-state/props.d.ts +0 -15
- package/types/parts/chat-sidebar/SideBarChat.d.ts +0 -48
- package/types/parts/chat-sidebar/config/useValidateProps.d.ts +0 -2
- package/types/parts/floating-button/FloatingButton.d.ts +0 -18
- package/types/parts/floating-container/styled.d.ts +0 -1
- package/types/parts/message-delimiter/MessageDelimiter.d.ts +0 -31
- package/types/parts/message-delimiter/config/useValidateProps.d.ts +0 -2
- package/types/parts/message-delimiter/props.d.ts +0 -26
- package/types/parts/sidebar-button/SidebarButton.d.ts +0 -24
- package/types/parts/sidebar-button/props.d.ts +0 -29
- package/types/parts/system-message/SystemMessage.d.ts +0 -23
- package/types/parts/system-message/config/useValidateProps.d.ts +0 -2
- package/types/parts/tile-button/TileButton.d.ts +0 -75
- package/types/parts/tile-button/config/useValidateProps.d.ts +0 -2
- package/types/parts/tile-button/props.d.ts +0 -88
- package/types/prop-types.d.ts +0 -33
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
+
import 'react';
|
|
9
|
+
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';
|
|
10
|
+
import { Wrapper, Line, Text } from './styled.js';
|
|
11
|
+
import { messageDelimiterProps, defaultProps } from './props.js';
|
|
12
|
+
import { jsxs } from 'react/jsx-runtime';
|
|
13
|
+
|
|
14
|
+
var _Line, _Line2;
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
+
|
|
20
|
+
const MessageDelimiter = props => {
|
|
21
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
22
|
+
useValidateTypescriptPropTypes(propsWithDefault, messageDelimiterProps);
|
|
23
|
+
const globalAttrs = useGetGlobalAttributes(propsWithDefault);
|
|
24
|
+
const {
|
|
25
|
+
title,
|
|
26
|
+
size,
|
|
27
|
+
verticalMargin
|
|
28
|
+
} = propsWithDefault;
|
|
29
|
+
return /*#__PURE__*/jsxs(Wrapper, _objectSpread(_objectSpread({
|
|
30
|
+
cols: ['1fr', 'auto', '1fr']
|
|
31
|
+
}, globalAttrs), {}, {
|
|
32
|
+
children: [_Line || (_Line = /*#__PURE__*/_jsx(Line, {})), /*#__PURE__*/_jsx(Text, {
|
|
33
|
+
size: size,
|
|
34
|
+
verticalMargin: verticalMargin,
|
|
35
|
+
"data-testid": "chat-message-delimiter-title"
|
|
36
|
+
}, void 0, title), _Line2 || (_Line2 = /*#__PURE__*/_jsx(Line, {}))]
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const MessageDelimiterWithSchema = describe(MessageDelimiter);
|
|
41
|
+
MessageDelimiterWithSchema.propTypes = messageDelimiterProps;
|
|
42
|
+
|
|
43
|
+
export { MessageDelimiter, MessageDelimiterWithSchema };
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
+
const defaultProps = {
|
|
13
|
+
title: '',
|
|
14
|
+
size: 's',
|
|
15
|
+
verticalMargin: '0px'
|
|
16
|
+
};
|
|
17
|
+
const messageDelimiterProps = _objectSpread(_objectSpread({}, globalAttributesPropTypes), {}, {
|
|
18
|
+
title: PropTypes.string.isRequired.description('Text to display in the delimiter'),
|
|
19
|
+
size: PropTypes.oneOf(['s', 'l']).description('size of the delimiter').defaultValue('s'),
|
|
20
|
+
extraProps: PropTypes.object.description('extra props for delimiter'),
|
|
21
|
+
verticalMargin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Configurable css vertical margin property for flexibilty')
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export { defaultProps, messageDelimiterProps };
|
|
@@ -2,13 +2,13 @@ import { Grid } from '@elliemae/ds-grid';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
const Wrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
5
|
-
componentId: "sc-
|
|
5
|
+
componentId: "sc-1oelxl4-0"
|
|
6
6
|
})(["align-items:center;justify-content:center;width:100%;min-height:8px;"]);
|
|
7
7
|
const Line = /*#__PURE__*/styled.span.withConfig({
|
|
8
|
-
componentId: "sc-
|
|
8
|
+
componentId: "sc-1oelxl4-1"
|
|
9
9
|
})(["border-top:1px solid ", ";"], props => props.theme.colors.neutral['400']);
|
|
10
10
|
const Text = /*#__PURE__*/styled.p.withConfig({
|
|
11
|
-
componentId: "sc-
|
|
11
|
+
componentId: "sc-1oelxl4-2"
|
|
12
12
|
})(["color:", ";font-size:", ";font-weight:", ";margin:", ";"], props => props.theme.colors.neutral['600'], props => props.size === 's' ? '12px' : '14px', props => props.theme.fontWeights.semibold, props => typeof props.verticalMargin === 'number' ? "".concat(props.verticalMargin, "px 8px") : "".concat(props.verticalMargin, " 8px"));
|
|
13
13
|
|
|
14
14
|
export { Line, Text, Wrapper };
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'core-js/modules/web.url.to-json.js';
|
|
3
2
|
import 'react';
|
|
4
|
-
import { describe } from '
|
|
3
|
+
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
5
4
|
import { Wrapper, Header, Title, Time, Message } from './style.js';
|
|
6
5
|
import { systemMessageProps, defaultProps } from './props.js';
|
|
7
|
-
import { useValidateProps } from './config/useValidateProps.js';
|
|
8
6
|
|
|
9
7
|
var _span;
|
|
10
8
|
|
|
11
9
|
const SystemMessage = props => {
|
|
12
|
-
|
|
10
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
11
|
+
useValidateTypescriptPropTypes(propsWithDefault, systemMessageProps);
|
|
13
12
|
const {
|
|
14
13
|
title,
|
|
15
14
|
time,
|
|
16
15
|
body
|
|
17
|
-
} =
|
|
16
|
+
} = propsWithDefault;
|
|
18
17
|
return /*#__PURE__*/_jsx(Wrapper, {
|
|
19
18
|
rows: ['auto', 'auto']
|
|
20
19
|
}, void 0, /*#__PURE__*/_jsx(Header, {
|
|
@@ -28,7 +27,6 @@ const SystemMessage = props => {
|
|
|
28
27
|
}, void 0, body));
|
|
29
28
|
};
|
|
30
29
|
|
|
31
|
-
SystemMessage.defaultProps = defaultProps;
|
|
32
30
|
const SystemMessageWithSchema = describe(SystemMessage);
|
|
33
31
|
SystemMessageWithSchema.propTypes = systemMessageProps;
|
|
34
32
|
|
|
File without changes
|
|
File without changes
|
|
@@ -2,19 +2,19 @@ import styled from 'styled-components';
|
|
|
2
2
|
import { Grid } from '@elliemae/ds-grid';
|
|
3
3
|
|
|
4
4
|
const Wrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
5
|
-
componentId: "sc-
|
|
5
|
+
componentId: "sc-1qrpnrc-0"
|
|
6
6
|
})(["align-items:center;justify-content:center;max-width:100%;padding:0 8px 8px;border:1px solid ", ";border-radius:10px;background-color:", ";box-shadow:none;"], props => props.theme.colors.neutral['100'], props => props.theme.colors.neutral['080']);
|
|
7
7
|
const Header = /*#__PURE__*/styled(Grid).withConfig({
|
|
8
|
-
componentId: "sc-
|
|
8
|
+
componentId: "sc-1qrpnrc-1"
|
|
9
9
|
})(["align-items:center;height:36px;"]);
|
|
10
10
|
const Title = /*#__PURE__*/styled.p.withConfig({
|
|
11
|
-
componentId: "sc-
|
|
11
|
+
componentId: "sc-1qrpnrc-2"
|
|
12
12
|
})(["font-size:14px;font-weight:", ";color:", ";margin:0;"], props => props.theme.fontWeights.semibold, props => props.theme.colors.neutral['700']);
|
|
13
13
|
const Time = /*#__PURE__*/styled.p.withConfig({
|
|
14
|
-
componentId: "sc-
|
|
14
|
+
componentId: "sc-1qrpnrc-3"
|
|
15
15
|
})(["font-size:12px;font-weight:", ";color:", ";margin:0;text-align:right;"], props => props.theme.fontWeights.regular, props => props.theme.colors.neutral['700']);
|
|
16
16
|
const Message = /*#__PURE__*/styled.p.withConfig({
|
|
17
|
-
componentId: "sc-
|
|
17
|
+
componentId: "sc-1qrpnrc-4"
|
|
18
18
|
})(["font-size:13px;font-weight:", ";color:", ";min-height:32px;text-align:center;margin:0;"], props => props.theme.fontWeights.regular, props => props.theme.colors.neutral['700']);
|
|
19
19
|
|
|
20
20
|
export { Header, Message, Time, Title, Wrapper };
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'core-js/modules/web.url.to-json.js';
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import { describe } from '
|
|
3
|
+
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
5
4
|
import { DSTooltipV3 } from '@elliemae/ds-tooltip';
|
|
6
5
|
import { Grid } from '@elliemae/ds-grid';
|
|
7
6
|
import { CloseXsmall } from '@elliemae/ds-icons';
|
|
8
7
|
import { StyledWrapperCentralContent, StyledTileButtonIcon, StyledStatusBadge, StyledTileButtonLabel, StyledTileButton, StyledWrapper, StyledWrapperLeftBorder, CloseButton, StyledTooltipV3ButtonWrapper } from './styled.js';
|
|
9
8
|
import { propsTileButton, defaultTileButton } from './props.js';
|
|
10
|
-
import { useValidateProps } from './config/useValidateProps.js';
|
|
11
9
|
import { jsx } from 'react/jsx-runtime';
|
|
12
10
|
|
|
13
11
|
var _StyledWrapperLeftBor, _CloseXsmall;
|
|
@@ -15,7 +13,8 @@ var _StyledWrapperLeftBor, _CloseXsmall;
|
|
|
15
13
|
const TileButton = props => {
|
|
16
14
|
var _Icon, _StyledTileButtonLabe, _span;
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultTileButton);
|
|
17
|
+
useValidateTypescriptPropTypes(propsWithDefault, propsTileButton);
|
|
19
18
|
const {
|
|
20
19
|
label,
|
|
21
20
|
title,
|
|
@@ -36,7 +35,7 @@ const TileButton = props => {
|
|
|
36
35
|
tooltipPlacement,
|
|
37
36
|
disableTooltip,
|
|
38
37
|
innerRef
|
|
39
|
-
} =
|
|
38
|
+
} = propsWithDefault;
|
|
40
39
|
const handleClick = React.useCallback(() => {
|
|
41
40
|
onClick(dsId, title);
|
|
42
41
|
}, [dsId, onClick, title]);
|
|
@@ -58,7 +57,7 @@ const TileButton = props => {
|
|
|
58
57
|
}) : null)), !isHeader ? /*#__PURE__*/_jsx(Grid, {
|
|
59
58
|
width: "100%",
|
|
60
59
|
justifyContent: "center"
|
|
61
|
-
}, void 0, label ? _StyledTileButtonLabe || (_StyledTileButtonLabe = /*#__PURE__*/_jsx(StyledTileButtonLabel, {}, void 0, label)) : null) : null), [isHeader, Icon, badge, badgeColor, badgePosition, label]);
|
|
60
|
+
}, void 0, label ? _StyledTileButtonLabe || (_StyledTileButtonLabe = /*#__PURE__*/_jsx(StyledTileButtonLabel, {}, void 0, label)) : null) : null), [isHeader, Icon, badge, dsId, badgeColor, badgePosition, label]);
|
|
62
61
|
const Btn = React.useMemo(() => /*#__PURE__*/jsx(StyledTileButton, {
|
|
63
62
|
isHeader: isHeader,
|
|
64
63
|
value: dsId,
|
|
@@ -90,7 +89,6 @@ const TileButton = props => {
|
|
|
90
89
|
}, void 0, Btn)) : Btn;
|
|
91
90
|
};
|
|
92
91
|
|
|
93
|
-
TileButton.defaultProps = defaultTileButton;
|
|
94
92
|
const TileButtonWithSchema = describe(TileButton);
|
|
95
93
|
TileButtonWithSchema.propTypes = propsTileButton;
|
|
96
94
|
|
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { PropTypes } from '
|
|
1
|
+
import { PropTypes } from '@elliemae/ds-props-helpers';
|
|
2
2
|
import { noop } from 'lodash';
|
|
3
3
|
import { Comments } from '@elliemae/ds-icons';
|
|
4
4
|
|
|
5
5
|
const defaultTileButton = {
|
|
6
6
|
Icon: Comments,
|
|
7
|
-
dsId:
|
|
7
|
+
dsId: '',
|
|
8
8
|
label: '',
|
|
9
9
|
onClick: noop,
|
|
10
10
|
onBlur: noop,
|
|
@@ -25,7 +25,7 @@ const defaultTileButton = {
|
|
|
25
25
|
};
|
|
26
26
|
const propsTileButton = {
|
|
27
27
|
Icon: PropTypes.func.description('Icon component').defaultValue(defaultTileButton.Icon),
|
|
28
|
-
dsId: PropTypes.
|
|
28
|
+
dsId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Unique id for the button').defaultValue(defaultTileButton.dsId),
|
|
29
29
|
label: PropTypes.string.description('It will display under the icon').defaultValue(defaultTileButton.label),
|
|
30
30
|
title: PropTypes.string.description('Tooltip').defaultValue(defaultTileButton.title),
|
|
31
31
|
onClick: PropTypes.func.description('The function to call when is clicked').defaultValue(defaultTileButton.onClick),
|
|
@@ -8,10 +8,10 @@ const MIN_WIDTH_SIDEBAR = 48;
|
|
|
8
8
|
const BUTTON_SIDEBAR_HEIGHT = 48; // Buttons
|
|
9
9
|
|
|
10
10
|
const StyledWrapperLeftBorder = /*#__PURE__*/styled(Grid).withConfig({
|
|
11
|
-
componentId: "sc-
|
|
11
|
+
componentId: "sc-b69sbu-0"
|
|
12
12
|
})(["height:100%;width:4px;position:absolute;top:0;left:0;"]);
|
|
13
13
|
const StyledStatusBadge = /*#__PURE__*/styled.div.withConfig({
|
|
14
|
-
componentId: "sc-
|
|
14
|
+
componentId: "sc-b69sbu-1"
|
|
15
15
|
})(["height:8px;width:8px;position:absolute;top:0;background:", ";", ";border-radius:50%;box-sizing:content-box;"], props => {
|
|
16
16
|
switch (props.badgeColor) {
|
|
17
17
|
case 'blue':
|
|
@@ -36,23 +36,23 @@ const StyledStatusBadge = /*#__PURE__*/styled.div.withConfig({
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
const StyledWrapperCentralContent = /*#__PURE__*/styled(Grid).withConfig({
|
|
39
|
-
componentId: "sc-
|
|
39
|
+
componentId: "sc-b69sbu-2"
|
|
40
40
|
})(["width:24px;height:40px;"]);
|
|
41
41
|
const StyledTileButtonIcon = /*#__PURE__*/styled(Grid).withConfig({
|
|
42
|
-
componentId: "sc-
|
|
42
|
+
componentId: "sc-b69sbu-3"
|
|
43
43
|
})(["position:relative;height:24px;width:24px;svg{fill:", ";}&:focus{svg{fill:", ";}}"], props => props.theme.colors.neutral[500], props => props.theme.colors.brand[800]);
|
|
44
44
|
const StyledTileButtonLabel = /*#__PURE__*/styled.div.withConfig({
|
|
45
|
-
componentId: "sc-
|
|
45
|
+
componentId: "sc-b69sbu-4"
|
|
46
46
|
})(["width:24px;height:", ";text-transform:uppercase;overflow:hidden;text-align:center;font-size:13px;color:", ";line-height:17px;"], props => props.theme.space.xs, props => props.theme.colors.neutral[600]);
|
|
47
47
|
const CloseButton = /*#__PURE__*/styled.button.withConfig({
|
|
48
|
-
componentId: "sc-
|
|
48
|
+
componentId: "sc-b69sbu-5"
|
|
49
49
|
})(["outline:none;background:none;height:9px;width:9px;position:absolute;top:1px;right:1px;overflow:hidden;padding:0;border:none;span{position:absolute;left:-3px;top:-4px;}&:focus,&:hover{svg{fill:", ";}&:after{display:block;content:'';position:absolute;top:0;left:0;width:100%;height:100%;border:solid 1px ", ";border-radius:2px;}}cursor:pointer;"], props => props.theme.colors.brand[600], props => props.theme.colors.brand[600]); // MAIN WRAPPER
|
|
50
50
|
|
|
51
51
|
const StyledTooltipV3ButtonWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
52
|
-
componentId: "sc-
|
|
52
|
+
componentId: "sc-b69sbu-6"
|
|
53
53
|
})(["height:", "px;width:", "px;"], BUTTON_SIDEBAR_HEIGHT, MIN_WIDTH_SIDEBAR);
|
|
54
54
|
const StyledTileButton = /*#__PURE__*/styled.button.withConfig({
|
|
55
|
-
componentId: "sc-
|
|
55
|
+
componentId: "sc-b69sbu-7"
|
|
56
56
|
})(["outline:none;background:transparent;height:", "px;width:", "px;position:relative;padding:0;border:none;cursor:pointer;border-bottom:", ";&:focus,&:hover,&:active,&:disabled{background:", ";& ", "{border:2px solid ", ";margin-top:-2px;", ";}}&:focus,&:hover{& ", "{background:", ";}& ", "{color:", ";}& svg{fill:", ";}}&:active:not(:disabled){background:", ";& ", "{background:", ";}& ", "{color:", ";font-weight:600;}& svg{fill:", ";}& ", "{border:2px solid ", ";}}&:disabled{background:", ";", "{background:", ";}& ", "{background:", ";border:2px solid ", ";}", "{svg{fill:", ";}}", "{color:", ";}}", ""], BUTTON_SIDEBAR_HEIGHT, MIN_WIDTH_SIDEBAR, props => props.isHeader ? "1px solid ".concat(props.theme.colors.neutral['200']) : 'none', props => props.theme.colors.neutral['080'], StyledStatusBadge, props => props.theme.colors.neutral['080'], props => {
|
|
57
57
|
switch (props.badgePosition) {
|
|
58
58
|
case 'left':
|
|
@@ -72,7 +72,7 @@ const StyledTileButton = /*#__PURE__*/styled.button.withConfig({
|
|
|
72
72
|
return '';
|
|
73
73
|
});
|
|
74
74
|
const StyledWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
75
|
-
componentId: "sc-
|
|
75
|
+
componentId: "sc-b69sbu-8"
|
|
76
76
|
})(["height:100%;width:100%;position:relative;"]);
|
|
77
77
|
|
|
78
78
|
export { CloseButton, StyledStatusBadge, StyledTileButton, StyledTileButtonIcon, StyledTileButtonLabel, StyledTooltipV3ButtonWrapper, StyledWrapper, StyledWrapperCentralContent, StyledWrapperLeftBorder };
|
package/esm/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
export { ChatBubble, ChatBubbleWithSchema } from './
|
|
2
|
-
export { BUBBLE_TYPES } from './
|
|
3
|
-
export { FloatingButton } from './
|
|
4
|
-
export { StyledFloatingContainer } from './
|
|
5
|
-
export { ChatContainerHeader } from './
|
|
6
|
-
export { ChatEmptyState } from './
|
|
7
|
-
export {
|
|
1
|
+
export { ChatBubble, ChatBubbleWithSchema } from './exported-related/bubble/ChatBubble.js';
|
|
2
|
+
export { BUBBLE_TYPES } from './exported-related/bubble/props.js';
|
|
3
|
+
export { FloatingButton } from './exported-related/floating-button/FloatingButton.js';
|
|
4
|
+
export { StyledFloatingContainer } from './exported-related/floating-container/styled.js';
|
|
5
|
+
export { ChatContainerHeader, ChatContainerHeaderWithSchema } from './exported-related/chat-container-header/ChatContainerHeader.js';
|
|
6
|
+
export { ChatEmptyState, ChatEmptyStateWithSchema } from './exported-related/chat-empty-state/ChatEmptyState.js';
|
|
7
|
+
export { SideBarChat, SideBarChatWithSchema } from './exported-related/chat-sidebar/SideBarChat.js';
|
|
8
|
+
export { TileButton, TileButtonWithSchema } from './exported-related/tile-button/TileButton.js';
|
|
9
|
+
export { MessageDelimiter, MessageDelimiterWithSchema } from './exported-related/message-delimiter/MessageDelimiter.js';
|
|
10
|
+
export { SystemMessage, SystemMessageWithSchema } from './exported-related/system-message/SystemMessage.js';
|
|
11
|
+
export { ChatCard, ChatCardWithSchema } from './exported-related/chat-card/ChatCard.js';
|
|
12
|
+
export { ChatComposerPropTypes, ChatContainerMessagesListPropTypes, ChatContainerPropTypes, defaultProps, defaultPropsComposer, defaultPropsMessagesList } from './react-desc-prop-types.js';
|
|
8
13
|
export { ChatComposer, ChatComposerWithSchema } from './parts/chat-composer/ChatContainerComposer.js';
|
|
9
|
-
export { SideBarChat, SideBarChatWithSchema } from './parts/chat-sidebar/SideBarChat.js';
|
|
10
14
|
export { ChatContainer, ChatContainerWithSchema } from './parts/chat-container/ChatContainer.js';
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export { SystemMessage, SystemMessageWithSchema } from './parts/system-message/SystemMessage.js';
|
|
14
|
-
export { ChatCard, ChatCardWithSchema } from './parts/chat-card/ChatCard.js';
|
|
15
|
+
export { ChatContainerMessagesList, ChatContainerMessagesListWithSchema } from './parts/chat-container-messages-list/ChatContainerMessagesList.js';
|
|
16
|
+
export { ChatDataTestIds } from './ChatDataTestids.js';
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import 'core-js/modules/web.url.to-json.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
1
|
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
6
2
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
3
|
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
4
|
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
5
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
7
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
8
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
10
9
|
import React from 'react';
|
|
11
10
|
import { Grid } from '@elliemae/ds-grid';
|
|
12
|
-
import { describe } from 'react-desc';
|
|
13
11
|
import { PaperAirplane } from '@elliemae/ds-icons';
|
|
12
|
+
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
14
13
|
import { StyledChatContainerContentComposer, StyledComposerInput, StyledComposerButton, StyledCounterArea, StyledCounterErrorA11y } from './styled.js';
|
|
15
|
-
import {
|
|
16
|
-
import { composerProps, defaultComposerPros } from './props.js';
|
|
14
|
+
import { ChatComposerPropTypes, defaultPropsComposer } from '../../react-desc-prop-types.js';
|
|
17
15
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
18
16
|
|
|
19
17
|
var _PaperAirplane, _Grid;
|
|
@@ -25,7 +23,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
25
23
|
const ChatComposer = props => {
|
|
26
24
|
var _input$current;
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultPropsComposer);
|
|
27
|
+
useValidateTypescriptPropTypes(propsWithDefault, ChatComposerPropTypes);
|
|
29
28
|
const {
|
|
30
29
|
inputValue,
|
|
31
30
|
onChange,
|
|
@@ -42,7 +41,7 @@ const ChatComposer = props => {
|
|
|
42
41
|
buttonDisabled,
|
|
43
42
|
dataTestid,
|
|
44
43
|
actionRef
|
|
45
|
-
} =
|
|
44
|
+
} = propsWithDefault;
|
|
46
45
|
const COMPOSER_MIN_HEIGHT = 32;
|
|
47
46
|
const input = React.useRef();
|
|
48
47
|
const inputSize = React.useRef();
|
|
@@ -146,8 +145,7 @@ const ChatComposer = props => {
|
|
|
146
145
|
}) : '', inputMaxLength ? " ".concat(inputLength, " / ").concat(inputMaxLength) : ''), _Grid || (_Grid = /*#__PURE__*/_jsx(Grid, {}))));
|
|
147
146
|
};
|
|
148
147
|
|
|
149
|
-
ChatComposer.defaultProps = defaultComposerPros;
|
|
150
148
|
const ChatComposerWithSchema = describe(ChatComposer);
|
|
151
|
-
ChatComposerWithSchema.propTypes =
|
|
149
|
+
ChatComposerWithSchema.propTypes = ChatComposerPropTypes;
|
|
152
150
|
|
|
153
151
|
export { ChatComposer, ChatComposerWithSchema };
|
|
@@ -7,14 +7,13 @@ import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
|
7
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { noop } from 'lodash';
|
|
10
|
-
import { describe } from '
|
|
10
|
+
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';
|
|
11
11
|
import DSIndeterminateProgressIndicator from '@elliemae/ds-indeterminate-progress-indicator';
|
|
12
12
|
import DSBanner, { BANNER_TYPES } from '@elliemae/ds-banner';
|
|
13
13
|
import { ChatComposer } from '../chat-composer/ChatContainerComposer.js';
|
|
14
14
|
import { ChatContainerMessagesList } from '../chat-container-messages-list/ChatContainerMessagesList.js';
|
|
15
|
-
import {
|
|
15
|
+
import { ChatContainerPropTypes, defaultProps } from '../../react-desc-prop-types.js';
|
|
16
16
|
import { StyledIndicatorContainer, StyledChatContainerContent, MobileStyledChatContainerContent } from './styled.js';
|
|
17
|
-
import { useValidateProps } from './config/useValidateProps.js';
|
|
18
17
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
19
18
|
|
|
20
19
|
var _DSIndeterminateProgr;
|
|
@@ -26,7 +25,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
26
25
|
const ChatContainer = props => {
|
|
27
26
|
var _messagesListProps$me2, _containerRef$current;
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
29
|
+
useValidateTypescriptPropTypes(propsWithDefault, ChatContainerPropTypes);
|
|
30
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefault);
|
|
30
31
|
const {
|
|
31
32
|
sendingText,
|
|
32
33
|
sendingMessages,
|
|
@@ -42,9 +43,8 @@ const ChatContainer = props => {
|
|
|
42
43
|
device,
|
|
43
44
|
isLoading,
|
|
44
45
|
hasMoreItems,
|
|
45
|
-
getMoreMessages
|
|
46
|
-
|
|
47
|
-
} = props;
|
|
46
|
+
getMoreMessages
|
|
47
|
+
} = propsWithDefault;
|
|
48
48
|
const bannerRef = React.useRef({
|
|
49
49
|
focusOnWrapper: noop,
|
|
50
50
|
focusOnLink: noop
|
|
@@ -96,11 +96,10 @@ const ChatContainer = props => {
|
|
|
96
96
|
actionRef.current.focusOnBannerLink = bannerRef.current.focusOnLink;
|
|
97
97
|
}
|
|
98
98
|
}, [actionRef]);
|
|
99
|
-
return /*#__PURE__*/jsxs(Container, {
|
|
99
|
+
return /*#__PURE__*/jsxs(Container, _objectSpread(_objectSpread({}, globalAttributes), {}, {
|
|
100
100
|
rows: ['minmax(0, 1fr)', 'auto'],
|
|
101
101
|
ref: containerRef,
|
|
102
102
|
role: "region",
|
|
103
|
-
"aria-label": ariaLabel,
|
|
104
103
|
children: [/*#__PURE__*/_jsx("div", {
|
|
105
104
|
style: {
|
|
106
105
|
position: 'relative',
|
|
@@ -115,7 +114,7 @@ const ChatContainer = props => {
|
|
|
115
114
|
sendingText: sendingText,
|
|
116
115
|
bannerPosition: bannerPosition,
|
|
117
116
|
bannerRef: bannerRef
|
|
118
|
-
})), ['top', 'bottom'].includes(isLoading) ? /*#__PURE__*/_jsx(StyledIndicatorContainer, {
|
|
117
|
+
})), isLoading && ['top', 'bottom'].includes(isLoading) ? /*#__PURE__*/_jsx(StyledIndicatorContainer, {
|
|
119
118
|
isLoading: isLoading,
|
|
120
119
|
"data-testid": "ds-chat-loading-indicator"
|
|
121
120
|
}, void 0, _DSIndeterminateProgr || (_DSIndeterminateProgr = /*#__PURE__*/_jsx(DSIndeterminateProgressIndicator, {
|
|
@@ -126,17 +125,17 @@ const ChatContainer = props => {
|
|
|
126
125
|
isLoading: bannerPosition
|
|
127
126
|
}, void 0, /*#__PURE__*/_jsx(DSBanner, {
|
|
128
127
|
showCloseButton: true,
|
|
129
|
-
label: bannerProps.label || 'Unread messages',
|
|
128
|
+
label: (bannerProps === null || bannerProps === void 0 ? void 0 : bannerProps.label) || 'Unread messages',
|
|
130
129
|
containerProps: {
|
|
131
130
|
id: 'ds-chat-banner'
|
|
132
131
|
},
|
|
133
132
|
actionLink: {
|
|
134
|
-
label: bannerProps.viewLabel || 'View',
|
|
135
|
-
onClick: bannerProps.onView
|
|
133
|
+
label: (bannerProps === null || bannerProps === void 0 ? void 0 : bannerProps.viewLabel) || 'View',
|
|
134
|
+
onClick: bannerProps === null || bannerProps === void 0 ? void 0 : bannerProps.onView
|
|
136
135
|
},
|
|
137
|
-
onClose: bannerProps.onClose,
|
|
136
|
+
onClose: bannerProps === null || bannerProps === void 0 ? void 0 : bannerProps.onClose,
|
|
138
137
|
isOpen: true,
|
|
139
|
-
type: bannerProps.type || BANNER_TYPES.INFO,
|
|
138
|
+
type: (bannerProps === null || bannerProps === void 0 ? void 0 : bannerProps.type) || BANNER_TYPES.INFO,
|
|
140
139
|
actionRef: bannerRef
|
|
141
140
|
})), sendingMessages && sendingMessages.length > 0 ? /*#__PURE__*/_jsx(StyledIndicatorContainer, {
|
|
142
141
|
isLoading: "bottom",
|
|
@@ -152,11 +151,10 @@ const ChatContainer = props => {
|
|
|
152
151
|
maxHeight: (((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.clientHeight) || 0) / 2,
|
|
153
152
|
actionRef: actionRef || listRef
|
|
154
153
|
}))]
|
|
155
|
-
});
|
|
154
|
+
}));
|
|
156
155
|
};
|
|
157
156
|
|
|
158
|
-
ChatContainer.defaultProps = defaultProps;
|
|
159
157
|
const ChatContainerWithSchema = describe(ChatContainer);
|
|
160
|
-
ChatContainerWithSchema.propTypes =
|
|
158
|
+
ChatContainerWithSchema.propTypes = ChatContainerPropTypes;
|
|
161
159
|
|
|
162
160
|
export { ChatContainer, ChatContainerWithSchema };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { Grid } from '@elliemae/ds-grid';
|
|
3
|
-
import { StyledTitleLeftBubble, StyleBodyWrapper, StyledTitleRightBubble } from '
|
|
3
|
+
import { StyledTitleLeftBubble, StyleBodyWrapper, StyledTitleRightBubble } from '../../exported-related/bubble/styled.js';
|
|
4
4
|
import { StyledComposerInput } from '../chat-composer/styled.js';
|
|
5
|
-
import { Wrapper, Title, Message, Time } from '
|
|
5
|
+
import { Wrapper, Title, Message, Time } from '../../exported-related/system-message/style.js';
|
|
6
6
|
|
|
7
7
|
const CONTAINER_WIDTH = 300;
|
|
8
8
|
const StyledChatContainerContent = /*#__PURE__*/styled(Grid).withConfig({
|