@elliemae/ds-chat 2.2.0-alpha.3 → 3.0.0-next.0
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/ChatDataTestids.js +26 -54
- package/cjs/index.d.js +2 -27
- package/cjs/index.js +44 -69
- package/cjs/parts/bubble/ChatBubble.js +64 -74
- package/cjs/parts/bubble/ChatBubbleArrow.js +79 -96
- package/cjs/parts/bubble/config/useValidateProps.js +24 -47
- package/cjs/parts/bubble/index.js +12 -38
- package/cjs/parts/bubble/props.js +48 -60
- package/cjs/parts/bubble/styled.js +48 -141
- package/cjs/parts/chat-card/ChatCard.js +39 -55
- package/cjs/parts/chat-card/config/useValidateProps.js +9 -36
- package/cjs/parts/chat-card/index.js +10 -36
- package/cjs/parts/chat-card/props.js +12 -39
- package/cjs/parts/chat-card/styled.js +36 -71
- package/cjs/parts/chat-composer/ChatContainerComposer.js +98 -92
- package/cjs/parts/chat-composer/config/useValidateProps.js +9 -36
- package/cjs/parts/chat-composer/index.js +10 -36
- package/cjs/parts/chat-composer/props.js +36 -73
- package/cjs/parts/chat-composer/styled.js +34 -102
- package/cjs/parts/chat-container/ChatContainer.js +140 -122
- package/cjs/parts/chat-container/config/useValidateProps.js +9 -36
- package/cjs/parts/chat-container/index.js +10 -36
- package/cjs/parts/chat-container/props.js +42 -85
- package/cjs/parts/chat-container/styled.js +23 -104
- package/cjs/parts/chat-container-header/ChatContainerHeader.js +30 -48
- package/cjs/parts/chat-container-header/helpers.js +25 -38
- package/cjs/parts/chat-container-header/styled.js +24 -59
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +225 -163
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js +9 -36
- package/cjs/parts/chat-container-messages-list/index.js +10 -36
- package/cjs/parts/chat-container-messages-list/props.js +24 -62
- package/cjs/parts/chat-container-messages-list/styled.js +38 -100
- package/cjs/parts/chat-empty-state/ChatEmptyState.js +42 -58
- package/cjs/parts/chat-empty-state/config/useValidateProps.js +9 -36
- package/cjs/parts/chat-empty-state/props.js +12 -39
- package/cjs/parts/chat-empty-state/styled.js +21 -47
- package/cjs/parts/chat-sidebar/SideBarChat.js +81 -82
- package/cjs/parts/chat-sidebar/config/useValidateProps.js +9 -36
- package/cjs/parts/chat-sidebar/index.js +10 -36
- package/cjs/parts/chat-sidebar/props.js +30 -72
- package/cjs/parts/chat-sidebar/styled.js +20 -56
- package/cjs/parts/floating-button/FloatingButton.js +34 -47
- package/cjs/parts/floating-button/index.js +9 -28
- package/cjs/parts/floating-button/props.js +15 -42
- package/cjs/parts/floating-button/styled.js +17 -63
- package/cjs/parts/floating-container/styled.js +17 -47
- package/cjs/parts/grid-influencer/InfluencerContainer.js +21 -41
- package/cjs/parts/grid-influencer/styled.js +21 -56
- package/cjs/parts/message-delimiter/MessageDelimiter.js +39 -53
- package/cjs/parts/message-delimiter/config/useValidateProps.js +9 -36
- package/cjs/parts/message-delimiter/index.js +10 -36
- package/cjs/parts/message-delimiter/props.js +19 -44
- package/cjs/parts/message-delimiter/styled.js +24 -53
- package/cjs/parts/sidebar-button/SidebarButton.js +53 -52
- package/cjs/parts/sidebar-button/index.js +2 -20
- package/cjs/parts/sidebar-button/props.js +26 -49
- package/cjs/parts/sidebar-button/styled.js +24 -68
- package/cjs/parts/system-message/SystemMessage.js +40 -55
- package/cjs/parts/system-message/config/useValidateProps.js +9 -36
- package/cjs/parts/system-message/index.js +10 -36
- package/cjs/parts/system-message/props.js +15 -42
- package/cjs/parts/system-message/style.js +32 -75
- package/cjs/parts/tile-button/TileButton.js +68 -98
- package/cjs/parts/tile-button/config/useValidateProps.js +9 -36
- package/cjs/parts/tile-button/index.js +10 -36
- package/cjs/parts/tile-button/props.js +45 -83
- package/cjs/parts/tile-button/styled.js +77 -229
- package/cjs/prop-types.js +26 -53
- package/cjs/styled.js +14 -42
- package/esm/ChatDataTestids.js +22 -25
- package/esm/index.d.js +1 -2
- package/esm/index.js +14 -40
- package/esm/parts/bubble/ChatBubble.js +51 -51
- package/esm/parts/bubble/ChatBubbleArrow.js +71 -67
- package/esm/parts/bubble/config/useValidateProps.js +19 -17
- package/esm/parts/bubble/index.js +2 -9
- package/esm/parts/bubble/props.js +36 -30
- package/esm/parts/bubble/styled.js +32 -112
- package/esm/parts/chat-card/ChatCard.js +27 -23
- package/esm/parts/chat-card/config/useValidateProps.js +4 -6
- package/esm/parts/chat-card/index.js +1 -7
- package/esm/parts/chat-card/props.js +8 -10
- package/esm/parts/chat-card/styled.js +23 -42
- package/esm/parts/chat-composer/ChatContainerComposer.js +83 -65
- package/esm/parts/chat-composer/config/useValidateProps.js +4 -6
- package/esm/parts/chat-composer/index.js +1 -7
- package/esm/parts/chat-composer/props.js +24 -37
- package/esm/parts/chat-composer/styled.js +22 -73
- package/esm/parts/chat-container/ChatContainer.js +122 -88
- package/esm/parts/chat-container/config/useValidateProps.js +4 -6
- package/esm/parts/chat-container/index.js +1 -7
- package/esm/parts/chat-container/props.js +31 -52
- package/esm/parts/chat-container/styled.js +16 -79
- package/esm/parts/chat-container-header/ChatContainerHeader.js +21 -22
- package/esm/parts/chat-container-header/helpers.js +17 -9
- package/esm/parts/chat-container-header/styled.js +14 -30
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +210 -138
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js +4 -6
- package/esm/parts/chat-container-messages-list/index.js +1 -10
- package/esm/parts/chat-container-messages-list/props.js +17 -31
- package/esm/parts/chat-container-messages-list/styled.js +25 -71
- package/esm/parts/chat-empty-state/ChatEmptyState.js +29 -25
- package/esm/parts/chat-empty-state/config/useValidateProps.js +4 -6
- package/esm/parts/chat-empty-state/props.js +7 -10
- package/esm/parts/chat-empty-state/styled.js +11 -18
- package/esm/parts/chat-sidebar/SideBarChat.js +67 -50
- package/esm/parts/chat-sidebar/config/useValidateProps.js +4 -6
- package/esm/parts/chat-sidebar/index.js +1 -7
- package/esm/parts/chat-sidebar/props.js +21 -39
- package/esm/parts/chat-sidebar/styled.js +11 -27
- package/esm/parts/floating-button/FloatingButton.js +26 -18
- package/esm/parts/floating-button/index.js +1 -3
- package/esm/parts/floating-button/props.js +8 -11
- package/esm/parts/floating-button/styled.js +9 -34
- package/esm/parts/floating-container/styled.js +9 -18
- package/esm/parts/grid-influencer/InfluencerContainer.js +12 -12
- package/esm/parts/grid-influencer/styled.js +12 -27
- package/esm/parts/message-delimiter/MessageDelimiter.js +26 -20
- package/esm/parts/message-delimiter/config/useValidateProps.js +4 -6
- package/esm/parts/message-delimiter/index.js +1 -10
- package/esm/parts/message-delimiter/props.js +14 -15
- package/esm/parts/message-delimiter/styled.js +14 -24
- package/esm/parts/sidebar-button/SidebarButton.js +41 -22
- package/esm/parts/sidebar-button/index.js +1 -2
- package/esm/parts/sidebar-button/props.js +15 -18
- package/esm/parts/sidebar-button/styled.js +14 -39
- package/esm/parts/system-message/SystemMessage.js +27 -22
- package/esm/parts/system-message/config/useValidateProps.js +4 -6
- package/esm/parts/system-message/index.js +1 -7
- package/esm/parts/system-message/props.js +10 -13
- package/esm/parts/system-message/style.js +20 -46
- package/esm/parts/tile-button/TileButton.js +54 -75
- package/esm/parts/tile-button/config/useValidateProps.js +4 -6
- package/esm/parts/tile-button/index.js +1 -7
- package/esm/parts/tile-button/props.js +33 -47
- package/esm/parts/tile-button/styled.js +60 -200
- package/esm/prop-types.js +16 -19
- package/esm/styled.js +5 -13
- package/package.json +10 -10
- package/cjs/ChatDataTestids.js.map +0 -7
- package/cjs/index.d.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/parts/bubble/ChatBubble.js.map +0 -7
- package/cjs/parts/bubble/ChatBubbleArrow.js.map +0 -7
- package/cjs/parts/bubble/config/useValidateProps.js.map +0 -7
- package/cjs/parts/bubble/index.js.map +0 -7
- package/cjs/parts/bubble/props.js.map +0 -7
- package/cjs/parts/bubble/styled.js.map +0 -7
- package/cjs/parts/chat-card/ChatCard.js.map +0 -7
- package/cjs/parts/chat-card/config/useValidateProps.js.map +0 -7
- package/cjs/parts/chat-card/index.js.map +0 -7
- package/cjs/parts/chat-card/props.js.map +0 -7
- package/cjs/parts/chat-card/styled.js.map +0 -7
- package/cjs/parts/chat-composer/ChatContainerComposer.js.map +0 -7
- package/cjs/parts/chat-composer/config/useValidateProps.js.map +0 -7
- package/cjs/parts/chat-composer/index.js.map +0 -7
- package/cjs/parts/chat-composer/props.js.map +0 -7
- package/cjs/parts/chat-composer/styled.js.map +0 -7
- package/cjs/parts/chat-container/ChatContainer.js.map +0 -7
- package/cjs/parts/chat-container/config/useValidateProps.js.map +0 -7
- package/cjs/parts/chat-container/index.js.map +0 -7
- package/cjs/parts/chat-container/props.js.map +0 -7
- package/cjs/parts/chat-container/styled.js.map +0 -7
- package/cjs/parts/chat-container-header/ChatContainerHeader.js.map +0 -7
- package/cjs/parts/chat-container-header/helpers.js.map +0 -7
- package/cjs/parts/chat-container-header/styled.js.map +0 -7
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +0 -7
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js.map +0 -7
- package/cjs/parts/chat-container-messages-list/index.js.map +0 -7
- package/cjs/parts/chat-container-messages-list/props.js.map +0 -7
- package/cjs/parts/chat-container-messages-list/styled.js.map +0 -7
- package/cjs/parts/chat-empty-state/ChatEmptyState.js.map +0 -7
- package/cjs/parts/chat-empty-state/config/useValidateProps.js.map +0 -7
- package/cjs/parts/chat-empty-state/props.js.map +0 -7
- package/cjs/parts/chat-empty-state/styled.js.map +0 -7
- package/cjs/parts/chat-sidebar/SideBarChat.js.map +0 -7
- package/cjs/parts/chat-sidebar/config/useValidateProps.js.map +0 -7
- package/cjs/parts/chat-sidebar/index.js.map +0 -7
- package/cjs/parts/chat-sidebar/props.js.map +0 -7
- package/cjs/parts/chat-sidebar/styled.js.map +0 -7
- package/cjs/parts/floating-button/FloatingButton.js.map +0 -7
- package/cjs/parts/floating-button/index.js.map +0 -7
- package/cjs/parts/floating-button/props.js.map +0 -7
- package/cjs/parts/floating-button/styled.js.map +0 -7
- package/cjs/parts/floating-container/styled.js.map +0 -7
- package/cjs/parts/grid-influencer/InfluencerContainer.js.map +0 -7
- package/cjs/parts/grid-influencer/styled.js.map +0 -7
- package/cjs/parts/message-delimiter/MessageDelimiter.js.map +0 -7
- package/cjs/parts/message-delimiter/config/useValidateProps.js.map +0 -7
- package/cjs/parts/message-delimiter/index.js.map +0 -7
- package/cjs/parts/message-delimiter/props.js.map +0 -7
- package/cjs/parts/message-delimiter/styled.js.map +0 -7
- package/cjs/parts/sidebar-button/SidebarButton.js.map +0 -7
- package/cjs/parts/sidebar-button/index.js.map +0 -7
- package/cjs/parts/sidebar-button/props.js.map +0 -7
- package/cjs/parts/sidebar-button/styled.js.map +0 -7
- package/cjs/parts/system-message/SystemMessage.js.map +0 -7
- package/cjs/parts/system-message/config/useValidateProps.js.map +0 -7
- package/cjs/parts/system-message/index.js.map +0 -7
- package/cjs/parts/system-message/props.js.map +0 -7
- package/cjs/parts/system-message/style.js.map +0 -7
- package/cjs/parts/tile-button/TileButton.js.map +0 -7
- package/cjs/parts/tile-button/config/useValidateProps.js.map +0 -7
- package/cjs/parts/tile-button/index.js.map +0 -7
- package/cjs/parts/tile-button/props.js.map +0 -7
- package/cjs/parts/tile-button/styled.js.map +0 -7
- package/cjs/prop-types.js.map +0 -7
- package/cjs/styled.js.map +0 -7
- package/cjs/tests/utils.js +0 -66
- package/cjs/tests/utils.js.map +0 -7
- package/esm/ChatDataTestids.js.map +0 -7
- package/esm/index.d.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/parts/bubble/ChatBubble.js.map +0 -7
- package/esm/parts/bubble/ChatBubbleArrow.js.map +0 -7
- package/esm/parts/bubble/config/useValidateProps.js.map +0 -7
- package/esm/parts/bubble/index.js.map +0 -7
- package/esm/parts/bubble/props.js.map +0 -7
- package/esm/parts/bubble/styled.js.map +0 -7
- package/esm/parts/chat-card/ChatCard.js.map +0 -7
- package/esm/parts/chat-card/config/useValidateProps.js.map +0 -7
- package/esm/parts/chat-card/index.js.map +0 -7
- package/esm/parts/chat-card/props.js.map +0 -7
- package/esm/parts/chat-card/styled.js.map +0 -7
- package/esm/parts/chat-composer/ChatContainerComposer.js.map +0 -7
- package/esm/parts/chat-composer/config/useValidateProps.js.map +0 -7
- package/esm/parts/chat-composer/index.js.map +0 -7
- package/esm/parts/chat-composer/props.js.map +0 -7
- package/esm/parts/chat-composer/styled.js.map +0 -7
- package/esm/parts/chat-container/ChatContainer.js.map +0 -7
- package/esm/parts/chat-container/config/useValidateProps.js.map +0 -7
- package/esm/parts/chat-container/index.js.map +0 -7
- package/esm/parts/chat-container/props.js.map +0 -7
- package/esm/parts/chat-container/styled.js.map +0 -7
- package/esm/parts/chat-container-header/ChatContainerHeader.js.map +0 -7
- package/esm/parts/chat-container-header/helpers.js.map +0 -7
- package/esm/parts/chat-container-header/styled.js.map +0 -7
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +0 -7
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js.map +0 -7
- package/esm/parts/chat-container-messages-list/index.js.map +0 -7
- package/esm/parts/chat-container-messages-list/props.js.map +0 -7
- package/esm/parts/chat-container-messages-list/styled.js.map +0 -7
- package/esm/parts/chat-empty-state/ChatEmptyState.js.map +0 -7
- package/esm/parts/chat-empty-state/config/useValidateProps.js.map +0 -7
- package/esm/parts/chat-empty-state/props.js.map +0 -7
- package/esm/parts/chat-empty-state/styled.js.map +0 -7
- package/esm/parts/chat-sidebar/SideBarChat.js.map +0 -7
- package/esm/parts/chat-sidebar/config/useValidateProps.js.map +0 -7
- package/esm/parts/chat-sidebar/index.js.map +0 -7
- package/esm/parts/chat-sidebar/props.js.map +0 -7
- package/esm/parts/chat-sidebar/styled.js.map +0 -7
- package/esm/parts/floating-button/FloatingButton.js.map +0 -7
- package/esm/parts/floating-button/index.js.map +0 -7
- package/esm/parts/floating-button/props.js.map +0 -7
- package/esm/parts/floating-button/styled.js.map +0 -7
- package/esm/parts/floating-container/styled.js.map +0 -7
- package/esm/parts/grid-influencer/InfluencerContainer.js.map +0 -7
- package/esm/parts/grid-influencer/styled.js.map +0 -7
- package/esm/parts/message-delimiter/MessageDelimiter.js.map +0 -7
- package/esm/parts/message-delimiter/config/useValidateProps.js.map +0 -7
- package/esm/parts/message-delimiter/index.js.map +0 -7
- package/esm/parts/message-delimiter/props.js.map +0 -7
- package/esm/parts/message-delimiter/styled.js.map +0 -7
- package/esm/parts/sidebar-button/SidebarButton.js.map +0 -7
- package/esm/parts/sidebar-button/index.js.map +0 -7
- package/esm/parts/sidebar-button/props.js.map +0 -7
- package/esm/parts/sidebar-button/styled.js.map +0 -7
- package/esm/parts/system-message/SystemMessage.js.map +0 -7
- package/esm/parts/system-message/config/useValidateProps.js.map +0 -7
- package/esm/parts/system-message/index.js.map +0 -7
- package/esm/parts/system-message/props.js.map +0 -7
- package/esm/parts/system-message/style.js.map +0 -7
- package/esm/parts/tile-button/TileButton.js.map +0 -7
- package/esm/parts/tile-button/config/useValidateProps.js.map +0 -7
- package/esm/parts/tile-button/index.js.map +0 -7
- package/esm/parts/tile-button/props.js.map +0 -7
- package/esm/parts/tile-button/styled.js.map +0 -7
- package/esm/prop-types.js.map +0 -7
- package/esm/styled.js.map +0 -7
- package/esm/tests/utils.js +0 -37
- package/esm/tests/utils.js.map +0 -7
|
@@ -1,71 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { BUBBLE_TYPES } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const StyledChatContainerContentListScroll = styled.div`
|
|
27
|
-
width: 100%;
|
|
28
|
-
height: ${(props) => props.height};
|
|
29
|
-
position: relative;
|
|
30
|
-
`;
|
|
31
|
-
const StyledLoadMoreContainer = styled.div`
|
|
32
|
-
position: absolute;
|
|
33
|
-
width: calc(100% + ${(props) => props.theme.space.xxs});
|
|
34
|
-
padding: ${(props) => props.theme.space.xxs};
|
|
35
|
-
left: -${(props) => props.theme.space.xxs};
|
|
36
|
-
right: -${(props) => props.theme.space.xxs};
|
|
37
|
-
display: grid;
|
|
38
|
-
justify-content: center;
|
|
39
|
-
align-items: center;
|
|
40
|
-
${(props) => props.hasMoreItems === "top" ? "top: 0;" : ""}
|
|
41
|
-
${(props) => props.hasMoreItems === "bottom" ? "bottom: 0;" : ""}
|
|
42
|
-
`;
|
|
43
|
-
const ListItem = styled.div`
|
|
44
|
-
&:focus,
|
|
45
|
-
&:focus-visible {
|
|
46
|
-
outline: none;
|
|
47
|
-
&:after {
|
|
48
|
-
content: '';
|
|
49
|
-
display: block;
|
|
50
|
-
position: absolute;
|
|
51
|
-
top: 0;
|
|
52
|
-
left: -${(props) => props.theme.space.xxs};
|
|
53
|
-
pointer-events: none;
|
|
54
|
-
border-radius: 2px;
|
|
55
|
-
background-color: #ebedf0;
|
|
56
|
-
width: calc(100% + 24px);
|
|
57
|
-
border: 2px solid #1e79c2;
|
|
58
|
-
height: 100%;
|
|
59
|
-
z-index: -1;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
`;
|
|
63
|
-
export {
|
|
64
|
-
ListItem,
|
|
65
|
-
StyledChatContainerContentList,
|
|
66
|
-
StyledChatContainerContentListScroll,
|
|
67
|
-
StyledLoadMoreContainer,
|
|
68
|
-
StyledWrapper,
|
|
69
|
-
StyledWrapperListItem
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=styled.js.map
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import '../bubble/ChatBubble.js';
|
|
3
|
+
import { BUBBLE_TYPES } from '../bubble/props.js';
|
|
4
|
+
|
|
5
|
+
const StyledWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
6
|
+
componentId: "sc-1jhprzr-0"
|
|
7
|
+
})(["width:100%;height:100%;"]); // list
|
|
8
|
+
|
|
9
|
+
const StyledWrapperListItem = /*#__PURE__*/styled.div.withConfig({
|
|
10
|
+
componentId: "sc-1jhprzr-1"
|
|
11
|
+
})(["min-width:100%;", ";", ";", ";"], props => props.type === BUBBLE_TYPES.SENDER && "padding: ".concat(props.theme.space.xxs, " ").concat(props.theme.space.xxs, " ").concat(props.theme.space.xxs, " 13%\n "), props => props.type === BUBBLE_TYPES.RECIPIENT && "padding: ".concat(props.theme.space.xxs, " 13% ").concat(props.theme.space.xxs, "\n ").concat(props.theme.space.xxs, "\n "), props => props.type === BUBBLE_TYPES.SYSTEM && "padding: ".concat(props.theme.space.xxs, " 0px\n "));
|
|
12
|
+
const StyledChatContainerContentList = /*#__PURE__*/styled.div.withConfig({
|
|
13
|
+
componentId: "sc-1jhprzr-2"
|
|
14
|
+
})(["width:100%;height:100%;padding:", ";padding-bottom:0;overflow-y:auto;overflow-x:hidden;"], props => props.theme.space.xs);
|
|
15
|
+
const StyledChatContainerContentListScroll = /*#__PURE__*/styled.div.withConfig({
|
|
16
|
+
componentId: "sc-1jhprzr-3"
|
|
17
|
+
})(["width:100%;height:", ";position:relative;"], props => props.height);
|
|
18
|
+
const StyledLoadMoreContainer = /*#__PURE__*/styled.div.withConfig({
|
|
19
|
+
componentId: "sc-1jhprzr-4"
|
|
20
|
+
})(["position:absolute;width:calc(100% + ", ");padding:", ";left:-", ";right:-", ";display:grid;justify-content:center;align-items:center;", " ", ""], props => props.theme.space.xxs, props => props.theme.space.xxs, props => props.theme.space.xxs, props => props.theme.space.xxs, props => props.hasMoreItems === 'top' ? 'top: 0;' : '', props => props.hasMoreItems === 'bottom' ? 'bottom: 0;' : '');
|
|
21
|
+
const ListItem = /*#__PURE__*/styled.div.withConfig({
|
|
22
|
+
componentId: "sc-1jhprzr-5"
|
|
23
|
+
})(["&:focus,&:focus-visible{outline:none;&:after{content:'';display:block;position:absolute;top:0;left:-", ";pointer-events:none;border-radius:2px;background-color:#ebedf0;width:calc(100% + 24px);border:2px solid #1e79c2;height:100%;z-index:-1;}}"], props => props.theme.space.xxs);
|
|
24
|
+
|
|
25
|
+
export { ListItem, StyledChatContainerContentList, StyledChatContainerContentListScroll, StyledLoadMoreContainer, StyledWrapper, StyledWrapperListItem };
|
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.url.to-json.js';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { describe } from 'react-desc';
|
|
5
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
6
|
+
import { Communications } from '@elliemae/ds-icons';
|
|
7
|
+
import { emptyStateProps, defaultProps } from './props.js';
|
|
8
|
+
import { MessageWrapper, ChatEmptyStateWrapper } from './styled.js';
|
|
9
|
+
import { useValidateProps } from './config/useValidateProps.js';
|
|
10
|
+
|
|
11
|
+
const ChatEmptyState = props => {
|
|
12
|
+
var _Grid, _Grid2;
|
|
13
|
+
|
|
10
14
|
useValidateProps(props, ChatEmptyStateListWithSchema.toJSON());
|
|
11
|
-
const {
|
|
12
|
-
|
|
15
|
+
const {
|
|
16
|
+
label,
|
|
17
|
+
action
|
|
18
|
+
} = props;
|
|
19
|
+
const MainContent = useMemo(() => /*#__PURE__*/_jsx(Grid, {
|
|
13
20
|
alignItems: "center",
|
|
14
21
|
justifyContent: "center"
|
|
15
|
-
},
|
|
22
|
+
}, void 0, /*#__PURE__*/_jsx(Grid, {
|
|
16
23
|
alignItems: "center",
|
|
17
24
|
justifyContent: "center"
|
|
18
|
-
},
|
|
25
|
+
}, void 0, /*#__PURE__*/_jsx(Communications, {
|
|
19
26
|
size: "xxl",
|
|
20
|
-
color: [
|
|
21
|
-
})),
|
|
27
|
+
color: ['neutral', 400]
|
|
28
|
+
})), _Grid || (_Grid = /*#__PURE__*/_jsx(Grid, {
|
|
22
29
|
alignItems: "center",
|
|
23
30
|
justifyContent: "center"
|
|
24
|
-
},
|
|
31
|
+
}, void 0, /*#__PURE__*/_jsx(MessageWrapper, {}, void 0, label))), _Grid2 || (_Grid2 = /*#__PURE__*/_jsx(Grid, {
|
|
25
32
|
alignItems: "center",
|
|
26
33
|
justifyContent: "center"
|
|
27
|
-
}, action)), [label, action]);
|
|
28
|
-
return
|
|
34
|
+
}, void 0, action))), [label, action]);
|
|
35
|
+
return /*#__PURE__*/_jsx(ChatEmptyStateWrapper, {
|
|
29
36
|
alignItems: "center",
|
|
30
37
|
justifyContent: "center"
|
|
31
|
-
}, MainContent);
|
|
38
|
+
}, void 0, MainContent);
|
|
32
39
|
};
|
|
33
|
-
|
|
40
|
+
|
|
34
41
|
ChatEmptyState.defaultProps = defaultProps;
|
|
35
42
|
const ChatEmptyStateListWithSchema = describe(ChatEmptyState);
|
|
36
43
|
ChatEmptyStateListWithSchema.propTypes = emptyStateProps;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
ChatEmptyStateListWithSchema
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=ChatEmptyState.js.map
|
|
44
|
+
|
|
45
|
+
export { ChatEmptyState, ChatEmptyStateListWithSchema };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { useValidatePropTypes } from '@elliemae/ds-props-helpers';
|
|
2
|
+
|
|
3
3
|
const useValidateProps = (props, schema) => {
|
|
4
4
|
useValidatePropTypes(props, schema);
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=useValidateProps.js.map
|
|
6
|
+
|
|
7
|
+
export { useValidateProps };
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { PropTypes } from 'react-desc';
|
|
2
|
+
|
|
3
3
|
const defaultProps = {
|
|
4
|
-
label:
|
|
4
|
+
label: 'No Messages Yet',
|
|
5
5
|
action: null
|
|
6
6
|
};
|
|
7
7
|
const emptyStateProps = {
|
|
8
|
-
label: PropTypes.arrayOf(PropTypes.string).description(
|
|
9
|
-
action: PropTypes.node.description(
|
|
8
|
+
label: PropTypes.arrayOf(PropTypes.string).description('No Message to show text helper').defaultValue(defaultProps.label),
|
|
9
|
+
action: PropTypes.node.description('action element').defaultValue(defaultProps.action)
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
emptyStateProps
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=props.js.map
|
|
11
|
+
|
|
12
|
+
export { defaultProps, emptyStateProps };
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
3
|
+
|
|
4
4
|
const CONTAINER_WIDTH = 300;
|
|
5
|
-
const ChatEmptyStateWrapper = styled(Grid)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
`;
|
|
14
|
-
export {
|
|
15
|
-
CONTAINER_WIDTH,
|
|
16
|
-
ChatEmptyStateWrapper,
|
|
17
|
-
MessageWrapper
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=styled.js.map
|
|
5
|
+
const ChatEmptyStateWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
6
|
+
componentId: "sc-1tutmen-0"
|
|
7
|
+
})(["height:100%;min-width:", "px;overflow:hidden;background:", ";"], CONTAINER_WIDTH, props => props.theme.colors.neutral['050']);
|
|
8
|
+
const MessageWrapper = /*#__PURE__*/styled.p.withConfig({
|
|
9
|
+
componentId: "sc-1tutmen-1"
|
|
10
|
+
})(["font-size:18px;"]);
|
|
11
|
+
|
|
12
|
+
export { CONTAINER_WIDTH, ChatEmptyStateWrapper, MessageWrapper };
|
|
@@ -1,26 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
+
import 'core-js/modules/web.url.to-json.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
6
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
8
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
9
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
10
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { describe } from 'react-desc';
|
|
13
|
+
import { MenuCollapse, MenuExpand } from '@elliemae/ds-icons';
|
|
14
|
+
import { StyledSideBarContainer, StyledSideBarButtonsContainer } from './styled.js';
|
|
15
|
+
import { TileButton } from '../tile-button/TileButton.js';
|
|
16
|
+
import { SidebarButton } from '../sidebar-button/SidebarButton.js';
|
|
17
|
+
import { chatSidebarProps, defaultProps } from './props.js';
|
|
18
|
+
import { useValidateProps } from './config/useValidateProps.js';
|
|
19
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
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; }
|
|
24
|
+
|
|
25
|
+
const FooterChat = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
expanded,
|
|
28
|
+
onFooterClose,
|
|
29
|
+
onFooterExpand,
|
|
30
|
+
footerButtonExtraProps
|
|
31
|
+
} = _ref;
|
|
32
|
+
return /*#__PURE__*/_jsx(SidebarButton, {
|
|
33
|
+
dsId: "sidebar_footer",
|
|
34
|
+
label: null,
|
|
35
|
+
Icon: !expanded ? MenuCollapse : MenuExpand,
|
|
36
|
+
onClick: expanded ? onFooterClose : onFooterExpand,
|
|
37
|
+
"aria-pressed": expanded,
|
|
38
|
+
"aria-label": footerButtonExtraProps['aria-label']
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const SideBarChat = props => {
|
|
24
43
|
useValidateProps(props, SideBarChatWithSchema.toJSON());
|
|
25
44
|
const {
|
|
26
45
|
sidebarItems,
|
|
@@ -33,39 +52,37 @@ const SideBarChat = (props) => {
|
|
|
33
52
|
enableTooltipWhenIsClosed,
|
|
34
53
|
actionRef
|
|
35
54
|
} = props;
|
|
36
|
-
const {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
55
|
+
const {
|
|
56
|
+
current: listRef
|
|
57
|
+
} = React.useRef({});
|
|
58
|
+
const registerReference = React.useCallback(ref => {
|
|
59
|
+
if (ref) listRef[ref.dataset.key] = ref;
|
|
40
60
|
}, [listRef]);
|
|
41
|
-
|
|
61
|
+
React.useEffect(() => {
|
|
42
62
|
if (actionRef.current.listRef) {
|
|
43
63
|
actionRef.current.listRef = listRef;
|
|
44
64
|
}
|
|
45
65
|
}, [sidebarItems, expanded, actionRef, listRef]);
|
|
46
|
-
return
|
|
47
|
-
rows: [1,
|
|
48
|
-
ref: listRef
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
})
|
|
66
|
+
return /*#__PURE__*/jsxs(StyledSideBarContainer, {
|
|
67
|
+
rows: [1, 'auto'],
|
|
68
|
+
ref: listRef,
|
|
69
|
+
children: [/*#__PURE__*/_jsx(StyledSideBarButtonsContainer, {}, void 0, sidebarItems.map(p => /*#__PURE__*/jsx(TileButton, _objectSpread(_objectSpread({
|
|
70
|
+
innerRef: registerReference
|
|
71
|
+
}, p), {}, {
|
|
72
|
+
selected: selectedItem === p.dsId,
|
|
73
|
+
tooltipPlacement: tooltipPlacement,
|
|
74
|
+
disableTooltip: enableTooltipWhenIsClosed ? false : !expanded
|
|
75
|
+
}), p.dsId))), /*#__PURE__*/_jsx(FooterChat, {
|
|
76
|
+
expanded: expanded,
|
|
77
|
+
onFooterClose: onFooterClose,
|
|
78
|
+
onFooterExpand: onFooterExpand,
|
|
79
|
+
footerButtonExtraProps: footerButtonExtraProps
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
62
82
|
};
|
|
63
|
-
|
|
83
|
+
|
|
64
84
|
SideBarChat.defaultProps = defaultProps;
|
|
65
85
|
const SideBarChatWithSchema = describe(SideBarChat);
|
|
66
86
|
SideBarChatWithSchema.propTypes = chatSidebarProps;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
SideBarChatWithSchema
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=SideBarChat.js.map
|
|
87
|
+
|
|
88
|
+
export { SideBarChat, SideBarChatWithSchema };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { useValidatePropTypes } from '@elliemae/ds-props-helpers';
|
|
2
|
+
|
|
3
3
|
const useValidateProps = (props, schema) => {
|
|
4
4
|
useValidatePropTypes(props, schema);
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=useValidateProps.js.map
|
|
6
|
+
|
|
7
|
+
export { useValidateProps };
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { PropTypes } from 'react-desc';
|
|
2
|
+
import { noop } from 'lodash';
|
|
3
|
+
|
|
4
4
|
const defaultProps = {
|
|
5
5
|
expanded: false,
|
|
6
|
-
selectedItem:
|
|
6
|
+
selectedItem: undefined,
|
|
7
7
|
sidebarItems: [],
|
|
8
8
|
onFooterExpand: noop,
|
|
9
9
|
onFooterClose: noop,
|
|
10
10
|
onHeaderExpand: noop,
|
|
11
11
|
onHeaderClose: noop,
|
|
12
|
-
footerButtonExtraProps: {
|
|
13
|
-
|
|
12
|
+
footerButtonExtraProps: {
|
|
13
|
+
'aria-label': 'expand or collapse button'
|
|
14
|
+
},
|
|
15
|
+
tooltipPlacement: 'right',
|
|
14
16
|
enableTooltipWhenIsClosed: false,
|
|
15
17
|
actionRef: {
|
|
16
18
|
current: {
|
|
@@ -19,37 +21,17 @@ const defaultProps = {
|
|
|
19
21
|
}
|
|
20
22
|
};
|
|
21
23
|
const chatSidebarProps = {
|
|
22
|
-
sidebarItems: PropTypes.arrayOf(PropTypes.object).description(
|
|
23
|
-
expanded: PropTypes.bool.description(
|
|
24
|
-
selectedItem: PropTypes.string.description(
|
|
25
|
-
tooltipPlacement: PropTypes.oneOf([
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"bottom",
|
|
34
|
-
"bottom-start",
|
|
35
|
-
"left-end",
|
|
36
|
-
"left",
|
|
37
|
-
"left-start"
|
|
38
|
-
]).description("start placement preferences, as per popperjs placement option").defaultValue("'right'"),
|
|
39
|
-
enableTooltipWhenIsClosed: PropTypes.bool.description("Enable tooltip when is closed").defaultValue(defaultProps.onFooterExpand),
|
|
40
|
-
onFooterExpand: PropTypes.func.description("The function to call when the chat is opened via the footer").defaultValue(defaultProps.onFooterExpand),
|
|
41
|
-
onFooterClose: PropTypes.func.description("The function to call when the chat is closed via the footer").defaultValue(defaultProps.onFooterClose),
|
|
42
|
-
onHeaderExpand: PropTypes.func.description("The function to call when the chat is opened via the header").defaultValue(defaultProps.onHeaderExpand),
|
|
43
|
-
onHeaderClose: PropTypes.func.description("The function to call when the chat is closed via the header").defaultValue(defaultProps.onHeaderClose),
|
|
44
|
-
footerButtonExtraProps: PropTypes.object.description("Expand/collapse footer button extra props").defaultValue(defaultProps.footerButtonExtraProps),
|
|
45
|
-
actionRef: PropTypes.object.description(`Action ref for sidebar
|
|
46
|
-
{
|
|
47
|
-
listRef: references to Tiles
|
|
48
|
-
}
|
|
49
|
-
`).defaultValue(defaultProps.actionRef)
|
|
50
|
-
};
|
|
51
|
-
export {
|
|
52
|
-
chatSidebarProps,
|
|
53
|
-
defaultProps
|
|
24
|
+
sidebarItems: PropTypes.arrayOf(PropTypes.object).description('The array of out-of-the-box items you want to render inside the sidebar nav of the chat').defaultValue(defaultProps.sidebarItems),
|
|
25
|
+
expanded: PropTypes.bool.description('Whether to show the chat expanded or collapsed').defaultValue(defaultProps.expanded),
|
|
26
|
+
selectedItem: PropTypes.string.description('The id of the chat item you want to be opened').defaultValue(defaultProps.selectedItem),
|
|
27
|
+
tooltipPlacement: PropTypes.oneOf(['top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']).description('start placement preferences, as per popperjs placement option').defaultValue("'right'"),
|
|
28
|
+
enableTooltipWhenIsClosed: PropTypes.bool.description('Enable tooltip when is closed').defaultValue(defaultProps.onFooterExpand),
|
|
29
|
+
onFooterExpand: PropTypes.func.description('The function to call when the chat is opened via the footer').defaultValue(defaultProps.onFooterExpand),
|
|
30
|
+
onFooterClose: PropTypes.func.description('The function to call when the chat is closed via the footer').defaultValue(defaultProps.onFooterClose),
|
|
31
|
+
onHeaderExpand: PropTypes.func.description('The function to call when the chat is opened via the header').defaultValue(defaultProps.onHeaderExpand),
|
|
32
|
+
onHeaderClose: PropTypes.func.description('The function to call when the chat is closed via the header').defaultValue(defaultProps.onHeaderClose),
|
|
33
|
+
footerButtonExtraProps: PropTypes.object.description('Expand/collapse footer button extra props').defaultValue(defaultProps.footerButtonExtraProps),
|
|
34
|
+
actionRef: PropTypes.object.description("Action ref for sidebar\n {\n listRef: references to Tiles\n }\n ").defaultValue(defaultProps.actionRef)
|
|
54
35
|
};
|
|
55
|
-
|
|
36
|
+
|
|
37
|
+
export { chatSidebarProps, defaultProps };
|
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { MIN_WIDTH_SIDEBAR, BUTTON_SIDEBAR_HEIGHT } from "../../styled";
|
|
5
|
-
const StyledSideBarContainer = styled(Grid)`
|
|
6
|
-
height: 100%;
|
|
7
|
-
width: ${MIN_WIDTH_SIDEBAR}px;
|
|
8
|
-
background: ${(props) => props.theme.colors.neutral["050"]};
|
|
9
|
-
border-right: 1px solid ${(props) => props.theme.colors.neutral["100"]};
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
`;
|
|
12
|
-
const StyledSideBarButtonsContainer = styled(Grid)`
|
|
13
|
-
overflow-y: auto;
|
|
14
|
-
align-items: flex-start;
|
|
15
|
-
justify-content: flex-start;
|
|
16
|
-
grid-template-rows: repeat(auto-fill, ${BUTTON_SIDEBAR_HEIGHT}px);
|
|
17
|
-
overflow-x: hidden;
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
3
|
+
import { MIN_WIDTH_SIDEBAR, BUTTON_SIDEBAR_HEIGHT } from '../../styled.js';
|
|
18
4
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=styled.js.map
|
|
5
|
+
const StyledSideBarContainer = /*#__PURE__*/styled(Grid).withConfig({
|
|
6
|
+
componentId: "sc-16uijso-0"
|
|
7
|
+
})(["height:100%;width:", "px;background:", ";border-right:1px solid ", ";overflow:hidden;"], MIN_WIDTH_SIDEBAR, props => props.theme.colors.neutral['050'], props => props.theme.colors.neutral['100']);
|
|
8
|
+
const StyledSideBarButtonsContainer = /*#__PURE__*/styled(Grid).withConfig({
|
|
9
|
+
componentId: "sc-16uijso-1"
|
|
10
|
+
})(["overflow-y:auto;align-items:flex-start;justify-content:flex-start;grid-template-rows:repeat(auto-fill,", "px);overflow-x:hidden;scrollbar-width:thin;&::-webkit-scrollbar{width:6px;}"], BUTTON_SIDEBAR_HEIGHT);
|
|
11
|
+
|
|
12
|
+
export { StyledSideBarButtonsContainer, StyledSideBarContainer };
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Comments } from
|
|
4
|
-
import { StyledFloatingButton } from
|
|
5
|
-
import { defaultFloatingButton
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { Comments } from '@elliemae/ds-icons';
|
|
4
|
+
import { StyledFloatingButton } from './styled.js';
|
|
5
|
+
import { defaultFloatingButton } from './props.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var _Comments;
|
|
9
|
+
const FloatingButton = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
onClick,
|
|
12
|
+
onFocus,
|
|
13
|
+
innerRef
|
|
14
|
+
} = _ref;
|
|
15
|
+
return /*#__PURE__*/jsx(StyledFloatingButton, {
|
|
16
|
+
onFocus: onFocus,
|
|
17
|
+
ref: innerRef,
|
|
18
|
+
"data-testid": "chat-floating-button",
|
|
19
|
+
onClick: onClick,
|
|
20
|
+
children: _Comments || (_Comments = /*#__PURE__*/_jsx(Comments, {
|
|
21
|
+
size: "l"
|
|
22
|
+
}))
|
|
23
|
+
});
|
|
18
24
|
};
|
|
19
|
-
|
|
25
|
+
FloatingButton.defaultProps = defaultFloatingButton;
|
|
26
|
+
|
|
27
|
+
export { FloatingButton };
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { PropTypes } from 'react-desc';
|
|
2
|
+
import { noop } from 'lodash';
|
|
3
|
+
|
|
4
4
|
const defaultFloatingButton = {
|
|
5
5
|
onClick: noop,
|
|
6
6
|
onFocus: noop,
|
|
7
7
|
innerRef: null
|
|
8
8
|
};
|
|
9
9
|
const propsFloatingButton = {
|
|
10
|
-
onClick: PropTypes.func.description(
|
|
11
|
-
onFocus: PropTypes.func.description(
|
|
12
|
-
innerRef: PropTypes.object.description(
|
|
10
|
+
onClick: PropTypes.func.description('The function to call when the chat is opened via the footer').defaultValue(defaultFloatingButton.onClick),
|
|
11
|
+
onFocus: PropTypes.func.description('The function to call when button is being focused').defaultValue(defaultFloatingButton.onFocus),
|
|
12
|
+
innerRef: PropTypes.object.description('Ref to the component container').defaultValue(null)
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
propsFloatingButton
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=props.js.map
|
|
14
|
+
|
|
15
|
+
export { defaultFloatingButton, propsFloatingButton };
|