@elliemae/ds-chat 2.2.0-next.4 → 2.3.0-alpha.2
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 +54 -26
- package/cjs/ChatDataTestids.js.map +7 -0
- package/cjs/index.d.js +27 -2
- package/cjs/index.d.js.map +7 -0
- package/cjs/index.js +69 -44
- package/cjs/index.js.map +7 -0
- package/cjs/parts/bubble/ChatBubble.js +74 -64
- package/cjs/parts/bubble/ChatBubble.js.map +7 -0
- package/cjs/parts/bubble/ChatBubbleArrow.js +96 -79
- package/cjs/parts/bubble/ChatBubbleArrow.js.map +7 -0
- package/cjs/parts/bubble/config/useValidateProps.js +47 -24
- package/cjs/parts/bubble/config/useValidateProps.js.map +7 -0
- package/cjs/parts/bubble/index.js +38 -12
- package/cjs/parts/bubble/index.js.map +7 -0
- package/cjs/parts/bubble/props.js +60 -48
- package/cjs/parts/bubble/props.js.map +7 -0
- package/cjs/parts/bubble/styled.js +141 -48
- package/cjs/parts/bubble/styled.js.map +7 -0
- package/cjs/parts/chat-card/ChatCard.js +55 -39
- package/cjs/parts/chat-card/ChatCard.js.map +7 -0
- package/cjs/parts/chat-card/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-card/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-card/index.js +36 -10
- package/cjs/parts/chat-card/index.js.map +7 -0
- package/cjs/parts/chat-card/props.js +39 -12
- package/cjs/parts/chat-card/props.js.map +7 -0
- package/cjs/parts/chat-card/styled.js +71 -36
- package/cjs/parts/chat-card/styled.js.map +7 -0
- package/cjs/parts/chat-composer/ChatContainerComposer.js +92 -98
- package/cjs/parts/chat-composer/ChatContainerComposer.js.map +7 -0
- package/cjs/parts/chat-composer/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-composer/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-composer/index.js +36 -10
- package/cjs/parts/chat-composer/index.js.map +7 -0
- package/cjs/parts/chat-composer/props.js +73 -36
- package/cjs/parts/chat-composer/props.js.map +7 -0
- package/cjs/parts/chat-composer/styled.js +102 -34
- package/cjs/parts/chat-composer/styled.js.map +7 -0
- package/cjs/parts/chat-container/ChatContainer.js +122 -140
- package/cjs/parts/chat-container/ChatContainer.js.map +7 -0
- package/cjs/parts/chat-container/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-container/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-container/index.js +36 -10
- package/cjs/parts/chat-container/index.js.map +7 -0
- package/cjs/parts/chat-container/props.js +85 -42
- package/cjs/parts/chat-container/props.js.map +7 -0
- package/cjs/parts/chat-container/styled.js +104 -23
- package/cjs/parts/chat-container/styled.js.map +7 -0
- package/cjs/parts/chat-container-header/ChatContainerHeader.js +48 -30
- package/cjs/parts/chat-container-header/ChatContainerHeader.js.map +7 -0
- package/cjs/parts/chat-container-header/helpers.js +38 -25
- package/cjs/parts/chat-container-header/helpers.js.map +7 -0
- package/cjs/parts/chat-container-header/styled.js +59 -24
- package/cjs/parts/chat-container-header/styled.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +163 -225
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/index.js +36 -10
- package/cjs/parts/chat-container-messages-list/index.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/props.js +62 -24
- package/cjs/parts/chat-container-messages-list/props.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/styled.js +100 -38
- package/cjs/parts/chat-container-messages-list/styled.js.map +7 -0
- package/cjs/parts/chat-empty-state/ChatEmptyState.js +58 -42
- package/cjs/parts/chat-empty-state/ChatEmptyState.js.map +7 -0
- package/cjs/parts/chat-empty-state/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-empty-state/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-empty-state/props.js +39 -12
- package/cjs/parts/chat-empty-state/props.js.map +7 -0
- package/cjs/parts/chat-empty-state/styled.js +47 -21
- package/cjs/parts/chat-empty-state/styled.js.map +7 -0
- package/cjs/parts/chat-sidebar/SideBarChat.js +82 -81
- package/cjs/parts/chat-sidebar/SideBarChat.js.map +7 -0
- package/cjs/parts/chat-sidebar/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-sidebar/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-sidebar/index.js +36 -10
- package/cjs/parts/chat-sidebar/index.js.map +7 -0
- package/cjs/parts/chat-sidebar/props.js +72 -30
- package/cjs/parts/chat-sidebar/props.js.map +7 -0
- package/cjs/parts/chat-sidebar/styled.js +56 -20
- package/cjs/parts/chat-sidebar/styled.js.map +7 -0
- package/cjs/parts/floating-button/FloatingButton.js +47 -34
- package/cjs/parts/floating-button/FloatingButton.js.map +7 -0
- package/cjs/parts/floating-button/index.js +28 -9
- package/cjs/parts/floating-button/index.js.map +7 -0
- package/cjs/parts/floating-button/props.js +42 -15
- package/cjs/parts/floating-button/props.js.map +7 -0
- package/cjs/parts/floating-button/styled.js +63 -17
- package/cjs/parts/floating-button/styled.js.map +7 -0
- package/cjs/parts/floating-container/styled.js +47 -17
- package/cjs/parts/floating-container/styled.js.map +7 -0
- package/cjs/parts/grid-influencer/InfluencerContainer.js +41 -21
- package/cjs/parts/grid-influencer/InfluencerContainer.js.map +7 -0
- package/cjs/parts/grid-influencer/styled.js +56 -21
- package/cjs/parts/grid-influencer/styled.js.map +7 -0
- package/cjs/parts/message-delimiter/MessageDelimiter.js +53 -39
- package/cjs/parts/message-delimiter/MessageDelimiter.js.map +7 -0
- package/cjs/parts/message-delimiter/config/useValidateProps.js +36 -9
- package/cjs/parts/message-delimiter/config/useValidateProps.js.map +7 -0
- package/cjs/parts/message-delimiter/index.js +36 -10
- package/cjs/parts/message-delimiter/index.js.map +7 -0
- package/cjs/parts/message-delimiter/props.js +44 -19
- package/cjs/parts/message-delimiter/props.js.map +7 -0
- package/cjs/parts/message-delimiter/styled.js +53 -24
- package/cjs/parts/message-delimiter/styled.js.map +7 -0
- package/cjs/parts/sidebar-button/SidebarButton.js +52 -53
- package/cjs/parts/sidebar-button/SidebarButton.js.map +7 -0
- package/cjs/parts/sidebar-button/index.js +20 -2
- package/cjs/parts/sidebar-button/index.js.map +7 -0
- package/cjs/parts/sidebar-button/props.js +49 -26
- package/cjs/parts/sidebar-button/props.js.map +7 -0
- package/cjs/parts/sidebar-button/styled.js +68 -24
- package/cjs/parts/sidebar-button/styled.js.map +7 -0
- package/cjs/parts/system-message/SystemMessage.js +55 -40
- package/cjs/parts/system-message/SystemMessage.js.map +7 -0
- package/cjs/parts/system-message/config/useValidateProps.js +36 -9
- package/cjs/parts/system-message/config/useValidateProps.js.map +7 -0
- package/cjs/parts/system-message/index.js +36 -10
- package/cjs/parts/system-message/index.js.map +7 -0
- package/cjs/parts/system-message/props.js +42 -15
- package/cjs/parts/system-message/props.js.map +7 -0
- package/cjs/parts/system-message/style.js +75 -32
- package/cjs/parts/system-message/style.js.map +7 -0
- package/cjs/parts/tile-button/TileButton.js +98 -68
- package/cjs/parts/tile-button/TileButton.js.map +7 -0
- package/cjs/parts/tile-button/config/useValidateProps.js +36 -9
- package/cjs/parts/tile-button/config/useValidateProps.js.map +7 -0
- package/cjs/parts/tile-button/index.js +36 -10
- package/cjs/parts/tile-button/index.js.map +7 -0
- package/cjs/parts/tile-button/props.js +83 -45
- package/cjs/parts/tile-button/props.js.map +7 -0
- package/cjs/parts/tile-button/styled.js +229 -77
- package/cjs/parts/tile-button/styled.js.map +7 -0
- package/cjs/prop-types.js +53 -26
- package/cjs/prop-types.js.map +7 -0
- package/cjs/styled.js +42 -14
- package/cjs/styled.js.map +7 -0
- package/cjs/tests/utils.js +66 -0
- package/cjs/tests/utils.js.map +7 -0
- package/esm/ChatDataTestids.js +25 -22
- package/esm/ChatDataTestids.js.map +7 -0
- package/esm/index.d.js +2 -1
- package/esm/index.d.js.map +7 -0
- package/esm/index.js +40 -14
- package/esm/index.js.map +7 -0
- package/esm/parts/bubble/ChatBubble.js +51 -51
- package/esm/parts/bubble/ChatBubble.js.map +7 -0
- package/esm/parts/bubble/ChatBubbleArrow.js +67 -71
- package/esm/parts/bubble/ChatBubbleArrow.js.map +7 -0
- package/esm/parts/bubble/config/useValidateProps.js +17 -19
- package/esm/parts/bubble/config/useValidateProps.js.map +7 -0
- package/esm/parts/bubble/index.js +9 -2
- package/esm/parts/bubble/index.js.map +7 -0
- package/esm/parts/bubble/props.js +30 -36
- package/esm/parts/bubble/props.js.map +7 -0
- package/esm/parts/bubble/styled.js +112 -32
- package/esm/parts/bubble/styled.js.map +7 -0
- package/esm/parts/chat-card/ChatCard.js +23 -27
- package/esm/parts/chat-card/ChatCard.js.map +7 -0
- package/esm/parts/chat-card/config/useValidateProps.js +6 -4
- package/esm/parts/chat-card/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-card/index.js +7 -1
- package/esm/parts/chat-card/index.js.map +7 -0
- package/esm/parts/chat-card/props.js +10 -8
- package/esm/parts/chat-card/props.js.map +7 -0
- package/esm/parts/chat-card/styled.js +42 -23
- package/esm/parts/chat-card/styled.js.map +7 -0
- package/esm/parts/chat-composer/ChatContainerComposer.js +65 -83
- package/esm/parts/chat-composer/ChatContainerComposer.js.map +7 -0
- package/esm/parts/chat-composer/config/useValidateProps.js +6 -4
- package/esm/parts/chat-composer/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-composer/index.js +7 -1
- package/esm/parts/chat-composer/index.js.map +7 -0
- package/esm/parts/chat-composer/props.js +37 -24
- package/esm/parts/chat-composer/props.js.map +7 -0
- package/esm/parts/chat-composer/styled.js +73 -22
- package/esm/parts/chat-composer/styled.js.map +7 -0
- package/esm/parts/chat-container/ChatContainer.js +88 -122
- package/esm/parts/chat-container/ChatContainer.js.map +7 -0
- package/esm/parts/chat-container/config/useValidateProps.js +6 -4
- package/esm/parts/chat-container/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-container/index.js +7 -1
- package/esm/parts/chat-container/index.js.map +7 -0
- package/esm/parts/chat-container/props.js +52 -31
- package/esm/parts/chat-container/props.js.map +7 -0
- package/esm/parts/chat-container/styled.js +79 -16
- package/esm/parts/chat-container/styled.js.map +7 -0
- package/esm/parts/chat-container-header/ChatContainerHeader.js +22 -21
- package/esm/parts/chat-container-header/ChatContainerHeader.js.map +7 -0
- package/esm/parts/chat-container-header/helpers.js +9 -17
- package/esm/parts/chat-container-header/helpers.js.map +7 -0
- package/esm/parts/chat-container-header/styled.js +30 -14
- package/esm/parts/chat-container-header/styled.js.map +7 -0
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +138 -210
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +7 -0
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js +6 -4
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-container-messages-list/index.js +10 -1
- package/esm/parts/chat-container-messages-list/index.js.map +7 -0
- package/esm/parts/chat-container-messages-list/props.js +31 -17
- package/esm/parts/chat-container-messages-list/props.js.map +7 -0
- package/esm/parts/chat-container-messages-list/styled.js +71 -25
- package/esm/parts/chat-container-messages-list/styled.js.map +7 -0
- package/esm/parts/chat-empty-state/ChatEmptyState.js +25 -29
- package/esm/parts/chat-empty-state/ChatEmptyState.js.map +7 -0
- package/esm/parts/chat-empty-state/config/useValidateProps.js +6 -4
- package/esm/parts/chat-empty-state/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-empty-state/props.js +10 -7
- package/esm/parts/chat-empty-state/props.js.map +7 -0
- package/esm/parts/chat-empty-state/styled.js +18 -11
- package/esm/parts/chat-empty-state/styled.js.map +7 -0
- package/esm/parts/chat-sidebar/SideBarChat.js +50 -67
- package/esm/parts/chat-sidebar/SideBarChat.js.map +7 -0
- package/esm/parts/chat-sidebar/config/useValidateProps.js +6 -4
- package/esm/parts/chat-sidebar/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-sidebar/index.js +7 -1
- package/esm/parts/chat-sidebar/index.js.map +7 -0
- package/esm/parts/chat-sidebar/props.js +39 -21
- package/esm/parts/chat-sidebar/props.js.map +7 -0
- package/esm/parts/chat-sidebar/styled.js +27 -11
- package/esm/parts/chat-sidebar/styled.js.map +7 -0
- package/esm/parts/floating-button/FloatingButton.js +18 -26
- package/esm/parts/floating-button/FloatingButton.js.map +7 -0
- package/esm/parts/floating-button/index.js +3 -1
- package/esm/parts/floating-button/index.js.map +7 -0
- package/esm/parts/floating-button/props.js +11 -8
- package/esm/parts/floating-button/props.js.map +7 -0
- package/esm/parts/floating-button/styled.js +34 -9
- package/esm/parts/floating-button/styled.js.map +7 -0
- package/esm/parts/floating-container/styled.js +18 -9
- package/esm/parts/floating-container/styled.js.map +7 -0
- package/esm/parts/grid-influencer/InfluencerContainer.js +12 -12
- package/esm/parts/grid-influencer/InfluencerContainer.js.map +7 -0
- package/esm/parts/grid-influencer/styled.js +27 -12
- package/esm/parts/grid-influencer/styled.js.map +7 -0
- package/esm/parts/message-delimiter/MessageDelimiter.js +20 -26
- package/esm/parts/message-delimiter/MessageDelimiter.js.map +7 -0
- package/esm/parts/message-delimiter/config/useValidateProps.js +6 -4
- package/esm/parts/message-delimiter/config/useValidateProps.js.map +7 -0
- package/esm/parts/message-delimiter/index.js +10 -1
- package/esm/parts/message-delimiter/index.js.map +7 -0
- package/esm/parts/message-delimiter/props.js +15 -14
- package/esm/parts/message-delimiter/props.js.map +7 -0
- package/esm/parts/message-delimiter/styled.js +24 -14
- package/esm/parts/message-delimiter/styled.js.map +7 -0
- package/esm/parts/sidebar-button/SidebarButton.js +22 -41
- package/esm/parts/sidebar-button/SidebarButton.js.map +7 -0
- package/esm/parts/sidebar-button/index.js +2 -1
- package/esm/parts/sidebar-button/index.js.map +7 -0
- package/esm/parts/sidebar-button/props.js +18 -15
- package/esm/parts/sidebar-button/props.js.map +7 -0
- package/esm/parts/sidebar-button/styled.js +39 -14
- package/esm/parts/sidebar-button/styled.js.map +7 -0
- package/esm/parts/system-message/SystemMessage.js +22 -27
- package/esm/parts/system-message/SystemMessage.js.map +7 -0
- package/esm/parts/system-message/config/useValidateProps.js +6 -4
- package/esm/parts/system-message/config/useValidateProps.js.map +7 -0
- package/esm/parts/system-message/index.js +7 -1
- package/esm/parts/system-message/index.js.map +7 -0
- package/esm/parts/system-message/props.js +13 -10
- package/esm/parts/system-message/props.js.map +7 -0
- package/esm/parts/system-message/style.js +46 -20
- package/esm/parts/system-message/style.js.map +7 -0
- package/esm/parts/tile-button/TileButton.js +75 -54
- package/esm/parts/tile-button/TileButton.js.map +7 -0
- package/esm/parts/tile-button/config/useValidateProps.js +6 -4
- package/esm/parts/tile-button/config/useValidateProps.js.map +7 -0
- package/esm/parts/tile-button/index.js +7 -1
- package/esm/parts/tile-button/index.js.map +7 -0
- package/esm/parts/tile-button/props.js +47 -33
- package/esm/parts/tile-button/props.js.map +7 -0
- package/esm/parts/tile-button/styled.js +200 -60
- package/esm/parts/tile-button/styled.js.map +7 -0
- package/esm/prop-types.js +19 -16
- package/esm/prop-types.js.map +7 -0
- package/esm/styled.js +13 -5
- package/esm/styled.js.map +7 -0
- package/esm/tests/utils.js +37 -0
- package/esm/tests/utils.js.map +7 -0
- package/package.json +10 -10
- package/types/parts/bubble/ChatBubble.d.ts +1 -1
- package/types/parts/chat-card/ChatCard.d.ts +1 -1
- package/types/parts/chat-composer/ChatContainerComposer.d.ts +1 -1
- package/types/parts/chat-container/ChatContainer.d.ts +1 -1
- package/types/parts/chat-container-messages-list/ChatContainerMessagesList.d.ts +1 -1
- package/types/parts/chat-empty-state/ChatEmptyState.d.ts +1 -1
- package/types/parts/chat-sidebar/SideBarChat.d.ts +1 -1
- package/types/parts/message-delimiter/MessageDelimiter.d.ts +1 -1
- package/types/parts/system-message/SystemMessage.d.ts +1 -1
- package/types/parts/tile-button/TileButton.d.ts +1 -1
|
@@ -1,37 +1,117 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
+
import { BUBBLE_TYPES } from "./props";
|
|
5
|
+
const StyledWrapper = styled.div`
|
|
6
|
+
min-width: 224px;
|
|
7
|
+
border-radius: 10px;
|
|
8
|
+
`;
|
|
9
|
+
const StyledTitleBubble = styled(Grid)`
|
|
10
|
+
padding-top: 6px;
|
|
11
|
+
padding-left: 10px;
|
|
12
|
+
padding-right: 10px;
|
|
13
|
+
padding-bottom: 4px;
|
|
14
|
+
`;
|
|
15
|
+
const StyledTitleLeftBubble = styled(Grid)`
|
|
16
|
+
font-size: 13px;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
`;
|
|
19
|
+
const StyledTitleRightBubble = styled(Grid)`
|
|
20
|
+
font-size: 13px;
|
|
21
|
+
font-weight: 400;
|
|
22
|
+
color: ${(props) => props.type === BUBBLE_TYPES.SENDER ? "#FFF" : "#657489"};
|
|
23
|
+
`;
|
|
24
|
+
const StyleBodyWrapper = styled.div`
|
|
25
|
+
font-size: 13px;
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
line-height: 15px;
|
|
28
|
+
min-height: 18px;
|
|
29
|
+
padding: 0px 10px 8px 10px;
|
|
30
|
+
`;
|
|
31
|
+
const StyleErrorMessage = styled.div`
|
|
32
|
+
font-size: 12px;
|
|
33
|
+
font-weight: 400;
|
|
34
|
+
padding-top: ${(props) => props.theme.space.xxxs};
|
|
35
|
+
color: ${(props) => props.theme.colors.danger[900]};
|
|
36
|
+
align-items: flex-end;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
text-align: right;
|
|
39
|
+
line-height: 15px;
|
|
40
|
+
svg {
|
|
41
|
+
fill: ${(props) => props.theme.colors.danger[900]};
|
|
42
|
+
}
|
|
43
|
+
a {
|
|
44
|
+
font-size: 12px;
|
|
45
|
+
color: ${(props) => props.theme.colors.danger[900]};
|
|
46
|
+
}
|
|
47
|
+
.em-ds-icon {
|
|
48
|
+
margin-left: 8px;
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
const StyleHelpMessage = styled(StyleErrorMessage)`
|
|
52
|
+
font-size: 12px;
|
|
53
|
+
line-height: 15px;
|
|
54
|
+
color: ${(props) => props.theme.colors.neutral[500]};
|
|
55
|
+
svg {
|
|
56
|
+
fill: ${(props) => props.theme.colors.danger[500]};
|
|
57
|
+
}
|
|
58
|
+
a {
|
|
59
|
+
font-size: 12px;
|
|
60
|
+
color: ${(props) => props.theme.colors.danger[500]};
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
const StyledBubbleArrow = styled.div`
|
|
64
|
+
display: block;
|
|
65
|
+
content: '';
|
|
66
|
+
position: absolute;
|
|
67
|
+
bottom: 10px;
|
|
68
|
+
height: 15px;
|
|
69
|
+
`;
|
|
70
|
+
const StyledColoredBubble = styled.div`
|
|
71
|
+
min-width: 224px;
|
|
72
|
+
border-radius: 10px;
|
|
73
|
+
position: relative;
|
|
4
74
|
|
|
5
|
-
|
|
75
|
+
${(props) => props.type === BUBBLE_TYPES.SENDER ? `
|
|
76
|
+
border: 1px solid ${props.theme.colors.brand["700"]};
|
|
77
|
+
background: ${props.theme.colors.brand[600]};
|
|
78
|
+
color: ${props.theme.colors.neutral["000"]};
|
|
79
|
+
${StyledBubbleArrow}{
|
|
80
|
+
right: -9px;
|
|
81
|
+
bottom: 6px;
|
|
82
|
+
svg{
|
|
83
|
+
fill: ${props.theme.colors.brand[600]};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
6
86
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
87
|
+
a {
|
|
88
|
+
color: #FFF;
|
|
89
|
+
}
|
|
10
90
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
componentId: "sc-fe8e9o-2"
|
|
16
|
-
})(["font-size:13px;font-weight:600;"]);
|
|
17
|
-
const StyledTitleRightBubble = /*#__PURE__*/styled(Grid).withConfig({
|
|
18
|
-
componentId: "sc-fe8e9o-3"
|
|
19
|
-
})(["font-size:13px;font-weight:400;color:", ";"], props => props.type === BUBBLE_TYPES.SENDER ? '#FFF' : '#657489');
|
|
20
|
-
const StyleBodyWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
21
|
-
componentId: "sc-fe8e9o-4"
|
|
22
|
-
})(["font-size:13px;font-weight:400;line-height:15px;min-height:18px;padding:0px 10px 8px 10px;"]);
|
|
23
|
-
const StyleErrorMessage = /*#__PURE__*/styled.div.withConfig({
|
|
24
|
-
componentId: "sc-fe8e9o-5"
|
|
25
|
-
})(["font-size:12px;font-weight:400;padding-top:", ";color:", ";align-items:flex-end;justify-content:center;text-align:right;line-height:15px;svg{fill:", ";}a{font-size:12px;color:", ";}.em-ds-icon{margin-left:8px;}"], props => props.theme.space.xxxs, props => props.theme.colors.danger[900], props => props.theme.colors.danger[900], props => props.theme.colors.danger[900]);
|
|
26
|
-
const StyleHelpMessage = /*#__PURE__*/styled(StyleErrorMessage).withConfig({
|
|
27
|
-
componentId: "sc-fe8e9o-6"
|
|
28
|
-
})(["font-size:12px;line-height:15px;color:", ";svg{fill:", ";}a{font-size:12px;color:", ";}"], props => props.theme.colors.neutral[500], props => props.theme.colors.danger[500], props => props.theme.colors.danger[500]); // bubble sender/ recipient
|
|
91
|
+
` : `
|
|
92
|
+
box-shadow: 0 1px 3px 0 rgba(53,60,70,0.80);
|
|
93
|
+
background: ${props.theme.colors.neutral["000"]};
|
|
94
|
+
color: ${props.theme.colors.neutral[700]};
|
|
29
95
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
96
|
+
${StyledBubbleArrow}{
|
|
97
|
+
left: -11px;
|
|
98
|
+
bottom: 6px;
|
|
99
|
+
svg{
|
|
100
|
+
fill: ${props.theme.colors.neutral["000"]};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
36
103
|
|
|
37
|
-
|
|
104
|
+
`}
|
|
105
|
+
`;
|
|
106
|
+
export {
|
|
107
|
+
StyleBodyWrapper,
|
|
108
|
+
StyleErrorMessage,
|
|
109
|
+
StyleHelpMessage,
|
|
110
|
+
StyledBubbleArrow,
|
|
111
|
+
StyledColoredBubble,
|
|
112
|
+
StyledTitleBubble,
|
|
113
|
+
StyledTitleLeftBubble,
|
|
114
|
+
StyledTitleRightBubble,
|
|
115
|
+
StyledWrapper
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/bubble/styled.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { BUBBLE_TYPES } from './props';\n\n// Bubble WRAPPER\nexport const StyledWrapper = styled.div<any>`\n min-width: 224px;\n border-radius: 10px;\n`;\n\n// Bubble HEADER\nexport const StyledTitleBubble = styled(Grid)`\n padding-top: 6px;\n padding-left: 10px;\n padding-right: 10px;\n padding-bottom: 4px;\n`;\n\nexport const StyledTitleLeftBubble = styled(Grid)`\n font-size: 13px;\n font-weight: 600;\n`;\nexport const StyledTitleRightBubble = styled(Grid)`\n font-size: 13px;\n font-weight: 400;\n color: ${(props) => (props.type === BUBBLE_TYPES.SENDER ? '#FFF' : '#657489')};\n`;\n\nexport const StyleBodyWrapper = styled.div<any>`\n font-size: 13px;\n font-weight: 400;\n line-height: 15px;\n min-height: 18px;\n padding: 0px 10px 8px 10px;\n`;\n\nexport const StyleErrorMessage = styled.div<any>`\n font-size: 12px;\n font-weight: 400;\n padding-top: ${(props) => props.theme.space.xxxs};\n color: ${(props) => props.theme.colors.danger[900]};\n align-items: flex-end;\n justify-content: center;\n text-align: right;\n line-height: 15px;\n svg {\n fill: ${(props) => props.theme.colors.danger[900]};\n }\n a {\n font-size: 12px;\n color: ${(props) => props.theme.colors.danger[900]};\n }\n .em-ds-icon {\n margin-left: 8px;\n }\n`;\n\nexport const StyleHelpMessage = styled(StyleErrorMessage)`\n font-size: 12px;\n line-height: 15px;\n color: ${(props) => props.theme.colors.neutral[500]};\n svg {\n fill: ${(props) => props.theme.colors.danger[500]};\n }\n a {\n font-size: 12px;\n color: ${(props) => props.theme.colors.danger[500]};\n }\n`;\n\n// bubble sender/ recipient\nexport const StyledBubbleArrow = styled.div<any>`\n display: block;\n content: '';\n position: absolute;\n bottom: 10px;\n height: 15px;\n`;\n\nexport const StyledColoredBubble = styled.div<any>`\n min-width: 224px;\n border-radius: 10px;\n position: relative;\n\n ${(props) =>\n props.type === BUBBLE_TYPES.SENDER\n ? `\n border: 1px solid ${props.theme.colors.brand['700']};\n background: ${props.theme.colors.brand[600]};\n color: ${props.theme.colors.neutral['000']};\n ${StyledBubbleArrow}{ \n right: -9px;\n bottom: 6px;\n svg{\n fill: ${props.theme.colors.brand[600]};\n }\n }\n\n a {\n color: #FFF;\n }\n\n `\n : `\n box-shadow: 0 1px 3px 0 rgba(53,60,70,0.80);\n background: ${props.theme.colors.neutral['000']};\n color: ${props.theme.colors.neutral[700]};\n\n ${StyledBubbleArrow}{ \n left: -11px;\n bottom: 6px;\n svg{\n fill: ${props.theme.colors.neutral['000']};\n }\n }\n\n `}\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AAGO,MAAM,gBAAgB,OAAO;AAAA;AAAA;AAAA;AAM7B,MAAM,oBAAoB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOjC,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAIrC,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAAA,WAGlC,CAAC,UAAW,MAAM,SAAS,aAAa,SAAS,SAAS;AAAA;AAG9D,MAAM,mBAAmB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQhC,MAAM,oBAAoB,OAAO;AAAA;AAAA;AAAA,iBAGvB,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,WACnC,CAAC,UAAU,MAAM,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAMpC,CAAC,UAAU,MAAM,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA,aAIpC,CAAC,UAAU,MAAM,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAO3C,MAAM,mBAAmB,OAAO;AAAA;AAAA;AAAA,WAG5B,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA,YAErC,CAAC,UAAU,MAAM,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA,aAIpC,CAAC,UAAU,MAAM,MAAM,OAAO,OAAO;AAAA;AAAA;AAK3C,MAAM,oBAAoB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQjC,MAAM,sBAAsB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKtC,CAAC,UACD,MAAM,SAAS,aAAa,SACxB;AAAA,4BACoB,MAAM,MAAM,OAAO,MAAM;AAAA,sBAC/B,MAAM,MAAM,OAAO,MAAM;AAAA,iBAC9B,MAAM,MAAM,OAAO,QAAQ;AAAA,UAClC;AAAA;AAAA;AAAA;AAAA,wBAIc,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QASzC;AAAA;AAAA,sBAEc,MAAM,MAAM,OAAO,QAAQ;AAAA,iBAChC,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA,UAElC;AAAA;AAAA;AAAA;AAAA,wBAIc,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,37 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const ChatCard = props => {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { describe } from "react-desc";
|
|
4
|
+
import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
5
|
+
import { propTypes } from "./props";
|
|
6
|
+
import { useValidateProps } from "./config/useValidateProps";
|
|
7
|
+
import { Wrapper, MainContent, Title, Content, Time, RightAddon } from "./styled";
|
|
8
|
+
const ChatCard = (props) => {
|
|
11
9
|
useValidateProps(props, ChatCardWithSchema.toJSON());
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
time,
|
|
16
|
-
rightAddon
|
|
17
|
-
} = props;
|
|
18
|
-
return /*#__PURE__*/_jsx(Wrapper, {
|
|
19
|
-
cols: ['1fr', 'auto'],
|
|
10
|
+
const { title, content, time, rightAddon } = props;
|
|
11
|
+
return /* @__PURE__ */ React2.createElement(Wrapper, {
|
|
12
|
+
cols: ["1fr", "auto"],
|
|
20
13
|
"data-testid": "chat-card-wrapper"
|
|
21
|
-
},
|
|
14
|
+
}, /* @__PURE__ */ React2.createElement(MainContent, null, /* @__PURE__ */ React2.createElement(Title, {
|
|
22
15
|
"data-testid": "chat-card-title"
|
|
23
|
-
},
|
|
16
|
+
}, title), /* @__PURE__ */ React2.createElement(Content, {
|
|
24
17
|
"data-testid": "chat-card-content"
|
|
25
|
-
},
|
|
18
|
+
}, /* @__PURE__ */ React2.createElement(SimpleTruncatedTooltipText, {
|
|
26
19
|
value: content
|
|
27
|
-
})), time &&
|
|
20
|
+
})), time && /* @__PURE__ */ React2.createElement(Time, {
|
|
28
21
|
"data-testid": "chat-card-time"
|
|
29
|
-
},
|
|
22
|
+
}, time)), rightAddon && /* @__PURE__ */ React2.createElement(RightAddon, {
|
|
30
23
|
"data-testid": "chat-card-right-addon"
|
|
31
|
-
},
|
|
24
|
+
}, rightAddon));
|
|
32
25
|
};
|
|
33
|
-
|
|
26
|
+
ChatCard.propTypes = propTypes;
|
|
34
27
|
const ChatCardWithSchema = describe(ChatCard);
|
|
35
28
|
ChatCardWithSchema.propTypes = propTypes;
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
export {
|
|
30
|
+
ChatCard,
|
|
31
|
+
ChatCardWithSchema
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=ChatCard.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-card/ChatCard.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from 'react-desc';\n\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { propTypes, CardPropTypes } from './props';\nimport { useValidateProps } from './config/useValidateProps';\nimport { Wrapper, MainContent, Title, Content, Time, RightAddon } from './styled';\n\nconst ChatCard = (props: CardPropTypes): JSX.Element => {\n useValidateProps(props, ChatCardWithSchema.toJSON());\n const { title, content, time, rightAddon } = props;\n return (\n <Wrapper cols={['1fr', 'auto']} data-testid=\"chat-card-wrapper\">\n <MainContent>\n <Title data-testid=\"chat-card-title\">{title}</Title>\n <Content data-testid=\"chat-card-content\">\n <SimpleTruncatedTooltipText value={content} />\n </Content>\n {time && <Time data-testid=\"chat-card-time\">{time}</Time>}\n </MainContent>\n {rightAddon && <RightAddon data-testid=\"chat-card-right-addon\">{rightAddon}</RightAddon>}\n </Wrapper>\n );\n};\n\nChatCard.propTypes = propTypes;\nconst ChatCardWithSchema = describe(ChatCard);\nChatCardWithSchema.propTypes = propTypes;\n\nexport { ChatCard, ChatCardWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEA;AACA;AACA;AACA;AAEA,MAAM,WAAW,CAAC,UAAsC;AACtD,mBAAiB,OAAO,mBAAmB;AAC3C,QAAM,EAAE,OAAO,SAAS,MAAM,eAAe;AAC7C,SACE,qCAAC,SAAD;AAAA,IAAS,MAAM,CAAC,OAAO;AAAA,IAAS,eAAY;AAAA,KAC1C,qCAAC,aAAD,MACE,qCAAC,OAAD;AAAA,IAAO,eAAY;AAAA,KAAmB,QACtC,qCAAC,SAAD;AAAA,IAAS,eAAY;AAAA,KACnB,qCAAC,4BAAD;AAAA,IAA4B,OAAO;AAAA,OAEpC,QAAQ,qCAAC,MAAD;AAAA,IAAM,eAAY;AAAA,KAAkB,QAE9C,cAAc,qCAAC,YAAD;AAAA,IAAY,eAAY;AAAA,KAAyB;AAAA;AAKtE,SAAS,YAAY;AACrB,MAAM,qBAAqB,SAAS;AACpC,mBAAmB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useValidatePropTypes } from "@elliemae/ds-props-helpers";
|
|
3
3
|
const useValidateProps = (props, schema) => {
|
|
4
4
|
useValidatePropTypes(props, schema);
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
export {
|
|
7
|
+
useValidateProps
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/chat-card/config/useValidateProps.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { CardPropTypes } from '../props';\n\nexport const useValidateProps = (props: CardPropTypes, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAGO,MAAM,mBAAmB,CAAC,OAAsB,WAA0B;AAC/E,uBAAqB,OAAO;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-card/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { ChatCard, ChatCardWithSchema } from './ChatCard';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes } from "react-desc";
|
|
3
3
|
const propTypes = {
|
|
4
|
-
title: PropTypes.string.isRequired.description(
|
|
5
|
-
content: PropTypes.string.description(
|
|
6
|
-
time: PropTypes.string.description(
|
|
7
|
-
rightAddon: PropTypes.element.description(
|
|
4
|
+
title: PropTypes.string.isRequired.description(`Card's title`),
|
|
5
|
+
content: PropTypes.string.description(`Card's content`),
|
|
6
|
+
time: PropTypes.string.description("Time"),
|
|
7
|
+
rightAddon: PropTypes.element.description("Right addon, badge or icon")
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
export {
|
|
10
|
+
propTypes
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-card/props.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n title: PropTypes.string.isRequired.description(`Card's title`),\n content: PropTypes.string.description(`Card's content`),\n time: PropTypes.string.description('Time'),\n rightAddon: PropTypes.element.description('Right addon, badge or icon'),\n};\n\nexport interface CardPropTypes {\n title: string;\n content: string;\n time: string;\n rightAddon: JSX.Element;\n}\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,MAAM,YAAY;AAAA,EACvB,OAAO,UAAU,OAAO,WAAW,YAAY;AAAA,EAC/C,SAAS,UAAU,OAAO,YAAY;AAAA,EACtC,MAAM,UAAU,OAAO,YAAY;AAAA,EACnC,YAAY,UAAU,QAAQ,YAAY;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,23 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const Wrapper =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
+
const Wrapper = styled(Grid)`
|
|
5
|
+
min-width: 248px;
|
|
6
|
+
border: 1px;
|
|
7
|
+
border-bottom: 1px solid #ccc;
|
|
8
|
+
padding: 12px 12px;
|
|
9
|
+
`;
|
|
10
|
+
const MainContent = styled.div``;
|
|
11
|
+
const Title = styled.p`
|
|
12
|
+
font-size: 16px;
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
margin: 0;
|
|
15
|
+
`;
|
|
16
|
+
const Content = styled.p`
|
|
17
|
+
font-size: 12px;
|
|
18
|
+
font-weight: 400;
|
|
19
|
+
line-height: 1;
|
|
20
|
+
margin: 0;
|
|
21
|
+
`;
|
|
22
|
+
const Time = styled.p`
|
|
23
|
+
font-size: 12px;
|
|
24
|
+
font-weight: 100;
|
|
25
|
+
margin: 0;
|
|
26
|
+
margin-top: 8px;
|
|
27
|
+
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
28
|
+
color: ${(props) => props.theme.colors.neutral["500"]};
|
|
29
|
+
`;
|
|
30
|
+
const RightAddon = styled.div`
|
|
31
|
+
height: fit-content;
|
|
32
|
+
margin-left: 12px;
|
|
33
|
+
`;
|
|
34
|
+
export {
|
|
35
|
+
Content,
|
|
36
|
+
MainContent,
|
|
37
|
+
RightAddon,
|
|
38
|
+
Time,
|
|
39
|
+
Title,
|
|
40
|
+
Wrapper
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-card/styled.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\n\nexport const Wrapper = styled(Grid)`\n min-width: 248px;\n border: 1px;\n border-bottom: 1px solid #ccc;\n padding: 12px 12px;\n`;\n\nexport const MainContent = styled.div``;\n\nexport const Title = styled.p`\n font-size: 16px;\n font-weight: 600;\n margin: 0;\n`;\n\nexport const Content = styled.p`\n font-size: 12px;\n font-weight: 400;\n line-height: 1;\n margin: 0;\n`;\n\nexport const Time = styled.p`\n font-size: 12px;\n font-weight: 100;\n margin: 0;\n margin-top: 8px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['500']};\n`;\n\nexport const RightAddon = styled.div`\n height: fit-content;\n margin-left: 12px;\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEO,MAAM,UAAU,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOvB,MAAM,cAAc,OAAO;AAE3B,MAAM,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA;AAMrB,MAAM,UAAU,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOvB,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,iBAKV,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAG1C,MAAM,aAAa,OAAO;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,30 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
import { composerProps, defaultComposerPros } from './props.js';
|
|
17
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
18
|
-
|
|
19
|
-
var _PaperAirplane, _Grid;
|
|
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 ChatComposer = props => {
|
|
26
|
-
var _input$current;
|
|
27
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
+
import { describe } from "react-desc";
|
|
5
|
+
import { PaperAirplane } from "@elliemae/ds-icons";
|
|
6
|
+
import {
|
|
7
|
+
StyledChatContainerContentComposer,
|
|
8
|
+
StyledComposerInput,
|
|
9
|
+
StyledComposerButton,
|
|
10
|
+
StyledCounterArea,
|
|
11
|
+
StyledCounterErrorA11y
|
|
12
|
+
} from "./styled";
|
|
13
|
+
import { useValidateProps } from "./config/useValidateProps";
|
|
14
|
+
import { defaultComposerPros, composerProps } from "./props";
|
|
15
|
+
const ChatComposer = (props) => {
|
|
28
16
|
useValidateProps(props, ChatComposerWithSchema.toJSON());
|
|
29
17
|
const {
|
|
30
18
|
inputValue,
|
|
@@ -43,110 +31,104 @@ const ChatComposer = props => {
|
|
|
43
31
|
actionRef
|
|
44
32
|
} = props;
|
|
45
33
|
const COMPOSER_MIN_HEIGHT = 32;
|
|
46
|
-
const input =
|
|
47
|
-
const inputSize =
|
|
48
|
-
const inputSend =
|
|
49
|
-
const [height, setHeight] =
|
|
50
|
-
const internalMaxHeight =
|
|
51
|
-
const [showScroll, setShowScroll] =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (newHeight !== height && newHeight > COMPOSER_MIN_HEIGHT) onResize(newHeight);
|
|
34
|
+
const input = React2.useRef();
|
|
35
|
+
const inputSize = React2.useRef();
|
|
36
|
+
const inputSend = React2.useRef();
|
|
37
|
+
const [height, setHeight] = React2.useState(32);
|
|
38
|
+
const internalMaxHeight = React2.useMemo(() => maxHeight - 24, [maxHeight]);
|
|
39
|
+
const [showScroll, setShowScroll] = React2.useState(true);
|
|
40
|
+
React2.useEffect(() => {
|
|
41
|
+
const newHeight = inputSize.current?.scrollHeight > internalMaxHeight ? internalMaxHeight : inputSize.current?.scrollHeight;
|
|
42
|
+
if (newHeight !== height && newHeight > COMPOSER_MIN_HEIGHT)
|
|
43
|
+
onResize(newHeight);
|
|
57
44
|
setHeight(newHeight);
|
|
58
|
-
setShowScroll(
|
|
45
|
+
setShowScroll(inputSize.current?.scrollHeight - inputSize.current?.clientHeight > 5);
|
|
59
46
|
}, [inputValue, internalMaxHeight, height, onResize]);
|
|
60
|
-
|
|
47
|
+
React2.useEffect(() => {
|
|
61
48
|
if (actionRef && actionRef.current) {
|
|
62
49
|
actionRef.current.focusToComposer = () => {
|
|
63
50
|
input.current.focus();
|
|
64
51
|
};
|
|
65
|
-
|
|
66
52
|
actionRef.current.focusToSend = () => {
|
|
67
53
|
inputSend.current.focus();
|
|
68
54
|
};
|
|
69
55
|
}
|
|
70
56
|
}, [actionRef]);
|
|
71
|
-
const handleChange =
|
|
57
|
+
const handleChange = React2.useCallback((e) => {
|
|
72
58
|
onChange(e.target.value);
|
|
73
59
|
}, [onChange]);
|
|
74
|
-
const heightProps = {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return /*#__PURE__*/_jsx(StyledChatContainerContentComposer, {
|
|
81
|
-
rows: ['auto', '15px'],
|
|
82
|
-
maxHeight: "".concat(maxHeight, "px"),
|
|
60
|
+
const heightProps = { height, overflow: showScroll ? "auto" : "hidden" };
|
|
61
|
+
const inputLength = String(inputValue || "").length;
|
|
62
|
+
const hasError = React2.useMemo(() => inputLength > inputMaxLength, [inputLength, inputMaxLength]);
|
|
63
|
+
return /* @__PURE__ */ React2.createElement(StyledChatContainerContentComposer, {
|
|
64
|
+
rows: ["auto", "15px"],
|
|
65
|
+
maxHeight: `${maxHeight}px`,
|
|
83
66
|
"data-testid": dataTestid
|
|
84
|
-
},
|
|
85
|
-
cols: [
|
|
86
|
-
style: {
|
|
87
|
-
height: heightProps.height
|
|
88
|
-
},
|
|
67
|
+
}, /* @__PURE__ */ React2.createElement(Grid, {
|
|
68
|
+
cols: ["1fr", "24px"],
|
|
69
|
+
style: { height: heightProps.height },
|
|
89
70
|
justifyContent: "center",
|
|
90
71
|
alignItems: "flex-end",
|
|
91
72
|
gutter: "xxs"
|
|
92
|
-
},
|
|
73
|
+
}, /* @__PURE__ */ React2.createElement(StyledComposerInput, {
|
|
93
74
|
ref: input,
|
|
94
75
|
onChange: handleChange,
|
|
95
|
-
style:
|
|
76
|
+
style: { ...heightProps },
|
|
96
77
|
value: inputValue,
|
|
97
|
-
onFocus
|
|
98
|
-
onBlur
|
|
99
|
-
onKeyDown
|
|
100
|
-
placeholder
|
|
78
|
+
onFocus,
|
|
79
|
+
onBlur,
|
|
80
|
+
onKeyDown,
|
|
81
|
+
placeholder,
|
|
101
82
|
"aria-label": "Message to send",
|
|
102
83
|
"data-testid": "chat-composer-textarea",
|
|
103
84
|
name: "chat-composer-textarea",
|
|
104
85
|
id: "chat-composer-textarea"
|
|
105
|
-
}),
|
|
86
|
+
}), /* @__PURE__ */ React2.createElement(Grid, {
|
|
106
87
|
height: "32px",
|
|
107
88
|
alignItems: "center"
|
|
108
|
-
},
|
|
89
|
+
}, /* @__PURE__ */ React2.createElement(StyledComposerButton, {
|
|
109
90
|
buttonType: "text",
|
|
110
|
-
icon:
|
|
91
|
+
icon: /* @__PURE__ */ React2.createElement(PaperAirplane, {
|
|
111
92
|
width: 18,
|
|
112
93
|
height: 18
|
|
113
|
-
})
|
|
94
|
+
}),
|
|
114
95
|
onClick: onSend,
|
|
115
96
|
size: "s",
|
|
116
97
|
disabled: !inputValue || buttonDisabled || hasError,
|
|
117
98
|
"data-testid": "chat-composer-send-button",
|
|
118
99
|
"aria-label": "Send",
|
|
119
100
|
innerRef: inputSend
|
|
120
|
-
}))),
|
|
101
|
+
}))), /* @__PURE__ */ React2.createElement(StyledComposerInput, {
|
|
121
102
|
ref: inputSize,
|
|
122
103
|
style: {
|
|
123
104
|
height: 32,
|
|
124
|
-
visibility:
|
|
125
|
-
pointerEvents:
|
|
126
|
-
position:
|
|
105
|
+
visibility: "hidden",
|
|
106
|
+
pointerEvents: "none",
|
|
107
|
+
position: "absolute",
|
|
127
108
|
top: 0,
|
|
128
|
-
width:
|
|
109
|
+
width: input.current?.clientWidth
|
|
129
110
|
},
|
|
130
111
|
onChange: handleChange,
|
|
131
112
|
value: inputValue
|
|
132
|
-
}),
|
|
133
|
-
cols: [
|
|
113
|
+
}), /* @__PURE__ */ React2.createElement(Grid, {
|
|
114
|
+
cols: ["1fr", "24px"],
|
|
134
115
|
justifyContent: "flex-end",
|
|
135
116
|
alignItems: "center",
|
|
136
117
|
gutter: "xxs",
|
|
137
118
|
pb: "xxs"
|
|
138
|
-
},
|
|
139
|
-
hasError
|
|
119
|
+
}, /* @__PURE__ */ React2.createElement(StyledCounterArea, {
|
|
120
|
+
hasError,
|
|
140
121
|
"data-testid": "composer-counter-area"
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}, 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. ")]
|
|
145
|
-
}) : '', inputMaxLength && !maxLengthMessage ? " ".concat(inputLength, " / ").concat(inputMaxLength) : ''), _Grid || (_Grid = /*#__PURE__*/_jsx(Grid, {}))));
|
|
122
|
+
}, inputMaxLength && hasError ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(StyledCounterErrorA11y, {
|
|
123
|
+
role: "alert"
|
|
124
|
+
}, maxLengthMessage || `You have entered ${inputLength} characters and have exceeded the limit by ${inputLength - inputMaxLength}. Please limit to less than ${inputMaxLength} characters. `), maxLengthMessage || `Please limit to less than ${inputMaxLength} characters. `) : "", inputMaxLength && !maxLengthMessage ? ` ${inputLength} / ${inputMaxLength}` : ""), /* @__PURE__ */ React2.createElement(Grid, null)));
|
|
146
125
|
};
|
|
147
|
-
|
|
126
|
+
ChatComposer.propTypes = composerProps;
|
|
148
127
|
ChatComposer.defaultProps = defaultComposerPros;
|
|
149
128
|
const ChatComposerWithSchema = describe(ChatComposer);
|
|
150
129
|
ChatComposerWithSchema.propTypes = composerProps;
|
|
151
|
-
|
|
152
|
-
|
|
130
|
+
export {
|
|
131
|
+
ChatComposer,
|
|
132
|
+
ChatComposerWithSchema
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=ChatContainerComposer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-composer/ChatContainerComposer.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from 'react-desc';\nimport { PaperAirplane } from '@elliemae/ds-icons';\nimport {\n StyledChatContainerContentComposer,\n StyledComposerInput,\n StyledComposerButton,\n StyledCounterArea,\n StyledCounterErrorA11y,\n} from './styled';\nimport { useValidateProps } from './config/useValidateProps';\n\nimport { defaultComposerPros, composerProps, ChatComposerProps } from './props';\n\n// eslint-disable-next-line complexity\nconst ChatComposer = (props: ChatComposerProps): JSX.Element => {\n useValidateProps(props, ChatComposerWithSchema.toJSON());\n\n const {\n inputValue,\n onChange,\n onResize,\n onSend,\n onFocus,\n onBlur,\n onKeyDown,\n maxHeight = 300,\n placeholder,\n inputMaxLength,\n maxLengthMessage,\n buttonDisabled,\n dataTestid,\n actionRef,\n } = props;\n\n const COMPOSER_MIN_HEIGHT = 32;\n const input = React.useRef<HTMLTextAreaElement>();\n const inputSize = React.useRef<HTMLTextAreaElement>();\n const inputSend = React.useRef<HTMLButtonElement>();\n const [height, setHeight] = React.useState(32);\n const internalMaxHeight = React.useMemo(() => maxHeight - 24, [maxHeight]);\n const [showScroll, setShowScroll] = React.useState(true);\n\n React.useEffect(() => {\n const newHeight =\n inputSize.current?.scrollHeight > internalMaxHeight ? internalMaxHeight : inputSize.current?.scrollHeight;\n if (newHeight !== height && newHeight > COMPOSER_MIN_HEIGHT) onResize(newHeight);\n setHeight(newHeight);\n setShowScroll(inputSize.current?.scrollHeight - inputSize.current?.clientHeight > 5);\n }, [inputValue, internalMaxHeight, height, onResize]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToComposer = () => {\n input.current.focus();\n };\n actionRef.current.focusToSend = () => {\n inputSend.current.focus();\n };\n }\n }, [actionRef]);\n\n const handleChange = React.useCallback(\n (e) => {\n onChange(e.target.value);\n },\n [onChange],\n );\n const heightProps = { height, overflow: showScroll ? 'auto' : 'hidden' };\n\n const inputLength = String(inputValue || '').length;\n const hasError = React.useMemo(() => inputLength > inputMaxLength, [inputLength, inputMaxLength]);\n return (\n <StyledChatContainerContentComposer rows={['auto', '15px']} maxHeight={`${maxHeight}px`} data-testid={dataTestid}>\n <Grid\n cols={['1fr', '24px']}\n style={{ height: heightProps.height }}\n justifyContent=\"center\"\n alignItems=\"flex-end\"\n gutter=\"xxs\"\n >\n <StyledComposerInput\n ref={input}\n onChange={handleChange}\n style={{ ...heightProps }}\n value={inputValue}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n aria-label=\"Message to send\"\n data-testid=\"chat-composer-textarea\"\n name=\"chat-composer-textarea\"\n id=\"chat-composer-textarea\"\n />\n\n <Grid height=\"32px\" alignItems=\"center\">\n <StyledComposerButton\n buttonType=\"text\"\n icon={<PaperAirplane width={18} height={18} />}\n onClick={onSend}\n size=\"s\"\n disabled={!inputValue || buttonDisabled || hasError}\n data-testid=\"chat-composer-send-button\"\n aria-label=\"Send\"\n innerRef={inputSend}\n />\n </Grid>\n </Grid>\n <StyledComposerInput\n ref={inputSize}\n style={{\n height: 32,\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: input.current?.clientWidth,\n }}\n onChange={handleChange}\n value={inputValue}\n />\n <Grid cols={['1fr', '24px']} justifyContent=\"flex-end\" alignItems=\"center\" gutter=\"xxs\" pb=\"xxs\">\n <StyledCounterArea hasError={hasError} data-testid=\"composer-counter-area\">\n {inputMaxLength && hasError ? (\n <>\n <StyledCounterErrorA11y role=\"alert\">\n {maxLengthMessage ||\n `You have entered ${inputLength} characters and have exceeded the limit by ${\n inputLength - inputMaxLength\n }. Please limit to less than ${inputMaxLength} characters. `}\n </StyledCounterErrorA11y>\n {maxLengthMessage || `Please limit to less than ${inputMaxLength} characters. `}\n </>\n ) : (\n ''\n )}\n {inputMaxLength && !maxLengthMessage ? ` ${inputLength} / ${inputMaxLength}` : ''}\n </StyledCounterArea>\n <Grid />\n </Grid>\n </StyledChatContainerContentComposer>\n );\n};\n\nChatComposer.propTypes = composerProps;\nChatComposer.defaultProps = defaultComposerPros;\nconst ChatComposerWithSchema = describe(ChatComposer);\nChatComposerWithSchema.propTypes = composerProps;\n\nexport { ChatComposer, ChatComposerWithSchema };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|