@coorpacademy/components 11.32.33-alpha.31.30 → 11.32.33-alpha.32

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.
Files changed (54) hide show
  1. package/es/atom/title/index.d.ts.map +1 -1
  2. package/es/atom/title/index.js +0 -6
  3. package/es/atom/title/index.js.map +1 -1
  4. package/es/atom/title/style.css +0 -11
  5. package/es/molecule/progress-wrapper/index.d.ts +2 -4
  6. package/es/molecule/progress-wrapper/index.d.ts.map +1 -1
  7. package/es/molecule/progress-wrapper/index.js +10 -17
  8. package/es/molecule/progress-wrapper/index.js.map +1 -1
  9. package/es/molecule/progress-wrapper/style.css +1 -9
  10. package/es/template/certification-detail/index.d.ts +3 -44
  11. package/es/template/certification-detail/index.d.ts.map +1 -1
  12. package/es/template/certification-detail/index.js +14 -34
  13. package/es/template/certification-detail/index.js.map +1 -1
  14. package/es/template/certification-detail/style.css +1 -12
  15. package/es/template/skill-detail/all-courses.js +3 -3
  16. package/es/template/skill-detail/all-courses.js.map +1 -1
  17. package/lib/atom/title/index.d.ts.map +1 -1
  18. package/lib/atom/title/index.js +0 -6
  19. package/lib/atom/title/index.js.map +1 -1
  20. package/lib/atom/title/style.css +0 -11
  21. package/lib/molecule/progress-wrapper/index.d.ts +2 -4
  22. package/lib/molecule/progress-wrapper/index.d.ts.map +1 -1
  23. package/lib/molecule/progress-wrapper/index.js +10 -18
  24. package/lib/molecule/progress-wrapper/index.js.map +1 -1
  25. package/lib/molecule/progress-wrapper/style.css +1 -9
  26. package/lib/template/certification-detail/index.d.ts +3 -44
  27. package/lib/template/certification-detail/index.d.ts.map +1 -1
  28. package/lib/template/certification-detail/index.js +14 -35
  29. package/lib/template/certification-detail/index.js.map +1 -1
  30. package/lib/template/certification-detail/style.css +1 -12
  31. package/lib/template/skill-detail/all-courses.js +3 -3
  32. package/lib/template/skill-detail/all-courses.js.map +1 -1
  33. package/locales/en/global.json +0 -5
  34. package/package.json +2 -2
  35. package/es/molecule/certification-card/index.d.ts +0 -21
  36. package/es/molecule/certification-card/index.d.ts.map +0 -1
  37. package/es/molecule/certification-card/index.js +0 -99
  38. package/es/molecule/certification-card/index.js.map +0 -1
  39. package/es/molecule/certification-card/style.css +0 -72
  40. package/es/template/certifications/index.d.ts +0 -54
  41. package/es/template/certifications/index.d.ts.map +0 -1
  42. package/es/template/certifications/index.js +0 -91
  43. package/es/template/certifications/index.js.map +0 -1
  44. package/es/template/certifications/style.css +0 -70
  45. package/lib/molecule/certification-card/index.d.ts +0 -21
  46. package/lib/molecule/certification-card/index.d.ts.map +0 -1
  47. package/lib/molecule/certification-card/index.js +0 -113
  48. package/lib/molecule/certification-card/index.js.map +0 -1
  49. package/lib/molecule/certification-card/style.css +0 -72
  50. package/lib/template/certifications/index.d.ts +0 -54
  51. package/lib/template/certifications/index.d.ts.map +0 -1
  52. package/lib/template/certifications/index.js +0 -110
  53. package/lib/template/certifications/index.js.map +0 -1
  54. package/lib/template/certifications/style.css +0 -70
