@coorpacademy/components 11.32.24-alpha.6 → 11.32.25

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 (241) hide show
  1. package/es/atom/button-link/index.d.ts +1 -0
  2. package/es/atom/button-link/index.d.ts.map +1 -1
  3. package/es/atom/button-link/index.js +4 -2
  4. package/es/atom/button-link/index.js.map +1 -1
  5. package/es/atom/button-link/types.d.ts +2 -0
  6. package/es/atom/button-link/types.d.ts.map +1 -1
  7. package/es/atom/button-link/types.js +1 -0
  8. package/es/atom/button-link/types.js.map +1 -1
  9. package/es/atom/circular-progress-bar/index.d.ts.map +1 -1
  10. package/es/atom/circular-progress-bar/index.js +1 -10
  11. package/es/atom/circular-progress-bar/index.js.map +1 -1
  12. package/es/atom/input-doublestep/index.d.ts +1 -0
  13. package/es/atom/input-doublestep/index.d.ts.map +1 -1
  14. package/es/atom/input-doublestep/index.js +38 -13
  15. package/es/atom/input-doublestep/index.js.map +1 -1
  16. package/es/atom/input-doublestep/style.css +7 -67
  17. package/es/atom/select/index.js +1 -1
  18. package/es/atom/select/index.js.map +1 -1
  19. package/es/molecule/base-modal/index.d.ts +1 -0
  20. package/es/molecule/base-modal/index.d.ts.map +1 -1
  21. package/es/molecule/base-modal/index.js +8 -6
  22. package/es/molecule/base-modal/index.js.map +1 -1
  23. package/es/molecule/brand-create-form/index.d.ts.map +1 -1
  24. package/es/molecule/brand-create-form/index.js +9 -4
  25. package/es/molecule/brand-create-form/index.js.map +1 -1
  26. package/es/molecule/brand-download-box/index.d.ts.map +1 -1
  27. package/es/molecule/brand-download-box/index.js +11 -6
  28. package/es/molecule/brand-download-box/index.js.map +1 -1
  29. package/es/molecule/brand-download-box/style.css +6 -5
  30. package/es/molecule/brand-form-group/index.d.ts.map +1 -1
  31. package/es/molecule/brand-form-group/index.js +12 -1
  32. package/es/molecule/brand-form-group/index.js.map +1 -1
  33. package/es/molecule/cm-popin/style.css +1 -1
  34. package/es/molecule/cm-popin/types.d.ts +3 -0
  35. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  36. package/es/molecule/discipline-associated-skills/index.js +1 -1
  37. package/es/molecule/discipline-associated-skills/index.js.map +1 -1
  38. package/es/molecule/draggable-list/index.d.ts +1 -0
  39. package/es/molecule/expandible-actionable-table/index.d.ts +1 -0
  40. package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
  41. package/es/molecule/expandible-actionable-table/types.d.ts +1 -0
  42. package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
  43. package/es/molecule/learning-priority-modal/index.d.ts.map +1 -1
  44. package/es/molecule/learning-priority-modal/index.js +8 -15
  45. package/es/molecule/learning-priority-modal/index.js.map +1 -1
  46. package/es/molecule/learning-priority-modal/style.css +0 -1
  47. package/es/molecule/learning-priority-setup-item/index.d.ts.map +1 -1
  48. package/es/molecule/learning-priority-setup-item/index.js +1 -1
  49. package/es/molecule/learning-priority-setup-item/index.js.map +1 -1
  50. package/es/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
  51. package/es/molecule/learning-profile-radar-chart/index.js +0 -2
  52. package/es/molecule/learning-profile-radar-chart/index.js.map +1 -1
  53. package/es/molecule/playlist-detail-cover/index.d.ts +14 -0
  54. package/es/molecule/playlist-detail-cover/index.d.ts.map +1 -0
  55. package/es/molecule/playlist-detail-cover/index.js +52 -0
  56. package/es/molecule/playlist-detail-cover/index.js.map +1 -0
  57. package/es/molecule/playlist-detail-cover/style.css +17 -0
  58. package/es/molecule/setup-section/index.d.ts.map +1 -1
  59. package/es/molecule/setup-section/index.js +3 -1
  60. package/es/molecule/setup-section/index.js.map +1 -1
  61. package/es/molecule/setup-section/style.css +2 -2
  62. package/es/molecule/skill-picker-modal/index.js +1 -1
  63. package/es/molecule/skill-picker-modal/index.js.map +1 -1
  64. package/es/organism/brand-form/index.d.ts.map +1 -1
  65. package/es/organism/brand-form/index.js +24 -15
  66. package/es/organism/brand-form/index.js.map +1 -1
  67. package/es/organism/brand-learning-priorities/index.d.ts +1 -21
  68. package/es/organism/brand-learning-priorities/index.d.ts.map +1 -1
  69. package/es/organism/brand-learning-priorities/index.js +1 -14
  70. package/es/organism/brand-learning-priorities/index.js.map +1 -1
  71. package/es/organism/brand-learning-priorities/style.css +2 -0
  72. package/es/organism/list-item/index.d.ts +3 -1
  73. package/es/organism/list-item/index.d.ts.map +1 -1
  74. package/es/organism/list-item/index.js +7 -5
  75. package/es/organism/list-item/index.js.map +1 -1
  76. package/es/organism/list-items/index.d.ts +3 -0
  77. package/es/organism/setup-header/index.d.ts +4 -0
  78. package/es/organism/wizard-contents/index.d.ts +3 -0
  79. package/es/template/app-player/loading/index.d.ts +3 -0
  80. package/es/template/app-player/player/index.d.ts +6 -0
  81. package/es/template/app-player/player/slides/index.d.ts +3 -0
  82. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  83. package/es/template/app-player/popin-correction/index.d.ts +3 -0
  84. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  85. package/es/template/app-player/popin-end/index.d.ts +3 -0
  86. package/es/template/app-review/index.d.ts +3 -0
  87. package/es/template/app-review/index.d.ts.map +1 -1
  88. package/es/template/app-review/player/prop-types.d.ts +3 -0
  89. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  90. package/es/template/app-review/prop-types.d.ts +3 -0
  91. package/es/template/app-review/prop-types.d.ts.map +1 -1
  92. package/es/template/back-office/brand-create/index.d.ts +4 -0
  93. package/es/template/back-office/brand-create/index.d.ts.map +1 -1
  94. package/es/template/back-office/brand-list/index.d.ts +4 -0
  95. package/es/template/back-office/brand-list/index.d.ts.map +1 -1
  96. package/es/template/back-office/brand-update/index.d.ts +14 -0
  97. package/es/template/back-office/dashboard-preview/index.d.ts +4 -0
  98. package/es/template/back-office/layout/index.d.ts +4 -0
  99. package/es/template/back-office/layout/index.d.ts.map +1 -1
  100. package/es/template/common/dashboard/index.d.ts +6 -0
  101. package/es/template/common/search-page/index.d.ts +3 -0
  102. package/es/template/external-course/index.d.ts +3 -0
  103. package/es/template/my-learning/index.js +1 -1
  104. package/es/template/my-learning/index.js.map +1 -1
  105. package/es/template/playlist-detail/index.d.ts +96 -0
  106. package/es/template/playlist-detail/index.d.ts.map +1 -0
  107. package/es/template/playlist-detail/index.js +109 -0
  108. package/es/template/playlist-detail/index.js.map +1 -0
  109. package/es/template/playlist-detail/style.css +108 -0
  110. package/es/template/skill-detail/all-courses.d.ts +1 -1
  111. package/es/template/skill-detail/all-courses.js +3 -3
  112. package/es/template/skill-detail/all-courses.js.map +1 -1
  113. package/es/template/skill-detail/index.d.ts +39 -4
  114. package/es/template/skill-detail/index.d.ts.map +1 -1
  115. package/es/template/skill-detail/index.js +2 -4
  116. package/es/template/skill-detail/index.js.map +1 -1
  117. package/es/util/external-content.d.ts +1 -0
  118. package/es/util/external-content.d.ts.map +1 -1
  119. package/es/util/external-content.js +1 -0
  120. package/es/util/external-content.js.map +1 -1
  121. package/lib/atom/button-link/index.d.ts +1 -0
  122. package/lib/atom/button-link/index.d.ts.map +1 -1
  123. package/lib/atom/button-link/index.js +4 -2
  124. package/lib/atom/button-link/index.js.map +1 -1
  125. package/lib/atom/button-link/types.d.ts +2 -0
  126. package/lib/atom/button-link/types.d.ts.map +1 -1
  127. package/lib/atom/button-link/types.js +1 -0
  128. package/lib/atom/button-link/types.js.map +1 -1
  129. package/lib/atom/circular-progress-bar/index.d.ts.map +1 -1
  130. package/lib/atom/circular-progress-bar/index.js +1 -10
  131. package/lib/atom/circular-progress-bar/index.js.map +1 -1
  132. package/lib/atom/input-doublestep/index.d.ts +1 -0
  133. package/lib/atom/input-doublestep/index.d.ts.map +1 -1
  134. package/lib/atom/input-doublestep/index.js +39 -13
  135. package/lib/atom/input-doublestep/index.js.map +1 -1
  136. package/lib/atom/input-doublestep/style.css +7 -67
  137. package/lib/atom/select/index.js +1 -1
  138. package/lib/atom/select/index.js.map +1 -1
  139. package/lib/molecule/base-modal/index.d.ts +1 -0
  140. package/lib/molecule/base-modal/index.d.ts.map +1 -1
  141. package/lib/molecule/base-modal/index.js +8 -6
  142. package/lib/molecule/base-modal/index.js.map +1 -1
  143. package/lib/molecule/brand-create-form/index.d.ts.map +1 -1
  144. package/lib/molecule/brand-create-form/index.js +9 -4
  145. package/lib/molecule/brand-create-form/index.js.map +1 -1
  146. package/lib/molecule/brand-download-box/index.d.ts.map +1 -1
  147. package/lib/molecule/brand-download-box/index.js +11 -6
  148. package/lib/molecule/brand-download-box/index.js.map +1 -1
  149. package/lib/molecule/brand-download-box/style.css +6 -5
  150. package/lib/molecule/brand-form-group/index.d.ts.map +1 -1
  151. package/lib/molecule/brand-form-group/index.js +12 -1
  152. package/lib/molecule/brand-form-group/index.js.map +1 -1
  153. package/lib/molecule/cm-popin/style.css +1 -1
  154. package/lib/molecule/cm-popin/types.d.ts +3 -0
  155. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  156. package/lib/molecule/discipline-associated-skills/index.js +1 -1
  157. package/lib/molecule/discipline-associated-skills/index.js.map +1 -1
  158. package/lib/molecule/draggable-list/index.d.ts +1 -0
  159. package/lib/molecule/expandible-actionable-table/index.d.ts +1 -0
  160. package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
  161. package/lib/molecule/expandible-actionable-table/types.d.ts +1 -0
  162. package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
  163. package/lib/molecule/learning-priority-modal/index.d.ts.map +1 -1
  164. package/lib/molecule/learning-priority-modal/index.js +9 -14
  165. package/lib/molecule/learning-priority-modal/index.js.map +1 -1
  166. package/lib/molecule/learning-priority-modal/style.css +0 -1
  167. package/lib/molecule/learning-priority-setup-item/index.d.ts.map +1 -1
  168. package/lib/molecule/learning-priority-setup-item/index.js +1 -1
  169. package/lib/molecule/learning-priority-setup-item/index.js.map +1 -1
  170. package/lib/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
  171. package/lib/molecule/learning-profile-radar-chart/index.js +0 -2
  172. package/lib/molecule/learning-profile-radar-chart/index.js.map +1 -1
  173. package/lib/molecule/playlist-detail-cover/index.d.ts +14 -0
  174. package/lib/molecule/playlist-detail-cover/index.d.ts.map +1 -0
  175. package/lib/molecule/playlist-detail-cover/index.js +68 -0
  176. package/lib/molecule/playlist-detail-cover/index.js.map +1 -0
  177. package/lib/molecule/playlist-detail-cover/style.css +17 -0
  178. package/lib/molecule/setup-section/index.d.ts.map +1 -1
  179. package/lib/molecule/setup-section/index.js +4 -1
  180. package/lib/molecule/setup-section/index.js.map +1 -1
  181. package/lib/molecule/setup-section/style.css +2 -2
  182. package/lib/molecule/skill-picker-modal/index.js +1 -1
  183. package/lib/molecule/skill-picker-modal/index.js.map +1 -1
  184. package/lib/organism/brand-form/index.d.ts.map +1 -1
  185. package/lib/organism/brand-form/index.js +24 -15
  186. package/lib/organism/brand-form/index.js.map +1 -1
  187. package/lib/organism/brand-learning-priorities/index.d.ts +1 -21
  188. package/lib/organism/brand-learning-priorities/index.d.ts.map +1 -1
  189. package/lib/organism/brand-learning-priorities/index.js +3 -15
  190. package/lib/organism/brand-learning-priorities/index.js.map +1 -1
  191. package/lib/organism/brand-learning-priorities/style.css +2 -0
  192. package/lib/organism/list-item/index.d.ts +3 -1
  193. package/lib/organism/list-item/index.d.ts.map +1 -1
  194. package/lib/organism/list-item/index.js +7 -5
  195. package/lib/organism/list-item/index.js.map +1 -1
  196. package/lib/organism/list-items/index.d.ts +3 -0
  197. package/lib/organism/setup-header/index.d.ts +4 -0
  198. package/lib/organism/wizard-contents/index.d.ts +3 -0
  199. package/lib/template/app-player/loading/index.d.ts +3 -0
  200. package/lib/template/app-player/player/index.d.ts +6 -0
  201. package/lib/template/app-player/player/slides/index.d.ts +3 -0
  202. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  203. package/lib/template/app-player/popin-correction/index.d.ts +3 -0
  204. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  205. package/lib/template/app-player/popin-end/index.d.ts +3 -0
  206. package/lib/template/app-review/index.d.ts +3 -0
  207. package/lib/template/app-review/index.d.ts.map +1 -1
  208. package/lib/template/app-review/player/prop-types.d.ts +3 -0
  209. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  210. package/lib/template/app-review/prop-types.d.ts +3 -0
  211. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  212. package/lib/template/back-office/brand-create/index.d.ts +4 -0
  213. package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
  214. package/lib/template/back-office/brand-list/index.d.ts +4 -0
  215. package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
  216. package/lib/template/back-office/brand-update/index.d.ts +14 -0
  217. package/lib/template/back-office/dashboard-preview/index.d.ts +4 -0
  218. package/lib/template/back-office/layout/index.d.ts +4 -0
  219. package/lib/template/back-office/layout/index.d.ts.map +1 -1
  220. package/lib/template/common/dashboard/index.d.ts +6 -0
  221. package/lib/template/common/search-page/index.d.ts +3 -0
  222. package/lib/template/external-course/index.d.ts +3 -0
  223. package/lib/template/my-learning/index.js +1 -1
  224. package/lib/template/my-learning/index.js.map +1 -1
  225. package/lib/template/playlist-detail/index.d.ts +96 -0
  226. package/lib/template/playlist-detail/index.d.ts.map +1 -0
  227. package/lib/template/playlist-detail/index.js +134 -0
  228. package/lib/template/playlist-detail/index.js.map +1 -0
  229. package/lib/template/playlist-detail/style.css +108 -0
  230. package/lib/template/skill-detail/all-courses.d.ts +1 -1
  231. package/lib/template/skill-detail/all-courses.js +3 -3
  232. package/lib/template/skill-detail/all-courses.js.map +1 -1
  233. package/lib/template/skill-detail/index.d.ts +39 -4
  234. package/lib/template/skill-detail/index.d.ts.map +1 -1
  235. package/lib/template/skill-detail/index.js +3 -2
  236. package/lib/template/skill-detail/index.js.map +1 -1
  237. package/lib/util/external-content.d.ts +1 -0
  238. package/lib/util/external-content.d.ts.map +1 -1
  239. package/lib/util/external-content.js +3 -1
  240. package/lib/util/external-content.js.map +1 -1
  241. package/package.json +2 -2
