@coorpacademy/components 11.32.45 → 11.32.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/button-link/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +12 -6
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link-icon/index.js +2 -2
- package/es/atom/button-link-icon/index.js.map +1 -1
- package/es/atom/input-file-draggable/index.js +2 -2
- package/es/atom/input-file-draggable/index.js.map +1 -1
- package/es/atom/link/index.d.ts +1 -1
- package/es/atom/link/index.d.ts.map +1 -1
- package/es/atom/link/index.js +33 -41
- package/es/atom/link/index.js.map +1 -1
- package/es/molecule/banner/index.js +3 -3
- package/es/molecule/banner/index.js.map +1 -1
- package/es/molecule/certification-card/index.d.ts +4 -0
- package/es/molecule/certification-card/index.d.ts.map +1 -1
- package/es/molecule/certification-card/index.js +14 -10
- package/es/molecule/certification-card/index.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +1 -1
- package/es/molecule/progress-wrapper/index.d.ts.map +1 -1
- package/es/molecule/progress-wrapper/index.js +22 -12
- package/es/molecule/progress-wrapper/index.js.map +1 -1
- package/es/organism/accordion/coorp-manager/part/index.d.ts.map +1 -1
- package/es/organism/accordion/coorp-manager/part/index.js +3 -1
- package/es/organism/accordion/coorp-manager/part/index.js.map +1 -1
- package/es/organism/list-item/index.js +1 -1
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +3 -3
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/sidebar/index.d.ts +28 -3
- package/es/organism/sidebar/index.d.ts.map +1 -1
- package/es/organism/sidebar/index.js +7 -3
- package/es/organism/sidebar/index.js.map +1 -1
- package/es/template/app-player/loading/index.d.ts +1 -1
- package/es/template/app-player/player/index.d.ts +2 -2
- package/es/template/app-player/player/slides/index.d.ts +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +3 -3
- package/es/template/app-player/popin-end/index.d.ts +2 -2
- package/es/template/app-player/popin-end/summary.d.ts +1 -1
- package/es/template/app-player/popin-header/index.d.ts +1 -1
- package/es/template/app-review/index.d.ts +1 -1
- package/es/template/app-review/player/prop-types.d.ts +1 -1
- package/es/template/app-review/prop-types.d.ts +1 -1
- package/es/template/back-office/brand-update/index.d.ts +1 -1
- package/es/template/certification-detail/index.d.ts +1 -0
- package/es/template/certification-detail/index.d.ts.map +1 -1
- package/es/template/certification-detail/index.js +3 -1
- package/es/template/certification-detail/index.js.map +1 -1
- package/es/template/certifications/index.d.ts +9 -0
- package/es/template/certifications/index.d.ts.map +1 -1
- package/es/template/certifications/index.js +34 -12
- package/es/template/certifications/index.js.map +1 -1
- package/es/template/common/dashboard/index.d.ts +2 -2
- package/es/template/common/search-page/index.d.ts +1 -1
- package/es/template/external-course/index.d.ts +1 -1
- package/es/template/skill-detail/index.d.ts +1 -1
- package/es/template/skill-detail/index.d.ts.map +1 -1
- package/es/template/skill-detail/index.js +5 -5
- package/es/template/skill-detail/index.js.map +1 -1
- package/es/variables/colors.d.ts +2 -0
- package/es/variables/colors.d.ts.map +1 -1
- package/es/variables/colors.js +3 -1
- package/es/variables/colors.js.map +1 -1
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js +12 -6
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link-icon/index.js +2 -2
- package/lib/atom/button-link-icon/index.js.map +1 -1
- package/lib/atom/input-file-draggable/index.js.map +1 -1
- package/lib/atom/link/index.d.ts +1 -1
- package/lib/atom/link/index.d.ts.map +1 -1
- package/lib/atom/link/index.js +33 -42
- package/lib/atom/link/index.js.map +1 -1
- package/lib/molecule/banner/index.js.map +1 -1
- package/lib/molecule/certification-card/index.d.ts +4 -0
- package/lib/molecule/certification-card/index.d.ts.map +1 -1
- package/lib/molecule/certification-card/index.js +14 -10
- package/lib/molecule/certification-card/index.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +1 -1
- package/lib/molecule/progress-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/progress-wrapper/index.js +26 -13
- package/lib/molecule/progress-wrapper/index.js.map +1 -1
- package/lib/organism/accordion/coorp-manager/part/index.d.ts.map +1 -1
- package/lib/organism/accordion/coorp-manager/part/index.js +5 -1
- package/lib/organism/accordion/coorp-manager/part/index.js.map +1 -1
- package/lib/organism/list-item/index.js +2 -2
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +4 -3
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/sidebar/index.d.ts +28 -3
- package/lib/organism/sidebar/index.d.ts.map +1 -1
- package/lib/organism/sidebar/index.js +7 -3
- package/lib/organism/sidebar/index.js.map +1 -1
- package/lib/template/app-player/loading/index.d.ts +1 -1
- package/lib/template/app-player/player/index.d.ts +2 -2
- package/lib/template/app-player/player/slides/index.d.ts +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +3 -3
- package/lib/template/app-player/popin-end/index.d.ts +2 -2
- package/lib/template/app-player/popin-end/summary.d.ts +1 -1
- package/lib/template/app-player/popin-header/index.d.ts +1 -1
- package/lib/template/app-review/index.d.ts +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +1 -1
- package/lib/template/app-review/prop-types.d.ts +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +1 -1
- package/lib/template/certification-detail/index.d.ts +1 -0
- package/lib/template/certification-detail/index.d.ts.map +1 -1
- package/lib/template/certification-detail/index.js +3 -1
- package/lib/template/certification-detail/index.js.map +1 -1
- package/lib/template/certifications/index.d.ts +9 -0
- package/lib/template/certifications/index.d.ts.map +1 -1
- package/lib/template/certifications/index.js +36 -14
- package/lib/template/certifications/index.js.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +2 -2
- package/lib/template/common/search-page/index.d.ts +1 -1
- package/lib/template/external-course/index.d.ts +1 -1
- package/lib/template/skill-detail/index.d.ts +1 -1
- package/lib/template/skill-detail/index.d.ts.map +1 -1
- package/lib/template/skill-detail/index.js +5 -5
- package/lib/template/skill-detail/index.js.map +1 -1
- package/lib/variables/colors.d.ts +2 -0
- package/lib/variables/colors.d.ts.map +1 -1
- package/lib/variables/colors.js +3 -1
- package/lib/variables/colors.js.map +1 -1
- package/locales/bs/global.json +1 -1
- package/locales/cs/global.json +1 -1
- package/locales/de/global.json +1 -1
- package/locales/en/global.json +1 -1
- package/locales/es/global.json +1 -1
- package/locales/et/global.json +1 -1
- package/locales/fi/global.json +1 -1
- package/locales/fr/global.json +1 -1
- package/locales/hr/global.json +1 -1
- package/locales/hu/global.json +1 -1
- package/locales/hy/global.json +1 -1
- package/locales/it/global.json +1 -1
- package/locales/ja/global.json +1 -1
- package/locales/ko/global.json +1 -1
- package/locales/nl/global.json +1 -1
- package/locales/pl/global.json +1 -1
- package/locales/pt/global.json +1 -1
- package/locales/ro/global.json +1 -1
- package/locales/ru/global.json +1 -1
- package/locales/sk/global.json +1 -1
- package/locales/sl/global.json +1 -1
- package/locales/sv/global.json +1 -1
- package/locales/tl/global.json +1 -1
- package/locales/tr/global.json +1 -1
- package/locales/uk/global.json +1 -1
- package/locales/vi/global.json +1 -1
- package/locales/zh/global.json +1 -1
- package/locales/zh_TW/global.json +1 -1
- package/package.json +2 -2
|
@@ -810,8 +810,8 @@ declare const propTypes: {
|
|
|
810
810
|
'aria-label': PropTypes.Requireable<string>;
|
|
811
811
|
title: PropTypes.Requireable<string>;
|
|
812
812
|
target: PropTypes.Requireable<string>;
|
|
813
|
-
skinHover: PropTypes.Requireable<boolean>;
|
|
814
813
|
hoverColor: PropTypes.Requireable<string>;
|
|
814
|
+
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
815
815
|
download: PropTypes.Requireable<boolean>;
|
|
816
816
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
817
817
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1207,8 +1207,8 @@ declare namespace BrandUpdate {
|
|
|
1207
1207
|
'aria-label': PropTypes.Requireable<string>;
|
|
1208
1208
|
title: PropTypes.Requireable<string>;
|
|
1209
1209
|
target: PropTypes.Requireable<string>;
|
|
1210
|
-
skinHover: PropTypes.Requireable<boolean>;
|
|
1211
1210
|
hoverColor: PropTypes.Requireable<string>;
|
|
1211
|
+
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
1212
1212
|
download: PropTypes.Requireable<boolean>;
|
|
1213
1213
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1214
1214
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -27,6 +27,7 @@ declare namespace CertificationDetail {
|
|
|
27
27
|
}
|
|
28
28
|
namespace propTypes {
|
|
29
29
|
const title: PropTypes.Validator<string>;
|
|
30
|
+
const tag: PropTypes.Requireable<string>;
|
|
30
31
|
const certificationRef: PropTypes.Validator<string>;
|
|
31
32
|
const description: PropTypes.Validator<string>;
|
|
32
33
|
const logoUrl: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certification-detail/index.js"],"names":[],"mappings":";AAgBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certification-detail/index.js"],"names":[],"mappings":";AAgBA,4EAyHC"}
|
|
@@ -21,6 +21,7 @@ const CertificationDetail = (props, context) => {
|
|
|
21
21
|
const {
|
|
22
22
|
certificationRef,
|
|
23
23
|
title,
|
|
24
|
+
tag,
|
|
24
25
|
description,
|
|
25
26
|
certificationCourses,
|
|
26
27
|
ongoingCoursesAvailable,
|
|
@@ -81,7 +82,7 @@ const CertificationDetail = (props, context) => {
|
|
|
81
82
|
className: style.logo,
|
|
82
83
|
src: logoUrl
|
|
83
84
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tag, {
|
|
84
|
-
label:
|
|
85
|
+
label: tag
|
|
85
86
|
}), /*#__PURE__*/React.createElement("div", {
|
|
86
87
|
className: style.title
|
|
87
88
|
}, title), description ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Description, null), isDescriptionTruncated ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -127,6 +128,7 @@ CertificationDetail.contextTypes = {
|
|
|
127
128
|
};
|
|
128
129
|
CertificationDetail.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
129
130
|
title: PropTypes.string.isRequired,
|
|
131
|
+
tag: PropTypes.string,
|
|
130
132
|
certificationRef: PropTypes.string.isRequired,
|
|
131
133
|
description: PropTypes.string.isRequired,
|
|
132
134
|
logoUrl: PropTypes.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useEffect","useRef","useState","useMemo","PropTypes","classnames","Markdown","Provider","Tag","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearningButton","ProgressWrapper","style","CertificationDetail","props","context","certificationRef","title","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","descriptionRef","translate","progression","mandatoryModules","stars","totalModules","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","completedModules","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","childContextTypes","propTypes","string","isRequired","shape","number","bool","onChange","func","options","arrayOf"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase, round, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\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 CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n description,\n certificationCourses,\n ongoingCoursesAvailable,\n filters,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n diplomaUrl,\n badgeUrl\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n const {progression, mandatoryModules, stars, totalModules} = metrics;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n const completedModules = useMemo(\n () => round((mandatoryModules * progression) / 100),\n [mandatoryModules, progression]\n );\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\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 {isDescriptionTruncated ? (\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 completedModules={completedModules}\n mandatoryModules={mandatoryModules}\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\n content={certificationCourses}\n filters={filters}\n data-name=\"certification-courses\"\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.isRequired,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n mandatoryModules: PropTypes.number,\n totalModules: PropTypes.number\n }),\n diplomaUrl: PropTypes.string,\n badgeUrl: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\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,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,MAAvC,EAA+CC,QAA/C,EAAyDC,OAAzD,QAAuE,OAAvE;AACA,OAAO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Effect","useRef","useState","useMemo","PropTypes","classnames","Markdown","Provider","Tag","SelectOptionPropTypes","ButtonLinkIcon","Icon","CardsGrid","AllCourses","ContinueLearningButton","ProgressWrapper","style","CertificationDetail","props","context","certificationRef","title","tag","description","certificationCourses","ongoingCoursesAvailable","filters","onBackClick","onContinueLearningClick","metrics","logoUrl","diplomaUrl","badgeUrl","descriptionRef","translate","progression","mandatoryModules","stars","totalModules","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","completedModules","backgroundContainer","container","backButton","ctaContainer","logoContainer","logo","showMoreWrapper","faSize","wrapperSize","contentStats","type","downloadUrl","contextTypes","skin","childContextTypes","propTypes","string","isRequired","shape","number","bool","onChange","func","options","arrayOf"],"sources":["../../../src/template/certification-detail/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {compact, lowerCase, round, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\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 CertificationDetail = (props, context) => {\n const {\n certificationRef,\n title,\n tag,\n description,\n certificationCourses,\n ongoingCoursesAvailable,\n filters,\n onBackClick,\n onContinueLearningClick,\n metrics,\n logoUrl,\n diplomaUrl,\n badgeUrl\n } = props;\n const descriptionRef = useRef(null);\n const {translate} = context;\n\n const {progression, mandatoryModules, stars, totalModules} = metrics;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n const completedModules = useMemo(\n () => round((mandatoryModules * progression) / 100),\n [mandatoryModules, progression]\n );\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={certificationRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div className={style.logoContainer}>\n <img className={style.logo} src={logoUrl} />\n </div>\n <div>\n <Tag label={tag} />\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\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 completedModules={completedModules}\n mandatoryModules={mandatoryModules}\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\n content={certificationCourses}\n filters={filters}\n data-name=\"certification-courses\"\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 tag: PropTypes.string,\n certificationRef: PropTypes.string.isRequired,\n description: PropTypes.string.isRequired,\n logoUrl: PropTypes.string,\n metrics: PropTypes.shape({\n progression: PropTypes.number,\n stars: PropTypes.number,\n mandatoryModules: PropTypes.number,\n totalModules: PropTypes.number\n }),\n diplomaUrl: PropTypes.string,\n badgeUrl: PropTypes.string,\n ongoingCoursesAvailable: PropTypes.bool,\n certificationCourses: PropTypes.shape(CardsGrid.propTypes),\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,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,MAAvC,EAA+CC,QAA/C,EAAyDC,OAAzD,QAAuE,OAAvE;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,iBAArB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,SAAQC,qBAAR,QAAoC,mBAApC;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,UAAP,MAAuB,6BAAvB;AACA,SAAQC,sBAAR,QAAqC,iBAArC;AACA,OAAOC,eAAP,MAA4B,iCAA5B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,mBAAmB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC9C,MAA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AW,EAAE/B,SAAS,CAACiE,MADA;IAEvBhC,KAAK,EAAEjC,SAAS,CAACiE,MAFM;IAGvBjC,gBAAgB,EAAEhC,SAAS,CAACiE,MAHL;IAIvB/B,YAAY,EAAElC,SAAS,CAACiE;EAJD,CAAhB,CANqB;EAY9BtC,UAAU,EAAE3B,SAAS,CAAC8D,MAZQ;EAa9BlC,QAAQ,EAAE5B,SAAS,CAAC8D,MAbU;EAc9BzC,uBAAuB,EAAErB,SAAS,CAACkE,IAdL;EAe9B9C,oBAAoB,EAAEpB,SAAS,CAACgE,KAAV,CAAgBxD,SAAS,CAACqD,SAA1B,CAfQ;EAgB9BvC,OAAO,EAAEtB,SAAS,CAACgE,KAAV,CAAgB;IACvBG,QAAQ,EAAEnE,SAAS,CAACoE,IADG;IAEvBC,OAAO,EAAErE,SAAS,CAACsE,OAAV,CAAkBtE,SAAS,CAACgE,KAAV,CAAgB3D,qBAAhB,CAAlB;EAFc,CAAhB,CAhBqB;EAoB9BkB,WAAW,EAAEvB,SAAS,CAACoE,IApBO;EAqB9B5C,uBAAuB,EAAExB,SAAS,CAACoE;AArBL,CAAhC;AAwBA,eAAevD,mBAAf"}
|
|
@@ -16,7 +16,16 @@ declare namespace Certifications {
|
|
|
16
16
|
progress: PropTypes.Requireable<number>;
|
|
17
17
|
imgUrl: PropTypes.Requireable<string>;
|
|
18
18
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
+
locales: PropTypes.Requireable<PropTypes.InferProps<{
|
|
20
|
+
conditionDescriptionProgress: PropTypes.Requireable<string>;
|
|
21
|
+
}>>;
|
|
19
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
|
+
}>>;
|
|
20
29
|
const sorting: PropTypes.Requireable<PropTypes.InferProps<{
|
|
21
30
|
title: PropTypes.Requireable<string>;
|
|
22
31
|
name: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certifications/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/certifications/index.js"],"names":[],"mappings":";AAUA,uEAwEC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _map from "lodash/fp/map";
|
|
2
|
+
|
|
1
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
4
|
|
|
3
5
|
import React, { useState, useCallback } from 'react';
|
|
@@ -11,6 +13,12 @@ import style from './style.css';
|
|
|
11
13
|
|
|
12
14
|
const Certifications = (props, context) => {
|
|
13
15
|
const {
|
|
16
|
+
locales: {
|
|
17
|
+
title,
|
|
18
|
+
subtitle,
|
|
19
|
+
tag,
|
|
20
|
+
count
|
|
21
|
+
},
|
|
14
22
|
certifications,
|
|
15
23
|
sorting
|
|
16
24
|
} = props;
|
|
@@ -32,8 +40,8 @@ const Certifications = (props, context) => {
|
|
|
32
40
|
className: style.container,
|
|
33
41
|
"data-name": "Certifications"
|
|
34
42
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
35
|
-
title:
|
|
36
|
-
subtitle:
|
|
43
|
+
title: title,
|
|
44
|
+
subtitle: subtitle,
|
|
37
45
|
type: "form-group",
|
|
38
46
|
titleSize: "standard-light-weight",
|
|
39
47
|
subtitleSize: "standard-without-margin",
|
|
@@ -47,7 +55,7 @@ const Certifications = (props, context) => {
|
|
|
47
55
|
className: style.sortSectionWrapper
|
|
48
56
|
}, /*#__PURE__*/React.createElement("div", {
|
|
49
57
|
className: style.certificatesCount
|
|
50
|
-
},
|
|
58
|
+
}, count), /*#__PURE__*/React.createElement("div", {
|
|
51
59
|
className: style.sortSection
|
|
52
60
|
}, /*#__PURE__*/React.createElement(InputSwitch, {
|
|
53
61
|
id: 'show-completed-courses-switch',
|
|
@@ -61,15 +69,20 @@ const Certifications = (props, context) => {
|
|
|
61
69
|
className: style.sortWrapper
|
|
62
70
|
}, translate('sort_by'), sortView) : null)), /*#__PURE__*/React.createElement("div", {
|
|
63
71
|
className: style.certificateList
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
72
|
+
}, _map(certification => {
|
|
73
|
+
const {
|
|
74
|
+
label,
|
|
75
|
+
progress
|
|
76
|
+
} = certification;
|
|
77
|
+
if (!showCompleted && progress === 100) return null;
|
|
69
78
|
return /*#__PURE__*/React.createElement("div", {
|
|
70
|
-
key:
|
|
71
|
-
}, /*#__PURE__*/React.createElement(CertificationCard, certification
|
|
72
|
-
|
|
79
|
+
key: label
|
|
80
|
+
}, /*#__PURE__*/React.createElement(CertificationCard, _extends({}, certification, {
|
|
81
|
+
locales: _extends({}, certification.locales, {
|
|
82
|
+
tag
|
|
83
|
+
})
|
|
84
|
+
})));
|
|
85
|
+
}, certifications))));
|
|
73
86
|
};
|
|
74
87
|
|
|
75
88
|
Certifications.contextTypes = {
|
|
@@ -86,8 +99,17 @@ Certifications.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
86
99
|
}),
|
|
87
100
|
progress: PropTypes.number,
|
|
88
101
|
imgUrl: PropTypes.string,
|
|
89
|
-
onClick: PropTypes.func
|
|
102
|
+
onClick: PropTypes.func,
|
|
103
|
+
locales: PropTypes.shape({
|
|
104
|
+
conditionDescriptionProgress: PropTypes.string
|
|
105
|
+
})
|
|
90
106
|
})),
|
|
107
|
+
locales: PropTypes.shape({
|
|
108
|
+
title: PropTypes.string,
|
|
109
|
+
subtitle: PropTypes.string,
|
|
110
|
+
tag: PropTypes.string,
|
|
111
|
+
count: PropTypes.string
|
|
112
|
+
}),
|
|
91
113
|
sorting: PropTypes.shape(Select.propTypes)
|
|
92
114
|
} : {};
|
|
93
115
|
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","certifications","sorting","translate","showCompleted","setShowCompleted","sortView","undefined","handleShowCompletedToggle","backgroudnContainer","container","iconName","iconColor","borderRadius","backgroundColor","sortSectionWrapper","certificatesCount","
|
|
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} locales={{...certification.locales, 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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E7C,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"}
|
|
@@ -302,8 +302,8 @@ declare namespace Dashboard {
|
|
|
302
302
|
'aria-label': PropTypes.Requireable<string>;
|
|
303
303
|
title: PropTypes.Requireable<string>;
|
|
304
304
|
target: PropTypes.Requireable<string>;
|
|
305
|
-
skinHover: PropTypes.Requireable<boolean>;
|
|
306
305
|
hoverColor: PropTypes.Requireable<string>;
|
|
306
|
+
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
307
307
|
download: PropTypes.Requireable<boolean>;
|
|
308
308
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
309
309
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -611,8 +611,8 @@ declare namespace Dashboard {
|
|
|
611
611
|
'aria-label': PropTypes.Requireable<string>;
|
|
612
612
|
title: PropTypes.Requireable<string>;
|
|
613
613
|
target: PropTypes.Requireable<string>;
|
|
614
|
-
skinHover: PropTypes.Requireable<boolean>;
|
|
615
614
|
hoverColor: PropTypes.Requireable<string>;
|
|
615
|
+
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
616
616
|
download: PropTypes.Requireable<boolean>;
|
|
617
617
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
618
618
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -483,8 +483,8 @@ declare namespace SearchPage {
|
|
|
483
483
|
'aria-label': PropTypes.Requireable<string>;
|
|
484
484
|
title: PropTypes.Requireable<string>;
|
|
485
485
|
target: PropTypes.Requireable<string>;
|
|
486
|
-
skinHover: PropTypes.Requireable<boolean>;
|
|
487
486
|
hoverColor: PropTypes.Requireable<string>;
|
|
487
|
+
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
488
488
|
download: PropTypes.Requireable<boolean>;
|
|
489
489
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
490
490
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -320,8 +320,8 @@ declare namespace ExternalCourse {
|
|
|
320
320
|
'aria-label': PropTypes.Requireable<string>;
|
|
321
321
|
title: PropTypes.Requireable<string>;
|
|
322
322
|
target: PropTypes.Requireable<string>;
|
|
323
|
-
skinHover: PropTypes.Requireable<boolean>;
|
|
324
323
|
hoverColor: PropTypes.Requireable<string>;
|
|
324
|
+
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
325
325
|
download: PropTypes.Requireable<boolean>;
|
|
326
326
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
327
327
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -67,12 +67,12 @@ declare namespace SkillDetail {
|
|
|
67
67
|
export const metrics: PropTypes.Requireable<PropTypes.InferProps<{
|
|
68
68
|
score: PropTypes.Requireable<number>;
|
|
69
69
|
questionsToReview: PropTypes.Requireable<number>;
|
|
70
|
+
totalContents: PropTypes.Requireable<number>;
|
|
70
71
|
}>>;
|
|
71
72
|
export const focused: PropTypes.Requireable<boolean>;
|
|
72
73
|
export const availableForReview: PropTypes.Requireable<boolean>;
|
|
73
74
|
const ongoingCoursesAvailable_1: PropTypes.Requireable<boolean>;
|
|
74
75
|
export { ongoingCoursesAvailable_1 as ongoingCoursesAvailable };
|
|
75
|
-
export const totalCourses: PropTypes.Requireable<number>;
|
|
76
76
|
export const skillIncludedCourses: PropTypes.Requireable<PropTypes.InferProps<{
|
|
77
77
|
list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
|
|
78
78
|
customStyle: PropTypes.Requireable<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":"AAeO,8EA+BN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":"AAeO,8EA+BN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYD,oEAmJC"}
|
|
@@ -64,7 +64,6 @@ const SkillDetail = (props, context) => {
|
|
|
64
64
|
focused,
|
|
65
65
|
availableForReview,
|
|
66
66
|
ongoingCoursesAvailable,
|
|
67
|
-
totalCourses,
|
|
68
67
|
skillIncludedCourses,
|
|
69
68
|
filters,
|
|
70
69
|
sorting,
|
|
@@ -75,7 +74,8 @@ const SkillDetail = (props, context) => {
|
|
|
75
74
|
const descriptionRef = useRef(null);
|
|
76
75
|
const {
|
|
77
76
|
score = 0,
|
|
78
|
-
questionsToReview
|
|
77
|
+
questionsToReview,
|
|
78
|
+
totalContents
|
|
79
79
|
} = metrics;
|
|
80
80
|
const {
|
|
81
81
|
translate
|
|
@@ -175,7 +175,7 @@ const SkillDetail = (props, context) => {
|
|
|
175
175
|
content: skillIncludedCourses,
|
|
176
176
|
filters: filters,
|
|
177
177
|
sorting: sorting,
|
|
178
|
-
totalContents:
|
|
178
|
+
totalContents: totalContents
|
|
179
179
|
})));
|
|
180
180
|
};
|
|
181
181
|
|
|
@@ -189,12 +189,12 @@ SkillDetail.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
189
189
|
description: PropTypes.string,
|
|
190
190
|
metrics: PropTypes.shape({
|
|
191
191
|
score: PropTypes.number,
|
|
192
|
-
questionsToReview: PropTypes.number
|
|
192
|
+
questionsToReview: PropTypes.number,
|
|
193
|
+
totalContents: PropTypes.number
|
|
193
194
|
}),
|
|
194
195
|
focused: PropTypes.bool,
|
|
195
196
|
availableForReview: PropTypes.bool,
|
|
196
197
|
ongoingCoursesAvailable: PropTypes.bool,
|
|
197
|
-
totalCourses: PropTypes.number,
|
|
198
198
|
skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),
|
|
199
199
|
filters: PropTypes.shape({
|
|
200
200
|
onChange: PropTypes.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","useRef","useEffect","PropTypes","convert","classnames","Markdown","Provider","Select","SelectOptionPropTypes","ButtonLink","ButtonLinkIcon","Icon","CardsGrid","style","AllCourses","ContinueLearningButton","props","context","ongoingCoursesAvailable","onClick","skin","translate","primarySkinColor","width","borderRadius","backgroundColor","position","faIcon","name","color","size","contextTypes","childContextTypes","propTypes","bool","func","SkillDetail","title","skillRef","description","metrics","focused","availableForReview","totalCourses","skillIncludedCourses","filters","sorting","onBackClick","onReviewClick","onContinueLearningClick","descriptionRef","score","questionsToReview","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","ProgressBar","undefined","progressBarColor","inlineProgressValueStyle","progressBarWrapper","progress","backgroundContainer","container","backButton","ctaContainer","skillFocusBadge","faSize","wrapperSize","showMoreWrapper","ctaWrapper","skillInformation","skillInformationNumber","progressContainer","progressInformationNumber","toFixed","string","isRequired","shape","number","onChange","options","arrayOf"],"sources":["../../../src/template/skill-detail/index.js"],"sourcesContent":["import React, {useCallback, useState, useRef, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {get, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport style from './style.css';\nimport AllCourses from './all-courses';\n\nexport const ContinueLearningButton = (props, context) => {\n const {ongoingCoursesAvailable, onClick} = props;\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n return (\n <div>\n <ButtonLink\n label={\n ongoingCoursesAvailable ? translate('continue_learning') : translate('start_learning')\n }\n type=\"primary\"\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px',\n backgroundColor: primarySkinColor\n }}\n hoverBackgroundColor={convert(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`)}\n hoverColor=\"#FFFFFF\"\n icon={{\n position: 'left',\n faIcon: {\n name: 'play',\n color: '#FFFFFF',\n size: 16\n }\n }}\n onClick={onClick}\n />\n </div>\n );\n};\n\nContinueLearningButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearningButton.propTypes = {\n ongoingCoursesAvailable: PropTypes.bool,\n onClick: PropTypes.func\n};\n\nconst SkillDetail = (props, context) => {\n const {\n title,\n skillRef,\n description,\n metrics = {},\n focused,\n availableForReview,\n ongoingCoursesAvailable,\n totalCourses,\n skillIncludedCourses,\n filters,\n sorting,\n onBackClick,\n onReviewClick,\n onContinueLearningClick\n } = props;\n const descriptionRef = useRef(null);\n const {score = 0, questionsToReview} = metrics;\n const {translate} = context;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n const ProgressBar = useCallback(() => {\n if (score === undefined) return null;\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${score}%`\n };\n\n return (\n <div className={style.progressBarWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressValueStyle}\n role=\"progressbar\"\n />\n </div>\n );\n }, [score]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={skillRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div>\n {focused ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 10,\n wrapperSize: 16\n }}\n />\n {translate('skill_focus')}\n </div>\n ) : null}\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {showMore ? translate('Show less') : translate('Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{\n faSize: 14,\n wrapperSize: 16\n }}\n />\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n\n <div className={style.ctaWrapper}>\n <ButtonLink\n type=\"secondary\"\n onClick={onReviewClick}\n label={translate('review_this_skill')}\n disabled={!availableForReview}\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px'\n }}\n />\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n {questionsToReview > 0 ? (\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{questionsToReview}</span>\n {translate('skill_chart_side_panel_questions_to_review')}\n </div>\n ) : null}\n <div className={style.progressContainer}>\n <ProgressBar />\n <span className={style.progressInformationNumber}>{score.toFixed(1)}%</span>\n </div>\n <AllCourses\n content={skillIncludedCourses}\n filters={filters}\n sorting={sorting}\n totalContents={totalCourses}\n />\n </div>\n </div>\n );\n};\n\nSkillDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nSkillDetail.propTypes = {\n title: PropTypes.string.isRequired,\n skillRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n questionsToReview: PropTypes.number\n }),\n focused: PropTypes.bool,\n availableForReview: PropTypes.bool,\n ongoingCoursesAvailable: PropTypes.bool,\n totalCourses: PropTypes.number,\n skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),\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 onReviewClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default SkillDetail;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,EAAsCC,MAAtC,EAA8CC,SAA9C,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,iBAArB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;A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C,IAlBD;EAmBtBa,aAAa,EAAE9C,SAAS,CAACiC,IAnBH;EAoBtBc,uBAAuB,EAAE/C,SAAS,CAACiC;AApBb,CAAxB;AAuBA,eAAeC,WAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","useRef","useEffect","PropTypes","convert","classnames","Markdown","Provider","Select","SelectOptionPropTypes","ButtonLink","ButtonLinkIcon","Icon","CardsGrid","style","AllCourses","ContinueLearningButton","props","context","ongoingCoursesAvailable","onClick","skin","translate","primarySkinColor","width","borderRadius","backgroundColor","position","faIcon","name","color","size","contextTypes","childContextTypes","propTypes","bool","func","SkillDetail","title","skillRef","description","metrics","focused","availableForReview","skillIncludedCourses","filters","sorting","onBackClick","onReviewClick","onContinueLearningClick","descriptionRef","score","questionsToReview","totalContents","isDescriptionTruncated","setIsDescriptionTruncated","showMore","setShowMore","handleShowMore","current","clientHeight","scrollHeight","Description","truncate","ProgressBar","undefined","progressBarColor","inlineProgressValueStyle","progressBarWrapper","progress","backgroundContainer","container","backButton","ctaContainer","skillFocusBadge","faSize","wrapperSize","showMoreWrapper","ctaWrapper","skillInformation","skillInformationNumber","progressContainer","progressInformationNumber","toFixed","string","isRequired","shape","number","onChange","options","arrayOf"],"sources":["../../../src/template/skill-detail/index.js"],"sourcesContent":["import React, {useCallback, useState, useRef, useEffect} from 'react';\nimport PropTypes from 'prop-types';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {get, isNil} from 'lodash/fp';\nimport Markdown from 'markdown-to-jsx';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport style from './style.css';\nimport AllCourses from './all-courses';\n\nexport const ContinueLearningButton = (props, context) => {\n const {ongoingCoursesAvailable, onClick} = props;\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n return (\n <div>\n <ButtonLink\n label={\n ongoingCoursesAvailable ? translate('continue_learning') : translate('start_learning')\n }\n type=\"primary\"\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px',\n backgroundColor: primarySkinColor\n }}\n hoverBackgroundColor={convert(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`)}\n hoverColor=\"#FFFFFF\"\n icon={{\n position: 'left',\n faIcon: {\n name: 'play',\n color: '#FFFFFF',\n size: 16\n }\n }}\n onClick={onClick}\n />\n </div>\n );\n};\n\nContinueLearningButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearningButton.propTypes = {\n ongoingCoursesAvailable: PropTypes.bool,\n onClick: PropTypes.func\n};\n\nconst SkillDetail = (props, context) => {\n const {\n title,\n skillRef,\n description,\n metrics = {},\n focused,\n availableForReview,\n ongoingCoursesAvailable,\n skillIncludedCourses,\n filters,\n sorting,\n onBackClick,\n onReviewClick,\n onContinueLearningClick\n } = props;\n const descriptionRef = useRef(null);\n const {score = 0, questionsToReview, totalContents} = metrics;\n const {translate} = context;\n\n const [isDescriptionTruncated, setIsDescriptionTruncated] = useState(false);\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n useEffect(() => {\n if (descriptionRef.current) {\n const {clientHeight = 0, scrollHeight = 0} = descriptionRef.current;\n setIsDescriptionTruncated(scrollHeight > clientHeight);\n }\n }, [description]);\n\n const Description = useCallback(() => {\n return (\n <div\n ref={descriptionRef}\n className={classnames(style.description, !showMore && style.truncate)}\n >\n <Markdown>{description}</Markdown>\n </div>\n );\n }, [showMore, description]);\n\n const ProgressBar = useCallback(() => {\n if (score === undefined) return null;\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${score}%`\n };\n\n return (\n <div className={style.progressBarWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressValueStyle}\n role=\"progressbar\"\n />\n </div>\n );\n }, [score]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={skillRef}>\n {!isNil(onBackClick) ? (\n <ButtonLinkIcon\n faIcon=\"arrow-left\"\n data-name=\"back-button\"\n aria-label={translate('back')}\n onClick={onBackClick}\n className={style.backButton}\n tooltipPlacement=\"right\"\n />\n ) : null}\n <div className={style.ctaContainer}>\n <div>\n {focused ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 10,\n wrapperSize: 16\n }}\n />\n {translate('skill_focus')}\n </div>\n ) : null}\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {isDescriptionTruncated ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {showMore ? translate('Show less') : translate('Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{\n faSize: 14,\n wrapperSize: 16\n }}\n />\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n\n <div className={style.ctaWrapper}>\n <ButtonLink\n type=\"secondary\"\n onClick={onReviewClick}\n label={translate('review_this_skill')}\n disabled={!availableForReview}\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px'\n }}\n />\n <ContinueLearningButton\n ongoingCoursesAvailable={ongoingCoursesAvailable}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n {questionsToReview > 0 ? (\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{questionsToReview}</span>\n {translate('skill_chart_side_panel_questions_to_review')}\n </div>\n ) : null}\n <div className={style.progressContainer}>\n <ProgressBar />\n <span className={style.progressInformationNumber}>{score.toFixed(1)}%</span>\n </div>\n <AllCourses\n content={skillIncludedCourses}\n filters={filters}\n sorting={sorting}\n totalContents={totalContents}\n />\n </div>\n </div>\n );\n};\n\nSkillDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nSkillDetail.propTypes = {\n title: PropTypes.string.isRequired,\n skillRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n questionsToReview: PropTypes.number,\n totalContents: PropTypes.number\n }),\n focused: PropTypes.bool,\n availableForReview: PropTypes.bool,\n ongoingCoursesAvailable: PropTypes.bool,\n skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),\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 onReviewClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default SkillDetail;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,EAAsCC,MAAtC,EAA8CC,SAA9C,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,iBAArB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,UAAP,MAAuB,eAAvB;AAEA,OAAO,MAAMC,sBAAsB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACxD,MAAM;IAACC,uBAAD;IAA0BC;EAA1B,IAAqCH,KAA3C;EACA,MAAM;IAACI,IAAD;IAAOC;EAAP,IAAoBJ,OAA1B;;EACA,MAAMK,gBAAgB,GAAG,KAAI,gBAAJ,EAAsBF,IAAtB,CA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,SAAS,CAACiF,MAAV,CAAiBC,UAFL;EAGtB7C,WAAW,EAAErC,SAAS,CAACiF,MAHD;EAItB3C,OAAO,EAAEtC,SAAS,CAACmF,KAAV,CAAgB;IACvBnC,KAAK,EAAEhD,SAAS,CAACoF,MADM;IAEvBnC,iBAAiB,EAAEjD,SAAS,CAACoF,MAFN;IAGvBlC,aAAa,EAAElD,SAAS,CAACoF;EAHF,CAAhB,CAJa;EAStB7C,OAAO,EAAEvC,SAAS,CAACgC,IATG;EAUtBQ,kBAAkB,EAAExC,SAAS,CAACgC,IAVR;EAWtBhB,uBAAuB,EAAEhB,SAAS,CAACgC,IAXb;EAYtBS,oBAAoB,EAAEzC,SAAS,CAACmF,KAAV,CAAgBzE,SAAS,CAACqB,SAA1B,CAZA;EAatBW,OAAO,EAAE1C,SAAS,CAACmF,KAAV,CAAgB;IACvBE,QAAQ,EAAErF,SAAS,CAACiC,IADG;IAEvBqD,OAAO,EAAEtF,SAAS,CAACuF,OAAV,CAAkBvF,SAAS,CAACmF,KAAV,CAAgB7E,qBAAhB,CAAlB;EAFc,CAAhB,CAba;EAiBtBqC,OAAO,EAAE3C,SAAS,CAACmF,KAAV,CAAgB9E,MAAM,CAAC0B,SAAvB,CAjBa;EAkBtBa,WAAW,EAAE5C,SAAS,CAACiC,IAlBD;EAmBtBY,aAAa,EAAE7C,SAAS,CAACiC,IAnBH;EAoBtBa,uBAAuB,EAAE9C,SAAS,CAACiC;AApBb,CAAxB;AAuBA,eAAeC,WAAf"}
|
package/es/variables/colors.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export declare const COLORS: {
|
|
|
5
5
|
readonly white: "#ffffff";
|
|
6
6
|
readonly cm_grey_800: "#171721";
|
|
7
7
|
readonly cm_primary_blue: "#0061FF";
|
|
8
|
+
readonly cm_grey_500: "#515161";
|
|
9
|
+
readonly brand: "#00B0FF";
|
|
8
10
|
};
|
|
9
11
|
export declare type Colors = typeof COLORS;
|
|
10
12
|
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/variables/colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/variables/colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;CAST,CAAC;AAEX,oBAAY,MAAM,GAAG,OAAO,MAAM,CAAC"}
|
package/es/variables/colors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","names":["COLORS","gray","negative","positive","white","cm_grey_800","cm_primary_blue"],"sources":["../../src/variables/colors.ts"],"sourcesContent":["export const COLORS = {\n gray: '#EAEAEB',\n negative: '#ed3436',\n positive: '#35CC7F',\n white: '#ffffff',\n cm_grey_800: '#171721',\n cm_primary_blue: '#0061FF'\n} as const;\n\nexport type Colors = typeof COLORS;\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,IAAI,EAAE,SADc;EAEpBC,QAAQ,EAAE,SAFU;EAGpBC,QAAQ,EAAE,SAHU;EAIpBC,KAAK,EAAE,SAJa;EAKpBC,WAAW,EAAE,SALO;EAMpBC,eAAe,EAAE;
|
|
1
|
+
{"version":3,"file":"colors.js","names":["COLORS","gray","negative","positive","white","cm_grey_800","cm_primary_blue","cm_grey_500","brand"],"sources":["../../src/variables/colors.ts"],"sourcesContent":["export const COLORS = {\n gray: '#EAEAEB',\n negative: '#ed3436',\n positive: '#35CC7F',\n white: '#ffffff',\n cm_grey_800: '#171721',\n cm_primary_blue: '#0061FF',\n cm_grey_500: '#515161',\n brand: '#00B0FF'\n} as const;\n\nexport type Colors = typeof COLORS;\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,IAAI,EAAE,SADc;EAEpBC,QAAQ,EAAE,SAFU;EAGpBC,QAAQ,EAAE,SAHU;EAIpBC,KAAK,EAAE,SAJa;EAKpBC,WAAW,EAAE,SALO;EAMpBC,eAAe,EAAE,SANG;EAOpBC,WAAW,EAAE,SAPO;EAQpBC,KAAK,EAAE;AARa,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAMA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAMA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;AAoD7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;CAoGzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -37,7 +37,6 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
|
|
|
37
37
|
position: ''
|
|
38
38
|
};
|
|
39
39
|
const Icon = type && _buttonIcons.ICONS[type];
|
|
40
|
-
const isApplyHover = hovered && hoverBackgroundColor && hoverColor;
|
|
41
40
|
|
|
42
41
|
if (!Icon && !faIcon) {
|
|
43
42
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -49,8 +48,9 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
|
|
|
49
48
|
|
|
50
49
|
const iconComponent = faIcon ? /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
51
50
|
iconName: faIcon.name,
|
|
52
|
-
iconColor:
|
|
53
|
-
|
|
51
|
+
iconColor: hovered && hoverColor ? hoverColor : faIcon.color,
|
|
52
|
+
// eslint-disable-next-line no-nested-ternary
|
|
53
|
+
backgroundColor: !faIcon?.backgroundColor ? 'transparent' : hovered && hoverBackgroundColor ? hoverBackgroundColor : faIcon.backgroundColor,
|
|
54
54
|
size: {
|
|
55
55
|
faSize: faIcon.size,
|
|
56
56
|
wrapperSize: faIcon.size
|
|
@@ -91,7 +91,9 @@ const ButtonLink = props => {
|
|
|
91
91
|
const [hovered, setHovered] = (0, _react.useState)(false);
|
|
92
92
|
const handleOnClick = (0, _react.useCallback)(event => onClick(event), [onClick]);
|
|
93
93
|
const handleOnKeyDown = (0, _react.useCallback)(event => onKeyDown(event), [onKeyDown]);
|
|
94
|
-
const handleMouseOver = (0, _react.useCallback)(() =>
|
|
94
|
+
const handleMouseOver = (0, _react.useCallback)(() => {
|
|
95
|
+
setHovered(true);
|
|
96
|
+
}, [setHovered]);
|
|
95
97
|
const handleMouseLeave = (0, _react.useCallback)(() => setHovered(false), [setHovered]);
|
|
96
98
|
|
|
97
99
|
const _customStyle = (0, _react.useMemo)(() => {
|
|
@@ -109,8 +111,12 @@ const ButtonLink = props => {
|
|
|
109
111
|
className: styleButton,
|
|
110
112
|
"data-name": dataName,
|
|
111
113
|
"data-testid": dataTestId,
|
|
112
|
-
"aria-label": ariaLabel || label
|
|
113
|
-
|
|
114
|
+
"aria-label": ariaLabel || label,
|
|
115
|
+
hoverColor: hoverColor,
|
|
116
|
+
hoverBackgroundColor: hoverBackgroundColor,
|
|
117
|
+
onMouseEnter: handleMouseOver,
|
|
118
|
+
onMouseLeave: handleMouseLeave
|
|
119
|
+
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor));
|
|
114
120
|
}
|
|
115
121
|
|
|
116
122
|
return /*#__PURE__*/_react.default.createElement("button", _extends({}, useTitle && {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","ICONS","
|
|
1
|
+
{"version":3,"file":"index.js","names":["getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","ICONS","style","buttonContent","label","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","customStyle","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","useTitle","styleButton","classnames","button","primary","secondary","tertiary","text","dangerous","setHovered","useState","handleOnClick","useCallback","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","_customStyle","useMemo","title","propTypes"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback, useState, useMemo} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport FaIcon from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (\n icon?: IconType,\n content?: string | React.ReactNode,\n hovered?: boolean,\n hoverBackgroundColor?: string,\n hoverColor?: string\n) => {\n const {type, faIcon, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon && !faIcon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{content}</span>\n </div>\n );\n }\n\n const iconComponent = faIcon ? (\n <FaIcon\n {...{\n iconName: faIcon.name,\n iconColor: hovered && hoverColor ? hoverColor : faIcon.color,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? 'transparent'\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n }}\n />\n ) : (\n <Icon className={style.icon} theme=\"coorpmanager\" />\n );\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? iconComponent : null}\n {content ? <span className={style.label}>{content}</span> : null}\n {position === 'right' ? iconComponent : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n usage = 'button',\n label,\n content,\n hoverBackgroundColor,\n hoverColor,\n disabled = false,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const styleButton = classnames(\n className,\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const [hovered, setHovered] = useState(false);\n\n const handleOnClick = useCallback(event => onClick(event), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n const handleMouseOver = useCallback(() => {\n setHovered(true);\n }, [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n // eslint-disable-next-line react/button-has-type\n type={usage}\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={_customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n tabIndex={0}\n disabled={disabled}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;A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T;IAUE,SAAS,EAAEhB,WAVb;IAWE,OAAO,EAAEU,aAXX;IAYE,SAAS,EAAEG,eAZb;IAaE,WAAW,EAAEC,eAbf;IAcE,YAAY,EAAEC,gBAdhB;IAeE,QAAQ,EAAE,CAfZ;IAgBE,QAAQ,EAAExB;EAhBZ,IAkBG3B,gBAAgB,CAACC,IAAD,EAAOC,OAAO,IAAIW,KAAlB,EAAyBV,OAAzB,EAAkCC,oBAAlC,EAAwDC,UAAxD,CAlBnB,CADF;AAsBD,CApGD;;AAsGAmB,UAAU,CAAC+B,SAAX,2CAAuBA,cAAvB;eAEe/B,U"}
|
|
@@ -101,8 +101,8 @@ const ButtonLinkIcon = props => {
|
|
|
101
101
|
className: styleButton,
|
|
102
102
|
"data-name": dataName,
|
|
103
103
|
"aria-label": ariaLabel,
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
onMouseEnter: handleMouseOver,
|
|
105
|
+
onMouseLeave: handleMouseLeave
|
|
106
106
|
}), contentView) : /*#__PURE__*/_react.default.createElement("button", _extends({}, ariaLabel ? {
|
|
107
107
|
'data-for': 'button-icon',
|
|
108
108
|
'data-tip': toolTipIsVisible
|