@zohodesk/components 1.2.4 → 1.2.6

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.
Files changed (202) hide show
  1. package/README.md +8 -0
  2. package/coverage/Button/Button.js.html +1 -1
  3. package/coverage/Button/css/Button.module.css.html +1 -1
  4. package/coverage/Button/css/cssJSLogic.js.html +1 -1
  5. package/coverage/Button/css/index.html +1 -1
  6. package/coverage/Button/index.html +1 -1
  7. package/coverage/Button/props/defaultProps.js.html +1 -1
  8. package/coverage/Button/props/index.html +1 -1
  9. package/coverage/Button/props/propTypes.js.html +1 -1
  10. package/coverage/Buttongroup/Buttongroup.js.html +1 -1
  11. package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
  12. package/coverage/Buttongroup/index.html +1 -1
  13. package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
  14. package/coverage/Buttongroup/props/index.html +1 -1
  15. package/coverage/Buttongroup/props/propTypes.js.html +1 -1
  16. package/coverage/index.html +1 -1
  17. package/coverage/utils/dummyFunction.js.html +1 -1
  18. package/coverage/utils/index.html +1 -1
  19. package/es/AppContainer/AppContainer.js +3 -0
  20. package/es/v1/Accordion/Accordion.js +65 -0
  21. package/es/v1/Accordion/AccordionItem.js +57 -0
  22. package/es/v1/Accordion/index.js +2 -0
  23. package/es/v1/Animation/Animation.js +127 -0
  24. package/es/v1/AppContainer/AppContainer.js +137 -0
  25. package/es/v1/Avatar/Avatar.js +189 -0
  26. package/es/v1/AvatarTeam/AvatarTeam.js +70 -0
  27. package/es/v1/Button/Button.js +68 -0
  28. package/es/v1/Buttongroup/Buttongroup.js +31 -0
  29. package/es/v1/Card/Card.js +271 -0
  30. package/es/v1/CheckBox/CheckBox.js +155 -0
  31. package/es/v1/DateTime/CalendarView.js +218 -0
  32. package/es/v1/DateTime/DateTime.js +783 -0
  33. package/es/v1/DateTime/DateTimePopupFooter.js +47 -0
  34. package/es/v1/DateTime/DateTimePopupHeader.js +105 -0
  35. package/es/v1/DateTime/DateWidget.js +1098 -0
  36. package/es/v1/DateTime/DaysRow.js +31 -0
  37. package/es/v1/DateTime/Time.js +166 -0
  38. package/es/v1/DateTime/YearView.js +264 -0
  39. package/es/v1/DateTime/index.js +1 -0
  40. package/es/v1/DropBox/DropBox.js +91 -0
  41. package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +132 -0
  42. package/es/v1/DropDown/DropDown.js +73 -0
  43. package/es/v1/DropDown/DropDownHeading.js +44 -0
  44. package/es/v1/DropDown/DropDownItem.js +76 -0
  45. package/es/v1/DropDown/DropDownSearch.js +63 -0
  46. package/es/v1/DropDown/DropDownSeparator.js +15 -0
  47. package/es/v1/Heading/Heading.js +32 -0
  48. package/es/v1/Label/Label.js +40 -0
  49. package/es/v1/Layout/Box.js +115 -0
  50. package/es/v1/Layout/Container.js +132 -0
  51. package/es/v1/Layout/index.js +2 -0
  52. package/es/v1/ListItem/ListContainer.js +102 -0
  53. package/es/v1/ListItem/ListItem.js +124 -0
  54. package/es/v1/ListItem/ListItemWithAvatar.js +145 -0
  55. package/es/v1/ListItem/ListItemWithCheckBox.js +104 -0
  56. package/es/v1/ListItem/ListItemWithIcon.js +127 -0
  57. package/es/v1/ListItem/ListItemWithRadio.js +105 -0
  58. package/es/v1/ListItem/index.js +6 -0
  59. package/es/v1/Modal/Modal.js +154 -0
  60. package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +1079 -0
  61. package/es/v1/MultiSelect/AdvancedMultiSelect.js +568 -0
  62. package/es/v1/MultiSelect/EmptyState.js +64 -0
  63. package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +50 -0
  64. package/es/v1/MultiSelect/MultiSelect.js +1120 -0
  65. package/es/v1/MultiSelect/MultiSelectHeader.js +32 -0
  66. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +216 -0
  67. package/es/v1/MultiSelect/SelectedOptions.js +82 -0
  68. package/es/v1/MultiSelect/Suggestions.js +142 -0
  69. package/es/v1/MultiSelect/index.js +4 -0
  70. package/es/v1/PopOver/PopOver.js +211 -0
  71. package/es/v1/Popup/Popup.js +645 -0
  72. package/es/v1/Radio/Radio.js +115 -0
  73. package/es/v1/Responsive/CustomResponsive.js +195 -0
  74. package/es/v1/Responsive/RefWrapper.js +39 -0
  75. package/es/v1/Responsive/ResizeComponent.js +197 -0
  76. package/es/v1/Responsive/ResizeObserver.js +140 -0
  77. package/es/v1/Responsive/Responsive.js +194 -0
  78. package/es/v1/Responsive/index.js +9 -0
  79. package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +58 -0
  80. package/es/v1/Ribbon/Ribbon.js +33 -0
  81. package/es/v1/RippleEffect/RippleEffect.js +24 -0
  82. package/es/v1/Select/GroupSelect.js +803 -0
  83. package/es/v1/Select/Select.js +969 -0
  84. package/es/v1/Select/SelectWithAvatar.js +344 -0
  85. package/es/v1/Select/SelectWithIcon.js +535 -0
  86. package/es/v1/Select/index.js +4 -0
  87. package/es/v1/Stencils/Stencils.js +26 -0
  88. package/es/v1/Switch/Switch.js +94 -0
  89. package/es/v1/Tab/Tab.js +108 -0
  90. package/es/v1/Tab/TabContent.js +30 -0
  91. package/es/v1/Tab/TabContentWrapper.js +29 -0
  92. package/es/v1/Tab/TabWrapper.js +57 -0
  93. package/es/v1/Tab/Tabs.js +612 -0
  94. package/es/v1/Tab/index.js +5 -0
  95. package/es/v1/Tag/Tag.js +134 -0
  96. package/es/v1/TextBox/TextBox.js +154 -0
  97. package/es/v1/TextBoxIcon/TextBoxIcon.js +158 -0
  98. package/es/v1/Textarea/Textarea.js +102 -0
  99. package/es/v1/Tooltip/Tooltip.js +518 -0
  100. package/es/v1/Typography/Typography.js +38 -0
  101. package/es/v1/Typography/css/Typography.module.css +376 -0
  102. package/es/v1/Typography/css/cssJSLogic.js +46 -0
  103. package/es/v1/Typography/css/letterSpacingMap.js +12 -0
  104. package/es/v1/Typography/props/defaultProps.js +8 -0
  105. package/es/v1/Typography/props/propTypes.js +24 -0
  106. package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +69 -0
  107. package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +100 -0
  108. package/es/v1/semantic/Button/Button.js +53 -0
  109. package/es/v1/semantic/index.js +1 -0
  110. package/lib/AppContainer/AppContainer.js +5 -0
  111. package/lib/v1/Accordion/Accordion.js +96 -0
  112. package/lib/v1/Accordion/AccordionItem.js +68 -0
  113. package/lib/v1/Accordion/index.js +23 -0
  114. package/lib/v1/Animation/Animation.js +143 -0
  115. package/lib/v1/AppContainer/AppContainer.js +209 -0
  116. package/lib/v1/Avatar/Avatar.js +246 -0
  117. package/lib/v1/AvatarTeam/AvatarTeam.js +81 -0
  118. package/lib/v1/Button/Button.js +82 -0
  119. package/lib/v1/Buttongroup/Buttongroup.js +44 -0
  120. package/lib/v1/Card/Card.js +365 -0
  121. package/lib/v1/CheckBox/CheckBox.js +166 -0
  122. package/lib/v1/DateTime/CalendarView.js +285 -0
  123. package/lib/v1/DateTime/DateTime.js +872 -0
  124. package/lib/v1/DateTime/DateTimePopupFooter.js +96 -0
  125. package/lib/v1/DateTime/DateTimePopupHeader.js +166 -0
  126. package/lib/v1/DateTime/DateWidget.js +1125 -0
  127. package/lib/v1/DateTime/DaysRow.js +80 -0
  128. package/lib/v1/DateTime/Time.js +254 -0
  129. package/lib/v1/DateTime/YearView.js +325 -0
  130. package/lib/v1/DateTime/index.js +15 -0
  131. package/lib/v1/DropBox/DropBox.js +119 -0
  132. package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +145 -0
  133. package/lib/v1/DropDown/DropDown.js +170 -0
  134. package/lib/v1/DropDown/DropDownHeading.js +93 -0
  135. package/lib/v1/DropDown/DropDownItem.js +127 -0
  136. package/lib/v1/DropDown/DropDownSearch.js +113 -0
  137. package/lib/v1/DropDown/DropDownSeparator.js +64 -0
  138. package/lib/v1/Heading/Heading.js +49 -0
  139. package/lib/v1/Label/Label.js +51 -0
  140. package/lib/v1/Layout/Box.js +128 -0
  141. package/lib/v1/Layout/Container.js +145 -0
  142. package/lib/v1/Layout/index.js +23 -0
  143. package/lib/v1/ListItem/ListContainer.js +120 -0
  144. package/lib/v1/ListItem/ListItem.js +138 -0
  145. package/lib/v1/ListItem/ListItemWithAvatar.js +162 -0
  146. package/lib/v1/ListItem/ListItemWithCheckBox.js +125 -0
  147. package/lib/v1/ListItem/ListItemWithIcon.js +143 -0
  148. package/lib/v1/ListItem/ListItemWithRadio.js +126 -0
  149. package/lib/v1/ListItem/index.js +55 -0
  150. package/lib/v1/Modal/Modal.js +212 -0
  151. package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +1167 -0
  152. package/lib/v1/MultiSelect/AdvancedMultiSelect.js +634 -0
  153. package/lib/v1/MultiSelect/EmptyState.js +112 -0
  154. package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +62 -0
  155. package/lib/v1/MultiSelect/MultiSelect.js +1201 -0
  156. package/lib/v1/MultiSelect/MultiSelectHeader.js +78 -0
  157. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +270 -0
  158. package/lib/v1/MultiSelect/SelectedOptions.js +126 -0
  159. package/lib/v1/MultiSelect/Suggestions.js +195 -0
  160. package/lib/v1/MultiSelect/index.js +39 -0
  161. package/lib/v1/PopOver/PopOver.js +293 -0
  162. package/lib/v1/Popup/Popup.js +715 -0
  163. package/lib/v1/Radio/Radio.js +126 -0
  164. package/lib/v1/Responsive/CustomResponsive.js +242 -0
  165. package/lib/v1/Responsive/RefWrapper.js +57 -0
  166. package/lib/v1/Responsive/ResizeComponent.js +268 -0
  167. package/lib/v1/Responsive/ResizeObserver.js +168 -0
  168. package/lib/v1/Responsive/Responsive.js +274 -0
  169. package/lib/v1/Responsive/index.js +55 -0
  170. package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +79 -0
  171. package/lib/v1/Ribbon/Ribbon.js +44 -0
  172. package/lib/v1/RippleEffect/RippleEffect.js +39 -0
  173. package/lib/v1/Select/GroupSelect.js +877 -0
  174. package/lib/v1/Select/Select.js +1013 -0
  175. package/lib/v1/Select/SelectWithAvatar.js +394 -0
  176. package/lib/v1/Select/SelectWithIcon.js +597 -0
  177. package/lib/v1/Select/index.js +39 -0
  178. package/lib/v1/Stencils/Stencils.js +43 -0
  179. package/lib/v1/Switch/Switch.js +108 -0
  180. package/lib/v1/Tab/Tab.js +132 -0
  181. package/lib/v1/Tab/TabContent.js +42 -0
  182. package/lib/v1/Tab/TabContentWrapper.js +42 -0
  183. package/lib/v1/Tab/TabWrapper.js +89 -0
  184. package/lib/v1/Tab/Tabs.js +680 -0
  185. package/lib/v1/Tab/index.js +47 -0
  186. package/lib/v1/Tag/Tag.js +154 -0
  187. package/lib/v1/TextBox/TextBox.js +168 -0
  188. package/lib/v1/TextBoxIcon/TextBoxIcon.js +196 -0
  189. package/lib/v1/Textarea/Textarea.js +118 -0
  190. package/lib/v1/Tooltip/Tooltip.js +586 -0
  191. package/lib/v1/Typography/Typography.js +56 -0
  192. package/lib/v1/Typography/css/Typography.module.css +376 -0
  193. package/lib/v1/Typography/css/cssJSLogic.js +41 -0
  194. package/lib/v1/Typography/css/letterSpacingMap.js +20 -0
  195. package/lib/v1/Typography/props/defaultProps.js +15 -0
  196. package/lib/v1/Typography/props/propTypes.js +35 -0
  197. package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +90 -0
  198. package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +126 -0
  199. package/lib/v1/semantic/Button/Button.js +63 -0
  200. package/lib/v1/semantic/index.js +15 -0
  201. package/package.json +1 -1
  202. package/result.json +1 -1
