@zohoim/chat-components 0.0.1-cx
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/README.md +9 -0
- package/es/ActionIcon/ActionIcon.js +82 -0
- package/es/ActionIcon/css/ActionIcon.module.css +8 -0
- package/es/ActionIcon/index.js +1 -0
- package/es/ActionIcon/props/defaultProps.js +8 -0
- package/es/ActionIcon/props/propTypes.js +17 -0
- package/es/ActionIconWrapper/ActionIconWrapper.js +61 -0
- package/es/ActionIconWrapper/css/ActionIconWrapper.module.css +32 -0
- package/es/ActionIconWrapper/css/cssJSLogic.js +14 -0
- package/es/ActionIconWrapper/index.js +1 -0
- package/es/ActionIconWrapper/props/defaultProps.js +6 -0
- package/es/ActionIconWrapper/props/propTypes.js +12 -0
- package/es/AttachmentBubble/AttachmentBubble.js +87 -0
- package/es/AttachmentBubble/css/AttachmentBubble.module.css +55 -0
- package/es/AttachmentBubble/css/cssJSLogic.js +18 -0
- package/es/AttachmentBubble/index.js +1 -0
- package/es/AttachmentBubble/props/defaultProps.js +8 -0
- package/es/AttachmentBubble/props/propTypes.js +19 -0
- package/es/AttachmentBubbleInfo/AttachmentBubbleInfo.js +48 -0
- package/es/AttachmentBubbleInfo/css/AttachmentBubbleInfo.module.css +39 -0
- package/es/AttachmentBubbleInfo/css/cssJSLogic.js +13 -0
- package/es/AttachmentBubbleInfo/index.js +1 -0
- package/es/AttachmentBubbleInfo/props/defaultProps.js +6 -0
- package/es/AttachmentBubbleInfo/props/propTypes.js +9 -0
- package/es/AttachmentIcon/AttachmentIcon.js +60 -0
- package/es/AttachmentIcon/css/AttachmentIcon.module.css +8 -0
- package/es/AttachmentIcon/css/cssJSLogic.js +13 -0
- package/es/AttachmentIcon/index.js +1 -0
- package/es/AttachmentIcon/props/defaultProps.js +8 -0
- package/es/AttachmentIcon/props/propTypes.js +21 -0
- package/es/AttachmentIcon/utils/getAttachmentIconComponent.js +81 -0
- package/es/Audio/Audio.js +38 -0
- package/es/Audio/css/Audio.module.css +7 -0
- package/es/Audio/index.js +1 -0
- package/es/Audio/props/defaultProps.js +6 -0
- package/es/Audio/props/propTypes.js +8 -0
- package/es/AudioBubble/AudioBubble.js +56 -0
- package/es/AudioBubble/css/AudioBubble.module.css +4 -0
- package/es/AudioBubble/index.js +1 -0
- package/es/AudioBubble/props/defaultProps.js +7 -0
- package/es/AudioBubble/props/propTypes.js +16 -0
- package/es/Fonts/puviFont.module.css +62 -0
- package/es/ImageBubble/ImageBubble.js +70 -0
- package/es/ImageBubble/css/ImageBubble.module.css +63 -0
- package/es/ImageBubble/css/cssJSLogic.js +15 -0
- package/es/ImageBubble/index.js +1 -0
- package/es/ImageBubble/props/defaultProps.js +6 -0
- package/es/ImageBubble/props/propTypes.js +13 -0
- package/es/LazyLoadImage/LazyLoadImage.js +37 -0
- package/es/LazyLoadImage/css/LazyLoadImage.module.css +5 -0
- package/es/LazyLoadImage/index.js +1 -0
- package/es/LazyLoadImage/props/defaultProps.js +6 -0
- package/es/LazyLoadImage/props/propTypes.js +8 -0
- package/es/LocationBubble/LocationBubble.js +62 -0
- package/es/LocationBubble/css/LocationBubble.module.css +57 -0
- package/es/LocationBubble/css/cssJSLogic.js +13 -0
- package/es/LocationBubble/images/location.png +0 -0
- package/es/LocationBubble/index.js +1 -0
- package/es/LocationBubble/props/defaultProps.js +6 -0
- package/es/LocationBubble/props/propTypes.js +8 -0
- package/es/MediaBubbleWrapper/MediaBubbleWrapper.js +62 -0
- package/es/MediaBubbleWrapper/css/MediaBubbleWrapper.module.css +7 -0
- package/es/MediaBubbleWrapper/index.js +1 -0
- package/es/MediaBubbleWrapper/props/defaultProps.js +7 -0
- package/es/MediaBubbleWrapper/props/propTypes.js +17 -0
- package/es/Message/Message.js +126 -0
- package/es/Message/index.js +1 -0
- package/es/Message/props/defaultProps.js +12 -0
- package/es/Message/props/propTypes.js +41 -0
- package/es/MessageAction/MessageAction.js +60 -0
- package/es/MessageAction/index.js +1 -0
- package/es/MessageAction/props/defaultProps.js +8 -0
- package/es/MessageAction/props/propTypes.js +21 -0
- package/es/MessageActions/MessageActions.js +120 -0
- package/es/MessageActions/css/MessageActions.module.css +24 -0
- package/es/MessageActions/index.js +1 -0
- package/es/MessageActions/props/defaultProps.js +10 -0
- package/es/MessageActions/props/propTypes.js +25 -0
- package/es/MessageActionsMore/MessageActionsMore.js +101 -0
- package/es/MessageActionsMore/css/MessageActionsMore.module.css +23 -0
- package/es/MessageActionsMore/index.js +1 -0
- package/es/MessageActionsMore/props/defaultProps.js +9 -0
- package/es/MessageActionsMore/props/propTypes.js +13 -0
- package/es/MessageActionsWrapper/MessageActionsWrapper.js +68 -0
- package/es/MessageActionsWrapper/css/MessageActionsWrapper.module.css +3 -0
- package/es/MessageActionsWrapper/index.js +1 -0
- package/es/MessageActionsWrapper/props/defaultProps.js +9 -0
- package/es/MessageActionsWrapper/props/propTypes.js +15 -0
- package/es/MessageAvatar/MessageAvatar.js +49 -0
- package/es/MessageAvatar/css/MessageAvatar.module.css +23 -0
- package/es/MessageAvatar/index.js +1 -0
- package/es/MessageAvatar/props/defaultProps.js +7 -0
- package/es/MessageAvatar/props/propTypes.js +13 -0
- package/es/MessageBox/MessageBox.js +66 -0
- package/es/MessageBox/css/MessageBox.module.css +56 -0
- package/es/MessageBox/css/cssJSLogic.js +18 -0
- package/es/MessageBox/index.js +1 -0
- package/es/MessageBox/props/defaultProps.js +6 -0
- package/es/MessageBox/props/propTypes.js +13 -0
- package/es/MessageBubble/MessageBubble.js +116 -0
- package/es/MessageBubble/css/MessageBubble.module.css +101 -0
- package/es/MessageBubble/css/cssJSLogic.js +34 -0
- package/es/MessageBubble/index.js +1 -0
- package/es/MessageBubble/props/defaultProps.js +11 -0
- package/es/MessageBubble/props/propTypes.js +17 -0
- package/es/MessageStatus/MessageStatus.js +77 -0
- package/es/MessageStatus/css/MessageStatus.module.css +17 -0
- package/es/MessageStatus/css/cssJSLogic.js +26 -0
- package/es/MessageStatus/index.js +1 -0
- package/es/MessageStatus/props/defaultProps.js +6 -0
- package/es/MessageStatus/props/propTypes.js +12 -0
- package/es/MoreActionItem/MoreActionItem.js +72 -0
- package/es/MoreActionItem/css/MoreActionItem.module.css +27 -0
- package/es/MoreActionItem/index.js +1 -0
- package/es/MoreActionItem/props/defaultProps.js +7 -0
- package/es/MoreActionItem/props/propTypes.js +14 -0
- package/es/ReplyBubble/ReplyBubble.js +118 -0
- package/es/ReplyBubble/css/ReplyBubble.module.css +23 -0
- package/es/ReplyBubble/css/cssJSLogic.js +14 -0
- package/es/ReplyBubble/index.js +1 -0
- package/es/ReplyBubble/props/defaultProps.js +8 -0
- package/es/ReplyBubble/props/propTypes.js +28 -0
- package/es/ReplyBubbleContent/ReplyBubbleContent.js +61 -0
- package/es/ReplyBubbleContent/css/ReplyBubbleContent.module.css +75 -0
- package/es/ReplyBubbleContent/css/cssJSLogic.js +13 -0
- package/es/ReplyBubbleContent/index.js +1 -0
- package/es/ReplyBubbleContent/props/defaultProps.js +6 -0
- package/es/ReplyBubbleContent/props/propTypes.js +11 -0
- package/es/ReplyBubbleHeader/ReplyBubbleHeader.js +74 -0
- package/es/ReplyBubbleHeader/css/ReplyBubbleHeader.module.css +44 -0
- package/es/ReplyBubbleHeader/css/cssJSLogic.js +12 -0
- package/es/ReplyBubbleHeader/index.js +1 -0
- package/es/ReplyBubbleHeader/props/defaultProps.js +7 -0
- package/es/ReplyBubbleHeader/props/propTypes.js +13 -0
- package/es/TextBubble/TextBubble.js +49 -0
- package/es/TextBubble/css/TextBubble.module.css +35 -0
- package/es/TextBubble/css/cssJSLogic.js +18 -0
- package/es/TextBubble/index.js +1 -0
- package/es/TextBubble/props/defaultProps.js +6 -0
- package/es/TextBubble/props/propTypes.js +10 -0
- package/es/Theme/ThemeAssets.js +78 -0
- package/es/Theme/ThemeWrapper.js +88 -0
- package/es/Theme/TooltipWrapper.js +85 -0
- package/es/Theme/constants/index.js +41 -0
- package/es/Theme/css/TooltipWrapper.module.css +10 -0
- package/es/Theme/index.js +1 -0
- package/es/Theme/props/defaultProps.js +10 -0
- package/es/Theme/props/propTypes.js +14 -0
- package/es/Theme/themeVariables/commonThemeColorVariable.js +17 -0
- package/es/Theme/themeVariables/dark/blueTheme.js +116 -0
- package/es/Theme/themeVariables/dark/commonColorVariable.js +16 -0
- package/es/Theme/themeVariables/dark/greenTheme.js +115 -0
- package/es/Theme/themeVariables/dark/orangeTheme.js +115 -0
- package/es/Theme/themeVariables/dark/redTheme.js +115 -0
- package/es/Theme/themeVariables/dark/yellowTheme.js +115 -0
- package/es/Theme/themeVariables/light/blueTheme.js +114 -0
- package/es/Theme/themeVariables/light/commonColorVariable.js +35 -0
- package/es/Theme/themeVariables/light/greenTheme.js +114 -0
- package/es/Theme/themeVariables/light/orangeTheme.js +114 -0
- package/es/Theme/themeVariables/light/redTheme.js +114 -0
- package/es/Theme/themeVariables/light/yellowTheme.js +114 -0
- package/es/Theme/themeVariables/pureDark/blueTheme.js +115 -0
- package/es/Theme/themeVariables/pureDark/commonColorVariable.js +18 -0
- package/es/Theme/themeVariables/pureDark/greenTheme.js +115 -0
- package/es/Theme/themeVariables/pureDark/orangeTheme.js +115 -0
- package/es/Theme/themeVariables/pureDark/redTheme.js +115 -0
- package/es/Theme/themeVariables/pureDark/yellowTheme.js +115 -0
- package/es/Theme/utils/combineConfigurations.js +17 -0
- package/es/Theme/utils/flatVariables.js +12 -0
- package/es/Theme/utils/getCustomizedCssVariables.js +19 -0
- package/es/Theme/utils/getThemeConfigurations.js +81 -0
- package/es/Theme/utils/getWrapperDivProps.js +16 -0
- package/es/Video/Video.js +38 -0
- package/es/Video/css/Video.module.css +5 -0
- package/es/Video/index.js +1 -0
- package/es/Video/props/defaultProps.js +6 -0
- package/es/Video/props/propTypes.js +8 -0
- package/es/VideoBubble/VideoBubble.js +66 -0
- package/es/VideoBubble/css/VideoBubble.module.css +12 -0
- package/es/VideoBubble/css/cssJSLogic.js +14 -0
- package/es/VideoBubble/index.js +1 -0
- package/es/VideoBubble/props/defaultProps.js +7 -0
- package/es/VideoBubble/props/propTypes.js +17 -0
- package/es/constants/index.js +1 -0
- package/es/css/common.module.css +6 -0
- package/es/icons/create-icon-components.js +172 -0
- package/es/icons/factory/attachments/audio.svg +19 -0
- package/es/icons/factory/attachments/code.svg +21 -0
- package/es/icons/factory/attachments/image.svg +20 -0
- package/es/icons/factory/attachments/pdf.svg +19 -0
- package/es/icons/factory/attachments/ppt.svg +1 -0
- package/es/icons/factory/attachments/text.svg +22 -0
- package/es/icons/factory/attachments/unknown.svg +21 -0
- package/es/icons/factory/attachments/video.svg +19 -0
- package/es/icons/factory/attachments/xls.svg +1 -0
- package/es/icons/factory/attachments/zip.svg +27 -0
- package/es/icons/factory/common/alertTriangle.svg +5 -0
- package/es/icons/factory/common/article.svg +4 -0
- package/es/icons/factory/common/reply.svg +6 -0
- package/es/icons/factory/messageStatus/clock.svg +7 -0
- package/es/icons/factory/messageStatus/doubleTick.svg +1 -0
- package/es/icons/factory/messageStatus/failed.svg +7 -0
- package/es/icons/factory/messageStatus/tick.svg +1 -0
- package/es/icons/icon.template.js +28 -0
- package/es/icons/iconSrc/attachments/Audio.js +38 -0
- package/es/icons/iconSrc/attachments/Code.js +44 -0
- package/es/icons/iconSrc/attachments/Image.js +43 -0
- package/es/icons/iconSrc/attachments/Pdf.js +38 -0
- package/es/icons/iconSrc/attachments/Ppt.js +26 -0
- package/es/icons/iconSrc/attachments/Text.js +47 -0
- package/es/icons/iconSrc/attachments/Txt.js +47 -0
- package/es/icons/iconSrc/attachments/Unknown.js +42 -0
- package/es/icons/iconSrc/attachments/Video.js +38 -0
- package/es/icons/iconSrc/attachments/Xls.js +26 -0
- package/es/icons/iconSrc/attachments/Zip.js +86 -0
- package/es/icons/iconSrc/attachments/index.js +10 -0
- package/es/icons/iconSrc/common/AlertTriangle.js +23 -0
- package/es/icons/iconSrc/common/Article.js +17 -0
- package/es/icons/iconSrc/common/Reply.js +13 -0
- package/es/icons/iconSrc/common/index.js +3 -0
- package/es/icons/iconSrc/messageStatus/Clock.js +14 -0
- package/es/icons/iconSrc/messageStatus/DoubleTick.js +16 -0
- package/es/icons/iconSrc/messageStatus/Failed.js +14 -0
- package/es/icons/iconSrc/messageStatus/Tick.js +13 -0
- package/es/icons/iconSrc/messageStatus/index.js +4 -0
- package/es/im/ArticleBubble/ArticleBubble.js +80 -0
- package/es/im/ArticleBubble/css/ArticleBubble.module.css +75 -0
- package/es/im/ArticleBubble/css/cssJSLogic.js +12 -0
- package/es/im/ArticleBubble/index.js +1 -0
- package/es/im/ArticleBubble/props/defaultProps.js +6 -0
- package/es/im/ArticleBubble/props/propTypes.js +14 -0
- package/es/im/IMIntegrationIcon/IMIntegrationIcon.js +73 -0
- package/es/im/IMIntegrationIcon/css/IMIntegrationIcon.module.css +72 -0
- package/es/im/IMIntegrationIcon/css/cssJSLogic.js +53 -0
- package/es/im/IMIntegrationIcon/index.js +1 -0
- package/es/im/IMIntegrationIcon/props/defaultProps.js +11 -0
- package/es/im/IMIntegrationIcon/props/propTypes.js +14 -0
- package/es/im/IMMessage/IMMessage.js +197 -0
- package/es/im/IMMessage/css/IMMessage.module.css +36 -0
- package/es/im/IMMessage/css/cssJSLogic.js +15 -0
- package/es/im/IMMessage/index.js +1 -0
- package/es/im/IMMessage/props/defaultProps.js +16 -0
- package/es/im/IMMessage/props/propTypes.js +126 -0
- package/es/im/IMMessageContent/IMMessageContent.js +128 -0
- package/es/im/IMMessageContent/css/IMMessageContent.module.css +8 -0
- package/es/im/IMMessageContent/index.js +1 -0
- package/es/im/IMMessageContent/props/defaultProps.js +9 -0
- package/es/im/IMMessageContent/props/propTypes.js +54 -0
- package/es/im/IMMessageMeta/IMMessageMeta.js +72 -0
- package/es/im/IMMessageMeta/css/IMMessageMeta.module.css +46 -0
- package/es/im/IMMessageMeta/css/cssJSLogic.js +29 -0
- package/es/im/IMMessageMeta/index.js +1 -0
- package/es/im/IMMessageMeta/props/defaultProps.js +11 -0
- package/es/im/IMMessageMeta/props/propTypes.js +42 -0
- package/es/im/IMMessageMetaInfo/IMMessageMetaInfo.js +29 -0
- package/es/im/IMMessageMetaInfo/css/IMMessageMetaInfo.module.css +14 -0
- package/es/im/IMMessageMetaInfo/index.js +1 -0
- package/es/im/IMMessageMetaInfo/props/defaultProps.js +8 -0
- package/es/im/IMMessageMetaInfo/props/propTypes.js +8 -0
- package/es/im/IMPermaLink/IMPermaLink.js +48 -0
- package/es/im/IMPermaLink/css/IMPermaLink.module.css +14 -0
- package/es/im/IMPermaLink/css/cssJSLogic.js +14 -0
- package/es/im/IMPermaLink/index.js +1 -0
- package/es/im/IMPermaLink/props/defaultProps.js +6 -0
- package/es/im/IMPermaLink/props/propTypes.js +11 -0
- package/es/im/IMReplyBubble/IMReplyBubble.js +52 -0
- package/es/im/IMReplyBubble/index.js +1 -0
- package/es/im/IMReplyBubble/props/defaultProps.js +7 -0
- package/es/im/IMReplyBubble/props/propTypes.js +29 -0
- package/es/im/IMTextBubble/IMTextBubble.js +40 -0
- package/es/im/IMTextBubble/index.js +1 -0
- package/es/im/IMTextBubble/props/defaultProps.js +8 -0
- package/es/im/IMTextBubble/props/propTypes.js +31 -0
- package/es/im/css/common.module.css +6 -0
- package/es/im/index.js +9 -0
- package/es/index.js +32 -0
- package/package.json +49 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/** ** Hooks *** */
|
|
4
|
+
|
|
5
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
6
|
+
/** ** Constants *** */
|
|
7
|
+
|
|
8
|
+
import replyBubbleContentDefaultProps from './props/defaultProps';
|
|
9
|
+
import replyBubbleContentPropTypes from './props/propTypes';
|
|
10
|
+
/** ** Methods *** */
|
|
11
|
+
|
|
12
|
+
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
13
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
14
|
+
/** ** Styles *** */
|
|
15
|
+
|
|
16
|
+
import style from './css/ReplyBubbleContent.module.css';
|
|
17
|
+
/** ** Components *** */
|
|
18
|
+
|
|
19
|
+
import { Container, Box } from '@zohodesk/components/es/Layout';
|
|
20
|
+
export default function ReplyBubbleContent(props) {
|
|
21
|
+
const {
|
|
22
|
+
customStyle,
|
|
23
|
+
senderName,
|
|
24
|
+
renderIcon,
|
|
25
|
+
renderMessage,
|
|
26
|
+
isFailed,
|
|
27
|
+
onClick
|
|
28
|
+
} = props;
|
|
29
|
+
/* External CSS Customization */
|
|
30
|
+
|
|
31
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
32
|
+
/* css classnames added based on logic */
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
replyBubbleContentClass
|
|
36
|
+
} = cssJSLogic({
|
|
37
|
+
isFailed
|
|
38
|
+
}, newStyle);
|
|
39
|
+
const icon = renderHandler(renderIcon)();
|
|
40
|
+
const messageContent = renderHandler(renderMessage)();
|
|
41
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
42
|
+
align: "vertical",
|
|
43
|
+
alignBox: "row",
|
|
44
|
+
className: replyBubbleContentClass,
|
|
45
|
+
isCover: false,
|
|
46
|
+
onClick: onClick
|
|
47
|
+
}, icon ? /*#__PURE__*/React.createElement(Box, {
|
|
48
|
+
className: newStyle.iconWrapper
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
50
|
+
align: "both"
|
|
51
|
+
}, icon)) : null, /*#__PURE__*/React.createElement(Box, {
|
|
52
|
+
flexible: true
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
54
|
+
className: newStyle.name
|
|
55
|
+
}, senderName), messageContent ? /*#__PURE__*/React.createElement(Box, {
|
|
56
|
+
className: newStyle.messageWrapper
|
|
57
|
+
}, messageContent) : null));
|
|
58
|
+
}
|
|
59
|
+
ReplyBubbleContent.propTypes = replyBubbleContentPropTypes;
|
|
60
|
+
ReplyBubbleContent.defaultProps = replyBubbleContentDefaultProps;
|
|
61
|
+
ReplyBubbleContent.displayName = 'ReplyBubbleContent';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
.replyBubbleContent {
|
|
2
|
+
position: relative;
|
|
3
|
+
background-color: var(--imlib_chat_components_replyBubbleContent_bg_color);
|
|
4
|
+
border: 1px solid var(--imlib_chat_components_replyBubbleContent_border_color);
|
|
5
|
+
border-radius: 3px;
|
|
6
|
+
margin: var(--zd_size5) 0 ;
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
}[dir=ltr] .replyBubbleContent {
|
|
9
|
+
padding: var(--zd_size10) var(--zd_size10) var(--zd_size10) var(--zd_size20) ;
|
|
10
|
+
}[dir=rtl] .replyBubbleContent {
|
|
11
|
+
padding: var(--zd_size10) var(--zd_size20) var(--zd_size10) var(--zd_size10) ;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.failedReplyBubbleContent{
|
|
15
|
+
background-color: var(--imlib_chat_components_replyBubbleContent_bg_color_failed);
|
|
16
|
+
border-color: var(--imlib_chat_components_replyBubbleContent_border_color_failed);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.replyBubbleContent::after {
|
|
20
|
+
content: '';
|
|
21
|
+
width: var(--zd_size2) ;
|
|
22
|
+
display: block;
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: var(--zd_size10) ;
|
|
25
|
+
bottom: var(--zd_size10) ;
|
|
26
|
+
background-color: var(--imlib_chat_components_replyBubbleContent_line_color);
|
|
27
|
+
border-radius: 30px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
[dir=ltr] .replyBubbleContent::after {
|
|
31
|
+
left: var(--zd_size10) ;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[dir=rtl] .replyBubbleContent::after {
|
|
35
|
+
right: var(--zd_size10) ;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.failedReplyBubbleContent::after{
|
|
39
|
+
background-color: var(--imlib_chat_components_replyBubbleContent_line_color_failed);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.name {
|
|
43
|
+
color: var(--imlib_chat_components_replyBubbleContent_sender_color);
|
|
44
|
+
font-size: var(--zd_font_size15) ;
|
|
45
|
+
line-height: 1.5;
|
|
46
|
+
composes: dotted from "../../css/common.module.css";
|
|
47
|
+
font-family: var(--zd_semibold);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.failedReplyBubbleContent .name{
|
|
51
|
+
color: var(--imlib_chat_components_replyBubbleContent_sender_color_failed);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[dir=ltr] .iconWrapper {
|
|
55
|
+
margin-right: var(--zd_size10) ;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[dir=rtl] .iconWrapper {
|
|
59
|
+
margin-left: var(--zd_size10) ;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.messageWrapper {
|
|
63
|
+
color: var(--imlib_chat_components_replyBubbleContent_content_color);
|
|
64
|
+
font-size: var(--zd_font_size13) ;
|
|
65
|
+
line-height: 1.5;
|
|
66
|
+
-webkit-line-clamp: 2;
|
|
67
|
+
display: -webkit-box;
|
|
68
|
+
-webkit-box-orient: vertical;
|
|
69
|
+
word-break: break-word;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.failedReplyBubbleContent .messageWrapper{
|
|
74
|
+
color: var(--imlib_chat_components_replyBubbleContent_content_color_failed);
|
|
75
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { compileClassNames } from '@zohodesk/utils';
|
|
2
|
+
export default function cssJSLogic(props, style) {
|
|
3
|
+
const {
|
|
4
|
+
isFailed
|
|
5
|
+
} = props;
|
|
6
|
+
const replyBubbleContentClass = compileClassNames({
|
|
7
|
+
[style.replyBubbleContent]: true,
|
|
8
|
+
[style.failedReplyBubbleContent]: isFailed
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
replyBubbleContentClass
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ReplyBubbleContent } from './ReplyBubbleContent';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
const replyBubbleContentPropTypes = {
|
|
4
|
+
renderIcon: PropTypes.func.isRequired,
|
|
5
|
+
renderMessage: PropTypes.func.isRequired,
|
|
6
|
+
senderName: PropTypes.string.isRequired,
|
|
7
|
+
customStyle: PropTypes.object,
|
|
8
|
+
isFailed: PropTypes.bool,
|
|
9
|
+
onClick: PropTypes.func
|
|
10
|
+
};
|
|
11
|
+
export default replyBubbleContentPropTypes;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import React, { useMemo, useCallback } from 'react';
|
|
3
|
+
/** ** Hooks *** */
|
|
4
|
+
|
|
5
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
6
|
+
/** ** Constants *** */
|
|
7
|
+
|
|
8
|
+
import replyBubbleHeaderDefaultProps from './props/defaultProps';
|
|
9
|
+
import replyBubbleHeaderPropTypes from './props/propTypes';
|
|
10
|
+
/** ** Styles *** */
|
|
11
|
+
|
|
12
|
+
import style from './css/ReplyBubbleHeader.module.css';
|
|
13
|
+
/** ** Components *** */
|
|
14
|
+
|
|
15
|
+
import { Container, Box } from '@zohodesk/components/es/Layout';
|
|
16
|
+
/** ** Icons *** */
|
|
17
|
+
|
|
18
|
+
import ReplyIcon from '@zohodesk/icon/es/general/Reply';
|
|
19
|
+
/** ** Methods *** */
|
|
20
|
+
|
|
21
|
+
import renderHandler from '@zohoim/chat-components-utils/es/common/renderHandler';
|
|
22
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
23
|
+
export default function ReplyBubbleHeader(props) {
|
|
24
|
+
const {
|
|
25
|
+
customStyle,
|
|
26
|
+
replyText,
|
|
27
|
+
dateTimeDetails,
|
|
28
|
+
renderCustomReplyIcon,
|
|
29
|
+
isFailed
|
|
30
|
+
} = props;
|
|
31
|
+
const {
|
|
32
|
+
displayDateTime,
|
|
33
|
+
tooltip
|
|
34
|
+
} = dateTimeDetails;
|
|
35
|
+
/* External CSS Customization */
|
|
36
|
+
|
|
37
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
38
|
+
const iconStyle = useMemo(() => ({
|
|
39
|
+
base: newStyle.replyIcon
|
|
40
|
+
}), [newStyle.replyIcon]);
|
|
41
|
+
/* css classnames added based on logic */
|
|
42
|
+
|
|
43
|
+
const {
|
|
44
|
+
replyBubbleHeaderClass
|
|
45
|
+
} = cssJSLogic({
|
|
46
|
+
isFailed
|
|
47
|
+
}, newStyle);
|
|
48
|
+
const renderIcon = useCallback(() => {
|
|
49
|
+
const customIcon = renderHandler(renderCustomReplyIcon)();
|
|
50
|
+
return customIcon || /*#__PURE__*/React.createElement(ReplyIcon, {
|
|
51
|
+
customStyle: iconStyle
|
|
52
|
+
});
|
|
53
|
+
}, [iconStyle, renderCustomReplyIcon]);
|
|
54
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
55
|
+
align: "vertical",
|
|
56
|
+
alignBox: "row",
|
|
57
|
+
className: replyBubbleHeaderClass
|
|
58
|
+
}, renderIcon(), /*#__PURE__*/React.createElement(Box, {
|
|
59
|
+
flexible: true
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
61
|
+
align: "between",
|
|
62
|
+
alignBox: "row"
|
|
63
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
64
|
+
className: newStyle.replyText,
|
|
65
|
+
flexible: true
|
|
66
|
+
}, replyText), /*#__PURE__*/React.createElement(Box, {
|
|
67
|
+
className: newStyle.time,
|
|
68
|
+
"data-title": tooltip,
|
|
69
|
+
flexible: true
|
|
70
|
+
}, displayDateTime))));
|
|
71
|
+
}
|
|
72
|
+
ReplyBubbleHeader.propTypes = replyBubbleHeaderPropTypes;
|
|
73
|
+
ReplyBubbleHeader.defaultProps = replyBubbleHeaderDefaultProps;
|
|
74
|
+
ReplyBubbleHeader.displayName = 'ReplyBubbleHeader';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.replyIcon {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-shrink: 0;
|
|
4
|
+
width: var(--zd_size20) !important;
|
|
5
|
+
height: var(--zd_size20) !important;
|
|
6
|
+
cursor: default;
|
|
7
|
+
}[dir=ltr] .replyIcon {
|
|
8
|
+
margin-right: var(--zd_size5) ;
|
|
9
|
+
}[dir=rtl] .replyIcon {
|
|
10
|
+
margin-left: var(--zd_size5) ;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.replyText {
|
|
14
|
+
font-size: var(--zd_font_size14) ;
|
|
15
|
+
color: var(--imlib_chat_components_replyBubbleHeader_text_color);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[dir=ltr] .replyText {
|
|
19
|
+
margin-right: var(--zd_size5) ;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[dir=rtl] .replyText {
|
|
23
|
+
margin-left: var(--zd_size5) ;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.failedReplyBubbleHeader .replyText {
|
|
27
|
+
color: var(--imlib_chat_components_replyBubbleHeader_text_color_failed);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.replyText,
|
|
31
|
+
.time {
|
|
32
|
+
composes: dotted from '../../css/common.module.css';
|
|
33
|
+
max-width: max-content;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.time {
|
|
37
|
+
font-size: var(--zd_font_size11) ;
|
|
38
|
+
letter-spacing: 0.4px;
|
|
39
|
+
color: var(--imlib_chat_components_replyBubbleHeader_time_color);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.failedReplyBubbleHeader .time {
|
|
43
|
+
color: var(--imlib_chat_components_replyBubbleHeader_time_color_failed);
|
|
44
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { compileClassNames } from '@zohodesk/utils';
|
|
2
|
+
export default function cssJSLogic(props, style) {
|
|
3
|
+
const {
|
|
4
|
+
isFailed
|
|
5
|
+
} = props;
|
|
6
|
+
const replyBubbleHeaderClass = compileClassNames({
|
|
7
|
+
[style.failedReplyBubbleHeader]: isFailed
|
|
8
|
+
});
|
|
9
|
+
return {
|
|
10
|
+
replyBubbleHeaderClass
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ReplyBubbleHeader } from './ReplyBubbleHeader';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** ** Constants *** */
|
|
2
|
+
import { dummyObject } from '@zohoim/chat-components-utils/es/constants/emptyConstants';
|
|
3
|
+
const replyBubbleHeaderDefaultProps = {
|
|
4
|
+
customStyle: dummyObject,
|
|
5
|
+
dateTimeDetails: dummyObject
|
|
6
|
+
};
|
|
7
|
+
export default replyBubbleHeaderDefaultProps;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
const replyBubbleHeaderPropTypes = {
|
|
4
|
+
replyText: PropTypes.string.isRequired,
|
|
5
|
+
customStyle: PropTypes.object,
|
|
6
|
+
dateTimeDetails: PropTypes.shape({
|
|
7
|
+
displayDateTime: PropTypes.string,
|
|
8
|
+
tooltip: PropTypes.string
|
|
9
|
+
}),
|
|
10
|
+
renderCustomReplyIcon: PropTypes.func,
|
|
11
|
+
isFailed: PropTypes.bool
|
|
12
|
+
};
|
|
13
|
+
export default replyBubbleHeaderPropTypes;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import React, { Fragment } from 'react';
|
|
3
|
+
/** ** Hooks *** */
|
|
4
|
+
|
|
5
|
+
import useMergeStyle from '@zohodesk/hooks/es/utils/useMergeStyle';
|
|
6
|
+
/** ** Constants *** */
|
|
7
|
+
|
|
8
|
+
import textBubbleDefaultProps from './props/defaultProps';
|
|
9
|
+
import textBubblePropTypes from './props/propTypes';
|
|
10
|
+
/** ** Styles *** */
|
|
11
|
+
|
|
12
|
+
import style from './css/TextBubble.module.css';
|
|
13
|
+
/** ** Methods *** */
|
|
14
|
+
|
|
15
|
+
import cssJSLogic from './css/cssJSLogic';
|
|
16
|
+
export default function TextBubble(props) {
|
|
17
|
+
const {
|
|
18
|
+
customStyle,
|
|
19
|
+
moreText,
|
|
20
|
+
message,
|
|
21
|
+
onClickMore,
|
|
22
|
+
isFailed
|
|
23
|
+
} = props;
|
|
24
|
+
/* External CSS Customization */
|
|
25
|
+
|
|
26
|
+
const newStyle = useMergeStyle(style, customStyle);
|
|
27
|
+
/* css classnames added based on logic */
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
textBubbleClass,
|
|
31
|
+
moreTextClass
|
|
32
|
+
} = cssJSLogic({
|
|
33
|
+
isFailed
|
|
34
|
+
}, newStyle);
|
|
35
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
36
|
+
className: textBubbleClass // eslint-disable-next-line react/no-danger, @zohodesk/zsecurity/no-unsecure-html
|
|
37
|
+
,
|
|
38
|
+
dangerouslySetInnerHTML: {
|
|
39
|
+
// __html: HTMLPurifier.sanitize(message)
|
|
40
|
+
__html: message
|
|
41
|
+
}
|
|
42
|
+
}), moreText ? /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: moreTextClass,
|
|
44
|
+
onClick: onClickMore
|
|
45
|
+
}, moreText) : null);
|
|
46
|
+
}
|
|
47
|
+
TextBubble.propTypes = textBubblePropTypes;
|
|
48
|
+
TextBubble.defaultProps = textBubbleDefaultProps;
|
|
49
|
+
TextBubble.displayName = 'TextBubble';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.textBubble {
|
|
2
|
+
/* Use this class name for css customisation */
|
|
3
|
+
color: var(--imlib_chat_components_textBubble_text_color);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.failedTextBubble {
|
|
7
|
+
color: var(--imlib_chat_components_textBubble_text_color_failed);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.moreText {
|
|
11
|
+
color: var(--imlib_chat_components_textBubble_see_more_color);
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.moreText:hover {
|
|
16
|
+
text-decoration: underline;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.failedMoreText {
|
|
20
|
+
color: var(--imlib_chat_components_textBubble_see_more_color_failed);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.textBubble a {
|
|
24
|
+
color: var(--imlib_chat_components_textBubble_url_color);
|
|
25
|
+
word-break: break-word;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.textBubble a:hover {
|
|
29
|
+
text-decoration: underline !important;
|
|
30
|
+
/* !important for Desk css overwrite */
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.failedTextBubble a {
|
|
34
|
+
color: var(--imlib_chat_components_textBubble_url_color_failed);
|
|
35
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { compileClassNames } from '@zohodesk/utils';
|
|
2
|
+
export default function cssJSLogic(props, style) {
|
|
3
|
+
const {
|
|
4
|
+
isFailed
|
|
5
|
+
} = props;
|
|
6
|
+
const textBubbleClass = compileClassNames({
|
|
7
|
+
[style.textBubble]: true,
|
|
8
|
+
[style.failedTextBubble]: isFailed
|
|
9
|
+
});
|
|
10
|
+
const moreTextClass = compileClassNames({
|
|
11
|
+
[style.moreText]: true,
|
|
12
|
+
[style.failedMoreText]: isFailed
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
textBubbleClass,
|
|
16
|
+
moreTextClass
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TextBubble } from './TextBubble';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
const textBubblePropTypes = {
|
|
4
|
+
message: PropTypes.string.isRequired,
|
|
5
|
+
customStyle: PropTypes.object,
|
|
6
|
+
moreText: PropTypes.string,
|
|
7
|
+
onClickMore: PropTypes.func,
|
|
8
|
+
isFailed: PropTypes.bool
|
|
9
|
+
};
|
|
10
|
+
export default textBubblePropTypes;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** ** Libraries *** */
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import '@zohodesk/components/lib/common/boxShadow.module.css';
|
|
4
|
+
/* component pkg - default mode, themes */
|
|
5
|
+
|
|
6
|
+
import '@zohodesk/components/assets/Appearance/light/themes/blue/blue_CTA_LightTheme.module.css';
|
|
7
|
+
import '@zohodesk/components/assets/Appearance/light/themes/blue/blue_CTA_LightModifyCategory.module.css';
|
|
8
|
+
import '@zohodesk/components/assets/Appearance/light/themes/green/green_CTA_LightTheme.module.css';
|
|
9
|
+
import '@zohodesk/components/assets/Appearance/light/themes/green/green_CTA_LightModifyCategory.module.css';
|
|
10
|
+
import '@zohodesk/components/assets/Appearance/light/themes/orange/orange_CTA_LightTheme.module.css';
|
|
11
|
+
import '@zohodesk/components/assets/Appearance/light/themes/orange/orange_CTA_LightModifyCategory.module.css';
|
|
12
|
+
import '@zohodesk/components/assets/Appearance/light/themes/red/red_CTA_LightTheme.module.css';
|
|
13
|
+
import '@zohodesk/components/assets/Appearance/light/themes/red/red_CTA_LightModifyCategory.module.css';
|
|
14
|
+
import '@zohodesk/components/assets/Appearance/light/themes/yellow/yellow_CTA_LightTheme.module.css';
|
|
15
|
+
import '@zohodesk/components/assets/Appearance/light/themes/yellow/yellow_CTA_LightModifyCategory.module.css';
|
|
16
|
+
import '@zohodesk/components/assets/Appearance/light/themes/blue/blue_ComponentTheme_LightTheme.module.css';
|
|
17
|
+
import '@zohodesk/components/assets/Appearance/light/themes/green/green_ComponentTheme_LightTheme.module.css';
|
|
18
|
+
import '@zohodesk/components/assets/Appearance/light/themes/orange/orange_ComponentTheme_LightTheme.module.css';
|
|
19
|
+
import '@zohodesk/components/assets/Appearance/light/themes/red/red_ComponentTheme_LightTheme.module.css';
|
|
20
|
+
import '@zohodesk/components/assets/Appearance/light/themes/yellow/yellow_ComponentTheme_LightTheme.module.css';
|
|
21
|
+
import '@zohodesk/components/assets/Appearance/light/mode/Component_LightMode.module.css';
|
|
22
|
+
import '@zohodesk/components/assets/Contrast/lightContrastLightness.module.css';
|
|
23
|
+
/* component pkg - dark mode, themes */
|
|
24
|
+
|
|
25
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/blue/blue_CTA_DarkTheme.module.css';
|
|
26
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/blue/blue_CTA_DarkModifyCategory.module.css';
|
|
27
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/green/green_CTA_DarkTheme.module.css';
|
|
28
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/green/green_CTA_DarkModifyCategory.module.css';
|
|
29
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/orange/orange_CTA_DarkTheme.module.css';
|
|
30
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/orange/orange_CTA_DarkModifyCategory.module.css';
|
|
31
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/red/red_CTA_DarkTheme.module.css';
|
|
32
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/red/red_CTA_DarkModifyCategory.module.css';
|
|
33
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkTheme.module.css';
|
|
34
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkModifyCategory.module.css';
|
|
35
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/blue/blue_ComponentTheme_DarkTheme.module.css';
|
|
36
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/green/green_ComponentTheme_DarkTheme.module.css';
|
|
37
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/orange/orange_ComponentTheme_DarkTheme.module.css';
|
|
38
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/red/red_ComponentTheme_DarkTheme.module.css';
|
|
39
|
+
import '@zohodesk/components/assets/Appearance/dark/themes/yellow/yellow_ComponentTheme_DarkTheme.module.css';
|
|
40
|
+
import '@zohodesk/components/assets/Appearance/dark/mode/Component_DarkMode.module.css';
|
|
41
|
+
import '@zohodesk/components/assets/Contrast/darkContrastLightness.module.css';
|
|
42
|
+
/* component pkg - pure dark mode, themes */
|
|
43
|
+
|
|
44
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkTheme.module.css';
|
|
45
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkModifyCategory.module.css';
|
|
46
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkTheme.module.css';
|
|
47
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkModifyCategory.module.css';
|
|
48
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkTheme.module.css';
|
|
49
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkModifyCategory.module.css';
|
|
50
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkTheme.module.css';
|
|
51
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkModifyCategory.module.css';
|
|
52
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkTheme.module.css';
|
|
53
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkModifyCategory.module.css';
|
|
54
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/blue/blue_ComponentTheme_PureDarkTheme.module.css';
|
|
55
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/green/green_ComponentTheme_PureDarkTheme.module.css';
|
|
56
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/orange/orange_ComponentTheme_PureDarkTheme.module.css';
|
|
57
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/red/red_ComponentTheme_PureDarkTheme.module.css';
|
|
58
|
+
import '@zohodesk/components/assets/Appearance/pureDark/themes/yellow/yellow_ComponentTheme_PureDarkTheme.module.css';
|
|
59
|
+
import '@zohodesk/components/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css';
|
|
60
|
+
import '@zohodesk/components/assets/Contrast/pureDarkContrastLightness.module.css';
|
|
61
|
+
/** ** Desk Components Assets *** */
|
|
62
|
+
|
|
63
|
+
import '@zohodesk/variables/assets/colorVariables.module.css';
|
|
64
|
+
import '@zohodesk/variables/assets/dotVariables.module.css';
|
|
65
|
+
import '@zohodesk/variables/assets/sizeVariables.module.css';
|
|
66
|
+
import '@zohodesk/variables/assets/fontsizeVariables.module.css';
|
|
67
|
+
import '@zohodesk/variables/lib/fontFamilyVariables.module.css';
|
|
68
|
+
import '@zohodesk/variables/assets/transitionVariables.module.css';
|
|
69
|
+
import '@zohodesk/variables/assets/no_transitionVariables.module.css';
|
|
70
|
+
export default function DeskAssets(props) {
|
|
71
|
+
const {
|
|
72
|
+
children
|
|
73
|
+
} = props;
|
|
74
|
+
return children || null;
|
|
75
|
+
}
|
|
76
|
+
DeskAssets.propTypes = {
|
|
77
|
+
children: PropTypes.node
|
|
78
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
/** ** Libraries *** */
|
|
4
|
+
import React, { useMemo, useCallback } from 'react';
|
|
5
|
+
/** ** Constants *** */
|
|
6
|
+
|
|
7
|
+
import themeWrapperPropTypes from './props/propTypes';
|
|
8
|
+
import themeWrapperDefaultProps from './props/defaultProps';
|
|
9
|
+
import { styleTagId } from './constants';
|
|
10
|
+
import { MSG_ACTION_POPUP_PORTAL } from '../constants';
|
|
11
|
+
/** ** Components *** */
|
|
12
|
+
|
|
13
|
+
import ThemeAssets from './ThemeAssets';
|
|
14
|
+
import TooltipWrapper from './TooltipWrapper';
|
|
15
|
+
import { Container } from '@zohodesk/components/es/Layout';
|
|
16
|
+
/** ** Methods *** */
|
|
17
|
+
|
|
18
|
+
import getThemeConfigurations from './utils/getThemeConfigurations';
|
|
19
|
+
import getCustomizedCssVariables from './utils/getCustomizedCssVariables';
|
|
20
|
+
import getWrapperDivProps from './utils/getWrapperDivProps';
|
|
21
|
+
/** ** Fonts *** */
|
|
22
|
+
|
|
23
|
+
import '../Fonts/puviFont.module.css';
|
|
24
|
+
export default function ThemeWrapper(props) {
|
|
25
|
+
const {
|
|
26
|
+
children,
|
|
27
|
+
needThemeAssets,
|
|
28
|
+
needTooltip,
|
|
29
|
+
themeConfigurations: propThemeConfigurations,
|
|
30
|
+
mode: propMode,
|
|
31
|
+
theme: propTheme,
|
|
32
|
+
modeKey,
|
|
33
|
+
themeKey,
|
|
34
|
+
tooltipCustomStyle
|
|
35
|
+
} = props;
|
|
36
|
+
/** ** containerRef for Tooltip *** */
|
|
37
|
+
|
|
38
|
+
const containerRef = React.useRef(null);
|
|
39
|
+
const getContainerRef = useCallback(() => containerRef.current, []);
|
|
40
|
+
/** ** ThemeConfigurations Handling *** */
|
|
41
|
+
|
|
42
|
+
const {
|
|
43
|
+
themeConfigurations,
|
|
44
|
+
mode,
|
|
45
|
+
theme
|
|
46
|
+
} = getThemeConfigurations({
|
|
47
|
+
mode: propMode,
|
|
48
|
+
theme: propTheme
|
|
49
|
+
});
|
|
50
|
+
const configurations = propThemeConfigurations || themeConfigurations;
|
|
51
|
+
/** ** Style Handling *** */
|
|
52
|
+
|
|
53
|
+
const selector = `#${styleTagId}`;
|
|
54
|
+
const prefix = '--imlib_';
|
|
55
|
+
const configuration = useMemo(() => [configurations], [configurations]);
|
|
56
|
+
const customizedVariables = useMemo(() => getCustomizedCssVariables(configuration, prefix), [configuration, prefix]);
|
|
57
|
+
const wrapperDivProps = getWrapperDivProps({
|
|
58
|
+
modeKey,
|
|
59
|
+
themeKey,
|
|
60
|
+
mode,
|
|
61
|
+
theme
|
|
62
|
+
});
|
|
63
|
+
/** ** Children Render Functions *** */
|
|
64
|
+
|
|
65
|
+
const renderPortal = useCallback(() => /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
"data-portal": MSG_ACTION_POPUP_PORTAL
|
|
67
|
+
}), []);
|
|
68
|
+
const renderStyle = useCallback(() => /*#__PURE__*/React.createElement("style", {
|
|
69
|
+
id: "zoho-im-variables"
|
|
70
|
+
}, `${selector}{${customizedVariables}}`), [selector, customizedVariables]);
|
|
71
|
+
const renderAssets = useCallback(() => /*#__PURE__*/React.createElement(React.Fragment, null, needThemeAssets ? /*#__PURE__*/React.createElement(ThemeAssets, null) : null, needTooltip ? /*#__PURE__*/React.createElement(TooltipWrapper, {
|
|
72
|
+
containerRef: containerRef.current,
|
|
73
|
+
customStyle: tooltipCustomStyle,
|
|
74
|
+
getContainerRef: getContainerRef
|
|
75
|
+
}) : null), [getContainerRef, needTooltip, needThemeAssets, tooltipCustomStyle]);
|
|
76
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
77
|
+
id: styleTagId
|
|
78
|
+
}, wrapperDivProps, {
|
|
79
|
+
style: {
|
|
80
|
+
width: '100%',
|
|
81
|
+
height: '100%'
|
|
82
|
+
}
|
|
83
|
+
}), renderStyle(), /*#__PURE__*/React.createElement(Container, {
|
|
84
|
+
eleRef: containerRef
|
|
85
|
+
}, children), renderPortal(), renderAssets());
|
|
86
|
+
}
|
|
87
|
+
ThemeWrapper.propTypes = themeWrapperPropTypes;
|
|
88
|
+
ThemeWrapper.defaultProps = themeWrapperDefaultProps;
|