@coorpacademy/components 10.5.7-alpha.6.5 → 10.6.0
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/select/index.js +41 -22
- package/es/atom/select/index.js.map +1 -1
- package/es/atom/select/style.css +190 -42
- package/es/atom/select/test/fixtures/player.js +11 -0
- package/es/atom/select/test/fixtures/player.js.map +1 -0
- package/es/atom/select/test/fixtures.js +2 -0
- package/es/atom/select/test/fixtures.js.map +1 -1
- package/es/atom/select/test/select.js +49 -0
- package/es/atom/select/test/select.js.map +1 -0
- package/es/molecule/card/customer.js +6 -3
- package/es/molecule/card/customer.js.map +1 -1
- package/es/molecule/card/favorite.js +13 -4
- package/es/molecule/card/favorite.js.map +1 -1
- package/es/molecule/card/index.js +41 -12
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/card/selectable.js +11 -4
- package/es/molecule/card/selectable.js.map +1 -1
- package/es/molecule/card/test/fixtures/default.js +20 -1
- package/es/molecule/card/test/fixtures/default.js.map +1 -1
- package/es/molecule/card-content/index.js +20 -7
- package/es/molecule/card-content/index.js.map +1 -1
- package/es/molecule/card-content/test/fixtures/card-no-progress-bar.js +6 -1
- package/es/molecule/card-content/test/fixtures/card-no-progress-bar.js.map +1 -1
- package/es/molecule/course-sections/test/fixtures.js +15 -0
- package/es/molecule/course-sections/test/fixtures.js.map +1 -0
- package/es/molecule/draggable-list/test/fixtures.js +15 -0
- package/es/molecule/draggable-list/test/fixtures.js.map +1 -0
- package/es/molecule/questions/drop-down/index.js +1 -6
- package/es/molecule/questions/drop-down/index.js.map +1 -1
- package/es/molecule/questions/free-text/index.js +35 -15
- package/es/molecule/questions/free-text/index.js.map +1 -1
- package/es/molecule/questions/free-text/style.css +39 -15
- package/es/molecule/questions/free-text/test/fixtures/default.js +1 -1
- package/es/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
- package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js +9 -0
- package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
- package/es/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
- package/es/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
- package/es/molecule/questions/free-text/test/fixtures.js +4 -2
- package/es/molecule/questions/free-text/test/fixtures.js.map +1 -1
- package/es/molecule/questions/free-text/test/free-text.js +106 -0
- package/es/molecule/questions/free-text/test/free-text.js.map +1 -0
- package/es/molecule/questions/qcm/style.css +4 -0
- package/es/molecule/questions/qcm-drag/index.js +53 -21
- package/es/molecule/questions/qcm-drag/index.js.map +1 -1
- package/es/molecule/questions/qcm-drag/style.css +72 -22
- package/es/molecule/questions/qcm-graphic/index.js +1 -0
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/style.css +12 -2
- package/es/molecule/questions/qcm-graphic/test/fixtures/default.js +1 -1
- package/es/molecule/questions/qcm-graphic/test/fixtures/default.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/test/fixtures/no-selected.js +1 -1
- package/es/molecule/questions/qcm-graphic/test/fixtures/no-selected.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js +1 -1
- package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -1
- package/es/molecule/questions/template/index.js +15 -11
- package/es/molecule/questions/template/index.js.map +1 -1
- package/es/molecule/questions/template/style.css +6 -0
- package/es/molecule/wizard-summary/test/fixtures.js +2 -0
- package/es/molecule/wizard-summary/test/fixtures.js.map +1 -1
- package/es/organism/wizard-contents/test/fixtures.js +2 -0
- package/es/organism/wizard-contents/test/fixtures.js.map +1 -1
- package/es/template/back-office/brand-update/test/fixtures.js +2 -0
- package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/es/variables/colors.css +2 -0
- package/lib/atom/select/index.js +43 -19
- package/lib/atom/select/index.js.map +1 -1
- package/lib/atom/select/style.css +190 -42
- package/lib/atom/select/test/fixtures/player.js +21 -0
- package/lib/atom/select/test/fixtures/player.js.map +1 -0
- package/lib/atom/select/test/fixtures.js +3 -0
- package/lib/atom/select/test/fixtures.js.map +1 -1
- package/lib/atom/select/test/select.js +62 -0
- package/lib/atom/select/test/select.js.map +1 -0
- package/lib/molecule/card/customer.js +6 -3
- package/lib/molecule/card/customer.js.map +1 -1
- package/lib/molecule/card/favorite.js +13 -4
- package/lib/molecule/card/favorite.js.map +1 -1
- package/lib/molecule/card/index.js +41 -12
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/card/selectable.js +11 -4
- package/lib/molecule/card/selectable.js.map +1 -1
- package/lib/molecule/card/test/fixtures/default.js +20 -1
- package/lib/molecule/card/test/fixtures/default.js.map +1 -1
- package/lib/molecule/card-content/index.js +21 -7
- package/lib/molecule/card-content/index.js.map +1 -1
- package/lib/molecule/card-content/test/fixtures/card-no-progress-bar.js +6 -1
- package/lib/molecule/card-content/test/fixtures/card-no-progress-bar.js.map +1 -1
- package/lib/molecule/course-sections/test/fixtures.js +25 -0
- package/lib/molecule/course-sections/test/fixtures.js.map +1 -0
- package/lib/molecule/draggable-list/test/fixtures.js +25 -0
- package/lib/molecule/draggable-list/test/fixtures.js.map +1 -0
- package/lib/molecule/questions/drop-down/index.js +1 -5
- package/lib/molecule/questions/drop-down/index.js.map +1 -1
- package/lib/molecule/questions/free-text/index.js +32 -14
- package/lib/molecule/questions/free-text/index.js.map +1 -1
- package/lib/molecule/questions/free-text/style.css +39 -15
- package/lib/molecule/questions/free-text/test/fixtures/default.js +1 -1
- package/lib/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
- package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js +14 -0
- package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
- package/lib/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
- package/lib/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
- package/lib/molecule/questions/free-text/test/fixtures.js +5 -2
- package/lib/molecule/questions/free-text/test/fixtures.js.map +1 -1
- package/lib/molecule/questions/free-text/test/free-text.js +119 -0
- package/lib/molecule/questions/free-text/test/free-text.js.map +1 -0
- package/lib/molecule/questions/qcm/style.css +4 -0
- package/lib/molecule/questions/qcm-drag/index.js +53 -21
- package/lib/molecule/questions/qcm-drag/index.js.map +1 -1
- package/lib/molecule/questions/qcm-drag/style.css +72 -22
- package/lib/molecule/questions/qcm-graphic/index.js +1 -0
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/style.css +12 -2
- package/lib/molecule/questions/qcm-graphic/test/fixtures/default.js +1 -1
- package/lib/molecule/questions/qcm-graphic/test/fixtures/default.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/test/fixtures/no-selected.js +1 -1
- package/lib/molecule/questions/qcm-graphic/test/fixtures/no-selected.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js +1 -1
- package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -1
- package/lib/molecule/questions/template/index.js +15 -11
- package/lib/molecule/questions/template/index.js.map +1 -1
- package/lib/molecule/questions/template/style.css +6 -0
- package/lib/molecule/wizard-summary/test/fixtures.js +3 -0
- package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -1
- package/lib/organism/wizard-contents/test/fixtures.js +3 -0
- package/lib/organism/wizard-contents/test/fixtures.js.map +1 -1
- package/lib/template/back-office/brand-update/test/fixtures.js +3 -0
- package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/lib/variables/colors.css +2 -0
- package/package.json +2 -2
- package/es/molecule/cockpit-popin/test/fixtures.js +0 -17
- package/es/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/es/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
- package/es/molecule/search/test/fixtures.js +0 -15
- package/es/molecule/search/test/fixtures.js.map +0 -1
- package/lib/molecule/cockpit-popin/test/fixtures.js +0 -28
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/lib/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
- package/lib/molecule/search/test/fixtures.js +0 -25
- package/lib/molecule/search/test/fixtures.js.map +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import browserEnv from 'browser-env';
|
|
4
|
+
import test from 'ava';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { mount, configure } from 'enzyme';
|
|
7
|
+
import cloneDeep from 'lodash/fp/cloneDeep';
|
|
8
|
+
import noop from 'lodash/fp/noop';
|
|
9
|
+
import Adapter from 'enzyme-adapter-react-16';
|
|
10
|
+
import Select from '..';
|
|
11
|
+
import playerFixture from './fixtures/player';
|
|
12
|
+
browserEnv();
|
|
13
|
+
configure({
|
|
14
|
+
adapter: new Adapter()
|
|
15
|
+
});
|
|
16
|
+
test('classnames: should pass the styles pertinent to a player theme, text color: use skin color (selected, valid option, player)', t => {
|
|
17
|
+
const wrapper = mount( /*#__PURE__*/React.createElement(Select, _extends({}, playerFixture.props, {
|
|
18
|
+
onChange: noop
|
|
19
|
+
})));
|
|
20
|
+
const selectWrapper = wrapper.find('[data-name="select-wrapper"]');
|
|
21
|
+
t.true(selectWrapper.at(0).exists()); // should use skin color
|
|
22
|
+
|
|
23
|
+
t.deepEqual(selectWrapper.at(0).props().style, {
|
|
24
|
+
color: '#00B0FF'
|
|
25
|
+
});
|
|
26
|
+
const selectSpan = selectWrapper.at(0).find('[data-name="select-span"]');
|
|
27
|
+
t.true(selectSpan.at(0).exists());
|
|
28
|
+
t.is(selectSpan.at(0).props().className, 'select__selectSpan select__noLabelCommon');
|
|
29
|
+
});
|
|
30
|
+
test('text color: should not use skin color (selected, invalid option, player), long label', t => {
|
|
31
|
+
const withInvalid = cloneDeep(playerFixture.props);
|
|
32
|
+
withInvalid.options[1] = {
|
|
33
|
+
name: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean.',
|
|
34
|
+
value: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean.',
|
|
35
|
+
selected: true,
|
|
36
|
+
validOption: false
|
|
37
|
+
};
|
|
38
|
+
const wrapper = mount( /*#__PURE__*/React.createElement(Select, _extends({}, withInvalid, {
|
|
39
|
+
onChange: noop
|
|
40
|
+
})));
|
|
41
|
+
const selectWrapper = wrapper.find('[data-name="select-wrapper"]');
|
|
42
|
+
t.true(selectWrapper.at(0).exists()); // should not use skin color
|
|
43
|
+
|
|
44
|
+
t.deepEqual(selectWrapper.at(0).props().style, {});
|
|
45
|
+
const selectSpan = selectWrapper.at(0).find('[data-name="select-span"]');
|
|
46
|
+
t.true(selectSpan.at(0).exists());
|
|
47
|
+
t.is(selectSpan.at(0).props().className, 'select__selectSpan select__noLabelCommon select__longLabel');
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/select/test/select.js"],"names":["browserEnv","test","React","mount","configure","cloneDeep","noop","Adapter","Select","playerFixture","adapter","t","wrapper","props","selectWrapper","find","true","at","exists","deepEqual","style","color","selectSpan","is","className","withInvalid","options","name","value","selected","validOption"],"mappings":";;AAAA,OAAOA,UAAP,MAAuB,aAAvB;AACA,OAAOC,IAAP,MAAiB,KAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,KAAR,EAAeC,SAAf,QAA+B,QAA/B;AACA,OAAOC,SAAP,MAAsB,qBAAtB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,OAAP,MAAoB,yBAApB;AACA,OAAOC,MAAP,MAAmB,IAAnB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AAEAT,UAAU;AACVI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AK,eAAC,oBAAC,MAAD,eAAYsB,WAAZ;AAAyB,IAAA,QAAQ,EAAEnB;AAAnC,KAAD,CAArB;AACA,QAAMQ,aAAa,GAAGF,OAAO,CAACG,IAAR,CAAa,8BAAb,CAAtB;AACAJ,EAAAA,CAAC,CAACK,IAAF,CAAOF,aAAa,CAACG,EAAd,CAAiB,CAAjB,EAAoBC,MAApB,EAAP,EAVgG,CAWhG;;AACAP,EAAAA,CAAC,CAACQ,SAAF,CAAYL,aAAa,CAACG,EAAd,CAAiB,CAAjB,EAAoBJ,KAApB,GAA4BO,KAAxC,EAA+C,EAA/C;AACA,QAAME,UAAU,GAAGR,aAAa,CAACG,EAAd,CAAiB,CAAjB,EAAoBF,IAApB,CAAyB,2BAAzB,CAAnB;AACAJ,EAAAA,CAAC,CAACK,IAAF,CAAOM,UAAU,CAACL,EAAX,CAAc,CAAd,EAAiBC,MAAjB,EAAP;AACAP,EAAAA,CAAC,CAACY,EAAF,CACED,UAAU,CAACL,EAAX,CAAc,CAAd,EAAiBJ,KAAjB,GAAyBW,SAD3B,EAEE,4DAFF;AAID,CAnBG,CAAJ","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {mount, configure} from 'enzyme';\nimport cloneDeep from 'lodash/fp/cloneDeep';\nimport noop from 'lodash/fp/noop';\nimport Adapter from 'enzyme-adapter-react-16';\nimport Select from '..';\nimport playerFixture from './fixtures/player';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\n\ntest('classnames: should pass the styles pertinent to a player theme, text color: use skin color (selected, valid option, player)', t => {\n const wrapper = mount(<Select {...playerFixture.props} onChange={noop} />);\n const selectWrapper = wrapper.find('[data-name=\"select-wrapper\"]');\n t.true(selectWrapper.at(0).exists());\n // should use skin color\n t.deepEqual(selectWrapper.at(0).props().style, {\n color: '#00B0FF'\n });\n const selectSpan = selectWrapper.at(0).find('[data-name=\"select-span\"]');\n t.true(selectSpan.at(0).exists());\n t.is(selectSpan.at(0).props().className, 'select__selectSpan select__noLabelCommon');\n});\n\ntest('text color: should not use skin color (selected, invalid option, player), long label', t => {\n const withInvalid = cloneDeep(playerFixture.props);\n withInvalid.options[1] = {\n name: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean.',\n value: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean.',\n selected: true,\n validOption: false\n };\n const wrapper = mount(<Select {...withInvalid} onChange={noop} />);\n const selectWrapper = wrapper.find('[data-name=\"select-wrapper\"]');\n t.true(selectWrapper.at(0).exists());\n // should not use skin color\n t.deepEqual(selectWrapper.at(0).props().style, {});\n const selectSpan = selectWrapper.at(0).find('[data-name=\"select-span\"]');\n t.true(selectSpan.at(0).exists());\n t.is(\n selectSpan.at(0).props().className,\n 'select__selectSpan select__noLabelCommon select__longLabel'\n );\n});\n"],"file":"select.js"}
|
|
@@ -14,12 +14,14 @@ const Customer = props => {
|
|
|
14
14
|
type,
|
|
15
15
|
coorpOriginal,
|
|
16
16
|
theme,
|
|
17
|
-
disabled = false
|
|
17
|
+
disabled = false,
|
|
18
|
+
'aria-label': ariaLabel
|
|
18
19
|
} = props;
|
|
19
20
|
const className = classnames(THEMES[theme], style.customer, type === 'chapter' ? style.chapterCustomer : null);
|
|
20
21
|
return /*#__PURE__*/React.createElement("div", {
|
|
21
22
|
className: className,
|
|
22
|
-
disabled: disabled
|
|
23
|
+
disabled: disabled,
|
|
24
|
+
"aria-label": ariaLabel
|
|
23
25
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24
26
|
className: style.content
|
|
25
27
|
}, coorpOriginal ? /*#__PURE__*/React.createElement("span", {
|
|
@@ -34,7 +36,8 @@ Customer.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
34
36
|
type: PropTypes.string,
|
|
35
37
|
name: PropTypes.string,
|
|
36
38
|
coorpOriginal: PropTypes.bool.isRequired,
|
|
37
|
-
disabled: PropTypes.bool
|
|
39
|
+
disabled: PropTypes.bool,
|
|
40
|
+
'aria-label': PropTypes.string
|
|
38
41
|
} : {};
|
|
39
42
|
export default Customer;
|
|
40
43
|
//# sourceMappingURL=customer.js.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/card/customer.js"],"names":["React","PropTypes","classnames","style","THEMES","default","coorpmanager","Customer","props","name","type","coorpOriginal","theme","disabled","ariaLabel","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,KAA9C;AAAqD,kBAAcC;AAAnE,MAAgFN,KAAtF;AACA,QAAMO,SAAS,GAAGb,UAAU,CAC1BE,MAAM,CAACQ,KAAD,CADoB,EAE1BT,KAAK,CAACa,QAFoB,EAG1BN,IAAI,KAAK,SAAT,GAAqBP,KAAK,CAACc,eAA3B,GAA6C,IAHnB,CAA5B;AAMA,sBACE;AAAK,IAAA,SAAS,EAAEF,SAAhB;AAA2B,IAAA,QAAQ,EAAEF,QAArC;AAA+C,kBAAYC;AAA3D,kBACE;AAAK,IAAA,SAAS,EAAEX,KAAK,CAACe;AAAtB,KACGP,aAAa,gBAAG;AAAM,IAAA,SAAS,EAAER,KAAK,CAACgB;AAAvB,cAAH,GAAiD,IADjE,EAEGR,aAAa,gBAAG;AAAM,IAAA,SAAS,EAAER,KAAK,CAACiB;AAAvB,iBAAH,GAAuD,IAFvE,EAGG,CAACT,aAAD,IAAkBF,IAHrB,CADF,CADF;AASD,CAjBD;;AAmBAF,QAAQ,CAACc,SAAT,2CAAqB;AACnBT,EAAAA,KAAK,EAAEX,SAAS,CAACqB,KAAV,CAAgB,MAAKlB,MAAL,CAAhB,CADY;AAEnBM,EAAAA,IAAI,EAAET,SAAS,CAACsB,MAFG;AAGnBd,EAAAA,IAAI,EAAER,SAAS,CAACsB,MAHG;AAInBZ,EAAAA,aAAa,EAAEV,SAAS,CAACuB,IAAV,CAAeC,UAJX;AAKnBZ,EAAAA,QAAQ,EAAEZ,SAAS,CAACuB,IALD;AAMnB,gBAAcvB,SAAS,CAACsB;AANL,CAArB;AASA,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, 'aria-label': ariaLabel} = 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} aria-label={ariaLabel}>\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 'aria-label': PropTypes.string\n};\n\nexport default Customer;\n"],"file":"customer.js"}
|
|
@@ -35,7 +35,8 @@ class Favorite extends React.Component {
|
|
|
35
35
|
favorite,
|
|
36
36
|
addFavoriteToolTip,
|
|
37
37
|
removeFavoriteToolTip,
|
|
38
|
-
className
|
|
38
|
+
className,
|
|
39
|
+
'aria-label': ariaLabel = {}
|
|
39
40
|
} = this.props;
|
|
40
41
|
|
|
41
42
|
const primaryColor = _get('common.primary', skin);
|
|
@@ -51,6 +52,7 @@ class Favorite extends React.Component {
|
|
|
51
52
|
className: style.blocFavorite
|
|
52
53
|
}, toolTipView, /*#__PURE__*/React.createElement("div", {
|
|
53
54
|
"data-name": "favorite",
|
|
55
|
+
"aria-label": ariaLabel.favorite,
|
|
54
56
|
className: classnames(style.favorite, className, favorite && style.selected),
|
|
55
57
|
onClick: this.handleFavoviteClick,
|
|
56
58
|
style: {
|
|
@@ -60,12 +62,14 @@ class Favorite extends React.Component {
|
|
|
60
62
|
className: style.checkIcon,
|
|
61
63
|
color: brandColor,
|
|
62
64
|
width: 13,
|
|
63
|
-
height: 13
|
|
65
|
+
height: 13,
|
|
66
|
+
"aria-label": ariaLabel.removeFromFavorite
|
|
64
67
|
}) : /*#__PURE__*/React.createElement(MoreIcon, {
|
|
65
68
|
className: style.moreIcon,
|
|
66
69
|
color: darkColor,
|
|
67
70
|
width: 13,
|
|
68
|
-
height: 13
|
|
71
|
+
height: 13,
|
|
72
|
+
"aria-label": ariaLabel.addToFavorite
|
|
69
73
|
})));
|
|
70
74
|
}
|
|
71
75
|
|
|
@@ -81,7 +85,12 @@ Favorite.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
81
85
|
disabled: PropTypes.bool,
|
|
82
86
|
addFavoriteToolTip: PropTypes.string,
|
|
83
87
|
removeFavoriteToolTip: PropTypes.string,
|
|
84
|
-
onFavoriteClick: PropTypes.func
|
|
88
|
+
onFavoriteClick: PropTypes.func,
|
|
89
|
+
'aria-label': PropTypes.shape({
|
|
90
|
+
favorite: PropTypes.string,
|
|
91
|
+
addToFavorite: PropTypes.string,
|
|
92
|
+
removeFromFavorite: PropTypes.string
|
|
93
|
+
})
|
|
85
94
|
} : {};
|
|
86
95
|
export default Favorite;
|
|
87
96
|
//# sourceMappingURL=favorite.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/card/favorite.js"],"names":["React","PropTypes","classnames","NovaCompositionNavigationMore","MoreIcon","NovaCompositionCoorpacademyCheck","CheckIcon","Provider","style","Favorite","Component","constructor","props","context","handleFavoviteClick","bind","e","disabled","onFavoriteClick","stopPropagation","preventDefault","render","skin","favorite","addFavoriteToolTip","removeFavoriteToolTip","className","primaryColor","darkColor","brandColor","toolTipView","showToolTip","blocFavorite","selected","color","checkIcon","moreIcon","childContextTypes","propTypes","string","bool","func"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,6BAA6B,IAAIC,QADnC,EAEEC,gCAAgC,IAAIC,SAFtC,QAGO,0BAHP;AAIA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,KAAP,MAAkB,gBAAlB;;AAEA,MAAMC,QAAN,SAAuBT,KAAK,CAACU,SAA7B,CAAuC;
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/card/favorite.js"],"names":["React","PropTypes","classnames","NovaCompositionNavigationMore","MoreIcon","NovaCompositionCoorpacademyCheck","CheckIcon","Provider","style","Favorite","Component","constructor","props","context","handleFavoviteClick","bind","e","disabled","onFavoriteClick","stopPropagation","preventDefault","render","skin","favorite","addFavoriteToolTip","removeFavoriteToolTip","className","ariaLabel","primaryColor","darkColor","brandColor","toolTipView","showToolTip","blocFavorite","selected","color","checkIcon","removeFromFavorite","moreIcon","addToFavorite","childContextTypes","propTypes","string","bool","func","shape"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,6BAA6B,IAAIC,QADnC,EAEEC,gCAAgC,IAAIC,SAFtC,QAGO,0BAHP;AAIA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,KAAP,MAAkB,gBAAlB;;AAEA,MAAMC,QAAN,SAAuBT,KAAK,CAACU,SAA7B,CAAuC;AAmBrCC,EAAAA,WAAW,CAACC,KAAD,EAAQC,OAAR,EAAiB;AAC1B,UAAMD,KAAN,EAAaC,OAAb;AACA,SAAKC,mBAAL,GAA2B,KAAKA,mBAAL,CAAyBC,IAAzB,CAA8B,IAA9B,CAA3B;AACD;;AAEDD,EAAAA,mBAAmB,CAACE,CAAD,EAAI;AACrB,UAAM;AAACC,MAAAA,QAAD;AAAWC,MAAAA,eAAe;AAA1B,QAAqC,KAAKN,KAAhD;AACAI,IAAAA,CAAC,CAACG,eAAF;AACAH,IAAAA,CAAC,CAACI,cAAF;AACA,QAAI,CAACH,QAAL,EAAeC,eAAe,CAACF,CAAD,CAAf;AAChB;;AAEDK,EAAAA,MAAM,GAAG;AACP,UAAM;AAACC,MAAAA;AAAD,QAAS,KAAKT,OAApB;AACA,UAAM;AACJU,MAAAA,QADI;AAEJC,MAAAA,kBAFI;AAGJC,MAAAA,qBAHI;AAIJC,MAAAA,SAJI;AAKJ,oBAAcC,S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BAekB;AACpBa,EAAAA,IAAI,EAAEf,QAAQ,CAACiC,iBAAT,CAA2BlB;AADb,C;;AAflBb,Q,CACGgC,S,2CAAY;AACjBf,EAAAA,SAAS,EAAEzB,SAAS,CAACyC,MADJ;AAEjBnB,EAAAA,QAAQ,EAAEtB,SAAS,CAAC0C,IAFH;AAGjB1B,EAAAA,QAAQ,EAAEhB,SAAS,CAAC0C,IAHH;AAIjBnB,EAAAA,kBAAkB,EAAEvB,SAAS,CAACyC,MAJb;AAKjBjB,EAAAA,qBAAqB,EAAExB,SAAS,CAACyC,MALhB;AAMjBxB,EAAAA,eAAe,EAAEjB,SAAS,CAAC2C,IANV;AAOjB,gBAAc3C,SAAS,CAAC4C,KAAV,CAAgB;AAC5BtB,IAAAA,QAAQ,EAAEtB,SAAS,CAACyC,MADQ;AAE5BH,IAAAA,aAAa,EAAEtC,SAAS,CAACyC,MAFG;AAG5BL,IAAAA,kBAAkB,EAAEpC,SAAS,CAACyC;AAHF,GAAhB;AAPG,C;AAqFrB,eAAejC,QAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, noop} from 'lodash/fp';\nimport {\n NovaCompositionNavigationMore as MoreIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../atom/provider';\nimport style from './favorite.css';\n\nclass Favorite extends React.Component {\n static propTypes = {\n className: PropTypes.string,\n favorite: PropTypes.bool,\n disabled: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onFavoriteClick: PropTypes.func,\n 'aria-label': PropTypes.shape({\n favorite: PropTypes.string,\n addToFavorite: PropTypes.string,\n removeFromFavorite: PropTypes.string\n })\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props, context) {\n super(props, context);\n this.handleFavoviteClick = this.handleFavoviteClick.bind(this);\n }\n\n handleFavoviteClick(e) {\n const {disabled, onFavoriteClick = noop} = this.props;\n e.stopPropagation();\n e.preventDefault();\n if (!disabled) onFavoriteClick(e);\n }\n\n render() {\n const {skin} = this.context;\n const {\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n className,\n 'aria-label': ariaLabel = {}\n } = this.props;\n\n const primaryColor = get('common.primary', skin);\n const darkColor = get('common.dark', skin);\n const brandColor = get('common.brand', skin);\n const toolTipView =\n !isEmpty(removeFavoriteToolTip) && !isEmpty(addFavoriteToolTip) ? (\n <div className={style.showToolTip}>\n <span>{favorite ? removeFavoriteToolTip : addFavoriteToolTip}</span>\n </div>\n ) : null;\n\n return (\n <div className={style.blocFavorite}>\n {toolTipView}\n <div\n data-name=\"favorite\"\n aria-label={ariaLabel.favorite}\n className={classnames(style.favorite, className, favorite && style.selected)}\n onClick={this.handleFavoviteClick}\n style={{\n color: primaryColor\n }}\n >\n {favorite ? (\n <CheckIcon\n className={style.checkIcon}\n color={brandColor}\n width={13}\n height={13}\n aria-label={ariaLabel.removeFromFavorite}\n />\n ) : (\n <MoreIcon\n className={style.moreIcon}\n color={darkColor}\n width={13}\n height={13}\n aria-label={ariaLabel.addToFavorite}\n />\n )}\n </div>\n </div>\n );\n }\n}\n\nexport default Favorite;\n"],"file":"favorite.js"}
|
|
@@ -26,7 +26,8 @@ export const THEMES = {
|
|
|
26
26
|
const CardBackground = ({
|
|
27
27
|
type,
|
|
28
28
|
image,
|
|
29
|
-
empty
|
|
29
|
+
empty,
|
|
30
|
+
'aria-label': ariaLabel
|
|
30
31
|
}, {
|
|
31
32
|
skin
|
|
32
33
|
}) => {
|
|
@@ -59,6 +60,7 @@ const CardBackground = ({
|
|
|
59
60
|
className: style.imageWrapper
|
|
60
61
|
}, /*#__PURE__*/React.createElement("div", {
|
|
61
62
|
"data-name": "cover",
|
|
63
|
+
"aria-label": ariaLabel,
|
|
62
64
|
style: {
|
|
63
65
|
backgroundColor: iconColor,
|
|
64
66
|
backgroundImage: `url('${image}')`
|
|
@@ -71,6 +73,7 @@ const CardBackground = ({
|
|
|
71
73
|
className: style.imageWrapper
|
|
72
74
|
}, /*#__PURE__*/React.createElement("div", {
|
|
73
75
|
"data-name": "cover",
|
|
76
|
+
"aria-label": ariaLabel,
|
|
74
77
|
style: {
|
|
75
78
|
backgroundColor: iconColor
|
|
76
79
|
},
|
|
@@ -86,6 +89,7 @@ const CardBackground = ({
|
|
|
86
89
|
className: classnames(style.imageWrapper, type === 'chapter' ? style.chapterImageWrapper : null)
|
|
87
90
|
}, /*#__PURE__*/React.createElement("div", {
|
|
88
91
|
"data-name": "cover",
|
|
92
|
+
"aria-label": ariaLabel,
|
|
89
93
|
className: style.image,
|
|
90
94
|
style: {
|
|
91
95
|
backgroundColor: primaryColor,
|
|
@@ -100,7 +104,8 @@ CardBackground.contextTypes = {
|
|
|
100
104
|
CardBackground.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
101
105
|
type: PropTypes.string,
|
|
102
106
|
image: PropTypes.string,
|
|
103
|
-
empty: PropTypes.bool
|
|
107
|
+
empty: PropTypes.bool,
|
|
108
|
+
'aria-label': PropTypes.string
|
|
104
109
|
} : {};
|
|
105
110
|
const Card = memo(function Card(props, context) {
|
|
106
111
|
const {
|
|
@@ -126,7 +131,15 @@ const Card = memo(function Card(props, context) {
|
|
|
126
131
|
notification,
|
|
127
132
|
badgeCategory,
|
|
128
133
|
badgeLabel,
|
|
129
|
-
theme = 'default'
|
|
134
|
+
theme = 'default',
|
|
135
|
+
'aria-label': cardArialabel,
|
|
136
|
+
'background-aria-label': backgroundAriaLabel,
|
|
137
|
+
'favorite-aria-label': favoriteAriaLabel,
|
|
138
|
+
'selectable-aria-label': selectableAriaLabel,
|
|
139
|
+
'customer-aria-label': customerAriaLabel,
|
|
140
|
+
'badge-aria-label': badgeAriaLabel,
|
|
141
|
+
'disabled-aria-label': disabledArialabel,
|
|
142
|
+
'card-content-aria-label': cardContentLabelAriaLabel
|
|
130
143
|
} = props;
|
|
131
144
|
|
|
132
145
|
const empty = _isEmpty(_pick(['title', 'type', 'author', 'image'], props));
|
|
@@ -165,24 +178,29 @@ const Card = memo(function Card(props, context) {
|
|
|
165
178
|
"data-lock": disabled,
|
|
166
179
|
"data-type": getType(type),
|
|
167
180
|
disabled: disabled,
|
|
168
|
-
onClick: handleClick
|
|
181
|
+
onClick: handleClick,
|
|
182
|
+
"aria-label": cardArialabel
|
|
169
183
|
}, /*#__PURE__*/React.createElement(CardBackground, {
|
|
170
184
|
type: type,
|
|
171
185
|
image: image,
|
|
172
|
-
empty: empty
|
|
186
|
+
empty: empty,
|
|
187
|
+
"aria-label": backgroundAriaLabel
|
|
173
188
|
}), _isUndefined(isSelected) && !_isUndefined(favorite) ? /*#__PURE__*/React.createElement(Favorite, {
|
|
174
189
|
className: style.favorite,
|
|
175
190
|
favorite: favorite,
|
|
176
191
|
disabled: disabled,
|
|
177
192
|
onFavoriteClick: onFavoriteClick,
|
|
178
193
|
addFavoriteToolTip: addFavoriteToolTip,
|
|
179
|
-
removeFavoriteToolTip: removeFavoriteToolTip
|
|
194
|
+
removeFavoriteToolTip: removeFavoriteToolTip,
|
|
195
|
+
"aria-label": favoriteAriaLabel
|
|
180
196
|
}) : null, /*#__PURE__*/React.createElement(Selectable, {
|
|
181
|
-
isSelected: isSelected
|
|
197
|
+
isSelected: isSelected,
|
|
198
|
+
"aria-label": selectableAriaLabel
|
|
182
199
|
}), notification ? /*#__PURE__*/React.createElement(Notification, notification) : null, customer ? /*#__PURE__*/React.createElement(Customer, _extends({}, customer, {
|
|
183
200
|
theme: theme,
|
|
184
201
|
type: type,
|
|
185
|
-
disabled: disabled
|
|
202
|
+
disabled: disabled,
|
|
203
|
+
"aria-label": customerAriaLabel
|
|
186
204
|
})) : null, /*#__PURE__*/React.createElement(CardContentInfo, {
|
|
187
205
|
mode: MODES.CARD,
|
|
188
206
|
adaptiv: adaptiv,
|
|
@@ -195,12 +213,15 @@ const Card = memo(function Card(props, context) {
|
|
|
195
213
|
type: type,
|
|
196
214
|
badgeCategory: badgeCategory,
|
|
197
215
|
badgeLabel: badgeLabel,
|
|
198
|
-
theme: theme
|
|
216
|
+
theme: theme,
|
|
217
|
+
"aria-label": cardContentLabelAriaLabel
|
|
199
218
|
}), badge ? /*#__PURE__*/React.createElement("div", {
|
|
200
219
|
className: style.badge,
|
|
201
|
-
style: inlineBadgeStyle
|
|
220
|
+
style: inlineBadgeStyle,
|
|
221
|
+
"aria-label": badgeAriaLabel
|
|
202
222
|
}, badge) : null, disabled ? /*#__PURE__*/React.createElement("div", {
|
|
203
|
-
className: style.lockWrapper
|
|
223
|
+
className: style.lockWrapper,
|
|
224
|
+
"aria-label": disabledArialabel
|
|
204
225
|
}, lock) : null);
|
|
205
226
|
});
|
|
206
227
|
Card.contextTypes = {
|
|
@@ -226,7 +247,15 @@ Card.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
226
247
|
notification: PropTypes.shape(Notification.propTypes),
|
|
227
248
|
badgeCategory: CardContentInfo.propTypes.badgeCategory,
|
|
228
249
|
badgeLabel: CardContentInfo.propTypes.badgeLabel,
|
|
229
|
-
theme: PropTypes.oneOf(_keys(THEMES))
|
|
250
|
+
theme: PropTypes.oneOf(_keys(THEMES)),
|
|
251
|
+
'aria-label': PropTypes.string,
|
|
252
|
+
'background-aria-label': PropTypes.string,
|
|
253
|
+
'favorite-aria-label': Favorite.propTypes['aria-label'],
|
|
254
|
+
'selectable-aria-label': Selectable.propTypes['aria-label'],
|
|
255
|
+
'customer-aria-label': Customer.propTypes['aria-label'],
|
|
256
|
+
'badge-aria-label': PropTypes.string,
|
|
257
|
+
'disabled-aria-label': PropTypes.string,
|
|
258
|
+
'card-content-aria-label': CardContentInfo.propTypes['aria-label']
|
|
230
259
|
} : {};
|
|
231
260
|
export default Card;
|
|
232
261
|
//# 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","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,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,OAAO,MAAMC,MAAM,GAAG;AACpBC,EAAAA,OAAO,EAAE,IADW;AAEpBC,EAAAA,YAAY,EAAEH,KAAK,CAACG;AAFA,CAAf;;AAKP,MAAMC,cAAc,GAAG,CAAC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CAAC+C,MAPH;AAQfW,EAAAA,eAAe,EAAE1D,SAAS,CAACgD,IARZ;AASfS,EAAAA,QAAQ,EAAEzD,SAAS,CAACoF,KAAV,CAAgBzE,QAAQ,CAACmC,SAAzB,CATK;AAUfa,EAAAA,QAAQ,EAAE3D,SAAS,CAACqF,MAVL;AAWfzB,EAAAA,QAAQ,EAAE5D,SAAS,CAACgD,IAXL;AAYfa,EAAAA,kBAAkB,EAAE7D,SAAS,CAAC+C,MAZf;AAafe,EAAAA,qBAAqB,EAAE9D,SAAS,CAAC+C,MAblB;AAcfgB,EAAAA,OAAO,EAAE/D,SAAS,CAACsF,IAdJ;AAeftB,EAAAA,eAAe,EAAEhE,SAAS,CAACsF,IAfZ;AAgBfrB,EAAAA,UAAU,EAAEjE,SAAS,CAACgD,IAhBP;AAiBfkB,EAAAA,YAAY,EAAElE,SAAS,CAACoF,KAAV,CAAgBtE,YAAY,CAACgC,SAA7B,CAjBC;AAkBfqB,EAAAA,aAAa,EAAE1D,eAAe,CAACqC,SAAhB,CAA0BqB,aAlB1B;AAmBfC,EAAAA,UAAU,EAAE3D,eAAe,CAACqC,SAAhB,CAA0BsB,UAnBvB;AAoBfC,EAAAA,KAAK,EAAErE,SAAS,CAACuF,KAAV,CAAgB,MAAKvE,MAAL,CAAhB;AApBQ,CAAjB;AAsBA,eAAeiC,IAAf","sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from '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"}
|
|
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","ariaLabel","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","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","cardStyle","chapter","course","lazy","grid","handleClick","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","CARD","lockWrapper","shape","number","func","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{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, 'aria-label': ariaLabel}, {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 aria-label={ariaLabel}\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 aria-label={ariaLabel}\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 aria-label={ariaLabel}\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 'aria-label': PropTypes.string\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 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\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 aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\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 aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\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 theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : 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 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\nexport default Card;\n"],"file":"index.js"}
|
|
@@ -7,7 +7,8 @@ import style from './selectable.css';
|
|
|
7
7
|
|
|
8
8
|
const Selectable = props => {
|
|
9
9
|
const {
|
|
10
|
-
isSelected
|
|
10
|
+
isSelected,
|
|
11
|
+
'aria-label': ariaLabel = {}
|
|
11
12
|
} = props;
|
|
12
13
|
if (_isUndefined(isSelected)) return null;
|
|
13
14
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -17,14 +18,20 @@ const Selectable = props => {
|
|
|
17
18
|
}), /*#__PURE__*/React.createElement("div", {
|
|
18
19
|
className: style.iconWrapper
|
|
19
20
|
}, /*#__PURE__*/React.createElement(AddIcon, {
|
|
20
|
-
className: style.addIcon
|
|
21
|
+
className: style.addIcon,
|
|
22
|
+
"aria-label": ariaLabel.select
|
|
21
23
|
}), /*#__PURE__*/React.createElement(CheckIcon, {
|
|
22
|
-
className: style.checkIcon
|
|
24
|
+
className: style.checkIcon,
|
|
25
|
+
"aria-label": ariaLabel.unSelect
|
|
23
26
|
})));
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
Selectable.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
27
|
-
isSelected: PropTypes.bool
|
|
30
|
+
isSelected: PropTypes.bool,
|
|
31
|
+
'aria-label': PropTypes.shape({
|
|
32
|
+
select: PropTypes.string,
|
|
33
|
+
unSelect: PropTypes.string
|
|
34
|
+
})
|
|
28
35
|
} : {};
|
|
29
36
|
export default Selectable;
|
|
30
37
|
//# sourceMappingURL=selectable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/card/selectable.js"],"names":["React","PropTypes","classnames","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidRemoveAddAddCircle1","AddIcon","style","Selectable","props","isSelected","selectable","selected","circle","iconWrapper","addIcon","checkIcon","propTypes","bool"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,2BAA2B,IAAIC,SADjC,EAEEC,4BAA4B,IAAIC,OAFlC,QAGO,0BAHP;AAIA,OAAOC,KAAP,MAAkB,kBAAlB;;AAEA,MAAMC,UAAU,GAAGC,KAAK,IAAI;AAC1B,QAAM;AAACC,IAAAA;
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/card/selectable.js"],"names":["React","PropTypes","classnames","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidRemoveAddAddCircle1","AddIcon","style","Selectable","props","isSelected","ariaLabel","selectable","selected","circle","iconWrapper","addIcon","select","checkIcon","unSelect","propTypes","bool","shape","string"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,2BAA2B,IAAIC,SADjC,EAEEC,4BAA4B,IAAIC,OAFlC,QAGO,0BAHP;AAIA,OAAOC,KAAP,MAAkB,kBAAlB;;AAEA,MAAMC,UAAU,GAAGC,KAAK,IAAI;AAC1B,QAAM;AAACC,IAAAA,UAAD;AAAa,kBAAcC,SAAS,GAAG;AAAvC,MAA6CF,KAAnD;AAEA,MAAI,aAAYC,UAAZ,CAAJ,EAA6B,OAAO,IAAP;AAE7B,sBACE;AAAK,IAAA,SAAS,EAAER,UAAU,CAACK,KAAK,CAACK,UAAP,EAAmBF,UAAU,IAAIH,KAAK,CAACM,QAAvC;AAA1B,kBACE;AAAK,IAAA,SAAS,EAAEN,KAAK,CAACO;AAAtB,IADF,eAEE;AAAK,IAAA,SAAS,EAAEP,KAAK,CAACQ;AAAtB,kBACE,oBAAC,OAAD;AAAS,IAAA,SAAS,EAAER,KAAK,CAACS,OAA1B;AAAmC,kBAAYL,SAAS,CAACM;AAAzD,IADF,eAEE,oBAAC,SAAD;AAAW,IAAA,SAAS,EAAEV,KAAK,CAACW,SAA5B;AAAuC,kBAAYP,SAAS,CAACQ;AAA7D,IAFF,CAFF,CADF;AASD,CAdD;;AAgBAX,UAAU,CAACY,SAAX,2CAAuB;AACrBV,EAAAA,UAAU,EAAET,SAAS,CAACoB,IADD;AAErB,gBAAcpB,SAAS,CAACqB,KAAV,CAAgB;AAC5BL,IAAAA,MAAM,EAAEhB,SAAS,CAACsB,MADU;AAE5BJ,IAAAA,QAAQ,EAAElB,SAAS,CAACsB;AAFQ,GAAhB;AAFO,CAAvB;AAQA,eAAef,UAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isUndefined} from 'lodash/fp';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidRemoveAddAddCircle1 as AddIcon\n} from '@coorpacademy/nova-icons';\nimport style from './selectable.css';\n\nconst Selectable = props => {\n const {isSelected, 'aria-label': ariaLabel = {}} = props;\n\n if (isUndefined(isSelected)) return null;\n\n return (\n <div className={classnames(style.selectable, isSelected && style.selected)}>\n <div className={style.circle} />\n <div className={style.iconWrapper}>\n <AddIcon className={style.addIcon} aria-label={ariaLabel.select} />\n <CheckIcon className={style.checkIcon} aria-label={ariaLabel.unSelect} />\n </div>\n </div>\n );\n};\n\nSelectable.propTypes = {\n isSelected: PropTypes.bool,\n 'aria-label': PropTypes.shape({\n select: PropTypes.string,\n unSelect: PropTypes.string\n })\n};\n\nexport default Selectable;\n"],"file":"selectable.js"}
|
|
@@ -18,7 +18,26 @@ export default {
|
|
|
18
18
|
name: 'Decathlon creation'
|
|
19
19
|
},
|
|
20
20
|
onClick: () => console.log('click everywhere'),
|
|
21
|
-
onFavoriteClick: () => console.log('click Favorite')
|
|
21
|
+
onFavoriteClick: () => console.log('click Favorite'),
|
|
22
|
+
'aria-label': 'course card',
|
|
23
|
+
'background-aria-label': 'image wthout informations',
|
|
24
|
+
'favorite-aria-label': {
|
|
25
|
+
favorite: 'this cours is your favorite',
|
|
26
|
+
addToFavorite: 'add to favorite',
|
|
27
|
+
removeFromFavorite: 'remove from favorite'
|
|
28
|
+
},
|
|
29
|
+
'selectable-aria-label': {
|
|
30
|
+
select: 'select course',
|
|
31
|
+
unSelect: 'unselect course'
|
|
32
|
+
},
|
|
33
|
+
'customer-aria-label': 'made by',
|
|
34
|
+
'badge-aria-label': 'new course',
|
|
35
|
+
'disabled-aria-label': 'the course is disabled',
|
|
36
|
+
'card-content-aria-label': {
|
|
37
|
+
author: 'auther name',
|
|
38
|
+
progression: 'you have done 65% of the course',
|
|
39
|
+
adaptive: 'this is an adaptive course'
|
|
40
|
+
}
|
|
22
41
|
}
|
|
23
42
|
};
|
|
24
43
|
//# sourceMappingURL=default.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/molecule/card/test/fixtures/default.js"],"names":["props","image","adaptiv","certification","type","title","author","certifiedAuthor","progress","badge","favorite","addFavoriteToolTip","removeFavoriteToolTip","isSelected","undefined","customer","coorpOriginal","name","onClick","console","log","onFavoriteClick"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EACH,4LAFG;AAGLC,IAAAA,OAAO,EAAE,KAHJ;AAILC,IAAAA,aAAa,EAAE,KAJV;AAKLC,IAAAA,IAAI,EAAE,QALD;AAMLC,IAAAA,KAAK,EAAE,sDANF;AAOLC,IAAAA,MAAM,EAAE,cAPH;AAQLC,IAAAA,eAAe,EAAE,IARZ;AASLC,IAAAA,QAAQ,EAAE,IATL;AAULC,IAAAA,KAAK,EAAE,KAVF;AAWLC,IAAAA,QAAQ,EAAE,IAXL;AAYLC,IAAAA,kBAAkB,EAAE,gBAZf;AAaLC,IAAAA,qBAAqB,EAAE,qBAblB;AAcLC,IAAAA,UAAU,EAAEC,SAdP;AAeLC,IAAAA,QAAQ,EAAE;AACRC,MAAAA,aAAa,EAAE,IADP;AAERC,MAAAA,IAAI,EAAE;AAFE,KAfL;AAmBLC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,kBAAZ,CAnBV;AAoBLC,IAAAA,eAAe,EAAE,MAAMF,OAAO,CAACC,GAAR,CAAY,gBAAZ;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/card/test/fixtures/default.js"],"names":["props","image","adaptiv","certification","type","title","author","certifiedAuthor","progress","badge","favorite","addFavoriteToolTip","removeFavoriteToolTip","isSelected","undefined","customer","coorpOriginal","name","onClick","console","log","onFavoriteClick","addToFavorite","removeFromFavorite","select","unSelect","progression","adaptive"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EACH,4LAFG;AAGLC,IAAAA,OAAO,EAAE,KAHJ;AAILC,IAAAA,aAAa,EAAE,KAJV;AAKLC,IAAAA,IAAI,EAAE,QALD;AAMLC,IAAAA,KAAK,EAAE,sDANF;AAOLC,IAAAA,MAAM,EAAE,cAPH;AAQLC,IAAAA,eAAe,EAAE,IARZ;AASLC,IAAAA,QAAQ,EAAE,IATL;AAULC,IAAAA,KAAK,EAAE,KAVF;AAWLC,IAAAA,QAAQ,EAAE,IAXL;AAYLC,IAAAA,kBAAkB,EAAE,gBAZf;AAaLC,IAAAA,qBAAqB,EAAE,qBAblB;AAcLC,IAAAA,UAAU,EAAEC,SAdP;AAeLC,IAAAA,QAAQ,EAAE;AACRC,MAAAA,aAAa,EAAE,IADP;AAERC,MAAAA,IAAI,EAAE;AAFE,KAfL;AAmBLC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,kBAAZ,CAnBV;AAoBLC,IAAAA,eAAe,EAAE,MAAMF,OAAO,CAACC,GAAR,CAAY,gBAAZ,CApBlB;AAqBL,kBAAc,aArBT;AAsBL,6BAAyB,2BAtBpB;AAuBL,2BAAuB;AACrBV,MAAAA,QAAQ,EAAE,6BADW;AAErBY,MAAAA,aAAa,EAAE,iBAFM;AAGrBC,MAAAA,kBAAkB,EAAE;AAHC,KAvBlB;AA4BL,6BAAyB;AACvBC,MAAAA,MAAM,EAAE,eADe;AAEvBC,MAAAA,QAAQ,EAAE;AAFa,KA5BpB;AAgCL,2BAAuB,SAhClB;AAiCL,wBAAoB,YAjCf;AAkCL,2BAAuB,wBAlClB;AAmCL,+BAA2B;AACzBnB,MAAAA,MAAM,EAAE,aADiB;AAEzBoB,MAAAA,WAAW,EAAE,iCAFY;AAGzBC,MAAAA,QAAQ,EAAE;AAHe;AAnCtB;AADM,CAAf","sourcesContent":["export default {\n props: {\n image:\n 'https://api.coorpacademy.com/api-service/medias?url=https://static.coorpacademy.com/content/partner-wedemain/fr/medias/img/cover/shutterstock_248741149-1470302136299.jpg&h=500&w=500&q=90',\n adaptiv: false,\n certification: false,\n type: 'course',\n title: 'From Mass Market to One to One targeting Lorem ipsum',\n author: 'Coorpacademy',\n certifiedAuthor: true,\n progress: 0.65,\n badge: 'new',\n favorite: true,\n addFavoriteToolTip: 'Add to my list',\n removeFavoriteToolTip: 'Remove from my list',\n isSelected: undefined,\n customer: {\n coorpOriginal: true,\n name: 'Decathlon creation'\n },\n onClick: () => console.log('click everywhere'),\n onFavoriteClick: () => console.log('click Favorite'),\n 'aria-label': 'course card',\n 'background-aria-label': 'image wthout informations',\n 'favorite-aria-label': {\n favorite: 'this cours is your favorite',\n addToFavorite: 'add to favorite',\n removeFromFavorite: 'remove from favorite'\n },\n 'selectable-aria-label': {\n select: 'select course',\n unSelect: 'unselect course'\n },\n 'customer-aria-label': 'made by',\n 'badge-aria-label': 'new course',\n 'disabled-aria-label': 'the course is disabled',\n 'card-content-aria-label': {\n author: 'auther name',\n progression: 'you have done 65% of the course',\n adaptive: 'this is an adaptive course'\n }\n }\n};\n"],"file":"default.js"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _keys from "lodash/fp/keys";
|
|
2
2
|
import _isNil from "lodash/fp/isNil";
|
|
3
|
+
import _get from "lodash/fp/get";
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import PropTypes from 'prop-types';
|
|
5
6
|
import classnames from 'classnames';
|
|
@@ -90,7 +91,8 @@ const AuthorName = ({
|
|
|
90
91
|
author,
|
|
91
92
|
empty,
|
|
92
93
|
courseContent,
|
|
93
|
-
certifiedAuthor
|
|
94
|
+
certifiedAuthor,
|
|
95
|
+
'aria-label': ariaLabel
|
|
94
96
|
}) => {
|
|
95
97
|
const checkIcon = certifiedAuthor ? /*#__PURE__*/React.createElement(CheckIcon, {
|
|
96
98
|
className: classnames(style.authorIcon, courseContent ? style.iconShadow : null),
|
|
@@ -99,6 +101,7 @@ const AuthorName = ({
|
|
|
99
101
|
return /*#__PURE__*/React.createElement("div", {
|
|
100
102
|
"data-name": "author",
|
|
101
103
|
title: author,
|
|
104
|
+
"aria-label": ariaLabel,
|
|
102
105
|
className: classnames(style.author, courseContent ? style.lightTitle : style.darkAuthorTitle, empty ? style.empty : null)
|
|
103
106
|
}, /*#__PURE__*/React.createElement("span", null, author), checkIcon);
|
|
104
107
|
};
|
|
@@ -107,7 +110,8 @@ AuthorName.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
107
110
|
author: PropTypes.string,
|
|
108
111
|
empty: PropTypes.bool,
|
|
109
112
|
courseContent: PropTypes.bool,
|
|
110
|
-
certifiedAuthor: PropTypes.bool
|
|
113
|
+
certifiedAuthor: PropTypes.bool,
|
|
114
|
+
'aria-label': PropTypes.string
|
|
111
115
|
} : {};
|
|
112
116
|
|
|
113
117
|
const ContentInfo = ({
|
|
@@ -122,7 +126,8 @@ const ContentInfo = ({
|
|
|
122
126
|
type,
|
|
123
127
|
badgeCategory,
|
|
124
128
|
badgeLabel,
|
|
125
|
-
theme = 'default'
|
|
129
|
+
theme = 'default',
|
|
130
|
+
'aria-label': ariaLabel
|
|
126
131
|
}) => {
|
|
127
132
|
const progressBarColor = '#3EC483';
|
|
128
133
|
const inlineProgressValueStyle = {
|
|
@@ -137,10 +142,12 @@ const ContentInfo = ({
|
|
|
137
142
|
}, !disabled ? /*#__PURE__*/React.createElement("div", {
|
|
138
143
|
"data-name": "progress",
|
|
139
144
|
className: style.progress,
|
|
140
|
-
style: inlineProgressValueStyle
|
|
145
|
+
style: inlineProgressValueStyle,
|
|
146
|
+
"aria-label": _get('progression', ariaLabel)
|
|
141
147
|
}) : null) : null;
|
|
142
148
|
const adaptiveIcon = adaptiv ? /*#__PURE__*/React.createElement("div", {
|
|
143
|
-
className: classnames(style.adaptiveIcon, courseContent ? style.iconShadow : null)
|
|
149
|
+
className: classnames(style.adaptiveIcon, courseContent ? style.iconShadow : null),
|
|
150
|
+
"aria-label": _get('adaptive', ariaLabel)
|
|
144
151
|
}, /*#__PURE__*/React.createElement(AdaptivIcon, {
|
|
145
152
|
height: 25
|
|
146
153
|
})) : null;
|
|
@@ -166,7 +173,8 @@ const ContentInfo = ({
|
|
|
166
173
|
author: author,
|
|
167
174
|
empty: empty,
|
|
168
175
|
courseContent: courseContent,
|
|
169
|
-
certifiedAuthor: certifiedAuthor
|
|
176
|
+
certifiedAuthor: certifiedAuthor,
|
|
177
|
+
"aria-label": _get('author', ariaLabel)
|
|
170
178
|
})), progressBar);
|
|
171
179
|
};
|
|
172
180
|
|
|
@@ -185,7 +193,12 @@ ContentInfo.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
185
193
|
mode: PropTypes.string,
|
|
186
194
|
badgeCategory: ContentBadge.propTypes.category,
|
|
187
195
|
badgeLabel: ContentBadge.propTypes.label,
|
|
188
|
-
theme: PropTypes.oneOf(_keys(THEMES))
|
|
196
|
+
theme: PropTypes.oneOf(_keys(THEMES)),
|
|
197
|
+
'aria-label': PropTypes.shape({
|
|
198
|
+
author: PropTypes.string,
|
|
199
|
+
progression: PropTypes.string,
|
|
200
|
+
adaptive: PropTypes.string
|
|
201
|
+
})
|
|
189
202
|
} : {};
|
|
190
203
|
export default ContentInfo;
|
|
191
204
|
//# sourceMappingURL=index.js.map
|