@coorpacademy/components 11.32.48 → 11.32.50

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 (83) hide show
  1. package/es/atom/input-switch/style.css +9 -1
  2. package/es/molecule/banner/index.d.ts +5 -4
  3. package/es/molecule/banner/index.d.ts.map +1 -1
  4. package/es/molecule/banner/index.js +93 -37
  5. package/es/molecule/banner/index.js.map +1 -1
  6. package/es/molecule/banner/style.css +27 -5
  7. package/es/molecule/progress-wrapper/style.css +2 -10
  8. package/es/template/back-office/brand-update/index.d.ts +5 -4
  9. package/es/template/certification-detail/index.js +2 -2
  10. package/es/template/certification-detail/index.js.map +1 -1
  11. package/es/template/playlist-detail/index.d.ts +1 -0
  12. package/es/template/playlist-detail/index.d.ts.map +1 -1
  13. package/es/template/playlist-detail/index.js +6 -3
  14. package/es/template/playlist-detail/index.js.map +1 -1
  15. package/es/template/skill-detail/all-courses.css +4 -0
  16. package/es/template/skill-detail/all-courses.d.ts +1 -0
  17. package/es/template/skill-detail/all-courses.d.ts.map +1 -1
  18. package/es/template/skill-detail/all-courses.js +16 -3
  19. package/es/template/skill-detail/all-courses.js.map +1 -1
  20. package/es/template/skill-detail/index.d.ts +1 -0
  21. package/es/template/skill-detail/index.d.ts.map +1 -1
  22. package/es/template/skill-detail/index.js +6 -3
  23. package/es/template/skill-detail/index.js.map +1 -1
  24. package/es/variables/colors.d.ts +3 -0
  25. package/es/variables/colors.d.ts.map +1 -1
  26. package/es/variables/colors.js +3 -0
  27. package/es/variables/colors.js.map +1 -1
  28. package/lib/atom/input-switch/style.css +9 -1
  29. package/lib/molecule/banner/index.d.ts +5 -4
  30. package/lib/molecule/banner/index.d.ts.map +1 -1
  31. package/lib/molecule/banner/index.js +105 -38
  32. package/lib/molecule/banner/index.js.map +1 -1
  33. package/lib/molecule/banner/style.css +27 -5
  34. package/lib/molecule/progress-wrapper/style.css +2 -10
  35. package/lib/template/back-office/brand-update/index.d.ts +5 -4
  36. package/lib/template/certification-detail/index.js +2 -2
  37. package/lib/template/certification-detail/index.js.map +1 -1
  38. package/lib/template/playlist-detail/index.d.ts +1 -0
  39. package/lib/template/playlist-detail/index.d.ts.map +1 -1
  40. package/lib/template/playlist-detail/index.js +6 -3
  41. package/lib/template/playlist-detail/index.js.map +1 -1
  42. package/lib/template/skill-detail/all-courses.css +4 -0
  43. package/lib/template/skill-detail/all-courses.d.ts +1 -0
  44. package/lib/template/skill-detail/all-courses.d.ts.map +1 -1
  45. package/lib/template/skill-detail/all-courses.js +17 -3
  46. package/lib/template/skill-detail/all-courses.js.map +1 -1
  47. package/lib/template/skill-detail/index.d.ts +1 -0
  48. package/lib/template/skill-detail/index.d.ts.map +1 -1
  49. package/lib/template/skill-detail/index.js +6 -3
  50. package/lib/template/skill-detail/index.js.map +1 -1
  51. package/lib/variables/colors.d.ts +3 -0
  52. package/lib/variables/colors.d.ts.map +1 -1
  53. package/lib/variables/colors.js +3 -0
  54. package/lib/variables/colors.js.map +1 -1
  55. package/locales/bs/global.json +2 -0
  56. package/locales/cs/global.json +2 -0
  57. package/locales/de/global.json +2 -0
  58. package/locales/en/global.json +2 -0
  59. package/locales/es/global.json +2 -0
  60. package/locales/et/global.json +2 -0
  61. package/locales/fi/global.json +2 -0
  62. package/locales/fr/global.json +2 -0
  63. package/locales/hr/global.json +2 -0
  64. package/locales/hu/global.json +2 -0
  65. package/locales/hy/global.json +2 -0
  66. package/locales/it/global.json +2 -0
  67. package/locales/ja/global.json +2 -0
  68. package/locales/ko/global.json +2 -0
  69. package/locales/nl/global.json +2 -0
  70. package/locales/pl/global.json +2 -0
  71. package/locales/pt/global.json +2 -0
  72. package/locales/ro/global.json +2 -0
  73. package/locales/ru/global.json +2 -0
  74. package/locales/sk/global.json +2 -0
  75. package/locales/sl/global.json +2 -0
  76. package/locales/sv/global.json +2 -0
  77. package/locales/tl/global.json +2 -0
  78. package/locales/tr/global.json +2 -0
  79. package/locales/uk/global.json +2 -0
  80. package/locales/vi/global.json +2 -0
  81. package/locales/zh/global.json +2 -0
  82. package/locales/zh_TW/global.json +2 -0
  83. package/package.json +2 -2
@@ -86,6 +86,10 @@
86
86
  left: 30px;
87
87
  }
88
88
 
89
+ .coorpmanager input:checked ~ label::after {
90
+ left: 23px;
91
+ }
92
+
89
93
  .checkbox:disabled ~ label {
90
94
  background: light;
91
95
  pointer-events: none;
@@ -108,6 +112,10 @@
108
112
  min-height: 24px;
109
113
  }
110
114
 
115
+ .coorpmanager .title {
116
+ width: fit-content;
117
+ }
118
+
111
119
  .description {
112
120
  font-family: 'Gilroy';
113
121
  font-weight: 500;
@@ -126,6 +134,7 @@
126
134
  }
