@zohoim/chat-components 1.1.1-beta.2 → 1.1.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,9 +10,13 @@ In this Library, We Provide Some Basic Message Components to Build Your Chat App
10
10
 
11
11
  > import MessageBubble from '@zohoim/chat-components/es/MessageBubble/MessageBubble’;
12
12
 
13
+ # 1.1.2
14
+
15
+ - Color contrast support added for components
16
+
13
17
  # 1.1.1
14
18
 
15
- - **@zohoim/chat-components-utils** package updated
19
+ - **@zohoim/chat-components-utils** version updated
16
20
 
17
21
  # 1.1.0
18
22
 
@@ -53,10 +53,14 @@ export default function ActionIconWrapper(props) {
53
53
  id
54
54
  });
55
55
  return icon ? /*#__PURE__*/React.createElement("div", {
56
+ "aria-label": title,
56
57
  className: actionIconWrapperClass,
58
+ "data-a11y-focus": "true",
57
59
  "data-title": title,
58
60
  onClick: onClick,
59
- onMouseEnter: onMouseEnter
61
+ onMouseEnter: onMouseEnter,
62
+ role: "menuitem",
63
+ tabIndex: 0
60
64
  }, icon) : null;
61
65
  }
62
66
  ActionIconWrapper.propTypes = actionIconWrapperPropTypes;
