@coorpacademy/components 11.6.0 → 11.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/review-presentation/index.native.js +1 -1
- package/es/atom/review-presentation/index.native.js.map +1 -1
- package/es/atom/select/index.d.ts.map +1 -1
- package/es/atom/select/index.js +48 -11
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/answer/index.d.ts.map +1 -1
- package/es/molecule/answer/index.js +1 -9
- package/es/molecule/answer/index.js.map +1 -1
- package/es/molecule/empty-state-dashboard/index.d.ts +23 -0
- package/es/molecule/empty-state-dashboard/index.d.ts.map +1 -0
- package/es/molecule/empty-state-dashboard/index.js +31 -0
- package/es/molecule/empty-state-dashboard/index.js.map +1 -0
- package/es/molecule/empty-state-dashboard/style.css +55 -0
- package/es/molecule/empty-state-dashboard/types.d.ts +19 -0
- package/es/molecule/empty-state-dashboard/types.d.ts.map +1 -0
- package/es/molecule/empty-state-dashboard/types.js +19 -0
- package/es/molecule/empty-state-dashboard/types.js.map +1 -0
- package/es/organism/list-item/index.d.ts +8 -6
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +16 -2
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +18 -0
- package/es/organism/list-items/index.d.ts +2 -0
- package/es/organism/list-items/index.js +5 -1
- package/es/organism/list-items/index.js.map +1 -1
- package/es/organism/review-header/index.native.d.ts.map +1 -1
- package/es/organism/review-header/index.native.js +8 -7
- package/es/organism/review-header/index.native.js.map +1 -1
- package/es/template/activity/index.d.ts +36 -40
- package/es/template/activity/index.d.ts.map +1 -1
- package/es/template/activity/index.js +89 -111
- package/es/template/activity/index.js.map +1 -1
- package/es/template/activity/stars-summary.d.ts +9 -18
- package/es/template/activity/stars-summary.d.ts.map +1 -1
- package/es/template/activity/stars-summary.js +94 -122
- package/es/template/activity/stars-summary.js.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +20 -0
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +12 -3
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +5 -1
- package/es/util/button-icons.d.ts +1 -0
- package/es/util/button-icons.d.ts.map +1 -1
- package/es/util/button-icons.js +3 -2
- package/es/util/button-icons.js.map +1 -1
- package/lib/atom/review-presentation/index.native.js +1 -1
- package/lib/atom/review-presentation/index.native.js.map +1 -1
- package/lib/atom/select/index.d.ts.map +1 -1
- package/lib/atom/select/index.js +46 -9
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/answer/index.d.ts.map +1 -1
- package/lib/molecule/answer/index.js +1 -10
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/molecule/empty-state-dashboard/index.d.ts +23 -0
- package/lib/molecule/empty-state-dashboard/index.d.ts.map +1 -0
- package/lib/molecule/empty-state-dashboard/index.js +42 -0
- package/lib/molecule/empty-state-dashboard/index.js.map +1 -0
- package/lib/molecule/empty-state-dashboard/style.css +55 -0
- package/lib/molecule/empty-state-dashboard/types.d.ts +19 -0
- package/lib/molecule/empty-state-dashboard/types.d.ts.map +1 -0
- package/lib/molecule/empty-state-dashboard/types.js +29 -0
- package/lib/molecule/empty-state-dashboard/types.js.map +1 -0
- package/lib/organism/list-item/index.d.ts +8 -6
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +16 -2
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +18 -0
- package/lib/organism/list-items/index.d.ts +2 -0
- package/lib/organism/list-items/index.js +5 -1
- package/lib/organism/list-items/index.js.map +1 -1
- package/lib/organism/review-header/index.native.d.ts.map +1 -1
- package/lib/organism/review-header/index.native.js +8 -7
- package/lib/organism/review-header/index.native.js.map +1 -1
- package/lib/template/activity/index.d.ts +36 -40
- package/lib/template/activity/index.d.ts.map +1 -1
- package/lib/template/activity/index.js +95 -110
- package/lib/template/activity/index.js.map +1 -1
- package/lib/template/activity/stars-summary.d.ts +9 -18
- package/lib/template/activity/stars-summary.d.ts.map +1 -1
- package/lib/template/activity/stars-summary.js +90 -119
- package/lib/template/activity/stars-summary.js.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +20 -0
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +13 -3
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +5 -1
- package/lib/util/button-icons.d.ts +1 -0
- package/lib/util/button-icons.d.ts.map +1 -1
- package/lib/util/button-icons.js +2 -1
- package/lib/util/button-icons.js.map +1 -1
- package/locales/bs/global.json +8 -1
- package/locales/cs/global.json +8 -1
- package/locales/de/global.json +8 -1
- package/locales/en/global.json +0 -1
- package/locales/es/global.json +8 -1
- package/locales/et/global.json +8 -1
- package/locales/fr/global.json +0 -1
- package/locales/hr/global.json +8 -1
- package/locales/hu/global.json +8 -1
- package/locales/hy/global.json +0 -1
- package/locales/it/global.json +8 -1
- package/locales/ja/global.json +8 -1
- package/locales/ko/global.json +8 -1
- package/locales/nl/global.json +8 -1
- package/locales/pl/global.json +8 -1
- package/locales/pt/global.json +8 -1
- package/locales/ro/global.json +8 -1
- package/locales/ru/global.json +0 -1
- package/locales/sk/global.json +8 -1
- package/locales/tl/global.json +8 -1
- package/locales/tr/global.json +8 -1
- package/locales/uk/global.json +8 -1
- package/locales/vi/global.json +8 -1
- package/locales/zh/global.json +8 -1
- package/locales/zh_TW/global.json +8 -1
- package/package.json +2 -2
- package/locales/.mtslconfig.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Tag","ButtonLink","BulletPointMenuButton","style","ListItem","props","bulletPointMenuButton","buttonLink","tags","title","tagsView","convert","cap","tag","index","wrapper","settings","edit","propTypes","shape","buttonAriaLabel","string","menuAriaLabel","buttons","arrayOf","label","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Tag","ButtonLink","BulletPointMenuButton","style","ListItem","props","isPublished","bulletPointMenuButton","buttonLink","tags","title","order","ariaLabel","tagsView","convert","cap","tag","index","type","wrapper","orderWrapper","settings","edit","propTypes","shape","buttonAriaLabel","string","menuAriaLabel","buttons","arrayOf","label","onClick","func","dataName","icon","position","oneOf","isRequired","number"],"sources":["../../../src/organism/list-item/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\nimport style from './style.css';\n\nconst ListItem = props => {\n let isPublished = false;\n const {bulletPointMenuButton, buttonLink, tags, title, order, 'aria-label': ariaLabel} = props;\n\n const tagsView = map.convert({cap: false})((tag, index) => {\n isPublished = tag.type === 'published';\n return (\n <div key={index} className={style.tag}>\n <Tag {...tag} />\n </div>\n );\n })(tags);\n return (\n <div className={style.wrapper}>\n {isPublished ? (\n <div className={style.orderWrapper}>\n <div className={style.order} aria-label={ariaLabel}>\n {order + 1}\n </div>\n <div className={style.title} title={title}>\n {title}\n </div>\n </div>\n ) : (\n <div className={style.title} title={title}>\n {title}\n </div>\n )}\n <div className={style.settings}>\n {tagsView}\n <div className={style.edit}>\n <ButtonLink {...buttonLink} />\n </div>\n <BulletPointMenuButton {...bulletPointMenuButton} />\n </div>\n </div>\n );\n};\n\nListItem.propTypes = {\n bulletPointMenuButton: PropTypes.shape({\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: PropTypes.arrayOf(\n PropTypes.shape({\n 'data-name': PropTypes.string,\n label: PropTypes.string,\n type: PropTypes.string,\n onClick: PropTypes.func\n })\n ),\n onClick: PropTypes.func\n }),\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n tags: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['published', 'draft', 'archived', 'revised', 'default'])\n })\n ),\n title: PropTypes.string.isRequired,\n order: PropTypes.number,\n 'aria-label': PropTypes.string\n};\n\nexport default ListItem;\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,qBAAP,MAAkC,yCAAlC;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAGC,KAAK,IAAI;EACxB,IAAIC,WAAW,GAAG,KAAlB;EACA,MAAM;IAACC,qBAAD;IAAwBC,UAAxB;IAAoCC,IAApC;IAA0CC,KAA1C;IAAiDC,KAAjD;IAAwD,cAAcC;EAAtE,IAAmFP,KAAzF;;EAEA,MAAMQ,QAAQ,GAAG,KAAIC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EAA0B,CAACC,GAAD,EAAMC,KAAN,KAAgB;IACzDX,WAAW,GAAGU,GAAG,CAACE,IAAJ,KAAa,WAA3B;IACA,oBACE;MAAK,GAAG,EAAED,KAAV;MAAiB,SAAS,EAAEd,KAAK,CAACa;IAAlC,gBACE,oBAAC,GAAD,EAASA,GAAT,CADF,CADF;EAKD,CAPgB,EAOdP,IAPc,CAAjB;;EAQA,oBACE;IAAK,SAAS,EAAEN,KAAK,CAACgB;EAAtB,GACGb,WAAW,gBACV;IAAK,SAAS,EAAEH,KAAK,CAACiB;EAAtB,gBACE;IAAK,SAAS,EAAEjB,KAAK,CAACQ,KAAtB;IAA6B,cAAYC;EAAzC,GACGD,KAAK,GAAG,CADX,CADF,eAIE;IAAK,SAAS,EAAER,KAAK,CAACO,KAAtB;IAA6B,KAAK,EAAEA;EAApC,GACGA,KADH,CAJF,CADU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,SAAS,CAAC8B,OAAV,CACJ9B,SAAS,CAACyB,KAAV,CAAgB;IACdM,KAAK,EAAE/B,SAAS,CAAC2B,MADH;IAEdR,IAAI,EAAEnB,SAAS,CAACqC,KAAV,CAAgB,CAAC,WAAD,EAAc,OAAd,EAAuB,UAAvB,EAAmC,SAAnC,EAA8C,SAA9C,CAAhB;EAFQ,CAAhB,CADI,CAzBa;EA+BnB1B,KAAK,EAAEX,SAAS,CAAC2B,MAAV,CAAiBW,UA/BL;EAgCnB1B,KAAK,EAAEZ,SAAS,CAACuC,MAhCE;EAiCnB,cAAcvC,SAAS,CAAC2B;AAjCL,CAArB;AAoCA,eAAetB,QAAf"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
@value xtraLightGrey from colors;
|
|
5
5
|
@value cm_grey_900 from colors;
|
|
6
6
|
@value primaryAdd1 from colors;
|
|
7
|
+
@value cm_grey_400 from colors;
|
|
7
8
|
|
|
8
9
|
.wrapper {
|
|
9
10
|
align-items: center;
|
|
@@ -51,3 +52,20 @@
|
|
|
51
52
|
margin: 0 16px 0 0;
|
|
52
53
|
min-width: 93px;
|
|
53
54
|
}
|
|
55
|
+
|
|
56
|
+
.order {
|
|
57
|
+
width: 6px;
|
|
58
|
+
height: 20px;
|
|
59
|
+
font-family: 'Gilroy';
|
|
60
|
+
font-style: normal;
|
|
61
|
+
font-weight: 600;
|
|
62
|
+
font-size: 14px;
|
|
63
|
+
line-height: 20px;
|
|
64
|
+
color: cm_grey_400;
|
|
65
|
+
margin: 0 16px 0 0;
|
|
66
|
+
}
|
|
67
|
+
.orderWrapper {
|
|
68
|
+
align-items: center;
|
|
69
|
+
display: flex;
|
|
70
|
+
width: 100%;
|
|
71
|
+
}
|
|
@@ -56,6 +56,8 @@ declare namespace ListItems {
|
|
|
56
56
|
type: PropTypes.Requireable<string>;
|
|
57
57
|
}> | null | undefined)[]>;
|
|
58
58
|
title: PropTypes.Validator<string>;
|
|
59
|
+
order: PropTypes.Requireable<number>;
|
|
60
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
59
61
|
}> | null | undefined)[]>;
|
|
60
62
|
title: PropTypes.Requireable<string>;
|
|
61
63
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import PropTypes from 'prop-types';
|
|
3
5
|
import ListItem from '../list-item';
|
|
@@ -15,7 +17,9 @@ const ListItems = ({
|
|
|
15
17
|
key: item.id,
|
|
16
18
|
className: style.item,
|
|
17
19
|
"data-name": `content-${index}`
|
|
18
|
-
}, /*#__PURE__*/React.createElement(ListItem, item
|
|
20
|
+
}, /*#__PURE__*/React.createElement(ListItem, _extends({}, item, {
|
|
21
|
+
order: index
|
|
22
|
+
}))));
|
|
19
23
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
20
24
|
className: style.header
|
|
21
25
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","ListItem","Title","ButtonLink","style","ListItems","title","buttonLink","items","ariaLabel","itemsView","map","item","index","id","header","buttonCreate","list","propTypes","string","shape","arrayOf"],"sources":["../../../src/organism/list-items/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ListItem from '../list-item';\nimport Title from '../../atom/title';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst ListItems = ({title, buttonLink, items, 'aria-label': ariaLabel}) => {\n const itemsView = items.map((item, index) => (\n <li key={item.id} className={style.item} data-name={`content-${index}`}>\n <ListItem {...item} />\n </li>\n ));\n\n return (\n <div>\n <div className={style.header}>\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'list-title'} />\n </div>\n <div className={style.buttonCreate}>\n <ButtonLink {...buttonLink} />\n </div>\n </div>\n <ul className={style.list} aria-label={ariaLabel} data-name={'content-list'}>\n {itemsView}\n </ul>\n </div>\n );\n};\n\nListItems.propTypes = {\n 'aria-label': PropTypes.string,\n buttonLink: PropTypes.shape(ButtonLink.propTypes),\n items: PropTypes.arrayOf(PropTypes.shape(ListItem.propTypes)),\n title: PropTypes.string\n};\n\nexport default ListItems;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,cAArB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,SAAS,GAAG,CAAC;EAACC,KAAD;EAAQC,UAAR;EAAoBC,KAApB;EAA2B,cAAcC;AAAzC,CAAD,KAAyD;EACzE,MAAMC,SAAS,GAAGF,KAAK,CAACG,GAAN,CAAU,CAACC,IAAD,EAAOC,KAAP,kBAC1B;IAAI,GAAG,EAAED,IAAI,CAACE,EAAd;IAAkB,SAAS,EAAEV,KAAK,CAACQ,IAAnC;IAAyC,aAAY,WAAUC,KAAM;EAArE,gBACE,oBAAC,QAAD,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","ListItem","Title","ButtonLink","style","ListItems","title","buttonLink","items","ariaLabel","itemsView","map","item","index","id","header","buttonCreate","list","propTypes","string","shape","arrayOf"],"sources":["../../../src/organism/list-items/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ListItem from '../list-item';\nimport Title from '../../atom/title';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst ListItems = ({title, buttonLink, items, 'aria-label': ariaLabel}) => {\n const itemsView = items.map((item, index) => (\n <li key={item.id} className={style.item} data-name={`content-${index}`}>\n <ListItem {...item} order={index} />\n </li>\n ));\n\n return (\n <div>\n <div className={style.header}>\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'list-title'} />\n </div>\n <div className={style.buttonCreate}>\n <ButtonLink {...buttonLink} />\n </div>\n </div>\n <ul className={style.list} aria-label={ariaLabel} data-name={'content-list'}>\n {itemsView}\n </ul>\n </div>\n );\n};\n\nListItems.propTypes = {\n 'aria-label': PropTypes.string,\n buttonLink: PropTypes.shape(ButtonLink.propTypes),\n items: PropTypes.arrayOf(PropTypes.shape(ListItem.propTypes)),\n title: PropTypes.string\n};\n\nexport default ListItems;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,cAArB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,SAAS,GAAG,CAAC;EAACC,KAAD;EAAQC,UAAR;EAAoBC,KAApB;EAA2B,cAAcC;AAAzC,CAAD,KAAyD;EACzE,MAAMC,SAAS,GAAGF,KAAK,CAACG,GAAN,CAAU,CAACC,IAAD,EAAOC,KAAP,kBAC1B;IAAI,GAAG,EAAED,IAAI,CAACE,EAAd;IAAkB,SAAS,EAAEV,KAAK,CAACQ,IAAnC;IAAyC,aAAY,WAAUC,KAAM;EAArE,gBACE,oBAAC,QAAD,eAAcD,IAAd;IAAoB,KAAK,EAAEC;EAA3B,GADF,CADgB,CAAlB;EAMA,oBACE,8CACE;IAAK,SAAS,EAAET,KAAK,CAACW;EAAtB,gBACE;IAAK,SAAS,EAAEX,KAAK,CAACE;EAAtB,gBACE,oBAAC,KAAD;IAAO,KAAK,EAAEA,KAAd;IAAqB,IAAI,EAAE,YAA3B;IAAyC,aAAW;EAApD,EADF,CADF,eAIE;IAAK,SAAS,EAAEF,KAAK,CAACY;EAAtB,gBACE,oBAAC,UAAD,EAAgBT,UAAhB,CADF,CAJF,CADF,eASE;IAAI,SAAS,EAAEH,KAAK,CAACa,IAArB;IAA2B,cAAYR,SAAvC;IAAkD,aAAW;EAA7D,GACGC,SADH,CATF,CADF;AAeD,CAtBD;;AAwBAL,SAAS,CAACa,SAAV,2CAAsB;EACpB,cAAclB,SAAS,CAACmB,MADJ;EAEpBZ,UAAU,EAAEP,SAAS,CAACoB,KAAV,CAAgBjB,UAAU,CAACe,SAA3B,CAFQ;EAGpBV,KAAK,EAAER,SAAS,CAACqB,OAAV,CAAkBrB,SAAS,CAACoB,KAAV,CAAgBnB,QAAQ,CAACiB,SAAzB,CAAlB,CAHa;EAIpBZ,KAAK,EAAEN,SAAS,CAACmB;AAJG,CAAtB;AAOA,eAAed,SAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-header/index.native.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/organism/review-header/index.native.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAsCpC,QAAA,MAAM,YAAY,UAAW,WAAW,gBAqBvC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -10,7 +10,8 @@ const style = StyleSheet.create({
|
|
|
10
10
|
flexDirection: 'row',
|
|
11
11
|
justifyContent: 'center',
|
|
12
12
|
alignItems: 'center',
|
|
13
|
-
alignContent: 'center'
|
|
13
|
+
alignContent: 'center',
|
|
14
|
+
width: '100%'
|
|
14
15
|
},
|
|
15
16
|
header: {
|
|
16
17
|
width: '80%',
|
|
@@ -18,14 +19,14 @@ const style = StyleSheet.create({
|
|
|
18
19
|
alignItems: 'center',
|
|
19
20
|
justifyContent: 'center',
|
|
20
21
|
height: 70,
|
|
21
|
-
paddingTop:
|
|
22
|
+
paddingTop: 8
|
|
22
23
|
},
|
|
23
|
-
|
|
24
|
+
touchArea: {
|
|
24
25
|
position: 'absolute',
|
|
25
|
-
right:
|
|
26
|
-
bottom: 10,
|
|
26
|
+
right: 24,
|
|
27
27
|
borderRadius: 12,
|
|
28
|
-
|
|
28
|
+
paddingTop: 16,
|
|
29
|
+
padding: 8
|
|
29
30
|
},
|
|
30
31
|
icon: {
|
|
31
32
|
width: 12,
|
|
@@ -45,7 +46,7 @@ const ReviewHeader = props => {
|
|
|
45
46
|
}, steps.map(step => /*#__PURE__*/React.createElement(Step, _extends({}, step, {
|
|
46
47
|
key: step.value
|
|
47
48
|
})))), /*#__PURE__*/React.createElement(Touchable, {
|
|
48
|
-
style: style.
|
|
49
|
+
style: style.touchArea,
|
|
49
50
|
isHighlight: true,
|
|
50
51
|
onPress: onQuitClick,
|
|
51
52
|
accessibilityLabel: "open-popin-button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","StyleSheet","View","NovaSolidStatusClose","CloseIcon","Step","Touchable","style","create","container","flexDirection","justifyContent","alignItems","alignContent","
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","StyleSheet","View","NovaSolidStatusClose","CloseIcon","Step","Touchable","style","create","container","flexDirection","justifyContent","alignItems","alignContent","width","header","height","paddingTop","touchArea","position","right","borderRadius","padding","icon","ReviewHeader","props","steps","onQuitClick","map","step","value"],"sources":["../../../src/organism/review-header/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, View, ViewStyle} from 'react-native';\nimport {NovaSolidStatusClose as CloseIcon} from '@coorpacademy/nova-icons';\nimport Step from '../../atom/review-header-step-item/index.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {HeaderProps} from './types';\n\ntype StyleSheetType = {\n container: ViewStyle;\n header: ViewStyle;\n touchArea: ViewStyle;\n icon: ViewStyle;\n};\n\nconst style: StyleSheetType = StyleSheet.create({\n container: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n alignContent: 'center',\n width: '100%'\n },\n header: {\n width: '80%',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n height: 70,\n paddingTop: 8\n },\n touchArea: {\n position: 'absolute',\n right: 24,\n borderRadius: 12,\n paddingTop: 16,\n padding: 8\n },\n icon: {\n width: 12,\n height: 12\n }\n});\n\nconst ReviewHeader = (props: HeaderProps) => {\n const {steps, onQuitClick} = props;\n\n return (\n <View style={style.container}>\n <View style={style.header}>\n {steps.map(step => (\n <Step {...step} key={step.value} />\n ))}\n </View>\n <Touchable\n style={style.touchArea}\n isHighlight\n onPress={onQuitClick}\n accessibilityLabel=\"open-popin-button\"\n testID=\"open-popin-button\"\n >\n <CloseIcon style={style.icon} color=\"#06265B\" />\n </Touchable>\n </View>\n );\n};\n\nexport default ReviewHeader;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAQC,UAAR,EAAoBC,IAApB,QAA0C,cAA1C;AACA,SAAQC,oBAAoB,IAAIC,SAAhC,QAAgD,0BAAhD;AACA,OAAOC,IAAP,MAAiB,iDAAjB;AACA,OAAOC,SAAP,MAAsB,kCAAtB;AAUA,MAAMC,KAAqB,GAAGN,UAAU,CAACO,MAAX,CAAkB;EAC9CC,SAAS,EAAE;IACTC,aAAa,EAAE,KADN;IAETC,cAAc,EAAE,QAFP;IAGTC,UAAU,EAAE,QAHH;IAITC,YAAY,EAAE,QAJL;IAKTC,KAAK,EAAE;EALE,CADmC;EAQ9CC,MAAM,EAAE;IACND,KAAK,EAAE,KADD;IAENJ,aAAa,EAAE,KAFT;IAGNE,UAAU,EAAE,QAHN;IAIND,cAAc,EAAE,QAJV;IAKNK,MAAM,EAAE,EALF;IAMNC,UAAU,EAAE;EANN,CARsC;EAgB9CC,SAAS,EAAE;IACTC,QAAQ,EAAE,UADD;IAETC,KAAK,EAAE,EAFE;IAGTC,YAAY,EAAE,EAHL;IAITJ,UAAU,EAAE,EAJH;IAKTK,OAAO,EAAE;EALA,CAhBmC;EAuB9CC,IAAI,EAAE;IACJT,KAAK,EAAE,EADH;IAEJE,MAAM,EAAE;EAFJ;AAvBwC,CAAlB,CAA9B;;AA6BA,MAAMQ,YAAY,GAAIC,KAAD,IAAwB;EAC3C,MAAM;IAACC,KAAD;IAAQC;EAAR,IAAuBF,KAA7B;EAEA,oBACE,oBAAC,IAAD;IAAM,KAAK,EAAElB,KAAK,CAACE;EAAnB,gBACE,oBAAC,IAAD;IAAM,KAAK,EAAEF,KAAK,CAACQ;EAAnB,GACGW,KAAK,CAACE,GAAN,CAAUC,IAAI,iBACb,oBAAC,IAAD,eAAUA,IAAV;IAAgB,GAAG,EAAEA,IAAI,CAACC;EAA1B,GADD,CADH,CADF,eAME,oBAAC,SAAD;IACE,KAAK,EAAEvB,KAAK,CAACW,SADf;IAEE,WAAW,MAFb;IAGE,OAAO,EAAES,WAHX;IAIE,kBAAkB,EAAC,mBAJrB;IAKE,MAAM,EAAC;EALT,gBAOE,oBAAC,SAAD;IAAW,KAAK,EAAEpB,KAAK,CAACgB,IAAxB;IAA8B,KAAK,EAAC;EAApC,EAPF,CANF,CADF;AAkBD,CArBD;;AAuBA,eAAeC,YAAf"}
|
|
@@ -1,14 +1,38 @@
|
|
|
1
1
|
export default Progression;
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
declare function Progression(props: any, legacyContext: any): JSX.Element;
|
|
3
|
+
declare namespace Progression {
|
|
4
|
+
namespace contextTypes {
|
|
5
|
+
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
|
+
common: PropTypes.Requireable<{
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
}>;
|
|
9
|
+
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
|
+
'logo-mobile': PropTypes.Requireable<any>;
|
|
11
|
+
logo: PropTypes.Requireable<any>;
|
|
12
|
+
'logo-email': PropTypes.Requireable<any>;
|
|
13
|
+
login: PropTypes.Requireable<any>;
|
|
14
|
+
}>>;
|
|
15
|
+
icons: PropTypes.Requireable<{
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
}>;
|
|
18
|
+
mod: PropTypes.Requireable<{
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
}>;
|
|
21
|
+
courses: PropTypes.Requireable<any[]>;
|
|
22
|
+
texts: PropTypes.Requireable<{
|
|
23
|
+
[x: string]: any;
|
|
24
|
+
}>;
|
|
25
|
+
}>>;
|
|
26
|
+
}
|
|
27
|
+
namespace propTypes {
|
|
28
|
+
const mainTitle: PropTypes.Validator<string>;
|
|
29
|
+
const mainSubtitle: PropTypes.Validator<string>;
|
|
30
|
+
const adaptiveAriaLabel: PropTypes.Requireable<string>;
|
|
31
|
+
const total: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
8
32
|
label: PropTypes.Validator<string>;
|
|
9
33
|
stars: PropTypes.Validator<number>;
|
|
10
34
|
}>>>;
|
|
11
|
-
engines: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
35
|
+
const engines: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
12
36
|
type: PropTypes.Validator<string>;
|
|
13
37
|
stars: PropTypes.Validator<number>;
|
|
14
38
|
title: PropTypes.Validator<string>;
|
|
@@ -22,8 +46,8 @@ declare class Progression extends React.Component<any, any, any> {
|
|
|
22
46
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
47
|
}>>;
|
|
24
48
|
}> | null | undefined)[]>;
|
|
25
|
-
loading: PropTypes.Validator<boolean>;
|
|
26
|
-
progressions: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
49
|
+
const loading: PropTypes.Validator<boolean>;
|
|
50
|
+
const progressions: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
27
51
|
ref: PropTypes.Validator<string>;
|
|
28
52
|
completion: PropTypes.Validator<number>;
|
|
29
53
|
stars: PropTypes.Validator<number>;
|
|
@@ -38,7 +62,7 @@ declare class Progression extends React.Component<any, any, any> {
|
|
|
38
62
|
adaptive: PropTypes.Validator<boolean>;
|
|
39
63
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
40
64
|
}> | null | undefined)[]>;
|
|
41
|
-
themeFilter: PropTypes.Requireable<PropTypes.InferProps<{
|
|
65
|
+
const themeFilter: PropTypes.Requireable<PropTypes.InferProps<{
|
|
42
66
|
options: PropTypes.Validator<(PropTypes.InferProps<{
|
|
43
67
|
name: PropTypes.Validator<string>;
|
|
44
68
|
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
@@ -47,42 +71,14 @@ declare class Progression extends React.Component<any, any, any> {
|
|
|
47
71
|
}> | null | undefined)[]>;
|
|
48
72
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
49
73
|
}>>;
|
|
50
|
-
recommendation: PropTypes.Requireable<PropTypes.InferProps<{
|
|
74
|
+
const recommendation: PropTypes.Requireable<PropTypes.InferProps<{
|
|
51
75
|
cta: PropTypes.Validator<string>;
|
|
52
76
|
title: PropTypes.Validator<string>;
|
|
53
77
|
subtitle: PropTypes.Validator<string>;
|
|
54
78
|
courseTitle: PropTypes.Validator<string>;
|
|
55
79
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
56
80
|
}>>;
|
|
57
|
-
}
|
|
58
|
-
static contextTypes: {
|
|
59
|
-
skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
60
|
-
common: PropTypes.Requireable<{
|
|
61
|
-
[x: string]: any;
|
|
62
|
-
}>;
|
|
63
|
-
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
64
|
-
'logo-mobile': PropTypes.Requireable<any>;
|
|
65
|
-
logo: PropTypes.Requireable<any>;
|
|
66
|
-
'logo-email': PropTypes.Requireable<any>;
|
|
67
|
-
login: PropTypes.Requireable<any>;
|
|
68
|
-
}>>;
|
|
69
|
-
icons: PropTypes.Requireable<{
|
|
70
|
-
[x: string]: any;
|
|
71
|
-
}>;
|
|
72
|
-
mod: PropTypes.Requireable<{
|
|
73
|
-
[x: string]: any;
|
|
74
|
-
}>;
|
|
75
|
-
courses: PropTypes.Requireable<any[]>;
|
|
76
|
-
texts: PropTypes.Requireable<{
|
|
77
|
-
[x: string]: any;
|
|
78
|
-
}>;
|
|
79
|
-
}>>;
|
|
80
|
-
};
|
|
81
|
-
constructor(props: any, context: any);
|
|
82
|
-
handleClick: (e: any) => void;
|
|
83
|
-
handleSelectTheme: (e: any) => void;
|
|
84
|
-
render(): JSX.Element;
|
|
81
|
+
}
|
|
85
82
|
}
|
|
86
|
-
import React from "react";
|
|
87
83
|
import PropTypes from "prop-types";
|
|
88
84
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/activity/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/activity/index.js"],"names":[],"mappings":";AAeA,0EAuGC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import _isEmpty from "lodash/fp/isEmpty";
|
|
2
|
-
import _omit from "lodash/fp/omit";
|
|
3
|
-
import _get from "lodash/fp/get";
|
|
4
|
-
|
|
5
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
6
2
|
|
|
7
|
-
import React from 'react';
|
|
3
|
+
import React, { useCallback } from 'react';
|
|
4
|
+
import get from 'lodash/fp/get';
|
|
5
|
+
import isEmpty from 'lodash/fp/isEmpty';
|
|
6
|
+
import omit from 'lodash/fp/omit';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
import classnames from 'classnames';
|
|
10
|
-
import Provider from '../../atom/provider';
|
|
9
|
+
import Provider, { GetSkinFromContext } from '../../atom/provider';
|
|
11
10
|
import Button from '../../atom/button';
|
|
12
11
|
import Select from '../../atom/select';
|
|
13
12
|
import Loader from '../../atom/loader';
|
|
@@ -16,112 +15,91 @@ import EngineStars from './engine-stars';
|
|
|
16
15
|
import StarsSummary from './stars-summary';
|
|
17
16
|
import style from './style.css';
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
onChange
|
|
39
|
-
}
|
|
40
|
-
} = this.props;
|
|
41
|
-
onChange && onChange(e);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
this.handleClick = this.handleClick.bind(this);
|
|
45
|
-
this.handleSelectTheme = this.handleSelectTheme.bind(this);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
render() {
|
|
18
|
+
const Progression = (props, legacyContext) => {
|
|
19
|
+
const {
|
|
20
|
+
mainTitle,
|
|
21
|
+
mainSubtitle,
|
|
22
|
+
recommendation = {},
|
|
23
|
+
progressions = [],
|
|
24
|
+
adaptiveAriaLabel,
|
|
25
|
+
total,
|
|
26
|
+
engines = [],
|
|
27
|
+
themeFilter = {},
|
|
28
|
+
loading
|
|
29
|
+
} = props;
|
|
30
|
+
const skin = GetSkinFromContext(legacyContext);
|
|
31
|
+
const {
|
|
32
|
+
onChange: themeFilterOnChange
|
|
33
|
+
} = themeFilter;
|
|
34
|
+
const handleClick = useCallback(e => {
|
|
35
|
+
e.stopPropagation();
|
|
36
|
+
e.preventDefault();
|
|
49
37
|
const {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}, themeSelect, recommendationSection), /*#__PURE__*/React.createElement(StarsSummary, {
|
|
116
|
-
engines: engines,
|
|
117
|
-
total: total
|
|
118
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
119
|
-
className: style.wrapperProgression,
|
|
120
|
-
"data-name": "activityList"
|
|
121
|
-
}, coreProgression, loader));
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
}
|
|
38
|
+
onClick
|
|
39
|
+
} = recommendation;
|
|
40
|
+
onClick && onClick(e);
|
|
41
|
+
}, [recommendation]);
|
|
42
|
+
const handleSelectTheme = useCallback(e => {
|
|
43
|
+
themeFilterOnChange && themeFilterOnChange(e);
|
|
44
|
+
}, [themeFilterOnChange]);
|
|
45
|
+
const primary = get('common.primary', skin);
|
|
46
|
+
const loader = loading ? /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
className: style.loader
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Loader, null)) : null;
|
|
49
|
+
const allProgressions = progressions.map(progression => /*#__PURE__*/React.createElement(ProgressionItem, _extends({}, omit(['ref'], progression), {
|
|
50
|
+
key: progression.ref,
|
|
51
|
+
adaptiveAriaLabel: adaptiveAriaLabel
|
|
52
|
+
})));
|
|
53
|
+
const coreProgression = /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
"data-name": "activityCore",
|
|
55
|
+
className: style.core
|
|
56
|
+
}, allProgressions);
|
|
57
|
+
const themeSelect = !isEmpty(themeFilter.options) ? /*#__PURE__*/React.createElement(Select, {
|
|
58
|
+
borderClassName: style.selectBorder,
|
|
59
|
+
className: style.select,
|
|
60
|
+
theme: "thematiques",
|
|
61
|
+
options: themeFilter.options,
|
|
62
|
+
onChange: handleSelectTheme
|
|
63
|
+
}) : null;
|
|
64
|
+
const recommendationSection = !isEmpty(recommendation) ? /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: style.recommendationWrapper
|
|
66
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
67
|
+
className: style.recommendationSection
|
|
68
|
+
}, recommendation.title, " "), /*#__PURE__*/React.createElement("p", {
|
|
69
|
+
className: style.recommendationSection
|
|
70
|
+
}, /*#__PURE__*/React.createElement("span", null, recommendation.subtitle, " "), /*#__PURE__*/React.createElement("span", {
|
|
71
|
+
className: classnames(style.course, style.innerHTML) // eslint-disable-next-line react/no-danger
|
|
72
|
+
,
|
|
73
|
+
dangerouslySetInnerHTML: {
|
|
74
|
+
__html: recommendation.courseTitle
|
|
75
|
+
}
|
|
76
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
77
|
+
type: "link",
|
|
78
|
+
onClick: handleClick,
|
|
79
|
+
submitValue: recommendation.cta,
|
|
80
|
+
style: {
|
|
81
|
+
backgroundColor: primary
|
|
82
|
+
},
|
|
83
|
+
className: style.cta
|
|
84
|
+
})) : null;
|
|
85
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
className: style.default
|
|
87
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
"data-name": "activity-header"
|
|
89
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
className: style.mainTitle
|
|
91
|
+
}, /*#__PURE__*/React.createElement("span", null, mainTitle), " ", mainSubtitle), /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: style.headerProgression
|
|
93
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
className: style.wrapperCta
|
|
95
|
+
}, themeSelect, recommendationSection), /*#__PURE__*/React.createElement(StarsSummary, {
|
|
96
|
+
engines: engines,
|
|
97
|
+
total: total
|
|
98
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
className: style.wrapperProgression,
|
|
100
|
+
"data-name": "activityList"
|
|
101
|
+
}, coreProgression, loader));
|
|
102
|
+
};
|
|
125
103
|
|
|
126
104
|
Progression.contextTypes = {
|
|
127
105
|
skin: Provider.childContextTypes.skin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","Button","Select","Loader","ProgressionItem","EngineStars","StarsSummary","style","Progression","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","get","isEmpty","omit","PropTypes","classnames","Provider","GetSkinFromContext","Button","Select","Loader","ProgressionItem","EngineStars","StarsSummary","style","Progression","props","legacyContext","mainTitle","mainSubtitle","recommendation","progressions","adaptiveAriaLabel","total","engines","themeFilter","loading","skin","onChange","themeFilterOnChange","handleClick","e","stopPropagation","preventDefault","onClick","handleSelectTheme","primary","loader","allProgressions","map","progression","ref","coreProgression","core","themeSelect","options","selectBorder","select","recommendationSection","recommendationWrapper","title","subtitle","course","innerHTML","__html","courseTitle","cta","backgroundColor","default","headerProgression","wrapperCta","wrapperProgression","contextTypes","childContextTypes","propTypes","string","isRequired","shape","label","stars","number","arrayOf","bool","func"],"sources":["../../../src/template/activity/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport get from 'lodash/fp/get';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport omit from 'lodash/fp/omit';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../atom/provider';\nimport Button from '../../atom/button';\nimport Select from '../../atom/select';\nimport Loader from '../../atom/loader';\nimport ProgressionItem from './progression-item';\nimport EngineStars from './engine-stars';\nimport StarsSummary from './stars-summary';\nimport style from './style.css';\n\nconst Progression = (props, legacyContext) => {\n const {\n mainTitle,\n mainSubtitle,\n recommendation = {},\n progressions = [],\n adaptiveAriaLabel,\n total,\n engines = [],\n themeFilter = {},\n loading\n } = props;\n const skin = GetSkinFromContext(legacyContext);\n const {onChange: themeFilterOnChange} = themeFilter;\n\n const handleClick = useCallback(\n e => {\n e.stopPropagation();\n e.preventDefault();\n const {onClick} = recommendation;\n onClick && onClick(e);\n },\n [recommendation]\n );\n\n const handleSelectTheme = useCallback(\n e => {\n themeFilterOnChange && themeFilterOnChange(e);\n },\n [themeFilterOnChange]\n );\n\n const primary = get('common.primary', skin);\n const loader = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : null;\n const allProgressions = progressions.map(progression => (\n <ProgressionItem\n {...omit(['ref'], progression)}\n key={progression.ref}\n adaptiveAriaLabel={adaptiveAriaLabel}\n />\n ));\n\n const coreProgression = (\n <div data-name=\"activityCore\" className={style.core}>\n {allProgressions}\n </div>\n );\n const themeSelect = !isEmpty(themeFilter.options) ? (\n <Select\n borderClassName={style.selectBorder}\n className={style.select}\n theme=\"thematiques\"\n options={themeFilter.options}\n onChange={handleSelectTheme}\n />\n ) : null;\n const recommendationSection = !isEmpty(recommendation) ? (\n <div className={style.recommendationWrapper}>\n <p className={style.recommendationSection}>{recommendation.title} </p>\n <p className={style.recommendationSection}>\n <span>{recommendation.subtitle} </span>\n <span\n className={classnames(style.course, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: recommendation.courseTitle}}\n />\n </p>\n <Button\n type=\"link\"\n onClick={handleClick}\n submitValue={recommendation.cta}\n style={{\n backgroundColor: primary\n }}\n className={style.cta}\n />\n </div>\n ) : null;\n\n return (\n <div className={style.default}>\n <div data-name=\"activity-header\">\n <div className={style.mainTitle}>\n <span>{mainTitle}</span> {mainSubtitle}\n </div>\n <div className={style.headerProgression}>\n <div className={style.wrapperCta}>\n {themeSelect}\n {recommendationSection}\n </div>\n <StarsSummary engines={engines} total={total} />\n </div>\n </div>\n <div className={style.wrapperProgression} data-name=\"activityList\">\n {coreProgression}\n {loader}\n </div>\n </div>\n );\n};\n\nProgression.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nProgression.propTypes = {\n mainTitle: PropTypes.string.isRequired,\n mainSubtitle: PropTypes.string.isRequired,\n adaptiveAriaLabel: PropTypes.string,\n total: PropTypes.shape({\n label: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired\n }).isRequired,\n engines: PropTypes.arrayOf(PropTypes.shape(EngineStars.propTypes)),\n loading: PropTypes.bool.isRequired,\n progressions: PropTypes.arrayOf(\n PropTypes.shape({...ProgressionItem.propTypes, ref: PropTypes.string.isRequired})\n ),\n themeFilter: PropTypes.shape({\n options: Select.propTypes.options.isRequired,\n onChange: Select.propTypes.onChange\n }),\n recommendation: PropTypes.shape({\n cta: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string.isRequired,\n courseTitle: PropTypes.string.isRequired,\n onClick: PropTypes.func\n })\n};\n\nexport default Progression;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,qBAA3C;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,M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