@coorpacademy/components 11.35.2-forcedeploy.13 → 11.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/button-link/index.js +1 -1
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/style.css +2 -2
- package/es/atom/icon/index.d.ts +17 -35
- package/es/atom/icon/index.d.ts.map +1 -1
- package/es/atom/icon/index.js +15 -32
- package/es/atom/icon/index.js.map +1 -1
- package/es/atom/radio-with-title/index.d.ts +3 -13
- package/es/atom/radio-with-title/index.d.ts.map +1 -1
- package/es/atom/radio-with-title/types.d.ts +2 -13
- package/es/atom/radio-with-title/types.d.ts.map +1 -1
- package/es/atom/status-item/index.native.js +1 -1
- package/es/atom/status-item/index.native.js.map +1 -1
- package/es/atom/tag/index.d.ts +1 -12
- package/es/atom/tag/style.css +0 -1
- package/es/atom/title/index.d.ts +2 -13
- package/es/molecule/banner/style.css +0 -1
- package/es/molecule/base-modal/style.css +1 -0
- package/es/molecule/bulk-progress-bar/index.js +2 -2
- package/es/molecule/bulk-progress-bar/index.js.map +1 -1
- package/es/molecule/certification-card/index.js +1 -1
- package/es/molecule/certification-card/index.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +7 -28
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/cm-popin/types.js +1 -1
- package/es/molecule/cm-popin/types.js.map +1 -1
- package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +0 -2
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/learner-skill-card/index.js +8 -10
- package/es/molecule/learner-skill-card/index.js.map +1 -1
- package/es/molecule/learner-skill-card/style.css +0 -1
- package/es/molecule/learning-priority-modal/style.css +2 -3
- package/es/molecule/progress-wrapper/index.js +1 -1
- package/es/molecule/progress-wrapper/index.js.map +1 -1
- package/es/molecule/skills-chart-side-information-item/index.d.ts +1 -1
- package/es/molecule/skills-chart-side-information-panel/index.d.ts +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +2 -13
- package/es/molecule/title-radio-wrapper/index.d.ts +3 -13
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +2 -13
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/molecule/translation-modal/index.d.ts +1 -0
- package/es/molecule/translation-modal/index.d.ts.map +1 -1
- package/es/molecule/translation-modal/index.js +7 -24
- package/es/molecule/translation-modal/index.js.map +1 -1
- package/es/organism/cards-grid/index.d.ts +10 -48
- package/es/organism/cards-grid/index.d.ts.map +1 -1
- package/es/organism/cards-grid/index.js +2 -3
- package/es/organism/cards-grid/index.js.map +1 -1
- package/es/organism/content-skill-modal/index.d.ts +3 -13
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +2 -12
- package/es/organism/content-skill-modal/types.d.ts.map +1 -1
- package/es/organism/list-item/index.js +5 -5
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +17 -23
- package/es/organism/list-items/index.d.ts +2 -13
- package/es/organism/list-items/style.css +0 -1
- package/es/organism/rewards-form/index.d.ts +2 -13
- package/es/organism/select-opponents/index.d.ts +3 -13
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +2 -13
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/sidebar/index.d.ts +2 -2
- package/es/organism/skill-edition/index.d.ts +52 -1261
- package/es/organism/skill-edition/index.d.ts.map +1 -1
- package/es/organism/skill-edition/index.js +224 -3
- package/es/organism/skill-edition/index.js.map +1 -1
- package/es/organism/skill-edition/types.d.ts +117 -1268
- package/es/organism/skill-edition/types.d.ts.map +1 -1
- package/es/organism/skill-edition/types.js +59 -7
- package/es/organism/skill-edition/types.js.map +1 -1
- package/es/organism/title-and-input/index.d.ts +5 -25
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +4 -24
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +2 -13
- package/es/template/app-player/loading/index.d.ts +6 -27
- package/es/template/app-player/player/index.d.ts +12 -53
- package/es/template/app-player/player/slides/index.d.ts +6 -27
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +6 -26
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +6 -27
- package/es/template/app-review/index.d.ts +7 -27
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +6 -27
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +6 -27
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +1113 -1713
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +12 -0
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/utils.d.ts +1 -1
- package/es/template/common/dashboard/index.d.ts +12 -53
- package/es/template/common/search-page/index.d.ts +6 -27
- package/es/template/external-course/index.d.ts +6 -27
- package/es/template/skill-detail/all-courses.css +2 -3
- package/es/template/skill-detail/all-courses.d.ts +17 -52
- package/es/template/skill-detail/all-courses.d.ts.map +1 -1
- package/es/template/skill-detail/all-courses.js +11 -12
- package/es/template/skill-detail/all-courses.js.map +1 -1
- package/es/template/skill-detail/continue-learning.css +2 -7
- package/es/template/skill-detail/continue-learning.d.ts +12 -25
- package/es/template/skill-detail/continue-learning.d.ts.map +1 -1
- package/es/template/skill-detail/continue-learning.js.map +1 -1
- package/es/template/skill-detail/index.d.ts +71 -81
- package/es/template/skill-detail/index.d.ts.map +1 -1
- package/es/template/skill-detail/index.js +55 -87
- package/es/template/skill-detail/index.js.map +1 -1
- package/es/template/skill-detail/style.css +39 -97
- package/es/variables/colors.css +0 -2
- package/es/variables/colors.d.ts +2 -3
- package/es/variables/colors.d.ts.map +1 -1
- package/es/variables/colors.js +3 -4
- package/es/variables/colors.js.map +1 -1
- package/es/variables/theme.native.js +1 -1
- package/es/variables/theme.native.js.map +1 -1
- package/lib/atom/button-link/index.js +1 -1
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/style.css +2 -2
- package/lib/atom/icon/index.d.ts +17 -35
- package/lib/atom/icon/index.d.ts.map +1 -1
- package/lib/atom/icon/index.js +18 -34
- package/lib/atom/icon/index.js.map +1 -1
- package/lib/atom/radio-with-title/index.d.ts +3 -13
- package/lib/atom/radio-with-title/index.d.ts.map +1 -1
- package/lib/atom/radio-with-title/types.d.ts +2 -13
- package/lib/atom/radio-with-title/types.d.ts.map +1 -1
- package/lib/atom/status-item/index.native.js +1 -1
- package/lib/atom/status-item/index.native.js.map +1 -1
- package/lib/atom/tag/index.d.ts +1 -12
- package/lib/atom/tag/style.css +0 -1
- package/lib/atom/title/index.d.ts +2 -13
- package/lib/molecule/banner/style.css +0 -1
- package/lib/molecule/base-modal/style.css +1 -0
- package/lib/molecule/bulk-progress-bar/index.js +2 -2
- package/lib/molecule/bulk-progress-bar/index.js.map +1 -1
- package/lib/molecule/certification-card/index.js +1 -1
- package/lib/molecule/certification-card/index.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +7 -28
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/cm-popin/types.js +1 -1
- package/lib/molecule/cm-popin/types.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +0 -2
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/learner-skill-card/index.js +8 -10
- package/lib/molecule/learner-skill-card/index.js.map +1 -1
- package/lib/molecule/learner-skill-card/style.css +0 -1
- package/lib/molecule/learning-priority-modal/style.css +2 -3
- package/lib/molecule/progress-wrapper/index.js +1 -1
- package/lib/molecule/progress-wrapper/index.js.map +1 -1
- package/lib/molecule/skills-chart-side-information-item/index.d.ts +1 -1
- package/lib/molecule/skills-chart-side-information-panel/index.d.ts +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +2 -13
- package/lib/molecule/title-radio-wrapper/index.d.ts +3 -13
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +2 -13
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/molecule/translation-modal/index.d.ts +1 -0
- package/lib/molecule/translation-modal/index.d.ts.map +1 -1
- package/lib/molecule/translation-modal/index.js +6 -23
- package/lib/molecule/translation-modal/index.js.map +1 -1
- package/lib/organism/cards-grid/index.d.ts +10 -48
- package/lib/organism/cards-grid/index.d.ts.map +1 -1
- package/lib/organism/cards-grid/index.js +2 -3
- package/lib/organism/cards-grid/index.js.map +1 -1
- package/lib/organism/content-skill-modal/index.d.ts +3 -13
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +2 -12
- package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +5 -5
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +17 -23
- package/lib/organism/list-items/index.d.ts +2 -13
- package/lib/organism/list-items/style.css +0 -1
- package/lib/organism/rewards-form/index.d.ts +2 -13
- package/lib/organism/select-opponents/index.d.ts +3 -13
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +2 -13
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/sidebar/index.d.ts +2 -2
- package/lib/organism/skill-edition/index.d.ts +52 -1261
- package/lib/organism/skill-edition/index.d.ts.map +1 -1
- package/lib/organism/skill-edition/index.js +224 -3
- package/lib/organism/skill-edition/index.js.map +1 -1
- package/lib/organism/skill-edition/types.d.ts +117 -1268
- package/lib/organism/skill-edition/types.d.ts.map +1 -1
- package/lib/organism/skill-edition/types.js +59 -7
- package/lib/organism/skill-edition/types.js.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +5 -25
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +4 -24
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +2 -13
- package/lib/template/app-player/loading/index.d.ts +6 -27
- package/lib/template/app-player/player/index.d.ts +12 -53
- package/lib/template/app-player/player/slides/index.d.ts +6 -27
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +6 -26
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +6 -27
- package/lib/template/app-review/index.d.ts +7 -27
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +6 -27
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +6 -27
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +1113 -1713
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +12 -0
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/utils.d.ts +1 -1
- package/lib/template/common/dashboard/index.d.ts +12 -53
- package/lib/template/common/search-page/index.d.ts +6 -27
- package/lib/template/external-course/index.d.ts +6 -27
- package/lib/template/skill-detail/all-courses.css +2 -3
- package/lib/template/skill-detail/all-courses.d.ts +17 -52
- package/lib/template/skill-detail/all-courses.d.ts.map +1 -1
- package/lib/template/skill-detail/all-courses.js +11 -11
- package/lib/template/skill-detail/all-courses.js.map +1 -1
- package/lib/template/skill-detail/continue-learning.css +2 -7
- package/lib/template/skill-detail/continue-learning.d.ts +12 -25
- package/lib/template/skill-detail/continue-learning.d.ts.map +1 -1
- package/lib/template/skill-detail/continue-learning.js.map +1 -1
- package/lib/template/skill-detail/index.d.ts +71 -81
- package/lib/template/skill-detail/index.d.ts.map +1 -1
- package/lib/template/skill-detail/index.js +55 -87
- package/lib/template/skill-detail/index.js.map +1 -1
- package/lib/template/skill-detail/style.css +39 -97
- package/lib/variables/colors.css +0 -2
- package/lib/variables/colors.d.ts +2 -3
- package/lib/variables/colors.d.ts.map +1 -1
- package/lib/variables/colors.js +3 -4
- package/lib/variables/colors.js.map +1 -1
- package/lib/variables/theme.native.js +1 -1
- package/lib/variables/theme.native.js.map +1 -1
- package/locales/bs/global.json +1 -0
- package/locales/de/global.json +1 -0
- package/locales/es/global.json +1 -0
- package/locales/et/global.json +1 -0
- package/locales/fi/global.json +1 -0
- package/locales/fr/global.json +1 -0
- package/locales/hu/global.json +1 -0
- package/locales/hy/global.json +1 -0
- package/locales/ja/global.json +1 -0
- package/locales/nl/global.json +1 -0
- package/locales/pl/global.json +1 -0
- package/locales/pt/global.json +1 -0
- package/locales/ro/global.json +1 -0
- package/locales/sk/global.json +1 -0
- package/locales/sl/global.json +1 -0
- package/locales/sv/global.json +1 -0
- package/locales/tl/global.json +1 -0
- package/locales/tr/global.json +1 -0
- package/locales/uk/global.json +1 -0
- package/locales/vi/global.json +1 -0
- package/locales/zh/global.json +1 -0
- package/locales/zh_TW/global.json +1 -0
- package/package.json +2 -2
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
2
|
import Link from '../../atom/link';
|
|
4
3
|
import { TitleProps } from '../../atom/title/types';
|
|
5
4
|
import CardsGrid from '../../organism/cards-grid';
|
|
6
5
|
import ListItems from '../../organism/list-items';
|
|
7
|
-
import {
|
|
6
|
+
import { iconPropTypes } from '../../atom/icon';
|
|
8
7
|
declare const propTypes: {
|
|
9
8
|
content: PropTypes.Requireable<string>;
|
|
10
9
|
mode: PropTypes.Requireable<string>;
|
|
@@ -16,7 +15,7 @@ declare const propTypes: {
|
|
|
16
15
|
'data-name': PropTypes.Requireable<string>;
|
|
17
16
|
titleSize: PropTypes.Requireable<string>;
|
|
18
17
|
subtitleSize: PropTypes.Requireable<string>;
|
|
19
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
18
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
20
19
|
tag: PropTypes.Requireable<PropTypes.InferProps<{
|
|
21
20
|
label: PropTypes.Requireable<string>;
|
|
22
21
|
type: PropTypes.Requireable<string>;
|
|
@@ -24,17 +23,7 @@ declare const propTypes: {
|
|
|
24
23
|
customStyle: PropTypes.Requireable<{
|
|
25
24
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
26
25
|
}>;
|
|
27
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
28
|
-
position: PropTypes.Requireable<string>;
|
|
29
|
-
iconName?: import("react").Validator<string> | undefined;
|
|
30
|
-
iconColor?: import("react").Validator<string | null | undefined> | undefined;
|
|
31
|
-
backgroundColor?: import("react").Validator<string | null | undefined> | undefined;
|
|
32
|
-
gradientBackground?: import("react").Validator<boolean | null | undefined> | undefined;
|
|
33
|
-
borderRadius?: import("react").Validator<string | null | undefined> | undefined;
|
|
34
|
-
preset?: import("react").Validator<string | null | undefined> | undefined;
|
|
35
|
-
size?: import("react").Validator<import("../../atom/icon").IconSize | null | undefined> | undefined;
|
|
36
|
-
customStyle?: import("react").Validator<import("react").CSSProperties | null | undefined> | undefined;
|
|
37
|
-
}>>;
|
|
26
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
38
27
|
}>>;
|
|
39
28
|
button: PropTypes.Requireable<PropTypes.InferProps<{
|
|
40
29
|
type: PropTypes.Requireable<string>;
|
|
@@ -121,8 +110,8 @@ declare const propTypes: {
|
|
|
121
110
|
borderRadius: PropTypes.Requireable<string>;
|
|
122
111
|
preset: PropTypes.Requireable<string>;
|
|
123
112
|
size: PropTypes.Requireable<PropTypes.InferProps<{
|
|
124
|
-
faSize: PropTypes.
|
|
125
|
-
wrapperSize: PropTypes.
|
|
113
|
+
faSize: PropTypes.Requireable<number>;
|
|
114
|
+
wrapperSize: PropTypes.Requireable<number>;
|
|
126
115
|
}>>;
|
|
127
116
|
customStyle: PropTypes.Requireable<{
|
|
128
117
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
@@ -560,7 +549,7 @@ declare const propTypes: {
|
|
|
560
549
|
'data-name': PropTypes.Requireable<string>;
|
|
561
550
|
titleSize: PropTypes.Requireable<string>;
|
|
562
551
|
subtitleSize: PropTypes.Requireable<string>;
|
|
563
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
552
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
564
553
|
tag: PropTypes.Requireable<PropTypes.InferProps<{
|
|
565
554
|
label: PropTypes.Requireable<string>;
|
|
566
555
|
type: PropTypes.Requireable<string>;
|
|
@@ -568,17 +557,7 @@ declare const propTypes: {
|
|
|
568
557
|
customStyle: PropTypes.Requireable<{
|
|
569
558
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
570
559
|
}>;
|
|
571
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
572
|
-
position: PropTypes.Requireable<string>;
|
|
573
|
-
iconName?: import("react").Validator<string> | undefined;
|
|
574
|
-
iconColor?: import("react").Validator<string | null | undefined> | undefined;
|
|
575
|
-
backgroundColor?: import("react").Validator<string | null | undefined> | undefined;
|
|
576
|
-
gradientBackground?: import("react").Validator<boolean | null | undefined> | undefined;
|
|
577
|
-
borderRadius?: import("react").Validator<string | null | undefined> | undefined;
|
|
578
|
-
preset?: import("react").Validator<string | null | undefined> | undefined;
|
|
579
|
-
size?: import("react").Validator<import("../../atom/icon").IconSize | null | undefined> | undefined;
|
|
580
|
-
customStyle?: import("react").Validator<import("react").CSSProperties | null | undefined> | undefined;
|
|
581
|
-
}>>;
|
|
560
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
582
561
|
}>>;
|
|
583
562
|
button: PropTypes.Requireable<PropTypes.InferProps<{
|
|
584
563
|
type: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAKnC,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,GAChD,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;KACtD,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;CACpD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -7,7 +7,7 @@ import Link from '../../atom/link';
|
|
|
7
7
|
import CardsGrid from '../../organism/cards-grid';
|
|
8
8
|
import ListItems from '../../organism/list-items';
|
|
9
9
|
import { ICONS } from '../../util/button-icons';
|
|
10
|
-
import {
|
|
10
|
+
import { iconPropTypes } from '../../atom/icon';
|
|
11
11
|
const propTypes = {
|
|
12
12
|
content: PropTypes.string,
|
|
13
13
|
mode: PropTypes.oneOf(['alert', 'information', 'cookie', 'items', 'list']),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","ButtonLink","InputSwitch","Title","Link","CardsGrid","ListItems","ICONS","
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","ButtonLink","InputSwitch","Title","Link","CardsGrid","ListItems","ICONS","iconPropTypes","propTypes","content","string","mode","oneOf","header","shape","title","headerIcon","backgroundImage","firstButton","label","handleOnclick","func","largeButton","bool","type","customStyle","secondButton","icon","position","_keys","thirdButton","onClose","oneOfType","backgroundImageUrl","descriptionText","cookieTitle","headerSubtitle","descriptionBtnTxt","listBtnSwicth","arrayOf","items","list","link"],"sources":["../../../src/molecule/cm-popin/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport ButtonLink from '../../atom/button-link';\nimport InputSwitch from '../../atom/input-switch';\nimport Title from '../../atom/title';\nimport Link from '../../atom/link';\nimport {TitleProps} from '../../atom/title/types';\nimport CardsGrid from '../../organism/cards-grid';\nimport ListItems from '../../organism/list-items';\nimport {ICONS} from '../../util/button-icons';\nimport {iconPropTypes} from '../../atom/icon';\n\nconst propTypes = {\n content: PropTypes.string,\n mode: PropTypes.oneOf(['alert', 'information', 'cookie', 'items', 'list']),\n header: PropTypes.shape({\n title: PropTypes.shape(Title.propTypes),\n headerIcon: PropTypes.string,\n backgroundImage: PropTypes.string\n }),\n firstButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary', 'tertiary']),\n customStyle: ButtonLink.propTypes.customStyle\n }),\n secondButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: ButtonLink.propTypes.customStyle,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS))\n })\n }),\n thirdButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: ButtonLink.propTypes.customStyle\n }),\n onClose: PropTypes.func,\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.shape(iconPropTypes)]),\n backgroundImageUrl: PropTypes.string,\n descriptionText: PropTypes.string,\n cookieTitle: PropTypes.string,\n headerSubtitle: PropTypes.string,\n descriptionBtnTxt: PropTypes.string,\n listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes)),\n items: PropTypes.shape({\n type: PropTypes.oneOf(['content', 'list']),\n list: PropTypes.oneOfType([\n PropTypes.shape(CardsGrid.propTypes),\n PropTypes.shape(ListItems.propTypes)\n ])\n }),\n link: PropTypes.shape(Link.propTypes)\n};\n\ntype PopinHeaderProps = {\n title: TitleProps;\n backgroundImage: string;\n headerIcon: string;\n};\n\nexport type QuitPopinButton = {\n 'aria-label'?: string;\n label: string;\n type: string;\n customStyle?: {\n backgroundColor?: string;\n color?: string;\n };\n handleOnclick: () => void;\n};\n\nexport type CMPopinProps = {\n content: string;\n icon: string | PropTypes.InferProps<typeof iconPropTypes>;\n mode: 'alert' | 'information' | 'cookie' | 'items' | 'list';\n onClose?: () => void;\n popinHeader?: PopinHeaderProps;\n descriptionText: string;\n firstButton?: QuitPopinButton;\n secondButton?: QuitPopinButton;\n items?: {\n type: 'content' | 'list';\n list:\n | PropTypes.InferProps<typeof CardsGrid.propTypes>\n | PropTypes.InferProps<typeof ListItems.propTypes>;\n };\n link?: PropTypes.InferProps<typeof Link.propTypes>;\n};\n\nexport default propTypes;\n"],"mappings":";AAAA,OAAOA,SAAS,MAAM,YAAY;AAElC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,WAAW,MAAM,yBAAyB;AACjD,OAAOC,KAAK,MAAM,kBAAkB;AACpC,OAAOC,IAAI,MAAM,iBAAiB;AAElC,OAAOC,SAAS,MAAM,2BAA2B;AACjD,OAAOC,SAAS,MAAM,2BAA2B;AACjD,SAAQC,KAAK,QAAO,yBAAyB;AAC7C,SAAQC,aAAa,QAAO,iBAAiB;AAE7C,MAAMC,SAAS,GAAG;EAChBC,OAAO,EAAEV,SAAS,CAACW,MAAM;EACzBC,IAAI,EAAEZ,SAAS,CAACa,KAAK,CAAC,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;EAC1EC,MAAM,EAAEd,SAAS,CAACe,KAAK,CAAC;IACtBC,KAAK,EAAEhB,SAAS,CAACe,KAAK,CAACZ,KAAK,CAACM,SAAS,CAAC;IACvCQ,UAAU,EAAEjB,SAAS,CAACW,MAAM;IAC5BO,eAAe,EAAElB,SAAS,CAACW;EAC7B,CAAC,CAAC;EACFQ,WAAW,EAAEnB,SAAS,CAACe,KAAK,CAAC;IAC3BK,KAAK,EAAEpB,SAAS,CAACW,MAAM;IACvBU,aAAa,EAAEr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AC;EACFM,OAAO,EAAEhC,SAAS,CAACsB,IAAI;EACvBM,IAAI,EAAE5B,SAAS,CAACiC,SAAS,CAAC,CAACjC,SAAS,CAACW,MAAM,EAAEX,SAAS,CAACe,KAAK,CAACP,aAAa,CAAC,CAAC,CAAC;EAC7E0B,kBAAkB,EAAElC,SAAS,CAACW,MAAM;EACpCwB,eAAe,EAAEnC,SAAS,CAACW,MAAM;EACjCyB,WAAW,EAAEpC,SAAS,CAACW,MAAM;EAC7B0B,cAAc,EAAErC,SAAS,CAACW,MAAM;EAChC2B,iBAAiB,EAAEtC,SAAS,CAACW,MAAM;EACnC4B,aAAa,EAAEvC,SAAS,CAACwC,OAAO,CAACxC,SAAS,CAACe,KAAK,CAACb,WAAW,CAACO,SAAS,CAAC,CAAC;EACxEgC,KAAK,EAAEzC,SAAS,CAACe,KAAK,CAAC;IACrBU,IAAI,EAAEzB,SAAS,CAACa,KAAK,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1C6B,IAAI,EAAE1C,SAAS,CAACiC,SAAS,CAAC,CACxBjC,SAAS,CAACe,KAAK,CAACV,SAAS,CAACI,SAAS,CAAC,EACpCT,SAAS,CAACe,KAAK,CAACT,SAAS,CAACG,SAAS,CAAC,CACrC;EACH,CAAC,CAAC;EACFkC,IAAI,EAAE3C,SAAS,CAACe,KAAK,CAACX,IAAI,CAACK,SAAS;AACtC,CAAC;AAqCD,eAAeA,SAAS","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"names":[],"mappings":";AAuFA;IACE;;;OAGG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqBE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAkCC;IA/BC;;;;;;;;MAQC;IAED,0DAAgE;IAsHlE,qBAiBC;IAED,qBAGC;IAED,sBAGC;IAED,0BASC;IAvJC,uEAA6D;IAyJ/D,mCAIC;IA5DD,oCAMC;IAGD,sCAIC;IA5DD,qBAGC;IAnCD,0BAMC;IAED,2BAYC;IAED,6BAOC;IASD,wCAuCC;IAGC,kBAA2B;IA6D7B,sBAuGC;CACF"}
|
|
@@ -19,7 +19,6 @@ import Provider from '../../../atom/provider';
|
|
|
19
19
|
import Card, { cardPropTypes } from '../../card';
|
|
20
20
|
import LearningPriorityCard from '../../learning-priority-card';
|
|
21
21
|
import Icon from '../../../atom/icon';
|
|
22
|
-
import { COLORS } from '../../../variables/colors';
|
|
23
22
|
import style from './style.css';
|
|
24
23
|
const ShowMoreLink = props => {
|
|
25
24
|
const {
|
|
@@ -297,7 +296,6 @@ class CardsList extends React.PureComponent {
|
|
|
297
296
|
color: dark,
|
|
298
297
|
preset: 's',
|
|
299
298
|
borderRadius: '8px',
|
|
300
|
-
backgroundColor: COLORS.neutral_75,
|
|
301
299
|
ariaLabel: ariaLabel.showMoreOnLeftAriaLabel
|
|
302
300
|
};
|
|
303
301
|
const arrows = /*#__PURE__*/React.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","NovaSolidContentContentBook1","LearnerIcon","NovaCompositionCoorpacademyTimer","TimerIcon","Provider","Card","cardPropTypes","LearningPriorityCard","Icon","COLORS","style","ShowMoreLink","props","onShowMore","showMore","className","createElement","onClick","contextTypes","skin","childContextTypes","propTypes","process","env","NODE_ENV","func","string","IconView","context","contentType","ICONS","chapter","course","dark","_get","IconType","color","icon","computeWidth","card","type","nextPage","page","maxPages","CardsList","PureComponent","translate","constructor","state","actualPage","scrollLeft","offsetWidth","possiblePositions","possiblePages","cardsWidth","handleScroll_","_throttle","handleScroll","bind","handleOnLeft","handleOnRight","scrollTo","updateState","_debounce","updatePages","setCardsWrapper","getScrollWidth","handleResize","testingSizes","componentDidMount","cardsWrapper","addEventListener","window","componentDidUpdate","cards","newCardsWidth","_pipe","_map","_sum","updatePaginationState","setState","componentWillUnmount","removeEventListener","cancel","wrapperWidth","wrapperScrollLeft","cardWidths","_reduce","cardPositions","accWidth","cardWidth","_head","acc","pageIndex","accPageWidth","pageWidth","skip","_findIndex","position","_last","element","index","onScroll","leftBound","rightBound","leftIndex","rightIndex","_findLastIndex","limit","indexOfNextFirstCard","indexOf","nextPosition","render","title","customStyle","dataName","ariaLabel","_getOr","titleStyle","titleLink","cardsView","_toPairs","key","_extends","arrowIconProps","preset","borderRadius","backgroundColor","neutral_75","showMoreOnLeftAriaLabel","arrows","arrowsWrapper","arrow","iconName","titleView","titleNode","hasPages","showMoreView","showMoreBar","switchPagesView","pagingWrapper","wrapper","list","header","ref","oneOfType","node","arrayOf","shape","objectOf","showMoreOnRightAriaLabel","oneOf","any"],"sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"sourcesContent":["import React from 'react';\nimport {\n debounce,\n throttle,\n get,\n getOr,\n map,\n sum,\n last,\n pipe,\n toPairs,\n reduce,\n head,\n findIndex,\n findLastIndex\n} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../../atom/provider';\nimport Card, {cardPropTypes} from '../../card';\nimport LearningPriorityCard from '../../learning-priority-card';\nimport Icon from '../../../atom/icon';\nimport {COLORS} from '../../../variables/colors';\nimport style from './style.css';\n\nconst ShowMoreLink = props => {\n const {onShowMore, showMore, className} = props;\n return (\n <div className={className} onClick={onShowMore}>\n {showMore}\n </div>\n );\n};\n\nShowMoreLink.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nShowMoreLink.propTypes = {\n onShowMore: PropTypes.func,\n showMore: PropTypes.string,\n className: PropTypes.string\n};\n\nconst IconView = (props, context) => {\n const {skin} = context;\n const {contentType} = props;\n const ICONS = {\n chapter: TimerIcon,\n course: LearnerIcon\n };\n\n if (!contentType) {\n return null;\n }\n\n const dark = get('common.dark', skin);\n const IconType = ICONS[contentType];\n\n return (\n <div>\n <IconType style={{color: dark}} className={style.icon} data-contenttype={contentType} />\n </div>\n );\n};\n\nconst computeWidth = card => {\n switch (card && card.type) {\n case 'chapter':\n return 219;\n default:\n return 272;\n }\n};\n\nconst nextPage = (page, maxPages) => {\n if (page < 0) return maxPages;\n if (page > maxPages) return 0;\n return page;\n};\n\nIconView.propTypes = {\n contentType: PropTypes.string\n};\n\nclass CardsList extends React.PureComponent {\n /**\n * IMPORTANT: update prop-types.ts too, 1st a migration of tests\n * is intended, then, a TS + functional refactor is planned.\n */\n static propTypes = {\n contentType: PropTypes.string,\n dataName: PropTypes.string,\n title: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),\n showMore: PropTypes.string,\n cards: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(cardPropTypes),\n PropTypes.shape(LearningPriorityCard.propTypes)\n ])\n ),\n customStyle: PropTypes.objectOf(PropTypes.string),\n onScroll: PropTypes.func,\n onShowMore: PropTypes.func,\n 'arrows-aria-label': PropTypes.shape({\n showMoreOnLeftAriaLabel: PropTypes.string,\n showMoreOnRightAriaLabel: PropTypes.string\n }),\n type: PropTypes.oneOf(['cards', 'learningPrioritiesCards']),\n // eslint-disable-next-line react/forbid-prop-types\n testingSizes: PropTypes.any\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n actualPage: 0,\n maxPages: 0,\n scrollLeft: 0,\n offsetWidth: 0,\n possiblePositions: [],\n possiblePages: [],\n cardsWidth: 0\n };\n\n this.handleScroll_ = throttle(200, this.handleScroll.bind(this));\n this.handleScroll = this.handleScroll.bind(this);\n this.handleOnLeft = this.handleOnLeft.bind(this);\n this.handleOnRight = this.handleOnRight.bind(this);\n this.scrollTo = this.scrollTo.bind(this);\n this.updateState = debounce(200, this.updatePages.bind(this));\n this.updatePages = this.updatePages.bind(this);\n this.setCardsWrapper = this.setCardsWrapper.bind(this);\n this.getScrollWidth = this.getScrollWidth.bind(this);\n this.handleResize = this.handleResize.bind(this);\n\n // for testing purposes only - no other way to test this polluted component\n if (props.testingSizes) {\n const {offsetWidth, scrollLeft, maxPages, possiblePages, possiblePositions} =\n props.testingSizes;\n this.state.offsetWidth = offsetWidth;\n this.state.scrollLeft = scrollLeft;\n this.state.maxPages = maxPages;\n this.state.possiblePages = possiblePages;\n this.state.possiblePositions = possiblePositions;\n }\n }\n\n componentDidMount() {\n this.cardsWrapper.addEventListener('scroll', this.handleScroll_);\n\n if (window) {\n window.addEventListener('resize', this.handleResize);\n }\n }\n\n componentDidUpdate() {\n const {cards = []} = this.props;\n const {offsetWidth, cardsWidth} = this.state;\n const newCardsWidth = pipe(map(computeWidth), sum)(cards);\n\n if (newCardsWidth !== cardsWidth && offsetWidth !== 0) {\n this.updatePaginationState(cards);\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({\n cardsWidth: newCardsWidth\n });\n }\n }\n\n componentWillUnmount() {\n this.cardsWrapper.removeEventListener('scroll', this.handleScroll_);\n\n if (window) {\n window.removeEventListener('resize', this.handleResize);\n }\n this.updateState.cancel();\n }\n\n /* istanbul ignore next */\n handleResize() {\n const {cards = []} = this.props;\n this.updatePaginationState(cards);\n }\n\n /* istanbul ignore next */\n updatePaginationState(cards) {\n const {offsetWidth: wrapperWidth, scrollLeft: wrapperScrollLeft} = this.state;\n\n const cardWidths = map(computeWidth)(cards);\n\n const possiblePositions = pipe(\n reduce(\n ([cardPositions, accWidth], cardWidth) => [\n [...cardPositions, accWidth],\n cardWidth + accWidth\n ],\n [[], 0]\n ),\n head\n )(cardWidths);\n\n const possiblePages = pipe(\n reduce(\n ([acc, pageIndex, accPageWidth], cardWidth) => {\n const pageWidth = accPageWidth + cardWidth;\n if (pageWidth > wrapperWidth) {\n return [[...acc, pageIndex + 1], pageIndex + 1, cardWidth];\n }\n return [[...acc, pageIndex], pageIndex, pageWidth];\n },\n [[], 0, 0]\n ),\n head\n )(cardWidths);\n\n const skip = findIndex(position => position >= wrapperScrollLeft, possiblePositions);\n const actualPage = possiblePages[skip + 1];\n\n this.setState({\n possiblePositions,\n possiblePages,\n maxPages: last(possiblePages),\n actualPage\n });\n }\n\n setCardsWrapper(element) {\n this.cardsWrapper = element;\n this.setState({\n scrollLeft: this.cardsWrapper?.scrollLeft,\n offsetWidth: this.cardsWrapper?.offsetWidth\n });\n }\n\n /* istanbul ignore next */\n getScrollWidth(index) {\n const {cards = []} = this.props;\n const card = cards[index];\n return computeWidth(card);\n }\n\n /* istanbul ignore next */\n handleScroll() {\n const scrollLeft = this.cardsWrapper?.scrollLeft;\n this.setState({scrollLeft});\n\n const {possiblePositions, offsetWidth} = this.state;\n const {onScroll} = this.props;\n if (onScroll) {\n const leftBound = scrollLeft;\n const rightBound = scrollLeft + offsetWidth;\n\n const leftIndex = findIndex(position => position > leftBound, possiblePositions) - 1;\n const rightIndex = findLastIndex(position => position < rightBound, possiblePositions);\n const skip = leftIndex;\n const limit = rightIndex - skip + 1;\n\n onScroll(skip, limit);\n }\n }\n\n handleOnLeft() {\n const {actualPage, maxPages} = this.state;\n this.scrollTo(nextPage(actualPage - 1, maxPages));\n }\n\n handleOnRight() {\n const {actualPage, maxPages} = this.state;\n this.scrollTo(nextPage(actualPage + 1, maxPages));\n }\n\n scrollTo(page) {\n const {possiblePages, possiblePositions} = this.state;\n const indexOfNextFirstCard = possiblePages.indexOf(page);\n const nextPosition = possiblePositions[indexOfNextFirstCard];\n this.cardsWrapper.scrollLeft = nextPosition;\n this.updatePages(page);\n this.setState({\n scrollLeft: nextPosition\n });\n }\n\n updatePages(actualPage) {\n this.setState({\n actualPage\n });\n }\n\n render() {\n const {\n title,\n showMore,\n cards,\n customStyle = {},\n onShowMore,\n dataName,\n contentType,\n 'arrows-aria-label': ariaLabel = {},\n type\n } = this.props;\n const {skin} = this.context;\n const {maxPages} = this.state;\n const dark = getOr('#90A4AE', 'common.dark', skin);\n const titleStyle = onShowMore ? style.titleLink : style.title;\n const cardsView = pipe(\n toPairs,\n map(([key, card]) => {\n return (\n <div className={style.card} key={key}>\n {card && type === 'learningPrioritiesCards' ? (\n <LearningPriorityCard {...card} dataName={`${dataName}-${key}`} />\n ) : (\n <Card {...card} dataName={`${dataName}-${key}`} />\n )}\n </div>\n );\n })\n )(cards);\n\n const arrowIconProps = {\n color: dark,\n preset: 's',\n borderRadius: '8px',\n backgroundColor: COLORS.neutral_75,\n ariaLabel: ariaLabel.showMoreOnLeftAriaLabel\n };\n\n const arrows = (\n <div className={style.arrowsWrapper}>\n <div className={style.arrow} onClick={this.handleOnLeft} data-name=\"card-list-left-arrow\">\n <Icon {...arrowIconProps} iconName=\"arrow-left\" />\n </div>\n <div className={style.arrow} onClick={this.handleOnRight} data-name=\"card-list-right-arrow\">\n <Icon {...arrowIconProps} iconName=\"arrow-right\" />\n </div>\n </div>\n );\n\n const titleView =\n typeof title === 'string' ? (\n <span data-name=\"title\" className={titleStyle} onClick={onShowMore}>\n <IconView contentType={contentType} />\n <span>{title}</span>\n </span>\n ) : (\n <span className={style.titleNode}>{title}</span>\n );\n\n const hasPages = maxPages > 0;\n const showMoreView =\n hasPages && showMore && onShowMore ? (\n <ShowMoreLink\n className={hasPages ? style.showMoreBar : style.showMore}\n onShowMore={onShowMore}\n showMore={showMore}\n />\n ) : null;\n\n const switchPagesView = hasPages ? (\n <div className={style.pagingWrapper}>\n {showMoreView}\n {arrows}\n </div>\n ) : null;\n\n return (\n <div\n className={style.wrapper}\n style={customStyle}\n data-name=\"cardsList\"\n data-max-pages={`${maxPages}`}\n // eslint-disable-next-line react/destructuring-assignment\n data-actual-page={`${this.state.actualPage}`}\n data-scroll-left={this.cardsWrapper?.scrollLeft}\n >\n <div className={style.list}>\n <div>\n <div data-name=\"header\" className={style.header}>\n {titleView}\n {switchPagesView}\n </div>\n <div\n className={style.cards}\n data-testid=\"cards-view-wrapper\"\n ref={this.setCardsWrapper}\n >\n {cardsView}\n </div>\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default CardsList;\n"],"mappings":";;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAgBzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SACEC,4BAA4B,IAAIC,WAAW,EAC3CC,gCAAgC,IAAIC,SAAS,QACxC,0BAA0B;AACjC,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,IAAI,IAAGC,aAAa,QAAO,YAAY;AAC9C,OAAOC,oBAAoB,MAAM,8BAA8B;AAC/D,OAAOC,IAAI,MAAM,oBAAoB;AACrC,SAAQC,MAAM,QAAO,2BAA2B;AAChD,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAACC,UAAU;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGH,KAAK;EAC/C,oBACEd,KAAA,CAAAkB,aAAA;IAAKD,SAAS,EAAEA,SAAU;IAACE,OAAO,EAAEJ;EAAW,GAC5CC,QACE,CAAC;AAEV,CAAC;AAEDH,YAAY,CAACO,YAAY,GAAG;EAC1BC,IAAI,EAAEf,QAAQ,CAACgB,iBAAiB,CAACD;AACnC,CAAC;AAEDR,YAAY,CAACU,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACvBX,UAAU,EAAEd,SAAS,CAAC0B,IAAI;EAC1BX,QAAQ,EAAEf,SAAS,CAAC2B,MAAM;EAC1BX,SAAS,EAAEhB,SAAS,CAAC2B;AACvB,CAAC;AAED,MAAMC,QAAQ,GAAGA,CAACf,KAAK,EAAEgB,OAAO,KAAK;EACnC,MAAM;IAACT;EAAI,CAAC,GAAGS,OAAO;EACtB,MAAM;IAACC;EAAW,CAAC,GAAGj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AAK,CAAC9I,aAAa,CAAC,EAC9BP,SAAS,CAACqJ,KAAK,CAAC7I,oBAAoB,CAACc,SAAS,CAAC,CAChD,CACH,CAAC;EACD6F,WAAW,EAAEnH,SAAS,CAACsJ,QAAQ,CAACtJ,SAAS,CAAC2B,MAAM,CAAC;EACjD4E,QAAQ,EAAEvG,SAAS,CAAC0B,IAAI;EACxBZ,UAAU,EAAEd,SAAS,CAAC0B,IAAI;EAC1B,mBAAmB,EAAE1B,SAAS,CAACqJ,KAAK,CAAC;IACnCnB,uBAAuB,EAAElI,SAAS,CAAC2B,MAAM;IACzC4H,wBAAwB,EAAEvJ,SAAS,CAAC2B;EACtC,CAAC,CAAC;EACFc,IAAI,EAAEzC,SAAS,CAACwJ,KAAK,CAAC,CAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC;EAC3D;EACAnF,YAAY,EAAErE,SAAS,CAACyJ;AAC1B,CAAC;AAmSH,eAAe5G,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","NovaSolidContentContentBook1","LearnerIcon","NovaCompositionCoorpacademyTimer","TimerIcon","Provider","Card","cardPropTypes","LearningPriorityCard","Icon","style","ShowMoreLink","props","onShowMore","showMore","className","createElement","onClick","contextTypes","skin","childContextTypes","propTypes","process","env","NODE_ENV","func","string","IconView","context","contentType","ICONS","chapter","course","dark","_get","IconType","color","icon","computeWidth","card","type","nextPage","page","maxPages","CardsList","PureComponent","translate","constructor","state","actualPage","scrollLeft","offsetWidth","possiblePositions","possiblePages","cardsWidth","handleScroll_","_throttle","handleScroll","bind","handleOnLeft","handleOnRight","scrollTo","updateState","_debounce","updatePages","setCardsWrapper","getScrollWidth","handleResize","testingSizes","componentDidMount","cardsWrapper","addEventListener","window","componentDidUpdate","cards","newCardsWidth","_pipe","_map","_sum","updatePaginationState","setState","componentWillUnmount","removeEventListener","cancel","wrapperWidth","wrapperScrollLeft","cardWidths","_reduce","cardPositions","accWidth","cardWidth","_head","acc","pageIndex","accPageWidth","pageWidth","skip","_findIndex","position","_last","element","index","onScroll","leftBound","rightBound","leftIndex","rightIndex","_findLastIndex","limit","indexOfNextFirstCard","indexOf","nextPosition","render","title","customStyle","dataName","ariaLabel","_getOr","titleStyle","titleLink","cardsView","_toPairs","key","_extends","arrowIconProps","preset","borderRadius","showMoreOnLeftAriaLabel","arrows","arrowsWrapper","arrow","iconName","titleView","titleNode","hasPages","showMoreView","showMoreBar","switchPagesView","pagingWrapper","wrapper","list","header","ref","oneOfType","node","arrayOf","shape","objectOf","showMoreOnRightAriaLabel","oneOf","any"],"sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"sourcesContent":["import React from 'react';\nimport {\n debounce,\n throttle,\n get,\n getOr,\n map,\n sum,\n last,\n pipe,\n toPairs,\n reduce,\n head,\n findIndex,\n findLastIndex\n} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../../atom/provider';\nimport Card, {cardPropTypes} from '../../card';\nimport LearningPriorityCard from '../../learning-priority-card';\nimport Icon from '../../../atom/icon';\nimport style from './style.css';\n\nconst ShowMoreLink = props => {\n const {onShowMore, showMore, className} = props;\n return (\n <div className={className} onClick={onShowMore}>\n {showMore}\n </div>\n );\n};\n\nShowMoreLink.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nShowMoreLink.propTypes = {\n onShowMore: PropTypes.func,\n showMore: PropTypes.string,\n className: PropTypes.string\n};\n\nconst IconView = (props, context) => {\n const {skin} = context;\n const {contentType} = props;\n const ICONS = {\n chapter: TimerIcon,\n course: LearnerIcon\n };\n\n if (!contentType) {\n return null;\n }\n\n const dark = get('common.dark', skin);\n const IconType = ICONS[contentType];\n\n return (\n <div>\n <IconType style={{color: dark}} className={style.icon} data-contenttype={contentType} />\n </div>\n );\n};\n\nconst computeWidth = card => {\n switch (card && card.type) {\n case 'chapter':\n return 219;\n default:\n return 272;\n }\n};\n\nconst nextPage = (page, maxPages) => {\n if (page < 0) return maxPages;\n if (page > maxPages) return 0;\n return page;\n};\n\nIconView.propTypes = {\n contentType: PropTypes.string\n};\n\nclass CardsList extends React.PureComponent {\n /**\n * IMPORTANT: update prop-types.ts too, 1st a migration of tests\n * is intended, then, a TS + functional refactor is planned.\n */\n static propTypes = {\n contentType: PropTypes.string,\n dataName: PropTypes.string,\n title: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),\n showMore: PropTypes.string,\n cards: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(cardPropTypes),\n PropTypes.shape(LearningPriorityCard.propTypes)\n ])\n ),\n customStyle: PropTypes.objectOf(PropTypes.string),\n onScroll: PropTypes.func,\n onShowMore: PropTypes.func,\n 'arrows-aria-label': PropTypes.shape({\n showMoreOnLeftAriaLabel: PropTypes.string,\n showMoreOnRightAriaLabel: PropTypes.string\n }),\n type: PropTypes.oneOf(['cards', 'learningPrioritiesCards']),\n // eslint-disable-next-line react/forbid-prop-types\n testingSizes: PropTypes.any\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n actualPage: 0,\n maxPages: 0,\n scrollLeft: 0,\n offsetWidth: 0,\n possiblePositions: [],\n possiblePages: [],\n cardsWidth: 0\n };\n\n this.handleScroll_ = throttle(200, this.handleScroll.bind(this));\n this.handleScroll = this.handleScroll.bind(this);\n this.handleOnLeft = this.handleOnLeft.bind(this);\n this.handleOnRight = this.handleOnRight.bind(this);\n this.scrollTo = this.scrollTo.bind(this);\n this.updateState = debounce(200, this.updatePages.bind(this));\n this.updatePages = this.updatePages.bind(this);\n this.setCardsWrapper = this.setCardsWrapper.bind(this);\n this.getScrollWidth = this.getScrollWidth.bind(this);\n this.handleResize = this.handleResize.bind(this);\n\n // for testing purposes only - no other way to test this polluted component\n if (props.testingSizes) {\n const {offsetWidth, scrollLeft, maxPages, possiblePages, possiblePositions} =\n props.testingSizes;\n this.state.offsetWidth = offsetWidth;\n this.state.scrollLeft = scrollLeft;\n this.state.maxPages = maxPages;\n this.state.possiblePages = possiblePages;\n this.state.possiblePositions = possiblePositions;\n }\n }\n\n componentDidMount() {\n this.cardsWrapper.addEventListener('scroll', this.handleScroll_);\n\n if (window) {\n window.addEventListener('resize', this.handleResize);\n }\n }\n\n componentDidUpdate() {\n const {cards = []} = this.props;\n const {offsetWidth, cardsWidth} = this.state;\n const newCardsWidth = pipe(map(computeWidth), sum)(cards);\n\n if (newCardsWidth !== cardsWidth && offsetWidth !== 0) {\n this.updatePaginationState(cards);\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({\n cardsWidth: newCardsWidth\n });\n }\n }\n\n componentWillUnmount() {\n this.cardsWrapper.removeEventListener('scroll', this.handleScroll_);\n\n if (window) {\n window.removeEventListener('resize', this.handleResize);\n }\n this.updateState.cancel();\n }\n\n /* istanbul ignore next */\n handleResize() {\n const {cards = []} = this.props;\n this.updatePaginationState(cards);\n }\n\n /* istanbul ignore next */\n updatePaginationState(cards) {\n const {offsetWidth: wrapperWidth, scrollLeft: wrapperScrollLeft} = this.state;\n\n const cardWidths = map(computeWidth)(cards);\n\n const possiblePositions = pipe(\n reduce(\n ([cardPositions, accWidth], cardWidth) => [\n [...cardPositions, accWidth],\n cardWidth + accWidth\n ],\n [[], 0]\n ),\n head\n )(cardWidths);\n\n const possiblePages = pipe(\n reduce(\n ([acc, pageIndex, accPageWidth], cardWidth) => {\n const pageWidth = accPageWidth + cardWidth;\n if (pageWidth > wrapperWidth) {\n return [[...acc, pageIndex + 1], pageIndex + 1, cardWidth];\n }\n return [[...acc, pageIndex], pageIndex, pageWidth];\n },\n [[], 0, 0]\n ),\n head\n )(cardWidths);\n\n const skip = findIndex(position => position >= wrapperScrollLeft, possiblePositions);\n const actualPage = possiblePages[skip + 1];\n\n this.setState({\n possiblePositions,\n possiblePages,\n maxPages: last(possiblePages),\n actualPage\n });\n }\n\n setCardsWrapper(element) {\n this.cardsWrapper = element;\n this.setState({\n scrollLeft: this.cardsWrapper?.scrollLeft,\n offsetWidth: this.cardsWrapper?.offsetWidth\n });\n }\n\n /* istanbul ignore next */\n getScrollWidth(index) {\n const {cards = []} = this.props;\n const card = cards[index];\n return computeWidth(card);\n }\n\n /* istanbul ignore next */\n handleScroll() {\n const scrollLeft = this.cardsWrapper?.scrollLeft;\n this.setState({scrollLeft});\n\n const {possiblePositions, offsetWidth} = this.state;\n const {onScroll} = this.props;\n if (onScroll) {\n const leftBound = scrollLeft;\n const rightBound = scrollLeft + offsetWidth;\n\n const leftIndex = findIndex(position => position > leftBound, possiblePositions) - 1;\n const rightIndex = findLastIndex(position => position < rightBound, possiblePositions);\n const skip = leftIndex;\n const limit = rightIndex - skip + 1;\n\n onScroll(skip, limit);\n }\n }\n\n handleOnLeft() {\n const {actualPage, maxPages} = this.state;\n this.scrollTo(nextPage(actualPage - 1, maxPages));\n }\n\n handleOnRight() {\n const {actualPage, maxPages} = this.state;\n this.scrollTo(nextPage(actualPage + 1, maxPages));\n }\n\n scrollTo(page) {\n const {possiblePages, possiblePositions} = this.state;\n const indexOfNextFirstCard = possiblePages.indexOf(page);\n const nextPosition = possiblePositions[indexOfNextFirstCard];\n this.cardsWrapper.scrollLeft = nextPosition;\n this.updatePages(page);\n this.setState({\n scrollLeft: nextPosition\n });\n }\n\n updatePages(actualPage) {\n this.setState({\n actualPage\n });\n }\n\n render() {\n const {\n title,\n showMore,\n cards,\n customStyle = {},\n onShowMore,\n dataName,\n contentType,\n 'arrows-aria-label': ariaLabel = {},\n type\n } = this.props;\n const {skin} = this.context;\n const {maxPages} = this.state;\n const dark = getOr('#90A4AE', 'common.dark', skin);\n const titleStyle = onShowMore ? style.titleLink : style.title;\n const cardsView = pipe(\n toPairs,\n map(([key, card]) => {\n return (\n <div className={style.card} key={key}>\n {card && type === 'learningPrioritiesCards' ? (\n <LearningPriorityCard {...card} dataName={`${dataName}-${key}`} />\n ) : (\n <Card {...card} dataName={`${dataName}-${key}`} />\n )}\n </div>\n );\n })\n )(cards);\n\n const arrowIconProps = {\n color: dark,\n preset: 's',\n borderRadius: '8px',\n ariaLabel: ariaLabel.showMoreOnLeftAriaLabel\n };\n\n const arrows = (\n <div className={style.arrowsWrapper}>\n <div className={style.arrow} onClick={this.handleOnLeft} data-name=\"card-list-left-arrow\">\n <Icon {...arrowIconProps} iconName=\"arrow-left\" />\n </div>\n <div className={style.arrow} onClick={this.handleOnRight} data-name=\"card-list-right-arrow\">\n <Icon {...arrowIconProps} iconName=\"arrow-right\" />\n </div>\n </div>\n );\n\n const titleView =\n typeof title === 'string' ? (\n <span data-name=\"title\" className={titleStyle} onClick={onShowMore}>\n <IconView contentType={contentType} />\n <span>{title}</span>\n </span>\n ) : (\n <span className={style.titleNode}>{title}</span>\n );\n\n const hasPages = maxPages > 0;\n const showMoreView =\n hasPages && showMore && onShowMore ? (\n <ShowMoreLink\n className={hasPages ? style.showMoreBar : style.showMore}\n onShowMore={onShowMore}\n showMore={showMore}\n />\n ) : null;\n\n const switchPagesView = hasPages ? (\n <div className={style.pagingWrapper}>\n {showMoreView}\n {arrows}\n </div>\n ) : null;\n\n return (\n <div\n className={style.wrapper}\n style={customStyle}\n data-name=\"cardsList\"\n data-max-pages={`${maxPages}`}\n // eslint-disable-next-line react/destructuring-assignment\n data-actual-page={`${this.state.actualPage}`}\n data-scroll-left={this.cardsWrapper?.scrollLeft}\n >\n <div className={style.list}>\n <div>\n <div data-name=\"header\" className={style.header}>\n {titleView}\n {switchPagesView}\n </div>\n <div\n className={style.cards}\n data-testid=\"cards-view-wrapper\"\n ref={this.setCardsWrapper}\n >\n {cardsView}\n </div>\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default CardsList;\n"],"mappings":";;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAgBzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SACEC,4BAA4B,IAAIC,WAAW,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AEpJ,SAAS,CAAC0B;EACtC,CAAC,CAAC;EACFc,IAAI,EAAExC,SAAS,CAACqJ,KAAK,CAAC,CAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC;EAC3D;EACAjF,YAAY,EAAEpE,SAAS,CAACsJ;AAC1B,CAAC;AAkSH,eAAe1G,SAAS","ignoreList":[]}
|
|
@@ -34,7 +34,7 @@ const LearnerSkillCard = (props, context) => {
|
|
|
34
34
|
name
|
|
35
35
|
} = icon;
|
|
36
36
|
const questionsLocale = translate('skill_chart_side_panel_questions_to_review');
|
|
37
|
-
const [badgeIconName, badgeLocale, tagTextColor, tagBackgroundColor] = focus ? ['bullseye-arrow', translate('skill_focus'), COLORS.purple_700, COLORS.purple_100] : ['shapes', translate('skill'), COLORS.
|
|
37
|
+
const [badgeIconName, badgeLocale, tagTextColor, tagBackgroundColor] = focus ? ['bullseye-arrow', translate('skill_focus'), COLORS.purple_700, COLORS.purple_100] : ['shapes', translate('skill'), COLORS.cm_grey_500, COLORS.gray];
|
|
38
38
|
const headerBackgroundRef = useRef(null);
|
|
39
39
|
const defaultBackground = useMemo(() => createGradientBackground(color, '93%', '100%'), [color]);
|
|
40
40
|
const focusBackground = useMemo(() => createGradientBackground(color, '83%', '100%'), [color]);
|
|
@@ -91,11 +91,7 @@ const LearnerSkillCard = (props, context) => {
|
|
|
91
91
|
faSize: 10,
|
|
92
92
|
wrapperSize: 16
|
|
93
93
|
}
|
|
94
|
-
}), /*#__PURE__*/React.createElement("
|
|
95
|
-
style: {
|
|
96
|
-
color: tagTextColor
|
|
97
|
-
}
|
|
98
|
-
}, badgeLocale)), /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
}), badgeLocale), /*#__PURE__*/React.createElement("div", {
|
|
99
95
|
className: style.questionWrapper
|
|
100
96
|
}, /*#__PURE__*/React.createElement("div", {
|
|
101
97
|
"data-name": "skill-card-title",
|
|
@@ -111,10 +107,12 @@ const LearnerSkillCard = (props, context) => {
|
|
|
111
107
|
}, /*#__PURE__*/React.createElement(FaIcon, {
|
|
112
108
|
iconName: 'circle',
|
|
113
109
|
iconColor: COLORS.cm_grey_400,
|
|
114
|
-
backgroundColor: 'transparent',
|
|
115
110
|
size: {
|
|
116
|
-
faSize: 4
|
|
117
|
-
|
|
111
|
+
faSize: 4
|
|
112
|
+
},
|
|
113
|
+
customStyle: {
|
|
114
|
+
padding: 0,
|
|
115
|
+
height: 'auto'
|
|
118
116
|
}
|
|
119
117
|
}), /*#__PURE__*/React.createElement("span", {
|
|
120
118
|
"data-name": "learner-skill-card-questions-to-review"
|
|
@@ -126,7 +124,7 @@ const LearnerSkillCard = (props, context) => {
|
|
|
126
124
|
max: MAX_SCORE,
|
|
127
125
|
className: style.progressWrapper,
|
|
128
126
|
style: {
|
|
129
|
-
backgroundColor: COLORS.
|
|
127
|
+
backgroundColor: COLORS.positive
|
|
130
128
|
}
|
|
131
129
|
})));
|
|
132
130
|
};
|
|
@@ -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","questionsLocale","badgeIconName","badgeLocale","tagTextColor","tagBackgroundColor","purple_700","purple_100","neutral_500","gray","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","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 questionsLocale = translate('skill_chart_side_panel_questions_to_review') as string;\n const [badgeIconName, badgeLocale, tagTextColor, tagBackgroundColor] = focus\n ? ['bullseye-arrow', translate('skill_focus') as string, COLORS.purple_700, COLORS.purple_100]\n : ['shapes', translate('skill') as string, COLORS.neutral_500, COLORS.gray];\n const headerBackgroundRef = useRef<HTMLDivElement | null>(null);\n const defaultBackground = useMemo(() => createGradientBackground(color, '93%', '100%'), [color]);\n const focusBackground = useMemo(() => createGradientBackground(color, '83%', '100%'), [color]);\n const handleMouseEnter = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, focusBackground);\n }, [focusBackground]);\n const handleMouseLeave = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, defaultBackground);\n }, [defaultBackground]);\n return (\n <div\n data-testid={`learner-skill-card-wrapper-${cardIndex}`}\n onClick={onExploreClick}\n className={style.learnerSkillCardContainer}\n aria-label={ariaLabel}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div\n data-testid=\"learner-skill-card-icon-header-wrapper\"\n ref={headerBackgroundRef}\n className={style.iconHeaderWrapper}\n style={{backgroundImage: defaultBackground, color: tagTextColor}}\n >\n <div className={style.iconWrapper} data-testid=\"learner-skill-card-icon-wrapper\">\n <FaIcon\n {...{\n iconName: name,\n iconColor: color,\n size: {\n faSize: 20,\n wrapperSize: 44\n },\n borderRadius: '12px',\n gradientBackground: true,\n customStyle: {border: '4px solid white'}\n }}\n />\n </div>\n </div>\n <div className={style.learnerSkillCardContent}>\n <div className={style.skillTitleWrapper}>\n <div\n className={style.skillFocusBadge}\n style={{\n backgroundColor: tagBackgroundColor,\n color: tagTextColor\n }}\n >\n <FaIcon\n {...{\n iconName: badgeIconName,\n backgroundColor: tagBackgroundColor,\n size: {\n faSize: 10,\n wrapperSize: 16\n }\n }}\n />\n <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 data-name=\"learner-skill-card-skill-content-number\">\n {content} {translate('content')}\n </div>\n {questionsToReview ? (\n <div\n className={style.skillInformation}\n data-name=\"learner-skill-card-skill-questions-wrapper\"\n >\n <FaIcon\n {...{\n iconName: 'circle',\n iconColor: COLORS.cm_grey_400,\n backgroundColor: 'transparent',\n size: {faSize: 4, wrapperSize: 0}\n }}\n />\n <span data-name=\"learner-skill-card-questions-to-review\">\n {questionsToReview}\n </span>\n {questionsLocale}\n </div>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n <div className={style.progressInformations}>\n <ProgressBar\n value={score}\n displayInfo={false}\n max={MAX_SCORE}\n className={style.progressWrapper}\n style={{backgroundColor: COLORS.cm_positive_500}}\n />\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = propTypes;\n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EAAC,GAAC,EAACE,SAAS,CAAC,SAAS,CAC3B,CAAC,EACLD,iBAAiB,gBAChB/B,KAAA,CAAAiD,aAAA;IACEE,SAAS,EAAExC,KAAK,CAAC6D,gBAAiB;IAClC,aAAU;EAA4C,gBAEtDxE,KAAA,CAAAiD,aAAA,CAACxC,MAAM;IAEHgD,QAAQ,EAAE,QAAQ;IAClBC,SAAS,EAAEnD,MAAM,CAACkE,WAAW;IAC7BJ,eAAe,EAAE,aAAa;IAC9BV,IAAI,EAAE;MAACC,MAAM,EAAE,CAAC;MAAEC,WAAW,EAAE;IAAC;EAAC,CAEpC,CAAC,eACF7D,KAAA,CAAAiD,aAAA;IAAM,aAAU;EAAwC,GACrDlB,iBACG,CAAC,QACD,EAACI,eACJ,CAAC,GACJ,IACD,CACF,CACF,CACF,CAAC,eACNnC,KAAA,CAAAiD,aAAA;IAAKE,SAAS,EAAExC,KAAK,CAAC+D;EAAqB,gBACzC1E,KAAA,CAAAiD,aAAA,CAAC3C,WAAW;IACVqE,KAAK,EAAE9C,KAAM;IACb+C,WAAW,EAAE,KAAM;IACnBC,GAAG,EAAEjE,SAAU;IACfuC,SAAS,EAAExC,KAAK,CAACmE,eAAgB;IACjCnE,KAAK,EAAE;MAAC0D,eAAe,EAAE9D,MAAM,CAACwE;IAAe;EAAE,CAClD,CACE,CACF,CAAC;AAEV,CAAC;AAED7D,gBAAgB,CAAC8D,YAAY,GAAG;EAC9BhD,SAAS,EAAE5B,QAAQ,CAAC6E,iBAAiB,CAACjD;AACxC,CAAC;AAEDd,gBAAgB,CAACR,SAAS,GAAAwE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG1E,SAAS;AAEtC,eAAeQ,gBAAgB","ignoreList":[]}
|
|
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","questionsLocale","badgeIconName","badgeLocale","tagTextColor","tagBackgroundColor","purple_700","purple_100","cm_grey_500","gray","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","skillInformation","cm_grey_400","padding","height","progressInformations","value","displayInfo","max","progressWrapper","positive","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 questionsLocale = translate('skill_chart_side_panel_questions_to_review') as string;\n const [badgeIconName, badgeLocale, tagTextColor, tagBackgroundColor] = focus\n ? ['bullseye-arrow', translate('skill_focus') as string, COLORS.purple_700, COLORS.purple_100]\n : ['shapes', translate('skill') as string, COLORS.cm_grey_500, COLORS.gray];\n const headerBackgroundRef = useRef<HTMLDivElement | null>(null);\n const defaultBackground = useMemo(() => createGradientBackground(color, '93%', '100%'), [color]);\n const focusBackground = useMemo(() => createGradientBackground(color, '83%', '100%'), [color]);\n const handleMouseEnter = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, focusBackground);\n }, [focusBackground]);\n const handleMouseLeave = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, defaultBackground);\n }, [defaultBackground]);\n return (\n <div\n data-testid={`learner-skill-card-wrapper-${cardIndex}`}\n onClick={onExploreClick}\n className={style.learnerSkillCardContainer}\n aria-label={ariaLabel}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div\n data-testid=\"learner-skill-card-icon-header-wrapper\"\n ref={headerBackgroundRef}\n className={style.iconHeaderWrapper}\n style={{backgroundImage: defaultBackground, color: tagTextColor}}\n >\n <div className={style.iconWrapper} data-testid=\"learner-skill-card-icon-wrapper\">\n <FaIcon\n {...{\n iconName: name,\n iconColor: color,\n size: {\n faSize: 20,\n wrapperSize: 44\n },\n borderRadius: '12px',\n gradientBackground: true,\n customStyle: {border: '4px solid white'}\n }}\n />\n </div>\n </div>\n <div className={style.learnerSkillCardContent}>\n <div className={style.skillTitleWrapper}>\n <div\n className={style.skillFocusBadge}\n style={{\n backgroundColor: tagBackgroundColor,\n color: tagTextColor\n }}\n >\n <FaIcon\n {...{\n iconName: badgeIconName,\n backgroundColor: tagBackgroundColor,\n size: {\n faSize: 10,\n wrapperSize: 16\n }\n }}\n />\n {badgeLocale}\n </div>\n\n <div className={style.questionWrapper}>\n <div\n data-name=\"skill-card-title\"\n className={style.skillTitle}\n aria-label={skillAriaLabel || skillTitle}\n >\n {skillTitle}\n </div>\n <div className={style.contentAndQuestionsWrapper}>\n <div data-name=\"learner-skill-card-skill-content-number\">\n {content} {translate('content')}\n </div>\n {questionsToReview ? (\n <div\n className={style.skillInformation}\n data-name=\"learner-skill-card-skill-questions-wrapper\"\n >\n <FaIcon\n {...{\n iconName: 'circle',\n iconColor: COLORS.cm_grey_400,\n size: {faSize: 4},\n customStyle: {padding: 0, height: 'auto'}\n }}\n />\n <span data-name=\"learner-skill-card-questions-to-review\">\n {questionsToReview}\n </span>\n {questionsLocale}\n </div>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n <div className={style.progressInformations}>\n <ProgressBar\n value={score}\n displayInfo={false}\n max={MAX_SCORE}\n className={style.progressWrapper}\n style={{backgroundColor: COLORS.positive}}\n />\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = propTypes;\n\nexport default LearnerSkillCard;\n"],"mappings":"AAAA,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;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AAED/D,gBAAgB,CAACgE,YAAY,GAAG;EAC9BlD,SAAS,EAAE5B,QAAQ,CAAC+E,iBAAiB,CAACnD;AACxC,CAAC;AAEDd,gBAAgB,CAACR,SAAS,GAAA0E,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG5E,SAAS;AAEtC,eAAeQ,gBAAgB","ignoreList":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
@value colors: "../../variables/colors.css";
|
|
2
2
|
@value cm_grey_100 from colors;
|
|
3
|
-
@value cm_grey_500 from colors;
|
|
4
3
|
|
|
5
4
|
.LearningPriorityContainer {
|
|
6
5
|
height: 485px;
|
|
@@ -53,8 +52,8 @@
|
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
.skillFilterNumberInActive {
|
|
56
|
-
background-color:
|
|
57
|
-
color:
|
|
55
|
+
background-color: #EAEAEB;
|
|
56
|
+
color: #515161;
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
.priorityListWrapper {
|
|
@@ -142,7 +142,7 @@ const ProgressWrapper = ({
|
|
|
142
142
|
}, progression, "%"))), /*#__PURE__*/React.createElement(ProgressBar, {
|
|
143
143
|
className: style.customProgressBar,
|
|
144
144
|
style: {
|
|
145
|
-
backgroundColor: COLORS.
|
|
145
|
+
backgroundColor: COLORS.positive
|
|
146
146
|
},
|
|
147
147
|
displayInfo: false,
|
|
148
148
|
value: progression,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","classNames","PropTypes","convert","Title","ProgressBar","COLORS","Tag","ButtonLink","Icon","Provider","GetSkinFromContext","style","uncappedMap","_map","cap","DetailSection","index","type","isLocked","downloadUrl","stars","context","translate","skin","primarySkinColor","_get","isTypeStars","downloadButtonProps","label","link","target","href","customStyle","backgroundColor","color","width","transition","hoverBackgroundColor","hoverColor","white","icon","position","faIcon","name","size","padding","disabled","createElement","className","detailsInfo","detailsInfoText","detailsTitle","iconName","iconColor","preset","img","src","buttonContainer","ProgressWrapper","completedModules","mandatoryModules","title","subtitle","progression","sections","mandatoryCompletedModulesLocale","total","count","showDetails","setShowDetails","handleToggleDetails","container","titleContainer","titleSize","statscontainer","stats","dangerouslySetInnerHTML","__html","statsNumber","customProgressBar","cm_positive_500","displayInfo","value","max","statsProgressionMobile","_isEmpty","Fragment","toggleDetailsButton","onClick","toggleDetailsLabel","toggleDetailsTitle","cm_grey_500","cm_grey_700","faSize","wrapperSize","details","visibleDetails","hiddenDetails","section","_extends","key","commonDetailSectionPropTypes","process","env","NODE_ENV","oneOf","string","number","contextTypes","childContextTypes","propTypes","bool","arrayOf","shape"],"sources":["../../../src/molecule/progress-wrapper/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport {convert} from 'css-color-function';\nimport {isEmpty, map, get} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport Provider, {GetSkinFromContext} from '../../atom/provider';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst DetailSection = ({index, type, isLocked, downloadUrl, stars}, context) => {\n const {translate} = context;\n const skin = GetSkinFromContext(context);\n const primarySkinColor = get('common.primary', skin);\n const isTypeStars = type === 'stars';\n\n const downloadButtonProps = {\n label: translate('download'),\n link: {\n target: '_blank',\n href: downloadUrl\n },\n 'data-name': `download-${type}-button`,\n 'aria-label': `download ${type} button`,\n customStyle: {\n backgroundColor: convert(`color(${primarySkinColor} a(0.07))`),\n color: primarySkinColor,\n width: 'auto',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n hoverBackgroundColor: primarySkinColor,\n hoverColor: COLORS.white,\n icon: {\n position: 'left',\n faIcon: {\n name: 'download',\n color: primarySkinColor,\n size: 14,\n customStyle: {padding: 0}\n }\n },\n disabled: isLocked\n };\n\n return isTypeStars ? (\n <div\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>{translate('bonus_stars')}</span>\n </div>\n <div className={style.stars}>\n <Icon iconName=\"star\" iconColor=\"#FFCE0A\" backgroundColor=\"#FFF9D1\" preset=\"xl\" />\n <span>{stars}</span>\n </div>\n </div>\n </div>\n ) : (\n <div\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\n <img\n className={style.img}\n src={\n type === 'badge'\n ? downloadUrl\n : 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'\n }\n />\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>\n {type === 'diploma' ? translate('diploma') : translate('badge')}\n </span>\n </div>\n\n <div className={style.buttonContainer}>\n <ButtonLink {...downloadButtonProps} />\n </div>\n </div>\n </div>\n );\n};\n\nconst ProgressWrapper = (\n {completedModules, mandatoryModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const mandatoryCompletedModulesLocale = translate('modules_completed_mandatory', {\n total: mandatoryModules,\n count: completedModules > mandatoryModules ? mandatoryModules : completedModules\n });\n const isLocked = progression !== 100;\n\n const [showDetails, setShowDetails] = useState(false);\n\n const handleToggleDetails = useCallback(() => {\n setShowDetails(!showDetails);\n }, [showDetails]);\n return (\n <div\n className={style.container}\n data-name=\"prgress-wrapper\"\n aria-label=\"progress wrapper section\"\n >\n <div className={style.titleContainer}>\n <Title type=\"form-group\" titleSize=\"medium\" title={title} subtitle={subtitle} />\n </div>\n <div className={style.statscontainer}>\n <div className={style.stats}>\n <div\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: mandatoryCompletedModulesLocale}}\n />\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber} data-name=\"progress-value\">\n {progression}%\n </span>\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.cm_positive_500}}\n displayInfo={false}\n value={progression}\n max={100}\n />\n <div className={style.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n\n {!isEmpty(sections) ? (\n <>\n <div\n className={style.toggleDetailsButton}\n onClick={handleToggleDetails}\n data-testid=\"progress-wrapper-toggle-details-button\"\n >\n <div className={style.toggleDetailsLabel}>\n <span className={style.toggleDetailsTitle}>{translate('rewards')}</span>\n {isLocked ? (\n <Tag\n label={translate('locked')}\n size=\"S\"\n icon={{\n position: 'left',\n iconName: 'lock',\n iconColor: COLORS.cm_grey_500,\n preset: 's',\n customStyle: {padding: 0}\n }}\n />\n ) : null}\n </div>\n <Icon\n iconColor={COLORS.cm_grey_700}\n iconName={showDetails ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 20, wrapperSize: 24}}\n />\n </div>\n\n <div\n className={classNames(\n style.details,\n showDetails ? style.visibleDetails : style.hiddenDetails\n )}\n data-testid=\"progress-wrapper-details\"\n >\n {uncappedMap(\n (section, index) => (\n <DetailSection\n {...section}\n isLocked={isLocked}\n key={`${section.type}-${index}`}\n index={index}\n />\n ),\n sections\n )}\n </div>\n </>\n ) : null}\n </div>\n );\n};\n\nconst commonDetailSectionPropTypes = {\n type: PropTypes.oneOf(['diploma', 'badge', 'stars']),\n downloadUrl: PropTypes.string,\n stars: PropTypes.number\n};\n\nDetailSection.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nDetailSection.propTypes = {\n index: PropTypes.number,\n isLocked: PropTypes.bool,\n ...commonDetailSectionPropTypes\n};\n\nProgressWrapper.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nProgressWrapper.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n completedModules: PropTypes.number,\n mandatoryModules: PropTypes.number,\n progression: PropTypes.number,\n sections: PropTypes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,MAAM;EAC7B3C,QAAQ,EAAE/D,SAAS,CAAC+G,OAAO,CAAC/G,SAAS,CAACgH,KAAK,CAACZ,4BAA4B,CAAC;AAC3E,CAAC;AAED,eAAe3C,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","classNames","PropTypes","convert","Title","ProgressBar","COLORS","Tag","ButtonLink","Icon","Provider","GetSkinFromContext","style","uncappedMap","_map","cap","DetailSection","index","type","isLocked","downloadUrl","stars","context","translate","skin","primarySkinColor","_get","isTypeStars","downloadButtonProps","label","link","target","href","customStyle","backgroundColor","color","width","transition","hoverBackgroundColor","hoverColor","white","icon","position","faIcon","name","size","padding","disabled","createElement","className","detailsInfo","detailsInfoText","detailsTitle","iconName","iconColor","preset","img","src","buttonContainer","ProgressWrapper","completedModules","mandatoryModules","title","subtitle","progression","sections","mandatoryCompletedModulesLocale","total","count","showDetails","setShowDetails","handleToggleDetails","container","titleContainer","titleSize","statscontainer","stats","dangerouslySetInnerHTML","__html","statsNumber","customProgressBar","positive","displayInfo","value","max","statsProgressionMobile","_isEmpty","Fragment","toggleDetailsButton","onClick","toggleDetailsLabel","toggleDetailsTitle","cm_grey_500","cm_grey_700","faSize","wrapperSize","details","visibleDetails","hiddenDetails","section","_extends","key","commonDetailSectionPropTypes","process","env","NODE_ENV","oneOf","string","number","contextTypes","childContextTypes","propTypes","bool","arrayOf","shape"],"sources":["../../../src/molecule/progress-wrapper/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport {convert} from 'css-color-function';\nimport {isEmpty, map, get} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport Provider, {GetSkinFromContext} from '../../atom/provider';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst DetailSection = ({index, type, isLocked, downloadUrl, stars}, context) => {\n const {translate} = context;\n const skin = GetSkinFromContext(context);\n const primarySkinColor = get('common.primary', skin);\n const isTypeStars = type === 'stars';\n\n const downloadButtonProps = {\n label: translate('download'),\n link: {\n target: '_blank',\n href: downloadUrl\n },\n 'data-name': `download-${type}-button`,\n 'aria-label': `download ${type} button`,\n customStyle: {\n backgroundColor: convert(`color(${primarySkinColor} a(0.07))`),\n color: primarySkinColor,\n width: 'auto',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n hoverBackgroundColor: primarySkinColor,\n hoverColor: COLORS.white,\n icon: {\n position: 'left',\n faIcon: {\n name: 'download',\n color: primarySkinColor,\n size: 14,\n customStyle: {padding: 0}\n }\n },\n disabled: isLocked\n };\n\n return isTypeStars ? (\n <div\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>{translate('bonus_stars')}</span>\n </div>\n <div className={style.stars}>\n <Icon iconName=\"star\" iconColor=\"#FFCE0A\" backgroundColor=\"#FFF9D1\" preset=\"xl\" />\n <span>{stars}</span>\n </div>\n </div>\n </div>\n ) : (\n <div\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\n <img\n className={style.img}\n src={\n type === 'badge'\n ? downloadUrl\n : 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'\n }\n />\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>\n {type === 'diploma' ? translate('diploma') : translate('badge')}\n </span>\n </div>\n\n <div className={style.buttonContainer}>\n <ButtonLink {...downloadButtonProps} />\n </div>\n </div>\n </div>\n );\n};\n\nconst ProgressWrapper = (\n {completedModules, mandatoryModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const mandatoryCompletedModulesLocale = translate('modules_completed_mandatory', {\n total: mandatoryModules,\n count: completedModules > mandatoryModules ? mandatoryModules : completedModules\n });\n const isLocked = progression !== 100;\n\n const [showDetails, setShowDetails] = useState(false);\n\n const handleToggleDetails = useCallback(() => {\n setShowDetails(!showDetails);\n }, [showDetails]);\n return (\n <div\n className={style.container}\n data-name=\"prgress-wrapper\"\n aria-label=\"progress wrapper section\"\n >\n <div className={style.titleContainer}>\n <Title type=\"form-group\" titleSize=\"medium\" title={title} subtitle={subtitle} />\n </div>\n <div className={style.statscontainer}>\n <div className={style.stats}>\n <div\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: mandatoryCompletedModulesLocale}}\n />\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber} data-name=\"progress-value\">\n {progression}%\n </span>\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progression}\n max={100}\n />\n <div className={style.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n\n {!isEmpty(sections) ? (\n <>\n <div\n className={style.toggleDetailsButton}\n onClick={handleToggleDetails}\n data-testid=\"progress-wrapper-toggle-details-button\"\n >\n <div className={style.toggleDetailsLabel}>\n <span className={style.toggleDetailsTitle}>{translate('rewards')}</span>\n {isLocked ? (\n <Tag\n label={translate('locked')}\n size=\"S\"\n icon={{\n position: 'left',\n iconName: 'lock',\n iconColor: COLORS.cm_grey_500,\n preset: 's',\n customStyle: {padding: 0}\n }}\n />\n ) : null}\n </div>\n <Icon\n iconColor={COLORS.cm_grey_700}\n iconName={showDetails ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 20, wrapperSize: 24}}\n />\n </div>\n\n <div\n className={classNames(\n style.details,\n showDetails ? style.visibleDetails : style.hiddenDetails\n )}\n data-testid=\"progress-wrapper-details\"\n >\n {uncappedMap(\n (section, index) => (\n <DetailSection\n {...section}\n isLocked={isLocked}\n key={`${section.type}-${index}`}\n index={index}\n />\n ),\n sections\n )}\n </div>\n </>\n ) : null}\n </div>\n );\n};\n\nconst commonDetailSectionPropTypes = {\n type: PropTypes.oneOf(['diploma', 'badge', 'stars']),\n downloadUrl: PropTypes.string,\n stars: PropTypes.number\n};\n\nDetailSection.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nDetailSection.propTypes = {\n index: PropTypes.number,\n isLocked: PropTypes.bool,\n ...commonDetailSectionPropTypes\n};\n\nProgressWrapper.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nProgressWrapper.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n completedModules: PropTypes.number,\n mandatoryModules: PropTypes.number,\n progression: PropTypes.number,\n sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))\n};\n\nexport default ProgressWrapper;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,QAAQ,QAAO,OAAO;AAClD,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAAQC,OAAO,QAAO,oBAAoB;AAE1C,OAAOC,KAAK,MAAM,kBAAkB;AACpC,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,GAAG,MAAM,gBAAgB;AAChC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,QAAQ,IAAGC,kBAAkB,QAAO,qBAAqB;AAChE;AACA,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,WAAW,GAAGC,IAAA,CAAIX,OAAO,CAAC;EAACY,GAAG,EAAE;AAAK,CAAC,CAAC;AAE7C,MAAMC,aAAa,GAAGA,CAAC;EAACC,KAAK;EAAEC,IAAI;EAAEC,QAAQ;EAAEC,WAAW;EAAEC;AAAK,CAAC,EAAEC,OAAO,KAAK;EAC9E,MAAM;IAACC;EA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SAAS,CAAC0G,MAAM;EACvBzF,QAAQ,EAAEjB,SAAS,CAAC8G,IAAI;EACxB,GAAGV;AACL,CAAC;AAED3C,eAAe,CAACkD,YAAY,GAAG;EAC7BtF,SAAS,EAAEb,QAAQ,CAACoG,iBAAiB,CAACvF;AACxC,CAAC;AAEDoC,eAAe,CAACoD,SAAS,GAAAR,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EAC1B3C,KAAK,EAAE5D,SAAS,CAACyG,MAAM;EACvB5C,QAAQ,EAAE7D,SAAS,CAACyG,MAAM;EAC1B/C,gBAAgB,EAAE1D,SAAS,CAAC0G,MAAM;EAClC/C,gBAAgB,EAAE3D,SAAS,CAAC0G,MAAM;EAClC5C,WAAW,EAAE9D,SAAS,CAAC0G,MAAM;EAC7B3C,QAAQ,EAAE/D,SAAS,CAAC+G,OAAO,CAAC/G,SAAS,CAACgH,KAAK,CAACZ,4BAA4B,CAAC;AAC3E,CAAC;AAED,eAAe3C,eAAe","ignoreList":[]}
|
|
@@ -7,7 +7,7 @@ declare function SkillsChartSideInformationItem({ title, value, legend, icon: ic
|
|
|
7
7
|
}): JSX.Element;
|
|
8
8
|
declare namespace SkillsChartSideInformationItem {
|
|
9
9
|
namespace propTypes {
|
|
10
|
-
const icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
10
|
+
const icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
11
11
|
const title: PropTypes.Requireable<string>;
|
|
12
12
|
const value: PropTypes.Requireable<string>;
|
|
13
13
|
const legend: PropTypes.Requireable<string>;
|
|
@@ -5,7 +5,7 @@ declare function SkillsChartSideInformationPanel({ sidePanelItems }: {
|
|
|
5
5
|
declare namespace SkillsChartSideInformationPanel {
|
|
6
6
|
namespace propTypes {
|
|
7
7
|
const sidePanelItems: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
8
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
8
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
9
9
|
title: PropTypes.Requireable<string>;
|
|
10
10
|
value: PropTypes.Requireable<string>;
|
|
11
11
|
legend: PropTypes.Requireable<string>;
|
|
@@ -26,7 +26,7 @@ declare namespace TitleAndCheckBoxWrapper {
|
|
|
26
26
|
'data-name': PropTypes.Requireable<string>;
|
|
27
27
|
titleSize: PropTypes.Requireable<string>;
|
|
28
28
|
subtitleSize: PropTypes.Requireable<string>;
|
|
29
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
29
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
30
30
|
tag: PropTypes.Requireable<PropTypes.InferProps<{
|
|
31
31
|
label: PropTypes.Requireable<string>;
|
|
32
32
|
type: PropTypes.Requireable<string>;
|
|
@@ -34,17 +34,7 @@ declare namespace TitleAndCheckBoxWrapper {
|
|
|
34
34
|
customStyle: PropTypes.Requireable<{
|
|
35
35
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
36
36
|
}>;
|
|
37
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
38
|
-
position: PropTypes.Requireable<string>;
|
|
39
|
-
iconName?: React.Validator<string> | undefined;
|
|
40
|
-
iconColor?: React.Validator<string | null | undefined> | undefined;
|
|
41
|
-
backgroundColor?: React.Validator<string | null | undefined> | undefined;
|
|
42
|
-
gradientBackground?: React.Validator<boolean | null | undefined> | undefined;
|
|
43
|
-
borderRadius?: React.Validator<string | null | undefined> | undefined;
|
|
44
|
-
preset?: React.Validator<string | null | undefined> | undefined;
|
|
45
|
-
size?: React.Validator<import("../../atom/icon").IconSize | null | undefined> | undefined;
|
|
46
|
-
customStyle?: React.Validator<React.CSSProperties | null | undefined> | undefined;
|
|
47
|
-
}>>;
|
|
37
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
48
38
|
}>>;
|
|
49
39
|
button: PropTypes.Requireable<PropTypes.InferProps<{
|
|
50
40
|
type: PropTypes.Requireable<string>;
|
|
@@ -191,5 +181,4 @@ declare namespace TitleAndCheckBoxWrapper {
|
|
|
191
181
|
}
|
|
192
182
|
}
|
|
193
183
|
import PropTypes from "prop-types";
|
|
194
|
-
import React from "react";
|
|
195
184
|
//# sourceMappingURL=index.d.ts.map
|