@coorpacademy/components 10.3.28 → 10.3.32-alpha.14

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 (117) hide show
  1. package/es/atom/clue/test/see-clue.js +33 -0
  2. package/es/atom/clue/test/see-clue.js.map +1 -1
  3. package/es/atom/content-badge/test/fixtures.js +2 -0
  4. package/es/atom/content-badge/test/fixtures.js.map +1 -1
  5. package/es/atom/input-switch/test/fixtures.js +10 -0
  6. package/es/atom/input-switch/test/fixtures.js.map +1 -1
  7. package/es/atom/loader/test/fixtures.js +2 -0
  8. package/es/atom/loader/test/fixtures.js.map +1 -1
  9. package/es/atom/provider/index.js +1 -1
  10. package/es/atom/provider/index.js.map +1 -1
  11. package/es/molecule/banner/style.css +1 -0
  12. package/es/molecule/banner/test/fixtures/default.js +1 -1
  13. package/es/molecule/banner/test/fixtures/default.js.map +1 -1
  14. package/es/molecule/banner/test/fixtures.js +8 -0
  15. package/es/molecule/banner/test/fixtures.js.map +1 -1
  16. package/es/molecule/card/customer.css +61 -3
  17. package/es/molecule/card/customer.js +17 -5
  18. package/es/molecule/card/customer.js.map +1 -1
  19. package/es/molecule/card/index.js +25 -12
  20. package/es/molecule/card/index.js.map +1 -1
  21. package/es/molecule/card/style.css +86 -24
  22. package/es/molecule/card/test/fixtures/coorpmanager.js +18 -0
  23. package/es/molecule/card/test/fixtures/coorpmanager.js.map +1 -0
  24. package/es/molecule/card/test/fixtures.js +2 -0
  25. package/es/molecule/card/test/fixtures.js.map +1 -1
  26. package/es/molecule/card-content/index.js +33 -18
  27. package/es/molecule/card-content/index.js.map +1 -1
  28. package/es/molecule/card-content/style.css +56 -0
  29. package/es/molecule/cm-popin/style.css +1 -0
  30. package/es/molecule/cockpit-popin/test/fixtures.js +17 -0
  31. package/es/molecule/cockpit-popin/test/fixtures.js.map +1 -0
  32. package/es/molecule/select-multiple/test/fixtures.js +8 -0
  33. package/es/molecule/select-multiple/test/fixtures.js.map +1 -1
  34. package/es/molecule/vertical-tabs/test/fixtures.js +2 -0
  35. package/es/molecule/vertical-tabs/test/fixtures.js.map +1 -1
  36. package/es/molecule/wizard-summary/style.css +1 -0
  37. package/es/organism/content-translation/test/fixtures.js +15 -0
  38. package/es/organism/content-translation/test/fixtures.js.map +1 -0
  39. package/es/organism/course-selection/test/fixtures/default.js +29 -7
  40. package/es/organism/course-selection/test/fixtures/default.js.map +1 -1
  41. package/es/organism/course-selection/test/fixtures.js +2 -0
  42. package/es/organism/course-selection/test/fixtures.js.map +1 -1
  43. package/es/organism/list-item/test/fixtures.js +19 -0
  44. package/es/organism/list-item/test/fixtures.js.map +1 -0
  45. package/es/organism/list-items/test/fixtures/published.js +1 -1
  46. package/es/organism/list-items/test/fixtures/published.js.map +1 -1
  47. package/es/organism/list-items/test/fixtures.js +17 -0
  48. package/es/organism/list-items/test/fixtures.js.map +1 -0
  49. package/es/organism/mooc-footer/style.css +1 -0
  50. package/es/organism/wizard-contents/style.css +4 -6
  51. package/es/organism/wizard-contents/test/fixtures.js +21 -0
  52. package/es/organism/wizard-contents/test/fixtures.js.map +1 -0
  53. package/es/template/back-office/brand-update/index.js +1 -1
  54. package/es/template/back-office/brand-update/index.js.map +1 -1
  55. package/es/template/back-office/brand-update/test/fixtures/wizard-form-create-playlist.js +49 -0
  56. package/es/template/back-office/brand-update/test/fixtures/wizard-form-create-playlist.js.map +1 -1
  57. package/es/template/back-office/brand-update/test/fixtures.js +20 -2
  58. package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
  59. package/lib/atom/clue/test/see-clue.js +34 -0
  60. package/lib/atom/clue/test/see-clue.js.map +1 -1
  61. package/lib/atom/content-badge/test/fixtures.js +3 -0
  62. package/lib/atom/content-badge/test/fixtures.js.map +1 -1
  63. package/lib/atom/input-switch/test/fixtures.js +15 -0
  64. package/lib/atom/input-switch/test/fixtures.js.map +1 -1
  65. package/lib/atom/loader/test/fixtures.js +3 -0
  66. package/lib/atom/loader/test/fixtures.js.map +1 -1
  67. package/lib/atom/provider/index.js +1 -1
  68. package/lib/atom/provider/index.js.map +1 -1
  69. package/lib/molecule/banner/style.css +1 -0
  70. package/lib/molecule/banner/test/fixtures/default.js +1 -1
  71. package/lib/molecule/banner/test/fixtures/default.js.map +1 -1
  72. package/lib/molecule/banner/test/fixtures.js +12 -0
  73. package/lib/molecule/banner/test/fixtures.js.map +1 -1
  74. package/lib/molecule/card/customer.css +61 -3
  75. package/lib/molecule/card/customer.js +22 -6
  76. package/lib/molecule/card/customer.js.map +1 -1
  77. package/lib/molecule/card/index.js +29 -13
  78. package/lib/molecule/card/index.js.map +1 -1
  79. package/lib/molecule/card/style.css +86 -24
  80. package/lib/molecule/card/test/fixtures/coorpmanager.js +28 -0
  81. package/lib/molecule/card/test/fixtures/coorpmanager.js.map +1 -0
  82. package/lib/molecule/card/test/fixtures.js +3 -0
  83. package/lib/molecule/card/test/fixtures.js.map +1 -1
  84. package/lib/molecule/card-content/index.js +36 -19
  85. package/lib/molecule/card-content/index.js.map +1 -1
  86. package/lib/molecule/card-content/style.css +56 -0
  87. package/lib/molecule/cm-popin/style.css +1 -0
  88. package/lib/molecule/cockpit-popin/test/fixtures.js +28 -0
  89. package/lib/molecule/cockpit-popin/test/fixtures.js.map +1 -0
  90. package/lib/molecule/select-multiple/test/fixtures.js +12 -0
  91. package/lib/molecule/select-multiple/test/fixtures.js.map +1 -1
  92. package/lib/molecule/vertical-tabs/test/fixtures.js +3 -0
  93. package/lib/molecule/vertical-tabs/test/fixtures.js.map +1 -1
  94. package/lib/molecule/wizard-summary/style.css +1 -0
  95. package/lib/organism/content-translation/test/fixtures.js +25 -0
  96. package/lib/organism/content-translation/test/fixtures.js.map +1 -0
  97. package/lib/organism/course-selection/test/fixtures/default.js +30 -7
  98. package/lib/organism/course-selection/test/fixtures/default.js.map +1 -1
  99. package/lib/organism/course-selection/test/fixtures.js +3 -0
  100. package/lib/organism/course-selection/test/fixtures.js.map +1 -1
  101. package/lib/organism/list-item/test/fixtures.js +31 -0
  102. package/lib/organism/list-item/test/fixtures.js.map +1 -0
  103. package/lib/organism/list-items/test/fixtures/published.js +1 -1
  104. package/lib/organism/list-items/test/fixtures/published.js.map +1 -1
  105. package/lib/organism/list-items/test/fixtures.js +28 -0
  106. package/lib/organism/list-items/test/fixtures.js.map +1 -0
  107. package/lib/organism/mooc-footer/style.css +1 -0
  108. package/lib/organism/wizard-contents/style.css +4 -6
  109. package/lib/organism/wizard-contents/test/fixtures.js +34 -0
  110. package/lib/organism/wizard-contents/test/fixtures.js.map +1 -0
  111. package/lib/template/back-office/brand-update/index.js +1 -1
  112. package/lib/template/back-office/brand-update/index.js.map +1 -1
  113. package/lib/template/back-office/brand-update/test/fixtures/wizard-form-create-playlist.js +49 -0
  114. package/lib/template/back-office/brand-update/test/fixtures/wizard-form-create-playlist.js.map +1 -1
  115. package/lib/template/back-office/brand-update/test/fixtures.js +30 -3
  116. package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
  117. package/package.json +2 -2
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.default = void 0;
4
+ exports.default = exports.THEMES = void 0;
5
+
6
+ var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
5
7
 
