@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getButtonContent","icon","faIcon","Icon","ICONS","style","buttonContent","getSizeStyle","size","small","responsive","default","ButtonLinkIcon","props","disabled","dataName","ariaLabel","link","onClick","className","tooltipPlacement","toolTipIsVisible","setToolTipIsVisible","useState","timer","useRef","contentView","styleButton","classnames","handleOnClick","useCallback","handleMouseOver","current","clearTimeout","setTimeout","undefined","handleMouseLeave","TooltipContent","tooltipContentWrapper","Button","propTypes","PropTypes","oneOf","string","func","shape","href","download","bool","target"],"sources":["../../../src/atom/button-link-icon/index.js"],"sourcesContent":["import React, {useState, useCallback, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {ICONS} from '../../util/button-icons';\nimport FaIcon from '../icon';\nimport Link from '../link';\nimport ToolTip from '../tooltip';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst getButtonContent = (icon, faIcon) => {\n const Icon = getOr(null, icon, ICONS);\n\n if (!Icon && !faIcon) {\n return <div className={style.buttonContent} />;\n }\n\n return (\n <div className={style.buttonContent}>\n {faIcon ? <FaIcon iconName={faIcon} /> : <Icon className={style.icon} />}\n </div>\n );\n};\n\nconst getSizeStyle = size => {\n switch (size) {\n case 'small':\n return style.small;\n case 'responsive':\n return style.responsive;\n default:\n return style.default;\n }\n};\n\nconst ButtonLinkIcon = props => {\n const {\n size = 'default',\n disabled,\n icon,\n faIcon,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick,\n className,\n tooltipPlacement = 'left'\n } = props;\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n const timer = useRef();\n\n const contentView = getButtonContent(icon, faIcon);\n const styleButton = classnames(\n getSizeStyle(size),\n link && style.link,\n disabled && style.disabled,\n className\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const handleMouseOver = useCallback(() => {\n timer.current && clearTimeout(timer.current);\n timer.current = setTimeout(() => {\n setToolTipIsVisible(true);\n timer.current = undefined;\n }, 300);\n }, [timer, setToolTipIsVisible]);\n\n const handleMouseLeave = useCallback(() => {\n timer.current && clearTimeout(timer.current);\n setToolTipIsVisible(false);\n }, [timer, setToolTipIsVisible]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{ariaLabel}</span>,\n [ariaLabel]\n );\n\n const Button = useCallback(\n () =>\n link ? (\n <Link\n {...link}\n {...(ariaLabel\n ? {\n 'data-for': 'button-icon',\n 'data-tip': toolTipIsVisible\n }\n : {})}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel}\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["getButtonContent","icon","faIcon","Icon","ICONS","style","buttonContent","getSizeStyle","size","small","responsive","default","ButtonLinkIcon","props","disabled","dataName","ariaLabel","link","onClick","className","tooltipPlacement","toolTipIsVisible","setToolTipIsVisible","useState","timer","useRef","contentView","styleButton","classnames","handleOnClick","useCallback","handleMouseOver","current","clearTimeout","setTimeout","undefined","handleMouseLeave","TooltipContent","tooltipContentWrapper","Button","propTypes","PropTypes","oneOf","string","func","shape","href","download","bool","target"],"sources":["../../../src/atom/button-link-icon/index.js"],"sourcesContent":["import React, {useState, useCallback, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {ICONS} from '../../util/button-icons';\nimport FaIcon from '../icon';\nimport Link from '../link';\nimport ToolTip from '../tooltip';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst getButtonContent = (icon, faIcon) => {\n const Icon = getOr(null, icon, ICONS);\n\n if (!Icon && !faIcon) {\n return <div className={style.buttonContent} />;\n }\n\n return (\n <div className={style.buttonContent}>\n {faIcon ? <FaIcon iconName={faIcon} /> : <Icon className={style.icon} />}\n </div>\n );\n};\n\nconst getSizeStyle = size => {\n switch (size) {\n case 'small':\n return style.small;\n case 'responsive':\n return style.responsive;\n default:\n return style.default;\n }\n};\n\nconst ButtonLinkIcon = props => {\n const {\n size = 'default',\n disabled,\n icon,\n faIcon,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick,\n className,\n tooltipPlacement = 'left'\n } = props;\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n const timer = useRef();\n\n const contentView = getButtonContent(icon, faIcon);\n const styleButton = classnames(\n getSizeStyle(size),\n link && style.link,\n disabled && style.disabled,\n className\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const handleMouseOver = useCallback(() => {\n timer.current && clearTimeout(timer.current);\n timer.current = setTimeout(() => {\n setToolTipIsVisible(true);\n timer.current = undefined;\n }, 300);\n }, [timer, setToolTipIsVisible]);\n\n const handleMouseLeave = useCallback(() => {\n timer.current && clearTimeout(timer.current);\n setToolTipIsVisible(false);\n }, [timer, setToolTipIsVisible]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{ariaLabel}</span>,\n [ariaLabel]\n );\n\n const Button = useCallback(\n () =>\n link ? (\n <Link\n {...link}\n {...(ariaLabel\n ? {\n 'data-for': 'button-icon',\n 'data-tip': toolTipIsVisible\n }\n : {})}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {contentView}\n </Link>\n ) : (\n <button\n {...(ariaLabel\n ? {\n 'data-for': 'button-icon',\n 'data-tip': toolTipIsVisible\n }\n : {})}\n type=\"button\"\n aria-label={ariaLabel}\n data-name={dataName}\n data-testid={`button-${dataName}-${className}`}\n className={styleButton}\n onClick={handleOnClick}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n disabled={disabled}\n >\n {contentView}\n </button>\n ),\n [\n link,\n ariaLabel,\n className,\n contentView,\n dataName,\n disabled,\n handleMouseLeave,\n handleMouseOver,\n handleOnClick,\n styleButton,\n toolTipIsVisible\n ]\n );\n\n return (\n <>\n <Button />\n {ariaLabel ? (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={toolTipIsVisible}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={ariaLabel}\n />\n ) : null}\n </>\n );\n};\n\nButtonLinkIcon.propTypes = {\n size: PropTypes.oneOf(['default', 'small', 'responsive']),\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.oneOf(keys(ICONS)),\n faIcon: PropTypes.string,\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool,\n className: PropTypes.string,\n tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom'])\n};\n\nexport default ButtonLinkIcon;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,CAACC,IAAD,EAAOC,MAAP,KAAkB;EACzC,MAAMC,IAAI,GAAG,qBAAM,IAAN,EAAYF,IAAZ,EAAkBG,kBAAlB,CAAb;;EAEA,IAAI,CAACD,IAAD,IAAS,CAACD,MAAd,EAAsB;IACpB,oBAAO;MAAK,SAAS,EAAEG,cAAA,CAAMC;IAAtB,EAAP;EACD;;EAED,oBACE;IAAK,SAAS,EAAED,cAAA,CAAMC;EAAtB,GACGJ,MAAM,gBAAG,6BAAC,aAAD;IAAQ,QAAQ,EAAEA;EAAlB,EAAH,gBAAkC,6BAAC,IAAD;IAAM,SAAS,EAAEG,cAAA,CAAMJ;EAAvB,EAD3C,CADF;AAKD,CAZD;;AAcA,MAAMM,YAAY,GAAGC,IAAI,IAAI;EAC3B,QAAQA,IAAR;IACE,KAAK,OAAL;MACE,OAAOH,cAAA,CAAMI,KAAb;;IACF,KAAK,YAAL;MACE,OAAOJ,cAAA,CAAMK,UAAb;;IACF;MACE,OAAOL,cAAA,CAAMM,OAAb;EANJ;AAQD,CATD;;AAWA,MAAMC,cAAc,GAAGC,KAAK,IAAI;EAC9B,MAAM;IACJL,IAAI,GAAG,SADH;IAEJM,QAFI;IAGJb,IAHI;IAIJC,MAJI;IAKJ,aAAaa,QALT;IAMJ,cAAcC,SANV;IAOJC,IAPI;IAQJC,OARI;IASJC,SATI;IAUJC,gBAAgB,GAAG;EAVf,IAWFP,KAXJ;EAYA,MAAM,CAACQ,gBAAD,EAAmBC,mBAAnB,IAA0C,IAAAC,eAAA,EAAS,KAAT,CAAhD;EACA,MAAMC,KAAK,GAAG,IAAAC,aAAA,GAA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AAEuB,kBAAA,CAAUG,IANM;EAOzB3B,IAAI,EAAEwB,kBAAA,CAAUI,KAAV,CAAgB;IACpBC,IAAI,EAAEL,kBAAA,CAAUE,MADI;IAEpBI,QAAQ,EAAEN,kBAAA,CAAUO,IAFA;IAGpBC,MAAM,EAAER,kBAAA,CAAUC,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB;EAHY,CAAhB,CAPmB;EAYzB5B,QAAQ,EAAE2B,kBAAA,CAAUO,IAZK;EAazB7B,SAAS,EAAEsB,kBAAA,CAAUE,MAbI;EAczBvB,gBAAgB,EAAEqB,kBAAA,CAAUC,KAAV,CAAgB,CAAC,MAAD,EAAS,OAAT,EAAkB,KAAlB,EAAyB,QAAzB,CAAhB;AAdO,CAA3B;eAiBe9B,c"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["InputFileDraggable","title","description","previewLabel","previewContent","uploadLabel","loading","modified","disabled","disableHoverTooltip","onChange","onReset","name","labelLink","labelButtonLink","hrefLink","filesTypes","error","buttonAriaLabel","errorButtonLabel","pdfButtonLabel","pdfButtonAriaLabel","filesNumber","multiple","required","onClick","handleReset","useCallback","e","preventDefault","linkCustomStyle","width","color","onClick_","onDragStart","onDragStop","style","input","templateLink","href","download","multipleFilesContainer","icon","seeDetailsButton","seeIcon","propTypes","DragAndDrop","PropTypes","bool","string","func","FilesPropType"],"sources":["../../../src/atom/input-file-draggable/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {isNil} from 'lodash/fp';\nimport {\n NovaSolidFilesBasicFileLines as FileLinesIcon,\n NovaCompositionCoorpacademyEye as EyeIcon\n} from '@coorpacademy/nova-icons';\nimport DragAndDrop from '../drag-and-drop';\nimport
|
|
1
|
+
{"version":3,"file":"index.js","names":["InputFileDraggable","title","description","previewLabel","previewContent","uploadLabel","loading","modified","disabled","disableHoverTooltip","onChange","onReset","name","labelLink","labelButtonLink","hrefLink","filesTypes","error","buttonAriaLabel","errorButtonLabel","pdfButtonLabel","pdfButtonAriaLabel","filesNumber","multiple","required","onClick","handleReset","useCallback","e","preventDefault","linkCustomStyle","width","color","onClick_","onDragStart","onDragStop","style","input","templateLink","href","download","multipleFilesContainer","icon","seeDetailsButton","seeIcon","propTypes","DragAndDrop","PropTypes","bool","string","func","FilesPropType"],"sources":["../../../src/atom/input-file-draggable/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {isNil} from 'lodash/fp';\nimport {\n NovaSolidFilesBasicFileLines as FileLinesIcon,\n NovaCompositionCoorpacademyEye as EyeIcon\n} from '@coorpacademy/nova-icons';\nimport DragAndDrop from '../drag-and-drop';\nimport ButtonLink from '../button-link';\nimport {FilesPropType} from '../../util/proptypes';\nimport style from './style.css';\n\nconst InputFileDraggable = ({\n title,\n description,\n previewLabel,\n previewContent,\n uploadLabel,\n loading,\n modified,\n disabled = false,\n disableHoverTooltip = false,\n onChange,\n onReset = null,\n name,\n labelLink,\n labelButtonLink,\n hrefLink,\n filesTypes = '',\n error = '',\n buttonAriaLabel,\n errorButtonLabel,\n pdfButtonLabel,\n pdfButtonAriaLabel,\n filesNumber = 0,\n multiple = false,\n required = false,\n onClick\n}) => {\n const handleReset = useCallback(\n e => {\n if (isNil(onReset)) return;\n e.preventDefault();\n return onReset(e);\n },\n [onReset]\n );\n\n const linkCustomStyle = {\n width: '40px',\n color: '#FF541F'\n };\n\n const onClick_ = useCallback(\n e => {\n e.preventDefault();\n return onClick(e);\n },\n [onClick]\n );\n\n return (\n <>\n <DragAndDrop\n title={title}\n description={description}\n previewLabel={previewLabel}\n previewContent={previewContent}\n uploadLabel={uploadLabel}\n loading={loading}\n modified={modified}\n onReset={handleReset}\n error={error}\n disabled={disabled}\n disableHoverTooltip={disableHoverTooltip}\n buttonAriaLabel={buttonAriaLabel}\n errorButtonLabel={errorButtonLabel}\n pdfButtonLabel={pdfButtonLabel}\n pdfButtonAriaLabel={pdfButtonAriaLabel}\n multiple={multiple}\n >\n {(onDragStart, onDragStop) => (\n <input\n {...(disableHoverTooltip ? {title: ''} : {})}\n type=\"file\"\n name={name}\n accept={filesTypes}\n disabled={loading || disabled}\n className={style.input}\n onChange={onChange}\n onDragEnter={onDragStart}\n onDrop={onDragStop}\n onDragLeave={onDragStop}\n multiple={multiple}\n required={required}\n />\n )}\n </DragAndDrop>\n {labelLink && hrefLink ? (\n <div className={style.templateLink}>\n {labelLink}\n <ButtonLink\n type=\"text\"\n customStyle={linkCustomStyle}\n link={{href: hrefLink, download: true}}\n label={labelButtonLink}\n />\n </div>\n ) : null}\n {multiple && filesNumber > 0 ? (\n <div className={style.multipleFilesContainer}>\n <div className={style.filesNumber}>\n <FileLinesIcon className={style.icon} />\n <div>{filesNumber} files</div>\n </div>\n <div className={style.seeDetailsButton} onClick={onClick_}>\n <EyeIcon className={style.seeIcon} />\n <div>See details</div>\n </div>\n </div>\n ) : null}\n </>\n );\n};\n\nInputFileDraggable.propTypes = {\n ...DragAndDrop.propTypes,\n disableHoverTooltip: PropTypes.bool,\n name: PropTypes.string,\n onChange: PropTypes.func,\n onReset: PropTypes.func,\n filesTypes: FilesPropType,\n error: PropTypes.string,\n buttonAriaLabel: PropTypes.string,\n errorButtonLabel: PropTypes.string,\n labelLink: PropTypes.string,\n hrefLink: PropTypes.string\n};\n\nexport default InputFileDraggable;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,kBAAkB,GAAG,CAAC;EAC1BC,KAD0B;EAE1BC,WAF0B;EAG1BC,YAH0B;EAI1BC,cAJ0B;EAK1BC,WAL0B;EAM1BC,OAN0B;EAO1BC,QAP0B;EAQ1BC,QAAQ,GAAG,KARe;EAS1BC,mBAAmB,GAAG,KATI;EAU1BC,QAV0B;EAW1BC,OAAO,GAAG,IAXgB;EAY1BC,IAZ0B;EAa1BC,SAb0B;EAc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CAAUE,MAHlB;EAIEvC,QAAQ,EAAEqC,kBAAA,CAAUG,IAJtB;EAKEvC,OAAO,EAAEoC,kBAAA,CAAUG,IALrB;EAMElC,UAAU,EAAEmC,wBANd;EAOElC,KAAK,EAAE8B,kBAAA,CAAUE,MAPnB;EAQE/B,eAAe,EAAE6B,kBAAA,CAAUE,MAR7B;EASE9B,gBAAgB,EAAE4B,kBAAA,CAAUE,MAT9B;EAUEpC,SAAS,EAAEkC,kBAAA,CAAUE,MAVvB;EAWElC,QAAQ,EAAEgC,kBAAA,CAAUE;AAXtB;eAcejD,kB"}
|
package/lib/atom/link/index.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ declare namespace Link {
|
|
|
9
9
|
'aria-label': PropTypes.Requireable<string>;
|
|
10
10
|
title: PropTypes.Requireable<string>;
|
|
11
11
|
target: PropTypes.Requireable<string>;
|
|
12
|
-
skinHover: PropTypes.Requireable<boolean>;
|
|
13
12
|
hoverColor: PropTypes.Requireable<string>;
|
|
13
|
+
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
14
14
|
download: PropTypes.Requireable<boolean>;
|
|
15
15
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
16
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/link/index.js"],"names":[],"mappings":";AAMA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/link/index.js"],"names":[],"mappings":";AAMA,mEAwEC"}
|
package/lib/atom/link/index.js
CHANGED
|
@@ -5,19 +5,17 @@ exports.default = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _noop2 = _interopRequireDefault(require("lodash/fp/noop"));
|
|
7
7
|
|
|
8
|
-
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
9
|
-
|
|
10
8
|
var _identity2 = _interopRequireDefault(require("lodash/fp/identity"));
|
|
11
9
|
|
|
12
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
11
|
|
|
14
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
13
|
|
|
16
|
-
var _provider =
|
|
14
|
+
var _provider = _interopRequireDefault(require("../provider"));
|
|
17
15
|
|
|
18
16
|
var _navigation = _interopRequireDefault(require("../../util/navigation"));
|
|
19
17
|
|
|
20
|
-
const _excluded = ["
|
|
18
|
+
const _excluded = ["hoverColor", "hoverBackgroundColor", "data-name", "useButtonTag", "href", "onClick", "style", "children", "onMouseEnter", "onMouseLeave", "download", "disabled"];
|
|
21
19
|
|
|
22
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
21
|
|
|
@@ -30,7 +28,6 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
30
28
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
29
|
|
|
32
30
|
const Link = (props, legacyContext) => {
|
|
33
|
-
const skin = (0, _provider.GetSkinFromContext)(legacyContext);
|
|
34
31
|
const [hovered, setHovered] = (0, _react.useState)(false);
|
|
35
32
|
const {
|
|
36
33
|
history: {
|
|
@@ -39,25 +36,24 @@ const Link = (props, legacyContext) => {
|
|
|
39
36
|
} = legacyContext;
|
|
40
37
|
|
|
41
38
|
const {
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
hoverColor,
|
|
40
|
+
hoverBackgroundColor,
|
|
44
41
|
'data-name': dataName = 'link',
|
|
45
|
-
|
|
46
|
-
useButtonTag = false
|
|
47
|
-
} = props,
|
|
48
|
-
linKElementProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
49
|
-
|
|
50
|
-
const {
|
|
42
|
+
useButtonTag = false,
|
|
51
43
|
href,
|
|
52
44
|
onClick = _noop2.default,
|
|
53
|
-
|
|
54
|
-
style: propsStyle,
|
|
45
|
+
style: customStyle,
|
|
55
46
|
children,
|
|
56
|
-
onMouseLeave = _noop2.default,
|
|
57
47
|
onMouseEnter = _noop2.default,
|
|
48
|
+
onMouseLeave = _noop2.default,
|
|
58
49
|
download,
|
|
59
50
|
disabled
|
|
60
|
-
} = props
|
|
51
|
+
} = props,
|
|
52
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
53
|
+
|
|
54
|
+
const navigate = (0, _react.useMemo)(() => (0, _navigation.default)(legacyContext)({
|
|
55
|
+
href
|
|
56
|
+
}), [href, legacyContext]);
|
|
61
57
|
const handleMouseEnter = (0, _react.useCallback)(() => {
|
|
62
58
|
setHovered(true);
|
|
63
59
|
onMouseEnter();
|
|
@@ -66,39 +62,34 @@ const Link = (props, legacyContext) => {
|
|
|
66
62
|
setHovered(false);
|
|
67
63
|
onMouseLeave();
|
|
68
64
|
}, [onMouseLeave]);
|
|
69
|
-
const navigate = (0, _react.useMemo)(() => (0, _navigation.default)(legacyContext)({
|
|
70
|
-
href
|
|
71
|
-
}), [href, legacyContext]);
|
|
72
65
|
const handleOnClick = (0, _react.useCallback)(e => {
|
|
73
66
|
onClick(e);
|
|
74
|
-
|
|
75
|
-
if (!download) {
|
|
76
|
-
navigate(e);
|
|
77
|
-
}
|
|
67
|
+
if (!download) navigate(e);
|
|
78
68
|
}, [download, navigate, onClick]);
|
|
79
69
|
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const _hoverStyle = (0, _react.useMemo)(() => skinHover && hovered ? {
|
|
70
|
+
const style = _extends({}, customStyle, hovered && hoverBackgroundColor ? {
|
|
71
|
+
backgroundColor: hoverBackgroundColor
|
|
72
|
+
} : undefined, hovered && hoverColor ? {
|
|
85
73
|
color: hoverColor
|
|
86
|
-
} :
|
|
74
|
+
} : undefined, href || onClick ? null : {
|
|
75
|
+
pointerEvents: 'none'
|
|
76
|
+
});
|
|
87
77
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
78
|
+
return useButtonTag ? /*#__PURE__*/_react.default.createElement("button", _extends({}, restProps, {
|
|
79
|
+
"data-name": dataName,
|
|
80
|
+
type: "button",
|
|
81
|
+
onClick: disabled ? _noop2.default : handleOnClick,
|
|
82
|
+
style: style,
|
|
83
|
+
onMouseEnter: handleMouseEnter,
|
|
84
|
+
onMouseLeave: handleMouseLeave
|
|
85
|
+
}), children) : /*#__PURE__*/_react.default.createElement("a", _extends({}, restProps, {
|
|
86
|
+
"data-name": dataName,
|
|
91
87
|
href: disabled || !href ? undefined : createHref(href),
|
|
92
88
|
onClick: disabled ? _noop2.default : handleOnClick,
|
|
89
|
+
style: style,
|
|
93
90
|
onMouseEnter: handleMouseEnter,
|
|
94
|
-
onMouseLeave: handleMouseLeave
|
|
95
|
-
|
|
96
|
-
style: _extends({}, propsStyle, _style, _hoverStyle)
|
|
97
|
-
}), [_hoverStyle, _style, ariaLabel, className, dataName, handleMouseEnter, handleMouseLeave, handleOnClick, href, disabled, createHref, linKElementProps, propsStyle]);
|
|
98
|
-
|
|
99
|
-
return useButtonTag ? /*#__PURE__*/_react.default.createElement("button", _extends({}, _props, {
|
|
100
|
-
type: "button"
|
|
101
|
-
}), children) : /*#__PURE__*/_react.default.createElement("a", _props, children);
|
|
91
|
+
onMouseLeave: handleMouseLeave
|
|
92
|
+
}), children);
|
|
102
93
|
};
|
|
103
94
|
|
|
104
95
|
Link.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -109,8 +100,8 @@ Link.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
109
100
|
'aria-label': _propTypes.default.string,
|
|
110
101
|
title: _propTypes.default.string,
|
|
111
102
|
target: _propTypes.default.oneOf(['_self', '_blank', '_parent', '_top']),
|
|
112
|
-
skinHover: _propTypes.default.bool,
|
|
113
103
|
hoverColor: _propTypes.default.string,
|
|
104
|
+
hoverBackgroundColor: _propTypes.default.string,
|
|
114
105
|
download: _propTypes.default.bool,
|
|
115
106
|
onClick: _propTypes.default.func,
|
|
116
107
|
onMouseEnter: _propTypes.default.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Link","props","legacyContext","
|
|
1
|
+
{"version":3,"file":"index.js","names":["Link","props","legacyContext","hovered","setHovered","useState","history","createHref","hoverColor","hoverBackgroundColor","dataName","useButtonTag","href","onClick","style","customStyle","children","onMouseEnter","onMouseLeave","download","disabled","restProps","navigate","useMemo","pushToHistory","handleMouseEnter","useCallback","handleMouseLeave","handleOnClick","e","backgroundColor","undefined","color","pointerEvents","propTypes","PropTypes","node","className","string","title","target","oneOf","bool","func","shape","contextTypes","skin","Provider","childContextTypes"],"sources":["../../../src/atom/link/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {identity, noop} from 'lodash/fp';\nimport Provider from '../provider';\nimport pushToHistory from '../../util/navigation';\n\nconst Link = (props, legacyContext) => {\n const [hovered, setHovered] = useState(false);\n const {history: {createHref = identity} = {}} = legacyContext;\n\n const {\n hoverColor,\n hoverBackgroundColor,\n 'data-name': dataName = 'link',\n useButtonTag = false,\n href,\n onClick = noop,\n style: customStyle,\n children,\n onMouseEnter = noop,\n onMouseLeave = noop,\n download,\n disabled,\n ...restProps\n } = props;\n\n const navigate = useMemo(() => pushToHistory(legacyContext)({href}), [href, legacyContext]);\n\n const handleMouseEnter = useCallback(() => {\n setHovered(true);\n onMouseEnter();\n }, [onMouseEnter]);\n\n const handleMouseLeave = useCallback(() => {\n setHovered(false);\n onMouseLeave();\n }, [onMouseLeave]);\n\n const handleOnClick = useCallback(\n e => {\n onClick(e);\n if (!download) navigate(e);\n },\n [download, navigate, onClick]\n );\n\n const style = {\n ...customStyle,\n ...(hovered && hoverBackgroundColor ? {backgroundColor: hoverBackgroundColor} : undefined),\n ...(hovered && hoverColor ? {color: hoverColor} : undefined),\n ...(href || onClick ? null : {pointerEvents: 'none'})\n };\n\n return useButtonTag ? (\n <button\n {...restProps}\n data-name={dataName}\n type=\"button\"\n onClick={disabled ? noop : handleOnClick}\n style={style}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {children}\n </button>\n ) : (\n <a\n {...restProps}\n data-name={dataName}\n href={disabled || !href ? undefined : createHref(href)}\n onClick={disabled ? noop : handleOnClick}\n style={style}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {children}\n </a>\n );\n};\n\nLink.propTypes = {\n children: PropTypes.node,\n className: PropTypes.string,\n href: PropTypes.string,\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string,\n title: PropTypes.string,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),\n hoverColor: PropTypes.string,\n hoverBackgroundColor: PropTypes.string,\n download: PropTypes.bool,\n onClick: PropTypes.func,\n onMouseEnter: PropTypes.func,\n onMouseLeave: PropTypes.func,\n useButtonTag: PropTypes.bool,\n style: PropTypes.shape({}),\n disabled: PropTypes.bool\n};\n\nLink.contextTypes = {\n skin: Provider.childContextTypes.skin,\n history: Provider.childContextTypes.history\n};\n\nexport default Link;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;;;;;;;AAEA,MAAMA,IAAI,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACrC,MAAM,CAACC,OAAD,EAAUC,UAAV,IAAwB,IAAAC,eAAA,EAAS,KAAT,CAA9B;EACA,MAAM;IAACC,OAAO,EAAE;MAACC,UAAU;IAAX,IAA0B;EAApC,IAA0CL,aAAhD;;EAEA,MAAM;IACJM,UADI;IAEJC,oBAFI;IAGJ,aAAaC,QAAQ,GAAG,MAHpB;IAIJC,YAAY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;AAhBL,CAAjB;AAmBA1C,IAAI,CAAC6C,YAAL,GAAoB;EAClBC,IAAI,EAAEC,iBAAA,CAASC,iBAAT,CAA2BF,IADf;EAElBxC,OAAO,EAAEyC,iBAAA,CAASC,iBAAT,CAA2B1C;AAFlB,CAApB;eAKeN,I"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ICONS","success","ValidateIcon","error","QuestionIcon","warning","STYLES","style","Banner","props","type","message","firstCTA","firstCTALabel","secondCTALabel","secondCTA","temporary","bannerKey","onEnd","Icon","classnames","banner","temporaryBanner","icon","temporaryIcon","button","buttonsBar","propTypes","PropTypes","string","oneOf","isRequired","func","bool"],"sources":["../../../src/molecule/banner/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as QuestionIcon,\n NovaCompositionCoorpacademyValidate as ValidateIcon\n} from '@coorpacademy/nova-icons';\nimport
|
|
1
|
+
{"version":3,"file":"index.js","names":["ICONS","success","ValidateIcon","error","QuestionIcon","warning","STYLES","style","Banner","props","type","message","firstCTA","firstCTALabel","secondCTALabel","secondCTA","temporary","bannerKey","onEnd","Icon","classnames","banner","temporaryBanner","icon","temporaryIcon","button","buttonsBar","propTypes","PropTypes","string","oneOf","isRequired","func","bool"],"sources":["../../../src/molecule/banner/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as QuestionIcon,\n NovaCompositionCoorpacademyValidate as ValidateIcon\n} from '@coorpacademy/nova-icons';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst ICONS = {\n success: ValidateIcon,\n error: QuestionIcon,\n warning: QuestionIcon\n};\n\nconst STYLES = {\n success: style.success,\n error: style.error,\n warning: style.warning\n};\n\nconst Banner = props => {\n const {\n type,\n message,\n firstCTA,\n firstCTALabel,\n secondCTALabel,\n secondCTA,\n temporary,\n bannerKey,\n onEnd\n } = props;\n const Icon = ICONS[type];\n return (\n <div\n key={bannerKey}\n className={classnames(style.banner, STYLES[type], temporary && style.temporaryBanner)}\n onAnimationEnd={onEnd}\n title={message}\n >\n <div data-name={`${type}-banner-message`} className={style.message}>\n <Icon className={classnames(style.icon, temporary && style.temporaryIcon)} />\n {message}\n </div>\n {firstCTALabel ? (\n <div className={classnames(style.button, STYLES[type])}>\n <ButtonLink\n data-name=\"first-banner-cta\"\n aria-label={firstCTALabel}\n label={firstCTALabel}\n onClick={firstCTA}\n type=\"text\"\n />\n </div>\n ) : null}\n {firstCTALabel && secondCTALabel ? (\n <div className={classnames(style.buttonsBar, STYLES[type])} />\n ) : null}\n {secondCTALabel ? (\n <div className={classnames(style.button, STYLES[type])}>\n <ButtonLink\n data-name=\"second-banner-cta\"\n onClick={secondCTA}\n aria-label={secondCTALabel}\n label={secondCTALabel}\n type=\"text\"\n />\n </div>\n ) : null}\n </div>\n );\n};\n\nBanner.propTypes = {\n bannerKey: PropTypes.string,\n type: PropTypes.oneOf(keys(ICONS)),\n message: PropTypes.string.isRequired,\n firstCTA: PropTypes.func,\n firstCTALabel: PropTypes.string,\n secondCTALabel: PropTypes.string,\n secondCTA: PropTypes.func,\n temporary: PropTypes.bool,\n onEnd: PropTypes.func\n};\n\nexport default Banner;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;;;AAEA,MAAMA,KAAK,GAAG;EACZC,OAAO,EAAEC,8CADG;EAEZC,KAAK,EAAEC,0DAFK;EAGZC,OAAO,EAAED;AAHG,CAAd;AAMA,MAAME,MAAM,GAAG;EACbL,OAAO,EAAEM,cAAA,CAAMN,OADF;EAEbE,KAAK,EAAEI,cAAA,CAAMJ,KAFA;EAGbE,OAAO,EAAEE,cAAA,CAAMF;AAHF,CAAf;;AAMA,MAAMG,MAAM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E,6BAAC,mBAAD;IACE,aAAU,mBADZ;IAEE,OAAO,EAAEK,SAFX;IAGE,cAAYD,cAHd;IAIE,KAAK,EAAEA,cAJT;IAKE,IAAI,EAAC;EALP,EADF,CADa,GAUX,IAlCN,CADF;AAsCD,CAnDD;;AAqDAN,MAAM,CAACmB,SAAP,2CAAmB;EACjBV,SAAS,EAAEW,kBAAA,CAAUC,MADJ;EAEjBnB,IAAI,EAAEkB,kBAAA,CAAUE,KAAV,CAAgB,oBAAK9B,KAAL,CAAhB,CAFW;EAGjBW,OAAO,EAAEiB,kBAAA,CAAUC,MAAV,CAAiBE,UAHT;EAIjBnB,QAAQ,EAAEgB,kBAAA,CAAUI,IAJH;EAKjBnB,aAAa,EAAEe,kBAAA,CAAUC,MALR;EAMjBf,cAAc,EAAEc,kBAAA,CAAUC,MANT;EAOjBd,SAAS,EAAEa,kBAAA,CAAUI,IAPJ;EAQjBhB,SAAS,EAAEY,kBAAA,CAAUK,IARJ;EASjBf,KAAK,EAAEU,kBAAA,CAAUI;AATA,CAAnB;eAYexB,M"}
|
|
@@ -15,6 +15,10 @@ declare namespace CertificationCard {
|
|
|
15
15
|
const progress: PropTypes.Requireable<number>;
|
|
16
16
|
const imgUrl: PropTypes.Requireable<string>;
|
|
17
17
|
const onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
+
const locales: PropTypes.Requireable<PropTypes.InferProps<{
|
|
19
|
+
conditionDescriptionProgress: PropTypes.Requireable<string>;
|
|
20
|
+
tag: PropTypes.Requireable<string>;
|
|
21
|
+
}>>;
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/certification-card/index.js"],"names":[],"mappings":";AAQA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/certification-card/index.js"],"names":[],"mappings":";AAQA,0EA2DC"}
|
|
@@ -22,17 +22,17 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
22
22
|
const CertificationCard = (props, context) => {
|
|
23
23
|
const {
|
|
24
24
|
label,
|
|
25
|
-
|
|
25
|
+
locales: {
|
|
26
|
+
conditionDescriptionProgress,
|
|
27
|
+
tag
|
|
28
|
+
},
|
|
29
|
+
goal: {
|
|
30
|
+
title
|
|
31
|
+
},
|
|
26
32
|
progress,
|
|
27
33
|
imgUrl,
|
|
28
34
|
onClick
|
|
29
35
|
} = props;
|
|
30
|
-
const {
|
|
31
|
-
title,
|
|
32
|
-
condition: {
|
|
33
|
-
nbDone
|
|
34
|
-
}
|
|
35
|
-
} = goal;
|
|
36
36
|
const {
|
|
37
37
|
translate
|
|
38
38
|
} = context;
|
|
@@ -76,14 +76,14 @@ const CertificationCard = (props, context) => {
|
|
|
76
76
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
77
77
|
className: _style.default.titleWrapper
|
|
78
78
|
}, /*#__PURE__*/_react.default.createElement(_tag.default, {
|
|
79
|
-
label:
|
|
79
|
+
label: tag,
|
|
80
80
|
size: "S"
|
|
81
81
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
82
82
|
className: _style.default.title,
|
|
83
83
|
"data-name": "certification-title"
|
|
84
84
|
}, title), /*#__PURE__*/_react.default.createElement("div", {
|
|
85
85
|
className: _style.default.moduleCount
|
|
86
|
-
},
|
|
86
|
+
}, conditionDescriptionProgress)), /*#__PURE__*/_react.default.createElement(_progressBar.default, {
|
|
87
87
|
className: _style.default.customProgressBar,
|
|
88
88
|
style: {
|
|
89
89
|
backgroundColor: _colors.COLORS.positive
|
|
@@ -107,7 +107,11 @@ CertificationCard.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
107
107
|
}),
|
|
108
108
|
progress: _propTypes.default.number,
|
|
109
109
|
imgUrl: _propTypes.default.string,
|
|
110
|
-
onClick: _propTypes.default.func
|
|
110
|
+
onClick: _propTypes.default.func,
|
|
111
|
+
locales: _propTypes.default.shape({
|
|
112
|
+
conditionDescriptionProgress: _propTypes.default.string,
|
|
113
|
+
tag: _propTypes.default.string
|
|
114
|
+
})
|
|
111
115
|
} : {};
|
|
112
116
|
var _default = CertificationCard;
|
|
113
117
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CertificationCard","props","context","label","
|
|
1
|
+
{"version":3,"file":"index.js","names":["CertificationCard","props","context","label","locales","conditionDescriptionProgress","tag","goal","title","progress","imgUrl","onClick","translate","isInprogress","progressLabel","progressTagType","progressIconProps","position","iconName","iconColor","backgroundColor","size","faSize","wrapperSize","customStyle","padding","style","container","top","right","imageSection","imageContainer","detailWrapper","titleWrapper","moduleCount","customProgressBar","COLORS","positive","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","shape","condition","nbDone","number","func"],"sources":["../../../src/molecule/certification-card/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {COLORS} from '../../variables/colors';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport ProgressBar from '../progress-bar';\nimport style from './style.css';\n\nconst CertificationCard = (props, context) => {\n const {\n label,\n locales: {conditionDescriptionProgress, tag},\n goal: {title},\n progress,\n imgUrl,\n onClick\n } = props;\n const {translate} = context;\n const isInprogress = progress < 100;\n const progressLabel = isInprogress ? translate('in_progress') : translate('completed');\n const progressTagType = isInprogress ? 'progress' : 'success';\n\n const progressIconProps = {\n position: 'left',\n iconName: isInprogress ? 'clock' : 'circle-check',\n iconColor: isInprogress ? '#B87A00' : '#05944F',\n backgroundColor: isInprogress ? '#FFEECC' : '#D6F5E5',\n size: {\n faSize: 10,\n wrapperSize: 10\n },\n customStyle: {padding: 0}\n };\n\n return (\n <div className={style.container} data-name={`certification-card-${label}`} onClick={onClick}>\n {progress > 0 ? (\n <Tag\n label={progressLabel}\n type={progressTagType}\n customStyle={{position: 'absolute', top: '12px', right: '12px'}}\n icon={progressIconProps}\n />\n ) : null}\n <div className={style.imageSection}>\n <div className={style.imageContainer}>\n <img src={imgUrl} />\n </div>\n </div>\n <div className={style.detailWrapper}>\n <div className={style.titleWrapper}>\n <Tag label={tag} size=\"S\" />\n <div className={style.title} data-name=\"certification-title\">\n {title}\n </div>\n <div className={style.moduleCount}>{conditionDescriptionProgress}</div>\n </div>\n <ProgressBar\n className={style.customProgressBar}\n style={{backgroundColor: COLORS.positive}}\n displayInfo={false}\n value={progress}\n max={100}\n />\n </div>\n </div>\n );\n};\n\nCertificationCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nCertificationCard.propTypes = {\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 tag: PropTypes.string\n })\n};\n\nexport default CertificationCard;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,iBAAiB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC5C,MAAM;IACJC,KADI;IAEJC,OAAO,EAAE;MAACC,4BAAD;MAA+BC;IAA/B,CAFL;IAGJC,IAAI,EAAE;MAACC;IAAD,CAHF;IAIJC,QAJI;IAKJC,MALI;IAMJC;EANI,IAOFV,KAPJ;EAQA,MAAM;IAACW;EAAD,IAAcV,OAApB;EACA,MAAMW,YAAY,GAAGJ,QAAQ,GAAG,GAAhC;EACA,MAAMK,aAAa,GAAGD,YAAY,GAAGD,SAAS,CAAC,aAAD,CAAZ,GAA8BA,SAAS,CAAC,WAAD,CAAzE;EACA,MAAMG,eAAe,GAAGF,YAAY,GAAG,UAAH,GAAgB,SAApD;EAEA,MAAMG,iBAAiB,GAAG;IACxBC,QAAQ,EAAE,MADc;IAExBC,QAAQ,EAAEL,YAAY,GAA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IE,KAAK,EAAE5B,QAJT;IAKE,GAAG,EAAE;EALP,EARF,CAdF,CADF;AAiCD,CA3DD;;AA6DAT,iBAAiB,CAACsC,YAAlB,GAAiC;EAC/B1B,SAAS,EAAE2B,iBAAA,CAASC,iBAAT,CAA2B5B;AADP,CAAjC;AAIAZ,iBAAiB,CAACyC,SAAlB,2CAA8B;EAC5BtC,KAAK,EAAEuC,kBAAA,CAAUC,MADW;EAE5BpC,IAAI,EAAEmC,kBAAA,CAAUE,KAAV,CAAgB;IACpBpC,KAAK,EAAEkC,kBAAA,CAAUC,MADG;IAEpBE,SAAS,EAAEH,kBAAA,CAAUE,KAAV,CAAgB;MACzBE,MAAM,EAAEJ,kBAAA,CAAUK;IADO,CAAhB;EAFS,CAAhB,CAFsB;EAQ5BtC,QAAQ,EAAEiC,kBAAA,CAAUK,MARQ;EAS5BrC,MAAM,EAAEgC,kBAAA,CAAUC,MATU;EAU5BhC,OAAO,EAAE+B,kBAAA,CAAUM,IAVS;EAW5B5C,OAAO,EAAEsC,kBAAA,CAAUE,KAAV,CAAgB;IACvBvC,4BAA4B,EAAEqC,kBAAA,CAAUC,MADjB;IAEvBrC,GAAG,EAAEoC,kBAAA,CAAUC;EAFQ,CAAhB;AAXmB,CAA9B;eAiBe3C,iB"}
|
|
@@ -297,8 +297,8 @@ declare const propTypes: {
|
|
|
297
297
|
'aria-label': PropTypes.Requireable<string>;
|
|
298
298
|
title: PropTypes.Requireable<string>;
|
|
299
299
|
target: PropTypes.Requireable<string>;
|
|
300
|
-
skinHover: PropTypes.Requireable<boolean>;
|
|
301
300
|
hoverColor: PropTypes.Requireable<string>;
|
|
301
|
+
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
302
302
|
download: PropTypes.Requireable<boolean>;
|
|
303
303
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
304
304
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/progress-wrapper/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/progress-wrapper/index.js"],"names":[],"mappings":";AA+GA;;;;;;;8BA8DC"}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
+
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
|
|
7
|
+
|
|
6
8
|
var _map2 = _interopRequireDefault(require("lodash/fp/map"));
|
|
7
9
|
|
|
8
10
|
var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
@@ -11,6 +13,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
13
|
|
|
12
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
15
|
|
|
16
|
+
var _cssColorFunction = require("css-color-function");
|
|
17
|
+
|
|
14
18
|
var _title = _interopRequireDefault(require("../../atom/title"));
|
|
15
19
|
|
|
16
20
|
var _progressBar = _interopRequireDefault(require("../progress-bar"));
|
|
@@ -23,10 +27,14 @@ var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
|
23
27
|
|
|
24
28
|
var _icon = _interopRequireDefault(require("../../atom/icon"));
|
|
25
29
|
|
|
26
|
-
var _provider =
|
|
30
|
+
var _provider = _interopRequireWildcard(require("../../atom/provider"));
|
|
27
31
|
|
|
28
32
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
29
33
|
|
|
34
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
+
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
+
|
|
30
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
39
|
|
|
32
40
|
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); }
|
|
@@ -45,26 +53,30 @@ const DetailSection = ({
|
|
|
45
53
|
const {
|
|
46
54
|
translate
|
|
47
55
|
} = context;
|
|
56
|
+
const skin = (0, _provider.GetSkinFromContext)(context);
|
|
57
|
+
const primarySkinColor = (0, _get2.default)('common.primary', skin);
|
|
48
58
|
const isTypeStars = type === 'stars';
|
|
49
|
-
|
|
50
|
-
const DownloadButton = /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
59
|
+
const downloadButtonProps = {
|
|
51
60
|
label: translate('download'),
|
|
52
61
|
link: {
|
|
53
62
|
target: '_blank',
|
|
54
63
|
href: downloadUrl
|
|
55
64
|
},
|
|
56
|
-
|
|
57
|
-
|
|
65
|
+
'data-name': `download-${type}-button`,
|
|
66
|
+
'aria-label': `download ${type} button`,
|
|
58
67
|
customStyle: {
|
|
59
|
-
backgroundColor:
|
|
60
|
-
color:
|
|
61
|
-
width: 'auto'
|
|
68
|
+
backgroundColor: (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.07))`),
|
|
69
|
+
color: primarySkinColor,
|
|
70
|
+
width: 'auto',
|
|
71
|
+
transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'
|
|
62
72
|
},
|
|
73
|
+
hoverBackgroundColor: primarySkinColor,
|
|
74
|
+
hoverColor: _colors.COLORS.white,
|
|
63
75
|
icon: {
|
|
64
76
|
position: 'left',
|
|
65
77
|
faIcon: {
|
|
66
78
|
name: 'download',
|
|
67
|
-
color:
|
|
79
|
+
color: primarySkinColor,
|
|
68
80
|
size: 14,
|
|
69
81
|
customStyle: {
|
|
70
82
|
padding: 0
|
|
@@ -72,7 +84,7 @@ const DetailSection = ({
|
|
|
72
84
|
}
|
|
73
85
|
},
|
|
74
86
|
disabled: isLocked
|
|
75
|
-
}
|
|
87
|
+
};
|
|
76
88
|
|
|
77
89
|
const LockedTag = /*#__PURE__*/_react.default.createElement(_tag.default, {
|
|
78
90
|
label: translate('locked'),
|
|
@@ -80,7 +92,7 @@ const DetailSection = ({
|
|
|
80
92
|
icon: {
|
|
81
93
|
position: 'left',
|
|
82
94
|
iconName: 'lock',
|
|
83
|
-
iconColor:
|
|
95
|
+
iconColor: _colors.COLORS.cm_grey_500,
|
|
84
96
|
preset: 's',
|
|
85
97
|
customStyle: {
|
|
86
98
|
padding: 0
|
|
@@ -120,7 +132,7 @@ const DetailSection = ({
|
|
|
120
132
|
className: _style.default.detailsTitle
|
|
121
133
|
}, type === 'diploma' ? translate('diploma') : translate('badge')), isLocked ? LockedTag : null), /*#__PURE__*/_react.default.createElement("div", {
|
|
122
134
|
className: _style.default.buttonContainer
|
|
123
|
-
},
|
|
135
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, downloadButtonProps))));
|
|
124
136
|
};
|
|
125
137
|
|
|
126
138
|
const ProgressWrapper = ({
|
|
@@ -186,7 +198,8 @@ const commonDetailSectionPropTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
186
198
|
stars: _propTypes.default.number
|
|
187
199
|
} : {};
|
|
188
200
|
DetailSection.contextTypes = {
|
|
189
|
-
translate: _provider.default.childContextTypes.translate
|
|
201
|
+
translate: _provider.default.childContextTypes.translate,
|
|
202
|
+
skin: _provider.default.childContextTypes.skin
|
|
190
203
|
};
|
|
191
204
|
DetailSection.propTypes = process.env.NODE_ENV !== "production" ? _extends({
|
|
192
205
|
index: _propTypes.default.number,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["uncappedMap","convert","cap","DetailSection","index","type","isLocked","downloadUrl","stars","context","translate","isTypeStars","DownloadButton","target","href","backgroundColor","color","width","position","faIcon","name","size","customStyle","padding","LockedTag","iconName","iconColor","preset","style","detailsInfo","detailsInfoText","detailsTitle","img","buttonContainer","ProgressWrapper","completedModules","mandatoryModules","title","subtitle","progression","sections","mandatoryCompletedModulesLocale","container","titleContainer","statscontainer","stats","statsNumber","customProgressBar","COLORS","positive","statsProgressionMobile","details","section","commonDetailSectionPropTypes","PropTypes","oneOf","string","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, 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-${type}-button`}\n aria-label={`download ${type} button`}\n customStyle={{backgroundColor: '#F1F6FE', color: '#0061FF', width: 'auto'}}\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={translate('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\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\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\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\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, mandatoryModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const mandatoryCompletedModulesLocale = translate('modules_completed_mandatory');\n const isLocked = progression !== 100;\n\n return (\n <div\n className={style.container}\n data-name=\"prgress-wrapper\"\n aria-label=\"progress wrapper section\"\n >\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} data-name=\"progress-stats\">\n {`${\n completedModules > mandatoryModules ? mandatoryModules : completedModules\n } / ${mandatoryModules}`}\n </span>\n {mandatoryCompletedModulesLocale}\n </div>\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber} data-name=\"progress-value\">\n {progression}%\n </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.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n\n {isEmpty(sections) ? null : (\n <div className={style.details}>\n {uncappedMap(\n (section, index) => (\n <DetailSection\n {...section}\n isLocked={isLocked}\n key={`${section.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 completedModules: PropTypes.number,\n mandatoryModules: 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,WAAxB;EAAqCC;AAArC,CAAD,EAA8CC,OAA9C,KAA0D;EAC9E,MAAM;IAACC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EA;EAJT,GAFQ,EASVoC,QATU,CADd,CArCJ,CADF;AAsDD,CA9DD;;AAgEA,MAAMa,4BAAN,2CAAqC;EACnChD,IAAI,EAAEiD,kBAAA,CAAUC,KAAV,CAAgB,CAAC,SAAD,EAAY,OAAZ,EAAqB,OAArB,CAAhB,CAD6B;EAEnChD,WAAW,EAAE+C,kBAAA,CAAUE,MAFY;EAGnChD,KAAK,EAAE8C,kBAAA,CAAUG;AAHkB,CAArC;AAMAtD,aAAa,CAACuD,YAAd,GAA6B;EAC3BhD,SAAS,EAAEiD,iBAAA,CAASC,iBAAT,CAA2BlD;AADX,CAA7B;AAIAP,aAAa,CAAC0D,SAAd;EACEzD,KAAK,EAAEkD,kBAAA,CAAUG,MADnB;EAEEnD,QAAQ,EAAEgD,kBAAA,CAAUQ;AAFtB,GAGKT,4BAHL;AAMAnB,eAAe,CAACwB,YAAhB,GAA+B;EAC7BhD,SAAS,EAAEiD,iBAAA,CAASC,iBAAT,CAA2BlD;AADT,CAA/B;AAIAwB,eAAe,CAAC2B,SAAhB,2CAA4B;EAC1BxB,KAAK,EAAEiB,kBAAA,CAAUE,MADS;EAE1BlB,QAAQ,EAAEgB,kBAAA,CAAUE,MAFM;EAG1BrB,gBAAgB,EAAEmB,kBAAA,CAAUG,MAHF;EAI1BrB,gBAAgB,EAAEkB,kBAAA,CAAUG,MAJF;EAK1BlB,WAAW,EAAEe,kBAAA,CAAUG,MALG;EAM1BjB,QAAQ,EAAEc,kBAAA,CAAUS,OAAV,CAAkBT,kBAAA,CAAUU,KAAV,CAAgBX,4BAAhB,CAAlB;AANgB,CAA5B;eASenB,e"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["uncappedMap","convert","cap","DetailSection","index","type","isLocked","downloadUrl","stars","context","translate","skin","GetSkinFromContext","primarySkinColor","isTypeStars","downloadButtonProps","label","link","target","href","customStyle","backgroundColor","color","width","transition","hoverBackgroundColor","hoverColor","COLORS","white","icon","position","faIcon","name","size","padding","disabled","LockedTag","iconName","iconColor","cm_grey_500","preset","style","detailsInfo","detailsInfoText","detailsTitle","img","buttonContainer","ProgressWrapper","completedModules","mandatoryModules","title","subtitle","progression","sections","mandatoryCompletedModulesLocale","container","titleContainer","statscontainer","stats","statsNumber","customProgressBar","positive","statsProgressionMobile","details","section","commonDetailSectionPropTypes","PropTypes","oneOf","string","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 {convert} from 'css-color-function';\nimport {isEmpty, map, get} 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, {GetSkinFromContext} 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 skin = GetSkinFromContext(context);\n const primarySkinColor = get('common.primary', skin);\n const isTypeStars = type === 'stars';\n\n const downloadButtonProps = {\n label: translate('download'),\n link: {\n target: '_blank',\n href: downloadUrl\n },\n 'data-name': `download-${type}-button`,\n 'aria-label': `download ${type} button`,\n customStyle: {\n backgroundColor: convert(`color(${primarySkinColor} a(0.07))`),\n color: primarySkinColor,\n width: 'auto',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n hoverBackgroundColor: primarySkinColor,\n hoverColor: COLORS.white,\n icon: {\n position: 'left',\n faIcon: {\n name: 'download',\n color: primarySkinColor,\n size: 14,\n customStyle: {padding: 0}\n }\n },\n disabled: isLocked\n };\n\n const LockedTag = (\n <Tag\n label={translate('locked')}\n size=\"S\"\n icon={{\n position: 'left',\n iconName: 'lock',\n iconColor: COLORS.cm_grey_500,\n preset: 's',\n customStyle: {padding: 0}\n }}\n />\n );\n\n return isTypeStars ? (\n <div\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\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\n className={style[`detailsSection${index}`]}\n data-name={type}\n aria-label={`${type} informations`}\n >\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}>\n <ButtonLink {...downloadButtonProps} />\n </div>\n </div>\n </div>\n );\n};\n\nconst ProgressWrapper = (\n {completedModules, mandatoryModules, title, subtitle, progression, sections},\n context\n) => {\n const {translate} = context;\n const mandatoryCompletedModulesLocale = translate('modules_completed_mandatory');\n const isLocked = progression !== 100;\n\n return (\n <div\n className={style.container}\n data-name=\"prgress-wrapper\"\n aria-label=\"progress wrapper section\"\n >\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} data-name=\"progress-stats\">\n {`${\n completedModules > mandatoryModules ? mandatoryModules : completedModules\n } / ${mandatoryModules}`}\n </span>\n {mandatoryCompletedModulesLocale}\n </div>\n </div>\n <div className={style.progression}>\n <span className={style.statsNumber} data-name=\"progress-value\">\n {progression}%\n </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.statsProgressionMobile}>\n <span className={style.statsNumber}>{progression}%</span>\n </div>\n\n {isEmpty(sections) ? null : (\n <div className={style.details}>\n {uncappedMap(\n (section, index) => (\n <DetailSection\n {...section}\n isLocked={isLocked}\n key={`${section.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 skin: Provider.childContextTypes.skin\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 completedModules: PropTypes.number,\n mandatoryModules: PropTypes.number,\n progression: PropTypes.number,\n sections: PropTypes.arrayOf(PropTypes.shape(commonDetailSectionPropTypes))\n};\n\nexport default ProgressWrapper;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;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,WAAxB;EAAqCC;AAArC,CAAD,EAA8CC,OAA9C,KAA0D;EAC9E,MAAM;IAACC;EAAD,IAAcD,OAApB;EACA,MAAME,IAAI,GAAG,IAAAC,4BAAA,EAAmBH,OAAnB,CAAb;EACA,MAAMI,gBAAgB,GAAG,mBAAI,gBAAJ,EAAsBF,IAAtB,CAAzB;EACA,MAAMG,WAA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