127
135
 
128
136
  .coorpmanager label::after, .coorpmanagerModified label::after {
137
+ top: 1px;
129
138
  width: 22px;
130
139
  height: 22px;
131
140
  }
@@ -134,7 +143,6 @@
134
143
  font-family: Gilroy;
135
144
  font-weight: bold;
136
145
  color: black;
137
- min-width: 190px;
138
146
  }
139
147
 
140
148
  .coorpmanager .checkbox:checked ~ label {
@@ -5,10 +5,11 @@ declare namespace Banner {
5
5
  const bannerKey: PropTypes.Requireable<string>;
6
6
  const type: PropTypes.Requireable<string>;
7
7
  const message: PropTypes.Validator<string>;
8
- const firstCTA: PropTypes.Requireable<(...args: any[]) => any>;
9
- const firstCTALabel: PropTypes.Requireable<string>;
10
- const secondCTALabel: PropTypes.Requireable<string>;
11
- const secondCTA: PropTypes.Requireable<(...args: any[]) => any>;
8
+ const cta: PropTypes.Requireable<(PropTypes.InferProps<{
9
+ label: PropTypes.Requireable<string>;
10
+ type: PropTypes.Requireable<string>;
11
+ action: PropTypes.Requireable<(...args: any[]) => any>;
12
+ }> | null | undefined)[]>;
12
13
  const temporary: PropTypes.Requireable<boolean>;
13
14
  const onEnd: PropTypes.Requireable<(...args: any[]) => any>;
14
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/banner/index.js"],"names":[],"mappings":";AAuBA,iDAmDC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/banner/index.js"],"names":[],"mappings":";AA0BA,iDAmFC"}
@@ -1,34 +1,101 @@
1
+ import _size from "lodash/fp/size";
2
+ import _map from "lodash/fp/map";
3
+ import _isEmpty from "lodash/fp/isEmpty";
4
+ import _noop from "lodash/fp/noop";
1
5
  import _keys from "lodash/fp/keys";
2
- import React from 'react';
6
+ import React, { useState, useCallback } from 'react';
3
7
  import PropTypes from 'prop-types';
4
8
  import classnames from 'classnames';
5
- import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as QuestionIcon, NovaCompositionCoorpacademyValidate as ValidateIcon } from '@coorpacademy/nova-icons';
9
+ import { COLORS } from '../../variables/colors';
6
10
  import ButtonLink from '../../atom/button-link';
11
+ import Icon from '../../atom/icon';
12
+ import InputSwitch from '../../atom/input-switch';
7
13
  import style from './style.css';
8
- const ICONS = {
9
- success: ValidateIcon,
10
- error: QuestionIcon,
11
- warning: QuestionIcon
14
+
15
+ const uncappedMap = _map.convert({
16
+ cap: false
17
+ });
18
+
19
+ const TYPES = {
20
+ success: ['circle-check', COLORS.cm_positive_200],
21
+ error: ['triangle-exclamation', COLORS.cm_negative_200],
22
+ warning: ['circle-exclamation', COLORS.cm_yellow_400],
23
+ info: ['circle-info', COLORS.cm_grey_500]
12
24
  };
13
25
  const STYLES = {
14
26
  success: style.success,
15
27
  error: style.error,
16
- warning: style.warning
28
+ warning: style.warning,
29
+ info: style.info
17
30
  };
18
31
 
19
32
  const Banner = props => {
20
33
  const {
21
34
  type,
22
35
  message,
23
- firstCTA,
24
- firstCTALabel,
25
- secondCTALabel,
26
- secondCTA,
36
+ cta = [],
27
37
  temporary,
28
38
  bannerKey,
29
39
  onEnd
30
40
  } = props;
31
- const Icon = ICONS[type];
41
+ const [switchValue, setSwitchValue] = useState(false);
42
+ const ButtonSeparator = /*#__PURE__*/React.createElement("div", {
43
+ className: classnames(style.buttonsBar, STYLES[type])
44
+ });
45
+ const handleSwitchToggle = useCallback(action => e => {
46
+ const newSwitchValue = !switchValue;
47
+ setSwitchValue(newSwitchValue);
48
+ action(newSwitchValue);
49
+ }, [switchValue]);
50
+
51
+ const buildButton = ({
52
+ type: buttonType = 'button',
53
+ label,
54
+ action = _noop
55
+ }) => {
56
+ const commonStyle = classnames(style.button, STYLES[type]);
57
+
58
+ switch (buttonType) {
59
+ case 'switch':
60
+ return /*#__PURE__*/React.createElement("div", {
61
+ className: commonStyle
62
+ }, /*#__PURE__*/React.createElement(InputSwitch, {
63
+ id: "show-microlearning-switch",
64
+ theme: "coorpmanager",
65
+ title: label,
66
+ value: switchValue,
67
+ onChange: handleSwitchToggle(action),
68
+ "data-name": `banner-switch-cta`,
69
+ "aria-label": label
70
+ }));
71
+
72
+ default:
73
+ return /*#__PURE__*/React.createElement("div", {
74
+ className: commonStyle
75
+ }, /*#__PURE__*/React.createElement(ButtonLink, {
76
+ "data-name": "banner-button-cta",
77
+ "aria-label": label,
78
+ label: label,
79
+ onClick: action,
80
+ type: "text",
81
+ customStyle: {
82
+ padding: 0
83
+ }
84
+ }));
85
+ }
86
+ };
87
+
88
+ const buildCta = ctaOptions => {
89
+ return uncappedMap((options, i) => {
90
+ if (_isEmpty(options)) return null;
91
+ return /*#__PURE__*/React.createElement("div", {
92
+ className: style.ctaWrapper,
93
+ key: i
94
+ }, i > 0 && i <= _size(options) ? ButtonSeparator : null, buildButton(options));
95
+ }, ctaOptions);
96
+ };
97
+
98
+ const [iconName, iconColor] = TYPES[type];
32
99
  return /*#__PURE__*/React.createElement("div", {
33
100
  key: bannerKey,
34
101
  className: classnames(style.banner, STYLES[type], temporary && style.temporaryBanner),
@@ -38,36 +105,25 @@ const Banner = props => {
38
105
  "data-name": `${type}-banner-message`,
39
106
  className: style.message
40
107
  }, /*#__PURE__*/React.createElement(Icon, {
41
- className: classnames(style.icon, temporary && style.temporaryIcon)
42
- }), message), firstCTALabel ? /*#__PURE__*/React.createElement("div", {
43
- className: classnames(style.button, STYLES[type])
44
- }, /*#__PURE__*/React.createElement(ButtonLink, {
45
- "data-name": "first-banner-cta",
46
- "aria-label": firstCTALabel,
47
- label: firstCTALabel,
48
- onClick: firstCTA,
49
- type: "text"
50
- })) : null, firstCTALabel && secondCTALabel ? /*#__PURE__*/React.createElement("div", {
51
- className: classnames(style.buttonsBar, STYLES[type])
52
- }) : null, secondCTALabel ? /*#__PURE__*/React.createElement("div", {
53
- className: classnames(style.button, STYLES[type])
54
- }, /*#__PURE__*/React.createElement(ButtonLink, {
55
- "data-name": "second-banner-cta",
56
- onClick: secondCTA,
57
- "aria-label": secondCTALabel,
58
- label: secondCTALabel,
59
- type: "text"
60
- })) : null);
108
+ iconName: iconName,
109
+ iconColor: iconColor,
110
+ className: classnames(style.icon, temporary && style.temporaryIcon),
111
+ customStyle: {
112
+ padding: 0
113
+ }
114
+ }), message), buildCta(cta));
61
115
  };
