@zohodesk/components 1.0.0-alpha-225 → 1.0.0-alpha-226

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 (234) hide show
  1. package/README.md +4 -0
  2. package/es/ListItem/ListContainer.js +123 -0
  3. package/es/ListItem/ListItem.js +23 -31
  4. package/es/ListItem/ListItemWithAvatar.js +21 -27
  5. package/es/ListItem/ListItemWithCheckBox.js +23 -29
  6. package/es/ListItem/ListItemWithIcon.js +26 -26
  7. package/es/ListItem/ListItemWithRadio.js +24 -31
  8. package/lib/ListItem/ListContainer.js +132 -0
  9. package/lib/ListItem/ListItem.js +25 -32
  10. package/lib/ListItem/ListItemWithAvatar.js +23 -28
  11. package/lib/ListItem/ListItemWithCheckBox.js +24 -27
  12. package/lib/ListItem/ListItemWithIcon.js +27 -26
  13. package/lib/ListItem/ListItemWithRadio.js +26 -27
  14. package/package.json +3 -3
  15. package/README_Beta.md +0 -2
  16. package/__testUtils__/globals.js +0 -46
  17. package/__testUtils__/moduleMapKey.json +0 -138
  18. package/dubFinder.js +0 -96
  19. package/es/Accordion/docs/Accordion__Demo.docs.js +0 -80
  20. package/es/Animation/docs/Animation__default.docs.js +0 -34
  21. package/es/Animation/docs/Animation__fadeIn.docs.js +0 -34
  22. package/es/Animation/docs/Animation__scaleIn.docs.js +0 -34
  23. package/es/Animation/docs/Animation__skewIn.docs.js +0 -34
  24. package/es/Animation/docs/Animation__slideDown.docs.js +0 -34
  25. package/es/Animation/docs/Animation__slideLeft.docs.js +0 -34
  26. package/es/Animation/docs/Animation__zoomIn.docs.js +0 -34
  27. package/es/AppContainer/docs/AppContainer__default.docs.js +0 -20
  28. package/es/Avatar/docs/Avatar__custom.docs.js +0 -29
  29. package/es/Avatar/docs/Avatar__default.docs.js +0 -29
  30. package/es/Avatar/docs/Avatar__palette.docs.js +0 -49
  31. package/es/Avatar/docs/Avatar__text.docs.js +0 -28
  32. package/es/AvatarTeam/docs/AvatarTeam__custom.docs.js +0 -73
  33. package/es/AvatarTeam/docs/AvatarTeam__default.docs.js +0 -31
  34. package/es/AvatarTeam/docs/AvatarTeam__palette.docs.js +0 -50
  35. package/es/AvatarTeam/docs/AvatarTeam__size.docs.js +0 -49
  36. package/es/Button/docs/Button__custom.docs.js +0 -771
  37. package/es/Button/docs/Button__default.docs.js +0 -536
  38. package/es/Buttongroup/docs/Buttongroup__custom.docs.js +0 -37
  39. package/es/Buttongroup/docs/Buttongroup__footer.docs.js +0 -33
  40. package/es/Buttongroup/docs/Buttongroup__header.docs.js +0 -42
  41. package/es/Card/docs/Card__Custom.docs.js +0 -34
  42. package/es/Card/docs/Card__Default.docs.js +0 -37
  43. package/es/Card/docs/Card__Scroll.docs.js +0 -59
  44. package/es/CheckBox/docs/CheckBox__custom.docs.js +0 -293
  45. package/es/CheckBox/docs/CheckBox__default.docs.js +0 -219
  46. package/es/DateTime/docs/DateTime__default.docs.js +0 -91
  47. package/es/DateTime/docs/DateWidget__default.docs.js +0 -183
  48. package/es/DateTime/docs/timezonedata.json +0 -1
  49. package/es/DropBox/docs/DropBox__custom.docs.js +0 -66
  50. package/es/DropBox/docs/DropBox__customOrder.docs.js +0 -92
  51. package/es/DropBox/docs/DropBox__fixedPosition.docs.js +0 -91
  52. package/es/DropBox/docs/DropBox__position.docs.js +0 -87
  53. package/es/DropBox/docs/DropBox__size.docs.js +0 -61
  54. package/es/DropDown/docs/DropDownHeading__custom.docs.js +0 -23
  55. package/es/DropDown/docs/DropDownHeading__default.docs.js +0 -21
  56. package/es/Label/docs/Label__clipped.docs.js +0 -27
  57. package/es/Label/docs/Label__custom.docs.js +0 -30
  58. package/es/Label/docs/Label__palette.docs.js +0 -42
  59. package/es/Label/docs/Label__size.docs.js +0 -29
  60. package/es/Label/docs/Label__type.docs.js +0 -37
  61. package/es/Layout/docs/Layout__Hidden.docs.js +0 -77
  62. package/es/Layout/docs/Layout__default.docs.js +0 -49
  63. package/es/Layout/docs/Layout__four_Column.docs.js +0 -85
  64. package/es/Layout/docs/Layout__three_Column.docs.js +0 -76
  65. package/es/Layout/docs/Layout__two_Column.docs.js +0 -69
  66. package/es/LightNightMode/docs/AlternativeColors.docs.js +0 -74
  67. package/es/ListItem/docs/ListItemWithAvatar__custom.docs.js +0 -155
  68. package/es/ListItem/docs/ListItemWithAvatar__default.docs.js +0 -112
  69. package/es/ListItem/docs/ListItemWithCheckBox__custom.docs.js +0 -91
  70. package/es/ListItem/docs/ListItemWithCheckBox__default.docs.js +0 -65
  71. package/es/ListItem/docs/ListItemWithIcon__custom.docs.js +0 -68
  72. package/es/ListItem/docs/ListItemWithIcon__default.docs.js +0 -62
  73. package/es/ListItem/docs/ListItemWithRadio__custom.docs.js +0 -91
  74. package/es/ListItem/docs/ListItemWithRadio__default.docs.js +0 -65
  75. package/es/ListItem/docs/ListItem__custom.docs.js +0 -114
  76. package/es/ListItem/docs/ListItem__default.docs.js +0 -82
  77. package/es/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +0 -125
  78. package/es/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +0 -114
  79. package/es/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +0 -141
  80. package/es/MultiSelect/docs/MultiSelect__default.docs.js +0 -161
  81. package/es/PopOver/docs/PopOver__default.docs.js +0 -32
  82. package/es/Provider/docs/Provider_Id__Class.docs.js +0 -29
  83. package/es/Provider/docs/Provider_Id__Function.docs.js +0 -18
  84. package/es/Provider/docs/Provider_Zindex__Class.docs.js +0 -32
  85. package/es/Provider/docs/Provider_Zindex__Function.docs.js +0 -23
  86. package/es/Radio/docs/Radio__custom.docs.js +0 -245
  87. package/es/Radio/docs/Radio__default.docs.js +0 -169
  88. package/es/Responsive/docs/Responsive__Custom.docs.js +0 -206
  89. package/es/Responsive/docs/Responsive__default.docs.js +0 -97
  90. package/es/Responsive/docs/style.module.css +0 -56
  91. package/es/Ribbon/docs/Ribbon__custom.docs.js +0 -386
  92. package/es/Ribbon/docs/Ribbon__default.docs.js +0 -342
  93. package/es/RippleEffect/docs/RippleEffect__default.docs.js +0 -435
  94. package/es/Select/docs/GroupSelect__default.docs.js +0 -149
  95. package/es/Select/docs/SelectWithAvatar__default.docs.js +0 -97
  96. package/es/Select/docs/SelectWithIcon__default.docs.js +0 -138
  97. package/es/Select/docs/Select__default.docs.js +0 -288
  98. package/es/Stencils/docs/Stencils__custom.docs.js +0 -45
  99. package/es/Stencils/docs/Stencils__default.docs.js +0 -50
  100. package/es/Switch/docs/Switch__custom.docs.js +0 -153
  101. package/es/Switch/docs/Switch__default.docs.js +0 -107
  102. package/es/Tab/docs/Tab__default.docs.js +0 -258
  103. package/es/Tab/docs/tabdocs.module.css +0 -29
  104. package/es/Tag/docs/Tag__custom.docs.js +0 -368
  105. package/es/Tag/docs/Tag__default.docs.js +0 -253
  106. package/es/TextBox/docs/TextBox__custom.docs.js +0 -43
  107. package/es/TextBox/docs/TextBox__default.docs.js +0 -40
  108. package/es/TextBox/docs/TextBox__size.docs.js +0 -38
  109. package/es/TextBox/docs/TextBox__variant.docs.js +0 -38
  110. package/es/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +0 -89
  111. package/es/TextBoxIcon/docs/TextBoxIcon__default.docs.js +0 -61
  112. package/es/Textarea/docs/Textarea__animated.docs.js +0 -41
  113. package/es/Textarea/docs/Textarea__custom.docs.js +0 -82
  114. package/es/Textarea/docs/Textarea__default.docs.js +0 -76
  115. package/es/Textarea/docs/Textarea__disabled.docs.js +0 -29
  116. package/es/Tooltip/docs/Tooltip__default.docs.js +0 -332
  117. package/es/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +0 -97
  118. package/es/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +0 -150
  119. package/es/a11y/FocusScope/docs/FocusScope__default.docs.js +0 -139
  120. package/es/beta/FocusRing/docs/FocusRing__default.docs.js +0 -48
  121. package/es/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +0 -72
  122. package/es/semantic/Button/docs/Button__default.docs.js +0 -20
  123. package/externalDocsBuild.js +0 -21
  124. package/lib/Accordion/docs/Accordion__Demo.docs.js +0 -126
  125. package/lib/Animation/docs/Animation__default.docs.js +0 -85
  126. package/lib/Animation/docs/Animation__fadeIn.docs.js +0 -85
  127. package/lib/Animation/docs/Animation__scaleIn.docs.js +0 -85
  128. package/lib/Animation/docs/Animation__skewIn.docs.js +0 -85
  129. package/lib/Animation/docs/Animation__slideDown.docs.js +0 -85
  130. package/lib/Animation/docs/Animation__slideLeft.docs.js +0 -85
  131. package/lib/Animation/docs/Animation__zoomIn.docs.js +0 -85
  132. package/lib/AppContainer/docs/AppContainer__default.docs.js +0 -70
  133. package/lib/Avatar/docs/Avatar__custom.docs.js +0 -87
  134. package/lib/Avatar/docs/Avatar__default.docs.js +0 -83
  135. package/lib/Avatar/docs/Avatar__palette.docs.js +0 -107
  136. package/lib/Avatar/docs/Avatar__text.docs.js +0 -86
  137. package/lib/AvatarTeam/docs/AvatarTeam__custom.docs.js +0 -124
  138. package/lib/AvatarTeam/docs/AvatarTeam__default.docs.js +0 -82
  139. package/lib/AvatarTeam/docs/AvatarTeam__palette.docs.js +0 -101
  140. package/lib/AvatarTeam/docs/AvatarTeam__size.docs.js +0 -100
  141. package/lib/Button/docs/Button__custom.docs.js +0 -826
  142. package/lib/Button/docs/Button__default.docs.js +0 -590
  143. package/lib/Buttongroup/docs/Buttongroup__custom.docs.js +0 -89
  144. package/lib/Buttongroup/docs/Buttongroup__footer.docs.js +0 -85
  145. package/lib/Buttongroup/docs/Buttongroup__header.docs.js +0 -98
  146. package/lib/Card/docs/Card__Custom.docs.js +0 -90
  147. package/lib/Card/docs/Card__Default.docs.js +0 -92
  148. package/lib/Card/docs/Card__Scroll.docs.js +0 -114
  149. package/lib/CheckBox/docs/CheckBox__custom.docs.js +0 -348
  150. package/lib/CheckBox/docs/CheckBox__default.docs.js +0 -273
  151. package/lib/DateTime/docs/DateTime__default.docs.js +0 -142
  152. package/lib/DateTime/docs/DateWidget__default.docs.js +0 -240
  153. package/lib/DateTime/docs/timezonedata.json +0 -1
  154. package/lib/DropBox/docs/DropBox__custom.docs.js +0 -122
  155. package/lib/DropBox/docs/DropBox__customOrder.docs.js +0 -141
  156. package/lib/DropBox/docs/DropBox__fixedPosition.docs.js +0 -140
  157. package/lib/DropBox/docs/DropBox__position.docs.js +0 -142
  158. package/lib/DropBox/docs/DropBox__size.docs.js +0 -116
  159. package/lib/DropDown/docs/DropDownHeading__custom.docs.js +0 -73
  160. package/lib/DropDown/docs/DropDownHeading__default.docs.js +0 -70
  161. package/lib/Label/docs/Label__clipped.docs.js +0 -81
  162. package/lib/Label/docs/Label__custom.docs.js +0 -85
  163. package/lib/Label/docs/Label__palette.docs.js +0 -96
  164. package/lib/Label/docs/Label__size.docs.js +0 -83
  165. package/lib/Label/docs/Label__type.docs.js +0 -91
  166. package/lib/Layout/docs/Layout__Hidden.docs.js +0 -127
  167. package/lib/Layout/docs/Layout__default.docs.js +0 -98
  168. package/lib/Layout/docs/Layout__four_Column.docs.js +0 -135
  169. package/lib/Layout/docs/Layout__three_Column.docs.js +0 -126
  170. package/lib/Layout/docs/Layout__two_Column.docs.js +0 -119
  171. package/lib/LightNightMode/docs/AlternativeColors.docs.js +0 -131
  172. package/lib/ListItem/docs/ListItemWithAvatar__custom.docs.js +0 -206
  173. package/lib/ListItem/docs/ListItemWithAvatar__default.docs.js +0 -162
  174. package/lib/ListItem/docs/ListItemWithCheckBox__custom.docs.js +0 -142
  175. package/lib/ListItem/docs/ListItemWithCheckBox__default.docs.js +0 -115
  176. package/lib/ListItem/docs/ListItemWithIcon__custom.docs.js +0 -119
  177. package/lib/ListItem/docs/ListItemWithIcon__default.docs.js +0 -112
  178. package/lib/ListItem/docs/ListItemWithRadio__custom.docs.js +0 -142
  179. package/lib/ListItem/docs/ListItemWithRadio__default.docs.js +0 -115
  180. package/lib/ListItem/docs/ListItem__custom.docs.js +0 -164
  181. package/lib/ListItem/docs/ListItem__default.docs.js +0 -131
  182. package/lib/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +0 -177
  183. package/lib/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +0 -165
  184. package/lib/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +0 -191
  185. package/lib/MultiSelect/docs/MultiSelect__default.docs.js +0 -214
  186. package/lib/PopOver/docs/PopOver__default.docs.js +0 -86
  187. package/lib/Provider/docs/Provider_Id__Class.docs.js +0 -77
  188. package/lib/Provider/docs/Provider_Id__Function.docs.js +0 -29
  189. package/lib/Provider/docs/Provider_Zindex__Class.docs.js +0 -80
  190. package/lib/Provider/docs/Provider_Zindex__Function.docs.js +0 -34
  191. package/lib/Radio/docs/Radio__custom.docs.js +0 -299
  192. package/lib/Radio/docs/Radio__default.docs.js +0 -222
  193. package/lib/Responsive/docs/Responsive__Custom.docs.js +0 -272
  194. package/lib/Responsive/docs/Responsive__default.docs.js +0 -142
  195. package/lib/Responsive/docs/style.module.css +0 -56
  196. package/lib/Ribbon/docs/Ribbon__custom.docs.js +0 -437
  197. package/lib/Ribbon/docs/Ribbon__default.docs.js +0 -392
  198. package/lib/RippleEffect/docs/RippleEffect__default.docs.js +0 -484
  199. package/lib/Select/docs/GroupSelect__default.docs.js +0 -199
  200. package/lib/Select/docs/SelectWithAvatar__default.docs.js +0 -152
  201. package/lib/Select/docs/SelectWithIcon__default.docs.js +0 -190
  202. package/lib/Select/docs/Select__default.docs.js +0 -340
  203. package/lib/Stencils/docs/Stencils__custom.docs.js +0 -96
  204. package/lib/Stencils/docs/Stencils__default.docs.js +0 -101
  205. package/lib/Switch/docs/Switch__custom.docs.js +0 -203
  206. package/lib/Switch/docs/Switch__default.docs.js +0 -156
  207. package/lib/Tab/docs/Tab__default.docs.js +0 -308
  208. package/lib/Tab/docs/tabdocs.module.css +0 -29
  209. package/lib/Tag/docs/Tag__custom.docs.js +0 -423
  210. package/lib/Tag/docs/Tag__default.docs.js +0 -307
  211. package/lib/TextBox/docs/TextBox__custom.docs.js +0 -98
  212. package/lib/TextBox/docs/TextBox__default.docs.js +0 -95
  213. package/lib/TextBox/docs/TextBox__size.docs.js +0 -93
  214. package/lib/TextBox/docs/TextBox__variant.docs.js +0 -93
  215. package/lib/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +0 -145
  216. package/lib/TextBoxIcon/docs/TextBoxIcon__default.docs.js +0 -117
  217. package/lib/Textarea/docs/Textarea__animated.docs.js +0 -95
  218. package/lib/Textarea/docs/Textarea__custom.docs.js +0 -137
  219. package/lib/Textarea/docs/Textarea__default.docs.js +0 -130
  220. package/lib/Textarea/docs/Textarea__disabled.docs.js +0 -83
  221. package/lib/Tooltip/docs/Tooltip__default.docs.js +0 -391
  222. package/lib/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +0 -150
  223. package/lib/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +0 -206
  224. package/lib/a11y/FocusScope/docs/FocusScope__default.docs.js +0 -191
  225. package/lib/beta/FocusRing/docs/FocusRing__default.docs.js +0 -101
  226. package/lib/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +0 -145
  227. package/lib/semantic/Button/docs/Button__default.docs.js +0 -66
  228. package/preprocess/componentAppearanceColors.js +0 -67
  229. package/preprocess/componentThemeColors.js +0 -123
  230. package/preprocess/ctaThemeColors.js +0 -101
  231. package/preprocess/index.js +0 -3
  232. package/preprocess/json/componentAppearanceVariableJson.js +0 -1346
  233. package/preprocess/json/componentThemeVariableJson.js +0 -242
  234. package/preprocess/json/ctaThemeVariableJson.js +0 -203
