@coorpacademy/components 10.1.5 → 10.1.9

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 (265) hide show
  1. package/es/atom/button-link/index.js +7 -23
  2. package/es/atom/button-link/index.js.map +1 -1
  3. package/es/atom/button-link/style.css +4 -6
  4. package/es/atom/button-link/test/fixtures.js +31 -0
  5. package/es/atom/button-link/test/fixtures.js.map +1 -0
  6. package/es/atom/button-link-icon-only/index.js +76 -0
  7. package/es/atom/button-link-icon-only/index.js.map +1 -0
  8. package/es/atom/button-link-icon-only/style.css +64 -0
  9. package/es/atom/button-link-icon-only/test/button-link-icon-only.js +25 -0
  10. package/es/atom/button-link-icon-only/test/button-link-icon-only.js.map +1 -0
  11. package/es/atom/button-link-icon-only/test/fixtures/button-icon-bullet.js +10 -0
  12. package/es/atom/button-link-icon-only/test/fixtures/button-icon-bullet.js.map +1 -0
  13. package/es/atom/{button-link/test/fixtures/icon-button.js → button-link-icon-only/test/fixtures/default.js} +3 -6
  14. package/es/atom/button-link-icon-only/test/fixtures/default.js.map +1 -0
  15. package/es/atom/button-link-icon-only/test/fixtures/no-icon.js +7 -0
  16. package/es/atom/button-link-icon-only/test/fixtures/no-icon.js.map +1 -0
  17. package/es/atom/button-link-icon-only/test/fixtures/small-button-disabled.js +11 -0
  18. package/es/atom/button-link-icon-only/test/fixtures/small-button-disabled.js.map +1 -0
  19. package/es/atom/button-link-icon-only/test/fixtures/small-link-download.js +13 -0
  20. package/es/atom/button-link-icon-only/test/fixtures/small-link-download.js.map +1 -0
  21. package/es/atom/button-link-icon-only/test/fixtures.js +21 -0
  22. package/es/atom/button-link-icon-only/test/fixtures.js.map +1 -0
  23. package/es/atom/button-menu/index.js +66 -0
  24. package/es/atom/button-menu/index.js.map +1 -0
  25. package/es/atom/button-menu/style.css +51 -0
  26. package/es/atom/button-menu/test/fixtures/default.js +20 -0
  27. package/es/atom/button-menu/test/fixtures/default.js.map +1 -0
  28. package/es/atom/button-menu/test/fixtures/multiple-buttons.js +15 -0
  29. package/es/atom/button-menu/test/fixtures/multiple-buttons.js.map +1 -0
  30. package/es/atom/button-menu/test/fixtures.js +15 -0
  31. package/es/atom/button-menu/test/fixtures.js.map +1 -0
  32. package/es/atom/chips/test/fixtures.js +17 -0
  33. package/es/atom/chips/test/fixtures.js.map +1 -0
  34. package/es/atom/content-badge/test/fixtures.js +27 -0
  35. package/es/atom/content-badge/test/fixtures.js.map +1 -0
  36. package/es/atom/input-search/test/fixtures.js +19 -0
  37. package/es/atom/input-search/test/fixtures.js.map +1 -0
  38. package/es/atom/input-text/index.js.map +1 -1
  39. package/es/atom/input-text/test/fixtures.js +2 -0
  40. package/es/atom/input-text/test/fixtures.js.map +1 -1
  41. package/es/atom/input-textarea/test/fixtures.js +4 -0
  42. package/es/atom/input-textarea/test/fixtures.js.map +1 -1
  43. package/es/atom/tag/index.js +3 -2
  44. package/es/atom/tag/index.js.map +1 -1
  45. package/es/atom/tag/style.css +5 -1
  46. package/es/atom/tag/test/fixtures/draft.js +7 -0
  47. package/es/atom/tag/test/fixtures/draft.js.map +1 -0
  48. package/es/atom/tag/test/fixtures/{revision.js → revised.js} +2 -2
  49. package/es/atom/tag/test/fixtures/revised.js.map +1 -0
  50. package/es/atom/tag/test/fixtures.js +19 -0
  51. package/es/atom/tag/test/fixtures.js.map +1 -0
  52. package/es/atom/wizard-steps/test/fixtures.js +17 -0
  53. package/es/atom/wizard-steps/test/fixtures.js.map +1 -0
  54. package/es/molecule/banner/index.js +19 -10
  55. package/es/molecule/banner/index.js.map +1 -1
  56. package/es/molecule/banner/style.css +10 -8
  57. package/es/molecule/banner/test/fixtures.js +15 -0
  58. package/es/molecule/banner/test/fixtures.js.map +1 -0
  59. package/es/molecule/brand-form-group/index.js +20 -5
  60. package/es/molecule/brand-form-group/index.js.map +1 -1
  61. package/es/molecule/brand-form-group/style.css +19 -0
  62. package/es/molecule/brand-form-group/test/fixtures.js +2 -0
  63. package/es/molecule/brand-form-group/test/fixtures.js.map +1 -1
  64. package/es/molecule/bullet-point-menu-button/index.js +51 -0
  65. package/es/molecule/bullet-point-menu-button/index.js.map +1 -0
  66. package/es/molecule/bullet-point-menu-button/style.css +52 -0
  67. package/es/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js +34 -0
  68. package/es/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js.map +1 -0
  69. package/es/molecule/bullet-point-menu-button/test/fixtures/default.js +11 -0
  70. package/es/molecule/bullet-point-menu-button/test/fixtures/default.js.map +1 -0
  71. package/es/molecule/bullet-point-menu-button/test/fixtures/multiple-buttons.js +13 -0
  72. package/es/molecule/bullet-point-menu-button/test/fixtures/multiple-buttons.js.map +1 -0
  73. package/es/molecule/bullet-point-menu-button/test/fixtures.js +15 -0
  74. package/es/molecule/bullet-point-menu-button/test/fixtures.js.map +1 -0
  75. package/es/molecule/card/test/fixtures.js +4 -0
  76. package/es/molecule/card/test/fixtures.js.map +1 -1
  77. package/es/molecule/cm-popin/index.js +8 -7
  78. package/es/molecule/cm-popin/index.js.map +1 -1
  79. package/es/molecule/cm-popin/style.css +0 -25
  80. package/es/molecule/cm-popin/test/fixtures.js +17 -0
  81. package/es/molecule/cm-popin/test/fixtures.js.map +1 -0
  82. package/es/molecule/empty-search-result/test/fixtures.js +13 -0
  83. package/es/molecule/empty-search-result/test/fixtures.js.map +1 -0
  84. package/es/molecule/feedback/test/fixtures.js +0 -2
  85. package/es/molecule/feedback/test/fixtures.js.map +1 -1
  86. package/es/molecule/vertical-tabs/index.js +8 -3
  87. package/es/molecule/vertical-tabs/index.js.map +1 -1
  88. package/es/molecule/vertical-tabs/test/fixtures/default.js +2 -1
  89. package/es/molecule/vertical-tabs/test/fixtures/default.js.map +1 -1
  90. package/es/molecule/vertical-tabs/test/fixtures/with-selected-item.js +2 -1
  91. package/es/molecule/vertical-tabs/test/fixtures/with-selected-item.js.map +1 -1
  92. package/es/molecule/vertical-tabs/test/fixtures.js +15 -0
  93. package/es/molecule/vertical-tabs/test/fixtures.js.map +1 -0
  94. package/es/molecule/wizard-summary/index.js +3 -1
  95. package/es/molecule/wizard-summary/index.js.map +1 -1
  96. package/es/molecule/wizard-summary/style.css +8 -0
  97. package/es/molecule/wizard-summary/test/fixtures.js +21 -0
  98. package/es/molecule/wizard-summary/test/fixtures.js.map +1 -0
  99. package/es/organism/brand-form/test/fixtures/wizard-playlists.js +26 -0
  100. package/es/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -0
  101. package/es/organism/brand-form/test/fixtures.js +2 -0
  102. package/es/organism/brand-form/test/fixtures.js.map +1 -1
  103. package/es/organism/course-selection/test/fixtures.js +21 -0
  104. package/es/organism/course-selection/test/fixtures.js.map +1 -0
  105. package/es/organism/playlist-translation/index.js +63 -0
  106. package/es/organism/playlist-translation/index.js.map +1 -0
  107. package/es/organism/playlist-translation/style.css +45 -0
  108. package/es/organism/playlist-translation/test/fixtures/default.js +24 -0
  109. package/es/organism/playlist-translation/test/fixtures/default.js.map +1 -0
  110. package/es/organism/playlist-translation/test/fixtures/delete.js +18 -0
  111. package/es/organism/playlist-translation/test/fixtures/delete.js.map +1 -0
  112. package/es/organism/playlist-translation/test/fixtures.js +15 -0
  113. package/es/organism/playlist-translation/test/fixtures.js.map +1 -0
  114. package/es/organism/search-and-chips-results/index.js +1 -0
  115. package/es/organism/search-and-chips-results/index.js.map +1 -1
  116. package/es/organism/search-and-chips-results/style.css +1 -1
  117. package/es/organism/search-and-chips-results/test/fixtures.js +21 -0
  118. package/es/organism/search-and-chips-results/test/fixtures.js.map +1 -0
  119. package/es/organism/setup-header/index.js +78 -31
  120. package/es/organism/setup-header/index.js.map +1 -1
  121. package/es/organism/setup-header/style.css +27 -62
  122. package/es/template/app-player/popin-end/test/fixtures.js +0 -2
  123. package/es/template/app-player/popin-end/test/fixtures.js.map +1 -1
  124. package/es/template/teams-dashboard/index.js +4 -3
  125. package/es/template/teams-dashboard/index.js.map +1 -1
  126. package/es/util/button-icons.js +16 -0
  127. package/es/util/button-icons.js.map +1 -0
  128. package/es/variables/colors.css +2 -0
  129. package/lib/atom/button-link/index.js +9 -25
  130. package/lib/atom/button-link/index.js.map +1 -1
  131. package/lib/atom/button-link/style.css +4 -6
  132. package/lib/atom/button-link/test/fixtures.js +49 -0
  133. package/lib/atom/button-link/test/fixtures.js.map +1 -0
  134. package/lib/atom/button-link-icon-only/index.js +94 -0
  135. package/lib/atom/button-link-icon-only/index.js.map +1 -0
  136. package/lib/atom/button-link-icon-only/style.css +64 -0
  137. package/lib/atom/button-link-icon-only/test/button-link-icon-only.js +37 -0
  138. package/lib/atom/button-link-icon-only/test/button-link-icon-only.js.map +1 -0
  139. package/lib/atom/button-link-icon-only/test/fixtures/button-icon-bullet.js +15 -0
  140. package/lib/atom/button-link-icon-only/test/fixtures/button-icon-bullet.js.map +1 -0
  141. package/lib/atom/{button-link/test/fixtures/icon-button.js → button-link-icon-only/test/fixtures/default.js} +3 -6
  142. package/lib/atom/button-link-icon-only/test/fixtures/default.js.map +1 -0
  143. package/lib/atom/button-link-icon-only/test/fixtures/no-icon.js +12 -0
  144. package/lib/atom/button-link-icon-only/test/fixtures/no-icon.js.map +1 -0
  145. package/lib/atom/button-link-icon-only/test/fixtures/small-button-disabled.js +16 -0
  146. package/lib/atom/button-link-icon-only/test/fixtures/small-button-disabled.js.map +1 -0
  147. package/lib/atom/button-link-icon-only/test/fixtures/small-link-download.js +18 -0
  148. package/lib/atom/button-link-icon-only/test/fixtures/small-link-download.js.map +1 -0
  149. package/lib/atom/button-link-icon-only/test/fixtures.js +34 -0
  150. package/lib/atom/button-link-icon-only/test/fixtures.js.map +1 -0
  151. package/lib/atom/button-menu/index.js +82 -0
  152. package/lib/atom/button-menu/index.js.map +1 -0
  153. package/lib/atom/button-menu/style.css +51 -0
  154. package/lib/atom/button-menu/test/fixtures/default.js +27 -0
  155. package/lib/atom/button-menu/test/fixtures/default.js.map +1 -0
  156. package/lib/atom/button-menu/test/fixtures/multiple-buttons.js +23 -0
  157. package/lib/atom/button-menu/test/fixtures/multiple-buttons.js.map +1 -0
  158. package/lib/atom/button-menu/test/fixtures.js +25 -0
  159. package/lib/atom/button-menu/test/fixtures.js.map +1 -0
  160. package/lib/atom/chips/test/fixtures.js +28 -0
  161. package/lib/atom/chips/test/fixtures.js.map +1 -0
  162. package/lib/atom/content-badge/test/fixtures.js +43 -0
  163. package/lib/atom/content-badge/test/fixtures.js.map +1 -0
  164. package/lib/atom/input-search/test/fixtures.js +31 -0
  165. package/lib/atom/input-search/test/fixtures.js.map +1 -0
  166. package/lib/atom/input-text/index.js.map +1 -1
  167. package/lib/atom/input-text/test/fixtures.js +3 -0
  168. package/lib/atom/input-text/test/fixtures.js.map +1 -1
  169. package/lib/atom/input-textarea/test/fixtures.js +6 -0
  170. package/lib/atom/input-textarea/test/fixtures.js.map +1 -1
  171. package/lib/atom/tag/index.js +3 -2
  172. package/lib/atom/tag/index.js.map +1 -1
  173. package/lib/atom/tag/style.css +5 -1
  174. package/lib/atom/tag/test/fixtures/draft.js +12 -0
  175. package/lib/atom/tag/test/fixtures/draft.js.map +1 -0
  176. package/lib/atom/tag/test/fixtures/{revision.js → revised.js} +2 -2
  177. package/lib/atom/tag/test/fixtures/revised.js.map +1 -0
  178. package/lib/atom/tag/test/fixtures.js +31 -0
  179. package/lib/atom/tag/test/fixtures.js.map +1 -0
  180. package/lib/atom/wizard-steps/test/fixtures.js +28 -0
  181. package/lib/atom/wizard-steps/test/fixtures.js.map +1 -0
  182. package/lib/molecule/banner/index.js +19 -10
  183. package/lib/molecule/banner/index.js.map +1 -1
  184. package/lib/molecule/banner/style.css +10 -8
  185. package/lib/molecule/banner/test/fixtures.js +25 -0
  186. package/lib/molecule/banner/test/fixtures.js.map +1 -0
  187. package/lib/molecule/brand-form-group/index.js +22 -5
  188. package/lib/molecule/brand-form-group/index.js.map +1 -1
  189. package/lib/molecule/brand-form-group/style.css +19 -0
  190. package/lib/molecule/brand-form-group/test/fixtures.js +3 -0
  191. package/lib/molecule/brand-form-group/test/fixtures.js.map +1 -1
  192. package/lib/molecule/bullet-point-menu-button/index.js +69 -0
  193. package/lib/molecule/bullet-point-menu-button/index.js.map +1 -0
  194. package/lib/molecule/bullet-point-menu-button/style.css +52 -0
  195. package/lib/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js +46 -0
  196. package/lib/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js.map +1 -0
  197. package/lib/molecule/bullet-point-menu-button/test/fixtures/default.js +18 -0
  198. package/lib/molecule/bullet-point-menu-button/test/fixtures/default.js.map +1 -0
  199. package/lib/molecule/bullet-point-menu-button/test/fixtures/multiple-buttons.js +25 -0
  200. package/lib/molecule/bullet-point-menu-button/test/fixtures/multiple-buttons.js.map +1 -0
  201. package/lib/molecule/bullet-point-menu-button/test/fixtures.js +25 -0
  202. package/lib/molecule/bullet-point-menu-button/test/fixtures.js.map +1 -0
  203. package/lib/molecule/card/test/fixtures.js +6 -0
  204. package/lib/molecule/card/test/fixtures.js.map +1 -1
  205. package/lib/molecule/cm-popin/index.js +8 -6
  206. package/lib/molecule/cm-popin/index.js.map +1 -1
  207. package/lib/molecule/cm-popin/style.css +0 -25
  208. package/lib/molecule/cm-popin/test/fixtures.js +28 -0
  209. package/lib/molecule/cm-popin/test/fixtures.js.map +1 -0
  210. package/lib/molecule/empty-search-result/test/fixtures.js +22 -0
  211. package/lib/molecule/empty-search-result/test/fixtures.js.map +1 -0
  212. package/lib/molecule/feedback/test/fixtures.js +0 -3
  213. package/lib/molecule/feedback/test/fixtures.js.map +1 -1
  214. package/lib/molecule/vertical-tabs/index.js +8 -3
  215. package/lib/molecule/vertical-tabs/index.js.map +1 -1
  216. package/lib/molecule/vertical-tabs/test/fixtures/default.js +2 -1
  217. package/lib/molecule/vertical-tabs/test/fixtures/default.js.map +1 -1
  218. package/lib/molecule/vertical-tabs/test/fixtures/with-selected-item.js +2 -1
  219. package/lib/molecule/vertical-tabs/test/fixtures/with-selected-item.js.map +1 -1
  220. package/lib/molecule/vertical-tabs/test/fixtures.js +25 -0
  221. package/lib/molecule/vertical-tabs/test/fixtures.js.map +1 -0
  222. package/lib/molecule/wizard-summary/index.js +3 -1
  223. package/lib/molecule/wizard-summary/index.js.map +1 -1
  224. package/lib/molecule/wizard-summary/style.css +8 -0
  225. package/lib/molecule/wizard-summary/test/fixtures.js +34 -0
  226. package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -0
  227. package/lib/organism/brand-form/test/fixtures/wizard-playlists.js +31 -0
  228. package/lib/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -0
  229. package/lib/organism/brand-form/test/fixtures.js +3 -0
  230. package/lib/organism/brand-form/test/fixtures.js.map +1 -1
  231. package/lib/organism/course-selection/test/fixtures.js +34 -0
  232. package/lib/organism/course-selection/test/fixtures.js.map +1 -0
  233. package/lib/organism/playlist-translation/index.js +78 -0
  234. package/lib/organism/playlist-translation/index.js.map +1 -0
  235. package/lib/organism/playlist-translation/style.css +45 -0
  236. package/lib/organism/playlist-translation/test/fixtures/default.js +35 -0
  237. package/lib/organism/playlist-translation/test/fixtures/default.js.map +1 -0
  238. package/lib/organism/playlist-translation/test/fixtures/delete.js +29 -0
  239. package/lib/organism/playlist-translation/test/fixtures/delete.js.map +1 -0
  240. package/lib/organism/playlist-translation/test/fixtures.js +25 -0
  241. package/lib/organism/playlist-translation/test/fixtures.js.map +1 -0
  242. package/lib/organism/search-and-chips-results/index.js +1 -0
  243. package/lib/organism/search-and-chips-results/index.js.map +1 -1
  244. package/lib/organism/search-and-chips-results/style.css +1 -1
  245. package/lib/organism/search-and-chips-results/test/fixtures.js +34 -0
  246. package/lib/organism/search-and-chips-results/test/fixtures.js.map +1 -0
  247. package/lib/organism/setup-header/index.js +80 -32
  248. package/lib/organism/setup-header/index.js.map +1 -1
  249. package/lib/organism/setup-header/style.css +27 -62
  250. package/lib/template/app-player/popin-end/test/fixtures.js +0 -3
  251. package/lib/template/app-player/popin-end/test/fixtures.js.map +1 -1
  252. package/lib/template/teams-dashboard/index.js +3 -1
  253. package/lib/template/teams-dashboard/index.js.map +1 -1
  254. package/lib/util/button-icons.js +23 -0
  255. package/lib/util/button-icons.js.map +1 -0
  256. package/lib/variables/colors.css +2 -0
  257. package/package.json +3 -3
  258. package/es/atom/button-link/test/fixtures/icon-button.js.map +0 -1
  259. package/es/atom/tag/test/fixtures/revision.js.map +0 -1
  260. package/es/molecule/cockpit-popin/test/fixtures.js +0 -17
  261. package/es/molecule/cockpit-popin/test/fixtures.js.map +0 -1
  262. package/lib/atom/button-link/test/fixtures/icon-button.js.map +0 -1
  263. package/lib/atom/tag/test/fixtures/revision.js.map +0 -1
  264. package/lib/molecule/cockpit-popin/test/fixtures.js +0 -28
  265. package/lib/molecule/cockpit-popin/test/fixtures.js.map +0 -1
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _ava = _interopRequireDefault(require("ava"));
4
+
5
+ var _forEach = _interopRequireDefault(require("lodash/forEach"));
6
+
7
+ var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
8
+
9
+ var _ = _interopRequireDefault(require(".."));
10
+
11
+ var _default = _interopRequireDefault(require("./fixtures/default"));
12
+
13
+ var _firstStep = _interopRequireDefault(require("./fixtures/first-step"));
14
+
15
+ var _lastStep = _interopRequireDefault(require("./fixtures/last-step"));
16
+
17
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+
19
+ (0, _ava.default)('Atom › AtomWizardSteps > should have valid propTypes', t => {
20
+ t.pass();
21
+ (0, _forEach.default)(_.default.propTypes, (value, key) => {
22
+ t.not(value, undefined, `PropType for "Atom.AtomWizardSteps.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
23
+ });
24
+ });
25
+ (0, _ava.default)('Atom › AtomWizardSteps › Default › should be rendered', _renderComponent.default, _.default, _default.default);
26
+ (0, _ava.default)('Atom › AtomWizardSteps › FirstStep › should be rendered', _renderComponent.default, _.default, _firstStep.default);
27
+ (0, _ava.default)('Atom › AtomWizardSteps › LastStep › should be rendered', _renderComponent.default, _.default, _lastStep.default);
28
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/atom/wizard-steps/test/fixtures.js"],"names":["t","pass","AtomWizardSteps","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureFirstStep","fixtureLastStep"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,sDAAL,EAA6DA,CAAC,IAAI;AAChEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAgBC,SAAxB,EAAmC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACjDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,gDAA+CF,GAAI,mEAA5E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,uDAAL,EAA8DG,wBAA9D,EAAoFN,SAApF,EAAqGO,gBAArG;AACA,kBAAK,yDAAL,EAAgED,wBAAhE,EAAsFN,SAAtF,EAAuGQ,kBAAvG;AACA,kBAAK,wDAAL,EAA+DF,wBAA/D,EAAqFN,SAArF,EAAsGS,iBAAtG","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomWizardSteps from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureFirstStep from './fixtures/first-step';\nimport fixtureLastStep from './fixtures/last-step';\n\ntest('Atom › AtomWizardSteps > should have valid propTypes', t => {\n t.pass();\n forEach(AtomWizardSteps.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomWizardSteps.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomWizardSteps › Default › should be rendered', renderComponentMacro, AtomWizardSteps, fixtureDefault);\ntest('Atom › AtomWizardSteps › FirstStep › should be rendered', renderComponentMacro, AtomWizardSteps, fixtureFirstStep);\ntest('Atom › AtomWizardSteps › LastStep › should be rendered', renderComponentMacro, AtomWizardSteps, fixtureLastStep);\n"],"file":"fixtures.js"}
@@ -11,7 +11,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
 
12
12
  var _novaIcons = require("@coorpacademy/nova-icons");
13
13
 
14
- var _link = _interopRequireDefault(require("../../atom/link"));
14
+ var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
15
15
 
16
16
  var _style = _interopRequireDefault(require("./style.css"));
17
17
 
@@ -27,23 +27,32 @@ const Banner = props => {
27
27
  secondCTA
28
28
  } = props;
29
29
  return /*#__PURE__*/_react.default.createElement("div", {
30
- className: (0, _classnames.default)(_style.default.banner, type === 'error' && _style.default.errorBanner)
30
+ className: (0, _classnames.default)(_style.default.banner, type === 'error' && _style.default.errorBanner),
31
+ title: message
31
32
  }, /*#__PURE__*/_react.default.createElement("div", {
32
33
  "data-name": `${type}-banner-message`,
33
34
  className: _style.default.message
34
35
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidInterfaceFeedbackInterfaceAlertDiamond, {
35
36
  className: _style.default.icon
36
- }), message), firstCTALabel ? /*#__PURE__*/_react.default.createElement(_link.default, {
37
+ }), message), firstCTALabel ? /*#__PURE__*/_react.default.createElement("div", {
38
+ className: _style.default.button
39
+ }, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
37
40
  "data-name": "first-banner-cta",
38
- className: _style.default.button,
39
- onClick: firstCTA
40
- }, firstCTALabel) : null, firstCTALabel && secondCTALabel ? /*#__PURE__*/_react.default.createElement("div", {
41
+ "aria-label": firstCTALabel,
42
+ label: firstCTALabel,
43
+ onClick: firstCTA,
44
+ type: "text"
45
+ })) : null, firstCTALabel && secondCTALabel ? /*#__PURE__*/_react.default.createElement("div", {
41
46
  className: _style.default.buttonsBar
42
- }) : null, secondCTALabel ? /*#__PURE__*/_react.default.createElement(_link.default, {
47
+ }) : null, secondCTALabel ? /*#__PURE__*/_react.default.createElement("div", {
48
+ className: _style.default.button
49
+ }, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
43
50
  "data-name": "second-banner-cta",
44
- className: _style.default.button,
45
- onClick: secondCTA
46
- }, secondCTALabel) : null);
51
+ onClick: secondCTA,
52
+ "aria-label": secondCTALabel,
53
+ label: secondCTALabel,
54
+ type: "text"
55
+ })) : null);
47
56
  };
48
57
 
49
58
  Banner.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/banner/index.js"],"names":["Banner","props","type","message","firstCTA","firstCTALabel","secondCTALabel","secondCTA","style","banner","errorBanner","icon","button","buttonsBar","propTypes","PropTypes","oneOf","string","isRequired","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,MAAM,GAAGC,KAAK,IAAI;AACtB,QAAM;AAACC,IAAAA,IAAD;AAAOC,IAAAA,OAAP;AAAgBC,IAAAA,QAAhB;AAA0BC,IAAAA,aAA1B;AAAyCC,IAAAA,cAAzC;AAAyDC,IAAAA;AAAzD,MAAsEN,KAA5E;AACA,sBACE;AAAK,IAAA,SAAS,EAAE,yBAAWO,eAAMC,MAAjB,EAAyBP,IAAI,KAAK,OAAT,IAAoBM,eAAME,WAAnD;AAAhB,kBACE;AAAK,iBAAY,GAAER,IAAK,iBAAxB;AAA0C,IAAA,SAAS,EAAEM,eAAML;AAA3D,kBACE,6BAAC,0DAAD;AAAc,IAAA,SAAS,EAAEK,eAAMG;AAA/B,IADF,EAEGR,OAFH,CADF,EAKGE,aAAa,gBACZ,6BAAC,aAAD;AAAM,iBAAU,kBAAhB;AAAmC,IAAA,SAAS,EAAEG,eAAMI,MAApD;AAA4D,IAAA,OAAO,EAAER;AAArE,KACGC,aADH,CADY,GAIV,IATN,EAUGA,aAAa,IAAIC,cAAjB,gBAAkC;AAAK,IAAA,SAAS,EAAEE,eAAMK;AAAtB,IAAlC,GAAyE,IAV5E,EAWGP,cAAc,gBACb,6BAAC,aAAD;AAAM,iBAAU,mBAAhB;AAAoC,IAAA,SAAS,EAAEE,eAAMI,MAArD;AAA6D,IAAA,OAAO,EAAEL;AAAtE,KACGD,cADH,CADa,GAIX,IAfN,CADF;AAmBD,CArBD;;AAuBAN,MAAM,CAACc,SAAP,2CAAmB;AACjBZ,EAAAA,IAAI,EAAEa,mBAAUC,KAAV,CAAgB,CAAC,aAAD,EAAgB,OAAhB,CAAhB,CADW;AAEjBb,EAAAA,OAAO,EAAEY,mBAAUE,MAAV,CAAiBC,UAFT;AAGjBd,EAAAA,QAAQ,EAAEW,mBAAUI,IAHH;AAIjBd,EAAAA,aAAa,EAAEU,mBAAUE,MAJR;AAKjBX,EAAAA,cAAc,EAAES,mBAAUE,MALT;AAMjBV,EAAAA,SAAS,EAAEQ,mBAAUI;AANJ,CAAnB;eASenB,M","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {NovaSolidInterfaceFeedbackInterfaceAlertDiamond as QuestionIcon} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport style from './style.css';\n\nconst Banner = props => {\n const {type, message, firstCTA, firstCTALabel, secondCTALabel, secondCTA} = props;\n return (\n <div className={classnames(style.banner, type === 'error' && style.errorBanner)}>\n <div data-name={`${type}-banner-message`} className={style.message}>\n <QuestionIcon className={style.icon} />\n {message}\n </div>\n {firstCTALabel ? (\n <Link data-name=\"first-banner-cta\" className={style.button} onClick={firstCTA}>\n {firstCTALabel}\n </Link>\n ) : null}\n {firstCTALabel && secondCTALabel ? <div className={style.buttonsBar} /> : null}\n {secondCTALabel ? (\n <Link data-name=\"second-banner-cta\" className={style.button} onClick={secondCTA}>\n {secondCTALabel}\n </Link>\n ) : null}\n </div>\n );\n};\n\nBanner.propTypes = {\n type: PropTypes.oneOf(['information', 'error']),\n message: PropTypes.string.isRequired,\n firstCTA: PropTypes.func,\n firstCTALabel: PropTypes.string,\n secondCTALabel: PropTypes.string,\n secondCTA: PropTypes.func\n};\n\nexport default Banner;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/molecule/banner/index.js"],"names":["Banner","props","type","message","firstCTA","firstCTALabel","secondCTALabel","secondCTA","style","banner","errorBanner","icon","button","buttonsBar","propTypes","PropTypes","oneOf","string","isRequired","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,MAAM,GAAGC,KAAK,IAAI;AACtB,QAAM;AAACC,IAAAA,IAAD;AAAOC,IAAAA,OAAP;AAAgBC,IAAAA,QAAhB;AAA0BC,IAAAA,aAA1B;AAAyCC,IAAAA,cAAzC;AAAyDC,IAAAA;AAAzD,MAAsEN,KAA5E;AACA,sBACE;AACE,IAAA,SAAS,EAAE,yBAAWO,eAAMC,MAAjB,EAAyBP,IAAI,KAAK,OAAT,IAAoBM,eAAME,WAAnD,CADb;AAEE,IAAA,KAAK,EAAEP;AAFT,kBAIE;AAAK,iBAAY,GAAED,IAAK,iBAAxB;AAA0C,IAAA,SAAS,EAAEM,eAAML;AAA3D,kBACE,6BAAC,0DAAD;AAAc,IAAA,SAAS,EAAEK,eAAMG;AAA/B,IADF,EAEGR,OAFH,CAJF,EAQGE,aAAa,gBACZ;AAAK,IAAA,SAAS,EAAEG,eAAMI;AAAtB,kBACE,6BAAC,mBAAD;AACE,iBAAU,kBADZ;AAEE,kBAAYP,aAFd;AAGE,IAAA,KAAK,EAAEA,aAHT;AAIE,IAAA,OAAO,EAAED,QAJX;AAKE,IAAA,IAAI,EAAC;AALP,IADF,CADY,GAUV,IAlBN,EAmBGC,aAAa,IAAIC,cAAjB,gBAAkC;AAAK,IAAA,SAAS,EAAEE,eAAMK;AAAtB,IAAlC,GAAyE,IAnB5E,EAoBGP,cAAc,gBACb;AAAK,IAAA,SAAS,EAAEE,eAAMI;AAAtB,kBACE,6BAAC,mBAAD;AACE,iBAAU,mBADZ;AAEE,IAAA,OAAO,EAAEL,SAFX;AAGE,kBAAYD,cAHd;AAIE,IAAA,KAAK,EAAEA,cAJT;AAKE,IAAA,IAAI,EAAC;AALP,IADF,CADa,GAUX,IA9BN,CADF;AAkCD,CApCD;;AAsCAN,MAAM,CAACc,SAAP,2CAAmB;AACjBZ,EAAAA,IAAI,EAAEa,mBAAUC,KAAV,CAAgB,CAAC,aAAD,EAAgB,OAAhB,CAAhB,CADW;AAEjBb,EAAAA,OAAO,EAAEY,mBAAUE,MAAV,CAAiBC,UAFT;AAGjBd,EAAAA,QAAQ,EAAEW,mBAAUI,IAHH;AAIjBd,EAAAA,aAAa,EAAEU,mBAAUE,MAJR;AAKjBX,EAAAA,cAAc,EAAES,mBAAUE,MALT;AAMjBV,EAAAA,SAAS,EAAEQ,mBAAUI;AANJ,CAAnB;eASenB,M","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {NovaSolidInterfaceFeedbackInterfaceAlertDiamond as QuestionIcon} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/button-link';\nimport style from './style.css';\n\nconst Banner = props => {\n const {type, message, firstCTA, firstCTALabel, secondCTALabel, secondCTA} = props;\n return (\n <div\n className={classnames(style.banner, type === 'error' && style.errorBanner)}\n title={message}\n >\n <div data-name={`${type}-banner-message`} className={style.message}>\n <QuestionIcon className={style.icon} />\n {message}\n </div>\n {firstCTALabel ? (\n <div className={style.button}>\n <Link\n data-name=\"first-banner-cta\"\n aria-label={firstCTALabel}\n label={firstCTALabel}\n onClick={firstCTA}\n type=\"text\"\n />\n </div>\n ) : null}\n {firstCTALabel && secondCTALabel ? <div className={style.buttonsBar} /> : null}\n {secondCTALabel ? (\n <div className={style.button}>\n <Link\n data-name=\"second-banner-cta\"\n onClick={secondCTA}\n aria-label={secondCTALabel}\n label={secondCTALabel}\n type=\"text\"\n />\n </div>\n ) : null}\n </div>\n );\n};\n\nBanner.propTypes = {\n type: PropTypes.oneOf(['information', 'error']),\n message: PropTypes.string.isRequired,\n firstCTA: PropTypes.func,\n firstCTALabel: PropTypes.string,\n secondCTALabel: PropTypes.string,\n secondCTA: PropTypes.func\n};\n\nexport default Banner;\n"],"file":"index.js"}
@@ -6,7 +6,9 @@
6
6
  @value cm_negative_50 from colors;
7
7
  @value cm_negative_200 from colors;
8
8
  @value cm_warning_50 from colors;
9
+ @value cm_yellow_100 from colors;
9
10
  @value cm_yellow_200 from colors;
11
+ @value cm_yellow_400 from colors;
10
12
 
11
13
  .banner {
12
14
  display: flex;
@@ -26,20 +28,20 @@
26
28
  color: cm_negative_200;
27
29
  }
28
30
 
29
- .button {
30
- flex-grow: 0;
31
- font-family: Gilroy;
32
- font-size: 12px;
33
- font-weight: bold;
34
- line-height: 1.33;
31
+ .button{
35
32
  background-color: transparent;
33
+ color: cm_yellow_200;
34
+ }
35
+
36
+ .button :hover{
37
+ color: cm_yellow_400;
36
38
  }
37
39
 
38
40
  .buttonsBar {
39
- width: 1px;
41
+ width: 2px;
40
42
  align-self: stretch;
41
43
  flex-grow: 0;
42
- opacity: 0.1;
44
+ opacity: 0.3;
43
45
  background-color: cm_yellow_200;
44
46
  }
45
47
 
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ var _ava = _interopRequireDefault(require("ava"));
4
+
5
+ var _forEach = _interopRequireDefault(require("lodash/forEach"));
6
+
7
+ var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
8
+
9
+ var _ = _interopRequireDefault(require(".."));
10
+
11
+ var _default = _interopRequireDefault(require("./fixtures/default"));
12
+
13
+ var _errorBanner = _interopRequireDefault(require("./fixtures/error-banner"));
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+
17
+ (0, _ava.default)('Molecule › MoleculeBanner > should have valid propTypes', t => {
18
+ t.pass();
19
+ (0, _forEach.default)(_.default.propTypes, (value, key) => {
20
+ t.not(value, undefined, `PropType for "Molecule.MoleculeBanner.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
21
+ });
22
+ });
23
+ (0, _ava.default)('Molecule › MoleculeBanner › Default › should be rendered', _renderComponent.default, _.default, _default.default);
24
+ (0, _ava.default)('Molecule › MoleculeBanner › ErrorBanner › should be rendered', _renderComponent.default, _.default, _errorBanner.default);
25
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/molecule/banner/test/fixtures.js"],"names":["t","pass","MoleculeBanner","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureErrorBanner"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,yDAAL,EAAgEA,CAAC,IAAI;AACnEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAeC,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,mDAAkDF,GAAI,mEAA/E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,0DAAL,EAAiEG,wBAAjE,EAAuFN,SAAvF,EAAuGO,gBAAvG;AACA,kBAAK,8DAAL,EAAqED,wBAArE,EAA2FN,SAA3F,EAA2GQ,oBAA3G","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeBanner from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureErrorBanner from './fixtures/error-banner';\n\ntest('Molecule › MoleculeBanner > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeBanner.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeBanner.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeBanner › Default › should be rendered', renderComponentMacro, MoleculeBanner, fixtureDefault);\ntest('Molecule › MoleculeBanner › ErrorBanner › should be rendered', renderComponentMacro, MoleculeBanner, fixtureErrorBanner);\n"],"file":"fixtures.js"}
@@ -7,6 +7,8 @@ var _snakeCase2 = _interopRequireDefault(require("lodash/fp/snakeCase"));
7
7
 
