@coorpacademy/components 11.38.3-alpha.19 → 11.38.3-alpha.21

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 (152) hide show
  1. package/es/atom/input-search/index.d.ts +2 -0
  2. package/es/atom/input-search/index.d.ts.map +1 -1
  3. package/es/atom/input-search/index.js +46 -13
  4. package/es/atom/input-search/index.js.map +1 -1
  5. package/es/atom/input-search/style.css +97 -0
  6. package/es/molecule/card/customer.css +3 -0
  7. package/es/molecule/card/favorite.d.ts.map +1 -1
  8. package/es/molecule/card/favorite.js +0 -5
  9. package/es/molecule/card/favorite.js.map +1 -1
  10. package/es/molecule/card/index.d.ts.map +1 -1
  11. package/es/molecule/card/index.js +11 -29
  12. package/es/molecule/card/index.js.map +1 -1
  13. package/es/molecule/card/notification.css +16 -39
  14. package/es/molecule/card/notification.d.ts.map +1 -1
  15. package/es/molecule/card/notification.js +4 -26
  16. package/es/molecule/card/notification.js.map +1 -1
  17. package/es/molecule/card/style.css +14 -16
  18. package/es/molecule/card-content/index.d.ts.map +1 -1
  19. package/es/molecule/card-content/index.js +36 -79
  20. package/es/molecule/card-content/index.js.map +1 -1
  21. package/es/molecule/card-content/style.css +24 -32
  22. package/es/molecule/cm-popin/types.d.ts +2 -0
  23. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  24. package/es/molecule/external-content-button/style.css +0 -1
  25. package/es/molecule/multi-filter-panel/index.d.ts +2 -0
  26. package/es/molecule/multi-filter-panel/index.d.ts.map +1 -1
  27. package/es/molecule/multi-filter-panel/prop-types.d.ts +2 -0
  28. package/es/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
  29. package/es/molecule/search-form/index.d.ts +5 -0
  30. package/es/molecule/search-form/index.d.ts.map +1 -1
  31. package/es/molecule/search-form/index.js +26 -16
  32. package/es/molecule/search-form/index.js.map +1 -1
  33. package/es/molecule/search-form/style.css +21 -6
  34. package/es/organism/brand-table/index.d.ts +2 -0
  35. package/es/organism/content-skill-modal/index.d.ts +4 -0
  36. package/es/organism/content-skill-modal/index.d.ts.map +1 -1
  37. package/es/organism/content-skill-modal/types.d.ts +4 -0
  38. package/es/organism/content-skill-modal/types.d.ts.map +1 -1
  39. package/es/organism/filter-checkbox-and-search/index.d.ts +2 -0
  40. package/es/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
  41. package/es/organism/filter-checkbox-and-search/props-types.d.ts +2 -0
  42. package/es/organism/filter-checkbox-and-search/props-types.d.ts.map +1 -1
  43. package/es/organism/list-items/index.d.ts +2 -0
  44. package/es/organism/mooc-header/index.d.ts +14 -0
  45. package/es/organism/mooc-header/index.d.ts.map +1 -1
  46. package/es/organism/mooc-header/index.js +132 -13
  47. package/es/organism/mooc-header/index.js.map +1 -1
  48. package/es/organism/mooc-header/style.css +184 -8
  49. package/es/template/app-player/loading/index.d.ts +2 -0
  50. package/es/template/app-player/player/index.d.ts +4 -0
  51. package/es/template/app-player/player/slides/index.d.ts +2 -0
  52. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  53. package/es/template/app-player/popin-correction/index.d.ts +2 -0
  54. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  55. package/es/template/app-player/popin-end/index.d.ts +2 -0
  56. package/es/template/app-review/index.d.ts +2 -0
  57. package/es/template/app-review/index.d.ts.map +1 -1
  58. package/es/template/app-review/player/prop-types.d.ts +2 -0
  59. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  60. package/es/template/app-review/prop-types.d.ts +2 -0
  61. package/es/template/app-review/prop-types.d.ts.map +1 -1
  62. package/es/template/back-office/brand-update/index.d.ts +12 -0
  63. package/es/template/common/dashboard/index.d.ts +4 -0
  64. package/es/template/common/search-page/index.d.ts +2 -0
  65. package/es/template/external-course/index.d.ts +2 -0
  66. package/es/util/check-is-mobile.js +3 -2
  67. package/es/util/check-is-mobile.js.map +1 -1
  68. package/es/util/external-content.d.ts +4 -38
  69. package/es/util/external-content.d.ts.map +1 -1
  70. package/es/util/external-content.js +4 -33
  71. package/es/util/external-content.js.map +1 -1
  72. package/es/variables/colors.d.ts +0 -5
  73. package/es/variables/colors.d.ts.map +1 -1
  74. package/es/variables/colors.js +1 -6
  75. package/es/variables/colors.js.map +1 -1
  76. package/lib/atom/input-search/index.d.ts +2 -0
  77. package/lib/atom/input-search/index.d.ts.map +1 -1
  78. package/lib/atom/input-search/index.js +46 -13
  79. package/lib/atom/input-search/index.js.map +1 -1
  80. package/lib/atom/input-search/style.css +97 -0
  81. package/lib/molecule/card/customer.css +3 -0
  82. package/lib/molecule/card/favorite.d.ts.map +1 -1
  83. package/lib/molecule/card/favorite.js +0 -5
  84. package/lib/molecule/card/favorite.js.map +1 -1
  85. package/lib/molecule/card/index.d.ts.map +1 -1
  86. package/lib/molecule/card/index.js +10 -28
  87. package/lib/molecule/card/index.js.map +1 -1
  88. package/lib/molecule/card/notification.css +16 -39
  89. package/lib/molecule/card/notification.d.ts.map +1 -1
  90. package/lib/molecule/card/notification.js +3 -25
  91. package/lib/molecule/card/notification.js.map +1 -1
  92. package/lib/molecule/card/style.css +14 -16
  93. package/lib/molecule/card-content/index.d.ts.map +1 -1
  94. package/lib/molecule/card-content/index.js +34 -77
  95. package/lib/molecule/card-content/index.js.map +1 -1
  96. package/lib/molecule/card-content/style.css +24 -32
  97. package/lib/molecule/cm-popin/types.d.ts +2 -0
  98. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  99. package/lib/molecule/external-content-button/style.css +0 -1
  100. package/lib/molecule/multi-filter-panel/index.d.ts +2 -0
  101. package/lib/molecule/multi-filter-panel/index.d.ts.map +1 -1
  102. package/lib/molecule/multi-filter-panel/prop-types.d.ts +2 -0
  103. package/lib/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
  104. package/lib/molecule/search-form/index.d.ts +5 -0
  105. package/lib/molecule/search-form/index.d.ts.map +1 -1
  106. package/lib/molecule/search-form/index.js +27 -17
  107. package/lib/molecule/search-form/index.js.map +1 -1
  108. package/lib/molecule/search-form/style.css +21 -6
  109. package/lib/organism/brand-table/index.d.ts +2 -0
  110. package/lib/organism/content-skill-modal/index.d.ts +4 -0
  111. package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
  112. package/lib/organism/content-skill-modal/types.d.ts +4 -0
  113. package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
  114. package/lib/organism/filter-checkbox-and-search/index.d.ts +2 -0
  115. package/lib/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
  116. package/lib/organism/filter-checkbox-and-search/props-types.d.ts +2 -0
  117. package/lib/organism/filter-checkbox-and-search/props-types.d.ts.map +1 -1
  118. package/lib/organism/list-items/index.d.ts +2 -0
  119. package/lib/organism/mooc-header/index.d.ts +14 -0
  120. package/lib/organism/mooc-header/index.d.ts.map +1 -1
  121. package/lib/organism/mooc-header/index.js +132 -13
  122. package/lib/organism/mooc-header/index.js.map +1 -1
  123. package/lib/organism/mooc-header/style.css +184 -8
  124. package/lib/template/app-player/loading/index.d.ts +2 -0
  125. package/lib/template/app-player/player/index.d.ts +4 -0
  126. package/lib/template/app-player/player/slides/index.d.ts +2 -0
  127. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  128. package/lib/template/app-player/popin-correction/index.d.ts +2 -0
  129. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  130. package/lib/template/app-player/popin-end/index.d.ts +2 -0
  131. package/lib/template/app-review/index.d.ts +2 -0
  132. package/lib/template/app-review/index.d.ts.map +1 -1
  133. package/lib/template/app-review/player/prop-types.d.ts +2 -0
  134. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  135. package/lib/template/app-review/prop-types.d.ts +2 -0
  136. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  137. package/lib/template/back-office/brand-update/index.d.ts +12 -0
  138. package/lib/template/common/dashboard/index.d.ts +4 -0
  139. package/lib/template/common/search-page/index.d.ts +2 -0
  140. package/lib/template/external-course/index.d.ts +2 -0
  141. package/lib/util/check-is-mobile.js +3 -2
  142. package/lib/util/check-is-mobile.js.map +1 -1
  143. package/lib/util/external-content.d.ts +4 -38
  144. package/lib/util/external-content.d.ts.map +1 -1
  145. package/lib/util/external-content.js +5 -34
  146. package/lib/util/external-content.js.map +1 -1
  147. package/lib/variables/colors.d.ts +0 -5
  148. package/lib/variables/colors.d.ts.map +1 -1
  149. package/lib/variables/colors.js +1 -6
  150. package/lib/variables/colors.js.map +1 -1
  151. package/locales/en/global.json +4 -4
  152. package/package.json +2 -2
