@coorpacademy/components 11.38.6-alpha.27 → 11.38.6-alpha.28

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 (161) hide show
  1. package/es/atom/input-search/index.d.ts +0 -2
  2. package/es/atom/input-search/index.d.ts.map +1 -1
  3. package/es/atom/input-search/index.js +13 -46
  4. package/es/atom/input-search/index.js.map +1 -1
  5. package/es/atom/input-search/style.css +0 -96
  6. package/es/molecule/card/customer.css +0 -3
  7. package/es/molecule/card/favorite.css +3 -3
  8. package/es/molecule/card/index.d.ts.map +1 -1
  9. package/es/molecule/card/index.js +27 -11
  10. package/es/molecule/card/index.js.map +1 -1
  11. package/es/molecule/card/notification.css +28 -12
  12. package/es/molecule/card/notification.d.ts.map +1 -1
  13. package/es/molecule/card/notification.js +24 -4
  14. package/es/molecule/card/notification.js.map +1 -1
  15. package/es/molecule/card/style.css +4 -53
  16. package/es/molecule/card-content/index.d.ts.map +1 -1
  17. package/es/molecule/card-content/index.js +59 -37
  18. package/es/molecule/card-content/index.js.map +1 -1
  19. package/es/molecule/card-content/style.css +24 -69
  20. package/es/molecule/cm-popin/types.d.ts +0 -2
  21. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  22. package/es/molecule/external-content-button/style.css +1 -0
  23. package/es/molecule/multi-filter-panel/index.d.ts +0 -2
  24. package/es/molecule/multi-filter-panel/index.d.ts.map +1 -1
  25. package/es/molecule/multi-filter-panel/prop-types.d.ts +0 -2
  26. package/es/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
  27. package/es/molecule/search-form/index.d.ts +0 -5
  28. package/es/molecule/search-form/index.d.ts.map +1 -1
  29. package/es/molecule/search-form/index.js +16 -26
  30. package/es/molecule/search-form/index.js.map +1 -1
  31. package/es/molecule/search-form/style.css +6 -21
  32. package/es/organism/brand-table/index.d.ts +0 -2
  33. package/es/organism/content-skill-modal/index.d.ts +0 -4
  34. package/es/organism/content-skill-modal/index.d.ts.map +1 -1
  35. package/es/organism/content-skill-modal/types.d.ts +0 -4
  36. package/es/organism/content-skill-modal/types.d.ts.map +1 -1
  37. package/es/organism/filter-checkbox-and-search/index.d.ts +0 -2
  38. package/es/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
  39. package/es/organism/filter-checkbox-and-search/props-types.d.ts +0 -2
  40. package/es/organism/filter-checkbox-and-search/props-types.d.ts.map +1 -1
  41. package/es/organism/list-items/index.d.ts +0 -2
  42. package/es/organism/mooc-header/index.d.ts +0 -14
  43. package/es/organism/mooc-header/index.d.ts.map +1 -1
  44. package/es/organism/mooc-header/index.js +12 -123
  45. package/es/organism/mooc-header/index.js.map +1 -1
  46. package/es/organism/mooc-header/style.css +8 -181
  47. package/es/template/app-player/loading/index.d.ts +0 -2
  48. package/es/template/app-player/player/index.d.ts +0 -4
  49. package/es/template/app-player/player/slides/index.d.ts +0 -2
  50. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  51. package/es/template/app-player/popin-correction/index.d.ts +0 -2
  52. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  53. package/es/template/app-player/popin-end/index.d.ts +0 -2
  54. package/es/template/app-review/index.d.ts +0 -2
  55. package/es/template/app-review/index.d.ts.map +1 -1
  56. package/es/template/app-review/player/prop-types.d.ts +0 -2
  57. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  58. package/es/template/app-review/prop-types.d.ts +0 -2
  59. package/es/template/app-review/prop-types.d.ts.map +1 -1
  60. package/es/template/back-office/brand-update/index.d.ts +0 -12
  61. package/es/template/common/dashboard/index.d.ts +0 -4
  62. package/es/template/common/search-page/index.d.ts +0 -2
  63. package/es/template/external-course/index.d.ts +0 -2
  64. package/es/util/check-is-mobile.d.ts +1 -1
  65. package/es/util/check-is-mobile.d.ts.map +1 -1
  66. package/es/util/check-is-mobile.js +2 -4
  67. package/es/util/check-is-mobile.js.map +1 -1
  68. package/es/util/external-content.d.ts +38 -4
  69. package/es/util/external-content.d.ts.map +1 -1
  70. package/es/util/external-content.js +27 -4
  71. package/es/util/external-content.js.map +1 -1
  72. package/es/util/icons.d.ts +8 -0
  73. package/es/util/icons.d.ts.map +1 -0
  74. package/es/util/icons.js +8 -0
  75. package/es/util/icons.js.map +1 -0
  76. package/es/variables/colors.d.ts +5 -0
  77. package/es/variables/colors.d.ts.map +1 -1
  78. package/es/variables/colors.js +6 -1
  79. package/es/variables/colors.js.map +1 -1
  80. package/lib/atom/input-search/index.d.ts +0 -2
  81. package/lib/atom/input-search/index.d.ts.map +1 -1
  82. package/lib/atom/input-search/index.js +13 -46
  83. package/lib/atom/input-search/index.js.map +1 -1
  84. package/lib/atom/input-search/style.css +0 -96
  85. package/lib/molecule/card/customer.css +0 -3
  86. package/lib/molecule/card/favorite.css +3 -3
  87. package/lib/molecule/card/index.d.ts.map +1 -1
  88. package/lib/molecule/card/index.js +26 -10
  89. package/lib/molecule/card/index.js.map +1 -1
  90. package/lib/molecule/card/notification.css +28 -12
  91. package/lib/molecule/card/notification.d.ts.map +1 -1
  92. package/lib/molecule/card/notification.js +23 -3
  93. package/lib/molecule/card/notification.js.map +1 -1
  94. package/lib/molecule/card/style.css +4 -53
  95. package/lib/molecule/card-content/index.d.ts.map +1 -1
  96. package/lib/molecule/card-content/index.js +58 -36
  97. package/lib/molecule/card-content/index.js.map +1 -1
  98. package/lib/molecule/card-content/style.css +24 -69
  99. package/lib/molecule/cm-popin/types.d.ts +0 -2
  100. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  101. package/lib/molecule/external-content-button/style.css +1 -0
  102. package/lib/molecule/multi-filter-panel/index.d.ts +0 -2
  103. package/lib/molecule/multi-filter-panel/index.d.ts.map +1 -1
  104. package/lib/molecule/multi-filter-panel/prop-types.d.ts +0 -2
  105. package/lib/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
  106. package/lib/molecule/search-form/index.d.ts +0 -5
  107. package/lib/molecule/search-form/index.d.ts.map +1 -1
  108. package/lib/molecule/search-form/index.js +17 -27
  109. package/lib/molecule/search-form/index.js.map +1 -1
  110. package/lib/molecule/search-form/style.css +6 -21
  111. package/lib/organism/brand-table/index.d.ts +0 -2
  112. package/lib/organism/content-skill-modal/index.d.ts +0 -4
  113. package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
  114. package/lib/organism/content-skill-modal/types.d.ts +0 -4
  115. package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
  116. package/lib/organism/filter-checkbox-and-search/index.d.ts +0 -2
  117. package/lib/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
  118. package/lib/organism/filter-checkbox-and-search/props-types.d.ts +0 -2
  119. package/lib/organism/filter-checkbox-and-search/props-types.d.ts.map +1 -1
  120. package/lib/organism/list-items/index.d.ts +0 -2
  121. package/lib/organism/mooc-header/index.d.ts +0 -14
  122. package/lib/organism/mooc-header/index.d.ts.map +1 -1
  123. package/lib/organism/mooc-header/index.js +12 -123
  124. package/lib/organism/mooc-header/index.js.map +1 -1
  125. package/lib/organism/mooc-header/style.css +8 -181
  126. package/lib/template/app-player/loading/index.d.ts +0 -2
  127. package/lib/template/app-player/player/index.d.ts +0 -4
  128. package/lib/template/app-player/player/slides/index.d.ts +0 -2
  129. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  130. package/lib/template/app-player/popin-correction/index.d.ts +0 -2
  131. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  132. package/lib/template/app-player/popin-end/index.d.ts +0 -2
  133. package/lib/template/app-review/index.d.ts +0 -2
  134. package/lib/template/app-review/index.d.ts.map +1 -1
  135. package/lib/template/app-review/player/prop-types.d.ts +0 -2
  136. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  137. package/lib/template/app-review/prop-types.d.ts +0 -2
  138. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  139. package/lib/template/back-office/brand-update/index.d.ts +0 -12
  140. package/lib/template/common/dashboard/index.d.ts +0 -4
  141. package/lib/template/common/search-page/index.d.ts +0 -2
  142. package/lib/template/external-course/index.d.ts +0 -2
  143. package/lib/util/check-is-mobile.d.ts +1 -1
  144. package/lib/util/check-is-mobile.d.ts.map +1 -1
  145. package/lib/util/check-is-mobile.js +2 -4
  146. package/lib/util/check-is-mobile.js.map +1 -1
  147. package/lib/util/external-content.d.ts +38 -4
  148. package/lib/util/external-content.d.ts.map +1 -1
  149. package/lib/util/external-content.js +28 -5
  150. package/lib/util/external-content.js.map +1 -1
  151. package/lib/util/icons.d.ts +8 -0
  152. package/lib/util/icons.d.ts.map +1 -0
  153. package/lib/util/icons.js +12 -0
  154. package/lib/util/icons.js.map +1 -0
  155. package/lib/variables/colors.d.ts +5 -0
  156. package/lib/variables/colors.d.ts.map +1 -1
  157. package/lib/variables/colors.js +6 -1
  158. package/lib/variables/colors.js.map +1 -1
  159. package/locales/en/global.json +5 -0
  160. package/locales/lt/global.json +24 -24
  161. package/package.json +2 -2
