@coorpacademy/components 10.4.6-alpha.2 → 10.5.1
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/card-image-preview/test/fixtures.js +45 -0
- package/es/atom/card-image-preview/test/fixtures.js.map +1 -0
- package/es/molecule/course-section/index.js +60 -0
- package/es/molecule/course-section/index.js.map +1 -0
- package/es/molecule/course-section/style.css +65 -0
- package/es/molecule/course-section/test/fixtures/chapter.js +17 -0
- package/es/molecule/course-section/test/fixtures/chapter.js.map +1 -0
- package/es/molecule/course-section/test/fixtures/course.js +17 -0
- package/es/molecule/course-section/test/fixtures/course.js.map +1 -0
- package/es/molecule/feedback/style.css +0 -1
- package/es/molecule/wizard-summary/index.js +5 -5
- package/es/molecule/wizard-summary/index.js.map +1 -1
- package/lib/atom/card-image-preview/test/fixtures.js +70 -0
- package/lib/atom/card-image-preview/test/fixtures.js.map +1 -0
- package/lib/molecule/course-section/index.js +72 -0
- package/lib/molecule/course-section/index.js.map +1 -0
- package/lib/molecule/course-section/style.css +65 -0
- package/lib/molecule/course-section/test/fixtures/chapter.js +22 -0
- package/lib/molecule/course-section/test/fixtures/chapter.js.map +1 -0
- package/lib/molecule/course-section/test/fixtures/course.js +22 -0
- package/lib/molecule/course-section/test/fixtures/course.js.map +1 -0
- package/lib/molecule/feedback/style.css +0 -1
- package/lib/molecule/wizard-summary/index.js +5 -5
- package/lib/molecule/wizard-summary/index.js.map +1 -1
- 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/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/search/test/fixtures.js +0 -25
- package/lib/molecule/search/test/fixtures.js.map +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomCardImagePreview from '..';
|
|
5
|
+
import fixtureAdaptivAndDisabled from './fixtures/adaptiv-and-disabled';
|
|
6
|
+
import fixtureAdaptiv from './fixtures/adaptiv';
|
|
7
|
+
import fixtureArabic from './fixtures/arabic';
|
|
8
|
+
import fixtureArticle from './fixtures/article';
|
|
9
|
+
import fixtureCoorpmanager from './fixtures/coorpmanager';
|
|
10
|
+
import fixtureDefault from './fixtures/default';
|
|
11
|
+
import fixtureDisabled from './fixtures/disabled';
|
|
12
|
+
import fixtureEmpty from './fixtures/empty';
|
|
13
|
+
import fixtureExternalContent from './fixtures/external-content';
|
|
14
|
+
import fixtureFavorite from './fixtures/favorite';
|
|
15
|
+
import fixtureFreerunAndDisabled from './fixtures/freerun-and-disabled';
|
|
16
|
+
import fixtureFreerun from './fixtures/freerun';
|
|
17
|
+
import fixturePodcast from './fixtures/podcast';
|
|
18
|
+
import fixtureScorm from './fixtures/scorm';
|
|
19
|
+
import fixtureSelectableFalse from './fixtures/selectable-false';
|
|
20
|
+
import fixtureSelectableTrue from './fixtures/selectable-true';
|
|
21
|
+
import fixtureVideo from './fixtures/video';
|
|
22
|
+
test('Atom › AtomCardImagePreview > should have valid propTypes', t => {
|
|
23
|
+
t.pass();
|
|
24
|
+
forEach(AtomCardImagePreview.propTypes, (value, key) => {
|
|
25
|
+
t.not(value, undefined, `PropType for "Atom.AtomCardImagePreview.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
test('Atom › AtomCardImagePreview › AdaptivAndDisabled › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureAdaptivAndDisabled);
|
|
29
|
+
test('Atom › AtomCardImagePreview › Adaptiv › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureAdaptiv);
|
|
30
|
+
test('Atom › AtomCardImagePreview › Arabic › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureArabic);
|
|
31
|
+
test('Atom › AtomCardImagePreview › Article › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureArticle);
|
|
32
|
+
test('Atom › AtomCardImagePreview › Coorpmanager › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureCoorpmanager);
|
|
33
|
+
test('Atom › AtomCardImagePreview › Default › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureDefault);
|
|
34
|
+
test('Atom › AtomCardImagePreview › Disabled › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureDisabled);
|
|
35
|
+
test('Atom › AtomCardImagePreview › Empty › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureEmpty);
|
|
36
|
+
test('Atom › AtomCardImagePreview › ExternalContent › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureExternalContent);
|
|
37
|
+
test('Atom › AtomCardImagePreview › Favorite › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureFavorite);
|
|
38
|
+
test('Atom › AtomCardImagePreview › FreerunAndDisabled › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureFreerunAndDisabled);
|
|
39
|
+
test('Atom › AtomCardImagePreview › Freerun › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureFreerun);
|
|
40
|
+
test('Atom › AtomCardImagePreview › Podcast › should be rendered', renderComponentMacro, AtomCardImagePreview, fixturePodcast);
|
|
41
|
+
test('Atom › AtomCardImagePreview › Scorm › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureScorm);
|
|
42
|
+
test('Atom › AtomCardImagePreview › SelectableFalse › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureSelectableFalse);
|
|
43
|
+
test('Atom › AtomCardImagePreview › SelectableTrue › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureSelectableTrue);
|
|
44
|
+
test('Atom › AtomCardImagePreview › Video › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureVideo);
|
|
45
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/card-image-preview/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomCardImagePreview","fixtureAdaptivAndDisabled","fixtureAdaptiv","fixtureArabic","fixtureArticle","fixtureCoorpmanager","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,oBAAP,MAAiC,IAAjC;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;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;AAEApB,IAAI,CAAC,2DAAD,EAA8DqB,CAAC,IAAI;AACrEA,EAAAA,CAAC,CAACC,IAAF;AACArB,EAAAA,OAAO,CAACE,oBA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2Ga,cAA3G,CAAJ;AACAhB,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,oBAAnF,EAAyGc,YAAzG,CAAJ;AACAjB,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,oBAA7F,EAAmHe,sBAAnH,CAAJ;AACAlB,IAAI,CAAC,mEAAD,EAAsEE,oBAAtE,EAA4FC,oBAA5F,EAAkHgB,qBAAlH,CAAJ;AACAnB,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,oBAAnF,EAAyGiB,YAAzG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomCardImagePreview 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('Atom › AtomCardImagePreview > should have valid propTypes', t => {\n t.pass();\n forEach(AtomCardImagePreview.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomCardImagePreview.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomCardImagePreview › AdaptivAndDisabled › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureAdaptivAndDisabled);\ntest('Atom › AtomCardImagePreview › Adaptiv › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureAdaptiv);\ntest('Atom › AtomCardImagePreview › Arabic › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureArabic);\ntest('Atom › AtomCardImagePreview › Article › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureArticle);\ntest('Atom › AtomCardImagePreview › Coorpmanager › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureCoorpmanager);\ntest('Atom › AtomCardImagePreview › Default › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureDefault);\ntest('Atom › AtomCardImagePreview › Disabled › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureDisabled);\ntest('Atom › AtomCardImagePreview › Empty › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureEmpty);\ntest('Atom › AtomCardImagePreview › ExternalContent › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureExternalContent);\ntest('Atom › AtomCardImagePreview › Favorite › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureFavorite);\ntest('Atom › AtomCardImagePreview › FreerunAndDisabled › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureFreerunAndDisabled);\ntest('Atom › AtomCardImagePreview › Freerun › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureFreerun);\ntest('Atom › AtomCardImagePreview › Podcast › should be rendered', renderComponentMacro, AtomCardImagePreview, fixturePodcast);\ntest('Atom › AtomCardImagePreview › Scorm › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureScorm);\ntest('Atom › AtomCardImagePreview › SelectableFalse › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureSelectableFalse);\ntest('Atom › AtomCardImagePreview › SelectableTrue › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureSelectableTrue);\ntest('Atom › AtomCardImagePreview › Video › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureVideo);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import CardImagePreview from '../../atom/card-image-preview';
|
|
4
|
+
import ContentBadge from '../../atom/content-badge';
|
|
5
|
+
import style from './style.css';
|
|
6
|
+
|
|
7
|
+
const CourseSection = props => {
|
|
8
|
+
const {
|
|
9
|
+
image,
|
|
10
|
+
contentBadge: {
|
|
11
|
+
category,
|
|
12
|
+
label
|
|
13
|
+
},
|
|
14
|
+
title,
|
|
15
|
+
author,
|
|
16
|
+
position,
|
|
17
|
+
'aria-label': {
|
|
18
|
+
title: ariaLabelTitle,
|
|
19
|
+
author: ariaLabelAuthor
|
|
20
|
+
}
|
|
21
|
+
} = props;
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
className: style.container,
|
|
24
|
+
"aria-label": ariaLabelTitle,
|
|
25
|
+
"data-name": `course-section-${position}`
|
|
26
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
27
|
+
className: style.position
|
|
28
|
+
}, position), /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: style.containerImage
|
|
30
|
+
}, /*#__PURE__*/React.createElement(CardImagePreview, {
|
|
31
|
+
image: image
|
|
32
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: style.containerInfos
|
|
34
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: style.containerMainInfos
|
|
36
|
+
}, /*#__PURE__*/React.createElement(ContentBadge, {
|
|
37
|
+
className: style.contentBadge,
|
|
38
|
+
category: category,
|
|
39
|
+
label: label
|
|
40
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: style.title
|
|
42
|
+
}, title)), /*#__PURE__*/React.createElement("span", {
|
|
43
|
+
className: style.author,
|
|
44
|
+
"aria-label": ariaLabelAuthor
|
|
45
|
+
}, author)));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
CourseSection.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
49
|
+
'aria-label': PropTypes.shape({
|
|
50
|
+
title: PropTypes.string,
|
|
51
|
+
author: PropTypes.string
|
|
52
|
+
}),
|
|
53
|
+
image: PropTypes.string,
|
|
54
|
+
contentBadge: PropTypes.shape(ContentBadge.propTypes),
|
|
55
|
+
title: PropTypes.string,
|
|
56
|
+
author: PropTypes.string,
|
|
57
|
+
position: PropTypes.number
|
|
58
|
+
} : {};
|
|
59
|
+
export default CourseSection;
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/course-section/index.js"],"names":["React","PropTypes","CardImagePreview","ContentBadge","style","CourseSection","props","image","contentBadge","category","label","title","author","position","ariaLabelTitle","ariaLabelAuthor","container","containerImage","containerInfos","containerMainInfos","propTypes","shape","string","number"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,gBAAP,MAA6B,+BAA7B;AACA,OAAOC,YAAP,MAAyB,0BAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,aAAa,GAAGC,KAAK,IAAI;AAC7B,QAAM;AACJC,IAAAA,KADI;AAEJC,IAAAA,YAAY,EAAE;AAACC,MAAAA,QAAD;AAAWC,MAAAA;AAAX,KAFV;AAGJC,IAAAA,KAHI;AAIJC,IAAAA,MAJI;AAKJC,IAAAA,QALI;AAMJ,kBAAc;AAACF,MAAAA,KAAK,EAAEG,cAAR;AAAwBF,MAAAA,MAAM,EAAEG;AAAhC;AANV,MAOFT,KAPJ;AAQA,sBACE;AACE,IAAA,SAAS,EAAEF,KAAK,CAACY,SADnB;AAEE,kBAAYF,cAFd;AAGE,iBAAY,kBAAiBD,QAAS;AAHxC,kBAKE;AAAM,IAAA,SAAS,EAAET,KAAK,CAACS;AAAvB,KAAkCA,QAAlC,CALF,eAME;AAAK,IAAA,SAAS,EAAET,KAAK,CAACa;AAAtB,kBACE,oBAAC,gBAAD;AAAkB,IAAA,KAAK,EAAEV;AAAzB,IADF,CANF,eASE;AAAK,IAAA,SAAS,EAAEH,KAAK,CAACc;AAAtB,kBACE;AAAK,IAAA,SAAS,EAAEd,KAAK,CAACe;AAAtB,kBACE,oBAAC,YAAD;AAAc,IAAA,SAAS,EAAEf,KAAK,CAACI,YAA/B;AAA6C,IAAA,QAAQ,EAAEC,QAAvD;AAAiE,IAAA,KAAK,EAAEC;AAAxE,IADF,eAEE;AAAK,IAAA,SAAS,EAAEN,KAAK,CAACO;AAAtB,KAA8BA,KAA9B,CAFF,CADF,eAKE;AAAM,IAAA,SAAS,EAAEP,KAAK,CAACQ,MAAvB;AAA+B,kBAAYG;AAA3C,KACGH,MADH,CALF,CATF,CADF;AAqBD,CA9BD;;AAgCAP,aAAa,CAACe,SAAd,2CAA0B;AACxB,gBAAcnB,SAAS,CAACoB,KAAV,CAAgB;AAC5BV,IAAAA,KAAK,EAAEV,SAAS,CAACqB,MADW;AAE5BV,IAAAA,MAAM,EAAEX,SAAS,CAACqB;AAFU,GAAhB,CADU;AAKxBf,EAAAA,KAAK,EAAEN,SAAS,CAACqB,MALO;AAMxBd,EAAAA,YAAY,EAAEP,SAAS,CAACoB,KAAV,CAAgBlB,YAAY,CAACiB,SAA7B,CANU;AAOxBT,EAAAA,KAAK,EAAEV,SAAS,CAACqB,MAPO;AAQxBV,EAAAA,MAAM,EAAEX,SAAS,CAACqB,MARM;AASxBT,EAAAA,QAAQ,EAAEZ,SAAS,CAACsB;AATI,CAA1B;AAYA,eAAelB,aAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport CardImagePreview from '../../atom/card-image-preview';\nimport ContentBadge from '../../atom/content-badge';\nimport style from './style.css';\n\nconst CourseSection = props => {\n const {\n image,\n contentBadge: {category, label},\n title,\n author,\n position,\n 'aria-label': {title: ariaLabelTitle, author: ariaLabelAuthor}\n } = props;\n return (\n <div\n className={style.container}\n aria-label={ariaLabelTitle}\n data-name={`course-section-${position}`}\n >\n <span className={style.position}>{position}</span>\n <div className={style.containerImage}>\n <CardImagePreview image={image} />\n </div>\n <div className={style.containerInfos}>\n <div className={style.containerMainInfos}>\n <ContentBadge className={style.contentBadge} category={category} label={label} />\n <div className={style.title}>{title}</div>\n </div>\n <span className={style.author} aria-label={ariaLabelAuthor}>\n {author}\n </span>\n </div>\n </div>\n );\n};\n\nCourseSection.propTypes = {\n 'aria-label': PropTypes.shape({\n title: PropTypes.string,\n author: PropTypes.string\n }),\n image: PropTypes.string,\n contentBadge: PropTypes.shape(ContentBadge.propTypes),\n title: PropTypes.string,\n author: PropTypes.string,\n position: PropTypes.number\n};\n\nexport default CourseSection;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value cm_grey_50 from colors;
|
|
3
|
+
@value cm_grey_900 from colors;
|
|
4
|
+
@value cm_grey_500 from colors;
|
|
5
|
+
@value cm_grey_400 from colors;
|
|
6
|
+
|
|
7
|
+
.container {
|
|
8
|
+
align-items: center;
|
|
9
|
+
background-color: cm_grey_50;
|
|
10
|
+
border-radius: 7px;
|
|
11
|
+
display: flex;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
justify-content: start;
|
|
14
|
+
margin-top: 8px;
|
|
15
|
+
padding: 8px 16px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.containerInfos {
|
|
19
|
+
margin-left: 16px;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.containerMainInfos {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.title {
|
|
29
|
+
color: cm_grey_900;
|
|
30
|
+
line-height: 22px;
|
|
31
|
+
font-family: Gilroy;
|
|
32
|
+
font-size: 16px;
|
|
33
|
+
font-weight: bold;
|
|
34
|
+
margin-left: 4px;
|
|
35
|
+
overflow:hidden;
|
|
36
|
+
white-space:nowrap;
|
|
37
|
+
display:inline-block;
|
|
38
|
+
text-overflow:ellipsis;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.author {
|
|
42
|
+
color: cm_grey_500;
|
|
43
|
+
display: block;
|
|
44
|
+
font-family: Gilroy;
|
|
45
|
+
line-height: 20px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.position {
|
|
49
|
+
color: cm_grey_400;
|
|
50
|
+
font-family: Gilroy;
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
line-height: 20px;
|
|
53
|
+
margin: 0 12px 0 14px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.contentBadge {
|
|
57
|
+
font-size: 8px;
|
|
58
|
+
font-weight: bold;
|
|
59
|
+
line-height: 10px;;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.containerImage {
|
|
63
|
+
min-height: 56px;
|
|
64
|
+
min-width: 56px;
|
|
65
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
'aria-label': {
|
|
4
|
+
title: 'aria label title',
|
|
5
|
+
author: 'aria label author'
|
|
6
|
+
},
|
|
7
|
+
title: 'Social networks',
|
|
8
|
+
author: 'Author',
|
|
9
|
+
image: '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',
|
|
10
|
+
contentBadge: {
|
|
11
|
+
label: 'chapter',
|
|
12
|
+
category: 'chapter'
|
|
13
|
+
},
|
|
14
|
+
position: 2
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/chapter.js"],"names":["props","title","author","image","contentBadge","label","category","position"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc;AACZC,MAAAA,KAAK,EAAE,kBADK;AAEZC,MAAAA,MAAM,EAAE;AAFI,KADT;AAKLD,IAAAA,KAAK,EAAE,iBALF;AAMLC,IAAAA,MAAM,EAAE,QANH;AAOLC,IAAAA,KAAK,EACH,4LARG;AASLC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,SADK;AAEZC,MAAAA,QAAQ,EAAE;AAFE,KATT;AAaLC,IAAAA,QAAQ,EAAE;AAbL;AADM,CAAf","sourcesContent":["export default {\n props: {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Social networks',\n author: 'Author',\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 contentBadge: {\n label: 'chapter',\n category: 'chapter'\n },\n position: 2\n }\n};\n"],"file":"chapter.js"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
'aria-label': {
|
|
4
|
+
title: 'aria label title',
|
|
5
|
+
author: 'aria label author'
|
|
6
|
+
},
|
|
7
|
+
title: 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',
|
|
8
|
+
author: 'Author',
|
|
9
|
+
image: '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',
|
|
10
|
+
contentBadge: {
|
|
11
|
+
label: 'course',
|
|
12
|
+
category: 'course'
|
|
13
|
+
},
|
|
14
|
+
position: 1
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=course.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/course.js"],"names":["props","title","author","image","contentBadge","label","category","position"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc;AACZC,MAAAA,KAAK,EAAE,kBADK;AAEZC,MAAAA,MAAM,EAAE;AAFI,KADT;AAKLD,IAAAA,KAAK,EACH,qIANG;AAOLC,IAAAA,MAAM,EAAE,QAPH;AAQLC,IAAAA,KAAK,EACH,4LATG;AAULC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,QADK;AAEZC,MAAAA,QAAQ,EAAE;AAFE,KAVT;AAcLC,IAAAA,QAAQ,EAAE;AAdL;AADM,CAAf","sourcesContent":["export default {\n props: {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title:\n 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',\n author: 'Author',\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 contentBadge: {\n label: 'course',\n category: 'course'\n },\n position: 1\n }\n};\n"],"file":"course.js"}
|
|
@@ -109,15 +109,15 @@ const buildSections = sections => {
|
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
const BuildAction = ({
|
|
112
|
-
action
|
|
112
|
+
action,
|
|
113
|
+
side
|
|
113
114
|
}) => {
|
|
114
115
|
const {
|
|
115
116
|
onClick,
|
|
116
117
|
text,
|
|
117
118
|
disabled = false,
|
|
118
119
|
icon,
|
|
119
|
-
'aria-label': ariaLabel
|
|
120
|
-
side
|
|
120
|
+
'aria-label': ariaLabel
|
|
121
121
|
} = action;
|
|
122
122
|
const handleClick = useMemo(() => () => onClick(), [onClick]);
|
|
123
123
|
if (!action) return null;
|
|
@@ -215,10 +215,10 @@ BuildAction.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
215
215
|
icon: PropTypes.string,
|
|
216
216
|
disabled: PropTypes.bool,
|
|
217
217
|
text: PropTypes.string,
|
|
218
|
-
side: PropTypes.string,
|
|
219
218
|
onClick: PropTypes.func,
|
|
220
219
|
'aria-label': PropTypes.string
|
|
221
|
-
})
|
|
220
|
+
}),
|
|
221
|
+
side: PropTypes.string
|
|
222
222
|
} : {};
|
|
223
223
|
WizardSummary.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
224
224
|
title: PropTypes.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/wizard-summary/index.js"],"names":["React","useMemo","useState","useCallback","useRef","PropTypes","classnames","NovaCompositionNavigationArrowDown","ArrowDownIcon","ContentBadge","ButtonLink","style","buildItemsOfSection","items","map","item","index","type","title","value","category","label","author","unsaved","contentWrapper","contentCounter","contentItem","content","contentTitle","__html","text","valueSimpleText","buildSectionHeader","section","counterText","sectionHeader","buildSections","sections","itemsView","sectionWrapper","BuildAction","action","onClick","disabled","icon","ariaLabel","side","handleClick","buttonProps","position","button","checkOnClose","checked","summaryElement","onCloseSummary","clickEvent","current","contains","target","WizardSummary","props","sectionsView","idSwitch","setChecked","handleOnChange","document","addEventListener","removeEventListener","container","desktopSummaryTitle","checkbox","summary","tabletSummaryHeader","tabletSummaryTitle","tabletSummaryIcon","summarySections","actionZone","propTypes","shape","string","bool","func","arrayOf","oneOfType","oneOf"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,QAAxB,EAAkCC,WAAlC,EAA+CC,MAA/C,QAA4D,OAA5D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SAAQC,kCAAkC,IAAIC,aAA9C,QAAkE,0BAAlE;AACA,OAAOC,YAAP,MAAyB,0BAAzB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,mBAAmB,GAAGC,KAAK,IAAI;AACnC,SAAOA,KAAK,CAACC,GAAN,CAAU,CAACC,IAAD,EAAOC,KAAP,KAAiB;AAChC,UAAM;AAACC,MAAAA;AAAD,QAASF,IAAf;;AACA,YA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B,QATwB,CAAhB,CAFI;AAadlE,MAAAA,KAAK,EAAEb,SAAS,CAAC0E,MAbH;AAcd1D,MAAAA,KAAK,EAAEhB,SAAS,CAAC0E,MAdH;AAedzD,MAAAA,MAAM,EAAEjB,SAAS,CAAC0E,MAfJ;AAgBdxD,MAAAA,OAAO,EAAElB,SAAS,CAAC2E;AAhBL,KAAhB,CAXkB,CAApB,CADK,CAFO;AAkCd9C,IAAAA,WAAW,EAAE7B,SAAS,CAAC0E;AAlCT,GAAhB,CADQ,CAHc;AAyCxBtC,EAAAA,MAAM,EAAED,WAAW,CAACqC,SAAZ,CAAsBpC;AAzCN,CAA1B;AA4CA,eAAekB,aAAf","sourcesContent":["import React, {useMemo, useState, useCallback, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {uniqueId} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowDown as ArrowDownIcon} from '@coorpacademy/nova-icons';\nimport ContentBadge from '../../atom/content-badge';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst buildItemsOfSection = items => {\n return items.map((item, index) => {\n const {type} = item;\n switch (type) {\n case 'mainElement':\n return (\n <li key={`${item.title}-${index}`} data-name={item.title}>\n <span className={style.title}>{item.title}</span>\n <span className={style.value}>{item.value}</span>\n </li>\n );\n case 'content': {\n const {category, label, title, author, unsaved = false} = item;\n return (\n <li className={style.contentWrapper} key={`${title}-${index}`} data-name={item.title}>\n <span className={style.contentCounter}>{index + 1}</span>\n <div className={style.contentItem}>\n <div className={style.content}>\n <ContentBadge category={category} label={label} />\n <span\n className={classnames(style.contentTitle, unsaved && style.unsaved)}\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n {author ? <span className={style.author}>{author}</span> : null}\n </div>\n </li>\n );\n }\n case 'text':\n default: {\n const {text, unsaved = false} = item;\n return (\n <li key={`${item.text}-${index}`} data-name={item.title}>\n <span className={classnames(style.valueSimpleText, unsaved && style.unsaved)}>\n {text}\n </span>\n </li>\n );\n }\n }\n });\n};\n\nconst buildSectionHeader = section => {\n const {title, counterText} = section;\n if (!title) {\n return null;\n }\n return (\n <div className={style.sectionHeader}>\n <span className={style.title}>{title}</span>\n {counterText ? <span className={style.counterText}>{counterText}</span> : null}\n </div>\n );\n};\n\nconst buildSections = sections => {\n return sections.map((section, index) => {\n const sectionHeader = buildSectionHeader(section);\n const itemsView = buildItemsOfSection(section.items);\n return (\n <div\n key={`summary-section-${index}`}\n data-step={index}\n data-name={`summary-section-${index}`}\n className={style.sectionWrapper}\n >\n {sectionHeader}\n <ul>{itemsView}</ul>\n </div>\n );\n });\n};\n\nconst BuildAction = ({action}) => {\n const {onClick, text, disabled = false, icon, 'aria-label': ariaLabel, side} = action;\n const handleClick = useMemo(() => () => onClick(), [onClick]);\n\n if (!action) return null;\n\n const buttonProps = {\n type: 'text',\n label: text,\n disabled,\n 'aria-label': ariaLabel,\n 'data-name': `${icon}-button-${side}`,\n onClick: handleClick,\n icon: {\n position: 'left',\n type: icon\n }\n };\n\n return (\n <div className={style.button}>\n <ButtonLink {...buttonProps} />\n </div>\n );\n};\n\nconst checkOnClose = (checked, summaryElement, onCloseSummary, clickEvent) => {\n if (checked) {\n if (\n summaryElement &&\n summaryElement.current &&\n !summaryElement.current.contains(clickEvent.target)\n ) {\n onCloseSummary();\n }\n }\n};\n\nconst WizardSummary = props => {\n const {title, sections, action, side} = props;\n const sectionsView = buildSections(sections);\n const idSwitch = uniqueId('open-summary-wizard');\n const summaryElement = useRef(null);\n const [checked, setChecked] = useState(false);\n\n const onCloseSummary = () => setChecked(false);\n const handleOnChange = useCallback(() => {\n if (!checked) {\n document.addEventListener('click', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n document.addEventListener('touchstart', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n } else {\n document.removeEventListener('click', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n document.removeEventListener('touchstart', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n }\n setChecked(!checked);\n }, [checked]);\n\n return (\n <div className={style.container} ref={summaryElement}>\n <span className={style.desktopSummaryTitle} data-name={`summary-title-${side}`}>\n {title}\n </span>\n <input\n type=\"checkbox\"\n id={idSwitch}\n name=\"toogle\"\n title={idSwitch}\n className={style.checkbox}\n data-name={`summary-checkbox-${side}`}\n checked={checked}\n onChange={handleOnChange}\n />\n <div className={style.summary}>\n <div className={style.tabletSummaryHeader}>\n <label htmlFor={idSwitch}>\n <span className={style.tabletSummaryTitle}>{title}</span>\n <ArrowDownIcon className={style.tabletSummaryIcon} />\n </label>\n </div>\n <div className={style.summarySections} data-name={`summary-section-${side}`}>\n {sectionsView}\n </div>\n </div>\n <div className={style.actionZone} data-name={`summary-actions-${side}`}>\n <BuildAction action={action} side={side} />\n </div>\n </div>\n );\n};\n\nBuildAction.propTypes = {\n action: PropTypes.shape({\n icon: PropTypes.string,\n disabled: PropTypes.bool,\n text: PropTypes.string,\n side: PropTypes.string,\n onClick: PropTypes.func,\n 'aria-label': PropTypes.string\n })\n};\n\nWizardSummary.propTypes = {\n title: PropTypes.string,\n side: PropTypes.string,\n sections: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n items: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n type: PropTypes.string,\n title: PropTypes.string,\n value: PropTypes.string\n }),\n PropTypes.shape({\n type: PropTypes.string,\n text: PropTypes.string,\n unsaved: PropTypes.bool\n }),\n PropTypes.shape({\n type: PropTypes.string,\n category: PropTypes.oneOf([\n 'base',\n 'advanced',\n 'coach',\n 'chapter',\n 'scorm',\n 'video',\n 'article',\n 'podcast',\n 'course'\n ]),\n title: PropTypes.string,\n label: PropTypes.string,\n author: PropTypes.string,\n unsaved: PropTypes.bool\n })\n ])\n ),\n counterText: PropTypes.string\n })\n ),\n action: BuildAction.propTypes.action\n};\n\nexport default WizardSummary;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/wizard-summary/index.js"],"names":["React","useMemo","useState","useCallback","useRef","PropTypes","classnames","NovaCompositionNavigationArrowDown","ArrowDownIcon","ContentBadge","ButtonLink","style","buildItemsOfSection","items","map","item","index","type","title","value","category","label","author","unsaved","contentWrapper","contentCounter","contentItem","content","contentTitle","__html","text","valueSimpleText","buildSectionHeader","section","counterText","sectionHeader","buildSections","sections","itemsView","sectionWrapper","BuildAction","action","side","onClick","disabled","icon","ariaLabel","handleClick","buttonProps","position","button","checkOnClose","checked","summaryElement","onCloseSummary","clickEvent","current","contains","target","WizardSummary","props","sectionsView","idSwitch","setChecked","handleOnChange","document","addEventListener","removeEventListener","container","desktopSummaryTitle","checkbox","summary","tabletSummaryHeader","tabletSummaryTitle","tabletSummaryIcon","summarySections","actionZone","propTypes","shape","string","bool","func","arrayOf","oneOfType","oneOf"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,QAAxB,EAAkCC,WAAlC,EAA+CC,MAA/C,QAA4D,OAA5D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SAAQC,kCAAkC,IAAIC,aAA9C,QAAkE,0BAAlE;AACA,OAAOC,YAAP,MAAyB,0BAAzB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,mBAAmB,GAAGC,KAAK,IAAI;AACnC,SAAOA,KAAK,CAACC,GAAN,CAAU,CAACC,IAAD,EAAOC,KAAP,KAAiB;AAChC,UAAM;AAACC,MAAAA;AAAD,QAASF,IAAf;;AACA,YAAQE,IAAR;AACE,WAAK,aAAL;AACE,4BACE;AAAI,UAAA,GAAG,EAAG,GAAEF,IAAI,CAACG,KAAM,IAAGF,KAAM,EAAhC;AAAmC,uBAAWD,IAAI,CAACG;AAAnD,wBACE;AAAM,U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MAfJ;AAgBdxD,MAAAA,OAAO,EAAElB,SAAS,CAAC2E;AAhBL,KAAhB,CAXkB,CAApB,CADK,CAFO;AAkCd9C,IAAAA,WAAW,EAAE7B,SAAS,CAAC0E;AAlCT,GAAhB,CADQ,CAHc;AAyCxBtC,EAAAA,MAAM,EAAED,WAAW,CAACqC,SAAZ,CAAsBpC;AAzCN,CAA1B;AA4CA,eAAekB,aAAf","sourcesContent":["import React, {useMemo, useState, useCallback, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {uniqueId} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowDown as ArrowDownIcon} from '@coorpacademy/nova-icons';\nimport ContentBadge from '../../atom/content-badge';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst buildItemsOfSection = items => {\n return items.map((item, index) => {\n const {type} = item;\n switch (type) {\n case 'mainElement':\n return (\n <li key={`${item.title}-${index}`} data-name={item.title}>\n <span className={style.title}>{item.title}</span>\n <span className={style.value}>{item.value}</span>\n </li>\n );\n case 'content': {\n const {category, label, title, author, unsaved = false} = item;\n return (\n <li className={style.contentWrapper} key={`${title}-${index}`} data-name={item.title}>\n <span className={style.contentCounter}>{index + 1}</span>\n <div className={style.contentItem}>\n <div className={style.content}>\n <ContentBadge category={category} label={label} />\n <span\n className={classnames(style.contentTitle, unsaved && style.unsaved)}\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n {author ? <span className={style.author}>{author}</span> : null}\n </div>\n </li>\n );\n }\n case 'text':\n default: {\n const {text, unsaved = false} = item;\n return (\n <li key={`${item.text}-${index}`} data-name={item.title}>\n <span className={classnames(style.valueSimpleText, unsaved && style.unsaved)}>\n {text}\n </span>\n </li>\n );\n }\n }\n });\n};\n\nconst buildSectionHeader = section => {\n const {title, counterText} = section;\n if (!title) {\n return null;\n }\n return (\n <div className={style.sectionHeader}>\n <span className={style.title}>{title}</span>\n {counterText ? <span className={style.counterText}>{counterText}</span> : null}\n </div>\n );\n};\n\nconst buildSections = sections => {\n return sections.map((section, index) => {\n const sectionHeader = buildSectionHeader(section);\n const itemsView = buildItemsOfSection(section.items);\n return (\n <div\n key={`summary-section-${index}`}\n data-step={index}\n data-name={`summary-section-${index}`}\n className={style.sectionWrapper}\n >\n {sectionHeader}\n <ul>{itemsView}</ul>\n </div>\n );\n });\n};\n\nconst BuildAction = ({action, side}) => {\n const {onClick, text, disabled = false, icon, 'aria-label': ariaLabel} = action;\n const handleClick = useMemo(() => () => onClick(), [onClick]);\n\n if (!action) return null;\n\n const buttonProps = {\n type: 'text',\n label: text,\n disabled,\n 'aria-label': ariaLabel,\n 'data-name': `${icon}-button-${side}`,\n onClick: handleClick,\n icon: {\n position: 'left',\n type: icon\n }\n };\n\n return (\n <div className={style.button}>\n <ButtonLink {...buttonProps} />\n </div>\n );\n};\n\nconst checkOnClose = (checked, summaryElement, onCloseSummary, clickEvent) => {\n if (checked) {\n if (\n summaryElement &&\n summaryElement.current &&\n !summaryElement.current.contains(clickEvent.target)\n ) {\n onCloseSummary();\n }\n }\n};\n\nconst WizardSummary = props => {\n const {title, sections, action, side} = props;\n const sectionsView = buildSections(sections);\n const idSwitch = uniqueId('open-summary-wizard');\n const summaryElement = useRef(null);\n const [checked, setChecked] = useState(false);\n\n const onCloseSummary = () => setChecked(false);\n const handleOnChange = useCallback(() => {\n if (!checked) {\n document.addEventListener('click', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n document.addEventListener('touchstart', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n } else {\n document.removeEventListener('click', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n document.removeEventListener('touchstart', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n }\n setChecked(!checked);\n }, [checked]);\n\n return (\n <div className={style.container} ref={summaryElement}>\n <span className={style.desktopSummaryTitle} data-name={`summary-title-${side}`}>\n {title}\n </span>\n <input\n type=\"checkbox\"\n id={idSwitch}\n name=\"toogle\"\n title={idSwitch}\n className={style.checkbox}\n data-name={`summary-checkbox-${side}`}\n checked={checked}\n onChange={handleOnChange}\n />\n <div className={style.summary}>\n <div className={style.tabletSummaryHeader}>\n <label htmlFor={idSwitch}>\n <span className={style.tabletSummaryTitle}>{title}</span>\n <ArrowDownIcon className={style.tabletSummaryIcon} />\n </label>\n </div>\n <div className={style.summarySections} data-name={`summary-section-${side}`}>\n {sectionsView}\n </div>\n </div>\n <div className={style.actionZone} data-name={`summary-actions-${side}`}>\n <BuildAction action={action} side={side} />\n </div>\n </div>\n );\n};\n\nBuildAction.propTypes = {\n action: PropTypes.shape({\n icon: PropTypes.string,\n disabled: PropTypes.bool,\n text: PropTypes.string,\n onClick: PropTypes.func,\n 'aria-label': PropTypes.string\n }),\n side: PropTypes.string\n};\n\nWizardSummary.propTypes = {\n title: PropTypes.string,\n side: PropTypes.string,\n sections: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n items: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n type: PropTypes.string,\n title: PropTypes.string,\n value: PropTypes.string\n }),\n PropTypes.shape({\n type: PropTypes.string,\n text: PropTypes.string,\n unsaved: PropTypes.bool\n }),\n PropTypes.shape({\n type: PropTypes.string,\n category: PropTypes.oneOf([\n 'base',\n 'advanced',\n 'coach',\n 'chapter',\n 'scorm',\n 'video',\n 'article',\n 'podcast',\n 'course'\n ]),\n title: PropTypes.string,\n label: PropTypes.string,\n author: PropTypes.string,\n unsaved: PropTypes.bool\n })\n ])\n ),\n counterText: PropTypes.string\n })\n ),\n action: BuildAction.propTypes.action\n};\n\nexport default WizardSummary;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
+
|
|
5
|
+
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
+
|
|
7
|
+
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
+
|
|
9
|
+
var _ = _interopRequireDefault(require(".."));
|
|
10
|
+
|
|
11
|
+
var _adaptivAndDisabled = _interopRequireDefault(require("./fixtures/adaptiv-and-disabled"));
|
|
12
|
+
|
|
13
|
+
var _adaptiv = _interopRequireDefault(require("./fixtures/adaptiv"));
|
|
14
|
+
|
|
15
|
+
var _arabic = _interopRequireDefault(require("./fixtures/arabic"));
|
|
16
|
+
|
|
17
|
+
var _article = _interopRequireDefault(require("./fixtures/article"));
|
|
18
|
+
|
|
19
|
+
var _coorpmanager = _interopRequireDefault(require("./fixtures/coorpmanager"));
|
|
20
|
+
|
|
21
|
+
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
22
|
+
|
|
23
|
+
var _disabled = _interopRequireDefault(require("./fixtures/disabled"));
|
|
24
|
+
|
|
25
|
+
var _empty = _interopRequireDefault(require("./fixtures/empty"));
|
|
26
|
+
|
|
27
|
+
var _externalContent = _interopRequireDefault(require("./fixtures/external-content"));
|
|
28
|
+
|
|
29
|
+
var _favorite = _interopRequireDefault(require("./fixtures/favorite"));
|
|
30
|
+
|
|
31
|
+
var _freerunAndDisabled = _interopRequireDefault(require("./fixtures/freerun-and-disabled"));
|
|
32
|
+
|
|
33
|
+
var _freerun = _interopRequireDefault(require("./fixtures/freerun"));
|
|
34
|
+
|
|
35
|
+
var _podcast = _interopRequireDefault(require("./fixtures/podcast"));
|
|
36
|
+
|
|
37
|
+
var _scorm = _interopRequireDefault(require("./fixtures/scorm"));
|
|
38
|
+
|
|
39
|
+
var _selectableFalse = _interopRequireDefault(require("./fixtures/selectable-false"));
|
|
40
|
+
|
|
41
|
+
var _selectableTrue = _interopRequireDefault(require("./fixtures/selectable-true"));
|
|
42
|
+
|
|
43
|
+
var _video = _interopRequireDefault(require("./fixtures/video"));
|
|
44
|
+
|
|
45
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
46
|
+
|
|
47
|
+
(0, _ava.default)('Atom › AtomCardImagePreview > should have valid propTypes', t => {
|
|
48
|
+
t.pass();
|
|
49
|
+
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
50
|
+
t.not(value, undefined, `PropType for "Atom.AtomCardImagePreview.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › AdaptivAndDisabled › should be rendered', _renderComponent.default, _.default, _adaptivAndDisabled.default);
|
|
54
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › Adaptiv › should be rendered', _renderComponent.default, _.default, _adaptiv.default);
|
|
55
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › Arabic › should be rendered', _renderComponent.default, _.default, _arabic.default);
|
|
56
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › Article › should be rendered', _renderComponent.default, _.default, _article.default);
|
|
57
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › Coorpmanager › should be rendered', _renderComponent.default, _.default, _coorpmanager.default);
|
|
58
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
59
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › Disabled › should be rendered', _renderComponent.default, _.default, _disabled.default);
|
|
60
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › Empty › should be rendered', _renderComponent.default, _.default, _empty.default);
|
|
61
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › ExternalContent › should be rendered', _renderComponent.default, _.default, _externalContent.default);
|
|
62
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › Favorite › should be rendered', _renderComponent.default, _.default, _favorite.default);
|
|
63
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › FreerunAndDisabled › should be rendered', _renderComponent.default, _.default, _freerunAndDisabled.default);
|
|
64
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › Freerun › should be rendered', _renderComponent.default, _.default, _freerun.default);
|
|
65
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › Podcast › should be rendered', _renderComponent.default, _.default, _podcast.default);
|
|
66
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › Scorm › should be rendered', _renderComponent.default, _.default, _scorm.default);
|
|
67
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › SelectableFalse › should be rendered', _renderComponent.default, _.default, _selectableFalse.default);
|
|
68
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › SelectableTrue › should be rendered', _renderComponent.default, _.default, _selectableTrue.default);
|
|
69
|
+
(0, _ava.default)('Atom › AtomCardImagePreview › Video › should be rendered', _renderComponent.default, _.default, _video.default);
|
|
70
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/card-image-preview/test/fixtures.js"],"names":["t","pass","AtomCardImagePreview","propTypes","value","key","not","undefined","renderComponentMacro","fixtureAdaptivAndDisabled","fixtureAdaptiv","fixtureArabic","fixtureArticle","fixtureCoorpmanager","fixtureDefault","fixtureDisabled","fixtureEmpty","fixtureExternalContent","fixtureFavorite","fixtureFreerunAndDisabled","fixtureFreerun","fixturePodcast","fixtureScorm","fixtureSelectableFalse","fixtureSelectableTrue","fixtureVideo"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,2DAAL,EAAkEA,CAAC,IAAI;AACrEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAqBC,SAA7B,EAAwC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,qDAAoDF,GAAI,mEAAjF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Each';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomCardImagePreview 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('Atom › AtomCardImagePreview > should have valid propTypes', t => {\n t.pass();\n forEach(AtomCardImagePreview.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomCardImagePreview.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomCardImagePreview › AdaptivAndDisabled › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureAdaptivAndDisabled);\ntest('Atom › AtomCardImagePreview › Adaptiv › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureAdaptiv);\ntest('Atom › AtomCardImagePreview › Arabic › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureArabic);\ntest('Atom › AtomCardImagePreview › Article › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureArticle);\ntest('Atom › AtomCardImagePreview › Coorpmanager › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureCoorpmanager);\ntest('Atom › AtomCardImagePreview › Default › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureDefault);\ntest('Atom › AtomCardImagePreview › Disabled › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureDisabled);\ntest('Atom › AtomCardImagePreview › Empty › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureEmpty);\ntest('Atom › AtomCardImagePreview › ExternalContent › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureExternalContent);\ntest('Atom › AtomCardImagePreview › Favorite › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureFavorite);\ntest('Atom › AtomCardImagePreview › FreerunAndDisabled › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureFreerunAndDisabled);\ntest('Atom › AtomCardImagePreview › Freerun › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureFreerun);\ntest('Atom › AtomCardImagePreview › Podcast › should be rendered', renderComponentMacro, AtomCardImagePreview, fixturePodcast);\ntest('Atom › AtomCardImagePreview › Scorm › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureScorm);\ntest('Atom › AtomCardImagePreview › SelectableFalse › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureSelectableFalse);\ntest('Atom › AtomCardImagePreview › SelectableTrue › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureSelectableTrue);\ntest('Atom › AtomCardImagePreview › Video › should be rendered', renderComponentMacro, AtomCardImagePreview, fixtureVideo);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _cardImagePreview = _interopRequireDefault(require("../../atom/card-image-preview"));
|
|
11
|
+
|
|
12
|
+
var _contentBadge = _interopRequireDefault(require("../../atom/content-badge"));
|
|
13
|
+
|
|
14
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
const CourseSection = props => {
|
|
19
|
+
const {
|
|
20
|
+
image,
|
|
21
|
+
contentBadge: {
|
|
22
|
+
category,
|
|
23
|
+
label
|
|
24
|
+
},
|
|
25
|
+
title,
|
|
26
|
+
author,
|
|
27
|
+
position,
|
|
28
|
+
'aria-label': {
|
|
29
|
+
title: ariaLabelTitle,
|
|
30
|
+
author: ariaLabelAuthor
|
|
31
|
+
}
|
|
32
|
+
} = props;
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
+
className: _style.default.container,
|
|
35
|
+
"aria-label": ariaLabelTitle,
|
|
36
|
+
"data-name": `course-section-${position}`
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
38
|
+
className: _style.default.position
|
|
39
|
+
}, position), /*#__PURE__*/_react.default.createElement("div", {
|
|
40
|
+
className: _style.default.containerImage
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement(_cardImagePreview.default, {
|
|
42
|
+
image: image
|
|
43
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
44
|
+
className: _style.default.containerInfos
|
|
45
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
46
|
+
className: _style.default.containerMainInfos
|
|
47
|
+
}, /*#__PURE__*/_react.default.createElement(_contentBadge.default, {
|
|
48
|
+
className: _style.default.contentBadge,
|
|
49
|
+
category: category,
|
|
50
|
+
label: label
|
|
51
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
52
|
+
className: _style.default.title
|
|
53
|
+
}, title)), /*#__PURE__*/_react.default.createElement("span", {
|
|
54
|
+
className: _style.default.author,
|
|
55
|
+
"aria-label": ariaLabelAuthor
|
|
56
|
+
}, author)));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
CourseSection.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
60
|
+
'aria-label': _propTypes.default.shape({
|
|
61
|
+
title: _propTypes.default.string,
|
|
62
|
+
author: _propTypes.default.string
|
|
63
|
+
}),
|
|
64
|
+
image: _propTypes.default.string,
|
|
65
|
+
contentBadge: _propTypes.default.shape(_contentBadge.default.propTypes),
|
|
66
|
+
title: _propTypes.default.string,
|
|
67
|
+
author: _propTypes.default.string,
|
|
68
|
+
position: _propTypes.default.number
|
|
69
|
+
} : {};
|
|
70
|
+
var _default = CourseSection;
|
|
71
|
+
exports.default = _default;
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/course-section/index.js"],"names":["CourseSection","props","image","contentBadge","category","label","title","author","position","ariaLabelTitle","ariaLabelAuthor","style","container","containerImage","containerInfos","containerMainInfos","propTypes","PropTypes","shape","string","ContentBadge","number"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,aAAa,GAAGC,KAAK,IAAI;AAC7B,QAAM;AACJC,IAAAA,KADI;AAEJC,IAAAA,YAAY,EAAE;AAACC,MAAAA,QAAD;AAAWC,MAAAA;AAAX,KAFV;AAGJC,IAAAA,KAHI;AAIJC,IAAAA,MAJI;AAKJC,IAAAA,QALI;AAMJ,kBAAc;AAACF,MAAAA,KAAK,EAAEG,cAAR;AAAwBF,MAAAA,MAAM,EAAEG;AAAhC;AANV,MAOFT,KAPJ;AAQA,sBACE;AACE,IAAA,SAAS,EAAEU,eAAMC,SADnB;AAEE,kBAAYH,cAFd;AAGE,iBAAY,kBAAiBD,QAAS;AAHxC,kBAKE;AAAM,IAAA,SAAS,EAAEG,eAAMH;AAAvB,KAAkCA,QAAlC,CALF,eAME;AAAK,IAAA,SAAS,EAAEG,eAAME;AAAtB,kBACE,6BAAC,yBAAD;AAAkB,IAAA,KAAK,EAAEX;AAAzB,IADF,CANF,eASE;AAAK,IAAA,SAAS,EAAES,eAAMG;AAAtB,kBACE;AAAK,IAAA,SAAS,EAAEH,eAAMI;AAAtB,kBACE,6BAAC,qBAAD;AAAc,IAAA,SAAS,EAAEJ,eAAMR,YAA/B;AAA6C,IAAA,QAAQ,EAAEC,QAAvD;AAAiE,IAAA,KAAK,EAAEC;AAAxE,IADF,eAEE;AAAK,IAAA,SAAS,EAAEM,eAAML;AAAtB,KAA8BA,KAA9B,CAFF,CADF,eAKE;AAAM,IAAA,SAAS,EAAEK,eAAMJ,MAAvB;AAA+B,kBAAYG;AAA3C,KACGH,MADH,CALF,CATF,CADF;AAqBD,CA9BD;;AAgCAP,aAAa,CAACgB,SAAd,2CAA0B;AACxB,gBAAcC,mBAAUC,KAAV,CAAgB;AAC5BZ,IAAAA,KAAK,EAAEW,mBAAUE,MADW;AAE5BZ,IAAAA,MAAM,EAAEU,mBAAUE;AAFU,GAAhB,CADU;AAKxBjB,EAAAA,KAAK,EAAEe,mBAAUE,MALO;AAMxBhB,EAAAA,YAAY,EAAEc,mBAAUC,KAAV,CAAgBE,sBAAaJ,SAA7B,CANU;AAOxBV,EAAAA,KAAK,EAAEW,mBAAUE,MAPO;AAQxBZ,EAAAA,MAAM,EAAEU,mBAAUE,MARM;AASxBX,EAAAA,QAAQ,EAAES,mBAAUI;AATI,CAA1B;eAYerB,a","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport CardImagePreview from '../../atom/card-image-preview';\nimport ContentBadge from '../../atom/content-badge';\nimport style from './style.css';\n\nconst CourseSection = props => {\n const {\n image,\n contentBadge: {category, label},\n title,\n author,\n position,\n 'aria-label': {title: ariaLabelTitle, author: ariaLabelAuthor}\n } = props;\n return (\n <div\n className={style.container}\n aria-label={ariaLabelTitle}\n data-name={`course-section-${position}`}\n >\n <span className={style.position}>{position}</span>\n <div className={style.containerImage}>\n <CardImagePreview image={image} />\n </div>\n <div className={style.containerInfos}>\n <div className={style.containerMainInfos}>\n <ContentBadge className={style.contentBadge} category={category} label={label} />\n <div className={style.title}>{title}</div>\n </div>\n <span className={style.author} aria-label={ariaLabelAuthor}>\n {author}\n </span>\n </div>\n </div>\n );\n};\n\nCourseSection.propTypes = {\n 'aria-label': PropTypes.shape({\n title: PropTypes.string,\n author: PropTypes.string\n }),\n image: PropTypes.string,\n contentBadge: PropTypes.shape(ContentBadge.propTypes),\n title: PropTypes.string,\n author: PropTypes.string,\n position: PropTypes.number\n};\n\nexport default CourseSection;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value cm_grey_50 from colors;
|
|
3
|
+
@value cm_grey_900 from colors;
|
|
4
|
+
@value cm_grey_500 from colors;
|
|
5
|
+
@value cm_grey_400 from colors;
|
|
6
|
+
|
|
7
|
+
.container {
|
|
8
|
+
align-items: center;
|
|
9
|
+
background-color: cm_grey_50;
|
|
10
|
+
border-radius: 7px;
|
|
11
|
+
display: flex;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
justify-content: start;
|
|
14
|
+
margin-top: 8px;
|
|
15
|
+
padding: 8px 16px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.containerInfos {
|
|
19
|
+
margin-left: 16px;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.containerMainInfos {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.title {
|
|
29
|
+
color: cm_grey_900;
|
|
30
|
+
line-height: 22px;
|
|
31
|
+
font-family: Gilroy;
|
|
32
|
+
font-size: 16px;
|
|
33
|
+
font-weight: bold;
|
|
34
|
+
margin-left: 4px;
|
|
35
|
+
overflow:hidden;
|
|
36
|
+
white-space:nowrap;
|
|
37
|
+
display:inline-block;
|
|
38
|
+
text-overflow:ellipsis;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.author {
|
|
42
|
+
color: cm_grey_500;
|
|
43
|
+
display: block;
|
|
44
|
+
font-family: Gilroy;
|
|
45
|
+
line-height: 20px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.position {
|
|
49
|
+
color: cm_grey_400;
|
|
50
|
+
font-family: Gilroy;
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
line-height: 20px;
|
|
53
|
+
margin: 0 12px 0 14px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.contentBadge {
|
|
57
|
+
font-size: 8px;
|
|
58
|
+
font-weight: bold;
|
|
59
|
+
line-height: 10px;;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.containerImage {
|
|
63
|
+
min-height: 56px;
|
|
64
|
+
min-width: 56px;
|
|
65
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _default = {
|
|
6
|
+
props: {
|
|
7
|
+
'aria-label': {
|
|
8
|
+
title: 'aria label title',
|
|
9
|
+
author: 'aria label author'
|
|
10
|
+
},
|
|
11
|
+
title: 'Social networks',
|
|
12
|
+
author: 'Author',
|
|
13
|
+
image: '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',
|
|
14
|
+
contentBadge: {
|
|
15
|
+
label: 'chapter',
|
|
16
|
+
category: 'chapter'
|
|
17
|
+
},
|
|
18
|
+
position: 2
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
22
|
+
//# sourceMappingURL=chapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/chapter.js"],"names":["props","title","author","image","contentBadge","label","category","position"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc;AACZC,MAAAA,KAAK,EAAE,kBADK;AAEZC,MAAAA,MAAM,EAAE;AAFI,KADT;AAKLD,IAAAA,KAAK,EAAE,iBALF;AAMLC,IAAAA,MAAM,EAAE,QANH;AAOLC,IAAAA,KAAK,EACH,4LARG;AASLC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,SADK;AAEZC,MAAAA,QAAQ,EAAE;AAFE,KATT;AAaLC,IAAAA,QAAQ,EAAE;AAbL;AADM,C","sourcesContent":["export default {\n props: {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title: 'Social networks',\n author: 'Author',\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 contentBadge: {\n label: 'chapter',\n category: 'chapter'\n },\n position: 2\n }\n};\n"],"file":"chapter.js"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _default = {
|
|
6
|
+
props: {
|
|
7
|
+
'aria-label': {
|
|
8
|
+
title: 'aria label title',
|
|
9
|
+
author: 'aria label author'
|
|
10
|
+
},
|
|
11
|
+
title: 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',
|
|
12
|
+
author: 'Author',
|
|
13
|
+
image: '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',
|
|
14
|
+
contentBadge: {
|
|
15
|
+
label: 'course',
|
|
16
|
+
category: 'course'
|
|
17
|
+
},
|
|
18
|
+
position: 1
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
22
|
+
//# sourceMappingURL=course.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/course-section/test/fixtures/course.js"],"names":["props","title","author","image","contentBadge","label","category","position"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,kBAAc;AACZC,MAAAA,KAAK,EAAE,kBADK;AAEZC,MAAAA,MAAM,EAAE;AAFI,KADT;AAKLD,IAAAA,KAAK,EACH,qIANG;AAOLC,IAAAA,MAAM,EAAE,QAPH;AAQLC,IAAAA,KAAK,EACH,4LATG;AAULC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,QADK;AAEZC,MAAAA,QAAQ,EAAE;AAFE,KAVT;AAcLC,IAAAA,QAAQ,EAAE;AAdL;AADM,C","sourcesContent":["export default {\n props: {\n 'aria-label': {\n title: 'aria label title',\n author: 'aria label author'\n },\n title:\n 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',\n author: 'Author',\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 contentBadge: {\n label: 'course',\n category: 'course'\n },\n position: 1\n }\n};\n"],"file":"course.js"}
|
|
@@ -127,15 +127,15 @@ const buildSections = sections => {
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
const BuildAction = ({
|
|
130
|
-
action
|
|
130
|
+
action,
|
|
131
|
+
side
|
|
131
132
|
}) => {
|
|
132
133
|
const {
|
|
133
134
|
onClick,
|
|
134
135
|
text,
|
|
135
136
|
disabled = false,
|
|
136
137
|
icon,
|
|
137
|
-
'aria-label': ariaLabel
|
|
138
|
-
side
|
|
138
|
+
'aria-label': ariaLabel
|
|
139
139
|
} = action;
|
|
140
140
|
const handleClick = (0, _react.useMemo)(() => () => onClick(), [onClick]);
|
|
141
141
|
if (!action) return null;
|
|
@@ -231,10 +231,10 @@ BuildAction.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
231
231
|
icon: _propTypes.default.string,
|
|
232
232
|
disabled: _propTypes.default.bool,
|
|
233
233
|
text: _propTypes.default.string,
|
|
234
|
-
side: _propTypes.default.string,
|
|
235
234
|
onClick: _propTypes.default.func,
|
|
236
235
|
'aria-label': _propTypes.default.string
|
|
237
|
-
})
|
|
236
|
+
}),
|
|
237
|
+
side: _propTypes.default.string
|
|
238
238
|
} : {};
|
|
239
239
|
WizardSummary.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
240
240
|
title: _propTypes.default.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/wizard-summary/index.js"],"names":["buildItemsOfSection","items","map","item","index","type","title","style","value","category","label","author","unsaved","contentWrapper","contentCounter","contentItem","content","contentTitle","__html","text","valueSimpleText","buildSectionHeader","section","counterText","sectionHeader","buildSections","sections","itemsView","sectionWrapper","BuildAction","action","onClick","disabled","icon","ariaLabel","side","handleClick","buttonProps","position","button","checkOnClose","checked","summaryElement","onCloseSummary","clickEvent","current","contains","target","WizardSummary","props","sectionsView","idSwitch","setChecked","handleOnChange","document","addEventListener","removeEventListener","container","desktopSummaryTitle","checkbox","summary","tabletSummaryHeader","tabletSummaryTitle","tabletSummaryIcon","summarySections","actionZone","propTypes","PropTypes","shape","string","bool","func","arrayOf","oneOfType","oneOf"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,mBAAmB,GAAGC,KAAK,IAAI;AACnC,SAAOA,KAAK,CAACC,GAAN,CAAU,CAACC,IAAD,EAAOC,KAAP,KAAiB;AAChC,UAAM;AAACC,MAAAA;AAAD,QAASF,IAAf;;AACA,YAAQE,IAAR;AACE,WAAK,aAAL;AACE,4BACE;AAAI,UAAA,GAAG,EAAG,GAAEF,IAAI,CAACG,KAAM,IAAGF,KAAM,EAAhC;AAAmC,uBAAWD,IAAI,CAACG;AAAnD,wBACE;AAAM,UAAA,SAAS,EAAEC,eAAMD;AAAvB,WAA+BH,IAAI,CAACG,KAApC,CADF,eAEE;AAAM,UAAA,SAAS,EAAEC,eAAMC;AAAvB,WAA+BL,IAAI,CAACK,KAApC,CAFF,CADF;;AAMF,WAAK,SAAL;A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AAV,CAAoB,CAClBN,mBAAUC,KAAV,CAAgB;AACd/D,MAAAA,IAAI,EAAE8D,mBAAUE,MADF;AAEd/D,MAAAA,KAAK,EAAE6D,mBAAUE,MAFH;AAGd7D,MAAAA,KAAK,EAAE2D,mBAAUE;AAHH,KAAhB,CADkB,EAMlBF,mBAAUC,KAAV,CAAgB;AACd/D,MAAAA,IAAI,EAAE8D,mBAAUE,MADF;AAEdlD,MAAAA,IAAI,EAAEgD,mBAAUE,MAFF;AAGdzD,MAAAA,OAAO,EAAEuD,mBAAUG;AAHL,KAAhB,CANkB,EAWlBH,mBAAUC,KAAV,CAAgB;AACd/D,MAAAA,IAAI,EAAE8D,mBAAUE,MADF;AAEd5D,MAAAA,QAAQ,EAAE0D,mBAAUO,KAAV,CAAgB,CACxB,MADwB,EAExB,UAFwB,EAGxB,OAHwB,EAIxB,SAJwB,EAKxB,OALwB,EAMxB,OANwB,EAOxB,SAPwB,EAQxB,SARwB,EASxB,QATwB,CAAhB,CAFI;AAadpE,MAAAA,KAAK,EAAE6D,mBAAUE,MAbH;AAcd3D,MAAAA,KAAK,EAAEyD,mBAAUE,MAdH;AAed1D,MAAAA,MAAM,EAAEwD,mBAAUE,MAfJ;AAgBdzD,MAAAA,OAAO,EAAEuD,mBAAUG;AAhBL,KAAhB,CAXkB,CAApB,CADK,CAFO;AAkCd/C,IAAAA,WAAW,EAAE4C,mBAAUE;AAlCT,GAAhB,CADQ,CAHc;AAyCxBvC,EAAAA,MAAM,EAAED,WAAW,CAACqC,SAAZ,CAAsBpC;AAzCN,CAA1B;eA4CekB,a","sourcesContent":["import React, {useMemo, useState, useCallback, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {uniqueId} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowDown as ArrowDownIcon} from '@coorpacademy/nova-icons';\nimport ContentBadge from '../../atom/content-badge';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst buildItemsOfSection = items => {\n return items.map((item, index) => {\n const {type} = item;\n switch (type) {\n case 'mainElement':\n return (\n <li key={`${item.title}-${index}`} data-name={item.title}>\n <span className={style.title}>{item.title}</span>\n <span className={style.value}>{item.value}</span>\n </li>\n );\n case 'content': {\n const {category, label, title, author, unsaved = false} = item;\n return (\n <li className={style.contentWrapper} key={`${title}-${index}`} data-name={item.title}>\n <span className={style.contentCounter}>{index + 1}</span>\n <div className={style.contentItem}>\n <div className={style.content}>\n <ContentBadge category={category} label={label} />\n <span\n className={classnames(style.contentTitle, unsaved && style.unsaved)}\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n {author ? <span className={style.author}>{author}</span> : null}\n </div>\n </li>\n );\n }\n case 'text':\n default: {\n const {text, unsaved = false} = item;\n return (\n <li key={`${item.text}-${index}`} data-name={item.title}>\n <span className={classnames(style.valueSimpleText, unsaved && style.unsaved)}>\n {text}\n </span>\n </li>\n );\n }\n }\n });\n};\n\nconst buildSectionHeader = section => {\n const {title, counterText} = section;\n if (!title) {\n return null;\n }\n return (\n <div className={style.sectionHeader}>\n <span className={style.title}>{title}</span>\n {counterText ? <span className={style.counterText}>{counterText}</span> : null}\n </div>\n );\n};\n\nconst buildSections = sections => {\n return sections.map((section, index) => {\n const sectionHeader = buildSectionHeader(section);\n const itemsView = buildItemsOfSection(section.items);\n return (\n <div\n key={`summary-section-${index}`}\n data-step={index}\n data-name={`summary-section-${index}`}\n className={style.sectionWrapper}\n >\n {sectionHeader}\n <ul>{itemsView}</ul>\n </div>\n );\n });\n};\n\nconst BuildAction = ({action}) => {\n const {onClick, text, disabled = false, icon, 'aria-label': ariaLabel, side} = action;\n const handleClick = useMemo(() => () => onClick(), [onClick]);\n\n if (!action) return null;\n\n const buttonProps = {\n type: 'text',\n label: text,\n disabled,\n 'aria-label': ariaLabel,\n 'data-name': `${icon}-button-${side}`,\n onClick: handleClick,\n icon: {\n position: 'left',\n type: icon\n }\n };\n\n return (\n <div className={style.button}>\n <ButtonLink {...buttonProps} />\n </div>\n );\n};\n\nconst checkOnClose = (checked, summaryElement, onCloseSummary, clickEvent) => {\n if (checked) {\n if (\n summaryElement &&\n summaryElement.current &&\n !summaryElement.current.contains(clickEvent.target)\n ) {\n onCloseSummary();\n }\n }\n};\n\nconst WizardSummary = props => {\n const {title, sections, action, side} = props;\n const sectionsView = buildSections(sections);\n const idSwitch = uniqueId('open-summary-wizard');\n const summaryElement = useRef(null);\n const [checked, setChecked] = useState(false);\n\n const onCloseSummary = () => setChecked(false);\n const handleOnChange = useCallback(() => {\n if (!checked) {\n document.addEventListener('click', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n document.addEventListener('touchstart', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n } else {\n document.removeEventListener('click', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n document.removeEventListener('touchstart', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n }\n setChecked(!checked);\n }, [checked]);\n\n return (\n <div className={style.container} ref={summaryElement}>\n <span className={style.desktopSummaryTitle} data-name={`summary-title-${side}`}>\n {title}\n </span>\n <input\n type=\"checkbox\"\n id={idSwitch}\n name=\"toogle\"\n title={idSwitch}\n className={style.checkbox}\n data-name={`summary-checkbox-${side}`}\n checked={checked}\n onChange={handleOnChange}\n />\n <div className={style.summary}>\n <div className={style.tabletSummaryHeader}>\n <label htmlFor={idSwitch}>\n <span className={style.tabletSummaryTitle}>{title}</span>\n <ArrowDownIcon className={style.tabletSummaryIcon} />\n </label>\n </div>\n <div className={style.summarySections} data-name={`summary-section-${side}`}>\n {sectionsView}\n </div>\n </div>\n <div className={style.actionZone} data-name={`summary-actions-${side}`}>\n <BuildAction action={action} side={side} />\n </div>\n </div>\n );\n};\n\nBuildAction.propTypes = {\n action: PropTypes.shape({\n icon: PropTypes.string,\n disabled: PropTypes.bool,\n text: PropTypes.string,\n side: PropTypes.string,\n onClick: PropTypes.func,\n 'aria-label': PropTypes.string\n })\n};\n\nWizardSummary.propTypes = {\n title: PropTypes.string,\n side: PropTypes.string,\n sections: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n items: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n type: PropTypes.string,\n title: PropTypes.string,\n value: PropTypes.string\n }),\n PropTypes.shape({\n type: PropTypes.string,\n text: PropTypes.string,\n unsaved: PropTypes.bool\n }),\n PropTypes.shape({\n type: PropTypes.string,\n category: PropTypes.oneOf([\n 'base',\n 'advanced',\n 'coach',\n 'chapter',\n 'scorm',\n 'video',\n 'article',\n 'podcast',\n 'course'\n ]),\n title: PropTypes.string,\n label: PropTypes.string,\n author: PropTypes.string,\n unsaved: PropTypes.bool\n })\n ])\n ),\n counterText: PropTypes.string\n })\n ),\n action: BuildAction.propTypes.action\n};\n\nexport default WizardSummary;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/wizard-summary/index.js"],"names":["buildItemsOfSection","items","map","item","index","type","title","style","value","category","label","author","unsaved","contentWrapper","contentCounter","contentItem","content","contentTitle","__html","text","valueSimpleText","buildSectionHeader","section","counterText","sectionHeader","buildSections","sections","itemsView","sectionWrapper","BuildAction","action","side","onClick","disabled","icon","ariaLabel","handleClick","buttonProps","position","button","checkOnClose","checked","summaryElement","onCloseSummary","clickEvent","current","contains","target","WizardSummary","props","sectionsView","idSwitch","setChecked","handleOnChange","document","addEventListener","removeEventListener","container","desktopSummaryTitle","checkbox","summary","tabletSummaryHeader","tabletSummaryTitle","tabletSummaryIcon","summarySections","actionZone","propTypes","PropTypes","shape","string","bool","func","arrayOf","oneOfType","oneOf"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,mBAAmB,GAAGC,KAAK,IAAI;AACnC,SAAOA,KAAK,CAACC,GAAN,CAAU,CAACC,IAAD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C,IAAAA,WAAW,EAAE4C,mBAAUE;AAlCT,GAAhB,CADQ,CAHc;AAyCxBvC,EAAAA,MAAM,EAAED,WAAW,CAACqC,SAAZ,CAAsBpC;AAzCN,CAA1B;eA4CekB,a","sourcesContent":["import React, {useMemo, useState, useCallback, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {uniqueId} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowDown as ArrowDownIcon} from '@coorpacademy/nova-icons';\nimport ContentBadge from '../../atom/content-badge';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst buildItemsOfSection = items => {\n return items.map((item, index) => {\n const {type} = item;\n switch (type) {\n case 'mainElement':\n return (\n <li key={`${item.title}-${index}`} data-name={item.title}>\n <span className={style.title}>{item.title}</span>\n <span className={style.value}>{item.value}</span>\n </li>\n );\n case 'content': {\n const {category, label, title, author, unsaved = false} = item;\n return (\n <li className={style.contentWrapper} key={`${title}-${index}`} data-name={item.title}>\n <span className={style.contentCounter}>{index + 1}</span>\n <div className={style.contentItem}>\n <div className={style.content}>\n <ContentBadge category={category} label={label} />\n <span\n className={classnames(style.contentTitle, unsaved && style.unsaved)}\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n {author ? <span className={style.author}>{author}</span> : null}\n </div>\n </li>\n );\n }\n case 'text':\n default: {\n const {text, unsaved = false} = item;\n return (\n <li key={`${item.text}-${index}`} data-name={item.title}>\n <span className={classnames(style.valueSimpleText, unsaved && style.unsaved)}>\n {text}\n </span>\n </li>\n );\n }\n }\n });\n};\n\nconst buildSectionHeader = section => {\n const {title, counterText} = section;\n if (!title) {\n return null;\n }\n return (\n <div className={style.sectionHeader}>\n <span className={style.title}>{title}</span>\n {counterText ? <span className={style.counterText}>{counterText}</span> : null}\n </div>\n );\n};\n\nconst buildSections = sections => {\n return sections.map((section, index) => {\n const sectionHeader = buildSectionHeader(section);\n const itemsView = buildItemsOfSection(section.items);\n return (\n <div\n key={`summary-section-${index}`}\n data-step={index}\n data-name={`summary-section-${index}`}\n className={style.sectionWrapper}\n >\n {sectionHeader}\n <ul>{itemsView}</ul>\n </div>\n );\n });\n};\n\nconst BuildAction = ({action, side}) => {\n const {onClick, text, disabled = false, icon, 'aria-label': ariaLabel} = action;\n const handleClick = useMemo(() => () => onClick(), [onClick]);\n\n if (!action) return null;\n\n const buttonProps = {\n type: 'text',\n label: text,\n disabled,\n 'aria-label': ariaLabel,\n 'data-name': `${icon}-button-${side}`,\n onClick: handleClick,\n icon: {\n position: 'left',\n type: icon\n }\n };\n\n return (\n <div className={style.button}>\n <ButtonLink {...buttonProps} />\n </div>\n );\n};\n\nconst checkOnClose = (checked, summaryElement, onCloseSummary, clickEvent) => {\n if (checked) {\n if (\n summaryElement &&\n summaryElement.current &&\n !summaryElement.current.contains(clickEvent.target)\n ) {\n onCloseSummary();\n }\n }\n};\n\nconst WizardSummary = props => {\n const {title, sections, action, side} = props;\n const sectionsView = buildSections(sections);\n const idSwitch = uniqueId('open-summary-wizard');\n const summaryElement = useRef(null);\n const [checked, setChecked] = useState(false);\n\n const onCloseSummary = () => setChecked(false);\n const handleOnChange = useCallback(() => {\n if (!checked) {\n document.addEventListener('click', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n document.addEventListener('touchstart', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n } else {\n document.removeEventListener('click', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n document.removeEventListener('touchstart', clickEvent =>\n checkOnClose(!checked, summaryElement, onCloseSummary, clickEvent)\n );\n }\n setChecked(!checked);\n }, [checked]);\n\n return (\n <div className={style.container} ref={summaryElement}>\n <span className={style.desktopSummaryTitle} data-name={`summary-title-${side}`}>\n {title}\n </span>\n <input\n type=\"checkbox\"\n id={idSwitch}\n name=\"toogle\"\n title={idSwitch}\n className={style.checkbox}\n data-name={`summary-checkbox-${side}`}\n checked={checked}\n onChange={handleOnChange}\n />\n <div className={style.summary}>\n <div className={style.tabletSummaryHeader}>\n <label htmlFor={idSwitch}>\n <span className={style.tabletSummaryTitle}>{title}</span>\n <ArrowDownIcon className={style.tabletSummaryIcon} />\n </label>\n </div>\n <div className={style.summarySections} data-name={`summary-section-${side}`}>\n {sectionsView}\n </div>\n </div>\n <div className={style.actionZone} data-name={`summary-actions-${side}`}>\n <BuildAction action={action} side={side} />\n </div>\n </div>\n );\n};\n\nBuildAction.propTypes = {\n action: PropTypes.shape({\n icon: PropTypes.string,\n disabled: PropTypes.bool,\n text: PropTypes.string,\n onClick: PropTypes.func,\n 'aria-label': PropTypes.string\n }),\n side: PropTypes.string\n};\n\nWizardSummary.propTypes = {\n title: PropTypes.string,\n side: PropTypes.string,\n sections: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n items: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n type: PropTypes.string,\n title: PropTypes.string,\n value: PropTypes.string\n }),\n PropTypes.shape({\n type: PropTypes.string,\n text: PropTypes.string,\n unsaved: PropTypes.bool\n }),\n PropTypes.shape({\n type: PropTypes.string,\n category: PropTypes.oneOf([\n 'base',\n 'advanced',\n 'coach',\n 'chapter',\n 'scorm',\n 'video',\n 'article',\n 'podcast',\n 'course'\n ]),\n title: PropTypes.string,\n label: PropTypes.string,\n author: PropTypes.string,\n unsaved: PropTypes.bool\n })\n ])\n ),\n counterText: PropTypes.string\n })\n ),\n action: BuildAction.propTypes.action\n};\n\nexport default WizardSummary;\n"],"file":"index.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.5.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"webpack-hot-middleware": "^2.25.0"
|
|
120
120
|
},
|
|
121
121
|
"author": "CoorpAcademy",
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "022518475049c239295a02ddd8e4d38a345c49c7"
|
|
123
123
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import test from 'ava';
|
|
2
|
-
import forEach from 'lodash/forEach';
|
|
3
|
-
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
-
import MoleculeCockpitPopin from '..';
|
|
5
|
-
import fixtureDefault from './fixtures/default';
|
|
6
|
-
import fixtureLoading from './fixtures/loading';
|
|
7
|
-
import fixtureVideoTranslate from './fixtures/video-translate';
|
|
8
|
-
test('Molecule › MoleculeCockpitPopin > should have valid propTypes', t => {
|
|
9
|
-
t.pass();
|
|
10
|
-
forEach(MoleculeCockpitPopin.propTypes, (value, key) => {
|
|
11
|
-
t.not(value, undefined, `PropType for "Molecule.MoleculeCockpitPopin.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
test('Molecule › MoleculeCockpitPopin › Default › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureDefault);
|
|
15
|
-
test('Molecule › MoleculeCockpitPopin › Loading › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureLoading);
|
|
16
|
-
test('Molecule › MoleculeCockpitPopin › VideoTranslate › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureVideoTranslate);
|
|
17
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/cockpit-popin/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCockpitPopin","fixtureDefault","fixtureLoading","fixtureVideoTranslate","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,oBAAP,MAAiC,IAAjC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AAEAN,IAAI,CAAC,+DAAD,EAAkEO,CAAC,IAAI;AACzEA,EAAAA,CAAC,CAACC,IAAF;AACAP,EAAAA,OAAO,CAACE,oBAAoB,CAACM,SAAtB,EAAiC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yDAAwDF,GAAI,mEAArF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAX,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,oBAAzF,EAA+GC,cAA/G,CAAJ;AACAJ,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,oBAAzF,EAA+GE,cAA/G,CAAJ;AACAL,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,oBAAhG,EAAsHG,qBAAtH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCockpitPopin from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLoading from './fixtures/loading';\nimport fixtureVideoTranslate from './fixtures/video-translate';\n\ntest('Molecule › MoleculeCockpitPopin > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCockpitPopin.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCockpitPopin.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCockpitPopin › Default › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureDefault);\ntest('Molecule › MoleculeCockpitPopin › Loading › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureLoading);\ntest('Molecule › MoleculeCockpitPopin › VideoTranslate › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureVideoTranslate);\n"],"file":"fixtures.js"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import test from 'ava';
|
|
2
|
-
import forEach from 'lodash/forEach';
|
|
3
|
-
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
-
import MoleculeSearch from '..';
|
|
5
|
-
import fixtureDefault from './fixtures/default';
|
|
6
|
-
import fixtureWithValue from './fixtures/with-value';
|
|
7
|
-
test('Molecule › MoleculeSearch > should have valid propTypes', t => {
|
|
8
|
-
t.pass();
|
|
9
|
-
forEach(MoleculeSearch.propTypes, (value, key) => {
|
|
10
|
-
t.not(value, undefined, `PropType for "Molecule.MoleculeSearch.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
test('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);
|
|
14
|
-
test('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);
|
|
15
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/search/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeSearch","fixtureDefault","fixtureWithValue","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,cAAP,MAA2B,IAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AAEAL,IAAI,CAAC,yDAAD,EAA4DM,CAAC,IAAI;AACnEA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,cAAc,CAACK,SAAhB,EAA2B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,mDAAkDF,GAAI,mEAA/E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,cAAnF,EAAmGC,cAAnG,CAAJ;AACAJ,IAAI,CAAC,4DAAD,EAA+DE,oBAA/D,EAAqFC,cAArF,EAAqGE,gBAArG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeSearch from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithValue from './fixtures/with-value';\n\ntest('Molecule › MoleculeSearch > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeSearch.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeSearch.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);\ntest('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);\n"],"file":"fixtures.js"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
-
|
|
5
|
-
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
-
|
|
7
|
-
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
-
|
|
9
|
-
var _ = _interopRequireDefault(require(".."));
|
|
10
|
-
|
|
11
|
-
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
12
|
-
|
|
13
|
-
var _loading = _interopRequireDefault(require("./fixtures/loading"));
|
|
14
|
-
|
|
15
|
-
var _videoTranslate = _interopRequireDefault(require("./fixtures/video-translate"));
|
|
16
|
-
|
|
17
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
-
|
|
19
|
-
(0, _ava.default)('Molecule › MoleculeCockpitPopin > should have valid propTypes', t => {
|
|
20
|
-
t.pass();
|
|
21
|
-
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
22
|
-
t.not(value, undefined, `PropType for "Molecule.MoleculeCockpitPopin.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
(0, _ava.default)('Molecule › MoleculeCockpitPopin › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
26
|
-
(0, _ava.default)('Molecule › MoleculeCockpitPopin › Loading › should be rendered', _renderComponent.default, _.default, _loading.default);
|
|
27
|
-
(0, _ava.default)('Molecule › MoleculeCockpitPopin › VideoTranslate › should be rendered', _renderComponent.default, _.default, _videoTranslate.default);
|
|
28
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/cockpit-popin/test/fixtures.js"],"names":["t","pass","MoleculeCockpitPopin","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureLoading","fixtureVideoTranslate"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,+DAAL,EAAsEA,CAAC,IAAI;AACzEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAqBC,SAA7B,EAAwC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yDAAwDF,GAAI,mEAArF;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,gEAAL,EAAuEG,wBAAvE,EAA6FN,SAA7F,EAAmHO,gBAAnH;AACA,kBAAK,gEAAL,EAAuED,wBAAvE,EAA6FN,SAA7F,EAAmHQ,gBAAnH;AACA,kBAAK,uEAAL,EAA8EF,wBAA9E,EAAoGN,SAApG,EAA0HS,uBAA1H","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCockpitPopin from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLoading from './fixtures/loading';\nimport fixtureVideoTranslate from './fixtures/video-translate';\n\ntest('Molecule › MoleculeCockpitPopin > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCockpitPopin.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCockpitPopin.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCockpitPopin › Default › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureDefault);\ntest('Molecule › MoleculeCockpitPopin › Loading › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureLoading);\ntest('Molecule › MoleculeCockpitPopin › VideoTranslate › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureVideoTranslate);\n"],"file":"fixtures.js"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _ava = _interopRequireDefault(require("ava"));
|
|
4
|
-
|
|
5
|
-
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
6
|
-
|
|
7
|
-
var _renderComponent = _interopRequireDefault(require("../../../test/helpers/render-component"));
|
|
8
|
-
|
|
9
|
-
var _ = _interopRequireDefault(require(".."));
|
|
10
|
-
|
|
11
|
-
var _default = _interopRequireDefault(require("./fixtures/default"));
|
|
12
|
-
|
|
13
|
-
var _withValue = _interopRequireDefault(require("./fixtures/with-value"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
(0, _ava.default)('Molecule › MoleculeSearch > should have valid propTypes', t => {
|
|
18
|
-
t.pass();
|
|
19
|
-
(0, _forEach.default)(_.default.propTypes, (value, key) => {
|
|
20
|
-
t.not(value, undefined, `PropType for "Molecule.MoleculeSearch.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
(0, _ava.default)('Molecule › MoleculeSearch › Default › should be rendered', _renderComponent.default, _.default, _default.default);
|
|
24
|
-
(0, _ava.default)('Molecule › MoleculeSearch › WithValue › should be rendered', _renderComponent.default, _.default, _withValue.default);
|
|
25
|
-
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/search/test/fixtures.js"],"names":["t","pass","MoleculeSearch","propTypes","value","key","not","undefined","renderComponentMacro","fixtureDefault","fixtureWithValue"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,yDAAL,EAAgEA,CAAC,IAAI;AACnEA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAeC,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,mDAAkDF,GAAI,mEAA/E;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,0DAAL,EAAiEG,wBAAjE,EAAuFN,SAAvF,EAAuGO,gBAAvG;AACA,kBAAK,4DAAL,EAAmED,wBAAnE,EAAyFN,SAAzF,EAAyGQ,kBAAzG","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeSearch from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithValue from './fixtures/with-value';\n\ntest('Molecule › MoleculeSearch > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeSearch.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeSearch.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);\ntest('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);\n"],"file":"fixtures.js"}
|