package/README.md CHANGED
@@ -32,6 +32,10 @@ In this Package, we Provide Some Basic Components to Build Web App
32
32
  - TextBoxIcon
33
33
  - Tooltip
34
34
 
35
+ # 1.0.0-alpha-226
36
+
37
+ - ListContainer Implemented in => ListItem,ListItemWithAvatar,ListItemWithIcon,ListItemWithRadio,ListItemWithCheckBox
38
+
35
39
  # 1.0.0-alpha-225
36
40
 
37
41
  - Appearance css moved to assets
@@ -0,0 +1,123 @@
1
+ function _extends() { _extends = Object.assign || 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 from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import { Container } from '../Layout';
7
+ import CssProvider from '../Provider/CssProvider';
8
+ import style from './ListItem.module.css';
9
+
10
+ const ListContainer = props => {
11
+ const {
12
+ size,
13
+ active,
14
+ highlight,
15
+ autoHover,
16
+ palette,
17
+ title,
18
+ disableTitle,
19
+ needTick,
20
+ isLink,
21
+ href,
22
+ target,
23
+ needBorder,
24
+ isDisabled,
25
+ children,
26
+ dataId,
27
+ a11y,
28
+ customClass,
29
+ customProps,
30
+ onClick,
31
+ onMouseEnter,
32
+ onMouseOver,
33
+ eleRef
34
+ } = props;
35
+ const {
36
+ role,
37
+ ariaSelected
38
+ } = a11y;
39
+ const options = {};
40
+
41
+ if (isLink) {
42
+ options.href = href;
43
+ options.target = `_${target}`;
44
+ }
45
+
46
+ if (active) {
47
+ options['data-selected'] = active;
48
+ }
49
+
50
+ if (!isDisabled && !isLink && active) {
51
+ options.tabindex = '0';
52
+ }
53
+
54
+ return /*#__PURE__*/React.createElement(Container, _extends({
55
+ role: role,
56
+ "aria-selected": ariaSelected,
57
+ isCover: false,
58
+ align: "vertical",
59
+ alignBox: "row",
60
+ className: `${style.list} ${style[size]} ${style[palette]} ${active ? style[`active${palette}`] : highlight && !isDisabled ? style[`${palette}Hover`] : ''} ${autoHover && !isDisabled ? style[`${palette}Effect`] : ''} ${needTick ? style[`${size}withTick`] : ''} ${isDisabled ? CssProvider('isDisable') : ''} ${needBorder ? active ? style.activewithBorder : style.withBorder : ''} ${customClass}`,
61
+ dataId: dataId,
62
+ onClick: !isDisabled && onClick,
63
+ onMouseEnter: onMouseEnter,
64
+ onMouseOver: onMouseOver,
65
+ eleRef: eleRef,
66
+ tagName: isLink ? 'a' : 'li',
67
+ "data-title": isDisabled ? disableTitle : title
68
+ }, options, customProps), children);
69
+ };
70
+
71
+ ListContainer.defaultProps = {
72
+ active: false,
73
+ autoHover: false,
74
+ highlight: false,
75
+ needTick: false,
76
+ palette: 'default',
77
+ size: 'medium',
78
+ isLink: false,
79
+ target: 'blank',
80
+ needBorder: true,
81
+ a11y: {},
82
+ customClass: {},
83
+ customProps: {}
84
+ };
85
+ export default ListContainer;
86
+ ListContainer.propTypes = {
87
+ active: PropTypes.bool,
88
+ autoHover: PropTypes.bool,
89
+ children: PropTypes.node,
90
+ dataId: PropTypes.string,
91
+ disableTitle: PropTypes.string,
92
+ highlight: PropTypes.bool,
93
+ href: PropTypes.string,
94
+ isDisabled: PropTypes.bool,
95
+ isLink: PropTypes.bool,
96
+ needBorder: PropTypes.bool,
97
+ needTick: PropTypes.bool,
98
+ onClick: PropTypes.func,
99
+ onMouseEnter: PropTypes.func,
100
+ onMouseOver: PropTypes.func,
101
+ palette: PropTypes.oneOf(['default', 'primary', 'secondary', 'dark']),
102
+ size: PropTypes.oneOf(['small', 'medium', 'large']),
103
+ target: PropTypes.oneOf(['blank', 'self']),
104
+ title: PropTypes.string,
105
+ a11y: PropTypes.shape({
106
+ role: PropTypes.string,
107
+ ariaSelected: PropTypes.bool
108
+ }),
109
+ customClass: PropTypes.shape({
110
+ customListItem: PropTypes.string,
111
+ customTickIcon: PropTypes.string
112
+ }),
113
+ customProps: PropTypes.shape({
114
+ ListItemProps: PropTypes.object
115
+ })
116
+ };
117
+
118
+ if (false) {
119
+ ListContainer.docs = {
120
+ componentGroup: 'Molecule',
121
+ folderName: 'Style Guide'
122
+ };
123
+ }
@@ -3,11 +3,11 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
3
3
  /**** Libraries ****/
4
4
  import React from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import { Container, Box } from '../Layout';
6
+ import { Box } from '../Layout';
7
+ import ListContainer from './ListContainer';
7
8
  /**** Components ****/
8
9
 
9
10
  import Icon from '@zohodesk/icons/lib/Icon';
10
- import CssProvider from '../Provider/CssProvider';
11
11
  /**** CSS ****/
12
12
 
13
13
  import style from './ListItem.module.css';
@@ -72,48 +72,40 @@ export default class ListItem extends React.Component {
72
72
  customProps
73
73
  } = this.props;
74
74
  let {
75
- ListItemProps = {}
75
+ ListItemProps = {},
76
+ ContainerProps = {}
76
77
  } = customProps;
77
78
  let {
78
79
  customListItem = '',
79
80
  customTickIcon = ''
80
81
  } = customClass;
81
82
  let {
82
- role,
83
- ariaSelected,
84
83
  ariaHidden = true
85
84
  } = a11y;
86
85
  let tickIconPalette = style[`${palette}Tick`] ? style[`${palette}Tick`] : '';
87
- let options = {};
88
-
89
- if (isLink) {
90
- options.href = href;
91
- options.target = `_${target}`;
92
- }
93
-
94
- if (active) {
95
- options['data-selected'] = active;
96
- }
97
-
98
- if (!isDisabled && !isLink && active) {
99
- options.tabindex = '0';
100
- }
101
-
102
86
  let dataIdString = dataId ? dataId : value ? String(value).replace("'", '_') : 'listItem';
103
- return /*#__PURE__*/React.createElement(Container, _extends({
104
- role: role,
105
- "aria-selected": ariaSelected,
106
- isCover: false,
107
- align: "vertical",
108
- alignBox: "row",
109
- className: `${style.list} ${style[size]} ${style[palette]} ${active ? style[`active${palette}`] : highlight && !isDisabled ? style[`${palette}Hover`] : ''} ${autoHover && !isDisabled ? style[`${palette}Effect`] : ''} ${needTick ? style[`${size}withTick`] : ''} ${isDisabled ? CssProvider('isDisable') : ''} ${needBorder ? active ? style.activewithBorder : style.withBorder : ''} ${customListItem}`,
87
+ return /*#__PURE__*/React.createElement(ListContainer, _extends({
88
+ a11y: a11y,
89
+ size: size,
90
+ palette: palette,
91
+ highlight: highlight,
92
+ isDisabled: isDisabled,
93
+ active: active,
94
+ autoHover: autoHover,
95
+ needTick: needTick,
96
+ needBorder: needBorder,
97
+ customClass: customListItem,
110
98
  dataId: dataIdString,
111
- onClick: !isDisabled && this.handleClick,
99
+ isLink: isLink,
100
+ href: href,
101
+ target: target,
102
+ disableTitle: disableTitle,
103
+ title: title,
104
+ onClick: this.handleClick,
112
105
  onMouseEnter: this.handleMouseEnter,
113
106
  eleRef: this.getRef,
114
- tagName: isLink ? 'a' : 'li',
115
- "data-title": isDisabled ? disableTitle : title
116
- }, options, ListItemProps), value ? /*#__PURE__*/React.createElement(Box, {
107
+ customProps: ListItemProps
108
+ }, ContainerProps), value ? /*#__PURE__*/React.createElement(Box, {
117
109
  shrink: true,
118
110
  adjust: true,
119
111
  className: style.value
@@ -3,13 +3,13 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
3
3
  /**** Libraries ****/
4
4
  import React from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import { Container, Box } from '../Layout';
6
+ import { Box } from '../Layout';
7
+ import ListContainer from './ListContainer';
7
8
  /**** Components ****/
8
9
 
9
10
  import Avatar from '../Avatar/Avatar';
10
11
  import AvatarTeam from '../AvatarTeam/AvatarTeam';
11
12
  import Icon from '@zohodesk/icons/lib/Icon';
12
- import CssProvider from '../Provider/CssProvider';
13
13
  /**** CSS ****/
14
14
 
15
15
  import style from './ListItem.module.css';
@@ -76,44 +76,38 @@ export default class ListItemWithAvatar extends React.PureComponent {
76
76
  customProps
77
77
  } = this.props;
78
78
  let {
79
- ListItemProps = {}
79
+ ListItemProps = {},
80
+ ContainerProps = {}
80
81
  } = customProps;
81
82
  let {
82
83
  customListItem = '',
83
84
  customAvatar = '',
84
85
  customAvatarTeam = ''
85
86
  } = customClass;
86
- let options = {};
87
87
  let {
88
- role,
89
- ariaSelected,
90
88
  ariaHidden = true
91
89
  } = a11y;
92
90
  let isDarkPalette = palette === 'dark';
93
-
94
- if (active) {
95
- options['data-selected'] = active;
96
- }
97
-
98
- if (!isDisabled && active) {
99
- options.tabindex = '0';
100
- }
101
-
102
91
  let dataIdString = value ? value : dataId;
103
- return /*#__PURE__*/React.createElement(Container, _extends({
104
- role: role,
105
- "aria-selected": ariaSelected,
106
- isCover: false,
107
- align: "vertical",
108
- alignBox: "row",
109
- className: `${style.list} ${style[size]} ${style[palette]} ${active ? style[`active${palette}`] : highlight && !isDisabled ? style[`${palette}Hover`] : ''} ${autoHover && !isDisabled ? style[`${palette}Effect`] : ''} ${needTick ? style[`${size}withTick`] : ''} ${isDisabled ? CssProvider('isDisable') : ''} ${needBorder ? active ? style.activewithBorder : style.withBorder : ''} ${customListItem}`,
110
- onClick: !isDisabled && this.handleClick,
92
+ return /*#__PURE__*/React.createElement(ListContainer, _extends({
93
+ a11y: a11y,
94
+ size: size,
95
+ palette: palette,
96
+ highlight: highlight,
97
+ isDisabled: isDisabled,
98
+ active: active,
99
+ autoHover: autoHover,
100
+ needTick: needTick,
101
+ needBorder: needBorder,
102
+ customClass: customListItem,
103
+ dataId: `${dataIdString}_ListItemWithAvatar`,
104
+ onClick: this.handleClick,
111
105
  onMouseEnter: this.handleMouseEnter,
112
106
  eleRef: this.getRef,
113
- tagName: "li",
114
- dataId: `${dataIdString}_ListItemWithAvatar`,
115
- "data-title": isDisabled ? disableTitle : null
116
- }, options, ListItemProps), name || imgSrc ? /*#__PURE__*/React.createElement(Box, {
107
+ disableTitle: disableTitle,
108
+ title: null,
109
+ customProps: ListItemProps
110
+ }, ContainerProps), name || imgSrc ? /*#__PURE__*/React.createElement(Box, {
117
111
  className: style.leftAvatar
118
112
  }, isTeam ? /*#__PURE__*/React.createElement(AvatarTeam, {
119
113
  name: name,
@@ -2,9 +2,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2
2
 
3
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
+ import ListContainer from './ListContainer';
5
6
  import CheckBox from '../CheckBox/CheckBox';
6
- import { Container, Box } from '../Layout';
7
- import CssProvider from '../Provider/CssProvider';
7
+ import { Box } from '../Layout';
8
8
  import style from './ListItem.module.css';
9
9
  export default class ListItemWithCheckBox extends React.Component {
10
10
  constructor(props) {
@@ -57,42 +57,35 @@ export default class ListItemWithCheckBox extends React.Component {
57
57
  isDisabled,
58
58
  disableTitle,
59
59
  a11y,
60
- customClass
60
+ customClass,
61
+ customProps
61
62
  } = this.props;
62
63
  let {
63
- role,
64
- ariaSelected
65
- } = a11y;
64
+ ListItemProps = {},
65
+ ContainerProps = {}
66
+ } = customProps;
66
67
  let {
67
68
  customListItem = '',
68
69
  customCheckBox = '',
69
70
  customLabel = ''
70
71
  } = customClass;
71
- let options = {};
72
-
73
- if (active) {
74
- options['data-selected'] = active;
75
- }
76
-
77
- if (!isDisabled && active) {
78
- options.tabindex = '0';
79
- }
80
-
81
- return /*#__PURE__*/React.createElement(Container, _extends({
82
- role: role,
83
- "aria-selected": ariaSelected,
84
- isCover: false,
85
- align: "vertical",
86
- alignBox: "row",
87
- className: `${style.list} ${style[size]} ${style[palette]} ${active ? style[`active${palette}`] : highlight && !isDisabled ? style[`${palette}Hover`] : ''} ${autoHover && !isDisabled ? style[`${palette}Effect`] : ''}
88
- ${isDisabled ? CssProvider('isDisable') : ''} ${customListItem}`,
72
+ return /*#__PURE__*/React.createElement(ListContainer, _extends({
73
+ a11y: a11y,
74
+ size: size,
75
+ palette: palette,
76
+ highlight: highlight,
77
+ isDisabled: isDisabled,
78
+ active: active,
79
+ autoHover: autoHover,
80
+ customClass: customListItem,
89
81
  dataId: `${dataId ? dataId : value}_ListItemWithCheckBox`,
90
- onClick: !isDisabled && this.onClick,
82
+ onClick: this.onClick,
91
83
  onMouseOver: this.onHover,
92
84
  eleRef: this.getRef,
93
- tagName: "li",
94
- "data-title": isDisabled ? disableTitle : null
95
- }, options), /*#__PURE__*/React.createElement(Box, {
85
+ disableTitle: disableTitle,
86
+ title: null,
87
+ customProps: ListItemProps
88
+ }, ContainerProps), /*#__PURE__*/React.createElement(Box, {
96
89
  className: style.iconBox
97
90
  }, /*#__PURE__*/React.createElement(CheckBox, {
98
91
  checked: checked,
@@ -121,7 +114,8 @@ ListItemWithCheckBox.defaultProps = {
121
114
  size: 'medium',
122
115
  value: 'List',
123
116
  a11y: {},
124
- customClass: {}
117
+ customClass: {},
118
+ customProps: {}
125
119
  };
126
120
  ListItemWithCheckBox.propTypes = {
127
121
  active: PropTypes.bool,
@@ -3,9 +3,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
3
3
  /**** Libraries ****/
4
4
  import React from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import { Container, Box } from '../Layout';
6
+ import { Box } from '../Layout';
7
7
  import Icon from '@zohodesk/icons/lib/Icon';
8
- import CssProvider from '../Provider/CssProvider';
8
+ import ListContainer from './ListContainer';
9
9
  /**** CSS ****/
10
10
 
11
11
  import style from './ListItem.module.css';
@@ -61,6 +61,9 @@ export default class ListItemWithIcon extends React.Component {
61
61
  dataId,
62
62
  title,
63
63
  needTick,
64
+ isLink,
65
+ href,
66
+ target,
64
67
  needBorder,
65
68
  isDisabled,
66
69
  disableTitle,
@@ -69,38 +72,35 @@ export default class ListItemWithIcon extends React.Component {
69
72
  customProps
70
73
  } = this.props;
71
74
  let {
72
- ListItemProps = {}
75
+ ListItemProps = {},
76
+ ContainerProps = {}
73
77
  } = customProps;
74
78
  let {
75
- role,
76
- ariaSelected,
77
79
  ariaHidden = true
78
80
  } = a11y;
79
- let options = {};
80
-
81
- if (active) {
82
- options['data-selected'] = active;
83
- }
84
-
85
- if (!isDisabled && active) {
86
- options.tabindex = '0';
87
- }
88
-
89
81
  let dataIdString = dataId ? `${dataId.replace("'", '_')}` : value.toLowerCase().replace("'", '_');
90
- return /*#__PURE__*/React.createElement(Container, _extends({
91
- role: role,
92
- "aria-selected": ariaSelected,
93
- isCover: false,
94
- align: "vertical",
95
- alignBox: "row",
96
- className: `${style.list} ${style[size]} ${style[palette]} ${active ? style[`active${palette}`] : highlight && !isDisabled ? style[`${palette}Hover`] : ''} ${autoHover && !isDisabled ? style[`${palette}Effect`] : ''} ${needTick ? style[`${size}withTick`] : ''} ${isDisabled ? CssProvider('isDisable') : ''} ${needBorder ? active ? style.activewithBorder : style.withBorder : ''} ${customClass}`,
82
+ return /*#__PURE__*/React.createElement(ListContainer, _extends({
83
+ a11y: a11y,
84
+ size: size,
85
+ palette: palette,
86
+ highlight: highlight,
87
+ isDisabled: isDisabled,
88
+ active: active,
89
+ autoHover: autoHover,
90
+ needTick: needTick,
91
+ needBorder: needBorder,
92
+ customClass: customClass,
97
93
  dataId: dataIdString,
98
- onClick: !isDisabled && this.handleClick,
94
+ isLink: isLink,
95
+ href: href,
96
+ target: target,
97
+ onClick: this.handleClick,
99
98
  onMouseOver: this.handleMouseEnter,
100
99
  eleRef: this.getRef,
101
- tagName: "li",
102
- "data-title": isDisabled ? disableTitle : null
103
- }, options, ListItemProps), iconName && /*#__PURE__*/React.createElement(Box, {
100
+ disableTitle: disableTitle,
101
+ title: null,
102
+ customProps: ListItemProps
103
+ }, ContainerProps), iconName && /*#__PURE__*/React.createElement(Box, {
104
104
  "aria-hidden": true,
105
105
  className: style.iconBox,
106
106
  dataId: dataId ? `${dataId}_Icon` : `${value.toLowerCase().replace("'", '_')}_Icon`
@@ -3,8 +3,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
3
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import Radio from '../Radio/Radio';
6
- import { Container, Box } from '../Layout';
7
- import CssProvider from '../Provider/CssProvider';
6
+ import { Box } from '../Layout';
7
+ import ListContainer from './ListContainer';
8
8
  import style from './ListItem.module.css';
9
9
  export default class ListItemWithRadio extends React.Component {
10
10
  constructor(props) {
@@ -58,43 +58,35 @@ export default class ListItemWithRadio extends React.Component {
58
58
  isDisabled,
59
59
  disableTitle,
60
60
  a11y,
61
- customClass
61
+ customClass,
62
+ customProps
62
63
  } = this.props;
64
+ let {
65
+ ListItemProps = {},
66
+ ContainerProps = {}
67
+ } = customProps;
63
68
  let {
64
69
  customListItem = '',
65
70
  customRadio = '',
66
71
  customRadioWrap = ''
67
72
  } = customClass;
68
- let {
69
- role,
70
- ariaSelected
71
- } = a11y;
72
- let options = {};
73
-
74
- if (active) {
75
- options['data-selected'] = active;
76
- }
77
-
78
- if (!isDisabled && active) {
79
- options.tabindex = '0';
80
- }
81
-
82
- return /*#__PURE__*/React.createElement(Container, _extends({
83
- role: role,
84
- "aria-selected": ariaSelected,
85
- isCover: false,
86
- align: "vertical",
87
- alignBox: "row",
88
- className: `${style.list} ${style[size]} ${style[palette]} ${active ? style.active : highlight && !isDisabled ? style.hover : ''} ${autoHover && !isDisabled ? style.effect : ''} ${isDisabled ? CssProvider('isDisable') : ''} `,
89
- className: `${style.list} ${style[size]} ${style[palette]} ${active ? style[`active${palette}`] : highlight && !isDisabled ? style[`${palette}Hover`] : ''} ${autoHover && !isDisabled ? style[`${palette}Effect`] : ''}
90
- ${isDisabled ? CssProvider('isDisable') : ''} ${customListItem}`,
73
+ return /*#__PURE__*/React.createElement(ListContainer, _extends({
74
+ a11y: a11y,
75
+ size: size,
76
+ palette: palette,
77
+ highlight: highlight,
78
+ isDisabled: isDisabled,
79
+ active: active,
80
+ autoHover: autoHover,
81
+ customClass: customListItem,
91
82
  dataId: dataId,
92
- onClick: !isDisabled && this.onClick,
83
+ onClick: this.onClick,
93
84
  onMouseOver: this.onHover,
94
85
  eleRef: this.getRef,
95
- tagName: "li",
96
- "data-title": isDisabled ? disableTitle : null
97
- }, options), /*#__PURE__*/React.createElement(Box, {
86
+ disableTitle: disableTitle,
87
+ title: null,
88
+ customProps: ListItemProps
89
+ }, ContainerProps), /*#__PURE__*/React.createElement(Box, {
98
90
  className: style.iconBox
99
91
  }, /*#__PURE__*/React.createElement(Radio, {
100
92
  checked: checked,
@@ -125,7 +117,8 @@ ListItemWithRadio.defaultProps = {
125
117
  value: 'List',
126
118
  dataId: 'listItemWithRadioComp',
127
119
  a11y: {},
128
- customClass: {}
120
+ customClass: {},
121
+ customProps: {}
129
122
  };
130
123
  ListItemWithRadio.propTypes = {
131
124
  active: PropTypes.bool,
@@ -0,0 +1,132 @@
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 _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _Layout = require("../Layout");
13
+
14
+ var _CssProvider = _interopRequireDefault(require("../Provider/CssProvider"));
15
+
16
+ var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ function _extends() { _extends = Object.assign || 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); }
21
+
22
+ var ListContainer = function ListContainer(props) {
23
+ var size = props.size,
24
+ active = props.active,
25
+ highlight = props.highlight,
26
+ autoHover = props.autoHover,
27
+ palette = props.palette,
28
+ title = props.title,
29
+ disableTitle = props.disableTitle,
30
+ needTick = props.needTick,
31
+ isLink = props.isLink,
32
+ href = props.href,
33
+ target = props.target,
34
+ needBorder = props.needBorder,
35
+ isDisabled = props.isDisabled,
36
+ children = props.children,
37
+ dataId = props.dataId,
38
+ a11y = props.a11y,
39
+ customClass = props.customClass,
40
+ customProps = props.customProps,
41
+ onClick = props.onClick,
42
+ onMouseEnter = props.onMouseEnter,
43
+ onMouseOver = props.onMouseOver,
44
+ eleRef = props.eleRef;
45
+ var role = a11y.role,
46
+ ariaSelected = a11y.ariaSelected;
47
+ var options = {};
48
+
49
+ if (isLink) {
50
+ options.href = href;
51
+ options.target = "_".concat(target);
52
+ }
53
+
54
+ if (active) {
55
+ options['data-selected'] = active;
56
+ }
57
+
58
+ if (!isDisabled && !isLink && active) {
59
+ options.tabindex = '0';
60
+ }
61
+
62
+ return /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
63
+ role: role,
64
+ "aria-selected": ariaSelected,
65
+ isCover: false,
66
+ align: "vertical",
67
+ alignBox: "row",
68
+ className: "".concat(_ListItemModule["default"].list, " ").concat(_ListItemModule["default"][size], " ").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),
69
+ dataId: dataId,
70
+ onClick: !isDisabled && onClick,
71
+ onMouseEnter: onMouseEnter,
72
+ onMouseOver: onMouseOver,
73
+ eleRef: eleRef,
74
+ tagName: isLink ? 'a' : 'li',
75
+ "data-title": isDisabled ? disableTitle : title
76
+ }, options, customProps), children);
77
+ };
78
+
79
+ ListContainer.defaultProps = {
80
+ active: false,
81
+ autoHover: false,
82
+ highlight: false,
83
+ needTick: false,
84
+ palette: 'default',
85
+ size: 'medium',
86
+ isLink: false,
87
+ target: 'blank',
88
+ needBorder: true,
89
+ a11y: {},
90
+ customClass: {},
91
+ customProps: {}
92
+ };
93
+ var _default = ListContainer;
94
+ exports["default"] = _default;
95
+ ListContainer.propTypes = {
96
+ active: _propTypes["default"].bool,
97
+ autoHover: _propTypes["default"].bool,
98
+ children: _propTypes["default"].node,
99
+ dataId: _propTypes["default"].string,
100
+ disableTitle: _propTypes["default"].string,
101
+ highlight: _propTypes["default"].bool,
102
+ href: _propTypes["default"].string,
103
+ isDisabled: _propTypes["default"].bool,
104
+ isLink: _propTypes["default"].bool,
105
+ needBorder: _propTypes["default"].bool,
106
+ needTick: _propTypes["default"].bool,
107
+ onClick: _propTypes["default"].func,
108
+ onMouseEnter: _propTypes["default"].func,
109
+ onMouseOver: _propTypes["default"].func,
110
+ palette: _propTypes["default"].oneOf(['default', 'primary', 'secondary', 'dark']),
111
+ size: _propTypes["default"].oneOf(['small', 'medium', 'large']),
112
+ target: _propTypes["default"].oneOf(['blank', 'self']),
113
+ title: _propTypes["default"].string,
114
+ a11y: _propTypes["default"].shape({
115
+ role: _propTypes["default"].string,
116
+ ariaSelected: _propTypes["default"].bool
117
+ }),
118
+ customClass: _propTypes["default"].shape({
119
+ customListItem: _propTypes["default"].string,
120
+ customTickIcon: _propTypes["default"].string
121
+ }),
122
+ customProps: _propTypes["default"].shape({
123
+ ListItemProps: _propTypes["default"].object
124
+ })
125
+ };
126
+
127
+ if (false) {
128
+ ListContainer.docs = {
129
+ componentGroup: 'Molecule',
130
+ folderName: 'Style Guide'
131
+ };
132
+ }