@@ -71,6 +71,9 @@ export default function AttachmentHandler(props) {
71
71
  return /*#__PURE__*/React.createElement(Container, {
72
72
  alignBox: "column"
73
73
  }, customIcon || /*#__PURE__*/React.createElement(IconButton, {
74
+ a11y: {
75
+ ariaLabel: iconTitle
76
+ },
74
77
  className: newStyle.iconButton,
75
78
  iconClass: newStyle.icon,
76
79
  iconName: iconName,
package/es/Emoji/Emoji.js CHANGED
@@ -58,8 +58,12 @@ export default function Emoji(props) {
58
58
  });
59
59
  return /*#__PURE__*/React.createElement("span", {
60
60
  ref: eleRef,
61
+ "aria-label": title,
61
62
  className: emojiClass,
62
- onClick: onSelect
63
+ "data-a11y-focus": "true",
64
+ onClick: onSelect,
65
+ role: "button",
66
+ tabIndex: 0
63
67
  }, /*#__PURE__*/React.createElement("span", {
64
68
  className: newStyle.emojiContent,
65
69
  "data-smiley": emojiName,
@@ -83,7 +83,10 @@ function EmojiPopupComp(props) {
83
83
  isActive: isPopupOpen,
84
84
  onClick: onTogglePopup,
85
85
  title: tooltip,
86
- ...iconProps
86
+ ...iconProps,
87
+ a11y: {
88
+ ariaLabel: tooltip
89
+ }
87
90
  }), isPopupOpen ? /*#__PURE__*/React.createElement(DropBox, {
88
91
  boxPosition: position,
89
92
  customClass: popupClass,
@@ -4,7 +4,6 @@
4
4
  }
5
5
 
6
6
  .tabIcon {
7
- /* padding: var(--zd_size10) var(--zd_size16); */
8
7
  position: relative;
9
8
  height: var(--zd_size35) ;
10
9
  display: flex;
@@ -36,5 +35,5 @@
36
35
  width: auto ;
37
36
  height: auto ;
38
37
  margin: 0 ;
39
- padding: 8% ;
38
+ padding: 0 8% ;
40
39
  }
@@ -29,7 +29,8 @@ export default function MessageActions(props) {
29
29
  setRetainMessageActions,
30
30
  renderSecondaryActions,
31
31
  customStyle,
32
- customProps
32
+ customProps,
33
+ moreTitle
33
34
  } = props;
34
35
  const {
35
36
  messageActionProps = dummyObject,
@@ -106,6 +107,7 @@ export default function MessageActions(props) {
106
107
  }, /*#__PURE__*/React.createElement(MoreIcon, null)), [newStyle.moreIcon]);
107
108
  const renderMore = useCallback(componentProps => /*#__PURE__*/React.createElement(ActionIconWrapper, {
108
109
  renderIcon: renderMoreIcon,
110
+ title: moreTitle,
109
111
  ...componentProps,
110
112
  ...actionIconWrapperProps
111
113
  }), [actionIconWrapperProps, renderMoreIcon]);
@@ -21,6 +21,7 @@ const messageActionsPropTypes = {
21
21
  customStyle: PropTypes.object,
22
22
  defaultShowCount: PropTypes.number,
23
23
  renderSecondaryActions: PropTypes.func,
24
- setRetainMessageActions: PropTypes.func
24
+ setRetainMessageActions: PropTypes.func,
25
+ moreTitle: PropTypes.string
25
26
  };
26
27
  export default messageActionsPropTypes;
@@ -20,6 +20,7 @@ import { Box } from '@zohodesk/components/es/Layout';
20
20
  /** ** Styles *** */
21
21
 
22
22
  import style from "./css/MessageBubble.module.css";
23
+ import generateUniqueId from '@zohoim/chat-components-utils/es/common/generateUniqueId';
23
24
  export default function MessageBubble(props) {
24
25
  const {
25
26
  renderMessageBox,
@@ -39,7 +40,9 @@ export default function MessageBubble(props) {
39
40
  const {
40
41
  onMouseEnter,
41
42
  onMouseLeave,
42
- isRenderMessageActions
43
+ isRenderMessageActions,
44
+ onFocus,
45
+ onBlur
43
46
  } = useMessageBubbleAction(props);
44
47
  /* css classnames added based on logic */
45
48
 
@@ -67,7 +70,9 @@ export default function MessageBubble(props) {
67
70
  const messageActionsRenderer = useCallback(() => {
68
71
  const messageActions = isRenderMessageActions ? renderHandler(renderMessageActions)() : null;
69
72
  return messageActions ? /*#__PURE__*/React.createElement(Box, {
70
- className: messageActionWrapperClass
73
+ className: messageActionWrapperClass,
74
+ role: "button",
75
+ tabIndex: "0"
71
76
  }, messageActions) : null;
72
77
  }, [isRenderMessageActions, renderMessageActions, messageActionWrapperClass]);
73
78
  /* Message Box Render */
@@ -84,12 +89,16 @@ export default function MessageBubble(props) {
84
89
 
85
90
  const messageBox = useMemo(() => messageBoxRenderer(), [messageBoxRenderer]);
86
91
  const messageActions = useMemo(() => messageActionsRenderer(), [messageActionsRenderer]);
92
+ const uniqueId = generateUniqueId();
87
93
  const messageBoxWithActionsRenderer = useCallback(() => messageBox || messageActions ? /*#__PURE__*/React.createElement(Box, {
88
94
  className: newStyle.messageContainer
89
95
  }, /*#__PURE__*/React.createElement(Box, {
90
96
  className: newStyle.messageBoxWrapper,
91
97
  flexible: true
92
- }, messageBox, messageActions)) : null, [messageBox, messageActions, newStyle.messageContainer, newStyle.messageBoxWrapper]);
98
+ }, messageBox, /*#__PURE__*/React.createElement("div", {
99
+ id: uniqueId,
100
+ role: "menu"
101
+ }, messageActions))) : null, [messageBox, messageActions, newStyle.messageContainer, newStyle.messageBoxWrapper, uniqueId]);
93
102
  /* Message Footer Render */
94
103
 
95
104
  const messageFooterRenderer = useCallback(() => {
@@ -106,9 +115,16 @@ export default function MessageBubble(props) {
106
115
  /* Construct Layout */
107
116
 
108
117
  const messageLayout = /*#__PURE__*/React.createElement("div", {
118
+ "aria-controls": uniqueId,
119
+ "aria-expanded": isRenderMessageActions ? 'true' : 'false',
120
+ "aria-haspopup": "true",
109
121
  className: bubbleClass,
122
+ onBlur: onBlur,
123
+ onFocus: onFocus,
110
124
  onMouseEnter: onMouseEnter,
111
- onMouseLeave: onMouseLeave
125
+ onMouseLeave: onMouseLeave,
126
+ role: "button",
127
+ tabIndex: 0
112
128
  }, messageSender, messageBoxWithActions, messageFooter);
113
129
  return messageLayout;
114
130
  }
@@ -50,6 +50,10 @@ export default function MoreActionItem(props) {
50
50
  id
51
51
  });
52
52
  return /*#__PURE__*/React.createElement(ListContainer, {
53
+ a11y: {
54
+ 'data-a11y-focus': true,
55
+ 'data-a11y-click': true
56
+ },
53
57
  autoHover: true,
54
58
  customClass: newStyle.listItem,
55
59
  disableTitle: title,
@@ -39,9 +39,12 @@ export default function TextBubble(props) {
39
39
  // __html: HTMLPurifier.sanitize(message)
40
40
  __html: message
41
41
  }
42
- }), moreText ? /*#__PURE__*/React.createElement("div", {
42
+ }), moreText ? /*#__PURE__*/React.createElement("button", {
43
43
  className: moreTextClass,
44
- onClick: onClickMore
44
+ "data-a11y-click": "true",
45
+ "data-a11y-focus": "true",
46
+ onClick: onClickMore,
47
+ tabIndex: "0"
45
48
  }, moreText) : null);
46
49
  }
47
50
  TextBubble.propTypes = textBubblePropTypes;
@@ -9,6 +9,7 @@
9
9
 
10
10
  .moreText {
11
11
  color: var(--imlib_chat_components_textBubble_see_more_color);
12
+ composes: buttonReset from '~@zohodesk/components/es/semantic/Button/semanticButton.module.css';
12
13
  cursor: pointer;
13
14
  }
14
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/chat-components",
3
- "version": "1.1.1-beta.2",
3
+ "version": "1.1.2-beta.1",
4
4
  "description": "Chat Components",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -42,8 +42,8 @@
42
42
  "@zohodesk/utils": "1.3.13",
43
43
  "@zohodesk/variables": "1.0.0",
44
44
  "@zohodesk/virtualizer": "1.0.13",
45
- "@zohoim/chat-components-hooks": "1.1.1-beta.2",
46
- "@zohoim/chat-components-utils": "1.1.1-beta.2"
45
+ "@zohoim/chat-components-hooks": "1.1.2-beta.1",
46
+ "@zohoim/chat-components-utils": "1.1.2-beta.1"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@zohodesk-private/color-variable-preprocessor": "1.2.1",
@@ -52,5 +52,5 @@
52
52
  "jsdom": "23.0.0",
53
53
  "react-to-jsx": "1.3.2"
54
54
  },
55
- "gitHead": "626644b2b66a2e3053c2bf15a791e29bd28c4287"
55
+ "gitHead": "6c8e910485f7b1e0f710ced9ab0bfad331866493"
56
56
  }