@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,246 @@
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 = _interopRequireDefault(require("react"));
11
+
12
+ var _defaultProps = require("../../Avatar/props/defaultProps");
13
+
14
+ var _propTypes = require("../../Avatar/props/propTypes");
15
+
16
+ var _getInitial = require("../../utils/getInitial");
17
+
18
+ var _AvatarSize = _interopRequireDefault(require("../../Provider/AvatarSize"));
19
+
20
+ var _AvatarModule = _interopRequireDefault(require("../../Avatar/Avatar.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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
27
+
28
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
29
+
30
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
31
+
32
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
33
+
34
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
35
+
36
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
37
+
38
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
39
+
40
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
41
+
42
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
43
+
44
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
45
+
46
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
47
+
48
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
49
+
50
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
51
+
52
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
53
+
54
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
55
+
56
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
57
+
58
+ /*
59
+ 1. need to change name into firstName lastName
60
+ 2. pattern support via context as well as props
61
+ 3. prop high priority to arrange firstName lastName
62
+ 4. team pass name as lastName and pass pattern via prop
63
+ */
64
+ var Avatar = /*#__PURE__*/function (_React$Component) {
65
+ _inherits(Avatar, _React$Component);
66
+
67
+ var _super = _createSuper(Avatar);
68
+
69
+ function Avatar(props) {
70
+ var _this;
71
+
72
+ _classCallCheck(this, Avatar);
73
+
74
+ _this = _super.call(this, props);
75
+ _this.state = {
76
+ isLoaded: false
77
+ };
78
+ _this.putInvalidImageURLJSON = _this.putInvalidImageURLJSON.bind(_assertThisInitialized(_this));
79
+ _this.putValidImageURLJSON = _this.putValidImageURLJSON.bind(_assertThisInitialized(_this));
80
+ _this.getInitialByFullName = _this.getInitialByFullName.bind(_assertThisInitialized(_this));
81
+ return _this;
82
+ }
83
+
84
+ _createClass(Avatar, [{
85
+ key: "componentDidUpdate",
86
+ value: function componentDidUpdate(prevProps, prevState) {
87
+ var src = this.props.src;
88
+ var isLoaded = this.state.isLoaded;
89
+
90
+ if (prevProps.src !== src) {
91
+ this.setState({
92
+ isLoaded: !isLoaded
93
+ });
94
+ }
95
+ }
96
+ }, {
97
+ key: "putInvalidImageURLJSON",
98
+ value: function putInvalidImageURLJSON() {
99
+ var _this$props = this.props,
100
+ src = _this$props.src,
101
+ alternateSrc = _this$props.alternateSrc;
102
+ var isLoaded = this.state.isLoaded;
103
+
104
+ var _validImgArr = _toConsumableArray(Avatar.validImageURLs);
105
+
106
+ var _invalidImgArr = _toConsumableArray(Avatar.invalidImageURLs); // if (alternateSrc) {
107
+ // _validImgArr.push(alternateSrc);
108
+ // }
109
+
110
+
111
+ var validIndex = _validImgArr.indexOf(src);
112
+
113
+ if (validIndex !== -1) {
114
+ _validImgArr.splice(validIndex, 1);
115
+ }
116
+
117
+ _invalidImgArr.push(src);
118
+
119
+ Avatar.invalidImageURLs = _invalidImgArr;
120
+ Avatar.validImageURLs = _validImgArr;
121
+ this.setState({
122
+ isLoaded: !isLoaded
123
+ });
124
+ }
125
+ }, {
126
+ key: "putValidImageURLJSON",
127
+ value: function putValidImageURLJSON() {
128
+ var src = this.props.src;
129
+ var isLoaded = this.state.isLoaded;
130
+ var validImgArr = Avatar.validImageURLs;
131
+ var invalidImgArr = Avatar.invalidImageURLs;
132
+
133
+ if (src && validImgArr.indexOf(src) === -1 && invalidImgArr.indexOf(src) === -1) {
134
+ var _validImgArr = _toConsumableArray(validImgArr);
135
+
136
+ _validImgArr.push(src);
137
+
138
+ Avatar.validImageURLs = _validImgArr;
139
+ this.setState({
140
+ isLoaded: !isLoaded
141
+ });
142
+ }
143
+ }
144
+ /* this will cause error if user name already have some space need to move firstName lastName user preference pattern*/
145
+
146
+ }, {
147
+ key: "getInitialByFullName",
148
+ value: function getInitialByFullName() {
149
+ var fullName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
150
+ fullName = (fullName || '').trim();
151
+ var nameList = fullName.split(' ');
152
+
153
+ if (nameList.length === 1) {
154
+ return (0, _getInitial.getInitial)('', nameList[0]);
155
+ }
156
+
157
+ return (0, _getInitial.getInitial)(nameList[0], nameList[1]);
158
+ } // componentDidMount() {
159
+ // const { src } = this.props;
160
+ // const validImgArr = Avatar.validImageURLs;
161
+ // if (validImgArr.indexOf(src) === -1) {
162
+ // let _validImgArr = [...validImgArr];
163
+ // _validImgArr.push(src);
164
+ // }
165
+ // }
166
+
167
+ }, {
168
+ key: "render",
169
+ value: function render() {
170
+ var _this$props2 = this.props,
171
+ src = _this$props2.src,
172
+ name = _this$props2.name,
173
+ size = _this$props2.size,
174
+ palette = _this$props2.palette,
175
+ onClick = _this$props2.onClick,
176
+ title = _this$props2.title,
177
+ shape = _this$props2.shape,
178
+ needTitle = _this$props2.needTitle,
179
+ dataId = _this$props2.dataId,
180
+ initial = _this$props2.initial,
181
+ needBorder = _this$props2.needBorder,
182
+ borderOnActive = _this$props2.borderOnActive,
183
+ borderOnHover = _this$props2.borderOnHover,
184
+ textPalette = _this$props2.textPalette,
185
+ customClass = _this$props2.customClass,
186
+ alternateSrc = _this$props2.alternateSrc,
187
+ isAnimate = _this$props2.isAnimate,
188
+ dataSelectorId = _this$props2.dataSelectorId,
189
+ customProps = _this$props2.customProps,
190
+ needInnerBorder = _this$props2.needInnerBorder,
191
+ needDefaultBorder = _this$props2.needDefaultBorder;
192
+ var _customProps$AvatarPr = customProps.AvatarProps,
193
+ AvatarProps = _customProps$AvatarPr === void 0 ? {} : _customProps$AvatarPr;
194
+ var textStyle = textPalette ? _AvatarModule["default"][textPalette] : palette === 'secondary' ? _AvatarModule["default"].white : _AvatarModule["default"].black;
195
+ var shapeStyle = shape === 'circle' ? 'circle' : "square_".concat(size);
196
+ initial = initial || this.getInitialByFullName(name);
197
+ var isInvalidImageList = Avatar.invalidImageURLs.indexOf(src) !== -1; //let isValidImageList = Avatar.validImageURLs.indexOf(src) !== -1;
198
+
199
+ var showAvatar = src && !isInvalidImageList;
200
+ var showInitial = !showAvatar || showAvatar && isInvalidImageList;
201
+ var showAlternateAvatar = alternateSrc ? showInitial : false;
202
+ var border = borderOnHover || onClick;
203
+ var showDefaultBorder = src && !isInvalidImageList && needDefaultBorder;
204
+ var borderStyle = (showDefaultBorder || !src || !showAvatar || showInitial) && needBorder ? "".concat(_AvatarModule["default"].border, " ").concat(borderOnActive ? _AvatarModule["default"].borderOnActive : border ? _AvatarModule["default"].borderOnHover : '', " ") : '';
205
+ borderStyle = showAlternateAvatar ? '' : borderStyle;
206
+ return /*#__PURE__*/_react["default"].createElement("div", _extends({
207
+ className: "".concat(_AvatarModule["default"].avatar, " ").concat(_AvatarModule["default"][size], " ").concat((0, _AvatarSize["default"])(size), " ").concat(_AvatarModule["default"][shapeStyle], " ").concat(_AvatarModule["default"][palette], " ").concat(textStyle, " ").concat(borderStyle, " ").concat(customClass ? customClass : ''),
208
+ "data-title": needTitle ? title ? title : name : null,
209
+ "data-id": dataId,
210
+ "data-test-id": dataId,
211
+ onClick: onClick,
212
+ "data-selector-id": dataSelectorId
213
+ }, AvatarProps), showInitial && !showAlternateAvatar && /*#__PURE__*/_react["default"].createElement("span", {
214
+ className: "".concat(_AvatarModule["default"].initial),
215
+ "data-id": "".concat(dataId, "_AvatarInitial"),
216
+ "data-test-id": "".concat(dataId, "_AvatarInitial"),
217
+ "data-selector-id": "".concat(dataSelectorId, "_AvatarInitial")
218
+ }, initial), (showAvatar || showAlternateAvatar) && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("img", {
219
+ className: "".concat(_AvatarModule["default"].image, " ").concat(isAnimate ? _AvatarModule["default"].animate : '', " ").concat(needInnerBorder ? _AvatarModule["default"].innerBorder : ''),
220
+ "data-id": "".concat(dataId, "_AvatarImg"),
221
+ "data-test-id": "".concat(dataId, "_AvatarImg"),
222
+ "data-selector-id": "".concat(dataSelectorId, "_AvatarImg"),
223
+ name: name,
224
+ onError: this.putInvalidImageURLJSON,
225
+ onLoad: this.putValidImageURLJSON,
226
+ src: showAlternateAvatar ? alternateSrc : src,
227
+ alt: name
228
+ }), showDefaultBorder ? null : /*#__PURE__*/_react["default"].createElement("span", {
229
+ className: "".concat(_AvatarModule["default"].shadow, " ").concat(textStyle, " ")
230
+ })));
231
+ }
232
+ }]);
233
+
234
+ return Avatar;
235
+ }(_react["default"].Component);
236
+
237
+ exports["default"] = Avatar;
238
+ Avatar.defaultProps = _defaultProps.defaultProps;
239
+ Avatar.propTypes = _propTypes.propTypes;
240
+ Avatar.invalidImageURLs = [];
241
+ Avatar.validImageURLs = []; // if (__DOCS__) {
242
+ // Avatar.docs = {
243
+ // componentGroup: 'Avatar Group',
244
+ // folderName: 'Style Guide'
245
+ // };
246
+ // }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = AvatarTeam;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _defaultProps = require("../../AvatarTeam/props/defaultProps");
11
+
12
+ var _propTypes = require("../../AvatarTeam/props/propTypes");
13
+
14
+ var _Avatar = _interopRequireDefault(require("../Avatar/Avatar"));
15
+
16
+ var _AvatarTeamModule = _interopRequireDefault(require("../../AvatarTeam/AvatarTeam.module.css"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ 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); }
21
+
22
+ /* once avatar support firstname lastname and pattern
23
+ pass lastName as team name and pattern ["FIRST_NAME","LAST_NAME"] as props
24
+
25
+ Not going to export to external then can kept inside supportapp
26
+ */
27
+ function AvatarTeam(props) {
28
+ var src = props.src,
29
+ name = props.name,
30
+ size = props.size,
31
+ palette = props.palette,
32
+ textPalette = props.textPalette,
33
+ onClick = props.onClick,
34
+ title = props.title,
35
+ isFilled = props.isFilled,
36
+ dataId = props.dataId,
37
+ needTitle = props.needTitle,
38
+ customClass = props.customClass,
39
+ borderOnActive = props.borderOnActive,
40
+ borderOnHover = props.borderOnHover,
41
+ dataSelectorId = props.dataSelectorId,
42
+ customProps = props.customProps,
43
+ needInnerBorder = props.needInnerBorder,
44
+ needBorder = props.needBorder,
45
+ needDefaultBorder = props.needDefaultBorder;
46
+ var _customProps$AvatarTe = customProps.AvatarTeamProps,
47
+ AvatarTeamProps = _customProps$AvatarTe === void 0 ? {} : _customProps$AvatarTe,
48
+ _customProps$AvatarPr = customProps.AvatarProps,
49
+ AvatarProps = _customProps$AvatarPr === void 0 ? {} : _customProps$AvatarPr;
50
+ var _customClass$customAv = customClass.customAvatar,
51
+ customAvatar = _customClass$customAv === void 0 ? '' : _customClass$customAv,
52
+ _customClass$customAv2 = customClass.customAvatarTeam,
53
+ customAvatarTeam = _customClass$customAv2 === void 0 ? '' : _customClass$customAv2;
54
+ var border = borderOnHover || onClick;
55
+ return /*#__PURE__*/_react["default"].createElement("span", _extends({
56
+ className: "".concat(_AvatarTeamModule["default"].container, " ").concat(borderOnActive ? _AvatarTeamModule["default"].borderOnActive : border ? _AvatarTeamModule["default"].borderOnHover : '', " "),
57
+ "data-id": dataId,
58
+ "data-test-id": dataId,
59
+ "data-selector-id": dataSelectorId
60
+ }, AvatarTeamProps), /*#__PURE__*/_react["default"].createElement(_Avatar["default"], _extends({
61
+ name: name,
62
+ onClick: onClick,
63
+ palette: palette,
64
+ textPalette: textPalette,
65
+ size: size,
66
+ src: src,
67
+ title: title,
68
+ needTitle: needTitle,
69
+ customClass: customAvatar,
70
+ borderOnActive: borderOnActive,
71
+ borderOnHover: border,
72
+ needInnerBorder: needInnerBorder,
73
+ needBorder: needBorder,
74
+ needDefaultBorder: needDefaultBorder
75
+ }, AvatarProps)), /*#__PURE__*/_react["default"].createElement("span", {
76
+ className: "".concat(_AvatarTeamModule["default"].team, " ").concat(isFilled ? "".concat(_AvatarTeamModule["default"]["".concat(palette, "Filled")]) : _AvatarTeamModule["default"].nofill, " \n ").concat(_AvatarTeamModule["default"]["".concat(size, "team")], " ").concat(customAvatarTeam)
77
+ }));
78
+ }
79
+
80
+ AvatarTeam.defaultProps = _defaultProps.defaultProps;
81
+ AvatarTeam.propTypes = _propTypes.propTypes;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = Button;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _defaultProps = require("../../Button/props/defaultProps");
11
+
12
+ var _propTypes = require("../../Button/props/propTypes");
13
+
14
+ var _cssJSLogic2 = _interopRequireDefault(require("../../Button/css/cssJSLogic"));
15
+
16
+ var _utils = require("@zohodesk/utils");
17
+
18
+ var _ButtonModule = _interopRequireDefault(require("../../Button/css/Button.module.css"));
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
+
22
+ 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); }
23
+
24
+ /*
25
+ Button text and children props?
26
+ use children for both cases
27
+ toLowerCase check needed?
28
+ */
29
+ function Button(props) {
30
+ var text = props.text,
31
+ disabled = props.disabled,
32
+ onClick = props.onClick,
33
+ status = props.status,
34
+ children = props.children,
35
+ dataId = props.dataId,
36
+ needAppearance = props.needAppearance,
37
+ getRef = props.getRef,
38
+ title = props.title,
39
+ dataSelectorId = props.dataSelectorId,
40
+ customProps = props.customProps,
41
+ customStyle = props.customStyle,
42
+ a11y = props.a11y,
43
+ id = props.id;
44
+ var finalStyle = (0, _utils.mergeStyle)(_ButtonModule["default"], customStyle);
45
+
46
+ var _cssJSLogic = (0, _cssJSLogic2["default"])({
47
+ props: props,
48
+ style: finalStyle
49
+ }),
50
+ buttonClass = _cssJSLogic.buttonClass,
51
+ loaderParentClass = _cssJSLogic.loaderParentClass,
52
+ loaderChildClass = _cssJSLogic.loaderChildClass;
53
+
54
+ var statusLower = status.toLowerCase();
55
+ return /*#__PURE__*/_react["default"].createElement("button", _extends({
56
+ className: buttonClass,
57
+ "data-id": disabled ? "".concat(dataId, "_disabled") : dataId,
58
+ "data-test-id": disabled ? "".concat(dataId, "_disabled") : dataId,
59
+ disabled: disabled || statusLower === 'loading',
60
+ onClick: onClick,
61
+ "data-title": title,
62
+ type: "button",
63
+ ref: getRef,
64
+ "data-selector-id": dataSelectorId
65
+ }, customProps, a11y, {
66
+ id: id
67
+ }), children ? children : text, statusLower !== 'none' && needAppearance && /*#__PURE__*/_react["default"].createElement("div", {
68
+ className: finalStyle.overlay
69
+ }, /*#__PURE__*/_react["default"].createElement("div", {
70
+ className: loaderParentClass
71
+ }, /*#__PURE__*/_react["default"].createElement("div", {
72
+ className: loaderChildClass
73
+ }))));
74
+ }
75
+
76
+ Button.defaultProps = _defaultProps.defaultProps;
77
+ Button.propTypes = _propTypes.propTypes; // if (__DOCS__) {
78
+ // Button.docs = {
79
+ // componentGroup: 'Form Elements',
80
+ // folderName: 'Style Guide'
81
+ // };
82
+ // }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = Buttongroup;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _defaultProps = require("../../Buttongroup/props/defaultProps");
11
+
12
+ var _propTypes = require("../../Buttongroup/props/propTypes");
13
+
14
+ var _ButtongroupModule = _interopRequireDefault(require("../../Buttongroup/Buttongroup.module.css"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
+
18
+ function Buttongroup(props) {
19
+ var children = props.children,
20
+ type = props.type,
21
+ buttonPosition = props.buttonPosition,
22
+ customClass = props.customClass,
23
+ dataId = props.dataId,
24
+ dataSelectorId = props.dataSelectorId;
25
+ var btnGroup = [];
26
+ children && children.forEach(function (child) {
27
+ var btnRight = /*#__PURE__*/_react["default"].createElement("span", {
28
+ className: _ButtongroupModule["default"][type]
29
+ }, child);
30
+
31
+ btnGroup.push(btnRight);
32
+ });
33
+ return /*#__PURE__*/_react["default"].createElement("div", {
34
+ className: "".concat(_ButtongroupModule["default"].buttonGroup, " ").concat(_ButtongroupModule["default"][type], " ").concat(customClass ? customClass : ''),
35
+ "data-id": dataId,
36
+ "data-test-id": dataId,
37
+ "data-selector-id": dataSelectorId
38
+ }, /*#__PURE__*/_react["default"].createElement("div", {
39
+ className: _ButtongroupModule["default"]["align".concat(buttonPosition)]
40
+ }, children));
41
+ }
42
+
43
+ Buttongroup.defaultProps = _defaultProps.defaultProps;
44
+ Buttongroup.propTypes = _propTypes.propTypes;