@@ -1 +1 @@
1
- {"version":3,"file":"all-courses.js","names":["React","useState","useCallback","useEffect","PropTypes","Provider","Select","SelectOptionPropTypes","ButtonLink","SearchForm","CardsGrid","searchValueIncluded","InputSwitch","style","FilterButton","props","context","selected","filter","onClick","skin","primarySkinColor","buttonProps","customStyle","backgroundColor","color","transition","width","label","contextTypes","childContextTypes","translate","propTypes","bool","string","func","AllCourses","courses","totalCourses","filters","sorting","options","onChange","list","loading","showCompleted","setShowCompleted","searchValue","setSearchValue","searchResults","setSearchResults","course","sortView","undefined","handleSearch","value","skill","title","handleSearchReset","handleShowCompletedToggle","toggledShowCompleted","progress","continueLearningWrapper","continueLearningTitle","continueLearningNumber","searchAndSortSection","searchWrapper","placeholder","sortSection","sortWrapper","filterWrapper","length","map","index","name","handleChange","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","number","arrayOf"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, sortBy} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport SearchForm from '../../molecule/search-form';\nimport CardsGrid from '../../organism/cards-grid';\nimport searchValueIncluded from '../../util/search-value-included';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './all-courses.css';\n\nconst FilterButton = (props, context) => {\n const {selected, filter, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: selected ? primarySkinColor : '#E1E1E3',\n color: selected ? '#FFFFFF' : '#515161',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n label: filter,\n onClick,\n 'data-name': 'filter-type-course-button'\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nFilterButton.propTypes = {\n selected: PropTypes.bool,\n filter: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {courses, totalCourses, filters, sorting} = props;\n const {options, onChange} = filters;\n const {list, loading} = courses;\n const {translate} = context;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState('');\n const [searchResults, setSearchResults] = useState(\n sortBy(course => -getOr(0, ['progress'], course), list)\n );\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 useEffect(() => {\n setSearchResults(sortBy(course => -getOr(0, ['progress'], course), list));\n }, [list]);\n\n const handleSearch = useCallback(\n value => {\n setSearchValue(value);\n setSearchResults(list.filter(skill => searchValueIncluded(skill.title, value)));\n },\n [list, setSearchValue, setSearchResults]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n setSearchResults(list);\n }, [list, setSearchValue, setSearchResults]);\n\n const handleShowCompletedToggle = useCallback(() => {\n const toggledShowCompleted = !showCompleted;\n setShowCompleted(toggledShowCompleted);\n if (toggledShowCompleted) {\n setSearchResults(list);\n handleSearchReset();\n } else {\n setSearchResults(searchResults.filter(skill => skill.progress < 100));\n }\n }, [list, searchResults, showCompleted, setShowCompleted, setSearchResults, handleSearchReset]);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_courses')}</span>\n <span className={style.continueLearningNumber}>{totalCourses}</span>\n </div>\n <div className={style.searchAndSortSection}>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_place_holder'),\n value: searchValue,\n onChange: handleSearch\n }}\n onReset={handleSearchReset}\n />\n </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 <div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>\n </div>\n </div>\n <div className={style.filterWrapper}>\n {options.length > 2 && searchResults.length > 0\n ? options.map((filter, index) => {\n const {name, value, selected} = filter;\n\n function handleChange() {\n onChange(value);\n handleSearchReset();\n }\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton selected={selected} filter={name} onClick={handleChange} />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n })\n : null}\n </div>\n <div>\n {searchResults.length > 0 ? (\n <CardsGrid\n list={searchResults}\n loading={loading}\n customStyle={{justifyContent: 'left'}}\n />\n ) : (\n <div className={style.emptySearchResultContainer}>\n <div className={style.emptySearchResultTitle}>\n {translate('empty_search_result_title', {searchValue})}\n </div>\n <div className={style.emptySearchResultDescription}>\n {translate('empty_search_result_description')}\n </div>\n <div className={style.emptySearchResultClearSearch} onClick={handleSearchReset}>\n {translate('empty_search_result_clear_search')}\n </div>\n </div>\n )}\n </div>\n </>\n );\n};\n\nAllCourses.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nAllCourses.propTypes = {\n courses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes)\n};\n\nexport default AllCourses;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,EAAsCC,SAAtC,QAAsD,OAAtD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,UAAP,MAAuB,4BAAvB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,mBAAP,MAAgC,kCAAhC;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,mBAAlB;;AAEA,MAAMC,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IAACC,QAAD;IAAWC,MAAX;IAAmBC;EAAnB,IAA8BJ,KAApC;EACA,MAAM;IAACK;EAAD,IAASJ,OAAf;;EACA,MAAMK,gBAAgB,GAAG,KAAI,gBAAJ,EAAsBD,IAAtB,CAAzB;;EAEA,MAAME,WAAW,GAAG;IAClBC,WAAW,EAAE;MACXC,eAAe,EAAEP,QAAQ,GAAGI,gBAAH,GAAsB,SADpC;MAEXI,KAAK,EAAER,QAAQ,GAAG,SAAH,GAAe,SAFnB;MAGXS,UAAU,EAAE,6DAHD;MAIXC,KAAK,EAAE;IAJI,CADK;IAOlBC,KAAK,EAAEV,MAPW;IAQlBC,OARkB;IASlB,aAAa;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EAFc,CAAhB,CAHY;EAOrBiC,OAAO,EAAEpC,SAAS,CAAC+E,KAAV,CAAgB7E,MAAM,CAAC0B,SAAvB;AAPY,CAAvB;AAUA,eAAeI,UAAf"}
1
+ {"version":3,"file":"all-courses.js","names":["React","useState","useCallback","useEffect","PropTypes","Provider","Select","SelectOptionPropTypes","ButtonLink","SearchForm","CardsGrid","searchValueIncluded","InputSwitch","style","FilterButton","props","context","selected","filter","onClick","skin","primarySkinColor","buttonProps","customStyle","backgroundColor","color","transition","width","label","contextTypes","childContextTypes","translate","propTypes","bool","string","func","AllCourses","courses","totalCourses","filters","sorting","options","onChange","list","loading","showCompleted","setShowCompleted","searchValue","setSearchValue","searchResults","setSearchResults","course","sortView","undefined","handleSearch","value","skill","title","handleSearchReset","handleShowCompletedToggle","toggledShowCompleted","progress","continueLearningWrapper","continueLearningTitle","continueLearningNumber","searchAndSortSection","searchWrapper","placeholder","sortSection","sortWrapper","filterWrapper","length","map","index","name","handleChange","filterButtonWrapper","divider","justifyContent","emptySearchResultContainer","emptySearchResultTitle","emptySearchResultDescription","emptySearchResultClearSearch","shape","number","arrayOf"],"sources":["../../../src/template/skill-detail/all-courses.js"],"sourcesContent":["import React, {useState, useCallback, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, getOr, sortBy} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport SearchForm from '../../molecule/search-form';\nimport CardsGrid from '../../organism/cards-grid';\nimport searchValueIncluded from '../../util/search-value-included';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './all-courses.css';\n\nconst FilterButton = (props, context) => {\n const {selected, filter, onClick} = props;\n const {skin} = context;\n const primarySkinColor = get('common.primary', skin);\n\n const buttonProps = {\n customStyle: {\n backgroundColor: selected ? primarySkinColor : '#E1E1E3',\n color: selected ? '#FFFFFF' : '#515161',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out',\n width: 'fit-content'\n },\n label: filter,\n onClick,\n 'data-name': 'filter-type-course-button'\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nFilterButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nFilterButton.propTypes = {\n selected: PropTypes.bool,\n filter: PropTypes.string,\n onClick: PropTypes.func\n};\n\nconst AllCourses = (props, context) => {\n const {courses, totalCourses, filters, sorting} = props;\n const {options, onChange} = filters;\n const {list, loading} = courses;\n const {translate} = context;\n const [showCompleted, setShowCompleted] = useState(true);\n const [searchValue, setSearchValue] = useState('');\n const [searchResults, setSearchResults] = useState(\n sortBy(course => -getOr(0, ['progress'], course), list)\n );\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 useEffect(() => {\n setSearchResults(sortBy(course => -getOr(0, ['progress'], course), list));\n }, [list]);\n\n const handleSearch = useCallback(\n value => {\n setSearchValue(value);\n setSearchResults(list.filter(skill => searchValueIncluded(skill.title, value)));\n },\n [list, setSearchValue, setSearchResults]\n );\n\n const handleSearchReset = useCallback(() => {\n setSearchValue('');\n setSearchResults(list);\n }, [list, setSearchValue, setSearchResults]);\n\n const handleShowCompletedToggle = useCallback(() => {\n const toggledShowCompleted = !showCompleted;\n setShowCompleted(toggledShowCompleted);\n if (toggledShowCompleted) {\n setSearchResults(list);\n handleSearchReset();\n } else {\n setSearchResults(searchResults.filter(skill => skill.progress === 0));\n }\n }, [list, searchResults, showCompleted, setShowCompleted, setSearchResults, handleSearchReset]);\n\n return (\n <>\n <div className={style.continueLearningWrapper}>\n <span className={style.continueLearningTitle}>{translate('all_courses')}</span>\n <span className={style.continueLearningNumber}>{totalCourses}</span>\n </div>\n <div className={style.searchAndSortSection}>\n <div className={style.searchWrapper}>\n <SearchForm\n search={{\n placeholder: translate('search_place_holder'),\n value: searchValue,\n onChange: handleSearch\n }}\n onReset={handleSearchReset}\n />\n </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 {sortView ? (<div className={style.sortWrapper}>\n {translate('sort_by')}\n {sortView}\n </div>) : null}\n </div>\n </div>\n <div className={style.filterWrapper}>\n {options.length > 2 && searchResults.length > 0\n ? options.map((filter, index) => {\n const {name, value, selected} = filter;\n\n function handleChange() {\n onChange(value);\n handleSearchReset();\n }\n return (\n <div key={index} className={style.filterButtonWrapper}>\n <FilterButton selected={selected} filter={name} onClick={handleChange} />\n {value === 'ALL' ? <div className={style.divider} /> : null}\n </div>\n );\n })\n : null}\n </div>\n <div>\n {searchResults.length > 0 ? (\n <CardsGrid\n list={searchResults}\n loading={loading}\n customStyle={{justifyContent: 'left'}}\n />\n ) : (\n <div className={style.emptySearchResultContainer}>\n <div className={style.emptySearchResultTitle}>\n {translate('empty_search_result_title', {searchValue})}\n </div>\n <div className={style.emptySearchResultDescription}>\n {translate('empty_search_result_description')}\n </div>\n <div className={style.emptySearchResultClearSearch} onClick={handleSearchReset}>\n {translate('empty_search_result_clear_search')}\n </div>\n </div>\n )}\n </div>\n </>\n );\n};\n\nAllCourses.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nAllCourses.propTypes = {\n courses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes)\n};\n\nexport default AllCourses;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,EAAsCC,SAAtC,QAAsD,OAAtD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA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D,EAA8B;IAACgB;EAAD,CAA9B,CADZ,CADF,eAIE;IAAK,SAAS,EAAElC,KAAK,CAACoE;EAAtB,GACGlD,SAAS,CAAC,iCAAD,CADZ,CAJF,eAOE;IAAK,SAAS,EAAElB,KAAK,CAACqE,4BAAtB;IAAoD,OAAO,EAAExB;EAA7D,GACG3B,SAAS,CAAC,kCAAD,CADZ,CAPF,CARJ,CAlDF,CADF;AA0ED,CAxHD;;AA0HAK,UAAU,CAACP,YAAX,GAA0B;EACxBT,IAAI,EAAEf,QAAQ,CAACyB,iBAAT,CAA2BV,IADT;EAExBW,SAAS,EAAE1B,QAAQ,CAACyB,iBAAT,CAA2BC;AAFd,CAA1B;AAKAK,UAAU,CAACJ,SAAX,2CAAuB;EACrBK,OAAO,EAAEjC,SAAS,CAAC+E,KAAV,CAAgBzE,SAAS,CAACsB,SAA1B,CADY;EAErBM,YAAY,EAAElC,SAAS,CAACgF,MAFH;EAGrB7C,OAAO,EAAEnC,SAAS,CAAC+E,KAAV,CAAgB;IACvBzC,QAAQ,EAAEtC,SAAS,CAAC+B,IADG;IAEvBM,OAAO,EAAErC,SAAS,CAACiF,OAAV,CAAkBjF,SAAS,CAAC+E,KAAV,CAAgB5E,qBAAhB,CAAlB;EAFc,CAAhB,CAHY;EAOrBiC,OAAO,EAAEpC,SAAS,CAAC+E,KAAV,CAAgB7E,MAAM,CAAC0B,SAAvB;AAPY,CAAvB;AAUA,eAAeI,UAAf"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/title/index.js"],"names":[],"mappings":";AA4CA,gDA4BC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/title/index.js"],"names":[],"mappings":";AAwCA,gDA4BC"}
@@ -24,9 +24,6 @@ const getTitleStyle = (type, size) => {
24
24
 
25
25
  case 'form-group':
26
26
  switch (size) {
27
- case 'standard-light-weight':
28
- return _style.default.titleFormGroupLightWeight;
29
-
30
27
  case 'standard':
31
28
  return _style.default.titleFormGroup;
32
29
 
@@ -50,9 +47,6 @@ const getSubtitleStyle = (type, size) => {
50
47
  case 'standard':
51
48
  return _style.default.subtitleFormGroup;
52
49
 
53
- case 'standard-without-margin':
54
- return _style.default.subtitleFormGroupWithoutMargin;
55
-
56
50
  case 'small':
57
51
  return _style.default.smallSubtitleFormGroup;
58
52
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["getTitleStyle","type","size","style","titlePage","titleFormGroupLightWeight","titleFormGroup","mediumTitleFormGroup","smallTitleFormGroup","getSubtitleStyle","subtitlePage","subtitleFormGroup","subtitleFormGroupWithoutMargin","smallSubtitleFormGroup","smallSubtitleFormGroupWithoutMargin","extraSmallSubtitleFormGroup","Title","props","title","subtitle","dataName","titleSize","subtitleSize","icon","tag","titleStyle","subtitleStyle","subtitleSection","container","propTypes","PropTypes","string","oneOf","shape","Icon","Tag"],"sources":["../../../src/atom/title/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Icon from '../icon';\nimport Tag from '../tag';\nimport style from './style.css';\n\nconst getTitleStyle = (type, size) => {\n switch (type) {\n case 'page':\n return style.titlePage;\n case 'form-group':\n switch (size) {\n case 'standard-light-weight':\n return style.titleFormGroupLightWeight;\n case 'standard':\n return style.titleFormGroup;\n case 'medium':\n return style.mediumTitleFormGroup;\n case 'small':\n return style.smallTitleFormGroup;\n }\n }\n};\n\nconst getSubtitleStyle = (type, size) => {\n switch (type) {\n case 'page':\n return style.subtitlePage;\n case 'form-group':\n switch (size) {\n case 'standard':\n return style.subtitleFormGroup;\n case 'standard-without-margin':\n return style.subtitleFormGroupWithoutMargin;\n case 'small':\n return style.smallSubtitleFormGroup;\n case 'small-without-margin':\n return style.smallSubtitleFormGroupWithoutMargin;\n case 'extra-small':\n return style.extraSmallSubtitleFormGroup;\n }\n }\n};\n\nconst Title = props => {\n const {\n title,\n subtitle,\n type,\n 'data-name': dataName,\n titleSize = 'standard',\n subtitleSize = 'standard',\n icon,\n tag\n } = props;\n const titleStyle = getTitleStyle(type, titleSize);\n const subtitleStyle = getSubtitleStyle(type, subtitleSize);\n\n const subtitleSection = subtitle ? <div className={subtitleStyle}>{subtitle}</div> : null;\n\n return (\n <div className={style.container}>\n {icon ? <Icon {...icon} className={style.icon} /> : null}\n <div>\n <div className={titleStyle} data-name={dataName}>\n {title}\n {tag ? <Tag {...tag} /> : null}\n </div>\n {subtitleSection}\n </div>\n </div>\n );\n};\n\nTitle.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n type: PropTypes.oneOf(['page', 'form-group']),\n 'data-name': PropTypes.string,\n titleSize: PropTypes.oneOf(['standard', 'medium', 'small']),\n subtitleSize: PropTypes.oneOf(['standard', 'small', 'small-without-margin', 'extra-small']),\n icon: PropTypes.shape(Icon.propTypes),\n tag: PropTypes.shape(Tag.propTypes)\n};\nexport default Title;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,aAAa,GAAG,CAACC,IAAD,EAAOC,IAAP,KAAgB;EACpC,QAAQD,IAAR;IACE,KAAK,MAAL;MACE,OAAOE,cAAA,CAAMC,SAAb;;IACF,KAAK,YAAL;MACE,QAAQF,IAAR;QACE,KAAK,uBAAL;UACE,OAAOC,cAAA,CAAME,yBAAb;;QACF,KAAK,UAAL;UACE,OAAOF,cAAA,CAAMG,cAAb;;QACF,KAAK,QAAL;UACE,OAAOH,cAAA,CAAMI,oBAAb;;QACF,KAAK,OAAL;UACE,OAAOJ,cAAA,CAAMK,mBAAb;MARJ;;EAJJ;AAeD,CAhBD;;AAkBA,MAAMC,gBAAgB,GAAG,CAACR,IAAD,EAAOC,IAAP,KAAgB;EACvC,QAAQD,IAAR;IACE,KAAK,MAAL;MACE,OAAOE,cAAA,CAAMO,YAAb;;IACF,KAAK,YAAL;MACE,QAAQR,IAAR;QACE,KAAK,UAAL;UACE,OAAOC,cAAA,CAAMQ,iBAAb;;QACF,KAAK,yBAAL;UACE,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;EAKhBV,SAAS,EAAES,kBAAA,CAAUE,KAAV,CAAgB,CAAC,UAAD,EAAa,QAAb,EAAuB,OAAvB,CAAhB,CALK;EAMhBV,YAAY,EAAEQ,kBAAA,CAAUE,KAAV,CAAgB,CAAC,UAAD,EAAa,OAAb,EAAsB,sBAAtB,EAA8C,aAA9C,CAAhB,CANE;EAOhBT,IAAI,EAAEO,kBAAA,CAAUG,KAAV,CAAgBC,aAAA,CAAKL,SAArB,CAPU;EAQhBL,GAAG,EAAEM,kBAAA,CAAUG,KAAV,CAAgBE,YAAA,CAAIN,SAApB;AARW,CAAlB;eAUeb,K"}
1
+ {"version":3,"file":"index.js","names":["getTitleStyle","type","size","style","titlePage","titleFormGroup","mediumTitleFormGroup","smallTitleFormGroup","getSubtitleStyle","subtitlePage","subtitleFormGroup","smallSubtitleFormGroup","smallSubtitleFormGroupWithoutMargin","extraSmallSubtitleFormGroup","Title","props","title","subtitle","dataName","titleSize","subtitleSize","icon","tag","titleStyle","subtitleStyle","subtitleSection","container","propTypes","PropTypes","string","oneOf","shape","Icon","Tag"],"sources":["../../../src/atom/title/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Icon from '../icon';\nimport Tag from '../tag';\nimport style from './style.css';\n\nconst getTitleStyle = (type, size) => {\n switch (type) {\n case 'page':\n return style.titlePage;\n case 'form-group':\n switch (size) {\n case 'standard':\n return style.titleFormGroup;\n case 'medium':\n return style.mediumTitleFormGroup;\n case 'small':\n return style.smallTitleFormGroup;\n }\n }\n};\n\nconst getSubtitleStyle = (type, size) => {\n switch (type) {\n case 'page':\n return style.subtitlePage;\n case 'form-group':\n switch (size) {\n case 'standard':\n return style.subtitleFormGroup;\n case 'small':\n return style.smallSubtitleFormGroup;\n case 'small-without-margin':\n return style.smallSubtitleFormGroupWithoutMargin;\n case 'extra-small':\n return style.extraSmallSubtitleFormGroup;\n }\n }\n};\n\nconst Title = props => {\n const {\n title,\n subtitle,\n type,\n 'data-name': dataName,\n titleSize = 'standard',\n subtitleSize = 'standard',\n icon,\n tag\n } = props;\n const titleStyle = getTitleStyle(type, titleSize);\n const subtitleStyle = getSubtitleStyle(type, subtitleSize);\n\n const subtitleSection = subtitle ? <div className={subtitleStyle}>{subtitle}</div> : null;\n\n return (\n <div className={style.container}>\n {icon ? <Icon {...icon} className={style.icon} /> : null}\n <div>\n <div className={titleStyle} data-name={dataName}>\n {title}\n {tag ? <Tag {...tag} /> : null}\n </div>\n {subtitleSection}\n </div>\n </div>\n );\n};\n\nTitle.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n type: PropTypes.oneOf(['page', 'form-group']),\n 'data-name': PropTypes.string,\n titleSize: PropTypes.oneOf(['standard', 'medium', 'small']),\n subtitleSize: PropTypes.oneOf(['standard', 'small', 'small-without-margin', 'extra-small']),\n icon: PropTypes.shape(Icon.propTypes),\n tag: PropTypes.shape(Tag.propTypes)\n};\nexport default Title;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,aAAa,GAAG,CAACC,IAAD,EAAOC,IAAP,KAAgB;EACpC,QAAQD,IAAR;IACE,KAAK,MAAL;MACE,OAAOE,cAAA,CAAMC,SAAb;;IACF,KAAK,YAAL;MACE,QAAQF,IAAR;QACE,KAAK,UAAL;UACE,OAAOC,cAAA,CAAME,cAAb;;QACF,KAAK,QAAL;UACE,OAAOF,cAAA,CAAMG,oBAAb;;QACF,KAAK,OAAL;UACE,OAAOH,cAAA,CAAMI,mBAAb;MANJ;;EAJJ;AAaD,CAdD;;AAgBA,MAAMC,gBAAgB,GAAG,CAACP,IAAD,EAAOC,IAAP,KAAgB;EACvC,QAAQD,IAAR;IACE,KAAK,MAAL;MACE,OAAOE,cAAA,CAAMM,YAAb;;IACF,KAAK,YAAL;MACE,QAAQP,IAAR;QACE,KAAK,UAAL;UACE,OAAOC,cAAA,CAAMO,iBAAb;;QACF,KAAK,OAAL;UACE,OAAOP,cAAA,CAAMQ,sBAAb;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AAvB,CAAhB,CALK;EAMhBV,YAAY,EAAEQ,kBAAA,CAAUE,KAAV,CAAgB,CAAC,UAAD,EAAa,OAAb,EAAsB,sBAAtB,EAA8C,aAA9C,CAAhB,CANE;EAOhBT,IAAI,EAAEO,kBAAA,CAAUG,KAAV,CAAgBC,aAAA,CAAKL,SAArB,CAPU;EAQhBL,GAAG,EAAEM,kBAAA,CAAUG,KAAV,CAAgBE,YAAA,CAAIN,SAApB;AARW,CAAlB;eAUeb,K"}
@@ -28,11 +28,6 @@
28
28
  gap: 4px;
29
29
  }
30
30
 
31
- .titleFormGroupLightWeight {
32
- composes: titleFormGroup;
33
- font-weight: 600;
34
- }
35
-
36
31
  .mediumTitleFormGroup {
37
32
  composes: title;
38
33
  font-size: 16px;
@@ -69,12 +64,6 @@
69
64
  color: cm_grey_400;
70
65
  }
71
66
 
72
- .subtitleFormGroupWithoutMargin {
73
- composes: subtitleFormGroup;
74
- font-weight: 500;
75
- margin: 0;
76
- }
77
-
78
67
  .smallSubtitleFormGroup{
79
68
  composes: subtitleFormGroup;
80
69
  max-width: 455px;
@@ -1,6 +1,5 @@
1
1
  export default ProgressWrapper;
2
- declare function ProgressWrapper({ completedCourses, completedModules, title, subtitle, progression, sections }: {
3
- completedCourses: any;
2
+ declare function ProgressWrapper({ completedModules, title, subtitle, progression, sections }: {
4
3
  completedModules: any;
5
4
  title: any;
6
5
  subtitle: any;
@@ -19,8 +18,7 @@ declare namespace ProgressWrapper {
19
18
  const progression: PropTypes.Requireable<number>;
20
19
  const sections: PropTypes.Requireable<(PropTypes.InferProps<{
21
20
  type: PropTypes.Requireable<string>;
22
- badgeUrl: PropTypes.Requireable<string>;
23
- onDownload: PropTypes.Requireable<(...args: any[]) => any>;
21
+ downloadUrl: PropTypes.Requireable<string>;
24
22
  stars: PropTypes.Requireable<number>;
25
23
  }> | null | undefined)[]>;
26
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/progress-wrapper/index.js"],"names":[],"mappings":";AAyFA;;;;;;;8BA8DC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/progress-wrapper/index.js"],"names":[],"mappings":";AA6FA;;;;;;8BAyDC"}
@@ -5,8 +5,6 @@ exports.default = void 0;
5
5
 
6
6
  var _map2 = _interopRequireDefault(require("lodash/fp/map"));
7
7
 
8
- var _lowerCase2 = _interopRequireDefault(require("lodash/fp/lowerCase"));
9
-
10
8
  var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
11
9
 
12
10
  var _react = _interopRequireDefault(require("react"));
@@ -41,8 +39,7 @@ const DetailSection = ({
41
39
  index,
42
40
  type,
43
41
  isLocked,
44
- badgeUrl,
45
- onDownload,
42
+ downloadUrl,
46
43
  stars
47
44
  }, context) => {
48
45
  const {
@@ -52,7 +49,10 @@ const DetailSection = ({
52
49
 
53
50
  const DownloadButton = /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
54
51
  label: translate('download'),
55
- onClick: onDownload,
52
+ link: {
53
+ target: '_blank',
54
+ href: downloadUrl
55
+ },
56
56
  "data-name": "download-button",
57
57
  "aria-label": "download button",
58
58
  customStyle: {
@@ -106,7 +106,7 @@ const DetailSection = ({
106
106
  className: _style.default[`detailsSection${index}`]
107
107
  }, /*#__PURE__*/_react.default.createElement("img", {
108
108
  className: _style.default.img,
109
- src: badgeUrl || 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'
109
+ src: type === 'badge' ? downloadUrl : 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'
110
110
  }), /*#__PURE__*/_react.default.createElement("div", {
111
111
  className: _style.default.detailsInfo
112
112
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -119,7 +119,6 @@ const DetailSection = ({
119
119
  };
120
120
 
121
121
  const ProgressWrapper = ({
122
- completedCourses,
123
122
  completedModules,
124
123
  title,
125
124
  subtitle,
@@ -144,11 +143,7 @@ const ProgressWrapper = ({
144
143
  className: _style.default.statscontainer
145
144
  }, /*#__PURE__*/_react.default.createElement("div", {
146
145
  className: _style.default.stats
147
- }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("span", {
148
- className: _style.default.statsNumber
149
- }, completedCourses), (0, _lowerCase2.default)(translate('courses_completed'))), /*#__PURE__*/_react.default.createElement("div", {
150
- className: _style.default.divider
151
- }), /*#__PURE__*/_react.default.createElement("div", {
146
+ }, /*#__PURE__*/_react.default.createElement("div", {
152
147
  className: _style.default.statsModule
153
148
  }, /*#__PURE__*/_react.default.createElement("span", {
154
149
  className: _style.default.statsNumber
@@ -179,13 +174,11 @@ const ProgressWrapper = ({
179
174
  }, uncappedMap(({
180
175
  type,
181
176
  stars,
182
- badgeUrl,
183
- onDownload
177
+ downloadUrl
184
178
  }, index) => /*#__PURE__*/_react.default.createElement(DetailSection, {
185
179
  type,
186
180
  isLocked,
187
- badgeUrl,
188
- onDownload,
181
+ downloadUrl,
189
182
  stars,
190
183
  key: `${type}-${index}`,
191
184
  index: index
@@ -194,8 +187,7 @@ const ProgressWrapper = ({
194
187
 
195
188
  const commonDetailSectionPropTypes = process.env.NODE_ENV !== "production" ? {
196
189
  type: _propTypes.default.oneOf(['diploma', 'badge', 'stars']),
197
- badgeUrl: _propTypes.default.string,
198
- onDownload: _propTypes.default.func,
190
+ downloadUrl: _propTypes.default.string,
199
191
  stars: _propTypes.default.number
200
192
  } : {};
201
193
  DetailSection.contextTypes = {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["uncappedMap","convert","cap","DetailSection","index","type","isLocked","badgeUrl","onDownload","stars","context","translate","isTypeStars","DownloadButton","backgroundColor","color","position","faIcon","name","size","customStyle","padding","LockedTag","iconName","iconColor","preset","style","detailsInfo","detailsInfoText","detailsTitle","img","buttonContainer","ProgressWrapper","completedCourses","completedModules","title","subtitle","progression","sections","modulesCompletedLocal","container","titleContainer","statscontainer","stats","statsNumber","divider","statsModule","customProgressBar","COLORS","positive","statsMobile","statsModuleMobile","statsProgressionMobile","details","commonDetailSectionPropTypes","PropTypes","oneOf","string","func","number","contextTypes","Provider","childContextTypes","propTypes","bool","arrayOf","shape"],"sources":["../../../src/molecule/progress-wrapper/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, lowerCase, map} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport Provider from '../../atom/provider';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst DetailSection = ({index, type, isLocked, badgeUrl, onDownload, stars}, context) => {\n const {translate} = context;\n const isTypeStars = type === 'stars';\n\n const DownloadButton = (\n <ButtonLink\n label={translate('download')}\n onClick={onDownload}\n data-name=\"download-button\"\n aria-label=\"download button\"\n customStyle={{backgroundColor: '#F1F6FE', color: '#0061FF'}}\n icon={{\n position: 'left',\n faIcon: {\n name: 'download',\n color: '#0061FF',\n size: 14,\n customStyle: {padding: 0}\n }\n }}\n disabled={isLocked}\n />\n );\n\n const LockedTag = (\n <Tag\n label=\"Locked\"\n size=\"S\"\n icon={{\n position: 'left',\n iconName: 'lock',\n iconColor: '#515161',\n preset: 's',\n customStyle: {padding: 0}\n }}\n />\n );\n\n return isTypeStars ? (\n <div className={style[`detailsSection${index}`]}>\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>{translate('bonus_stars')}</span>\n {isLocked ? LockedTag : null}\n </div>\n <div className={style.stars}>\n <Icon iconName=\"star\" iconColor=\"#FFCE0A\" backgroundColor=\"#FFF9D1\" preset=\"xl\" />\n <span>{stars}</span>\n </div>\n </div>\n </div>\n ) : (\n <div className={style[`detailsSection${index}`]}>\n <img\n className={style.img}\n src={\n badgeUrl ||\n 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'\n }\n />\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>\n {type === 'diploma' ? translate('diploma') : translate('badge')}\n </span>\n {isLocked ? LockedTag : null}\n </div>\n\n <div className={style.buttonContainer}>{DownloadButton}</div>\n </div>\n </div>\n );\n};\n\nconst ProgressWrapper = (\n {completedCourses, completedModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const modulesCompletedLocal = translate('modules_completed');\n const isLocked = progression !== 100;\n\n return (\n <div className={style.container}>\n <div className={style.titleContainer}>\n <Title type=\"form-group\" titleSize=\"medium\" title={title} subtitle={subtitle} />\n </div>\n <div className={style.statscontainer}>\n <div className={style.stats}>\n <div>\n <span className={style.statsNumber}>{completedCourses}</span>\n {lowerCase(translate('courses_completed'))}\n </div>\n <div className={style.divider} />\n <div className={style.statsModule}>\n <span className={style.statsNumber}>{completedModules}</span>\n {modulesCompletedLocal}\n </div>\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progression}\n max={100}\n />\n <div className={style.statsMobile}>\n <div className={style.statsModuleMobile}>\n <span className={style.statsNumber}>{completedModules}</span>\n {modulesCompletedLocal}\n </div>\n <div className={style.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n </div>\n\n {isEmpty(sections) ? null : (\n <div className={style.details}>\n {uncappedMap(\n ({type, stars, badgeUrl, onDownload}, index) => (\n <DetailSection\n {...{type, isLocked, badgeUrl, onDownload, stars}}\n key={`${type}-${index}`}\n index={index}\n />\n ),\n sections\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst commonDetailSectionPropTypes = {\n type: PropTypes.oneOf(['diploma', 'badge', 'stars']),\n badgeUrl: PropTypes.string,\n onDownload: PropTypes.func,\n stars: PropTypes.number\n};\n\nDetailSection.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nDetailSection.propTypes = {\n index: PropTypes.number,\n isLocked: PropTypes.bool,\n ...commonDetailSectionPropTypes\n};\n\nProgressWrapper.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nProgressWrapper.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n completedCourses: PropTypes.number,\n completedModules: PropTypes.number,\n progression: PropTypes.number,\n sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))\n};\n\nexport default ProgressWrapper;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEA,MAAMA,WAAW,GAAG,cAAIC,OAAJ,CAAY;EAACC,GAAG,EAAE;AAAN,CAAZ,CAApB;;AAEA,MAAMC,aAAa,GAAG,CAAC;EAACC,KAAD;EAAQC,IAAR;EAAcC,QAAd;EAAwBC,QAAxB;EAAkCC,UAAlC;EAA8CC;AAA9C,CAAD,EAAuDC,OAAvD,KAAmE;EACvF,MAAM;IAACC;EAAD,IAAcD,OAApB;EACA,MAAME,WAAW,GAAGP,IAAI,KAAK,OAA7B;;EAEA,MAAMQ,cAAc,gBAClB,6BAAC,mBAAD;IACE,KAAK,EAAEF,SAAS,CAAC,UAAD,CADlB;IAEE,OAAO,EAAEH,UAFX;IAGE,aAAU,iBAHZ;IAIE,cAAW,iBAJb;IAKE,WAAW,EAAE;MAACM,eAAe,EAAE,SAAlB;MAA6BC,KAAK,EAAE;IAApC,CALf;IAME,IAAI,EAAE;MACJC,QAAQ,EAAE,MADN;MAEJC,MAAM,EAAE;QACNC,IAAI,EAAE,UADA;QAENH,KAAK,EAAE,SAFD;QAGNI,IAAI,EAAE,EAHA;QAINC,WAAW,EAAE;UAACC,OAAO,EAAE;QAAV;MAJP;IAFJ,CANR;IAeE,QAAQ,EAAEf;EAfZ,EADF;;EAoBA,MAAMgB,SAAS,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KAAK,EAAEmD,kBAAA,CAAUI,MADnB;EAEErD,QAAQ,EAAEiD,kBAAA,CAAUS;AAFtB,GAGKV,4BAHL;AAMAtB,eAAe,CAAC4B,YAAhB,GAA+B;EAC7BjD,SAAS,EAAEkD,iBAAA,CAASC,iBAAT,CAA2BnD;AADT,CAA/B;AAIAqB,eAAe,CAAC+B,SAAhB,2CAA4B;EAC1B5B,KAAK,EAAEoB,kBAAA,CAAUE,MADS;EAE1BrB,QAAQ,EAAEmB,kBAAA,CAAUE,MAFM;EAG1BxB,gBAAgB,EAAEsB,kBAAA,CAAUI,MAHF;EAI1BzB,gBAAgB,EAAEqB,kBAAA,CAAUI,MAJF;EAK1BtB,WAAW,EAAEkB,kBAAA,CAAUI,MALG;EAM1BrB,QAAQ,EAAEiB,kBAAA,CAAUU,OAAV,CAAkBV,kBAAA,CAAUW,KAAV,CAAgBZ,4BAAhB,CAAlB;AANgB,CAA5B;eASetB,e"}
1
+ {"version":3,"file":"index.js","names":["uncappedMap","convert","cap","DetailSection","index","type","isLocked","downloadUrl","stars","context","translate","isTypeStars","DownloadButton","target","href","backgroundColor","color","position","faIcon","name","size","customStyle","padding","LockedTag","iconName","iconColor","preset","style","detailsInfo","detailsInfoText","detailsTitle","img","buttonContainer","ProgressWrapper","completedModules","title","subtitle","progression","sections","modulesCompletedLocal","container","titleContainer","statscontainer","stats","statsModule","statsNumber","customProgressBar","COLORS","positive","statsMobile","statsModuleMobile","statsProgressionMobile","details","commonDetailSectionPropTypes","PropTypes","oneOf","string","number","contextTypes","Provider","childContextTypes","propTypes","bool","completedCourses","arrayOf","shape"],"sources":["../../../src/molecule/progress-wrapper/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, lowerCase, map} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport Provider from '../../atom/provider';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst uncappedMap = map.convert({cap: false});\n\nconst DetailSection = ({index, type, isLocked, downloadUrl, stars}, context) => {\n const {translate} = context;\n const isTypeStars = type === 'stars';\n\n const DownloadButton = (\n <ButtonLink\n label={translate('download')}\n link={{\n target: '_blank',\n href: downloadUrl\n }}\n data-name=\"download-button\"\n aria-label=\"download button\"\n customStyle={{backgroundColor: '#F1F6FE', color: '#0061FF'}}\n icon={{\n position: 'left',\n faIcon: {\n name: 'download',\n color: '#0061FF',\n size: 14,\n customStyle: {padding: 0}\n }\n }}\n disabled={isLocked}\n />\n );\n\n const LockedTag = (\n <Tag\n label=\"Locked\"\n size=\"S\"\n icon={{\n position: 'left',\n iconName: 'lock',\n iconColor: '#515161',\n preset: 's',\n customStyle: {padding: 0}\n }}\n />\n );\n\n return isTypeStars ? (\n <div className={style[`detailsSection${index}`]}>\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>{translate('bonus_stars')}</span>\n {isLocked ? LockedTag : null}\n </div>\n <div className={style.stars}>\n <Icon iconName=\"star\" iconColor=\"#FFCE0A\" backgroundColor=\"#FFF9D1\" preset=\"xl\" />\n <span>{stars}</span>\n </div>\n </div>\n </div>\n ) : (\n <div className={style[`detailsSection${index}`]}>\n <img\n className={style.img}\n src={\n type === 'badge'\n ? downloadUrl\n : 'https://s3.eu-west-1.amazonaws.com/static.coorpacademy.com/assets/images/diploma.svg'\n }\n />\n <div className={style.detailsInfo}>\n <div className={style.detailsInfoText}>\n <span className={style.detailsTitle}>\n {type === 'diploma' ? translate('diploma') : translate('badge')}\n </span>\n {isLocked ? LockedTag : null}\n </div>\n\n <div className={style.buttonContainer}>{DownloadButton}</div>\n </div>\n </div>\n );\n};\n\nconst ProgressWrapper = (\n {completedModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const modulesCompletedLocal = translate('modules_completed');\n const isLocked = progression !== 100;\n\n return (\n <div className={style.container}>\n <div className={style.titleContainer}>\n <Title type=\"form-group\" titleSize=\"medium\" title={title} subtitle={subtitle} />\n </div>\n <div className={style.statscontainer}>\n <div className={style.stats}>\n <div className={style.statsModule}>\n <span className={style.statsNumber}>{completedModules}</span>\n {modulesCompletedLocal}\n </div>\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progression}\n max={100}\n />\n <div className={style.statsMobile}>\n <div className={style.statsModuleMobile}>\n <span className={style.statsNumber}>{completedModules}</span>\n {modulesCompletedLocal}\n </div>\n <div className={style.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n </div>\n\n {isEmpty(sections) ? null : (\n <div className={style.details}>\n {uncappedMap(\n ({type, stars, downloadUrl}, index) => (\n <DetailSection\n {...{type, isLocked, downloadUrl, stars}}\n key={`${type}-${index}`}\n index={index}\n />\n ),\n sections\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst commonDetailSectionPropTypes = {\n type: PropTypes.oneOf(['diploma', 'badge', 'stars']),\n downloadUrl: PropTypes.string,\n stars: PropTypes.number\n};\n\nDetailSection.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nDetailSection.propTypes = {\n index: PropTypes.number,\n isLocked: PropTypes.bool,\n ...commonDetailSectionPropTypes\n};\n\nProgressWrapper.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nProgressWrapper.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n completedCourses: PropTypes.number,\n completedModules: PropTypes.number,\n progression: PropTypes.number,\n sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))\n};\n\nexport default ProgressWrapper;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEA,MAAMA,WA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7da;
48
- border: solid #d7d7da 1px;
49
- border-radius: 4px;
50
- }
51
-
52
44
  .progression {
53
45
  display: flex;
54
46
  justify-content: end;
@@ -181,5 +173,5 @@
181
173
  padding-top: 16px;
182
174
  color: cm_grey_400;
183
175
  font-weight: 600;
184
- }
176
+ }
185
177
  }
@@ -36,18 +36,9 @@ declare namespace CertificationDetail {
36
36
  completedCourses: PropTypes.Requireable<number>;
37
37
  completedModules: PropTypes.Requireable<number>;
38
38
  }>>;
39
- const onDownloadDiploma: PropTypes.Requireable<(...args: any[]) => any>;
40
- const badge: PropTypes.Requireable<PropTypes.InferProps<{
41
- badgeUrl: PropTypes.Requireable<string>;
42
- onDownloadBadge: PropTypes.Requireable<(...args: any[]) => any>;
43
- }>>;
44
- const ongoingCourses: PropTypes.Requireable<PropTypes.InferProps<{
45
- list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
46
- customStyle: PropTypes.Requireable<{
47
- [x: string]: string | null | undefined;
48
- }>;
49
- loading: PropTypes.Requireable<boolean>;
50
- }>>;
39
+ const diplomaUrl: PropTypes.Requireable<string>;
40
+ const badgeUrl: PropTypes.Requireable<string>;
41
+ const ongoingCoursesAvailable: PropTypes.Requireable<boolean>;
51
42
  const certificationCourses: PropTypes.Requireable<PropTypes.InferProps<{
52
43
  list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
53
44
  customStyle: PropTypes.Requireable<{
@@ -55,7 +46,6 @@ declare namespace CertificationDetail {
55
46
  }>;
56
47
  loading: PropTypes.Requireable<boolean>;
57
48
  }>>;
58
- const totalCourses: PropTypes.Requireable<number>;
59
49
  const totalModules: PropTypes.Requireable<number>;
60
50
  const filters: PropTypes.Requireable<PropTypes.InferProps<{
61
51
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -66,37 +56,6 @@ declare namespace CertificationDetail {
66
56
  validOption: PropTypes.Requireable<boolean>;
67
57
  }> | null | undefined)[]>;
68
58
  }>>;
69
- const sorting: PropTypes.Requireable<PropTypes.InferProps<{
70
- title: PropTypes.Requireable<string>;
71
- name: PropTypes.Requireable<string>;
72
- className: PropTypes.Requireable<string>;
73
- borderClassName: PropTypes.Requireable<string>;
74
- disabled: PropTypes.Requireable<boolean>;
75
- multiple: PropTypes.Requireable<boolean>;
76
- description: PropTypes.Requireable<string>;
77
- required: PropTypes.Requireable<boolean>;
78
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
79
- theme: PropTypes.Requireable<string>;
80
- options: PropTypes.Requireable<(PropTypes.InferProps<{
81
- name: PropTypes.Validator<string>;
82
- value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
83
- selected: PropTypes.Requireable<boolean>;
84
- validOption: PropTypes.Requireable<boolean>;
85
- }> | null | undefined)[]>;
86
- optgroups: PropTypes.Requireable<(PropTypes.InferProps<{
87
- label: PropTypes.Validator<string>;
88
- options: PropTypes.Requireable<(PropTypes.InferProps<{
89
- name: PropTypes.Validator<string>;
90
- value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
91
- selected: PropTypes.Requireable<boolean>;
92
- validOption: PropTypes.Requireable<boolean>;
93
- }> | null | undefined)[]>;
94
- }> | null | undefined)[]>;
95
- modified: PropTypes.Requireable<boolean>;
96
- error: PropTypes.Requireable<boolean>;
97
- 'aria-label': PropTypes.Requireable<string>;
98
- 'aria-labelledby': PropTypes.Requireable<string>;
99
- }>>;
100
59
  const onBackClick: PropTypes.Requireable<(...args: any[]) => any>;
101
60
  const onContinueLearningClick: PropTypes.Requireable<(...args: any[]) => any>;
102
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certification-detail/index.js"],"names":[],"mappings":";AAkBA,4EA8GC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certification-detail/index.js"],"names":[],"mappings":";AAiBA,4EAgGC"}
@@ -17,7 +17,7 @@ var _provider = _interopRequireDefault(require("../../atom/provider"));
17
17
 
18
18
  var _tag = _interopRequireDefault(require("../../atom/tag"));
19
19
 
20
- var _select = _interopRequireWildcard(require("../../atom/select"));
20
+ var _select = require("../../atom/select");
21
21
 
22
22
  var _buttonLinkIcon = _interopRequireDefault(require("../../atom/button-link-icon"));
23
23
 
@@ -27,8 +27,6 @@ var _cardsGrid = _interopRequireDefault(require("../../organism/cards-grid"));
27
27
 
28
28
  var _allCourses = _interopRequireDefault(require("../skill-detail/all-courses"));
29
29
 
30
- var _continueLearning = _interopRequireDefault(require("../skill-detail/continue-learning"));
31
-
32
30
  var _skillDetail = require("../skill-detail");
33
31
 
34
32
  var _progressWrapper = _interopRequireDefault(require("../../molecule/progress-wrapper"));
@@ -49,17 +47,15 @@ const CertificationDetail = (props, context) => {
49
47
  title,
50
48
  description,
51
49
  certificationCourses,
52
- ongoingCourses,
53
- totalCourses,
50
+ ongoingCoursesAvailable,
54
51
  totalModules,
55
52
  filters,
56
- sorting,
57
53
  onBackClick,
58
54
  onContinueLearningClick,
59
55
  metrics,
60
56
  logoUrl,
61
- onDownloadDiploma,
62
- badge = {}
57
+ diplomaUrl,
58
+ badgeUrl
63
59
  } = props;
64
60
  const {
65
61
  translate
@@ -70,10 +66,6 @@ const CertificationDetail = (props, context) => {
70
66
  completedModules,
71
67
  stars
72
68
  } = metrics;
73
- const {
74
- badgeUrl = false,
75
- onDownloadBadge
76
- } = badge;
77
69
  const [showMore, setShowMore] = (0, _react.useState)(false);
78
70
  const handleShowMore = (0, _react.useCallback)(() => setShowMore(!showMore), [setShowMore, showMore]);
79
71
  const Description = (0, _react.useCallback)(() => {
@@ -115,16 +107,10 @@ const CertificationDetail = (props, context) => {
115
107
  }
116
108
  })) : null) : null, /*#__PURE__*/_react.default.createElement("div", {
117
109
  className: _style.default.contentStats
118
- }, /*#__PURE__*/_react.default.createElement("span", null, `${totalCourses} ${(0, _lowerCase2.default)(translate('courses'))}`), /*#__PURE__*/_react.default.createElement("div", {
119
- className: _style.default.divider
120
- }), /*#__PURE__*/_react.default.createElement("span", null, `${totalModules} ${(0, _lowerCase2.default)(translate('modules'))}`)), /*#__PURE__*/_react.default.createElement(_skillDetail.ContinueLearningButton, {
121
- ongoingCoursesAvailable: !!ongoingCourses.list.length,
110
+ }, /*#__PURE__*/_react.default.createElement("span", null, `${totalModules} ${(0, _lowerCase2.default)(translate('modules'))}`)), /*#__PURE__*/_react.default.createElement(_skillDetail.ContinueLearningButton, {
111
+ ongoingCoursesAvailable: ongoingCoursesAvailable,
122
112
  onClick: onContinueLearningClick
123
- }))), /*#__PURE__*/_react.default.createElement("div", {
124
- className: _style.default.continueLearningSection
125
- }, /*#__PURE__*/_react.default.createElement(_continueLearning.default, {
126
- ongoingCourses: ongoingCourses
127
- })), /*#__PURE__*/_react.default.createElement(_progressWrapper.default, {
113
+ }))), /*#__PURE__*/_react.default.createElement(_progressWrapper.default, {
128
114
  title: translate('your_progress'),
129
115
  subtitle: translate('certification_progress_wrapper_subtitle'),
130
116
  progression: progression,
@@ -132,20 +118,18 @@ const CertificationDetail = (props, context) => {
132
118
  completedModules: completedModules,
133
119
  sections: (0, _compact2.default)([{
134
120
  type: 'diploma',
135
- onDownload: () => onDownloadDiploma
121
+ downloadUrl: diplomaUrl
136
122
  }, badgeUrl && {
137
123
  type: 'badge',
138
- badgeUrl,
139
- onDownload: () => onDownloadBadge
124
+ downloadUrl: badgeUrl
140
125
  }, {
141
126
  type: 'stars',
142
127
  stars
143
128
  }])
144
129
  }), /*#__PURE__*/_react.default.createElement(_allCourses.default, {
145
130
  courses: certificationCourses,
146
- totalCourses: totalCourses,
147
- filters: filters,
148
- sorting: sorting
131
+ totalCourses: totalModules,
132
+ filters: filters
149
133
  })));
150
134
  };
151
135
 
@@ -164,20 +148,15 @@ CertificationDetail.propTypes = process.env.NODE_ENV !== "production" ? {
164
148
  completedCourses: _propTypes.default.number,
165
149
  completedModules: _propTypes.default.number
166
150
  }),
167
- onDownloadDiploma: _propTypes.default.func,
168
- badge: _propTypes.default.shape({
169
- badgeUrl: _propTypes.default.string,
170
- onDownloadBadge: _propTypes.default.func
171
- }),
172
- ongoingCourses: _propTypes.default.shape(_cardsGrid.default.propTypes),
151
+ diplomaUrl: _propTypes.default.string,
152
+ badgeUrl: _propTypes.default.string,
153
+ ongoingCoursesAvailable: _propTypes.default.bool,
173
154
  certificationCourses: _propTypes.default.shape(_cardsGrid.default.propTypes),
174
- totalCourses: _propTypes.default.number,
175
155
  totalModules: _propTypes.default.number,
176
156
  filters: _propTypes.default.shape({
177
157
  onChange: _propTypes.default.func,
178
158
  options: _propTypes.default.arrayOf(_propTypes.default.shape(_select.SelectOptionPropTypes))
179
159
  }),
180
- sorting: _propTypes.default.shape(_select.default.propTypes),
181
160
  onBackClick: _propTypes.default.func,
182
161
  onContinueLearningClick: _propTypes.default.func
183
162
  } : {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["DESCRIPTION_BREAKPOINT","CertificationDetail","props","context","certificationRef","title","description","certificationCourses","ongoingCourses","totalCourses","totalModules","filters","sorting","onBackClick","onContinueLearningClick","metrics","logoUrl","onDownloadDiploma","badge","translate","progression","completedCourses","completedModules","stars","badgeUrl","onDownloadBadge","showMore","setShowMore","useState","handleShowMore","useCallback","Description","classnames","style","truncate","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","length","showMoreWrapper","faSize","wrapperSize","contentStats","divider","list","continueLearningSection","type","onDownload","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","shape","number","func","CardsGrid","onChange","options","arrayOf","SelectOptionPropTypes","Select"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport ContinueLearning from '../skill-detail/continue-learning';\nimport {ContinueLearningButton} from '../skill-detail';\nimport ProgressWrapper from '../../molecule/progress-wrapper';\nimport style from './style.css';\n\nconst DESCRIPTION_BREAKPOINT = 382;\n\nconst CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n description,\n certificationCourses,\n ongoingCourses,\n totalCourses,\n totalModules,\n filters,\n sorting,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n onDownloadDiploma,\n badge = {}\n } = props;\n const {translate} = context;\n const {progression, completedCourses, completedModules, stars} = metrics;\n const {badgeUrl = false, onDownloadBadge} = badge;\n\n const [showMore, setShowMore] = useState(false);\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n {description}\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label=\"Back\"\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n <div className={style.ctaContainer}>\n <div className={style.logoContainer}>\n <img className={style.logo} src={logoUrl} />\n </div>\n <div>\n <Tag label={translate('certification')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {description.length >= DESCRIPTION_BREAKPOINT ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.contentStats}>\n <span>{`${totalCourses} ${lowerCase(translate('courses'))}`}</span>\n <div className={style.divider} />\n <span>{`${totalModules} ${lowerCase(translate('modules'))}`}</span>\n </div>\n <ContinueLearningButton\n ongoingCoursesAvailable={!!ongoingCourses.list.length}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n <div className={style.continueLearningSection}>\n <ContinueLearning ongoingCourses={ongoingCourses} />\n </div>\n <ProgressWrapper\n title={translate('your_progress')}\n subtitle={translate('certification_progress_wrapper_subtitle')}\n progression={progression}\n completedCourses={completedCourses}\n completedModules={completedModules}\n sections={compact([\n {\n type: 'diploma',\n onDownload: () => onDownloadDiploma\n },\n badgeUrl && {\n type: 'badge',\n badgeUrl,\n onDownload: () => onDownloadBadge\n },\n {\n type: 'stars',\n stars\n }\n ])}\n />\n <AllCourses\n courses={certificationCourses}\n totalCourses={totalCourses}\n filters={filters}\n sorting={sorting}\n />\n </div>\n </div>\n );\n};\n\nCertificationDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nCertificationDetail.propTypes = {\n title: PropTypes.string.isRequired,\n certificationRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n completedCourses: PropTypes.number,\n completedModules: PropTypes.number\n }),\n onDownloadDiploma: PropTypes.func,\n badge: PropTypes.shape({\n badgeUrl: PropTypes.string,\n onDownloadBadge: PropTypes.func\n }),\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes),\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n totalModules: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default CertificationDetail;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,sBAAsB,GAAG,GAA/B;;AAEA,MAAMC,mB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IAIvBtC,gBAAgB,EAAEkC,kBAAA,CAAUI;EAJL,CAAhB,CALqB;EAW9B3C,iBAAiB,EAAEuC,kBAAA,CAAUK,IAXC;EAY9B3C,KAAK,EAAEsC,kBAAA,CAAUG,KAAV,CAAgB;IACrBnC,QAAQ,EAAEgC,kBAAA,CAAUC,MADC;IAErBhC,eAAe,EAAE+B,kBAAA,CAAUK;EAFN,CAAhB,CAZuB;EAgB9BrD,cAAc,EAAEgD,kBAAA,CAAUG,KAAV,CAAgBG,kBAAA,CAAUP,SAA1B,CAhBc;EAiB9BhD,oBAAoB,EAAEiD,kBAAA,CAAUG,KAAV,CAAgBG,kBAAA,CAAUP,SAA1B,CAjBQ;EAkB9B9C,YAAY,EAAE+C,kBAAA,CAAUI,MAlBM;EAmB9BlD,YAAY,EAAE8C,kBAAA,CAAUI,MAnBM;EAoB9BjD,OAAO,EAAE6C,kBAAA,CAAUG,KAAV,CAAgB;IACvBI,QAAQ,EAAEP,kBAAA,CAAUK,IADG;IAEvBG,OAAO,EAAER,kBAAA,CAAUS,OAAV,CAAkBT,kBAAA,CAAUG,KAAV,CAAgBO,6BAAhB,CAAlB;EAFc,CAAhB,CApBqB;EAwB9BtD,OAAO,EAAE4C,kBAAA,CAAUG,KAAV,CAAgBQ,eAAA,CAAOZ,SAAvB,CAxBqB;EAyB9B1C,WAAW,EAAE2C,kBAAA,CAAUK,IAzBO;EA0B9B/C,uBAAuB,EAAE0C,kBAAA,CAAUK;AA1BL,CAAhC;eA6Be5D,mB"}
1
+ {"version":3,"file":"index.js","names":["DESCRIPTION_BREAKPOINT","CertificationDetail","props","context","certificationRef","title","description","certificationCourses","ongoingCoursesAvailable","totalModules","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","translate","progression","completedCourses","completedModules","stars","showMore","setShowMore","useState","handleShowMore","useCallback","Description","classnames","style","truncate","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","length","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","string","isRequired","shape","number","bool","CardsGrid","onChange","func","options","arrayOf","SelectOptionPropTypes"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport AllCourses from '../skill-detail/all-courses';\nimport {ContinueLearningButton} from '../skill-detail';\nimport ProgressWrapper from '../../molecule/progress-wrapper';\nimport style from './style.css';\n\nconst DESCRIPTION_BREAKPOINT = 382;\n\nconst CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n description,\n certificationCourses,\n ongoingCoursesAvailable,\n totalModules,\n filters,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n diplomaUrl,\n badgeUrl\n } = props;\n const {translate} = context;\n const {progression, completedCourses, completedModules, stars} = metrics;\n\n const [showMore, setShowMore] = useState(false);\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n {description}\n </div>\n );\n }, [showMore, description]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label=\"Back\"\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n <div className={style.ctaContainer}>\n <div className={style.logoContainer}>\n <img className={style.logo} src={logoUrl} />\n </div>\n <div>\n <Tag label={translate('certification')} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {description.length >= DESCRIPTION_BREAKPOINT ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {translate(showMore ? 'Show less' : 'Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{faSize: 14, wrapperSize: 16}}\n />\n </div>\n ) : null}\n </>\n ) : null}\n <div className={style.contentStats}>\n <span>{`${totalModules} ${lowerCase(translate('modules'))}`}</span>\n </div>\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n <ProgressWrapper\n title={translate('your_progress')}\n subtitle={translate('certification_progress_wrapper_subtitle')}\n progression={progression}\n completedCourses={completedCourses}\n completedModules={completedModules}\n sections={compact([\n {\n type: 'diploma',\n downloadUrl: diplomaUrl\n },\n badgeUrl && {\n type: 'badge',\n downloadUrl: badgeUrl\n },\n {\n type: 'stars',\n stars\n }\n ])}\n />\n <AllCourses courses={certificationCourses} totalCourses={totalModules} filters={filters} />\n </div>\n </div>\n );\n};\n\nCertificationDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nCertificationDetail.propTypes = {\n title: PropTypes.string.isRequired,\n certificationRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n completedCourses: PropTypes.number,\n completedModules: PropTypes.number\n }),\n diplomaUrl: PropTypes.string,\n badgeUrl: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\n totalModules: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n onBackClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default CertificationDetail;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;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EAAEP,kBAAA,CAAUQ,IADG;IAEvBC,OAAO,EAAET,kBAAA,CAAUU,OAAV,CAAkBV,kBAAA,CAAUG,KAAV,CAAgBQ,6BAAhB,CAAlB;EAFc,CAAhB,CAhBqB;EAoB9BjD,WAAW,EAAEsC,kBAAA,CAAUQ,IApBO;EAqB9B7C,uBAAuB,EAAEqC,kBAAA,CAAUQ;AArBL,CAAhC;eAwBexD,mB"}
@@ -8,14 +8,6 @@
8
8
  @value cm_grey_200 from colors;
9
9
  @value cm_grey_400 from colors;
10
10
 
11
- .divider {
12
- width: 4px;
13
- height: 4px;
14
- background-color: cm_grey_400;
15
- border: solid cm_grey_400 1px;
16
- border-radius: 4px;
17
- }
18
-
19
11
  .textBase {
20
12
  font-family: "Gilroy";
21
13
  font-style: normal;
@@ -53,6 +45,7 @@
53
45
  align-items: center;
54
46
  width: 100%;
55
47
  gap: 40px;
48
+ margin-bottom: 40px;
56
49
  }
57
50
 
58
51
  .logoContainer {
@@ -112,10 +105,6 @@
112
105
  color: cm_grey_400;
113
106
  }
114
107
 
115
- .continueLearningSection {
116
- padding: 24px 0 32px 0;
117
- }
118
-
119
108
  @media tablet {
120
109
  .ctaContainer {
121
110
  flex-direction: column;