@zohodesk/components 1.0.0-temp-38 → 1.0.0-temp-42

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 (280) hide show
  1. package/README.md +68 -20
  2. package/es/AppContainer/AppContainer.js +47 -6
  3. package/es/Appearance/dark/mode/darkMode.module.css +355 -402
  4. package/es/Appearance/dark/themes/blue/blueDarkCTATheme.module.css +33 -33
  5. package/es/Appearance/dark/themes/blue/blueDarkComponentTheme.module.css +41 -30
  6. package/es/Appearance/dark/themes/green/greenDarkCTATheme.module.css +32 -32
  7. package/es/Appearance/dark/themes/green/greenDarkComponentTheme.module.css +40 -29
  8. package/es/Appearance/dark/themes/orange/orangeDarkCTATheme.module.css +32 -32
  9. package/es/Appearance/dark/themes/orange/orangeDarkComponentTheme.module.css +40 -29
  10. package/es/Appearance/dark/themes/red/redDarkCTATheme.module.css +32 -32
  11. package/es/Appearance/dark/themes/red/redDarkComponentTheme.module.css +40 -29
  12. package/es/Appearance/dark/themes/yellow/yellowDarkCTATheme.module.css +32 -32
  13. package/es/Appearance/dark/themes/yellow/yellowDarkComponentTheme.module.css +40 -29
  14. package/es/Appearance/default/mode/defaultMode.module.css +356 -403
  15. package/es/Appearance/default/themes/blue/blueDefaultCTATheme.module.css +33 -33
  16. package/es/Appearance/default/themes/blue/blueDefaultComponentTheme.module.css +41 -30
  17. package/es/Appearance/default/themes/green/greenDefaultCTATheme.module.css +32 -32
  18. package/es/Appearance/default/themes/green/greenDefaultComponentTheme.module.css +40 -29
  19. package/es/Appearance/default/themes/orange/orangeDefaultCTATheme.module.css +32 -32
  20. package/es/Appearance/default/themes/orange/orangeDefaultComponentTheme.module.css +40 -29
  21. package/es/Appearance/default/themes/red/redDefaultCTATheme.module.css +32 -32
  22. package/es/Appearance/default/themes/red/redDefaultComponentTheme.module.css +40 -29
  23. package/es/Appearance/default/themes/yellow/yellowDefaultCTATheme.module.css +32 -32
  24. package/es/Appearance/default/themes/yellow/yellowDefaultComponentTheme.module.css +40 -29
  25. package/es/Button/Button.module.css +7 -7
  26. package/es/ListItem/ListItemWithAvatar.js +11 -3
  27. package/es/ListItem/ListItemWithIcon.js +12 -4
  28. package/es/MultiSelect/AdvancedMultiSelect.js +21 -9
  29. package/es/MultiSelect/MultiSelect.js +9 -2
  30. package/es/MultiSelect/Suggestions.js +11 -2
  31. package/es/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +18 -3
  32. package/es/Provider/Config.js +2 -1
  33. package/es/Provider.js +8 -2
  34. package/es/Responsive/ResizeComponent.js +1 -1
  35. package/es/Select/GroupSelect.js +4 -4
  36. package/es/Select/Select.js +51 -10
  37. package/es/Select/docs/Select__default.docs.js +79 -0
  38. package/es/Stencils/Stencils.js +1 -1
  39. package/es/Tab/Tabs.js +14 -2
  40. package/es/Tag/Tag.module.css +1 -0
  41. package/es/TextBox/TextBox.js +7 -4
  42. package/es/TextBoxIcon/TextBoxIcon.js +13 -4
  43. package/es/common/animation.module.css +12 -0
  44. package/es/utils/Common.js +1 -1
  45. package/es/utils/ContextOptimizer.js +1 -1
  46. package/es/utils/dropDownUtils.js +12 -5
  47. package/es/utils/shallowEqual.js +32 -0
  48. package/lib/Accordion/Accordion.js +3 -3
  49. package/lib/Accordion/AccordionItem.js +3 -3
  50. package/lib/Accordion/docs/Accordion__Demo.docs.js +3 -3
  51. package/lib/Animation/Animation.js +3 -3
  52. package/lib/Animation/docs/Animation__default.docs.js +3 -3
  53. package/lib/Animation/docs/Animation__fadeIn.docs.js +3 -3
  54. package/lib/Animation/docs/Animation__scaleIn.docs.js +3 -3
  55. package/lib/Animation/docs/Animation__skewIn.docs.js +3 -3
  56. package/lib/Animation/docs/Animation__slideDown.docs.js +3 -3
  57. package/lib/Animation/docs/Animation__slideLeft.docs.js +3 -3
  58. package/lib/Animation/docs/Animation__zoomIn.docs.js +3 -3
  59. package/lib/AppContainer/AppContainer.js +59 -10
  60. package/lib/AppContainer/docs/AppContainer__default.docs.js +3 -3
  61. package/lib/Appearance/dark/mode/darkMode.module.css +355 -402
  62. package/lib/Appearance/dark/themes/blue/blueDarkCTATheme.module.css +33 -33
  63. package/lib/Appearance/dark/themes/blue/blueDarkComponentTheme.module.css +41 -30
  64. package/lib/Appearance/dark/themes/green/greenDarkCTATheme.module.css +32 -32
  65. package/lib/Appearance/dark/themes/green/greenDarkComponentTheme.module.css +40 -29
  66. package/lib/Appearance/dark/themes/orange/orangeDarkCTATheme.module.css +32 -32
  67. package/lib/Appearance/dark/themes/orange/orangeDarkComponentTheme.module.css +40 -29
  68. package/lib/Appearance/dark/themes/red/redDarkCTATheme.module.css +32 -32
  69. package/lib/Appearance/dark/themes/red/redDarkComponentTheme.module.css +40 -29
  70. package/lib/Appearance/dark/themes/yellow/yellowDarkCTATheme.module.css +32 -32
  71. package/lib/Appearance/dark/themes/yellow/yellowDarkComponentTheme.module.css +40 -29
  72. package/lib/Appearance/default/mode/defaultMode.module.css +356 -403
  73. package/lib/Appearance/default/themes/blue/blueDefaultCTATheme.module.css +33 -33
  74. package/lib/Appearance/default/themes/blue/blueDefaultComponentTheme.module.css +41 -30
  75. package/lib/Appearance/default/themes/green/greenDefaultCTATheme.module.css +32 -32
  76. package/lib/Appearance/default/themes/green/greenDefaultComponentTheme.module.css +40 -29
  77. package/lib/Appearance/default/themes/orange/orangeDefaultCTATheme.module.css +32 -32
  78. package/lib/Appearance/default/themes/orange/orangeDefaultComponentTheme.module.css +40 -29
  79. package/lib/Appearance/default/themes/red/redDefaultCTATheme.module.css +32 -32
  80. package/lib/Appearance/default/themes/red/redDefaultComponentTheme.module.css +40 -29
  81. package/lib/Appearance/default/themes/yellow/yellowDefaultCTATheme.module.css +32 -32
  82. package/lib/Appearance/default/themes/yellow/yellowDefaultComponentTheme.module.css +40 -29
  83. package/lib/Avatar/Avatar.js +3 -3
  84. package/lib/Avatar/docs/Avatar__custom.docs.js +3 -3
  85. package/lib/Avatar/docs/Avatar__default.docs.js +3 -3
  86. package/lib/Avatar/docs/Avatar__palette.docs.js +3 -3
  87. package/lib/Avatar/docs/Avatar__text.docs.js +3 -3
  88. package/lib/AvatarTeam/AvatarTeam.js +3 -3
  89. package/lib/AvatarTeam/docs/AvatarTeam__custom.docs.js +3 -3
  90. package/lib/AvatarTeam/docs/AvatarTeam__default.docs.js +3 -3
  91. package/lib/AvatarTeam/docs/AvatarTeam__palette.docs.js +3 -3
  92. package/lib/AvatarTeam/docs/AvatarTeam__size.docs.js +3 -3
  93. package/lib/Button/Button.js +3 -3
  94. package/lib/Button/Button.module.css +7 -7
  95. package/lib/Button/docs/Button__custom.docs.js +3 -3
  96. package/lib/Button/docs/Button__default.docs.js +3 -3
  97. package/lib/Buttongroup/Buttongroup.js +3 -3
  98. package/lib/Buttongroup/docs/Buttongroup__custom.docs.js +3 -3
  99. package/lib/Buttongroup/docs/Buttongroup__footer.docs.js +3 -3
  100. package/lib/Buttongroup/docs/Buttongroup__header.docs.js +3 -3
  101. package/lib/Card/Card.js +3 -3
  102. package/lib/Card/__tests__/Card.spec.js +1 -1
  103. package/lib/Card/docs/Card__Custom.docs.js +3 -3
  104. package/lib/Card/docs/Card__Default.docs.js +3 -3
  105. package/lib/Card/docs/Card__Scroll.docs.js +3 -3
  106. package/lib/Card/index.js +1 -1
  107. package/lib/CheckBox/CheckBox.js +3 -3
  108. package/lib/CheckBox/docs/CheckBox__custom.docs.js +3 -3
  109. package/lib/CheckBox/docs/CheckBox__default.docs.js +3 -3
  110. package/lib/DateTime/CalendarView.js +3 -3
  111. package/lib/DateTime/DateTime.js +3 -3
  112. package/lib/DateTime/DateTimePopupFooter.js +3 -3
  113. package/lib/DateTime/DateTimePopupHeader.js +3 -3
  114. package/lib/DateTime/DateWidget.js +3 -3
  115. package/lib/DateTime/DaysRow.js +3 -3
  116. package/lib/DateTime/Time.js +3 -3
  117. package/lib/DateTime/YearView.js +3 -3
  118. package/lib/DateTime/__tests__/CalendarView.spec.js +1 -1
  119. package/lib/DateTime/__tests__/DateTime.spec.js +1 -1
  120. package/lib/DateTime/docs/DateTime__default.docs.js +3 -3
  121. package/lib/DateTime/docs/DateWidget__default.docs.js +3 -3
  122. package/lib/DateTime/objectUtils.js +1 -1
  123. package/lib/DropBox/DropBox.js +3 -3
  124. package/lib/DropBox/docs/DropBox__custom.docs.js +3 -3
  125. package/lib/DropBox/docs/DropBox__customOrder.docs.js +3 -3
  126. package/lib/DropBox/docs/DropBox__fixedPosition.docs.js +3 -3
  127. package/lib/DropBox/docs/DropBox__position.docs.js +3 -3
  128. package/lib/DropBox/docs/DropBox__size.docs.js +3 -3
  129. package/lib/DropDown/DropDown.js +3 -3
  130. package/lib/DropDown/DropDownHeading.js +3 -3
  131. package/lib/DropDown/DropDownItem.js +3 -3
  132. package/lib/DropDown/DropDownSearch.js +3 -3
  133. package/lib/DropDown/DropDownSeparator.js +3 -3
  134. package/lib/DropDown/docs/DropDownHeading__custom.docs.js +3 -3
  135. package/lib/DropDown/docs/DropDownHeading__default.docs.js +3 -3
  136. package/lib/Label/Label.js +3 -3
  137. package/lib/Label/docs/Label__clipped.docs.js +3 -3
  138. package/lib/Label/docs/Label__custom.docs.js +3 -3
  139. package/lib/Label/docs/Label__palette.docs.js +3 -3
  140. package/lib/Label/docs/Label__size.docs.js +3 -3
  141. package/lib/Label/docs/Label__type.docs.js +3 -3
  142. package/lib/Layout/docs/Layout__Hidden.docs.js +3 -3
  143. package/lib/Layout/docs/Layout__default.docs.js +3 -3
  144. package/lib/Layout/docs/Layout__four_Column.docs.js +3 -3
  145. package/lib/Layout/docs/Layout__three_Column.docs.js +3 -3
  146. package/lib/Layout/docs/Layout__two_Column.docs.js +3 -3
  147. package/lib/LightNightMode/docs/AlternativeColors.docs.js +3 -3
  148. package/lib/ListItem/ListItem.js +3 -3
  149. package/lib/ListItem/ListItemWithAvatar.js +12 -6
  150. package/lib/ListItem/ListItemWithCheckBox.js +3 -3
  151. package/lib/ListItem/ListItemWithIcon.js +14 -7
  152. package/lib/ListItem/ListItemWithRadio.js +3 -3
  153. package/lib/ListItem/docs/ListItemWithAvatar__custom.docs.js +3 -3
  154. package/lib/ListItem/docs/ListItemWithAvatar__default.docs.js +3 -3
  155. package/lib/ListItem/docs/ListItemWithCheckBox__custom.docs.js +3 -3
  156. package/lib/ListItem/docs/ListItemWithCheckBox__default.docs.js +3 -3
  157. package/lib/ListItem/docs/ListItemWithIcon__custom.docs.js +3 -3
  158. package/lib/ListItem/docs/ListItemWithIcon__default.docs.js +3 -3
  159. package/lib/ListItem/docs/ListItemWithRadio__custom.docs.js +3 -3
  160. package/lib/ListItem/docs/ListItemWithRadio__default.docs.js +3 -3
  161. package/lib/ListItem/docs/ListItem__custom.docs.js +3 -3
  162. package/lib/ListItem/docs/ListItem__default.docs.js +3 -3
  163. package/lib/Modal/Modal.js +3 -3
  164. package/lib/Modal/__docs__/Modal__default.docs.js +3 -3
  165. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +3 -3
  166. package/lib/MultiSelect/AdvancedMultiSelect.js +23 -11
  167. package/lib/MultiSelect/EmptyState.js +3 -3
  168. package/lib/MultiSelect/MultiSelect.js +11 -5
  169. package/lib/MultiSelect/MultiSelectHeader.js +3 -3
  170. package/lib/MultiSelect/MultiSelectWithAvatar.js +3 -3
  171. package/lib/MultiSelect/SelectedOptions.js +3 -3
  172. package/lib/MultiSelect/Suggestions.js +19 -5
  173. package/lib/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +3 -3
  174. package/lib/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +21 -6
  175. package/lib/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +3 -3
  176. package/lib/MultiSelect/docs/MultiSelect__default.docs.js +3 -3
  177. package/lib/PopOver/PopOver.js +3 -3
  178. package/lib/PopOver/docs/PopOver__default.docs.js +3 -3
  179. package/lib/Popup/Popup.js +3 -3
  180. package/lib/Popup/__tests__/Popup.spec.js +3 -3
  181. package/lib/Provider/Config.js +2 -1
  182. package/lib/Provider/LibraryContext.js +3 -3
  183. package/lib/Provider/NumberGenerator/NumberGenerator.js +1 -1
  184. package/lib/Provider/docs/Provider_Id__Class.docs.js +3 -3
  185. package/lib/Provider/docs/Provider_Zindex__Class.docs.js +3 -3
  186. package/lib/Provider.js +12 -5
  187. package/lib/Radio/Radio.js +3 -3
  188. package/lib/Radio/docs/Radio__custom.docs.js +3 -3
  189. package/lib/Radio/docs/Radio__default.docs.js +3 -3
  190. package/lib/Responsive/CustomResponsive.js +3 -3
  191. package/lib/Responsive/RefWrapper.js +1 -1
  192. package/lib/Responsive/ResizeComponent.js +4 -4
  193. package/lib/Responsive/ResizeObserver.js +1 -1
  194. package/lib/Responsive/Responsive.js +3 -3
  195. package/lib/Responsive/docs/Responsive__Custom.docs.js +3 -3
  196. package/lib/Responsive/docs/Responsive__default.docs.js +3 -3
  197. package/lib/Responsive/sizeObservers.js +4 -4
  198. package/lib/Responsive/utils/shallowCompare.js +1 -1
  199. package/lib/Ribbon/Ribbon.js +3 -3
  200. package/lib/Ribbon/docs/Ribbon__custom.docs.js +3 -3
  201. package/lib/Ribbon/docs/Ribbon__default.docs.js +3 -3
  202. package/lib/RippleEffect/docs/RippleEffect__default.docs.js +3 -3
  203. package/lib/Select/GroupSelect.js +6 -6
  204. package/lib/Select/Select.js +57 -15
  205. package/lib/Select/SelectWithAvatar.js +3 -3
  206. package/lib/Select/SelectWithIcon.js +3 -3
  207. package/lib/Select/docs/GroupSelect__default.docs.js +3 -3
  208. package/lib/Select/docs/SelectWithAvatar__default.docs.js +3 -3
  209. package/lib/Select/docs/SelectWithIcon__default.docs.js +3 -3
  210. package/lib/Select/docs/Select__default.docs.js +82 -3
  211. package/lib/Stencils/Stencils.js +6 -6
  212. package/lib/Stencils/docs/Stencils__custom.docs.js +3 -3
  213. package/lib/Stencils/docs/Stencils__default.docs.js +3 -3
  214. package/lib/Switch/Switch.js +3 -3
  215. package/lib/Switch/docs/Switch__custom.docs.js +3 -3
  216. package/lib/Switch/docs/Switch__default.docs.js +3 -3
  217. package/lib/Tab/Tab.js +1 -1
  218. package/lib/Tab/TabWrapper.js +1 -1
  219. package/lib/Tab/Tabs.js +16 -5
  220. package/lib/Tab/docs/Tab__default.docs.js +3 -3
  221. package/lib/Tag/Tag.js +3 -3
  222. package/lib/Tag/Tag.module.css +1 -0
  223. package/lib/Tag/docs/Tag__custom.docs.js +3 -3
  224. package/lib/Tag/docs/Tag__default.docs.js +3 -3
  225. package/lib/TextBox/TextBox.js +9 -7
  226. package/lib/TextBox/docs/TextBox__custom.docs.js +3 -3
  227. package/lib/TextBox/docs/TextBox__default.docs.js +3 -3
  228. package/lib/TextBox/docs/TextBox__size.docs.js +3 -3
  229. package/lib/TextBox/docs/TextBox__variant.docs.js +3 -3
  230. package/lib/TextBoxIcon/TextBoxIcon.js +15 -7
  231. package/lib/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +3 -3
  232. package/lib/TextBoxIcon/docs/TextBoxIcon__default.docs.js +3 -3
  233. package/lib/Textarea/Textarea.js +3 -3
  234. package/lib/Textarea/docs/Textarea__animated.docs.js +3 -3
  235. package/lib/Textarea/docs/Textarea__custom.docs.js +3 -3
  236. package/lib/Textarea/docs/Textarea__default.docs.js +3 -3
  237. package/lib/Textarea/docs/Textarea__disabled.docs.js +3 -3
  238. package/lib/Tooltip/Tooltip.js +3 -3
  239. package/lib/Tooltip/__tests__/Tooltip.spec.js +3 -3
  240. package/lib/Tooltip/docs/Tooltip__default.docs.js +3 -3
  241. package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -3
  242. package/lib/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +3 -3
  243. package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +3 -3
  244. package/lib/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +3 -3
  245. package/lib/a11y/FocusScope/FocusScope.js +1 -1
  246. package/lib/a11y/FocusScope/docs/FocusScope__default.docs.js +3 -3
  247. package/lib/beta/FocusRing/FocusRing.js +3 -3
  248. package/lib/beta/FocusRing/docs/FocusRing__default.docs.js +3 -3
  249. package/lib/common/animation.module.css +12 -0
  250. package/lib/deprecated/PortalLayer/PortalLayer.js +3 -3
  251. package/lib/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +3 -3
  252. package/lib/semantic/Button/Button.js +3 -3
  253. package/lib/semantic/Button/docs/Button__default.docs.js +3 -3
  254. package/lib/utils/Common.js +1 -1
  255. package/lib/utils/ContextOptimizer.js +2 -2
  256. package/lib/utils/datetime/common.js +1 -1
  257. package/lib/utils/dropDownUtils.js +14 -5
  258. package/lib/utils/shallowEqual.js +41 -0
  259. package/package.json +9 -5
  260. package/preprocess/componentAppearanceColors.js +65 -0
  261. package/preprocess/componentThemeColors.js +119 -0
  262. package/preprocess/ctaThemeColors.js +95 -0
  263. package/preprocess/index.js +3 -0
  264. package/preprocess/json/componentAppearanceVariableJson.js +1515 -0
  265. package/preprocess/json/componentThemeVariableJson.js +259 -0
  266. package/preprocess/json/ctaThemeVariableJson.js +337 -0
  267. package/es/deprecated/Theme/darkTheme.module.css +0 -393
  268. package/es/deprecated/Theme/defaultTheme.module.css +0 -393
  269. package/es/deprecated/Theme/palette/darkCTAPalette.module.css +0 -116
  270. package/es/deprecated/Theme/palette/darkPalette.module.css +0 -155
  271. package/es/deprecated/Theme/palette/defaultCTAPalette.module.css +0 -116
  272. package/es/deprecated/Theme/palette/defaultPalette.module.css +0 -155
  273. package/es/deprecated/customscroll_Old.module.css +0 -46
  274. package/lib/deprecated/Theme/darkTheme.module.css +0 -393
  275. package/lib/deprecated/Theme/defaultTheme.module.css +0 -393
  276. package/lib/deprecated/Theme/palette/darkCTAPalette.module.css +0 -116
  277. package/lib/deprecated/Theme/palette/darkPalette.module.css +0 -155
  278. package/lib/deprecated/Theme/palette/defaultCTAPalette.module.css +0 -116
  279. package/lib/deprecated/Theme/palette/defaultPalette.module.css +0 -155
  280. package/lib/deprecated/customscroll_Old.module.css +0 -46
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -19,9 +19,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
19
19
 