@@ -20,15 +20,11 @@ export declare const COLORS: {
20
20
  readonly yellow_100: "#FFF9D1";
21
21
  readonly red_700: "#A30000";
22
22
  readonly red_100: "#FFD1D1";
23
- readonly cm_violet_podcast: "#432ba7";
24
23
  readonly cm_turquoise_strong: "#1B7B88";
25
24
  readonly yellow_500: "#FFCE0A";
26
25
  readonly neutral_75: " #F4F4F5";
27
26
  readonly neutral_400: " #9999A8";
28
27
  readonly neutral_500: "#515161";
29
- readonly cm_red_video: "#E8335E";
30
- readonly cm_bleu_article: "#365FCD";
31
- readonly cm_yellow_scorm: "#FFB800";
32
28
  readonly negative_700: "#B81400";
33
29
  readonly cm_orange_800: "#A32700";
34
30
  readonly purple_700: "#2B00A3";
@@ -38,7 +34,6 @@ export declare const COLORS: {
38
34
  readonly orange_100: "#FFDCD1";
39
35
  readonly cm_positive_500: "#35CC7F";
40
36
  readonly purple_500: "#4B0AFF";
41
- readonly cm_grey_200: "#D7D7DA";
42
37
  };
43
38
  export declare type Colors = typeof COLORS;
44
39
  //# sourceMappingURL=colors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/variables/colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCT,CAAC;AAEX,oBAAY,MAAM,GAAG,OAAO,MAAM,CAAC"}
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/variables/colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCT,CAAC;AAEX,oBAAY,MAAM,GAAG,OAAO,MAAM,CAAC"}
@@ -20,15 +20,11 @@ export const COLORS = {
20
20
  yellow_100: '#FFF9D1',
21
21
  red_700: '#A30000',
22
22
  red_100: '#FFD1D1',
23
- cm_violet_podcast: '#432ba7',
24
23
  cm_turquoise_strong: '#1B7B88',
25
24
  yellow_500: '#FFCE0A',
26
25
  neutral_75: ' #F4F4F5',
27
26
  neutral_400: ' #9999A8',
28
27
  neutral_500: '#515161',
29
- cm_red_video: '#E8335E',
30
- cm_bleu_article: '#365FCD',
31
- cm_yellow_scorm: '#FFB800',
32
28
  negative_700: '#B81400',
33
29
  cm_orange_800: '#A32700',
34
30
  purple_700: '#2B00A3',
@@ -37,7 +33,6 @@ export const COLORS = {
37
33
  pink_100: '#FAD6DE',
38
34
  orange_100: '#FFDCD1',
39
35
  cm_positive_500: '#35CC7F',
40
- purple_500: '#4B0AFF',
41
- cm_grey_200: '#D7D7DA'
36
+ purple_500: '#4B0AFF'
42
37
  };
43
38
  //# sourceMappingURL=colors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"colors.js","names":["COLORS","cm_grey_100","negative","cm_negative_200","cm_positive_200","white","cm_blue_50","cm_grey_400","cm_grey_800","cm_grey_150","cm_primary_blue","cm_blue_700","primary_100","primary_600","cm_grey_500","cm_grey_700","cm_yellow_400","brand","yellow_700","yellow_100","red_700","red_100","cm_violet_podcast","cm_turquoise_strong","yellow_500","neutral_75","neutral_400","neutral_500","cm_red_video","cm_bleu_article","cm_yellow_scorm","negative_700","cm_orange_800","purple_700","purple_100","turquoise_100","pink_100","orange_100","cm_positive_500","purple_500","cm_grey_200"],"sources":["../../src/variables/colors.ts"],"sourcesContent":["export const COLORS = {\n cm_grey_100: '#EAEAEB',\n negative: '#ed3436',\n cm_negative_200: '#B81400',\n cm_positive_200: '#05944F',\n white: '#FFFFFF',\n cm_blue_50: '#f1f6fe',\n cm_grey_400: '#9999A8',\n cm_grey_800: '#171721',\n cm_grey_150: '#E1E1E3',\n cm_primary_blue: '#0061FF',\n cm_blue_700: '#0042AD',\n primary_100: '#D6E6FF',\n primary_600: '#0051D6',\n cm_grey_500: '#9999A8',\n cm_grey_700: '#1D1D2B',\n cm_yellow_400: '#bd7e00',\n brand: '#00B0FF',\n yellow_700: '#A38300',\n yellow_100: '#FFF9D1',\n red_700: '#A30000',\n red_100: '#FFD1D1',\n cm_violet_podcast: '#432ba7',\n cm_turquoise_strong: '#1B7B88',\n yellow_500: '#FFCE0A',\n neutral_75: ' #F4F4F5',\n neutral_400: ' #9999A8',\n neutral_500: '#515161',\n cm_red_video: '#E8335E',\n cm_bleu_article: '#365FCD',\n cm_yellow_scorm: '#FFB800',\n negative_700: '#B81400',\n cm_orange_800: '#A32700',\n purple_700: '#2B00A3',\n purple_100: '#DDD1FF',\n turquoise_100: '#D9F4F7',\n pink_100: '#FAD6DE',\n orange_100: '#FFDCD1',\n cm_positive_500: '#35CC7F',\n purple_500: '#4B0AFF',\n cm_grey_200: '#D7D7DA'\n} as const;\n\nexport type Colors = typeof COLORS;\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,WAAW,EAAE,SAAS;EACtBC,QAAQ,EAAE,SAAS;EACnBC,eAAe,EAAE,SAAS;EAC1BC,eAAe,EAAE,SAAS;EAC1BC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,eAAe,EAAE,SAAS;EAC1BC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,SAAS;EACxBC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,iBAAiB,EAAE,SAAS;EAC5BC,mBAAmB,EAAE,SAAS;EAC9BC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,UAAU;EACtBC,WAAW,EAAE,UAAU;EACvBC,WAAW,EAAE,SAAS;EACtBC,YAAY,EAAE,SAAS;EACvBC,eAAe,EAAE,SAAS;EAC1BC,eAAe,EAAE,SAAS;EAC1BC,YAAY,EAAE,SAAS;EACvBC,aAAa,EAAE,SAAS;EACxBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,aAAa,EAAE,SAAS;EACxBC,QAAQ,EAAE,SAAS;EACnBC,UAAU,EAAE,SAAS;EACrBC,eAAe,EAAE,SAAS;EAC1BC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE;AACf,CAAU","ignoreList":[]}
1
+ {"version":3,"file":"colors.js","names":["COLORS","cm_grey_100","negative","cm_negative_200","cm_positive_200","white","cm_blue_50","cm_grey_400","cm_grey_800","cm_grey_150","cm_primary_blue","cm_blue_700","primary_100","primary_600","cm_grey_500","cm_grey_700","cm_yellow_400","brand","yellow_700","yellow_100","red_700","red_100","cm_turquoise_strong","yellow_500","neutral_75","neutral_400","neutral_500","negative_700","cm_orange_800","purple_700","purple_100","turquoise_100","pink_100","orange_100","cm_positive_500","purple_500"],"sources":["../../src/variables/colors.ts"],"sourcesContent":["export const COLORS = {\n cm_grey_100: '#EAEAEB',\n negative: '#ed3436',\n cm_negative_200: '#B81400',\n cm_positive_200: '#05944F',\n white: '#FFFFFF',\n cm_blue_50: '#f1f6fe',\n cm_grey_400: '#9999A8',\n cm_grey_800: '#171721',\n cm_grey_150: '#E1E1E3',\n cm_primary_blue: '#0061FF',\n cm_blue_700: '#0042AD',\n primary_100: '#D6E6FF',\n primary_600: '#0051D6',\n cm_grey_500: '#9999A8',\n cm_grey_700: '#1D1D2B',\n cm_yellow_400: '#bd7e00',\n brand: '#00B0FF',\n yellow_700: '#A38300',\n yellow_100: '#FFF9D1',\n red_700: '#A30000',\n red_100: '#FFD1D1',\n cm_turquoise_strong: '#1B7B88',\n yellow_500: '#FFCE0A',\n neutral_75: ' #F4F4F5',\n neutral_400: ' #9999A8',\n neutral_500: '#515161',\n negative_700: '#B81400',\n cm_orange_800: '#A32700',\n purple_700: '#2B00A3',\n purple_100: '#DDD1FF',\n turquoise_100: '#D9F4F7',\n pink_100: '#FAD6DE',\n orange_100: '#FFDCD1',\n cm_positive_500: '#35CC7F',\n purple_500: '#4B0AFF'\n} as const;\n\nexport type Colors = typeof COLORS;\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,WAAW,EAAE,SAAS;EACtBC,QAAQ,EAAE,SAAS;EACnBC,eAAe,EAAE,SAAS;EAC1BC,eAAe,EAAE,SAAS;EAC1BC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,eAAe,EAAE,SAAS;EAC1BC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,SAAS;EACxBC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,mBAAmB,EAAE,SAAS;EAC9BC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,UAAU;EACtBC,WAAW,EAAE,UAAU;EACvBC,WAAW,EAAE,SAAS;EACtBC,YAAY,EAAE,SAAS;EACvBC,aAAa,EAAE,SAAS;EACxBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,aAAa,EAAE,SAAS;EACxBC,QAAQ,EAAE,SAAS;EACnBC,UAAU,EAAE,SAAS;EACrBC,eAAe,EAAE,SAAS;EAC1BC,UAAU,EAAE;AACd,CAAU","ignoreList":[]}
@@ -31,6 +31,8 @@ declare namespace Search {
31
31
  const onClear: PropTypes.Requireable<(...args: any[]) => any>;
32
32
  const onFocus: PropTypes.Requireable<(...args: any[]) => any>;
33
33
  const onBlur: PropTypes.Requireable<(...args: any[]) => any>;
34
+ const onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
35
+ const inputRef: PropTypes.Requireable<(...args: any[]) => any>;
34
36
  const theme: PropTypes.Requireable<string>;
35
37
  const dataTestId: PropTypes.Requireable<string>;
36
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";AAYA,iDAkDC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";AAiBA,iDAoFC"}
@@ -13,6 +13,10 @@ var _style = _interopRequireDefault(require("./style.css"));
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ const handleMouseDown = e => {
17
+ e.preventDefault();
18
+ e.stopPropagation();
19
+ };
16
20
  const Search = props => {
17
21
  const {
18
22
  value,
@@ -21,27 +25,53 @@ const Search = props => {
21
25
  onClear = _noop2.default,
22
26
  onFocus,
23
27
  onBlur,
28
+ onKeyDown,
29
+ inputRef,
24
30
  theme = 'default',
25
31
  dataTestId
26
32
  } = props;
27
33
  const handleChange = (0, _react.useMemo)(() => e => onChange(e.target.value), [onChange]);
28
- const cmStyle = (0, _classnames.default)(_style.default.coorpmanager);
29
- const isDefaultTheme = theme === 'default';
34
+ const handleKeyDown = (0, _react.useMemo)(() => e => {
35
+ if (onKeyDown) {
36
+ onKeyDown(e);
37
+ }
38
+ }, [onKeyDown]);
39
+ const isCoorpManager = theme === 'coorpmanager';
40
+ const isMooc = theme === 'mooc';
41
+ const isDefault = theme === 'default';
42
+ const wrapperClass = (0, _classnames.default)({
43
+ [_style.default.wrapperSearch]: isDefault,
44
+ [_style.default.coorpmanager]: isCoorpManager,
45
+ [_style.default.wrapperMooc]: isMooc
46
+ });
47
+ const wrapperParentClass = (0, _classnames.default)({
48
+ [_style.default.wrapperMoocParent]: isMooc
49
+ });
50
+ const searchClass = (0, _classnames.default)({
51
+ [_style.default.search]: true,
52
+ [_style.default.moocSearch]: isMooc
53
+ });
54
+ const SearchIconComponent = isCoorpManager ? _novaIcons.NovaCompositionCoorpacademySearchThin : _novaIcons.NovaCompositionCoorpacademySearch;
55
+ const showTitle = isCoorpManager;
56
+ const showClearIcon = value && isCoorpManager;
30
57
  return /*#__PURE__*/_react.default.createElement("div", {
31
- className: isDefaultTheme ? _style.default.wrapperSearch : cmStyle
58
+ className: wrapperParentClass
59
+ }, /*#__PURE__*/_react.default.createElement("div", {
60
+ className: wrapperClass
32
61
  }, /*#__PURE__*/_react.default.createElement("label", {
33
62
  htmlFor: "search",
34
63
  title: placeholder
35
- }, !isDefaultTheme ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademySearchThin, {
36
- className: _style.default.searchIcon
37
- }) : /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademySearch, {
38
- className: _style.default.searchIcon
39
- }), !isDefaultTheme ? /*#__PURE__*/_react.default.createElement("span", {
64
+ }, /*#__PURE__*/_react.default.createElement(SearchIconComponent, {
65
+ className: _style.default.searchIcon,
66
+ "data-name": "search-icon",
67
+ onMouseDown: handleMouseDown
68
+ }), showTitle ? /*#__PURE__*/_react.default.createElement("span", {
40
69
  className: (0, _classnames.default)(_style.default.title, (0, _isEmpty2.default)(value) && _style.default.noValue)
41
70
  }, placeholder) : null), /*#__PURE__*/_react.default.createElement("input", {
71
+ ref: inputRef,
42
72
  "data-name": "search-input",
43
73
  "data-testid": dataTestId,
44
- className: _style.default.search,
74
+ className: searchClass,
45
75
  "aria-label": placeholder,
46
76
  type: "text",
47
77
  name: "search",
@@ -52,11 +82,12 @@ const Search = props => {
52
82
  onInput: handleChange,
53
83
  onFocus: onFocus,
54
84
  onChange: _noop2.default,
55
- onBlur: onBlur
56
- }), value && !isDefaultTheme ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidStatusClose, {
85
+ onBlur: onBlur,
86
+ onKeyDown: handleKeyDown
87
+ }), showClearIcon ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidStatusClose, {
57
88
  onClick: onClear,
58
89
  className: _style.default.clearIcon
59
- }) : null);
90
+ }) : null));
60
91
  };