8
8
  var _map2 = _interopRequireDefault(require("lodash/fp/map"));
9
9
 
10
+ var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
11
+
10
12
  var _react = _interopRequireDefault(require("react"));
11
13
 
12
14
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -57,6 +59,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
57
59
 
58
60
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
59
61
 
62
+ const inputContainerStyle = {
63
+ default: _style.default.defaultWidth,
64
+ medium: _style.default.mediumWidth,
65
+ large: _style.default.largeWidth
66
+ };
67
+
60
68
  const buildInput = field => {
61
69
  const {
62
70
  type
@@ -125,8 +133,13 @@ const buildInput = field => {
125
133
 
126
134
  const buildField = (field, index) => {
127
135
  const input = buildInput(field);
136
+ const {
137
+ theme,
138
+ size = 'default'
139
+ } = field;
140
+ const styleInput = theme === 'coorpmanager' ? inputContainerStyle[size] : _style.default.field;
128
141
  return /*#__PURE__*/_react.default.createElement("div", {
129
- className: _style.default.field,
142
+ className: styleInput,
130
143
  key: index
131
144
  }, input);
132
145
  };
@@ -164,7 +177,8 @@ BrandFormGroup.propTypes = process.env.NODE_ENV !== "production" ? {
164
177
  fieldsLayout: _propTypes.default.string,
165
178
  groupLayout: _propTypes.default.string,
166
179
  fields: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape(_extends(_extends({}, _autocomplete.default.propTypes), {}, {
167
- type: _propTypes.default.oneOf(['autoComplete'])
180
+ type: _propTypes.default.oneOf(['autoComplete']),
181
+ size: _propTypes.default.oneOf((0, _keys2.default)(inputContainerStyle))
168
182
  })), _propTypes.default.shape(_extends(_extends({}, _inputColor.default.propTypes), {}, {
169
183
  type: _propTypes.default.oneOf(['color'])
170
184
  })), _propTypes.default.shape(_extends(_extends({}, _inputReadonly.default.propTypes), {}, {
@@ -172,13 +186,15 @@ BrandFormGroup.propTypes = process.env.NODE_ENV !== "production" ? {
172
186
  })), _propTypes.default.shape(_extends(_extends({}, _inputSwitch.default.propTypes), {}, {
173
187
  type: _propTypes.default.oneOf(['switch'])
174
188
  })), _propTypes.default.shape(_extends(_extends({}, _inputTextarea.default.propTypes), {}, {
175
- type: _propTypes.default.oneOf(['textarea'])
189
+ type: _propTypes.default.oneOf(['textarea']),
190
+ size: _propTypes.default.oneOf((0, _keys2.default)(inputContainerStyle))
176
191
  })), _propTypes.default.shape(_extends(_extends({}, _inputHtml.default.propTypes), {}, {
177
192
  type: _propTypes.default.oneOf(['html'])
178
193
  })), _propTypes.default.shape(_extends(_extends({}, _inputDoublestep.default.propTypes), {}, {
179
194
  type: _propTypes.default.oneOf(['doublestep'])
180
195
  })), _propTypes.default.shape(_extends(_extends({}, _select.default.propTypes), {}, {
181
- type: _propTypes.default.oneOf(['select'])
196
+ type: _propTypes.default.oneOf(['select']),
197
+ size: _propTypes.default.oneOf((0, _keys2.default)(inputContainerStyle))
182
198
  })), _propTypes.default.shape(_extends(_extends({}, _inputCheckbox.default.propTypes), {}, {
183
199
  type: _propTypes.default.oneOf(['checkbox'])
184
200
  })), _propTypes.default.shape(_extends(_extends({}, _imageUpload.default.propTypes), {}, {
@@ -188,7 +204,8 @@ BrandFormGroup.propTypes = process.env.NODE_ENV !== "production" ? {
188
204
  })), _propTypes.default.shape(_extends(_extends({}, _setupSections.default.propTypes), {}, {
189
205
  type: _propTypes.default.oneOf(['sections'])
190
206
  })), _propTypes.default.shape(_extends(_extends({}, _inputText.default.propTypes), {}, {
191
- type: _propTypes.default.oneOf(['text'])
207
+ type: _propTypes.default.oneOf(['text']),
208
+ size: _propTypes.default.oneOf((0, _keys2.default)(inputContainerStyle))
192
209
  })), _propTypes.default.shape(_extends(_extends({}, _brandDownloadBox.default.propTypes), {}, {
193
210
  type: _propTypes.default.oneOf(['downloadbox'])
194
211
  })), _propTypes.default.shape(_extends(_extends({}, _brandUploadBox.default.propTypes), {}, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/brand-form-group/index.js"],"names":["buildInput","field","type","buildField","index","input","style","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","fieldsList","convert","cap","wrapper","groupGrid","titleWrapper","grid","propTypes","PropTypes","string","arrayOf","oneOfType","shape","Autocomplete","oneOf","InputColor","InputReadonly","InputSwitch","InputTextarea","InputHTML","InputDoublestep","Select","InputCheckbox","ImageUpload","SetupSlider","SetupSections","InputText","BrandDownloadBox","BrandUploadBox","Button","SelectMultiple","Roles"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,UAAU,GAAGC,KAAK,IAAI;AAC1B,QAAM;AAACC,IAAAA;AAAD,MAASD,KAAf;;AAEA,UAAQC,IAAR;AACE,SAAK,cAAL;AACE,0BAAO,6BAAC,qBAAD,EAAkBD,KAAlB,CAAP;;AACF,SAAK,OAAL;AACE,0BAAO,6BAAC,mBAAD,EAAgBA,KAAhB,CAAP;;AACF,SAAK,UAAL;AACE,0BAAO,6BAAC,sBAAD,EAAmBA,KAAnB,CAAP;;AACF,SAAK,QAAL;AACE,0BAAO,6BAAC,oBAAD,EAAiBA,KAAjB,CAAP;;AACF,SAAK,UAAL;AACE,0BAAO,6BAAC,sBAAD,EAAmBA,KAAnB,CAAP;;AACF,SAAK,MAAL;AACE,0BAAO,6BAAC,kBAAD,EAAeA,KAAf,CAAP;;AACF,SAAK,YAAL;AACE,0BAAO,6BAAC,wBAAD,EAAqBA,KAArB,CAAP;;AACF,SAAK,QAAL;AACE,0BAAO,6BAAC,eAAD,EAAYA,KAAZ,CAAP;;AACF,S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M,KAAV,CAAgB,CAAC,MAAD,CAAhB;AAFR,KAjDkB,EAqDlBN,mBAAUI,KAAV,uBACKe,0BAAiBpB,SADtB;AAEEnB,IAAAA,IAAI,EAAEoB,mBAAUM,KAAV,CAAgB,CAAC,aAAD,CAAhB;AAFR,KArDkB,EAyDlBN,mBAAUI,KAAV,uBACKgB,wBAAerB,SADpB;AAEEnB,IAAAA,IAAI,EAAEoB,mBAAUM,KAAV,CAAgB,CAAC,WAAD,CAAhB;AAFR,KAzDkB,EA6DlBN,mBAAUI,KAAV,uBACKiB,gBAAOtB,SADZ;AAEEnB,IAAAA,IAAI,EAAEoB,mBAAUM,KAAV,CAAgB,CAAC,QAAD,CAAhB;AAFR,KA7DkB,EAiElBN,mBAAUI,KAAV,uBACKkB,wBAAevB,SADpB;AAEEnB,IAAAA,IAAI,EAAEoB,mBAAUM,KAAV,CAAgB,CAAC,gBAAD,CAAhB;AAFR,KAjEkB,EAqElBN,mBAAUI,KAAV,uBACKmB,2BAAMxB,SADX;AAEEnB,IAAAA,IAAI,EAAEoB,mBAAUM,KAAV,CAAgB,CAAC,OAAD,CAAhB;AAFR,KArEkB,EAyElBN,mBAAUI,KAAV,CAAgBc,mBAAUnB,SAA1B,CAzEkB,CAApB,CADM;AALiB,CAA3B;eAmFed,c","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, snakeCase} from 'lodash/fp';\nimport classNames from 'classnames';\nimport Autocomplete from '../../atom/autocomplete';\nimport Select from '../../atom/select';\nimport SelectMultiple from '../select-multiple';\nimport InputText from '../../atom/input-text';\nimport InputColor from '../../atom/input-color';\nimport InputCheckbox from '../../atom/input-checkbox';\nimport InputReadonly from '../../atom/input-readonly';\nimport InputSwitch from '../../atom/input-switch';\nimport BrandUploadBox from '../brand-upload-box';\nimport BrandDownloadBox from '../brand-download-box';\nimport Button from '../../atom/button';\nimport InputTextarea from '../../atom/input-textarea';\nimport InputHTML from '../../atom/input-html';\nimport InputDoublestep from '../../atom/input-doublestep';\nimport ImageUpload from '../../atom/image-upload';\nimport SetupSlider from '../setup-slider';\nimport SetupSections from '../setup-sections';\nimport Title from '../../atom/title';\nimport Roles from '../coorp-manager-roles';\nimport style from './style.css';\n\nconst buildInput = field => {\n const {type} = field;\n\n switch (type) {\n case 'autoComplete':\n return <Autocomplete {...field} />;\n case 'color':\n return <InputColor {...field} />;\n case 'readonly':\n return <InputReadonly {...field} />;\n case 'switch':\n return <InputSwitch {...field} />;\n case 'textarea':\n return <InputTextarea {...field} />;\n case 'html':\n return <InputHTML {...field} />;\n case 'doublestep':\n return <InputDoublestep {...field} />;\n case 'select':\n return <Select {...field} />;\n case 'selectMultiple':\n return <SelectMultiple {...field} />;\n case 'checkbox':\n return <InputCheckbox {...field} />;\n case 'image':\n return <ImageUpload {...field} />;\n case 'slider':\n return <SetupSlider {...field} />;\n case 'sections':\n return <SetupSections {...field} />;\n case 'text':\n return <InputText {...field} />;\n case 'downloadbox':\n return <BrandDownloadBox {...field} />;\n case 'uploadbox':\n return <BrandUploadBox {...field} />;\n case 'button':\n case 'link':\n return <Button {...field} />;\n case 'roles':\n return <Roles {...field} />;\n default:\n return <InputText {...field} />;\n }\n};\n\nconst buildField = (field, index) => {\n const input = buildInput(field);\n\n return (\n <div className={style.field} key={index}>\n {input}\n </div>\n );\n};\n\nconst BrandFormGroup = props => {\n const {title, subtitle = '', fieldsLayout = '', groupLayout = '', fields = []} = props;\n const fieldsList = map.convert({cap: false})(buildField, fields);\n\n return (\n <div\n data-name={`brand_form_group_${snakeCase(title)}`}\n className={classNames(style.wrapper, groupLayout === 'grid' && style.groupGrid)}\n >\n <div className={style.titleWrapper}>\n <Title title={title} subtitle={subtitle} type={'form-group'} />\n </div>\n <div className={fieldsLayout === 'grid' ? style.grid : null}>{fieldsList}</div>\n </div>\n );\n};\n\nBrandFormGroup.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n fieldsLayout: PropTypes.string,\n groupLayout: PropTypes.string,\n fields: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n ...Autocomplete.propTypes,\n type: PropTypes.oneOf(['autoComplete'])\n }),\n PropTypes.shape({\n ...InputColor.propTypes,\n type: PropTypes.oneOf(['color'])\n }),\n PropTypes.shape({\n ...InputReadonly.propTypes,\n type: PropTypes.oneOf(['readonly'])\n }),\n PropTypes.shape({\n ...InputSwitch.propTypes,\n type: PropTypes.oneOf(['switch'])\n }),\n PropTypes.shape({\n ...InputTextarea.propTypes,\n type: PropTypes.oneOf(['textarea'])\n }),\n PropTypes.shape({\n ...InputHTML.propTypes,\n type: PropTypes.oneOf(['html'])\n }),\n PropTypes.shape({\n ...InputDoublestep.propTypes,\n type: PropTypes.oneOf(['doublestep'])\n }),\n PropTypes.shape({\n ...Select.propTypes,\n type: PropTypes.oneOf(['select'])\n }),\n PropTypes.shape({\n ...InputCheckbox.propTypes,\n type: PropTypes.oneOf(['checkbox'])\n }),\n PropTypes.shape({\n ...ImageUpload.propTypes,\n type: PropTypes.oneOf(['image'])\n }),\n PropTypes.shape({\n ...SetupSlider.propTypes,\n type: PropTypes.oneOf(['slider'])\n }),\n PropTypes.shape({\n ...SetupSections.propTypes,\n type: PropTypes.oneOf(['sections'])\n }),\n PropTypes.shape({\n ...InputText.propTypes,\n type: PropTypes.oneOf(['text'])\n }),\n PropTypes.shape({\n ...BrandDownloadBox.propTypes,\n type: PropTypes.oneOf(['downloadbox'])\n }),\n PropTypes.shape({\n ...BrandUploadBox.propTypes,\n type: PropTypes.oneOf(['uploadbox'])\n }),\n PropTypes.shape({\n ...Button.propTypes,\n type: PropTypes.oneOf(['button'])\n }),\n PropTypes.shape({\n ...SelectMultiple.propTypes,\n type: PropTypes.oneOf(['selectMultiple'])\n }),\n PropTypes.shape({\n ...Roles.propTypes,\n type: PropTypes.oneOf(['roles'])\n }),\n PropTypes.shape(InputText.propTypes)\n ])\n )\n};\nexport default BrandFormGroup;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/molecule/brand-form-group/index.js"],"names":["inputContainerStyle","default","style","defaultWidth","medium","mediumWidth","large","largeWidth","buildInput","field","type","buildField","index","input","theme","size","styleInput","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","fieldsList","convert","cap","wrapper","groupGrid","titleWrapper","grid","propTypes","PropTypes","string","arrayOf","oneOfType","shape","Autocomplete","oneOf","InputColor","InputReadonly","InputSwitch","InputTextarea","InputHTML","InputDoublestep","Select","InputCheckbox","ImageUpload","SetupSlider","SetupSections","InputText","BrandDownloadBox","BrandUploadBox","Button","SelectMultiple","Roles"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,mBAAmB,GAAG;AAC1BC,EAAAA,OAAO,EAAEC,eAAMC,YADW;AAE1BC,EAAAA,MAAM,EAAEF,eAAMG,WAFY;AAG1BC,EAAAA,KAAK,EAAEJ,eAAMK;AAHa,CAA5B;;AAMA,MAAMC,UAAU,GAAGC,KAAK,IAAI;AAC1B,QAAM;AAACC,IAAAA;AAAD,MAASD,KAAf;;AAEA,UAAQC,IAAR;AACE,SAAK,cAAL;AACE,0BAAO,6BAAC,qBAAD,EAAkBD,KAAlB,CAAP;;AACF,SAAK,OAAL;AACE,0BAAO,6BAAC,mBAAD,EAAgBA,KAAhB,CAAP;;AACF,SAAK,UAAL;AACE,0BAAO,6BAAC,sBAAD,EAAmBA,KAAnB,CAAP;;AACF,SAAK,QAAL;AACE,0BAAO,6BAAC,oBAAD,EAAiBA,KAAjB,CAAP;;AACF,SAAK,UAAL;AACE,0BAAO,6BAAC,sBAAD,EAAmBA,KAAnB,CAAP;;AACF,SAAK,MAAL;AACE,0BAAO,6BAAC,kBAAD,EAAeA,KAAf,CAAP;;AACF,SAAK,YAAL;AACE,0BAAO,6BAAC,wBAAD,EAAqBA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EAAEsB,mBAAUM,KAAV,CAAgB,CAAC,OAAD,CAAhB;AAFR,KAzEkB,EA6ElBN,mBAAUI,KAAV,CAAgBc,mBAAUnB,SAA1B,CA7EkB,CAApB,CADM;AALiB,CAA3B;eAuFed,c","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {keys, map, snakeCase} from 'lodash/fp';\nimport classNames from 'classnames';\nimport Autocomplete from '../../atom/autocomplete';\nimport Select from '../../atom/select';\nimport SelectMultiple from '../select-multiple';\nimport InputText from '../../atom/input-text';\nimport InputColor from '../../atom/input-color';\nimport InputCheckbox from '../../atom/input-checkbox';\nimport InputReadonly from '../../atom/input-readonly';\nimport InputSwitch from '../../atom/input-switch';\nimport BrandUploadBox from '../brand-upload-box';\nimport BrandDownloadBox from '../brand-download-box';\nimport Button from '../../atom/button';\nimport InputTextarea from '../../atom/input-textarea';\nimport InputHTML from '../../atom/input-html';\nimport InputDoublestep from '../../atom/input-doublestep';\nimport ImageUpload from '../../atom/image-upload';\nimport SetupSlider from '../setup-slider';\nimport SetupSections from '../setup-sections';\nimport Title from '../../atom/title';\nimport Roles from '../coorp-manager-roles';\nimport style from './style.css';\n\nconst inputContainerStyle = {\n default: style.defaultWidth,\n medium: style.mediumWidth,\n large: style.largeWidth\n};\n\nconst buildInput = field => {\n const {type} = field;\n\n switch (type) {\n case 'autoComplete':\n return <Autocomplete {...field} />;\n case 'color':\n return <InputColor {...field} />;\n case 'readonly':\n return <InputReadonly {...field} />;\n case 'switch':\n return <InputSwitch {...field} />;\n case 'textarea':\n return <InputTextarea {...field} />;\n case 'html':\n return <InputHTML {...field} />;\n case 'doublestep':\n return <InputDoublestep {...field} />;\n case 'select':\n return <Select {...field} />;\n case 'selectMultiple':\n return <SelectMultiple {...field} />;\n case 'checkbox':\n return <InputCheckbox {...field} />;\n case 'image':\n return <ImageUpload {...field} />;\n case 'slider':\n return <SetupSlider {...field} />;\n case 'sections':\n return <SetupSections {...field} />;\n case 'text':\n return <InputText {...field} />;\n case 'downloadbox':\n return <BrandDownloadBox {...field} />;\n case 'uploadbox':\n return <BrandUploadBox {...field} />;\n case 'button':\n case 'link':\n return <Button {...field} />;\n case 'roles':\n return <Roles {...field} />;\n default:\n return <InputText {...field} />;\n }\n};\n\nconst buildField = (field, index) => {\n const input = buildInput(field);\n const {theme, size = 'default'} = field;\n const styleInput = theme === 'coorpmanager' ? inputContainerStyle[size] : style.field;\n\n return (\n <div className={styleInput} key={index}>\n {input}\n </div>\n );\n};\n\nconst BrandFormGroup = props => {\n const {title, subtitle = '', fieldsLayout = '', groupLayout = '', fields = []} = props;\n const fieldsList = map.convert({cap: false})(buildField, fields);\n\n return (\n <div\n data-name={`brand_form_group_${snakeCase(title)}`}\n className={classNames(style.wrapper, groupLayout === 'grid' && style.groupGrid)}\n >\n <div className={style.titleWrapper}>\n <Title title={title} subtitle={subtitle} type={'form-group'} />\n </div>\n <div className={fieldsLayout === 'grid' ? style.grid : null}>{fieldsList}</div>\n </div>\n );\n};\n\nBrandFormGroup.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n fieldsLayout: PropTypes.string,\n groupLayout: PropTypes.string,\n fields: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n ...Autocomplete.propTypes,\n type: PropTypes.oneOf(['autoComplete']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputColor.propTypes,\n type: PropTypes.oneOf(['color'])\n }),\n PropTypes.shape({\n ...InputReadonly.propTypes,\n type: PropTypes.oneOf(['readonly'])\n }),\n PropTypes.shape({\n ...InputSwitch.propTypes,\n type: PropTypes.oneOf(['switch'])\n }),\n PropTypes.shape({\n ...InputTextarea.propTypes,\n type: PropTypes.oneOf(['textarea']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputHTML.propTypes,\n type: PropTypes.oneOf(['html'])\n }),\n PropTypes.shape({\n ...InputDoublestep.propTypes,\n type: PropTypes.oneOf(['doublestep'])\n }),\n PropTypes.shape({\n ...Select.propTypes,\n type: PropTypes.oneOf(['select']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputCheckbox.propTypes,\n type: PropTypes.oneOf(['checkbox'])\n }),\n PropTypes.shape({\n ...ImageUpload.propTypes,\n type: PropTypes.oneOf(['image'])\n }),\n PropTypes.shape({\n ...SetupSlider.propTypes,\n type: PropTypes.oneOf(['slider'])\n }),\n PropTypes.shape({\n ...SetupSections.propTypes,\n type: PropTypes.oneOf(['sections'])\n }),\n PropTypes.shape({\n ...InputText.propTypes,\n type: PropTypes.oneOf(['text']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...BrandDownloadBox.propTypes,\n type: PropTypes.oneOf(['downloadbox'])\n }),\n PropTypes.shape({\n ...BrandUploadBox.propTypes,\n type: PropTypes.oneOf(['uploadbox'])\n }),\n PropTypes.shape({\n ...Button.propTypes,\n type: PropTypes.oneOf(['button'])\n }),\n PropTypes.shape({\n ...SelectMultiple.propTypes,\n type: PropTypes.oneOf(['selectMultiple'])\n }),\n PropTypes.shape({\n ...Roles.propTypes,\n type: PropTypes.oneOf(['roles'])\n }),\n PropTypes.shape(InputText.propTypes)\n ])\n )\n};\nexport default BrandFormGroup;\n"],"file":"index.js"}
@@ -50,6 +50,25 @@
50
50
  margin-bottom: 0;
51
51
  }
52
52
 
53
+ .fieldCoorpmanager {
54
+ margin: 0 0 32px 0;
55
+ }
56
+
57
+ .defaultWidth {
58
+ composes: fieldCoorpmanager;
59
+ width: 300px;
60
+ }
61
+
62
+ .mediumWidth {
63
+ composes: fieldCoorpmanager;
64
+ width: 444px;
65
+ }
66
+
67
+ .largeWidth {
68
+ composes: fieldCoorpmanager;
69
+ width: 100%;
70
+ }
71
+
53
72
  @media desktop {
54
73
  .groupGrid {
55
74
  flex-direction: column;
@@ -12,6 +12,8 @@ var _analytics = _interopRequireDefault(require("./fixtures/analytics"));
12
12
 
13
13
  var _animations = _interopRequireDefault(require("./fixtures/animations"));
14
14
 
15
+ var _cmDefault = _interopRequireDefault(require("./fixtures/cm-default"));
16
+
15
17
  var _cohort = _interopRequireDefault(require("./fixtures/cohort"));
16
18
 
17
19
  var _dashboard = _interopRequireDefault(require("./fixtures/dashboard"));
@@ -40,6 +42,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
40
42
  });
41
43
  (0, _ava.default)('Molecule › MoleculeBrandFormGroup › Analytics › should be rendered', _renderComponent.default, _.default, _analytics.default);
42
44
  (0, _ava.default)('Molecule › MoleculeBrandFormGroup › Animations › should be rendered', _renderComponent.default, _.default, _animations.default);
45
+ (0, _ava.default)('Molecule › MoleculeBrandFormGroup › CmDefault › should be rendered', _renderComponent.default, _.default, _cmDefault.default);
43
46
  (0, _ava.default)('Molecule › MoleculeBrandFormGroup › Cohort › should be rendered', _renderComponent.default, _.default, _cohort.default);
44
47
  (0, _ava.default)('Molecule › MoleculeBrandFormGroup › Dashboard › should be rendered', _renderComponent.default, _.default, _dashboard.default);
45
48
  (0, _ava.default)('Molecule › MoleculeBrandFormGroup › Default › should be rendered', _renderComponent.default, _.default, _default.default);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/molecule/brand-form-group/test/fixtures.js"],"names":["t","pass","MoleculeBrandFormGroup","propTypes","value","key","not","undefined","renderComponentMacro","fixtureAnalytics","fixtureAnimations","fixtureCohort","fixtureDashboard","fixtureDefault","fixtureDoublefield","fixtureImages","fixtureLookandfeel","fixtureRoles","fixtureSlider","fixtureSso"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,iEAAL,EAAwEA,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAuBC,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2DAA0DF,GAAI,mEAAvF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,oEAAL,EAA2EG,wBAA3E,EAAiGN,SAAjG,EAAyHO,kBAAzH;AACA,kBAAK,qEAAL,EAA4ED,wBAA5E,EAAkGN,SAAlG,EAA0HQ,mBAA1H;AACA,kBAAK,iEAAL,EAAwEF,wBAAxE,EAA8FN,SAA9F,EAAsHS,eAAtH;AACA,kBAAK,oEAAL,EAA2EH,wBAA3E,EAAiGN,SAAjG,EAAyHU,kBAAzH;AACA,kBAAK,kEAAL,EAAyEJ,wBAAzE,EAA+FN,SAA/F,EAAuHW,gBAAvH;AACA,kBAAK,sEAAL,EAA6EL,wBAA7E,EAAmGN,SAAnG,EAA2HY,oBAA3H;AACA,kBAAK,iEAAL,EAAwEN,wBAAxE,EAA8FN,SAA9F,EAAsHa,eAAtH;AACA,kBAAK,sEAAL,EAA6EP,wBAA7E,EAAmGN,SAAnG,EAA2Hc,oBAA3H;AACA,kBAAK,gEAAL,EAAuER,wBAAvE,EAA6FN,SAA7F,EAAqHe,cAArH;AACA,kBAAK,iEAAL,EAAwET,wBAAxE,EAA8FN,SAA9F,EAAsHgB,eAAtH;AACA,kBAAK,8DAAL,EAAqEV,wBAArE,EAA2FN,SAA3F,EAAmHiB,YAAnH","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeBrandFormGroup from '..';\nimport fixtureAnalytics from './fixtures/analytics';\nimport fixtureAnimations from './fixtures/animations';\nimport fixtureCohort from './fixtures/cohort';\nimport fixtureDashboard from './fixtures/dashboard';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDoublefield from './fixtures/doublefield';\nimport fixtureImages from './fixtures/images';\nimport fixtureLookandfeel from './fixtures/lookandfeel';\nimport fixtureRoles from './fixtures/roles';\nimport fixtureSlider from './fixtures/slider';\nimport fixtureSso from './fixtures/sso';\n\ntest('Molecule › MoleculeBrandFormGroup > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeBrandFormGroup.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeBrandFormGroup.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeBrandFormGroup › Analytics › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureAnalytics);\ntest('Molecule › MoleculeBrandFormGroup › Animations › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureAnimations);\ntest('Molecule › MoleculeBrandFormGroup › Cohort › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureCohort);\ntest('Molecule › MoleculeBrandFormGroup › Dashboard › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDashboard);\ntest('Molecule › MoleculeBrandFormGroup › Default › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDefault);\ntest('Molecule › MoleculeBrandFormGroup › Doublefield › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDoublefield);\ntest('Molecule › MoleculeBrandFormGroup › Images › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureImages);\ntest('Molecule › MoleculeBrandFormGroup › Lookandfeel › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureLookandfeel);\ntest('Molecule › MoleculeBrandFormGroup › Roles › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureRoles);\ntest('Molecule › MoleculeBrandFormGroup › Slider › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureSlider);\ntest('Molecule › MoleculeBrandFormGroup › Sso › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureSso);\n"],"file":"fixtures.js"}
1
+ {"version":3,"sources":["../../../../src/molecule/brand-form-group/test/fixtures.js"],"names":["t","pass","MoleculeBrandFormGroup","propTypes","value","key","not","undefined","renderComponentMacro","fixtureAnalytics","fixtureAnimations","fixtureCmDefault","fixtureCohort","fixtureDashboard","fixtureDefault","fixtureDoublefield","fixtureImages","fixtureLookandfeel","fixtureRoles","fixtureSlider","fixtureSso"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,iEAAL,EAAwEA,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAuBC,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2DAA0DF,GAAI,mEAAvF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,oEAAL,EAA2EG,wBAA3E,EAAiGN,SAAjG,EAAyHO,kBAAzH;AACA,kBAAK,qEAAL,EAA4ED,wBAA5E,EAAkGN,SAAlG,EAA0HQ,mBAA1H;AACA,kBAAK,oEAAL,EAA2EF,wBAA3E,EAAiGN,SAAjG,EAAyHS,kBAAzH;AACA,kBAAK,iEAAL,EAAwEH,wBAAxE,EAA8FN,SAA9F,EAAsHU,eAAtH;AACA,kBAAK,oEAAL,EAA2EJ,wBAA3E,EAAiGN,SAAjG,EAAyHW,kBAAzH;AACA,kBAAK,kEAAL,EAAyEL,wBAAzE,EAA+FN,SAA/F,EAAuHY,gBAAvH;AACA,kBAAK,sEAAL,EAA6EN,wBAA7E,EAAmGN,SAAnG,EAA2Ha,oBAA3H;AACA,kBAAK,iEAAL,EAAwEP,wBAAxE,EAA8FN,SAA9F,EAAsHc,eAAtH;AACA,kBAAK,sEAAL,EAA6ER,wBAA7E,EAAmGN,SAAnG,EAA2He,oBAA3H;AACA,kBAAK,gEAAL,EAAuET,wBAAvE,EAA6FN,SAA7F,EAAqHgB,cAArH;AACA,kBAAK,iEAAL,EAAwEV,wBAAxE,EAA8FN,SAA9F,EAAsHiB,eAAtH;AACA,kBAAK,8DAAL,EAAqEX,wBAArE,EAA2FN,SAA3F,EAAmHkB,YAAnH","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeBrandFormGroup from '..';\nimport fixtureAnalytics from './fixtures/analytics';\nimport fixtureAnimations from './fixtures/animations';\nimport fixtureCmDefault from './fixtures/cm-default';\nimport fixtureCohort from './fixtures/cohort';\nimport fixtureDashboard from './fixtures/dashboard';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDoublefield from './fixtures/doublefield';\nimport fixtureImages from './fixtures/images';\nimport fixtureLookandfeel from './fixtures/lookandfeel';\nimport fixtureRoles from './fixtures/roles';\nimport fixtureSlider from './fixtures/slider';\nimport fixtureSso from './fixtures/sso';\n\ntest('Molecule › MoleculeBrandFormGroup > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeBrandFormGroup.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeBrandFormGroup.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeBrandFormGroup › Analytics › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureAnalytics);\ntest('Molecule › MoleculeBrandFormGroup › Animations › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureAnimations);\ntest('Molecule › MoleculeBrandFormGroup › CmDefault › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureCmDefault);\ntest('Molecule › MoleculeBrandFormGroup › Cohort › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureCohort);\ntest('Molecule › MoleculeBrandFormGroup › Dashboard › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDashboard);\ntest('Molecule › MoleculeBrandFormGroup › Default › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDefault);\ntest('Molecule › MoleculeBrandFormGroup › Doublefield › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDoublefield);\ntest('Molecule › MoleculeBrandFormGroup › Images › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureImages);\ntest('Molecule › MoleculeBrandFormGroup › Lookandfeel › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureLookandfeel);\ntest('Molecule › MoleculeBrandFormGroup › Roles › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureRoles);\ntest('Molecule › MoleculeBrandFormGroup › Slider › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureSlider);\ntest('Molecule › MoleculeBrandFormGroup › Sso › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureSso);\n"],"file":"fixtures.js"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _react = _interopRequireWildcard(require("react"));
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ var _buttonLinkIconOnly = _interopRequireDefault(require("../../atom/button-link-icon-only"));
11
+
12
+ var _buttonMenu = _interopRequireDefault(require("../../atom/button-menu"));
13
+
14
+ var _style = _interopRequireDefault(require("./style.css"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
19
+
20
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
+
24
+ const BulletPointMenuButton = props => {
25
+ const {
26
+ disabled = false,
27
+ buttonAriaLabel,
28
+ menuAriaLabel,
29
+ onClick,
30
+ buttons
31
+ } = props;
32
+ const handleOnClick = (0, _react.useCallback)(() => onClick(), [onClick]);
33
+ const menuProps = {
34
+ 'data-name': 'button-menu',
35
+ buttons
36
+ };
37
+
38
+ const menu = /*#__PURE__*/_react.default.createElement("div", {
39
+ className: _style.default.bulletPointMenu,
40
+ "data-name": "menu-wrapper",
41
+ "aria-label": menuAriaLabel
42
+ }, /*#__PURE__*/_react.default.createElement(_buttonMenu.default, menuProps));
43
+
44
+ const bulletPointButtonProps = {
45
+ size: 'default',
46
+ 'aria-label': buttonAriaLabel,
47
+ 'data-name': 'bullet-point-button',
48
+ icon: 'bullet-point',
49
+ onClick: handleOnClick,
50
+ disabled
51
+ };
52
+ return /*#__PURE__*/_react.default.createElement("div", {
53
+ className: _style.default.bulletPointWrapper,
54
+ "data-name": "bullet-point-wrapper"
55
+ }, /*#__PURE__*/_react.default.createElement(_buttonLinkIconOnly.default, _extends({}, bulletPointButtonProps, {
56
+ className: _style.default.bulletPointButton
57
+ })), menu);
58
+ };
59
+
60
+ BulletPointMenuButton.propTypes = process.env.NODE_ENV !== "production" ? {
61
+ disabled: _propTypes.default.bool,
62
+ buttonAriaLabel: _propTypes.default.string,
63
+ menuAriaLabel: _propTypes.default.string,
64
+ buttons: _buttonMenu.default.propTypes.buttons,
65
+ onClick: _propTypes.default.func
66
+ } : {};
67
+ var _default = BulletPointMenuButton;
68
+ exports.default = _default;
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/molecule/bullet-point-menu-button/index.js"],"names":["BulletPointMenuButton","props","disabled","buttonAriaLabel","menuAriaLabel","onClick","buttons","handleOnClick","menuProps","menu","style","bulletPointMenu","bulletPointButtonProps","size","icon","bulletPointWrapper","bulletPointButton","propTypes","PropTypes","bool","string","ButtonMenu","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,qBAAqB,GAAGC,KAAK,IAAI;AACrC,QAAM;AAACC,IAAAA,QAAQ,GAAG,KAAZ;AAAmBC,IAAAA,eAAnB;AAAoCC,IAAAA,aAApC;AAAmDC,IAAAA,OAAnD;AAA4DC,IAAAA;AAA5D,MAAuEL,KAA7E;AACA,QAAMM,aAAa,GAAG,wBAAY,MAAMF,OAAO,EAAzB,EAA6B,CAACA,OAAD,CAA7B,CAAtB;AAEA,QAAMG,SAAS,GAAG;AAChB,iBAAa,aADG;AAEhBF,IAAAA;AAFgB,GAAlB;;AAKA,QAAMG,IAAI,gBACR;AAAK,IAAA,SAAS,EAAEC,eAAMC,eAAtB;AAAuC,iBAAU,cAAjD;AAAgE,kBAAYP;AAA5E,kBACE,6BAAC,mBAAD,EAAgBI,SAAhB,CADF,CADF;;AAKA,QAAMI,sBAAsB,GAAG;AAC7BC,IAAAA,IAAI,EAAE,SADuB;AAE7B,kBAAcV,eAFe;AAG7B,iBAAa,qBAHgB;AAI7BW,IAAAA,IAAI,EAAE,cAJuB;AAK7BT,IAAAA,OAAO,EAAEE,aALoB;AAM7BL,IAAAA;AAN6B,GAA/B;AASA,sBACE;AAAK,IAAA,SAAS,EAAEQ,eAAMK,kBAAtB;AAA0C,iBAAU;AAApD,kBACE,6BAAC,2BAAD,eAAwBH,sBAAxB;AAAgD,IAAA,SAAS,EAAEF,eAAMM;AAAjE,KADF,EAEGP,IAFH,CADF;AAMD,CA7BD;;AA+BAT,qBAAqB,CAACiB,SAAtB,2CAAkC;AAChCf,EAAAA,QAAQ,EAAEgB,mBAAUC,IADY;AAEhChB,EAAAA,eAAe,EAAEe,mBAAUE,MAFK;AAGhChB,EAAAA,aAAa,EAAEc,mBAAUE,MAHO;AAIhCd,EAAAA,OAAO,EAAEe,oBAAWJ,SAAX,CAAqBX,OAJE;AAKhCD,EAAAA,OAAO,EAAEa,mBAAUI;AALa,CAAlC;eAQetB,qB","sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport ButtonMenu from '../../atom/button-menu';\nimport style from './style.css';\n\nconst BulletPointMenuButton = props => {\n const {disabled = false, buttonAriaLabel, menuAriaLabel, onClick, buttons} = props;\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const menuProps = {\n 'data-name': 'button-menu',\n buttons\n };\n\n const menu = (\n <div className={style.bulletPointMenu} data-name=\"menu-wrapper\" aria-label={menuAriaLabel}>\n <ButtonMenu {...menuProps} />\n </div>\n );\n const bulletPointButtonProps = {\n size: 'default',\n 'aria-label': buttonAriaLabel,\n 'data-name': 'bullet-point-button',\n icon: 'bullet-point',\n onClick: handleOnClick,\n disabled\n };\n\n return (\n <div className={style.bulletPointWrapper} data-name=\"bullet-point-wrapper\">\n <ButtonLinkIconOnly {...bulletPointButtonProps} className={style.bulletPointButton} />\n {menu}\n </div>\n );\n};\n\nBulletPointMenuButton.propTypes = {\n disabled: PropTypes.bool,\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: ButtonMenu.propTypes.buttons,\n onClick: PropTypes.func\n};\n\nexport default BulletPointMenuButton;\n"],"file":"index.js"}
@@ -0,0 +1,52 @@
1
+ @value colors: "../../variables/colors.css";
2
+ @value transparent from colors;
3
+ @value cm_grey_100 from colors;
4
+
5
+ .bulletPointWrapper {
6
+ display: flex;
7
+ flex-direction: column-reverse;
8
+ justify-content: flex-end;
9
+ width: 44px;
10
+ position: relative;
11
+ }
12
+
13
+ .bulletPointButton {
14
+ position: relative;
15
+ cursor: pointer;
16
+ }
17
+
18
+ .bulletPointMenu {
19
+ min-width: 80px;
20
+ /* positioning */
21
+ position: absolute;
22
+ align-self: flex-end;
23
+ bottom: 54px;
24
+ right: 0px;
25
+ /* elevation shadow */
26
+ box-shadow: rgba(0, 0, 0, 0.2) 0px 12px 28px 0px, rgba(0, 0, 0, 0.1) 0px 2px 4px 0px, rgba(255, 255, 255, 0.05) 0px 0px 0px 1px inset;
27
+ z-index: 1;
28
+ /* round corners */
29
+ border-radius: 7px;
30
+ overflow: hidden;
31
+ background-color: cm_grey_100;
32
+ }
33
+
34
+ /* Fade-in - Fade-out */
35
+ .bulletPointButton,button + .bulletPointMenu {
36
+ max-height: 0;
37
+ /* fade out combo */
38
+ visibility: hidden;
39
+ opacity:0;
40
+ transition:visibility 0.5s ease,opacity 0.5s ease;
41
+ }
42
+
43
+ .bulletPointButton,button:focus + .bulletPointMenu {
44
+ /* fade in combo */
45
+ max-height: max-content;
46
+ visibility:visible;
47
+ opacity:1;
48
+ }
49
+
50
+ /* Recover - unset pointer-events */
51
+ .bulletPointButton,button:focus { pointer-events: none; }
52
+ .bulletPointButton,button:not(:focus) { pointer-events: auto; }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ var _identity2 = _interopRequireDefault(require("lodash/fp/identity"));
4
+
5
+ var _browserEnv = _interopRequireDefault(require("browser-env"));
6
+
7
+ var _ava = _interopRequireDefault(require("ava"));
8
+
9
+ var _react = _interopRequireDefault(require("react"));
10
+
11
+ var _enzyme = require("enzyme");
12
+
13
+ var _enzymeAdapterReact = _interopRequireDefault(require("enzyme-adapter-react-16"));
14
+
15
+ var _ = _interopRequireDefault(require(".."));
16
+
17
+ var _default = _interopRequireDefault(require("./fixtures/default"));
18
+
19
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
+
21
+ (0, _browserEnv.default)();
22
+ (0, _enzyme.configure)({
23
+ adapter: new _enzymeAdapterReact.default()
24
+ });
25
+ const translate = _identity2.default;
26
+ (0, _ava.default)('should launch onClick, should find the button menu and have clickable buttons', t => {
27
+ const wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_.default, _default.default.props), {
28
+ context: {
29
+ translate
30
+ }
31
+ });
32
+ const button = wrapper.find('[data-name="bullet-point-button"]');
33
+ t.true(button.exists());
34
+ button.first().simulate('click', {});
35
+ const menu = wrapper.find('[data-name="button-menu"]').children().first();
36
+ t.true(menu.exists());
37
+ t.is(menu.children().length, 2);
38
+ const publishButton = menu.find('[data-name="menu-publish-button"]');
39
+ t.true(publishButton.exists());
40
+ publishButton.first().simulate('click', {});
41
+ const deleteButton = menu.find('[data-name="menu-delete-button"]');
42
+ t.true(deleteButton.exists());
43
+ deleteButton.first().simulate('click', {});
44
+ t.pass();
45
+ });
46
+ //# sourceMappingURL=bullet-point-menu-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js"],"names":["adapter","Adapter","translate","t","wrapper","defaultFixture","props","context","button","find","true","exists","first","simulate","menu","children","is","length","publishButton","deleteButton","pass"],"mappings":";;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;AAEA;AACA,uBAAU;AAACA,EAAAA,OAAO,EAAE,IAAIC,2BAAJ;AAAV,CAAV;AACA,MAAMC,SAAS,qBAAf;AAEA,kBAAK,+EAAL,EAAsFC,CAAC,IAAI;AACzF,QAAMC,OAAO,GAAG,iCAAM,6BAAC,SAAD,EAA2BC,iBAAeC,KAA1C,CAAN,EAA2D;AACzEC,IAAAA,OAAO,EAAE;AAACL,MAAAA;AAAD;AADgE,GAA3D,CAAhB;AAGA,QAAMM,MAAM,GAAGJ,OAAO,CAACK,IAAR,CAAa,mCAAb,CAAf;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOF,MAAM,CAACG,MAAP,EAAP;AACAH,EAAAA,MAAM,CAACI,KAAP,GAAeC,QAAf,CAAwB,OAAxB,EAAiC,EAAjC;AACA,QAAMC,IAAI,GAAGV,OAAO,CAACK,IAAR,CAAa,2BAAb,EAA0CM,QAA1C,GAAqDH,KAArD,EAAb;AACAT,EAAAA,CAAC,CAACO,IAAF,CAAOI,IAAI,CAACH,MAAL,EAAP;AACAR,EAAAA,CAAC,CAACa,EAAF,CAAKF,IAAI,CAACC,QAAL,GAAgBE,MAArB,EAA6B,CAA7B;AACA,QAAMC,aAAa,GAAGJ,IAAI,CAACL,IAAL,CAAU,mCAAV,CAAtB;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOQ,aAAa,CAACP,MAAd,EAAP;AACAO,EAAAA,aAAa,CAACN,KAAd,GAAsBC,QAAtB,CAA+B,OAA/B,EAAwC,EAAxC;AACA,QAAMM,YAAY,GAAGL,IAAI,CAACL,IAAL,CAAU,kCAAV,CAArB;AACAN,EAAAA,CAAC,CAACO,IAAF,CAAOS,YAAY,CAACR,MAAb,EAAP;AACAQ,EAAAA,YAAY,CAACP,KAAb,GAAqBC,QAArB,CAA8B,OAA9B,EAAuC,EAAvC;AACAV,EAAAA,CAAC,CAACiB,IAAF;AACD,CAjBD","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {mount, configure} from 'enzyme';\nimport {identity} from 'lodash/fp';\nimport Adapter from 'enzyme-adapter-react-16';\nimport BulletPointMenuButton from '..';\nimport defaultFixture from './fixtures/default';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\nconst translate = identity;\n\ntest('should launch onClick, should find the button menu and have clickable buttons', t => {\n const wrapper = mount(<BulletPointMenuButton {...defaultFixture.props} />, {\n context: {translate}\n });\n const button = wrapper.find('[data-name=\"bullet-point-button\"]');\n t.true(button.exists());\n button.first().simulate('click', {});\n const menu = wrapper.find('[data-name=\"button-menu\"]').children().first();\n t.true(menu.exists());\n t.is(menu.children().length, 2);\n const publishButton = menu.find('[data-name=\"menu-publish-button\"]');\n t.true(publishButton.exists());\n publishButton.first().simulate('click', {});\n const deleteButton = menu.find('[data-name=\"menu-delete-button\"]');\n t.true(deleteButton.exists());\n deleteButton.first().simulate('click', {});\n t.pass();\n});\n"],"file":"bullet-point-menu-button.js"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _default2 = require("../../../../atom/button-menu/test/fixtures/default");
7
+
8
+ var _default = {
9
+ props: {
10
+ buttonAriaLabel: 'aria button',
11
+ menuAriaLabel: 'aria menu',
12
+ buttons: [_default2.actionButtonProps, _default2.deleteButtonProps],
13
+ onClick: () => console.log('click on bullet point button - test in a bigger component to see the menu'),
14
+ componentKey: 'bullet-key'
15
+ }
16
+ };
17
+ exports.default = _default;
18
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/bullet-point-menu-button/test/fixtures/default.js"],"names":["props","buttonAriaLabel","menuAriaLabel","buttons","actionButtonProps","deleteButtonProps","onClick","console","log","componentKey"],"mappings":";;;;;AAAA;;eAKe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,eAAe,EAAE,aADZ;AAELC,IAAAA,aAAa,EAAE,WAFV;AAGLC,IAAAA,OAAO,EAAE,CAACC,2BAAD,EAAoBC,2BAApB,CAHJ;AAILC,IAAAA,OAAO,EAAE,MACPC,OAAO,CAACC,GAAR,CAAY,2EAAZ,CALG;AAMLC,IAAAA,YAAY,EAAE;AANT;AADM,C","sourcesContent":["import {\n actionButtonProps,\n deleteButtonProps\n} from '../../../../atom/button-menu/test/fixtures/default';\n\nexport default {\n props: {\n buttonAriaLabel: 'aria button',\n menuAriaLabel: 'aria menu',\n buttons: [actionButtonProps, deleteButtonProps],\n onClick: () =>\n console.log('click on bullet point button - test in a bigger component to see the menu'),\n componentKey: 'bullet-key'\n }\n};\n"],"file":"default.js"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _defaultsDeep = _interopRequireDefault(require("lodash/fp/defaultsDeep"));
7
+
8
+ var _default2 = require("../../../../atom/button-menu/test/fixtures/default");
9
+
10
+ var _multipleButtons = require("../../../../atom/button-menu/test/fixtures/multiple-buttons");
11
+
12
+ var _default3 = _interopRequireDefault(require("./default"));
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ const {
17
+ props
18
+ } = _default3.default;
19
+ var _default = {
20
+ props: (0, _defaultsDeep.default)(props, {
21
+ buttons: [_default2.actionButtonProps, _multipleButtons.disabledButtonProps, _default2.deleteButtonProps]
22
+ })
23
+ };
24
+ exports.default = _default;
25
+ //# sourceMappingURL=multiple-buttons.js.map