@coorpacademy/components 11.35.2-alpha.13 → 11.35.2-forcedeploy.13
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 +35 -17
- package/es/atom/icon/index.d.ts.map +1 -1
- package/es/atom/icon/index.js +32 -15
- package/es/atom/icon/index.js.map +1 -1
- package/es/atom/radio-with-title/index.d.ts +13 -3
- package/es/atom/radio-with-title/index.d.ts.map +1 -1
- package/es/atom/radio-with-title/types.d.ts +13 -2
- 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 +12 -1
- package/es/atom/tag/style.css +1 -0
- package/es/atom/title/index.d.ts +13 -2
- package/es/molecule/banner/style.css +1 -0
- package/es/molecule/base-modal/style.css +0 -1
- 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 +28 -7
- 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 +2 -0
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/learner-skill-card/index.d.ts +25 -40
- package/es/molecule/learner-skill-card/index.d.ts.map +1 -1
- package/es/molecule/learner-skill-card/index.js +95 -96
- package/es/molecule/learner-skill-card/index.js.map +1 -1
- package/es/molecule/learner-skill-card/prop-types.d.ts +37 -0
- package/es/molecule/learner-skill-card/prop-types.d.ts.map +1 -0
- package/es/molecule/learner-skill-card/prop-types.js +20 -0
- package/es/molecule/learner-skill-card/prop-types.js.map +1 -0
- package/es/molecule/learner-skill-card/style.css +62 -41
- package/es/molecule/learning-priority-modal/style.css +3 -2
- 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 +13 -2
- package/es/molecule/title-radio-wrapper/index.d.ts +13 -3
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +13 -2
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/molecule/translation-modal/index.d.ts +0 -1
- package/es/molecule/translation-modal/index.d.ts.map +1 -1
- package/es/molecule/translation-modal/index.js +24 -7
- package/es/molecule/translation-modal/index.js.map +1 -1
- package/es/organism/cards-grid/index.d.ts +48 -10
- package/es/organism/cards-grid/index.d.ts.map +1 -1
- package/es/organism/cards-grid/index.js +3 -2
- package/es/organism/cards-grid/index.js.map +1 -1
- package/es/organism/content-skill-modal/index.d.ts +13 -3
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +12 -2
- 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 +23 -17
- package/es/organism/list-items/index.d.ts +13 -2
- package/es/organism/list-items/style.css +1 -0
- package/es/organism/rewards-form/index.d.ts +13 -2
- package/es/organism/select-opponents/index.d.ts +13 -3
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +13 -2
- 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 +1261 -52
- package/es/organism/skill-edition/index.d.ts.map +1 -1
- package/es/organism/skill-edition/index.js +3 -224
- package/es/organism/skill-edition/index.js.map +1 -1
- package/es/organism/skill-edition/types.d.ts +1268 -117
- package/es/organism/skill-edition/types.d.ts.map +1 -1
- package/es/organism/skill-edition/types.js +7 -59
- package/es/organism/skill-edition/types.js.map +1 -1
- package/es/organism/title-and-input/index.d.ts +25 -5
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +24 -4
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +13 -2
- package/es/template/app-player/loading/index.d.ts +27 -6
- package/es/template/app-player/player/index.d.ts +53 -12
- package/es/template/app-player/player/slides/index.d.ts +27 -6
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +26 -6
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +27 -6
- package/es/template/app-review/index.d.ts +27 -7
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +27 -6
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +27 -6
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +1713 -1113
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +0 -12
- 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 +53 -12
- package/es/template/common/search-page/index.d.ts +27 -6
- package/es/template/external-course/index.d.ts +27 -6
- package/es/template/my-learning/index.d.ts +0 -1
- package/es/template/my-learning/index.d.ts.map +1 -1
- package/es/template/my-learning/index.js +26 -22
- package/es/template/my-learning/index.js.map +1 -1
- package/es/template/my-learning/style.css +9 -6
- package/es/template/skill-detail/all-courses.css +3 -2
- package/es/template/skill-detail/all-courses.d.ts +52 -17
- package/es/template/skill-detail/all-courses.d.ts.map +1 -1
- package/es/template/skill-detail/all-courses.js +12 -11
- package/es/template/skill-detail/all-courses.js.map +1 -1
- package/es/template/skill-detail/continue-learning.css +7 -2
- package/es/template/skill-detail/continue-learning.d.ts +25 -12
- 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 +81 -71
- package/es/template/skill-detail/index.d.ts.map +1 -1
- package/es/template/skill-detail/index.js +91 -58
- package/es/template/skill-detail/index.js.map +1 -1
- package/es/template/skill-detail/style.css +97 -39
- package/es/variables/colors.css +7 -1
- package/es/variables/colors.d.ts +9 -2
- package/es/variables/colors.d.ts.map +1 -1
- package/es/variables/colors.js +10 -3
- 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 +35 -17
- package/lib/atom/icon/index.d.ts.map +1 -1
- package/lib/atom/icon/index.js +34 -18
- package/lib/atom/icon/index.js.map +1 -1
- package/lib/atom/radio-with-title/index.d.ts +13 -3
- package/lib/atom/radio-with-title/index.d.ts.map +1 -1
- package/lib/atom/radio-with-title/types.d.ts +13 -2
- 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 +12 -1
- package/lib/atom/tag/style.css +1 -0
- package/lib/atom/title/index.d.ts +13 -2
- package/lib/molecule/banner/style.css +1 -0
- package/lib/molecule/base-modal/style.css +0 -1
- 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 +28 -7
- 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 +2 -0
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/learner-skill-card/index.d.ts +25 -40
- package/lib/molecule/learner-skill-card/index.d.ts.map +1 -1
- package/lib/molecule/learner-skill-card/index.js +98 -96
- package/lib/molecule/learner-skill-card/index.js.map +1 -1
- package/lib/molecule/learner-skill-card/prop-types.d.ts +37 -0
- package/lib/molecule/learner-skill-card/prop-types.d.ts.map +1 -0
- package/lib/molecule/learner-skill-card/prop-types.js +25 -0
- package/lib/molecule/learner-skill-card/prop-types.js.map +1 -0
- package/lib/molecule/learner-skill-card/style.css +62 -41
- package/lib/molecule/learning-priority-modal/style.css +3 -2
- 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 +13 -2
- package/lib/molecule/title-radio-wrapper/index.d.ts +13 -3
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +13 -2
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/molecule/translation-modal/index.d.ts +0 -1
- package/lib/molecule/translation-modal/index.d.ts.map +1 -1
- package/lib/molecule/translation-modal/index.js +23 -6
- package/lib/molecule/translation-modal/index.js.map +1 -1
- package/lib/organism/cards-grid/index.d.ts +48 -10
- package/lib/organism/cards-grid/index.d.ts.map +1 -1
- package/lib/organism/cards-grid/index.js +3 -2
- package/lib/organism/cards-grid/index.js.map +1 -1
- package/lib/organism/content-skill-modal/index.d.ts +13 -3
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +12 -2
- 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 +23 -17
- package/lib/organism/list-items/index.d.ts +13 -2
- package/lib/organism/list-items/style.css +1 -0
- package/lib/organism/rewards-form/index.d.ts +13 -2
- package/lib/organism/select-opponents/index.d.ts +13 -3
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +13 -2
- 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 +1261 -52
- package/lib/organism/skill-edition/index.d.ts.map +1 -1
- package/lib/organism/skill-edition/index.js +3 -224
- package/lib/organism/skill-edition/index.js.map +1 -1
- package/lib/organism/skill-edition/types.d.ts +1268 -117
- package/lib/organism/skill-edition/types.d.ts.map +1 -1
- package/lib/organism/skill-edition/types.js +7 -59
- package/lib/organism/skill-edition/types.js.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +25 -5
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +24 -4
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +13 -2
- package/lib/template/app-player/loading/index.d.ts +27 -6
- package/lib/template/app-player/player/index.d.ts +53 -12
- package/lib/template/app-player/player/slides/index.d.ts +27 -6
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +26 -6
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +27 -6
- package/lib/template/app-review/index.d.ts +27 -7
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +27 -6
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +27 -6
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +1713 -1113
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +0 -12
- 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 +53 -12
- package/lib/template/common/search-page/index.d.ts +27 -6
- package/lib/template/external-course/index.d.ts +27 -6
- package/lib/template/my-learning/index.d.ts +0 -1
- package/lib/template/my-learning/index.d.ts.map +1 -1
- package/lib/template/my-learning/index.js +26 -22
- package/lib/template/my-learning/index.js.map +1 -1
- package/lib/template/my-learning/style.css +9 -6
- package/lib/template/skill-detail/all-courses.css +3 -2
- package/lib/template/skill-detail/all-courses.d.ts +52 -17
- 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 +7 -2
- package/lib/template/skill-detail/continue-learning.d.ts +25 -12
- 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 +81 -71
- package/lib/template/skill-detail/index.d.ts.map +1 -1
- package/lib/template/skill-detail/index.js +91 -58
- package/lib/template/skill-detail/index.js.map +1 -1
- package/lib/template/skill-detail/style.css +97 -39
- package/lib/variables/colors.css +7 -1
- package/lib/variables/colors.d.ts +9 -2
- package/lib/variables/colors.d.ts.map +1 -1
- package/lib/variables/colors.js +10 -3
- 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/cs/global.json +1 -0
- package/locales/en/global.json +1 -0
- package/locales/hr/global.json +1 -0
- package/locales/it/global.json +1 -0
- package/locales/ko/global.json +1 -0
- package/locales/ru/global.json +1 -0
- package/package.json +2 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import PropTypes from 'prop-types';
|
|
2
3
|
import Link from '../../atom/link';
|
|
3
4
|
import { TitleProps } from '../../atom/title/types';
|
|
4
5
|
import CardsGrid from '../../organism/cards-grid';
|
|
5
6
|
import ListItems from '../../organism/list-items';
|
|
6
|
-
import { iconPropTypes } from '../../atom/icon';
|
|
7
|
+
import { propTypes as iconPropTypes } from '../../atom/icon';
|
|
7
8
|
declare const propTypes: {
|
|
8
9
|
content: PropTypes.Requireable<string>;
|
|
9
10
|
mode: PropTypes.Requireable<string>;
|
|
@@ -15,7 +16,7 @@ declare const propTypes: {
|
|
|
15
16
|
'data-name': PropTypes.Requireable<string>;
|
|
16
17
|
titleSize: PropTypes.Requireable<string>;
|
|
17
18
|
subtitleSize: PropTypes.Requireable<string>;
|
|
18
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<any
|
|
19
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<PropTypes.ValidationMap<any>>>;
|
|
19
20
|
tag: PropTypes.Requireable<PropTypes.InferProps<{
|
|
20
21
|
label: PropTypes.Requireable<string>;
|
|
21
22
|
type: PropTypes.Requireable<string>;
|
|
@@ -23,7 +24,17 @@ declare const propTypes: {
|
|
|
23
24
|
customStyle: PropTypes.Requireable<{
|
|
24
25
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
25
26
|
}>;
|
|
26
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
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
|
+
}>>;
|
|
27
38
|
}>>;
|
|
28
39
|
button: PropTypes.Requireable<PropTypes.InferProps<{
|
|
29
40
|
type: PropTypes.Requireable<string>;
|
|
@@ -110,8 +121,8 @@ declare const propTypes: {
|
|
|
110
121
|
borderRadius: PropTypes.Requireable<string>;
|
|
111
122
|
preset: PropTypes.Requireable<string>;
|
|
112
123
|
size: PropTypes.Requireable<PropTypes.InferProps<{
|
|
113
|
-
faSize: PropTypes.
|
|
114
|
-
wrapperSize: PropTypes.
|
|
124
|
+
faSize: PropTypes.Validator<number>;
|
|
125
|
+
wrapperSize: PropTypes.Validator<number>;
|
|
115
126
|
}>>;
|
|
116
127
|
customStyle: PropTypes.Requireable<{
|
|
117
128
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
@@ -549,7 +560,7 @@ declare const propTypes: {
|
|
|
549
560
|
'data-name': PropTypes.Requireable<string>;
|
|
550
561
|
titleSize: PropTypes.Requireable<string>;
|
|
551
562
|
subtitleSize: PropTypes.Requireable<string>;
|
|
552
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<any
|
|
563
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<PropTypes.ValidationMap<any>>>;
|
|
553
564
|
tag: PropTypes.Requireable<PropTypes.InferProps<{
|
|
554
565
|
label: PropTypes.Requireable<string>;
|
|
555
566
|
type: PropTypes.Requireable<string>;
|
|
@@ -557,7 +568,17 @@ declare const propTypes: {
|
|
|
557
568
|
customStyle: PropTypes.Requireable<{
|
|
558
569
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
559
570
|
}>;
|
|
560
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
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
|
+
}>>;
|
|
561
582
|
}>>;
|
|
562
583
|
button: PropTypes.Requireable<PropTypes.InferProps<{
|
|
563
584
|
type: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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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AY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE;QACZ,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;IAC1D,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAC5D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;QACzB,IAAI,EACA,SAAS,CAAC,UAAU,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 { iconPropTypes } from '../../atom/icon';
|
|
10
|
+
import { propTypes as 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","propTypes","iconPropTypes","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 {propTypes as 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,YAA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ACb,WAAW,CAACM,SAAS,CAAC,CAAC;EACxEiC,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,CAACG,SAAS,CAAC,EACpCR,SAAS,CAACe,KAAK,CAACT,SAAS,CAACE,SAAS,CAAC,CACrC;EACH,CAAC,CAAC;EACFmC,IAAI,EAAE3C,SAAS,CAACe,KAAK,CAACX,IAAI,CAACI,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":";AAwFA;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,sBAwGC;CACF"}
|
|
@@ -19,6 +19,7 @@ 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';
|
|
22
23
|
import style from './style.css';
|
|
23
24
|
const ShowMoreLink = props => {
|
|
24
25
|
const {
|
|
@@ -296,6 +297,7 @@ class CardsList extends React.PureComponent {
|
|
|
296
297
|
color: dark,
|
|
297
298
|
preset: 's',
|
|
298
299
|
borderRadius: '8px',
|
|
300
|
+
backgroundColor: COLORS.neutral_75,
|
|
299
301
|
ariaLabel: ariaLabel.showMoreOnLeftAriaLabel
|
|
300
302
|
};
|
|
301
303
|
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","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,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,OAAOC,KAAK,MAA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
|
+
{"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,I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18
|
-
|
|
19
|
-
|
|
20
|
-
}>;
|
|
21
|
-
courses: PropTypes.Requireable<any[]>;
|
|
22
|
-
texts: PropTypes.Requireable<{
|
|
23
|
-
[x: string]: any;
|
|
24
|
-
}>;
|
|
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>;
|
|
25
20
|
}>>;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
'aria-label': PropTypes.Requireable<string>;
|
|
30
|
-
skillTitle: PropTypes.Requireable<string>;
|
|
31
|
-
skillAriaLabel: PropTypes.Requireable<string>;
|
|
32
|
-
focus: PropTypes.Requireable<boolean>;
|
|
33
|
-
metrics: PropTypes.Requireable<PropTypes.InferProps<{
|
|
34
|
-
score: PropTypes.Requireable<number>;
|
|
35
|
-
content: PropTypes.Requireable<number>;
|
|
36
|
-
questionsToReview: PropTypes.Requireable<number>;
|
|
21
|
+
icon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
22
|
+
color: import("prop-types").Requireable<string>;
|
|
23
|
+
name: import("prop-types").Requireable<string>;
|
|
37
24
|
}>>;
|
|
38
|
-
|
|
39
|
-
onReviewClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
40
|
-
onExploreClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
25
|
+
onExploreClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
41
26
|
};
|
|
42
|
-
}
|
|
43
|
-
|
|
27
|
+
};
|
|
28
|
+
export default LearnerSkillCard;
|
|
44
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.
|
|
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;;;;;;;;;;;;;;;;;;;;;CA8HhF,CAAC;AAQF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { convert } from 'css-color-function';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import Icon from '../../atom/icon';
|
|
6
|
-
import ButtonLink from '../../atom/button-link';
|
|
7
|
-
import Provider from '../../atom/provider';
|
|
1
|
+
import React, { useCallback, useMemo, useRef } from 'react';
|
|
2
|
+
import Provider, { GetTranslateFromContext } from '../../atom/provider';
|
|
8
3
|
import ProgressBar from '../progress-bar';
|
|
9
4
|
import { COLORS } from '../../variables/colors';
|
|
5
|
+
import { createGradientBackground } from '../../util/get-background-gradient-color';
|
|
6
|
+
import FaIcon from '../../atom/icon';
|
|
7
|
+
import propTypes from './prop-types';
|
|
10
8
|
import style from './style.css';
|
|
11
9
|
const MAX_SCORE = 100;
|
|
10
|
+
export const updateBackgroundImage = (ref, background) => {
|
|
11
|
+
if (ref.current) {
|
|
12
|
+
ref.current.style.backgroundImage = background;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
12
15
|
const LearnerSkillCard = (props, context) => {
|
|
13
16
|
const {
|
|
14
17
|
'aria-label': ariaLabel,
|
|
18
|
+
cardIndex,
|
|
15
19
|
skillTitle,
|
|
16
20
|
skillAriaLabel,
|
|
17
|
-
focus
|
|
21
|
+
focus,
|
|
18
22
|
metrics,
|
|
19
|
-
|
|
20
|
-
onReviewClick,
|
|
23
|
+
icon,
|
|
21
24
|
onExploreClick
|
|
22
25
|
} = props;
|
|
23
26
|
const {
|
|
@@ -25,76 +28,97 @@ const LearnerSkillCard = (props, context) => {
|
|
|
25
28
|
content,
|
|
26
29
|
questionsToReview = 0
|
|
27
30
|
} = metrics;
|
|
31
|
+
const translate = GetTranslateFromContext(context);
|
|
28
32
|
const {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} =
|
|
32
|
-
const primarySkinColor = _get('common.primary', skin);
|
|
33
|
-
const reviewLocale = translate('Review');
|
|
34
|
-
const exploreLocale = translate('Explore');
|
|
33
|
+
color,
|
|
34
|
+
name
|
|
35
|
+
} = icon;
|
|
35
36
|
const questionsLocale = translate('skill_chart_side_panel_questions_to_review');
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
const [badgeIconName, badgeLocale, tagTextColor, tagBackgroundColor] = focus ? ['bullseye-arrow', translate('skill_focus'), COLORS.purple_700, COLORS.purple_100] : ['shapes', translate('skill'), COLORS.neutral_500, COLORS.gray];
|
|
38
|
+
const headerBackgroundRef = useRef(null);
|
|
39
|
+
const defaultBackground = useMemo(() => createGradientBackground(color, '93%', '100%'), [color]);
|
|
40
|
+
const focusBackground = useMemo(() => createGradientBackground(color, '83%', '100%'), [color]);
|
|
41
|
+
const handleMouseEnter = useCallback(() => {
|
|
42
|
+
updateBackgroundImage(headerBackgroundRef, focusBackground);
|
|
43
|
+
}, [focusBackground]);
|
|
44
|
+
const handleMouseLeave = useCallback(() => {
|
|
45
|
+
updateBackgroundImage(headerBackgroundRef, defaultBackground);
|
|
46
|
+
}, [defaultBackground]);
|
|
47
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
"data-testid": `learner-skill-card-wrapper-${cardIndex}`,
|
|
49
|
+
onClick: onExploreClick,
|
|
50
|
+
className: style.learnerSkillCardContainer,
|
|
51
|
+
"aria-label": ariaLabel,
|
|
52
|
+
onMouseEnter: handleMouseEnter,
|
|
53
|
+
onMouseLeave: handleMouseLeave
|
|
54
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
"data-testid": "learner-skill-card-icon-header-wrapper",
|
|
56
|
+
ref: headerBackgroundRef,
|
|
57
|
+
className: style.iconHeaderWrapper,
|
|
58
|
+
style: {
|
|
59
|
+
backgroundImage: defaultBackground,
|
|
60
|
+
color: tagTextColor
|
|
61
|
+
}
|
|
62
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: style.iconWrapper,
|
|
64
|
+
"data-testid": "learner-skill-card-icon-wrapper"
|
|
65
|
+
}, /*#__PURE__*/React.createElement(FaIcon, {
|
|
66
|
+
iconName: name,
|
|
67
|
+
iconColor: color,
|
|
68
|
+
size: {
|
|
69
|
+
faSize: 20,
|
|
70
|
+
wrapperSize: 44
|
|
42
71
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
'aria-label': `${skillTitle}, ${reviewLocale}`,
|
|
46
|
-
label: reviewLocale,
|
|
47
|
-
'data-name': 'learner-skill-card-review-button'
|
|
48
|
-
};
|
|
49
|
-
const buttonExploreProps = {
|
|
72
|
+
borderRadius: '12px',
|
|
73
|
+
gradientBackground: true,
|
|
50
74
|
customStyle: {
|
|
51
|
-
|
|
52
|
-
color: primarySkinColor,
|
|
53
|
-
transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'
|
|
54
|
-
},
|
|
55
|
-
hoverColor: '#FFFFFF',
|
|
56
|
-
hoverBackgroundColor: primarySkinColor,
|
|
57
|
-
onClick: onExploreClick,
|
|
58
|
-
'aria-label': `${skillTitle}, ${exploreLocale}`,
|
|
59
|
-
label: exploreLocale,
|
|
60
|
-
'data-name': 'learner-skill-card-explore-button',
|
|
61
|
-
icon: {
|
|
62
|
-
position: 'left',
|
|
63
|
-
faIcon: {
|
|
64
|
-
name: 'compass',
|
|
65
|
-
backgroundColor: convert(`color(${primarySkinColor} a(0.07))`),
|
|
66
|
-
color: primarySkinColor,
|
|
67
|
-
size: 16
|
|
68
|
-
}
|
|
75
|
+
border: '4px solid white'
|
|
69
76
|
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
className: style.learnerSkillCardWrapper,
|
|
73
|
-
"data-name": "learner-skill-card-wrapper",
|
|
74
|
-
"aria-label": ariaLabel
|
|
75
|
-
}, questionsToReview ? /*#__PURE__*/React.createElement("div", {
|
|
76
|
-
className: style.skillQuestionsWrapper
|
|
77
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: style.learnerSkillCardContent
|
|
77
79
|
}, /*#__PURE__*/React.createElement("div", {
|
|
78
|
-
className: style.skillInformation,
|
|
79
|
-
"data-name": "skill-questions"
|
|
80
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
81
|
-
className: style.skillInformationNumber
|
|
82
|
-
}, questionsToReview), "\xA0", questionsLocale)) : null, /*#__PURE__*/React.createElement("div", {
|
|
83
80
|
className: style.skillTitleWrapper
|
|
84
81
|
}, /*#__PURE__*/React.createElement("div", {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}, /*#__PURE__*/React.createElement(
|
|
91
|
-
iconName:
|
|
92
|
-
backgroundColor:
|
|
82
|
+
className: style.skillFocusBadge,
|
|
83
|
+
style: {
|
|
84
|
+
backgroundColor: tagBackgroundColor,
|
|
85
|
+
color: tagTextColor
|
|
86
|
+
}
|
|
87
|
+
}, /*#__PURE__*/React.createElement(FaIcon, {
|
|
88
|
+
iconName: badgeIconName,
|
|
89
|
+
backgroundColor: tagBackgroundColor,
|
|
93
90
|
size: {
|
|
94
91
|
faSize: 10,
|
|
95
92
|
wrapperSize: 16
|
|
96
93
|
}
|
|
97
|
-
}),
|
|
94
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
95
|
+
style: {
|
|
96
|
+
color: tagTextColor
|
|
97
|
+
}
|
|
98
|
+
}, badgeLocale)), /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
className: style.questionWrapper
|
|
100
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
"data-name": "skill-card-title",
|
|
102
|
+
className: style.skillTitle,
|
|
103
|
+
"aria-label": skillAriaLabel || skillTitle
|
|
104
|
+
}, skillTitle), /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
className: style.contentAndQuestionsWrapper
|
|
106
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
107
|
+
"data-name": "learner-skill-card-skill-content-number"
|
|
108
|
+
}, content, " ", translate('content')), questionsToReview ? /*#__PURE__*/React.createElement("div", {
|
|
109
|
+
className: style.skillInformation,
|
|
110
|
+
"data-name": "learner-skill-card-skill-questions-wrapper"
|
|
111
|
+
}, /*#__PURE__*/React.createElement(FaIcon, {
|
|
112
|
+
iconName: 'circle',
|
|
113
|
+
iconColor: COLORS.cm_grey_400,
|
|
114
|
+
backgroundColor: 'transparent',
|
|
115
|
+
size: {
|
|
116
|
+
faSize: 4,
|
|
117
|
+
wrapperSize: 0
|
|
118
|
+
}
|
|
119
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
120
|
+
"data-name": "learner-skill-card-questions-to-review"
|
|
121
|
+
}, questionsToReview), "\xA0", questionsLocale) : null)))), /*#__PURE__*/React.createElement("div", {
|
|
98
122
|
className: style.progressInformations
|
|
99
123
|
}, /*#__PURE__*/React.createElement(ProgressBar, {
|
|
100
124
|
value: score,
|
|
@@ -102,38 +126,13 @@ const LearnerSkillCard = (props, context) => {
|
|
|
102
126
|
max: MAX_SCORE,
|
|
103
127
|
className: style.progressWrapper,
|
|
104
128
|
style: {
|
|
105
|
-
backgroundColor: COLORS.
|
|
129
|
+
backgroundColor: COLORS.cm_positive_500
|
|
106
130
|
}
|
|
107
|
-
})
|
|
108
|
-
className: style.progressInformation,
|
|
109
|
-
"data-name": "completed-percentage"
|
|
110
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
111
|
-
className: style.progressInformationNumber
|
|
112
|
-
}, score, "%"))) : null, /*#__PURE__*/React.createElement("div", {
|
|
113
|
-
className: style.ctaWrapper,
|
|
114
|
-
"data-name": "cta-wrapper"
|
|
115
|
-
}, /*#__PURE__*/React.createElement(ButtonLink, buttonReviewProps), /*#__PURE__*/React.createElement("div", {
|
|
116
|
-
className: style.buttonWrapper,
|
|
117
|
-
"data-name": "button-explore-wrapper"
|
|
118
|
-
}, /*#__PURE__*/React.createElement(ButtonLink, buttonExploreProps))));
|
|
131
|
+
})));
|
|
119
132
|
};
|
|
120
133
|
LearnerSkillCard.contextTypes = {
|
|
121
|
-
skin: Provider.childContextTypes.skin,
|
|
122
134
|
translate: Provider.childContextTypes.translate
|
|
123
135
|
};
|
|
124
|
-
LearnerSkillCard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
125
|
-
'aria-label': PropTypes.string,
|
|
126
|
-
skillTitle: PropTypes.string,
|
|
127
|
-
skillAriaLabel: PropTypes.string,
|
|
128
|
-
focus: PropTypes.bool,
|
|
129
|
-
metrics: PropTypes.shape({
|
|
130
|
-
score: PropTypes.number,
|
|
131
|
-
content: PropTypes.number,
|
|
132
|
-
questionsToReview: PropTypes.number
|
|
133
|
-
}),
|
|
134
|
-
review: PropTypes.bool,
|
|
135
|
-
onReviewClick: PropTypes.func,
|
|
136
|
-
onExploreClick: PropTypes.func
|
|
137
|
-
} : {};
|
|
136
|
+
LearnerSkillCard.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
138
137
|
export default LearnerSkillCard;
|
|
139
138
|
//# sourceMappingURL=index.js.map
|