20
20
  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); } }
21
21
 
22
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
22
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
23
23
 
24
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
24
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
25
25
 
26
26
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
27
27
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -25,9 +25,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
25
25
 
26
26
  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); } }
27
27
 
28
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
28
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
29
 
30
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
30
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
31
31
 
32
32
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
33
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -19,9 +19,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
19
19
 
20
20
  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); } }
21
21
 
22
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
22
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
23
23
 
24
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
24
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
25
25
 
26
26
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
27
27
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -19,9 +19,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
19
19
 
20
20
  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); } }
21
21
 
22
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
22
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
23
23
 
24
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
24
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
25
25
 
26
26
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
27
27
 
@@ -453,5 +453,5 @@ function getElementSpace(elementRef) {
453
453
 
454
454
  function getSearchString() {
455
455
  var charachers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
456
- return charachers.toLowerCase(); //.replace(/\s+/g, '');
456
+ return (charachers || '').toString().toLowerCase(); //.replace(/\s+/g, '');
457
457
  }
@@ -9,7 +9,7 @@ var _react = require("react");
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
- var _reactRedux = require("react-redux");
12
+ var _shallowEqual = _interopRequireDefault(require("./shallowEqual"));
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
 
@@ -33,7 +33,7 @@ function ContextOptimizer(props) {
33
33
  }),