@@ -31,8 +31,6 @@ 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>;
36
34
  const theme: PropTypes.Requireable<string>;
37
35
  const dataTestId: PropTypes.Requireable<string>;
38
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";AAiBA,iDAoFC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";AAYA,iDAkDC"}
@@ -6,10 +6,6 @@ import classnames from 'classnames';
6
6
  import { NovaCompositionCoorpacademySearchThin as CMSearchIcon, NovaCompositionCoorpacademySearch as SearchIcon, NovaSolidStatusClose as CloseIcon } from '@coorpacademy/nova-icons';
7
7
  import Provider from '../provider';
8
8
  import style from './style.css';
9
- const handleMouseDown = e => {
10
- e.preventDefault();
11
- e.stopPropagation();
12
- };
13
9
  const Search = props => {
14
10
  const {
15
11
  value,
@@ -18,53 +14,27 @@ const Search = props => {
18
14
  onClear = _noop,
19
15
  onFocus,
20
16
  onBlur,
21
- onKeyDown,
22
- inputRef,
23
17
  theme = 'default',
24
18
  dataTestId
25
19
  } = props;
26
20
  const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);
27
- const handleKeyDown = useMemo(() => e => {
28
- if (onKeyDown) {
29
- onKeyDown(e);
30
- }
31
- }, [onKeyDown]);
32
- const isCoorpManager = theme === 'coorpmanager';
33
- const isMooc = theme === 'mooc';
34
- const isDefault = theme === 'default';
35
- const wrapperClass = classnames({
36
- [style.wrapperSearch]: isDefault,
37
- [style.coorpmanager]: isCoorpManager,
38
- [style.wrapperMooc]: isMooc
39
- });
40
- const wrapperParentClass = classnames({
41
- [style.wrapperMoocParent]: isMooc
42
- });
43
- const searchClass = classnames({
44
- [style.search]: true,
45
- [style.moocSearch]: isMooc
46
- });
47
- const SearchIconComponent = isCoorpManager ? CMSearchIcon : SearchIcon;
48
- const showTitle = isCoorpManager;
49
- const showClearIcon = value && isCoorpManager;
21
+ const cmStyle = classnames(style.coorpmanager);
22
+ const isDefaultTheme = theme === 'default';
50
23
  return /*#__PURE__*/React.createElement("div", {
51
- className: wrapperParentClass
52
- }, /*#__PURE__*/React.createElement("div", {
53
- className: wrapperClass
24
+ className: isDefaultTheme ? style.wrapperSearch : cmStyle
54
25
  }, /*#__PURE__*/React.createElement("label", {
55
26
  htmlFor: "search",
56
27
  title: placeholder
57
- }, /*#__PURE__*/React.createElement(SearchIconComponent, {
58
- className: style.searchIcon,
59
- "data-name": "search-icon",
60
- onMouseDown: handleMouseDown
61
- }), showTitle ? /*#__PURE__*/React.createElement("span", {
28
+ }, !isDefaultTheme ? /*#__PURE__*/React.createElement(CMSearchIcon, {
29
+ className: style.searchIcon
30
+ }) : /*#__PURE__*/React.createElement(SearchIcon, {
31
+ className: style.searchIcon
32
+ }), !isDefaultTheme ? /*#__PURE__*/React.createElement("span", {
62
33
  className: classnames(style.title, _isEmpty(value) && style.noValue)
63
34
  }, placeholder) : null), /*#__PURE__*/React.createElement("input", {
64
- ref: inputRef,
65
35
  "data-name": "search-input",
66
36
  "data-testid": dataTestId,
67
- className: searchClass,
37
+ className: style.search,
68
38
  "aria-label": placeholder,
69
39
  type: "text",
70
40
  name: "search",
@@ -75,12 +45,11 @@ const Search = props => {
75
45
  onInput: handleChange,
76
46
  onFocus: onFocus,
77
47
  onChange: _noop,
78
- onBlur: onBlur,
79
- onKeyDown: handleKeyDown
80
- }), showClearIcon ? /*#__PURE__*/React.createElement(CloseIcon, {
48
+ onBlur: onBlur
49
+ }), value && !isDefaultTheme ? /*#__PURE__*/React.createElement(CloseIcon, {
81
50
  onClick: onClear,
82
51
  className: style.clearIcon
83
- }) : null));
52
+ }) : null);
84
53
  };
