@coorpacademy/components 11.14.12 → 11.14.13-alpha.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/cta/index.d.ts +8 -34
- package/es/atom/cta/index.d.ts.map +1 -1
- package/es/atom/cta/index.js +58 -80
- package/es/atom/cta/index.js.map +1 -1
- package/es/atom/link/index.d.ts +1 -0
- package/es/atom/link/index.d.ts.map +1 -1
- package/es/atom/link/index.js +17 -11
- package/es/atom/link/index.js.map +1 -1
- package/es/atom/slide/index.d.ts +2 -0
- package/es/molecule/news/index.d.ts +2 -0
- package/es/molecule/questions/free-text/index.d.ts.map +1 -1
- package/es/molecule/questions/free-text/index.js +1 -0
- package/es/molecule/questions/free-text/index.js.map +1 -1
- package/es/molecule/questions/qcm/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm/index.js +3 -1
- package/es/molecule/questions/qcm/index.js.map +1 -1
- package/es/molecule/questions/qcm-drag/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm-drag/index.js +4 -1
- package/es/molecule/questions/qcm-drag/index.js.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
- package/es/molecule/questions/qcm-graphic/index.js +5 -1
- package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/es/molecule/questions/question-range/index.js +2 -1
- package/es/molecule/questions/question-range/index.js.map +1 -1
- package/es/molecule/questions/template/index.d.ts.map +1 -1
- package/es/molecule/questions/template/index.js +2 -1
- package/es/molecule/questions/template/index.js.map +1 -1
- package/es/organism/mooc/image-slider/index.d.ts +2 -0
- package/es/organism/mooc-header/index.d.ts +2 -0
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/sidebar/index.d.ts +2 -0
- package/es/organism/sidebar/index.d.ts.map +1 -1
- package/es/template/app-player/player/index.d.ts +2 -0
- package/es/template/app-player/player/slides/index.d.ts +2 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +2 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +1 -0
- package/es/template/app-player/popin-end/summary.d.ts +1 -0
- package/es/template/app-player/popin-header/index.d.ts +1 -0
- package/es/template/app-player/popin-header/index.d.ts.map +1 -1
- package/es/template/teams-dashboard/index.d.ts +2 -0
- package/lib/atom/cta/index.d.ts +8 -34
- package/lib/atom/cta/index.d.ts.map +1 -1
- package/lib/atom/cta/index.js +62 -79
- package/lib/atom/cta/index.js.map +1 -1
- package/lib/atom/link/index.d.ts +1 -0
- package/lib/atom/link/index.d.ts.map +1 -1
- package/lib/atom/link/index.js +17 -11
- package/lib/atom/link/index.js.map +1 -1
- package/lib/atom/slide/index.d.ts +2 -0
- package/lib/molecule/news/index.d.ts +2 -0
- package/lib/molecule/questions/free-text/index.d.ts.map +1 -1
- package/lib/molecule/questions/free-text/index.js +1 -0
- package/lib/molecule/questions/free-text/index.js.map +1 -1
- package/lib/molecule/questions/qcm/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm/index.js +3 -1
- package/lib/molecule/questions/qcm/index.js.map +1 -1
- package/lib/molecule/questions/qcm-drag/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm-drag/index.js +4 -1
- package/lib/molecule/questions/qcm-drag/index.js.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.d.ts.map +1 -1
- package/lib/molecule/questions/qcm-graphic/index.js +5 -1
- package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
- package/lib/molecule/questions/question-range/index.js +2 -1
- package/lib/molecule/questions/question-range/index.js.map +1 -1
- package/lib/molecule/questions/template/index.d.ts.map +1 -1
- package/lib/molecule/questions/template/index.js +2 -1
- package/lib/molecule/questions/template/index.js.map +1 -1
- package/lib/organism/mooc/image-slider/index.d.ts +2 -0
- package/lib/organism/mooc-header/index.d.ts +2 -0
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/sidebar/index.d.ts +2 -0
- package/lib/organism/sidebar/index.d.ts.map +1 -1
- package/lib/template/app-player/player/index.d.ts +2 -0
- package/lib/template/app-player/player/slides/index.d.ts +2 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +2 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +1 -0
- package/lib/template/app-player/popin-end/summary.d.ts +1 -0
- package/lib/template/app-player/popin-header/index.d.ts +1 -0
- package/lib/template/app-player/popin-header/index.d.ts.map +1 -1
- package/lib/template/teams-dashboard/index.d.ts +2 -0
- package/package.json +2 -2
- package/locales/.mtslconfig.json +0 -1
|
@@ -49,6 +49,7 @@ const QCMImage = (props, legacyContext) => {
|
|
|
49
49
|
className: style.imageWrapper,
|
|
50
50
|
"data-name": "answerImage",
|
|
51
51
|
"aria-label": ariaLabel || title,
|
|
52
|
+
title: ariaLabel || title,
|
|
52
53
|
style: {
|
|
53
54
|
backgroundImage: `url(${image})`
|
|
54
55
|
}
|
|
@@ -64,6 +65,8 @@ const QCMImage = (props, legacyContext) => {
|
|
|
64
65
|
id: checkboxId,
|
|
65
66
|
type: "checkbox",
|
|
66
67
|
value: title,
|
|
68
|
+
title: title,
|
|
69
|
+
"aria-label": title,
|
|
67
70
|
checked: selected,
|
|
68
71
|
onChange: onClick,
|
|
69
72
|
className: style.hiddenCheckbox
|
|
@@ -73,7 +76,8 @@ const QCMImage = (props, legacyContext) => {
|
|
|
73
76
|
"data-name": "qcm-graphic-wrapper",
|
|
74
77
|
className: style.wrapper,
|
|
75
78
|
role: "group",
|
|
76
|
-
"aria-label": groupAriaLabel
|
|
79
|
+
"aria-label": groupAriaLabel,
|
|
80
|
+
title: groupAriaLabel
|
|
77
81
|
}, answersViews);
|
|
78
82
|
};
|
|
79
83
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","GetSkinFromContext","getShadowBoxColorFromPrimary","style","QCMImage","props","legacyContext","answers","groupAriaLabel","skin","primarySkinColor","answersViews","map","answer","key","onClick","title","selected","image","ariaLabel","checkboxId","boxShadow","backgroundColor","background","content","imageWrapper","backgroundImage","titleWrapper","innerHTML","hiddenCheckbox","wrapper","contextTypes","childContextTypes","propTypes","arrayOf","shape","string","bool","func"],"sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst QCMImage = (props, legacyContext) => {\n const {answers, groupAriaLabel} = props;\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected, image, ariaLabel} = answer;\n const checkboxId = `checkbox-graphic-${key}`;\n\n return (\n <div\n onClick={onClick}\n data-selected={selected}\n data-name=\"answerGraphic\"\n style={{\n ...(selected && {\n boxShadow: `0 4px 16px ${getShadowBoxColorFromPrimary(primarySkinColor)}`\n })\n }}\n className={selected ? style.selected : style.answer}\n key={key}\n >\n <div\n data-name=\"answerBackground\"\n style={{\n backgroundColor: selected ? primarySkinColor : '#F4F4F5'\n }}\n className={style.background}\n />\n <div data-name=\"answerContent\" className={style.content}>\n <div\n className={style.imageWrapper}\n data-name=\"answerImage\"\n aria-label={ariaLabel || title}\n style={{\n backgroundImage: `url(${image})`\n }}\n />\n <div data-name=\"answerText\" className={style.titleWrapper}>\n <div title={title} className={classnames(style.title, style.innerHTML)}>\n <label htmlFor={checkboxId}>\n <input\n id={checkboxId}\n type=\"checkbox\"\n value={title}\n checked={selected}\n onChange={onClick}\n className={style.hiddenCheckbox}\n />\n {title}\n </label>\n </div>\n </div>\n </div>\n </div>\n );\n });\n\n return (\n <div\n data-name=\"qcm-graphic-wrapper\"\n className={style.wrapper}\n role=\"group\"\n aria-label={groupAriaLabel}\n >\n {answersViews}\n </div>\n );\n};\n\nQCMImage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQCMImage.propTypes = {\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n selected: PropTypes.bool,\n onClick: PropTypes.func,\n image: PropTypes.string,\n ariaLabel: PropTypes.string\n })\n ),\n groupAriaLabel: PropTypes.string\n};\n\nexport default QCMImage;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,wBAA3C;AACA,SAAQC,4BAAR,QAA2C,iDAA3C;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACzC,MAAM;IAACC,OAAD;IAAUC;EAAV,IAA4BH,KAAlC;EACA,MAAMI,IAAI,GAAGR,kBAAkB,CAACK,aAAD,CAA/B;;EACA,MAAMI,gBAAgB,GAAG,OAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAAzB;;EAEA,MAAME,YAAY,GAAGJ,OAAO,CAACK,GAAR,CAAY,CAACC,MAAD,EAASC,GAAT,KAAiB;IAChD,MAAM;MAACC,OAAD;MAAUC,KAAV;MAAiBC,QAAjB;MAA2BC,KAA3B;MAAkCC;IAAlC,IAA+CN,MAArD;IACA,MAAMO,UAAU,GAAI,oBAAmBN,GAAI,EAA3C;IAEA,oBACE;MACE,OAAO,EAAEC,OADX;MAEE,iBAAeE,QAFjB;MAGE,aAAU,eAHZ;MAIE,KAAK,eACCA,QAAQ,IAAI;QACdI,SAAS,EAAG,cAAanB,4BAA4B,CAACQ,gBAAD,CAAmB;MAD1D,CADb,CAJP;MASE,SAAS,EAAEO,QAAQ,GAAGd,KAAK,CAACc,QAAT,GAAoBd,KAAK,CAACU,MAT/C;MAUE,GAAG,EAAEC;IAVP,gBAYE;MACE,aAAU,kBADZ;MAEE,KAAK,EAAE;QACLQ,eAAe,EAAEL,QAAQ,GAAGP,gBAAH,GAAsB;MAD1C,CAFT;MAKE,SAAS,EAAEP,KAAK,CAACoB;IALnB,EAZF,eAmBE;MAAK,aAAU,eAAf;MAA+B,SAAS,EAAEpB,KAAK,CAACqB;IAAhD,gBACE;MACE,SAAS,EAAErB,KAAK,CAACsB,YADnB;MAEE,aAAU,aAFZ;MAGE,cAAYN,SAAS,IAAIH,KAH3B;MAIE,KAAK,EAAE;QACLU,eAAe,EAAG,OAAMR,KAAM;MADzB;
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","GetSkinFromContext","getShadowBoxColorFromPrimary","style","QCMImage","props","legacyContext","answers","groupAriaLabel","skin","primarySkinColor","answersViews","map","answer","key","onClick","title","selected","image","ariaLabel","checkboxId","boxShadow","backgroundColor","background","content","imageWrapper","backgroundImage","titleWrapper","innerHTML","hiddenCheckbox","wrapper","contextTypes","childContextTypes","propTypes","arrayOf","shape","string","bool","func"],"sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst QCMImage = (props, legacyContext) => {\n const {answers, groupAriaLabel} = props;\n const skin = GetSkinFromContext(legacyContext);\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected, image, ariaLabel} = answer;\n const checkboxId = `checkbox-graphic-${key}`;\n\n return (\n <div\n onClick={onClick}\n data-selected={selected}\n data-name=\"answerGraphic\"\n style={{\n ...(selected && {\n boxShadow: `0 4px 16px ${getShadowBoxColorFromPrimary(primarySkinColor)}`\n })\n }}\n className={selected ? style.selected : style.answer}\n key={key}\n >\n <div\n data-name=\"answerBackground\"\n style={{\n backgroundColor: selected ? primarySkinColor : '#F4F4F5'\n }}\n className={style.background}\n />\n <div data-name=\"answerContent\" className={style.content}>\n <div\n className={style.imageWrapper}\n data-name=\"answerImage\"\n aria-label={ariaLabel || title}\n title={ariaLabel || title}\n style={{\n backgroundImage: `url(${image})`\n }}\n />\n <div data-name=\"answerText\" className={style.titleWrapper}>\n <div title={title} className={classnames(style.title, style.innerHTML)}>\n <label htmlFor={checkboxId}>\n <input\n id={checkboxId}\n type=\"checkbox\"\n value={title}\n title={title}\n aria-label={title}\n checked={selected}\n onChange={onClick}\n className={style.hiddenCheckbox}\n />\n {title}\n </label>\n </div>\n </div>\n </div>\n </div>\n );\n });\n\n return (\n <div\n data-name=\"qcm-graphic-wrapper\"\n className={style.wrapper}\n role=\"group\"\n aria-label={groupAriaLabel}\n title={groupAriaLabel}\n >\n {answersViews}\n </div>\n );\n};\n\nQCMImage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQCMImage.propTypes = {\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n selected: PropTypes.bool,\n onClick: PropTypes.func,\n image: PropTypes.string,\n ariaLabel: PropTypes.string\n })\n ),\n groupAriaLabel: PropTypes.string\n};\n\nexport default QCMImage;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,wBAA3C;AACA,SAAQC,4BAAR,QAA2C,iDAA3C;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACzC,MAAM;IAACC,OAAD;IAAUC;EAAV,IA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KAAK,CAACyB,SAApB;IAAxC,gBACE;MAAO,OAAO,EAAER;IAAhB,gBACE;MACE,EAAE,EAAEA,UADN;MAEE,IAAI,EAAC,UAFP;MAGE,KAAK,EAAEJ,KAHT;MAIE,KAAK,EAAEA,KAJT;MAKE,cAAYA,KALd;MAME,OAAO,EAAEC,QANX;MAOE,QAAQ,EAAEF,OAPZ;MAQE,SAAS,EAAEZ,KAAK,CAAC0B;IARnB,EADF,EAWGb,KAXH,CADF,CADF,CAVF,CAnBF,CADF;EAkDD,CAtDoB,CAArB;EAwDA,oBACE;IACE,aAAU,qBADZ;IAEE,SAAS,EAAEb,KAAK,CAAC2B,OAFnB;IAGE,IAAI,EAAC,OAHP;IAIE,cAAYtB,cAJd;IAKE,KAAK,EAAEA;EALT,GAOGG,YAPH,CADF;AAWD,CAxED;;AA0EAP,QAAQ,CAAC2B,YAAT,GAAwB;EACtBtB,IAAI,EAAET,QAAQ,CAACgC,iBAAT,CAA2BvB;AADX,CAAxB;AAIAL,QAAQ,CAAC6B,SAAT,2CAAqB;EACnB1B,OAAO,EAAET,SAAS,CAACoC,OAAV,CACPpC,SAAS,CAACqC,KAAV,CAAgB;IACdnB,KAAK,EAAElB,SAAS,CAACsC,MADH;IAEdnB,QAAQ,EAAEnB,SAAS,CAACuC,IAFN;IAGdtB,OAAO,EAAEjB,SAAS,CAACwC,IAHL;IAIdpB,KAAK,EAAEpB,SAAS,CAACsC,MAJH;IAKdjB,SAAS,EAAErB,SAAS,CAACsC;EALP,CAAhB,CADO,CADU;EAUnB5B,cAAc,EAAEV,SAAS,CAACsC;AAVP,CAArB;AAaA,eAAehC,QAAf"}
|
|
@@ -31,7 +31,8 @@ const QuestionRange = (props, legacyContext) => {
|
|
|
31
31
|
return /*#__PURE__*/React.createElement("div", {
|
|
32
32
|
className: style.wrapper,
|
|
33
33
|
role: "group",
|
|
34
|
-
"aria-label": groupAriaLabel
|
|
34
|
+
"aria-label": groupAriaLabel,
|
|
35
|
+
title: groupAriaLabel
|
|
35
36
|
}, /*#__PURE__*/React.createElement("span", {
|
|
36
37
|
style: titleStyle,
|
|
37
38
|
className: classnames(style.title, style.innerHTML) // eslint-disable-next-line react/no-danger
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","GetSkinFromContext","Range","style","QuestionRange","props","legacyContext","title","minLabel","maxLabel","groupAriaLabel","rangeProps","skin","defaultColor","titleStyle","color","wrapper","innerHTML","__html","labelWrapper","label","contextTypes","childContextTypes","propTypes","string"],"sources":["../../../../src/molecule/questions/question-range/index.js"],"sourcesContent":["import React from 'react';\nimport {getOr} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport Range from '../../../atom/range';\nimport style from './style.css';\n\nconst QuestionRange = (props, legacyContext) => {\n const {title, minLabel, maxLabel, groupAriaLabel, ...rangeProps} = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const titleStyle = {\n color: defaultColor\n };\n\n return (\n <div className={style.wrapper} role=\"group\" aria-label={groupAriaLabel}>\n <span\n style={titleStyle}\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <Range {...rangeProps} />\n <div className={style.labelWrapper}>\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: minLabel}}\n />\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: maxLabel}}\n />\n </div>\n </div>\n );\n};\n\nQuestionRange.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQuestionRange.propTypes = {\n ...Range.propTypes,\n title: PropTypes.string,\n minLabel: PropTypes.string,\n maxLabel: PropTypes.string,\n groupAriaLabel: PropTypes.string\n};\n\nexport default QuestionRange;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,wBAA3C;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,aAAa,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EAC9C,MAAM;IAACC,KAAD;IAAQC,QAAR;IAAkBC,QAAlB;IAA4BC;EAA5B,IAA6DL,KAAnE;EAAA,MAAqDM,UAArD,iCAAmEN,KAAnE;;EAEA,MAAMO,IAAI,GAAGX,kBAAkB,CAACK,aAAD,CAA/B;;EACA,MAAMO,YAAY,GAAG,OAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAArB;;EAEA,MAAME,UAAU,GAAG;IACjBC,KAAK,EAAEF;EADU,CAAnB;EAIA,oBACE;IAAK,SAAS,EAAEV,KAAK,CAACa,OAAtB;IAA+B,IAAI,EAAC,OAApC;IAA4C,cAAYN;
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Provider","GetSkinFromContext","Range","style","QuestionRange","props","legacyContext","title","minLabel","maxLabel","groupAriaLabel","rangeProps","skin","defaultColor","titleStyle","color","wrapper","innerHTML","__html","labelWrapper","label","contextTypes","childContextTypes","propTypes","string"],"sources":["../../../../src/molecule/questions/question-range/index.js"],"sourcesContent":["import React from 'react';\nimport {getOr} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Provider, {GetSkinFromContext} from '../../../atom/provider';\nimport Range from '../../../atom/range';\nimport style from './style.css';\n\nconst QuestionRange = (props, legacyContext) => {\n const {title, minLabel, maxLabel, groupAriaLabel, ...rangeProps} = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n\n const titleStyle = {\n color: defaultColor\n };\n\n return (\n <div className={style.wrapper} role=\"group\" aria-label={groupAriaLabel} title={groupAriaLabel}>\n <span\n style={titleStyle}\n className={classnames(style.title, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <Range {...rangeProps} />\n <div className={style.labelWrapper}>\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: minLabel}}\n />\n <span\n className={classnames(style.label, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: maxLabel}}\n />\n </div>\n </div>\n );\n};\n\nQuestionRange.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQuestionRange.propTypes = {\n ...Range.propTypes,\n title: PropTypes.string,\n minLabel: PropTypes.string,\n maxLabel: PropTypes.string,\n groupAriaLabel: PropTypes.string\n};\n\nexport default QuestionRange;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,wBAA3C;AACA,OAAOC,KAAP,MAAkB,qBAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,aAAa,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EAC9C,MAAM;IAACC,KAAD;IAAQC,QAAR;IAAkBC,QAAlB;IAA4BC;EAA5B,IAA6DL,KAAnE;EAAA,MAAqDM,UAArD,iCAAmEN,KAAnE;;EAEA,MAAMO,IAAI,GAAGX,kBAAkB,CAACK,aAAD,CAA/B;;EACA,MAAMO,YAAY,GAAG,OAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAArB;;EAEA,MAAME,UAAU,GAAG;IACjBC,KAAK,EAAEF;EADU,CAAnB;EAIA,oBACE;IAAK,SAAS,EAAEV,KAAK,CAACa,OAAtB;IAA+B,IAAI,EAAC,OAApC;IAA4C,cAAYN,cAAxD;IAAwE,KAAK,EAAEA;EAA/E,gBACE;IACE,KAAK,EAAEI,UADT;IAEE,SAAS,EAAEf,UAAU,CAACI,KAAK,CAACI,KAAP,EAAcJ,KAAK,CAACc,SAApB,CAFvB,CAGE;IAHF;IAIE,uBAAuB,EAAE;MAACC,MAAM,EAAEX;IAAT;EAJ3B,EADF,eAOE,oBAAC,KAAD,EAAWI,UAAX,CAPF,eAQE;IAAK,SAAS,EAAER,KAAK,CAACgB;EAAtB,gBACE;IACE,SAAS,EAAEpB,UAAU,CAACI,KAAK,CAACiB,KAAP,EAAcjB,KAAK,CAACc,SAApB,CADvB,CAEE;IAFF;IAGE,uBAAuB,EAAE;MAACC,MAAM,EAAEV;IAAT;EAH3B,EADF,eAME;IACE,SAAS,EAAET,UAAU,CAACI,KAAK,CAACiB,KAAP,EAAcjB,KAAK,CAACc,SAApB,CADvB,CAEE;IAFF;IAGE,uBAAuB,EAAE;MAACC,MAAM,EAAET;IAAT;EAH3B,EANF,CARF,CADF;AAuBD,CAjCD;;AAmCAL,aAAa,CAACiB,YAAd,GAA6B;EAC3BT,IAAI,EAAEZ,QAAQ,CAACsB,iBAAT,CAA2BV;AADN,CAA7B;AAIAR,aAAa,CAACmB,SAAd,wDACKrB,KAAK,CAACqB,SADX;EAEEhB,KAAK,EAAET,SAAS,CAAC0B,MAFnB;EAGEhB,QAAQ,EAAEV,SAAS,CAAC0B,MAHtB;EAIEf,QAAQ,EAAEX,SAAS,CAAC0B,MAJtB;EAKEd,cAAc,EAAEZ,SAAS,CAAC0B;AAL5B;AAQA,eAAepB,aAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/template/index.js"],"names":[],"mappings":";AAQA;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/questions/template/index.js"],"names":[],"mappings":";AAQA;;;;gBA4CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","parseTemplateString","DropDown","FreeText","style","Template","template","answers","groupAriaLabel","totalTemplate","templateCompose","convert","cap","part","key","type","textPart","__html","value","field","name","fieldType","fieldProps","fieldView","text","answerType","wrapper","TextPropTypes","propTypes","string","arrayOf","oneOfType","shape"],"sources":["../../../../src/molecule/questions/template/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, find} from 'lodash/fp';\nimport parseTemplateString from '../../../util/parse-template-string';\nimport DropDown from '../drop-down';\nimport FreeText from '../free-text';\nimport style from './style.css';\n\nconst Template = ({template, answers, groupAriaLabel}) => {\n const totalTemplate = parseTemplateString(template);\n const templateCompose = map.convert({cap: false})((part, key) => {\n const type = part.type;\n if (type === 'string') {\n return (\n <span\n key={key}\n className={style.textPart}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: part.value}}\n />\n );\n }\n if (type === 'answerField') {\n const field = find({name: part.value}, answers);\n if (!field) return null;\n const {type: fieldType, ...fieldProps} = field;\n const fieldView =\n fieldType === 'text' ? (\n <FreeText {...fieldProps} className={style.text} />\n ) : (\n <DropDown {...fieldProps} theme=\"player\" />\n );\n\n return (\n <div className={style.answerType} key={part.value}>\n {fieldView}\n </div>\n );\n }\n }, totalTemplate);\n\n return (\n <div\n data-name=\"template-wrapper\"\n className={style.wrapper}\n role=\"group\"\n aria-label={groupAriaLabel}\n >\n {templateCompose}\n </div>\n );\n};\n\nconst TextPropTypes = {\n ...DropDown.propTypes,\n type: PropTypes.string\n};\n\nTemplate.propTypes = {\n template: PropTypes.string,\n answers: PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.shape(DropDown.propTypes), PropTypes.shape(TextPropTypes)])\n ),\n groupAriaLabel: PropTypes.string\n};\n\nexport default Template;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,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EACF,CA7BuB,EA6BrBd,aA7BqB,CAAxB;;EA+BA,oBACE;IACE,aAAU,kBADZ;IAEE,SAAS,EAAEL,KAAK,CAACsB,OAFnB;IAGE,IAAI,EAAC,OAHP;IAIE,cAAYlB;
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","parseTemplateString","DropDown","FreeText","style","Template","template","answers","groupAriaLabel","totalTemplate","templateCompose","convert","cap","part","key","type","textPart","__html","value","field","name","fieldType","fieldProps","fieldView","text","answerType","wrapper","TextPropTypes","propTypes","string","arrayOf","oneOfType","shape"],"sources":["../../../../src/molecule/questions/template/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, find} from 'lodash/fp';\nimport parseTemplateString from '../../../util/parse-template-string';\nimport DropDown from '../drop-down';\nimport FreeText from '../free-text';\nimport style from './style.css';\n\nconst Template = ({template, answers, groupAriaLabel}) => {\n const totalTemplate = parseTemplateString(template);\n const templateCompose = map.convert({cap: false})((part, key) => {\n const type = part.type;\n if (type === 'string') {\n return (\n <span\n key={key}\n className={style.textPart}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: part.value}}\n />\n );\n }\n if (type === 'answerField') {\n const field = find({name: part.value}, answers);\n if (!field) return null;\n const {type: fieldType, ...fieldProps} = field;\n const fieldView =\n fieldType === 'text' ? (\n <FreeText {...fieldProps} className={style.text} />\n ) : (\n <DropDown {...fieldProps} theme=\"player\" />\n );\n\n return (\n <div className={style.answerType} key={part.value}>\n {fieldView}\n </div>\n );\n }\n }, totalTemplate);\n\n return (\n <div\n data-name=\"template-wrapper\"\n className={style.wrapper}\n role=\"group\"\n aria-label={groupAriaLabel}\n title={groupAriaLabel}\n >\n {templateCompose}\n </div>\n );\n};\n\nconst TextPropTypes = {\n ...DropDown.propTypes,\n type: PropTypes.string\n};\n\nTemplate.propTypes = {\n template: PropTypes.string,\n answers: PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.shape(DropDown.propTypes), PropTyp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hC,GAJJ;MAOA,oBACE;QAAK,SAAS,EAAElB,KAAK,CAACqB,UAAtB;QAAkC,GAAG,EAAEZ,IAAI,CAACK;MAA5C,GACGK,SADH,CADF;IAKD;EACF,CA7BuB,EA6BrBd,aA7BqB,CAAxB;;EA+BA,oBACE;IACE,aAAU,kBADZ;IAEE,SAAS,EAAEL,KAAK,CAACsB,OAFnB;IAGE,IAAI,EAAC,OAHP;IAIE,cAAYlB,cAJd;IAKE,KAAK,EAAEA;EALT,GAOGE,eAPH,CADF;AAWD,CA5CD;;AA8CA,MAAMiB,aAAN,wDACKzB,QAAQ,CAAC0B,SADd;EAEEb,IAAI,EAAEf,SAAS,CAAC6B;AAFlB;AAKAxB,QAAQ,CAACuB,SAAT,2CAAqB;EACnBtB,QAAQ,EAAEN,SAAS,CAAC6B,MADD;EAEnBtB,OAAO,EAAEP,SAAS,CAAC8B,OAAV,CACP9B,SAAS,CAAC+B,SAAV,CAAoB,CAAC/B,SAAS,CAACgC,KAAV,CAAgB9B,QAAQ,CAAC0B,SAAzB,CAAD,EAAsC5B,SAAS,CAACgC,KAAV,CAAgBL,aAAhB,CAAtC,CAApB,CADO,CAFU;EAKnBnB,cAAc,EAAER,SAAS,CAAC6B;AALP,CAArB;AAQA,eAAexB,QAAf"}
|
|
@@ -10,6 +10,7 @@ declare namespace ImageSlider {
|
|
|
10
10
|
subtitle: PropTypes.Requireable<string>;
|
|
11
11
|
light: PropTypes.Requireable<boolean>;
|
|
12
12
|
cta: PropTypes.Requireable<PropTypes.InferProps<{
|
|
13
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
13
14
|
submitValue: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
14
15
|
href: PropTypes.Requireable<string>;
|
|
15
16
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -24,6 +25,7 @@ declare namespace ImageSlider {
|
|
|
24
25
|
rectangular: PropTypes.Requireable<boolean>;
|
|
25
26
|
fullWidth: PropTypes.Requireable<boolean>;
|
|
26
27
|
certificationButton: PropTypes.Requireable<boolean>;
|
|
28
|
+
useButtonTag: PropTypes.Requireable<boolean>;
|
|
27
29
|
}>>;
|
|
28
30
|
alignment: PropTypes.Requireable<string>;
|
|
29
31
|
}> | null | undefined)[]>;
|
|
@@ -42,6 +42,7 @@ declare class MoocHeader extends React.Component<any, any, any> {
|
|
|
42
42
|
}> | null | undefined)[]>;
|
|
43
43
|
}>>;
|
|
44
44
|
links: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
45
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
45
46
|
submitValue: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
46
47
|
href: PropTypes.Requireable<string>;
|
|
47
48
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -56,6 +57,7 @@ declare class MoocHeader extends React.Component<any, any, any> {
|
|
|
56
57
|
rectangular: PropTypes.Requireable<boolean>;
|
|
57
58
|
fullWidth: PropTypes.Requireable<boolean>;
|
|
58
59
|
certificationButton: PropTypes.Requireable<boolean>;
|
|
60
|
+
useButtonTag: PropTypes.Requireable<boolean>;
|
|
59
61
|
}> | null | undefined)[]>;
|
|
60
62
|
user: PropTypes.Requireable<PropTypes.InferProps<{
|
|
61
63
|
picture: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-header/index.js"],"names":[],"mappings":";AAyBA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-header/index.js"],"names":[],"mappings":";AAyBA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6FE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAwBC;IAtBC;;;;;;MAMC;IAgDH,6BAIC;IAED,yBAGC;IAxBD,qCAQC;IAED,wBAGC;IAjBD,+BAEC;IA4BD,2BAKC;IAED,0BAKC;IAED,sBAIC;IAED,qBAIC;IAED,yBAQC;IAED,0BAQC;IAED,0BAIC;IAED,2BAIC;IAED,iCAUC;IA7GD,2EASC;IAGC,kBAAsB;IAmGxB,6BAIE;IAEF,6BAIE;IAEF,6BAucC;CACF"}
|
|
@@ -141,6 +141,7 @@ export namespace ButtonItem {
|
|
|
141
141
|
const onClick_1: PropTypes.Requireable<(...args: any[]) => any>;
|
|
142
142
|
export { onClick_1 as onClick };
|
|
143
143
|
export const cta: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
144
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
144
145
|
submitValue: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
145
146
|
href: PropTypes.Requireable<string>;
|
|
146
147
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -155,6 +156,7 @@ export namespace ButtonItem {
|
|
|
155
156
|
rectangular: PropTypes.Requireable<boolean>;
|
|
156
157
|
fullWidth: PropTypes.Requireable<boolean>;
|
|
157
158
|
certificationButton: PropTypes.Requireable<boolean>;
|
|
159
|
+
useButtonTag: PropTypes.Requireable<boolean>;
|
|
158
160
|
}> | null | undefined>>;
|
|
159
161
|
const uppercase_4: PropTypes.Requireable<boolean>;
|
|
160
162
|
export { uppercase_4 as uppercase };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/sidebar/index.js"],"names":[],"mappings":"AAeO,uDA0BN;;;;;;;;;;;;;AAaM;;;;;;;gBAON;;;;;;;;;;;;;;;;;;;;;AAiBM;;;;;;;gBAON;;;;;AAIM;;;;;;;;;;;;;gBAwDN;;;;;;;;;;;;;;;;;;;;AAeM;;;;;;gBAyBN;;;;;AAIM;;;;;gBAMN;;;;;;;;;;;;;;AASM;;;;;;;;;;gBA6CN
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/sidebar/index.js"],"names":[],"mappings":"AAeO,uDA0BN;;;;;;;;;;;;;AAaM;;;;;;;gBAON;;;;;;;;;;;;;;;;;;;;;AAiBM;;;;;;;gBAON;;;;;AAIM;;;;;;;;;;;;;gBAwDN;;;;;;;;;;;;;;;;;;;;AAeM;;;;;;gBAyBN;;;;;AAIM;;;;;gBAMN;;;;;;;;;;;;;;AASM;;;;;;;;;;gBA6CN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcM;;;;;;;;;gBAuBN;;;;;;;;;;;;;;;;;;;;;;;;AAkED;;8BAaC"}
|
|
@@ -4,6 +4,7 @@ declare namespace SlidePlayer {
|
|
|
4
4
|
namespace propTypes {
|
|
5
5
|
const player: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
6
|
cta: PropTypes.Requireable<PropTypes.InferProps<{
|
|
7
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
7
8
|
submitValue: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
8
9
|
href: PropTypes.Requireable<string>;
|
|
9
10
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -18,6 +19,7 @@ declare namespace SlidePlayer {
|
|
|
18
19
|
rectangular: PropTypes.Requireable<boolean>;
|
|
19
20
|
fullWidth: PropTypes.Requireable<boolean>;
|
|
20
21
|
certificationButton: PropTypes.Requireable<boolean>;
|
|
22
|
+
useButtonTag: PropTypes.Requireable<boolean>;
|
|
21
23
|
}>>;
|
|
22
24
|
step: PropTypes.Requireable<PropTypes.InferProps<{
|
|
23
25
|
current: PropTypes.Validator<number>;
|
|
@@ -128,6 +128,7 @@ declare function ValidateButton({ cta }: {
|
|
|
128
128
|
declare namespace ValidateButton {
|
|
129
129
|
export namespace propTypes_1 {
|
|
130
130
|
const cta_1: PropTypes.Requireable<PropTypes.InferProps<{
|
|
131
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
131
132
|
submitValue: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
132
133
|
href: PropTypes.Requireable<string>;
|
|
133
134
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -142,6 +143,7 @@ declare namespace ValidateButton {
|
|
|
142
143
|
rectangular: PropTypes.Requireable<boolean>;
|
|
143
144
|
fullWidth: PropTypes.Requireable<boolean>;
|
|
144
145
|
certificationButton: PropTypes.Requireable<boolean>;
|
|
146
|
+
useButtonTag: PropTypes.Requireable<boolean>;
|
|
145
147
|
}>>;
|
|
146
148
|
export { cta_1 as cta };
|
|
147
149
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/template/app-player/player/slides/index.js"],"names":[],"mappings":";AAgZA,qEAkBC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA1HD;;uBAUC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/template/app-player/player/slides/index.js"],"names":[],"mappings":";AAgZA,qEAkBC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA1HD;;uBAUC;;;;;;;;;;;;;;;;;;;;;;;;;AAnOD;;;gBAaC;;;;;;;;;;;;;AAyDD;;;gBAAoF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAhHpF,oEAQC;;;;;;;;;AA6MD;;gBAiBC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA/GD,qEAaC"}
|
|
@@ -36,6 +36,7 @@ declare class PopinCorrection extends React.Component<any, any, any> {
|
|
|
36
36
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
37
37
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
38
38
|
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
39
|
+
useButtonTag: PropTypes.Requireable<boolean>;
|
|
39
40
|
style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
40
41
|
}>>;
|
|
41
42
|
type: PropTypes.Validator<string>;
|
|
@@ -83,6 +84,7 @@ declare class PopinCorrection extends React.Component<any, any, any> {
|
|
|
83
84
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
84
85
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
85
86
|
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
87
|
+
useButtonTag: PropTypes.Requireable<boolean>;
|
|
86
88
|
style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
87
89
|
}>>;
|
|
88
90
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/app-player/popin-correction/index.js"],"names":[],"mappings":";AAmGA;IACE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/app-player/popin-correction/index.js"],"names":[],"mappings":";AAmGA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmBE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBAIC;IAFC;;MAA0B;IAkB5B,gCAEC;IAhBD,0BAEC;IAED,kBAQC;IALC,gCAIE;IAIF,aAAsB;IAGxB,sBAsEC;CACF"}
|
|
@@ -36,6 +36,7 @@ declare namespace PopinEnd {
|
|
|
36
36
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
37
37
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
38
38
|
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
39
|
+
useButtonTag: PropTypes.Requireable<boolean>;
|
|
39
40
|
style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
40
41
|
}>>;
|
|
41
42
|
type: PropTypes.Validator<string>;
|
|
@@ -42,6 +42,7 @@ declare namespace Summary {
|
|
|
42
42
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
43
43
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
44
44
|
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
|
+
useButtonTag: PropTypes.Requireable<boolean>;
|
|
45
46
|
style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
46
47
|
}>>;
|
|
47
48
|
type: PropTypes.Validator<string>;
|
|
@@ -72,6 +72,7 @@ declare namespace NextQuestionPart {
|
|
|
72
72
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
73
73
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
74
74
|
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
75
|
+
useButtonTag: PropTypes.Requireable<boolean>;
|
|
75
76
|
style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
76
77
|
}>>;
|
|
77
78
|
export { cta_1 as cta };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/app-player/popin-header/index.js"],"names":[],"mappings":";AAyWA,oEAyDC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtID,gFA4DC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/app-player/popin-header/index.js"],"names":[],"mappings":";AAyWA,oEAyDC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtID,gFA4DC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5HD,yDAmDC;;;;;;;;;;;;;;;;;;;;;;;;;AApOD;;gBAkBC;;;;;;;;;;;AA8ED;;;;;uBAYC"}
|
|
@@ -17,6 +17,7 @@ declare namespace TeamsDashboard {
|
|
|
17
17
|
closeToolTipInformationTextAriaLabel: PropTypes.Requireable<string>;
|
|
18
18
|
}>>;
|
|
19
19
|
const platformLinks: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
20
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
20
21
|
submitValue: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
21
22
|
href: PropTypes.Requireable<string>;
|
|
22
23
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -31,6 +32,7 @@ declare namespace TeamsDashboard {
|
|
|
31
32
|
rectangular: PropTypes.Requireable<boolean>;
|
|
32
33
|
fullWidth: PropTypes.Requireable<boolean>;
|
|
33
34
|
certificationButton: PropTypes.Requireable<boolean>;
|
|
35
|
+
useButtonTag: PropTypes.Requireable<boolean>;
|
|
34
36
|
}> | null | undefined)[]>;
|
|
35
37
|
const sections: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
36
38
|
contentType: PropTypes.Requireable<string>;
|
package/lib/atom/cta/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export default CTA;
|
|
2
|
-
declare
|
|
3
|
-
|
|
2
|
+
declare function CTA(props: any, legacyContext: any): JSX.Element;
|
|
3
|
+
declare namespace CTA {
|
|
4
|
+
const propTypes: {
|
|
5
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
4
6
|
submitValue: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
5
7
|
href: PropTypes.Requireable<string>;
|
|
6
8
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -15,9 +17,10 @@ declare class CTA extends React.Component<any, any, any> {
|
|
|
15
17
|
rectangular: PropTypes.Requireable<boolean>;
|
|
16
18
|
fullWidth: PropTypes.Requireable<boolean>;
|
|
17
19
|
certificationButton: PropTypes.Requireable<boolean>;
|
|
20
|
+
useButtonTag: PropTypes.Requireable<boolean>;
|
|
18
21
|
};
|
|
19
|
-
|
|
20
|
-
skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
22
|
+
namespace contextTypes {
|
|
23
|
+
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
21
24
|
common: PropTypes.Requireable<{
|
|
22
25
|
[x: string]: any;
|
|
23
26
|
}>;
|
|
@@ -38,36 +41,7 @@ declare class CTA extends React.Component<any, any, any> {
|
|
|
38
41
|
[x: string]: any;
|
|
39
42
|
}>;
|
|
40
43
|
}>>;
|
|
41
|
-
}
|
|
42
|
-
constructor(props: any);
|
|
43
|
-
state: {
|
|
44
|
-
hovered: boolean;
|
|
45
|
-
};
|
|
46
|
-
handleMouseEnter(): void;
|
|
47
|
-
handleMouseLeave(): void;
|
|
48
|
-
getStyle(): {
|
|
49
|
-
backgroundColor: any;
|
|
50
|
-
borderColor: any;
|
|
51
|
-
opacity: string;
|
|
52
|
-
color?: undefined;
|
|
53
|
-
} | {
|
|
54
|
-
backgroundColor: any;
|
|
55
|
-
borderColor: any;
|
|
56
|
-
opacity?: undefined;
|
|
57
|
-
color?: undefined;
|
|
58
|
-
} | {
|
|
59
|
-
color: any;
|
|
60
|
-
borderColor: any;
|
|
61
|
-
backgroundColor?: undefined;
|
|
62
|
-
opacity?: undefined;
|
|
63
|
-
} | {
|
|
64
|
-
color: any;
|
|
65
|
-
backgroundColor?: undefined;
|
|
66
|
-
borderColor?: undefined;
|
|
67
|
-
opacity?: undefined;
|
|
68
|
-
} | undefined;
|
|
69
|
-
render(): JSX.Element;
|
|
44
|
+
}
|
|
70
45
|
}
|
|
71
|
-
import React from "react";
|
|
72
46
|
import PropTypes from "prop-types";
|
|
73
47
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/cta/index.js"],"names":[],"mappings":";AAUA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/cta/index.js"],"names":[],"mappings":";AAUA,kEAuGC"}
|
package/lib/atom/cta/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var _noop2 = _interopRequireDefault(require("lodash/fp/noop"));
|
|
|
7
7
|
|
|
8
8
|
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
|
|
9
9
|
|
|
10
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
12
|
var _cssColorFunction = require("css-color-function");
|
|
13
13
|
|
|
@@ -23,43 +23,42 @@ var _link = _interopRequireDefault(require("../link"));
|
|
|
23
23
|
|
|
24
24
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
25
25
|
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
26
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
disabled = false,
|
|
59
|
-
light = false,
|
|
60
|
-
secondary = false,
|
|
61
|
-
logout = false
|
|
62
|
-
} = this.props;
|
|
32
|
+
const CTA = (props, legacyContext) => {
|
|
33
|
+
const {
|
|
34
|
+
skin
|
|
35
|
+
} = legacyContext;
|
|
36
|
+
const {
|
|
37
|
+
'aria-label': ariaLabel,
|
|
38
|
+
submitValue = 'submit',
|
|
39
|
+
name: ctaName,
|
|
40
|
+
href,
|
|
41
|
+
target,
|
|
42
|
+
disabled = false,
|
|
43
|
+
light = false,
|
|
44
|
+
small = false,
|
|
45
|
+
secondary = false,
|
|
46
|
+
onClick,
|
|
47
|
+
className,
|
|
48
|
+
logout = false,
|
|
49
|
+
rectangular = false,
|
|
50
|
+
fullWidth = false,
|
|
51
|
+
certificationButton = false,
|
|
52
|
+
useButtonTag = false
|
|
53
|
+
} = props;
|
|
54
|
+
const [hovered, setHovered] = (0, _react.useState)(false);
|
|
55
|
+
const handleMouseEnter = (0, _react.useCallback)(() => {
|
|
56
|
+
setHovered(true);
|
|
57
|
+
}, []);
|
|
58
|
+
const handleMouseLeave = (0, _react.useCallback)(() => {
|
|
59
|
+
setHovered(false);
|
|
60
|
+
}, []);
|
|
61
|
+
const getStyle = (0, _react.useCallback)(() => {
|
|
63
62
|
const color = (0, _get2.default)('common.primary', skin);
|
|
64
63
|
const grey = (0, _get2.default)('common.grey', skin);
|
|
65
64
|
if (logout) return;
|
|
@@ -91,50 +90,30 @@ class CTA extends _react.default.Component {
|
|
|
91
90
|
borderColor: color,
|
|
92
91
|
backgroundColor: color
|
|
93
92
|
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
href: href,
|
|
115
|
-
onClick: disabled ? _noop2.default : onClick,
|
|
116
|
-
onMouseEnter: this.handleMouseEnter,
|
|
117
|
-
onMouseLeave: this.handleMouseLeave,
|
|
118
|
-
target: target,
|
|
119
|
-
className: (0, _classnames.default)(_style.default.button, disabled ? _style.default.disabled : null, small ? _style.default.smallButton : null, light ? _style.default.lightButton : null, secondary ? _style.default.secondaryButton : null, logout ? _style.default.logoutButton : null, rectangular ? _style.default.rectangularButton : null, fullWidth ? _style.default.fullWidth : null, certificationButton ? _style.default.certificationButton : null, className),
|
|
120
|
-
"data-name": ctaName || 'cta',
|
|
121
|
-
style: this.getStyle()
|
|
122
|
-
}, logout ? /*#__PURE__*/_react.default.createElement("div", {
|
|
123
|
-
className: _style.default.logoutWrapper,
|
|
124
|
-
"data-name": "cta-logout-label"
|
|
125
|
-
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyLogout, {
|
|
126
|
-
height: 15,
|
|
127
|
-
width: 15,
|
|
128
|
-
className: _style.default.logoutIcon
|
|
129
|
-
}), submitValue) : submitValue);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
CTA.contextTypes = {
|
|
135
|
-
skin: _provider.default.childContextTypes.skin
|
|
93
|
+
}, [disabled, hovered, light, logout, secondary, skin]);
|
|
94
|
+
return /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
95
|
+
href: href,
|
|
96
|
+
onClick: disabled ? _noop2.default : onClick,
|
|
97
|
+
onMouseEnter: handleMouseEnter,
|
|
98
|
+
onMouseLeave: handleMouseLeave,
|
|
99
|
+
target: target,
|
|
100
|
+
className: (0, _classnames.default)(_style.default.button, disabled ? _style.default.disabled : null, small ? _style.default.smallButton : null, light ? _style.default.lightButton : null, secondary ? _style.default.secondaryButton : null, logout ? _style.default.logoutButton : null, rectangular ? _style.default.rectangularButton : null, fullWidth ? _style.default.fullWidth : null, certificationButton ? _style.default.certificationButton : null, className),
|
|
101
|
+
"data-name": ctaName || 'cta',
|
|
102
|
+
style: getStyle(),
|
|
103
|
+
"aria-label": ariaLabel,
|
|
104
|
+
useButtonTag: useButtonTag
|
|
105
|
+
}, logout ? /*#__PURE__*/_react.default.createElement("div", {
|
|
106
|
+
className: _style.default.logoutWrapper,
|
|
107
|
+
"data-name": "cta-logout-label"
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyLogout, {
|
|
109
|
+
height: 15,
|
|
110
|
+
width: 15,
|
|
111
|
+
className: _style.default.logoutIcon
|
|
112
|
+
}), submitValue) : submitValue);
|
|
136
113
|
};
|
|
114
|
+
|
|
137
115
|
CTA.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
116
|
+
'aria-label': _link.default.propTypes['aria-label'],
|
|
138
117
|
submitValue: _link.default.propTypes.children,
|
|
139
118
|
href: _link.default.propTypes.href,
|
|
140
119
|
onClick: _link.default.propTypes.onClick,
|
|
@@ -148,8 +127,12 @@ CTA.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
148
127
|
logout: _propTypes.default.bool,
|
|
149
128
|
rectangular: _propTypes.default.bool,
|
|
150
129
|
fullWidth: _propTypes.default.bool,
|
|
151
|
-
certificationButton: _propTypes.default.bool
|
|
130
|
+
certificationButton: _propTypes.default.bool,
|
|
131
|
+
useButtonTag: _link.default.propTypes.useButtonTag
|
|
152
132
|
} : {};
|
|
133
|
+
CTA.contextTypes = {
|
|
134
|
+
skin: _provider.default.childContextTypes.skin
|
|
135
|
+
};
|
|
153
136
|
var _default = CTA;
|
|
154
137
|
exports.default = _default;
|
|
155
138
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CTA","
|
|
1
|
+
{"version":3,"file":"index.js","names":["CTA","props","legacyContext","skin","ariaLabel","submitValue","name","ctaName","href","target","disabled","light","small","secondary","onClick","className","logout","rectangular","fullWidth","certificationButton","useButtonTag","hovered","setHovered","useState","handleMouseEnter","useCallback","handleMouseLeave","getStyle","color","grey","backgroundColor","borderColor","opacity","darkenColor","convert","classnames","style","button","smallButton","lightButton","secondaryButton","logoutButton","rectangularButton","logoutWrapper","logoutIcon","propTypes","Link","children","PropTypes","string","bool","contextTypes","Provider","childContextTypes"],"sources":["../../../src/atom/cta/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport {convert} from 'css-color-function';\nimport PropTypes from 'prop-types';\nimport {get, noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {NovaCompositionCoorpacademyLogout as LogoutIcon} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport Link from '../link';\nimport style from './style.css';\n\nconst CTA = (props, legacyContext) => {\n const {skin} = legacyContext;\n const {\n 'aria-label': ariaLabel,\n submitValue = 'submit',\n name: ctaName,\n href,\n target,\n disabled = false,\n light = false,\n small = false,\n secondary = false,\n onClick,\n className,\n logout = false,\n rectangular = false,\n fullWidth = false,\n certificationButton = false,\n useButtonTag = false\n } = props;\n const [hovered, setHovered] = useState(false);\n\n const handleMouseEnter = useCallback(() => {\n setHovered(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setHovered(false);\n }, []);\n\n const getStyle = useCallback(() => {\n const color = get('common.primary', skin);\n const grey = get('common.grey', skin);\n\n if (logout) return;\n\n if (disabled) {\n return {\n backgroundColor: grey,\n borderColor: grey,\n opacity: '0.3'\n };\n }\n\n if (hovered) {\n const darkenColor = convert(`color(${color} blackness(+10%))`);\n return {\n backgroundColor: darkenColor,\n borderColor: darkenColor\n };\n }\n\n if (secondary)\n return {\n color,\n borderColor: color\n };\n\n if (light)\n return {\n color\n };\n\n return {\n borderColor: color,\n backgroundColor: color\n };\n }, [disabled, hovered, light, logout, secondary, skin]);\n\n return (\n <Link\n href={href}\n onClick={disabled ? noop : onClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n target={target}\n className={classnames(\n style.button,\n disabled ? style.disabled : null,\n small ? style.smallButton : null,\n light ? style.lightButton : null,\n secondary ? style.secondaryButton : null,\n logout ? style.logoutButton : null,\n rectangular ? style.rectangularButton : null,\n fullWidth ? style.fullWidth : null,\n certificationButton ? style.certificationButton : null,\n className\n )}\n data-name={ctaName || 'cta'}\n style={getStyle()}\n aria-label={ariaLabel}\n useButtonTag={useButtonTag}\n >\n {logout ? (\n <div className={style.logoutWrapper} data-name=\"cta-logout-label\">\n <LogoutIcon height={15} width={15} className={style.logoutIcon} />\n {submitValue}\n </div>\n ) : (\n submitValue\n )}\n </Link>\n );\n};\n\nCTA.propTypes = {\n 'aria-label': Link.propTypes['aria-label'],\n submitValue: Link.propTypes.children,\n href: Link.propTypes.href,\n onClick: Link.propTypes.onClick,\n target: Link.propTypes.target,\n name: PropTypes.string,\n disabled: PropTypes.bool,\n light: PropTypes.bool,\n secondary: PropTypes.bool,\n small: PropTypes.bool,\n className: PropTypes.string,\n logout: PropTypes.bool,\n rectangular: PropTypes.bool,\n fullWidth: PropTypes.bool,\n certificationButton: PropTypes.bool,\n useButtonTag: Link.propTypes.useButtonTag\n};\n\nCTA.cont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