@coorpacademy/components 11.40.2-alpha.11.12 → 11.40.2-alpha.13.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/es/molecule/certification-card/index.d.ts +2 -1
  2. package/es/molecule/certification-card/index.d.ts.map +1 -1
  3. package/es/molecule/certification-card/index.js +3 -0
  4. package/es/molecule/certification-card/index.js.map +1 -1
  5. package/es/molecule/cm-popin/types.d.ts +1 -1
  6. package/es/molecule/learner-skill-card/index.d.ts +24 -25
  7. package/es/molecule/learner-skill-card/index.d.ts.map +1 -1
  8. package/es/molecule/learner-skill-card/index.js +28 -10
  9. package/es/molecule/learner-skill-card/index.js.map +1 -1
  10. package/es/molecule/playlist-card/index.d.ts +2 -1
  11. package/es/molecule/playlist-card/index.d.ts.map +1 -1
  12. package/es/molecule/playlist-card/index.js +3 -0
  13. package/es/molecule/playlist-card/index.js.map +1 -1
  14. package/es/organism/cards-grid/index.d.ts +29 -1
  15. package/es/organism/cards-grid/index.d.ts.map +1 -1
  16. package/es/organism/cards-grid/index.js +23 -8
  17. package/es/organism/cards-grid/index.js.map +1 -1
  18. package/es/template/app-player/loading/index.d.ts +1 -1
  19. package/es/template/app-player/player/index.d.ts +2 -2
  20. package/es/template/app-player/player/slides/index.d.ts +1 -1
  21. package/es/template/app-player/popin-correction/index.d.ts +1 -1
  22. package/es/template/app-player/popin-end/index.d.ts +1 -1
  23. package/es/template/app-review/index.d.ts +1 -1
  24. package/es/template/app-review/player/prop-types.d.ts +1 -1
  25. package/es/template/app-review/prop-types.d.ts +1 -1
  26. package/es/template/back-office/brand-update/index.d.ts +1 -1
  27. package/es/template/certification-detail/index.d.ts +1 -1
  28. package/es/template/common/authors/index.d.ts +1 -1
  29. package/es/template/common/dashboard/index.d.ts +2 -2
  30. package/es/template/common/search-page/index.d.ts +49 -46
  31. package/es/template/common/search-page/style.css +2 -2
  32. package/es/template/external-course/index.d.ts +1 -1
  33. package/es/template/my-learning/index.d.ts.map +1 -1
  34. package/es/template/my-learning/index.js +3 -1
  35. package/es/template/my-learning/index.js.map +1 -1
  36. package/es/template/playlist-detail/index.d.ts +1 -1
  37. package/es/template/skill-detail/all-courses.d.ts +1 -1
  38. package/es/template/skill-detail/continue-learning.d.ts +1 -1
  39. package/es/template/skill-detail/index.d.ts +2 -2
  40. package/es/template/skill-detail/index.d.ts.map +1 -1
  41. package/es/template/skill-detail/index.js +3 -1
  42. package/es/template/skill-detail/index.js.map +1 -1
  43. package/lib/molecule/certification-card/index.d.ts +2 -1
  44. package/lib/molecule/certification-card/index.d.ts.map +1 -1
  45. package/lib/molecule/certification-card/index.js +3 -0
  46. package/lib/molecule/certification-card/index.js.map +1 -1
  47. package/lib/molecule/cm-popin/types.d.ts +1 -1
  48. package/lib/molecule/learner-skill-card/index.d.ts +24 -25
  49. package/lib/molecule/learner-skill-card/index.d.ts.map +1 -1
  50. package/lib/molecule/learner-skill-card/index.js +28 -10
  51. package/lib/molecule/learner-skill-card/index.js.map +1 -1
  52. package/lib/molecule/playlist-card/index.d.ts +2 -1
  53. package/lib/molecule/playlist-card/index.d.ts.map +1 -1
  54. package/lib/molecule/playlist-card/index.js +3 -0
  55. package/lib/molecule/playlist-card/index.js.map +1 -1
  56. package/lib/organism/cards-grid/index.d.ts +29 -1
  57. package/lib/organism/cards-grid/index.d.ts.map +1 -1
  58. package/lib/organism/cards-grid/index.js +23 -8
  59. package/lib/organism/cards-grid/index.js.map +1 -1
  60. package/lib/template/app-player/loading/index.d.ts +1 -1
  61. package/lib/template/app-player/player/index.d.ts +2 -2
  62. package/lib/template/app-player/player/slides/index.d.ts +1 -1
  63. package/lib/template/app-player/popin-correction/index.d.ts +1 -1
  64. package/lib/template/app-player/popin-end/index.d.ts +1 -1
  65. package/lib/template/app-review/index.d.ts +1 -1
  66. package/lib/template/app-review/player/prop-types.d.ts +1 -1
  67. package/lib/template/app-review/prop-types.d.ts +1 -1
  68. package/lib/template/back-office/brand-update/index.d.ts +1 -1
  69. package/lib/template/certification-detail/index.d.ts +1 -1
  70. package/lib/template/common/authors/index.d.ts +1 -1
  71. package/lib/template/common/dashboard/index.d.ts +2 -2
  72. package/lib/template/common/search-page/index.d.ts +49 -46
  73. package/lib/template/common/search-page/style.css +2 -2
  74. package/lib/template/external-course/index.d.ts +1 -1
  75. package/lib/template/my-learning/index.d.ts.map +1 -1
  76. package/lib/template/my-learning/index.js +3 -1
  77. package/lib/template/my-learning/index.js.map +1 -1
  78. package/lib/template/playlist-detail/index.d.ts +1 -1
  79. package/lib/template/skill-detail/all-courses.d.ts +1 -1
  80. package/lib/template/skill-detail/continue-learning.d.ts +1 -1
  81. package/lib/template/skill-detail/index.d.ts +2 -2
  82. package/lib/template/skill-detail/index.d.ts.map +1 -1
  83. package/lib/template/skill-detail/index.js +3 -1
  84. package/lib/template/skill-detail/index.js.map +1 -1
  85. package/package.json +2 -2
  86. package/es/molecule/learner-skill-card/prop-types.d.ts +0 -37
  87. package/es/molecule/learner-skill-card/prop-types.d.ts.map +0 -1
  88. package/es/molecule/learner-skill-card/prop-types.js +0 -20
  89. package/es/molecule/learner-skill-card/prop-types.js.map +0 -1
  90. package/lib/molecule/learner-skill-card/prop-types.d.ts +0 -37
  91. package/lib/molecule/learner-skill-card/prop-types.d.ts.map +0 -1
  92. package/lib/molecule/learner-skill-card/prop-types.js +0 -25
  93. package/lib/molecule/learner-skill-card/prop-types.js.map +0 -1
@@ -1,10 +1,11 @@
1
1
  export default CertificationCard;