62
116
 
117
+ const ctaPropTypes = process.env.NODE_ENV !== "production" ? PropTypes.shape({
118
+ label: PropTypes.string,
119
+ type: PropTypes.oneOf(['button', 'switch']),
120
+ action: PropTypes.func
121
+ }) : {};
63
122
  Banner.propTypes = process.env.NODE_ENV !== "production" ? {
64
123
  bannerKey: PropTypes.string,
65
- type: PropTypes.oneOf(_keys(ICONS)),
124
+ type: PropTypes.oneOf(_keys(TYPES)),
66
125
  message: PropTypes.string.isRequired,
67
- firstCTA: PropTypes.func,
68
- firstCTALabel: PropTypes.string,
69
- secondCTALabel: PropTypes.string,
70
- secondCTA: PropTypes.func,
126
+ cta: PropTypes.arrayOf(ctaPropTypes),
71
127
  temporary: PropTypes.bool,
72
128
  onEnd: PropTypes.func
73
129
  } : {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","classnames","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","QuestionIcon","NovaCompositionCoorpacademyValidate","ValidateIcon","ButtonLink","style","ICONS","success","error","warning","STYLES","Banner","props","type","message","firstCTA","firstCTALabel","secondCTALabel","secondCTA","temporary","bannerKey","onEnd","Icon","banner","temporaryBanner","icon","temporaryIcon","button","buttonsBar","propTypes","string","oneOf","isRequired","func","bool"],"sources":["../../../src/molecule/banner/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as QuestionIcon,\n NovaCompositionCoorpacademyValidate as ValidateIcon\n} from '@coorpacademy/nova-icons';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst ICONS = {\n success: ValidateIcon,\n error: QuestionIcon,\n warning: QuestionIcon\n};\n\nconst STYLES = {\n success: style.success,\n error: style.error,\n warning: style.warning\n};\n\nconst Banner = props => {\n const {\n type,\n message,\n firstCTA,\n firstCTALabel,\n secondCTALabel,\n secondCTA,\n temporary,\n bannerKey,\n onEnd\n } = props;\n const Icon = ICONS[type];\n return (\n <div\n key={bannerKey}\n className={classnames(style.banner, STYLES[type], temporary && style.temporaryBanner)}\n onAnimationEnd={onEnd}\n title={message}\n >\n <div data-name={`${type}-banner-message`} className={style.message}>\n <Icon className={classnames(style.icon, temporary && style.temporaryIcon)} />\n {message}\n </div>\n {firstCTALabel ? (\n <div className={classnames(style.button, STYLES[type])}>\n <ButtonLink\n data-name=\"first-banner-cta\"\n aria-label={firstCTALabel}\n label={firstCTALabel}\n onClick={firstCTA}\n type=\"text\"\n />\n </div>\n ) : null}\n {firstCTALabel && secondCTALabel ? (\n <div className={classnames(style.buttonsBar, STYLES[type])} />\n ) : null}\n {secondCTALabel ? (\n <div className={classnames(style.button, STYLES[type])}>\n <ButtonLink\n data-name=\"second-banner-cta\"\n onClick={secondCTA}\n aria-label={secondCTALabel}\n label={secondCTALabel}\n type=\"text\"\n />\n </div>\n ) : null}\n </div>\n );\n};\n\nBanner.propTypes = {\n bannerKey: PropTypes.string,\n type: PropTypes.oneOf(keys(ICONS)),\n message: PropTypes.string.isRequired,\n firstCTA: PropTypes.func,\n firstCTALabel: PropTypes.string,\n secondCTALabel: PropTypes.string,\n secondCTA: PropTypes.func,\n temporary: PropTypes.bool,\n onEnd: PropTypes.func\n};\n\nexport default Banner;\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,mCAAmC,IAAIC,YAFzC,QAGO,0BAHP;AAIA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,KAAK,GAAG;EACZC,OAAO,EAAEJ,YADG;EAEZK,KAAK,EAAEP,YAFK;EAGZQ,OAAO,EAAER;AAHG,CAAd;AAMA,MAAMS,MAAM,GAAG;EACbH,OAAO,EAAEF,KAAK,CAACE,OADF;EAEbC,KAAK,EAAEH,KAAK,CAACG,KAFA;EAGbC,OAAO,EAAEJ,KAAK,CAACI;AAHF,CAAf;;AAMA,MAAME,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IACJC,IADI;IAEJC,OAFI;IAGJC,QAHI;IAIJC,aAJI;IAKJC,cALI;IAMJC,SANI;IAOJC,SAPI;IAQJC,SARI;IASJC;EATI,IAUFT,KAVJ;EAWA,MAAMU,IAAI,GAAGhB,KAAK,CAACO,IAAD,CAAlB;EACA,oBACE;IACE,GAAG,EAAEO,SADP;IAEE,SAAS,EAAErB,UAAU,CAACM,KAAK,CAACkB,MAAP,EAAeb,MAAM,CAACG,IAAD,CAArB,EAA6BM,SAAS,IAAId,KAAK,CAACmB,eAAhD,CAFvB;IAGE,cAAc,EAAEH,KAHlB;IAIE,KAAK,EAAEP;EAJT,gBAME;IAAK,aAAY,GAAED,IAAK,iBAAxB;IAA0C,SAAS,EAAER,KAAK,CAACS;EAA3D,gBACE,oBAAC,IAAD;IAAM,SAAS,EAAEf,UAAU,CAACM,KAAK,CAACoB,IAAP,EAAaN,S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etB,MAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useState","useCallback","PropTypes","classnames","COLORS","ButtonLink","Icon","InputSwitch","style","uncappedMap","convert","cap","TYPES","success","cm_positive_200","error","cm_negative_200","warning","cm_yellow_400","info","cm_grey_500","STYLES","Banner","props","type","message","cta","temporary","bannerKey","onEnd","switchValue","setSwitchValue","ButtonSeparator","buttonsBar","handleSwitchToggle","action","e","newSwitchValue","buildButton","buttonType","label","commonStyle","button","padding","buildCta","ctaOptions","options","i","ctaWrapper","iconName","iconColor","banner","temporaryBanner","icon","temporaryIcon","ctaPropTypes","shape","string","oneOf","func","propTypes","isRequired","arrayOf","bool"],"sources":["../../../src/molecule/banner/index.js"],"sourcesContent":["import React, {useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys, noop, isEmpty, map, size} from 'lodash/fp';\nimport {COLORS} from '../../variables/colors';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst TYPES = {\n success: ['circle-check', COLORS.cm_positive_200],\n error: ['triangle-exclamation', COLORS.cm_negative_200],\n warning: ['circle-exclamation', COLORS.cm_yellow_400],\n info: ['circle-info', COLORS.cm_grey_500]\n};\n\nconst STYLES = {\n success: style.success,\n error: style.error,\n warning: style.warning,\n info: style.info\n};\n\nconst Banner = props => {\n const {type, message, cta = [], temporary, bannerKey, onEnd} = props;\n const [switchValue, setSwitchValue] = useState(false);\n\n const ButtonSeparator = <div className={classnames(style.buttonsBar, STYLES[type])} />;\n\n const handleSwitchToggle = useCallback(\n action => e => {\n const newSwitchValue = !switchValue;\n setSwitchValue(newSwitchValue);\n action(newSwitchValue);\n },\n [switchValue]\n );\n\n const buildButton = ({type: buttonType = 'button', label, action = noop}) => {\n const commonStyle = classnames(style.button, STYLES[type]);\n\n switch (buttonType) {\n case 'switch':\n return (\n <div className={commonStyle}>\n <InputSwitch\n id=\"show-microlearning-switch\"\n theme=\"coorpmanager\"\n title={label}\n value={switchValue}\n onChange={handleSwitchToggle(action)}\n data-name={`banner-switch-cta`}\n aria-label={label}\n />\n </div>\n );\n default:\n return (\n <div className={commonStyle}>\n <ButtonLink\n data-name=\"banner-button-cta\"\n aria-label={label}\n label={label}\n onClick={action}\n type=\"text\"\n customStyle={{padding: 0}}\n />\n </div>\n );\n }\n };\n\n const buildCta = ctaOptions => {\n return uncappedMap((options, i) => {\n if (isEmpty(options)) return null;\n\n return (\n <div className={style.ctaWrapper} key={i}>\n {i > 0 && i <= size(options) ? ButtonSeparator : null}\n {buildButton(options)}\n </div>\n );\n }, ctaOptions);\n };\n\n const [iconName, iconColor] = TYPES[type];\n\n return (\n <div\n key={bannerKey}\n className={classnames(style.banner, STYLES[type], temporary && style.temporaryBanner)}\n onAnimationEnd={onEnd}\n title={message}\n >\n <div data-name={`${type}-banner-message`} className={style.message}>\n <Icon\n iconName={iconName}\n iconColor={iconColor}\n className={classnames(style.icon, temporary && style.temporaryIcon)}\n customStyle={{padding: 0}}\n />\n {message}\n </div>\n {buildCta(cta)}\n </div>\n );\n};\n\nconst ctaPropTypes = PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['button', 'switch']),\n action: PropTypes.func\n});\n\nBanner.propTypes = {\n bannerKey: PropTypes.string,\n type: PropTypes.oneOf(keys(TYPES)),\n message: PropTypes.string.isRequired,\n cta: PropTypes.arrayOf(ctaPropTypes),\n temporary: PropTypes.bool,\n onEnd: PropTypes.func\n};\n\nexport default Banner;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SAAQC,MAAR,QAAqB,wBAArB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC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
12
  @value cm_yellow_100 from colors;
13
13
  @value cm_yellow_200 from colors;
14
14
  @value cm_yellow_400 from colors;
15
+ @value cm_grey_100 from colors;
16
+ @value cm_grey_700 from colors;
15
17
 
16
18
  @keyframes fadeIn {
17
19
  0% {
@@ -33,11 +35,11 @@
33
35
  .banner {
34
36
  display: flex;
35
37
  flex-direction: row;
36
- justify-content: flex-start;
37
- align-items: center;
38
+ justify-content: flex-start;
39
+ align-items: center;
38
40
  gap: 8px;
39
- padding: 16px 24px;
40
- border-radius: 5px;
41
+ padding: 16px;
42
+ border-radius: 12px;
41
43
  }
42
44
 
43
45
  .banner.warning {
@@ -55,6 +57,11 @@
55
57
  color: cm_positive_200;
56
58
  }
57
59
 
60
+ .banner.info {
61
+ background-color: cm_grey_100;
62
+ color: cm_grey_700;
63
+ }
64
+
58
65
  .temporaryBanner {
59
66
  display: inline-flex;
60
67
  align-items: center;
@@ -74,6 +81,11 @@
74
81
  transform: translateX(-50%);
75
82
  }
76
83
 
84
+ .ctaWrapper {
85
+ display: flex;
86
+ gap: 4px;
87
+ }
88
+
77
89
  .button{
78
90
  background-color: transparent;
79
91
  white-space: nowrap;
@@ -103,7 +115,6 @@
103
115
  color: color(cm_positive_100 blackness(+12%));
104
116
  }
105
117
 
106
-
107
118
  .buttonsBar {
108
119
  width: 2px;
109
120
  align-self: stretch;
@@ -123,6 +134,9 @@
123
134
  background-color: cm_positive_100;
124
135
  }
125
136
 
137
+ .buttonsBar.info {
138
+ background-color: cm_grey_700;
139
+ }
126
140
 
127
141
  .icon {
128
142
  height: 22px;
@@ -147,4 +161,12 @@
147
161
  display: flex;
148
162
  align-content: center;
149
163
  align-items: center;
164
+ gap: 16px;
150
165
  }
166
+
167
+ @media mobile {
168
+ .banner {
169
+ flex-wrap: wrap;
170
+ gap: 24px;
171
+ }
172
+ }
@@ -68,20 +68,12 @@
68
68
  padding: 16px;
69
69
  background-color: white;
70
70
  height: 114px;
71
- }
72
-
73
- .detailsSection0 {
74
- composes: detailsSectionCommon;
75
71
  flex: 1;
76
72
  }
77
73
 
78
- .detailsSection1 {
79
- composes: detailsSection0;
80
- }
81
-
82
- .detailsSection2 {
74
+ .detailsSection0 , .detailsSection1, .detailsSection2 {
83
75
  composes: detailsSectionCommon;
84
- width: 245px;
76
+ flex: 1;
85
77
  }
86
78
 
87
79
  .detailsInfo {
@@ -9,10 +9,11 @@ declare namespace BrandUpdate {
9
9
  bannerKey: PropTypes.Requireable<string>;
10
10
  type: PropTypes.Requireable<string>;
11
11
  message: PropTypes.Validator<string>;
12
- firstCTA: PropTypes.Requireable<(...args: any[]) => any>;
13
- firstCTALabel: PropTypes.Requireable<string>;
14
- secondCTALabel: PropTypes.Requireable<string>;
15
- secondCTA: PropTypes.Requireable<(...args: any[]) => any>;
12
+ cta: PropTypes.Requireable<(PropTypes.InferProps<{
13
+ label: PropTypes.Requireable<string>;
14
+ type: PropTypes.Requireable<string>;
15
+ action: PropTypes.Requireable<(...args: any[]) => any>;
16
+ }> | null | undefined)[]>;
16
17
  temporary: PropTypes.Requireable<boolean>;
17
18
  onEnd: PropTypes.Requireable<(...args: any[]) => any>;
18
19
  }> | null | undefined)[]>;
@@ -105,13 +105,13 @@ const CertificationDetail = (props, context) => {
105
105
  progression: progression,
106
106
  completedModules: completedModules,
107
107
  mandatoryModules: mandatoryModules,
108
- sections: _compact([{
108
+ sections: _compact([diplomaUrl && {
109
109
  type: 'diploma',
110
110
  downloadUrl: diplomaUrl
111
111
  }, badgeUrl && {
112
112
  type: 'badge',
113
113
  downloadUrl: badgeUrl
114
- }, {
114
+ }, stars && {
115
115
  type: 'stars',
116
116
  stars
117
117
  }])
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useEffect","useRef","useState","useMemo","PropTypes","classnames","Markdown","Provider","Tag","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearningButton","ProgressWrapper","style","CertificationDetail","props","context","certificationRef","title","tag","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","descriptionRef","translate","progression","mandatoryModules","stars","totalModules","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","completedModules","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","childContextTypes","propTypes","string","isRequired","shape","number","bool","onChange","func","options","arrayOf"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase, round, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport {ContinueLearningButton} from '../skill-detail';\nimport ProgressWrapper from '../../molecule/progress-wrapper';\nimport style from './style.css';\n\nconst CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n tag,\n description,\n certificationCourses,\n ongoingCoursesAvailable,\n filters,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n diplomaUrl,\n badgeUrl\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n\n const {progression, mandatoryModules, stars, totalModules} = metrics;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n const completedModules = useMemo(\n () => round((mandatoryModules * progression) / 100),\n [mandatoryModules, progression]\n );\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.logoContainer}>\n <img className={style.logo} src={logoUrl} />\n </div>\n <div>\n <Tag label={tag} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.contentStats}>\n <span>{`${totalModules} ${lowerCase(translate('modules'))}`}</span>\n </div>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n <ProgressWrapper\n title={translate('your_progress')}\n subtitle={translate('certification_progress_wrapper_subtitle')}\n progression={progression}\n completedModules={completedModules}\n mandatoryModules={mandatoryModules}\n sections={compact([\n {\n type: 'diploma',\n downloadUrl: diplomaUrl\n },\n badgeUrl && {\n type: 'badge',\n downloadUrl: badgeUrl\n },\n {\n type: 'stars',\n stars\n }\n ])}\n />\n <AllCourses\n content={certificationCourses}\n filters={filters}\n data-name=\"certification-courses\"\n />\n </div>\n </div>\n );\n};\n\nCertificationDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nCertificationDetail.propTypes = {\n title: PropTypes.string.isRequired,\n tag: PropTypes.string,\n certificationRef: PropTypes.string.isRequired,\n description: PropTypes.string.isRequired,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n mandatoryModules: PropTypes.number,\n totalModules: PropTypes.number\n }),\n diplomaUrl: PropTypes.string,\n badgeUrl: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default CertificationDetail;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,MAAvC,EAA+CC,QAA/C,EAAyDC,OAAzD,QAAuE,OAAvE;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,iBAArB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,SAAQC,qBAAR,QAAoC,mBAApC;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,UAAP,MAAuB,6BAAvB;AACA,SAAQC,sBAAR,QAAqC,iBAArC;AACA,OAAOC,eAAP,MAA4B,iCAA5B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,mBAAmB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC9C,MAAM;IACJC,gBADI;IAEJC,KAFI;IAGJC,GAHI;IAIJC,WAJI;IAKJC,oBALI;IAMJC,uBANI;IAOJC,OAPI;IAQJC,WARI;IASJC,uBATI;IAUJC,OAVI;IAWJC,OAXI;IAYJC,UAZI;IAaJC;EAbI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ANqB;EAY9BtC,UAAU,EAAE3B,SAAS,CAAC8D,MAZQ;EAa9BlC,QAAQ,EAAE5B,SAAS,CAAC8D,MAbU;EAc9BzC,uBAAuB,EAAErB,SAAS,CAACkE,IAdL;EAe9B9C,oBAAoB,EAAEpB,SAAS,CAACgE,KAAV,CAAgBxD,SAAS,CAACqD,SAA1B,CAfQ;EAgB9BvC,OAAO,EAAEtB,SAAS,CAACgE,KAAV,CAAgB;IACvBG,QAAQ,EAAEnE,SAAS,CAACoE,IADG;IAEvBC,OAAO,EAAErE,SAAS,CAACsE,OAAV,CAAkBtE,SAAS,CAACgE,KAAV,CAAgB3D,qBAAhB,CAAlB;EAFc,CAAhB,CAhBqB;EAoB9BkB,WAAW,EAAEvB,SAAS,CAACoE,IApBO;EAqB9B5C,uBAAuB,EAAExB,SAAS,CAACoE;AArBL,CAAhC;AAwBA,eAAevD,mBAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useEffect","useRef","useState","useMemo","PropTypes","classnames","Markdown","Provider","Tag","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearningButton","ProgressWrapper","style","CertificationDetail","props","context","certificationRef","title","tag","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","descriptionRef","translate","progression","mandatoryModules","stars","totalModules","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","completedModules","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","childContextTypes","propTypes","string","isRequired","shape","number","bool","onChange","func","options","arrayOf"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase, round, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport {ContinueLearningButton} from '../skill-detail';\nimport ProgressWrapper from '../../molecule/progress-wrapper';\nimport style from './style.css';\n\nconst CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n tag,\n description,\n certificationCourses,\n ongoingCoursesAvailable,\n filters,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n diplomaUrl,\n badgeUrl\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n\n const {progression, mandatoryModules, stars, totalModules} = metrics;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n const completedModules = useMemo(\n () => round((mandatoryModules * progression) / 100),\n [mandatoryModules, progression]\n );\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.logoContainer}>\n <img className={style.logo} src={logoUrl} />\n </div>\n <div>\n <Tag label={tag} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.contentStats}>\n <span>{`${totalModules} ${lowerCase(translate('modules'))}`}</span>\n </div>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n <ProgressWrapper\n title={translate('your_progress')}\n subtitle={translate('certification_progress_wrapper_subtitle')}\n progression={progression}\n completedModules={completedModules}\n mandatoryModules={mandatoryModules}\n sections={compact([\n diplomaUrl && {\n type: 'diploma',\n downloadUrl: diplomaUrl\n },\n badgeUrl && {\n type: 'badge',\n downloadUrl: badgeUrl\n },\n stars && {\n type: 'stars',\n stars\n }\n ])}\n />\n <AllCourses\n content={certificationCourses}\n filters={filters}\n data-name=\"certification-courses\"\n />\n </div>\n </div>\n );\n};\n\nCertificationDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nCertificationDetail.propTypes = {\n title: PropTypes.string.isRequired,\n tag: PropTypes.string,\n certificationRef: PropTypes.string.isRequired,\n description: PropTypes.string.isRequired,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n mandatoryModules: PropTypes.number,\n totalModules: PropTypes.number\n }),\n diplomaUrl: PropTypes.string,\n badgeUrl: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default CertificationDetail;\n"],"mappings":";;;;AAAA,OAAOA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AoB9BkB,WAAW,EAAEvB,SAAS,CAACoE,IApBO;EAqB9B5C,uBAAuB,EAAExB,SAAS,CAACoE;AArBL,CAAhC;AAwBA,eAAevD,mBAAf"}
@@ -83,6 +83,7 @@ declare namespace PlaylistDetail {
83
83
  }>>;
84
84
  const onBackClick: PropTypes.Requireable<(...args: any[]) => any>;
85
85
  const onContinueLearningClick: PropTypes.Requireable<(...args: any[]) => any>;
86
+ const bannerMicrolearningRuleAction: PropTypes.Requireable<(...args: any[]) => any>;
86
87
  }
87
88
  }
88
89
  import PropTypes from "prop-types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";AAgBA,uEAqFC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/playlist-detail/index.js"],"names":[],"mappings":";AAgBA,uEA2FC"}
@@ -25,7 +25,8 @@ const PlaylistDetail = (props, context) => {
25
25
  filters,
26
26
  sorting,
27
27
  onBackClick,
28
- onContinueLearningClick
28
+ onContinueLearningClick,
29
+ bannerMicrolearningRuleAction = null
29
30
  } = props;
30
31
  const descriptionRef = useRef(null);
31
32
  const {
@@ -88,7 +89,8 @@ const PlaylistDetail = (props, context) => {
88
89
  })))), /*#__PURE__*/React.createElement(AllCourses, {
89
90
  content: playlistCourses,
90
91
  filters: filters,
91
- sorting: sorting
92
+ sorting: sorting,
93
+ bannerMicrolearningRuleAction: bannerMicrolearningRuleAction
92
94
  })));
