@coorpacademy/components 11.34.2-alpha.94 → 11.34.2

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 (85) hide show
  1. package/es/atom/button-link-icon/index.js +1 -1
  2. package/es/atom/button-link-icon/index.js.map +1 -1
  3. package/es/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
  4. package/es/molecule/bullet-point-menu-button/index.js +24 -9
  5. package/es/molecule/bullet-point-menu-button/index.js.map +1 -1
  6. package/es/molecule/bullet-point-menu-button/types.d.ts +1 -1
  7. package/es/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
  8. package/es/molecule/bullet-point-menu-button/types.js.map +1 -1
  9. package/es/molecule/learner-skill-card/index.d.ts +40 -25
  10. package/es/molecule/learner-skill-card/index.d.ts.map +1 -1
  11. package/es/molecule/learner-skill-card/index.js +95 -92
  12. package/es/molecule/learner-skill-card/index.js.map +1 -1
  13. package/es/molecule/learner-skill-card/style.css +40 -61
  14. package/es/template/my-learning/index.d.ts +1 -0
  15. package/es/template/my-learning/index.d.ts.map +1 -1
  16. package/es/template/my-learning/index.js +23 -27
  17. package/es/template/my-learning/index.js.map +1 -1
  18. package/es/template/my-learning/style.css +6 -9
  19. package/es/template/skill-detail/index.d.ts.map +1 -1
  20. package/es/template/skill-detail/index.js +3 -4
  21. package/es/template/skill-detail/index.js.map +1 -1
  22. package/es/variables/colors.css +0 -5
  23. package/es/variables/colors.d.ts +0 -6
  24. package/es/variables/colors.d.ts.map +1 -1
  25. package/es/variables/colors.js +1 -7
  26. package/es/variables/colors.js.map +1 -1
  27. package/lib/atom/button-link-icon/index.js +1 -1
  28. package/lib/atom/button-link-icon/index.js.map +1 -1
  29. package/lib/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
  30. package/lib/molecule/bullet-point-menu-button/index.js +23 -8
  31. package/lib/molecule/bullet-point-menu-button/index.js.map +1 -1
  32. package/lib/molecule/bullet-point-menu-button/types.d.ts +1 -1
  33. package/lib/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
  34. package/lib/molecule/bullet-point-menu-button/types.js.map +1 -1
  35. package/lib/molecule/learner-skill-card/index.d.ts +40 -25
  36. package/lib/molecule/learner-skill-card/index.d.ts.map +1 -1
  37. package/lib/molecule/learner-skill-card/index.js +95 -95
  38. package/lib/molecule/learner-skill-card/index.js.map +1 -1
  39. package/lib/molecule/learner-skill-card/style.css +40 -61
  40. package/lib/template/my-learning/index.d.ts +1 -0
  41. package/lib/template/my-learning/index.d.ts.map +1 -1
  42. package/lib/template/my-learning/index.js +23 -27
  43. package/lib/template/my-learning/index.js.map +1 -1
  44. package/lib/template/my-learning/style.css +6 -9
  45. package/lib/template/skill-detail/index.d.ts.map +1 -1
  46. package/lib/template/skill-detail/index.js +3 -4
  47. package/lib/template/skill-detail/index.js.map +1 -1
  48. package/lib/variables/colors.css +0 -5
  49. package/lib/variables/colors.d.ts +0 -6
  50. package/lib/variables/colors.d.ts.map +1 -1
  51. package/lib/variables/colors.js +1 -7
  52. package/lib/variables/colors.js.map +1 -1
  53. package/locales/cs/global.json +13 -13
  54. package/locales/de/global.json +13 -13
  55. package/locales/en/global.json +0 -1
  56. package/locales/es/global.json +13 -13
  57. package/locales/et/global.json +13 -13
  58. package/locales/fi/global.json +13 -13
  59. package/locales/hr/global.json +13 -13
  60. package/locales/hu/global.json +13 -13
  61. package/locales/it/global.json +13 -13
  62. package/locales/ja/global.json +13 -13
  63. package/locales/ko/global.json +13 -13
  64. package/locales/nl/global.json +13 -13
  65. package/locales/pl/global.json +13 -13
  66. package/locales/pt/global.json +13 -13
  67. package/locales/ro/global.json +13 -13
  68. package/locales/ru/global.json +13 -13
  69. package/locales/sk/global.json +13 -13
  70. package/locales/sl/global.json +13 -13
  71. package/locales/sv/global.json +13 -13
  72. package/locales/tl/global.json +12 -12
  73. package/locales/tr/global.json +13 -13
  74. package/locales/uk/global.json +13 -13
  75. package/locales/vi/global.json +13 -13
  76. package/locales/zh_TW/global.json +8 -8
  77. package/package.json +2 -2
  78. package/es/molecule/learner-skill-card/prop-types.d.ts +0 -37
  79. package/es/molecule/learner-skill-card/prop-types.d.ts.map +0 -1
  80. package/es/molecule/learner-skill-card/prop-types.js +0 -20
  81. package/es/molecule/learner-skill-card/prop-types.js.map +0 -1
  82. package/lib/molecule/learner-skill-card/prop-types.d.ts +0 -37
  83. package/lib/molecule/learner-skill-card/prop-types.d.ts.map +0 -1
  84. package/lib/molecule/learner-skill-card/prop-types.js +0 -25
  85. package/lib/molecule/learner-skill-card/prop-types.js.map +0 -1
@@ -1,34 +1,28 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.updateBackgroundImage = exports.default = void 0;
5
- var _react = _interopRequireWildcard(require("react"));
6
- var _provider = _interopRequireWildcard(require("../../atom/provider"));
4
+ exports.default = void 0;
5
+ var _get2 = _interopRequireDefault(require("lodash/fp/get"));
6
+ var _react = _interopRequireDefault(require("react"));
7
+ var _cssColorFunction = require("css-color-function");
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _icon = _interopRequireDefault(require("../../atom/icon"));
10
+ var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
11
+ var _provider = _interopRequireDefault(require("../../atom/provider"));
7
12
  var _progressBar = _interopRequireDefault(require("../progress-bar"));
