@coorpacademy/components 11.32.20-alpha.39 → 11.32.20
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 +2 -0
- package/es/atom/button-link/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +22 -8
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/types.d.ts +4 -0
- package/es/atom/button-link/types.d.ts.map +1 -1
- package/es/atom/button-link/types.js +2 -0
- package/es/atom/button-link/types.js.map +1 -1
- package/es/atom/radio-with-title/index.d.ts +0 -6
- package/es/atom/radio-with-title/index.d.ts.map +1 -1
- package/es/atom/radio-with-title/types.d.ts +0 -6
- package/es/atom/radio-with-title/types.d.ts.map +1 -1
- package/es/atom/tag/style.css +1 -2
- package/es/atom/title/index.d.ts +0 -6
- package/es/atom/title/index.d.ts.map +1 -1
- package/es/atom/title/index.js +4 -16
- package/es/atom/title/index.js.map +1 -1
- package/es/atom/title/style.css +0 -13
- package/es/molecule/base-modal/index.d.ts.map +1 -1
- package/es/molecule/base-modal/index.js +6 -10
- package/es/molecule/base-modal/index.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +4 -6
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.d.ts +2 -9
- package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +26 -26
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/dashboard/cards-list/prop-types.d.ts +0 -1
- package/es/molecule/dashboard/cards-list/prop-types.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/prop-types.js.map +1 -1
- package/es/molecule/dashboard/cards-list/style.css +29 -12
- package/es/molecule/expandible-actionable-table/index.d.ts +2 -0
- package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/types.d.ts +2 -0
- package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/es/molecule/learner-skill-card/index.d.ts.map +1 -1
- package/es/molecule/learner-skill-card/index.js +7 -10
- package/es/molecule/learner-skill-card/index.js.map +1 -1
- package/es/molecule/learning-priority-card/index.d.ts +3 -2
- package/es/molecule/learning-priority-card/index.d.ts.map +1 -1
- package/es/molecule/learning-priority-card/index.js +10 -11
- package/es/molecule/learning-priority-card/index.js.map +1 -1
- package/es/molecule/learning-priority-card/style.css +0 -2
- package/es/molecule/learning-priority-card/types.d.ts +6 -4
- package/es/molecule/learning-priority-card/types.d.ts.map +1 -1
- package/es/molecule/learning-priority-card/types.js +4 -3
- package/es/molecule/learning-priority-card/types.js.map +1 -1
- package/es/molecule/skill-card/index.d.ts.map +1 -1
- package/es/molecule/skill-card/index.js +5 -8
- package/es/molecule/skill-card/index.js.map +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +0 -6
- package/es/molecule/title-radio-wrapper/index.d.ts +0 -6
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +0 -6
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/organism/list-items/index.d.ts +4 -0
- package/es/organism/rewards-form/index.d.ts +0 -6
- package/es/organism/select-opponents/index.d.ts +0 -6
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +0 -6
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/setup-header/index.d.ts +8 -0
- package/es/organism/title-and-input/index.d.ts +0 -12
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +0 -12
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +6 -6
- package/es/template/app-player/loading/index.d.ts +4 -6
- package/es/template/app-player/player/index.d.ts +8 -12
- package/es/template/app-player/player/slides/index.d.ts +4 -6
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +4 -6
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +6 -15
- package/es/template/app-player/popin-end/summary.d.ts +2 -9
- package/es/template/app-review/index.d.ts +4 -6
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +4 -6
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +4 -6
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-create/index.d.ts +8 -0
- package/es/template/back-office/brand-create/index.d.ts.map +1 -1
- package/es/template/back-office/brand-list/index.d.ts +8 -0
- package/es/template/back-office/brand-list/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +22 -6
- package/es/template/back-office/dashboard-preview/index.d.ts +8 -0
- package/es/template/back-office/layout/index.d.ts +8 -0
- package/es/template/back-office/layout/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.d.ts +8 -12
- package/es/template/common/dashboard/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.js +1 -28
- package/es/template/common/dashboard/index.js.map +1 -1
- package/es/template/common/search-page/index.d.ts +6 -15
- package/es/template/external-course/index.d.ts +4 -6
- package/es/template/my-learning/index.d.ts +1 -153
- package/es/template/my-learning/index.d.ts.map +1 -1
- package/es/template/my-learning/index.js +12 -51
- package/es/template/my-learning/index.js.map +1 -1
- package/es/template/my-learning/style.css +3 -18
- package/es/template/skill-detail/index.d.ts.map +1 -1
- package/es/template/skill-detail/index.js +4 -8
- package/es/template/skill-detail/index.js.map +1 -1
- package/es/template/teams-dashboard/index.d.ts +2 -9
- package/lib/atom/button-link/index.d.ts +2 -0
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js +21 -7
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/types.d.ts +4 -0
- package/lib/atom/button-link/types.d.ts.map +1 -1
- package/lib/atom/button-link/types.js +2 -0
- package/lib/atom/button-link/types.js.map +1 -1
- package/lib/atom/radio-with-title/index.d.ts +0 -6
- package/lib/atom/radio-with-title/index.d.ts.map +1 -1
- package/lib/atom/radio-with-title/types.d.ts +0 -6
- package/lib/atom/radio-with-title/types.d.ts.map +1 -1
- package/lib/atom/tag/style.css +1 -2
- package/lib/atom/title/index.d.ts +0 -6
- package/lib/atom/title/index.d.ts.map +1 -1
- package/lib/atom/title/index.js +4 -18
- package/lib/atom/title/index.js.map +1 -1
- package/lib/atom/title/style.css +0 -13
- package/lib/molecule/base-modal/index.d.ts.map +1 -1
- package/lib/molecule/base-modal/index.js +5 -9
- package/lib/molecule/base-modal/index.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +4 -6
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts +2 -9
- package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +26 -27
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/prop-types.d.ts +0 -1
- package/lib/molecule/dashboard/cards-list/prop-types.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/prop-types.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/style.css +29 -12
- package/lib/molecule/expandible-actionable-table/index.d.ts +2 -0
- package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/types.d.ts +2 -0
- package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/lib/molecule/learner-skill-card/index.d.ts.map +1 -1
- package/lib/molecule/learner-skill-card/index.js +6 -9
- package/lib/molecule/learner-skill-card/index.js.map +1 -1
- package/lib/molecule/learning-priority-card/index.d.ts +3 -2
- package/lib/molecule/learning-priority-card/index.d.ts.map +1 -1
- package/lib/molecule/learning-priority-card/index.js +10 -11
- package/lib/molecule/learning-priority-card/index.js.map +1 -1
- package/lib/molecule/learning-priority-card/style.css +0 -2
- package/lib/molecule/learning-priority-card/types.d.ts +6 -4
- package/lib/molecule/learning-priority-card/types.d.ts.map +1 -1
- package/lib/molecule/learning-priority-card/types.js +4 -3
- package/lib/molecule/learning-priority-card/types.js.map +1 -1
- package/lib/molecule/skill-card/index.d.ts.map +1 -1
- package/lib/molecule/skill-card/index.js +4 -7
- package/lib/molecule/skill-card/index.js.map +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +0 -6
- package/lib/molecule/title-radio-wrapper/index.d.ts +0 -6
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +0 -6
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/organism/list-items/index.d.ts +4 -0
- package/lib/organism/rewards-form/index.d.ts +0 -6
- package/lib/organism/select-opponents/index.d.ts +0 -6
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +0 -6
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/setup-header/index.d.ts +8 -0
- package/lib/organism/title-and-input/index.d.ts +0 -12
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +0 -12
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +6 -6
- package/lib/template/app-player/loading/index.d.ts +4 -6
- package/lib/template/app-player/player/index.d.ts +8 -12
- package/lib/template/app-player/player/slides/index.d.ts +4 -6
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +4 -6
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +6 -15
- package/lib/template/app-player/popin-end/summary.d.ts +2 -9
- package/lib/template/app-review/index.d.ts +4 -6
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +4 -6
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +4 -6
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-create/index.d.ts +8 -0
- package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-list/index.d.ts +8 -0
- package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +22 -6
- package/lib/template/back-office/dashboard-preview/index.d.ts +8 -0
- package/lib/template/back-office/layout/index.d.ts +8 -0
- package/lib/template/back-office/layout/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +8 -12
- package/lib/template/common/dashboard/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.js +1 -30
- package/lib/template/common/dashboard/index.js.map +1 -1
- package/lib/template/common/search-page/index.d.ts +6 -15
- package/lib/template/external-course/index.d.ts +4 -6
- package/lib/template/my-learning/index.d.ts +1 -153
- package/lib/template/my-learning/index.d.ts.map +1 -1
- package/lib/template/my-learning/index.js +13 -57
- package/lib/template/my-learning/index.js.map +1 -1
- package/lib/template/my-learning/style.css +3 -18
- package/lib/template/skill-detail/index.d.ts.map +1 -1
- package/lib/template/skill-detail/index.js +4 -8
- package/lib/template/skill-detail/index.js.map +1 -1
- package/lib/template/teams-dashboard/index.d.ts +2 -9
- package/package.json +2 -2
|
@@ -42,9 +42,6 @@ const BaseModal = (props, context) => {
|
|
|
42
42
|
const {
|
|
43
43
|
skin
|
|
44
44
|
} = context;
|
|
45
|
-
const [hovered, setHovered] = (0, _react.useState)(false);
|
|
46
|
-
const handleMouseOver = (0, _react.useCallback)(() => setHovered(true), [setHovered]);
|
|
47
|
-
const handleMouseLeave = (0, _react.useCallback)(() => setHovered(false), [setHovered]);
|
|
48
45
|
const Footer = (0, _react.useCallback)(() => {
|
|
49
46
|
if ((0, _isEmpty2.default)(footer)) return null;
|
|
50
47
|
if (typeof footer === 'function') return footer();
|
|
@@ -76,13 +73,12 @@ const BaseModal = (props, context) => {
|
|
|
76
73
|
onClick: onCancel,
|
|
77
74
|
label: cancelLabel,
|
|
78
75
|
disabled: cancelDisabled
|
|
79
|
-
}) : null, onConfirm && confirmLabel ? /*#__PURE__*/_react.default.createElement("div", {
|
|
80
|
-
onMouseOver: handleMouseOver,
|
|
81
|
-
onMouseLeave: handleMouseLeave
|
|
82
|
-
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, _extends({
|
|
76
|
+
}) : null, onConfirm && confirmLabel ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_buttonLink.default, _extends({
|
|
83
77
|
customStyle: {
|
|
84
|
-
backgroundColor:
|
|
78
|
+
backgroundColor: primarySkinColor
|
|
85
79
|
},
|
|
80
|
+
hoverBackgroundColor: (0, _cssColorFunction.convert)(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`),
|
|
81
|
+
hoverColor: '#FFFFFF',
|
|
86
82
|
className: _style.default.footerConfirmButton,
|
|
87
83
|
type: 'primary',
|
|
88
84
|
onClick: onConfirm,
|
|
@@ -100,7 +96,7 @@ const BaseModal = (props, context) => {
|
|
|
100
96
|
} : {}))) : null), text ? /*#__PURE__*/_react.default.createElement("div", {
|
|
101
97
|
className: `${_style.default.footerDescription} ${isError ? _style.default.footerDescriptionError : ''}`
|
|
102
98
|
}, text) : null);
|
|
103
|
-
}, [footer,
|
|
99
|
+
}, [footer, skin, _style.default, _cssColorFunction.convert, _get2.default, _isEmpty2.default]);
|
|
104
100
|
if (!isOpen || !title || !children) return null;
|
|
105
101
|
|
|
106
102
|
function handleOnClose(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["BaseModal","props","context","title","description","headerIcon","children","isOpen","footer","onClose","skin","hovered","setHovered","useState","handleMouseOver","useCallback","handleMouseLeave","Footer","cancelButton","confirmButton","text","isError","label","cancelLabel","onCancel","disabled","cancelDisabled","confirmLabel","onConfirm","confirmDisabled","iconName","primarySkinColor","style","footerCTAWrapper","className","footerCancelButton","type","onClick","customStyle","backgroundColor","convert","footerConfirmButton","icon","position","faIcon","name","color","size","footerDescription","footerDescriptionError","handleOnClose","e","stopPropagation","modalWrapper","modal","header","faSize","wrapperSize","headerContent","headerTitle","headerDescription","headerCloseIcon","body","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","shape","node","bool","oneOfType","func","boolean"],"sources":["../../../src/molecule/base-modal/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, get} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport Provider from '../../atom/provider';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst BaseModal = (props, context) => {\n const {title, description, headerIcon, children, isOpen, footer, onClose} = props;\n const {skin} = context;\n\n const [hovered, setHovered] = useState(false);\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const Footer = useCallback(() => {\n if (isEmpty(footer)) return null;\n if (typeof footer === 'function') return footer();\n\n const {cancelButton, confirmButton, text, isError} = footer;\n const {label: cancelLabel, onCancel, disabled: cancelDisabled} = cancelButton || {};\n const {\n label: confirmLabel,\n onConfirm,\n disabled: confirmDisabled,\n iconName\n } = confirmButton || {};\n const primarySkinColor = get('common.primary', skin);\n\n return (\n <div className={style.footer}>\n <div className={style.footerCTAWrapper}>\n {onCancel && cancelLabel ? (\n <ButtonLink\n {...{\n className: style.footerCancelButton,\n type: 'secondary',\n onClick: onCancel,\n label: cancelLabel,\n disabled: cancelDisabled\n }}\n />\n ) : null}\n {onConfirm && confirmLabel ? (\n <div onMouseOver={handleMouseOver} onMouseLeave={handleMouseLeave}>\n <ButtonLink\n {...{\n customStyle: {\n backgroundColor: hovered\n ? convert(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`)\n : primarySkinColor\n },\n className: style.footerConfirmButton,\n type: 'primary',\n onClick: onConfirm,\n label: confirmLabel,\n disabled: confirmDisabled,\n ...(iconName\n ? {\n icon: {\n position: 'left',\n faIcon: {\n name: iconName,\n color: '#FFFFFF',\n size: 16\n }\n }\n }\n : {})\n }}\n />\n </div>\n ) : null}\n </div>\n {text ? (\n <div\n className={`${style.footerDescription} ${isError ? style.footerDescriptionError : ''}`}\n >\n {text}\n </div>\n ) : null}\n </div>\n );\n }, [footer, hovered, handleMouseOver, handleMouseLeave, skin]);\n\n if (!isOpen || !title || !children) return null;\n\n function handleOnClose(e) {\n e?.stopPropagation();\n onClose();\n }\n\n return (\n <div className={style.modalWrapper}>\n <div className={style.modal}>\n <header className={style.header}>\n {headerIcon?.name ? (\n <div className={style.headerIcon}>\n <Icon\n iconName={headerIcon.name}\n iconColor={headerIcon.color}\n backgroundColor={headerIcon.backgroundColor}\n size={{faSize: 20, wrapperSize: 48}}\n />\n </div>\n ) : null}\n <div className={style.headerContent}>\n <div className={style.headerTitle}>{title}</div>\n {description ? <div className={style.headerDescription}>{description}</div> : null}\n </div>\n <div className={style.headerCloseIcon} onClick={handleOnClose}>\n <Icon iconName=\"close\" backgroundColor=\"#F4F4F5\" size={{faSize: 14, wrapperSize: 28}} />\n </div>\n </header>\n <div className={style.body}>{children}</div>\n <Footer />\n </div>\n </div>\n );\n};\n\nBaseModal.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nBaseModal.propTypes = {\n title: PropTypes.string,\n headerIcon: PropTypes.shape({\n name: PropTypes.string,\n color: PropTypes.string,\n backgroundColor: PropTypes.string\n }),\n description: PropTypes.string,\n children: PropTypes.node,\n isOpen: PropTypes.bool,\n footer: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n text: PropTypes.string,\n isError: PropTypes.boolean,\n cancelButton: PropTypes.shape({\n label: PropTypes.string,\n onCancel: PropTypes.func,\n disabled: PropTypes.bool\n }),\n confirmButton: PropTypes.shape({\n label: PropTypes.string,\n onConfirm: PropTypes.func,\n iconName: PropTypes.string,\n disabled: PropTypes.bool\n })\n })\n ]),\n onClose: PropTypes.func\n};\n\nexport default BaseModal;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,SAAS,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACpC,MAAM;IAACC,KAAD;IAAQC,WAAR;IAAqBC,UAArB;IAAiCC,QAAjC;IAA2CC,MAA3C;IAAmDC,MAAnD;IAA2DC;EAA3D,IAAsER,KAA5E;EACA,MAAM;IAACS;EAAD,IAASR,OAAf;EAEA,MAAM,CAACS,OAAD,EAAUC,UAAV,IAAwB,IAAAC,eAAA,EAAS,KAAT,CAA9B;EACA,MAAMC,eAAe,GAAG,IAAAC,kBAAA,EAAY,MAAMH,UAAU,CAAC,IAAD,CAA5B,EAAoC,CAACA,UAAD,CAApC,CAAxB;EACA,MAAMI,gBAAgB,GAAG,IAAAD,kBAAA,EAAY,MAAMH,UAAU,CAAC,KAAD,CAA5B,EAAqC,CAACA,UAAD,CAArC,CAAzB;EAEA,MAAMK,MAAM,GAAG,IAAAF,kBAAA,EAAY,MAAM;IAC/B,IAAI,uBAAQP,MAAR,CAAJ,EAAqB,OAAO,IAAP;IACrB,IAAI,OAAOA,MAAP,KAAkB,UAAtB,EAAkC,OAAOA,MAAM,EAAb;IAElC,MAAM;MAACU,YAAD;MAAeC,aAAf;MAA8BC,IAA9B;MAAoCC;IAApC,IAA+Cb,MAArD;IACA,MAAM;MAACc,KAAK,EAAEC,WAAR;MAAqBC,QAArB;MAA+BC,QAAQ,EAAEC;IAAzC,IAA2DR,YAAY,IAAI,EAAjF;IACA,MAAM;MACJI,KAAK,EAAEK,YADH;MAEJC,SAFI;MAGJH,QAAQ,EAAEI,eAHN;MAIJC;IAJI,IAKFX,aAAa,IAAI,EALrB;IAMA,MAAMY,gBAAgB,GAAG,mBAAI,gBAAJ,EAAsBrB,IAAtB,CAAzB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Icon","children","isOpen","footer","onClose","skin","Footer","useCallback","cancelButton","confirmButton","text","isError","label","cancelLabel","onCancel","disabled","cancelDisabled","confirmLabel","onConfirm","confirmDisabled","iconName","primarySkinColor","style","footerCTAWrapper","className","footerCancelButton","type","onClick","customStyle","backgroundColor","hoverBackgroundColor","convert","hoverColor","footerConfirmButton","icon","position","faIcon","name","color","size","footerDescription","footerDescriptionError","handleOnClose","e","stopPropagation","modalWrapper","modal","header","faSize","wrapperSize","headerContent","headerTitle","headerDescription","headerCloseIcon","body","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","shape","node","bool","oneOfType","func","boolean"],"sources":["../../../src/molecule/base-modal/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, get} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport Provider from '../../atom/provider';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst BaseModal = (props, context) => {\n const {title, description, headerIcon, children, isOpen, footer, onClose} = props;\n const {skin} = context;\n\n const Footer = useCallback(() => {\n if (isEmpty(footer)) return null;\n if (typeof footer === 'function') return footer();\n\n const {cancelButton, confirmButton, text, isError} = footer;\n const {label: cancelLabel, onCancel, disabled: cancelDisabled} = cancelButton || {};\n const {\n label: confirmLabel,\n onConfirm,\n disabled: confirmDisabled,\n iconName\n } = confirmButton || {};\n const primarySkinColor = get('common.primary', skin);\n\n return (\n <div className={style.footer}>\n <div className={style.footerCTAWrapper}>\n {onCancel && cancelLabel ? (\n <ButtonLink\n {...{\n className: style.footerCancelButton,\n type: 'secondary',\n onClick: onCancel,\n label: cancelLabel,\n disabled: cancelDisabled\n }}\n />\n ) : null}\n {onConfirm && confirmLabel ? (\n <div>\n <ButtonLink\n {...{\n customStyle: {backgroundColor: primarySkinColor},\n hoverBackgroundColor: convert(\n `hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`\n ),\n hoverColor: '#FFFFFF',\n className: style.footerConfirmButton,\n type: 'primary',\n onClick: onConfirm,\n label: confirmLabel,\n disabled: confirmDisabled,\n ...(iconName\n ? {\n icon: {\n position: 'left',\n faIcon: {\n name: iconName,\n color: '#FFFFFF',\n size: 16\n }\n }\n }\n : {})\n }}\n />\n </div>\n ) : null}\n </div>\n {text ? (\n <div\n className={`${style.footerDescription} ${isError ? style.footerDescriptionError : ''}`}\n >\n {text}\n </div>\n ) : null}\n </div>\n );\n }, [footer, skin, style, convert, get, isEmpty]);\n\n if (!isOpen || !title || !children) return null;\n\n function handleOnClose(e) {\n e?.stopPropagation();\n onClose();\n }\n\n return (\n <div className={style.modalWrapper}>\n <div className={style.modal}>\n <header className={style.header}>\n {headerIcon?.name ? (\n <div className={style.headerIcon}>\n <Icon\n iconName={headerIcon.name}\n iconColor={headerIcon.color}\n backgroundColor={headerIcon.backgroundColor}\n size={{faSize: 20, wrapperSize: 48}}\n />\n </div>\n ) : null}\n <div className={style.headerContent}>\n <div className={style.headerTitle}>{title}</div>\n {description ? <div className={style.headerDescription}>{description}</div> : null}\n </div>\n <div className={style.headerCloseIcon} onClick={handleOnClose}>\n <Icon iconName=\"close\" backgroundColor=\"#F4F4F5\" size={{faSize: 14, wrapperSize: 28}} />\n </div>\n </header>\n <div className={style.body}>{children}</div>\n <Footer />\n </div>\n </div>\n );\n};\n\nBaseModal.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nBaseModal.propTypes = {\n title: PropTypes.string,\n headerIcon: PropTypes.shape({\n name: PropTypes.string,\n color: PropTypes.string,\n backgroundColor: PropTypes.string\n }),\n description: PropTypes.string,\n children: PropTypes.node,\n isOpen: PropTypes.bool,\n footer: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n text: PropTypes.string,\n isError: PropTypes.boolean,\n cancelButton: PropTypes.shape({\n label: PropTypes.string,\n onCancel: PropTypes.func,\n disabled: PropTypes.bool\n }),\n confirmButton: PropTypes.shape({\n label: PropTypes.string,\n onConfirm: PropTypes.func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APH;EAQpB3D,QAAQ,EAAE0D,kBAAA,CAAUG,IARA;EASpB5D,MAAM,EAAEyD,kBAAA,CAAUI,IATE;EAUpB5D,MAAM,EAAEwD,kBAAA,CAAUK,SAAV,CAAoB,CAC1BL,kBAAA,CAAUM,IADgB,EAE1BN,kBAAA,CAAUE,KAAV,CAAgB;IACdnD,IAAI,EAAEiD,kBAAA,CAAUC,MADF;IAEdjD,OAAO,EAAEgD,kBAAA,CAAUO,OAFL;IAGd1D,YAAY,EAAEmD,kBAAA,CAAUE,KAAV,CAAgB;MAC5BjD,KAAK,EAAE+C,kBAAA,CAAUC,MADW;MAE5B9C,QAAQ,EAAE6C,kBAAA,CAAUM,IAFQ;MAG5BlD,QAAQ,EAAE4C,kBAAA,CAAUI;IAHQ,CAAhB,CAHA;IAQdtD,aAAa,EAAEkD,kBAAA,CAAUE,KAAV,CAAgB;MAC7BjD,KAAK,EAAE+C,kBAAA,CAAUC,MADY;MAE7B1C,SAAS,EAAEyC,kBAAA,CAAUM,IAFQ;MAG7B7C,QAAQ,EAAEuC,kBAAA,CAAUC,MAHS;MAI7B7C,QAAQ,EAAE4C,kBAAA,CAAUI;IAJS,CAAhB;EARD,CAAhB,CAF0B,CAApB,CAVY;EA4BpB3D,OAAO,EAAEuD,kBAAA,CAAUM;AA5BC,CAAtB;eA+BetE,S"}
|
|
@@ -14,12 +14,6 @@ declare const propTypes: {
|
|
|
14
14
|
'data-name': PropTypes.Requireable<string>;
|
|
15
15
|
titleSize: PropTypes.Requireable<string>;
|
|
16
16
|
subtitleSize: PropTypes.Requireable<string>;
|
|
17
|
-
icon: PropTypes.Requireable<PropTypes.InferProps<any>>;
|
|
18
|
-
tag: PropTypes.Requireable<PropTypes.InferProps<{
|
|
19
|
-
label: PropTypes.Requireable<string>;
|
|
20
|
-
type: PropTypes.Requireable<string>;
|
|
21
|
-
size: PropTypes.Requireable<string>;
|
|
22
|
-
}>>;
|
|
23
17
|
}>>;
|
|
24
18
|
headerIcon: PropTypes.Requireable<string>;
|
|
25
19
|
backgroundImage: PropTypes.Requireable<string>;
|
|
@@ -103,6 +97,8 @@ declare const propTypes: {
|
|
|
103
97
|
download: PropTypes.Requireable<boolean>;
|
|
104
98
|
target: PropTypes.Requireable<string>;
|
|
105
99
|
}>>;
|
|
100
|
+
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
101
|
+
hoverColor: PropTypes.Requireable<string>;
|
|
106
102
|
disabled: PropTypes.Requireable<boolean>;
|
|
107
103
|
className: PropTypes.Requireable<string>;
|
|
108
104
|
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
@@ -235,6 +231,8 @@ declare const propTypes: {
|
|
|
235
231
|
download: PropTypes.Requireable<boolean>;
|
|
236
232
|
target: PropTypes.Requireable<string>;
|
|
237
233
|
}>>;
|
|
234
|
+
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
235
|
+
hoverColor: PropTypes.Requireable<string>;
|
|
238
236
|
disabled: PropTypes.Requireable<boolean>;
|
|
239
237
|
className: PropTypes.Requireable<string>;
|
|
240
238
|
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAKnC,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAGlD,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAKnC,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,M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,CAAC,EAAE;QACN,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;QACzB,IAAI,EACA,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,GAChD,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;KACtD,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;CACpD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -9,7 +9,7 @@ declare class CardsList extends React.PureComponent<any, any, any> {
|
|
|
9
9
|
dataName: PropTypes.Requireable<string>;
|
|
10
10
|
title: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
11
11
|
showMore: PropTypes.Requireable<string>;
|
|
12
|
-
cards: PropTypes.Requireable<(
|
|
12
|
+
cards: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
13
13
|
badge: PropTypes.Requireable<string>;
|
|
14
14
|
image: PropTypes.Requireable<string>;
|
|
15
15
|
disabled: PropTypes.Requireable<boolean>;
|
|
@@ -60,13 +60,7 @@ declare class CardsList extends React.PureComponent<any, any, any> {
|
|
|
60
60
|
progression: PropTypes.Requireable<string>;
|
|
61
61
|
adaptive: PropTypes.Requireable<string>;
|
|
62
62
|
}>>;
|
|
63
|
-
}> |
|
|
64
|
-
title: PropTypes.Requireable<string>;
|
|
65
|
-
tagLabel: PropTypes.Requireable<string>;
|
|
66
|
-
progression: PropTypes.Requireable<number>;
|
|
67
|
-
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
68
|
-
type: PropTypes.Requireable<string>;
|
|
69
|
-
}> | null | undefined> | null | undefined)[]>;
|
|
63
|
+
}> | null | undefined)[]>;
|
|
70
64
|
customStyle: PropTypes.Requireable<{
|
|
71
65
|
[x: string]: string | null | undefined;
|
|
72
66
|
}>;
|
|
@@ -76,7 +70,6 @@ declare class CardsList extends React.PureComponent<any, any, any> {
|
|
|
76
70
|
showMoreOnLeftAriaLabel: PropTypes.Requireable<string>;
|
|
77
71
|
showMoreOnRightAriaLabel: PropTypes.Requireable<string>;
|
|
78
72
|
}>>;
|
|
79
|
-
type: PropTypes.Requireable<string>;
|
|
80
73
|
testingSizes: PropTypes.Requireable<any>;
|
|
81
74
|
};
|
|
82
75
|
static contextTypes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"names":[],"mappings":";AAuFA;IACE;;;OAGG;IACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"names":[],"mappings":";AAuFA;IACE;;;OAGG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAeE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAkCC;IA/BC;;;;;;;;MAQC;IAED,0DAAgE;IAsHlE,qBAiBC;IAED,qBAGC;IAED,sBAGC;IAED,0BASC;IAvJC,uEAA6D;IAyJ/D,mCAIC;IA5DD,oCAMC;IAGD,sCAIC;IA5DD,qBAGC;IAnCD,0BAMC;IAED,2BAYC;IAED,6BAOC;IASD,wCAuCC;IAGC,kBAA2B;IA6D7B,sBAuGC;CACF"}
|
|
@@ -39,10 +39,6 @@ var _provider = _interopRequireDefault(require("../../../atom/provider"));
|
|
|
39
39
|
|
|
40
40
|
var _card = _interopRequireWildcard(require("../../card"));
|
|
41
41
|
|
|
42
|
-
var _learningPriorityCard = _interopRequireDefault(require("../../learning-priority-card"));
|
|
43
|
-
|
|
44
|
-
var _icon = _interopRequireDefault(require("../../../atom/icon"));
|
|
45
|
-
|
|
46
42
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
47
43
|
|
|
48
44
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -341,34 +337,38 @@ class CardsList extends _react.default.PureComponent {
|
|
|
341
337
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
342
338
|
className: _style.default.card,
|
|
343
339
|
key: key
|
|
344
|
-
},
|
|
345
|
-
dataName: `${dataName}-${key}`
|
|
346
|
-
})) : /*#__PURE__*/_react.default.createElement(_card.default, _extends({}, card, {
|
|
340
|
+
}, /*#__PURE__*/_react.default.createElement(_card.default, _extends({}, card, {
|
|
347
341
|
dataName: `${dataName}-${key}`
|
|
348
342
|
})));
|
|
349
343
|
}))(cards);
|
|
350
|
-
const arrowIconProps = {
|
|
351
|
-
color: dark,
|
|
352
|
-
preset: 's',
|
|
353
|
-
borderRadius: '8px',
|
|
354
|
-
ariaLabel: ariaLabel.showMoreOnLeftAriaLabel
|
|
355
|
-
};
|
|
356
344
|
|
|
357
|
-
const
|
|
358
|
-
className: _style.default.
|
|
359
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
360
|
-
className: _style.default.arrow,
|
|
345
|
+
const leftArrowView = /*#__PURE__*/_react.default.createElement("div", {
|
|
346
|
+
className: _style.default.circle,
|
|
361
347
|
onClick: this.handleOnLeft,
|
|
362
348
|
"data-name": "card-list-left-arrow"
|
|
363
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
349
|
+
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowLeft, {
|
|
350
|
+
style: {
|
|
351
|
+
color: dark
|
|
352
|
+
},
|
|
353
|
+
className: _style.default.left,
|
|
354
|
+
width: 10,
|
|
355
|
+
height: 10,
|
|
356
|
+
"aria-label": ariaLabel.showMoreOnLeftAriaLabel
|
|
357
|
+
}));
|
|
358
|
+
|
|
359
|
+
const rightArrowView = /*#__PURE__*/_react.default.createElement("div", {
|
|
360
|
+
className: _style.default.circle,
|
|
367
361
|
onClick: this.handleOnRight,
|
|
368
362
|
"data-name": "card-list-right-arrow"
|
|
369
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
370
|
-
|
|
371
|
-
|
|
363
|
+
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowRight, {
|
|
364
|
+
style: {
|
|
365
|
+
color: dark
|
|
366
|
+
},
|
|
367
|
+
className: _style.default.right,
|
|
368
|
+
width: 10,
|
|
369
|
+
height: 10,
|
|
370
|
+
"aria-label": ariaLabel.showMoreOnRightAriaLabel
|
|
371
|
+
}));
|
|
372
372
|
|
|
373
373
|
const titleView = typeof title === 'string' ? /*#__PURE__*/_react.default.createElement("span", {
|
|
374
374
|
"data-name": "title",
|
|
@@ -387,7 +387,7 @@ class CardsList extends _react.default.PureComponent {
|
|
|
387
387
|
}) : null;
|
|
388
388
|
const switchPagesView = hasPages ? /*#__PURE__*/_react.default.createElement("div", {
|
|
389
389
|
className: _style.default.pagingWrapper
|
|
390
|
-
}, showMoreView,
|
|
390
|
+
}, showMoreView, leftArrowView, rightArrowView) : null;
|
|
391
391
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
392
392
|
className: _style.default.wrapper,
|
|
393
393
|
style: customStyle,
|
|
@@ -419,7 +419,7 @@ CardsList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
419
419
|
dataName: _propTypes.default.string,
|
|
420
420
|
title: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.string]),
|
|
421
421
|
showMore: _propTypes.default.string,
|
|
422
|
-
cards: _propTypes.default.arrayOf(_propTypes.default.
|
|
422
|
+
cards: _propTypes.default.arrayOf(_propTypes.default.shape(_card.cardPropTypes)),
|
|
423
423
|
customStyle: _propTypes.default.objectOf(_propTypes.default.string),
|
|
424
424
|
onScroll: _propTypes.default.func,
|
|
425
425
|
onShowMore: _propTypes.default.func,
|
|
@@ -427,7 +427,6 @@ CardsList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
427
427
|
showMoreOnLeftAriaLabel: _propTypes.default.string,
|
|
428
428
|
showMoreOnRightAriaLabel: _propTypes.default.string
|
|
429
429
|
}),
|
|
430
|
-
type: _propTypes.default.oneOf(['cards', 'learningPrioritiesCards']),
|
|
431
430
|
// eslint-disable-next-line react/forbid-prop-types
|
|
432
431
|
testingSizes: _propTypes.default.any
|
|
433
432
|
} : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ShowMoreLink","props","onShowMore","showMore","className","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","func","string","IconView","context","contentType","ICONS","chapter","TimerIcon","course","LearnerIcon","dark","IconType","color","style","icon","computeWidth","card","type","nextPage","page","maxPages","CardsList","React","PureComponent","constructor","state","actualPage","scrollLeft","offsetWidth","possiblePositions","possiblePages","cardsWidth","handleScroll_","handleScroll","bind","handleOnLeft","handleOnRight","scrollTo","updateState","updatePages","setCardsWrapper","getScrollWidth","handleResize","testingSizes","componentDidMount","cardsWrapper","addEventListener","window","componentDidUpdate","cards","newCardsWidth","updatePaginationState","setState","componentWillUnmount","removeEventListener","cancel","wrapperWidth","wrapperScrollLeft","cardWidths","cardPositions","accWidth","cardWidth","acc","pageIndex","accPageWidth","pageWidth","skip","position","element","index","onScroll","leftBound","rightBound","leftIndex","rightIndex","limit","indexOfNextFirstCard","indexOf","nextPosition","render","title","customStyle","dataName","ariaLabel","titleStyle","titleLink","cardsView","key","arrowIconProps","preset","borderRadius","showMoreOnLeftAriaLabel","arrows","arrowsWrapper","arrow","titleView","titleNode","hasPages","showMoreView","showMoreBar","switchPagesView","pagingWrapper","wrapper","list","header","translate","oneOfType","node","arrayOf","shape","cardPropTypes","LearningPriorityCard","objectOf","showMoreOnRightAriaLabel","oneOf","any"],"sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"sourcesContent":["import React from 'react';\nimport {\n debounce,\n throttle,\n get,\n getOr,\n map,\n sum,\n last,\n pipe,\n toPairs,\n reduce,\n head,\n findIndex,\n findLastIndex\n} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../../atom/provider';\nimport Card, {cardPropTypes} from '../../card';\nimport LearningPriorityCard from '../../learning-priority-card';\nimport Icon from '../../../atom/icon';\nimport style from './style.css';\n\nconst ShowMoreLink = props => {\n const {onShowMore, showMore, className} = props;\n return (\n <div className={className} onClick={onShowMore}>\n {showMore}\n </div>\n );\n};\n\nShowMoreLink.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nShowMoreLink.propTypes = {\n onShowMore: PropTypes.func,\n showMore: PropTypes.string,\n className: PropTypes.string\n};\n\nconst IconView = (props, context) => {\n const {skin} = context;\n const {contentType} = props;\n const ICONS = {\n chapter: TimerIcon,\n course: LearnerIcon\n };\n\n if (!contentType) {\n return null;\n }\n\n const dark = get('common.dark', skin);\n const IconType = ICONS[contentType];\n\n return (\n <div>\n <IconType style={{color: dark}} className={style.icon} data-contenttype={contentType} />\n </div>\n );\n};\n\nconst computeWidth = card => {\n switch (card && card.type) {\n case 'chapter':\n return 219;\n default:\n return 272;\n }\n};\n\nconst nextPage = (page, maxPages) => {\n if (page < 0) return maxPages;\n if (page > maxPages) return 0;\n return page;\n};\n\nIconView.propTypes = {\n contentType: PropTypes.string\n};\n\nclass CardsList extends React.PureComponent {\n /**\n * IMPORTANT: update prop-types.ts too, 1st a migration of tests\n * is intended, then, a TS + functional refactor is planned.\n */\n static propTypes = {\n contentType: PropTypes.string,\n dataName: PropTypes.string,\n title: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),\n showMore: PropTypes.string,\n cards: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(cardPropTypes),\n PropTypes.shape(LearningPriorityCard.propTypes)\n ])\n ),\n customStyle: PropTypes.objectOf(PropTypes.string),\n onScroll: PropTypes.func,\n onShowMore: PropTypes.func,\n 'arrows-aria-label': PropTypes.shape({\n showMoreOnLeftAriaLabel: PropTypes.string,\n showMoreOnRightAriaLabel: PropTypes.string\n }),\n type: PropTypes.oneOf(['cards', 'learningPrioritiesCards']),\n // eslint-disable-next-line react/forbid-prop-types\n testingSizes: PropTypes.any\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n actualPage: 0,\n maxPages: 0,\n scrollLeft: 0,\n offsetWidth: 0,\n possiblePositions: [],\n possiblePages: [],\n cardsWidth: 0\n };\n\n this.handleScroll_ = throttle(200, this.handleScroll.bind(this));\n this.handleScroll = this.handleScroll.bind(this);\n this.handleOnLeft = this.handleOnLeft.bind(this);\n this.handleOnRight = this.handleOnRight.bind(this);\n this.scrollTo = this.scrollTo.bind(this);\n this.updateState = debounce(200, this.updatePages.bind(this));\n this.updatePages = this.updatePages.bind(this);\n this.setCardsWrapper = this.setCardsWrapper.bind(this);\n this.getScrollWidth = this.getScrollWidth.bind(this);\n this.handleResize = this.handleResize.bind(this);\n\n // for testing purposes only - no other way to test this polluted component\n if (props.testingSizes) {\n const {offsetWidth, scrollLeft, maxPages, possiblePages, possiblePositions} =\n props.testingSizes;\n this.state.offsetWidth = offsetWidth;\n this.state.scrollLeft = scrollLeft;\n this.state.maxPages = maxPages;\n this.state.possiblePages = possiblePages;\n this.state.possiblePositions = possiblePositions;\n }\n }\n\n componentDidMount() {\n this.cardsWrapper.addEventListener('scroll', this.handleScroll_);\n\n if (window) {\n window.addEventListener('resize', this.handleResize);\n }\n }\n\n componentDidUpdate() {\n const {cards = []} = this.props;\n const {offsetWidth, cardsWidth} = this.state;\n const newCardsWidth = pipe(map(computeWidth), sum)(cards);\n\n if (newCardsWidth !== cardsWidth && offsetWidth !== 0) {\n this.updatePaginationState(cards);\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({\n cardsWidth: newCardsWidth\n });\n }\n }\n\n componentWillUnmount() {\n this.cardsWrapper.removeEventListener('scroll', this.handleScroll_);\n\n if (window) {\n window.removeEventListener('resize', this.handleResize);\n }\n this.updateState.cancel();\n }\n\n /* istanbul ignore next */\n handleResize() {\n const {cards = []} = this.props;\n this.updatePaginationState(cards);\n }\n\n /* istanbul ignore next */\n updatePaginationState(cards) {\n const {offsetWidth: wrapperWidth, scrollLeft: wrapperScrollLeft} = this.state;\n\n const cardWidths = map(computeWidth)(cards);\n\n const possiblePositions = pipe(\n reduce(\n ([cardPositions, accWidth], cardWidth) => [\n [...cardPositions, accWidth],\n cardWidth + accWidth\n ],\n [[], 0]\n ),\n head\n )(cardWidths);\n\n const possiblePages = pipe(\n reduce(\n ([acc, pageIndex, accPageWidth], cardWidth) => {\n const pageWidth = accPageWidth + cardWidth;\n if (pageWidth > wrapperWidth) {\n return [[...acc, pageIndex + 1], pageIndex + 1, cardWidth];\n }\n return [[...acc, pageIndex], pageIndex, pageWidth];\n },\n [[], 0, 0]\n ),\n head\n )(cardWidths);\n\n const skip = findIndex(position => position >= wrapperScrollLeft, possiblePositions);\n const actualPage = possiblePages[skip + 1];\n\n this.setState({\n possiblePositions,\n possiblePages,\n maxPages: last(possiblePages),\n actualPage\n });\n }\n\n setCardsWrapper(element) {\n this.cardsWrapper = element;\n this.setState({\n scrollLeft: this.cardsWrapper?.scrollLeft,\n offsetWidth: this.cardsWrapper?.offsetWidth\n });\n }\n\n /* istanbul ignore next */\n getScrollWidth(index) {\n const {cards = []} = this.props;\n const card = cards[index];\n return computeWidth(card);\n }\n\n /* istanbul ignore next */\n handleScroll() {\n const scrollLeft = this.cardsWrapper?.scrollLeft;\n this.setState({scrollLeft});\n\n const {possiblePositions, offsetWidth} = this.state;\n const {onScroll} = this.props;\n if (onScroll) {\n const leftBound = scrollLeft;\n const rightBound = scrollLeft + offsetWidth;\n\n const leftIndex = findIndex(position => position > leftBound, possiblePositions) - 1;\n const rightIndex = findLastIndex(position => position < rightBound, possiblePositions);\n const skip = leftIndex;\n const limit = rightIndex - skip + 1;\n\n onScroll(skip, limit);\n }\n }\n\n handleOnLeft() {\n const {actualPage, maxPages} = this.state;\n this.scrollTo(nextPage(actualPage - 1, maxPages));\n }\n\n handleOnRight() {\n const {actualPage, maxPages} = this.state;\n this.scrollTo(nextPage(actualPage + 1, maxPages));\n }\n\n scrollTo(page) {\n const {possiblePages, possiblePositions} = this.state;\n const indexOfNextFirstCard = possiblePages.indexOf(page);\n const nextPosition = possiblePositions[indexOfNextFirstCard];\n this.cardsWrapper.scrollLeft = nextPosition;\n this.updatePages(page);\n this.setState({\n scrollLeft: nextPosition\n });\n }\n\n updatePages(actualPage) {\n this.setState({\n actualPage\n });\n }\n\n render() {\n const {\n title,\n showMore,\n cards,\n customStyle = {},\n onShowMore,\n dataName,\n contentType,\n 'arrows-aria-label': ariaLabel = {}\n } = this.props;\n const {skin} = this.context;\n const {maxPages} = this.state;\n const dark = getOr('#90A4AE', 'common.dark', skin);\n const titleStyle = onShowMore ? style.titleLink : style.title;\n const cardsView = pipe(\n toPairs,\n map(([key, card]) => {\n return (\n <div className={style.card} key={key}>\n {card && card.type === 'learningPriority' ? (\n <LearningPriorityCard {...card} dataName={`${dataName}-${key}`} />\n ) : (\n <Card {...card} dataName={`${dataName}-${key}`} />\n )}\n </div>\n );\n })\n )(cards);\n\n const arrowIconProps = {\n color: dark,\n preset: 's',\n borderRadius: '8px',\n ariaLabel: ariaLabel.showMoreOnLeftAriaLabel\n };\n\n const arrows = (\n <div className={style.arrowsWrapper}>\n <div className={style.arrow} onClick={this.handleOnLeft} data-name=\"card-list-left-arrow\">\n <Icon {...arrowIconProps} iconName=\"arrow-left\" />\n </div>\n <div className={style.arrow} onClick={this.handleOnRight} data-name=\"card-list-right-arrow\">\n <Icon {...arrowIconProps} iconName=\"arrow-right\" />\n </div>\n </div>\n );\n\n const titleView =\n typeof title === 'string' ? (\n <span data-name=\"title\" className={titleStyle} onClick={onShowMore}>\n <IconView contentType={contentType} />\n <span>{title}</span>\n </span>\n ) : (\n <span className={style.titleNode}>{title}</span>\n );\n\n const hasPages = maxPages > 0;\n const showMoreView =\n hasPages && showMore && onShowMore ? (\n <ShowMoreLink\n className={hasPages ? style.showMoreBar : style.showMore}\n onShowMore={onShowMore}\n showMore={showMore}\n />\n ) : null;\n\n const switchPagesView = hasPages ? (\n <div className={style.pagingWrapper}>\n {showMoreView}\n {arrows}\n </div>\n ) : null;\n\n return (\n <div\n className={style.wrapper}\n style={customStyle}\n data-name=\"cardsList\"\n data-max-pages={`${maxPages}`}\n // eslint-disable-next-line react/destructuring-assignment\n data-actual-page={`${this.state.actualPage}`}\n data-scroll-left={this.cardsWrapper?.scrollLeft}\n >\n <div className={style.list}>\n <div>\n <div data-name=\"header\" className={style.header}>\n {titleView}\n {switchPagesView}\n </div>\n <div\n className={style.cards}\n data-testid=\"cards-view-wrapper\"\n ref={this.setCardsWrapper}\n >\n {cardsView}\n </div>\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default CardsList;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAgBA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAACC,UAAD;IAAaC,QAAb;IAAuBC;EAAvB,IAAoCH,KAA1C;EACA,oBACE;IAAK,SAAS,EAAEG,SAAhB;IAA2B,OAAO,EAAEF;EAApC,GACGC,QADH,CADF;AAKD,CAPD;;AASAH,YAAY,CAACK,YAAb,GAA4B;EAC1BC,IAAI,EAAEC,iBAAA,CAASC,iBAAT,CAA2BF;AADP,CAA5B;AAIAN,YAAY,CAACS,SAAb,2CAAyB;EACvBP,UAAU,EAAEQ,kBAAA,CAAUC,IADC;EAEvBR,QAAQ,EAAEO,kBAAA,CAAUE,MAFG;EAGvBR,SAAS,EAAEM,kBAAA,CAAUE;AAHE,CAAzB;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OAAV,CACL7G,kBAAA,CAAU2G,SAAV,CAAoB,CAClB3G,kBAAA,CAAU8G,KAAV,CAAgBC,mBAAhB,CADkB,EAElB/G,kBAAA,CAAU8G,KAAV,CAAgBE,6BAAA,CAAqBjH,SAArC,CAFkB,CAApB,CADK,CALU;EAWjBmF,WAAW,EAAElF,kBAAA,CAAUiH,QAAV,CAAmBjH,kBAAA,CAAUE,MAA7B,CAXI;EAYjBqE,QAAQ,EAAEvE,kBAAA,CAAUC,IAZH;EAajBT,UAAU,EAAEQ,kBAAA,CAAUC,IAbL;EAcjB,qBAAqBD,kBAAA,CAAU8G,KAAV,CAAgB;IACnClB,uBAAuB,EAAE5F,kBAAA,CAAUE,MADA;IAEnCgH,wBAAwB,EAAElH,kBAAA,CAAUE;EAFD,CAAhB,CAdJ;EAkBjBgB,IAAI,EAAElB,kBAAA,CAAUmH,KAAV,CAAgB,CAAC,OAAD,EAAU,yBAAV,CAAhB,CAlBW;EAmBjB;EACAvE,YAAY,EAAE5C,kBAAA,CAAUoH;AApBP,C;eAsTN9F,S"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ShowMoreLink","props","onShowMore","showMore","className","contextTypes","skin","Provider","childContextTypes","propTypes","PropTypes","func","string","IconView","context","contentType","ICONS","chapter","TimerIcon","course","LearnerIcon","dark","IconType","color","style","icon","computeWidth","card","type","nextPage","page","maxPages","CardsList","React","PureComponent","constructor","state","actualPage","scrollLeft","offsetWidth","possiblePositions","possiblePages","cardsWidth","handleScroll_","handleScroll","bind","handleOnLeft","handleOnRight","scrollTo","updateState","updatePages","setCardsWrapper","getScrollWidth","handleResize","testingSizes","componentDidMount","cardsWrapper","addEventListener","window","componentDidUpdate","cards","newCardsWidth","updatePaginationState","setState","componentWillUnmount","removeEventListener","cancel","wrapperWidth","wrapperScrollLeft","cardWidths","cardPositions","accWidth","cardWidth","acc","pageIndex","accPageWidth","pageWidth","skip","position","element","index","onScroll","leftBound","rightBound","leftIndex","rightIndex","limit","indexOfNextFirstCard","indexOf","nextPosition","render","title","customStyle","dataName","ariaLabel","titleStyle","titleLink","cardsView","key","leftArrowView","circle","left","showMoreOnLeftAriaLabel","rightArrowView","right","showMoreOnRightAriaLabel","titleView","titleNode","hasPages","showMoreView","showMoreBar","switchPagesView","pagingWrapper","wrapper","list","header","translate","oneOfType","node","arrayOf","shape","cardPropTypes","objectOf","any"],"sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"sourcesContent":["import React from 'react';\nimport {\n debounce,\n throttle,\n get,\n getOr,\n map,\n sum,\n last,\n pipe,\n toPairs,\n reduce,\n head,\n findIndex,\n findLastIndex\n} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {\n NovaCompositionNavigationArrowLeft as ArrowLeft,\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon\n} from '@coorpacademy/nova-icons';\nimport Provider from '../../../atom/provider';\nimport Card, {cardPropTypes} from '../../card';\nimport style from './style.css';\n\nconst ShowMoreLink = props => {\n const {onShowMore, showMore, className} = props;\n return (\n <div className={className} onClick={onShowMore}>\n {showMore}\n </div>\n );\n};\n\nShowMoreLink.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nShowMoreLink.propTypes = {\n onShowMore: PropTypes.func,\n showMore: PropTypes.string,\n className: PropTypes.string\n};\n\nconst IconView = (props, context) => {\n const {skin} = context;\n const {contentType} = props;\n const ICONS = {\n chapter: TimerIcon,\n course: LearnerIcon\n };\n\n if (!contentType) {\n return null;\n }\n\n const dark = get('common.dark', skin);\n const IconType = ICONS[contentType];\n\n return (\n <div>\n <IconType style={{color: dark}} className={style.icon} data-contenttype={contentType} />\n </div>\n );\n};\n\nconst computeWidth = card => {\n switch (card && card.type) {\n case 'chapter':\n return 219;\n default:\n return 272;\n }\n};\n\nconst nextPage = (page, maxPages) => {\n if (page < 0) return maxPages;\n if (page > maxPages) return 0;\n return page;\n};\n\nIconView.propTypes = {\n contentType: PropTypes.string\n};\n\nclass CardsList extends React.PureComponent {\n /**\n * IMPORTANT: update prop-types.ts too, 1st a migration of tests\n * is intended, then, a TS + functional refactor is planned.\n */\n static propTypes = {\n contentType: PropTypes.string,\n dataName: PropTypes.string,\n title: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),\n showMore: PropTypes.string,\n cards: PropTypes.arrayOf(PropTypes.shape(cardPropTypes)),\n customStyle: PropTypes.objectOf(PropTypes.string),\n onScroll: PropTypes.func,\n onShowMore: PropTypes.func,\n 'arrows-aria-label': PropTypes.shape({\n showMoreOnLeftAriaLabel: PropTypes.string,\n showMoreOnRightAriaLabel: PropTypes.string\n }),\n // eslint-disable-next-line react/forbid-prop-types\n testingSizes: PropTypes.any\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n actualPage: 0,\n maxPages: 0,\n scrollLeft: 0,\n offsetWidth: 0,\n possiblePositions: [],\n possiblePages: [],\n cardsWidth: 0\n };\n\n this.handleScroll_ = throttle(200, this.handleScroll.bind(this));\n this.handleScroll = this.handleScroll.bind(this);\n this.handleOnLeft = this.handleOnLeft.bind(this);\n this.handleOnRight = this.handleOnRight.bind(this);\n this.scrollTo = this.scrollTo.bind(this);\n this.updateState = debounce(200, this.updatePages.bind(this));\n this.updatePages = this.updatePages.bind(this);\n this.setCardsWrapper = this.setCardsWrapper.bind(this);\n this.getScrollWidth = this.getScrollWidth.bind(this);\n this.handleResize = this.handleResize.bind(this);\n\n // for testing purposes only - no other way to test this polluted component\n if (props.testingSizes) {\n const {offsetWidth, scrollLeft, maxPages, possiblePages, possiblePositions} =\n props.testingSizes;\n this.state.offsetWidth = offsetWidth;\n this.state.scrollLeft = scrollLeft;\n this.state.maxPages = maxPages;\n this.state.possiblePages = possiblePages;\n this.state.possiblePositions = possiblePositions;\n }\n }\n\n componentDidMount() {\n this.cardsWrapper.addEventListener('scroll', this.handleScroll_);\n\n if (window) {\n window.addEventListener('resize', this.handleResize);\n }\n }\n\n componentDidUpdate() {\n const {cards = []} = this.props;\n const {offsetWidth, cardsWidth} = this.state;\n const newCardsWidth = pipe(map(computeWidth), sum)(cards);\n\n if (newCardsWidth !== cardsWidth && offsetWidth !== 0) {\n this.updatePaginationState(cards);\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({\n cardsWidth: newCardsWidth\n });\n }\n }\n\n componentWillUnmount() {\n this.cardsWrapper.removeEventListener('scroll', this.handleScroll_);\n\n if (window) {\n window.removeEventListener('resize', this.handleResize);\n }\n this.updateState.cancel();\n }\n\n /* istanbul ignore next */\n handleResize() {\n const {cards = []} = this.props;\n this.updatePaginationState(cards);\n }\n\n /* istanbul ignore next */\n updatePaginationState(cards) {\n const {offsetWidth: wrapperWidth, scrollLeft: wrapperScrollLeft} = this.state;\n\n const cardWidths = map(computeWidth)(cards);\n\n const possiblePositions = pipe(\n reduce(\n ([cardPositions, accWidth], cardWidth) => [\n [...cardPositions, accWidth],\n cardWidth + accWidth\n ],\n [[], 0]\n ),\n head\n )(cardWidths);\n\n const possiblePages = pipe(\n reduce(\n ([acc, pageIndex, accPageWidth], cardWidth) => {\n const pageWidth = accPageWidth + cardWidth;\n if (pageWidth > wrapperWidth) {\n return [[...acc, pageIndex + 1], pageIndex + 1, cardWidth];\n }\n return [[...acc, pageIndex], pageIndex, pageWidth];\n },\n [[], 0, 0]\n ),\n head\n )(cardWidths);\n\n const skip = findIndex(position => position >= wrapperScrollLeft, possiblePositions);\n const actualPage = possiblePages[skip + 1];\n\n this.setState({\n possiblePositions,\n possiblePages,\n maxPages: last(possiblePages),\n actualPage\n });\n }\n\n setCardsWrapper(element) {\n this.cardsWrapper = element;\n this.setState({\n scrollLeft: this.cardsWrapper?.scrollLeft,\n offsetWidth: this.cardsWrapper?.offsetWidth\n });\n }\n\n /* istanbul ignore next */\n getScrollWidth(index) {\n const {cards = []} = this.props;\n const card = cards[index];\n return computeWidth(card);\n }\n\n /* istanbul ignore next */\n handleScroll() {\n const scrollLeft = this.cardsWrapper?.scrollLeft;\n this.setState({scrollLeft});\n\n const {possiblePositions, offsetWidth} = this.state;\n const {onScroll} = this.props;\n if (onScroll) {\n const leftBound = scrollLeft;\n const rightBound = scrollLeft + offsetWidth;\n\n const leftIndex = findIndex(position => position > leftBound, possiblePositions) - 1;\n const rightIndex = findLastIndex(position => position < rightBound, possiblePositions);\n const skip = leftIndex;\n const limit = rightIndex - skip + 1;\n\n onScroll(skip, limit);\n }\n }\n\n handleOnLeft() {\n const {actualPage, maxPages} = this.state;\n this.scrollTo(nextPage(actualPage - 1, maxPages));\n }\n\n handleOnRight() {\n const {actualPage, maxPages} = this.state;\n this.scrollTo(nextPage(actualPage + 1, maxPages));\n }\n\n scrollTo(page) {\n const {possiblePages, possiblePositions} = this.state;\n const indexOfNextFirstCard = possiblePages.indexOf(page);\n const nextPosition = possiblePositions[indexOfNextFirstCard];\n this.cardsWrapper.scrollLeft = nextPosition;\n this.updatePages(page);\n this.setState({\n scrollLeft: nextPosition\n });\n }\n\n updatePages(actualPage) {\n this.setState({\n actualPage\n });\n }\n\n render() {\n const {\n title,\n showMore,\n cards,\n customStyle = {},\n onShowMore,\n dataName,\n contentType,\n 'arrows-aria-label': ariaLabel = {}\n } = this.props;\n const {skin} = this.context;\n const {maxPages} = this.state;\n const dark = getOr('#90A4AE', 'common.dark', skin);\n const titleStyle = onShowMore ? style.titleLink : style.title;\n const cardsView = pipe(\n toPairs,\n map(([key, card]) => {\n return (\n <div className={style.card} key={key}>\n <Card {...card} dataName={`${dataName}-${key}`} />\n </div>\n );\n })\n )(cards);\n const leftArrowView = (\n <div className={style.circle} onClick={this.handleOnLeft} data-name=\"card-list-left-arrow\">\n <ArrowLeft\n style={{color: dark}}\n className={style.left}\n width={10}\n height={10}\n aria-label={ariaLabel.showMoreOnLeftAriaLabel}\n />\n </div>\n );\n const rightArrowView = (\n <div className={style.circle} onClick={this.handleOnRight} data-name=\"card-list-right-arrow\">\n <ArrowRight\n style={{color: dark}}\n className={style.right}\n width={10}\n height={10}\n aria-label={ariaLabel.showMoreOnRightAriaLabel}\n />\n </div>\n );\n\n const titleView =\n typeof title === 'string' ? (\n <span data-name=\"title\" className={titleStyle} onClick={onShowMore}>\n <IconView contentType={contentType} />\n <span>{title}</span>\n </span>\n ) : (\n <span className={style.titleNode}>{title}</span>\n );\n\n const hasPages = maxPages > 0;\n const showMoreView =\n hasPages && showMore && onShowMore ? (\n <ShowMoreLink\n className={hasPages ? style.showMoreBar : style.showMore}\n onShowMore={onShowMore}\n showMore={showMore}\n />\n ) : null;\n\n const switchPagesView = hasPages ? (\n <div className={style.pagingWrapper}>\n {showMoreView}\n {leftArrowView}\n {rightArrowView}\n </div>\n ) : null;\n\n return (\n <div\n className={style.wrapper}\n style={customStyle}\n data-name=\"cardsList\"\n data-max-pages={`${maxPages}`}\n // eslint-disable-next-line react/destructuring-assignment\n data-actual-page={`${this.state.actualPage}`}\n data-scroll-left={this.cardsWrapper?.scrollLeft}\n >\n <div className={style.list}>\n <div>\n <div data-name=\"header\" className={style.header}>\n {titleView}\n {switchPagesView}\n </div>\n <div\n className={style.cards}\n data-testid=\"cards-view-wrapper\"\n ref={this.setCardsWrapper}\n >\n {cardsView}\n </div>\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default CardsList;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAgBA;;AACA;;AAMA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IAACC,UAAD;IAAaC,QAAb;IAAuBC;EAAvB,IAAoCH,KAA1C;EACA,oBACE;IAAK,SAAS,EAAEG,SAAhB;IAA2B,OAAO,EAAEF;EAApC,GACGC,QADH,CADF;AAKD,CAPD;;AASAH,YAAY,CAACK,YAAb,GAA4B;EAC1BC,IAAI,EAAEC,iBAAA,CAASC,iBAAT,CAA2BF;AADP,CAA5B;AAIAN,YAAY,CA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EAIjBT,QAAQ,EAAEO,kBAAA,CAAUE,MAJH;EAKjBgD,KAAK,EAAElD,kBAAA,CAAU6G,OAAV,CAAkB7G,kBAAA,CAAU8G,KAAV,CAAgBC,mBAAhB,CAAlB,CALU;EAMjB7B,WAAW,EAAElF,kBAAA,CAAUgH,QAAV,CAAmBhH,kBAAA,CAAUE,MAA7B,CANI;EAOjBqE,QAAQ,EAAEvE,kBAAA,CAAUC,IAPH;EAQjBT,UAAU,EAAEQ,kBAAA,CAAUC,IARL;EASjB,qBAAqBD,kBAAA,CAAU8G,KAAV,CAAgB;IACnClB,uBAAuB,EAAE5F,kBAAA,CAAUE,MADA;IAEnC6F,wBAAwB,EAAE/F,kBAAA,CAAUE;EAFD,CAAhB,CATJ;EAajB;EACA0C,YAAY,EAAE5C,kBAAA,CAAUiH;AAdP,C;eAiTN3F,S"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/prop-types.ts"],"names":[],"mappings":";AAAA,oBAAY,cAAc,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,mBAAmB,EAAE;QACnB,uBAAuB,EAAE,MAAM,CAAC;QAChC,wBAAwB,EAAE,MAAM,CAAC;KAClC,CAAC;
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/prop-types.ts"],"names":[],"mappings":";AAAA,oBAAY,cAAc,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,mBAAmB,EAAE;QACnB,uBAAuB,EAAE,MAAM,CAAC;QAChC,wBAAwB,EAAE,MAAM,CAAC;KAClC,CAAC;CACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":[],"sources":["../../../../src/molecule/dashboard/cards-list/prop-types.ts"],"sourcesContent":["export type CardsListProps = {\n contentType: string;\n dataName: string;\n title: string | React.ReactNode;\n showMore: string;\n cards: Record<string, unknown>[];\n customStyle: Record<string, unknown>;\n onScroll: (skip: number, limit: number) => void;\n onShowMore: () => void;\n 'arrows-aria-label': {\n showMoreOnLeftAriaLabel: string;\n showMoreOnRightAriaLabel: string;\n };\n
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":[],"sources":["../../../../src/molecule/dashboard/cards-list/prop-types.ts"],"sourcesContent":["export type CardsListProps = {\n contentType: string;\n dataName: string;\n title: string | React.ReactNode;\n showMore: string;\n cards: Record<string, unknown>[];\n customStyle: Record<string, unknown>;\n onScroll: (skip: number, limit: number) => void;\n onShowMore: () => void;\n 'arrows-aria-label': {\n showMoreOnLeftAriaLabel: string;\n showMoreOnRightAriaLabel: string;\n };\n};\n"],"mappings":""}
|
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
@value lightMediumGray from colors;
|
|
9
9
|
@value medium from colors;
|
|
10
10
|
@value light from colors;
|
|
11
|
-
@value cm_grey_100 from colors;
|
|
12
|
-
@value cm_grey_75 from colors;
|
|
13
11
|
|
|
14
12
|
.wrapper {
|
|
15
13
|
padding: 16px 30px 8px;
|
|
@@ -106,26 +104,45 @@
|
|
|
106
104
|
}
|
|
107
105
|
|
|
108
106
|
.arrow {
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
position: flex;
|
|
108
|
+
padding: 9px;
|
|
111
109
|
cursor: pointer;
|
|
110
|
+
opacity: 1;
|
|
112
111
|
user-select: none;
|
|
113
112
|
}
|
|
114
113
|
|
|
115
|
-
.
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.arrowsWrapper {
|
|
120
|
-
display: flex;
|
|
121
|
-
justify-content: space-between;
|
|
122
|
-
gap: 12px;
|
|
114
|
+
.circle:hover {
|
|
115
|
+
box-shadow: 0 0 10px 0 color(medium a(70%));
|
|
123
116
|
}
|
|
124
117
|
|
|
118
|
+
.circle {
|
|
119
|
+
box-shadow: 0 0px 4px 0 color(lightMediumGray a(70%));
|
|
120
|
+
border: solid 1px light;
|
|
121
|
+
border-radius: 50%;
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
line-height: 0;
|
|
124
|
+
margin-left: 5px;
|
|
125
|
+
}
|
|
125
126
|
.pagingWrapper {
|
|
126
127
|
display: inline-flex;
|
|
127
128
|
}
|
|
128
129
|
|
|
130
|
+
.arrow:hover {
|
|
131
|
+
opacity: 1;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.left {
|
|
135
|
+
composes: arrow;
|
|
136
|
+
left: -35px;
|
|
137
|
+
text-align: right;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.right {
|
|
141
|
+
composes: arrow;
|
|
142
|
+
right: -35px;
|
|
143
|
+
text-align: left;
|
|
144
|
+
}
|
|
145
|
+
|
|
129
146
|
@media tablet {
|
|
130
147
|
.cards {
|
|
131
148
|
overflow-x: scroll;
|
|
@@ -79,6 +79,8 @@ declare const ActionableExpandableTable: {
|
|
|
79
79
|
download: import("prop-types").Requireable<boolean>;
|
|
80
80
|
target: import("prop-types").Requireable<string>;
|
|
81
81
|
}>>;
|
|
82
|
+
hoverBackgroundColor: import("prop-types").Requireable<string>;
|
|
83
|
+
hoverColor: import("prop-types").Requireable<string>;
|
|
82
84
|
disabled: import("prop-types").Requireable<boolean>;
|
|
83
85
|
className: import("prop-types").Requireable<string>;
|
|
84
86
|
customStyle: import("prop-types").Requireable<import("prop-types").InferProps<{}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandible-actionable-table/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAOjE,OAAO,EAA2C,KAAK,EAAY,MAAM,SAAS,CAAC;AAqCnF,QAAA,MAAM,yBAAyB;YAAW,KAAK,iBAAiB,gBAAgB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandible-actionable-table/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAOjE,OAAO,EAA2C,KAAK,EAAY,MAAM,SAAS,CAAC;AAqCnF,QAAA,MAAM,yBAAyB;YAAW,KAAK,iBAAiB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoL/E,CAAC;AASF,eAAe,yBAAyB,CAAC"}
|
|
@@ -56,6 +56,8 @@ export declare const propTypes: {
|
|
|
56
56
|
download: PropTypes.Requireable<boolean>;
|
|
57
57
|
target: PropTypes.Requireable<string>;
|
|
58
58
|
}>>;
|
|
59
|
+
hoverBackgroundColor: PropTypes.Requireable<string>;
|
|
60
|
+
hoverColor: PropTypes.Requireable<string>;
|
|
59
61
|
disabled: PropTypes.Requireable<boolean>;
|
|
60
62
|
className: PropTypes.Requireable<string>;
|
|
61
63
|
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandible-actionable-table/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,OAAO,EAAC,0BAA0B,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,KAAK,IAAI,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAC,KAAK,IAAI,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AA0BzE,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandible-actionable-table/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,OAAO,EAAC,0BAA0B,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,KAAK,IAAI,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAC,KAAK,IAAI,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AA0BzE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBrB,CAAC;AAEF,oBAAY,KAAK,GACb,MAAM,GACN,CAAC,eAAe,GA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,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.js"],"names":[],"mappings":";AASA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.js"],"names":[],"mappings":";AASA,yEAiJC"}
|
|
@@ -46,7 +46,6 @@ const LearnerSkillCard = (props, context) => {
|
|
|
46
46
|
skin,
|
|
47
47
|
translate
|
|
48
48
|
} = context;
|
|
49
|
-
const [hovered, setHovered] = (0, _react.useState)(false);
|
|
50
49
|
const primarySkinColor = (0, _get2.default)('common.primary', skin);
|
|
51
50
|
const reviewLocale = translate('Review');
|
|
52
51
|
const exploreLocale = translate('Explore');
|
|
@@ -54,8 +53,6 @@ const LearnerSkillCard = (props, context) => {
|
|
|
54
53
|
const questionsLocale = translate('questions');
|
|
55
54
|
const skillFocusLocale = translate('skill_focus');
|
|
56
55
|
const contentCompletedLocale = translate('courses_completed');
|
|
57
|
-
const handleMouseOver = (0, _react.useCallback)(() => setHovered(true), [setHovered]);
|
|
58
|
-
const handleMouseLeave = (0, _react.useCallback)(() => setHovered(false), [setHovered]);
|
|
59
56
|
const buttonReviewProps = {
|
|
60
57
|
customStyle: {
|
|
61
58
|
backgroundColor: '#FFF',
|
|
@@ -70,10 +67,12 @@ const LearnerSkillCard = (props, context) => {
|
|
|
70
67
|
};
|
|
71
68
|
const buttonExploreProps = {
|
|
72
69
|
customStyle: {
|
|
73
|
-
backgroundColor:
|
|
74
|
-
color:
|
|
70
|
+
backgroundColor: (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.07))`),
|
|
71
|
+
color: primarySkinColor,
|
|
75
72
|
transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'
|
|
76
73
|
},
|
|
74
|
+
hoverColor: '#FFFFFF',
|
|
75
|
+
hoverBackgroundColor: primarySkinColor,
|
|
77
76
|
onClick: onExploreClick,
|
|
78
77
|
'aria-label': `${skillTitle}, ${exploreLocale}`,
|
|
79
78
|
label: exploreLocale,
|
|
@@ -82,8 +81,8 @@ const LearnerSkillCard = (props, context) => {
|
|
|
82
81
|
position: 'left',
|
|
83
82
|
faIcon: {
|
|
84
83
|
name: 'compass',
|
|
85
|
-
backgroundColor:
|
|
86
|
-
color:
|
|
84
|
+
backgroundColor: (0, _cssColorFunction.convert)(`color(${primarySkinColor} a(0.07))`),
|
|
85
|
+
color: primarySkinColor,
|
|
87
86
|
size: 16
|
|
88
87
|
}
|
|
89
88
|
}
|
|
@@ -153,8 +152,6 @@ const LearnerSkillCard = (props, context) => {
|
|
|
153
152
|
"data-name": "cta-wrapper"
|
|
154
153
|
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonReviewProps), /*#__PURE__*/_react.default.createElement("div", {
|
|
155
154
|
className: _style.default.buttonWrapper,
|
|
156
|
-
onMouseOver: handleMouseOver,
|
|
157
|
-
onMouseLeave: handleMouseLeave,
|
|
158
155
|
"data-name": "button-explore-wrapper"
|
|
159
156
|
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonExploreProps))));
|
|
160
157
|
};
|