@coorpacademy/components 11.32.43 → 11.32.44-alpha.55
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/cta/index.js +2 -2
- package/es/atom/cta/index.js.map +1 -1
- package/es/atom/icon/index.d.ts +1 -0
- package/es/atom/icon/index.d.ts.map +1 -1
- package/es/atom/icon/index.js +8 -1
- package/es/atom/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 +2 -2
- package/es/atom/link/index.d.ts.map +1 -1
- package/es/atom/link/index.js +38 -46
- 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 +14 -2
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/draggable-list/index.d.ts +12 -0
- package/es/molecule/progress-wrapper/index.d.ts.map +1 -1
- package/es/molecule/progress-wrapper/index.js +21 -11
- package/es/molecule/progress-wrapper/index.js.map +1 -1
- package/es/organism/accordion/coorp-manager/part/index.js +2 -1
- package/es/organism/accordion/coorp-manager/part/index.js.map +1 -1
- package/es/organism/brand-learning-priorities/index.d.ts +12 -0
- package/es/organism/list-item/index.d.ts +16 -1
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +58 -9
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +25 -11
- package/es/organism/list-items/index.d.ts +12 -0
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +2 -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 +14 -2
- package/es/template/app-player/player/index.d.ts +28 -4
- package/es/template/app-player/player/slides/index.d.ts +14 -2
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +18 -6
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +16 -4
- package/es/template/app-player/popin-end/summary.d.ts +2 -2
- package/es/template/app-player/popin-header/index.d.ts +2 -2
- package/es/template/app-review/index.d.ts +14 -2
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +14 -2
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +14 -2
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +38 -2
- 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 +6 -0
- package/es/template/certifications/index.d.ts.map +1 -1
- package/es/template/certifications/index.js +26 -12
- package/es/template/certifications/index.js.map +1 -1
- package/es/template/common/dashboard/index.d.ts +28 -4
- package/es/template/common/search-page/index.d.ts +14 -2
- package/es/template/external-course/index.d.ts +14 -2
- 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/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/cta/index.js +2 -2
- package/lib/atom/cta/index.js.map +1 -1
- package/lib/atom/icon/index.d.ts +1 -0
- package/lib/atom/icon/index.d.ts.map +1 -1
- package/lib/atom/icon/index.js +12 -2
- package/lib/atom/icon/index.js.map +1 -1
- package/lib/atom/input-file-draggable/index.js.map +1 -1
- package/lib/atom/link/index.d.ts +2 -2
- package/lib/atom/link/index.d.ts.map +1 -1
- package/lib/atom/link/index.js +38 -47
- 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 +14 -2
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/draggable-list/index.d.ts +12 -0
- package/lib/molecule/progress-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/progress-wrapper/index.js +25 -12
- package/lib/molecule/progress-wrapper/index.js.map +1 -1
- package/lib/organism/accordion/coorp-manager/part/index.js +3 -1
- package/lib/organism/accordion/coorp-manager/part/index.js.map +1 -1
- package/lib/organism/brand-learning-priorities/index.d.ts +12 -0
- package/lib/organism/list-item/index.d.ts +16 -1
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +56 -5
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +25 -11
- package/lib/organism/list-items/index.d.ts +12 -0
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +2 -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 +14 -2
- package/lib/template/app-player/player/index.d.ts +28 -4
- package/lib/template/app-player/player/slides/index.d.ts +14 -2
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +18 -6
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +16 -4
- package/lib/template/app-player/popin-end/summary.d.ts +2 -2
- package/lib/template/app-player/popin-header/index.d.ts +2 -2
- package/lib/template/app-review/index.d.ts +14 -2
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +14 -2
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +14 -2
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +38 -2
- 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 +6 -0
- package/lib/template/certifications/index.d.ts.map +1 -1
- package/lib/template/certifications/index.js +28 -14
- package/lib/template/certifications/index.js.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +28 -4
- package/lib/template/common/search-page/index.d.ts +14 -2
- package/lib/template/external-course/index.d.ts +14 -2
- 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/locales/bs/global.json +10 -10
- package/locales/cs/global.json +10 -10
- package/locales/de/global.json +10 -10
- package/locales/en/global.json +1 -1
- package/locales/es/global.json +10 -10
- package/locales/et/global.json +10 -10
- package/locales/fi/global.json +10 -10
- package/locales/fr/global.json +10 -10
- package/locales/hr/global.json +10 -10
- package/locales/hu/global.json +10 -10
- package/locales/hy/global.json +10 -10
- package/locales/it/global.json +10 -10
- package/locales/ja/global.json +10 -10
- package/locales/ko/global.json +10 -10
- package/locales/nl/global.json +10 -10
- package/locales/pl/global.json +10 -10
- package/locales/pt/global.json +10 -10
- package/locales/ro/global.json +10 -10
- package/locales/ru/global.json +10 -10
- package/locales/sk/global.json +10 -10
- package/locales/sl/global.json +10 -10
- package/locales/sv/global.json +10 -10
- package/locales/tl/global.json +8 -8
- package/locales/tr/global.json +10 -10
- package/locales/uk/global.json +10 -10
- package/locales/vi/global.json +10 -10
- package/locales/zh/global.json +10 -10
- package/locales/zh_TW/global.json +10 -10
- package/package.json +2 -2
|
@@ -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"}
|
|
@@ -20,7 +20,6 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
|
|
|
20
20
|
position: ''
|
|
21
21
|
};
|
|
22
22
|
const Icon = type && ICONS[type];
|
|
23
|
-
const isApplyHover = hovered && hoverBackgroundColor && hoverColor;
|
|
24
23
|
|
|
25
24
|
if (!Icon && !faIcon) {
|
|
26
25
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -32,8 +31,9 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
|
|
|
32
31
|
|
|
33
32
|
const iconComponent = faIcon ? /*#__PURE__*/React.createElement(FaIcon, {
|
|
34
33
|
iconName: faIcon.name,
|
|
35
|
-
iconColor:
|
|
36
|
-
|
|
34
|
+
iconColor: hovered && hoverColor ? hoverColor : faIcon.color,
|
|
35
|
+
// eslint-disable-next-line no-nested-ternary
|
|
36
|
+
backgroundColor: !faIcon?.backgroundColor ? 'transparent' : hovered && hoverBackgroundColor ? hoverBackgroundColor : faIcon.backgroundColor,
|
|
37
37
|
size: {
|
|
38
38
|
faSize: faIcon.size,
|
|
39
39
|
wrapperSize: faIcon.size
|
|
@@ -74,7 +74,9 @@ const ButtonLink = props => {
|
|
|
74
74
|
const [hovered, setHovered] = useState(false);
|
|
75
75
|
const handleOnClick = useCallback(event => onClick(event), [onClick]);
|
|
76
76
|
const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);
|
|
77
|
-
const handleMouseOver = useCallback(() =>
|
|
77
|
+
const handleMouseOver = useCallback(() => {
|
|
78
|
+
setHovered(true);
|
|
79
|
+
}, [setHovered]);
|
|
78
80
|
const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);
|
|
79
81
|
|
|
80
82
|
const _customStyle = useMemo(() => {
|
|
@@ -92,8 +94,12 @@ const ButtonLink = props => {
|
|
|
92
94
|
className: styleButton,
|
|
93
95
|
"data-name": dataName,
|
|
94
96
|
"data-testid": dataTestId,
|
|
95
|
-
"aria-label": ariaLabel || label
|
|
96
|
-
|
|
97
|
+
"aria-label": ariaLabel || label,
|
|
98
|
+
hoverColor: hoverColor,
|
|
99
|
+
hoverBackgroundColor: hoverBackgroundColor,
|
|
100
|
+
onMouseOver: handleMouseOver,
|
|
101
|
+
onMouseLeave: handleMouseLeave
|
|
102
|
+
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor));
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
return /*#__PURE__*/React.createElement("button", _extends({}, useTitle && {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","useMemo","classnames","Link","FaIcon","ICONS","propTypes","style","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","useMemo","classnames","Link","FaIcon","ICONS","propTypes","style","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","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","button","primary","secondary","tertiary","text","dangerous","setHovered","handleOnClick","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","_customStyle","title"],"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 onMouseOver={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,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,EAAsCC,OAAtC,QAAoD,OAApD;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,OAAOC,MAAP,MAAmB,SAAnB;AACA,SAAQC,KAAR,QAAoB,yBAApB;AACA,OAAOC,SAAP,MAAmD,SAAnD;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,gBAAgB,GAAG,CACvBC,IADuB,EAEvBC,OAFuB,EAGvBC,OAHuB,EAIvBC,oBAJuB,EAKvBC,UALuB,KAMpB;EACH,MAAM;IAACC,IAAD;IAAOC,MAAP;IAAeC;EAAf,IAA2BP,IAAI,IAAI;IAACK,IAAI,EAAE,EAAP;IAAWE,QAAQ,EAAE;EAArB,CAAzC;EACA,MAAMC,IAAI,GAAGH,IAAI,IAAIT,KAAK,CAACS,IAAD,CAA1B;;EAEA,IAAI,CAACG,IAAD,IAAS,CAACF,MAAd,EAAsB;IACpB,oBACE;MAAK,SAAS,EAAER,KAAK,CAACW;IAAtB,gBACE;MAAM,SAAS,EAAEX,KAAK,CAACY;IAAvB,GAA+BT,OAA/B,CADF,CADF;EAKD;;EAED,MAAMU,aAAa,GAAGL,MAAM,gBAC1B,oBAAC,MAAD;IAEIM,QAAQ,EAAEN,MAAM,CAACO,IAFrB;IAGIC,SAAS,EAAEZ,OAAO,IAAIE,UAAX,GAAwBA,UAAxB,GAAqCE,MAAM,CAACS,KAH3D;IAII;IACAC,eAAe,EAAE,CAACV,MAAM,EAAEU,eAAT,GACb,aADa,GAEbd,OAAO,IAAIC,oBAAX,GACAA,oBADA,GAEAG,MAAM,CAACU,eATf;IAUIC,IAAI,EAAE;MACJC,MAAM,EAAEZ,MAAM,CAACW,IADX;MAE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,EAAEC;IAbhB,IAeG9C,gBAAgB,CAACC,IAAD,EAAOC,OAAO,IAAIS,KAAlB,EAAyBR,OAAzB,EAAkCC,oBAAlC,EAAwDC,UAAxD,CAfnB,CADF;EAmBD;;EAED,oBACE,2CACO4B,QAAQ,IAAI;IACfe,KAAK,EAAEpB,SAAS,IAAIjB;EADL,CADnB;IAIE;IACA,IAAI,EAAEa,KALR;IAME,cAAYI,SAAS,IAAIjB,KAN3B;IAOE,aAAWe,QAPb;IAQE,eAAaC,UARf;IASE,KAAK,EAAEoB,YATT;IAUE,SAAS,EAAEb,WAVb;IAWE,OAAO,EAAEQ,aAXX;IAYE,SAAS,EAAEE,eAZb;IAaE,WAAW,EAAEC,eAbf;IAcE,YAAY,EAAEC,gBAdhB;IAeE,QAAQ,EAAE,CAfZ;IAgBE,QAAQ,EAAErB;EAhBZ,IAkBGzB,gBAAgB,CAACC,IAAD,EAAOC,OAAO,IAAIS,KAAlB,EAAyBR,OAAzB,EAAkCC,oBAAlC,EAAwDC,UAAxD,CAlBnB,CADF;AAsBD,CApGD;;AAsGAiB,UAAU,CAACxB,SAAX,2CAAuBA,SAAvB;AAEA,eAAewB,UAAf"}
|
package/es/atom/cta/index.js
CHANGED
|
@@ -32,7 +32,7 @@ const CTA = (props, legacyContext) => {
|
|
|
32
32
|
useButtonTag = false
|
|
33
33
|
} = props;
|
|
34
34
|
const [hovered, setHovered] = useState(false);
|
|
35
|
-
const
|
|
35
|
+
const handleMouseOver = useCallback(() => {
|
|
36
36
|
setHovered(true);
|
|
37
37
|
}, []);
|
|
38
38
|
const handleMouseLeave = useCallback(() => {
|
|
@@ -76,7 +76,7 @@ const CTA = (props, legacyContext) => {
|
|
|
76
76
|
return /*#__PURE__*/React.createElement(Link, {
|
|
77
77
|
href: href,
|
|
78
78
|
onClick: disabled ? _noop : onClick,
|
|
79
|
-
|
|
79
|
+
onMouseOver: handleMouseOver,
|
|
80
80
|
onMouseLeave: handleMouseLeave,
|
|
81
81
|
target: target,
|
|
82
82
|
className: classnames(style.button, disabled ? style.disabled : null, small ? style.smallButton : null, light ? style.lightButton : null, secondary ? style.secondaryButton : null, logout ? style.logoutButton : null, rectangular ? style.rectangularButton : null, fullWidth ? style.fullWidth : null, certificationButton ? style.certificationButton : null, className),
|
package/es/atom/cta/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","convert","classnames","NovaCompositionCoorpacademyLogout","LogoutIcon","Link","Provider","style","propTypes","CTA","props","legacyContext","skin","ariaLabel","submitValue","name","ctaName","href","target","disabled","light","small","secondary","onClick","className","logout","rectangular","fullWidth","certificationButton","useButtonTag","hovered","setHovered","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","convert","classnames","NovaCompositionCoorpacademyLogout","LogoutIcon","Link","Provider","style","propTypes","CTA","props","legacyContext","skin","ariaLabel","submitValue","name","ctaName","href","target","disabled","light","small","secondary","onClick","className","logout","rectangular","fullWidth","certificationButton","useButtonTag","hovered","setHovered","handleMouseOver","handleMouseLeave","getStyle","color","grey","backgroundColor","borderColor","opacity","darkenColor","button","smallButton","lightButton","secondaryButton","logoutButton","rectangularButton","logoutWrapper","logoutIcon","contextTypes","childContextTypes"],"sources":["../../../src/atom/cta/index.tsx"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport {convert} from 'css-color-function';\nimport {get, noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {NovaCompositionCoorpacademyLogout as LogoutIcon} from '@coorpacademy/nova-icons';\nimport Link from '../link';\nimport type {WebContextValues} from '../provider/web-context';\nimport Provider from '../provider';\nimport style from './style.css';\nimport propTypes from './prop-types';\nimport type {CTAProps} from './prop-types';\n\nconst CTA = (props: CTAProps, legacyContext: WebContextValues) => {\n const {skin} = legacyContext;\n const {\n 'aria-label': ariaLabel,\n submitValue = 'submit',\n name: ctaName,\n href,\n target,\n disabled = false,\n light = false,\n small = false,\n secondary = false,\n onClick,\n className,\n logout = false,\n rectangular = false,\n fullWidth = false,\n certificationButton = false,\n useButtonTag = false\n } = props;\n const [hovered, setHovered] = useState(false);\n\n const handleMouseOver = useCallback(() => {\n setHovered(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setHovered(false);\n }, []);\n\n const getStyle = useCallback(() => {\n const color = get('common.primary', skin);\n const grey = get('common.grey', skin);\n\n if (logout) return;\n\n if (disabled) {\n return {\n backgroundColor: grey,\n borderColor: grey,\n opacity: '0.3'\n };\n }\n\n if (hovered) {\n const darkenColor = convert(`color(${color} blackness(+10%))`);\n return {\n backgroundColor: darkenColor,\n borderColor: darkenColor\n };\n }\n\n if (secondary)\n return {\n color,\n borderColor: color\n };\n\n if (light)\n return {\n color\n };\n\n return {\n borderColor: color,\n backgroundColor: color\n };\n }, [disabled, hovered, light, logout, secondary, skin]);\n\n return (\n <Link\n href={href}\n onClick={disabled ? noop : onClick}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n target={target}\n className={classnames(\n style.button,\n disabled ? style.disabled : null,\n small ? style.smallButton : null,\n light ? style.lightButton : null,\n secondary ? style.secondaryButton : null,\n logout ? style.logoutButton : null,\n rectangular ? style.rectangularButton : null,\n fullWidth ? style.fullWidth : null,\n certificationButton ? style.certificationButton : null,\n className\n )}\n data-name={ctaName || 'cta'}\n style={getStyle()}\n aria-label={ariaLabel}\n useButtonTag={useButtonTag}\n >\n {logout ? (\n <div className={style.logoutWrapper} data-name=\"cta-logout-label\">\n <LogoutIcon height={15} width={15} className={style.logoutIcon} />\n {submitValue}\n </div>\n ) : (\n submitValue\n )}\n </Link>\n );\n};\n\nCTA.propTypes = propTypes;\n\nCTA.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default CTA;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,QAA2C,OAA3C;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,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AAO,IAAI,KAlBxB;IAmBE,KAAK,EAAEkB,QAAQ,EAnBjB;IAoBE,cAAYrB,SApBd;IAqBE,YAAY,EAAEgB;EArBhB,GAuBGJ,MAAM,gBACL;IAAK,SAAS,EAAElB,KAAK,CAACwC,aAAtB;IAAqC,aAAU;EAA/C,gBACE,oBAAC,UAAD;IAAY,MAAM,EAAE,EAApB;IAAwB,KAAK,EAAE,EAA/B;IAAmC,SAAS,EAAExC,KAAK,CAACyC;EAApD,EADF,EAEGlC,WAFH,CADK,GAMLA,WA7BJ,CADF;AAkCD,CAvGD;;AAyGAL,GAAG,CAACD,SAAJ,2CAAgBA,SAAhB;AAEAC,GAAG,CAACwC,YAAJ,GAAmB;EACjBrC,IAAI,EAAEN,QAAQ,CAAC4C,iBAAT,CAA2BtC;AADhB,CAAnB;AAIA,eAAeH,GAAf"}
|
package/es/atom/icon/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.js"],"names":[],"mappings":"AAiBA,mDAAoD;AAiB7C,8DAC8D;;AAGrE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.js"],"names":[],"mappings":"AAiBA,mDAAoD;AAiB7C,iEAIN;AAEM,8DAC8D;;AAGrE,uDAoCG"}
|
package/es/atom/icon/index.js
CHANGED
|
@@ -30,12 +30,18 @@ const SIZE_CONFIGS = {
|
|
|
30
30
|
wrapperSize: 48
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
+
export const createGradientBackground = baseColor => {
|
|
34
|
+
const startColor = convert(`color(${baseColor} lightness(91%))`);
|
|
35
|
+
const endColor = convert(`color(${baseColor} lightness(81%))`);
|
|
36
|
+
return `linear-gradient(180deg, ${startColor} 0%, ${endColor} 100%)`;
|
|
37
|
+
};
|
|
33
38
|
export const getForegroundColor = backgroundColor => convert(`color(${backgroundColor} lightness(${ICON_LUMINOSITY}%))`); // set lightness to 32%
|
|
34
39
|
|
|
35
40
|
const Icon = /*#__PURE__*/React.memo(function Icon({
|
|
36
41
|
iconName,
|
|
37
42
|
iconColor,
|
|
38
43
|
backgroundColor,
|
|
44
|
+
gradientBackground,
|
|
39
45
|
borderRadius,
|
|
40
46
|
preset = DEFAULT_PRESET,
|
|
41
47
|
size,
|
|
@@ -45,7 +51,7 @@ const Icon = /*#__PURE__*/React.memo(function Icon({
|
|
|
45
51
|
const effectiveSize = size ? merge(SIZE_CONFIGS[DEFAULT_PRESET], size) : getOr(SIZE_CONFIGS[DEFAULT_PRESET], toLower(preset), SIZE_CONFIGS);
|
|
46
52
|
const wrapperSize = effectiveSize.wrapperSize - ICON_PADDING * 2;
|
|
47
53
|
const iconWrapperStyle = {
|
|
48
|
-
backgroundColor,
|
|
54
|
+
background: gradientBackground ? createGradientBackground(effectiveIconColor) : backgroundColor,
|
|
49
55
|
borderRadius,
|
|
50
56
|
width: wrapperSize,
|
|
51
57
|
height: wrapperSize,
|
|
@@ -64,6 +70,7 @@ Icon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
64
70
|
iconName: PropTypes.string.isRequired,
|
|
65
71
|
iconColor: PropTypes.string,
|
|
66
72
|
backgroundColor: PropTypes.string,
|
|
73
|
+
gradientBackground: PropTypes.bool,
|
|
67
74
|
borderRadius: PropTypes.string,
|
|
68
75
|
preset: PropTypes.oneOf(['s', 'm', 'xl']),
|
|
69
76
|
size: PropTypes.shape({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","number","FontAwesomeIcon","fas","library","toLower","merge","getOr","convert","style","add","DEFAULT_PRESET","ICON_LUMINOSITY","DEFAULT_WRAPPER_SIZE","ICON_PADDING","DEFAULT_ICON_COLOR","SIZE_CONFIGS","s","faSize","wrapperSize","m","xl","getForegroundColor","backgroundColor","Icon","memo","iconName","iconColor","borderRadius","preset","size","customStyle","effectiveIconColor","effectiveSize","iconWrapperStyle","width","height","padding","iconWrapper","propTypes","string","isRequired","oneOf","shape","objectOf","oneOfType"],"sources":["../../../src/atom/icon/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes, {number} from 'prop-types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {fas} from '@fortawesome/pro-solid-svg-icons';\nimport {library} from '@fortawesome/fontawesome-svg-core';\nimport toLower from 'lodash/fp/toLower';\nimport merge from 'lodash/fp/merge';\nimport getOr from 'lodash/fp/getOr';\nimport {convert} from 'css-color-function';\nimport style from './style.css';\n\nlibrary.add(fas);\n\nconst DEFAULT_PRESET = 'm';\nconst ICON_LUMINOSITY = 32;\nconst DEFAULT_WRAPPER_SIZE = 40;\nconst ICON_PADDING = 8;\nexport const DEFAULT_ICON_COLOR = 'hsl(0, 0%, 32%)';\n\nconst SIZE_CONFIGS = {\n s: {\n faSize: 12,\n wrapperSize: 32\n },\n m: {\n faSize: 16,\n wrapperSize: DEFAULT_WRAPPER_SIZE\n },\n xl: {\n faSize: 20,\n wrapperSize: 48\n }\n};\n\nexport const getForegroundColor = backgroundColor =>\n convert(`color(${backgroundColor} lightness(${ICON_LUMINOSITY}%))`);\n// set lightness to 32%\n\nconst Icon = React.memo(function Icon({\n iconName,\n iconColor,\n backgroundColor,\n borderRadius,\n preset = DEFAULT_PRESET,\n size,\n customStyle\n}) {\n const effectiveIconColor =\n iconColor || (backgroundColor ? getForegroundColor(backgroundColor) : DEFAULT_ICON_COLOR);\n\n const effectiveSize = size\n ? merge(SIZE_CONFIGS[DEFAULT_PRESET], size)\n : getOr(SIZE_CONFIGS[DEFAULT_PRESET], toLower(preset), SIZE_CONFIGS);\n\n const wrapperSize = effectiveSize.wrapperSize - ICON_PADDING * 2;\n\n const iconWrapperStyle = {\n backgroundColor,\n borderRadius,\n width: wrapperSize,\n height: wrapperSize,\n padding: ICON_PADDING\n };\n\n return (\n <div className={style.iconWrapper} style={{...iconWrapperStyle, ...customStyle}}>\n <FontAwesomeIcon\n icon={`fa-${iconName}`}\n color={effectiveIconColor}\n fontSize={effectiveSize.faSize}\n />\n </div>\n );\n});\n\nIcon.propTypes = {\n iconName: PropTypes.string.isRequired,\n iconColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n borderRadius: PropTypes.string,\n preset: PropTypes.oneOf(['s', 'm', 'xl']),\n size: PropTypes.shape({\n faSize: number,\n wrapperSize: PropTypes.number\n }),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport default Icon;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,IAAmBC,MAAnB,QAAgC,YAAhC;AACA,SAAQC,eAAR,QAA8B,gCAA9B;AACA,SAAQC,GAAR,QAAkB,kCAAlB;AACA,SAAQC,OAAR,QAAsB,mCAAtB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEAL,OAAO,CAACM,GAAR,CAAYP,GAAZ;AAEA,MAAMQ,cAAc,GAAG,GAAvB;AACA,MAAMC,eAAe,GAAG,EAAxB;AACA,MAAMC,oBAAoB,GAAG,EAA7B;AACA,MAAMC,YAAY,GAAG,CAArB;AACA,OAAO,MAAMC,kBAAkB,GAAG,iBAA3B;AAEP,MAAMC,YAAY,GAAG;EACnBC,CAAC,EAAE;IACDC,MAAM,EAAE,EADP;IAEDC,WAAW,EAAE;EAFZ,CADgB;EAKnBC,CAAC,EAAE;IACDF,MAAM,EAAE,EADP;IAEDC,WAAW,EAAEN;EAFZ,CALgB;EASnBQ,EAAE,EAAE;IACFH,MAAM,EAAE,EADN;IAEFC,WAAW,EAAE;EAFX;AATe,CAArB;AAeA,OAAO,MAAMG,kBAAkB,GAAGC,eAAe,IAC/
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","number","FontAwesomeIcon","fas","library","toLower","merge","getOr","convert","style","add","DEFAULT_PRESET","ICON_LUMINOSITY","DEFAULT_WRAPPER_SIZE","ICON_PADDING","DEFAULT_ICON_COLOR","SIZE_CONFIGS","s","faSize","wrapperSize","m","xl","createGradientBackground","baseColor","startColor","endColor","getForegroundColor","backgroundColor","Icon","memo","iconName","iconColor","gradientBackground","borderRadius","preset","size","customStyle","effectiveIconColor","effectiveSize","iconWrapperStyle","background","width","height","padding","iconWrapper","propTypes","string","isRequired","bool","oneOf","shape","objectOf","oneOfType"],"sources":["../../../src/atom/icon/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes, {number} from 'prop-types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {fas} from '@fortawesome/pro-solid-svg-icons';\nimport {library} from '@fortawesome/fontawesome-svg-core';\nimport toLower from 'lodash/fp/toLower';\nimport merge from 'lodash/fp/merge';\nimport getOr from 'lodash/fp/getOr';\nimport {convert} from 'css-color-function';\nimport style from './style.css';\n\nlibrary.add(fas);\n\nconst DEFAULT_PRESET = 'm';\nconst ICON_LUMINOSITY = 32;\nconst DEFAULT_WRAPPER_SIZE = 40;\nconst ICON_PADDING = 8;\nexport const DEFAULT_ICON_COLOR = 'hsl(0, 0%, 32%)';\n\nconst SIZE_CONFIGS = {\n s: {\n faSize: 12,\n wrapperSize: 32\n },\n m: {\n faSize: 16,\n wrapperSize: DEFAULT_WRAPPER_SIZE\n },\n xl: {\n faSize: 20,\n wrapperSize: 48\n }\n};\n\nexport const createGradientBackground = baseColor => {\n const startColor = convert(`color(${baseColor} lightness(91%))`);\n const endColor = convert(`color(${baseColor} lightness(81%))`);\n return `linear-gradient(180deg, ${startColor} 0%, ${endColor} 100%)`;\n};\n\nexport const getForegroundColor = backgroundColor =>\n convert(`color(${backgroundColor} lightness(${ICON_LUMINOSITY}%))`);\n// set lightness to 32%\n\nconst Icon = React.memo(function Icon({\n iconName,\n iconColor,\n backgroundColor,\n gradientBackground,\n borderRadius,\n preset = DEFAULT_PRESET,\n size,\n customStyle\n}) {\n const effectiveIconColor =\n iconColor || (backgroundColor ? getForegroundColor(backgroundColor) : DEFAULT_ICON_COLOR);\n\n const effectiveSize = size\n ? merge(SIZE_CONFIGS[DEFAULT_PRESET], size)\n : getOr(SIZE_CONFIGS[DEFAULT_PRESET], toLower(preset), SIZE_CONFIGS);\n\n const wrapperSize = effectiveSize.wrapperSize - ICON_PADDING * 2;\n\n const iconWrapperStyle = {\n background: gradientBackground ? createGradientBackground(effectiveIconColor) : backgroundColor,\n borderRadius,\n width: wrapperSize,\n height: wrapperSize,\n padding: ICON_PADDING\n };\n\n return (\n <div className={style.iconWrapper} style={{...iconWrapperStyle, ...customStyle}}>\n <FontAwesomeIcon\n icon={`fa-${iconName}`}\n color={effectiveIconColor}\n fontSize={effectiveSize.faSize}\n />\n </div>\n );\n});\n\nIcon.propTypes = {\n iconName: PropTypes.string.isRequired,\n iconColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n gradientBackground: PropTypes.bool,\n borderRadius: PropTypes.string,\n preset: PropTypes.oneOf(['s', 'm', 'xl']),\n size: PropTypes.shape({\n faSize: number,\n wrapperSize: PropTypes.number\n }),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport default Icon;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,IAAmBC,MAAnB,QAAgC,YAAhC;AACA,SAAQC,eAAR,QAA8B,gCAA9B;AACA,SAAQC,GAAR,QAAkB,kCAAlB;AACA,SAAQC,OAAR,QAAsB,mCAAtB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEAL,OAAO,CAACM,GAAR,CAAYP,GAAZ;AAEA,MAAMQ,c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A7B,CAApB,CAAnB;AAXE,CAAjB;AAcA,eAAe2B,IAAf"}
|
|
@@ -6,7 +6,7 @@ import React, { useCallback } from 'react';
|
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { NovaSolidFilesBasicFileLines as FileLinesIcon, NovaCompositionCoorpacademyEye as EyeIcon } from '@coorpacademy/nova-icons';
|
|
8
8
|
import DragAndDrop from '../drag-and-drop';
|
|
9
|
-
import
|
|
9
|
+
import ButtonLink from '../button-link';
|
|
10
10
|
import { FilesPropType } from '../../util/proptypes';
|
|
11
11
|
import style from './style.css';
|
|
12
12
|
|
|
@@ -83,7 +83,7 @@ const InputFileDraggable = ({
|
|
|
83
83
|
required: required
|
|
84
84
|
}))), labelLink && hrefLink ? /*#__PURE__*/React.createElement("div", {
|
|
85
85
|
className: style.templateLink
|
|
86
|
-
}, labelLink, /*#__PURE__*/React.createElement(
|
|
86
|
+
}, labelLink, /*#__PURE__*/React.createElement(ButtonLink, {
|
|
87
87
|
type: "text",
|
|
88
88
|
customStyle: linkCustomStyle,
|
|
89
89
|
link: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","PropTypes","NovaSolidFilesBasicFileLines","FileLinesIcon","NovaCompositionCoorpacademyEye","EyeIcon","DragAndDrop","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","PropTypes","NovaSolidFilesBasicFileLines","FileLinesIcon","NovaCompositionCoorpacademyEye","EyeIcon","DragAndDrop","ButtonLink","FilesPropType","style","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","e","preventDefault","linkCustomStyle","width","color","onClick_","onDragStart","onDragStop","input","templateLink","href","download","multipleFilesContainer","icon","seeDetailsButton","seeIcon","propTypes","bool","string","func"],"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,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,4BAA4B,IAAIC,aADlC,EAEEC,8BAA8B,IAAIC,OAFpC,QAGO,0BAHP;AAIA,OAAOC,WAAP,MAAwB,kBAAxB;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,SAAQC,aAAR,QAA4B,sBAA5B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,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;EAc1BC,eAd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;EAIEnC,QAAQ,EAAEnB,SAAS,CAACuD,IAJtB;EAKEnC,OAAO,EAAEpB,SAAS,CAACuD,IALrB;EAME9B,UAAU,EAAElB,aANd;EAOEmB,KAAK,EAAE1B,SAAS,CAACsD,MAPnB;EAQE3B,eAAe,EAAE3B,SAAS,CAACsD,MAR7B;EASE1B,gBAAgB,EAAE5B,SAAS,CAACsD,MAT9B;EAUEhC,SAAS,EAAEtB,SAAS,CAACsD,MAVvB;EAWE9B,QAAQ,EAAExB,SAAS,CAACsD;AAXtB;AAcA,eAAe7C,kBAAf"}
|
package/es/atom/link/index.d.ts
CHANGED
|
@@ -9,11 +9,11 @@ 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
|
+
onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
17
|
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
18
|
useButtonTag: PropTypes.Requireable<boolean>;
|
|
19
19
|
style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
@@ -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/es/atom/link/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _noop from "lodash/fp/noop";
|
|
2
|
-
import _getOr from "lodash/fp/getOr";
|
|
3
2
|
import _identity from "lodash/fp/identity";
|
|
4
|
-
const _excluded = ["
|
|
3
|
+
const _excluded = ["hoverColor", "hoverBackgroundColor", "data-name", "useButtonTag", "href", "onClick", "style", "children", "onMouseOver", "onMouseLeave", "download", "disabled"];
|
|
5
4
|
|
|
6
5
|
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); }
|
|
7
6
|
|
|
@@ -9,11 +8,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
9
8
|
|
|
10
9
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
11
10
|
import PropTypes from 'prop-types';
|
|
12
|
-
import Provider
|
|
11
|
+
import Provider from '../provider';
|
|
13
12
|
import pushToHistory from '../../util/navigation';
|
|
14
13
|
|
|
15
14
|
const Link = (props, legacyContext) => {
|
|
16
|
-
const skin = GetSkinFromContext(legacyContext);
|
|
17
15
|
const [hovered, setHovered] = useState(false);
|
|
18
16
|
const {
|
|
19
17
|
history: {
|
|
@@ -22,66 +20,60 @@ const Link = (props, legacyContext) => {
|
|
|
22
20
|
} = legacyContext;
|
|
23
21
|
|
|
24
22
|
const {
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
hoverColor,
|
|
24
|
+
hoverBackgroundColor,
|
|
27
25
|
'data-name': dataName = 'link',
|
|
28
|
-
|
|
29
|
-
useButtonTag = false
|
|
30
|
-
} = props,
|
|
31
|
-
linKElementProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
32
|
-
|
|
33
|
-
const {
|
|
26
|
+
useButtonTag = false,
|
|
34
27
|
href,
|
|
35
28
|
onClick = _noop,
|
|
36
|
-
|
|
37
|
-
style: propsStyle,
|
|
29
|
+
style: customStyle,
|
|
38
30
|
children,
|
|
31
|
+
onMouseOver = _noop,
|
|
39
32
|
onMouseLeave = _noop,
|
|
40
|
-
onMouseEnter = _noop,
|
|
41
33
|
download,
|
|
42
34
|
disabled
|
|
43
|
-
} = props
|
|
44
|
-
|
|
35
|
+
} = props,
|
|
36
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
37
|
+
|
|
38
|
+
const navigate = useMemo(() => pushToHistory(legacyContext)({
|
|
39
|
+
href
|
|
40
|
+
}), [href, legacyContext]);
|
|
41
|
+
const handleMouseOver = useCallback(() => {
|
|
45
42
|
setHovered(true);
|
|
46
|
-
|
|
47
|
-
}, [
|
|
43
|
+
onMouseOver();
|
|
44
|
+
}, [onMouseOver]);
|
|
48
45
|
const handleMouseLeave = useCallback(() => {
|
|
49
46
|
setHovered(false);
|
|
50
47
|
onMouseLeave();
|
|
51
48
|
}, [onMouseLeave]);
|
|
52
|
-
const navigate = useMemo(() => pushToHistory(legacyContext)({
|
|
53
|
-
href
|
|
54
|
-
}), [href, legacyContext]);
|
|
55
49
|
const handleOnClick = useCallback(e => {
|
|
56
50
|
onClick(e);
|
|
57
|
-
|
|
58
|
-
if (!download) {
|
|
59
|
-
navigate(e);
|
|
60
|
-
}
|
|
51
|
+
if (!download) navigate(e);
|
|
61
52
|
}, [download, navigate, onClick]);
|
|
62
53
|
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const _hoverStyle = useMemo(() => skinHover && hovered ? {
|
|
54
|
+
const style = _extends({}, customStyle, hovered && hoverBackgroundColor ? {
|
|
55
|
+
backgroundColor: hoverBackgroundColor
|
|
56
|
+
} : undefined, hovered && hoverColor ? {
|
|
68
57
|
color: hoverColor
|
|
69
|
-
} :
|
|
58
|
+
} : undefined, {
|
|
59
|
+
pointerEvents: disabled || !href ? 'none' : undefined
|
|
60
|
+
});
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
return useButtonTag ? /*#__PURE__*/React.createElement("button", _extends({}, restProps, {
|
|
63
|
+
"data-name": dataName,
|
|
64
|
+
type: "button",
|
|
65
|
+
onClick: disabled ? _noop : handleOnClick,
|
|
66
|
+
style: style,
|
|
67
|
+
onMouseOver: handleMouseOver,
|
|
68
|
+
onMouseLeave: handleMouseLeave
|
|
69
|
+
}), children) : /*#__PURE__*/React.createElement("a", _extends({}, restProps, {
|
|
70
|
+
"data-name": dataName,
|
|
74
71
|
href: disabled || !href ? undefined : createHref(href),
|
|
75
72
|
onClick: disabled ? _noop : handleOnClick,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}), [_hoverStyle, _style, ariaLabel, className, dataName, handleMouseEnter, handleMouseLeave, handleOnClick, href, disabled, createHref, linKElementProps, propsStyle]);
|
|
81
|
-
|
|
82
|
-
return useButtonTag ? /*#__PURE__*/React.createElement("button", _extends({}, _props, {
|
|
83
|
-
type: "button"
|
|
84
|
-
}), children) : /*#__PURE__*/React.createElement("a", _props, children);
|
|
73
|
+
style: style,
|
|
74
|
+
onMouseOver: handleMouseOver,
|
|
75
|
+
onMouseLeave: handleMouseLeave
|
|
76
|
+
}), children);
|
|
85
77
|
};
|
|
86
78
|
|
|
87
79
|
Link.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -92,11 +84,11 @@ Link.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
92
84
|
'aria-label': PropTypes.string,
|
|
93
85
|
title: PropTypes.string,
|
|
94
86
|
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
|
|
95
|
-
skinHover: PropTypes.bool,
|
|
96
87
|
hoverColor: PropTypes.string,
|
|
88
|
+
hoverBackgroundColor: PropTypes.string,
|
|
97
89
|
download: PropTypes.bool,
|
|
98
90
|
onClick: PropTypes.func,
|
|
99
|
-
|
|
91
|
+
onMouseOver: PropTypes.func,
|
|
100
92
|
onMouseLeave: PropTypes.func,
|
|
101
93
|
useButtonTag: PropTypes.bool,
|
|
102
94
|
style: PropTypes.shape({}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","Provider","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","Provider","pushToHistory","Link","props","legacyContext","hovered","setHovered","history","createHref","hoverColor","hoverBackgroundColor","dataName","useButtonTag","href","onClick","style","customStyle","children","onMouseOver","onMouseLeave","download","disabled","restProps","navigate","handleMouseOver","handleMouseLeave","handleOnClick","e","backgroundColor","undefined","color","pointerEvents","propTypes","node","className","string","title","target","oneOf","bool","func","shape","contextTypes","skin","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 onMouseOver = 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 handleMouseOver = useCallback(() => {\n setHovered(true);\n onMouseOver();\n }, [onMouseOver]);\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 pointerEvents: disabled || !href ? 'none' : undefined\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 onMouseOver={handleMouseOver}\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 onMouseOver={handleMouseOver}\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 onMouseOver: 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,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,EAAqCC,QAArC,QAAoD,OAApD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,aAAP,MAA0B,uBAA1B;;AAEA,MAAMC,IAAI,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACrC,MAAM,CAACC,OAAD,EAAUC,UAAV,IAAwBR,QAAQ,CAAC,KAAD,CAAtC;EACA,MAAM;IAACS,OAAO,EAAE;MAACC,UAAU;IAAX,IAA0B;EAApC,IAA0CJ,aAAhD;;EAEA,MAAM;IACJK,UADI;IAEJC,oBAFI;IAGJ,aAAaC,QAAQ,GAAG,MAHpB;IAIJC,YAAY,GAAG,KAJX;IAKJC,IALI;IAMJC,OAAO,QANH;IAOJC,KAAK,EAAEC,WAPH;IAQJC,QARI;IASJC,WAAW,QATP;IAUJC,YA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"}
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as QuestionIcon, NovaCompositionCoorpacademyValidate as ValidateIcon } from '@coorpacademy/nova-icons';
|
|
6
|
-
import
|
|
6
|
+
import ButtonLink from '../../atom/button-link';
|
|
7
7
|
import style from './style.css';
|
|
8
8
|
const ICONS = {
|
|
9
9
|
success: ValidateIcon,
|
|
@@ -41,7 +41,7 @@ const Banner = props => {
|
|
|
41
41
|
className: classnames(style.icon, temporary && style.temporaryIcon)
|
|
42
42
|
}), message), firstCTALabel ? /*#__PURE__*/React.createElement("div", {
|
|
43
43
|
className: classnames(style.button, STYLES[type])
|
|
44
|
-
}, /*#__PURE__*/React.createElement(
|
|
44
|
+
}, /*#__PURE__*/React.createElement(ButtonLink, {
|
|
45
45
|
"data-name": "first-banner-cta",
|
|
46
46
|
"aria-label": firstCTALabel,
|
|
47
47
|
label: firstCTALabel,
|
|
@@ -51,7 +51,7 @@ const Banner = props => {
|
|
|
51
51
|
className: classnames(style.buttonsBar, STYLES[type])
|
|
52
52
|
}) : null, secondCTALabel ? /*#__PURE__*/React.createElement("div", {
|
|
53
53
|
className: classnames(style.button, STYLES[type])
|
|
54
|
-
}, /*#__PURE__*/React.createElement(
|
|
54
|
+
}, /*#__PURE__*/React.createElement(ButtonLink, {
|
|
55
55
|
"data-name": "second-banner-cta",
|
|
56
56
|
onClick: secondCTA,
|
|
57
57
|
"aria-label": secondCTALabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","QuestionIcon","NovaCompositionCoorpacademyValidate","ValidateIcon","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","QuestionIcon","NovaCompositionCoorpacademyValidate","ValidateIcon","ButtonLink","style","ICONS","success","error","warning","STYLES","Banner","props","type","message","firstCTA","firstCTALabel","secondCTALabel","secondCTA","temporary","bannerKey","onEnd","Icon","banner","temporaryBanner","icon","temporaryIcon","button","buttonsBar","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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,mCAAmC,IAAIC,YAFzC,QAGO,0BAHP;AAIA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,KAAK,GAAG;EACZC,OAAO,EAAEJ,YADG;EAEZK,KAAK,EAAEP,YAFK;EAGZQ,OAAO,EAAER;AAHG,CAAd;AAMA,MAAMS,MAAM,GAAG;EACbH,OAAO,EAAEF,KAAK,CAACE,OADF;EAEbC,KAAK,EAAEH,KAAK,CAACG,KAFA;EAGbC,OAAO,EAAEJ,KAAK,CAACI;AAHF,CAAf;;AAMA,MAAME,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IACJC,IADI;IAEJC,OAFI;IAGJC,QAHI;IAIJC,aAJI;IAKJC,cALI;IAMJC,SANI;IAOJC,SAPI;IAQJC,SARI;IASJC;EATI,IAUFT,KAVJ;EAWA,MAAMU,IAAI,GAAGhB,KAAK,CAACO,IAAD,CAAlB;EACA,oBACE;IACE,GAAG,EAAEO,SADP;IAEE,SAAS,EAAErB,UAAU,CAACM,KAAK,CAACkB,MAAP,EAAeb,MAAM,CAACG,IAAD,CAArB,EAA6BM,SAAS,IAAId,KAAK,CAACmB,eAAhD,CAFvB;IAGE,cAAc,EAAEH,KAHlB;IAIE,KAAK,EAAEP;EAJT,gBAME;IAAK,aAAY,GAAED,IAAK,iBAAxB;IAA0C,SAAS,EAAER,KAAK,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d,SAAS,EAAErB,SAAS,CAACoC,IARJ;EASjBb,KAAK,EAAEvB,SAAS,CAACmC;AATA,CAAnB;AAYA,eAAetB,MAAf"}
|
|
@@ -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 tag: PropTypes.Requireable<string>;
|
|
19
|
+
const locales: PropTypes.Requireable<PropTypes.InferProps<{
|
|
20
|
+
conditionDescriptionProgress: 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,0EA4DC"}
|