2
- declare function CertificationCard(props: any, context: any): JSX.Element;
2
+ declare function CertificationCard(props: any, context: any): JSX.Element | null;
3
3
  declare namespace CertificationCard {
4
4
  namespace contextTypes {
5
5
  const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  }
7
7
  namespace propTypes {
8
+ const type: PropTypes.Validator<string>;
8
9
  const label: PropTypes.Requireable<string>;
9
10
  const goal: PropTypes.Requireable<PropTypes.InferProps<{
10
11
  title: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/certification-card/index.js"],"names":[],"mappings":";AAQA,0EA+DC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/certification-card/index.js"],"names":[],"mappings":";AAQA,iFAiEC"}
@@ -7,6 +7,7 @@ import ProgressBar from '../progress-bar';
7
7
  import style from './style.css';
8
8
  const CertificationCard = (props, context) => {
9
9
  const {
10
+ type,
10
11
  label,
11
12
  locales: {
12
13
  conditionDescriptionProgress,
@@ -19,6 +20,7 @@ const CertificationCard = (props, context) => {
19
20
  imgUrl,
20
21
  onClick
21
22
  } = props;
23
+ if (type !== 'certification') return null;
22
24
  const {
23
25
  translate
24
26
  } = context;
@@ -92,6 +94,7 @@ CertificationCard.contextTypes = {
92
94
  translate: Provider.childContextTypes.translate
93
95
  };
94
96
  CertificationCard.propTypes = process.env.NODE_ENV !== "production" ? {
97
+ type: PropTypes.oneOf(['certification']).isRequired,
95
98
  label: PropTypes.string,
96
99
  goal: PropTypes.shape({
97
100
  title: PropTypes.string,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","COLORS","Provider","Tag","ProgressBar","style","CertificationCard","props","context","label","locales","conditionDescriptionProgress","tag","goal","title","progress","imgUrl","onClick","translate","isInprogress","progressLabel","progressTagType","progressIconProps","position","iconName","iconColor","backgroundColor","size","faSize","wrapperSize","customStyle","padding","certificationIcon","createElement","className","container","type","top","right","icon","imageSection","imageContainer","src","detailWrapper","titleWrapper","moduleCount","dangerouslySetInnerHTML","__html","customProgressBar","cm_positive_500","displayInfo","value","max","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","shape","condition","nbDone","number","func"],"sources":["../../../src/molecule/certification-card/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {COLORS} from '../../variables/colors';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport ProgressBar from '../progress-bar';\nimport style from './style.css';\n\nconst CertificationCard = (props, context) => {\n const {\n label,\n locales: {conditionDescriptionProgress, tag},\n goal: {title},\n progress,\n imgUrl,\n onClick\n } = props;\n const {translate} = context;\n const isInprogress = progress < 100;\n const progressLabel = isInprogress ? translate('in_progress') : translate('completed');\n const progressTagType = isInprogress ? 'progress' : 'success';\n\n const progressIconProps = {\n position: 'left',\n iconName: isInprogress ? 'clock' : 'circle-check',\n iconColor: isInprogress ? '#B87A00' : '#05944F',\n backgroundColor: isInprogress ? '#FFEECC' : '#D6F5E5',\n size: {\n faSize: 10,\n wrapperSize: 10\n },\n customStyle: {padding: 0}\n };\n const certificationIcon = {iconName: 'wreath-laurel'};\n return (\n <div className={style.container} data-name={`certification-card-${label}`} onClick={onClick}>\n {progress > 0 ? (\n <Tag\n label={progressLabel}\n type={progressTagType}\n customStyle={{position: 'absolute', top: '12px', right: '12px'}}\n icon={progressIconProps}\n />\n ) : null}\n <div className={style.imageSection}>\n <div className={style.imageContainer}>\n <img src={imgUrl} />\n </div>\n </div>\n <div className={style.detailWrapper}>\n <div className={style.titleWrapper}>\n <Tag label={tag} size=\"S\" icon={certificationIcon} />\n <div className={style.title} data-name=\"certification-title\">\n {title}\n </div>\n <div\n className={style.moduleCount}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: conditionDescriptionProgress}}\n />\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.cm_positive_500}}\n displayInfo={false}\n value={progress}\n max={100}\n />\n </div>\n </div>\n );\n};\n\nCertificationCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nCertificationCard.propTypes = {\n label: PropTypes.string,\n goal: PropTypes.shape({\n title: PropTypes.string,\n condition: PropTypes.shape({\n nbDone: PropTypes.number\n })\n }),\n progress: PropTypes.number,\n imgUrl: PropTypes.string,\n onClick: PropTypes.func,\n locales: PropTypes.shape({\n conditionDescriptionProgress: PropTypes.string,\n tag: PropTypes.string\n })\n};\n\nexport default C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,KAAK,EAAEpC,QAAS;IAChBqC,GAAG,EAAE;EAAI,CACV,CACE,CACF,CAAC;AAEV,CAAC;AAED9C,iBAAiB,CAAC+C,YAAY,GAAG;EAC/BnC,SAAS,EAAEhB,QAAQ,CAACoD,iBAAiB,CAACpC;AACxC,CAAC;AAEDZ,iBAAiB,CAACiD,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EAC5BjD,KAAK,EAAET,SAAS,CAAC2D,MAAM;EACvB9C,IAAI,EAAEb,SAAS,CAAC4D,KAAK,CAAC;IACpB9C,KAAK,EAAEd,SAAS,CAAC2D,MAAM;IACvBE,SAAS,EAAE7D,SAAS,CAAC4D,KAAK,CAAC;MACzBE,MAAM,EAAE9D,SAAS,CAAC+D;IACpB,CAAC;EACH,CAAC,CAAC;EACFhD,QAAQ,EAAEf,SAAS,CAAC+D,MAAM;EAC1B/C,MAAM,EAAEhB,SAAS,CAAC2D,MAAM;EACxB1C,OAAO,EAAEjB,SAAS,CAACgE,IAAI;EACvBtD,OAAO,EAAEV,SAAS,CAAC4D,KAAK,CAAC;IACvBjD,4BAA4B,EAAEX,SAAS,CAAC2D,MAAM;IAC9C/C,GAAG,EAAEZ,SAAS,CAAC2D;EACjB,CAAC;AACH,CAAC;AAED,eAAerD,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","PropTypes","COLORS","Provider","Tag","ProgressBar","style","CertificationCard","props","context","type","label","locales","conditionDescriptionProgress","tag","goal","title","progress","imgUrl","onClick","translate","isInprogress","progressLabel","progressTagType","progressIconProps","position","iconName","iconColor","backgroundColor","size","faSize","wrapperSize","customStyle","padding","certificationIcon","createElement","className","container","top","right","icon","imageSection","imageContainer","src","detailWrapper","titleWrapper","moduleCount","dangerouslySetInnerHTML","__html","customProgressBar","cm_positive_500","displayInfo","value","max","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","oneOf","isRequired","string","shape","condition","nbDone","number","func"],"sources":["../../../src/molecule/certification-card/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {COLORS} from '../../variables/colors';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport ProgressBar from '../progress-bar';\nimport style from './style.css';\n\nconst CertificationCard = (props, context) => {\n const {\n type,\n label,\n locales: {conditionDescriptionProgress, tag},\n goal: {title},\n progress,\n imgUrl,\n onClick\n } = props;\n if (type !== 'certification') return null;\n const {translate} = context;\n const isInprogress = progress < 100;\n const progressLabel = isInprogress ? translate('in_progress') : translate('completed');\n const progressTagType = isInprogress ? 'progress' : 'success';\n\n const progressIconProps = {\n position: 'left',\n iconName: isInprogress ? 'clock' : 'circle-check',\n iconColor: isInprogress ? '#B87A00' : '#05944F',\n backgroundColor: isInprogress ? '#FFEECC' : '#D6F5E5',\n size: {\n faSize: 10,\n wrapperSize: 10\n },\n customStyle: {padding: 0}\n };\n const certificationIcon = {iconName: 'wreath-laurel'};\n return (\n <div className={style.container} data-name={`certification-card-${label}`} onClick={onClick}>\n {progress > 0 ? (\n <Tag\n label={progressLabel}\n type={progressTagType}\n customStyle={{position: 'absolute', top: '12px', right: '12px'}}\n icon={progressIconProps}\n />\n ) : null}\n <div className={style.imageSection}>\n <div className={style.imageContainer}>\n <img src={imgUrl} />\n </div>\n </div>\n <div className={style.detailWrapper}>\n <div className={style.titleWrapper}>\n <Tag label={tag} size=\"S\" icon={certificationIcon} />\n <div className={style.title} data-name=\"certification-title\">\n {title}\n </div>\n <div\n className={style.moduleCount}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: conditionDescriptionProgress}}\n />\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.cm_positive_500}}\n displayInfo={false}\n value={progress}\n max={100}\n />\n </div>\n </div>\n );\n};\n\nCertificationCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nCertificationCard.propTypes = {\n type: PropTypes.oneOf(['certification']).isRequired,\n label: PropTypes.string,\n goal: PropTypes.shape({\n title: PropTypes.string,\n condition: PropTypes.shape({\n nbDone: PropTypes.number\n })\n }),\n progress: PropTypes.number,\n imgUrl: PropTypes.string,\n onClick: PropTypes.func,\n locales: PropTypes.shape({\n conditionDescriptionProgress: PropTypes.string,\n tag: PropTypes.string\n })\n};\n\nexport default CertificationCard;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,GAAG,MAAM,gBAAgB;AAChC,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,iBAAiB,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EAC5C,MAAM;IACJC,IAAI;IACJC,KAAK;IACLC,OAAO,EAAE;MAACC,4BAA4B;MAAEC;IAAG,CAAC;IAC5CC,IAAI,EAAE;MAACC;IAAK,CAAC;IACbC,QAAQ;IACRC,MAAM;IACNC;EACF,CAAC,GAAGX,KAAK;EACT,IAAIE,IAAI,KAAK,eAAe,EAAE,OAAO,IAAI;EACzC,MAAM;IAACU;EAAS,CAAC,GAAGX,OAAO;EAC3B,MAAMY,YAAY,GAAGJ,QAAQ,GAAG,GAAG;EACnC,MAAMK,aAAa,GAAGD,YAAY,GAAGD,SAAS,CAAC,aAAa,CAAC,GAAGA,SAAS,CAAC,WAAW,CAAC;EACtF,MAAMG,eAAe,GAAGF,YAAY,GAAG,UAAU,GAAG,SAAS;EAE7D,MAAMG,iBAAiB,GAAG;IACxBC,QAAQ,EAAE,MAAM;IAChBC,QAAQ,EAAEL,YAAY,GAAG,OAAO,GAAG,cAAc;IACjDM,SAAS,EAAEN,YAAY,GAAG,SAAS,GAAG,SAAS;IAC/CO,eAAe,EAAEP,YAAY,GAAG,SAAS,GAAG,SAAS;IACrDQ,IAAI,EAAE;MACJC,MAAM,EAAE,EAAE;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ACAC,uBAAuB,EAAE;MAACC,MAAM,EAAEnC;IAA4B;EAAE,CACjE,CACE,CAAC,eACNb,KAAA,CAAAmC,aAAA,CAAC9B,WAAW;IACV+B,SAAS,EAAE9B,KAAK,CAAC2C,iBAAkB;IACnC3C,KAAK,EAAE;MAACsB,eAAe,EAAE1B,MAAM,CAACgD;IAAe,CAAE;IACjDC,WAAW,EAAE,KAAM;IACnBC,KAAK,EAAEnC,QAAS;IAChBoC,GAAG,EAAE;EAAI,CACV,CACE,CACF,CAAC;AAEV,CAAC;AAED9C,iBAAiB,CAAC+C,YAAY,GAAG;EAC/BlC,SAAS,EAAEjB,QAAQ,CAACoD,iBAAiB,CAACnC;AACxC,CAAC;AAEDb,iBAAiB,CAACiD,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EAC5BjD,IAAI,EAAET,SAAS,CAAC2D,KAAK,CAAC,CAAC,eAAe,CAAC,CAAC,CAACC,UAAU;EACnDlD,KAAK,EAAEV,SAAS,CAAC6D,MAAM;EACvB/C,IAAI,EAAEd,SAAS,CAAC8D,KAAK,CAAC;IACpB/C,KAAK,EAAEf,SAAS,CAAC6D,MAAM;IACvBE,SAAS,EAAE/D,SAAS,CAAC8D,KAAK,CAAC;MACzBE,MAAM,EAAEhE,SAAS,CAACiE;IACpB,CAAC;EACH,CAAC,CAAC;EACFjD,QAAQ,EAAEhB,SAAS,CAACiE,MAAM;EAC1BhD,MAAM,EAAEjB,SAAS,CAAC6D,MAAM;EACxB3C,OAAO,EAAElB,SAAS,CAACkE,IAAI;EACvBvD,OAAO,EAAEX,SAAS,CAAC8D,KAAK,CAAC;IACvBlD,4BAA4B,EAAEZ,SAAS,CAAC6D,MAAM;IAC9ChD,GAAG,EAAEb,SAAS,CAAC6D;EACjB,CAAC;AACH,CAAC;AAED,eAAevD,iBAAiB","ignoreList":[]}
@@ -156,7 +156,7 @@ declare const propTypes: {
156
156
  items: PropTypes.Requireable<PropTypes.InferProps<{
157
157
  type: PropTypes.Requireable<string>;
158
158
  list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
159
- list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
159
+ list: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
160
160
  customStyle: PropTypes.Requireable<{
161
161
  [x: string]: string | null | undefined;
162
162
  }>;
@@ -1,29 +1,28 @@
1
- import React from 'react';
2
- import { WebContextValues } from '../../atom/provider/web-context';
3
- import { LearnerSkillCardProps } from './prop-types';
4
- export declare const updateBackgroundImage: (ref: React.RefObject<HTMLDivElement>, background: string) => void;
5
- declare const LearnerSkillCard: {
6
- (props: LearnerSkillCardProps, context: WebContextValues): JSX.Element;
7
- contextTypes: {
8
- translate: import("prop-types").Requireable<(...args: any[]) => any>;
9
- };
10
- propTypes: {
11
- 'aria-label': import("prop-types").Requireable<string>;
12
- cardIndex: import("prop-types").Requireable<number>;
13
- skillTitle: import("prop-types").Requireable<string>;
14
- skillAriaLabel: import("prop-types").Requireable<string>;
15
- focus: import("prop-types").Requireable<boolean>;
16
- metrics: import("prop-types").Requireable<import("prop-types").InferProps<{
17
- content: import("prop-types").Requireable<number>;
18
- score: import("prop-types").Requireable<number>;
19
- questionsToReview: import("prop-types").Requireable<number>;
1
+ export function updateBackgroundImage(ref: any, background: any): void;
2
+ export default LearnerSkillCard;
3
+ declare function LearnerSkillCard(props: any, context: any): JSX.Element;
4
+ declare namespace LearnerSkillCard {
5
+ namespace contextTypes {
6
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
7
+ }
8
+ const propTypes: {
9
+ type: PropTypes.Validator<string>;
10
+ title: PropTypes.Validator<string>;
11
+ label: PropTypes.Requireable<string>;
12
+ 'aria-label': PropTypes.Requireable<string>;
13
+ cardIndex: PropTypes.Requireable<number>;
14
+ focus: PropTypes.Requireable<boolean>;
15
+ progress: PropTypes.Requireable<number>;
16
+ metrics: PropTypes.Requireable<PropTypes.InferProps<{
17
+ content: PropTypes.Requireable<number>;
18
+ questionsToReview: PropTypes.Requireable<number>;
20
19
  }>>;
21
- icon: import("prop-types").Requireable<import("prop-types").InferProps<{
22
- color: import("prop-types").Requireable<string>;
23
- name: import("prop-types").Requireable<string>;
20
+ icon: PropTypes.Requireable<PropTypes.InferProps<{
21
+ color: PropTypes.Requireable<string>;
22
+ name: PropTypes.Requireable<string>;
24
23
  }>>;
25
- onExploreClick: import("prop-types").Requireable<(...args: any[]) => any>;
24
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
26
25
  };
27
- };
28
- export default LearnerSkillCard;
26
+ }
27
+ import PropTypes from "prop-types";
29
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAKjE,OAAkB,EAAC,qBAAqB,EAAC,MAAM,cAAc,CAAC;AAK9D,eAAO,MAAM,qBAAqB,QAAS,MAAM,SAAS,CAAC,cAAc,CAAC,cAAc,MAAM,SAI7F,CAAC;AAEF,QAAA,MAAM,gBAAgB;YAAW,qBAAqB,WAAW,gBAAgB;;;;;;;;;;;;;;;;;;;;;CAoIhF,CAAC;AAQF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.js"],"names":[],"mappings":"AAWO,uEAIN;;AACD,yEAsIC"}
@@ -1,10 +1,10 @@
1
1
  import React, { useCallback, useMemo, useRef } from 'react';
2
+ import PropTypes from 'prop-types';
2
3
  import Provider, { GetTranslateFromContext } from '../../atom/provider';
3
4
  import ProgressBar from '../progress-bar';
4
5
  import { COLORS } from '../../variables/colors';
5
6
  import { createGradientBackground } from '../../util/get-background-gradient-color';
6
7
  import FaIcon from '../../atom/icon';
7
- import propTypes from './prop-types';
8
8
  import style from './style.css';
9
9
  const MAX_SCORE = 100;
10
10
  export const updateBackgroundImage = (ref, background) => {
@@ -16,15 +16,15 @@ const LearnerSkillCard = (props, context) => {
16
16
  const {
17
17
  'aria-label': ariaLabel,
18
18
  cardIndex,
19
- skillTitle,
20
- skillAriaLabel,
19
+ title,
20
+ label,
21
21
  focus,
22
22
  metrics,
23
+ progress,
23
24
  icon,
24
- onExploreClick
25
+ onClick
25
26
  } = props;
26
27
  const {
27
- score,
28
28
  content,
29
29
  questionsToReview = 0
30
30
  } = metrics;
@@ -45,7 +45,8 @@ const LearnerSkillCard = (props, context) => {
45
45
  }, [defaultBackground]);
46
46
  return /*#__PURE__*/React.createElement("div", {
47
47
  "data-testid": `learner-skill-card-wrapper-${cardIndex}`,
48
- onClick: onExploreClick,
48
+ "data-name": `skill-card-${label}`,
49
+ onClick: onClick,
49
50
  className: style.learnerSkillCardContainer,
50
51
  "aria-label": ariaLabel,
51
52
  onMouseEnter: handleMouseEnter,
@@ -99,8 +100,8 @@ const LearnerSkillCard = (props, context) => {
99
100
  }, /*#__PURE__*/React.createElement("div", {
100
101
  "data-name": "skill-card-title",
101
102
  className: style.skillTitle,
102
- "aria-label": skillAriaLabel || skillTitle
103
- }, skillTitle), /*#__PURE__*/React.createElement("div", {
103
+ "aria-label": ariaLabel || title
104
+ }, title), /*#__PURE__*/React.createElement("div", {
104
105
  className: style.contentAndQuestionsWrapper
105
106
  }, /*#__PURE__*/React.createElement("div", {
106
107
  "data-name": "learner-skill-card-skill-content-number"
@@ -134,7 +135,7 @@ const LearnerSkillCard = (props, context) => {
134
135
  })) : null)))), /*#__PURE__*/React.createElement("div", {
135
136
  className: style.progressInformations
136
137
  }, /*#__PURE__*/React.createElement(ProgressBar, {
137
- value: score,
138
+ value: progress,
138
139
  displayInfo: false,
139
140
  max: MAX_SCORE,
140
141
  className: style.progressWrapper,
@@ -146,6 +147,23 @@ const LearnerSkillCard = (props, context) => {
146
147
  LearnerSkillCard.contextTypes = {
147
148
  translate: Provider.childContextTypes.translate
148
149
  };
149
- LearnerSkillCard.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
150
+ LearnerSkillCard.propTypes = process.env.NODE_ENV !== "production" ? {
151
+ type: PropTypes.oneOf(['skill']).isRequired,
152
+ title: PropTypes.string.isRequired,
153
+ label: PropTypes.string,
154
+ 'aria-label': PropTypes.string,
155
+ cardIndex: PropTypes.number,
156
+ focus: PropTypes.bool,
157
+ progress: PropTypes.number,
158
+ metrics: PropTypes.shape({
159
+ content: PropTypes.number,
160
+ questionsToReview: PropTypes.number
161
+ }),
162
+ icon: PropTypes.shape({
163
+ color: PropTypes.string,
164
+ name: PropTypes.string
165
+ }),
166
+ onClick: PropTypes.func
167
+ } : {};
150
168
  export default LearnerSkillCard;
151
169
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useMemo","useRef","Provider","GetTranslateFromContext","ProgressBar","COLORS","createGradientBackground","FaIcon","propTypes","style","MAX_SCORE","updateBackgroundImage","ref","background","current","backgroundImage","LearnerSkillCard","props","context","ariaLabel","cardIndex","skillTitle","skillAriaLabel","focus","metrics","icon","onExploreClick","score","content","questionsToReview","translate","color","name","badgeIconName","badgeLocale","tagTextColor","tagBackgroundColor","purple_700","purple_100","neutral_500","cm_grey_100","headerBackgroundRef","defaultBackground","focusBackground","handleMouseEnter","handleMouseLeave","createElement","onClick","className","learnerSkillCardContainer","onMouseEnter","onMouseLeave","iconHeaderWrapper","iconWrapper","iconName","iconColor","size","faSize","wrapperSize","borderRadius","gradientBackground","customStyle","border","learnerSkillCardContent","skillTitleWrapper","skillFocusBadge","backgroundColor","questionWrapper","contentAndQuestionsWrapper","dangerouslySetInnerHTML","__html","count","skillInformation","cm_grey_400","progressInformations","value","displayInfo","max","progressWrapper","cm_positive_500","contextTypes","childContextTypes","process","env","NODE_ENV"],"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 [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.neutral_500, COLORS.cm_grey_100];\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 <span style={{color: tagTextColor}}>{badgeLocale}</span>\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\n data-name=\"learner-skill-card-skill-content-number\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: translate('content', {count: content})}}\n />\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 backgroundColor: 'transparent',\n size: {faSize: 4, wrapperSize: 0}\n }}\n />\n <span\n data-name=\"learner-skill-card-questions-to-review\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{\n __html: translate('skill_chart_side_panel_questions_to_review', {\n count: questionsToReview\n })\n }}\n />\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.cm_positive_500}}\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,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,EAAEC,MAAM,QAAO,OAAO;AACzD,OAAOC,QAAQ,IAAGC,uBAAuB,QAAO,qBAAqB;AAErE,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,SAAQC,wBAAwB,QAAO,0CAA0C;AACjF,OAAOC,MAAM,MAAM,iBAAiB;AACpC,OAAOC,SAAS,MAA+B,cAAc;AAC7D,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,SAAS,GAAG,GAAG;AAErB,OAAO,MAAMC,qBAAqB,GAAGA,CAACC,GAAoC,EAAEC,UAAkB,KAAK;EACjG,IAAID,GAAG,CAACE,OAAO,EAAE;IACfF,GAAG,CAACE,OAAO,CAACL,KAAK,CAACM,eAAe,GAAGF,UAAU;EAChD;AACF,CAAC;AAED,MAAMG,gBAAgB,GAAGA,CAACC,KAA4B,EAAEC,OAAyB,KAAK;EACpF,MAAM;IACJ,YAAY,EAAEC,SAAS;IACvBC,SAAS;IACTC,UAAU;IACVC,cAAc;IACdC,KAAK;IACLC,OAAO;IACPC,IAAI;IACJC;EACF,CAAC,GAAGT,KAAK;EACT,MAAM;IAACU,KAAK;IAAEC,OAAO;IAAEC,iBAAiB,GAAG;EAAC,CAAC,GAAGL,OAAO;EACvD,MAAMM,SAAS,GAAG3B,uBAAuB,CAACe,OAAO,CAAC;EAClD,MAAM;IAACa,KAAK;IAAEC;EAAI,CAAC,GAAGP,IAAI;EAC1B,MAAM,CAACQ,aAAa,EAAEC,WAAW,EAAEC,YAAY,EAAEC,kBAAkB,CAAC,GAAGb,KAAK,GACxE,CAAC,gBAAgB,EAAEO,SAAS,CAAC,aAAa,CAAC,EAAYzB,MAAM,CAACgC,UAAU,EAAEhC,MAAM,CAACiC,UAAU,CA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]}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useMemo","useRef","PropTypes","Provider","GetTranslateFromContext","ProgressBar","COLORS","createGradientBackground","FaIcon","style","MAX_SCORE","updateBackgroundImage","ref","background","current","backgroundImage","LearnerSkillCard","props","context","ariaLabel","cardIndex","title","label","focus","metrics","progress","icon","onClick","content","questionsToReview","translate","color","name","badgeIconName","badgeLocale","tagTextColor","tagBackgroundColor","purple_700","purple_100","neutral_500","cm_grey_100","headerBackgroundRef","defaultBackground","focusBackground","handleMouseEnter","handleMouseLeave","createElement","className","learnerSkillCardContainer","onMouseEnter","onMouseLeave","iconHeaderWrapper","iconWrapper","iconName","iconColor","size","faSize","wrapperSize","borderRadius","gradientBackground","customStyle","border","learnerSkillCardContent","skillTitleWrapper","skillFocusBadge","backgroundColor","questionWrapper","skillTitle","contentAndQuestionsWrapper","dangerouslySetInnerHTML","__html","count","skillInformation","cm_grey_400","progressInformations","value","displayInfo","max","progressWrapper","cm_positive_500","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","type","oneOf","isRequired","string","number","bool","shape","func"],"sources":["../../../src/molecule/learner-skill-card/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport {createGradientBackground} from '../../util/get-background-gradient-color';\nimport FaIcon from '../../atom/icon';\nimport style from './style.css';\n\nconst MAX_SCORE = 100;\n\nexport const updateBackgroundImage = (ref, background) => {\n if (ref.current) {\n ref.current.style.backgroundImage = background;\n }\n};\nconst LearnerSkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n cardIndex,\n title,\n label,\n focus,\n metrics,\n progress,\n icon,\n onClick\n } = props;\n const {content, questionsToReview = 0} = metrics;\n const translate = GetTranslateFromContext(context);\n const {color, name} = icon;\n const [badgeIconName, badgeLocale, tagTextColor, tagBackgroundColor] = focus\n ? ['bullseye-arrow', translate('skill_focus'), COLORS.purple_700, COLORS.purple_100]\n : ['shapes', translate('skill'), COLORS.neutral_500, COLORS.cm_grey_100];\n const headerBackgroundRef = useRef(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 data-name={`skill-card-${label}`}\n onClick={onClick}\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 <span style={{color: tagTextColor}}>{badgeLocale}</span>\n </div>\n\n <div className={style.questionWrapper}>\n <div\n data-name=\"skill-card-title\"\n className={style.skillTitle}\n aria-label={ariaLabel || title}\n >\n {title}\n </div>\n <div className={style.contentAndQuestionsWrapper}>\n <div\n data-name=\"learner-skill-card-skill-content-number\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: translate('content', {count: content})}}\n />\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 backgroundColor: 'transparent',\n size: {faSize: 4, wrapperSize: 0}\n }}\n />\n <span\n data-name=\"learner-skill-card-questions-to-review\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{\n __html: translate('skill_chart_side_panel_questions_to_review', {\n count: questionsToReview\n })\n }}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n <div className={style.progressInformations}>\n <ProgressBar\n value={progress}\n displayInfo={false}\n max={MAX_SCORE}\n className={style.progressWrapper}\n style={{backgroundColor: COLORS.cm_positive_500}}\n />\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = {\n type: PropTypes.oneOf(['skill']).isRequired,\n title: PropTypes.string.isRequired,\n label: PropTypes.string,\n 'aria-label': PropTypes.string,\n cardIndex: PropTypes.number,\n focus: PropTypes.bool,\n progress: PropTypes.number,\n metrics: PropTypes.shape({\n content: PropTypes.number,\n questionsToReview: PropTypes.number\n }),\n icon: PropTypes.shape({\n color: PropTypes.string,\n name: PropTypes.string\n }),\n onClick: PropTypes.func\n};\nexport default LearnerSkillCard;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,EAAEC,MAAM,QAAO,OAAO;AACzD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,QAAQ,IAAGC,uBAAuB,QAAO,qBAAqB;AACrE,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,SAAQC,wBAAwB,QAAO,0CAA0C;AACjF,OAAOC,MAAM,MAAM,iBAAiB;AACpC,OAAOC,KA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E1B,SAAS,CAACwF,MAAM;IACzB7D,iBAAiB,EAAE3B,SAAS,CAACwF;EAC/B,CAAC,CAAC;EACFhE,IAAI,EAAExB,SAAS,CAAC0F,KAAK,CAAC;IACpB7D,KAAK,EAAE7B,SAAS,CAACuF,MAAM;IACvBzD,IAAI,EAAE9B,SAAS,CAACuF;EAClB,CAAC,CAAC;EACF9D,OAAO,EAAEzB,SAAS,CAAC2F;AACrB,CAAC;AACD,eAAe7E,gBAAgB","ignoreList":[]}
@@ -1,10 +1,11 @@
1
1
  export default PlaylistCard;
2
- declare function PlaylistCard(props: any, context: any): JSX.Element;
2
+ declare function PlaylistCard(props: any, context: any): JSX.Element | null;
3
3
  declare namespace PlaylistCard {
4
4
  namespace contextTypes {
5
5
  const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  }
7
7
  namespace propTypes {
8
+ const type: PropTypes.Validator<string>;
8
9
  const label: PropTypes.Requireable<string>;
9
10
  const title: PropTypes.Validator<string>;
10
11
  const progress: PropTypes.Requireable<number>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/playlist-card/index.js"],"names":[],"mappings":";AASA,qEAuCC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/playlist-card/index.js"],"names":[],"mappings":";AASA,4EAwCC"}
@@ -8,6 +8,7 @@ import PlaylistDetailCover from '../playlist-detail-cover';
8
8
  import style from './style.css';
9
9
  const PlaylistCard = (props, context) => {
10
10
  const {
11
+ type,
11
12
  label,
12
13
  title,
13
14
  progress = 0,
@@ -18,6 +19,7 @@ const PlaylistCard = (props, context) => {
18
19
  coursesLabel
19
20
  }
20
21
  } = props;
22
+ if (type !== 'playlist') return null;
21
23
  const cover = coverImages ? /*#__PURE__*/React.createElement(PlaylistDetailCover, {
22
24
  className: style.cover,
23
25
  images: coverImages
@@ -63,6 +65,7 @@ PlaylistCard.contextTypes = {
63
65
  translate: Provider.childContextTypes.translate
64
66
  };
65
67
  PlaylistCard.propTypes = process.env.NODE_ENV !== "production" ? {
68
+ type: PropTypes.oneOf(['playlist']).isRequired,
66
69
  label: PropTypes.string,
67
70
  title: PropTypes.string.isRequired,
68
71
  progress: PropTypes.number,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","COLORS","Provider","Tag","ProgressBar","PlaylistDetailCover","style","PlaylistCard","props","context","label","title","progress","coverImages","onClick","locales","playlistTag","coursesLabel","cover","createElement","className","images","icon","iconName","container","imageContainer","detailWrapper","titleWrapper","size","courseCount","dangerouslySetInnerHTML","__html","customProgressBar","backgroundColor","cm_positive_500","displayInfo","value","max","contextTypes","translate","childContextTypes","propTypes","process","env","NODE_ENV","string","isRequired","number","func","shape","defaultProps"],"sources":["../../../src/molecule/playlist-card/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {COLORS} from '../../variables/colors';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport ProgressBar from '../progress-bar';\nimport PlaylistDetailCover from '../playlist-detail-cover';\nimport style from './style.css';\n\nconst PlaylistCard = (props, context) => {\n const {\n label,\n title,\n progress = 0,\n coverImages,\n onClick,\n locales: {playlistTag, coursesLabel}\n } = props;\n\n const cover = coverImages ? (\n <PlaylistDetailCover className={style.cover} images={coverImages} />\n ) : null;\n const icon = {iconName: 'lines-leaning'};\n return (\n <div className={style.container} data-name={`playlist-card-${label}`} onClick={onClick}>\n <div className={style.imageContainer}>{cover}</div>\n <div className={style.detailWrapper}>\n <div className={style.titleWrapper}>\n <Tag label={playlistTag} size=\"S\" icon={icon} />\n <div className={style.title} data-name=\"playlist-title\">\n {title}\n </div>\n <div\n className={style.courseCount}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: coursesLabel}}\n />\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.cm_positive_500}}\n displayInfo={false}\n value={progress}\n max={100}\n />\n </div>\n </div>\n );\n};\n\nPlaylistCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nPlaylistCard.propTypes = {\n label: PropTypes.string,\n title: PropTypes.string.isRequired,\n progress: PropTypes.number,\n coverImages: PlaylistDetailCover.propTypes.images,\n onClick: PropTypes.func,\n locales: PropTypes.shape({\n playlistTag: PropTypes.string,\n coursesLabel: PropTypes.string\n })\n};\n\nPlaylistCard.defaultProps = {\n locales: {\n playlistTag: 'Playlist',\n coursesLabel: 'courses'\n }\n};\n\nexport default PlaylistCard;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,GAAG,MAAM,gBAAgB;AAChC,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,YAAY,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EACvC,MAAM;IACJC,KAAK;IACLC,KAAK;IACLC,QAAQ,GAAG,CAAC;IACZC,WAAW;IACXC,OAAO;IACPC,OAAO,EAAE;MAACC,WAAW;MAAEC;IAAY;EACrC,CAAC,GAAGT,KAAK;EAET,MAAMU,KAAK,GAAGL,WAAW,gBACvBd,KAAA,CAAAoB,aAAA,CAACd,mBAAmB;IAACe,SAAS,EAAEd,KAAK,CAACY,KAAM;IAACG,MAAM,EAAER;EAAY,CAAE,CAAC,GAClE,IAAI;EACR,MAAMS,IAAI,GAAG;IAACC,QAAQ,EAAE;EAAe,CAAC;EACxC,oBACExB,KAAA,CAAAoB,aAAA;IAAKC,SAAS,EAAEd,KAAK,CAACkB,SAAU;IAAC,aAAW,iBAAiBd,KAAK,EAAG;IAACI,OAAO,EAAEA;EAAQ,gBACrFf,KAAA,CAAAoB,aAAA;IAAKC,SAAS,EAAEd,KAAK,CAACmB;EAAe,G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D,KAAK,CAAC;IACvBjC,WAAW,EAAEhB,SAAS,CAAC6C,MAAM;IAC7B5B,YAAY,EAAEjB,SAAS,CAAC6C;EAC1B,CAAC;AACH,CAAC;AAEDtC,YAAY,CAAC2C,YAAY,GAAG;EAC1BnC,OAAO,EAAE;IACPC,WAAW,EAAE,UAAU;IACvBC,YAAY,EAAE;EAChB;AACF,CAAC;AAED,eAAeV,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","PropTypes","COLORS","Provider","Tag","ProgressBar","PlaylistDetailCover","style","PlaylistCard","props","context","type","label","title","progress","coverImages","onClick","locales","playlistTag","coursesLabel","cover","createElement","className","images","icon","iconName","container","imageContainer","detailWrapper","titleWrapper","size","courseCount","dangerouslySetInnerHTML","__html","customProgressBar","backgroundColor","cm_positive_500","displayInfo","value","max","contextTypes","translate","childContextTypes","propTypes","process","env","NODE_ENV","oneOf","isRequired","string","number","func","shape","defaultProps"],"sources":["../../../src/molecule/playlist-card/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {COLORS} from '../../variables/colors';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport ProgressBar from '../progress-bar';\nimport PlaylistDetailCover from '../playlist-detail-cover';\nimport style from './style.css';\n\nconst PlaylistCard = (props, context) => {\n const {\n type,\n label,\n title,\n progress = 0,\n coverImages,\n onClick,\n locales: {playlistTag, coursesLabel}\n } = props;\n if (type !== 'playlist') return null;\n const cover = coverImages ? (\n <PlaylistDetailCover className={style.cover} images={coverImages} />\n ) : null;\n const icon = {iconName: 'lines-leaning'};\n return (\n <div className={style.container} data-name={`playlist-card-${label}`} onClick={onClick}>\n <div className={style.imageContainer}>{cover}</div>\n <div className={style.detailWrapper}>\n <div className={style.titleWrapper}>\n <Tag label={playlistTag} size=\"S\" icon={icon} />\n <div className={style.title} data-name=\"playlist-title\">\n {title}\n </div>\n <div\n className={style.courseCount}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: coursesLabel}}\n />\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.cm_positive_500}}\n displayInfo={false}\n value={progress}\n max={100}\n />\n </div>\n </div>\n );\n};\n\nPlaylistCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nPlaylistCard.propTypes = {\n type: PropTypes.oneOf(['playlist']).isRequired,\n label: PropTypes.string,\n title: PropTypes.string.isRequired,\n progress: PropTypes.number,\n coverImages: PlaylistDetailCover.propTypes.images,\n onClick: PropTypes.func,\n locales: PropTypes.shape({\n playlistTag: PropTypes.string,\n coursesLabel: PropTypes.string\n })\n};\n\nPlaylistCard.defaultProps = {\n locales: {\n playlistTag: 'Playlist',\n coursesLabel: 'courses'\n }\n};\n\nexport default PlaylistCard;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,GAAG,MAAM,gBAAgB;AAChC,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,YAAY,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EACvC,MAAM;IACJC,IAAI;IACJC,KAAK;IACLC,KAAK;IACLC,QAAQ,GAAG,CAAC;IACZC,WAAW;IACXC,OAAO;IACPC,OAAO,EAAE;MAACC,WAAW;MAAEC;IAAY;EACrC,CAAC,GAAGV,KAAK;EACT,IAAIE,IAAI,KAAK,UAAU,EAAE,OAAO,IAAI;EACpC,MAAMS,KAAK,GAAGL,WAAW,gBACvBf,KAAA,CAAAqB,aAAA,CAACf,mBAAmB;IAACgB,SAAS,EAAEf,KAAK,CAACa,KAAM;IAACG,MAAM,EAAER;EAAY,CAAE,CAAC,GAClE,IAAI;EACR,MAAMS,IAAI,GAAG;IAACC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KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,CAACC,UAAU;EAC9CpC,KAAK,EAAEX,SAAS,CAACgD,MAAM;EACvBpC,KAAK,EAAEZ,SAAS,CAACgD,MAAM,CAACD,UAAU;EAClClC,QAAQ,EAAEb,SAAS,CAACiD,MAAM;EAC1BnC,WAAW,EAAET,mBAAmB,CAACqC,SAAS,CAACpB,MAAM;EACjDP,OAAO,EAAEf,SAAS,CAACkD,IAAI;EACvBlC,OAAO,EAAEhB,SAAS,CAACmD,KAAK,CAAC;IACvBlC,WAAW,EAAEjB,SAAS,CAACgD,MAAM;IAC7B9B,YAAY,EAAElB,SAAS,CAACgD;EAC1B,CAAC;AACH,CAAC;AAEDzC,YAAY,CAAC6C,YAAY,GAAG;EAC1BpC,OAAO,EAAE;IACPC,WAAW,EAAE,UAAU;IACvBC,YAAY,EAAE;EAChB;AACF,CAAC;AAED,eAAeX,YAAY","ignoreList":[]}
@@ -31,6 +31,34 @@ export interface CardProps {
31
31
  'badge-aria-label'?: string;
32
32
  'disabled-aria-label'?: string;
33
33
  'card-content-aria-label'?: string;
34
+ cardIndex?: number;
35
+ focus?: boolean;
36
+ metrics?: {
37
+ content?: number;
38
+ questionsToReview?: number;
39
+ };
40
+ icon?: {
41
+ color: string;
42
+ name: string;
43
+ };
44
+ label?: string;
45
+ goal?: {
46
+ title?: string;
47
+ condition?: {
48
+ nbDone?: number;
49
+ };
50
+ };
51
+ imgUrl?: string;
52
+ locales?: {
53
+ conditionDescriptionProgress?: string;
54
+ tag?: string;
55
+ playlistTag?: string;
56
+ coursesLabel?: string;
57
+ };
58
+ coverImages?: {
59
+ url: string;
60
+ title: string;
61
+ }[];
34
62
  }
35
63
  export interface CardsGridProps {
36
64
  list: CardProps[];
@@ -40,7 +68,7 @@ export interface CardsGridProps {
40
68
  declare const CardsGrid: {
41
69
  (props: CardsGridProps): JSX.Element;
42
70
  propTypes: {
43
- list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
71
+ list: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
44
72
  customStyle: PropTypes.Requireable<{
45
73
  [x: string]: string | null | undefined;
46
74
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/cards-grid/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAMnC,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACxD,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC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,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;KACH,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE;QACR,4BAA4B,CAAC,EAAE,MAAM,CAAC;QACtC,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,WAAW,CAAC,EAAE;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;CACL;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,SAAS;YAAW,cAAc;;;;;;;;CAqCvC,CAAC;AAgBF,eAAe,SAAS,CAAC"}
@@ -1,8 +1,12 @@
1
+ import _uniqueId from "lodash/fp/uniqueId";
1
2
  import _map from "lodash/fp/map";
2
3
  import React from 'react';
3
4
  import PropTypes from 'prop-types';
4
5
  import Card from '../../molecule/card';
5
6
  import Loader from '../../atom/loader';
7
+ import CertificationCard from '../../molecule/certification-card';
8
+ import PlaylistCard from '../../molecule/playlist-card';
9
+ import LearnerSkillCard from '../../molecule/learner-skill-card';
6
10
  import style from './style.css';
7
11
  const CardsGrid = props => {
8
12
  const {
@@ -13,21 +17,32 @@ const CardsGrid = props => {
13
17
  const loader = loading ? /*#__PURE__*/React.createElement("div", {
14
18
  className: style.loader
15
19
  }, /*#__PURE__*/React.createElement(Loader, null)) : null;
16
- const cards = _map(cardProps => {
17
- return /*#__PURE__*/React.createElement("div", {
18
- "data-name": "cardGrid",
19
- className: style.card,
20
- key: cardProps.key
21
- }, /*#__PURE__*/React.createElement(Card, cardProps));
22
- }, list);
20
+ const renderCardByType = cardProps => {
21
+ switch (cardProps.type) {
22
+ case 'skill':
23
+ return /*#__PURE__*/React.createElement(LearnerSkillCard, cardProps);
24
+ case 'certification':
25
+ return /*#__PURE__*/React.createElement(CertificationCard, cardProps);
26
+ case 'playlist':
27
+ return /*#__PURE__*/React.createElement(PlaylistCard, cardProps);
28
+ default:
29
+ return /*#__PURE__*/React.createElement(Card, cardProps);
30
+ }
31
+ };
32
+ const cards = _map(cardProps => /*#__PURE__*/React.createElement("div", {
33
+ "data-name": "cardGrid",
34
+ className: style.card,
35
+ key: _uniqueId('card')
36
+ }, renderCardByType(cardProps)), list);
23
37
  return /*#__PURE__*/React.createElement("div", {
24
38
  className: style.defaultStyle,
25
39
  style: customStyle
26
40
  }, cards, loader);
27
41
  };
28
42
  CardsGrid.propTypes = process.env.NODE_ENV !== "production" ? {
43
+ list: PropTypes.arrayOf(PropTypes.oneOfType([
29
44
  // @ts-expect-error component is not typed & wrapped into memo
30
- list: PropTypes.arrayOf(PropTypes.shape(Card.propTypes)),
45
+ PropTypes.shape(Card.propTypes), PropTypes.shape(LearnerSkillCard.propTypes), PropTypes.shape(CertificationCard.propTypes), PropTypes.shape(PlaylistCard.propTypes)])),
31
46
  customStyle: PropTypes.objectOf(PropTypes.string),
32
47
  loading: PropTypes.bool
33
48
  } : {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","Card","Loader","style","CardsGrid","props","list","customStyle","loading","loader","createElement","className","cards","_map","cardProps","card","key","defaultStyle","propTypes","process","env","NODE_ENV","arrayOf","shape","objectOf","string","bool"],"sources":["../../../src/organism/cards-grid/index.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Card from '../../molecule/card';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nexport interface CardProps {\n key?: React.Key;\n badge?: string;\n image?: string;\n disabled?: boolean;\n adaptiv?: boolean;\n type?: string;\n title?: string;\n author?: string;\n certifiedAuthor?: boolean;\n customer?: Record<string, unknown>;\n progress: number;\n favorite?: boolean;\n addFavoriteToolTip?: string;\n removeFavoriteToolTip?: string;\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n onFavoriteClick?: () => void;\n isSelected?: boolean;\n notification?: Record<string, unknown>;\n badgeCategory?: string;\n badgeLabel?: string;\n theme?: 'default' | 'coorpmanager';\n disabledContent?: string;\n 'aria-label'?: string;\n 'background-aria-label'?: string;\n 'favorite-aria-label'?: string;\n 'selectable-aria-label'?: string;\n 'customer-aria-label'?: string;\n 'badge-aria-label'?: string;\n 'disabled-aria-label'?: string;\n 'card-content-aria-label'?: string;\n}\n\nexport interface CardsGridProps {\n list: CardProps[];\n customStyle?: Record<string, string>;\n loading?: boolean;\n}\n\nconst CardsGrid = (props: CardsGridProps) => {\n const {list = [], customStyle = {}, loading = false} = props;\n\n const loader = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : null;\n\n const cards = map(cardProps => {\n return (\n <div data-name=\"cardGrid\" className={style.card} key={cardProps.key}>\n <Card {...cardProps} />\n </div>\n );\n }, list);\n\n return (\n <div className={style.defaultStyle} style={customStyle}>\n {cards}\n {loader}\n </div>\n );\n};\n\nCardsGrid.propTypes = {\n // @ts-expect-error component is not typed & wrapped into memo\n list: PropTypes.arrayOf(PropTypes.shape(Card.propTypes)),\n customStyle: PropTypes.objectOf(PropTypes.string),\n loading: PropTypes.bool\n};\n\nexport default CardsGrid;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,IAAI,MAAM,qBAAqB;AACtC,OAAOC,MAAM,MAAM,mBAAmB;AACtC,OAAOC,KAAK,MAAM,aAAa;AAyC/B,MAAMC,SAAS,GAAIC,KAAqB,IAAK;EAC3C,MAAM;IAACC,IAAI,GAAG,EAAE;IAAEC,WAAW,GAAG,CAAC,CAAC;IAAEC,OAAO,GAAG;EAAK,CAAC,GAAGH,KAAK;EAE5D,MAAMI,MAAM,GAAGD,OAAO,gBACpBT,KAAA,CAAAW,aAAA;IAAKC,SAAS,EAAER,KAAK,CAACM;EAAO,gBAC3BV,KAAA,CAAAW,aAAA,CAACR,MAAM,MAAE,CACN,CAAC,GACJ,IAAI;EAER,MAAMU,KAAK,GAAGC,IAAA,CAAIC,SAAS,IAAI;IAC7B,oBACEf,KAAA,CAAAW,aAAA;MAAK,aAAU,UAAU;MAACC,SAAS,EAAER,KAAK,CAACY,IAAK;MAACC,GAAG,EAAEF,SAAS,CAACE;IAAI,gBAClEjB,KAAA,CAAAW,aAAA,CAACT,IAAI,EAAKa,SAAY,CACnB,CAAC;EAEV,CAAC,EAAER,IAAI,CAAC;EAER,oBACEP,KAAA,CAAAW,aAAA;IAAKC,SAAS,EAAER,KAAK,CAACc,YAAa;IAACd,KAAK,EAAEI;EAAY,GACpDK,KAAK,EACLH,MACE,CAAC;AAEV,CAAC;AAEDL,SAAS,CAACc,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACpB;EACAf,IAAI,EAAEN,SAAS,CAACsB,OAAO,CAACtB,SAAS,CAACuB,KAAK,CAACtB,IAAI,CAACiB,SAAS,CAAC,CAAC;EACxDX,WAAW,EAAEP,SAAS,CAACwB,QAAQ,CAACxB,SAAS,CAACyB,MAAM,CAAC;EACjDjB,OAAO,EAAER,SAAS,CAAC0B;AACrB,CAAC;AAED,eAAetB,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","PropTypes","Card","Loader","CertificationCard","PlaylistCard","LearnerSkillCard","style","CardsGrid","props","list","customStyle","loading","loader","createElement","className","renderCardByType","cardProps","type","cards","_map","card","key","_uniqueId","defaultStyle","propTypes","process","env","NODE_ENV","arrayOf","oneOfType","shape","objectOf","string","bool"],"sources":["../../../src/organism/cards-grid/index.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, uniqueId} from 'lodash/fp';\nimport Card from '../../molecule/card';\nimport Loader from '../../atom/loader';\nimport CertificationCard from '../../molecule/certification-card';\nimport PlaylistCard from '../../molecule/playlist-card';\nimport LearnerSkillCard from '../../molecule/learner-skill-card';\nimport style from './style.css';\n\nexport interface CardProps {\n key?: React.Key;\n badge?: string;\n image?: string;\n disabled?: boolean;\n adaptiv?: boolean;\n type?: string;\n title?: string;\n author?: string;\n certifiedAuthor?: boolean;\n customer?: Record<string, unknown>;\n progress: number;\n favorite?: boolean;\n addFavoriteToolTip?: string;\n removeFavoriteToolTip?: string;\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n onFavoriteClick?: () => void;\n isSelected?: boolean;\n notification?: Record<string, unknown>;\n badgeCategory?: string;\n badgeLabel?: string;\n theme?: 'default' | 'coorpmanager';\n disabledContent?: string;\n 'aria-label'?: string;\n 'background-aria-label'?: string;\n 'favorite-aria-label'?: string;\n 'selectable-aria-label'?: string;\n 'customer-aria-label'?: string;\n 'badge-aria-label'?: string;\n 'disabled-aria-label'?: string;\n 'card-content-aria-label'?: string;\n cardIndex?: number;\n focus?: boolean;\n metrics?: {\n content?: number;\n questionsToReview?: number;\n };\n icon?: {\n color: string;\n name: string;\n };\n label?: string;\n goal?: {\n title?: string;\n condition?: {\n nbDone?: number;\n };\n };\n imgUrl?: string;\n locales?: {\n conditionDescriptionProgress?: string;\n tag?: string;\n playlistTag?: string;\n coursesLabel?: string;\n };\n coverImages?: {\n url: string;\n title: string;\n }[];\n}\n\nexport interface CardsGridProps {\n list: CardProps[];\n customStyle?: Record<string, string>;\n loading?: boolean;\n}\n\nconst CardsGrid = (props: CardsGridProps) => {\n const {list = [], customStyle = {}, loading = false} = props;\n\n const loader = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : null;\n\n const renderCardByType = (cardProps: any) => {\n switch (cardProps.type) {\n case 'skill':\n return <LearnerSkillCard {...cardProps} />;\n case 'certification':\n return <CertificationCard {...cardProps} />;\n case 'playlist':\n return <PlaylistCard {...cardProps} />;\n default:\n return <Card {...cardProps} />;\n }\n };\n\n const cards = map(\n cardProps => (\n <div data-name=\"cardGrid\" className={style.card} key={uniqueId('card')}>\n {renderCardByType(cardProps)}\n </div>\n ),\n list\n );\n\n return (\n <div className={style.defaultStyle} style={customStyle}>\n {cards}\n {loader}\n </div>\n );\n};\n\nCardsGrid.propTypes = {\n list: PropTypes.arrayOf(\n PropTypes.oneOfType([\n // @ts-expect-error component is not typed & wrapped into memo\n PropTypes.shape(Card.propTypes),\n PropTypes.shape(LearnerSkillCard.propTypes),\n PropTypes.shape(CertificationCard.propTypes),\n PropTypes.shape(PlaylistCard.propTypes)\n ])\n ),\n customStyle: PropTypes.objectOf(PropTypes.string),\n loading: PropTypes.bool\n};\n\nexport default CardsGrid;\n"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,IAAI,MAAM,qBAAqB;AACtC,OAAOC,MAAM,MAAM,mBAAmB;AACtC,OAAOC,iBAAiB,MAAM,mCAAmC;AACjE,OAAOC,YAAY,MAAM,8BAA8B;AACvD,OAAOC,gBAAgB,MAAM,mCAAmC;AAChE,OAAOC,KAAK,MAAM,aAAa;AAqE/B,MAAMC,SAAS,GAAIC,KAAqB,IAAK;EAC3C,MAAM;IAACC,IAAI,GAAG,EAAE;IAAEC,WAAW,GAAG,CAAC,CAAC;IAAEC,OAAO,GAAG;EAAK,CAAC,GAAGH,KAAK;EAE5D,MAAMI,MAAM,GAAGD,OAAO,gBACpBZ,KAAA,CAAAc,aAAA;IAAKC,SAAS,EAAER,KAAK,CAACM;EAAO,gBAC3Bb,KAAA,CAAAc,aAAA,CAACX,MAAM,MAAE,CACN,CAAC,GACJ,IAAI;EAER,MAAMa,gBAAgB,GAAIC,SAAc,IAAK;IAC3C,QAAQA,SAAS,CAACC,IAAI;MACpB,KAAK,OAAO;QACV,oBAAOlB,KAAA,CAAAc,aAAA,CAACR,gBAAgB,EAAKW,SAAY,CAAC;MAC5C,KAAK,eAAe;QAClB,oBAAOj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Types.InferProps<{
156
156
  type: PropTypes.Requireable<string>;
157
157
  list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
158
- list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
158
+ list: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
159
159
  customStyle: PropTypes.Requireable<{
160
160
  [x: string]: string | null | undefined;
161
161
  }>;
@@ -206,7 +206,7 @@ declare namespace SlidePlayer {
206
206
  items: PropTypes.Requireable<PropTypes.InferProps<{
207
207
  type: PropTypes.Requireable<string>;
208
208
  list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
209
- list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
209
+ list: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
210
210
  customStyle: PropTypes.Requireable<{
211
211
  [x: string]: string | null | undefined;
212
212
  }>;
@@ -1014,7 +1014,7 @@ declare namespace SlidePlayer {
1014
1014
  items: PropTypes.Requireable<PropTypes.InferProps<{
1015
1015
  type: PropTypes.Requireable<string>;
1016
1016
  list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
1017
- list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
1017
+ list: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
1018
1018
  customStyle: PropTypes.Requireable<{
1019
1019
  [x: string]: string | null | undefined;
1020
1020
  }>;
@@ -212,7 +212,7 @@ declare namespace SlidesPlayer {
212
212
  items: PropTypes.Requireable<PropTypes.InferProps<{
213
213
  type: PropTypes.Requireable<string>;
214
214
  list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
215
- list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
215
+ list: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
216
216
  customStyle: PropTypes.Requireable<{
217
217
  [x: string]: string | null | undefined;
218
218
  }>;
@@ -242,7 +242,7 @@ declare class PopinCorrection extends React.Component<any, any, any> {
242
242
  items: PropTypes.Requireable<PropTypes.InferProps<{
243
243
  type: PropTypes.Requireable<string>;
244
244
  list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
245
- list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
245
+ list: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
246
246
  customStyle: PropTypes.Requireable<{
247
247
  [x: string]: string | null | undefined;
248
248
  }>;
@@ -342,7 +342,7 @@ declare namespace PopinEnd {
342
342
  items: PropTypes.Requireable<PropTypes.InferProps<{
343
343
  type: PropTypes.Requireable<string>;
344
344
  list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
345
- list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
345
+ list: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
346
346
  customStyle: PropTypes.Requireable<{
347
347
  [x: string]: string | null | undefined;
348
348
  }>;
@@ -663,7 +663,7 @@ declare const AppReview: {
663
663
  items: import("prop-types").Requireable<import("prop-types").InferProps<{
664
664
  type: import("prop-types").Requireable<string>;
665
665
  list: import("prop-types").Requireable<NonNullable<import("prop-types").InferProps<{
666
- list: import("prop-types").Requireable<(import("prop-types").InferProps<any> | null | undefined)[]>;
666
+ list: import("prop-types").Requireable<((import("prop-types").InferPropsInner<Pick<any, any>> & Partial<import("prop-types").InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
667
667
  customStyle: import("prop-types").Requireable<{
668
668
  [x: string]: string | null | undefined;
669
669
  }>;
@@ -664,7 +664,7 @@ declare const propTypes: {
664
664
  items: PropTypes.Requireable<PropTypes.InferProps<{
665
665
  type: PropTypes.Requireable<string>;
666
666
  list: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
667
- list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
667
+ list: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
668
668
  customStyle: PropTypes.Requireable<{
669
669
  [x: string]: string | null | undefined;
670
670
  }>;