@coorpacademy/components 11.35.2-forcedeploy2.15 → 11.35.2
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.js +1 -1
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/style.css +2 -2
- package/es/atom/icon/index.d.ts +17 -35
- package/es/atom/icon/index.d.ts.map +1 -1
- package/es/atom/icon/index.js +15 -32
- package/es/atom/icon/index.js.map +1 -1
- package/es/atom/radio-with-title/index.d.ts +3 -13
- package/es/atom/radio-with-title/index.d.ts.map +1 -1
- package/es/atom/radio-with-title/types.d.ts +2 -13
- package/es/atom/radio-with-title/types.d.ts.map +1 -1
- package/es/atom/status-item/index.native.js +1 -1
- package/es/atom/status-item/index.native.js.map +1 -1
- package/es/atom/tag/index.d.ts +1 -12
- package/es/atom/tag/style.css +0 -1
- package/es/atom/title/index.d.ts +2 -13
- package/es/molecule/banner/style.css +0 -1
- package/es/molecule/base-modal/style.css +1 -0
- package/es/molecule/bulk-progress-bar/index.js +2 -2
- package/es/molecule/bulk-progress-bar/index.js.map +1 -1
- package/es/molecule/certification-card/index.js +1 -1
- package/es/molecule/certification-card/index.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +7 -28
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/cm-popin/types.js +1 -1
- package/es/molecule/cm-popin/types.js.map +1 -1
- package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +0 -2
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/learner-skill-card/index.js +8 -10
- package/es/molecule/learner-skill-card/index.js.map +1 -1
- package/es/molecule/learner-skill-card/style.css +0 -1
- package/es/molecule/learning-priority-modal/style.css +2 -3
- package/es/molecule/progress-wrapper/index.js +1 -1
- package/es/molecule/progress-wrapper/index.js.map +1 -1
- package/es/molecule/skills-chart-side-information-item/index.d.ts +1 -1
- package/es/molecule/skills-chart-side-information-panel/index.d.ts +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +2 -13
- package/es/molecule/title-radio-wrapper/index.d.ts +3 -13
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +2 -13
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/molecule/translation-modal/index.d.ts +1 -0
- package/es/molecule/translation-modal/index.d.ts.map +1 -1
- package/es/molecule/translation-modal/index.js +7 -24
- package/es/molecule/translation-modal/index.js.map +1 -1
- package/es/organism/cards-grid/index.d.ts +10 -48
- package/es/organism/cards-grid/index.d.ts.map +1 -1
- package/es/organism/cards-grid/index.js +2 -3
- package/es/organism/cards-grid/index.js.map +1 -1
- package/es/organism/content-skill-modal/index.d.ts +3 -13
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +2 -12
- package/es/organism/content-skill-modal/types.d.ts.map +1 -1
- package/es/organism/list-item/index.js +5 -5
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +17 -23
- package/es/organism/list-items/index.d.ts +2 -13
- package/es/organism/list-items/style.css +0 -1
- package/es/organism/rewards-form/index.d.ts +2 -13
- package/es/organism/select-opponents/index.d.ts +3 -13
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +2 -13
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/sidebar/index.d.ts +2 -2
- package/es/organism/skill-edition/index.d.ts +52 -1261
- package/es/organism/skill-edition/index.d.ts.map +1 -1
- package/es/organism/skill-edition/index.js +224 -3
- package/es/organism/skill-edition/index.js.map +1 -1
- package/es/organism/skill-edition/types.d.ts +117 -1268
- package/es/organism/skill-edition/types.d.ts.map +1 -1
- package/es/organism/skill-edition/types.js +59 -7
- package/es/organism/skill-edition/types.js.map +1 -1
- package/es/organism/title-and-input/index.d.ts +5 -25
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +4 -24
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +2 -13
- package/es/template/app-player/loading/index.d.ts +6 -27
- package/es/template/app-player/player/index.d.ts +12 -53
- package/es/template/app-player/player/slides/index.d.ts +6 -27
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +6 -26
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +6 -27
- package/es/template/app-review/index.d.ts +7 -27
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +6 -27
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +6 -27
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +1113 -1713
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +12 -0
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/utils.d.ts +1 -1
- package/es/template/common/dashboard/index.d.ts +12 -53
- package/es/template/common/search-page/index.d.ts +6 -27
- package/es/template/external-course/index.d.ts +6 -27
- package/es/template/skill-detail/all-courses.css +2 -3
- package/es/template/skill-detail/all-courses.d.ts +17 -52
- package/es/template/skill-detail/all-courses.d.ts.map +1 -1
- package/es/template/skill-detail/all-courses.js +11 -12
- package/es/template/skill-detail/all-courses.js.map +1 -1
- package/es/template/skill-detail/continue-learning.css +2 -7
- package/es/template/skill-detail/continue-learning.d.ts +12 -25
- package/es/template/skill-detail/continue-learning.d.ts.map +1 -1
- package/es/template/skill-detail/continue-learning.js.map +1 -1
- package/es/template/skill-detail/index.d.ts +71 -89
- package/es/template/skill-detail/index.d.ts.map +1 -1
- package/es/template/skill-detail/index.js +55 -95
- package/es/template/skill-detail/index.js.map +1 -1
- package/es/template/skill-detail/style.css +39 -97
- package/es/variables/colors.css +0 -2
- package/es/variables/colors.d.ts +2 -3
- package/es/variables/colors.d.ts.map +1 -1
- package/es/variables/colors.js +3 -4
- package/es/variables/colors.js.map +1 -1
- package/es/variables/theme.native.js +1 -1
- package/es/variables/theme.native.js.map +1 -1
- package/lib/atom/button-link/index.js +1 -1
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/style.css +2 -2
- package/lib/atom/icon/index.d.ts +17 -35
- package/lib/atom/icon/index.d.ts.map +1 -1
- package/lib/atom/icon/index.js +18 -34
- package/lib/atom/icon/index.js.map +1 -1
- package/lib/atom/radio-with-title/index.d.ts +3 -13
- package/lib/atom/radio-with-title/index.d.ts.map +1 -1
- package/lib/atom/radio-with-title/types.d.ts +2 -13
- package/lib/atom/radio-with-title/types.d.ts.map +1 -1
- package/lib/atom/status-item/index.native.js +1 -1
- package/lib/atom/status-item/index.native.js.map +1 -1
- package/lib/atom/tag/index.d.ts +1 -12
- package/lib/atom/tag/style.css +0 -1
- package/lib/atom/title/index.d.ts +2 -13
- package/lib/molecule/banner/style.css +0 -1
- package/lib/molecule/base-modal/style.css +1 -0
- package/lib/molecule/bulk-progress-bar/index.js +2 -2
- package/lib/molecule/bulk-progress-bar/index.js.map +1 -1
- package/lib/molecule/certification-card/index.js +1 -1
- package/lib/molecule/certification-card/index.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +7 -28
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/cm-popin/types.js +1 -1
- package/lib/molecule/cm-popin/types.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +0 -2
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/learner-skill-card/index.js +8 -10
- package/lib/molecule/learner-skill-card/index.js.map +1 -1
- package/lib/molecule/learner-skill-card/style.css +0 -1
- package/lib/molecule/learning-priority-modal/style.css +2 -3
- package/lib/molecule/progress-wrapper/index.js +1 -1
- package/lib/molecule/progress-wrapper/index.js.map +1 -1
- package/lib/molecule/skills-chart-side-information-item/index.d.ts +1 -1
- package/lib/molecule/skills-chart-side-information-panel/index.d.ts +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +2 -13
- package/lib/molecule/title-radio-wrapper/index.d.ts +3 -13
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +2 -13
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/molecule/translation-modal/index.d.ts +1 -0
- package/lib/molecule/translation-modal/index.d.ts.map +1 -1
- package/lib/molecule/translation-modal/index.js +6 -23
- package/lib/molecule/translation-modal/index.js.map +1 -1
- package/lib/organism/cards-grid/index.d.ts +10 -48
- package/lib/organism/cards-grid/index.d.ts.map +1 -1
- package/lib/organism/cards-grid/index.js +2 -3
- package/lib/organism/cards-grid/index.js.map +1 -1
- package/lib/organism/content-skill-modal/index.d.ts +3 -13
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +2 -12
- package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +5 -5
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +17 -23
- package/lib/organism/list-items/index.d.ts +2 -13
- package/lib/organism/list-items/style.css +0 -1
- package/lib/organism/rewards-form/index.d.ts +2 -13
- package/lib/organism/select-opponents/index.d.ts +3 -13
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +2 -13
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/sidebar/index.d.ts +2 -2
- package/lib/organism/skill-edition/index.d.ts +52 -1261
- package/lib/organism/skill-edition/index.d.ts.map +1 -1
- package/lib/organism/skill-edition/index.js +224 -3
- package/lib/organism/skill-edition/index.js.map +1 -1
- package/lib/organism/skill-edition/types.d.ts +117 -1268
- package/lib/organism/skill-edition/types.d.ts.map +1 -1
- package/lib/organism/skill-edition/types.js +59 -7
- package/lib/organism/skill-edition/types.js.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +5 -25
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +4 -24
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +2 -13
- package/lib/template/app-player/loading/index.d.ts +6 -27
- package/lib/template/app-player/player/index.d.ts +12 -53
- package/lib/template/app-player/player/slides/index.d.ts +6 -27
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +6 -26
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +6 -27
- package/lib/template/app-review/index.d.ts +7 -27
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +6 -27
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +6 -27
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +1113 -1713
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +12 -0
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/utils.d.ts +1 -1
- package/lib/template/common/dashboard/index.d.ts +12 -53
- package/lib/template/common/search-page/index.d.ts +6 -27
- package/lib/template/external-course/index.d.ts +6 -27
- package/lib/template/skill-detail/all-courses.css +2 -3
- package/lib/template/skill-detail/all-courses.d.ts +17 -52
- package/lib/template/skill-detail/all-courses.d.ts.map +1 -1
- package/lib/template/skill-detail/all-courses.js +11 -11
- package/lib/template/skill-detail/all-courses.js.map +1 -1
- package/lib/template/skill-detail/continue-learning.css +2 -7
- package/lib/template/skill-detail/continue-learning.d.ts +12 -25
- package/lib/template/skill-detail/continue-learning.d.ts.map +1 -1
- package/lib/template/skill-detail/continue-learning.js.map +1 -1
- package/lib/template/skill-detail/index.d.ts +71 -89
- package/lib/template/skill-detail/index.d.ts.map +1 -1
- package/lib/template/skill-detail/index.js +55 -95
- package/lib/template/skill-detail/index.js.map +1 -1
- package/lib/template/skill-detail/style.css +39 -97
- package/lib/variables/colors.css +0 -2
- package/lib/variables/colors.d.ts +2 -3
- package/lib/variables/colors.d.ts.map +1 -1
- package/lib/variables/colors.js +3 -4
- package/lib/variables/colors.js.map +1 -1
- package/lib/variables/theme.native.js +1 -1
- package/lib/variables/theme.native.js.map +1 -1
- package/locales/bs/global.json +1 -0
- package/locales/de/global.json +1 -0
- package/locales/es/global.json +1 -0
- package/locales/et/global.json +1 -0
- package/locales/fi/global.json +1 -0
- package/locales/fr/global.json +1 -0
- package/locales/hu/global.json +1 -0
- package/locales/hy/global.json +1 -0
- package/locales/ja/global.json +1 -0
- package/locales/nl/global.json +1 -0
- package/locales/pl/global.json +1 -0
- package/locales/pt/global.json +1 -0
- package/locales/ro/global.json +1 -0
- package/locales/sk/global.json +1 -0
- package/locales/sl/global.json +1 -0
- package/locales/sv/global.json +1 -0
- package/locales/tl/global.json +1 -0
- package/locales/tr/global.json +1 -0
- package/locales/uk/global.json +1 -0
- package/locales/vi/global.json +1 -0
- package/locales/zh/global.json +1 -0
- package/locales/zh_TW/global.json +1 -0
- package/package.json +2 -2
|
@@ -29,7 +29,7 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
|
|
|
29
29
|
iconName: faIcon.name,
|
|
30
30
|
iconColor: hovered && hoverColor ? hoverColor : faIcon.color ?? DEFAULT_ICON_COLOR,
|
|
31
31
|
// eslint-disable-next-line no-nested-ternary
|
|
32
|
-
backgroundColor: !faIcon?.backgroundColor ?
|
|
32
|
+
backgroundColor: !faIcon?.backgroundColor ? 'transparent' : hovered && hoverBackgroundColor ? hoverBackgroundColor : faIcon.backgroundColor,
|
|
33
33
|
size: {
|
|
34
34
|
faSize: faIcon.size,
|
|
35
35
|
wrapperSize: faIcon.size
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","useMemo","classnames","Link","FaIcon","DEFAULT_ICON_COLOR","ICONS","ToolTip","propTypes","style","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","createElement","className","buttonContent","label","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","customStyle","theme","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","tooltipText","tooltipPlacement","link","onClick","_noop","onKeyDown","useTitle","styleButton","button","iconButton","primary","secondary","tertiary","text","dangerous","setHovered","handleOnClick","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","TooltipContent","tooltipContentWrapper","renderToolTip","closeToolTipInformationTextAriaLabel","fontSize","anchorId","toolTipIsVisible","placement","_customStyle","_extends","title","onMouseEnter","onMouseLeave","onMouseOver","tabIndex","process","env","NODE_ENV"],"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, {DEFAULT_ICON_COLOR, IconProps} from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\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 ?? DEFAULT_ICON_COLOR,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? null\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n } as IconProps)}\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 tooltipText,\n tooltipPlacement = 'left',\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 !label && style.iconButton,\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 TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n {...(ariaLabel && !label\n ? {\n 'data-for': 'button-icon',\n 'data-tip': hovered\n }\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 {renderToolTip()}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,QAAQ,EAAEC,OAAO,QAAO,OAAO;AAE3D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,MAAM,IAAGC,kBAAkB,QAAkB,SAAS;AAC7D,SAAQC,KAAK,QAAO,yBAAyB;AA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Bc,YAAY,EAAEb,gBAAiB;IAC/Be,QAAQ,EAAE,CAAE;IACZvC,QAAQ,EAAEA;EAAS,IAElB5B,gBAAgB,CAACC,IAAI,EAAEC,OAAO,IAAIW,KAAK,EAAEV,OAAO,EAAEC,oBAAoB,EAAEC,UAAU,CAAC,EACnFkD,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAED9B,UAAU,CAAC3B,SAAS,GAAAsE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGxE,SAAS;AAEhC,eAAe2B,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","useMemo","classnames","Link","FaIcon","DEFAULT_ICON_COLOR","ICONS","ToolTip","propTypes","style","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","createElement","className","buttonContent","label","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","customStyle","theme","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","tooltipText","tooltipPlacement","link","onClick","_noop","onKeyDown","useTitle","styleButton","button","iconButton","primary","secondary","tertiary","text","dangerous","setHovered","handleOnClick","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","TooltipContent","tooltipContentWrapper","renderToolTip","closeToolTipInformationTextAriaLabel","fontSize","anchorId","toolTipIsVisible","placement","_customStyle","_extends","title","onMouseEnter","onMouseLeave","onMouseOver","tabIndex","process","env","NODE_ENV"],"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, {DEFAULT_ICON_COLOR} from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\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 ?? DEFAULT_ICON_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 tooltipText,\n tooltipPlacement = 'left',\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 !label && style.iconButton,\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 TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n {...(ariaLabel && !label\n ? {\n 'data-for': 'button-icon',\n 'data-tip': hovered\n }\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 {renderToolTip()}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n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B,KAAM;IACZ,cAAYI,SAAS,IAAIlB,KAAM;IAC/B,aAAWgB,QAAS;IACpB,eAAaC,UAAW;IACxB/B,KAAK,EAAE8D,YAAa;IACpBlD,SAAS,EAAE4B,WAAY;IACvBJ,OAAO,EAAEa,aAAc;IACvBX,SAAS,EAAEa,eAAgB;IAC3BgB,WAAW,EAAEf,eAAgB;IAC7Bc,YAAY,EAAEb,gBAAiB;IAC/Be,QAAQ,EAAE,CAAE;IACZvC,QAAQ,EAAEA;EAAS,IAElB5B,gBAAgB,CAACC,IAAI,EAAEC,OAAO,IAAIW,KAAK,EAAEV,OAAO,EAAEC,oBAAoB,EAAEC,UAAU,CAAC,EACnFkD,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAED9B,UAAU,CAAC3B,SAAS,GAAAsE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGxE,SAAS;AAEhC,eAAe2B,UAAU","ignoreList":[]}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
align-items: center;
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
border: none;
|
|
25
|
-
padding:
|
|
25
|
+
padding: 0px 16px;
|
|
26
26
|
/* prevents text selection when dragging
|
|
27
27
|
the mouse over the button */
|
|
28
28
|
user-select: none;
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.buttonContent {
|
|
42
|
-
gap: 8px;
|
|
43
42
|
display: flex;
|
|
44
43
|
justify-content: center;
|
|
45
44
|
align-items: center;
|
|
@@ -56,6 +55,7 @@
|
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
.label {
|
|
58
|
+
margin: 0 8px 0 8px;
|
|
59
59
|
text-wrap: nowrap;
|
|
60
60
|
display: block;
|
|
61
61
|
}
|
package/es/atom/icon/index.d.ts
CHANGED
|
@@ -1,40 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
iconName: string;
|
|
14
|
-
iconColor?: string;
|
|
15
|
-
backgroundColor?: string;
|
|
16
|
-
gradientBackground?: boolean;
|
|
17
|
-
borderRadius?: string;
|
|
18
|
-
preset?: string;
|
|
19
|
-
size?: IconSize;
|
|
20
|
-
customStyle?: CSSProperties;
|
|
21
|
-
}
|
|
22
|
-
export declare function getForegroundColor(backgroundColor: string): string;
|
|
23
|
-
declare const Icon: React.FC<IconProps>;
|
|
24
|
-
export declare const propTypes: {
|
|
25
|
-
iconName: PropTypes.Validator<string>;
|
|
26
|
-
iconColor: PropTypes.Requireable<string>;
|
|
27
|
-
backgroundColor: PropTypes.Requireable<string>;
|
|
28
|
-
gradientBackground: PropTypes.Requireable<boolean>;
|
|
29
|
-
borderRadius: PropTypes.Requireable<string>;
|
|
30
|
-
preset: PropTypes.Requireable<string>;
|
|
31
|
-
size: PropTypes.Requireable<PropTypes.InferProps<{
|
|
32
|
-
faSize: PropTypes.Validator<number>;
|
|
33
|
-
wrapperSize: PropTypes.Validator<number>;
|
|
1
|
+
export const DEFAULT_ICON_COLOR: "hsl(0, 0%, 32%)";
|
|
2
|
+
export function getForegroundColor(backgroundColor: any): any;
|
|
3
|
+
export namespace iconPropTypes {
|
|
4
|
+
const iconName: PropTypes.Validator<string>;
|
|
5
|
+
const iconColor: PropTypes.Requireable<string>;
|
|
6
|
+
const backgroundColor: PropTypes.Requireable<string>;
|
|
7
|
+
const gradientBackground: PropTypes.Requireable<boolean>;
|
|
8
|
+
const borderRadius: PropTypes.Requireable<string>;
|
|
9
|
+
const preset: PropTypes.Requireable<string>;
|
|
10
|
+
const size: PropTypes.Requireable<PropTypes.InferProps<{
|
|
11
|
+
faSize: PropTypes.Requireable<number>;
|
|
12
|
+
wrapperSize: PropTypes.Requireable<number>;
|
|
34
13
|
}>>;
|
|
35
|
-
customStyle: PropTypes.Requireable<{
|
|
14
|
+
const customStyle: PropTypes.Requireable<{
|
|
36
15
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
37
16
|
}>;
|
|
38
|
-
}
|
|
17
|
+
}
|
|
39
18
|
export default Icon;
|
|
19
|
+
import PropTypes from "prop-types";
|
|
20
|
+
declare const Icon: React.NamedExoticComponent<object>;
|
|
21
|
+
import React from "react";
|
|
40
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.js"],"names":[],"mappings":"AAkBA,mDAAoD;AAiB7C,8DAC8D;;;;;;;;;;;;;;;;;;AAGrE,uDAsCG"}
|
package/es/atom/icon/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
2
|
+
import PropTypes, { number } from 'prop-types';
|
|
3
3
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
4
|
import { fas } from '@fortawesome/pro-solid-svg-icons';
|
|
5
5
|
import { library } from '@fortawesome/fontawesome-svg-core';
|
|
@@ -10,14 +10,11 @@ import { convert } from 'css-color-function';
|
|
|
10
10
|
import { createGradientBackground } from '../../util/get-background-gradient-color';
|
|
11
11
|
import style from './style.css';
|
|
12
12
|
library.add(fas);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const DEFAULT_PRESET = 'm';
|
|
14
|
+
const ICON_LUMINOSITY = 32;
|
|
15
|
+
const DEFAULT_WRAPPER_SIZE = 40;
|
|
16
|
+
const ICON_PADDING = 8;
|
|
17
17
|
export const DEFAULT_ICON_COLOR = 'hsl(0, 0%, 32%)';
|
|
18
|
-
export function getForegroundColor(backgroundColor) {
|
|
19
|
-
return convert(`color(${backgroundColor} lightness(${ICON_LUMINOSITY}%))`);
|
|
20
|
-
}
|
|
21
18
|
const SIZE_CONFIGS = {
|
|
22
19
|
s: {
|
|
23
20
|
faSize: 12,
|
|
@@ -32,7 +29,10 @@ const SIZE_CONFIGS = {
|
|
|
32
29
|
wrapperSize: 48
|
|
33
30
|
}
|
|
34
31
|
};
|
|
35
|
-
const
|
|
32
|
+
export const getForegroundColor = backgroundColor => convert(`color(${backgroundColor} lightness(${ICON_LUMINOSITY}%))`);
|
|
33
|
+
// set lightness to 32%
|
|
34
|
+
|
|
35
|
+
const Icon = /*#__PURE__*/React.memo(function Icon({
|
|
36
36
|
iconName,
|
|
37
37
|
iconColor,
|
|
38
38
|
backgroundColor,
|
|
@@ -41,18 +41,9 @@ const Icon = ({
|
|
|
41
41
|
preset = DEFAULT_PRESET,
|
|
42
42
|
size,
|
|
43
43
|
customStyle
|
|
44
|
-
})
|
|
44
|
+
}) {
|
|
45
45
|
const effectiveIconColor = iconColor || (backgroundColor ? getForegroundColor(backgroundColor) : DEFAULT_ICON_COLOR);
|
|
46
46
|
const effectiveSize = size ? merge(SIZE_CONFIGS[DEFAULT_PRESET], size) : getOr(SIZE_CONFIGS[DEFAULT_PRESET], toLower(preset), SIZE_CONFIGS);
|
|
47
|
-
const hasBackground = backgroundColor || gradientBackground;
|
|
48
|
-
if (!hasBackground) {
|
|
49
|
-
return /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
50
|
-
icon: `fa-${iconName}`,
|
|
51
|
-
color: effectiveIconColor,
|
|
52
|
-
fontSize: effectiveSize.faSize,
|
|
53
|
-
style: customStyle
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
47
|
const wrapperSize = effectiveSize.wrapperSize - ICON_PADDING * 2;
|
|
57
48
|
const iconWrapperStyle = {
|
|
58
49
|
background: gradientBackground ? createGradientBackground(effectiveIconColor, '81%', '91%') : backgroundColor,
|
|
@@ -72,8 +63,8 @@ const Icon = ({
|
|
|
72
63
|
color: effectiveIconColor,
|
|
73
64
|
fontSize: effectiveSize.faSize
|
|
74
65
|
}));
|
|
75
|
-
};
|
|
76
|
-
export const
|
|
66
|
+
});
|
|
67
|
+
export const iconPropTypes = {
|
|
77
68
|
iconName: PropTypes.string.isRequired,
|
|
78
69
|
iconColor: PropTypes.string,
|
|
79
70
|
backgroundColor: PropTypes.string,
|
|
@@ -81,19 +72,11 @@ export const propTypes = {
|
|
|
81
72
|
borderRadius: PropTypes.string,
|
|
82
73
|
preset: PropTypes.oneOf(['s', 'm', 'xl']),
|
|
83
74
|
size: PropTypes.shape({
|
|
84
|
-
faSize:
|
|
85
|
-
wrapperSize: PropTypes.number
|
|
75
|
+
faSize: number,
|
|
76
|
+
wrapperSize: PropTypes.number
|
|
86
77
|
}),
|
|
87
78
|
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
|
|
88
79
|
};
|
|
89
|
-
|
|
90
|
-
// const MemoizedIcon = React.memo(Icon) as React.MemoExoticComponent<React.FC<IconProps>> & {
|
|
91
|
-
// propTypes?: React.WeakValidationMap<IconProps>;
|
|
92
|
-
// defaultProps?: Partial<IconProps>;
|
|
93
|
-
// };
|
|
94
|
-
|
|
95
|
-
Icon.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
96
|
-
// MemoizedIcon.propTypes = Icon.propTypes;
|
|
97
|
-
|
|
80
|
+
Icon.propTypes = process.env.NODE_ENV !== "production" ? iconPropTypes : {};
|
|
98
81
|
export default Icon;
|
|
99
82
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","FontAwesomeIcon","fas","library","toLower","merge","getOr","convert","createGradientBackground","style","add","DEFAULT_PRESET","ICON_LUMINOSITY","DEFAULT_WRAPPER_SIZE","ICON_PADDING","DEFAULT_ICON_COLOR","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","number","FontAwesomeIcon","fas","library","toLower","merge","getOr","convert","createGradientBackground","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","gradientBackground","borderRadius","preset","size","customStyle","effectiveIconColor","effectiveSize","iconWrapperStyle","background","width","height","padding","createElement","className","iconWrapper","icon","color","fontSize","iconPropTypes","string","isRequired","bool","oneOf","shape","objectOf","oneOfType","propTypes","process","env","NODE_ENV"],"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 {createGradientBackground} from '../../util/get-background-gradient-color';\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 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\n ? createGradientBackground(effectiveIconColor, '81%', '91%')\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\nexport const iconPropTypes = {\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\nIcon.propTypes = iconPropTypes;\n\nexport default Icon;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,IAAGC,MAAM,QAAO,YAAY;AAC5C,SAAQC,eAAe,QAAO,gCAAgC;AAC9D,SAAQC,GAAG,QAAO,kCAAkC;AACpD,SAAQC,OAAO,QAAO,mCAAmC;AACzD,OAAOC,OAAO,MAAM,mBAAmB;AACvC,OAAOC,KAAK,MAAM,iBAAiB;AACnC,OAAOC,KAAK,MAAM,iBAAiB;AACnC,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,SAAQC,wBAAwB,QAAO,0CAA0C;AACjF,OAAOC,KAAK,MAAM,aAAa;AAE/BN,OAAO,CAACO,GAAG,CAACR,GAAG,CAAC;AAEhB,MAAMS,cAAc,GAAG,GAAG;AAC1B,MAAMC,eAAe,GAAG,EAAE;AAC1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
3
3
|
declare const RadioWithTitle: {
|
|
4
4
|
(props: RadioWithTitleProps): JSX.Element;
|
|
@@ -10,7 +10,7 @@ declare const RadioWithTitle: {
|
|
|
10
10
|
'data-name': import("prop-types").Requireable<string>;
|
|
11
11
|
titleSize: import("prop-types").Requireable<string>;
|
|
12
12
|
subtitleSize: import("prop-types").Requireable<string>;
|
|
13
|
-
icon: import("prop-types").Requireable<import("prop-types").InferProps<
|
|
13
|
+
icon: import("prop-types").Requireable<import("prop-types").InferProps<any>>;
|
|
14
14
|
tag: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
15
15
|
label: import("prop-types").Requireable<string>;
|
|
16
16
|
type: import("prop-types").Requireable<string>;
|
|
@@ -18,17 +18,7 @@ declare const RadioWithTitle: {
|
|
|
18
18
|
customStyle: import("prop-types").Requireable<{
|
|
19
19
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
20
20
|
}>;
|
|
21
|
-
icon: import("prop-types").Requireable<import("prop-types").InferProps<
|
|
22
|
-
position: import("prop-types").Requireable<string>;
|
|
23
|
-
iconName?: React.Validator<string> | undefined;
|
|
24
|
-
iconColor?: React.Validator<string | null | undefined> | undefined;
|
|
25
|
-
backgroundColor?: React.Validator<string | null | undefined> | undefined;
|
|
26
|
-
gradientBackground?: React.Validator<boolean | null | undefined> | undefined;
|
|
27
|
-
borderRadius?: React.Validator<string | null | undefined> | undefined;
|
|
28
|
-
preset?: React.Validator<string | null | undefined> | undefined;
|
|
29
|
-
size?: React.Validator<import("../icon").IconSize | null | undefined> | undefined;
|
|
30
|
-
customStyle?: React.Validator<React.CSSProperties | null | undefined> | undefined;
|
|
31
|
-
}>>;
|
|
21
|
+
icon: import("prop-types").Requireable<import("prop-types").InferProps<any>>;
|
|
32
22
|
}>>;
|
|
33
23
|
button: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
34
24
|
type: import("prop-types").Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAY,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEvD,QAAA,MAAM,cAAc;YAAW,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBjD,CAAC;AAIF,eAAe,cAAc,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
2
|
export declare const propTypes: {
|
|
4
3
|
title: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
@@ -8,7 +7,7 @@ export declare const propTypes: {
|
|
|
8
7
|
'data-name': PropTypes.Requireable<string>;
|
|
9
8
|
titleSize: PropTypes.Requireable<string>;
|
|
10
9
|
subtitleSize: PropTypes.Requireable<string>;
|
|
11
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
10
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
12
11
|
tag: PropTypes.Requireable<PropTypes.InferProps<{
|
|
13
12
|
label: PropTypes.Requireable<string>;
|
|
14
13
|
type: PropTypes.Requireable<string>;
|
|
@@ -16,17 +15,7 @@ export declare const propTypes: {
|
|
|
16
15
|
customStyle: PropTypes.Requireable<{
|
|
17
16
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
18
17
|
}>;
|
|
19
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
20
|
-
position: PropTypes.Requireable<string>;
|
|
21
|
-
iconName?: import("react").Validator<string> | undefined;
|
|
22
|
-
iconColor?: import("react").Validator<string | null | undefined> | undefined;
|
|
23
|
-
backgroundColor?: import("react").Validator<string | null | undefined> | undefined;
|
|
24
|
-
gradientBackground?: import("react").Validator<boolean | null | undefined> | undefined;
|
|
25
|
-
borderRadius?: import("react").Validator<string | null | undefined> | undefined;
|
|
26
|
-
preset?: import("react").Validator<string | null | undefined> | undefined;
|
|
27
|
-
size?: import("react").Validator<import("../icon").IconSize | null | undefined> | undefined;
|
|
28
|
-
customStyle?: import("react").Validator<import("react").CSSProperties | null | undefined> | undefined;
|
|
29
|
-
}>>;
|
|
18
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
30
19
|
}>>;
|
|
31
20
|
button: PropTypes.Requireable<PropTypes.InferProps<{
|
|
32
21
|
type: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOrB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","StyleSheet","Text","View","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","COLORS","createStyle","icon","current","backgroundColor","
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","useEffect","useState","StyleSheet","Text","View","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","COLORS","createStyle","icon","current","backgroundColor","positive","negative","gray","create","step","width","height","opacity","marginHorizontal","alignItems","justifyContent","borderRadius","stepText","fontWeight","fontSize","Step","value","style","setStyle","_style","child","createElement","color"],"sources":["../../../src/atom/status-item/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport {COLORS} from '../../variables/colors';\nimport {StatusItemProps} from './types';\n\ntype StyleSheetType = {\n step: ViewStyle;\n stepText: TextStyle;\n icon: ViewStyle;\n};\n\nconst createStyle = (icon: StatusItemProps['icon'], current?: boolean): StyleSheetType => {\n let backgroundColor;\n\n switch (icon) {\n case 'right':\n backgroundColor = COLORS.positive;\n break;\n case 'wrong':\n backgroundColor = COLORS.negative;\n break;\n case 'no-answer':\n default:\n backgroundColor = COLORS.gray;\n }\n\n return StyleSheet.create({\n step: {\n width: current ? 40 : 32,\n height: current ? 40 : 32,\n opacity: current ? 1 : 0.5,\n marginHorizontal: 8,\n backgroundColor,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 50\n },\n stepText: {\n fontWeight: '600',\n fontSize: current ? 16 : 12\n },\n icon: {\n width: current ? 14 : 12,\n height: current ? 14 : 12\n }\n });\n};\n\nconst Step = ({value, icon, current}: StatusItemProps) => {\n const [style, setStyle] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _style = createStyle(icon, current);\n setStyle(_style);\n }, [current, icon]);\n\n if (!style) {\n return null;\n }\n\n let child;\n\n switch (icon) {\n case 'right':\n child = <RightIcon style={style.icon} color=\"#fff\" />;\n break;\n case 'wrong':\n child = <WrongIcon style={style.icon} color=\"#fff\" />;\n break;\n case 'no-answer':\n default:\n child = <Text style={style.stepText}>{value}</Text>;\n }\n\n return <View style={style.step}>{child}</View>;\n};\n\nexport default Step;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,SAAS,EAAEC,QAAQ,QAAO,OAAO;AAChD,SAAQC,UAAU,EAAEC,IAAI,EAAaC,IAAI,QAAkB,cAAc;AACzE,SACEC,gCAAgC,IAAIC,SAAS,EAC7CC,oBAAoB,IAAIC,SAAS,QAC5B,0BAA0B;AACjC,SAAQC,MAAM,QAAO,wBAAwB;AAS7C,MAAMC,WAAW,GAAGA,CAACC,IAA6B,EAAEC,OAAiB,KAAqB;EACxF,IAAIC,eAAe;EAEnB,QAAQF,IAAI;IACV,KAAK,OAAO;MACVE,eAAe,GAAGJ,MAAM,CAACK,QAAQ;MACjC;IACF,KAAK,OAAO;MACVD,eAAe,GAAGJ,MAAM,CAACM,QAAQ;MACjC;IACF,KAAK,WAAW;IAChB;MACEF,eAAe,GAAGJ,MAAM,CAACO,IAAI;EACjC;EAEA,OAAOd,UAAU,CAACe,MAAM,CAAC;IACvBC,IAAI,EAAE;MACJC,KAAK,EAAEP,OAAO,GAAG,EAAE,GAAG,EAAE;MACxBQ,MAAM,EAAER,OAAO,GAAG,EAAE,GAAG,EAAE;MACzBS,OAAO,EAAET,OAAO,GAAG,CAAC,GAAG,GAAG;MAC1BU,gBAAgB,EAAE,CAAC;MACnBT,eAAe;MACfU,UAAU,EAAE,QAAQ;MACpBC,cAAc,EAAE,QAAQ;MACxBC,YAAY,EAAE;IAChB,CAAC;IACDC,QAAQ,EAAE;MACRC,UAAU,EAAE,KAAK;MACjBC,QAAQ,EAAEhB,OAAO,GAAG,EAAE,GAAG;IAC3B,CAAC;IACDD,IAAI,EAAE;MACJQ,KAAK,EAAEP,OAAO,GAAG,EAAE,GAAG,EAAE;MACxBQ,MAAM,EAAER,OAAO,GAAG,EAAE,GAAG;IACzB;EACF,CAAC,CAAC;AACJ,CAAC;AAED,MAAMiB,IAAI,GAAGA,CAAC;EAACC,KAAK;EAAEnB,IAAI;EAAEC;AAAwB,CAAC,KAAK;EACxD,MAAM,CAACmB,KAAK,EAAEC,QAAQ,CAAC,GAAG/B,QAAQ,CAAwB,IAAI,CAAC;EAE/DD,SAAS,CAAC,MAAM;IACd,MAAMiC,MAAM,GAAGvB,WAAW,CAACC,IAAI,EAAEC,OAAO,CAAC;IACzCoB,QAAQ,CAACC,MAAM,CAAC;EAClB,CAAC,EAAE,CAACrB,OAAO,EAAED,IAAI,CAAC,CAAC;EAEnB,IAAI,CAACoB,KAAK,EAAE;IACV,OAAO,IAAI;EACb;EAEA,IAAIG,KAAK;EAET,QAAQvB,IAAI;IACV,KAAK,OAAO;MACVuB,KAAK,gBAAGnC,KAAA,CAAAoC,aAAA,CAAC7B,SAAS;QAACyB,KAAK,EAAEA,KAAK,CAACpB,IAAK;QAACyB,KAAK,EAAC;MAAM,CAAE,CAAC;MACrD;IACF,KAAK,OAAO;MACVF,KAAK,gBAAGnC,KAAA,CAAAoC,aAAA,CAAC3B,SAAS;QAACuB,KAAK,EAAEA,KAAK,CAACpB,IAAK;QAACyB,KAAK,EAAC;MAAM,CAAE,CAAC;MACrD;IACF,KAAK,WAAW;IAChB;MACEF,KAAK,gBAAGnC,KAAA,CAAAoC,aAAA,CAAChC,IAAI;QAAC4B,KAAK,EAAEA,KAAK,CAACL;MAAS,GAAEI,KAAY,CAAC;EACvD;EAEA,oBAAO/B,KAAA,CAAAoC,aAAA,CAAC/B,IAAI;IAAC2B,KAAK,EAAEA,KAAK,CAACb;EAAK,GAAEgB,KAAY,CAAC;AAChD,CAAC;AAED,eAAeL,IAAI","ignoreList":[]}
|
package/es/atom/tag/index.d.ts
CHANGED
|
@@ -14,19 +14,8 @@ declare namespace Tag {
|
|
|
14
14
|
const customStyle: PropTypes.Requireable<{
|
|
15
15
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
16
16
|
}>;
|
|
17
|
-
const icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
18
|
-
position: PropTypes.Requireable<string>;
|
|
19
|
-
iconName?: React.Validator<string> | undefined;
|
|
20
|
-
iconColor?: React.Validator<string | null | undefined> | undefined;
|
|
21
|
-
backgroundColor?: React.Validator<string | null | undefined> | undefined;
|
|
22
|
-
gradientBackground?: React.Validator<boolean | null | undefined> | undefined;
|
|
23
|
-
borderRadius?: React.Validator<string | null | undefined> | undefined;
|
|
24
|
-
preset?: React.Validator<string | null | undefined> | undefined;
|
|
25
|
-
size?: React.Validator<import("../icon").IconSize | null | undefined> | undefined;
|
|
26
|
-
customStyle?: React.Validator<React.CSSProperties | null | undefined> | undefined;
|
|
27
|
-
}>>;
|
|
17
|
+
const icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
28
18
|
}
|
|
29
19
|
}
|
|
30
20
|
import PropTypes from "prop-types";
|
|
31
|
-
import React from "react";
|
|
32
21
|
//# sourceMappingURL=index.d.ts.map
|
package/es/atom/tag/style.css
CHANGED
package/es/atom/title/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare namespace Title {
|
|
|
8
8
|
'data-name': PropTypes.Requireable<string>;
|
|
9
9
|
titleSize: PropTypes.Requireable<string>;
|
|
10
10
|
subtitleSize: PropTypes.Requireable<string>;
|
|
11
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
11
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
12
12
|
tag: PropTypes.Requireable<PropTypes.InferProps<{
|
|
13
13
|
label: PropTypes.Requireable<string>;
|
|
14
14
|
type: PropTypes.Requireable<string>;
|
|
@@ -16,17 +16,7 @@ declare namespace Title {
|
|
|
16
16
|
customStyle: PropTypes.Requireable<{
|
|
17
17
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
18
18
|
}>;
|
|
19
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<
|
|
20
|
-
position: PropTypes.Requireable<string>;
|
|
21
|
-
iconName?: React.Validator<string> | undefined;
|
|
22
|
-
iconColor?: React.Validator<string | null | undefined> | undefined;
|
|
23
|
-
backgroundColor?: React.Validator<string | null | undefined> | undefined;
|
|
24
|
-
gradientBackground?: React.Validator<boolean | null | undefined> | undefined;
|
|
25
|
-
borderRadius?: React.Validator<string | null | undefined> | undefined;
|
|
26
|
-
preset?: React.Validator<string | null | undefined> | undefined;
|
|
27
|
-
size?: React.Validator<import("../icon").IconSize | null | undefined> | undefined;
|
|
28
|
-
customStyle?: React.Validator<React.CSSProperties | null | undefined> | undefined;
|
|
29
|
-
}>>;
|
|
19
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
30
20
|
}>>;
|
|
31
21
|
button: PropTypes.Requireable<PropTypes.InferProps<{
|
|
32
22
|
type: PropTypes.Requireable<string>;
|
|
@@ -69,5 +59,4 @@ declare namespace Title {
|
|
|
69
59
|
};
|
|
70
60
|
}
|
|
71
61
|
import PropTypes from "prop-types";
|
|
72
|
-
import React from "react";
|
|
73
62
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -7,7 +7,7 @@ import { propTypes } from './types';
|
|
|
7
7
|
const {
|
|
8
8
|
negative: cm_negative_100,
|
|
9
9
|
cm_primary_blue,
|
|
10
|
-
|
|
10
|
+
positive: cm_positive_100
|
|
11
11
|
} = COLORS;
|
|
12
12
|
const STATUS = {
|
|
13
13
|
inProgress: 'inProgress',
|
|
@@ -31,7 +31,7 @@ const resolveProgressBarColor = status => {
|
|
|
31
31
|
case STATUS.inProgress:
|
|
32
32
|
return cm_primary_blue;
|
|
33
33
|
default:
|
|
34
|
-
return
|
|
34
|
+
return cm_positive_100;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
const BulkProgressBar = props => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","ProgressBar","StatusItem","COLORS","style","propTypes","negative","cm_negative_100","cm_primary_blue","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","ProgressBar","StatusItem","COLORS","style","propTypes","negative","cm_negative_100","cm_primary_blue","positive","cm_positive_100","STATUS","inProgress","fail","renderStatusIcon","status","progress","createElement","role","className","progressText","statusItemWrapper","icon","resolveProgressBarColor","BulkProgressBar","props","dataName","container","progressBar","value","max","steps","backgroundColor","borderRadius","displayInfo","process","env","NODE_ENV"],"sources":["../../../src/molecule/bulk-progress-bar/index.tsx"],"sourcesContent":["import React from 'react';\nimport ProgressBar from '../progress-bar';\nimport StatusItem from '../../atom/status-item';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\nimport {Props, propTypes, Status} from './types';\n\nconst {negative: cm_negative_100, cm_primary_blue, positive: cm_positive_100} = COLORS;\n\nconst STATUS = {\n inProgress: 'inProgress',\n fail: 'fail'\n};\n\nconst renderStatusIcon = (status: Status, progress: number) => {\n if (status === STATUS.inProgress)\n return <div role=\"status\" className={style.progressText}>{`${progress} %`}</div>;\n return (\n <div className={style.statusItemWrapper}>\n <StatusItem icon={status === STATUS.fail ? 'invalid' : 'valid'} />\n </div>\n );\n};\n\nconst resolveProgressBarColor = (status: Status) => {\n switch (status) {\n case STATUS.fail:\n return cm_negative_100;\n case STATUS.inProgress:\n return cm_primary_blue;\n default:\n return cm_positive_100;\n }\n};\n\nconst BulkProgressBar = (props: Props) => {\n const {'data-name': dataName, status, progress} = props;\n\n return (\n <div className={style.container} data-name={dataName}>\n <ProgressBar\n className={style.progressBar}\n value={progress}\n max={100}\n steps={0}\n style={{backgroundColor: resolveProgressBarColor(status), borderRadius: '10px'}}\n displayInfo={false}\n />\n {renderStatusIcon(status, progress)}\n </div>\n );\n};\n\nBulkProgressBar.propTypes = propTypes;\n\nexport default BulkProgressBar;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,SAAQC,MAAM,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;IAC7BC,KAAK,EAAEb,QAAS;IAChBc,GAAG,EAAE,GAAI;IACTC,KAAK,EAAE,CAAE;IACT3B,KAAK,EAAE;MAAC4B,eAAe,EAAET,uBAAuB,CAACR,MAAM,CAAC;MAAEkB,YAAY,EAAE;IAAM,CAAE;IAChFC,WAAW,EAAE;EAAM,CACpB,CAAC,EACDpB,gBAAgB,CAACC,MAAM,EAAEC,QAAQ,CAC/B,CAAC;AAEV,CAAC;AAEDQ,eAAe,CAACnB,SAAS,GAAA8B,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGhC,SAAS;AAErC,eAAemB,eAAe","ignoreList":[]}
|
|
@@ -72,7 +72,7 @@ const CertificationCard = (props, context) => {
|
|
|
72
72
|
}, conditionDescriptionProgress)), /*#__PURE__*/React.createElement(ProgressBar, {
|
|
73
73
|
className: style.customProgressBar,
|
|
74
74
|
style: {
|
|
75
|
-
backgroundColor: COLORS.
|
|
75
|
+
backgroundColor: COLORS.positive
|
|
76
76
|
},
|
|
77
77
|
displayInfo: false,
|
|
78
78
|
value: progress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","COLORS","Provider","Tag","ProgressBar","style","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","createElement","className","container","type","top","right","icon","imageSection","imageContainer","src","detailWrapper","titleWrapper","moduleCount","customProgressBar","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","COLORS","Provider","Tag","ProgressBar","style","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","createElement","className","container","type","top","right","icon","imageSection","imageContainer","src","detailWrapper","titleWrapper","moduleCount","customProgressBar","positive","displayInfo","value","max","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","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,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,GAAG,MAAM,gBAAgB;AAChC,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,iBAAiB,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EAC5C,MAAM;IACJC,KAAK;IACLC,OAAO,EAAE;MAACC,4BAA4B;MAAEC;IAAG,CAAC;IAC5CC,IAAI,EAAE;MAACC;IAAK,CAAC;IACbC,QAAQ;IACRC,MAAM;IACNC;EACF,CAAC,GAAGV,KAAK;EACT,MAAM;IAACW;EAAS,CAAC,GAAGV,OAAO;EAC3B,MAAMW,YAAY,GAAGJ,QAAQ,GAAG,GAAG;EACnC,MAAMK,aAAa,GAAGD,YAAY,GAAGD,SAAS,CAAC,aAAa,CAAC,GAAGA,SAAS,CAAC,WAAW,CAAC;EACtF,MAAMG,eAAe,GAAGF,YAAY,GAAG,UAAU,GAAG,SAAS;EAE7D,MAAMG,iBAAiB,GAAG;IACxBC,QAAQ,EAAE,MAAM;IAChBC,QAAQ,EAAEL,YAAY,GAAG,OAAO,GAAG,cAAc;IACjDM,SAAS,EAAEN,YAAY,GAAG,SAAS,GAAG,SAAS;IAC/CO,eAAe,EAAEP,YAAY,GAAG,SAAS,GAAG,SAAS;IACrDQ,IAAI,EAAE;MACJC,MAAM,EAAE,EAAE;MACVC,WAAW,EAAE;IACf,CAAC;IACDC,WAAW,EAAE;MAACC,OAAO,EAAE;IAAC;EAC1B,CAAC;EAED,oBACEhC,KAAA,CAAAi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