85
54
  Search.contextTypes = {
86
55
  skin: Provider.childContextTypes.skin
@@ -92,9 +61,7 @@ Search.propTypes = process.env.NODE_ENV !== "production" ? {
92
61
  onClear: PropTypes.func,
93
62
  onFocus: PropTypes.func,
94
63
  onBlur: PropTypes.func,
95
- onKeyDown: PropTypes.func,
96
- inputRef: PropTypes.func,
97
- theme: PropTypes.oneOf(['default', 'coorpmanager', 'mooc']),
64
+ theme: PropTypes.oneOf(['default', 'coorpmanager']),
98
65
  dataTestId: PropTypes.string
99
66
  } : {};
100
67
  export default Search;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","NovaCompositionCoorpacademySearchThin","CMSearchIcon","NovaCompositionCoorpacademySearch","SearchIcon","NovaSolidStatusClose","CloseIcon","Provider","style","handleMouseDown","e","preventDefault","stopPropagation","Search","props","value","placeholder","onChange","_noop","onClear","onFocus","onBlur","onKeyDown","inputRef","theme","dataTestId","handleChange","target","handleKeyDown","isCoorpManager","isMooc","isDefault","wrapperClass","wrapperSearch","coorpmanager","wrapperMooc","wrapperParentClass","wrapperMoocParent","searchClass","search","moocSearch","SearchIconComponent","showTitle","showClearIcon","createElement","className","htmlFor","title","searchIcon","onMouseDown","_isEmpty","noValue","ref","type","name","id","onInput","onClick","clearIcon","contextTypes","skin","childContextTypes","propTypes","process","env","NODE_ENV","string","isRequired","func","oneOf"],"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,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,qCAAqC,IAAIC,YAAY,EACrDC,iCAAiC,IAAIC,UAAU,EAC/CC,oBAAoB,IAAIC,SAAS,QAC5B,0BAA0B;AAEjC,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,eAAe,GAAGC,CAAC,IAAI;EAC3BA,CAAC,CAACC,cAAc,CAAC,CAAC;EAClBD,CAAC,CAACE,eAAe,CAAC,CAAC;AACrB,CAAC;AAED,MAAMC,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IACJC,KAAK;IACLC,WAAW;IACXC,QAAQ,GAAAC,KAAO;IACfC,OAAO,GAAAD,KAAO;IACdE,OAAO;IACPC,MAAM;IACNC,SAAS;IAC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AAM;EACvBlD,WAAW,EAAEjB,SAAS,CAACmE,MAAM,CAACC,UAAU;EACxClD,QAAQ,EAAElB,SAAS,CAACqE,IAAI;EACxBjD,OAAO,EAAEpB,SAAS,CAACqE,IAAI;EACvBhD,OAAO,EAAErB,SAAS,CAACqE,IAAI;EACvB/C,MAAM,EAAEtB,SAAS,CAACqE,IAAI;EACtB9C,SAAS,EAAEvB,SAAS,CAACqE,IAAI;EACzB7C,QAAQ,EAAExB,SAAS,CAACqE,IAAI;EACxB5C,KAAK,EAAEzB,SAAS,CAACsE,KAAK,CAAC,CAAC,SAAS,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;EAC3D5C,UAAU,EAAE1B,SAAS,CAACmE;AACxB,CAAC;AAED,eAAerD,MAAM","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","NovaCompositionCoorpacademySearchThin","CMSearchIcon","NovaCompositionCoorpacademySearch","SearchIcon","NovaSolidStatusClose","CloseIcon","Provider","style","Search","props","value","placeholder","onChange","_noop","onClear","onFocus","onBlur","theme","dataTestId","handleChange","e","target","cmStyle","coorpmanager","isDefaultTheme","createElement","className","wrapperSearch","htmlFor","title","searchIcon","_isEmpty","noValue","search","type","name","id","onInput","onClick","clearIcon","contextTypes","skin","childContextTypes","propTypes","process","env","NODE_ENV","string","isRequired","func","oneOf"],"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,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,qCAAqC,IAAIC,YAAY,EACrDC,iCAAiC,IAAIC,UAAU,EAC/CC,oBAAoB,IAAIC,SAAS,QAC5B,0BAA0B;AAEjC,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IACJC,KAAK;IACLC,WAAW;IACXC,QAAQ,GAAAC,KAAO;IACfC,OAAO,GAAAD,KAAO;IACdE,OA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a;IACtBJ,OAAO,EAAEA,OAAQ;IACjBH,QAAQ,EAAAC,KAAO;IACfG,MAAM,EAAEA;EAAO,CAChB,CAAC,EACDN,KAAK,IAAI,CAACc,cAAc,gBACvB5B,KAAA,CAAA6B,aAAA,CAACpB,SAAS;IAACiC,OAAO,EAAExB,OAAQ;IAACY,SAAS,EAAEnB,KAAK,CAACgC;EAAU,CAAE,CAAC,GACzD,IACD,CAAC;AAEV,CAAC;AAED/B,MAAM,CAACgC,YAAY,GAAG;EACpBC,IAAI,EAAEnC,QAAQ,CAACoC,iBAAiB,CAACD;AACnC,CAAC;AAEDjC,MAAM,CAACmC,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACjBpC,KAAK,EAAEZ,SAAS,CAACiD,MAAM;EACvBpC,WAAW,EAAEb,SAAS,CAACiD,MAAM,CAACC,UAAU;EACxCpC,QAAQ,EAAEd,SAAS,CAACmD,IAAI;EACxBnC,OAAO,EAAEhB,SAAS,CAACmD,IAAI;EACvBlC,OAAO,EAAEjB,SAAS,CAACmD,IAAI;EACvBjC,MAAM,EAAElB,SAAS,CAACmD,IAAI;EACtBhC,KAAK,EAAEnB,SAAS,CAACoD,KAAK,CAAC,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;EACnDhC,UAAU,EAAEpB,SAAS,CAACiD;AACxB,CAAC;AAED,eAAevC,MAAM","ignoreList":[]}
@@ -8,13 +8,11 @@
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;
12
11
  @value cm_grey_100 from colors;
13
12
  @value cm_grey_150 from colors;
14
13
  @value cm_grey_400 from colors;
15
14
  @value cm_grey_500 from colors;
16
15
  @value cm_grey_700 from colors;
17
- @value brand from colors;
18
16
 
19
17
  .wrapperSearch {
20
18
  display: flex;
@@ -68,7 +66,6 @@
68
66
  color: medium;
69
67
  }
70
68
 
71
- /* Theme: coorpmanager */
72
69
  .coorpmanager {
73
70
  position: relative;
74
71
  }
@@ -180,65 +177,6 @@
180
177
  line-height: 16px;
181
178
  }