@@ -0,0 +1,108 @@
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
+ /* eslint-disable react/forbid-component-props */
4
+ import React, { useMemo, useCallback } from 'react';
5
+ import { Tab_defaultProps } from '../../Tab/props/defaultProps';
6
+ import { Tab_propTypes } from '../../Tab/props/propTypes';
7
+ import { Box, Container } from '../Layout';
8
+ import { cs } from '../../utils/Common';
9
+ import styles from '../../Tab/Tab.module.css';
10
+ const tabTypes = {
11
+ alpha: {
12
+ active: 'alphaActive',
13
+ tab: 'tabAlpha'
14
+ },
15
+ beta: {
16
+ active: 'betaActive',
17
+ tab: 'tabBeta'
18
+ },
19
+ delta: {
20
+ active: 'deltaActive',
21
+ tab: 'tabDelta'
22
+ }
23
+ };
24
+ export default function Tab(_ref) {
25
+ let {
26
+ id,
27
+ style,
28
+ text,
29
+ children,
30
+ className,
31
+ dataId,
32
+ dataSelectorId,
33
+ title,
34
+ titlePosition,
35
+ activeClass,
36
+ href,
37
+ isLink,
38
+ isDisabled,
39
+ tourId,
40
+ onClick,
41
+ isActive,
42
+ getTabRef,
43
+ onSelect,
44
+ type,
45
+ isAnimate,
46
+ needBorder,
47
+ needAppearance,
48
+ align,
49
+ isVirtual,
50
+ customProps
51
+ } = _ref;
52
+ let clickListener = useCallback(event => {
53
+ if (isLink && event && (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)) {
54
+ event && event.stopPropagation();
55
+ return;
56
+ }
57
+
58
+ event && event.preventDefault();
59
+ onSelect(id);
60
+ onClick && onClick(event);
61
+ }, [id, isLink, onSelect, onClick]);
62
+ let styleContent = useMemo(() => tabTypes[type] || {
63
+ active: 'active',
64
+ tab: 'tab'
65
+ }, [type]);
66
+ let getTab = useCallback(ref => getTabRef && getTabRef(id, ref, isVirtual), [id, isVirtual]);
67
+ let activeWithAppearance = cs([styles[styleContent.active], needBorder && !isAnimate && styles[`${styleContent.active}_border`]]);
68
+ let activeClasses = cs([needAppearance && activeWithAppearance, activeClass]);
69
+ let inActiveClasses = needAppearance && cs([styles[styleContent.tab], tabTypes[type] && styles[`${`${type}Hover`}`]]);
70
+ let tabClass = cs([styles.tab, align === 'vertical' ? styles.vertical : styles.horizontal, isDisabled && styles.disabled, needBorder && !isAnimate && needAppearance && styles.border, isActive ? activeClasses : inActiveClasses, className]);
71
+ return /*#__PURE__*/React.createElement(Box, _extends({
72
+ tourId: tourId,
73
+ tagName: isLink ? 'a' : 'div',
74
+ className: tabClass,
75
+ dataId: `${dataId}_Tab`,
76
+ onClick: !isDisabled ? clickListener : undefined,
77
+ style: style,
78
+ eleRef: getTab,
79
+ "data-title": title,
80
+ "data-title-position": titlePosition,
81
+ adjust: true,
82
+ href: isLink ? href : undefined,
83
+ "data-key": id,
84
+ role: "link",
85
+ "aria-controls": id,
86
+ "aria-selected": isActive ? true : false,
87
+ tabIndex: isLink ? undefined : isActive && !isDisabled ? '0' : '0',
88
+ "aria-label": text ? text : null,
89
+ dataSelectorId: dataSelectorId
90
+ }, customProps), /*#__PURE__*/React.createElement(Container, {
91
+ alignBox: "row",
92
+ align: "both",
93
+ className: styles.textContainer
94
+ }, text && /*#__PURE__*/React.createElement(Box, {
95
+ flexible: true,
96
+ adjust: true,
97
+ className: styles.tabText
98
+ }, text), children ? /*#__PURE__*/React.createElement(Box, {
99
+ shrink: true
100
+ }, children) : null));
101
+ }
102
+ Tab.defaultProps = Tab_defaultProps;
103
+ Tab.propTypes = Tab_propTypes; // if (__DOCS__) {
104
+ // Tab.docs = {
105
+ // componentGroup: 'Tab',
106
+ // folderName: 'Style Guide'
107
+ // };
108
+ // }
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { TabContent_defaultProps } from '../../Tab/props/defaultProps';
3
+ import { TabContent_propTypes } from '../../Tab/props/propTypes';
4
+ import { Container } from '../Layout';
5
+ import style from '../../Tab/TabContent.module.css';
6
+ /* eslint-disable react/forbid-component-props */
7
+
8
+ const TabContent = _ref => {
9
+ let {
10
+ children,
11
+ scroll,
12
+ dataId,
13
+ id,
14
+ dataSelectorId
15
+ } = _ref;
16
+ return /*#__PURE__*/React.createElement(Container, {
17
+ className: style.container,
18
+ scroll: scroll,
19
+ dataId: `${dataId}_TabContent`,
20
+ isScrollAttribute: true,
21
+ "aria-labelledby": id,
22
+ tabindex: "-1",
23
+ role: "tabpanel",
24
+ dataSelectorId: dataSelectorId
25
+ }, children);
26
+ };
27
+
28
+ TabContent.defaultProps = TabContent_defaultProps;
29
+ TabContent.propTypes = TabContent_propTypes;
30
+ export default TabContent;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { TabContentWrapper_defaultProps } from '../../Tab/props/defaultProps';
3
+ import { TabContentWrapper_propTypes } from '../../Tab/props/propTypes';
4
+ import { Box } from '../Layout';
5
+ /* eslint-disable react/forbid-component-props */
6
+
7
+ const TabContentWrapper = _ref => {
8
+ let {
9
+ style,
10
+ className,
11
+ children,
12
+ dataId,
13
+ selectedTab,
14
+ onScroll,
15
+ dataSelectorId
16
+ } = _ref;
17
+ return /*#__PURE__*/React.createElement(Box, {
18
+ flexible: true,
19
+ style: style,
20
+ dataId: dataId,
21
+ className: className,
22
+ onScroll: onScroll,
23
+ dataSelectorId: dataSelectorId
24
+ }, React.Children.map(children, child => /*#__PURE__*/React.isValidElement(child) && child.props.id === selectedTab ? child : null));
25
+ };
26
+
27
+ TabContentWrapper.defaultProps = TabContentWrapper_defaultProps;
28
+ TabContentWrapper.propTypes = TabContentWrapper_propTypes;
29
+ export default TabContentWrapper;
@@ -0,0 +1,57 @@
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
+ import React, { useState, useCallback } from 'react';
4
+ import { TabWrapper_defaultProps } from '../../Tab/props/defaultProps';
5
+ import { TabWrapper_propTypes } from '../../Tab/props/propTypes';
6
+ import { Container } from '../Layout';
7
+
8
+ function TabWrapper(_ref) {
9
+ let {
10
+ defaultTab,
11
+ hookToDisableInternalState,
12
+ onSelect,
13
+ type,
14
+ isAnimate,
15
+ needTabBorder,
16
+ needBorder,
17
+ needPadding,
18
+ needAppearance,
19
+ align,
20
+ dataId,
21
+ children,
22
+ dataSelectorId
23
+ } = _ref;
24
+ let [selectedTabInternal, setSelected] = useState(!hookToDisableInternalState ? defaultTab || 0 : null);
25
+ const setSelectedTab = useCallback(id => {
26
+ if (!hookToDisableInternalState) {
27
+ setSelected(id);
28
+ }
29
+
30
+ onSelect && onSelect(id);
31
+ }, [hookToDisableInternalState, onSelect]);
32
+ return /*#__PURE__*/React.createElement(Container, {
33
+ alignBox: align === 'vertical' ? 'column' : 'row',
34
+ dataId: dataId,
35
+ dataSelectorId: dataSelectorId
36
+ }, React.Children.map(children, child => {
37
+ let TabsChild = child.type;
38
+ let selectedTab = hookToDisableInternalState ? defaultTab : selectedTabInternal;
39
+ return /*#__PURE__*/React.createElement(TabsChild // eslint-disable-next-line react/no-array-index-key
40
+ , _extends({}, child.props, {
41
+ selectedTab: selectedTab,
42
+ onSelect: setSelectedTab,
43
+ type: type,
44
+ isAnimate: isAnimate,
45
+ needTabBorder: needTabBorder,
46
+ needBorder: needBorder,
47
+ needPadding: needPadding,
48
+ needAppearance: needAppearance,
49
+ hookToDisableInternalState: hookToDisableInternalState,
50
+ align: align
51
+ }));
52
+ }));
53
+ }
54
+
55
+ TabWrapper.propTypes = TabWrapper_propTypes;
56
+ TabWrapper.defaultProps = TabWrapper_defaultProps;
57
+ export default TabWrapper;