61
92
  Search.contextTypes = {
62
93
  skin: _provider.default.childContextTypes.skin
@@ -68,7 +99,9 @@ Search.propTypes = process.env.NODE_ENV !== "production" ? {
68
99
  onClear: _propTypes.default.func,
69
100
  onFocus: _propTypes.default.func,
70
101
  onBlur: _propTypes.default.func,
71
- theme: _propTypes.default.oneOf(['default', 'coorpmanager']),
102
+ onKeyDown: _propTypes.default.func,
103
+ inputRef: _propTypes.default.func,
104
+ theme: _propTypes.default.oneOf(['default', 'coorpmanager', 'mooc']),
72
105
  dataTestId: _propTypes.default.string
73
106
  } : {};
74
107
  var _default = exports.default = Search;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_classnames","_novaIcons","_provider","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Search","props","value","placeholder","onChange","_noop2","onClear","onFocus","onBlur","theme","dataTestId","handleChange","useMemo","target","cmStyle","classnames","style","coorpmanager","isDefaultTheme","createElement","className","wrapperSearch","htmlFor","title","NovaCompositionCoorpacademySearchThin","searchIcon","NovaCompositionCoorpacademySearch","_isEmpty2","noValue","search","type","name","id","onInput","NovaSolidStatusClose","onClick","clearIcon","contextTypes","skin","Provider","childContextTypes","propTypes","process","env","NODE_ENV","PropTypes","string","isRequired","func","oneOf","_default","exports"],"sources":["../../../src/atom/input-search/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademySearchThin as CMSearchIcon,\n NovaCompositionCoorpacademySearch as SearchIcon,\n NovaSolidStatusClose as CloseIcon\n} from '@coorpacademy/nova-icons';\nimport {noop, isEmpty} from 'lodash/fp';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst Search = props => {\n const {\n value,\n placeholder,\n onChange = noop,\n onClear = noop,\n onFocus,\n onBlur,\n theme = 'default',\n dataTestId\n } = props;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const cmStyle = classnames(style.coorpmanager);\n const isDefaultTheme = theme === 'default';\n\n return (\n <div className={isDefaultTheme ? style.wrapperSearch : cmStyle}>\n <label htmlFor=\"search\" title={placeholder}>\n {!isDefaultTheme ? (\n <CMSearchIcon className={style.searchIcon} />\n ) : (\n <SearchIcon className={style.searchIcon} />\n )}\n {!isDefaultTheme ? (\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {placeholder}\n </span>\n ) : null}\n </label>\n <input\n data-name=\"search-input\"\n data-testid={dataTestId}\n className={style.search}\n aria-label={placeholder}\n type=\"text\"\n name=\"search\"\n id=\"search\"\n placeholder={placeholder}\n title={placeholder}\n value={value}\n onInput={handleChange}\n onFocus={onFocus}\n onChange={noop}\n onBlur={onBlur}\n />\n {value && !isDefaultTheme ? (\n <CloseIcon onClick={onClear} className={style.clearIcon} />\n ) : null}\n </div>\n );\n};\n\nSearch.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearch.propTypes = {\n value: PropTypes.string,\n placeholder: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n onClear: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n theme: PropTypes.oneOf(['default', 'coorpmanager']),\n dataTestId: PropTypes.string\n};\n\nexport default Search;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAMA,IAAAK,SAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAAgC,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAA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OAAQ;IAACc,SAAS,EAAEJ,cAAK,CAACoB;EAAU,CAAE,CAAC,GACzD,IACD,CAAC;AAEV,CAAC;AAEDpC,MAAM,CAACqC,YAAY,GAAG;EACpBC,IAAI,EAAEC,iBAAQ,CAACC,iBAAiB,CAACF;AACnC,CAAC;AAEDtC,MAAM,CAACyC,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACjB1C,KAAK,EAAE2C,kBAAS,CAACC,MAAM;EACvB3C,WAAW,EAAE0C,kBAAS,CAACC,MAAM,CAACC,UAAU;EACxC3C,QAAQ,EAAEyC,kBAAS,CAACG,IAAI;EACxB1C,OAAO,EAAEuC,kBAAS,CAACG,IAAI;EACvBzC,OAAO,EAAEsC,kBAAS,CAACG,IAAI;EACvBxC,MAAM,EAAEqC,kBAAS,CAACG,IAAI;EACtBvC,KAAK,EAAEoC,kBAAS,CAACI,KAAK,CAAC,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;EACnDvC,UAAU,EAAEmC,kBAAS,CAACC;AACxB,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAjE,OAAA,GAEac,MAAM","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_classnames","_novaIcons","_provider","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","handleMouseDown","preventDefault","stopPropagation","Search","props","value","placeholder","onChange","_noop2","onClear","onFocus","onBlur","onKeyDown","inputRef","theme","dataTestId","handleChange","useMemo","target","handleKeyDown","isCoorpManager","isMooc","isDefault","wrapperClass","classnames","style","wrapperSearch","coorpmanager","wrapperMooc","wrapperParentClass","wrapperMoocParent","searchClass","search","moocSearch","SearchIconComponent","CMSearchIcon","SearchIcon","showTitle","showClearIcon","createElement","className","htmlFor","title","searchIcon","onMouseDown","_isEmpty2","noValue","ref","type","name","id","onInput","NovaSolidStatusClose","onClick","clearIcon","contextTypes","skin","Provider","childContextTypes","propTypes","process","env","NODE_ENV","PropTypes","string","isRequired","func","oneOf","_default","exports"],"sources":["../../../src/atom/input-search/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademySearchThin as CMSearchIcon,\n NovaCompositionCoorpacademySearch as SearchIcon,\n NovaSolidStatusClose as CloseIcon\n} from '@coorpacademy/nova-icons';\nimport {noop, isEmpty} from 'lodash/fp';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst handleMouseDown = e => {\n e.preventDefault();\n e.stopPropagation();\n};\n\nconst Search = props => {\n const {\n value,\n placeholder,\n onChange = noop,\n onClear = noop,\n onFocus,\n onBlur,\n onKeyDown,\n inputRef,\n theme = 'default',\n dataTestId\n } = props;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n\n const handleKeyDown = useMemo(\n () => e => {\n if (onKeyDown) {\n onKeyDown(e);\n }\n },\n [onKeyDown]\n );\n\n const isCoorpManager = theme === 'coorpmanager';\n const isMooc = theme === 'mooc';\n const isDefault = theme === 'default';\n\n const wrapperClass = classnames({\n [style.wrapperSearch]: isDefault,\n [style.coorpmanager]: isCoorpManager,\n [style.wrapperMooc]: isMooc\n });\n\n const wrapperParentClass = classnames({\n [style.wrapperMoocParent]: isMooc\n });\n\n const searchClass = classnames({\n [style.search]: true,\n [style.moocSearch]: isMooc\n });\n\n const SearchIconComponent = isCoorpManager ? CMSearchIcon : SearchIcon;\n const showTitle = isCoorpManager;\n const showClearIcon = value && isCoorpManager;\n\n return (\n <div className={wrapperParentClass}>\n <div className={wrapperClass}>\n <label htmlFor=\"search\" title={placeholder}>\n <SearchIconComponent\n className={style.searchIcon}\n data-name=\"search-icon\"\n onMouseDown={handleMouseDown}\n />\n {showTitle ? (\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {placeholder}\n </span>\n ) : null}\n </label>\n <input\n ref={inputRef}\n data-name=\"search-input\"\n data-testid={dataTestId}\n className={searchClass}\n aria-label={placeholder}\n type=\"text\"\n name=\"search\"\n id=\"search\"\n placeholder={placeholder}\n title={placeholder}\n value={value}\n onInput={handleChange}\n onFocus={onFocus}\n onChange={noop}\n onBlur={onBlur}\n onKeyDown={handleKeyDown}\n />\n {showClearIcon ? <CloseIcon onClick={onClear} className={style.clearIcon} /> : null}\n </div>\n </div>\n );\n};\n\nSearch.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearch.propTypes = {\n value: PropTypes.string,\n placeholder: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n onClear: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n onKeyDown: PropTypes.func,\n inputRef: PropTypes.func,\n theme: PropTypes.oneOf(['default', 'coorpmanager', 'mooc']),\n dataTestId: PropTypes.string\n};\n\nexport default Search;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAMA,IAAAK,SAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAAgC,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA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AAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACjBzD,KAAK,EAAE0D,kBAAS,CAACC,MAAM;EACvB1D,WAAW,EAAEyD,kBAAS,CAACC,MAAM,CAACC,UAAU;EACxC1D,QAAQ,EAAEwD,kBAAS,CAACG,IAAI;EACxBzD,OAAO,EAAEsD,kBAAS,CAACG,IAAI;EACvBxD,OAAO,EAAEqD,kBAAS,CAACG,IAAI;EACvBvD,MAAM,EAAEoD,kBAAS,CAACG,IAAI;EACtBtD,SAAS,EAAEmD,kBAAS,CAACG,IAAI;EACzBrD,QAAQ,EAAEkD,kBAAS,CAACG,IAAI;EACxBpD,KAAK,EAAEiD,kBAAS,CAACI,KAAK,CAAC,CAAC,SAAS,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;EAC3DpD,UAAU,EAAEgD,kBAAS,CAACC;AACxB,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAnF,OAAA,GAEaiB,MAAM","ignoreList":[]}
@@ -8,11 +8,13 @@
8
8
  @value white from colors;
9
9
  @value dark from colors;
10
10
  @value black from colors;
11
+ @value cm_grey_75 from colors;
11
12
  @value cm_grey_100 from colors;
12
13
  @value cm_grey_150 from colors;
13
14
  @value cm_grey_400 from colors;
14
15
  @value cm_grey_500 from colors;
15
16
  @value cm_grey_700 from colors;
17
+ @value brand from colors;
16
18
 
17
19
  .wrapperSearch {
18
20
  display: flex;
@@ -66,6 +68,7 @@
66
68
  color: medium;
67
69
  }
68
70
 
71
+ /* Theme: coorpmanager */
69
72
  .coorpmanager {
70
73
  position: relative;
71
74
  }
@@ -177,6 +180,65 @@
177
180
  line-height: 16px;
178
181
  }
