@zohodesk/dot 1.3.0 → 1.3.2

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 (164) hide show
  1. package/.cli/PropLessFiles.html +1 -1
  2. package/.cli/PropValidationExcludeFilesArray.js +1 -1
  3. package/.cli/propValidation_report.html +1 -1
  4. package/README.md +21 -12
  5. package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +163 -553
  6. package/assets/Appearance/dark/themes/blue/blue_DotTheme_DarkTheme.module.css +3 -12
  7. package/assets/Appearance/dark/themes/green/green_DotTheme_DarkTheme.module.css +3 -12
  8. package/assets/Appearance/dark/themes/orange/orange_DotTheme_DarkTheme.module.css +3 -12
  9. package/assets/Appearance/dark/themes/red/red_DotTheme_DarkTheme.module.css +3 -12
  10. package/assets/Appearance/dark/themes/yellow/yellow_DotTheme_DarkTheme.module.css +3 -12
  11. package/assets/Appearance/light/mode/Dot_LightMode.module.css +163 -553
  12. package/assets/Appearance/light/themes/blue/blue_DotTheme_LightTheme.module.css +3 -12
  13. package/assets/Appearance/light/themes/green/green_DotTheme_LightTheme.module.css +3 -12
  14. package/assets/Appearance/light/themes/orange/orange_DotTheme_LightTheme.module.css +3 -12
  15. package/assets/Appearance/light/themes/red/red_DotTheme_LightTheme.module.css +3 -12
  16. package/assets/Appearance/light/themes/yellow/yellow_DotTheme_LightTheme.module.css +3 -12
  17. package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +163 -553
  18. package/assets/Appearance/pureDark/themes/blue/blue_DotTheme_PureDarkTheme.module.css +3 -12
  19. package/assets/Appearance/pureDark/themes/green/green_DotTheme_PureDarkTheme.module.css +3 -12
  20. package/assets/Appearance/pureDark/themes/orange/orange_DotTheme_PureDarkTheme.module.css +3 -12
  21. package/assets/Appearance/pureDark/themes/red/red_DotTheme_PureDarkTheme.module.css +3 -12
  22. package/assets/Appearance/pureDark/themes/yellow/yellow_DotTheme_PureDarkTheme.module.css +3 -12
  23. package/coverage/ExternalLink/ExternalLink.js.html +1 -1
  24. package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
  25. package/coverage/ExternalLink/index.html +1 -1
  26. package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
  27. package/coverage/ExternalLink/props/index.html +1 -1
  28. package/coverage/ExternalLink/props/propTypes.js.html +1 -1
  29. package/coverage/IconButton/IconButton.js.html +466 -0
  30. package/coverage/IconButton/IconButton.module.css.html +151 -0
  31. package/coverage/IconButton/index.html +131 -0
  32. package/coverage/IconButton/props/defaultProps.js.html +136 -0
  33. package/coverage/IconButton/props/index.html +131 -0
  34. package/coverage/IconButton/props/propTypes.js.html +187 -0
  35. package/coverage/Image/Image.js.html +1 -1
  36. package/coverage/Image/Image.module.css.html +1 -1
  37. package/coverage/Image/index.html +1 -1
  38. package/coverage/Image/props/defaultProps.js.html +1 -1
  39. package/coverage/Image/props/index.html +1 -1
  40. package/coverage/Image/props/propTypes.js.html +1 -1
  41. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
  42. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
  43. package/coverage/avatar/AvatarWithTeam/index.html +1 -1
  44. package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
  45. package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
  46. package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
  47. package/coverage/coverage-final.json +4 -0
  48. package/coverage/coverage-summary.json +5 -1
  49. package/coverage/index.html +40 -10
  50. package/es/IconButton/__tests__/IconButton.spec.js +148 -0
  51. package/es/IconButton/__tests__/__snapshots__/IconButton.spec.js.snap +316 -0
  52. package/es/form/fields/FieldContainer/props/propTypes.js +1 -1
  53. package/es/v1/ActionButton/ActionButton.js +2 -2
  54. package/es/v1/AlphabeticList/AlphabeticList.js +6 -2
  55. package/es/v1/Attachment/Attachment.js +78 -75
  56. package/es/v1/AttachmentViewer/AttachmentImage.js +44 -63
  57. package/es/v1/Image/Image.js +26 -33
  58. package/es/v1/Loader/Loader.js +12 -18
  59. package/es/v1/Message/Message.js +16 -42
  60. package/es/v1/PlusIcon/PlusIcon.js +25 -37
  61. package/es/v1/Separator/Separator.js +40 -47
  62. package/es/v1/Upload/Upload.js +59 -66
  63. package/es/v1/alert/AlertHeader/AlertHeader.js +5 -4
  64. package/es/v1/alert/AlertHeader/props/defaultProps.js +12 -0
  65. package/es/v1/alert/AlertHeader/props/propTypes.js +20 -0
  66. package/es/v1/alert/AlertLookup/AlertLookup.js +6 -4
  67. package/es/v1/alert/AlertLookup/props/defaultProps.js +13 -0
  68. package/es/v1/alert/AlertLookup/props/propTypes.js +36 -0
  69. package/es/v1/avatar/AvatarClose/AvatarClose.js +32 -43
  70. package/es/v1/avatar/AvatarCollision/AvatarCollision.js +41 -52
  71. package/es/v1/avatar/AvatarIcon/AvatarIcon.js +38 -43
  72. package/es/v1/avatar/AvatarStatus/AvatarStatus.js +52 -63
  73. package/es/v1/avatar/AvatarThread/AvatarThread.js +62 -69
  74. package/es/v1/avatar/AvatarUser/AvatarUser.js +93 -100
  75. package/es/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +81 -88
  76. package/es/v1/form/fields/CheckBoxField/CheckBoxField.js +6 -6
  77. package/es/v1/form/fields/CurrencyField/CurrencyField.js +6 -6
  78. package/es/v1/form/fields/DateField/DateField.js +6 -6
  79. package/es/v1/form/fields/FieldContainer/FieldContainer.js +6 -6
  80. package/es/v1/form/fields/MultiSelectField/MultiSelectField.js +6 -6
  81. package/es/v1/form/fields/PhoneField/PhoneField.js +6 -6
  82. package/es/v1/form/fields/RadioField/RadioField.js +89 -97
  83. package/es/v1/form/fields/SelectField/SelectField.js +139 -154
  84. package/es/v1/layout/SetupDetailLayout/SetupDetailLayout.js +154 -197
  85. package/es/v1/layout/SubtabLayout/SubtabLayout.js +108 -124
  86. package/es/v1/list/SecondaryText/AccountName.js +61 -69
  87. package/es/v1/list/SecondaryText/ContactName.js +66 -74
  88. package/es/v1/list/SecondaryText/DepartmentText.js +15 -27
  89. package/es/v1/list/SecondaryText/Email.js +32 -40
  90. package/es/v1/list/SecondaryText/HappinessRating.js +17 -25
  91. package/es/v1/list/SecondaryText/PhoneNumber.js +36 -44
  92. package/es/v1/list/SecondaryText/PriorityText.js +16 -28
  93. package/es/v1/list/SecondaryText/SecondaryText.js +21 -33
  94. package/es/v1/list/SecondaryText/StatusText.js +17 -29
  95. package/es/v1/list/SecondaryText/TicketId.js +33 -45
  96. package/es/v1/list/SecondaryText/Website.js +22 -30
  97. package/es/v1/list/SecondryPanel/SecondryPanel.js +66 -83
  98. package/es/v1/list/SentimentStatus/SentimentStatus.js +18 -29
  99. package/es/v1/list/status/StatusDropdown/StatusDropdown.js +2 -2
  100. package/es/v1/list/status/StatusListItem/StatusListItem.js +75 -100
  101. package/es/v1/lookup/EmptyPage/EmptyPage.js +15 -26
  102. package/es/v1/lookup/Section/Section.js +14 -20
  103. package/es/v1/svg/PlusIcon.js +20 -27
  104. package/es/v1/svg/SnippetIcon.js +22 -29
  105. package/es/v1/svg/TemplateIcon.js +23 -30
  106. package/lib/IconButton/__tests__/IconButton.spec.js +156 -0
  107. package/lib/IconButton/__tests__/__snapshots__/IconButton.spec.js.snap +316 -0
  108. package/lib/form/fields/FieldContainer/props/propTypes.js +1 -1
  109. package/lib/v1/ActionButton/ActionButton.js +2 -2
  110. package/lib/v1/AlphabeticList/AlphabeticList.js +7 -3
  111. package/lib/v1/Attachment/Attachment.js +77 -112
  112. package/lib/v1/AttachmentViewer/AttachmentImage.js +61 -96
  113. package/lib/v1/Image/Image.js +26 -71
  114. package/lib/v1/Loader/Loader.js +12 -55
  115. package/lib/v1/Message/Message.js +23 -80
  116. package/lib/v1/PlusIcon/PlusIcon.js +25 -71
  117. package/lib/v1/Separator/Separator.js +44 -85
  118. package/lib/v1/Upload/Upload.js +58 -103
  119. package/lib/v1/alert/AlertHeader/AlertHeader.js +5 -4
  120. package/lib/v1/alert/AlertHeader/props/defaultProps.js +19 -0
  121. package/lib/v1/alert/AlertHeader/props/propTypes.js +31 -0
  122. package/lib/v1/alert/AlertLookup/AlertLookup.js +6 -4
  123. package/lib/v1/alert/AlertLookup/props/defaultProps.js +20 -0
  124. package/lib/v1/alert/AlertLookup/props/propTypes.js +47 -0
  125. package/lib/v1/avatar/AvatarClose/AvatarClose.js +32 -77
  126. package/lib/v1/avatar/AvatarCollision/AvatarCollision.js +41 -86
  127. package/lib/v1/avatar/AvatarIcon/AvatarIcon.js +37 -80
  128. package/lib/v1/avatar/AvatarStatus/AvatarStatus.js +52 -97
  129. package/lib/v1/avatar/AvatarThread/AvatarThread.js +61 -106
  130. package/lib/v1/avatar/AvatarUser/AvatarUser.js +95 -140
  131. package/lib/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +85 -130
  132. package/lib/v1/form/fields/CheckBoxField/CheckBoxField.js +6 -6
  133. package/lib/v1/form/fields/CurrencyField/CurrencyField.js +6 -6
  134. package/lib/v1/form/fields/DateField/DateField.js +6 -6
  135. package/lib/v1/form/fields/FieldContainer/FieldContainer.js +6 -6
  136. package/lib/v1/form/fields/MultiSelectField/MultiSelectField.js +6 -6
  137. package/lib/v1/form/fields/PhoneField/PhoneField.js +6 -6
  138. package/lib/v1/form/fields/RadioField/RadioField.js +91 -137
  139. package/lib/v1/form/fields/SelectField/SelectField.js +149 -200
  140. package/lib/v1/layout/SetupDetailLayout/SetupDetailLayout.js +160 -253
  141. package/lib/v1/layout/SubtabLayout/SubtabLayout.js +107 -206
  142. package/lib/v1/list/SecondaryText/AccountName.js +63 -113
  143. package/lib/v1/list/SecondaryText/ContactName.js +67 -117
  144. package/lib/v1/list/SecondaryText/DepartmentText.js +16 -66
  145. package/lib/v1/list/SecondaryText/Email.js +32 -82
  146. package/lib/v1/list/SecondaryText/HappinessRating.js +21 -68
  147. package/lib/v1/list/SecondaryText/PhoneNumber.js +36 -86
  148. package/lib/v1/list/SecondaryText/PriorityText.js +16 -66
  149. package/lib/v1/list/SecondaryText/SecondaryText.js +19 -69
  150. package/lib/v1/list/SecondaryText/StatusText.js +17 -67
  151. package/lib/v1/list/SecondaryText/TicketId.js +33 -83
  152. package/lib/v1/list/SecondaryText/Website.js +29 -72
  153. package/lib/v1/list/SecondryPanel/SecondryPanel.js +69 -168
  154. package/lib/v1/list/SentimentStatus/SentimentStatus.js +19 -64
  155. package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +2 -2
  156. package/lib/v1/list/status/StatusListItem/StatusListItem.js +81 -137
  157. package/lib/v1/lookup/EmptyPage/EmptyPage.js +43 -93
  158. package/lib/v1/lookup/Section/Section.js +14 -58
  159. package/lib/v1/svg/PlusIcon.js +20 -65
  160. package/lib/v1/svg/SnippetIcon.js +22 -67
  161. package/lib/v1/svg/TemplateIcon.js +23 -68
  162. package/package.json +12 -12
  163. package/result.json +1 -1
  164. package/unittest/index.html +1 -1