@@ -0,0 +1,17 @@
1
+ .container {
2
+ width: 100%;
3
+ height: 100%;
4
+ display: flex;
5
+ border-radius: 12px;
6
+ overflow: hidden;
7
+ }
8
+
9
+ .imagesWrapper {
10
+ width: 100%;
11
+ display: flex;
12
+ flex-direction: column;
13
+ }
14
+
15
+ .image {
16
+ flex: 1;
17
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/setup-section/index.js"],"names":[],"mappings":";AAsCA,qEAeC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA7CD,mFAiBC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/setup-section/index.js"],"names":[],"mappings":";AA0CA,qEAeC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAhDD,mFAqBC"}
@@ -15,6 +15,8 @@ var _inputSwitch = _interopRequireDefault(require("../../atom/input-switch"));
15
15
 
16
16
  var _radioGroup = _interopRequireDefault(require("../../atom/radio-group"));
17
17
 
18
+ var _colors = require("../../variables/colors");
19
+
18
20
  var _style = _interopRequireDefault(require("./style.css"));
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -41,7 +43,8 @@ const ContentTypesToggler = (props, context) => {
41
43
  }, /*#__PURE__*/_react.default.createElement(_radioGroup.default, _extends({}, contentTypes, {
42
44
  style: {
43
45
  color: contentTypesColor
44
- }
46
+ },
47
+ color: _colors.COLORS.cm_primary_blue
45
48
  })));
46
49
  };
47
50
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ContentTypesToggler","props","context","skin","contentTypes","brand","orange","contentTypesColor","style","contentTypeWrapper","color","contextTypes","Provider","childContextTypes","propTypes","PropTypes","shape","RadioGroup","modified","bool","SetupSection","translate","title","display","wrapper","settings","label","string","isRequired","onUp","func","onDown","InputSwitch"],"sources":["../../../src/molecule/setup-section/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport InputSwitch from '../../atom/input-switch';\nimport RadioGroup from '../../atom/radio-group';\nimport style from './style.css';\n\nconst ContentTypesToggler = (props, context) => {\n const {skin} = context;\n const {contentTypes} = props;\n\n if (!contentTypes) {\n return null;\n }\n\n const brand = get('common.brand', skin);\n const orange = get('common.orange', skin);\n const contentTypesColor = get('modified', contentTypes) ? orange : brand;\n\n return (\n <div className={style.contentTypeWrapper}>\n <RadioGroup {...contentTypes} style={{color: contentTypesColor}} />\n </div>\n );\n};\n\nContentTypesToggler.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nContentTypesToggler.propTypes = {\n contentTypes: PropTypes.shape({\n ...RadioGroup.propTypes,\n modified: PropTypes.bool\n })\n};\n\nconst SetupSection = (props, context) => {\n const {translate} = context;\n\n const {title, display, contentTypes} = props;\n\n return (\n <div className={style.wrapper}>\n <div className={style.title}>{title}</div>\n <div className={style.settings}>\n <ContentTypesToggler contentTypes={contentTypes} />\n <div className={style.label}>{translate('Show')}</div>\n <InputSwitch {...display} />\n </div>\n </div>\n );\n};\n\nSetupSection.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nSetupSection.propTypes = {\n title: PropTypes.string.isRequired,\n onUp: PropTypes.func,\n onDown: PropTypes.func,\n display: PropTypes.shape(InputSwitch.propTypes),\n contentTypes: ContentTypesToggler.propTypes.contentTypes\n};\n\nexport default SetupSection;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,mBAAmB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC9C,MAAM;IAACC;EAAD,IAASD,OAAf;EACA,MAAM;IAACE;EAAD,IAAiBH,KAAvB;;EAEA,IAAI,CAACG,YAAL,EAAmB;IACjB,OAAO,IAAP;EACD;;EAED,MAAMC,KAAK,GAAG,mBAAI,cAAJ,EAAoBF,IAApB,CAAd;EACA,MAA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CAA2BV;AAFP,CAA5B;AAKAiB,YAAY,CAACN,SAAb,2CAAyB;EACvBQ,KAAK,EAAEP,kBAAA,CAAUY,MAAV,CAAiBC,UADD;EAEvBC,IAAI,EAAEd,kBAAA,CAAUe,IAFO;EAGvBC,MAAM,EAAEhB,kBAAA,CAAUe,IAHK;EAIvBP,OAAO,EAAER,kBAAA,CAAUC,KAAV,CAAgBgB,oBAAA,CAAYlB,SAA5B,CAJc;EAKvBV,YAAY,EAAEJ,mBAAmB,CAACc,SAApB,CAA8BV;AALrB,CAAzB;eAQegB,Y"}
1
+ {"version":3,"file":"index.js","names":["ContentTypesToggler","props","context","skin","contentTypes","brand","orange","contentTypesColor","style","contentTypeWrapper","color","COLORS","cm_primary_blue","contextTypes","Provider","childContextTypes","propTypes","PropTypes","shape","RadioGroup","modified","bool","SetupSection","translate","title","display","wrapper","settings","label","string","isRequired","onUp","func","onDown","InputSwitch"],"sources":["../../../src/molecule/setup-section/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport InputSwitch from '../../atom/input-switch';\nimport RadioGroup from '../../atom/radio-group';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst ContentTypesToggler = (props, context) => {\n const {skin} = context;\n const {contentTypes} = props;\n\n if (!contentTypes) {\n return null;\n }\n\n const brand = get('common.brand', skin);\n const orange = get('common.orange', skin);\n const contentTypesColor = get('modified', contentTypes) ? orange : brand;\n\n return (\n <div className={style.contentTypeWrapper}>\n <RadioGroup\n {...contentTypes}\n style={{color: contentTypesColor}}\n color={COLORS.cm_primary_blue}\n />\n </div>\n );\n};\nContentTypesToggler.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nContentTypesToggler.propTypes = {\n contentTypes: PropTypes.shape({\n ...RadioGroup.propTypes,\n modified: PropTypes.bool\n })\n};\n\nconst SetupSection = (props, context) => {\n const {translate} = context;\n\n const {title, display, contentTypes} = props;\n\n return (\n <div className={style.wrapper}>\n <div className={style.title}>{title}</div>\n <div className={style.settings}>\n <ContentTypesToggler contentTypes={contentTypes} />\n <div className={style.label}>{translate('Show')}</div>\n <InputSwitch {...display} />\n </div>\n </div>\n );\n};\n\nSetupSection.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nSetupSection.propTypes = {\n title: PropTypes.string.isRequired,\n onUp: PropTypes.func,\n onDown: PropTypes.func,\n display: PropTypes.shape(InputSwitch.propTypes),\n contentTypes: ContentTypesToggler.propTypes.contentTypes\n};\n\nexport default SetupSection;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,mBAAmB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC9C,MAAM;IAACC;EAAD,IAASD,OAAf;EACA,MAAM;IAACE;EAAD,IAAiBH,KAAvB;;EAEA,IAAI,CAACG,YAAL,EAAmB;IACjB,OAAO,IAAP;EACD;;EAED,MAAMC,KAAK,GAAG,mBAAI,cAAJ,EAAoBF,IAApB,CAAd;EACA,MAAMG,MAAM,GAAG,mBAAI,eAAJ,EAAqBH,IAArB,CAAf;EACA,MAAMI,iBAAiB,GAAG,mBAAI,UAAJ,EAAgBH,YAAhB,IAAgCE,MAAhC,GAAyCD,KAAnE;EAEA,oBACE;IAAK,SAAS,EAAEG,cAAA,CAAMC;EAAtB,gBACE,6BAAC,mBAAD,eACML,YADN;IAEE,KAAK,EAAE;MAACM,KAAK,EAAEH;IAAR,CAFT;IAGE,KAAK,EAAEI,cAAA,CAAOC;EAHhB,GADF,CADF;AASD,CArBD;;AAsBAZ,mBAAmB,CAACa,YAApB,GAAmC;EACjCV,IAAI,EAAEW,iBAAA,CAASC,iBAAT,CAA2BZ;AADA,CAAnC;AAIAH,mBAAmB,CAACgB,SAApB,2CAAgC;EAC9BZ,YAAY,EAAEa,kBAAA,CAAUC,KAAV,cACTC,mBAAA,CAAWH,SADF;IAEZI,QAAQ,EAAEH,kBAAA,CAAUI;EAFR;AADgB,CAAhC;;AAOA,MAAMC,YAAY,GAAG,CAACrB,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IAACqB;EAAD,IAAcrB,OAApB;EAEA,MAAM;IAACsB,KAAD;IAAQC,OAAR;IAAiBrB;EAAjB,IAAiCH,KAAvC;EAEA,oBACE;IAAK,SAAS,EAAEO,cAAA,CAAMkB;EAAtB,gBACE;IAAK,SAAS,EAAElB,cAAA,CAAMgB;EAAtB,GAA8BA,KAA9B,CADF,eAEE;IAAK,SAAS,EAAEhB,cAAA,CAAMmB;EAAtB,gBACE,6BAAC,mBAAD;IAAqB,YAAY,EAAEvB;EAAnC,EADF,eAEE;IAAK,SAAS,EAAEI,cAAA,CAAMoB;EAAtB,GAA8BL,SAAS,CAAC,MAAD,CAAvC,CAFF,eAGE,6BAAC,oBAAD,EAAiBE,OAAjB,CAHF,CAFF,CADF;AAUD,CAfD;;AAiBAH,YAAY,CAACT,YAAb,GAA4B;EAC1BU,SAAS,EAAET,iBAAA,CAASC,iBAAT,CAA2BQ,SADZ;EAE1BpB,IAAI,EAAEW,iBAAA,CAASC,iBAAT,CAA2BZ;AAFP,CAA5B;AAKAmB,YAAY,CAACN,SAAb,2CAAyB;EACvBQ,KAAK,EAAEP,kBAAA,CAAUY,MAAV,CAAiBC,UADD;EAEvBC,IAAI,EAAEd,kBAAA,CAAUe,IAFO;EAGvBC,MAAM,EAAEhB,kBAAA,CAAUe,IAHK;EAIvBP,OAAO,EAAER,kBAAA,CAAUC,KAAV,CAAgBgB,oBAAA,CAAYlB,SAA5B,CAJc;EAKvBZ,YAAY,EAAEJ,mBAAmB,CAACgB,SAApB,CAA8BZ;AALrB,CAAzB;eAQekB,Y"}
@@ -2,7 +2,7 @@
2
2
  @value mobile from breakpoints;
3
3
  @value colors: "../../variables/colors.css";
4
4
  @value xtraLightGrey from colors;
5
- @value brand from colors;
5
+ @value cm_primary_blue from colors;
6
6
  @value primaryAdd1 from colors;
7
7
 
8
8
  .wrapper {
@@ -20,7 +20,7 @@
20
20
  .title {
21
21
  font-family: 'Gilroy';
22
22
  font-size: 14px;
23
- color: brand;
23
+ color: cm_primary_blue;
24
24
  font-weight: 700;
25
25
  }
26
26
 
@@ -59,7 +59,7 @@ const SkillPickerModal = (props, context) => {
59
59
  };
60
60
  });