179
182
 
183
+ /* Theme: mooc */
184
+ .wrapperMooc {
185
+ display: flex;
186
+ flex-flow: nowrap;
187
+ flex-direction: row;
188
+ align-items: center;
189
+ overflow: hidden;
190
+ border-radius: 12px;
191
+ transition: box-shadow 0.3s ease-in-out;
192
+ background: cm_grey_100;
193
+ padding: 2px;
194
+ width: 100%;
195
+ flex: 1;
196
+ }
197
+
198
+ .wrapperMoocParent {
199
+ width: 100%;
200
+ flex: 1;
201
+ border-radius: 12px;
202
+ transition: box-shadow 0.3s ease-in-out;
203
+ background: transparent;
204
+ }
205
+
206
+ .moocSearch {
207
+ background-color: cm_grey_100;
208
+ border-radius: 12px;
209
+ height: 44px;
210
+ margin: 0;
211
+ font-family: Gilroy;
212
+ font-size: 14px;
213
+ font-weight: 500;
214
+ color: cm_grey_700;
215
+ padding: 0 0 0 45px;
216
+ padding-right: 48px;
217
+ outline: none;
218
+ }
219
+
220
+ .moocSearch:focus-within {
221
+ background-color: cm_grey_75;
222
+ }
223
+
224
+ .wrapperMoocParent:focus-within .wrapperMooc {
225
+ background: transparent;
226
+ box-shadow: 0 0 0 2px rgba(255,255,255,0), 0 0 0 2px brand;
227
+ }
228
+
229
+ .wrapperMooc:hover {
230
+ box-shadow: 0 0 0 2px brand;
231
+ }
232
+
233
+ .wrapperMooc .clearIcon {
234
+ position: relative;
235
+ right: 26px;
236
+ color: cm_grey_400;
237
+ width: 14px;
238
+ height: 14px;
239
+ cursor: pointer;
240
+ }
241
+
180
242
  input:-webkit-autofill,