@@ -2,38 +2,31 @@ import React from 'react';
2
2
  import { defaultProps } from '../../Image/props/defaultProps';
3
3
  import { propTypes } from '../../Image/props/propTypes';
4
4
  import style from '../../Image/Image.module.css';
5
- export default class Image extends React.Component {
6
- render() {
7
- let {
8
- alt,
9
- src,
10
- className,
11
- isCover,
12
- title,
13
- onClick,
14
- dataId,
15
- htmlId,
16
- eleRef,
17
- original
18
- } = this.props;
19
- return /*#__PURE__*/React.createElement("img", {
20
- src: src,
21
- alt: alt,
22
- "data-title": title,
23
- "data-id": dataId,
24
- "data-test-id": dataId,
25
- className: ` ${className} ${isCover ? style.imgFullSize : style.imgMaxFullSize} `,
26
- onClick: onClick,
27
- id: htmlId,
28
- ref: eleRef,
29
- "data-original": original
30
- });
31
- }
32
-
5
+ export default function Image(props) {
6
+ let {
7
+ alt,
8
+ src,
9
+ className,
10
+ isCover,
11
+ title,
12
+ onClick,
13
+ dataId,
14
+ htmlId,
15
+ eleRef,
16
+ original
17
+ } = props;
18
+ return /*#__PURE__*/React.createElement("img", {
19
+ src: src,
20
+ alt: alt,
21
+ "data-title": title,
22
+ "data-id": dataId,
23
+ "data-test-id": dataId,
24
+ className: ` ${className} ${isCover ? style.imgFullSize : style.imgMaxFullSize} `,
25
+ onClick: onClick,
26
+ id: htmlId,
27
+ ref: eleRef,
28
+ "data-original": original
29
+ });
33
30
  }
34
31
  Image.propTypes = propTypes;
35
- Image.defaultProps = defaultProps; // if (__DOCS__) {
36
- // Image.docs = {
37
- // componentGroup: 'Atom'
38
- // };
39
- // }
32
+ Image.defaultProps = defaultProps;
@@ -1,21 +1,15 @@
1
1
  import React from 'react';
2
- import { getZIndex } from '@zohodesk/components/es/v1/Provider/ZindexProvider';
2
+ import { useZIndex } from '@zohodesk/components/es/v1/Provider/ZindexProvider';
3
3
  import style from '../../Loader/Loader.module.css';
4
- export default class Loader extends React.Component {
5
- constructor(props) {
6
- super(props);
7
- this.getNextIndex = getZIndex(this);
8
- }
9
-
10
- render() {
11
- return /*#__PURE__*/React.createElement("div", {
12
- className: style.ajaxLoader,
13
- style: {
14
- zIndex: `${this.getNextIndex()}`
15
- }
16
- }, /*#__PURE__*/React.createElement("div", {
17
- className: style.loader
18
- }));
19
- }
20
-
4
+ export default function Loader() {
5
+ let getNextId = useZIndex();
6
+ let Zindex = getNextId();
7
+ return /*#__PURE__*/React.createElement("div", {
8
+ className: style.ajaxLoader,
9
+ style: {
10
+ zIndex: `${Zindex}`
11
+ }
12
+ }, /*#__PURE__*/React.createElement("div", {
13
+ className: style.loader
14
+ }));
21
15
  }
@@ -1,59 +1,33 @@
1
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
2
 
3
- import React from 'react';
3
+ import React, { useState, useEffect } from 'react';
4
4
  import { defaultProps } from '../../Message/props/defaultProps';
5
5
  import { propTypes, MessageUI_propTypes, MessageNew_propTypes } from '../../Message/props/propTypes';
6
6
  import { Icon } from '@zohodesk/icons';
7
7
  import AutoClose from '../actions/AutoClose';
8
8
  import style from '../../Message/Message.module.css';
9
- export default class Message extends React.Component {
10
- constructor(props) {
11
- super(props);
12
- this.state = {
13
- hideMessage: false
14
- };
15
- }
16
-
17
- UNSAFE_componentWillReceiveProps(nextProps) {
18
- let {
19
- showMessage,
20
- hideMessage
21
- } = this.props;
22
-
23
- if (showMessage !== nextProps.showMessage) {
24
- if (nextProps.type != 'alert') {
25
- setTimeout(() => {
26
- hideMessage();
27
- }, 3000);
28
- }
29
- }
30
- }
31
-
32
- componentDidMount() {
33
- let {
34
- type,
35
- hideMessage
36
- } = this.props;
37
-
9
+ export default function Message(props) {
10
+ // constructor(props) {
11
+ // super(props);
12
+ // this.state = { hideMessage: false };
13
+ // }
14
+ // const [hideMessage,setHideMessage] = useState(false)
15
+ let {
16
+ showMessage,
17
+ hideMessage,
18
+ type
19
+ } = props;
20
+ useEffect(() => {
38
21
  if (type != 'alert') {
39
22
  setTimeout(() => {
40
23
  hideMessage();
41
24
  }, 3000);
42
25
  }
43
- }
44
-
45
- render() {
46
- return /*#__PURE__*/React.createElement(MessageUI, this.props);
47
- }
48
-
26
+ }, [showMessage]);
27
+ return /*#__PURE__*/React.createElement(MessageUI, props);
49
28
  }
50
29
  Message.propTypes = propTypes;
51
- Message.defaultProps = defaultProps; // if (__DOCS__) {
52
- // Message.docs = {
53
- // componentGroup: 'Atom'
54
- // };
55
- // }
56
-
30
+ Message.defaultProps = defaultProps;
57
31
  export function MessageUI(props) {
58
32
  function onClose(e) {
59
33
  let {
@@ -3,42 +3,30 @@ import { defaultProps } from '../../PlusIcon/props/defaultProps';
3
3
  import { propTypes } from '../../PlusIcon/props/propTypes';
4
4
  import style from '../../PlusIcon/PlusIcon.module.css';
5
5
  import AvatarIcon from '../avatar/AvatarIcon/AvatarIcon';
6
- export default class PlusIcon extends React.Component {
7
- constructor(props) {
8
- super(props);
9
- }
10
-
11
- render() {
12
- let {
13
- dataId,
14
- iconName,
15
- iconClass,
16
- iconSize,
17
- size,
18
- onClick,
19
- title,
20
- customClass
21
- } = this.props;
22
- return /*#__PURE__*/React.createElement("span", {
23
- className: style.container,
24
- onClick: onClick,
25
- "data-id": dataId,
26
- "data-test-id": dataId,
27
- "data-title": title
28
- }, /*#__PURE__*/React.createElement(AvatarIcon, {
29
- name: iconName,
30
- iconClass: `${iconClass} ${style.icon}`,
31
- iconSize: iconSize,
32
- size: size,
33
- className: `${customClass} ${style.plusIcon}`
34
- }));
35
- }
36
-
6
+ export default function PlusIcon(props) {
7
+ let {
8
+ dataId,
9
+ iconName,
10
+ iconClass,
11
+ iconSize,
12
+ size,
13
+ onClick,
14
+ title,
15
+ customClass
16
+ } = props;
17
+ return /*#__PURE__*/React.createElement("span", {
18
+ className: style.container,
19
+ onClick: onClick,
20
+ "data-id": dataId,
21
+ "data-test-id": dataId,
22
+ "data-title": title
23
+ }, /*#__PURE__*/React.createElement(AvatarIcon, {
24
+ name: iconName,
25
+ iconClass: `${iconClass} ${style.icon}`,
26
+ iconSize: iconSize,
27
+ size: size,
28
+ className: `${customClass} ${style.plusIcon}`
29
+ }));
37
30
  }
38
31
  PlusIcon.defaultProps = defaultProps;
39
- PlusIcon.propTypes = propTypes; // if (__DOCS__) {
40
- // PlusIcon.docs = {
41
- // componentGroup: 'Common',
42
- // folderName: 'Ticket DetailView'
43
- // };
44
- // }
32
+ PlusIcon.propTypes = propTypes;
@@ -3,58 +3,51 @@ import { Container, Box } from '@zohodesk/components/es/v1/Layout';
3
3
  import { defaultProps } from '../../Separator/props/defaultProps';
4
4
  import { propTypes } from '../../Separator/props/propTypes';
5
5
  import style from '../../Separator/Separator.module.css';
6
- export default class Separator extends React.Component {
7
- constructor(props) {
8
- super(props);
9
- }
10
-
11
- render() {
12
- const {
13
- children,
14
- type,
15
- customSeparatorType,
16
- palette,
17
- wrap,
18
- shrink,
19
- aligndirection,
20
- customClass
21
- } = this.props;
22
- const {
23
- customWrapper,
24
- customSeparator,
25
- customChildren
26
- } = customClass;
27
- const data = children.filter(el => el !== null && el !== undefined && el !== false);
28
- return /*#__PURE__*/React.createElement(Container, {
29
- alignBox: aligndirection,
30
- align: aligndirection === 'row' ? 'vertical' : '',
31
- wrap: wrap,
32
- isCover: false,
33
- className: `${style.varClass} ${customWrapper}`
34
- }, data.map((child, i) => {
35
- if (child) {
36
- if (data.length - 1 == i || aligndirection == 'column') {
37
- return child && /*#__PURE__*/React.createElement(Box, {
38
- shrink: shrink,
39
- key: i,
40
- className: customChildren
41
- }, child);
42
- }
43
-
44
- return child && /*#__PURE__*/React.createElement(React.Fragment, {
45
- key: i
46
- }, /*#__PURE__*/React.createElement(Box, {
6
+ export default function Separator(props) {
7
+ const {
8
+ children,
9
+ type,
10
+ customSeparatorType,
11
+ palette,
12
+ wrap,
13
+ shrink,
14
+ aligndirection,
15
+ customClass
16
+ } = props;
17
+ const {
18
+ customWrapper,
19
+ customSeparator,
20
+ customChildren
21
+ } = customClass;
22
+ const data = children.filter(el => el !== null && el !== undefined && el !== false);
23
+ return /*#__PURE__*/React.createElement(Container, {
24
+ alignBox: aligndirection,
25
+ align: aligndirection === 'row' ? 'vertical' : '',
26
+ wrap: wrap,
27
+ isCover: false,
28
+ className: `${style.varClass} ${customWrapper}`
29
+ }, data.map((child, i) => {
30
+ if (child) {
31
+ if (data.length - 1 == i || aligndirection == 'column') {
32
+ return child && /*#__PURE__*/React.createElement(Box, {
47
33
  shrink: shrink,
48
34
  key: i,
49
35
  className: customChildren
50
- }, child), /*#__PURE__*/React.createElement(Box, {
51
- className: `${style.separator} ${style[palette]} ${customSeparatorType ? '' : style[type]} ${customSeparator} `,
52
- key: i
53
- }, customSeparatorType ? customSeparatorType : type == 'slash' ? '/' : type == 'arrow' ? '>' : type == 'comma' ? ',' : '\u2022'));
36
+ }, child);
54
37
  }
55
- }));
56
- }
57
38
 
39
+ return child && /*#__PURE__*/React.createElement(React.Fragment, {
40
+ key: i
41
+ }, /*#__PURE__*/React.createElement(Box, {
42
+ shrink: shrink,
43
+ key: i,
44
+ className: customChildren
45
+ }, child), /*#__PURE__*/React.createElement(Box, {
46
+ className: `${style.separator} ${style[palette]} ${customSeparatorType ? '' : style[type]} ${customSeparator} `,
47
+ key: i
48
+ }, customSeparatorType ? customSeparatorType : type == 'slash' ? '/' : type == 'arrow' ? '>' : type == 'comma' ? ',' : '\u2022'));
49
+ }
50
+ }));
58
51
  }
59
52
  Separator.defaultProps = defaultProps;
60
53
  Separator.propTypes = propTypes;
@@ -5,72 +5,65 @@ import { Icon } from '@zohodesk/icons';
5
5
  import { Container, Box } from '@zohodesk/components/es/v1/Layout';
6
6
  import Image from '../Image/Image';
7
7
  import style from '../../Upload/Upload.module.css';
8
- export default class Upload extends React.Component {
9
- render() {
10
- let {
11
- isPreview,
12
- tooltip,
13
- dataId,
14
- dataSelectorId,
15
- progressValue,
16
- onClick,
17
- iconName,
18
- fileSize,
19
- imgSrc,
20
- isPreviewType,
21
- onRemove,
22
- size,
23
- getRef,
24
- palette
25
- } = this.props;
26
- return /*#__PURE__*/React.createElement(Container, {
27
- isInline: true,
28
- className: `${style.container} ${style[palette]} ${style[size]} ${isPreview ? style.preview : ''}
8
+ export default function Upload(props) {
9
+ let {
10
+ isPreview,
11
+ tooltip,
12
+ dataId,
13
+ dataSelectorId,
14
+ progressValue,
15
+ onClick,
16
+ iconName,
17
+ fileSize,
18
+ imgSrc,
19
+ isPreviewType,
20
+ onRemove,
21
+ size,
22
+ getRef,
23
+ palette
24
+ } = props;
25
+ return /*#__PURE__*/React.createElement(Container, {
26
+ isInline: true,
27
+ className: `${style.container} ${style[palette]} ${style[size]} ${isPreview ? style.preview : ''}
29
28
  `,
30
- dataId: dataId,
31
- "data-title": tooltip,
32
- isCover: false,
33
- eleRef: getRef,
34
- dataSelectorId: dataSelectorId
35
- }, /*#__PURE__*/React.createElement(React.Fragment, null, isPreview ? /*#__PURE__*/React.createElement("div", {
36
- "data-id": `${dataId}_attachLoading`,
37
- "data-test-id": `${dataId}_attachLoading`,
38
- className: style.loader,
39
- style: {
40
- width: `${progressValue}%`
41
- }
42
- }) : null, isPreviewType ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Image, {
43
- src: imgSrc,
44
- className: `${style.uploadimage} `,
45
- alt: "Uploaded Image",
46
- dataId: `${dataId}_fileName`
47
- }), /*#__PURE__*/React.createElement("div", {
48
- className: style.overlay,
49
- onClick: onClick
50
- })) : /*#__PURE__*/React.createElement(Box, {
51
- className: style.attachInfo,
52
- onClick: onClick,
53
- dataId: `${dataId}_openNewTab`
54
- }, /*#__PURE__*/React.createElement(Icon, {
55
- name: iconName,
56
- iconClass: style.fileIcon
57
- }), /*#__PURE__*/React.createElement("div", {
58
- className: style.attachsize
59
- }, fileSize))), typeof onRemove !== 'undefined' && onRemove != null ? /*#__PURE__*/React.createElement("span", {
60
- className: style.uploadclose,
61
- onClick: onRemove,
62
- "data-id": `${dataId}_deleteUpload`,
63
- "data-test-id": `${dataId}_deleteUpload`
64
- }, /*#__PURE__*/React.createElement(Icon, {
65
- name: "ZD-close",
66
- isBold: true
67
- })) : null);
68
- }
69
-
29
+ dataId: dataId,
30
+ "data-title": tooltip,
31
+ isCover: false,
32
+ eleRef: getRef,
33
+ dataSelectorId: dataSelectorId
34
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, isPreview ? /*#__PURE__*/React.createElement("div", {
35
+ "data-id": `${dataId}_attachLoading`,
36
+ "data-test-id": `${dataId}_attachLoading`,
37
+ className: style.loader,
38
+ style: {
39
+ width: `${progressValue}%`
40
+ }
41
+ }) : null, isPreviewType ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Image, {
42
+ src: imgSrc,
43
+ className: `${style.uploadimage} `,
44
+ alt: "Uploaded Image",
45
+ dataId: `${dataId}_fileName`
46
+ }), /*#__PURE__*/React.createElement("div", {
47
+ className: style.overlay,
48
+ onClick: onClick
49
+ })) : /*#__PURE__*/React.createElement(Box, {
50
+ className: style.attachInfo,
51
+ onClick: onClick,
52
+ dataId: `${dataId}_openNewTab`
53
+ }, /*#__PURE__*/React.createElement(Icon, {
54
+ name: iconName,
55
+ iconClass: style.fileIcon
56
+ }), /*#__PURE__*/React.createElement("div", {
57
+ className: style.attachsize
58
+ }, fileSize))), typeof onRemove !== 'undefined' && onRemove != null ? /*#__PURE__*/React.createElement("span", {
59
+ className: style.uploadclose,
60
+ onClick: onRemove,
61
+ "data-id": `${dataId}_deleteUpload`,
62
+ "data-test-id": `${dataId}_deleteUpload`
63
+ }, /*#__PURE__*/React.createElement(Icon, {
64
+ name: "ZD-close",
65
+ isBold: true
66
+ })) : null);
70
67
  }
71
68
  Upload.propTypes = propTypes;
72
- Upload.defaultProps = defaultProps; // if (__DOCS__) {
73
- // Upload.docs = {
74
- // componentGroup: 'Upload'
75
- // };
76
- // }
69
+ Upload.defaultProps = defaultProps;
@@ -10,8 +10,8 @@ import { mergeStyle } from '@zohodesk/utils'; //customHooks
10
10
 
11
11
  import useDragger from '../../../Hooks/Dragger/useDragger'; //Props
12
12
 
13
- import defaultProps from '../../../version2/lookup/AlertHeader/props/defaultProps';
14
- import propTypes from '../../../version2/lookup/AlertHeader/props/propTypes';
13
+ import defaultProps from './props/defaultProps';
14
+ import propTypes from './props/propTypes';
15
15
  export default function AlertHeader(props) {
16
16
  const {
17
17
  title,
@@ -24,7 +24,8 @@ export default function AlertHeader(props) {
24
24
  type,
25
25
  htmlId,
26
26
  customStyle,
27
- dragBoundaryLimit
27
+ dragBoundaryLimit,
28
+ renderAlertIcon
28
29
  } = props;
29
30
  const finalStyle = mergeStyle(style, customStyle);
30
31
  const {
@@ -51,7 +52,7 @@ export default function AlertHeader(props) {
51
52
  eleRef: dragRef
52
53
  }, needIcon && /*#__PURE__*/React.createElement("div", {
53
54
  className: finalStyle.iconContainer
54
- }, /*#__PURE__*/React.createElement(AlertIcons, {
55
+ }, renderAlertIcon ? renderAlertIcon() : /*#__PURE__*/React.createElement(AlertIcons, {
55
56
  type: type
56
57
  })), (title || children) && /*#__PURE__*/React.createElement(Box, {
57
58
  flexible: true
@@ -0,0 +1,12 @@
1
+ export default {
2
+ needIcon: true,
3
+ type: 'danger',
4
+ breakChildren: false,
5
+ dataId: 'alertHeader',
6
+ dragBoundaryLimit: {
7
+ top: 0,
8
+ left: 50,
9
+ right: 50,
10
+ bottom: 50
11
+ }
12
+ };
@@ -0,0 +1,20 @@
1
+ import PropTypes from 'prop-types';
2
+ export default {
3
+ breakChildren: PropTypes.bool,
4
+ children: PropTypes.node,
5
+ closeTitle: PropTypes.string,
6
+ dataId: PropTypes.string,
7
+ needIcon: PropTypes.bool,
8
+ onClose: PropTypes.func,
9
+ title: PropTypes.string,
10
+ type: PropTypes.oneOf(['success', 'error', 'danger', 'warning', 'info', 'notification']),
11
+ htmlId: PropTypes.string,
12
+ customStyle: PropTypes.object,
13
+ dragBoundaryLimit: PropTypes.shape({
14
+ top: PropTypes.number,
15
+ left: PropTypes.number,
16
+ right: PropTypes.number,
17
+ bottom: PropTypes.number
18
+ }),
19
+ renderAlertIcon: PropTypes.func
20
+ };
@@ -2,8 +2,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
2
2
 
3
3
  /**** Libraries ****/
4
4
  import React from 'react';
5
- import { defaultProps } from '../../../version2/lookup/AlertLookup/props/defaultProps';
6
- import { propTypes } from '../../../version2/lookup/AlertLookup/props/propTypes';
5
+ import { defaultProps } from './props/defaultProps';
6
+ import { propTypes } from './props/propTypes';
7
7
  /**** Components ****/
8
8
 
9
9
  import { useUniqueId } from '@zohodesk/components/es/v1/Provider/IdProvider';
@@ -65,7 +65,8 @@ export default function AlertLookup(props) {
65
65
  isHtmlContent,
66
66
  scroll,
67
67
  isDefaultFocus,
68
- onEsc
68
+ onEsc,
69
+ renderAlertIcon
69
70
  } = props;
70
71
  const {
71
72
  LookupProps = {},
@@ -115,7 +116,8 @@ export default function AlertLookup(props) {
115
116
  type: type,
116
117
  needIcon: needIcon,
117
118
  onClose: onClose,
118
- breakChildren: wrapHeader
119
+ breakChildren: wrapHeader,
120
+ renderAlertIcon: renderAlertIcon
119
121
  }, AlertHeaderProps), headerChildren ? headerChildren() : null)), /*#__PURE__*/React.createElement(Box, {
120
122
  flexible: true
121
123
  }, /*#__PURE__*/React.createElement("div", {
@@ -0,0 +1,13 @@
1
+ export const defaultProps = {
2
+ isActive: false,
3
+ size: 'small',
4
+ wrapHeader: false,
5
+ dataId: 'alertPopup',
6
+ isDefaultFocus: true,
7
+ customProps: {},
8
+ align: 'top',
9
+ childAnimationName: 'flyDown',
10
+ isHtmlContent: false,
11
+ scroll: '',
12
+ onEsc: 'cancel'
13
+ };
@@ -0,0 +1,36 @@
1
+ import PropTypes from 'prop-types';
2
+ export const propTypes = {
3
+ cancelText: PropTypes.string,
4
+ children: PropTypes.node,
5
+ confirmationMessage: PropTypes.string,
6
+ customClass: PropTypes.object,
7
+ dataId: PropTypes.string,
8
+ forwardRef: PropTypes.object,
9
+ headerChildren: PropTypes.func,
10
+ isActive: PropTypes.bool,
11
+ isDefaultFocus: PropTypes.bool,
12
+ message: PropTypes.node,
13
+ needIcon: PropTypes.bool,
14
+ onCancelClick: PropTypes.func,
15
+ onClose: PropTypes.func,
16
+ onLookupClick: PropTypes.func,
17
+ onSubmitClick: PropTypes.func,
18
+ size: PropTypes.oneOf(['small', 'xmedium', 'medium']),
19
+ submitText: PropTypes.string,
20
+ title: PropTypes.string,
21
+ type: PropTypes.oneOf(['success', 'error', 'danger', 'warning', 'info', 'notification']),
22
+ wrapHeader: PropTypes.bool,
23
+ a11y: PropTypes.object,
24
+ customProps: PropTypes.shape({
25
+ LookupProps: PropTypes.object,
26
+ AlertHeaderProps: PropTypes.object,
27
+ PrimaryButtonProps: PropTypes.object,
28
+ SecondaryButtonProps: PropTypes.object
29
+ }),
30
+ align: PropTypes.oneOf(['top', 'vertical']),
31
+ childAnimationName: PropTypes.oneOf(['expand', 'flyDown']),
32
+ isHtmlContent: PropTypes.bool,
33
+ scroll: PropTypes.oneOf(['horizontal', 'vertical', 'both']),
34
+ onEsc: PropTypes.oneOf(['close', 'cancel']),
35
+ renderAlertIcon: PropTypes.func
36
+ };