93
95
  };
94
96
 
@@ -109,7 +111,8 @@ PlaylistDetail.propTypes = process.env.NODE_ENV !== "production" ? {
109
111
  }),
110
112
  sorting: PropTypes.shape(Select.propTypes),
111
113
  onBackClick: PropTypes.func,
112
- onContinueLearningClick: PropTypes.func
114
+ onContinueLearningClick: PropTypes.func,
115
+ bannerMicrolearningRuleAction: PropTypes.func
113
116
  } : {};
114
117
  export default PlaylistDetail;
115
118
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useState","useEffect","useRef","PropTypes","classnames","Markdown","Provider","Tag","Select","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","PlaylistDetailCover","ContinueLearningButton","style","PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCoursesAvailable","playlistCourses","filters","sorting","onBackClick","onContinueLearningClick","descriptionRef","translate","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","backgroundContainer","container","backButton","ctaContainer","coverWrapper","showMoreWrapper","faSize","wrapperSize","continueLearningButton","contextTypes","skin","childContextTypes","propTypes","string","isRequired","images","bool","shape","onChange","func","options","arrayOf"],"sources":["../../../src/template/playlist-detail/index.js"],"sourcesContent":["import React, {useCallback, useState, useEffect, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport PlaylistDetailCover from '../../molecule/playlist-detail-cover';\nimport {ContinueLearningButton} from '../skill-detail';\nimport style from './style.css';\n\nconst PlaylistDetail = (props, context) => {\n const {\n title,\n coverImages,\n playlistRef,\n description,\n ongoingCoursesAvailable,\n playlistCourses,\n filters,\n sorting,\n onBackClick,\n onContinueLearningClick\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={playlistRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.coverWrapper}>\n <PlaylistDetailCover images={coverImages} />\n </div>\n <div>\n <Tag label={translate('playlist')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.continueLearningButton}>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n </div>\n <AllCourses content={playlistCourses} filters={filters} sorting={sorting} />\n </div>\n </div>\n );\n};\n\nPlaylistDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nPlaylistDetail.propTypes = {\n title: PropTypes.string.isRequired,\n coverImages: PlaylistDetailCover.propTypes.images,\n playlistRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n playlistCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,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EAAE3D,SAAS,CAAC4D,OAAV,CAAkB5D,SAAS,CAACwD,KAAV,CAAgBlD,qBAAhB,CAAlB;EAFc,CAAhB,CAPgB;EAWzBkB,OAAO,EAAExB,SAAS,CAACwD,KAAV,CAAgBnD,MAAM,CAAC8C,SAAvB,CAXgB;EAYzB1B,WAAW,EAAEzB,SAAS,CAAC0D,IAZE;EAazBhC,uBAAuB,EAAE1B,SAAS,CAAC0D;AAbV,CAA3B;AAgBA,eAAe5C,cAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useState","useEffect","useRef","PropTypes","classnames","Markdown","Provider","Tag","Select","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","PlaylistDetailCover","ContinueLearningButton","style","PlaylistDetail","props","context","title","coverImages","playlistRef","description","ongoingCoursesAvailable","playlistCourses","filters","sorting","onBackClick","onContinueLearningClick","bannerMicrolearningRuleAction","descriptionRef","translate","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","backgroundContainer","container","backButton","ctaContainer","coverWrapper","showMoreWrapper","faSize","wrapperSize","continueLearningButton","contextTypes","skin","childContextTypes","propTypes","string","isRequired","images","bool","shape","onChange","func","options","arrayOf"],"sources":["../../../src/template/playlist-detail/index.js"],"sourcesContent":["import React, {useCallback, useState, useEffect, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport PlaylistDetailCover from '../../molecule/playlist-detail-cover';\nimport {ContinueLearningButton} from '../skill-detail';\nimport style from './style.css';\n\nconst PlaylistDetail = (props, context) => {\n const {\n title,\n coverImages,\n playlistRef,\n description,\n ongoingCoursesAvailable,\n playlistCourses,\n filters,\n sorting,\n onBackClick,\n onContinueLearningClick,\n bannerMicrolearningRuleAction = null\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={playlistRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.coverWrapper}>\n <PlaylistDetailCover images={coverImages} />\n </div>\n <div>\n <Tag label={translate('playlist')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.continueLearningButton}>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n </div>\n <AllCourses\n content={playlistCourses}\n filters={filters}\n sorting={sorting}\n bannerMicrolearningRuleAction={bannerMicrolearningRuleAction}\n />\n </div>\n </div>\n );\n};\n\nPlaylistDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nPlaylistDetail.propTypes = {\n title: PropTypes.string.isRequired,\n coverImages: PlaylistDetailCover.propTypes.images,\n playlistRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n playlistCourses: PropTypes.shape(CardsGrid.propTypes),\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func,\n bannerMicrolearningRuleAction: PropTypes.func\n};\n\nexport default PlaylistDetail;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,EAAsCC,SAAtC,EAAiDC,MAAjD,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,iBAArB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,UAAP,MAAuB,6BAAvB;AACA,OAAOC,mBAAP,MAAgC,sCAAhC;AACA,SAAQC,sBAAR,QAAqC,iBAArC;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IACJC,KADI;IAEJC,WAFI;IAGJC,WAHI;IAIJC,WAJI;IAKJC,uBALI;IAMJC,eANI;IAOJC,OAPI;IAQJC,OARI;IASJC,WATI;IAUJC,uBAVI;IAWJC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KAf,cAAc,CAACsC,SAAf,2CAA2B;EACzBnC,KAAK,EAAEjB,SAAS,CAACqD,MAAV,CAAiBC,UADC;EAEzBpC,WAAW,EAAEP,mBAAmB,CAACyC,SAApB,CAA8BG,MAFlB;EAGzBpC,WAAW,EAAEnB,SAAS,CAACqD,MAAV,CAAiBC,UAHL;EAIzBlC,WAAW,EAAEpB,SAAS,CAACqD,MAJE;EAKzBhC,uBAAuB,EAAErB,SAAS,CAACwD,IALV;EAMzBlC,eAAe,EAAEtB,SAAS,CAACyD,KAAV,CAAgBhD,SAAS,CAAC2C,SAA1B,CANQ;EAOzB7B,OAAO,EAAEvB,SAAS,CAACyD,KAAV,CAAgB;IACvBC,QAAQ,EAAE1D,SAAS,CAAC2D,IADG;IAEvBC,OAAO,EAAE5D,SAAS,CAAC6D,OAAV,CAAkB7D,SAAS,CAACyD,KAAV,CAAgBnD,qBAAhB,CAAlB;EAFc,CAAhB,CAPgB;EAWzBkB,OAAO,EAAExB,SAAS,CAACyD,KAAV,CAAgBpD,MAAM,CAAC+C,SAAvB,CAXgB;EAYzB3B,WAAW,EAAEzB,SAAS,CAAC2D,IAZE;EAazBjC,uBAAuB,EAAE1B,SAAS,CAAC2D,IAbV;EAczBhC,6BAA6B,EAAE3B,SAAS,CAAC2D;AAdhB,CAA3B;AAiBA,eAAe7C,cAAf"}
@@ -109,6 +109,10 @@
109
109
  text-decoration: underline;
110
110
  }
111
111
 
112
+ .bannerWrapper {
113
+ margin-bottom: 16px;
114
+ }
115
+
112
116
  @media tablet {
113
117
  .searchAndSortSection {
114
118
  flex-direction: column;
@@ -74,6 +74,7 @@ declare namespace AllCourses {
74
74
  'aria-label': PropTypes.Requireable<string>;
75
75
  'aria-labelledby': PropTypes.Requireable<string>;
76
76
  }>>;
77
+ const bannerMicrolearningRuleAction: PropTypes.Requireable<(...args: any[]) => any>;
77
78
  }
78
79
  }
79
80
  import PropTypes from "prop-types";
@@ -1 +1 @@
1
- {"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.js"],"names":[],"mappings":";AAgDA,mEA2HC"}
1
+ {"version":3,"file":"all-courses.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/all-courses.js"],"names":[],"mappings":";AAiDA,mEA0IC"}
@@ -15,6 +15,7 @@ import SearchForm from '../../molecule/search-form';
15
15
  import CardsGrid from '../../organism/cards-grid';