181
243
  input:-webkit-autofill:hover,
182
244
  input:-webkit-autofill:focus,
@@ -184,6 +246,21 @@ input:-webkit-autofill:active{
184
246
  -webkit-background-clip: text;
185
247
  }
186
248
 
249
+ /* Correction spécifique pour le thème mooc */
250
+ .moocSearch:-webkit-autofill,
251
+ .moocSearch:-webkit-autofill:hover,
252
+ .moocSearch:-webkit-autofill:focus,
253
+ .moocSearch:-webkit-autofill:active {
254
+ -webkit-box-shadow: 0 0 0 1000px cm_grey_100 inset !important;
255
+ -webkit-text-fill-color: cm_grey_700 !important;
256
+ background-color: cm_grey_100 !important;
257
+ }
258
+
259
+ .wrapperMoocParent:focus-within .moocSearch:-webkit-autofill {
260
+ -webkit-box-shadow: 0 0 0 1000px cm_grey_75 inset !important;
261
+ background-color: cm_grey_75 !important;
262
+ }
263
+
187
264
  @media tablet {
188
265
  .search,
189
266
  input {
@@ -194,6 +271,16 @@ input:-webkit-autofill:active{
194
271
  font-size: 12px;
195
272
  color: medium;
196
273
  }
274
+
275
+ .wrapperMoocParent {
276
+ max-width: 100%;
277
+ box-sizing: border-box;
278
+ }
279
+
280
+ .wrapperMooc {
281
+ max-width: 100%;
282
+ box-sizing: border-box;
283
+ }
197
284
  }
198
285
 
199
286
  @media mobile {
@@ -204,4 +291,14 @@ input:-webkit-autofill:active{
204
291
  .search::placeholder {
205
292
  font-size: 12px;
206
293
  }
294
+
295
+ .wrapperMoocParent {
296
+ max-width: 100%;
297
+ box-sizing: border-box;
298
+ }
299
+
300
+ .wrapperMooc {
301
+ max-width: 100%;
302
+ box-sizing: border-box;
303
+ }
207
304
  }
@@ -47,6 +47,9 @@
47
47
  rgba(0, 0, 0, 0) 20%
48
48
  );
49
49
  }
50
+ .chapterCustomer {
51
+ padding-top: 10px;
52
+ }
50
53
 