61
61
  }, [skills, selectedSkillList, skillsLocales]);
62
- const isError = (0, _react.useMemo)(() => selectedSkillList.length > maxSelectedSkills || selectedSkillList.length < minSelectedSkills, [selectedSkillList, maxSelectedSkills]);
62
+ const isError = (0, _react.useMemo)(() => selectedSkillList.length > maxSelectedSkills || selectedSkillList.length < minSelectedSkills, [selectedSkillList, maxSelectedSkills, minSelectedSkills]);
63
63
  const footer = (0, _react.useMemo)(() => {
64
64
  const footerDescription = selectedSkillList.length > maxSelectedSkills ? translate('skill_focus_footer_error_description', {
65
65
  skillNumber: selectedSkillList.length - maxSelectedSkills
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["SkillPickerModal","props","context","skills","selectedSkills","skillsLocales","isOpen","isLoading","maxSelectedSkills","minSelectedSkills","onCancel","onConfirm","onClose","translate","selectedSkillList","setSelectedSkillList","useState","handleCancel","useCallback","handleClose","skillList","useMemo","map","skill","skillTitle","skillRef","focus","includes","isError","length","footer","footerDescription","skillNumber","text","cancelButton","label","disabled","confirmButton","iconName","name","backgroundColor","style","skillPickerContainer","loaderContainer","loader","marginBottom","display","gap","flexWrap","index","handleChipClick","newSelectedSkillList","filter","selectedSkill","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","string","objectOf","bool","number","func"],"sources":["../../../src/molecule/skill-picker-modal/index.js"],"sourcesContent":["import React, {useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport filter from 'lodash/fp/filter';\nimport BaseModal from '../base-modal';\nimport Chip from '../../atom/chip';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst SkillPickerModal = (props, context) => {\n const {\n skills,\n selectedSkills,\n skillsLocales,\n isOpen,\n isLoading,\n maxSelectedSkills = 6,\n minSelectedSkills = 3,\n onCancel,\n onConfirm,\n onClose\n } = props;\n const {translate} = context;\n\n const [selectedSkillList, setSelectedSkillList] = useState(selectedSkills);\n\n const handleCancel = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onCancel();\n }, [setSelectedSkillList, selectedSkills, onCancel]);\n\n const handleClose = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onClose();\n }, [setSelectedSkillList, selectedSkills, onClose]);\n\n const skillList = useMemo(() => {\n return skills.map(skill => {\n return {\n skillTitle: skillsLocales[skill],\n skillRef: skill,\n focus: selectedSkillList.includes(skill)\n };\n });\n }, [skills, selectedSkillList, skillsLocales]);\n\n const isError = useMemo(\n () =>\n selectedSkillList.length > maxSelectedSkills || selectedSkillList.length < minSelectedSkills,\n [selectedSkillList, maxSelectedSkills]\n );\n\n const footer = useMemo(() => {\n const footerDescription =\n selectedSkillList.length > maxSelectedSkills\n ? translate('skill_focus_footer_error_description', {\n skillNumber: selectedSkillList.length - maxSelectedSkills\n })\n : translate('skill_focus_footer_description', {\n skillNumber: minSelectedSkills - selectedSkillList.length\n });\n return {\n text: isLoading || !isError ? '' : footerDescription,\n isError,\n cancelButton: {\n onCancel: handleCancel,\n label: translate('cancel'),\n disabled: isLoading || isError\n },\n confirmButton: {\n onConfirm: () => onConfirm(selectedSkillList),\n label: translate('confirm'),\n iconName: 'circle-check',\n disabled: isLoading || isError\n }\n };\n }, [\n isError,\n handleCancel,\n onConfirm,\n translate,\n selectedSkillList,\n isLoading,\n maxSelectedSkills,\n minSelectedSkills\n ]);\n\n if ((!isLoading && !skills) || !isOpen) return null;\n\n return (\n <BaseModal\n title={translate('skill_focus')}\n description={translate('skill_focus_description')}\n isOpen={isOpen}\n onClose={handleClose}\n footer={footer}\n headerIcon={{\n name: 'bullseye-arrow',\n backgroundColor: '#DDD1FF'\n }}\n >\n <div className={style.skillPickerContainer}>\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <>\n <div style={{marginBottom: '16px'}}>\n {`${selectedSkillList.length} ${translate('selected')}`}\n </div>\n <div style={{display: 'flex', gap: '16px', flexWrap: 'wrap'}}>\n {skillList.map((skill, index) => {\n const {skillTitle, skillRef, focus} = skill;\n function handleChipClick() {\n const newSelectedSkillList = focus\n ? filter(selectedSkill => selectedSkill !== skillRef, selectedSkillList)\n : [...selectedSkillList, skill.skillRef];\n setSelectedSkillList(newSelectedSkillList);\n }\n\n return (\n <Chip\n text={skillTitle}\n selected={focus}\n onClick={handleChipClick}\n key={index}\n backgroundColor=\"skin\"\n />\n );\n })}\n </div>\n </>\n )}\n </div>\n </BaseModal>\n );\n};\n\nSkillPickerModal.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nSkillPickerModal.propTypes = {\n skills: PropTypes.arrayOf(PropTypes.string),\n selectedSkills: PropTypes.arrayOf(PropTypes.string),\n skillsLocales: PropTypes.objectOf(PropTypes.string),\n isOpen: PropTypes.bool,\n isLoading: PropTypes.bool,\n minSelectedSkills: PropTypes.number,\n maxSelectedSkills: PropTypes.number,\n onCancel: PropTypes.func,\n onConfirm: PropTypes.func,\n onClose: PropTypes.func\n};\n\nexport default SkillPickerModal;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IACJC,MADI;IAEJC,cAFI;IAGJC,aAHI;IAIJC,MAJI;IAKJC,SALI;IAMJC,iBAAiB,GAAG,CANhB;IAOJC,iBAAiB,GAAG,CAPhB;IAQJC,QARI;IASJC,SATI;IAUJC;EAVI,IAWFX,KAXJ;EAYA,MAAM;IAACY;EAAD,IAAcX,OAApB;EAEA,MAAM,CAACY,iBAAD,EAAoBC,o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SAAS,EAAEmD,kBAAA,CAAUI,IALM;EAM3BrD,iBAAiB,EAAEiD,kBAAA,CAAUK,MANF;EAO3BvD,iBAAiB,EAAEkD,kBAAA,CAAUK,MAPF;EAQ3BrD,QAAQ,EAAEgD,kBAAA,CAAUM,IARO;EAS3BrD,SAAS,EAAE+C,kBAAA,CAAUM,IATM;EAU3BpD,OAAO,EAAE8C,kBAAA,CAAUM;AAVQ,CAA7B;eAaehE,gB"}
1
+ {"version":3,"file":"index.js","names":["SkillPickerModal","props","context","skills","selectedSkills","skillsLocales","isOpen","isLoading","maxSelectedSkills","minSelectedSkills","onCancel","onConfirm","onClose","translate","selectedSkillList","setSelectedSkillList","useState","handleCancel","useCallback","handleClose","skillList","useMemo","map","skill","skillTitle","skillRef","focus","includes","isError","length","footer","footerDescription","skillNumber","text","cancelButton","label","disabled","confirmButton","iconName","name","backgroundColor","style","skillPickerContainer","loaderContainer","loader","marginBottom","display","gap","flexWrap","index","handleChipClick","newSelectedSkillList","filter","selectedSkill","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","string","objectOf","bool","number","func"],"sources":["../../../src/molecule/skill-picker-modal/index.js"],"sourcesContent":["import React, {useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport filter from 'lodash/fp/filter';\nimport BaseModal from '../base-modal';\nimport Chip from '../../atom/chip';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst SkillPickerModal = (props, context) => {\n const {\n skills,\n selectedSkills,\n skillsLocales,\n isOpen,\n isLoading,\n maxSelectedSkills = 6,\n minSelectedSkills = 3,\n onCancel,\n onConfirm,\n onClose\n } = props;\n const {translate} = context;\n\n const [selectedSkillList, setSelectedSkillList] = useState(selectedSkills);\n\n const handleCancel = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onCancel();\n }, [setSelectedSkillList, selectedSkills, onCancel]);\n\n const handleClose = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onClose();\n }, [setSelectedSkillList, selectedSkills, onClose]);\n\n const skillList = useMemo(() => {\n return skills.map(skill => {\n return {\n skillTitle: skillsLocales[skill],\n skillRef: skill,\n focus: selectedSkillList.includes(skill)\n };\n });\n }, [skills, selectedSkillList, skillsLocales]);\n\n const isError = useMemo(\n () =>\n selectedSkillList.length > maxSelectedSkills || selectedSkillList.length < minSelectedSkills,\n [selectedSkillList, maxSelectedSkills, minSelectedSkills]\n );\n\n const footer = useMemo(() => {\n const footerDescription =\n selectedSkillList.length > maxSelectedSkills\n ? translate('skill_focus_footer_error_description', {\n skillNumber: selectedSkillList.length - maxSelectedSkills\n })\n : translate('skill_focus_footer_description', {\n skillNumber: minSelectedSkills - selectedSkillList.length\n });\n return {\n text: isLoading || !isError ? '' : footerDescription,\n isError,\n cancelButton: {\n onCancel: handleCancel,\n label: translate('cancel'),\n disabled: isLoading || isError\n },\n confirmButton: {\n onConfirm: () => onConfirm(selectedSkillList),\n label: translate('confirm'),\n iconName: 'circle-check',\n disabled: isLoading || isError\n }\n };\n }, [\n isError,\n handleCancel,\n onConfirm,\n translate,\n selectedSkillList,\n isLoading,\n maxSelectedSkills,\n minSelectedSkills\n ]);\n\n if ((!isLoading && !skills) || !isOpen) return null;\n\n return (\n <BaseModal\n title={translate('skill_focus')}\n description={translate('skill_focus_description')}\n isOpen={isOpen}\n onClose={handleClose}\n footer={footer}\n headerIcon={{\n name: 'bullseye-arrow',\n backgroundColor: '#DDD1FF'\n }}\n >\n <div className={style.skillPickerContainer}>\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <>\n <div style={{marginBottom: '16px'}}>\n {`${selectedSkillList.length} ${translate('selected')}`}\n </div>\n <div style={{display: 'flex', gap: '16px', flexWrap: 'wrap'}}>\n {skillList.map((skill, index) => {\n const {skillTitle, skillRef, focus} = skill;\n function handleChipClick() {\n const newSelectedSkillList = focus\n ? filter(selectedSkill => selectedSkill !== skillRef, selectedSkillList)\n : [...selectedSkillList, skill.skillRef];\n setSelectedSkillList(newSelectedSkillList);\n }\n\n return (\n <Chip\n text={skillTitle}\n selected={focus}\n onClick={handleChipClick}\n key={index}\n backgroundColor=\"skin\"\n />\n );\n })}\n </div>\n </>\n )}\n </div>\n </BaseModal>\n );\n};\n\nSkillPickerModal.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nSkillPickerModal.propTypes = {\n skills: PropTypes.arrayOf(PropTypes.string),\n selectedSkills: PropTypes.arrayOf(PropTypes.string),\n skillsLocales: PropTypes.objectOf(PropTypes.string),\n isOpen: PropTypes.bool,\n isLoading: PropTypes.bool,\n minSelectedSkills: PropTypes.number,\n maxSelectedSkills: PropTypes.number,\n onCancel: PropTypes.func,\n onConfirm: PropTypes.func,\n onClose: PropTypes.func\n};\n\nexport default SkillPickerModal;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IACJC,MADI;IAEJC,cAFI;IAGJC,aAHI;IAIJC,MAJI;IAKJC,SALI;IAMJC,iBAAiB,GAAG,CANhB;IAOJC,iBAAiB,GAAG,CAPhB;IAQJC,QARI;IASJC,SATI;IAUJC;EAVI,IAWFX,KAXJ;EAYA,MAAM;IAACY;EAAD,IAAcX,OAApB;EAEA,MAAM,CAACY,iBAAD,EAAoBC,oBAApB,IAA4C,IAAAC,eAAA,EAASZ,cAAT,CAAlD;EAEA,MAAMa,YAAY,GAAG,IAAAC,kBAAA,EAAY,MAAM;IACrCH,oBAAoB,CAACX,cAAD,CAApB;IACAM,QAAQ;EACT,CAHoB,EAGlB,CAACK,oBAAD,EAAuBX,cAAvB,EAAuCM,QAAvC,CAHkB,CAArB;EAKA,MAAMS,WAAW,GAAG,IAAAD,kBAAA,EAAY,MAAM;IACpCH,oBAAoB,CAACX,cAAD,CAApB;IACAQ,OAAO;E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,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/brand-form/index.js"],"names":[],"mappings":";AAkEA,kEAgFC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/brand-form/index.js"],"names":[],"mappings":";AA8EA,kEAgFC"}
@@ -31,7 +31,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
31
31
 
32
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
33
 
34
- const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, darkColor, theme, massiveBattleForm) => {
34
+ const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip, disabled, isModified, isPending, massiveBattleForm) => {
35
35
  if (!onSubmit && !onReset) {
36
36
  return null;
37
37
  }
@@ -41,27 +41,36 @@ const buildButtonSection = (onSubmit, submitValue, onReset, resetValue, tooltip,
41
41
  "data-tip": tooltip.title,
42
42
  "data-for": "submitButton",
43
43
  className: massiveBattleForm ? _style.default.massiveBattleButton : _style.default.saveButton
44
- }, theme === 'coorpmanager' ? /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
44
+ }, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
45
45
  type: "primary",
46
46
  label: submitValue,
47
47
  disabled: disabledSubmit,
48
48
  "data-testid": "submit-button",
49
- buttonType: "submit",
50
- onClick: onSubmit
51
- }) : /*#__PURE__*/_react.default.createElement(_button.default, {
52
- type: "submit",
53
- disabled: disabledSubmit,
54
- submitValue: submitValue
49
+ usage: "submit",
50
+ onClick: onSubmit,
51
+ icon: {
52
+ position: 'left',
53
+ faIcon: {
54
+ name: 'circle-check',
55
+ color: '#FFFFFF',
56
+ size: 16
57
+ }
58
+ }
55
59
  })) : null;
