@coorpacademy/components 11.32.44-alpha.55 → 11.32.44-alpha.56

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.
@@ -5,9 +5,6 @@ declare namespace Certifications {
5
5
  const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  }
7
7
  namespace propTypes {
8
- const title: PropTypes.Requireable<string>;
9
- const subtitle: PropTypes.Requireable<string>;
10
- const tag: PropTypes.Requireable<string>;
11
8
  const certifications: PropTypes.Requireable<(PropTypes.InferProps<{
12
9
  label: PropTypes.Requireable<string>;
13
10
  goal: PropTypes.Requireable<PropTypes.InferProps<{
@@ -23,6 +20,12 @@ declare namespace Certifications {
23
20
  conditionDescriptionProgress: PropTypes.Requireable<string>;
24
21
  }>>;
25
22
  }> | null | undefined)[]>;
23
+ const locales: PropTypes.Requireable<PropTypes.InferProps<{
24
+ title: PropTypes.Requireable<string>;
25
+ subtitle: PropTypes.Requireable<string>;
26
+ tag: PropTypes.Requireable<string>;
27
+ count: PropTypes.Requireable<string>;
28
+ }>>;
26
29
  const sorting: PropTypes.Requireable<PropTypes.InferProps<{
27
30
  title: PropTypes.Requireable<string>;
28
31
  name: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certifications/index.js"],"names":[],"mappings":";AAUA,uEAoEC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certifications/index.js"],"names":[],"mappings":";AAUA,uEAwEC"}
@@ -13,9 +13,12 @@ import style from './style.css';
13
13
 
14
14
  const Certifications = (props, context) => {
15
15
  const {
16
- title,
17
- subtitle,
18
- tag,
16
+ locales: {
17
+ title,
18
+ subtitle,
19
+ tag,
20
+ count
21
+ },
19
22
  certifications,
20
23
  sorting
21
24
  } = props;
@@ -52,7 +55,7 @@ const Certifications = (props, context) => {
52
55
  className: style.sortSectionWrapper
53
56
  }, /*#__PURE__*/React.createElement("div", {
54
57
  className: style.certificatesCount
55
- }, `${certifications.length} ${title}`), /*#__PURE__*/React.createElement("div", {
58
+ }, count), /*#__PURE__*/React.createElement("div", {
56
59
  className: style.sortSection
57
60
  }, /*#__PURE__*/React.createElement(InputSwitch, {
58
61
  id: 'show-completed-courses-switch',
@@ -84,9 +87,6 @@ Certifications.contextTypes = {
84
87
  translate: Provider.childContextTypes.translate
85
88
  };
86
89
  Certifications.propTypes = process.env.NODE_ENV !== "production" ? {
87
- title: PropTypes.string,
88
- subtitle: PropTypes.string,
89
- tag: PropTypes.string,
90
90
  certifications: PropTypes.arrayOf(PropTypes.shape({
91
91
  label: PropTypes.string,
92
92
  goal: PropTypes.shape({
@@ -102,6 +102,12 @@ Certifications.propTypes = process.env.NODE_ENV !== "production" ? {
102
102
  conditionDescriptionProgress: PropTypes.string
103
103
  })
104
104
  })),
105
+ locales: PropTypes.shape({
106
+ title: PropTypes.string,
107
+ subtitle: PropTypes.string,
108
+ tag: PropTypes.string,
109
+ count: PropTypes.string
110
+ }),
105
111
  sorting: PropTypes.shape(Select.propTypes)
106
112
  } : {};
107
113
  export default Certifications;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useState","useCallback","PropTypes","Provider","Title","Select","InputSwitch","CertificationCard","style","Certifications","props","context","title","subtitle","tag","certifications","sorting","translate","showCompleted","setShowCompleted","sortView","undefined","handleShowCompletedToggle","backgroudnContainer","container","iconName","iconColor","borderRadius","backgroundColor","sortSectionWrapper","certificatesCount","length","sortSection","sortWrapper","certificateList","certification","label","progress","contextTypes","childContextTypes","propTypes","string","arrayOf","shape","goal","condition","nbDone","number","imgUrl","onClick","func","locales","conditionDescriptionProgress"],"sources":["../../../src/template/certifications/index.js"],"sourcesContent":["import React, {useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Title from '../../atom/title';\nimport Select from '../../atom/select';\nimport InputSwitch from '../../atom/input-switch';\nimport CertificationCard from '../../molecule/certification-card';\nimport style from './style.css';\n\nconst Certifications = (props, context) => {\n const {title, subtitle, tag, certifications, sorting} = props;\n const {translate} = context;\n\n const [showCompleted, setShowCompleted] = useState(true);\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(!showCompleted);\n }, [showCompleted, setShowCompleted]);\n\n return (\n <div className={style.backgroudnContainer}>\n <div className={style.container} data-name=\"Certifications\">\n <Title\n title={title}\n subtitle={subtitle}\n type=\"form-group\"\n titleSize=\"standard-light-weight\"\n subtitleSize=\"standard-without-margin\"\n icon={{\n iconName: 'wreath-laurel',\n iconColor: '#B87A00',\n borderRadius: '12px',\n backgroundColor: '#FFEECC'\n }}\n />\n <div className={style.sortSectionWrapper}>\n <div className={style.certificatesCount}>{`${certifications.length} ${title}`}</div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n type=\"switch\"\n name={translate('show_completed')}\n title={translate('show_completed')}\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n {sorting ? (\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n ) : null}\n </div>\n </div>\n <div className={style.certificateList}>\n {map(certification => {\n const {label, progress} = certification;\n if (!showCompleted && progress === 100) return null;\n\n return (\n <div key={label}>\n <CertificationCard {...certification} tag={tag} />\n </div>\n );\n }, certifications)}\n </div>\n </div>\n </div>\n );\n};\n\nCertifications.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nCertifications.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n tag: PropTypes.string,\n certifications: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n goal: PropTypes.shape({\n title: PropTypes.string,\n condition: PropTypes.shape({\n nbDone: PropTypes.number\n })\n }),\n progress: PropTypes.number,\n imgUrl: PropTypes.string,\n onClick: PropTypes.func,\n locales: PropTypes.shape({\n conditionDescriptionProgress: PropTypes.string\n })\n })\n ),\n sorting: PropTypes.shape(Select.propTypes)\n};\n\nexport default Certifications;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,iBAAP,MAA8B,mCAA9B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IAACC,KAAD;IAAQC,QAAR;IAAkBC,GAAlB;IAAuBC,cAAvB;IAAuCC;EAAvC,IAAkDN,KAAxD;EACA,MAAM;IAACO;EAAD,IAAcN,OAApB;EAEA,MAAM,CAACO,aAAD,EAAgBC,gBAAhB,IAAoCnB,QAAQ,CAAC,IAAD,CAAlD;EAEA,MAAMoB,QAAQ,GACZJ,OAAO,KAAKK,SAAZ,gBACE;IAAK,aAAU;EAAf,gBACE,oBAAC,MAAD,eAAYL,OAAZ;IAAqB,cAAW;EAAhC,GADF,CADF,GAII,IALN;EAOA,MAAMM,yBAAyB,GAAGrB,WAAW,CAAC,MAAM;IAClDkB,gBAAgB,CAAC,CAACD,aAAF,CAAhB;EACD,CAF4C,EAE1C,CAACA,aAAD,EAAgBC,gBAAhB,CAF0C,CAA7C;EAIA,oBACE;IAAK,SAAS,EAAEX,KAAK,CAACe;EAAtB,gBACE;IAAK,SAAS,EAAEf,KAAK,CAACgB,SAAtB;IAAiC,aAAU;EAA3C,gBACE,oBAAC,KAAD;IACE,KAAK,EAAEZ,KADT;IAEE,QAAQ,EAAEC,QAFZ;IAGE,IAAI,EAAC,YAHP;IAIE,SAAS,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EACzB5B,KAAK,EAAEV,SAAS,CAACuC,MADQ;EAEzB5B,QAAQ,EAAEX,SAAS,CAACuC,MAFK;EAGzB3B,GAAG,EAAEZ,SAAS,CAACuC,MAHU;EAIzB1B,cAAc,EAAEb,SAAS,CAACwC,OAAV,CACdxC,SAAS,CAACyC,KAAV,CAAgB;IACdP,KAAK,EAAElC,SAAS,CAACuC,MADH;IAEdG,IAAI,EAAE1C,SAAS,CAACyC,KAAV,CAAgB;MACpB/B,KAAK,EAAEV,SAAS,CAACuC,MADG;MAEpBI,SAAS,EAAE3C,SAAS,CAACyC,KAAV,CAAgB;QACzBG,MAAM,EAAE5C,SAAS,CAAC6C;MADO,CAAhB;IAFS,CAAhB,CAFQ;IAQdV,QAAQ,EAAEnC,SAAS,CAAC6C,MARN;IASdC,MAAM,EAAE9C,SAAS,CAACuC,MATJ;IAUdQ,OAAO,EAAE/C,SAAS,CAACgD,IAVL;IAWdC,OAAO,EAAEjD,SAAS,CAACyC,KAAV,CAAgB;MACvBS,4BAA4B,EAAElD,SAAS,CAACuC;IADjB,CAAhB;EAXK,CAAhB,CADc,CAJS;EAqBzBzB,OAAO,EAAEd,SAAS,CAACyC,KAAV,CAAgBtC,MAAM,CAACmC,SAAvB;AArBgB,CAA3B;AAwBA,eAAe/B,cAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useState","useCallback","PropTypes","Provider","Title","Select","InputSwitch","CertificationCard","style","Certifications","props","context","locales","title","subtitle","tag","count","certifications","sorting","translate","showCompleted","setShowCompleted","sortView","undefined","handleShowCompletedToggle","backgroudnContainer","container","iconName","iconColor","borderRadius","backgroundColor","sortSectionWrapper","certificatesCount","sortSection","sortWrapper","certificateList","certification","label","progress","contextTypes","childContextTypes","propTypes","arrayOf","shape","string","goal","condition","nbDone","number","imgUrl","onClick","func","conditionDescriptionProgress"],"sources":["../../../src/template/certifications/index.js"],"sourcesContent":["import React, {useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Title from '../../atom/title';\nimport Select from '../../atom/select';\nimport InputSwitch from '../../atom/input-switch';\nimport CertificationCard from '../../molecule/certification-card';\nimport style from './style.css';\n\nconst Certifications = (props, context) => {\n const {\n locales: {title, subtitle, tag, count},\n certifications,\n sorting\n } = props;\n const {translate} = context;\n\n const [showCompleted, setShowCompleted] = useState(true);\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(!showCompleted);\n }, [showCompleted, setShowCompleted]);\n\n return (\n <div className={style.backgroudnContainer}>\n <div className={style.container} data-name=\"Certifications\">\n <Title\n title={title}\n subtitle={subtitle}\n type=\"form-group\"\n titleSize=\"standard-light-weight\"\n subtitleSize=\"standard-without-margin\"\n icon={{\n iconName: 'wreath-laurel',\n iconColor: '#B87A00',\n borderRadius: '12px',\n backgroundColor: '#FFEECC'\n }}\n />\n <div className={style.sortSectionWrapper}>\n <div className={style.certificatesCount}>{count}</div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n type=\"switch\"\n name={translate('show_completed')}\n title={translate('show_completed')}\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n {sorting ? (\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n ) : null}\n </div>\n </div>\n <div className={style.certificateList}>\n {map(certification => {\n const {label, progress} = certification;\n if (!showCompleted && progress === 100) return null;\n\n return (\n <div key={label}>\n <CertificationCard {...certification} tag={tag} />\n </div>\n );\n }, certifications)}\n </div>\n </div>\n </div>\n );\n};\n\nCertifications.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nCertifications.propTypes = {\n certifications: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n goal: PropTypes.shape({\n title: PropTypes.string,\n condition: PropTypes.shape({\n nbDone: PropTypes.number\n })\n }),\n progress: PropTypes.number,\n imgUrl: PropTypes.string,\n onClick: PropTypes.func,\n locales: PropTypes.shape({\n conditionDescriptionProgress: PropTypes.string\n })\n })\n ),\n locales: PropTypes.shape({\n title: PropTypes.string,\n subtitle: PropTypes.string,\n tag: PropTypes.string,\n count: PropTypes.string\n }),\n sorting: PropTypes.shape(Select.propTypes)\n};\n\nexport default Certifications;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,iBAAP,MAA8B,mCAA9B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IACJC,OAAO,EAAE;MAACC,KAAD;MAAQC,QAAR;MAAkBC,GAAlB;MAAuBC;IAAvB,CADL;IAEJC,cAFI;IAGJC;EAHI,IAIFR,KAJJ;EAKA,MAAM;IAACS;EAAD,IAAcR,OAApB;EAEA,MAAM,CAACS,aAAD,EAAgBC,gBAAhB,IAAoCrB,QAAQ,CAAC,IAAD,CAAlD;EAEA,MAAMsB,QAAQ,GACZJ,OAAO,KAAKK,SAAZ,gBACE;IAAK,aAAU;EAAf,gBACE,oBAAC,MAAD,eAAYL,OAAZ;IAAqB,cAAW;EAAhC,GADF,CADF,GAII,IALN;EAOA,MAAMM,yBAAyB,GAAGvB,WAAW,CAAC,MAAM;IAClDoB,gBAAgB,CAAC,CAACD,aAAF,CAAhB;EACD,CAF4C,EAE1C,CAACA,aAAD,EAAgBC,gBAAhB,CAF0C,CAA7C;EAIA,oBACE;IAAK,SAAS,EAAEb,KAAK,CAACiB;EAAtB,gBACE;IAAK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CAAC8B,YAAf,GAA8B;EAC5BpB,SAAS,EAAEhB,QAAQ,CAACqC,iBAAT,CAA2BrB;AADV,CAA9B;AAIAV,cAAc,CAACgC,SAAf,2CAA2B;EACzBxB,cAAc,EAAEf,SAAS,CAACwC,OAAV,CACdxC,SAAS,CAACyC,KAAV,CAAgB;IACdN,KAAK,EAAEnC,SAAS,CAAC0C,MADH;IAEdC,IAAI,EAAE3C,SAAS,CAACyC,KAAV,CAAgB;MACpB9B,KAAK,EAAEX,SAAS,CAAC0C,MADG;MAEpBE,SAAS,EAAE5C,SAAS,CAACyC,KAAV,CAAgB;QACzBI,MAAM,EAAE7C,SAAS,CAAC8C;MADO,CAAhB;IAFS,CAAhB,CAFQ;IAQdV,QAAQ,EAAEpC,SAAS,CAAC8C,MARN;IASdC,MAAM,EAAE/C,SAAS,CAAC0C,MATJ;IAUdM,OAAO,EAAEhD,SAAS,CAACiD,IAVL;IAWdvC,OAAO,EAAEV,SAAS,CAACyC,KAAV,CAAgB;MACvBS,4BAA4B,EAAElD,SAAS,CAAC0C;IADjB,CAAhB;EAXK,CAAhB,CADc,CADS;EAkBzBhC,OAAO,EAAEV,SAAS,CAACyC,KAAV,CAAgB;IACvB9B,KAAK,EAAEX,SAAS,CAAC0C,MADM;IAEvB9B,QAAQ,EAAEZ,SAAS,CAAC0C,MAFG;IAGvB7B,GAAG,EAAEb,SAAS,CAAC0C,MAHQ;IAIvB5B,KAAK,EAAEd,SAAS,CAAC0C;EAJM,CAAhB,CAlBgB;EAwBzB1B,OAAO,EAAEhB,SAAS,CAACyC,KAAV,CAAgBtC,MAAM,CAACoC,SAAvB;AAxBgB,CAA3B;AA2BA,eAAehC,cAAf"}
@@ -5,9 +5,6 @@ declare namespace Certifications {
5
5
  const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  }
7
7
  namespace propTypes {
8
- const title: PropTypes.Requireable<string>;
9
- const subtitle: PropTypes.Requireable<string>;
10
- const tag: PropTypes.Requireable<string>;
11
8
  const certifications: PropTypes.Requireable<(PropTypes.InferProps<{
12
9
  label: PropTypes.Requireable<string>;
13
10
  goal: PropTypes.Requireable<PropTypes.InferProps<{
@@ -23,6 +20,12 @@ declare namespace Certifications {
23
20
  conditionDescriptionProgress: PropTypes.Requireable<string>;
24
21
  }>>;
25
22
  }> | null | undefined)[]>;
23
+ const locales: PropTypes.Requireable<PropTypes.InferProps<{
24
+ title: PropTypes.Requireable<string>;
25
+ subtitle: PropTypes.Requireable<string>;
26
+ tag: PropTypes.Requireable<string>;
27
+ count: PropTypes.Requireable<string>;
28
+ }>>;
26
29
  const sorting: PropTypes.Requireable<PropTypes.InferProps<{
27
30
  title: PropTypes.Requireable<string>;
28
31
  name: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certifications/index.js"],"names":[],"mappings":";AAUA,uEAoEC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certifications/index.js"],"names":[],"mappings":";AAUA,uEAwEC"}
@@ -31,9 +31,12 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
31
31
 
32
32
  const Certifications = (props, context) => {
33
33
  const {
34
- title,
35
- subtitle,
36
- tag,
34
+ locales: {
35
+ title,
36
+ subtitle,
37
+ tag,
38
+ count
39
+ },
37
40
  certifications,
38
41
  sorting
39
42
  } = props;
@@ -70,7 +73,7 @@ const Certifications = (props, context) => {
70
73
  className: _style.default.sortSectionWrapper
71
74
  }, /*#__PURE__*/_react.default.createElement("div", {
72
75
  className: _style.default.certificatesCount
73
- }, `${certifications.length} ${title}`), /*#__PURE__*/_react.default.createElement("div", {
76
+ }, count), /*#__PURE__*/_react.default.createElement("div", {
74
77
  className: _style.default.sortSection
75
78
  }, /*#__PURE__*/_react.default.createElement(_inputSwitch.default, {
76
79
  id: 'show-completed-courses-switch',
@@ -102,9 +105,6 @@ Certifications.contextTypes = {
102
105
  translate: _provider.default.childContextTypes.translate
103
106
  };
104
107
  Certifications.propTypes = process.env.NODE_ENV !== "production" ? {
105
- title: _propTypes.default.string,
106
- subtitle: _propTypes.default.string,
107
- tag: _propTypes.default.string,
108
108
  certifications: _propTypes.default.arrayOf(_propTypes.default.shape({
109
109
  label: _propTypes.default.string,
110
110
  goal: _propTypes.default.shape({
@@ -120,6 +120,12 @@ Certifications.propTypes = process.env.NODE_ENV !== "production" ? {
120
120
  conditionDescriptionProgress: _propTypes.default.string
121
121
  })
122
122
  })),
123
+ locales: _propTypes.default.shape({
124
+ title: _propTypes.default.string,
125
+ subtitle: _propTypes.default.string,
126
+ tag: _propTypes.default.string,
127
+ count: _propTypes.default.string
128
+ }),
123
129
  sorting: _propTypes.default.shape(_select.default.propTypes)
124
130
  } : {};
125
131
  var _default = Certifications;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Certifications","props","context","title","subtitle","tag","certifications","sorting","translate","showCompleted","setShowCompleted","useState","sortView","undefined","handleShowCompletedToggle","useCallback","style","backgroudnContainer","container","iconName","iconColor","borderRadius","backgroundColor","sortSectionWrapper","certificatesCount","length","sortSection","sortWrapper","certificateList","certification","label","progress","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","arrayOf","shape","goal","condition","nbDone","number","imgUrl","onClick","func","locales","conditionDescriptionProgress","Select"],"sources":["../../../src/template/certifications/index.js"],"sourcesContent":["import React, {useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Title from '../../atom/title';\nimport Select from '../../atom/select';\nimport InputSwitch from '../../atom/input-switch';\nimport CertificationCard from '../../molecule/certification-card';\nimport style from './style.css';\n\nconst Certifications = (props, context) => {\n const {title, subtitle, tag, certifications, sorting} = props;\n const {translate} = context;\n\n const [showCompleted, setShowCompleted] = useState(true);\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(!showCompleted);\n }, [showCompleted, setShowCompleted]);\n\n return (\n <div className={style.backgroudnContainer}>\n <div className={style.container} data-name=\"Certifications\">\n <Title\n title={title}\n subtitle={subtitle}\n type=\"form-group\"\n titleSize=\"standard-light-weight\"\n subtitleSize=\"standard-without-margin\"\n icon={{\n iconName: 'wreath-laurel',\n iconColor: '#B87A00',\n borderRadius: '12px',\n backgroundColor: '#FFEECC'\n }}\n />\n <div className={style.sortSectionWrapper}>\n <div className={style.certificatesCount}>{`${certifications.length} ${title}`}</div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n type=\"switch\"\n name={translate('show_completed')}\n title={translate('show_completed')}\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n {sorting ? (\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n ) : null}\n </div>\n </div>\n <div className={style.certificateList}>\n {map(certification => {\n const {label, progress} = certification;\n if (!showCompleted && progress === 100) return null;\n\n return (\n <div key={label}>\n <CertificationCard {...certification} tag={tag} />\n </div>\n );\n }, certifications)}\n </div>\n </div>\n </div>\n );\n};\n\nCertifications.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nCertifications.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n tag: PropTypes.string,\n certifications: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n goal: PropTypes.shape({\n title: PropTypes.string,\n condition: PropTypes.shape({\n nbDone: PropTypes.number\n })\n }),\n progress: PropTypes.number,\n imgUrl: PropTypes.string,\n onClick: PropTypes.func,\n locales: PropTypes.shape({\n conditionDescriptionProgress: PropTypes.string\n })\n })\n ),\n sorting: PropTypes.shape(Select.propTypes)\n};\n\nexport default Certifications;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,cAAc,GAAG,CAACC,KAAD,EA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EK,kBAAA,CAAUO,MARN;IASdC,MAAM,EAAER,kBAAA,CAAUC,MATJ;IAUdQ,OAAO,EAAET,kBAAA,CAAUU,IAVL;IAWdC,OAAO,EAAEX,kBAAA,CAAUG,KAAV,CAAgB;MACvBS,4BAA4B,EAAEZ,kBAAA,CAAUC;IADjB,CAAhB;EAXK,CAAhB,CADc,CAJS;EAqBzB9B,OAAO,EAAE6B,kBAAA,CAAUG,KAAV,CAAgBU,eAAA,CAAOd,SAAvB;AArBgB,CAA3B;eAwBenC,c"}
1
+ {"version":3,"file":"index.js","names":["Certifications","props","context","locales","title","subtitle","tag","count","certifications","sorting","translate","showCompleted","setShowCompleted","useState","sortView","undefined","handleShowCompletedToggle","useCallback","style","backgroudnContainer","container","iconName","iconColor","borderRadius","backgroundColor","sortSectionWrapper","certificatesCount","sortSection","sortWrapper","certificateList","certification","label","progress","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","string","goal","condition","nbDone","number","imgUrl","onClick","func","conditionDescriptionProgress","Select"],"sources":["../../../src/template/certifications/index.js"],"sourcesContent":["import React, {useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Title from '../../atom/title';\nimport Select from '../../atom/select';\nimport InputSwitch from '../../atom/input-switch';\nimport CertificationCard from '../../molecule/certification-card';\nimport style from './style.css';\n\nconst Certifications = (props, context) => {\n const {\n locales: {title, subtitle, tag, count},\n certifications,\n sorting\n } = props;\n const {translate} = context;\n\n const [showCompleted, setShowCompleted] = useState(true);\n\n const sortView =\n sorting !== undefined ? (\n <div data-name=\"choice\">\n <Select {...sorting} aria-label=\"All courses sort\" />\n </div>\n ) : null;\n\n const handleShowCompletedToggle = useCallback(() => {\n setShowCompleted(!showCompleted);\n }, [showCompleted, setShowCompleted]);\n\n return (\n <div className={style.backgroudnContainer}>\n <div className={style.container} data-name=\"Certifications\">\n <Title\n title={title}\n subtitle={subtitle}\n type=\"form-group\"\n titleSize=\"standard-light-weight\"\n subtitleSize=\"standard-without-margin\"\n icon={{\n iconName: 'wreath-laurel',\n iconColor: '#B87A00',\n borderRadius: '12px',\n backgroundColor: '#FFEECC'\n }}\n />\n <div className={style.sortSectionWrapper}>\n <div className={style.certificatesCount}>{count}</div>\n <div className={style.sortSection}>\n <InputSwitch\n id={'show-completed-courses-switch'}\n type=\"switch\"\n name={translate('show_completed')}\n title={translate('show_completed')}\n aria-label={'Show completed courses aria label'}\n value={showCompleted}\n onChange={handleShowCompletedToggle}\n />\n {sorting ? (\n <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n ) : null}\n </div>\n </div>\n <div className={style.certificateList}>\n {map(certification => {\n const {label, progress} = certification;\n if (!showCompleted && progress === 100) return null;\n\n return (\n <div key={label}>\n <CertificationCard {...certification} tag={tag} />\n </div>\n );\n }, certifications)}\n </div>\n </div>\n </div>\n );\n};\n\nCertifications.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nCertifications.propTypes = {\n certifications: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n goal: PropTypes.shape({\n title: PropTypes.string,\n condition: PropTypes.shape({\n nbDone: PropTypes.number\n })\n }),\n progress: PropTypes.number,\n imgUrl: PropTypes.string,\n onClick: PropTypes.func,\n locales: PropTypes.shape({\n conditionDescriptionProgress: PropTypes.string\n })\n })\n ),\n locales: PropTypes.shape({\n title: PropTypes.string,\n subtitle: PropTypes.string,\n tag: PropTypes.string,\n count: PropTypes.string\n }),\n sorting: PropTypes.shape(Select.propTypes)\n};\n\nexport default Certifications;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IACJC,OAAO,EAAE;MAACC,KAAD;MAAQC,QAAR;MAAkBC,GAAlB;MAAuBC;IAAvB,CADL;IAEJC,cAFI;IAGJ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E,KAAV,CAAgB;IACvBnC,KAAK,EAAEiC,kBAAA,CAAUG,MADM;IAEvBnC,QAAQ,EAAEgC,kBAAA,CAAUG,MAFG;IAGvBlC,GAAG,EAAE+B,kBAAA,CAAUG,MAHQ;IAIvBjC,KAAK,EAAE8B,kBAAA,CAAUG;EAJM,CAAhB,CAlBgB;EAwBzB/B,OAAO,EAAE4B,kBAAA,CAAUE,KAAV,CAAgBU,eAAA,CAAOb,SAAvB;AAxBgB,CAA3B;eA2BepC,c"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "11.32.44-alpha.55+a7eb1129d",
3
+ "version": "11.32.44-alpha.56+8919f5255",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -178,5 +178,5 @@
178
178
  "last 2 versions",
179
179
  "IE 11"
180
180
  ],
181
- "gitHead": "a7eb1129d17c0524732f8616201ec644055c92be"
181
+ "gitHead": "8919f525552adaaad95caeea85893c028da369bc"
182
182
  }