8
13
  var _colors = require("../../variables/colors");
9
- var _getBackgroundGradientColor = require("../../util/get-background-gradient-color");
10
- var _icon = _interopRequireDefault(require("../../atom/icon"));
11
- var _propTypes = _interopRequireDefault(require("./prop-types"));
12
14
  var _style = _interopRequireDefault(require("./style.css"));
13
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
16
  const MAX_SCORE = 100;
17
- const updateBackgroundImage = (ref, background) => {
18
- if (ref.current) {
19
- ref.current.style.backgroundImage = background;
20
- }
21
- };
22
- exports.updateBackgroundImage = updateBackgroundImage;
23
17
  const LearnerSkillCard = (props, context) => {
24
18
  const {
25
19
  'aria-label': ariaLabel,
26
- cardIndex,
27
20
  skillTitle,
28
21
  skillAriaLabel,
29
- focus,
22
+ focus = false,
30
23
  metrics,
31
- icon,
24
+ review = false,
25
+ onReviewClick,
32
26
  onExploreClick
33
27
  } = props;
34
28
  const {
@@ -36,95 +30,76 @@ const LearnerSkillCard = (props, context) => {
36
30
  content,
37
31
  questionsToReview = 0
38
32
  } = metrics;
39
- const translate = (0, _provider.GetTranslateFromContext)(context);
40
33
  const {
41
- color,
42
- name
43
- } = icon;
34
+ skin,
35
+ translate
36
+ } = context;
37
+ const primarySkinColor = (0, _get2.default)('common.primary', skin);
38
+ const reviewLocale = translate('Review');
39
+ const exploreLocale = translate('Explore');
44
40
  const questionsLocale = translate('skill_chart_side_panel_questions_to_review');
45
- const [badgeIconName, badgeLocale, tagTextColor, tagBackgroundColor] = focus ? ['bullseye-arrow', translate('skill_focus'), _colors.COLORS.purple_700, _colors.COLORS.purple_100] : ['shapes', translate('skill'), _colors.COLORS.cm_grey_500, _colors.COLORS.gray];
46
- const headerBackgroundRef = (0, _react.useRef)(null);
47
- const defaultBackground = (0, _react.useMemo)(() => (0, _getBackgroundGradientColor.createGradientBackground)(color, '93%', '100%'), [color]);
48
- const focusBackground = (0, _react.useMemo)(() => (0, _getBackgroundGradientColor.createGradientBackground)(color, '83%', '100%'), [color]);
49
- const handleMouseEnter = (0, _react.useCallback)(() => {
50
- updateBackgroundImage(headerBackgroundRef, focusBackground);
51
- }, [focusBackground]);
52
- const handleMouseLeave = (0, _react.useCallback)(() => {
53
- updateBackgroundImage(headerBackgroundRef, defaultBackground);
54
- }, [defaultBackground]);
55
- return /*#__PURE__*/_react.default.createElement("div", {
56
- "data-testid": `learner-skill-card-wrapper-${cardIndex}`,
57
- onClick: onExploreClick,
58
- className: _style.default.learnerSkillCardContainer,
59
- "aria-label": ariaLabel,
60
- onMouseEnter: handleMouseEnter,
61
- onMouseLeave: handleMouseLeave
62
- }, /*#__PURE__*/_react.default.createElement("div", {
63
- "data-testid": "learner-skill-card-icon-header-wrapper",
64
- ref: headerBackgroundRef,
65
- className: _style.default.iconHeaderWrapper,
66
- style: {
67
- backgroundImage: defaultBackground,
68
- color: tagTextColor
69
- }
70
- }, /*#__PURE__*/_react.default.createElement("div", {
71
- className: _style.default.iconWrapper,
72
- "data-testid": "learner-skill-card-icon-wrapper"
73
- }, /*#__PURE__*/_react.default.createElement(_icon.default, {
74
- iconName: name,
75
- iconColor: color,
76
- size: {
77
- faSize: 20,
78
- wrapperSize: 44
41
+ const skillFocusLocale = translate('skill_focus');
42
+ const buttonReviewProps = {
43
+ customStyle: {
44
+ backgroundColor: '#FFF',
45
+ transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',
46
+ padding: '0px'
79
47
  },
80
- borderRadius: '12px',
81
- gradientBackground: true,
48
+ disabled: !review,
49
+ onClick: onReviewClick,
50
+ 'aria-label': `${skillTitle}, ${reviewLocale}`,
51
+ label: reviewLocale,
52
+ 'data-name': 'learner-skill-card-review-button'
53
+ };
54
+ const buttonExploreProps = {
82
55
  customStyle: {
83
- border: '4px solid white'
56
+ backgroundColor: (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.07))`),
57
+ color: primarySkinColor,
58
+ transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'
59
+ },
60
+ hoverColor: '#FFFFFF',
61
+ hoverBackgroundColor: primarySkinColor,
62
+ onClick: onExploreClick,
63
+ 'aria-label': `${skillTitle}, ${exploreLocale}`,
64
+ label: exploreLocale,
65
+ 'data-name': 'learner-skill-card-explore-button',
66
+ icon: {
67
+ position: 'left',
68
+ faIcon: {
69
+ name: 'compass',
70
+ backgroundColor: (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.07))`),
71
+ color: primarySkinColor,
72
+ size: 16
73
+ }
84
74
  }
85
- }))), /*#__PURE__*/_react.default.createElement("div", {
86
- className: _style.default.learnerSkillCardContent
75
+ };
76
+ return /*#__PURE__*/_react.default.createElement("div", {
77
+ className: _style.default.learnerSkillCardWrapper,
78
+ "data-name": "learner-skill-card-wrapper",
79
+ "aria-label": ariaLabel
80
+ }, questionsToReview ? /*#__PURE__*/_react.default.createElement("div", {
81
+ className: _style.default.skillQuestionsWrapper
87
82
  }, /*#__PURE__*/_react.default.createElement("div", {
83
+ className: _style.default.skillInformation,
84
+ "data-name": "skill-questions"
85
+ }, /*#__PURE__*/_react.default.createElement("span", {
86
+ className: _style.default.skillInformationNumber
87
+ }, questionsToReview), "\xA0", questionsLocale)) : null, /*#__PURE__*/_react.default.createElement("div", {
88
88
  className: _style.default.skillTitleWrapper
89
89
  }, /*#__PURE__*/_react.default.createElement("div", {
90
- className: _style.default.skillFocusBadge,
91
- style: {
92
- backgroundColor: tagBackgroundColor,
93
- color: tagTextColor
94
- }
95
- }, /*#__PURE__*/_react.default.createElement(_icon.default, {
96
- iconName: badgeIconName,
97
- backgroundColor: tagBackgroundColor,
98
- size: {
99
- faSize: 10,
100
- wrapperSize: 16
101
- }
102
- }), badgeLocale), /*#__PURE__*/_react.default.createElement("div", {
103
- className: _style.default.questionWrapper
104
- }, /*#__PURE__*/_react.default.createElement("div", {
105
- "data-name": "skill-card-title",
90
+ "data-name": "skill-title",
106
91
  className: _style.default.skillTitle,
107
92
  "aria-label": skillAriaLabel || skillTitle
108
- }, skillTitle), /*#__PURE__*/_react.default.createElement("div", {
109
- className: _style.default.contentAndQuestionsWrapper
110
- }, /*#__PURE__*/_react.default.createElement("div", {
111
- "data-name": "learner-skill-card-skill-content-number"
112
- }, content, " ", translate('content')), questionsToReview ? /*#__PURE__*/_react.default.createElement("div", {
113
- className: _style.default.skillInformation,
114
- "data-name": "learner-skill-card-skill-questions-wrapper"
93
+ }, skillTitle), focus ? /*#__PURE__*/_react.default.createElement("div", {
94
+ className: _style.default.skillFocusBadge
115
95
  }, /*#__PURE__*/_react.default.createElement(_icon.default, {
116
- iconName: 'circle',
117
- iconColor: _colors.COLORS.cm_grey_400,
96
+ iconName: "bullseye-arrow",
97
+ backgroundColor: "#DDD1FF",
118
98
  size: {
119
- faSize: 4
120
- },
121
- customStyle: {
122
- padding: 0,
123
- height: 'auto'
99
+ faSize: 10,
100
+ wrapperSize: 16
124
101
  }
125
- }), /*#__PURE__*/_react.default.createElement("span", {
126
- "data-name": "learner-skill-card-questions-to-review"
127
- }, questionsToReview), "\xA0", questionsLocale) : null)))), /*#__PURE__*/_react.default.createElement("div", {
102
+ }), skillFocusLocale) : null), content ? /*#__PURE__*/_react.default.createElement("div", {
128
103
  className: _style.default.progressInformations
129
104
  }, /*#__PURE__*/_react.default.createElement(_progressBar.default, {
130
105
  value: score,
@@ -134,11 +109,36 @@ const LearnerSkillCard = (props, context) => {
134
109
  style: {
135
110
  backgroundColor: _colors.COLORS.positive
136
111
  }
137
- })));
112
+ }), /*#__PURE__*/_react.default.createElement("div", {
113
+ className: _style.default.progressInformation,
114
+ "data-name": "completed-percentage"
115
+ }, /*#__PURE__*/_react.default.createElement("span", {
116
+ className: _style.default.progressInformationNumber
117
+ }, score, "%"))) : null, /*#__PURE__*/_react.default.createElement("div", {
118
+ className: _style.default.ctaWrapper,
119
+ "data-name": "cta-wrapper"
120
+ }, /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonReviewProps), /*#__PURE__*/_react.default.createElement("div", {
121
+ className: _style.default.buttonWrapper,
122
+ "data-name": "button-explore-wrapper"
123
+ }, /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonExploreProps))));
138
124
  };
