@coorpacademy/components 11.14.1-alpha.3.27 → 11.14.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/index.d.ts.map +1 -1
- package/es/atom/button/index.js +18 -13
- package/es/atom/button/index.js.map +1 -1
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +5 -4
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +61 -40
- package/es/molecule/discipline-header/index.d.ts +1 -1
- package/es/molecule/discipline-header/index.d.ts.map +1 -1
- package/es/molecule/discipline-header/index.js +8 -8
- package/es/molecule/discipline-header/index.js.map +1 -1
- package/es/molecule/discipline-header/style.css +1 -1
- package/es/molecule/hero/index.d.ts +26 -30
- package/es/molecule/hero/index.d.ts.map +1 -1
- package/es/molecule/hero/index.js +13 -14
- package/es/molecule/hero/index.js.map +1 -1
- package/es/molecule/hero/style.css +0 -42
- package/es/molecule/quick-access-card/index.d.ts +0 -1
- package/es/molecule/quick-access-card/index.d.ts.map +1 -1
- package/es/molecule/quick-access-card/index.js +21 -77
- package/es/molecule/quick-access-card/index.js.map +1 -1
- package/es/molecule/quick-access-card/style.css +17 -28
- package/es/molecule/quick-access-cards-group/index.d.ts +0 -1
- package/es/organism/brand-dashboard/index.d.ts +0 -1
- package/es/template/back-office/brand-update/index.d.ts +0 -1
- package/es/template/external-course/index.d.ts +69 -21
- package/es/template/external-course/index.d.ts.map +1 -1
- package/es/template/external-course/index.js +73 -56
- package/es/template/external-course/index.js.map +1 -1
- package/es/template/external-course/style.css +1 -1
- package/es/util/button-icons.d.ts +0 -1
- package/es/util/button-icons.d.ts.map +1 -1
- package/es/util/button-icons.js +2 -3
- package/es/util/button-icons.js.map +1 -1
- package/es/variables/breakpoints.css +1 -1
- package/lib/atom/button/index.d.ts.map +1 -1
- package/lib/atom/button/index.js +18 -13
- package/lib/atom/button/index.js.map +1 -1
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +4 -3
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +61 -40
- package/lib/molecule/discipline-header/index.d.ts +1 -1
- package/lib/molecule/discipline-header/index.d.ts.map +1 -1
- package/lib/molecule/discipline-header/index.js +8 -8
- package/lib/molecule/discipline-header/index.js.map +1 -1
- package/lib/molecule/discipline-header/style.css +1 -1
- package/lib/molecule/hero/index.d.ts +26 -30
- package/lib/molecule/hero/index.d.ts.map +1 -1
- package/lib/molecule/hero/index.js +14 -15
- package/lib/molecule/hero/index.js.map +1 -1
- package/lib/molecule/hero/style.css +0 -42
- package/lib/molecule/quick-access-card/index.d.ts +0 -1
- package/lib/molecule/quick-access-card/index.d.ts.map +1 -1
- package/lib/molecule/quick-access-card/index.js +20 -76
- package/lib/molecule/quick-access-card/index.js.map +1 -1
- package/lib/molecule/quick-access-card/style.css +17 -28
- package/lib/molecule/quick-access-cards-group/index.d.ts +0 -1
- package/lib/organism/brand-dashboard/index.d.ts +0 -1
- package/lib/template/back-office/brand-update/index.d.ts +0 -1
- package/lib/template/external-course/index.d.ts +69 -21
- package/lib/template/external-course/index.d.ts.map +1 -1
- package/lib/template/external-course/index.js +76 -54
- package/lib/template/external-course/index.js.map +1 -1
- package/lib/template/external-course/style.css +1 -1
- package/lib/util/button-icons.d.ts +0 -1
- package/lib/util/button-icons.d.ts.map +1 -1
- package/lib/util/button-icons.js +1 -2
- package/lib/util/button-icons.js.map +1 -1
- package/lib/variables/breakpoints.css +1 -1
- package/package.json +3 -3
- package/es/molecule/expandable-item/index.d.ts +0 -19
- package/es/molecule/expandable-item/index.d.ts.map +0 -1
- package/es/molecule/expandable-item/index.js +0 -44
- package/es/molecule/expandable-item/index.js.map +0 -1
- package/es/molecule/expandable-item/style.css +0 -135
- package/es/molecule/expandable-item/types.d.ts +0 -20
- package/es/molecule/expandable-item/types.d.ts.map +0 -1
- package/es/molecule/expandable-item/types.js +0 -11
- package/es/molecule/expandable-item/types.js.map +0 -1
- package/es/molecule/expandable-list/index.d.ts +0 -18
- package/es/molecule/expandable-list/index.d.ts.map +0 -1
- package/es/molecule/expandable-list/index.js +0 -22
- package/es/molecule/expandable-list/index.js.map +0 -1
- package/es/molecule/expandable-list/style.css +0 -20
- package/es/molecule/expandable-list/types.d.ts +0 -17
- package/es/molecule/expandable-list/types.d.ts.map +0 -1
- package/es/molecule/expandable-list/types.js +0 -6
- package/es/molecule/expandable-list/types.js.map +0 -1
- package/es/molecule/hero/types.d.ts +0 -22
- package/es/molecule/hero/types.d.ts.map +0 -1
- package/es/molecule/hero/types.js +0 -14
- package/es/molecule/hero/types.js.map +0 -1
- package/es/molecule/menu-links/index.d.ts +0 -22
- package/es/molecule/menu-links/index.d.ts.map +0 -1
- package/es/molecule/menu-links/index.js +0 -70
- package/es/molecule/menu-links/index.js.map +0 -1
- package/es/molecule/menu-links/style.css +0 -161
- package/es/molecule/menu-links/types.d.ts +0 -35
- package/es/molecule/menu-links/types.d.ts.map +0 -1
- package/es/molecule/menu-links/types.js +0 -17
- package/es/molecule/menu-links/types.js.map +0 -1
- package/es/molecule/privacy-policy-contact/index.d.ts +0 -14
- package/es/molecule/privacy-policy-contact/index.d.ts.map +0 -1
- package/es/molecule/privacy-policy-contact/index.js +0 -28
- package/es/molecule/privacy-policy-contact/index.js.map +0 -1
- package/es/molecule/privacy-policy-contact/style.css +0 -38
- package/es/molecule/privacy-policy-contact/types.d.ts +0 -10
- package/es/molecule/privacy-policy-contact/types.d.ts.map +0 -1
- package/es/molecule/privacy-policy-contact/types.js +0 -6
- package/es/molecule/privacy-policy-contact/types.js.map +0 -1
- package/es/molecule/privacy-policy-download/index.d.ts +0 -38
- package/es/molecule/privacy-policy-download/index.d.ts.map +0 -1
- package/es/molecule/privacy-policy-download/index.js +0 -27
- package/es/molecule/privacy-policy-download/index.js.map +0 -1
- package/es/molecule/privacy-policy-download/style.css +0 -65
- package/es/molecule/privacy-policy-download/types.d.ts +0 -50
- package/es/molecule/privacy-policy-download/types.d.ts.map +0 -1
- package/es/molecule/privacy-policy-download/types.js +0 -8
- package/es/molecule/privacy-policy-download/types.js.map +0 -1
- package/es/template/common/faq-article-page/index.d.ts +0 -27
- package/es/template/common/faq-article-page/index.d.ts.map +0 -1
- package/es/template/common/faq-article-page/index.js +0 -50
- package/es/template/common/faq-article-page/index.js.map +0 -1
- package/es/template/common/faq-article-page/style.css +0 -110
- package/es/template/common/faq-article-page/types.d.ts +0 -40
- package/es/template/common/faq-article-page/types.d.ts.map +0 -1
- package/es/template/common/faq-article-page/types.js +0 -20
- package/es/template/common/faq-article-page/types.js.map +0 -1
- package/es/template/common/faq-cards-page/index.d.ts +0 -34
- package/es/template/common/faq-cards-page/index.d.ts.map +0 -1
- package/es/template/common/faq-cards-page/index.js +0 -45
- package/es/template/common/faq-cards-page/index.js.map +0 -1
- package/es/template/common/faq-cards-page/style.css +0 -95
- package/es/template/common/faq-cards-page/types.d.ts +0 -44
- package/es/template/common/faq-cards-page/types.d.ts.map +0 -1
- package/es/template/common/faq-cards-page/types.js +0 -13
- package/es/template/common/faq-cards-page/types.js.map +0 -1
- package/es/template/common/faq-page/index.d.ts +0 -80
- package/es/template/common/faq-page/index.d.ts.map +0 -1
- package/es/template/common/faq-page/index.js +0 -44
- package/es/template/common/faq-page/index.js.map +0 -1
- package/es/template/common/faq-page/style.css +0 -104
- package/es/template/common/faq-page/types.d.ts +0 -86
- package/es/template/common/faq-page/types.d.ts.map +0 -1
- package/es/template/common/faq-page/types.js +0 -13
- package/es/template/common/faq-page/types.js.map +0 -1
- package/es/template/common/privacy-policy-page/index.d.ts +0 -80
- package/es/template/common/privacy-policy-page/index.d.ts.map +0 -1
- package/es/template/common/privacy-policy-page/index.js +0 -50
- package/es/template/common/privacy-policy-page/index.js.map +0 -1
- package/es/template/common/privacy-policy-page/style.css +0 -123
- package/es/template/common/privacy-policy-page/types.d.ts +0 -86
- package/es/template/common/privacy-policy-page/types.d.ts.map +0 -1
- package/es/template/common/privacy-policy-page/types.js +0 -13
- package/es/template/common/privacy-policy-page/types.js.map +0 -1
- package/lib/molecule/expandable-item/index.d.ts +0 -19
- package/lib/molecule/expandable-item/index.d.ts.map +0 -1
- package/lib/molecule/expandable-item/index.js +0 -58
- package/lib/molecule/expandable-item/index.js.map +0 -1
- package/lib/molecule/expandable-item/style.css +0 -135
- package/lib/molecule/expandable-item/types.d.ts +0 -20
- package/lib/molecule/expandable-item/types.d.ts.map +0 -1
- package/lib/molecule/expandable-item/types.js +0 -20
- package/lib/molecule/expandable-item/types.js.map +0 -1
- package/lib/molecule/expandable-list/index.d.ts +0 -18
- package/lib/molecule/expandable-list/index.d.ts.map +0 -1
- package/lib/molecule/expandable-list/index.js +0 -33
- package/lib/molecule/expandable-list/index.js.map +0 -1
- package/lib/molecule/expandable-list/style.css +0 -20
- package/lib/molecule/expandable-list/types.d.ts +0 -17
- package/lib/molecule/expandable-list/types.d.ts.map +0 -1
- package/lib/molecule/expandable-list/types.js +0 -16
- package/lib/molecule/expandable-list/types.js.map +0 -1
- package/lib/molecule/hero/types.d.ts +0 -22
- package/lib/molecule/hero/types.d.ts.map +0 -1
- package/lib/molecule/hero/types.js +0 -25
- package/lib/molecule/hero/types.js.map +0 -1
- package/lib/molecule/menu-links/index.d.ts +0 -22
- package/lib/molecule/menu-links/index.d.ts.map +0 -1
- package/lib/molecule/menu-links/index.js +0 -88
- package/lib/molecule/menu-links/index.js.map +0 -1
- package/lib/molecule/menu-links/style.css +0 -161
- package/lib/molecule/menu-links/types.d.ts +0 -35
- package/lib/molecule/menu-links/types.d.ts.map +0 -1
- package/lib/molecule/menu-links/types.js +0 -26
- package/lib/molecule/menu-links/types.js.map +0 -1
- package/lib/molecule/privacy-policy-contact/index.d.ts +0 -14
- package/lib/molecule/privacy-policy-contact/index.d.ts.map +0 -1
- package/lib/molecule/privacy-policy-contact/index.js +0 -41
- package/lib/molecule/privacy-policy-contact/index.js.map +0 -1
- package/lib/molecule/privacy-policy-contact/style.css +0 -38
- package/lib/molecule/privacy-policy-contact/types.d.ts +0 -10
- package/lib/molecule/privacy-policy-contact/types.d.ts.map +0 -1
- package/lib/molecule/privacy-policy-contact/types.js +0 -15
- package/lib/molecule/privacy-policy-contact/types.js.map +0 -1
- package/lib/molecule/privacy-policy-download/index.d.ts +0 -38
- package/lib/molecule/privacy-policy-download/index.d.ts.map +0 -1
- package/lib/molecule/privacy-policy-download/index.js +0 -38
- package/lib/molecule/privacy-policy-download/index.js.map +0 -1
- package/lib/molecule/privacy-policy-download/style.css +0 -65
- package/lib/molecule/privacy-policy-download/types.d.ts +0 -50
- package/lib/molecule/privacy-policy-download/types.d.ts.map +0 -1
- package/lib/molecule/privacy-policy-download/types.js +0 -18
- package/lib/molecule/privacy-policy-download/types.js.map +0 -1
- package/lib/template/common/faq-article-page/index.d.ts +0 -27
- package/lib/template/common/faq-article-page/index.d.ts.map +0 -1
- package/lib/template/common/faq-article-page/index.js +0 -63
- package/lib/template/common/faq-article-page/index.js.map +0 -1
- package/lib/template/common/faq-article-page/style.css +0 -110
- package/lib/template/common/faq-article-page/types.d.ts +0 -40
- package/lib/template/common/faq-article-page/types.d.ts.map +0 -1
- package/lib/template/common/faq-article-page/types.js +0 -30
- package/lib/template/common/faq-article-page/types.js.map +0 -1
- package/lib/template/common/faq-cards-page/index.d.ts +0 -34
- package/lib/template/common/faq-cards-page/index.d.ts.map +0 -1
- package/lib/template/common/faq-cards-page/index.js +0 -58
- package/lib/template/common/faq-cards-page/index.js.map +0 -1
- package/lib/template/common/faq-cards-page/style.css +0 -95
- package/lib/template/common/faq-cards-page/types.d.ts +0 -44
- package/lib/template/common/faq-cards-page/types.d.ts.map +0 -1
- package/lib/template/common/faq-cards-page/types.js +0 -25
- package/lib/template/common/faq-cards-page/types.js.map +0 -1
- package/lib/template/common/faq-page/index.d.ts +0 -80
- package/lib/template/common/faq-page/index.d.ts.map +0 -1
- package/lib/template/common/faq-page/index.js +0 -58
- package/lib/template/common/faq-page/index.js.map +0 -1
- package/lib/template/common/faq-page/style.css +0 -104
- package/lib/template/common/faq-page/types.d.ts +0 -86
- package/lib/template/common/faq-page/types.d.ts.map +0 -1
- package/lib/template/common/faq-page/types.js +0 -24
- package/lib/template/common/faq-page/types.js.map +0 -1
- package/lib/template/common/privacy-policy-page/index.d.ts +0 -80
- package/lib/template/common/privacy-policy-page/index.d.ts.map +0 -1
- package/lib/template/common/privacy-policy-page/index.js +0 -65
- package/lib/template/common/privacy-policy-page/index.js.map +0 -1
- package/lib/template/common/privacy-policy-page/style.css +0 -123
- package/lib/template/common/privacy-policy-page/types.d.ts +0 -86
- package/lib/template/common/privacy-policy-page/types.d.ts.map +0 -1
- package/lib/template/common/privacy-policy-page/types.js +0 -24
- package/lib/template/common/privacy-policy-page/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button/index.js"],"names":[],"mappings":";AA8IA,iDAgCC"}
|
package/es/atom/button/index.js
CHANGED
|
@@ -48,7 +48,8 @@ const ButtonContent = props => {
|
|
|
48
48
|
target: target,
|
|
49
49
|
className: anchorClassName,
|
|
50
50
|
style: style,
|
|
51
|
-
"aria-label": ariaLabel
|
|
51
|
+
"aria-label": ariaLabel,
|
|
52
|
+
"data-testid": dataTestid
|
|
52
53
|
}, submitValue || children || 'submit');
|
|
53
54
|
|
|
54
55
|
case 'a':
|
|
@@ -58,7 +59,8 @@ const ButtonContent = props => {
|
|
|
58
59
|
target: target,
|
|
59
60
|
className: anchorClassName,
|
|
60
61
|
onClick: anchorOnClick,
|
|
61
|
-
style: style
|
|
62
|
+
style: style,
|
|
63
|
+
"data-testid": dataTestid
|
|
62
64
|
}, submitValue || children);
|
|
63
65
|
|
|
64
66
|
case 'button':
|
|
@@ -82,17 +84,20 @@ const ButtonContent = props => {
|
|
|
82
84
|
// falls through in case type is button BUT no button tag is needed, for retro-compatibility
|
|
83
85
|
|
|
84
86
|
default:
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
{
|
|
88
|
+
return /*#__PURE__*/React.createElement("input", {
|
|
89
|
+
"data-name": dataName,
|
|
90
|
+
type: type,
|
|
91
|
+
value: submitValue,
|
|
92
|
+
disabled: disabled,
|
|
93
|
+
onClick: onClick,
|
|
94
|
+
className: inputClassName,
|
|
95
|
+
"data-testid": dataTestid,
|
|
96
|
+
style: _extends({
|
|
97
|
+
color
|
|
98
|
+
}, style)
|
|
99
|
+
});
|
|
100
|
+
}
|
|
96
101
|
}
|
|
97
102
|
};
|
|
98
103
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","noop","ColorPropType","Link","cssStyle","ButtonContent","props","color","submitValue","disabled","download","href","target","onClick","className","children","type","style","dataName","ariaLabel","dataTestid","useButtonTag","buttonRef","dataFor","dataTooltipPlace","dataTip","onKeyDown","onMouseLeave","onMouseOver","anchorClassName","disabledAnchor","anchorOnClick","anchorHref","inputClassName","buttonDisabled","favorite","propTypes","string","bool","oneOf","node","shape","func","Button","buttonContentClassName","isLinkDisabled","useWrapper","buttonWrapperClassNames","button","contentClassName","buttonContent"],"sources":["../../../src/atom/button/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport noop from 'lodash/fp/noop';\nimport {ColorPropType} from '../../util/proptypes';\nimport Link from '../link';\nimport cssStyle from './style.css';\n\nconst ButtonContent = props => {\n const {\n color,\n submitValue,\n disabled,\n download,\n href,\n target,\n onClick,\n className,\n children,\n type,\n style,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestid,\n useButtonTag,\n buttonRef,\n 'data-for': dataFor,\n 'data-tooltip-place': dataTooltipPlace,\n 'data-tip': dataTip,\n onKeyDown = noop,\n onMouseLeave = noop,\n onMouseOver = noop\n } = props;\n const anchorClassName = (disabled && `${className} ${cssStyle.disabledAnchor}`) || className;\n const anchorOnClick = (disabled && null) || onClick;\n const anchorHref = (disabled && null) || href;\n const inputClassName = (disabled && `${className} ${cssStyle.buttonDisabled}`) || className;\n\n switch (type) {\n case 'link':\n return (\n <Link\n data-name={dataName}\n href={anchorHref}\n download={download}\n onClick={anchorOnClick}\n target={target}\n className={anchorClassName}\n style={style}\n aria-label={ariaLabel}\n >\n {submitValue || children || 'submit'}\n </Link>\n );\n\n case 'a':\n return (\n <a\n data-name={dataName}\n href={anchorHref}\n target={target}\n className={anchorClassName}\n onClick={anchorOnClick}\n style={style}\n >\n {submitValue || children}\n </a>\n );\n\n case 'button':\n if (useButtonTag)\n return (\n <button\n ref={buttonRef}\n type=\"button\"\n data-for={dataFor}\n data-tooltip-place={dataTooltipPlace}\n data-tip={dataTip}\n data-name={dataName}\n data-testid={dataTestid}\n aria-label={ariaLabel.favorite}\n className={className}\n onClick={onClick}\n style={style}\n onKeyDown={onKeyDown}\n onMouseLeave={onMouseLeave}\n onMouseOver={onMouseOver}\n tabIndex={0}\n >\n {children}\n </button>\n );\n // falls through in case type is button BUT no button tag is needed, for retro-compatibility\n default
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","noop","ColorPropType","Link","cssStyle","ButtonContent","props","color","submitValue","disabled","download","href","target","onClick","className","children","type","style","dataName","ariaLabel","dataTestid","useButtonTag","buttonRef","dataFor","dataTooltipPlace","dataTip","onKeyDown","onMouseLeave","onMouseOver","anchorClassName","disabledAnchor","anchorOnClick","anchorHref","inputClassName","buttonDisabled","favorite","propTypes","string","bool","oneOf","node","shape","func","Button","buttonContentClassName","isLinkDisabled","useWrapper","buttonWrapperClassNames","button","contentClassName","buttonContent"],"sources":["../../../src/atom/button/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport noop from 'lodash/fp/noop';\nimport {ColorPropType} from '../../util/proptypes';\nimport Link from '../link';\nimport cssStyle from './style.css';\n\nconst ButtonContent = props => {\n const {\n color,\n submitValue,\n disabled,\n download,\n href,\n target,\n onClick,\n className,\n children,\n type,\n style,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestid,\n useButtonTag,\n buttonRef,\n 'data-for': dataFor,\n 'data-tooltip-place': dataTooltipPlace,\n 'data-tip': dataTip,\n onKeyDown = noop,\n onMouseLeave = noop,\n onMouseOver = noop\n } = props;\n const anchorClassName = (disabled && `${className} ${cssStyle.disabledAnchor}`) || className;\n const anchorOnClick = (disabled && null) || onClick;\n const anchorHref = (disabled && null) || href;\n const inputClassName = (disabled && `${className} ${cssStyle.buttonDisabled}`) || className;\n\n switch (type) {\n case 'link':\n return (\n <Link\n data-name={dataName}\n href={anchorHref}\n download={download}\n onClick={anchorOnClick}\n target={target}\n className={anchorClassName}\n style={style}\n aria-label={ariaLabel}\n data-testid={dataTestid}\n >\n {submitValue || children || 'submit'}\n </Link>\n );\n\n case 'a':\n return (\n <a\n data-name={dataName}\n href={anchorHref}\n target={target}\n className={anchorClassName}\n onClick={anchorOnClick}\n style={style}\n data-testid={dataTestid}\n >\n {submitValue || children}\n </a>\n );\n\n case 'button':\n if (useButtonTag)\n return (\n <button\n ref={buttonRef}\n type=\"button\"\n data-for={dataFor}\n data-tooltip-place={dataTooltipPlace}\n data-tip={dataTip}\n data-name={dataName}\n data-testid={dataTestid}\n aria-label={ariaLabel.favorite}\n className={className}\n onClick={onClick}\n style={style}\n onKeyDown={onKeyDown}\n onMouseLeave={onMouseLeave}\n onMouseOver={onMouseOver}\n tabIndex={0}\n >\n {children}\n </button>\n );\n // falls through in case type is button BUT no button tag is needed, for retro-compatibility\n default: {\n return (\n <input\n data-name={dataName}\n type={type}\n value={submitValue}\n disabled={disabled}\n onClick={onClick}\n className={inputClassName}\n data-testid={dataTestid}\n style={{\n color,\n ...style\n }}\n />\n );\n }\n }\n};\n\nButtonContent.propTypes = {\n color: ColorPropType,\n submitValue: PropTypes.string,\n disabled: PropTypes.bool,\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),\n type: PropTypes.string,\n children: PropTypes.node,\n className: PropTypes.string,\n style: PropTypes.shape({}),\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-testid': PropTypes.string,\n useButtonTag: PropTypes.bool,\n // event handlers\n onClick: PropTypes.func,\n onKeyDown: PropTypes.func,\n onMouseLeave: PropTypes.func,\n onMouseOver: PropTypes.func,\n // for ReactTooltip handling\n buttonRef: PropTypes.shape({}),\n 'data-for': PropTypes.string,\n 'data-tooltip-place': PropTypes.string,\n 'data-tip': PropTypes.bool\n};\n\nconst Button = props => {\n const {\n className,\n buttonContentClassName,\n isLinkDisabled,\n type = 'submit',\n children,\n useWrapper = true\n } = props;\n const buttonWrapperClassNames = useMemo(\n () =>\n (isLinkDisabled && classnames([cssStyle.disabledAnchor, className])) ||\n classnames([cssStyle.button, className]),\n [className, isLinkDisabled]\n );\n\n const contentClassName = useMemo(\n () => (buttonContentClassName ? buttonContentClassName : cssStyle.buttonContent),\n [buttonContentClassName]\n );\n\n return useWrapper ? (\n <div className={buttonWrapperClassNames}>\n <ButtonContent {...props} type={type} className={contentClassName}>\n {children}\n </ButtonContent>\n </div>\n ) : (\n <ButtonContent {...props} type={type} className={contentClassName}>\n {children}\n </ButtonContent>\n );\n};\n\nButton.propTypes = {\n isLinkDisabled: PropTypes.bool,\n useWrapper: PropTypes.bool,\n buttonContentClassName: PropTypes.string,\n ...ButtonContent.propTypes\n};\n\nexport default Button;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;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AOA,MAAMI,gBAAgB,GAAGnD,OAAO,CAC9B,MAAO8C,sBAAsB,GAAGA,sBAAH,GAA4BxC,QAAQ,CAAC8C,aADpC,EAE9B,CAACN,sBAAD,CAF8B,CAAhC;EAKA,OAAOE,UAAU,gBACf;IAAK,SAAS,EAAEC;EAAhB,gBACE,oBAAC,aAAD,eAAmBzC,KAAnB;IAA0B,IAAI,EAAEU,IAAhC;IAAsC,SAAS,EAAEiC;EAAjD,IACGlC,QADH,CADF,CADe,gBAOf,oBAAC,aAAD,eAAmBT,KAAnB;IAA0B,IAAI,EAAEU,IAAhC;IAAsC,SAAS,EAAEiC;EAAjD,IACGlC,QADH,CAPF;AAWD,CAhCD;;AAkCA4B,MAAM,CAACP,SAAP;EACES,cAAc,EAAE9C,SAAS,CAACuC,IAD5B;EAEEQ,UAAU,EAAE/C,SAAS,CAACuC,IAFxB;EAGEM,sBAAsB,EAAE7C,SAAS,CAACsC;AAHpC,GAIKhC,aAAa,CAAC+B,SAJnB;AAOA,eAAeO,MAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AAeA,kDAoLC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie, NovaSolidSpaceMoonRocket as MoonRocket } from '@coorpacademy/nova-icons';
|
|
2
|
+
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie, NovaSolidSpaceMoonRocket as MoonRocket, NovaLineStatusCheckCircle1 as CheckCircle1 } from '@coorpacademy/nova-icons';
|
|
3
3
|
import map from 'lodash/fp/map';
|
|
4
4
|
import Cta from '../../atom/button-link';
|
|
5
5
|
import ButtonLinkIconOnly from '../../atom/button-link-icon-only';
|
|
@@ -26,7 +26,8 @@ const CMPopin = props => {
|
|
|
26
26
|
const logo = {
|
|
27
27
|
AlertDiamond,
|
|
28
28
|
WindowUpload,
|
|
29
|
-
MoonRocket
|
|
29
|
+
MoonRocket,
|
|
30
|
+
CheckCircle1
|
|
30
31
|
};
|
|
31
32
|
const LogoComponent = logo[icon];
|
|
32
33
|
const backgroundImageStyle = backgroundImageUrl ? {
|
|
@@ -135,7 +136,7 @@ const CMPopin = props => {
|
|
|
135
136
|
}
|
|
136
137
|
}) : null), descriptionBtnTxt ? /*#__PURE__*/React.createElement("div", {
|
|
137
138
|
className: style.descriptionBtn
|
|
138
|
-
}, descriptionBtnTxt) : null, renderBtnSwitch(), /*#__PURE__*/React.createElement("div", {
|
|
139
|
+
}, descriptionBtnTxt) : null, renderBtnSwitch(), firstButton || secondButton || thirdButton ? /*#__PURE__*/React.createElement("div", {
|
|
139
140
|
className: style.buttonContainer
|
|
140
141
|
}, firstButton ? /*#__PURE__*/React.createElement("div", {
|
|
141
142
|
className: firstButton.largeButton ? style.largeButton : style.button
|
|
@@ -164,7 +165,7 @@ const CMPopin = props => {
|
|
|
164
165
|
"aria-label": thirdButton['aria-label'],
|
|
165
166
|
type: thirdButton.type,
|
|
166
167
|
customStyle: thirdButton.customStyle
|
|
167
|
-
})) : null)));
|
|
168
|
+
})) : null) : null));
|
|
168
169
|
};
|
|
169
170
|
|
|
170
171
|
CMPopin.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","map","Cta","ButtonLinkIconOnly","InputSwitch","style","propTypes","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","background","popinCookie","popin","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth\n } = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n return null;\n };\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n <div\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderBtnSwitch()}\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n customStyle={secondButton.customStyle}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,EAIEC,wBAAwB,IAAIC,UAJ9B,QAKO,0BALP;AAMA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,SAAtB;;AAEA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,kBARI;IASJC,eATI;IAUJC,WAVI;IAWJC,WAXI;IAYJC,iBAZI;IAaJC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,GAWT,IAxBN,EAyBGnD,WAAW,gBACV;IAAK,SAAS,EAAEA,WAAW,CAAC+C,WAAZ,GAA0B5D,KAAK,CAAC4D,WAAhC,GAA8C5D,KAAK,CAAC6D;EAApE,gBACE,oBAAC,GAAD;IACE,KAAK,EAAEhD,WAAW,CAACiD,KADrB;IAEE,OAAO,EAAEjD,WAAW,CAACkD,aAFvB;IAGE,aAAY,gBAAelD,WAAW,CAACyB,IAAK,EAH9C;IAIE,cAAYzB,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAACyB,IALpB;IAME,WAAW,EAAEzB,WAAW,CAACmD;EAN3B,EADF,CADU,GAWR,IApCN,CAzCF,CALF,CADF;AAwFD,CAjLD;;AAmLA9D,OAAO,CAACD,SAAR,2CAAoBA,SAApB;AAEA,eAAeC,OAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","NovaLineStatusCheckCircle1","CheckCircle1","map","Cta","ButtonLinkIconOnly","InputSwitch","style","propTypes","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","background","popinCookie","popin","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaLineStatusCheckCircle1 as CheckCircle1\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth\n } = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket,\n CheckCircle1\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n return null;\n };\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n <div\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderBtnSwitch()}\n {firstButton || secondButton || thirdButton ? (\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n customStyle={secondButton.customStyle}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,EAIEC,wBAAwB,IAAIC,UAJ9B,EAKEC,0BAA0B,IAAIC,YALhC,QAMO,0BANP;AAOA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,SAAtB;;AAEA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,kBARI;IASJC,eATI;IAUJC,WAVI;IAWJC,WAXI;IAYJC,iBAZI;IAaJC;EAbI,IAcFb,KAdJ;EAgBA,MAAMc,IAAI,GAAG;IACX9B,YADW;IAEXE,YAFW;IAGXI,UAHW;IAIXE;EAJW,CAAb;EAMA,MAAMuB,aAAa,GAAGD,IAAI,CAACP,IAAD,CAA1B;EAEA,MAAMS,oBAAoB,GAAGR,kBAAkB,GAC3C;IACES,eAAe,EAAG,OAAMT,kBAAmB,GAD7C;IAEEU,cAAc,EAAE;EAFlB,CAD2C,GAK3C,IALJ;;EAMA,MAAMC,YAAY,GAAG,MAAM;IACzB,IAAIb,MAAJ,EAAY,oBAAO;MAAK,SAAS,EAAET,KAAK,CAACuB,gBAAtB;MAAwC,GAAG,EA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,IALpB;IAME,WAAW,EAAEzB,WAAW,CAACmD;EAN3B,EADF,CADU,GAWR,IApCN,CADD,GAuCG,IAhFN,CALF,CADF;AA0FD,CApLD;;AAsLA9D,OAAO,CAACD,SAAR,2CAAoBA,SAApB;AAEA,eAAeC,OAAf"}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
|
|
48
48
|
.popin {
|
|
49
49
|
overflow: auto;
|
|
50
|
-
width:
|
|
50
|
+
width: 434px;
|
|
51
51
|
flex-grow: 0;
|
|
52
52
|
margin: 16px;
|
|
53
53
|
padding: 16px 16px 20px 16px;
|
|
@@ -114,12 +114,12 @@
|
|
|
114
114
|
|
|
115
115
|
.button {
|
|
116
116
|
min-width: max-content;
|
|
117
|
-
width:
|
|
117
|
+
width: 161px;
|
|
118
118
|
padding: 8px;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
.largeButton {
|
|
122
|
-
width:
|
|
122
|
+
width: 75%;
|
|
123
123
|
padding: 8px;
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -147,7 +147,11 @@
|
|
|
147
147
|
color: cm_grey_500;
|
|
148
148
|
font-style: normal;
|
|
149
149
|
white-space: pre-line;
|
|
150
|
-
margin
|
|
150
|
+
margin: 0px 32px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.content {
|
|
154
|
+
margin: 20px 32px;
|
|
151
155
|
}
|
|
152
156
|
|
|
153
157
|
.cookieTitleContainer {
|
|
@@ -278,29 +282,21 @@ a {
|
|
|
278
282
|
}
|
|
279
283
|
|
|
280
284
|
@media tablet {
|
|
281
|
-
.popin {
|
|
282
|
-
position: fixed;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
285
|
.popin {
|
|
286
286
|
width: 80%;
|
|
287
|
+
overflow: hidden;
|
|
287
288
|
}
|
|
288
289
|
|
|
289
290
|
.buttonContainer {
|
|
290
291
|
display: flex;
|
|
291
292
|
flex-wrap: wrap-reverse;
|
|
292
|
-
margin:
|
|
293
|
-
width: 85%;
|
|
293
|
+
margin: 12px 24px 32px 24px;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
.button {
|
|
296
|
+
.largeButton, .button , .titleContainer {
|
|
297
297
|
width: 100%;
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
.titleContainer {
|
|
301
|
-
width: 85%;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
300
|
.popinCookie {
|
|
305
301
|
position: fixed;
|
|
306
302
|
bottom: 10px;
|
|
@@ -310,40 +306,66 @@ a {
|
|
|
310
306
|
overflow-x: hidden;
|
|
311
307
|
overflow-y: auto;
|
|
312
308
|
}
|
|
313
|
-
.popinCookie .button{
|
|
309
|
+
.popinCookie .button {
|
|
314
310
|
width: 100%;
|
|
315
311
|
padding: 0px 0px 8px 0px
|
|
316
312
|
}
|
|
317
313
|
|
|
318
314
|
.popinCookie .largeButton {
|
|
319
|
-
padding: 8px 0px 0px 0px
|
|
315
|
+
padding: 8px 0px 0px 0px;
|
|
320
316
|
}
|
|
321
317
|
.popinCookie .message {
|
|
322
318
|
padding: 24px 24px 0px 24px
|
|
323
319
|
}
|
|
320
|
+
.descriptionText {
|
|
321
|
+
margin: 0px 16px;
|
|
322
|
+
}
|
|
323
|
+
.content {
|
|
324
|
+
margin: 20px 16px;
|
|
325
|
+
}
|
|
326
|
+
.message {
|
|
327
|
+
padding: 40px 16px 0px;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
@media mobile {
|
|
332
|
+
.background {
|
|
333
|
+
padding: 0;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.popin {
|
|
337
|
+
width: 80%;
|
|
338
|
+
overflow: hidden;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.buttonContainer {
|
|
342
|
+
display: flex;
|
|
343
|
+
margin: 12px 16px 32px 16px;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.button {
|
|
347
|
+
width: 100%;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.titleContainer {
|
|
351
|
+
width: 100%;
|
|
352
|
+
margin: 0px 16px;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.descriptionText {
|
|
356
|
+
margin: 0px 16px;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.content {
|
|
360
|
+
margin: 16px 32px;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.largeButton {
|
|
364
|
+
margin: 0px 32px;
|
|
365
|
+
}
|
|
324
366
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
position: fixed;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
.popin {
|
|
331
|
-
width: 80%;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.buttonContainer {
|
|
335
|
-
display: flex;
|
|
336
|
-
margin: 48px 24px 32px 24px;
|
|
337
|
-
width: 85%;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.button {
|
|
341
|
-
width: 100%;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.titleContainer {
|
|
345
|
-
width: 85%;
|
|
346
|
-
}
|
|
367
|
+
.message {
|
|
368
|
+
padding: 40px 16px 0px;
|
|
347
369
|
}
|
|
348
370
|
}
|
|
349
371
|
|
|
@@ -355,7 +377,6 @@ button {
|
|
|
355
377
|
}
|
|
356
378
|
|
|
357
379
|
_:-ms-fullscreen,
|
|
358
|
-
.descriptionText,
|
|
359
380
|
.buttonContainer {
|
|
360
381
|
width: 85%;
|
|
361
382
|
}
|
|
@@ -47,7 +47,7 @@ declare class DisciplineHeader extends React.Component<any, any, any> {
|
|
|
47
47
|
constructor(props: any);
|
|
48
48
|
state: {
|
|
49
49
|
fullDisplay: boolean;
|
|
50
|
-
|
|
50
|
+
scrollHeightShowMore: number;
|
|
51
51
|
};
|
|
52
52
|
handleToggleDisplay(): void;
|
|
53
53
|
setHandle(el: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/discipline-header/index.js"],"names":[],"mappings":";AA4BA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAME;IAEF;;MAEE;IAEF,wBAQC;IANC;;;MAGC;IAKH,4BAIC;IAED,yBAEC;IAED,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/discipline-header/index.js"],"names":[],"mappings":";AA4BA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAME;IAEF;;MAEE;IAEF,wBAQC;IANC;;;MAGC;IAKH,4BAIC;IAED,yBAEC;IAED,sBAuDC;CACF"}
|
|
@@ -43,7 +43,7 @@ class DisciplineHeader extends React.Component {
|
|
|
43
43
|
super(props);
|
|
44
44
|
this.state = {
|
|
45
45
|
fullDisplay: false,
|
|
46
|
-
|
|
46
|
+
scrollHeightShowMore: 0
|
|
47
47
|
};
|
|
48
48
|
this.handleToggleDisplay = this.handleToggleDisplay.bind(this);
|
|
49
49
|
this.setHandle = this.setHandle.bind(this);
|
|
@@ -57,7 +57,7 @@ class DisciplineHeader extends React.Component {
|
|
|
57
57
|
|
|
58
58
|
setHandle(el) {
|
|
59
59
|
this.setState({
|
|
60
|
-
|
|
60
|
+
scrollHeightShowMore: getOr(0, 'scrollHeight', el)
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -71,15 +71,15 @@ class DisciplineHeader extends React.Component {
|
|
|
71
71
|
} = this.props;
|
|
72
72
|
const {
|
|
73
73
|
fullDisplay,
|
|
74
|
-
|
|
74
|
+
scrollHeightShowMore
|
|
75
75
|
} = this.state;
|
|
76
76
|
const {
|
|
77
77
|
translate
|
|
78
78
|
} = this.context;
|
|
79
|
-
const maxHeightCourseInfos =
|
|
79
|
+
const maxHeightCourseInfos = 215;
|
|
80
80
|
const hasMediaContent = image || video;
|
|
81
81
|
const toggleLabel = fullDisplay ? translate('See less') : translate('Show more');
|
|
82
|
-
const shortCourseText =
|
|
82
|
+
const shortCourseText = scrollHeightShowMore <= maxHeightCourseInfos;
|
|
83
83
|
const courseSeeMoreButtonStyle = shortCourseText ? style.showMoreHidden : style.showMore;
|
|
84
84
|
return /*#__PURE__*/React.createElement("div", {
|
|
85
85
|
"data-name": "disciplineHeader",
|
|
@@ -92,7 +92,8 @@ class DisciplineHeader extends React.Component {
|
|
|
92
92
|
})) : null, /*#__PURE__*/React.createElement("div", {
|
|
93
93
|
className: style.courseWrapper
|
|
94
94
|
}, /*#__PURE__*/React.createElement("div", {
|
|
95
|
-
className: fullDisplay ? style.courseTextWrapperFull : style.courseTextWrapperShort
|
|
95
|
+
className: fullDisplay ? style.courseTextWrapperFull : style.courseTextWrapperShort,
|
|
96
|
+
ref: this.setHandle
|
|
96
97
|
}, /*#__PURE__*/React.createElement("div", {
|
|
97
98
|
"data-name": "title",
|
|
98
99
|
className: classnames(style.title, style.innerHTML) // eslint-disable-next-line react/no-danger
|
|
@@ -105,8 +106,7 @@ class DisciplineHeader extends React.Component {
|
|
|
105
106
|
,
|
|
106
107
|
dangerouslySetInnerHTML: {
|
|
107
108
|
__html: description
|
|
108
|
-
}
|
|
109
|
-
ref: this.setHandle
|
|
109
|
+
}
|
|
110
110
|
})), /*#__PURE__*/React.createElement("div", {
|
|
111
111
|
className: courseSeeMoreButtonStyle,
|
|
112
112
|
onClick: this.handleToggleDisplay
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","get","getOr","classnames","NovaSolidSynchronizeSynchronize3","SyncIcon","VideoPlayer","Picture","style","Preview","image","video","mimeType","id","jwpOptions","propTypes","src","shape","DisciplineHeader","Component","constructor","props","state","fullDisplay","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","get","getOr","classnames","NovaSolidSynchronizeSynchronize3","SyncIcon","VideoPlayer","Picture","style","Preview","image","video","mimeType","id","jwpOptions","propTypes","src","shape","DisciplineHeader","Component","constructor","props","state","fullDisplay","scrollHeightShowMore","handleToggleDisplay","bind","setHandle","setState","prevState","el","render","title","description","lastUpdated","translate","context","maxHeightCourseInfos","hasMediaContent","toggleLabel","shortCourseText","courseSeeMoreButtonStyle","showMoreHidden","showMore","wrapper","imgWrapper","courseWrapper","courseTextWrapperFull","courseTextWrapperShort","innerHTML","__html","lastUpdatedWrapper","lastUpdatedWrapperShort","syncIcon","lastUpdatedText","contextTypes","func","string"],"sources":["../../../src/molecule/discipline-header/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport classnames from 'classnames';\nimport {NovaSolidSynchronizeSynchronize3 as SyncIcon} from '@coorpacademy/nova-icons';\nimport VideoPlayer from '../video-player';\nimport Picture from '../../atom/picture';\nimport style from './style.css';\n\nconst Preview = ({image, video}) => {\n const mimeType = get('mimeType', video);\n const id = get('id', video);\n const jwpOptions = get('jwpOptions', video);\n if (id) {\n return <VideoPlayer mimeType={mimeType} id={id} width=\"380px\" height=\"250px\" />;\n } else if (jwpOptions) {\n return <VideoPlayer {...video} />;\n } else {\n return <Picture className={style.image} src={image} />;\n }\n};\n\nPreview.propTypes = {\n image: Picture.propTypes.src,\n video: PropTypes.shape(VideoPlayer.propTypes)\n};\n\nclass DisciplineHeader extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n image: Preview.propTypes.image,\n video: Preview.propTypes.video,\n lastUpdated: PropTypes.string\n };\n\n static contextTypes = {\n translate: PropTypes.func\n };\n\n constructor(props) {\n super(props);\n this.state = {\n fullDisplay: false,\n scrollHeightShowMore: 0\n };\n this.handleToggleDisplay = this.handleToggleDisplay.bind(this);\n this.setHandle = this.setHandle.bind(this);\n }\n\n handleToggleDisplay() {\n this.setState(prevState => ({\n fullDisplay: !prevState.fullDisplay\n }));\n }\n\n setHandle(el) {\n this.setState({scrollHeightShowMore: getOr(0, 'scrollHeight', el)});\n }\n\n render() {\n const {image, title, description, video, lastUpdated} = this.props;\n const {fullDisplay, scrollHeightShowMore} = this.state;\n const {translate} = this.context;\n const maxHeightCourseInfos = 215;\n const hasMediaContent = image || video;\n const toggleLabel = fullDisplay ? translate('See less') : translate('Show more');\n const shortCourseText = scrollHeightShowMore <= maxHeightCourseInfos;\n const courseSeeMoreButtonStyle = shortCourseText ? style.showMoreHidden : style.showMore;\n\n return (\n <div data-name=\"disciplineHeader\" className={style.wrapper}>\n {hasMediaContent ? (\n <div className={style.imgWrapper}>\n <Preview image={image} video={video} />\n </div>\n ) : null}\n <div className={style.courseWrapper}>\n <div\n className={fullDisplay ? style.courseTextWrapperFull : style.courseTextWrapperShort}\n ref={this.setHandle}\n >\n <div\n data-name=\"title\"\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <div\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: description}}\n />\n </div>\n <div className={courseSeeMoreButtonStyle} onClick={this.handleToggleDisplay}>\n {toggleLabel}\n </div>\n {lastUpdated ? (\n <div\n className={classnames(\n style.lastUpdatedWrapper,\n shortCourseText ? style.lastUpdatedWrapperShort : null\n )}\n >\n <SyncIcon className={style.syncIcon} />\n <div\n className={classnames(style.lastUpdatedText, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: lastUpdated}}\n />\n </div>\n ) : null}\n </div>\n </div>\n );\n }\n}\n\nexport default DisciplineHeader;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,gCAAgC,IAAIC,QAA5C,QAA2D,0BAA3D;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,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Requireable<import("prop-types").InferProps<{
|
|
8
|
-
common: import("prop-types").Requireable<{
|
|
1
|
+
export default Hero;
|
|
2
|
+
declare function Hero(props: any, context: any): JSX.Element;
|
|
3
|
+
declare namespace Hero {
|
|
4
|
+
namespace contextTypes {
|
|
5
|
+
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
|
+
common: PropTypes.Requireable<{
|
|
9
7
|
[x: string]: any;
|
|
10
8
|
}>;
|
|
11
|
-
images:
|
|
12
|
-
'logo-mobile':
|
|
13
|
-
logo:
|
|
14
|
-
'logo-email':
|
|
15
|
-
login:
|
|
9
|
+
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
|
+
'logo-mobile': PropTypes.Requireable<any>;
|
|
11
|
+
logo: PropTypes.Requireable<any>;
|
|
12
|
+
'logo-email': PropTypes.Requireable<any>;
|
|
13
|
+
login: PropTypes.Requireable<any>;
|
|
16
14
|
}>>;
|
|
17
|
-
icons:
|
|
15
|
+
icons: PropTypes.Requireable<{
|
|
18
16
|
[x: string]: any;
|
|
19
17
|
}>;
|
|
20
|
-
mod:
|
|
18
|
+
mod: PropTypes.Requireable<{
|
|
21
19
|
[x: string]: any;
|
|
22
20
|
}>;
|
|
23
|
-
courses:
|
|
24
|
-
texts:
|
|
21
|
+
courses: PropTypes.Requireable<any[]>;
|
|
22
|
+
texts: PropTypes.Requireable<{
|
|
25
23
|
[x: string]: any;
|
|
26
24
|
}>;
|
|
27
25
|
}>>;
|
|
28
|
-
}
|
|
29
|
-
propTypes
|
|
30
|
-
image:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
export default Hero;
|
|
26
|
+
}
|
|
27
|
+
namespace propTypes {
|
|
28
|
+
const image: PropTypes.Requireable<string>;
|
|
29
|
+
const title: PropTypes.Requireable<string>;
|
|
30
|
+
const author: PropTypes.Requireable<string>;
|
|
31
|
+
const progress: PropTypes.Requireable<number>;
|
|
32
|
+
const onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
|
+
const submitValue: PropTypes.Requireable<string>;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
import PropTypes from "prop-types";
|
|
41
37
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/hero/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/hero/index.js"],"names":[],"mappings":";AASA,6DAgCC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _get from "lodash/fp/get";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import classnames from 'classnames';
|
|
4
5
|
import Provider from '../../atom/provider';
|
|
5
6
|
import Button from '../../atom/button';
|
|
6
7
|
import CardContentInfo, { MODES } from '../card-content';
|
|
7
|
-
import { propTypes } from './types';
|
|
8
8
|
import style from './style.css';
|
|
9
9
|
|
|
10
10
|
const Hero = (props, context) => {
|
|
@@ -17,9 +17,7 @@ const Hero = (props, context) => {
|
|
|
17
17
|
author,
|
|
18
18
|
progress,
|
|
19
19
|
onClick,
|
|
20
|
-
submitValue
|
|
21
|
-
description,
|
|
22
|
-
mode = MODES.HERO
|
|
20
|
+
submitValue
|
|
23
21
|
} = props;
|
|
24
22
|
|
|
25
23
|
const primaryColor = _get('common.primary', skin);
|
|
@@ -37,18 +35,12 @@ const Hero = (props, context) => {
|
|
|
37
35
|
backgroundColor: primaryColor,
|
|
38
36
|
backgroundImage: image ? `url('${image}')` : 'none'
|
|
39
37
|
}
|
|
40
|
-
})),
|
|
38
|
+
})), /*#__PURE__*/React.createElement(CardContentInfo, {
|
|
41
39
|
mode: MODES.HERO,
|
|
42
40
|
author: author,
|
|
43
41
|
progress: progress,
|
|
44
42
|
title: title
|
|
45
|
-
})
|
|
46
|
-
className: style.infoWrapper
|
|
47
|
-
}, /*#__PURE__*/React.createElement("h1", {
|
|
48
|
-
className: style.title
|
|
49
|
-
}, title), /*#__PURE__*/React.createElement("p", {
|
|
50
|
-
className: style.description
|
|
51
|
-
}, description)), mode === MODES.HERO ? /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
52
44
|
className: style.heroButtonWrapper
|
|
53
45
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
54
46
|
type: "link",
|
|
@@ -59,12 +51,19 @@ const Hero = (props, context) => {
|
|
|
59
51
|
style: {
|
|
60
52
|
backgroundColor: primaryColor
|
|
61
53
|
}
|
|
62
|
-
}))
|
|
54
|
+
})));
|
|
63
55
|
};
|
|
64
56
|
|
|
65
57
|
Hero.contextTypes = {
|
|
66
58
|
skin: Provider.childContextTypes.skin
|
|
67
59
|
};
|
|
68
|
-
Hero.propTypes = process.env.NODE_ENV !== "production" ?
|
|
60
|
+
Hero.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
61
|
+
image: PropTypes.string,
|
|
62
|
+
title: CardContentInfo.propTypes.title,
|
|
63
|
+
author: CardContentInfo.propTypes.author,
|
|
64
|
+
progress: CardContentInfo.propTypes.progress,
|
|
65
|
+
onClick: Button.propTypes.onClick,
|
|
66
|
+
submitValue: Button.propTypes.submitValue
|
|
67
|
+
} : {};
|
|
69
68
|
export default Hero;
|
|
70
69
|
//# sourceMappingURL=index.js.map
|