16
16
  import searchValueIncluded from '../../util/search-value-included';
17
17
  import InputSwitch from '../../atom/input-switch';
18
+ import Banner from '../../molecule/banner';
18
19
  import style from './all-courses.css';
19
20
 
20
21
  const uncappedMap = _map.convert({
@@ -67,7 +68,8 @@ const AllCourses = (props, context) => {
67
68
  content,
68
69
  filters,
69
70
  sorting,
70
- totalContents
71
+ totalContents,
72
+ bannerMicrolearningRuleAction
71
73
  } = props;
72
74
  const {
73
75
  options,
@@ -132,7 +134,17 @@ const AllCourses = (props, context) => {
132
134
  onChange: handleShowCompletedToggle
133
135
  }), sortView ? /*#__PURE__*/React.createElement("div", {
134
136
  className: style.sortWrapper
135
- }, translate('sort_by'), sortView) : null)), /*#__PURE__*/React.createElement("div", {
137
+ }, translate('sort_by'), sortView) : null)), bannerMicrolearningRuleAction ? /*#__PURE__*/React.createElement("div", {
138
+ className: style.bannerWrapper
139
+ }, /*#__PURE__*/React.createElement(Banner, {
140
+ type: "info",
141
+ message: translate('banner_microlearning_rule_message'),
142
+ cta: [{
143
+ type: 'switch',
144
+ label: translate('banner_microlearning_rule_label'),
145
+ action: bannerMicrolearningRuleAction
146
+ }]
147
+ })) : null, /*#__PURE__*/React.createElement("div", {
136
148
  className: style.filterWrapper
137
149
  }, _size(options) > 2 ? uncappedMap((filterProps, index) => {
138
150
  const {
@@ -188,7 +200,8 @@ AllCourses.propTypes = process.env.NODE_ENV !== "production" ? {
188
200
  onChange: PropTypes.func,
189
201
  options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))
190
202
  }),
191
- sorting: PropTypes.shape(Select.propTypes)
203
+ sorting: PropTypes.shape(Select.propTypes),
204
+ bannerMicrolearningRuleAction: PropTypes.func
192
205
  } : {};
193
206
  export default AllCourses;
194
207
  //# sourceMappingURL=all-courses.js.map