6
8
  var _pick2 = _interopRequireDefault(require("lodash/fp/pick"));
7
9
 
@@ -43,10 +45,17 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
43
45
 
44
46
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
45
47
 
48
+ const THEMES = {
49
+ default: null,
50
+ coorpmanager: _style.default.coorpmanager
51
+ };
52
+ exports.THEMES = THEMES;
53
+
46
54
  const CardBackground = ({
47
55
  type,
48
56
  image,
49
- empty
57
+ empty,
58
+ theme
50
59
  }, {
51
60
  skin
52
61
  }) => {
@@ -59,19 +68,19 @@ const CardBackground = ({
59
68
  const iconColor = _externalContent.EXTERNAL_CONTENT_ICONS[type].color;
60
69
 
61
70
  const backgroundIcon = /*#__PURE__*/_react.default.createElement("div", {
62
- className: _style.default.externalIconCircleWrapper
71
+ className: (0, _classnames.default)(THEMES[theme], _style.default.externalIconCircleWrapper)
63
72
  }, /*#__PURE__*/_react.default.createElement(IconType, {
64
- className: _style.default.externalIcon
73
+ className: (0, _classnames.default)(THEMES[theme], _style.default.externalIcon)
65
74
  }));
66
75
 
67
76
  if (image) {
68
77
  const _backgroundIcon = /*#__PURE__*/_react.default.createElement("div", {
69
- className: (0, _classnames.default)(_style.default.externalIconCircleWrapper, _style.default.externalIconCircleWithImageWrapper),
78
+ className: (0, _classnames.default)(THEMES[theme], _style.default.externalIconCircleWrapper, _style.default.externalIconCircleWithImageWrapper),
70
79
  style: {
71
80
  backgroundColor: iconColor
72
81
  }
73
82
  }, /*#__PURE__*/_react.default.createElement(IconType, {
74
- className: _style.default.externalIconWithImage
83
+ className: (0, _classnames.default)(THEMES[theme], _style.default.externalIconWithImage)
75
84
  }));
76
85
 
77
86
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -117,6 +126,7 @@ CardBackground.contextTypes = {
117
126
  skin: _provider.default.childContextTypes.skin
118
127
  };
119
128
  CardBackground.propTypes = process.env.NODE_ENV !== "production" ? {
129
+ theme: _propTypes.default.oneOf((0, _keys2.default)(THEMES)),
120
130
  type: _propTypes.default.string,
121
131
  image: _propTypes.default.string,
122
132
  empty: _propTypes.default.bool
@@ -144,12 +154,13 @@ const Card = (0, _react.memo)(function Card(props, context) {
144
154
  isSelected,
145
155
  notification,
146
156
  badgeCategory,
147
- badgeLabel
157
+ badgeLabel,
158
+ theme = 'default'
148
159
  } = props;
149
160
  const empty = (0, _isEmpty2.default)((0, _pick2.default)(['title', 'type', 'author', 'image'], props));
150
161
  const primaryColor = (0, _get2.default)('common.primary', skin);
151
162
  const whiteColor = (0, _get2.default)('common.white', skin);
152
- const cardStyle = (0, _classnames.default)(type === 'chapter' ? _style.default.chapter : _style.default.course, title ? null : _style.default.lazy, _style.default.grid, empty ? _style.default.empty : null);
163
+ 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);
153
164
  const handleClick = (0, _react.useMemo)(() => e => !disabled && onClick(e), [disabled, onClick]);
154
165
  const lock = disabled ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidLoginLocked, {
155
166
  className: _style.default.lockIcon,
@@ -183,7 +194,8 @@ const Card = (0, _react.memo)(function Card(props, context) {
183
194
  }, /*#__PURE__*/_react.default.createElement(CardBackground, {
184
195
  type: type,
185
196
  image: image,
186
- empty: empty
197
+ empty: empty,
198
+ theme: theme
187
199
  }), (0, _isUndefined2.default)(isSelected) && !(0, _isUndefined2.default)(favorite) ? /*#__PURE__*/_react.default.createElement(_favorite.default, {
188
200
  className: _style.default.favorite,
189
201
  favorite: favorite,
@@ -194,7 +206,9 @@ const Card = (0, _react.memo)(function Card(props, context) {
194
206
  }) : null, /*#__PURE__*/_react.default.createElement(_selectable.default, {
195
207
  isSelected: isSelected
196
208
  }), notification ? /*#__PURE__*/_react.default.createElement(_notification.default, notification) : null, customer ? /*#__PURE__*/_react.default.createElement(_customer.default, _extends({}, customer, {
197
- className: (0, _classnames.default)(_style.default.customer, type === 'chapter' ? _style.default.chapterCustomer : null)
209
+ theme: theme,
210
+ type: type,
211
+ disabled: disabled
198
212
  })) : null, /*#__PURE__*/_react.default.createElement(_cardContent.default, {
199
213
  mode: _cardContent.MODES.CARD,
200
214
  adaptiv: adaptiv,
@@ -206,9 +220,10 @@ const Card = (0, _react.memo)(function Card(props, context) {
206
220
  title: title,
207
221
  type: type,
208
222
  badgeCategory: badgeCategory,
209
- badgeLabel: badgeLabel
223
+ badgeLabel: badgeLabel,
224
+ theme: theme
210
225
  }), badge ? /*#__PURE__*/_react.default.createElement("div", {
211
- className: _style.default.badge,
226
+ className: (0, _classnames.default)(THEMES[theme], _style.default.badge),
212
227
  style: inlineBadgeStyle
213
228
  }, badge) : null, disabled ? /*#__PURE__*/_react.default.createElement("div", {
214
229
  className: _style.default.lockWrapper
@@ -236,7 +251,8 @@ Card.propTypes = process.env.NODE_ENV !== "production" ? {
236
251
  isSelected: _propTypes.default.bool,
237
252
  notification: _propTypes.default.shape(_notification.default.propTypes),
238
253
  badgeCategory: _cardContent.default.propTypes.badgeCategory,
239
- badgeLabel: _cardContent.default.propTypes.badgeLabel
254
+ badgeLabel: _cardContent.default.propTypes.badgeLabel,
255
+ theme: _propTypes.default.oneOf((0, _keys2.default)(THEMES))
240
256
  } : {};
241
257
  var _default = Card;
242
258
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/card/index.js"],"names":["CardBackground","type","image","empty","skin","externalContent","primaryColor","whiteColor","EXTERNAL_CONTENT_ICONS","IconType","icon","iconColor","color","backgroundIcon","style","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","Card","props","context","badge","adaptiv","disabled","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","cardStyle","chapter","course","lazy","grid","handleClick","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","chapterCustomer","MODES","CARD","lockWrapper","shape","Customer","number","func","Notification","CardContentInfo"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,cAAc,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOC,EAAAA,KAAP;AAAcC,EAAAA;AAAd,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B,EAAAA,YAAY,EAAEpB,mBAAUuC,KAAV,CAAgBI,sBAAa5C,SAA7B,CAjBC;AAkBfsB,EAAAA,aAAa,EAAEuB,qBAAgB7C,SAAhB,CAA0BsB,aAlB1B;AAmBfC,EAAAA,UAAU,EAAEsB,qBAAgB7C,SAAhB,CAA0BuB;AAnBvB,CAAjB;eAqBenB,I","sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick} from 'lodash/fp';\nimport {\n NovaSolidLoginLocked 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\nconst CardBackground = ({type, image, empty}, {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 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 style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? <PicturesIcon className={style.emptyIcon} color={whiteColor} /> : 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 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};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled = 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 } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n const cardStyle = classnames(\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const handleClick = useMemo(() => e => !disabled && onClick(e), [disabled, onClick]);\n const lock = disabled ? (\n <LockIcon className={style.lockIcon} color={whiteColor} height={40} />\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 >\n <CardBackground type={type} image={image} empty={empty} />\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 />\n ) : null}\n <Selectable isSelected={isSelected} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n className={classnames(style.customer, type === 'chapter' ? style.chapterCustomer : null)}\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 />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle}>\n {badge}\n </div>\n ) : null}\n {disabled ? <div className={style.lockWrapper}>{lock}</div> : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCard.propTypes = {\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};\nexport default Card;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/molecule/card/index.js"],"names":["THEMES","default","coorpmanager","style","CardBackground","type","image","empty","theme","skin","externalContent","primaryColor","whiteColor","EXTERNAL_CONTENT_ICONS","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","oneOf","string","bool","Card","props","context","badge","adaptiv","disabled","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","cardStyle","chapter","course","lazy","grid","handleClick","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","MODES","CARD","lockWrapper","shape","Customer","number","func","Notification","CardContentInfo"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,MAAMA,MAAM,GAAG;AACpBC,EAAAA,OAAO,EAAE,IADW;AAEpBC,EAAAA,YAAY,EAAEC,eAAMD;AAFA,CAAf;;;AAKP,MAAME,cAAc,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOC,EAAAA,KAAP;AAAcC,EAAAA,KAAd;AAAqBC,EAAAA;AAArB,CAAD,EAA8B;AAACC,EAAAA;AAAD,CAA9B,KAAyC;AAC9D,QAAMC,eAAe,GAAG,wCAAkBL,IAAlB,CAAxB;AACA,QAAMM,YAAY,GAAG,mBAAI,gBAAJ,EAAsBF,IAAtB,CAArB;AACA,QAAMG,UAAU,GAAG,mBAAI,cAAJ,EAAoBH,IAApB,CAAnB;;AAEA,MAAIC,eAAe,IAAIG,wCAAuBR,IAAvB,CAAvB,EAAqD;AACnD,UAAMS,QAAQ,GAAGD,wCAAuBR,IAAvB,EAA6BU,IAA9C;AACA,UAAMC,SAAS,GAAGH,wCAAuBR,IAAvB,EAA6BY,KAA/C;;AACA,UAAMC,cAAc,gBAClB;AAAK,MAAA,SAAS,EAAE,yBAAWlB,MAAM,CAACQ,KAAD,CAAjB,EAA0BL,eAAMgB,yBAAhC;AAAhB,oBACE,6BAAC,QAAD;AAAU,MAAA,SAAS,EAAE,yBAA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BAAgB7C,SAAhB,CAA0BuB,aAlB1B;AAmBfC,EAAAA,UAAU,EAAEqB,qBAAgB7C,SAAhB,CAA0BwB,UAnBvB;AAoBflD,EAAAA,KAAK,EAAE2B,mBAAUC,KAAV,CAAgB,oBAAKpC,MAAL,CAAhB;AApBQ,CAAjB;eAsBeuC,I","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 NovaSolidLoginLocked 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, theme}, {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={classnames(THEMES[theme], style.externalIconCircleWrapper)}>\n <IconType className={classnames(THEMES[theme], style.externalIcon)} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n THEMES[theme],\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={classnames(THEMES[theme], style.externalIconWithImage)} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\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 style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? <PicturesIcon className={style.emptyIcon} color={whiteColor} /> : 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 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 theme: PropTypes.oneOf(keys(THEMES)),\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled = 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 } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', 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 handleClick = useMemo(() => e => !disabled && onClick(e), [disabled, onClick]);\n const lock = disabled ? (\n <LockIcon className={style.lockIcon} color={whiteColor} height={40} />\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 >\n <CardBackground type={type} image={image} empty={empty} theme={theme} />\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 />\n ) : null}\n <Selectable isSelected={isSelected} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? <Customer {...customer} theme={theme} type={type} disabled={disabled} /> : 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 />\n {badge ? (\n <div className={classnames(THEMES[theme], style.badge)} style={inlineBadgeStyle}>\n {badge}\n </div>\n ) : null}\n {disabled ? <div className={style.lockWrapper}>{lock}</div> : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCard.propTypes = {\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};\nexport default Card;\n"],"file":"index.js"}
@@ -36,25 +36,6 @@
36
36
  z-index: 0;
37
37
  }
38
38
 
39
- .customer {
40
- position: absolute;
41
- top: 0;
42
- left: 0;
43
- width: 100%;
44
- height: 100%;
45
- }
46
-
47
- .customer {
48
- background: linear-gradient(
49
- to bottom,
50
- rgba(0, 0, 0, 0.2) 0%,
51
- rgba(0, 0, 0, 0) 20%
52
- );
53
- }
54
- .chapterCustomer {
55
- padding-top: 10px;
56
- }
57
-
58
39
  .grid.empty {
59
40
  padding-bottom: 25px;
60
41
  opacity: 0.6;
@@ -66,6 +47,7 @@
66
47
  width: 256px;
67
48
  height: 297px;
68
49
  }
50
+
69
51
  .chapter {
70
52
  composes: default;
71
53
  border-radius: 8px;
@@ -73,6 +55,18 @@
73
55
  height: 297px;
74
56
  }
75
57
 
58
+ .coorpmanager.course {
59
+ border-radius: 5px;
60
+ width: 172px;
61
+ height: 201px;
62
+ }
63
+
64
+ .coorpmanager.chapter {
65
+ border-radius: 5px;
66
+ width: 138px;
67
+ height: 201px;
68
+ }
69
+
76
70
  .course .imageWrapper {
77
71
  width: 100%;
78
72
  height: 100%;
@@ -89,6 +83,10 @@
89
83
  left: 0;
90
84
  }
91
85
 
86
+ .coorpmanager.chapter .chapterImageWrapper {
87
+ max-height: 52px;
88
+ }
89
+
92
90
  .default .image {
93
91
  overflow: hidden;
94
92
  background-position: 50%;
@@ -218,10 +216,6 @@
218
216
  left: 0;
219
217
  }
220
218
 
221
- .default[disabled] .customer {
222
- background: none;
223
- }
224
-
225
219
  .badge {
226
220
  position: absolute;
227
221
  width: auto;
@@ -239,6 +233,11 @@
239
233
  user-select: none;
240
234
  }
241
235
 
236
+ .coorpmanager.badge {
237
+ padding: 2px 5px;
238
+ font-size: 7px;
239
+ }
240
+
242
241
  .emptyIcon {
243
242
  vertical-align: middle;
244
243
  width: 80px;
@@ -295,11 +294,24 @@
295
294
  }
296
295
 
297
296
  .externalIconCircleWrapper {
297
+ border-radius: 50%;
298
+ padding: 17px;
299
+ box-sizing: border-box;
300
+ background-color: rgba(255, 255, 255, 0.3);
301
+ justify-content: center;
302
+ transform: scale(1);
303
+ transition: transform 0.25s ease-in-out;
298
304
  width: 80px;
299
305
  height: 80px;
300
306
  margin-top: 20px;
307
+ }
308
+
309
+ .coorpmanager .externalIconCircleWrapper {
310
+ width: 50px;
311
+ height: 50px;
312
+ margin-top: 12px;
313
+ padding: 13px;
301
314
  border-radius: 50%;
302
- padding: 17px;
303
315
  box-sizing: border-box;
304
316
  background-color: rgba(255, 255, 255, 0.3);
305
317
  justify-content: center;
@@ -313,6 +325,12 @@
313
325
  height: 45px;
314
326
  }
315
327
 
328
+ .coorpmanager .externalIcon {
329
+ color: white;
330
+ width: 23px;
331
+ height: 23px;
332
+ }
333
+
316
334
  .externalIconCircleWrapper::after {
317
335
  animation: pulse 3s linear 0s infinite;
318
336
  animation-play-state: paused;
@@ -343,6 +361,18 @@
343
361
  transition: box-shadow 0.25s linear;
344
362
  }
345
363
 
364
+ .coorpmanager .externalIconCircleWrapper::after,
365
+ .coorpmanager .externalIconCircleWrapper::before {
366
+ width: 50px;
367
+ height: 50px;
368
+ top: 0;
369
+ left: 0;
370
+ transform: scale(1);
371
+ opacity: 0;
372
+ box-shadow: inset 0 0 7px 0 rgba(255, 255, 255, 0);
373
+ transition: box-shadow 0.25s linear;
374
+ }
375
+
346
376
  .externalIconCircleWithImageWrapper {
347
377
  width: 60px;
348
378
  height: 60px;
@@ -350,6 +380,22 @@
350
380
  z-index: 1;
351
381
  }
352
382
 
383
+ .coorpmanager .externalIconCircleWithImageWrapper {
384
+ width: 50px;
385
+ height: 50px;
386
+ border-radius: 50%;
387
+ padding: 12px;
388
+ z-index: 1;
389
+ margin-top: 20px;
390
+ }
391
+
392
+ .coorpmanager.externalIconWithImage {
393
+ color: white;
394
+ width: 25px;
395
+ height: 25px;
396
+ padding: 0 0 0 1px;
397
+ }
398
+
353
399
  .externalIconWithImage {
354
400
  color: white;
355
401
  width: 28px;
@@ -372,6 +418,22 @@
372
418
  transition: box-shadow 0.25s linear;
373
419
  }
374
420
 
421
+ .coorpmanager.externalIconCircleWithImageWrapper::after,
422
+ .coorpmanager.externalIconCircleWithImageWrapper::before {
423
+ content: '';
424
+ width: 50px;
425
+ height: 50px;
426
+ top: 0;
427
+ left: 0;
428
+ position: absolute;
429
+ transform: scale(1);
430
+ opacity: 0;
431
+ box-shadow: inset 0 0 7px 0 rgba(255, 255, 255, 0);
432
+ transition: box-shadow 0.25s linear;
433
+
434
+ }
435
+
436
+
375
437
  @keyframes pulse {
376
438
  0% {
377
439
  transform: scale(1);
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _defaultsDeep2 = _interopRequireDefault(require("lodash/fp/defaultsDeep"));
7
+
8
+ var _default2 = _interopRequireDefault(require("./default"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ const {
13
+ props
14
+ } = _default2.default;
15
+ var _default = {
16
+ props: (0, _defaultsDeep2.default)(props, {
17
+ disabled: false,
18
+ type: 'course',
19
+ image: 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/CoorpAcademy/content-marmiton/cockpit-marmiton/cover/shutterstock_520965634-1491986518210.jpg&h=500&w=500&q=90',
20
+ progress: 0.1,
21
+ isSelected: false,
22
+ badgeCategory: 'base',
23
+ badgeLabel: 'basic',
24
+ theme: 'coorpmanager'
25
+ })
26
+ };
27
+ exports.default = _default;
28
+ //# sourceMappingURL=coorpmanager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/card/test/fixtures/coorpmanager.js"],"names":["props","Default","disabled","type","image","progress","isSelected","badgeCategory","badgeLabel","theme"],"mappings":";;;;;;;AACA;;;;AAEA,MAAM;AAACA,EAAAA;AAAD,IAAUC,iBAAhB;eAEe;AACbD,EAAAA,KAAK,EAAE,4BAAaA,KAAb,EAAoB;AACzBE,IAAAA,QAAQ,EAAE,KADe;AAEzBC,IAAAA,IAAI,EAAE,QAFmB;AAGzBC,IAAAA,KAAK,EACH,4MAJuB;AAKzBC,IAAAA,QAAQ,EAAE,GALe;AAMzBC,IAAAA,UAAU,EAAE,KANa;AAOzBC,IAAAA,aAAa,EAAE,MAPU;AAQzBC,IAAAA,UAAU,EAAE,OARa;AASzBC,IAAAA,KAAK,EAAE;AATkB,GAApB;AADM,C","sourcesContent":["import {defaultsDeep} from 'lodash/fp';\nimport Default from './default';\n\nconst {props} = Default;\n\nexport default {\n props: defaultsDeep(props, {\n disabled: false,\n type: 'course',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/CoorpAcademy/content-marmiton/cockpit-marmiton/cover/shutterstock_520965634-1491986518210.jpg&h=500&w=500&q=90',\n progress: 0.1,\n isSelected: false,\n badgeCategory: 'base',\n badgeLabel: 'basic',\n theme: 'coorpmanager'\n })\n};\n"],"file":"coorpmanager.js"}
@@ -16,6 +16,8 @@ var _arabic = _interopRequireDefault(require("./fixtures/arabic"));
16
16
 
17
17
  var _article = _interopRequireDefault(require("./fixtures/article"));
18
18
 
19
+ var _coorpmanager = _interopRequireDefault(require("./fixtures/coorpmanager"));
20
+
19
21
  var _default = _interopRequireDefault(require("./fixtures/default"));
20
22
 
21
23
  var _disabled = _interopRequireDefault(require("./fixtures/disabled"));
@@ -52,6 +54,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
52
54
  (0, _ava.default)('Molecule › MoleculeCard › Adaptiv › should be rendered', _renderComponent.default, _.default, _adaptiv.default);
53
55
  (0, _ava.default)('Molecule › MoleculeCard › Arabic › should be rendered', _renderComponent.default, _.default, _arabic.default);
54
56
  (0, _ava.default)('Molecule › MoleculeCard › Article › should be rendered', _renderComponent.default, _.default, _article.default);
57
+ (0, _ava.default)('Molecule › MoleculeCard › Coorpmanager › should be rendered', _renderComponent.default, _.default, _coorpmanager.default);
55
58
  (0, _ava.default)('Molecule › MoleculeCard › Default › should be rendered', _renderComponent.default, _.default, _default.default);
56
59
  (0, _ava.default)('Molecule › MoleculeCard › Disabled › should be rendered', _renderComponent.default, _.default, _disabled.default);
57
60
  (0, _ava.default)('Molecule › MoleculeCard › Empty › should be rendered', _renderComponent.default, _.default, _empty.default);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/molecule/card/test/fixtures.js"],"names":["t","pass","MoleculeCard","propTypes","value","key","not","undefined","renderComponentMacro","fixtureAdaptivAndDisabled","fixtureAdaptiv","fixtureArabic","fixtureArticle","fixtureDefault","fixtureDisabled","fixtureEmpty","fixtureExternalContent","fixtureFavorite","fixtureFreerunAndDisabled","fixtureFreerun","fixturePodcast","fixtureScorm","fixtureSelectableFalse","fixtureSelectableTrue","fixtureVideo"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,uDAAL,EAA8DA,CAAC,IAAI;AACjEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAaC,SAArB,EAAgC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC9CL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,iDAAgDF,GAAI,mEAA7E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,mEAAL,EAA0EG,wBAA1E,EAAgGN,SAAhG,EAA8GO,2BAA9G;AACA,kBAAK,wDAAL,EAA+DD,wBAA/D,EAAqFN,SAArF,EAAmGQ,gBAAnG;AACA,kBAAK,uDAAL,EAA8DF,wBAA9D,EAAoFN,SAApF,EAAkGS,eAAlG;AACA,kBAAK,wDAAL,EAA+DH,wBAA/D,EAAqFN,SAArF,EAAmGU,gBAAnG;AACA,kBAAK,wDAAL,EAA+DJ,wBAA/D,EAAqFN,SAArF,EAAmGW,gBAAnG;AACA,kBAAK,yDAAL,EAAgEL,wBAAhE,EAAsFN,SAAtF,EAAoGY,iBAApG;AACA,kBAAK,sDAAL,EAA6DN,wBAA7D,EAAmFN,SAAnF,EAAiGa,cAAjG;AACA,kBAAK,gEAAL,EAAuEP,wBAAvE,EAA6FN,SAA7F,EAA2Gc,wBAA3G;AACA,kBAAK,yDAAL,EAAgER,wBAAhE,EAAsFN,SAAtF,EAAoGe,iBAApG;AACA,kBAAK,mEAAL,EAA0ET,wBAA1E,EAAgGN,SAAhG,EAA8GgB,2BAA9G;AACA,kBAAK,wDAAL,EAA+DV,wBAA/D,EAAqFN,SAArF,EAAmGiB,gBAAnG;AACA,kBAAK,wDAAL,EAA+DX,wBAA/D,EAAqFN,SAArF,EAAmGkB,gBAAnG;AACA,kBAAK,sDAAL,EAA6DZ,wBAA7D,EAAmFN,SAAnF,EAAiGmB,cAAjG;AACA,kBAAK,gEAAL,EAAuEb,wBAAvE,EAA6FN,SAA7F,EAA2GoB,wBAA3G;AACA,kBAAK,+DAAL,EAAsEd,wBAAtE,EAA4FN,SAA5F,EAA0GqB,uBAA1G;AACA,kBAAK,sDAAL,EAA6Df,wBAA7D,EAAmFN,SAAnF,EAAiGsB,cAAjG","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCard from '..';\nimport fixtureAdaptivAndDisabled from './fixtures/adaptiv-and-disabled';\nimport fixtureAdaptiv from './fixtures/adaptiv';\nimport fixtureArabic from './fixtures/arabic';\nimport fixtureArticle from './fixtures/article';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDisabled from './fixtures/disabled';\nimport fixtureEmpty from './fixtures/empty';\nimport fixtureExternalContent from './fixtures/external-content';\nimport fixtureFavorite from './fixtures/favorite';\nimport fixtureFreerunAndDisabled from './fixtures/freerun-and-disabled';\nimport fixtureFreerun from './fixtures/freerun';\nimport fixturePodcast from './fixtures/podcast';\nimport fixtureScorm from './fixtures/scorm';\nimport fixtureSelectableFalse from './fixtures/selectable-false';\nimport fixtureSelectableTrue from './fixtures/selectable-true';\nimport fixtureVideo from './fixtures/video';\n\ntest('Molecule › MoleculeCard > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCard.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCard.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCard › AdaptivAndDisabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureAdaptivAndDisabled);\ntest('Molecule › MoleculeCard › Adaptiv › should be rendered', renderComponentMacro, MoleculeCard, fixtureAdaptiv);\ntest('Molecule › MoleculeCard › Arabic › should be rendered', renderComponentMacro, MoleculeCard, fixtureArabic);\ntest('Molecule › MoleculeCard › Article › should be rendered', renderComponentMacro, MoleculeCard, fixtureArticle);\ntest('Molecule › MoleculeCard › Default › should be rendered', renderComponentMacro, MoleculeCard, fixtureDefault);\ntest('Molecule › MoleculeCard › Disabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureDisabled);\ntest('Molecule › MoleculeCard › Empty › should be rendered', renderComponentMacro, MoleculeCard, fixtureEmpty);\ntest('Molecule › MoleculeCard › ExternalContent › should be rendered', renderComponentMacro, MoleculeCard, fixtureExternalContent);\ntest('Molecule › MoleculeCard › Favorite › should be rendered', renderComponentMacro, MoleculeCard, fixtureFavorite);\ntest('Molecule › MoleculeCard › FreerunAndDisabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureFreerunAndDisabled);\ntest('Molecule › MoleculeCard › Freerun › should be rendered', renderComponentMacro, MoleculeCard, fixtureFreerun);\ntest('Molecule › MoleculeCard › Podcast › should be rendered', renderComponentMacro, MoleculeCard, fixturePodcast);\ntest('Molecule › MoleculeCard › Scorm › should be rendered', renderComponentMacro, MoleculeCard, fixtureScorm);\ntest('Molecule › MoleculeCard › SelectableFalse › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableFalse);\ntest('Molecule › MoleculeCard › SelectableTrue › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableTrue);\ntest('Molecule › MoleculeCard › Video › should be rendered', renderComponentMacro, MoleculeCard, fixtureVideo);\n"],"file":"fixtures.js"}
1
+ {"version":3,"sources":["../../../../src/molecule/card/test/fixtures.js"],"names":["t","pass","MoleculeCard","propTypes","value","key","not","undefined","renderComponentMacro","fixtureAdaptivAndDisabled","fixtureAdaptiv","fixtureArabic","fixtureArticle","fixtureCoorpmanager","fixtureDefault","fixtureDisabled","fixtureEmpty","fixtureExternalContent","fixtureFavorite","fixtureFreerunAndDisabled","fixtureFreerun","fixturePodcast","fixtureScorm","fixtureSelectableFalse","fixtureSelectableTrue","fixtureVideo"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,uDAAL,EAA8DA,CAAC,IAAI;AACjEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAaC,SAArB,EAAgC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC9CL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,iDAAgDF,GAAI,mEAA7E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,mEAAL,EAA0EG,wBAA1E,EAAgGN,SAAhG,EAA8GO,2BAA9G;AACA,kBAAK,wDAAL,EAA+DD,wBAA/D,EAAqFN,SAArF,EAAmGQ,gBAAnG;AACA,kBAAK,uDAAL,EAA8DF,wBAA9D,EAAoFN,SAApF,EAAkGS,eAAlG;AACA,kBAAK,wDAAL,EAA+DH,wBAA/D,EAAqFN,SAArF,EAAmGU,gBAAnG;AACA,kBAAK,6DAAL,EAAoEJ,wBAApE,EAA0FN,SAA1F,EAAwGW,qBAAxG;AACA,kBAAK,wDAAL,EAA+DL,wBAA/D,EAAqFN,SAArF,EAAmGY,gBAAnG;AACA,kBAAK,yDAAL,EAAgEN,wBAAhE,EAAsFN,SAAtF,EAAoGa,iBAApG;AACA,kBAAK,sDAAL,EAA6DP,wBAA7D,EAAmFN,SAAnF,EAAiGc,cAAjG;AACA,kBAAK,gEAAL,EAAuER,wBAAvE,EAA6FN,SAA7F,EAA2Ge,wBAA3G;AACA,kBAAK,yDAAL,EAAgET,wBAAhE,EAAsFN,SAAtF,EAAoGgB,iBAApG;AACA,kBAAK,mEAAL,EAA0EV,wBAA1E,EAAgGN,SAAhG,EAA8GiB,2BAA9G;AACA,kBAAK,wDAAL,EAA+DX,wBAA/D,EAAqFN,SAArF,EAAmGkB,gBAAnG;AACA,kBAAK,wDAAL,EAA+DZ,wBAA/D,EAAqFN,SAArF,EAAmGmB,gBAAnG;AACA,kBAAK,sDAAL,EAA6Db,wBAA7D,EAAmFN,SAAnF,EAAiGoB,cAAjG;AACA,kBAAK,gEAAL,EAAuEd,wBAAvE,EAA6FN,SAA7F,EAA2GqB,wBAA3G;AACA,kBAAK,+DAAL,EAAsEf,wBAAtE,EAA4FN,SAA5F,EAA0GsB,uBAA1G;AACA,kBAAK,sDAAL,EAA6DhB,wBAA7D,EAAmFN,SAAnF,EAAiGuB,cAAjG","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCard from '..';\nimport fixtureAdaptivAndDisabled from './fixtures/adaptiv-and-disabled';\nimport fixtureAdaptiv from './fixtures/adaptiv';\nimport fixtureArabic from './fixtures/arabic';\nimport fixtureArticle from './fixtures/article';\nimport fixtureCoorpmanager from './fixtures/coorpmanager';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDisabled from './fixtures/disabled';\nimport fixtureEmpty from './fixtures/empty';\nimport fixtureExternalContent from './fixtures/external-content';\nimport fixtureFavorite from './fixtures/favorite';\nimport fixtureFreerunAndDisabled from './fixtures/freerun-and-disabled';\nimport fixtureFreerun from './fixtures/freerun';\nimport fixturePodcast from './fixtures/podcast';\nimport fixtureScorm from './fixtures/scorm';\nimport fixtureSelectableFalse from './fixtures/selectable-false';\nimport fixtureSelectableTrue from './fixtures/selectable-true';\nimport fixtureVideo from './fixtures/video';\n\ntest('Molecule › MoleculeCard > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCard.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCard.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCard › AdaptivAndDisabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureAdaptivAndDisabled);\ntest('Molecule › MoleculeCard › Adaptiv › should be rendered', renderComponentMacro, MoleculeCard, fixtureAdaptiv);\ntest('Molecule › MoleculeCard › Arabic › should be rendered', renderComponentMacro, MoleculeCard, fixtureArabic);\ntest('Molecule › MoleculeCard › Article › should be rendered', renderComponentMacro, MoleculeCard, fixtureArticle);\ntest('Molecule › MoleculeCard › Coorpmanager › should be rendered', renderComponentMacro, MoleculeCard, fixtureCoorpmanager);\ntest('Molecule › MoleculeCard › Default › should be rendered', renderComponentMacro, MoleculeCard, fixtureDefault);\ntest('Molecule › MoleculeCard › Disabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureDisabled);\ntest('Molecule › MoleculeCard › Empty › should be rendered', renderComponentMacro, MoleculeCard, fixtureEmpty);\ntest('Molecule › MoleculeCard › ExternalContent › should be rendered', renderComponentMacro, MoleculeCard, fixtureExternalContent);\ntest('Molecule › MoleculeCard › Favorite › should be rendered', renderComponentMacro, MoleculeCard, fixtureFavorite);\ntest('Molecule › MoleculeCard › FreerunAndDisabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureFreerunAndDisabled);\ntest('Molecule › MoleculeCard › Freerun › should be rendered', renderComponentMacro, MoleculeCard, fixtureFreerun);\ntest('Molecule › MoleculeCard › Podcast › should be rendered', renderComponentMacro, MoleculeCard, fixturePodcast);\ntest('Molecule › MoleculeCard › Scorm › should be rendered', renderComponentMacro, MoleculeCard, fixtureScorm);\ntest('Molecule › MoleculeCard › SelectableFalse › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableFalse);\ntest('Molecule › MoleculeCard › SelectableTrue › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableTrue);\ntest('Molecule › MoleculeCard › Video › should be rendered', renderComponentMacro, MoleculeCard, fixtureVideo);\n"],"file":"fixtures.js"}
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.default = exports.MODES = void 0;
4
+ exports.default = exports.THEMES = exports.MODES = void 0;
5
+
6
+ var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
5
7
 
6
8
  var _isNil2 = _interopRequireDefault(require("lodash/fp/isNil"));
7
9
 
@@ -30,11 +32,17 @@ const MODES = {
30
32
  CARD: 'card'
31
33
  };
32
34
  exports.MODES = MODES;
35
+ const THEMES = {
36
+ default: null,
37
+ coorpmanager: _style2.default.coorpmanager
38
+ };
39
+ exports.THEMES = THEMES;
33
40
 
34
41
  const ContentTypeInfo = ({
35
42
  mode,
36
43
  type,
37
- externalContent
44
+ externalContent,
45
+ theme
38
46
  }, context) => {
39
47
  const {
40
48
  translate
@@ -46,12 +54,11 @@ const ContentTypeInfo = ({
46
54
 
47
55
  if (type === 'chapter') {
48
56
  return /*#__PURE__*/_react.default.createElement("div", {
49
- className: _style2.default.microLearningIcon
57
+ className: (0, _classnames.default)(THEMES[theme], _style2.default.microLearningIcon)
50
58
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyTimer, {
51
- height: 40,
52
- width: 40
59
+ className: _style2.default.timerIcon
53
60
  }), /*#__PURE__*/_react.default.createElement("span", {
54
- className: _style2.default.microLearninglabel
61
+ className: (0, _classnames.default)(THEMES[theme], _style2.default.microLearninglabel)
55
62
  }, "5' learning"));
56
63
  }
57
64
 
@@ -75,16 +82,18 @@ ContentTypeInfo.contextTypes = {
75
82
  ContentTypeInfo.propTypes = process.env.NODE_ENV !== "production" ? {
76
83
  externalContent: _propTypes.default.bool,
77
84
  type: _propTypes.default.string,
78
- mode: _propTypes.default.string
85
+ mode: _propTypes.default.string,
86
+ theme: _propTypes.default.oneOf((0, _keys2.default)(THEMES))
79
87
  } : {};
80
88
 
81
89
  const CardTitle = ({
82
90
  title,
83
91
  empty,
84
- courseContent
92
+ courseContent,
93
+ theme
85
94
  }) => {
86
95
  return /*#__PURE__*/_react.default.createElement("div", {
87
- className: (0, _classnames.default)(_style2.default.title, _style.innerHTML, courseContent ? _style2.default.lightTitle : _style2.default.darkTitle, empty ? _style2.default.empty : null),
96
+ className: (0, _classnames.default)(THEMES[theme], _style2.default.title, _style.innerHTML, courseContent ? _style2.default.lightTitle : _style2.default.darkTitle, empty ? _style2.default.empty : null),
88
97
  "data-name": "title",
89
98
  title: title // eslint-disable-next-line react/no-danger
90
99
  ,
@@ -97,14 +106,16 @@ const CardTitle = ({
97
106
  CardTitle.propTypes = process.env.NODE_ENV !== "production" ? {
98
107
  title: _propTypes.default.string,
99
108
  empty: _propTypes.default.bool,
100
- courseContent: _propTypes.default.bool
109
+ courseContent: _propTypes.default.bool,
110
+ theme: _propTypes.default.oneOf((0, _keys2.default)(THEMES))
101
111
  } : {};
102
112
 
103
113
  const AuthorName = ({
104
114
  author,
105
115
  empty,
106
116
  courseContent,
107
- certifiedAuthor
117
+ certifiedAuthor,
118
+ theme
108
119
  }) => {
109
120
  const checkIcon = certifiedAuthor ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidStatusCheckCircle2, {
110
121
  className: (0, _classnames.default)(_style2.default.authorIcon, courseContent ? _style2.default.iconShadow : null),
@@ -113,7 +124,7 @@ const AuthorName = ({
113
124
  return /*#__PURE__*/_react.default.createElement("div", {
114
125
  "data-name": "author",
115
126
  title: author,
116
- className: (0, _classnames.default)(_style2.default.author, courseContent ? _style2.default.lightTitle : _style2.default.darkAuthorTitle, empty ? _style2.default.empty : null)
127
+ className: (0, _classnames.default)(THEMES[theme], _style2.default.author, courseContent ? _style2.default.lightTitle : _style2.default.darkAuthorTitle, empty ? _style2.default.empty : null)
117
128
  }, /*#__PURE__*/_react.default.createElement("span", null, author), checkIcon);
118
129
  };
119
130
 
@@ -121,7 +132,8 @@ AuthorName.propTypes = process.env.NODE_ENV !== "production" ? {
121
132
  author: _propTypes.default.string,
122
133
  empty: _propTypes.default.bool,
123
134
  courseContent: _propTypes.default.bool,
124
- certifiedAuthor: _propTypes.default.bool
135
+ certifiedAuthor: _propTypes.default.bool,
136
+ theme: _propTypes.default.oneOf((0, _keys2.default)(THEMES))
125
137
  } : {};
126
138
 
127
139
  const ContentInfo = ({
@@ -135,7 +147,8 @@ const ContentInfo = ({
135
147
  title,
136
148
  type,
137
149
  badgeCategory,
138
- badgeLabel
150
+ badgeLabel,
151
+ theme = 'default'
139
152
  }) => {
140
153
  const progressBarColor = '#3EC483';
141
154
  const inlineProgressValueStyle = {
@@ -159,11 +172,12 @@ const ContentInfo = ({
159
172
  })) : null;
160
173
  return /*#__PURE__*/_react.default.createElement("div", {
161
174
  "data-name": "info",
162
- className: (0, _classnames.default)(_style2.default.infoWrapper, mode === MODES.HERO ? _style2.default.hero : _style2.default.card, disabled ? _style2.default.progressBarDisabled : null, externalContent ? _style2.default.externalContent : null)
175
+ className: (0, _classnames.default)(THEMES[theme], _style2.default.infoWrapper, mode === MODES.HERO ? _style2.default.hero : _style2.default.card, disabled ? _style2.default.progressBarDisabled : null, externalContent ? _style2.default.externalContent : null)
163
176
  }, /*#__PURE__*/_react.default.createElement(ContentTypeInfo, {
164
177
  mode: mode,
165
178
  type: type,
166
- externalContent: externalContent
179
+ externalContent: externalContent,
180
+ theme: theme
167
181
  }), /*#__PURE__*/_react.default.createElement("div", {
168
182
  className: (0, _classnames.default)(_style2.default.cardInfo, chapterContent ? _style2.default.microLearningCardInfo : null)
169
183
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -174,12 +188,14 @@ const ContentInfo = ({
174
188
  }) : null), /*#__PURE__*/_react.default.createElement(CardTitle, {
175
189
  title: title,
176
190
  empty: empty,
177
- courseContent: courseContent
191
+ courseContent: courseContent,
192
+ theme: theme
178
193
  }), /*#__PURE__*/_react.default.createElement(AuthorName, {
179
194
  author: author,
180
195
  empty: empty,
181
196
  courseContent: courseContent,
182
- certifiedAuthor: certifiedAuthor
197
+ certifiedAuthor: certifiedAuthor,
198
+ theme: theme
183
199
  })), progressBar);
184
200
  };
185
201
 
@@ -197,7 +213,8 @@ ContentInfo.propTypes = process.env.NODE_ENV !== "production" ? {
197
213
  type: _propTypes.default.string,
198
214
  mode: _propTypes.default.string,
199
215
  badgeCategory: _contentBadge.default.propTypes.category,
200
- badgeLabel: _contentBadge.default.propTypes.label
216
+ badgeLabel: _contentBadge.default.propTypes.label,
217
+ theme: _propTypes.default.oneOf((0, _keys2.default)(THEMES))
201
218
  } : {};
202
219
  var _default = ContentInfo;
203
220
  exports.default = _default;