139
125
  LearnerSkillCard.contextTypes = {
126
+ skin: _provider.default.childContextTypes.skin,
140
127
  translate: _provider.default.childContextTypes.translate
141
128
  };
142
- LearnerSkillCard.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
129
+ LearnerSkillCard.propTypes = process.env.NODE_ENV !== "production" ? {
130
+ 'aria-label': _propTypes.default.string,
131
+ skillTitle: _propTypes.default.string,
132
+ skillAriaLabel: _propTypes.default.string,
133
+ focus: _propTypes.default.bool,
134
+ metrics: _propTypes.default.shape({
135
+ score: _propTypes.default.number,
136
+ content: _propTypes.default.number,
137
+ questionsToReview: _propTypes.default.number
138
+ }),
139
+ review: _propTypes.default.bool,
140
+ onReviewClick: _propTypes.default.func,
141
+ onExploreClick: _propTypes.default.func
142
+ } : {};
143
143
  var _default = exports.default = LearnerSkillCard;
144
144
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_provider","_progressBar","_interopRequireDefault","_colors","_getBackgroundGradientColor","_icon","_propTypes","_style","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","MAX_SCORE","updateBackgroundImage","ref","background","current","style","backgroundImage","exports","LearnerSkillCard","props","context","ariaLabel","cardIndex","skillTitle","skillAriaLabel","focus","metrics","icon","onExploreClick","score","content","questionsToReview","translate","GetTranslateFromContext","color","name","questionsLocale","badgeIconName","badgeLocale","tagTextColor","tagBackgroundColor","COLORS","purple_700","purple_100","cm_grey_500","gray","headerBackgroundRef","useRef","defaultBackground","useMemo","createGradientBackground","focusBackground","handleMouseEnter","useCallback","handleMouseLeave","createElement","onClick","className","learnerSkillCardContainer","onMouseEnter","onMouseLeave","iconHeaderWrapper","iconWrapper","iconName","iconColor","size","faSize","wrapperSize","borderRadius","gradientBackground","customStyle","border","learnerSkillCardContent","skillTitleWrapper","skillFocusBadge","backgroundColor","questionWrapper","contentAndQuestionsWrapper","skillInformation","cm_grey_400","padding","height","progressInformations","value","displayInfo","max","progressWrapper","positive","contextTypes","Provider","childContextTypes","propTypes","process","env","NODE_ENV","_default"],"sources":["../../../src/molecule/learner-skill-card/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useRef} from 'react';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport {WebContextValues} from '../../atom/provider/web-context';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport {createGradientBackground} from '../../util/get-background-gradient-color';\nimport FaIcon from '../../atom/icon';\nimport propTypes, {LearnerSkillCardProps} from './prop-types';\nimport style from './style.css';\n\nconst MAX_SCORE = 100;\n\nexport const updateBackgroundImage = (ref: React.RefObject<HTMLDivElement>, background: string) => {\n if (ref.current) {\n ref.current.style.backgroundImage = background;\n }\n};\n\nconst LearnerSkillCard = (props: LearnerSkillCardProps, context: WebContextValues) => {\n const {\n 'aria-label': ariaLabel,\n cardIndex,\n skillTitle,\n skillAriaLabel,\n focus,\n metrics,\n icon,\n onExploreClick\n } = props;\n const {score, content, questionsToReview = 0} = metrics;\n const translate = GetTranslateFromContext(context);\n const {color, name} = icon;\n const questionsLocale = translate('skill_chart_side_panel_questions_to_review') as string;\n const [badgeIconName, badgeLocale, tagTextColor, tagBackgroundColor] = focus\n ? ['bullseye-arrow', translate('skill_focus') as string, COLORS.purple_700, COLORS.purple_100]\n : ['shapes', translate('skill') as string, COLORS.cm_grey_500, COLORS.gray];\n const headerBackgroundRef = useRef<HTMLDivElement | null>(null);\n const defaultBackground = useMemo(() => createGradientBackground(color, '93%', '100%'), [color]);\n const focusBackground = useMemo(() => createGradientBackground(color, '83%', '100%'), [color]);\n const handleMouseEnter = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, focusBackground);\n }, [focusBackground]);\n const handleMouseLeave = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, defaultBackground);\n }, [defaultBackground]);\n return (\n <div\n data-testid={`learner-skill-card-wrapper-${cardIndex}`}\n onClick={onExploreClick}\n className={style.learnerSkillCardContainer}\n aria-label={ariaLabel}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div\n data-testid=\"learner-skill-card-icon-header-wrapper\"\n ref={headerBackgroundRef}\n className={style.iconHeaderWrapper}\n style={{backgroundImage: defaultBackground, color: tagTextColor}}\n >\n <div className={style.iconWrapper} data-testid=\"learner-skill-card-icon-wrapper\">\n <FaIcon\n {...{\n iconName: name,\n iconColor: color,\n size: {\n faSize: 20,\n wrapperSize: 44\n },\n borderRadius: '12px',\n gradientBackground: true,\n customStyle: {border: '4px solid white'}\n }}\n />\n </div>\n </div>\n <div className={style.learnerSkillCardContent}>\n <div className={style.skillTitleWrapper}>\n <div\n className={style.skillFocusBadge}\n style={{\n backgroundColor: tagBackgroundColor,\n color: tagTextColor\n }}\n >\n <FaIcon\n {...{\n iconName: badgeIconName,\n backgroundColor: tagBackgroundColor,\n size: {\n faSize: 10,\n wrapperSize: 16\n }\n }}\n />\n {badgeLocale}\n </div>\n\n <div className={style.questionWrapper}>\n <div\n data-name=\"skill-card-title\"\n className={style.skillTitle}\n aria-label={skillAriaLabel || skillTitle}\n >\n {skillTitle}\n </div>\n <div className={style.contentAndQuestionsWrapper}>\n <div data-name=\"learner-skill-card-skill-content-number\">\n {content} {translate('content')}\n </div>\n {questionsToReview ? (\n <div\n className={style.skillInformation}\n data-name=\"learner-skill-card-skill-questions-wrapper\"\n >\n <FaIcon\n {...{\n iconName: 'circle',\n iconColor: COLORS.cm_grey_400,\n size: {faSize: 4},\n customStyle: {padding: 0, height: 'auto'}\n }}\n />\n <span data-name=\"learner-skill-card-questions-to-review\">\n {questionsToReview}\n </span>\n &nbsp;{questionsLocale}\n </div>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n <div className={style.progressInformations}>\n <ProgressBar\n value={score}\n displayInfo={false}\n max={MAX_SCORE}\n className={style.progressWrapper}\n style={{backgroundColor: COLORS.positive}}\n />\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = propTypes;\n\nexport default LearnerSkillCard;\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,uBAAA,CAAAC,OAAA;AAEA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,2BAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,UAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,MAAA,GAAAL,sBAAA,CAAAH,OAAA;AAAgC,SAAAG,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAA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,EAAElC,cAAM,CAAC8C;IAAQ;EAAE,CAC3C,CACE,CACF,CAAC;AAEV,CAAC;AAEDrE,gBAAgB,CAACsE,YAAY,GAAG;EAC9BxD,SAAS,EAAEyD,iBAAQ,CAACC,iBAAiB,CAAC1D;AACxC,CAAC;AAEDd,gBAAgB,CAACyE,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,kBAAS;AAAC,IAAAI,QAAA,GAAA9E,OAAA,CAAAzB,OAAA,GAExB0B,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_cssColorFunction","_propTypes","_icon","_buttonLink","_provider","_progressBar","_colors","_style","e","__esModule","default","MAX_SCORE","LearnerSkillCard","props","context","ariaLabel","skillTitle","skillAriaLabel","focus","metrics","review","onReviewClick","onExploreClick","score","content","questionsToReview","skin","translate","primarySkinColor","_get2","reviewLocale","exploreLocale","questionsLocale","skillFocusLocale","buttonReviewProps","customStyle","backgroundColor","transition","padding","disabled","onClick","label","buttonExploreProps","convert","color","hoverColor","hoverBackgroundColor","icon","position","faIcon","name","size","createElement","className","style","learnerSkillCardWrapper","skillQuestionsWrapper","skillInformation","skillInformationNumber","skillTitleWrapper","skillFocusBadge","iconName","faSize","wrapperSize","progressInformations","value","displayInfo","max","progressWrapper","COLORS","positive","progressInformation","progressInformationNumber","ctaWrapper","buttonWrapper","contextTypes","Provider","childContextTypes","propTypes","process","env","NODE_ENV","PropTypes","string","bool","shape","number","func","_default","exports"],"sources":["../../../src/molecule/learner-skill-card/index.js"],"sourcesContent":["import React from 'react';\nimport {convert} from 'css-color-function';\nimport {get} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport Provider from '../../atom/provider';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst MAX_SCORE = 100;\n\nconst LearnerSkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n skillTitle,\n skillAriaLabel,\n focus = false,\n metrics,\n review = false,\n onReviewClick,\n onExploreClick\n } = props;\n const {score, content, questionsToReview = 0} = metrics;\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const reviewLocale = translate('Review');\n const exploreLocale = translate('Explore');\n const questionsLocale = translate('skill_chart_side_panel_questions_to_review');\n const skillFocusLocale = translate('skill_focus');\n\n const buttonReviewProps = {\n customStyle: {\n backgroundColor: '#FFF',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n padding: '0px'\n },\n disabled: !review,\n onClick: onReviewClick,\n 'aria-label': `${skillTitle}, ${reviewLocale}`,\n label: reviewLocale,\n 'data-name': 'learner-skill-card-review-button'\n };\n\n const buttonExploreProps = {\n customStyle: {\n backgroundColor: convert(`color(${primarySkinColor} a(0.07))`),\n color: primarySkinColor,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n hoverColor: '#FFFFFF',\n hoverBackgroundColor: primarySkinColor,\n onClick: onExploreClick,\n 'aria-label': `${skillTitle}, ${exploreLocale}`,\n label: exploreLocale,\n 'data-name': 'learner-skill-card-explore-button',\n icon: {\n position: 'left',\n faIcon: {\n name: 'compass',\n backgroundColor: convert(`color(${primarySkinColor} a(0.07))`),\n color: primarySkinColor,\n size: 16\n }\n }\n };\n return (\n <div\n className={style.learnerSkillCardWrapper}\n data-name=\"learner-skill-card-wrapper\"\n aria-label={ariaLabel}\n >\n {questionsToReview ? (\n <div className={style.skillQuestionsWrapper}>\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{questionsToReview}</span>\n &nbsp;{questionsLocale}\n </div>\n </div>\n ) : null}\n <div className={style.skillTitleWrapper}>\n <div\n data-name=\"skill-title\"\n className={style.skillTitle}\n aria-label={skillAriaLabel || skillTitle}\n >\n {skillTitle}\n </div>\n {focus ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 10,\n wrapperSize: 16\n }}\n />\n {skillFocusLocale}\n </div>\n ) : null}\n </div>\n {content ? (\n <div className={style.progressInformations}>\n <ProgressBar\n value={score}\n displayInfo={false}\n max={MAX_SCORE}\n className={style.progressWrapper}\n style={{backgroundColor: COLORS.positive}}\n />\n <div className={style.progressInformation} data-name=\"completed-percentage\">\n <span className={style.progressInformationNumber}>{score}%</span>\n </div>\n </div>\n ) : null}\n <div className={style.ctaWrapper} data-name=\"cta-wrapper\">\n <ButtonLink {...buttonReviewProps} />\n <div className={style.buttonWrapper} data-name=\"button-explore-wrapper\">\n <ButtonLink {...buttonExploreProps} />\n </div>\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = {\n 'aria-label': PropTypes.string,\n skillTitle: PropTypes.string,\n skillAriaLabel: PropTypes.string,\n focus: PropTypes.bool,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n content: PropTypes.number,\n questionsToReview: PropTypes.number\n }),\n review: PropTypes.bool,\n onReviewClick: PropTypes.func,\n onExploreClick: PropTypes.func\n};\n\nexport default LearnerSkillCard;\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,YAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAT,sBAAA,CAAAC,OAAA;AAAgC,SAAAD,uBAAAU,CAAA,WAAAA,CAAA,IA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CACF,CAAC;AAEV,CAAC;AAED9B,gBAAgB,CAAC+D,YAAY,GAAG;EAC9BjD,IAAI,EAAEkD,iBAAQ,CAACC,iBAAiB,CAACnD,IAAI;EACrCC,SAAS,EAAEiD,iBAAQ,CAACC,iBAAiB,CAAClD;AACxC,CAAC;AAEDf,gBAAgB,CAACkE,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EAC3B,YAAY,EAAEC,kBAAS,CAACC,MAAM;EAC9BnE,UAAU,EAAEkE,kBAAS,CAACC,MAAM;EAC5BlE,cAAc,EAAEiE,kBAAS,CAACC,MAAM;EAChCjE,KAAK,EAAEgE,kBAAS,CAACE,IAAI;EACrBjE,OAAO,EAAE+D,kBAAS,CAACG,KAAK,CAAC;IACvB9D,KAAK,EAAE2D,kBAAS,CAACI,MAAM;IACvB9D,OAAO,EAAE0D,kBAAS,CAACI,MAAM;IACzB7D,iBAAiB,EAAEyD,kBAAS,CAACI;EAC/B,CAAC,CAAC;EACFlE,MAAM,EAAE8D,kBAAS,CAACE,IAAI;EACtB/D,aAAa,EAAE6D,kBAAS,CAACK,IAAI;EAC7BjE,cAAc,EAAE4D,kBAAS,CAACK;AAC5B,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA/E,OAAA,GAEaE,gBAAgB","ignoreList":[]}
@@ -18,52 +18,58 @@
18
18
  font-style: normal;