56
- const cancelBackground = {
57
- backgroundColor: darkColor
58
- };
59
60
  const resetButton = onReset ? /*#__PURE__*/_react.default.createElement("div", {
60
61
  className: _style.default.resetButton
61
- }, /*#__PURE__*/_react.default.createElement(_button.default, {
62
- type: "reset",
63
- submitValue: resetValue,
64
- style: cancelBackground
62
+ }, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
63
+ usage: "reset",
64
+ label: resetValue,
65
+ "data-testid": "reset-button",
66
+ onClick: onReset,
67
+ icon: {
68
+ position: 'left',
69
+ faIcon: {
70
+ name: 'trash',
71
+ size: 16
72
+ }
73
+ }
65
74
  })) : null;
66
75
  return /*#__PURE__*/_react.default.createElement("div", {
67
76
  className: _style.default.buttons
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["buildButtonSection","onSubmit","submitValue","onReset","resetValue","tooltip","disabled","isModified","isPending","darkColor","theme","massiveBattleForm","disabledSubmit","submitButton","title","style","massiveBattleButton","saveButton","cancelBackground","backgroundColor","resetButton","buttons","BrandForm","props","context","groups","back","isLoading","skin","fields","type","backView","color","arrowBack","link","backDesc","desc","brandGroups","map","group","index","buttonSection","handleSubmit","useMemo","e","preventDefault","handleReset","loaderContainer","loader","form","contextTypes","Provider","childContextTypes","defaultProps","place","propTypes","PropTypes","arrayOf","shape","BrandFormGroup","isRequired","bool","func","Button","Link","children","href","string"],"sources":["../../../src/organism/brand-form/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowLeft as ArrowLeft} from '@coorpacademy/nova-icons';\nimport BrandFormGroup from '../../molecule/brand-form-group';\nimport Provider from '../../atom/provider';\nimport Button from '../../atom/button';\nimport ButtonLink from '../../atom/button-link';\nimport Link from '../../atom/link';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nconst buildButtonSection = (\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n tooltip,\n disabled,\n isModified,\n isPending,\n darkColor,\n theme,\n massiveBattleForm\n) => {\n if (!onSubmit && !onReset) {\n return null;\n }\n\n const disabledSubmit = disabled || isPending || !isModified;\n const submitButton = onSubmit ? (\n <div\n data-tip={tooltip.title}\n data-for=\"submitButton\"\n className={massiveBattleForm ? style.massiveBattleButton : style.saveButton}\n >\n {theme === 'coorpmanager' ? (\n <ButtonLink\n type=\"primary\"\n label={submitValue}\n disabled={disabledSubmit}\n data-testid=\"submit-button\"\n buttonType=\"submit\"\n onClick={onSubmit}\n />\n ) : (\n <Button type=\"submit\" disabled={disabledSubmit} submitValue={submitValue} />\n )}\n </div>\n ) : null;\n\n const cancelBackground = {backgroundColor: darkColor};\n\n const resetButton = onReset ? (\n <div className={style.resetButton}>\n <Button type=\"reset\" submitValue={resetValue} style={cancelBackground} />\n </div>\n ) : null;\n\n return (\n <div className={style.buttons}>\n {submitButton}\n {resetButton}\n </div>\n );\n};\nconst BrandForm = (props, context) => {\n const {\n groups,\n disabled,\n isModified,\n isPending,\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n back,\n tooltip,\n isLoading,\n theme\n } = props;\n const {skin} = context;\n const darkColor = get('common.dark', skin);\n const massiveBattleForm = groups[0]?.fields?.[0]?.type === 'titleAndInput';\n const backView = back ? (\n <p className={style.back}>\n <ArrowLeft style={{color: darkColor}} className={style.arrowBack} />\n <Link href={back.link} className={style.backDesc}>\n {back.desc}\n </Link>\n </p>\n ) : null;\n\n const brandGroups = groups.map((group, index) => {\n return (\n <div className={style.group} key={index}>\n <BrandFormGroup {...group} />\n </div>\n );\n });\n\n const buttonSection = buildButtonSection(\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n tooltip,\n disabled,\n isModified,\n isPending,\n darkColor,\n theme,\n massiveBattleForm\n );\n\n const handleSubmit = useMemo(\n () => e => {\n e.preventDefault();\n return onSubmit(e);\n },\n [onSubmit]\n );\n\n const handleReset = useMemo(\n () => e => {\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n return (\n <div>\n {backView}\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <form onSubmit={handleSubmit} onReset={handleReset} className={style.form}>\n {brandGroups}\n {buttonSection}\n </form>\n )}\n </div>\n );\n};\n\nBrandForm.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nBrandForm.defaultProps = {\n tooltip: {\n title: '',\n place: 'top'\n }\n};\n\nBrandForm.propTypes = {\n groups: PropTypes.arrayOf(PropTypes.shape(BrandFormGroup.propTypes)).isRequired,\n disabled: PropTypes.bool,\n isModified: PropTypes.bool,\n isPending: PropTypes.bool,\n onSubmit: PropTypes.func,\n submitValue: Button.propTypes.submitValue,\n onReset: PropTypes.func,\n resetValue: Button.propTypes.submitValue,\n back: PropTypes.shape({\n desc: Link.propTypes.children,\n link: Link.propTypes.href\n }),\n tooltip: PropTypes.shape({\n title: PropTypes.string,\n place: PropTypes.string\n }),\n isLoading: PropTypes.bool,\n theme: PropTypes.string\n};\n\nexport default BrandForm;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,kBAAkB,GAAG,CACzBC,QADyB,EAEzBC,WAFyB,EAGzBC,OAHyB,EAIzBC,UAJyB,EAKzBC,OALyB,EAMzBC,QANyB,EAOzBC,UAPyB,EAQzBC,SARyB,EASzBC,SATyB,EAUzBC,KAVyB,EAWzBC,iBAXyB,KAYtB;EACH,IAAI,CAACV,QAAD,IAAa,CAACE,OAAlB,EAA2B;IACzB,OAAO,IAAP;EACD;;EAED,MAAMS,cAAc,GAAGN,QAAQ,IAAIE,SAAZ,IAAyB,CAACD,UAAjD;EACA,MAAMM,YAAY,GAAGZ,QAAQ,gBAC3B;IACE,YAAUI,OAAO,CAACS,KADpB;IAEE,YAAS,cAFX;IAGE,SAAS,EAAEH,iBAAiB,GAAGI,cAAA,CAAMC,mBAAT,GAA+BD,cAAA,CAAME;EAHnE,GAKGP,KAAK,KAAK,cAAV,gBACC,6BAAC,mBAAD;IACE,IAAI,EAAC,SADP;IAEE,KAAK,EAAER,WAFT;IAGE,QAAQ,EAAEU,cAHZ;IAIE,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","tooltip","disabled","isModified","isPending","massiveBattleForm","disabledSubmit","submitButton","title","style","massiveBattleButton","saveButton","position","faIcon","name","color","size","resetButton","buttons","BrandForm","props","context","groups","back","isLoading","theme","skin","darkColor","fields","type","backView","arrowBack","link","backDesc","desc","brandGroups","map","group","index","buttonSection","handleSubmit","useMemo","e","preventDefault","handleReset","loaderContainer","loader","form","contextTypes","Provider","childContextTypes","defaultProps","place","propTypes","PropTypes","arrayOf","shape","BrandFormGroup","isRequired","bool","func","Button","Link","children","href","string"],"sources":["../../../src/organism/brand-form/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowLeft as ArrowLeft} from '@coorpacademy/nova-icons';\nimport BrandFormGroup from '../../molecule/brand-form-group';\nimport Provider from '../../atom/provider';\nimport Button from '../../atom/button';\nimport ButtonLink from '../../atom/button-link';\nimport Link from '../../atom/link';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nconst buildButtonSection = (\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n tooltip,\n disabled,\n isModified,\n isPending,\n massiveBattleForm\n) => {\n if (!onSubmit && !onReset) {\n return null;\n }\n\n const disabledSubmit = disabled || isPending || !isModified;\n const submitButton = onSubmit ? (\n <div\n data-tip={tooltip.title}\n data-for=\"submitButton\"\n className={massiveBattleForm ? style.massiveBattleButton : style.saveButton}\n >\n <ButtonLink\n type=\"primary\"\n label={submitValue}\n disabled={disabledSubmit}\n data-testid=\"submit-button\"\n usage=\"submit\"\n onClick={onSubmit}\n icon={{\n position: 'left',\n faIcon: {\n name: 'circle-check',\n color: '#FFFFFF',\n size: 16\n }\n }}\n />\n </div>\n ) : null;\n\n const resetButton = onReset ? (\n <div className={style.resetButton}>\n <ButtonLink\n usage=\"reset\"\n label={resetValue}\n data-testid=\"reset-button\"\n onClick={onReset}\n icon={{\n position: 'left',\n faIcon: {\n name: 'trash',\n size: 16\n }\n }}\n />\n </div>\n ) : null;\n\n return (\n <div className={style.buttons}>\n {submitButton}\n {resetButton}\n </div>\n );\n};\nconst BrandForm = (props, context) => {\n const {\n groups,\n disabled,\n isModified,\n isPending,\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n back,\n tooltip,\n isLoading,\n theme\n } = props;\n const {skin} = context;\n const darkColor = get('common.dark', skin);\n const massiveBattleForm = groups[0]?.fields?.[0]?.type === 'titleAndInput';\n const backView = back ? (\n <p className={style.back}>\n <ArrowLeft style={{color: darkColor}} className={style.arrowBack} />\n <Link href={back.link} className={style.backDesc}>\n {back.desc}\n </Link>\n </p>\n ) : null;\n\n const brandGroups = groups.map((group, index) => {\n return (\n <div className={style.group} key={index}>\n <BrandFormGroup {...group} />\n </div>\n );\n });\n\n const buttonSection = buildButtonSection(\n onSubmit,\n submitValue,\n onReset,\n resetValue,\n tooltip,\n disabled,\n isModified,\n isPending,\n darkColor,\n theme,\n massiveBattleForm\n );\n\n const handleSubmit = useMemo(\n () => e => {\n e.preventDefault();\n return onSubmit(e);\n },\n [onSubmit]\n );\n\n const handleReset = useMemo(\n () => e => {\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n return (\n <div>\n {backView}\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <form onSubmit={handleSubmit} onReset={handleReset} className={style.form}>\n {brandGroups}\n {buttonSection}\n </form>\n )}\n </div>\n );\n};\n\nBrandForm.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nBrandForm.defaultProps = {\n tooltip: {\n title: '',\n place: 'top'\n }\n};\n\nBrandForm.propTypes = {\n groups: PropTypes.arrayOf(PropTypes.shape(BrandFormGroup.propTypes)).isRequired,\n disabled: PropTypes.bool,\n isModified: PropTypes.bool,\n isPending: PropTypes.bool,\n onSubmit: PropTypes.func,\n submitValue: Button.propTypes.submitValue,\n onReset: PropTypes.func,\n resetValue: Button.propTypes.submitValue,\n back: PropTypes.shape({\n desc: Link.propTypes.children,\n link: Link.propTypes.href\n }),\n tooltip: PropTypes.shape({\n title: PropTypes.string,\n place: PropTypes.string\n }),\n isLoading: PropTypes.bool,\n theme: PropTypes.string\n};\n\nexport default BrandForm;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,kBAAkB,GAAG,CACzBC,QADyB,EAEzBC,WAFyB,EAGzBC,OAHyB,EAIzBC,UAJyB,EAKzBC,OALyB,EAMzBC,QANyB,EAOzBC,UAPyB,EAQzBC,SARyB,EASzBC,iBATyB,KAUtB;EACH,IAAI,CAACR,QAAD,IAAa,CAACE,OAAlB,EAA2B;IACzB,OAAO,IAAP;EACD;;EAED,MAAMO,cAAc,GAAGJ,QAAQ,IAAIE,SAAZ,IAAyB,CAACD,UAAjD;EACA,MAAMI,YAAY,GAAGV,QAAQ,gBAC3B;IACE,YAAUI,OAAO,CAACO,KADpB;IAEE,YAAS,cAFX;IAGE,SAAS,EAAEH,iBAAiB,GAAGI,cAAA,CAAMC,mBAAT,GAA+BD,cAAA,CAAME;EAHnE,gBAKE,6BAAC,mBAAD;IACE,IAAI,EAAC,SADP;IAEE,KAAK,EAAEb,WAFT;IAGE,QAAQ,EAAEQ,cAHZ;IAIE,eAAY,eAJd;IAKE,KAAK,EAAC,QALR;IAME,OAAO,EAAET,QANX;IAOE,IAAI,EAAE;MACJe,QAAQ,EAAE,MADN;MAEJC,MAAM,EAAE;QACNC,IAAI,EAAE,cADA;QAENC,KAAK,EAAE,SAFD;QAGNC,IAAI,EAAE;MAHA;IAFJ;EAPR,EALF,CAD2B,GAuBzB,IAvBJ;EAyBA,MAAMC,WAAW,GAAGlB,OAAO,gBACzB;IAAK,SAAS,EAAEU,cAAA,CAAMQ;EAAtB,gBACE,6BAAC,mBAAD;IACE,KAAK,EAAC,OADR;IAEE,KAAK,EAAEjB,UAFT;IAGE,eAAY,cAHd;IAIE,OAAO,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,OAAV,CAAkBD,kBAAA,CAAUE,KAAV,CAAgBC,uBAAA,CAAeJ,SAA/B,CAAlB,EAA6DK,UADjD;EAEpBxD,QAAQ,EAAEoD,kBAAA,CAAUK,IAFA;EAGpBxD,UAAU,EAAEmD,kBAAA,CAAUK,IAHF;EAIpBvD,SAAS,EAAEkD,kBAAA,CAAUK,IAJD;EAKpB9D,QAAQ,EAAEyD,kBAAA,CAAUM,IALA;EAMpB9D,WAAW,EAAE+D,eAAA,CAAOR,SAAP,CAAiBvD,WANV;EAOpBC,OAAO,EAAEuD,kBAAA,CAAUM,IAPC;EAQpB5D,UAAU,EAAE6D,eAAA,CAAOR,SAAP,CAAiBvD,WART;EASpByB,IAAI,EAAE+B,kBAAA,CAAUE,KAAV,CAAgB;IACpBtB,IAAI,EAAE4B,aAAA,CAAKT,SAAL,CAAeU,QADD;IAEpB/B,IAAI,EAAE8B,aAAA,CAAKT,SAAL,CAAeW;EAFD,CAAhB,CATc;EAapB/D,OAAO,EAAEqD,kBAAA,CAAUE,KAAV,CAAgB;IACvBhD,KAAK,EAAE8C,kBAAA,CAAUW,MADM;IAEvBb,KAAK,EAAEE,kBAAA,CAAUW;EAFM,CAAhB,CAbW;EAiBpBzC,SAAS,EAAE8B,kBAAA,CAAUK,IAjBD;EAkBpBlC,KAAK,EAAE6B,kBAAA,CAAUW;AAlBG,CAAtB;eAqBe9C,S"}
@@ -2,27 +2,6 @@ export default BrandLearningPriorities;
2
2
  declare function BrandLearningPriorities(props: any, context: any): JSX.Element;
3
3
  declare namespace BrandLearningPriorities {
4
4
  namespace contextTypes {
5
- const skin: PropTypes.Requireable<PropTypes.InferProps<{
6
- common: PropTypes.Requireable<{
7
- [x: string]: any;
8
- }>;
9
- images: PropTypes.Requireable<PropTypes.InferProps<{
10
- 'logo-mobile': PropTypes.Requireable<any>;
11
- logo: PropTypes.Requireable<any>;
12
- 'logo-email': PropTypes.Requireable<any>;
13
- login: PropTypes.Requireable<any>;
14
- }>>;
15
- icons: PropTypes.Requireable<{
16
- [x: string]: any;
17
- }>;
18
- mod: PropTypes.Requireable<{
19
- [x: string]: any;
20
- }>;
21
- courses: PropTypes.Requireable<any[]>;
22
- texts: PropTypes.Requireable<{
23
- [x: string]: any;
24
- }>;
25
- }>>;
26
5
  const translate: PropTypes.Requireable<(...args: any[]) => any>;
27
6
  }
28
7
  namespace propTypes {
@@ -84,6 +63,7 @@ declare namespace BrandLearningPriorities {
84
63
  title: PropTypes.Validator<string>;
85
64
  subtitle: PropTypes.Requireable<string>;
86
65
  selected: PropTypes.Requireable<boolean>;
66
+ selectedColor: PropTypes.Requireable<string>;
87
67
  dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
88
68
  label: PropTypes.Requireable<string>;
89
69
  type: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/brand-learning-priorities/index.js"],"names":[],"mappings":";AAYA,gFAiGC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/brand-learning-priorities/index.js"],"names":[],"mappings":";AAUA,gFA2FC"}
@@ -3,14 +3,10 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
5
 
6
- var _get2 = _interopRequireDefault(require("lodash/fp/get"));
7
-
8
6
  var _react = _interopRequireWildcard(require("react"));
9
7
 
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
9
 
12
- var _cssColorFunction = require("css-color-function");
13
-
14
10
  var _provider = _interopRequireDefault(require("../../atom/provider"));
15
11
 
16
12
  var _loader = _interopRequireDefault(require("../../atom/loader"));
@@ -25,12 +21,12 @@ var _learningPriorityModal = _interopRequireDefault(require("../../molecule/lear
25
21
 
26
22
  var _style = _interopRequireDefault(require("./style.css"));
27
23
 
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+
28
26
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
27
 
30
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
31
29
 
32
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
-
34
30
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
35
31
 
36
32
  const BrandLearningPriorities = (props, context) => {
@@ -49,10 +45,8 @@ const BrandLearningPriorities = (props, context) => {
49
45
  const [itemList, setItemList] = (0, _react.useState)([...items]);
50
46
  const [openModal, setOpenModal] = (0, _react.useState)(false);
51
47
  const {
52
- skin,
53
48
  translate
54
49
  } = context;
55
- const primarySkinColor = (0, _get2.default)('common.primary', skin);
56
50
  const selectedPriorities = (0, _react.useMemo)(() => items.map(priority => priority.priorityRef), [items]);
57
51
  const handleDropItem = (0, _react.useCallback)((dragRef, dropRef) => {
58
52
  const dragIndex = itemList.findIndex(item => item.priorityRef === dragRef);
@@ -100,14 +94,10 @@ const BrandLearningPriorities = (props, context) => {
100
94
  }, /*#__PURE__*/_react.default.createElement("div", {
101
95
  className: _style.default.priorityCount
102
96
  }, `${items.length} ${translate('items')}`), /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
97
+ type: "primary",
103
98
  customStyle: {
104
- backgroundColor: primarySkinColor,
105
- color: '#FFFFFF',
106
- transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',
107
99
  width: 'fit-content'
108
100
  },
109
- hoverBackgroundColor: (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.07))`),
110
- hoverColor: primarySkinColor,
111
101
  onClick: handleOpenModal,
112
102
  label: translate('add_learning_priority'),
113
103
  "data-name": "add-learning-priority",
@@ -115,7 +105,6 @@ const BrandLearningPriorities = (props, context) => {
115
105
  position: 'left',
116
106
  faIcon: {
117
107
  name: 'plus',
118
- backgroundColor: primarySkinColor,
119
108
  color: '#FFFFFF',
120
109
  size: 16
121
110
  }
@@ -128,7 +117,6 @@ const BrandLearningPriorities = (props, context) => {
128
117
  };
129
118
 
130
119
  BrandLearningPriorities.contextTypes = {
131
- skin: _provider.default.childContextTypes.skin,
132
120
  translate: _provider.default.childContextTypes.translate
133
121
  };
134
122
  BrandLearningPriorities.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["BrandLearningPriorities","props","context","content","priorities","filters","isLoading","onAdd","items","onDrop","itemType","itemList","setItemList","useState","openModal","setOpenModal","skin","translate","primarySkinColor","selectedPriorities","useMemo","map","priority","priorityRef","handleDropItem","useCallback","dragRef","dropRef","dragIndex","findIndex","item","dropIndex","newItems","dragItem","splice","type","ref","Loading","style","loaderContainer","loader","useEffect","handleOpenModal","handleCloseModal","container","LPtitle","LPdescription","ctaWrapper","priorityCount","length","backgroundColor","color","transition","width","convert","position","faIcon","name","size","contextTypes","Provider","childContextTypes","propTypes","PropTypes","shape","DraggableList","arrayOf","string","title","courses","number","SelectOptionPropTypes","count","bool","func"],"sources":["../../../src/organism/brand-learning-priorities/index.js"],"sourcesContent":["import React, {useState, useCallback, useMemo, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport {convert} from 'css-color-function';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Loader from '../../atom/loader';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport DraggableList from '../../molecule/draggable-list';\nimport ButtonLink from '../../atom/button-link';\nimport LearningPriorityModal from '../../molecule/learning-priority-modal';\nimport style from './style.css';\n\nconst BrandLearningPriorities = (props, context) => {\n const {content, priorities, filters, isLoading, onAdd} = props;\n const {items, onDrop, itemType} = content;\n const [itemList, setItemList] = useState([...items]);\n const [openModal, setOpenModal] = useState(false);\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const selectedPriorities = useMemo(() => items.map(priority => priority.priorityRef), [items]);\n\n const handleDropItem = useCallback(\n (dragRef, dropRef) => {\n const dragIndex = itemList.findIndex(item => item.priorityRef === dragRef);\n const dropIndex = itemList.findIndex(item => item.priorityRef === dropRef);\n\n if (dragIndex === dropIndex) return;\n\n const newItems = [...itemList];\n const [dragItem] = newItems.splice(dragIndex, 1);\n newItems.splice(dropIndex, 0, dragItem);\n\n setItemList(newItems);\n onDrop(\n newItems.map(item => {\n return {type: item.type, ref: item.priorityRef};\n })\n );\n },\n [itemList, setItemList, onDrop]\n );\n\n const Loading = useCallback(\n () => (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ),\n []\n );\n\n useEffect(() => {\n setItemList(items);\n }, [items]);\n\n const handleOpenModal = useCallback(() => setOpenModal(true), [setOpenModal]);\n const handleCloseModal = useCallback(() => setOpenModal(false), [setOpenModal]);\n return (\n <div className={style.container}>\n <LearningPriorityModal\n isLoading={isLoading}\n isOpen={openModal}\n onCancel={handleCloseModal}\n onClose={handleCloseModal}\n onAdd={onAdd}\n priorities={priorities}\n filters={filters}\n preselected={selectedPriorities}\n />\n <div className={style.LPtitle}>{translate('learning_priorities')}</div>\n <div className={style.LPdescription}>\n {translate('learning_priorities_brand_description')}\n </div>\n\n {isLoading ? (\n <Loading />\n ) : (\n <>\n <div className={style.ctaWrapper}>\n <div className={style.priorityCount}>{`${items.length} ${translate('items')}`}</div>\n <ButtonLink\n customStyle={{\n backgroundColor: primarySkinColor,\n color: '#FFFFFF',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n }}\n hoverBackgroundColor={convert(`color(${primarySkinColor} a(0.07))`)}\n hoverColor={primarySkinColor}\n onClick={handleOpenModal}\n label={translate('add_learning_priority')}\n data-name=\"add-learning-priority\"\n icon={{\n position: 'left',\n faIcon: {\n name: 'plus',\n backgroundColor: primarySkinColor,\n color: '#FFFFFF',\n size: 16\n }\n }}\n />\n </div>\n <DraggableList itemType={itemType} items={itemList} onDrop={handleDropItem} />\n </>\n )}\n </div>\n );\n};\n\nBrandLearningPriorities.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nBrandLearningPriorities.propTypes = {\n content: PropTypes.shape(DraggableList.propTypes),\n priorities: PropTypes.arrayOf(\n PropTypes.shape({\n ref: PropTypes.string,\n title: PropTypes.string,\n courses: PropTypes.number,\n type: PropTypes.string\n })\n ),\n filters: PropTypes.arrayOf(\n PropTypes.shape({\n ...SelectOptionPropTypes,\n count: PropTypes.number\n })\n ),\n isLoading: PropTypes.bool,\n onAdd: PropTypes.func\n};\n\nexport default BrandLearningPriorities;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,uBAAuB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAClD,MAAM;IAACC,OAAD;IAAUC,UAAV;IAAsBC,OAAtB;IAA+BC,SAA/B;IAA0CC;EAA1C,IAAmDN,KAAzD;EACA,MAAM;IAACO,KAAD;IAAQC,MAAR;IAAgBC;EAAhB,IAA4BP,OAAlC;EACA,MAAM,CAACQ,QAAD,EAAWC,WAAX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,EAAE0D,kBAAA,CAAUG,OAAV,CACPH,kBAAA,CAAUC,KAAV,cACKO,6BADL;IAEEC,KAAK,EAAET,kBAAA,CAAUO;EAFnB,GADO,CAVyB;EAgBlChE,SAAS,EAAEyD,kBAAA,CAAUU,IAhBa;EAiBlClE,KAAK,EAAEwD,kBAAA,CAAUW;AAjBiB,CAApC;eAoBe1E,uB"}
1
+ {"version":3,"file":"index.js","names":["BrandLearningPriorities","props","context","content","priorities","filters","isLoading","onAdd","items","onDrop","itemType","itemList","setItemList","useState","openModal","setOpenModal","translate","selectedPriorities","useMemo","map","priority","priorityRef","handleDropItem","useCallback","dragRef","dropRef","dragIndex","findIndex","item","dropIndex","newItems","dragItem","splice","type","ref","Loading","style","loaderContainer","loader","useEffect","handleOpenModal","handleCloseModal","container","LPtitle","LPdescription","ctaWrapper","priorityCount","length","width","position","faIcon","name","color","size","contextTypes","Provider","childContextTypes","propTypes","PropTypes","shape","DraggableList","arrayOf","string","title","courses","number","SelectOptionPropTypes","count","bool","func"],"sources":["../../../src/organism/brand-learning-priorities/index.js"],"sourcesContent":["import React, {useState, useCallback, useMemo, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider from '../../atom/provider';\nimport Loader from '../../atom/loader';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport DraggableList from '../../molecule/draggable-list';\nimport ButtonLink from '../../atom/button-link';\nimport LearningPriorityModal from '../../molecule/learning-priority-modal';\nimport style from './style.css';\n\nconst BrandLearningPriorities = (props, context) => {\n const {content, priorities, filters, isLoading, onAdd} = props;\n const {items, onDrop, itemType} = content;\n const [itemList, setItemList] = useState([...items]);\n const [openModal, setOpenModal] = useState(false);\n const {translate} = context;\n\n const selectedPriorities = useMemo(() => items.map(priority => priority.priorityRef), [items]);\n\n const handleDropItem = useCallback(\n (dragRef, dropRef) => {\n const dragIndex = itemList.findIndex(item => item.priorityRef === dragRef);\n const dropIndex = itemList.findIndex(item => item.priorityRef === dropRef);\n\n if (dragIndex === dropIndex) return;\n\n const newItems = [...itemList];\n const [dragItem] = newItems.splice(dragIndex, 1);\n newItems.splice(dropIndex, 0, dragItem);\n\n setItemList(newItems);\n onDrop(\n newItems.map(item => {\n return {type: item.type, ref: item.priorityRef};\n })\n );\n },\n [itemList, setItemList, onDrop]\n );\n\n const Loading = useCallback(\n () => (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ),\n []\n );\n\n useEffect(() => {\n setItemList(items);\n }, [items]);\n\n const handleOpenModal = useCallback(() => setOpenModal(true), [setOpenModal]);\n const handleCloseModal = useCallback(() => setOpenModal(false), [setOpenModal]);\n return (\n <div className={style.container}>\n <LearningPriorityModal\n isLoading={isLoading}\n isOpen={openModal}\n onCancel={handleCloseModal}\n onClose={handleCloseModal}\n onAdd={onAdd}\n priorities={priorities}\n filters={filters}\n preselected={selectedPriorities}\n />\n <div className={style.LPtitle}>{translate('learning_priorities')}</div>\n <div className={style.LPdescription}>\n {translate('learning_priorities_brand_description')}\n </div>\n\n {isLoading ? (\n <Loading />\n ) : (\n <>\n <div className={style.ctaWrapper}>\n <div className={style.priorityCount}>{`${items.length} ${translate('items')}`}</div>\n <ButtonLink\n type=\"primary\"\n customStyle={{\n width: 'fit-content'\n }}\n onClick={handleOpenModal}\n label={translate('add_learning_priority')}\n data-name=\"add-learning-priority\"\n icon={{\n position: 'left',\n faIcon: {\n name: 'plus',\n color: '#FFFFFF',\n size: 16\n }\n }}\n />\n </div>\n <DraggableList itemType={itemType} items={itemList} onDrop={handleDropItem} />\n </>\n )}\n </div>\n );\n};\n\nBrandLearningPriorities.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nBrandLearningPriorities.propTypes = {\n content: PropTypes.shape(DraggableList.propTypes),\n priorities: PropTypes.arrayOf(\n PropTypes.shape({\n ref: PropTypes.string,\n title: PropTypes.string,\n courses: PropTypes.number,\n type: PropTypes.string\n })\n ),\n filters: PropTypes.arrayOf(\n PropTypes.shape({\n ...SelectOption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kBAAA,CAAUO,MAHL;IAIdhC,IAAI,EAAEyB,kBAAA,CAAUI;EAJF,CAAhB,CADU,CAFsB;EAUlCzD,OAAO,EAAEqD,kBAAA,CAAUG,OAAV,CACPH,kBAAA,CAAUC,KAAV,cACKO,6BADL;IAEEC,KAAK,EAAET,kBAAA,CAAUO;EAFnB,GADO,CAVyB;EAgBlC3D,SAAS,EAAEoD,kBAAA,CAAUU,IAhBa;EAiBlC7D,KAAK,EAAEmD,kBAAA,CAAUW;AAjBiB,CAApC;eAoBerE,uB"}
@@ -4,6 +4,7 @@
4
4
  .container {
5
5
  font-family: "Gilroy";
6
6
  font-style: normal;
7
+ margin-bottom: 48px;
7
8
  }
8
9
 
9
10
  .LPtitle {
@@ -38,6 +39,7 @@
38
39
  .ctaWrapper {
39
40
  display: flex;
40
41
  justify-content: space-between;
42
+ align-items: center;
41
43
  margin-bottom: 16px;
42
44
  }
43
45
 
@@ -1,11 +1,12 @@
1
1
  export default ListItem;
2
- declare function ListItem({ buttonLink, secondButtonLink, bulletPointMenuButton, tags, title, selected, subtitle, dataColumns, order, "aria-label": ariaLabel, disabled, contentType, isBulkStyle, isOverflowHidden, onClick }: {
2
+ declare function ListItem({ buttonLink, secondButtonLink, bulletPointMenuButton, tags, title, selected, selectedColor, subtitle, dataColumns, order, "aria-label": ariaLabel, disabled, contentType, isBulkStyle, isOverflowHidden, onClick }: {
3
3
  buttonLink: any;
4
4
  secondButtonLink: any;
5
5
  bulletPointMenuButton: any;
6
6
  tags: any;
7
7
  title: any;
8
8
  selected: any;
9
+ selectedColor: any;
9
10
  subtitle: any;
10
11
  dataColumns: any;
11
12
  order: any;
@@ -45,6 +46,7 @@ declare namespace ListItem {
45
46
  title: PropTypes.Validator<string>;
46
47
  subtitle: PropTypes.Requireable<string>;
47
48
  selected: PropTypes.Requireable<boolean>;
49
+ selectedColor: PropTypes.Requireable<string>;
48
50
  dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
49
51
  label: PropTypes.Requireable<string>;
50
52
  type: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAaA;;;;;;;;;;;;;;;;8BAuGC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAaA;;;;;;;;;;;;;;;;;8BAwGC"}
@@ -42,6 +42,7 @@ const ListItem = ({
42
42
  tags,
43
43
  title,
44
44
  selected,
45
+ selectedColor,
45
46
  subtitle,
46
47
  dataColumns,
47
48
  order,
@@ -55,7 +56,7 @@ const ListItem = ({
55
56
  const {
56
57
  skin
57
58
  } = context;
58
- const primarySkinColor = (0, _get2.default)('common.primary', skin);
59
+ const primarySelectedColor = selectedColor || (0, _get2.default)('common.primary', skin);
59
60
 
60
61
  const mapUncapped = _map2.default.convert({
61
62
  cap: false
@@ -63,11 +64,11 @@ const ListItem = ({
63
64
 
64
65
  let isPublished = false;
65
66
  const selectedStyle = selected ? {
66
- backgroundColor: (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.07))`)
67
+ backgroundColor: (0, _cssColorFunction.convert)(`color(${primarySelectedColor} a(0.07))`)
67
68
  } : {};
68
69
  const tagSelectedStyle = selected ? {
69
- backgroundColor: (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.15))`),
70
- color: primarySkinColor
70
+ backgroundColor: (0, _cssColorFunction.convert)(`color(${primarySelectedColor} a(0.15))`),
71
+ color: primarySelectedColor
71
72
  } : {};
72
73
  const tagsView = mapUncapped((tag, index) => {
73
74
  isPublished = tag.type === 'success';
@@ -103,7 +104,7 @@ const ListItem = ({
103
104
  className: _style.default.settings
104
105
  }, tagsView, selected ? /*#__PURE__*/_react.default.createElement(_icon.default, {
105
106
  iconName: "circle-check",
106
- iconColor: primarySkinColor,
107
+ iconColor: primarySelectedColor,
107
108
  backgroundColor: '#ffffff',
108
109
  size: {
109
110
  faSize: 16,
@@ -120,6 +121,7 @@ ListItem.propTypes = process.env.NODE_ENV !== "production" ? {
120
121
  title: _propTypes.default.string.isRequired,
121
122
  subtitle: _propTypes.default.string,
122
123
  selected: _propTypes.default.bool,
124
+ selectedColor: _propTypes.default.string,
123
125
  dataColumns: _propTypes.default.arrayOf(_propTypes.default.shape({
124
126
  label: _propTypes.default.string,
125
127
  type: _propTypes.default.oneOf(['success', 'failure', 'warning', 'progress', 'default']),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ListItem","buttonLink","secondButtonLink","bulletPointMenuButton","tags","title","selected","subtitle","dataColumns","order","ariaLabel","disabled","contentType","isBulkStyle","isOverflowHidden","onClick","context","skin","primarySkinColor","mapUncapped","convert","cap","isPublished","selectedStyle","backgroundColor","tagSelectedStyle","color","tagsView","tag","index","type","style","dataColumnsView","dataColumn","className","label","orderView","undefined","classnames","wrapper","gridLayout","withSubtitle","cursorPointer","dataColumnsWrapper","hiddenOverflowX","settings","faSize","wrapperSize","contextTypes","Provider","childContextTypes","translate","propTypes","PropTypes","string","isRequired","bool","arrayOf","shape","oneOf","dataName","icon","position","func","buttonAriaLabel","menuAriaLabel","buttons","number","id"],"sources":["../../../src/organism/list-item/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, map, noop, get} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst ListItem = (\n {\n buttonLink,\n secondButtonLink,\n bulletPointMenuButton,\n tags,\n title,\n selected,\n subtitle,\n dataColumns,\n order,\n 'aria-label': ariaLabel,\n disabled = false,\n contentType,\n isBulkStyle = false,\n isOverflowHidden = false,\n onClick = noop\n },\n context\n) => {\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n const mapUncapped = map.convert({cap: false});\n let isPublished = false;\n\n const selectedStyle = selected\n ? {\n backgroundColor: convert(`color(${primarySkinColor} a(0.07))`)\n }\n : {};\n\n const tagSelectedStyle = selected\n ? {\n backgroundColor: convert(`color(${primarySkinColor} a(0.15))`),\n color: primarySkinColor\n }\n : {};\n\n const tagsView = mapUncapped((tag, index) => {\n isPublished = tag.type === 'success';\n return (\n <div key={index} className={style.tag}>\n <Tag {...tag} customStyle={tagSelectedStyle} />\n </div>\n );\n })(tags);\n\n const dataColumnsView = mapUncapped((dataColumn, index) => {\n return (\n <div key={index} className={style[dataColumn.className]}>\n {dataColumn.type ? <Tag {...dataColumn} /> : dataColumn.label}\n </div>\n );\n })(dataColumns);\n\n const orderView =\n order !== null && order !== undefined ? (\n <div className={style.order} aria-label={ariaLabel}>\n {order + 1}\n </div>\n ) : null;\n\n return (\n <div\n className={classnames(\n style.wrapper,\n isBulkStyle && style.gridLayout,\n subtitle && style.withSubtitle,\n disabled && style.disabled,\n onClick !== noop && !disabled && style.cursorPointer\n )}\n onClick={!disabled ? onClick : undefined}\n style={selectedStyle}\n >\n <div\n className={classnames(style.dataColumnsWrapper, isOverflowHidden && style.hiddenOverflowX)}\n >\n {isPublished && contentType === 'certification' ? orderView : null}\n <div className={style.title} title={title}>\n {title}\n {subtitle ? <div className={style.subtitle}>{subtitle}</div> : null}\n </div>\n {dataColumnsView}\n </div>\n\n <div className={style.settings}>\n {tagsView}\n {selected ? (\n <Icon\n iconName=\"circle-check\"\n iconColor={primarySkinColor}\n backgroundColor={'#ffffff'}\n size={{faSize: 16, wrapperSize: 16}}\n />\n ) : null}\n {buttonLink ? <ButtonLink {...buttonLink} /> : null}\n {secondButtonLink ? <ButtonLink {...secondButtonLink} /> : null}\n {!isEmpty(bulletPointMenuButton) ? (\n <BulletPointMenuButton {...bulletPointMenuButton} />\n ) : null}\n </div>\n </div>\n );\n};\n\nListItem.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nListItem.propTypes = {\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string,\n selected: PropTypes.bool,\n dataColumns: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['success', 'failure', 'warning', 'progress', 'default']),\n className: PropTypes.oneOf(['cell', 'title'])\n })\n ),\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n secondButtonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n bulletPointMenuButton: PropTypes.shape({\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: PropTypes.arrayOf(\n PropTypes.shape({\n 'data-name': PropTypes.string,\n label: PropTypes.string,\n type: PropTypes.string,\n onClick: PropTypes.func\n })\n ),\n onClick: PropTypes.func\n }),\n tags: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['success', 'failure', 'warning', 'progress', 'default'])\n })\n ),\n disabled: PropTypes.bool,\n onClick: PropTypes.func,\n isBulkStyle: PropTypes.bool,\n isOverflowHidden: PropTypes.bool,\n order: PropTypes.number,\n 'aria-label': PropTypes.string,\n contentType: PropTypes.string,\n id: PropTypes.string\n};\n\nexport default ListItem;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEA,MAAMA,QAAQ,GAAG,CACf;EACEC,UADF;EAEEC,gBAFF;EAGEC,qBAHF;EAIEC,IAJF;EAKEC,KALF;EAMEC,QANF;EAOEC,QAP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xB,IAAI,EAAEuB,kBAAA,CAAUM,KAAV,CAAgB,CAAC,SAAD,EAAY,SAAZ,EAAuB,SAAvB,EAAkC,UAAlC,EAA8C,SAA9C,CAAhB;EAFQ,CAAhB,CADI,CA9Ca;EAoDnBhD,QAAQ,EAAE0C,kBAAA,CAAUG,IApDD;EAqDnBzC,OAAO,EAAEsC,kBAAA,CAAUU,IArDA;EAsDnBlD,WAAW,EAAEwC,kBAAA,CAAUG,IAtDJ;EAuDnB1C,gBAAgB,EAAEuC,kBAAA,CAAUG,IAvDT;EAwDnB/C,KAAK,EAAE4C,kBAAA,CAAUc,MAxDE;EAyDnB,cAAcd,kBAAA,CAAUC,MAzDL;EA0DnB1C,WAAW,EAAEyC,kBAAA,CAAUC,MA1DJ;EA2DnBc,EAAE,EAAEf,kBAAA,CAAUC;AA3DK,CAArB;eA8DetD,Q"}
1
+ {"version":3,"file":"index.js","names":["ListItem","buttonLink","secondButtonLink","bulletPointMenuButton","tags","title","selected","selectedColor","subtitle","dataColumns","order","ariaLabel","disabled","contentType","isBulkStyle","isOverflowHidden","onClick","context","skin","primarySelectedColor","mapUncapped","convert","cap","isPublished","selectedStyle","backgroundColor","tagSelectedStyle","color","tagsView","tag","index","type","style","dataColumnsView","dataColumn","className","label","orderView","undefined","classnames","wrapper","gridLayout","withSubtitle","cursorPointer","dataColumnsWrapper","hiddenOverflowX","settings","faSize","wrapperSize","contextTypes","Provider","childContextTypes","translate","propTypes","PropTypes","string","isRequired","bool","arrayOf","shape","oneOf","dataName","icon","position","func","buttonAriaLabel","menuAriaLabel","buttons","number","id"],"sources":["../../../src/organism/list-item/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, map, noop, get} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst ListItem = (\n {\n buttonLink,\n secondButtonLink,\n bulletPointMenuButton,\n tags,\n title,\n selected,\n selectedColor,\n subtitle,\n dataColumns,\n order,\n 'aria-label': ariaLabel,\n disabled = false,\n contentType,\n isBulkStyle = false,\n isOverflowHidden = false,\n onClick = noop\n },\n context\n) => {\n const {skin} = context;\n const primarySelectedColor = selectedColor || get('common.primary', skin);\n const mapUncapped = map.convert({cap: false});\n let isPublished = false;\n\n const selectedStyle = selected\n ? {\n backgroundColor: convert(`color(${primarySelectedColor} a(0.07))`)\n }\n : {};\n\n const tagSelectedStyle = selected\n ? {\n backgroundColor: convert(`color(${primarySelectedColor} a(0.15))`),\n color: primarySelectedColor\n }\n : {};\n\n const tagsView = mapUncapped((tag, index) => {\n isPublished = tag.type === 'success';\n return (\n <div key={index} className={style.tag}>\n <Tag {...tag} customStyle={tagSelectedStyle} />\n </div>\n );\n })(tags);\n\n const dataColumnsView = mapUncapped((dataColumn, index) => {\n return (\n <div key={index} className={style[dataColumn.className]}>\n {dataColumn.type ? <Tag {...dataColumn} /> : dataColumn.label}\n </div>\n );\n })(dataColumns);\n\n const orderView =\n order !== null && order !== undefined ? (\n <div className={style.order} aria-label={ariaLabel}>\n {order + 1}\n </div>\n ) : null;\n\n return (\n <div\n className={classnames(\n style.wrapper,\n isBulkStyle && style.gridLayout,\n subtitle && style.withSubtitle,\n disabled && style.disabled,\n onClick !== noop && !disabled && style.cursorPointer\n )}\n onClick={!disabled ? onClick : undefined}\n style={selectedStyle}\n >\n <div\n className={classnames(style.dataColumnsWrapper, isOverflowHidden && style.hiddenOverflowX)}\n >\n {isPublished && contentType === 'certification' ? orderView : null}\n <div className={style.title} title={title}>\n {title}\n {subtitle ? <div className={style.subtitle}>{subtitle}</div> : null}\n </div>\n {dataColumnsView}\n </div>\n\n <div className={style.settings}>\n {tagsView}\n {selected ? (\n <Icon\n iconName=\"circle-check\"\n iconColor={primarySelectedColor}\n backgroundColor={'#ffffff'}\n size={{faSize: 16, wrapperSize: 16}}\n />\n ) : null}\n {buttonLink ? <ButtonLink {...buttonLink} /> : null}\n {secondButtonLink ? <ButtonLink {...secondButtonLink} /> : null}\n {!isEmpty(bulletPointMenuButton) ? (\n <BulletPointMenuButton {...bulletPointMenuButton} />\n ) : null}\n </div>\n </div>\n );\n};\n\nListItem.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nListItem.propTypes = {\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string,\n selected: PropTypes.bool,\n selectedColor: PropTypes.string,\n dataColumns: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['success', 'failure', 'warning', 'progress', 'default']),\n className: PropTypes.oneOf(['cell', 'title'])\n })\n ),\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n secondButtonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n bulletPointMenuButton: PropTypes.shape({\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: PropTypes.arrayOf(\n PropTypes.shape({\n 'data-name': PropTypes.string,\n label: PropTypes.string,\n type: PropTypes.string,\n onClick: PropTypes.func\n })\n ),\n onClick: PropTypes.func\n }),\n tags: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['success', 'failure', 'warning', 'progress', 'default'])\n })\n ),\n disabled: PropTypes.bool,\n onClick: PropTypes.func,\n isBulkStyle: PropTypes.bool,\n isOverflowHidden: PropTypes.bool,\n order: PropTypes.number,\n 'aria-label': PropTypes.string,\n contentType: PropTypes.string,\n id: PropTypes.string\n};\n\nexport default ListItem;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEA,MAAMA,QAAQ,GAAG,CACf;EACEC,UADF;EAEEC,gBAFF;EAGEC,qBAHF;EAIEC,IAJF;EAKEC,KALF;EAMEC,QANF;EAOEC,aAPF;EAQEC,QARF;EASEC,WATF;EAUEC,KAVF;EAWE,cAAcC,SAXhB;EAYEC,QAAQ,GAAG,KAZb;EAaEC,WAbF;EAcEC,WAAW,GAAG,KAdhB;EAeEC,gBAAgB,GAAG,KAfrB;EAgBEC,OAAO;AAhBT,CADe,EAmBfC,OAnBe,KAoBZ;EACH,MAAM;IAACC;EAAD,IAASD,OAAf;EACA,MAAME,oBAAoB,GAAGZ,aAAa,IAAI,mBAAI,gBAAJ,EAAsBW,IAAtB,CAA9C;;EACA,MAAME,WAAW,GAAG,cAAIC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,CAApB;;EACA,IAAIC,WAAW,GAAG,KAAlB;EAEA,MAAMC,aAAa,GAAGlB,QAAQ,GAC1B;IACEmB,eAAe,EAAE,IAAAJ,yBAAA,EAAS,SAAQF,oBAAqB,WAAtC;EADnB,CAD0B,GAI1B,EAJJ;EAMA,MAAMO,gBAAgB,GAAGpB,QAAQ,GAC7B;IACEmB,eAAe,EAAE,IAAAJ,yBAAA,EAAS,SAAQF,oBAAqB,WAAtC,CADnB;IAEEQ,KAAK,EAAER;EAFT,CAD6B,GAK7B,EALJ;EAOA,MAAMS,QAAQ,GAAGR,WAAW,CAAC,CAACS,GAAD,EAAMC,KAAN,KAAgB;IAC3CP,WAAW,GAAGM,GAAG,CAACE,IAAJ,KAAa,SAA3B;IACA,oBACE;MAAK,GAAG,EAAED,KAAV;MAAiB,SAAS,EAAEE,cAAA,CAAMH;IAAlC,gB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AAgB;MACd,aAAaL,kBAAA,CAAUC,MADT;MAEdnB,KAAK,EAAEkB,kBAAA,CAAUC,MAFH;MAGdxB,IAAI,EAAEuB,kBAAA,CAAUC,MAHF;MAIdvC,OAAO,EAAEsC,kBAAA,CAAUU;IAJL,CAAhB,CADO,CAH4B;IAWrChD,OAAO,EAAEsC,kBAAA,CAAUU;EAXkB,CAAhB,CAlCJ;EA+CnB5D,IAAI,EAAEkD,kBAAA,CAAUI,OAAV,CACJJ,kBAAA,CAAUK,KAAV,CAAgB;IACdvB,KAAK,EAAEkB,kBAAA,CAAUC,MADH;IAEdxB,IAAI,EAAEuB,kBAAA,CAAUM,KAAV,CAAgB,CAAC,SAAD,EAAY,SAAZ,EAAuB,SAAvB,EAAkC,UAAlC,EAA8C,SAA9C,CAAhB;EAFQ,CAAhB,CADI,CA/Ca;EAqDnBhD,QAAQ,EAAE0C,kBAAA,CAAUG,IArDD;EAsDnBzC,OAAO,EAAEsC,kBAAA,CAAUU,IAtDA;EAuDnBlD,WAAW,EAAEwC,kBAAA,CAAUG,IAvDJ;EAwDnB1C,gBAAgB,EAAEuC,kBAAA,CAAUG,IAxDT;EAyDnB/C,KAAK,EAAE4C,kBAAA,CAAUc,MAzDE;EA0DnB,cAAcd,kBAAA,CAAUC,MA1DL;EA2DnB1C,WAAW,EAAEyC,kBAAA,CAAUC,MA3DJ;EA4DnBc,EAAE,EAAEf,kBAAA,CAAUC;AA5DK,CAArB;eA+DevD,Q"}
@@ -12,6 +12,7 @@ declare namespace ListItems {
12
12
  'aria-label': PropTypes.Requireable<string>;
13
13
  buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
14
14
  type: PropTypes.Requireable<string>;
15
+ usage: PropTypes.Requireable<string>;
15
16
  label: PropTypes.Requireable<string>;
16
17
  content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
17
18
  'aria-label': PropTypes.Requireable<string>;
@@ -56,6 +57,7 @@ declare namespace ListItems {
56
57
  title: PropTypes.Validator<string>;
57
58
  subtitle: PropTypes.Requireable<string>;
58
59
  selected: PropTypes.Requireable<boolean>;
60
+ selectedColor: PropTypes.Requireable<string>;
59
61
  dataColumns: PropTypes.Requireable<(PropTypes.InferProps<{
60
62
  label: PropTypes.Requireable<string>;
61
63
  type: PropTypes.Requireable<string>;
@@ -150,6 +152,7 @@ declare namespace ListItems {
150
152
  lastField: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
151
153
  componentType: PropTypes.Requireable<string>;
152
154
  type: PropTypes.Requireable<string>;
155
+ usage: PropTypes.Requireable<string>;
153
156
  label: PropTypes.Requireable<string>;
154
157
  content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
155
158
  'aria-label': PropTypes.Requireable<string>;