182
179
 
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
-
242
180
  input:-webkit-autofill,
243
181
  input:-webkit-autofill:hover,
244
182
  input:-webkit-autofill:focus,
@@ -246,20 +184,6 @@ input:-webkit-autofill:active{
246
184
  -webkit-background-clip: text;
247
185
  }
248
186
 
249
- .moocSearch:-webkit-autofill,
250
- .moocSearch:-webkit-autofill:hover,
251
- .moocSearch:-webkit-autofill:focus,
252
- .moocSearch:-webkit-autofill:active {
253
- -webkit-box-shadow: 0 0 0 1000px cm_grey_100 inset !important;
254
- -webkit-text-fill-color: cm_grey_700 !important;
255
- background-color: cm_grey_100 !important;
256
- }
257
-
258
- .wrapperMoocParent:focus-within .moocSearch:-webkit-autofill {
259
- -webkit-box-shadow: 0 0 0 1000px cm_grey_75 inset !important;
260
- background-color: cm_grey_75 !important;
261
- }
262
-
263
187
  @media tablet {
264
188
  .search,
265
189
  input {
@@ -270,16 +194,6 @@ input:-webkit-autofill:active{
270
194
  font-size: 12px;
271
195
  color: medium;
272
196
  }
273
-
274
- .wrapperMoocParent {
275
- max-width: 100%;
276
- box-sizing: border-box;
277
- }
278
-
279
- .wrapperMooc {
280
- max-width: 100%;
281
- box-sizing: border-box;
282
- }
283
197
  }
284
198
 
285
199
  @media mobile {
@@ -290,14 +204,4 @@ input:-webkit-autofill:active{
290
204
  .search::placeholder {
291
205
  font-size: 12px;
292
206
  }
293
-
294
- .wrapperMoocParent {
295
- max-width: 100%;
296
- box-sizing: border-box;
297
- }
298
-
299
- .wrapperMooc {
300
- max-width: 100%;
301
- box-sizing: border-box;
302
- }
303
207
  }
@@ -47,9 +47,6 @@
47
47
  rgba(0, 0, 0, 0) 20%
48
48
  );
49
49
  }
