@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,120 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _Layout = require("../Layout");
13
+
14
+ var _CssProvider = _interopRequireDefault(require("../../Provider/CssProvider"));
15
+
16
+ var _ListItemModule = _interopRequireDefault(require("../../ListItem/ListItem.module.css"));
17
+
18
+ var _defaultProps = require("../../ListItem/props/defaultProps");
19
+
20
+ var _propTypes = require("../../ListItem/props/propTypes");
21
+
22
+ var _CustomResponsive = require("../Responsive/CustomResponsive");
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
+
26
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
+
28
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
+
30
+ 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); }
31
+
32
+ var ListContainer = function ListContainer(props) {
33
+ var size = props.size,
34
+ active = props.active,
35
+ highlight = props.highlight,
36
+ autoHover = props.autoHover,
37
+ palette = props.palette,
38
+ title = props.title,
39
+ disableTitle = props.disableTitle,
40
+ needTick = props.needTick,
41
+ isLink = props.isLink,
42
+ href = props.href,
43
+ target = props.target,
44
+ needBorder = props.needBorder,
45
+ isDisabled = props.isDisabled,
46
+ children = props.children,
47
+ dataId = props.dataId,
48
+ dataSelectorId = props.dataSelectorId,
49
+ a11y = props.a11y,
50
+ customClass = props.customClass,
51
+ customProps = props.customProps,
52
+ onClick = props.onClick,
53
+ onMouseEnter = props.onMouseEnter,
54
+ onMouseOver = props.onMouseOver,
55
+ eleRef = props.eleRef;
56
+ var responsiveFunc = (0, _react.useCallback)(function (_ref) {
57
+ var mediaQueryOR = _ref.mediaQueryOR,
58
+ isTouchDevice = _ref.isTouchDevice;
59
+ return {
60
+ mobileToTab: mediaQueryOR([{
61
+ maxWidth: 700
62
+ }]),
63
+ isTouchDevice: isTouchDevice
64
+ };
65
+ }, []);
66
+
67
+ var _useResponsiveReceive = (0, _CustomResponsive.useResponsiveReceiver)('Helmet', responsiveFunc),
68
+ mobileToTab = _useResponsiveReceive.mobileToTab,
69
+ isTouchDevice = _useResponsiveReceive.isTouchDevice;
70
+
71
+ var role = a11y.role,
72
+ ariaSelected = a11y.ariaSelected,
73
+ ariaLabel = a11y.ariaLabel,
74
+ _a11y$insetFocus = a11y.insetFocus,
75
+ insetFocus = _a11y$insetFocus === void 0 ? true : _a11y$insetFocus;
76
+ var options = {};
77
+
78
+ if (isLink) {
79
+ options.href = href;
80
+ options.target = "_".concat(target);
81
+ }
82
+
83
+ if (active) {
84
+ options['data-selected'] = active;
85
+ }
86
+
87
+ if (!isDisabled && !isLink) {
88
+ options.tabindex = '0';
89
+ }
90
+
91
+ return /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
92
+ role: role,
93
+ "data-a11y-inset-focus": insetFocus,
94
+ "aria-selected": ariaSelected,
95
+ "aria-label": ariaLabel,
96
+ isCover: false,
97
+ align: "vertical",
98
+ alignBox: "row",
99
+ className: "".concat(_ListItemModule["default"].list, " ").concat(_ListItemModule["default"][size], " ").concat(mobileToTab && isTouchDevice ? _ListItemModule["default"].responsiveHeight : '', " ").concat(_ListItemModule["default"][palette], " ").concat(active ? _ListItemModule["default"]["active".concat(palette)] : highlight && !isDisabled ? _ListItemModule["default"]["".concat(palette, "Hover")] : '', " ").concat(autoHover && !isDisabled ? _ListItemModule["default"]["".concat(palette, "Effect")] : '', " ").concat(needTick ? _ListItemModule["default"]["".concat(size, "withTick")] : '', " ").concat(isDisabled ? (0, _CssProvider["default"])('isDisable') : '', " ").concat(needBorder ? active ? _ListItemModule["default"].activewithBorder : _ListItemModule["default"].withBorder : '', " ").concat(customClass),
100
+ dataId: dataId,
101
+ dataSelectorId: dataSelectorId,
102
+ onClick: !isDisabled && onClick,
103
+ onMouseEnter: onMouseEnter,
104
+ onMouseOver: onMouseOver,
105
+ eleRef: eleRef,
106
+ tagName: isLink ? 'a' : 'li',
107
+ "data-title": isDisabled ? disableTitle : title
108
+ }, options, customProps), children);
109
+ };
110
+
111
+ ListContainer.defaultProps = _defaultProps.ListContainerDefaultProps;
112
+ ListContainer.propTypes = _propTypes.ListContainer_Props;
113
+ var _default = ListContainer; // if (__DOCS__) {
114
+ // ListContainer.docs = {
115
+ // componentGroup: 'Molecule',
116
+ // folderName: 'Style Guide'
117
+ // };
118
+ // }
119
+
120
+ exports["default"] = _default;
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _Layout = require("../Layout");
11
+
12
+ var _ListContainer = _interopRequireDefault(require("./ListContainer"));
13
+
14
+ var _defaultProps = require("../../ListItem/props/defaultProps");
15
+
16
+ var _propTypes = require("../../ListItem/props/propTypes");
17
+
18
+ var _icons = require("@zohodesk/icons");
19
+
20
+ var _ListItemModule = _interopRequireDefault(require("../../ListItem/ListItem.module.css"));
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
+
24
+ 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); }
25
+
26
+ 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; }
27
+
28
+ 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; }
29
+
30
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
+
32
+ var ListItem = function ListItem(props) {
33
+ var size = props.size,
34
+ active = props.active,
35
+ highlight = props.highlight,
36
+ value = props.value,
37
+ autoHover = props.autoHover,
38
+ palette = props.palette,
39
+ title = props.title,
40
+ disableTitle = props.disableTitle,
41
+ needTick = props.needTick,
42
+ isLink = props.isLink,
43
+ href = props.href,
44
+ target = props.target,
45
+ needBorder = props.needBorder,
46
+ isDisabled = props.isDisabled,
47
+ children = props.children,
48
+ dataId = props.dataId,
49
+ dataSelectorId = props.dataSelectorId,
50
+ a11y = props.a11y,
51
+ customClass = props.customClass,
52
+ customProps = props.customProps,
53
+ needMultiLineText = props.needMultiLineText,
54
+ getRef = props.getRef,
55
+ index = props.index,
56
+ id = props.id,
57
+ onClick = props.onClick,
58
+ onMouseEnter = props.onMouseEnter;
59
+
60
+ function handleRef(ele) {
61
+ getRef && getRef(ele, index, id);
62
+ }
63
+
64
+ function handleClick(e) {
65
+ onClick && onClick(id, value, index, e);
66
+ }
67
+
68
+ function handleMouseEnter(e) {
69
+ onMouseEnter && onMouseEnter(id, value, index, e);
70
+ }
71
+
72
+ var _customProps$ListItem = customProps.ListItemProps,
73
+ ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem,
74
+ _customProps$Containe = customProps.ContainerProps,
75
+ ContainerProps = _customProps$Containe === void 0 ? {} : _customProps$Containe;
76
+ var _customClass$customLi = customClass.customListItem,
77
+ customListItem = _customClass$customLi === void 0 ? '' : _customClass$customLi,
78
+ _customClass$customTi = customClass.customTickIcon,
79
+ customTickIcon = _customClass$customTi === void 0 ? '' : _customClass$customTi;
80
+
81
+ var listA11y = _objectSpread({
82
+ ariaHidden: true,
83
+ role: 'option'
84
+ }, a11y);
85
+
86
+ var ariaHidden = listA11y.ariaHidden;
87
+ var tickIconPalette = _ListItemModule["default"]["".concat(palette, "Tick")] ? _ListItemModule["default"]["".concat(palette, "Tick")] : '';
88
+ var dataIdString = dataId ? dataId : value ? String(value).replace("'", '_') : 'listItem';
89
+ return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
90
+ a11y: listA11y,
91
+ size: size,
92
+ palette: palette,
93
+ highlight: highlight,
94
+ isDisabled: isDisabled,
95
+ active: active,
96
+ autoHover: autoHover,
97
+ needTick: needTick,
98
+ needBorder: needBorder,
99
+ customClass: customListItem,
100
+ dataId: dataIdString,
101
+ dataSelectorId: "".concat(dataSelectorId),
102
+ isLink: isLink,
103
+ href: href,
104
+ target: target,
105
+ disableTitle: disableTitle,
106
+ title: title,
107
+ onClick: handleClick,
108
+ onMouseEnter: handleMouseEnter,
109
+ eleRef: handleRef,
110
+ customProps: ListItemProps
111
+ }, ContainerProps), value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
112
+ shrink: true,
113
+ adjust: true,
114
+ className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
115
+ }, value) : null, children ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
116
+ shrink: true,
117
+ adjust: true,
118
+ className: _ListItemModule["default"].children
119
+ }, children) : null, needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
120
+ className: "".concat(_ListItemModule["default"].tickIcon, " ").concat(tickIconPalette, " ").concat(customTickIcon),
121
+ "aria-hidden": ariaHidden,
122
+ dataId: "".concat(dataIdString, "_tickIcon"),
123
+ dataSelectorId: "".concat(dataSelectorId, "_tickIcon")
124
+ }, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
125
+ name: "ZD-ticknew",
126
+ size: "8"
127
+ })) : null);
128
+ };
129
+
130
+ var _default = ListItem;
131
+ exports["default"] = _default;
132
+ ListItem.defaultProps = _defaultProps.ListItemDefaultProps;
133
+ ListItem.propTypes = _propTypes.ListItem_Props; // if (__DOCS__) {
134
+ // ListItem.docs = {
135
+ // componentGroup: 'Molecule',
136
+ // folderName: 'Style Guide'
137
+ // };
138
+ // }
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _Layout = require("../Layout");
11
+
12
+ var _ListContainer = _interopRequireDefault(require("./ListContainer"));
13
+
14
+ var _defaultProps = require("../../ListItem/props/defaultProps");
15
+
16
+ var _propTypes = require("../../ListItem/props/propTypes");
17
+
18
+ var _Avatar = _interopRequireDefault(require("../Avatar/Avatar"));
19
+
20
+ var _AvatarTeam = _interopRequireDefault(require("../AvatarTeam/AvatarTeam"));
21
+
22
+ var _icons = require("@zohodesk/icons");
23
+
24
+ var _ListItemModule = _interopRequireDefault(require("../../ListItem/ListItem.module.css"));
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
+
28
+ 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); }
29
+
30
+ 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; }
31
+
32
+ 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; }
33
+
34
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
35
+
36
+ var ListItemWithAvatar = function ListItemWithAvatar(props) {
37
+ var size = props.size,
38
+ active = props.active,
39
+ highlight = props.highlight,
40
+ value = props.value,
41
+ name = props.name,
42
+ imgSrc = props.imgSrc,
43
+ autoHover = props.autoHover,
44
+ isTeam = props.isTeam,
45
+ palette = props.palette,
46
+ title = props.title,
47
+ needTick = props.needTick,
48
+ dataId = props.dataId,
49
+ dataSelectorId = props.dataSelectorId,
50
+ initial = props.initial,
51
+ isDisabled = props.isDisabled,
52
+ needBorder = props.needBorder,
53
+ disableTitle = props.disableTitle,
54
+ needAvatarTitle = props.needAvatarTitle,
55
+ avatarPalette = props.avatarPalette,
56
+ a11y = props.a11y,
57
+ customClass = props.customClass,
58
+ customProps = props.customProps,
59
+ needMultiLineText = props.needMultiLineText,
60
+ index = props.index,
61
+ id = props.id,
62
+ getRef = props.getRef,
63
+ onClick = props.onClick,
64
+ onMouseEnter = props.onMouseEnter;
65
+
66
+ function handleRef(ele) {
67
+ getRef && getRef(ele, index, id);
68
+ }
69
+
70
+ function handleClick(e) {
71
+ onClick && onClick(id, value, index, e);
72
+ }
73
+
74
+ function handleMouseEnter(e) {
75
+ onMouseEnter && onMouseEnter(id, value, index, e);
76
+ }
77
+
78
+ var _customProps$ListItem = customProps.ListItemProps,
79
+ ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem,
80
+ _customProps$Containe = customProps.ContainerProps,
81
+ ContainerProps = _customProps$Containe === void 0 ? {} : _customProps$Containe;
82
+ var _customClass$customLi = customClass.customListItem,
83
+ customListItem = _customClass$customLi === void 0 ? '' : _customClass$customLi,
84
+ _customClass$customAv = customClass.customAvatar,
85
+ customAvatar = _customClass$customAv === void 0 ? '' : _customClass$customAv,
86
+ _customClass$customAv2 = customClass.customAvatarTeam,
87
+ customAvatarTeam = _customClass$customAv2 === void 0 ? '' : _customClass$customAv2;
88
+
89
+ var listA11y = _objectSpread({
90
+ ariaHidden: true,
91
+ role: 'option'
92
+ }, a11y);
93
+
94
+ var ariaHidden = listA11y.ariaHidden;
95
+ var isDarkPalette = palette === 'dark';
96
+ var dataIdString = value ? value : dataId;
97
+ return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
98
+ a11y: listA11y,
99
+ size: size,
100
+ palette: palette,
101
+ highlight: highlight,
102
+ isDisabled: isDisabled,
103
+ active: active,
104
+ autoHover: autoHover,
105
+ needTick: needTick,
106
+ needBorder: needBorder,
107
+ customClass: customListItem,
108
+ dataId: "".concat(dataIdString, "_ListItemWithAvatar"),
109
+ dataSelectorId: "".concat(dataSelectorId),
110
+ onClick: handleClick,
111
+ onMouseEnter: handleMouseEnter,
112
+ eleRef: handleRef,
113
+ disableTitle: disableTitle,
114
+ title: null,
115
+ customProps: ListItemProps
116
+ }, ContainerProps), name || imgSrc ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
117
+ className: _ListItemModule["default"].leftAvatar
118
+ }, isTeam ? /*#__PURE__*/_react["default"].createElement(_AvatarTeam["default"], {
119
+ name: name,
120
+ size: "small",
121
+ src: imgSrc,
122
+ needTitle: needAvatarTitle,
123
+ textPalette: isDarkPalette ? 'white' : '',
124
+ palette: isDarkPalette ? 'info' : avatarPalette,
125
+ customClass: {
126
+ customAvatar: customAvatar,
127
+ customAvatarTeam: customAvatarTeam
128
+ }
129
+ }) : /*#__PURE__*/_react["default"].createElement(_Avatar["default"], {
130
+ name: name,
131
+ size: "small",
132
+ src: imgSrc,
133
+ initial: initial,
134
+ textPalette: isDarkPalette ? 'white' : '',
135
+ needTitle: needAvatarTitle,
136
+ palette: isDarkPalette ? 'info' : avatarPalette,
137
+ customClass: customAvatar
138
+ })) : null, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
139
+ flexible: true,
140
+ shrink: true,
141
+ "data-title": isDisabled ? null : title,
142
+ className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
143
+ }, value) : null, needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
144
+ className: _ListItemModule["default"].tickIcon,
145
+ "aria-hidden": ariaHidden,
146
+ dataId: "".concat(dataIdString, "_tickIcon"),
147
+ dataSelectorId: "".concat(dataSelectorId, "_tickIcon")
148
+ }, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
149
+ name: "ZD-ticknew",
150
+ size: "8"
151
+ })) : null);
152
+ };
153
+
154
+ var _default = ListItemWithAvatar;
155
+ exports["default"] = _default;
156
+ ListItemWithAvatar.defaultProps = _defaultProps.ListItemWithAvatarDefaultProps;
157
+ ListItemWithAvatar.propTypes = _propTypes.ListItemWithAvatar_Props; // if (__DOCS__) {
158
+ // ListItemWithAvatar.docs = {
159
+ // componentGroup: 'Molecule',
160
+ // folderName: 'Style Guide'
161
+ // };
162
+ // }
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _ListContainer = _interopRequireDefault(require("./ListContainer"));
11
+
12
+ var _defaultProps = require("../../ListItem/props/defaultProps");
13
+
14
+ var _propTypes = require("../../ListItem/props/propTypes");
15
+
16
+ var _CheckBox = _interopRequireDefault(require("../CheckBox/CheckBox"));
17
+
18
+ var _Layout = require("../Layout");
19
+
20
+ var _ListItemModule = _interopRequireDefault(require("../../ListItem/ListItem.module.css"));
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
+
24
+ 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); }
25
+
26
+ 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; }
27
+
28
+ 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; }
29
+
30
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
+
32
+ var ListItemWithCheckBox = function ListItemWithCheckBox(props) {
33
+ var size = props.size,
34
+ active = props.active,
35
+ highlight = props.highlight,
36
+ value = props.value,
37
+ checked = props.checked,
38
+ autoHover = props.autoHover,
39
+ palette = props.palette,
40
+ dataId = props.dataId,
41
+ dataSelectorId = props.dataSelectorId,
42
+ title = props.title,
43
+ isDisabled = props.isDisabled,
44
+ disableTitle = props.disableTitle,
45
+ a11y = props.a11y,
46
+ customClass = props.customClass,
47
+ customProps = props.customProps,
48
+ needMultiLineText = props.needMultiLineText,
49
+ id = props.id,
50
+ index = props.index,
51
+ onHover = props.onHover,
52
+ onClick = props.onClick,
53
+ getRef = props.getRef;
54
+
55
+ function handleRef(ele) {
56
+ getRef && getRef(ele, index);
57
+ }
58
+
59
+ function handleClick(e) {
60
+ onClick && onClick(id, value, index, e);
61
+ }
62
+
63
+ function handleHover(e) {
64
+ onHover && onHover(id, value, index, e);
65
+ }
66
+
67
+ var listA11y = _objectSpread({
68
+ role: 'option'
69
+ }, a11y);
70
+
71
+ var _customProps$ListItem = customProps.ListItemProps,
72
+ ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem,
73
+ _customProps$Containe = customProps.ContainerProps,
74
+ ContainerProps = _customProps$Containe === void 0 ? {} : _customProps$Containe;
75
+ var _customClass$customLi = customClass.customListItem,
76
+ customListItem = _customClass$customLi === void 0 ? '' : _customClass$customLi,
77
+ _customClass$customCh = customClass.customCheckBox,
78
+ customCheckBox = _customClass$customCh === void 0 ? '' : _customClass$customCh,
79
+ _customClass$customLa = customClass.customLabel,
80
+ customLabel = _customClass$customLa === void 0 ? '' : _customClass$customLa;
81
+ return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
82
+ a11y: listA11y,
83
+ size: size,
84
+ palette: palette,
85
+ highlight: highlight,
86
+ isDisabled: isDisabled,
87
+ active: active,
88
+ autoHover: autoHover,
89
+ customClass: customListItem,
90
+ dataId: "".concat(dataId ? dataId : value, "_ListItemWithCheckBox"),
91
+ dataSelectorId: dataSelectorId,
92
+ onClick: handleClick,
93
+ onMouseOver: handleHover,
94
+ eleRef: handleRef,
95
+ disableTitle: disableTitle,
96
+ title: null,
97
+ customProps: ListItemProps
98
+ }, ContainerProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
99
+ className: _ListItemModule["default"].iconBox
100
+ }, /*#__PURE__*/_react["default"].createElement(_CheckBox["default"], {
101
+ checked: checked,
102
+ a11y: {
103
+ ariaHidden: true
104
+ },
105
+ customClass: {
106
+ customCheckBox: customCheckBox,
107
+ customLabel: customLabel
108
+ }
109
+ })), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
110
+ flexible: true,
111
+ shrink: true,
112
+ "data-title": isDisabled ? null : title,
113
+ className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
114
+ }, value));
115
+ };
116
+
117
+ var _default = ListItemWithCheckBox;
118
+ exports["default"] = _default;
119
+ ListItemWithCheckBox.defaultProps = _defaultProps.ListItemWithCheckBoxDefaultProps;
120
+ ListItemWithCheckBox.propTypes = _propTypes.ListItemWithCheckBox_Props; // if (__DOCS__) {
121
+ // ListItemWithCheckBox.docs = {
122
+ // componentGroup: 'Molecule',
123
+ // folderName: 'Style Guide'
124
+ // };
125
+ // }