@coorpacademy/components 10.3.32-alpha.0 → 10.3.32-alpha.16
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/input-switch/test/fixtures.js +10 -0
- package/es/atom/input-switch/test/fixtures.js.map +1 -1
- package/es/molecule/card/customer.css +61 -3
- package/es/molecule/card/customer.js +17 -5
- package/es/molecule/card/customer.js.map +1 -1
- package/es/molecule/card/index.js +15 -5
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/card/style.css +86 -24
- package/es/molecule/card/test/fixtures/coorpmanager.js +18 -0
- package/es/molecule/card/test/fixtures/coorpmanager.js.map +1 -0
- package/es/molecule/card/test/fixtures.js +2 -0
- package/es/molecule/card/test/fixtures.js.map +1 -1
- package/es/molecule/card-content/index.js +11 -5
- package/es/molecule/card-content/index.js.map +1 -1
- package/es/molecule/card-content/style.css +52 -0
- package/es/molecule/cockpit-popin/test/fixtures.js +17 -0
- package/es/molecule/cockpit-popin/test/fixtures.js.map +1 -0
- package/es/molecule/search/test/fixtures.js +15 -0
- package/es/molecule/search/test/fixtures.js.map +1 -0
- package/es/organism/course-selection/index.js +1 -6
- package/es/organism/course-selection/index.js.map +1 -1
- package/es/organism/course-selection/style.css +1 -7
- package/es/organism/course-selection/test/fixtures/default.js +29 -7
- package/es/organism/course-selection/test/fixtures/default.js.map +1 -1
- package/es/organism/course-selection/test/fixtures.js +2 -0
- package/es/organism/course-selection/test/fixtures.js.map +1 -1
- package/es/organism/playlist-translation/test/fixtures.js +15 -0
- package/es/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/es/organism/search-and-chips-results/index.js +1 -6
- package/es/organism/search-and-chips-results/index.js.map +1 -1
- package/es/organism/search-and-chips-results/style.css +1 -7
- package/es/organism/wizard-contents/index.js +5 -1
- package/es/organism/wizard-contents/index.js.map +1 -1
- package/es/organism/wizard-contents/style.css +7 -1
- package/lib/atom/input-switch/test/fixtures.js +15 -0
- package/lib/atom/input-switch/test/fixtures.js.map +1 -1
- package/lib/molecule/card/customer.css +61 -3
- package/lib/molecule/card/customer.js +22 -6
- package/lib/molecule/card/customer.js.map +1 -1
- package/lib/molecule/card/index.js +19 -6
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/card/style.css +86 -24
- package/lib/molecule/card/test/fixtures/coorpmanager.js +28 -0
- package/lib/molecule/card/test/fixtures/coorpmanager.js.map +1 -0
- package/lib/molecule/card/test/fixtures.js +3 -0
- package/lib/molecule/card/test/fixtures.js.map +1 -1
- package/lib/molecule/card-content/index.js +14 -6
- package/lib/molecule/card-content/index.js.map +1 -1
- package/lib/molecule/card-content/style.css +52 -0
- package/lib/molecule/cockpit-popin/test/fixtures.js +28 -0
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +1 -0
- package/lib/molecule/search/test/fixtures.js +25 -0
- package/lib/molecule/search/test/fixtures.js.map +1 -0
- package/lib/organism/course-selection/index.js +1 -7
- package/lib/organism/course-selection/index.js.map +1 -1
- package/lib/organism/course-selection/style.css +1 -7
- package/lib/organism/course-selection/test/fixtures/default.js +30 -7
- package/lib/organism/course-selection/test/fixtures/default.js.map +1 -1
- package/lib/organism/course-selection/test/fixtures.js +3 -0
- package/lib/organism/course-selection/test/fixtures.js.map +1 -1
- package/lib/organism/playlist-translation/test/fixtures.js +25 -0
- package/lib/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/lib/organism/search-and-chips-results/index.js +1 -7
- package/lib/organism/search-and-chips-results/index.js.map +1 -1
- package/lib/organism/search-and-chips-results/style.css +1 -7
- package/lib/organism/wizard-contents/index.js +5 -1
- package/lib/organism/wizard-contents/index.js.map +1 -1
- package/lib/organism/wizard-contents/style.css +7 -1
- package/package.json +2 -2
|
@@ -3,6 +3,11 @@ import forEach from 'lodash/forEach';
|
|
|
3
3
|
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
4
|
import AtomInputSwitch from '..';
|
|
5
5
|
import fixtureChecked from './fixtures/checked';
|
|
6
|
+
import fixtureCmLeft from './fixtures/cm-left';
|
|
7
|
+
import fixtureCmRightChecked from './fixtures/cm-right-checked';
|
|
8
|
+
import fixtureCmRightDisabled from './fixtures/cm-right-disabled';
|
|
9
|
+
import fixtureCmRightModified from './fixtures/cm-right-modified';
|
|
10
|
+
import fixtureCmRight from './fixtures/cm-right';
|
|
6
11
|
import fixtureDisabled from './fixtures/disabled';
|
|
7
12
|
import fixtureModified from './fixtures/modified';
|
|
8
13
|
import fixtureNoTitle from './fixtures/no-title';
|
|
@@ -15,6 +20,11 @@ test('Atom › AtomInputSwitch > should have valid propTypes', t => {
|
|
|
15
20
|
});
|
|
16
21
|
});
|
|
17
22
|
test('Atom › AtomInputSwitch › Checked › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureChecked);
|
|
23
|
+
test('Atom › AtomInputSwitch › CmLeft › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureCmLeft);
|
|
24
|
+
test('Atom › AtomInputSwitch › CmRightChecked › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureCmRightChecked);
|
|
25
|
+
test('Atom › AtomInputSwitch › CmRightDisabled › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureCmRightDisabled);
|
|
26
|
+
test('Atom › AtomInputSwitch › CmRightModified › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureCmRightModified);
|
|
27
|
+
test('Atom › AtomInputSwitch › CmRight › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureCmRight);
|
|
18
28
|
test('Atom › AtomInputSwitch › Disabled › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureDisabled);
|
|
19
29
|
test('Atom › AtomInputSwitch › Modified › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureModified);
|
|
20
30
|
test('Atom › AtomInputSwitch › NoTitle › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureNoTitle);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/input-switch/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomInputSwitch","fixtureChecked","fixtureDisabled","fixtureModified","fixtureNoTitle","fixtureSso","fixtureUnchecked","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,eAAP,MAA4B,IAA5B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,cAAP,MAA2B,qBAA3B;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/input-switch/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomInputSwitch","fixtureChecked","fixtureCmLeft","fixtureCmRightChecked","fixtureCmRightDisabled","fixtureCmRightModified","fixtureCmRight","fixtureDisabled","fixtureModified","fixtureNoTitle","fixtureSso","fixtureUnchecked","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,eAAP,MAA4B,IAA5B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,aAAP,MAA0B,oBAA1B;AACA,OAAOC,qBAAP,MAAkC,6BAAlC;AACA,OAAOC,sBAAP,MAAmC,8BAAnC;AACA,OAAOC,sBAAP,MAAmC,8BAAnC;AACA,OAAOC,cAAP,MAA2B,qBAA3B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,cAAP,MAA2B,qBAA3B;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AAEAd,IAAI,CAAC,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helpers/render-component';\nimport AtomInputSwitch from '..';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureCmLeft from './fixtures/cm-left';\nimport fixtureCmRightChecked from './fixtures/cm-right-checked';\nimport fixtureCmRightDisabled from './fixtures/cm-right-disabled';\nimport fixtureCmRightModified from './fixtures/cm-right-modified';\nimport fixtureCmRight from './fixtures/cm-right';\nimport fixtureDisabled from './fixtures/disabled';\nimport fixtureModified from './fixtures/modified';\nimport fixtureNoTitle from './fixtures/no-title';\nimport fixtureSso from './fixtures/sso';\nimport fixtureUnchecked from './fixtures/unchecked';\n\ntest('Atom › AtomInputSwitch > should have valid propTypes', t => {\n t.pass();\n forEach(AtomInputSwitch.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomInputSwitch.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomInputSwitch › Checked › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureChecked);\ntest('Atom › AtomInputSwitch › CmLeft › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureCmLeft);\ntest('Atom › AtomInputSwitch › CmRightChecked › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureCmRightChecked);\ntest('Atom › AtomInputSwitch › CmRightDisabled › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureCmRightDisabled);\ntest('Atom › AtomInputSwitch › CmRightModified › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureCmRightModified);\ntest('Atom › AtomInputSwitch › CmRight › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureCmRight);\ntest('Atom › AtomInputSwitch › Disabled › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureDisabled);\ntest('Atom › AtomInputSwitch › Modified › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureModified);\ntest('Atom › AtomInputSwitch › NoTitle › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureNoTitle);\ntest('Atom › AtomInputSwitch › Sso › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureSso);\ntest('Atom › AtomInputSwitch › Unchecked › should be rendered', renderComponentMacro, AtomInputSwitch, fixtureUnchecked);\n"],"file":"fixtures.js"}
|
|
@@ -3,33 +3,91 @@
|
|
|
3
3
|
@value colors: "../../variables/colors.css";
|
|
4
4
|
@value white from colors;
|
|
5
5
|
|
|
6
|
-
.
|
|
6
|
+
.default {
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-wrap: wrap;
|
|
9
9
|
justify-content: center;
|
|
10
|
-
padding: 12px 12px 0;
|
|
11
10
|
width: 100%;
|
|
12
11
|
font-family: 'Open Sans';
|
|
13
12
|
box-sizing: border-box;
|
|
14
13
|
text-align: center;
|
|
15
14
|
color: white;
|
|
16
15
|
text-transform: uppercase;
|
|
17
|
-
font-size: 12px;
|
|
18
16
|
text-shadow: 0 0 4px rgba(0, 0, 0, 0.75);
|
|
19
17
|
user-select: none;
|
|
20
18
|
}
|
|
21
19
|
|
|
20
|
+
.customer[disabled] {
|
|
21
|
+
background: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.content {
|
|
25
|
+
composes: default;
|
|
26
|
+
padding: 12px 12px 0;
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.coorpmanager .content {
|
|
31
|
+
padding: 8px 12px 0;
|
|
32
|
+
font-size: 8px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.customer {
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 0;
|
|
38
|
+
left: 0;
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.customer {
|
|
44
|
+
background: linear-gradient(
|
|
45
|
+
to bottom,
|
|
46
|
+
rgba(0, 0, 0, 0.2) 0%,
|
|
47
|
+
rgba(0, 0, 0, 0) 20%
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
.chapterCustomer {
|
|
51
|
+
padding-top: 10px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.coorpmanager.customer.chapterCustomer {
|
|
55
|
+
padding-top: 0px;
|
|
56
|
+
}
|
|
57
|
+
|
|
22
58
|
.coorp,
|
|
23
59
|
.original {
|
|
24
60
|
letter-spacing: 3px;
|
|
25
61
|
}
|
|
26
62
|
|
|
63
|
+
.coorpmanager .coorp {
|
|
64
|
+
letter-spacing: 2px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.coorpmanager.customer.chapterCustomer .coorp {
|
|
68
|
+
letter-spacing: 1px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.coorpmanager .original {
|
|
72
|
+
letter-spacing: 2px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.coorpmanager.customer.chapterCustomer .original {
|
|
76
|
+
letter-spacing: 1px;
|
|
77
|
+
}
|
|
78
|
+
|
|
27
79
|
.coorp {
|
|
28
80
|
font-weight: 100;
|
|
29
81
|
margin-right: 5px;
|
|
30
82
|
letter-spacing: 4px;
|
|
31
83
|
}
|
|
32
84
|
|
|
85
|
+
.coorpmanager .coorp {
|
|
86
|
+
font-weight: 100;
|
|
87
|
+
margin-right: 5px;
|
|
88
|
+
letter-spacing: 2px;
|
|
89
|
+
}
|
|
90
|
+
|
|
33
91
|
.original {
|
|
34
92
|
font-weight: 600;
|
|
35
93
|
}
|
|
@@ -1,15 +1,25 @@
|
|
|
1
|
+
import _keys from "lodash/fp/keys";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
4
|
+
import classnames from 'classnames';
|
|
3
5
|
import style from './customer.css';
|
|
6
|
+
export const THEMES = {
|
|
7
|
+
default: null,
|
|
8
|
+
coorpmanager: style.coorpmanager
|
|
9
|
+
};
|
|
4
10
|
|
|
5
11
|
const Customer = props => {
|
|
6
12
|
const {
|
|
7
13
|
name,
|
|
8
|
-
|
|
9
|
-
coorpOriginal
|
|
14
|
+
type,
|
|
15
|
+
coorpOriginal,
|
|
16
|
+
theme,
|
|
17
|
+
disabled = false
|
|
10
18
|
} = props;
|
|
19
|
+
const className = classnames(THEMES[theme], style.customer, type === 'chapter' ? style.chapterCustomer : null);
|
|
11
20
|
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
-
className: className
|
|
21
|
+
className: className,
|
|
22
|
+
disabled: disabled
|
|
13
23
|
}, /*#__PURE__*/React.createElement("div", {
|
|
14
24
|
className: style.content
|
|
15
25
|
}, coorpOriginal ? /*#__PURE__*/React.createElement("span", {
|
|
@@ -20,9 +30,11 @@ const Customer = props => {
|
|
|
20
30
|
};
|
|
21
31
|
|
|
22
32
|
Customer.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
23
|
-
|
|
33
|
+
theme: PropTypes.oneOf(_keys(THEMES)),
|
|
34
|
+
type: PropTypes.string,
|
|
24
35
|
name: PropTypes.string,
|
|
25
|
-
coorpOriginal: PropTypes.bool.isRequired
|
|
36
|
+
coorpOriginal: PropTypes.bool.isRequired,
|
|
37
|
+
disabled: PropTypes.bool
|
|
26
38
|
} : {};
|
|
27
39
|
export default Customer;
|
|
28
40
|
//# sourceMappingURL=customer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/card/customer.js"],"names":["React","PropTypes","style","Customer","props","name","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/card/customer.js"],"names":["React","PropTypes","classnames","style","THEMES","default","coorpmanager","Customer","props","name","type","coorpOriginal","theme","disabled","className","customer","chapterCustomer","content","coorp","original","propTypes","oneOf","string","bool","isRequired"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,KAAP,MAAkB,gBAAlB;AAEA,OAAO,MAAMC,MAAM,GAAG;AACpBC,EAAAA,OAAO,EAAE,IADW;AAEpBC,EAAAA,YAAY,EAAEH,KAAK,CAACG;AAFA,CAAf;;AAKP,MAAMC,QAAQ,GAAGC,KAAK,IAAI;AACxB,QAAM;AAACC,IAAAA,IAAD;AAAOC,IAAAA,IAAP;AAAaC,IAAAA,aAAb;AAA4BC,IAAAA,KAA5B;AAAmCC,IAAAA,QAAQ,GAAG;AAA9C,MAAuDL,KAA7D;AACA,QAAMM,SAAS,GAAGZ,UAAU,CAC1BE,MAAM,CAACQ,KAAD,CADoB,EAE1BT,KAAK,CAACY,QAFoB,EAG1BL,IAAI,KAAK,SAAT,GAAqBP,KAAK,CAACa,eAA3B,GAA6C,IAHnB,CAA5B;AAMA,sBACE;AAAK,IAAA,SAAS,EAAEF,SAAhB;AAA2B,IAAA,QAAQ,EAAED;AAArC,kBACE;AAAK,IAAA,SAAS,EAAEV,KAAK,CAACc;AAAtB,KACGN,aAAa,gBAAG;AAAM,IAAA,SAAS,EAAER,KAAK,CAACe;AAAvB,cAAH,GAAiD,IADjE,EAEGP,aAAa,gBAAG;AAAM,IAAA,SAAS,EAAER,KAAK,CAACgB;AAAvB,iBAAH,GAAuD,IAFvE,EAGG,CAACR,aAAD,IAAkBF,IAHrB,CADF,CADF;AASD,CAjBD;;AAmBAF,QAAQ,CAACa,SAAT,2CAAqB;AACnBR,EAAAA,KAAK,EAAEX,SAAS,CAACoB,KAAV,CAAgB,MAAKjB,MAAL,CAAhB,CADY;AAEnBM,EAAAA,IAAI,EAAET,SAAS,CAACqB,MAFG;AAGnBb,EAAAA,IAAI,EAAER,SAAS,CAACqB,MAHG;AAInBX,EAAAA,aAAa,EAAEV,SAAS,CAACsB,IAAV,CAAeC,UAJX;AAKnBX,EAAAA,QAAQ,EAAEZ,SAAS,CAACsB;AALD,CAArB;AAQA,eAAehB,QAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport style from './customer.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst Customer = props => {\n const {name, type, coorpOriginal, theme, disabled = false} = props;\n const className = classnames(\n THEMES[theme],\n style.customer,\n type === 'chapter' ? style.chapterCustomer : null\n );\n\n return (\n <div className={className} disabled={disabled}>\n <div className={style.content}>\n {coorpOriginal ? <span className={style.coorp}>Coorp </span> : null}\n {coorpOriginal ? <span className={style.original}>Original </span> : null}\n {!coorpOriginal && name}\n </div>\n </div>\n );\n};\n\nCustomer.propTypes = {\n theme: PropTypes.oneOf(keys(THEMES)),\n type: PropTypes.string,\n name: PropTypes.string,\n coorpOriginal: PropTypes.bool.isRequired,\n disabled: PropTypes.bool\n};\n\nexport default Customer;\n"],"file":"customer.js"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _keys from "lodash/fp/keys";
|
|
1
2
|
import _pick from "lodash/fp/pick";
|
|
2
3
|
import _isUndefined from "lodash/fp/isUndefined";
|
|
3
4
|
import _isEmpty from "lodash/fp/isEmpty";
|
|
@@ -17,6 +18,10 @@ import Favorite from './favorite';
|
|
|
17
18
|
import Selectable from './selectable';
|
|
18
19
|
import Notification from './notification';
|
|
19
20
|
import style from './style.css';
|
|
21
|
+
export const THEMES = {
|
|
22
|
+
default: null,
|
|
23
|
+
coorpmanager: style.coorpmanager
|
|
24
|
+
};
|
|
20
25
|
|
|
21
26
|
const CardBackground = ({
|
|
22
27
|
type,
|
|
@@ -120,7 +125,8 @@ const Card = memo(function Card(props, context) {
|
|
|
120
125
|
isSelected,
|
|
121
126
|
notification,
|
|
122
127
|
badgeCategory,
|
|
123
|
-
badgeLabel
|
|
128
|
+
badgeLabel,
|
|
129
|
+
theme = 'default'
|
|
124
130
|
} = props;
|
|
125
131
|
|
|
126
132
|
const empty = _isEmpty(_pick(['title', 'type', 'author', 'image'], props));
|
|
@@ -129,7 +135,7 @@ const Card = memo(function Card(props, context) {
|
|
|
129
135
|
|
|
130
136
|
const whiteColor = _get('common.white', skin);
|
|
131
137
|
|
|
132
|
-
const cardStyle = classnames(type === 'chapter' ? style.chapter : style.course, title ? null : style.lazy, style.grid, empty ? style.empty : null);
|
|
138
|
+
const cardStyle = classnames(THEMES[theme], type === 'chapter' ? style.chapter : style.course, title ? null : style.lazy, style.grid, empty ? style.empty : null);
|
|
133
139
|
const handleClick = useMemo(() => e => !disabled && onClick(e), [disabled, onClick]);
|
|
134
140
|
const lock = disabled ? /*#__PURE__*/React.createElement(LockIcon, {
|
|
135
141
|
className: style.lockIcon,
|
|
@@ -174,7 +180,9 @@ const Card = memo(function Card(props, context) {
|
|
|
174
180
|
}) : null, /*#__PURE__*/React.createElement(Selectable, {
|
|
175
181
|
isSelected: isSelected
|
|
176
182
|
}), notification ? /*#__PURE__*/React.createElement(Notification, notification) : null, customer ? /*#__PURE__*/React.createElement(Customer, _extends({}, customer, {
|
|
177
|
-
|
|
183
|
+
theme: theme,
|
|
184
|
+
type: type,
|
|
185
|
+
disabled: disabled
|
|
178
186
|
})) : null, /*#__PURE__*/React.createElement(CardContentInfo, {
|
|
179
187
|
mode: MODES.CARD,
|
|
180
188
|
adaptiv: adaptiv,
|
|
@@ -186,7 +194,8 @@ const Card = memo(function Card(props, context) {
|
|
|
186
194
|
title: title,
|
|
187
195
|
type: type,
|
|
188
196
|
badgeCategory: badgeCategory,
|
|
189
|
-
badgeLabel: badgeLabel
|
|
197
|
+
badgeLabel: badgeLabel,
|
|
198
|
+
theme: theme
|
|
190
199
|
}), badge ? /*#__PURE__*/React.createElement("div", {
|
|
191
200
|
className: style.badge,
|
|
192
201
|
style: inlineBadgeStyle
|
|
@@ -216,7 +225,8 @@ Card.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
216
225
|
isSelected: PropTypes.bool,
|
|
217
226
|
notification: PropTypes.shape(Notification.propTypes),
|
|
218
227
|
badgeCategory: CardContentInfo.propTypes.badgeCategory,
|
|
219
|
-
badgeLabel: CardContentInfo.propTypes.badgeLabel
|
|
228
|
+
badgeLabel: CardContentInfo.propTypes.badgeLabel,
|
|
229
|
+
theme: PropTypes.oneOf(_keys(THEMES))
|
|
220
230
|
} : {};
|
|
221
231
|
export default Card;
|
|
222
232
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/card/index.js"],"names":["React","useMemo","memo","PropTypes","classnames","NovaSolidLoginLocked","LockIcon","NovaCompositionCoorpacademyPictures","PicturesIcon","isExternalContent","EXTERNAL_CONTENT_ICONS","Provider","CardContentInfo","MODES","Customer","Favorite","Selectable","Notification","style","CardBackground","type","image","empty","skin","externalContent","primaryColor","whiteColor","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","childContextTypes","propTypes","string","bool","Card","props","context","badge","adaptiv","disabled","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","cardStyle","chapter","course","lazy","grid","handleClick","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","chapterCustomer","CARD","lockWrapper","shape","number","func"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,IAAxB,QAAmC,OAAnC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,oBAAoB,IAAIC,QAD1B,EAEEC,mCAAmC,IAAIC,YAFzC,QAGO,0BAHP;AAIA,SAAQC,iBAAR,EAA2BC,sBAA3B,QAAwD,6BAAxD;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,eAAP,IAAyBC,KAAzB,QAAqC,iBAArC;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc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EAAAA,QAAQ,EAAEtD,SAAS,CAACiF,KAAV,CAAgBtE,QAAQ,CAACgC,SAAzB,CATK;AAUfa,EAAAA,QAAQ,EAAExD,SAAS,CAACkF,MAVL;AAWfzB,EAAAA,QAAQ,EAAEzD,SAAS,CAAC6C,IAXL;AAYfa,EAAAA,kBAAkB,EAAE1D,SAAS,CAAC4C,MAZf;AAafe,EAAAA,qBAAqB,EAAE3D,SAAS,CAAC4C,MAblB;AAcfgB,EAAAA,OAAO,EAAE5D,SAAS,CAACmF,IAdJ;AAeftB,EAAAA,eAAe,EAAE7D,SAAS,CAACmF,IAfZ;AAgBfrB,EAAAA,UAAU,EAAE9D,SAAS,CAAC6C,IAhBP;AAiBfkB,EAAAA,YAAY,EAAE/D,SAAS,CAACiF,KAAV,CAAgBnE,YAAY,CAAC6B,SAA7B,CAjBC;AAkBfqB,EAAAA,aAAa,EAAEvD,eAAe,CAACkC,SAAhB,CAA0BqB,aAlB1B;AAmBfC,EAAAA,UAAU,EAAExD,eAAe,CAACkC,SAAhB,CAA0BsB;AAnBvB,CAAjB;AAqBA,eAAenB,IAAf","sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick} from 'lodash/fp';\nimport {\n NovaSolidLoginLocked as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nconst CardBackground = ({type, image, empty}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? <PicturesIcon className={style.emptyIcon} color={whiteColor} /> : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n const cardStyle = classnames(\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const handleClick = useMemo(() => e => !disabled && onClick(e), [disabled, onClick]);\n const lock = disabled ? (\n <LockIcon className={style.lockIcon} color={whiteColor} height={40} />\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n >\n <CardBackground type={type} image={image} empty={empty} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n />\n ) : null}\n <Selectable isSelected={isSelected} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n className={classnames(style.customer, type === 'chapter' ? style.chapterCustomer : null)}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle}>\n {badge}\n </div>\n ) : null}\n {disabled ? <div className={style.lockWrapper}>{lock}</div> : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCard.propTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel\n};\nexport default Card;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/card/index.js"],"names":["React","useMemo","memo","PropTypes","classnames","NovaSolidLoginLocked","LockIcon","NovaCompositionCoorpacademyPictures","PicturesIcon","isExternalContent","EXTERNAL_CONTENT_ICONS","Provider","CardContentInfo","MODES","Customer","Favorite","Selectable","Notification","style","THEMES","default","coorpmanager","CardBackground","type","image","empty","skin","externalContent","primaryColor","whiteColor","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","childContextTypes","propTypes","string","bool","Card","props","context","badge","adaptiv","disabled","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","cardStyle","chapter","course","lazy","grid","handleClick","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","CARD","lockWrapper","shape","number","func","oneOf"],"mappings":";;;;;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,IAAxB,QAAmC,OAAnC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,oBAAoB,IAAIC,QAD1B,EAEEC,mCAAmC,IAAIC,YAFzC,QAGO,0BAHP;AAIA,SAAQC,iBAAR,EAA2BC,sBAA3B,QAAwD,6BAAxD;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,eAAP,IAAy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 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaSolidLoginLocked as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst CardBackground = ({type, image, empty}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? <PicturesIcon className={style.emptyIcon} color={whiteColor} /> : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default'\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n const cardStyle = classnames(\n THEMES[theme],\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const handleClick = useMemo(() => e => !disabled && onClick(e), [disabled, onClick]);\n const lock = disabled ? (\n <LockIcon className={style.lockIcon} color={whiteColor} height={40} />\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n >\n <CardBackground type={type} image={image} empty={empty} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n />\n ) : null}\n <Selectable isSelected={isSelected} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? <Customer {...customer} theme={theme} type={type} disabled={disabled} /> : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle}>\n {badge}\n </div>\n ) : null}\n {disabled ? <div className={style.lockWrapper}>{lock}</div> : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCard.propTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES))\n};\nexport default Card;\n"],"file":"index.js"}
|
|
@@ -36,25 +36,6 @@
|
|
|
36
36
|
z-index: 0;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.customer {
|
|
40
|
-
position: absolute;
|
|
41
|
-
top: 0;
|
|
42
|
-
left: 0;
|
|
43
|
-
width: 100%;
|
|
44
|
-
height: 100%;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.customer {
|
|
48
|
-
background: linear-gradient(
|
|
49
|
-
to bottom,
|
|
50
|
-
rgba(0, 0, 0, 0.2) 0%,
|
|
51
|
-
rgba(0, 0, 0, 0) 20%
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
.chapterCustomer {
|
|
55
|
-
padding-top: 10px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
39
|
.grid.empty {
|
|
59
40
|
padding-bottom: 25px;
|
|
60
41
|
opacity: 0.6;
|
|
@@ -66,6 +47,7 @@
|
|
|
66
47
|
width: 256px;
|
|
67
48
|
height: 297px;
|
|
68
49
|
}
|
|
50
|
+
|
|
69
51
|
.chapter {
|
|
70
52
|
composes: default;
|
|
71
53
|
border-radius: 8px;
|
|
@@ -73,6 +55,18 @@
|
|
|
73
55
|
height: 297px;
|
|
74
56
|
}
|
|
75
57
|
|
|
58
|
+
.coorpmanager.course {
|
|
59
|
+
border-radius: 5px;
|
|
60
|
+
width: 172px;
|
|
61
|
+
height: 201px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.coorpmanager.chapter {
|
|
65
|
+
border-radius: 5px;
|
|
66
|
+
width: 138px;
|
|
67
|
+
height: 201px;
|
|
68
|
+
}
|
|
69
|
+
|
|
76
70
|
.course .imageWrapper {
|
|
77
71
|
width: 100%;
|
|
78
72
|
height: 100%;
|
|
@@ -89,6 +83,10 @@
|
|
|
89
83
|
left: 0;
|
|
90
84
|
}
|
|
91
85
|
|
|
86
|
+
.coorpmanager.chapter .chapterImageWrapper {
|
|
87
|
+
max-height: 52px;
|
|
88
|
+
}
|
|
89
|
+
|
|
92
90
|
.default .image {
|
|
93
91
|
overflow: hidden;
|
|
94
92
|
background-position: 50%;
|
|
@@ -218,10 +216,6 @@
|
|
|
218
216
|
left: 0;
|
|
219
217
|
}
|
|
220
218
|
|
|
221
|
-
.default[disabled] .customer {
|
|
222
|
-
background: none;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
219
|
.badge {
|
|
226
220
|
position: absolute;
|
|
227
221
|
width: auto;
|
|
@@ -239,6 +233,11 @@
|
|
|
239
233
|
user-select: none;
|
|
240
234
|
}
|
|
241
235
|
|
|
236
|
+
.coorpmanager .badge {
|
|
237
|
+
padding: 2px 5px;
|
|
238
|
+
font-size: 7px;
|
|
239
|
+
}
|
|
240
|
+
|
|
242
241
|
.emptyIcon {
|
|
243
242
|
vertical-align: middle;
|
|
244
243
|
width: 80px;
|
|
@@ -295,11 +294,24 @@
|
|
|
295
294
|
}
|
|
296
295
|
|
|
297
296
|
.externalIconCircleWrapper {
|
|
297
|
+
border-radius: 50%;
|
|
298
|
+
padding: 17px;
|
|
299
|
+
box-sizing: border-box;
|
|
300
|
+
background-color: rgba(255, 255, 255, 0.3);
|
|
301
|
+
justify-content: center;
|
|
302
|
+
transform: scale(1);
|
|
303
|
+
transition: transform 0.25s ease-in-out;
|
|
298
304
|
width: 80px;
|
|
299
305
|
height: 80px;
|
|
300
306
|
margin-top: 20px;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.coorpmanager .externalIconCircleWrapper {
|
|
310
|
+
width: 50px;
|
|
311
|
+
height: 50px;
|
|
312
|
+
margin-top: 12px;
|
|
313
|
+
padding: 13px;
|
|
301
314
|
border-radius: 50%;
|
|
302
|
-
padding: 17px;
|
|
303
315
|
box-sizing: border-box;
|
|
304
316
|
background-color: rgba(255, 255, 255, 0.3);
|
|
305
317
|
justify-content: center;
|
|
@@ -313,6 +325,12 @@
|
|
|
313
325
|
height: 45px;
|
|
314
326
|
}
|
|
315
327
|
|
|
328
|
+
.coorpmanager .externalIcon {
|
|
329
|
+
color: white;
|
|
330
|
+
width: 23px;
|
|
331
|
+
height: 23px;
|
|
332
|
+
}
|
|
333
|
+
|
|
316
334
|
.externalIconCircleWrapper::after {
|
|
317
335
|
animation: pulse 3s linear 0s infinite;
|
|
318
336
|
animation-play-state: paused;
|
|
@@ -343,6 +361,18 @@
|
|
|
343
361
|
transition: box-shadow 0.25s linear;
|
|
344
362
|
}
|
|
345
363
|
|
|
364
|
+
.coorpmanager .externalIconCircleWrapper::after,
|
|
365
|
+
.coorpmanager .externalIconCircleWrapper::before {
|
|
366
|
+
width: 50px;
|
|
367
|
+
height: 50px;
|
|
368
|
+
top: 0;
|
|
369
|
+
left: 0;
|
|
370
|
+
transform: scale(1);
|
|
371
|
+
opacity: 0;
|
|
372
|
+
box-shadow: inset 0 0 7px 0 rgba(255, 255, 255, 0);
|
|
373
|
+
transition: box-shadow 0.25s linear;
|
|
374
|
+
}
|
|
375
|
+
|
|
346
376
|
.externalIconCircleWithImageWrapper {
|
|
347
377
|
width: 60px;
|
|
348
378
|
height: 60px;
|
|
@@ -350,6 +380,22 @@
|
|
|
350
380
|
z-index: 1;
|
|
351
381
|
}
|
|
352
382
|
|
|
383
|
+
.coorpmanager .externalIconCircleWithImageWrapper {
|
|
384
|
+
width: 50px;
|
|
385
|
+
height: 50px;
|
|
386
|
+
border-radius: 50%;
|
|
387
|
+
padding: 12px;
|
|
388
|
+
z-index: 1;
|
|
389
|
+
margin-top: 20px;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.coorpmanager .externalIconWithImage {
|
|
393
|
+
color: white;
|
|
394
|
+
width: 25px;
|
|
395
|
+
height: 25px;
|
|
396
|
+
padding: 0 0 0 1px;
|
|
397
|
+
}
|
|
398
|
+
|
|
353
399
|
.externalIconWithImage {
|
|
354
400
|
color: white;
|
|
355
401
|
width: 28px;
|
|
@@ -372,6 +418,22 @@
|
|
|
372
418
|
transition: box-shadow 0.25s linear;
|
|
373
419
|
}
|
|
374
420
|
|
|
421
|
+
.coorpmanager .externalIconCircleWithImageWrapper::after,
|
|
422
|
+
.coorpmanager .externalIconCircleWithImageWrapper::before {
|
|
423
|
+
content: '';
|
|
424
|
+
width: 50px;
|
|
425
|
+
height: 50px;
|
|
426
|
+
top: 0;
|
|
427
|
+
left: 0;
|
|
428
|
+
position: absolute;
|
|
429
|
+
transform: scale(1);
|
|
430
|
+
opacity: 0;
|
|
431
|
+
box-shadow: inset 0 0 7px 0 rgba(255, 255, 255, 0);
|
|
432
|
+
transition: box-shadow 0.25s linear;
|
|
433
|
+
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
|
|
375
437
|
@keyframes pulse {
|
|
376
438
|
0% {
|
|
377
439
|
transform: scale(1);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _defaultsDeep from "lodash/fp/defaultsDeep";
|
|
2
|
+
import Default from './default';
|
|
3
|
+
const {
|
|
4
|
+
props
|
|
5
|
+
} = Default;
|
|
6
|
+
export default {
|
|
7
|
+
props: _defaultsDeep(props, {
|
|
8
|
+
disabled: false,
|
|
9
|
+
type: 'course',
|
|
10
|
+
image: 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/CoorpAcademy/content-marmiton/cockpit-marmiton/cover/shutterstock_520965634-1491986518210.jpg&h=500&w=500&q=90',
|
|
11
|
+
progress: 0.1,
|
|
12
|
+
isSelected: false,
|
|
13
|
+
badgeCategory: 'base',
|
|
14
|
+
badgeLabel: 'basic',
|
|
15
|
+
theme: 'coorpmanager'
|
|
16
|
+
})
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=coorpmanager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/card/test/fixtures/coorpmanager.js"],"names":["Default","props","disabled","type","image","progress","isSelected","badgeCategory","badgeLabel","theme"],"mappings":";AACA,OAAOA,OAAP,MAAoB,WAApB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,OAAhB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE,cAAaA,KAAb,EAAoB;AACzBC,IAAAA,QAAQ,EAAE,KADe;AAEzBC,IAAAA,IAAI,EAAE,QAFmB;AAGzBC,IAAAA,KAAK,EACH,4MAJuB;AAKzBC,IAAAA,QAAQ,EAAE,GALe;AAMzBC,IAAAA,UAAU,EAAE,KANa;AAOzBC,IAAAA,aAAa,EAAE,MAPU;AAQzBC,IAAAA,UAAU,EAAE,OARa;AASzBC,IAAAA,KAAK,EAAE;AATkB,GAApB;AADM,CAAf","sourcesContent":["import {defaultsDeep} from 'lodash/fp';\nimport Default from './default';\n\nconst {props} = Default;\n\nexport default {\n props: defaultsDeep(props, {\n disabled: false,\n type: 'course',\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/CoorpAcademy/content-marmiton/cockpit-marmiton/cover/shutterstock_520965634-1491986518210.jpg&h=500&w=500&q=90',\n progress: 0.1,\n isSelected: false,\n badgeCategory: 'base',\n badgeLabel: 'basic',\n theme: 'coorpmanager'\n })\n};\n"],"file":"coorpmanager.js"}
|
|
@@ -6,6 +6,7 @@ import fixtureAdaptivAndDisabled from './fixtures/adaptiv-and-disabled';
|
|
|
6
6
|
import fixtureAdaptiv from './fixtures/adaptiv';
|
|
7
7
|
import fixtureArabic from './fixtures/arabic';
|
|
8
8
|
import fixtureArticle from './fixtures/article';
|
|
9
|
+
import fixtureCoorpmanager from './fixtures/coorpmanager';
|
|
9
10
|
import fixtureDefault from './fixtures/default';
|
|
10
11
|
import fixtureDisabled from './fixtures/disabled';
|
|
11
12
|
import fixtureEmpty from './fixtures/empty';
|
|
@@ -28,6 +29,7 @@ test('Molecule › MoleculeCard › AdaptivAndDisabled › should be rendered',
|
|
|
28
29
|
test('Molecule › MoleculeCard › Adaptiv › should be rendered', renderComponentMacro, MoleculeCard, fixtureAdaptiv);
|
|
29
30
|
test('Molecule › MoleculeCard › Arabic › should be rendered', renderComponentMacro, MoleculeCard, fixtureArabic);
|
|
30
31
|
test('Molecule › MoleculeCard › Article › should be rendered', renderComponentMacro, MoleculeCard, fixtureArticle);
|
|
32
|
+
test('Molecule › MoleculeCard › Coorpmanager › should be rendered', renderComponentMacro, MoleculeCard, fixtureCoorpmanager);
|
|
31
33
|
test('Molecule › MoleculeCard › Default › should be rendered', renderComponentMacro, MoleculeCard, fixtureDefault);
|
|
32
34
|
test('Molecule › MoleculeCard › Disabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureDisabled);
|
|
33
35
|
test('Molecule › MoleculeCard › Empty › should be rendered', renderComponentMacro, MoleculeCard, fixtureEmpty);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/card/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCard","fixtureAdaptivAndDisabled","fixtureAdaptiv","fixtureArabic","fixtureArticle","fixtureDefault","fixtureDisabled","fixtureEmpty","fixtureExternalContent","fixtureFavorite","fixtureFreerunAndDisabled","fixtureFreerun","fixturePodcast","fixtureScorm","fixtureSelectableFalse","fixtureSelectableTrue","fixtureVideo","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,YAAP,MAAyB,IAAzB;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,OAAOC,YAAP,MAAyB,kBAAzB;
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/card/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCard","fixtureAdaptivAndDisabled","fixtureAdaptiv","fixtureArabic","fixtureArticle","fixtureCoorpmanager","fixtureDefault","fixtureDisabled","fixtureEmpty","fixtureExternalContent","fixtureFavorite","fixtureFreerunAndDisabled","fixtureFreerun","fixturePodcast","fixtureScorm","fixtureSelectableFalse","fixtureSelectableTrue","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forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCard from '..';\nimport fixtureAdaptivAndDisabled from './fixtures/adaptiv-and-disabled';\nimport fixtureAdaptiv from './fixtures/adaptiv';\nimport fixtureArabic from './fixtures/arabic';\nimport fixtureArticle from './fixtures/article';\nimport fixtureCoorpmanager from './fixtures/coorpmanager';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDisabled from './fixtures/disabled';\nimport fixtureEmpty from './fixtures/empty';\nimport fixtureExternalContent from './fixtures/external-content';\nimport fixtureFavorite from './fixtures/favorite';\nimport fixtureFreerunAndDisabled from './fixtures/freerun-and-disabled';\nimport fixtureFreerun from './fixtures/freerun';\nimport fixturePodcast from './fixtures/podcast';\nimport fixtureScorm from './fixtures/scorm';\nimport fixtureSelectableFalse from './fixtures/selectable-false';\nimport fixtureSelectableTrue from './fixtures/selectable-true';\nimport fixtureVideo from './fixtures/video';\n\ntest('Molecule › MoleculeCard > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCard.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCard.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCard › AdaptivAndDisabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureAdaptivAndDisabled);\ntest('Molecule › MoleculeCard › Adaptiv › should be rendered', renderComponentMacro, MoleculeCard, fixtureAdaptiv);\ntest('Molecule › MoleculeCard › Arabic › should be rendered', renderComponentMacro, MoleculeCard, fixtureArabic);\ntest('Molecule › MoleculeCard › Article › should be rendered', renderComponentMacro, MoleculeCard, fixtureArticle);\ntest('Molecule › MoleculeCard › Coorpmanager › should be rendered', renderComponentMacro, MoleculeCard, fixtureCoorpmanager);\ntest('Molecule › MoleculeCard › Default › should be rendered', renderComponentMacro, MoleculeCard, fixtureDefault);\ntest('Molecule › MoleculeCard › Disabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureDisabled);\ntest('Molecule › MoleculeCard › Empty › should be rendered', renderComponentMacro, MoleculeCard, fixtureEmpty);\ntest('Molecule › MoleculeCard › ExternalContent › should be rendered', renderComponentMacro, MoleculeCard, fixtureExternalContent);\ntest('Molecule › MoleculeCard › Favorite › should be rendered', renderComponentMacro, MoleculeCard, fixtureFavorite);\ntest('Molecule › MoleculeCard › FreerunAndDisabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureFreerunAndDisabled);\ntest('Molecule › MoleculeCard › Freerun › should be rendered', renderComponentMacro, MoleculeCard, fixtureFreerun);\ntest('Molecule › MoleculeCard › Podcast › should be rendered', renderComponentMacro, MoleculeCard, fixturePodcast);\ntest('Molecule › MoleculeCard › Scorm › should be rendered', renderComponentMacro, MoleculeCard, fixtureScorm);\ntest('Molecule › MoleculeCard › SelectableFalse › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableFalse);\ntest('Molecule › MoleculeCard › SelectableTrue › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableTrue);\ntest('Molecule › MoleculeCard › Video › should be rendered', renderComponentMacro, MoleculeCard, fixtureVideo);\n"],"file":"fixtures.js"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _keys from "lodash/fp/keys";
|
|
1
2
|
import _isNil from "lodash/fp/isNil";
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
@@ -12,6 +13,10 @@ export const MODES = {
|
|
|
12
13
|
HERO: 'hero',
|
|
13
14
|
CARD: 'card'
|
|
14
15
|
};
|
|
16
|
+
export const THEMES = {
|
|
17
|
+
default: null,
|
|
18
|
+
coorpmanager: style.coorpmanager
|
|
19
|
+
};
|
|
15
20
|
|
|
16
21
|
const ContentTypeInfo = ({
|
|
17
22
|
mode,
|
|
@@ -30,8 +35,7 @@ const ContentTypeInfo = ({
|
|
|
30
35
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
36
|
className: style.microLearningIcon
|
|
32
37
|
}, /*#__PURE__*/React.createElement(TimerIcon, {
|
|
33
|
-
|
|
34
|
-
width: 40
|
|
38
|
+
className: style.timerIcon
|
|
35
39
|
}), /*#__PURE__*/React.createElement("span", {
|
|
36
40
|
className: style.microLearninglabel
|
|
37
41
|
}, "5' learning"));
|
|
@@ -117,7 +121,8 @@ const ContentInfo = ({
|
|
|
117
121
|
title,
|
|
118
122
|
type,
|
|
119
123
|
badgeCategory,
|
|
120
|
-
badgeLabel
|
|
124
|
+
badgeLabel,
|
|
125
|
+
theme = 'default'
|
|
121
126
|
}) => {
|
|
122
127
|
const progressBarColor = '#3EC483';
|
|
123
128
|
const inlineProgressValueStyle = {
|
|
@@ -141,7 +146,7 @@ const ContentInfo = ({
|
|
|
141
146
|
})) : null;
|
|
142
147
|
return /*#__PURE__*/React.createElement("div", {
|
|
143
148
|
"data-name": "info",
|
|
144
|
-
className: classnames(style.infoWrapper, mode === MODES.HERO ? style.hero : style.card, disabled ? style.progressBarDisabled : null, externalContent ? style.externalContent : null)
|
|
149
|
+
className: classnames(THEMES[theme], style.infoWrapper, mode === MODES.HERO ? style.hero : style.card, disabled ? style.progressBarDisabled : null, externalContent ? style.externalContent : null)
|
|
145
150
|
}, /*#__PURE__*/React.createElement(ContentTypeInfo, {
|
|
146
151
|
mode: mode,
|
|
147
152
|
type: type,
|
|
@@ -179,7 +184,8 @@ ContentInfo.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
179
184
|
type: PropTypes.string,
|
|
180
185
|
mode: PropTypes.string,
|
|
181
186
|
badgeCategory: ContentBadge.propTypes.category,
|
|
182
|
-
badgeLabel: ContentBadge.propTypes.label
|
|
187
|
+
badgeLabel: ContentBadge.propTypes.label,
|
|
188
|
+
theme: PropTypes.oneOf(_keys(THEMES))
|
|
183
189
|
} : {};
|
|
184
190
|
export default ContentInfo;
|
|
185
191
|
//# sourceMappingURL=index.js.map
|