50
- .chapterCustomer {
51
- padding-top: 10px;
52
- }
53
50
 
54
51
  .coorpmanager.customer.chapterCustomer {
55
52
  padding-top: 0px;
@@ -8,8 +8,8 @@
8
8
  @value black from colors;
9
9
 
10
10
  .favorite {
11
- width: 24px;
12
- height: 24px;
11
+ width: 36px;
12
+ height: 36px;
13
13
  position: absolute;
14
14
  right: 8px;
15
15
  top: 8px;
@@ -19,7 +19,7 @@
19
19
  line-height: 0px;
20
20
  box-shadow: 0 0 13px 0 rgba(0, 0, 0, 0.11);
21
21
  background-color: #ffffff;
22
- border-radius: 100%;
22
+ border-radius: 8px;
23
23
  border: none;
24
24
  padding: 0;
25
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/index.js"],"names":[],"mappings":";;;;;AA2PA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE;;;AAlKF,uDA8HG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/index.js"],"names":[],"mappings":";;;;;AA4QA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE;;;AAjKF,uDA6HG"}
@@ -8,9 +8,11 @@ import React, { useMemo, memo } from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import classnames from 'classnames';
10
10
  import { NovaCompositionCoorpacademyPadlock as LockIcon, NovaCompositionCoorpacademyPictures as PicturesIcon } from '@coorpacademy/nova-icons';
11
- import { isExternalContent, EXTERNAL_CONTENT_ICONS } from '../../util/external-content';
11
+ import { isExternalContent, ICONS_TYPES, EXTERNAL_CONTENT_ICONS } from '../../util/external-content';
12
12
  import Provider from '../../atom/provider';
13
13
  import CardContentInfo, { MODES } from '../card-content';
14
+ import FaIcon from '../../atom/icon';
15
+ import { COLORS } from '../../variables/colors';
14
16
  import Customer from './customer';
15
17
  import Favorite from './favorite';
16
18
  import Selectable from './selectable';
@@ -20,6 +22,7 @@ export const THEMES = {
20
22
  default: null,
21
23
  coorpmanager: style.coorpmanager
22
24
  };
25
+ const ICON_SIZE = '28px';
23
26
  const CardBackground = ({
24
27
  type,
25
28
  image,
@@ -31,22 +34,35 @@ const CardBackground = ({
31
34
  const externalContent = isExternalContent(type);
32
35
  const primaryColor = _get('common.primary', skin);
33
36
  const whiteColor = _get('common.white', skin);
34
- if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {
35
- const IconType = EXTERNAL_CONTENT_ICONS[type].icon;
36
- const iconColor = EXTERNAL_CONTENT_ICONS[type].color;
37
+ if (externalContent && EXTERNAL_CONTENT_ICONS[type] || type === 'chapter') {
38
+ const {
39
+ iconName,
40
+ iconColor
41
+ } = ICONS_TYPES[type];
37
42
  const backgroundIcon = /*#__PURE__*/React.createElement("div", {
38
- className: style.externalIconCircleWrapper
39
- }, /*#__PURE__*/React.createElement(IconType, {
40
- className: style.externalIcon
43
+ className: classnames(style.externalIconCircleWrapper, style.externalIconCircleWithImageWrapper)
44
+ }, /*#__PURE__*/React.createElement(FaIcon, {
45
+ iconName: iconName,
46
+ customStyle: {
47
+ color: COLORS.white,
48
+ height: ICON_SIZE,
49
+ width: ICON_SIZE
50
+ }
41
51
  }));
42
52
  if (image) {
43
53
  const _backgroundIcon = /*#__PURE__*/React.createElement("div", {
44
54
  className: classnames(style.externalIconCircleWrapper, style.externalIconCircleWithImageWrapper),
45
55
  style: {
46
56
  backgroundColor: iconColor
57
+ },
58
+ "data-testid": "card-background-image"
59
+ }, /*#__PURE__*/React.createElement(FaIcon, {
60
+ iconName: iconName,
61
+ customStyle: {
62
+ color: COLORS.white,
63
+ height: ICON_SIZE,
64
+ width: ICON_SIZE
47
65
  }
48
- }, /*#__PURE__*/React.createElement(IconType, {
49
- className: style.externalIconWithImage
50
66
  }));
51
67
  return /*#__PURE__*/React.createElement("div", {
52
68
  className: style.imageWrapper
@@ -78,7 +94,7 @@ const CardBackground = ({
78
94
  }
79
95
  }) : null;
80
96
  return /*#__PURE__*/React.createElement("div", {
81
- className: classnames(style.imageWrapper, type === 'chapter' ? style.chapterImageWrapper : null)
97
+ className: style.imageWrapper
82
98
  }, /*#__PURE__*/React.createElement("div", {
83
99
  "data-name": "cover",
84
100
  "aria-label": ariaLabel,
@@ -135,7 +151,7 @@ const Card = /*#__PURE__*/memo(function Card(props, context) {
135
151
  } = props;
136
152
  const empty = _isEmpty(_pick(['title', 'type', 'author', 'image'], props));
137
153
  const primaryColor = _get('common.primary', skin);
138
- const cardStyle = classnames(THEMES[theme], type === 'chapter' ? style.chapter : style.course, title ? null : style.lazy, style.grid, empty ? style.empty : null);
154
+ const cardStyle = classnames(THEMES[theme], style.course, title ? null : style.lazy, style.grid, empty ? style.empty : null);
139
155
  const disabled = hidden && (!isSelected || _isUndefined(isSelected));
140
156
  const handleClick = useMemo(() => e => onClick(e), [onClick]);
141
157
  const lock = disabled ? /*#__PURE__*/React.createElement("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","memo","PropTypes","classnames","NovaCompositionCoorpacademyPadlock","LockIcon","NovaCompositionCoorpacademyPictures","PicturesIcon","isExternalContent","EXTERNAL_CONTENT_ICONS","Provider","CardContentInfo","MODES","Customer","Favorite","Selectable","Notification","style","THEMES","default","coorpmanager","CardBackground","type","image","empty","ariaLabel","skin","externalContent","primaryColor","_get","whiteColor","IconType","icon","iconColor","color","backgroundIcon","createElement","className","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","bool","Card","props","context","badge","adaptiv","disabled","hidden","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","disabledContent","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","_isEmpty","_pick","cardStyle","chapter","course","lazy","grid","_isUndefined","handleClick","e","lock","lockContent","lockIcon","height","dangerouslySetInnerHTML","__html","inlineBadgeStyle","getType","contentType","_extends","mode","CARD","lockWrapper","cardPropTypes","shape","number","func","oneOf","_keys"],"sources":["../../../src/molecule/card/index.js"],"sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? (\n <PicturesIcon className={style.emptyIcon} style={{color: whiteColor}} />\n ) : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled: hidden = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n disabledContent,\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const cardStyle = classnames(\n THEMES[theme],\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const disabled = hidden && (!isSelected || isUndefined(isSelected));\n const handleClick = useMemo(() => e => onClick(e), [onClick]);\n const lock = disabled ? (\n <div className={style.lockContent}>\n <LockIcon className={style.lockIcon} height={48} />\n <span\n aria-label={disabledArialabel}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: disabledContent}}\n />\n </div>\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} hidden={hidden} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport const cardPropTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n disabledContent: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\n\nCard.propTypes = cardPropTypes;\n\nexport default Card;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,IAAI,QAAO,OAAO;AAC1C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,kCAAkC,IAAIC,QAAQ,EAC9CC,mCAAmC,IAAIC,YAAY,QAC9C,0BAA0B;AACjC,SAAQC,iBAAiB,EAAEC,sBAAsB,QAAO,6BAA6B;AACrF,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,eAAe,IAAGC,KAAK,QAAO,iBAAiB;AACtD,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,KAAK,MAAM,aAAa;AAE/B,OAAO,MAAMC,MAAM,GAAG;EACpBC,OAAO,EAAE,IAAI;EACbC,YAAY,EAAEH,KAAK,CAACG;AACtB,CAAC;AAED,MAAMC,cAAc,GAAGA,CAAC;EAACC,IAAI;EAAEC,KAAK;EAAEC,KAAK;EAAE,YAAY,EAAEC;AAAS,CAAC,EAAE;EAACC;AAAI,CAAC,KAAK;EAChF,MAAMC,eAAe,GAAGnB,iBAAiB,CAACc,IAAI,CAAC;EAC/C,MAAMM,YAAY,GAAGC,IAAA,CAAI,gBAAgB,EAAEH,IAAI,CAAC;EAChD,MAAMI,UAAU,GAAGD,IAAA,CAAI,cAAc,EAAEH,IAAI,CAAC;EAE5C,IAAIC,eAAe,IAAIlB,sBAAsB,CAACa,IAAI,CAAC,EAAE;IACnD,MAAMS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C,QAAQ,CAACsC,SAAS,CAAC,YAAY,CAAC;EACvD,uBAAuB,EAAErC,UAAU,CAACqC,SAAS,CAAC,YAAY,CAAC;EAC3D,qBAAqB,EAAEvC,QAAQ,CAACuC,SAAS,CAAC,YAAY,CAAC;EACvD,kBAAkB,EAAElD,SAAS,CAACsD,MAAM;EACpC,qBAAqB,EAAEtD,SAAS,CAACsD,MAAM;EACvC,yBAAyB,EAAE7C,eAAe,CAACyC,SAAS,CAAC,YAAY;AACnE,CAAC;AAEDM,IAAI,CAACN,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGyD,aAAa;AAE9B,eAAetD,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useMemo","memo","PropTypes","classnames","NovaCompositionCoorpacademyPadlock","LockIcon","NovaCompositionCoorpacademyPictures","PicturesIcon","isExternalContent","ICONS_TYPES","EXTERNAL_CONTENT_ICONS","Provider","CardContentInfo","MODES","FaIcon","COLORS","Customer","Favorite","Selectable","Notification","style","THEMES","default","coorpmanager","ICON_SIZE","CardBackground","type","image","empty","ariaLabel","skin","externalContent","primaryColor","_get","whiteColor","iconName","iconColor","backgroundIcon","createElement","className","externalIconCircleWrapper","externalIconCircleWithImageWrapper","customStyle","color","white","height","width","_backgroundIcon","backgroundColor","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","bool","Card","props","context","badge","adaptiv","disabled","hidden","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","disabledContent","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","_isEmpty","_pick","cardStyle","course","lazy","grid","_isUndefined","handleClick","e","lock","lockContent","lockIcon","dangerouslySetInnerHTML","__html","inlineBadgeStyle","getType","contentType","_extends","mode","CARD","lockWrapper","cardPropTypes","shape","number","func","oneOf","_keys"],"sources":["../../../src/molecule/card/index.js"],"sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, ICONS_TYPES, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport FaIcon from '../../atom/icon';\nimport {COLORS} from '../../variables/colors';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst ICON_SIZE = '28px';\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if ((externalContent && EXTERNAL_CONTENT_ICONS[type]) || type === 'chapter') {\n const {iconName, iconColor} = ICONS_TYPES[type];\n const backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n >\n <FaIcon\n iconName={iconName}\n customStyle={{\n color: COLORS.white,\n height: ICON_SIZE,\n width: ICON_SIZE\n }}\n />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n data-testid=\"card-background-image\"\n >\n <FaIcon\n iconName={iconName}\n customStyle={{\n color: COLORS.white,\n height: ICON_SIZE,\n width: ICON_SIZE\n }}\n />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? (\n <PicturesIcon className={style.emptyIcon} style={{color: whiteColor}} />\n ) : null;\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled: hidden = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n disabledContent,\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const cardStyle = classnames(\n THEMES[theme],\n style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const disabled = hidden && (!isSelected || isUndefined(isSelected));\n const handleClick = useMemo(() => e => onClick(e), [onClick]);\n const lock = disabled ? (\n <div className={style.lockContent}>\n <LockIcon className={style.lockIcon} height={48} />\n <span\n aria-label={disabledArialabel}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: disabledContent}}\n />\n </div>\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} hidden={hidden} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport const cardPropTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n disabledContent: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\n\nCard.propTypes = cardPropTypes;\n\nexport default Card;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,IAAI,QAAO,OAAO;AAC1C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,kCAAkC,IAAIC,QAAQ,EAC9CC,mCAAmC,IAAIC,YAAY,QAC9C,0BAA0B;AACjC,SAAQC,iBAAiB,EAAEC,WAAW,EAAEC,sBAAsB,QAAO,6BAA6B;AAClG,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,eAAe,IAAGC,KAAK,QAAO,iBAAiB;AACtD,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,QAAQ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":[]}
@@ -5,13 +5,16 @@
5
5
  @value grey from colors;
6
6
  @value dark from colors;
7
7
  @value white from colors;
8
+ @value cm_blue_700 from colors;
9
+ @value primary_100 from colors;
10
+ @value cm_grey_75 from colors;
8
11
 
9
12
  .notificationWrapper {
10
13
  width: 100%;
11
14
  height: 100%;
12
15
  top: 0;
13
16
  left: 0;
14
- background: color(dark a(75%));
17
+ background: rgba(29, 29, 43, 0.5);
15
18
  position: absolute;
16
19
  z-index: 0;
17
20
  opacity: 0;
@@ -19,17 +22,22 @@
19
22
  }
20
23
 
21
24
  .notification {
22
- width: 100px;
23
- height: 100px;
25
+ width: 156px;
24
26
  background: light;
25
27
  position: absolute;
26
28
  top: 50%;
27
29
  left: 50%;
28
- margin: -50px 0 0 -50px;
29
- border-radius: 7px;
30
- padding: 12px 7px 7px;
30
+ margin: -78px 0 0 -78px;
31
+ border-radius: 12px;
32
+ padding: 16px;
31
33
  box-sizing: border-box;
32
34
  color: grey;
35
+ background: cm_grey_75;
36
+ align-items: center;
37
+ display: flex;
38
+ gap: 12px;
39
+ justify-content: center;
40
+ flex-direction: column;
33
41
  }
34
42
 
35
43
  .showOverlay .notification {
@@ -42,21 +50,29 @@
42
50
 
43
51
  .notification .icon {
44
52
  font-size: 30px;
45
- height: 30px;
46
- width: 100%;
53
+ height: 20px;
54
+ width: 15px;
55
+ }
56
+
57
+ .iconWrapper {
58
+ width: 32px;
59
+ height: 32px;
60
+ padding: 8px;
61
+ display: flex;
62
+ justify-content: center;
63
+ align-items: center;
64
+ border-radius: 12px;
47
65
  }
48
66
 
49
67
  .message {
50
- width: 100%;
51
- height: 50px;
52
- line-height: 50px;
68
+ line-height: 20px;
53
69
  }
54
70
 
55
71
  .message span {
56
72
  display: inline-block;
57
73
  vertical-align: middle;
58
74
  user-select: none;
59
- line-height: 16px;
75
+ line-height: 20px;
60
76
  font-size: 14px;
61
77
  font-family: 'Gilroy';
62
78
  text-align: center;
@@ -1 +1 @@
1
- {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/notification.js"],"names":[],"mappings":";AAyBA,uDAmBC"}
1
+ {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/notification.js"],"names":[],"mappings":";AA+BA,uDAqBC"}
@@ -3,14 +3,25 @@ import _get from "lodash/fp/get";
3
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import classnames from 'classnames';
6
- import { NovaCompositionNavigationMore as MoreIcon, NovaSolidLoginLocked as LockIcon, NovaSolidLocksLockUnlock1 as UnlockIcon, NovaCompositionCoorpacademyCheck as CheckIcon } from '@coorpacademy/nova-icons';
6
+ import { NovaSolidLoginLocked as LockIcon, NovaSolidLocksLockUnlock1 as UnlockIcon, NovaCompositionCoorpacademyCheck as CheckIcon, NovaSolidStatusClose as CloseIcon } from '@coorpacademy/nova-icons';
7
+ import { COLORS } from '../../variables/colors';
7
8
  import style from './notification.css';
8
9
  const NOTIFICATION_ICON = {
9
10
  addFavorite: CheckIcon,
10
- removeFavorite: MoreIcon,
11
+ removeFavorite: CloseIcon,
11
12
  lock: LockIcon,
12
13
  unlock: UnlockIcon
13
14
  };
15
+ const NOTIFICATIONS_COLORS = {
16
+ addFavorite: {
17
+ color: COLORS.cm_blue_700,
18
+ backgroundColor: COLORS.primary_100
19
+ },
20
+ removeFavorite: {
21
+ color: COLORS.neutral_500,
22
+ backgroundColor: COLORS.cm_grey_100
23
+ }
24
+ };
14
25
  const handleOverlayClick = e => {
15
26
  e.stopPropagation();
16
27
  e.preventDefault();
@@ -22,6 +33,10 @@ const Notification = props => {
22
33
  icon
23
34
  } = props;
24
35
  const IconType = _get(icon, NOTIFICATION_ICON);
36
+ const {
37
+ color,
38
+ backgroundColor
39
+ } = _get(icon, NOTIFICATIONS_COLORS);
25
40
  return /*#__PURE__*/React.createElement("div", {
26
41
  "data-name": "notification",
27
42
  "data-type": icon,
@@ -29,13 +44,18 @@ const Notification = props => {
29
44
  className: classnames(style.showOverlay, style.notificationWrapper)
30
45
  }, /*#__PURE__*/React.createElement("div", {
31
46
  className: style.notification
47
+ }, /*#__PURE__*/React.createElement("div", {
48
+ className: style.iconWrapper,
49
+ style: {
50
+ backgroundColor
51
+ }
32
52
  }, /*#__PURE__*/React.createElement(IconType, {
33
53
  className: style.icon,
34
54
  style: {
35
- color: null
55
+ color
36
56
  },
37
57
  stroke: null
38
- }), /*#__PURE__*/React.createElement("div", {
58
+ })), /*#__PURE__*/React.createElement("div", {
39
59
  className: style.message
40
60
  }, /*#__PURE__*/React.createElement("span", {
41
61
  role: "status"