19
19
  }
20
20
 
21
- .learnerSkillCardContainer {
21
+ .learnerSkillCardWrapper {
22
22
  display: flex;
23
23
  flex-direction: column;
24
- width: 258px;
25
- height: 220px;
24
+ max-width: 258px;
25
+ min-width: 254px;
26
+ width: 100%;
27
+ min-height: 252px;
26
28
  box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.04);
27
29
  transition: box-shadow 0.15s ease-in-out;
28
30
  border-radius: 12px;
31
+ padding: 24px;
29
32
  box-sizing: border-box;
30
- cursor: pointer;
31
- position: relative;
32
33
  }
33
34
 
34
- .learnerSkillCardContainer:hover {
35
- box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.10);
35
+ .learnerSkillCardWrapper:hover {
36
+ box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.10);
36
37
  }
37
38
 
38
- .skillInformation {
39
+ .skillQuestionsWrapper,
40
+ .progressInformations {
41
+ display: flex;
42
+ justify-content: space-between;
43
+ margin-bottom: 8px;
44
+ }
45
+
46
+ .skillInformation,
47
+ .progressInformation {
39
48
  composes: textBase;
40
49
  font-weight: 400;
41
- font-size: 12px;
42
- line-height: 16px;
50
+ font-size: 10px;
51
+ line-height: 12px;
43
52
  color: cm_grey_400;
44
- display: flex;
45
- align-items: center;
46
53
  }
47
54
 
55
+ .skillInformationNumber,
56
+ .progressInformationNumber {
57
+ color: #000;
58
+ }
48
59
 
49
60
  .skillTitleWrapper {
50
61
  display: flex;
51
- gap: 8px;
52
62
  flex-direction: column;
53
- justify-content: space-between;
54
63
  min-height: 68px;
64
+ margin-bottom: 24px;
55
65
  }
56
66
 
57
67
  .skillTitle {
58
68
  composes: textBase;
59
69
  font-weight: 600;
60
70
  font-size: 16px;
61
- display: -webkit-box;
62
- -webkit-line-clamp: 2;
63
- -webkit-box-orient: vertical;
64
- line-clamp: 2;
65
- text-overflow: ellipsis;
66
- overflow: hidden;
71
+ line-height: 22px;
72
+ margin-bottom: 8px;
67
73
  }
68
74
 
69
75
  .skillFocusBadge {
@@ -72,67 +78,40 @@
72
78
  height: 12px;
73
79
  width: fit-content;
74
80
  align-items: center;
81
+ background-color: #DDD1FF;
75
82
  border-radius: 24px;
76
83
  padding: 2px 4px;
77
84
  font-size: 10px;
78
85
  line-height: 12px;
79
86
  font-weight: 600;
87
+ color: #3900D6;
80
88
  margin-right: 8px;
81
89
  }
82
90
 
83
91
  .progressWrapper {
84
- position: absolute;
85
- bottom: 16px;
86
- left: 40px;
87
- width: 178px;
92
+ position: relative;
93
+ top: 4px;
94
+ left: 0;
95
+ width: 100%;
88
96
  height: 4px;
89
97
  border-radius: 2px;
90
98
  overflow: hidden;
91
99
  background: light;
100
+ margin-bottom: 8px;
92
101
  }
93
102
 
94
103
  .progressInformations {
95
- padding: 16px 24px;
96
- }
97
-
98
- .contentAndQuestionsWrapper {
99
- composes: textBase;
100
- font-weight: 400;
101
- font-size: 12px;
102
- line-height: 16px;
103
- color: cm_grey_400;
104
104
  display: flex;
105
- align-items: center;
106
- }
107
-
108
- .iconWrapper {
109
- border-radius: 12px;
110
- }
111
-
112
- .iconHeaderWrapper {
113
- padding: 12px 0 12px 16px;
114
- border-radius: 12px 12px 0 0;
115
- border: 2px solid white;
116
- background-position-y: -2px;
117
- background-repeat: repeat-x;
118
- background-color: white;
119
- }
120
-
121
- .learnerSkillCardContainer:hover .iconHeaderWrapper {
122
- border: 2px solid transparent;
123
- cursor: pointer;
105
+ gap: 8px;
106
+ min-height: 12px;
107
+ margin-bottom: 24px;
124
108
  }
125
109
 
126
- .learnerSkillCardContent {
127
- padding: 16px;
128
- padding-bottom: 0;
110
+ .ctaWrapper {
111
+ margin-top: auto;
129
112
  display: flex;
130
- gap: 8px;
131
- flex-direction: column;
132
113
  }
133
114
 
134
- .questionWrapper {
115
+ .buttonWrapper {
135
116
  display: flex;
136
- gap: 8px;
137
- flex-direction: column;
138
- }
117
+ }
@@ -46,6 +46,7 @@ declare namespace MyLearning {
46
46
  const learnerFeature: PropTypes.Requireable<boolean>;
47
47
  const isLoading: PropTypes.Requireable<boolean>;
48
48
  const onSkillFocusConfirm: PropTypes.Requireable<(...args: any[]) => any>;
49
+ const onReviewSkill: PropTypes.Requireable<(...args: any[]) => any>;
49
50
  const onExploreSkill: PropTypes.Requireable<(...args: any[]) => any>;
50
51
  const learningPriorities: PropTypes.Requireable<PropTypes.InferProps<{
51
52
  contentType: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/my-learning/index.js"],"names":[],"mappings":";AAmHA,mEAwZC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/my-learning/index.js"],"names":[],"mappings":";AAgHA,mEA+ZC"}
@@ -30,13 +30,11 @@ var _searchValueIncluded = _interopRequireDefault(require("../../util/search-val
30
30
  var _timeFormat = require("../../util/time-format");
31
31
  var _cardsList = _interopRequireDefault(require("../../molecule/dashboard/cards-list"));
32
32
  var _title = _interopRequireDefault(require("../../atom/title"));
33
- var _colors = require("../../variables/colors");
34
33
  var _style = _interopRequireDefault(require("./style.css"));
35
34
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
36
35
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
37
36
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
38
37
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
39
- const roundScore = value => Math.round(value * 10) / 10;
40
38
  const ChangeSkillFocusButton = (props, context) => {
41
39
  const {
42
40
  onClick
@@ -55,7 +53,7 @@ const ChangeSkillFocusButton = (props, context) => {
55
53
  transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'
56
54
  },
57
55
  hoverBackgroundColor: primarySkinColor,
58
- hoverColor: _colors.COLORS.white,
56
+ hoverColor: "#FFFFFF",
59
57
  onClick: onClick,
60
58
  label: translate('skills_change_focus'),
61
59
  "data-name": "change-skill-focus-button",
@@ -91,14 +89,14 @@ const FilterButton = (props, context) => {
91
89
  const Content = (0, _react.useCallback)(() => /*#__PURE__*/_react.default.createElement("div", null, filter, /*#__PURE__*/_react.default.createElement("span", {
92
90
  className: active ? _style.default.skillFilterNumber : _style.default.skillFilterNumberInActive,
93
91
  style: {
94
- backgroundColor: active ? (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.07))`) : _colors.COLORS.gray,
95
- color: active ? primarySkinColor : _colors.COLORS.cm_grey_500
92
+ backgroundColor: active ? (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.07))`) : '#EAEAEB',
93
+ color: active ? primarySkinColor : '#515161'
96
94
  }
97
95
  }, skillTotal)), [filter, skillTotal, active, primarySkinColor]);
98
96
  const buttonProps = {
99
97
  customStyle: {
100
- backgroundColor: active ? (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.07))`) : _colors.COLORS.white,
101
- color: active ? primarySkinColor : _colors.COLORS.cm_grey_400,
98
+ backgroundColor: active ? (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.07))`) : '#FFFFFF',
99
+ color: active ? primarySkinColor : '#9999A8',
102
100
  transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',
103
101
  width: 'fit-content'
104
102
  },
@@ -127,6 +125,7 @@ const MyLearning = (props, context) => {
127
125
  learnerFeature = true,
128
126
  isLoading,
129
127
  onSkillFocusConfirm,
128
+ onReviewSkill,
130
129
  onExploreSkill,
131
130
  learningPriorities
132
131
  } = props;
@@ -139,12 +138,12 @@ const MyLearning = (props, context) => {
139
138
  const [selectedSkillsList, setSelectedSkillsList] = (0, _react.useState)(selectedSkills);
140
139
  const [skillFocusSelectedOnChart, setSkillFocusSelectedOnChart] = (0, _react.useState)(undefined);
141
140
  const [searchValue, setSearchValue] = (0, _react.useState)('');
142
- const [searchResults, setSearchResults] = (0, _react.useState)((0, _sortBy2.default)(skillRef => (0, _getOr2.default)(0, [skillRef, 'stats', 'score'], skillsInformation), skills));
141
+ const [searchResults, setSearchResults] = (0, _react.useState)((0, _sortBy2.default)(skillRef => -(0, _getOr2.default)(0, [skillRef, 'stats', 'score'], skillsInformation), skills));
143
142
  const [activeFilter, setActiveFilter] = (0, _react.useState)('all');
144
143
  const skillsReviewReady = (0, _react.useMemo)(() => {
145
144
  return searchResults.filter(skill => skillsInformation[skill] ? skillsInformation[skill].availableForReview : false);
146
145
  }, [searchResults, skillsInformation]);
147
- const graphDatas = (0, _react.useMemo)(() => (0, _pipe2.default)((0, _map2.default)(skill => [skill, roundScore((0, _getOr2.default)(0, [skill, 'stats', 'score'], skillsInformation))]), _fromPairs2.default)(selectedSkillsList), [selectedSkillsList, skillsInformation]);
146
+ const graphDatas = (0, _react.useMemo)(() => (0, _pipe2.default)((0, _map2.default)(skill => [skill, (0, _getOr2.default)(0, [skill, 'stats', 'score'], skillsInformation).toFixed(1)]), _fromPairs2.default)(selectedSkillsList), [selectedSkillsList, skillsInformation]);
148
147
  const graphLegends = (0, _react.useMemo)(() => (0, _pipe2.default)((0, _map2.default)(skill => [skill, skillsLocales[skill]]), _fromPairs2.default)(selectedSkillsList), [selectedSkillsList, skillsLocales]);
149
148
  const filters = (0, _react.useMemo)(() => {
150
149
  return {
@@ -168,7 +167,7 @@ const MyLearning = (props, context) => {
168
167
  legend: skillChartPaneLegends,
169
168
  icon: {
170
169
  iconName: 'book-open-cover',
171
- backgroundColor: _colors.COLORS.turquoise_100
170
+ backgroundColor: '#D9F4F7'
172
171
  }
173
172
  }, {
174
173
  title: translate('skill_chart_side_panel_learning_hours'),
@@ -176,7 +175,7 @@ const MyLearning = (props, context) => {
176
175
  legend: skillChartPaneLegends,
177
176
  icon: {
178
177
  iconName: 'clock',
179
- backgroundColor: _colors.COLORS.pink_100
178
+ backgroundColor: '#FAD6DE'
180
179
  }
181
180
  }, {
182
181
  title: translate('skill_chart_side_panel_questions_to_review'),
@@ -184,7 +183,7 @@ const MyLearning = (props, context) => {
184
183
  legend: skillChartPaneLegends,
185
184
  icon: {
186
185
  iconName: 'circle-question',
187
- backgroundColor: _colors.COLORS.orange_100
186
+ backgroundColor: '#FFDCD1'
188
187
  }
189
188
  }];
190
189
  const skillsScore = (0, _react.useMemo)(() => (0, _pipe2.default)((0, _map2.default)(skill => [skill, (0, _getOr2.default)(0, [skill, 'stats', 'score'], skillsInformation)]), _fromPairs2.default)(skills), [skills, skillsInformation]);
@@ -218,9 +217,9 @@ const MyLearning = (props, context) => {
218
217
  subtitle: translate('learning_priorities_description'),
219
218
  icon: {
220
219
  iconName: 'sign-post',
221
- iconColor: _colors.COLORS.cm_orange_800,
220
+ iconColor: '#A32700',
222
221
  borderRadius: '12px',
223
- backgroundColor: _colors.COLORS.orange_100
222
+ backgroundColor: '#FFDCD1'
224
223
  },
225
224
  tag: {
226
225
  label: `${(0, _size2.default)(learningPriorities.cards)}`,
@@ -251,7 +250,7 @@ const MyLearning = (props, context) => {
251
250
  className: _style.default.skillFocusHeaderIcon
252
251
  }, /*#__PURE__*/_react.default.createElement(_icon.default, {
253
252
  iconName: "bullseye-arrow",
254
- backgroundColor: _colors.COLORS.purple_100,
253
+ backgroundColor: "#DDD1FF",
255
254
  borderRadius: "12px",
256
255
  size: {
257
256
  faSize: 20,
@@ -319,7 +318,7 @@ const MyLearning = (props, context) => {
319
318
  className: _style.default.skillListHeaderIcon
320
319
  }, /*#__PURE__*/_react.default.createElement(_icon.default, {
321
320
  iconName: "dumbbell",
322
- backgroundColor: _colors.COLORS.yellow_100,
321
+ backgroundColor: "#FFF9D1",
323
322
  size: {
324
323
  faSize: 20,
325
324
  wrapperSize: 48
@@ -374,7 +373,7 @@ const MyLearning = (props, context) => {
374
373
  onClick: handleSearchReset
375
374
  }, translate('empty_search_result_clear_search'))) : /*#__PURE__*/_react.default.createElement("div", {
376
375
  className: _style.default.skillListContainer
377
- }, activeFilter === 'review' && filters[activeFilter].length === 0 ? /*#__PURE__*/_react.default.createElement("div", {
376
+ }, activeFilter === 'review_mode_available' && filters[activeFilter].length === 0 ? /*#__PURE__*/_react.default.createElement("div", {
378
377
  className: _style.default.skillListEmptyContainer
379
378
  }, /*#__PURE__*/_react.default.createElement(_reviewNoSkills.default, {
380
379
  titleNoSkills: translate('review_skill_empty'),
@@ -388,6 +387,9 @@ const MyLearning = (props, context) => {
388
387
  contentCompleted: 0,
389
388
  questionsToReview: 0
390
389
  };
390
+ function handleReviewSkill() {
391
+ onReviewSkill(skill);
392
+ }
391
393
  function handleExploreSkill() {
392
394
  onExploreSkill(skill);
393
395
  }
@@ -396,25 +398,18 @@ const MyLearning = (props, context) => {
396
398
  content,
397
399
  questionsToReview
398
400
  } = skillsInformation[skill] ? skillsInformation[skill].stats : defaultStats;
399
- const {
400
- color,
401
- name
402
- } = (0, _get2.default)([skill, 'icon'], skillsInformation);
403
401
  return /*#__PURE__*/_react.default.createElement("div", {
404
402
  key: index
405
403
  }, /*#__PURE__*/_react.default.createElement(_learnerSkillCard.default, {
406
404
  skillTitle: skillsLocales[skill],
407
- cardIndex: index,
408
405
  focus: selectedSkills.includes(skill),
409
406
  metrics: {
410
- score,
407
+ score: score.toFixed(1),
411
408
  content,
412
409
  questionsToReview
413
410
  },
414
- icon: {
415
- color,
416
- name
417
- },
411
+ review: skillsInformation[skill] ? skillsInformation[skill].availableForReview : false,
412
+ onReviewClick: handleReviewSkill,
418
413
  onExploreClick: handleExploreSkill
419
414
  }));
420
415
  }))));
@@ -440,6 +435,7 @@ MyLearning.propTypes = process.env.NODE_ENV !== "production" ? {
440
435
  learnerFeature: _propTypes.default.bool,
441
436
  isLoading: _propTypes.default.bool,
442
437
  onSkillFocusConfirm: _propTypes.default.func,
438
+ onReviewSkill: _propTypes.default.func,
443
439
  onExploreSkill: _propTypes.default.func,
444
440
  learningPriorities: _propTypes.default.shape(_cardsList.default.propTypes)
445
441
  } : {};