34
34
  local = _useRef.current;
35
35
 
36
- if (!(0, _reactRedux.shallowEqual)(data, local.data) || local.renderF !== renderF) {
36
+ if (!(0, _shallowEqual["default"])(data, local.data) || local.renderF !== renderF) {
37
37
  local.children = renderF(data);
38
38
  local.data = data;
39
39
  local.renderF = renderF;
@@ -18,7 +18,7 @@ exports.pad = pad;
18
18
  exports.replaceI18NValuesWithRegex = replaceI18NValuesWithRegex;
19
19
  exports.unescapeUnicode = unescapeUnicode;
20
20
 
21
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
21
+ 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); }
22
22
 
23
23
  var dateFormat = {
24
24
  dayNames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
@@ -19,7 +19,7 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
19
19
 
20
20
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
21
 
22
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
22
+ 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); }
23
23
 
24
24
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
25
25
 
@@ -130,6 +130,10 @@ var getDisabledOptions = function getDisabledOptions(props) {
130
130
  return props.disabledOptions || dummyArray;
131
131
  };
132
132
 
133
+ var getListItemProps = function getListItemProps(props) {
134
+ return props.listItemProps || '';
135
+ };
136
+
133
137
  var makeGetMultiSelectFilterSuggestions = function makeGetMultiSelectFilterSuggestions() {
134
138
  return (0, _reselect.createSelector)([getOptions, getSelectedOptionsSel, getSearchStr, getNeedSearch, getIsStartWithSearch], function (options, selectedOptions, searchStr, needSearch, isStartsWithSearch) {
135
139
  var suggestions = [];
@@ -138,8 +142,8 @@ var makeGetMultiSelectFilterSuggestions = function makeGetMultiSelectFilterSugge
138
142
  var id = option.id,
139
143
  _option$value = option.value,
140
144
  value = _option$value === void 0 ? '' : _option$value;
141
- var valueString = value.toLowerCase();
142
- var searchString = searchStr.toLowerCase();
145
+ var valueString = (0, _Common.getSearchString)(value);
146
+ var searchString = (0, _Common.getSearchString)(searchStr);
143
147
  var isMatch = needSearch ? isStartsWithSearch ? valueString.startsWith(searchString) : valueString.indexOf(searchString) !== -1 : true;
144
148
 
145
149
  if (selectedOptions.indexOf(id) === -1 && isMatch) {
@@ -210,7 +214,7 @@ var extractOptionId = function extractOptionId(id) {
210
214
  exports.extractOptionId = extractOptionId;
211
215
 
212
216
  var makeFormatOptions = function makeFormatOptions() {
213
- return (0, _reselect.createSelector)([getOptions, getValueField, getTextField, getImageField, getPrefixText, getIconName, getIconSize, getOptionType, getDisabledOptions], function (options, valueField, textField, imageField, prefixText, iconName, iconSize, optionType, disabledOptions) {
217
+ return (0, _reselect.createSelector)([getOptions, getValueField, getTextField, getImageField, getPrefixText, getIconName, getIconSize, getOptionType, getDisabledOptions, getListItemProps], function (options, valueField, textField, imageField, prefixText, iconName, iconSize, optionType, disabledOptions, listItemProps) {
214
218
  var revampOptions = [];
215
219
  var remvampOptionIds = [];
216
220
  var normalizedAllOptions = {};
@@ -223,7 +227,8 @@ var makeFormatOptions = function makeFormatOptions() {
223
227
  impImageField = option.imageField,
224
228
  impOptionType = option.optionType,
225
229
  impIconName = option.iconName,
226
- impIconSize = option.iconSize;
230
+ impIconSize = option.iconSize,
231
+ listStyle = option.listItemProps;
227
232
  var id = _typeof(option) === 'object' ? option[impValueField || valueField] : option;
228
233
  var value = _typeof(option) === 'object' ? option[impTextField || textField] : option;
229
234
  var photoURL = _typeof(option) === 'object' ? option[impImageField || imageField] : ''; // grouping options (group select/MultiSelect)
@@ -254,6 +259,10 @@ var makeFormatOptions = function makeFormatOptions() {
254
259
  optionDetails.isDisabled = disabledOptions.indexOf(id) >= 0;
255
260
  }
256
261
 
262
+ if (listStyle || listItemProps) {
263
+ optionDetails.listItemProps = listStyle || listItemProps;
264
+ }
265
+
257
266
  normalizedFormatOptions[id] = optionDetails;
258
267
  normalizedAllOptions[id] = option;
259
268
  revampOptions.push(optionDetails);
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = shallowEqual;
7
+
8
+ 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); }
9
+
10
+ function is(x, y) {
11
+ if (x === y) {
12
+ return x !== 0 || y !== 0 || 1 / x === 1 / y;
13
+ } else {
14
+ return x !== x && y !== y;
15
+ }
16
+ }
17
+
18
+ function shallowEqual(objA, objB) {
19
+ if (is(objA, objB)) {
20
+ return true;
21
+ }
22
+
23
+ if (_typeof(objA) !== 'object' || objA === null || _typeof(objB) !== 'object' || objB === null) {
24
+ return false;
25
+ }
26
+
27
+ var keysA = Object.keys(objA);
28
+ var keysB = Object.keys(objB);
29
+
30
+ if (keysA.length !== keysB.length) {
31
+ return false;
32
+ }
33
+
34
+ for (var i = 0; i < keysA.length; i++) {
35
+ if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
36
+ return false;
37
+ }
38
+ }
39
+
40
+ return true;
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/components",
3
- "version": "1.0.0-temp-38",
3
+ "version": "1.0.0-temp-42",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "jsnext:main": "es/index.js",
@@ -13,7 +13,8 @@
13
13
  "lintAllFix": "npm run lintAll --eslint:fix=true",
14
14
  "clean": "react-cli clean build unittest coverage es lib assets && mkdir assets",
15
15
  "dubCheck": "node dubFinder node_modules/@zohodesk/icons/lib node_modules/@zohodesk/variables/lib",
16
- "init": "npm run clean && cd ../assets && npm run componentsassets && cd ../components",
16
+ "init": "npm run clean && cd ../assets && npm run componentsassets && cd ../components && npm run build:variables",
17
+ "build:variables": "node ./preprocess/index",
17
18
  "rtl": "react-cli rtl ./src ./lib && react-cli rtl ./src ./es",
18
19
  "start": "react-cli start",
19
20
  "docs": "npm run dubCheck && react-cli docs",
@@ -33,12 +34,12 @@
33
34
  },
34
35
  "devDependencies": {
35
36
  "@zohodesk/docstool": "1.0.0-alpha-2",
36
- "@zohodesk/variables": "1.0.0-temp-1",
37
+ "@zohodesk/variables": "1.0.0-beta.25",
37
38
  "@zohodesk/icons": "1.0.0-beta.85",
38
39
  "@zohodesk/virtualizer": "1.0.3",
39
40
  "velocity-react": "^1.4.1",
40
41
  "react-sortable-hoc": "^0.8.3",
41
- "@zohodesk/svg": "1.0.0-beta.33"
42
+ "@zohodesk/svg": "1.0.0-beta.37"
42
43
  },
43
44
  "dependencies": {
44
45
  "hoist-non-react-statics": "3.0.1",
@@ -49,12 +50,15 @@
49
50
  "peerDependencies": {
50
51
  "@zohodesk/icons": "^1.0.0-beta.85",
51
52
  "@zohodesk/variables": "^1.0.0-beta.24",
52
- "@zohodesk/svg": "^1.0.0-beta.33",
53
+ "@zohodesk/svg": "^1.0.0-beta.37",
53
54
  "@zohodesk/virtualizer": "^1.0.3",
54
55
  "velocity-react": "^1.4.1",
55
56
  "react-sortable-hoc": "^0.8.3"
56
57
  },
57
58
  "react-cli": {
59
+ "preprocessor": {
60
+ "runner": "preprocess/index.js"
61
+ },
58
62
  "docs": {
59
63
  "componentFolder": "./src",
60
64
  "cssUniqueness": "false",
@@ -0,0 +1,65 @@
1
+ var { componentAppearanceVariables } = require('./json/componentAppearanceVariableJson');
2
+ let fs = require('fs');
3
+ let path = require('path');
4
+ let baseFolder = 'Appearance';
5
+ let mode = ['default', 'dark'];
6
+ let modeFiles = [];
7
+ mode.forEach(mode => {
8
+ let modeFilesString = `../src/${baseFolder}/${mode}/mode/${mode}Mode.module.css`;
9
+ modeFiles.push(path.join(__dirname, modeFilesString));
10
+ });
11
+ let files = modeFiles;
12
+
13
+ function generate(mode) {
14
+ let exportVariables = [];
15
+ let counter = 0;
16
+ let newLine = '';
17
+ componentAppearanceVariables.map(componentVariable => {
18
+ let commentName = componentVariable[3];
19
+ counting = counter++;
20
+ if (counting != 0) {
21
+ newLine = `\n\t`;
22
+ }
23
+ if (mode == 'default') {
24
+ let componentDefaultColors = componentVariable[1][1];
25
+
26
+ colorsResult = [
27
+ `\n\t--${componentVariable[0]}: ${componentDefaultColors};`
28
+ ];
29
+ exportVariables.push(
30
+ commentName ? `${newLine}\n\t/* ${commentName} */` : '',
31
+ colorsResult
32
+ );
33
+ } else if (mode == 'dark') {
34
+ let componentDarkColors = componentVariable[2][1];
35
+
36
+ colorsResult = [
37
+ `\n\t--${componentVariable[0]}: ${componentDarkColors};`
38
+ ];
39
+ exportVariables.push(
40
+ commentName ? `${newLine}\n\t/* ${commentName} */` : '',
41
+ colorsResult
42
+ );
43
+ }
44
+ });
45
+ return exportVariables.join('');
46
+ }
47
+
48
+ let arrayIndexCounter = 0;
49
+ mode.forEach(mode => {
50
+ let fileString = files[arrayIndexCounter];
51
+ // let splitPath = fileString.split(/\\/g);
52
+ let getMode = mode;
53
+ if (mode == 'default') {
54
+ blueSelector = ', :global(.blueDefaultTheme) [data-desk-theme="blue"]';
55
+ } else if (mode == 'dark') {
56
+ blueSelector = '';
57
+ }
58
+ fs.writeFileSync(
59
+ fileString,
60
+ `[data-mode='${getMode}']${blueSelector} {${generate(
61
+ getMode
62
+ )}\n}`
63
+ );
64
+ arrayIndexCounter++;
65
+ });
@@ -0,0 +1,119 @@
1
+ var { componentThemeVariables } = require('./json/componentThemeVariableJson');
2
+ let fs = require('fs');
3
+ let path = require('path');
4
+ let baseFolder = 'Appearance';
5
+ let mode = ['default', 'dark'];
6
+ let themes = ['blue', 'green', 'orange', 'red', 'yellow'];
7
+ let themeFiles = [];
8
+ mode.forEach(mode => {
9
+ themes.forEach(theme => {
10
+ let themeFilesString = `../src/${baseFolder}/${mode}/themes/${theme}/${
11
+ theme + capitalizeFirstLetter(mode)
12
+ }ComponentTheme.module.css`;
13
+ themeFiles.push(path.join(__dirname, themeFilesString));
14
+ });
15
+ });
16
+ let files = themeFiles;
17
+
18
+ function capitalizeFirstLetter(string) {
19
+ return string.charAt(0).toUpperCase() + string.slice(1);
20
+ }
21
+
22
+ function generate(mode, theme) {
23
+ let exportVariables = [];
24
+ let counter = 0;
25
+ let newLine = '';
26
+ componentThemeVariables.map(componentVariable => {
27
+ let commentName = componentVariable[3];
28
+ counting = counter++;
29
+ if (counting != 0) {
30
+ newLine = `\n\t`;
31
+ }
32
+ if (mode == 'default') {
33
+ let componentDefaultColors = componentVariable[1][1];
34
+
35
+ let colorsResult = '';
36
+ if (theme == 'blue') {
37
+ colorsResult = [
38
+ `\n\t--zdt_${componentVariable[0]}: ${componentDefaultColors[0]};`
39
+ ];
40
+ } else if (theme == 'green') {
41
+ colorsResult = [
42
+ `\n\t--zdt_${componentVariable[0]}: ${componentDefaultColors[1]};`
43
+ ];
44
+ } else if (theme == 'orange') {
45
+ colorsResult = [
46
+ `\n\t--zdt_${componentVariable[0]}: ${componentDefaultColors[2]};`
47
+ ];
48
+ } else if (theme == 'red') {
49
+ colorsResult = [
50
+ `\n\t--zdt_${componentVariable[0]}: ${componentDefaultColors[3]};`
51
+ ];
52
+ } else if (theme == 'yellow') {
53
+ colorsResult = [
54
+ `\n\t--zdt_${componentVariable[0]}: ${componentDefaultColors[4]};`
55
+ ];
56
+ }
57
+ exportVariables.push(
58
+ commentName ? `${newLine}\n\t/* ${commentName} */` : '',
59
+ colorsResult
60
+ );
61
+ } else if (mode == 'dark') {
62
+ let componentDarkColors = componentVariable[2][1];
63
+ let colorsResult = '';
64
+ if (theme == 'blue') {
65
+ colorsResult = [
66
+ `\n\t--zdt_${componentVariable[0]}: ${componentDarkColors[0]};`
67
+ ];
68
+ } else if (theme == 'green') {
69
+ colorsResult = [
70
+ `\n\t--zdt_${componentVariable[0]}: ${componentDarkColors[1]};`
71
+ ];
72
+ } else if (theme == 'orange') {
73
+ colorsResult = [
74
+ `\n\t--zdt_${componentVariable[0]}: ${componentDarkColors[2]};`
75
+ ];
76
+ } else if (theme == 'red') {
77
+ colorsResult = [
78
+ `\n\t--zdt_${componentVariable[0]}: ${componentDarkColors[3]};`
79
+ ];
80
+ } else if (theme == 'yellow') {
81
+ colorsResult = [
82
+ `\n\t--zdt_${componentVariable[0]}: ${componentDarkColors[4]};`
83
+ ];
84
+ }
85
+ exportVariables.push(
86
+ commentName ? `${newLine}\n\t/* ${commentName} */` : '',
87
+ colorsResult
88
+ );
89
+ }
90
+ });
91
+ return exportVariables.join('');
92
+ }
93
+
94
+ let arrayIndexCounter = 0;
95
+ mode.forEach(mode => {
96
+ themes.forEach(theme => {
97
+ let fileString = files[arrayIndexCounter];
98
+ // let splitPath = fileString.split(/\\/g);
99
+ let getMode = mode;
100
+ let getTheme = theme;
101
+ if (theme == 'blue') {
102
+ if (mode == 'default') {
103
+ blueSelector = ', :global(.blueDefaultTheme) [data-desk-theme="blue"]';
104
+ } else if (mode == 'dark') {
105
+ blueSelector = ', :global(.blueDarkTheme) [data-desk-theme="blue"]';
106
+ }
107
+ } else {
108
+ blueSelector = '';
109
+ }
110
+ fs.writeFileSync(
111
+ fileString,
112
+ `[data-mode='${getMode}'][data-theme='${getTheme}']${blueSelector} {${generate(
113
+ getMode,
114
+ getTheme
115
+ )}\n}`
116
+ );
117
+ arrayIndexCounter++;
118
+ });
119
+ });
@@ -0,0 +1,95 @@
1
+ var { ctaThemeVariables } = require('./json/ctaThemeVariableJson');
2
+ let fs = require('fs');
3
+ let path = require('path');
4
+ let baseFolder = 'Appearance';
5
+ let mode = ['default', 'dark'];
6
+ let themes = ['blue', 'green', 'orange', 'red', 'yellow'];
7
+ let themeFiles = [];
8
+ mode.forEach(mode => {
9
+ themes.forEach(theme => {
10
+ let themeFilesString = `../src/${baseFolder}/${mode}/themes/${theme}/${
11
+ theme + capitalizeFirstLetter(mode)
12
+ }CTATheme.module.css`;
13
+ themeFiles.push(path.join(__dirname, themeFilesString));
14
+ });
15
+ });
16
+ let files = themeFiles;
17
+
18
+ function capitalizeFirstLetter(string) {
19
+ return string.charAt(0).toUpperCase() + string.slice(1);
20
+ }
21
+
22
+ function generate(mode, theme) {
23
+ let exportVariables = [];
24
+ ctaThemeVariables.map(ctaVariable => {
25
+ if (mode == 'default') {
26
+ let ctaDefaultColors = ctaVariable[1][1];
27
+ let colorsResult = '';
28
+ if (theme == 'blue') {
29
+ colorsResult = [
30
+ `\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDefaultColors[0]}`
31
+ ];
32
+ } else if (theme == 'green') {
33
+ colorsResult = [
34
+ `\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDefaultColors[1]}`
35
+ ];
36
+ } else if (theme == 'orange') {
37
+ colorsResult = [
38
+ `\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDefaultColors[2]}`
39
+ ];
40
+ } else if (theme == 'red') {
41
+ colorsResult = [
42
+ `\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDefaultColors[3]}`
43
+ ];
44
+ } else if (theme == 'yellow') {
45
+ colorsResult = [
46
+ `\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDefaultColors[4]}`
47
+ ];
48
+ }
49
+ exportVariables.push(colorsResult);
50
+ } else if (mode == 'dark') {
51
+ let ctaDarkColors = ctaVariable[2][1];
52
+ let colorsResult = '';
53
+ if (theme == 'blue') {
54
+ colorsResult = [`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDarkColors[0]}`];
55
+ } else if (theme == 'green') {
56
+ colorsResult = [`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDarkColors[1]}`];
57
+ } else if (theme == 'orange') {
58
+ colorsResult = [`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDarkColors[2]}`];
59
+ } else if (theme == 'red') {
60
+ colorsResult = [`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDarkColors[3]}`];
61
+ } else if (theme == 'yellow') {
62
+ colorsResult = [`\n\t--zdt_cta_${ctaVariable[0]}: ${ctaDarkColors[4]}`];
63
+ }
64
+ exportVariables.push(colorsResult);
65
+ }
66
+ });
67
+ return exportVariables.join(';');
68
+ }
69
+
70
+ let arrayIndexCounter = 0;
71
+ mode.forEach(mode => {
72
+ themes.forEach(theme => {
73
+ let fileString = files[arrayIndexCounter];
74
+ // let splitPath = fileString.split(/\\/g);
75
+ let getMode = mode;
76
+ let getTheme = theme;
77
+ if (theme == 'blue') {
78
+ if (mode == 'default') {
79
+ blueSelector = ', :global(.blueDefaultTheme) [data-desk-theme="blue"]';
80
+ } else if (mode == 'dark') {
81
+ blueSelector = ', :global(.blueDarkTheme) [data-desk-theme="blue"]';
82
+ }
83
+ } else {
84
+ blueSelector = '';
85
+ }
86
+ fs.writeFileSync(
87
+ fileString,
88
+ `[data-mode='${getMode}'][data-theme='${getTheme}']${blueSelector} {${generate(
89
+ getMode,
90
+ getTheme
91
+ )}\n}`
92
+ );
93
+ arrayIndexCounter++;
94
+ });
95
+ });
@@ -0,0 +1,3 @@
1
+ require('./ctaThemeColors');
2
+ require('./componentThemeColors');
3
+ require('./componentAppearanceColors');