51
54
  .coorpmanager.customer.chapterCustomer {
52
55
  padding-top: 0px;
@@ -1 +1 @@
1
- {"version":3,"file":"favorite.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/favorite.js"],"names":[],"mappings":";AAcA;;;;;;;;oCA6IC"}
1
+ {"version":3,"file":"favorite.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/favorite.js"],"names":[],"mappings":";AAcA;;;;;;;;oCAwIC"}
@@ -40,16 +40,11 @@ const Favorite = ({
40
40
  const buttonRef = (0, _react.useRef)(null);
41
41
  const allowToolTip = (0, _react.useMemo)(() => !(0, _isEmpty2.default)(removeFavoriteToolTip) && !(0, _isEmpty2.default)(addFavoriteToolTip), [addFavoriteToolTip, removeFavoriteToolTip]);
42
42
 
43
- // eslint-disable-next-line no-console
44
- console.log('🚀 ~ favorite.js:49 ~ allowToolTip:', allowToolTip);
45
-
46
43
  // to be replaced by useId when React17 is bumped to React18
47
44
  const [favoriteButtonAnchorId] = (0, _react.useState)(allowToolTip ? (0, _uuid.v5)('engaged-battle-', _uuid.v5.URL) : undefined);
48
45
  const toolTipContent = (0, _react.useMemo)(
49
46
  // eslint-disable-next-line no-nested-ternary
50
47
  () => allowToolTip ? favorite ? removeFavoriteToolTip : addFavoriteToolTip : null, [addFavoriteToolTip, favorite, removeFavoriteToolTip, allowToolTip]);
51
- // eslint-disable-next-line no-console
52
- console.log('🚀 ~ favorite.js:63 ~ toolTipContent:', toolTipContent);
53
48
  const [mouseLeaveTimer, setMouseLeaveTimer] = (0, _react.useState)(undefined);
54
49
  const [toolTipIsVisible, setToolTipIsVisible] = (0, _react.useState)(false);
55
50
  const handleMouseOver = (0, _react.useCallback)(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"favorite.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_classnames","_uuid","_novaIcons","_provider","_tooltip","_button","_favorite","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Favorite","favorite","addFavoriteToolTip","removeFavoriteToolTip","className","ariaLabel","onFavoriteClick","_noop2","disabled","legacyContext","skin","GetSkinFromContext","translate","GetTranslateFromContext","handleFavoriteClick","useCallback","stopPropagation","preventDefault","primaryColor","_get2","darkColor","brandColor","buttonRef","useRef","allowToolTip","useMemo","_isEmpty2","console","log","favoriteButtonAnchorId","useState","uuidV5","URL","undefined","toolTipContent","mouseLeaveTimer","setMouseLeaveTimer","toolTipIsVisible","setToolTipIsVisible","handleMouseOver","clearTimeout","_has2","current","focus","handleMouseLeave","setTimeout","blur","handleKeyPress","event","toggleStateOnKeyPress","iconWrapperClassName","classnames","style","selected","icon","createElement","NovaCompositionCoorpacademyCheck","checkIcon","color","width","height","removeFromFavorite","NovaCompositionNavigationMore","moreIcon","addToFavorite","favoriteWrapper","type","buttonContentClassName","onClick","onKeyDown","onMouseLeave","onMouseOver","tabIndex","useButtonTag","useWrapper","fontSize","anchorId","TooltipContent","closeToolTipInformationTextAriaLabel","stickyOnKeyboardNavigation","propTypes","process","env","NODE_ENV","PropTypes","string","bool","func","shape","contextTypes","Provider","childContextTypes","_default","exports"],"sources":["../../../src/molecule/card/favorite.js"],"sourcesContent":["import React, {useCallback, useMemo, useRef, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {v5 as uuidV5} from 'uuid';\nimport {get, has, isEmpty, noop} from 'lodash/fp';\nimport {\n NovaCompositionNavigationMore as MoreIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext, GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip, {toggleStateOnKeyPress} from '../../atom/tooltip';\nimport Button from '../../atom/button';\nimport style from './favorite.css';\n\nconst Favorite = (\n {\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n className,\n 'aria-label': ariaLabel = {},\n onFavoriteClick = noop,\n disabled\n },\n legacyContext\n) => {\n const skin = GetSkinFromContext(legacyContext);\n const translate = GetTranslateFromContext(legacyContext);\n const handleFavoriteClick = useCallback(\n e => {\n e.stopPropagation();\n e.preventDefault();\n if (!disabled) onFavoriteClick(e);\n },\n [disabled, onFavoriteClick]\n );\n\n const primaryColor = get('common.primary', skin);\n const darkColor = get('common.dark', skin);\n const brandColor = get('common.brand', skin);\n\n const buttonRef = useRef(null);\n\n const allowToolTip = useMemo(\n () => !isEmpty(removeFavoriteToolTip) && !isEmpty(addFavoriteToolTip),\n [addFavoriteToolTip, removeFavoriteToolTip]\n );\n\n // eslint-disable-next-line no-console\n console.log('🚀 ~ favorite.js:49 ~ allowToolTip:', allowToolTip);\n\n // to be replaced by useId when React17 is bumped to React18\n const [favoriteButtonAnchorId] = useState(\n allowToolTip ? uuidV5('engaged-battle-', uuidV5.URL) : undefined\n );\n\n const toolTipContent = useMemo(\n // eslint-disable-next-line no-nested-ternary\n () => (allowToolTip ? (favorite ? removeFavoriteToolTip : addFavoriteToolTip) : null),\n [addFavoriteToolTip, favorite, removeFavoriteToolTip, allowToolTip]\n );\n // eslint-disable-next-line no-console\n console.log('🚀 ~ favorite.js:63 ~ toolTipContent:', toolTipContent);\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n /* istanbul ignore next */ has(['current', 'focus'], buttonRef) && buttonRef.current.focus();\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(\n setTimeout(() => {\n setToolTipIsVisible(false);\n // @ts-expect-error (error: blur does not exists on type never)\n /* istanbul ignore next */ has(['current', 'blur'], buttonRef) && buttonRef.current.blur();\n }, 500)\n );\n }, []);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);\n },\n [toolTipIsVisible]\n );\n\n const iconWrapperClassName = useMemo(\n () => classnames(style.favorite, className, favorite && style.selected),\n [className, favorite]\n );\n const icon = useMemo(\n () =>\n favorite ? (\n <CheckIcon\n // eslint-disable-next-line css-modules/no-undef-class\n className={style.checkIcon}\n style={{color: brandColor}}\n width={13}\n height={13}\n data-testid=\"favorite-check-icon\"\n aria-label={ariaLabel.removeFromFavorite}\n />\n ) : (\n <MoreIcon\n className={style.moreIcon}\n style={{color: darkColor}}\n width={13}\n height={13}\n data-testid=\"favorite-add-icon\"\n aria-label={ariaLabel.addToFavorite}\n />\n ),\n [ariaLabel.addToFavorite, ariaLabel.removeFromFavorite, brandColor, darkColor, favorite]\n );\n\n return (\n <div className={style.favoriteWrapper} data-testid=\"favorite-wrapper\">\n <Button\n buttonRef={buttonRef}\n type=\"button\"\n data-for={favoriteButtonAnchorId}\n data-tooltip-place=\"left\"\n data-tip={allowToolTip}\n data-name=\"favorite\"\n data-testid=\"favorite-button\"\n aria-label={ariaLabel.favorite}\n buttonContentClassName={iconWrapperClassName}\n onClick={handleFavoriteClick}\n style={{\n color: primaryColor\n }}\n onKeyDown={handleKeyPress}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n tabIndex={0}\n useButtonTag\n useWrapper={false}\n >\n {icon}\n </Button>\n <ToolTip\n fontSize={12}\n anchorId={favoriteButtonAnchorId}\n toolTipIsVisible={toolTipIsVisible}\n TooltipContent={toolTipContent}\n closeToolTipInformationTextAriaLabel={translate('close_tooltip_information')}\n stickyOnKeyboardNavigation\n />\n </div>\n );\n};\n\nFavorite.propTypes = {\n className: PropTypes.string,\n favorite: PropTypes.bool,\n disabled: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onFavoriteClick: PropTypes.func,\n 'aria-label': PropTypes.shape({\n favorite: PropTypes.string,\n addToFavorite: PropTypes.string,\n removeFromFavorite: PropTypes.string\n })\n};\n\nFavorite.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nexport default Favorite;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AAIA,IAAAM,SAAA,GAAAP,uBAAA,CAAAC,OAAA;AACA,IAAAO,QAAA,GAAAR,uBAAA,CAAAC,OAAA;AACA,IAAAQ,OAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,SAAA,GAAAP,sBAAA,CAAAF,OAAA;AAAmC,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAA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B/E,IAAI,EAAEgF,iBAAQ,CAACC,iBAAiB,CAACjF,IAAI;EACrCE,SAAS,EAAE8E,iBAAQ,CAACC,iBAAiB,CAAC/E;AACxC,CAAC;AAAC,IAAAgF,QAAA,GAAAC,OAAA,CAAA3G,OAAA,GAEac,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"favorite.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_classnames","_uuid","_novaIcons","_provider","_tooltip","_button","_favorite","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Favorite","favorite","addFavoriteToolTip","removeFavoriteToolTip","className","ariaLabel","onFavoriteClick","_noop2","disabled","legacyContext","skin","GetSkinFromContext","translate","GetTranslateFromContext","handleFavoriteClick","useCallback","stopPropagation","preventDefault","primaryColor","_get2","darkColor","brandColor","buttonRef","useRef","allowToolTip","useMemo","_isEmpty2","favoriteButtonAnchorId","useState","uuidV5","URL","undefined","toolTipContent","mouseLeaveTimer","setMouseLeaveTimer","toolTipIsVisible","setToolTipIsVisible","handleMouseOver","clearTimeout","_has2","current","focus","handleMouseLeave","setTimeout","blur","handleKeyPress","event","toggleStateOnKeyPress","iconWrapperClassName","classnames","style","selected","icon","createElement","NovaCompositionCoorpacademyCheck","checkIcon","color","width","height","removeFromFavorite","NovaCompositionNavigationMore","moreIcon","addToFavorite","favoriteWrapper","type","buttonContentClassName","onClick","onKeyDown","onMouseLeave","onMouseOver","tabIndex","useButtonTag","useWrapper","fontSize","anchorId","TooltipContent","closeToolTipInformationTextAriaLabel","stickyOnKeyboardNavigation","propTypes","process","env","NODE_ENV","PropTypes","string","bool","func","shape","contextTypes","Provider","childContextTypes","_default","exports"],"sources":["../../../src/molecule/card/favorite.js"],"sourcesContent":["import React, {useCallback, useMemo, useRef, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {v5 as uuidV5} from 'uuid';\nimport {get, has, isEmpty, noop} from 'lodash/fp';\nimport {\n NovaCompositionNavigationMore as MoreIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext, GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip, {toggleStateOnKeyPress} from '../../atom/tooltip';\nimport Button from '../../atom/button';\nimport style from './favorite.css';\n\nconst Favorite = (\n {\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n className,\n 'aria-label': ariaLabel = {},\n onFavoriteClick = noop,\n disabled\n },\n legacyContext\n) => {\n const skin = GetSkinFromContext(legacyContext);\n const translate = GetTranslateFromContext(legacyContext);\n const handleFavoriteClick = useCallback(\n e => {\n e.stopPropagation();\n e.preventDefault();\n if (!disabled) onFavoriteClick(e);\n },\n [disabled, onFavoriteClick]\n );\n\n const primaryColor = get('common.primary', skin);\n const darkColor = get('common.dark', skin);\n const brandColor = get('common.brand', skin);\n\n const buttonRef = useRef(null);\n\n const allowToolTip = useMemo(\n () => !isEmpty(removeFavoriteToolTip) && !isEmpty(addFavoriteToolTip),\n [addFavoriteToolTip, removeFavoriteToolTip]\n );\n\n // to be replaced by useId when React17 is bumped to React18\n const [favoriteButtonAnchorId] = useState(\n allowToolTip ? uuidV5('engaged-battle-', uuidV5.URL) : undefined\n );\n\n const toolTipContent = useMemo(\n // eslint-disable-next-line no-nested-ternary\n () => (allowToolTip ? (favorite ? removeFavoriteToolTip : addFavoriteToolTip) : null),\n [addFavoriteToolTip, favorite, removeFavoriteToolTip, allowToolTip]\n );\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n /* istanbul ignore next */ has(['current', 'focus'], buttonRef) && buttonRef.current.focus();\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(\n setTimeout(() => {\n setToolTipIsVisible(false);\n // @ts-expect-error (error: blur does not exists on type never)\n /* istanbul ignore next */ has(['current', 'blur'], buttonRef) && buttonRef.current.blur();\n }, 500)\n );\n }, []);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);\n },\n [toolTipIsVisible]\n );\n\n const iconWrapperClassName = useMemo(\n () => classnames(style.favorite, className, favorite && style.selected),\n [className, favorite]\n );\n const icon = useMemo(\n () =>\n favorite ? (\n <CheckIcon\n // eslint-disable-next-line css-modules/no-undef-class\n className={style.checkIcon}\n style={{color: brandColor}}\n width={13}\n height={13}\n data-testid=\"favorite-check-icon\"\n aria-label={ariaLabel.removeFromFavorite}\n />\n ) : (\n <MoreIcon\n className={style.moreIcon}\n style={{color: darkColor}}\n width={13}\n height={13}\n data-testid=\"favorite-add-icon\"\n aria-label={ariaLabel.addToFavorite}\n />\n ),\n [ariaLabel.addToFavorite, ariaLabel.removeFromFavorite, brandColor, darkColor, favorite]\n );\n\n return (\n <div className={style.favoriteWrapper} data-testid=\"favorite-wrapper\">\n <Button\n buttonRef={buttonRef}\n type=\"button\"\n data-for={favoriteButtonAnchorId}\n data-tooltip-place=\"left\"\n data-tip={allowToolTip}\n data-name=\"favorite\"\n data-testid=\"favorite-button\"\n aria-label={ariaLabel.favorite}\n buttonContentClassName={iconWrapperClassName}\n onClick={handleFavoriteClick}\n style={{\n color: primaryColor\n }}\n onKeyDown={handleKeyPress}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n tabIndex={0}\n useButtonTag\n useWrapper={false}\n >\n {icon}\n </Button>\n <ToolTip\n fontSize={12}\n anchorId={favoriteButtonAnchorId}\n toolTipIsVisible={toolTipIsVisible}\n TooltipContent={toolTipContent}\n closeToolTipInformationTextAriaLabel={translate('close_tooltip_information')}\n stickyOnKeyboardNavigation\n />\n </div>\n );\n};\n\nFavorite.propTypes = {\n className: PropTypes.string,\n favorite: PropTypes.bool,\n disabled: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onFavoriteClick: PropTypes.func,\n 'aria-label': PropTypes.shape({\n favorite: PropTypes.string,\n addToFavorite: PropTypes.string,\n removeFromFavorite: PropTypes.string\n })\n};\n\nFavorite.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nexport default Favorite;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AAIA,IAAAM,SAAA,GAAAP,uBAAA,CAAAC,OAAA;AACA,IAAAO,QAAA,GAAAR,uBAAA,CAAAC,OAAA;AACA,IAAAQ,OAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,SAAA,GAAAP,sBAAA,CAAAF,OAAA;AAAmC,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SA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AAuB;IACjCQ,gBAAgB,EAAEA,gBAAiB;IACnCwC,cAAc,EAAE3C,cAAe;IAC/B4C,oCAAoC,EAAEhE,SAAS,CAAC,2BAA2B,CAAE;IAC7EiE,0BAA0B;EAAA,CAC3B,CACE,CAAC;AAEV,CAAC;AAED7E,QAAQ,CAAC8E,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACnB7E,SAAS,EAAE8E,kBAAS,CAACC,MAAM;EAC3BlF,QAAQ,EAAEiF,kBAAS,CAACE,IAAI;EACxB5E,QAAQ,EAAE0E,kBAAS,CAACE,IAAI;EACxBlF,kBAAkB,EAAEgF,kBAAS,CAACC,MAAM;EACpChF,qBAAqB,EAAE+E,kBAAS,CAACC,MAAM;EACvC7E,eAAe,EAAE4E,kBAAS,CAACG,IAAI;EAC/B,YAAY,EAAEH,kBAAS,CAACI,KAAK,CAAC;IAC5BrF,QAAQ,EAAEiF,kBAAS,CAACC,MAAM;IAC1BrB,aAAa,EAAEoB,kBAAS,CAACC,MAAM;IAC/BxB,kBAAkB,EAAEuB,kBAAS,CAACC;EAChC,CAAC;AACH,CAAC;AAEDnF,QAAQ,CAACuF,YAAY,GAAG;EACtB7E,IAAI,EAAE8E,iBAAQ,CAACC,iBAAiB,CAAC/E,IAAI;EACrCE,SAAS,EAAE4E,iBAAQ,CAACC,iBAAiB,CAAC7E;AACxC,CAAC;AAAC,IAAA8E,QAAA,GAAAC,OAAA,CAAAzG,OAAA,GAEac,QAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/index.js"],"names":[],"mappings":";;;;;AA8QA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE;;;AAnKF,uDA+HG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/index.js"],"names":[],"mappings":";;;;;AA2PA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE;;;AAlKF,uDA8HG"}
@@ -14,8 +14,6 @@ var _novaIcons = require("@coorpacademy/nova-icons");
14
14
  var _externalContent = require("../../util/external-content");
15
15
  var _provider = _interopRequireDefault(require("../../atom/provider"));
16
16
  var _cardContent = _interopRequireWildcard(require("../card-content"));
17
- var _icon = _interopRequireDefault(require("../../atom/icon"));
18
- var _colors = require("../../variables/colors");
19
17
  var _customer = _interopRequireDefault(require("./customer"));
20
18
  var _favorite = _interopRequireDefault(require("./favorite"));
21
19
  var _selectable = _interopRequireDefault(require("./selectable"));
@@ -29,7 +27,6 @@ const THEMES = exports.THEMES = {
29
27
  default: null,
30
28
  coorpmanager: _style.default.coorpmanager
31
29
  };
32
- const ICON_SIZE = '28px';
33
30
  const CardBackground = ({
34
31
  type,
35
32
  image,
@@ -41,35 +38,22 @@ const CardBackground = ({
41
38
  const externalContent = (0, _externalContent.isExternalContent)(type);
42
39
  const primaryColor = (0, _get2.default)('common.primary', skin);
43
40
  const whiteColor = (0, _get2.default)('common.white', skin);
44
- if (externalContent && _externalContent.EXTERNAL_CONTENT_ICONS[type] || type === 'chapter') {
45
- const {
46
- iconName,
47
- iconColor
48
- } = _externalContent.ICONS_TYPES[type];
41
+ if (externalContent && _externalContent.EXTERNAL_CONTENT_ICONS[type]) {
42
+ const IconType = _externalContent.EXTERNAL_CONTENT_ICONS[type].icon;
43
+ const iconColor = _externalContent.EXTERNAL_CONTENT_ICONS[type].color;
49
44
  const backgroundIcon = /*#__PURE__*/_react.default.createElement("div", {
50
- className: (0, _classnames.default)(_style.default.externalIconCircleWrapper, _style.default.externalIconCircleWithImageWrapper)
51
- }, /*#__PURE__*/_react.default.createElement(_icon.default, {
52
- iconName: iconName,
53
- customStyle: {
54
- color: _colors.COLORS.white,
55
- height: ICON_SIZE,
56
- width: ICON_SIZE
57
- }
45
+ className: _style.default.externalIconCircleWrapper
46
+ }, /*#__PURE__*/_react.default.createElement(IconType, {
47
+ className: _style.default.externalIcon
58
48
  }));
59
49
  if (image) {
60
50
  const _backgroundIcon = /*#__PURE__*/_react.default.createElement("div", {
61
51
  className: (0, _classnames.default)(_style.default.externalIconCircleWrapper, _style.default.externalIconCircleWithImageWrapper),
62
52
  style: {
63
53
  backgroundColor: iconColor
64
- },
65
- "data-testid": "card-background-image"
66
- }, /*#__PURE__*/_react.default.createElement(_icon.default, {
67
- iconName: iconName,
68
- customStyle: {
69
- color: _colors.COLORS.white,
70
- height: ICON_SIZE,
71
- width: ICON_SIZE
72
54
  }
55
+ }, /*#__PURE__*/_react.default.createElement(IconType, {
56
+ className: _style.default.externalIconWithImage
73
57
  }));
74
58
  return /*#__PURE__*/_react.default.createElement("div", {
75
59
  className: _style.default.imageWrapper
@@ -101,7 +85,7 @@ const CardBackground = ({
101
85
  }
102
86
  }) : null;
103
87
  return /*#__PURE__*/_react.default.createElement("div", {
104
- className: _style.default.imageWrapper
88
+ className: (0, _classnames.default)(_style.default.imageWrapper, type === 'chapter' ? _style.default.chapterImageWrapper : null)
105
89
  }, /*#__PURE__*/_react.default.createElement("div", {
106
90
  "data-name": "cover",
107
91
  "aria-label": ariaLabel,
@@ -158,7 +142,7 @@ const Card = /*#__PURE__*/(0, _react.memo)(function Card(props, context) {
158
142
  } = props;
159
143
  const empty = (0, _isEmpty2.default)((0, _pick2.default)(['title', 'type', 'author', 'image'], props));
160
144
  const primaryColor = (0, _get2.default)('common.primary', skin);
161
- const cardStyle = (0, _classnames.default)(THEMES[theme], _style.default.course, title ? null : _style.default.lazy, _style.default.grid, empty ? _style.default.empty : null);
145
+ const cardStyle = (0, _classnames.default)(THEMES[theme], type === 'chapter' ? _style.default.chapter : _style.default.course, title ? null : _style.default.lazy, _style.default.grid, empty ? _style.default.empty : null);
162
146
  const disabled = hidden && (!isSelected || (0, _isUndefined2.default)(isSelected));
163
147
  const handleClick = (0, _react.useMemo)(() => e => onClick(e), [onClick]);
164
148
  const lock = disabled ? /*#__PURE__*/_react.default.createElement("div", {
@@ -187,8 +171,6 @@ const Card = /*#__PURE__*/(0, _react.memo)(function Card(props, context) {
187
171
  return contentType;
188
172
  }
189
173
  };
190
- // eslint-disable-next-line no-console
191
- console.log('type of card', type, 'favorite', favorite);
192
174
  return /*#__PURE__*/_react.default.createElement("div", {
193
175
  className: cardStyle,
194
176
  "data-name": "card",