@coorpacademy/components 10.6.1 → 10.8.0

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.
Files changed (67) hide show
  1. package/es/atom/button-link/index.js +10 -3
  2. package/es/atom/button-link/index.js.map +1 -1
  3. package/es/atom/tag/index.js +1 -1
  4. package/es/atom/tag/index.js.map +1 -1
  5. package/es/molecule/cockpit-popin/test/fixtures.js +17 -0
  6. package/es/molecule/cockpit-popin/test/fixtures.js.map +1 -0
  7. package/es/molecule/course-section/style.css +2 -2
  8. package/es/molecule/dashboard/review-banner/test/fixtures.js +13 -0
  9. package/es/molecule/dashboard/review-banner/test/fixtures.js.map +1 -0
  10. package/es/molecule/review-correction-popin/index.js +103 -0
  11. package/es/molecule/review-correction-popin/index.js.map +1 -0
  12. package/es/molecule/review-correction-popin/style.css +315 -0
  13. package/es/molecule/review-correction-popin/test/fixtures/right.js +17 -0
  14. package/es/molecule/review-correction-popin/test/fixtures/right.js.map +1 -0
  15. package/es/molecule/review-correction-popin/test/fixtures/wrong.js +19 -0
  16. package/es/molecule/review-correction-popin/test/fixtures/wrong.js.map +1 -0
  17. package/es/molecule/review-correction-popin/test/fixtures.js +15 -0
  18. package/es/molecule/review-correction-popin/test/fixtures.js.map +1 -0
  19. package/es/molecule/search/test/fixtures.js +15 -0
  20. package/es/molecule/search/test/fixtures.js.map +1 -0
  21. package/es/organism/list-items/index.js +2 -2
  22. package/es/organism/list-items/index.js.map +1 -1
  23. package/es/organism/wizard-contents/index.js +2 -2
  24. package/es/organism/wizard-contents/index.js.map +1 -1
  25. package/es/template/back-office/brand-list/index.js +16 -3
  26. package/es/template/back-office/brand-list/index.js.map +1 -1
  27. package/es/template/back-office/brand-list/style.css +11 -5
  28. package/es/template/back-office/brand-list/test/fixtures/default.js +3 -3
  29. package/es/template/back-office/brand-list/test/fixtures/default.js.map +1 -1
  30. package/es/template/back-office/brand-list/test/fixtures/rh.js +23 -1
  31. package/es/template/back-office/brand-list/test/fixtures/rh.js.map +1 -1
  32. package/es/util/button-icons.js +2 -1
  33. package/es/util/button-icons.js.map +1 -1
  34. package/lib/atom/button-link/index.js +11 -3
  35. package/lib/atom/button-link/index.js.map +1 -1
  36. package/lib/atom/tag/index.js +1 -1
  37. package/lib/atom/tag/index.js.map +1 -1
  38. package/lib/molecule/cockpit-popin/test/fixtures.js +28 -0
  39. package/lib/molecule/cockpit-popin/test/fixtures.js.map +1 -0
  40. package/lib/molecule/course-section/style.css +2 -2
  41. package/lib/molecule/dashboard/review-banner/test/fixtures.js +22 -0
  42. package/lib/molecule/dashboard/review-banner/test/fixtures.js.map +1 -0
  43. package/lib/molecule/review-correction-popin/index.js +116 -0
  44. package/lib/molecule/review-correction-popin/index.js.map +1 -0
  45. package/lib/molecule/review-correction-popin/style.css +315 -0
  46. package/lib/molecule/review-correction-popin/test/fixtures/right.js +22 -0
  47. package/lib/molecule/review-correction-popin/test/fixtures/right.js.map +1 -0
  48. package/lib/molecule/review-correction-popin/test/fixtures/wrong.js +24 -0
  49. package/lib/molecule/review-correction-popin/test/fixtures/wrong.js.map +1 -0
  50. package/lib/molecule/review-correction-popin/test/fixtures.js +25 -0
  51. package/lib/molecule/review-correction-popin/test/fixtures.js.map +1 -0
  52. package/lib/molecule/search/test/fixtures.js +25 -0
  53. package/lib/molecule/search/test/fixtures.js.map +1 -0
  54. package/lib/organism/list-items/index.js +2 -2
  55. package/lib/organism/list-items/index.js.map +1 -1
  56. package/lib/organism/wizard-contents/index.js +2 -2
  57. package/lib/organism/wizard-contents/index.js.map +1 -1
  58. package/lib/template/back-office/brand-list/index.js +17 -3
  59. package/lib/template/back-office/brand-list/index.js.map +1 -1
  60. package/lib/template/back-office/brand-list/style.css +11 -5
  61. package/lib/template/back-office/brand-list/test/fixtures/default.js +3 -3
  62. package/lib/template/back-office/brand-list/test/fixtures/default.js.map +1 -1
  63. package/lib/template/back-office/brand-list/test/fixtures/rh.js +23 -1
  64. package/lib/template/back-office/brand-list/test/fixtures/rh.js.map +1 -1
  65. package/lib/util/button-icons.js +1 -0
  66. package/lib/util/button-icons.js.map +1 -1
  67. package/package.json +2 -2
@@ -1,3 +1,4 @@
1
+ import _noop from "lodash/fp/noop";
1
2
  import _keys from "lodash/fp/keys";
2
3
  import _getOr from "lodash/fp/getOr";
3
4
 
@@ -46,14 +47,17 @@ const ButtonLink = props => {
46
47
  'data-name': dataName,
47
48
  'aria-label': ariaLabel,
48
49
  link,
49
- onClick
50
+ onClick = _noop,
51
+ className,
52
+ customStyle
50
53
  } = props;
51
54
  const contentView = getButtonContent(icon, label);
52
- const styleButton = classnames(style.button, type === 'primary' && style.primary, type === 'secondary' && style.secondary, type === 'tertiary' && style.tertiary, type === 'text' && style.text, type === 'dangerous' && style.dangerous, link && style.link, disabled && style.disabled);
55
+ const styleButton = classnames(className, style.button, type === 'primary' && style.primary, type === 'secondary' && style.secondary, type === 'tertiary' && style.tertiary, type === 'text' && style.text, type === 'dangerous' && style.dangerous, link && style.link, disabled && style.disabled);
53
56
  const handleOnClick = useCallback(() => onClick(), [onClick]);
54
57
 
55
58
  if (link) {
56
59
  return /*#__PURE__*/React.createElement(Link, _extends({}, link, {
60
+ style: customStyle,
57
61
  className: styleButton,
58
62
  "data-name": dataName,
59
63
  "aria-label": ariaLabel || label,
@@ -66,6 +70,7 @@ const ButtonLink = props => {
66
70
  "aria-label": ariaLabel || label,
67
71
  title: ariaLabel || label,
68
72
  "data-name": dataName,
73
+ style: customStyle,
69
74
  className: styleButton,
70
75
  onClick: handleOnClick
71
76
  }, contentView);
@@ -86,7 +91,9 @@ ButtonLink.propTypes = process.env.NODE_ENV !== "production" ? {
86
91
  download: PropTypes.bool,
87
92
  target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])
88
93
  }),
89
- disabled: PropTypes.bool
94
+ disabled: PropTypes.bool,
95
+ className: PropTypes.string,
96
+ customStyle: PropTypes.shape({})
90
97
  } : {};
91
98
  export default ButtonLink;
92
99
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/atom/button-link/index.js"],"names":["React","useCallback","PropTypes","classnames","Link","ICONS","style","getButtonContent","icon","label","type","position","Icon","buttonContent","ButtonLink","props","disabled","dataName","ariaLabel","link","onClick","contentView","styleButton","button","primary","secondary","tertiary","text","dangerous","handleOnClick","propTypes","oneOf","string","shape","func","href","download","bool","target"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,SAAQC,KAAR,QAAoB,yBAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,IAAD,EAAOC,KAAP,KAAiB;AACxC,QAAM;AAACC,IAAAA,IAAD;AAAOC,IAAAA;AAAP,MAAmBH,IAAzB;;AACA,QAAMI,IAAI,GAAG,OAAM,IAAN,EAAYF,IAAZ,EAAkBL,KAAlB,CAAb;;AAEA,MAAI,CAACO,IAAL,EAAW;AACT,wBACE;AAAK,MAAA,SAAS,EAAEN,KAAK,CAACO;AAAtB,oBACE;AAAM,MAAA,SAAS,EAAEP,KAAK,CAACG;AAAvB,OAA+BA,KAA/B,CADF,CADF;AAKD;;AAED,sBACE;AAAK,IAAA,SAAS,EAAEH,KAAK,CAACO;AAAtB,KACGF,QAAQ,KAAK,MAAb,gBAAsB,oBAAC,IAAD;AAAM,IAAA,SAAS,EAAEL,KAAK,CAACE;AAAvB,IAAtB,GAAwD,IAD3D,eAEE;AAAM,IAAA,SAAS,EAAEF,KAAK,CAACG;AAAvB,KAA+BA,KAA/B,CAFF,EAGGE,QAAQ,KAAK,OAAb,gBAAuB,oBAAC,IAAD;AAAM,IAAA,SAAS,EAAEL,KAAK,CAACE;AAAvB,IAAvB,GAAyD,IAH5D,CADF;AAOD,CAnBD;;AAqBA,MAAMM,UAAU,GAAG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;AAYD,CAnDD;;AAqDAP,UAAU,CAACgB,SAAX,2CAAuB;AACrBpB,EAAAA,IAAI,EAAER,SAAS,CAAC6B,KAAV,CAAgB,CAAC,SAAD,EAAY,WAAZ,EAAyB,UAAzB,EAAqC,MAArC,EAA6C,WAA7C,CAAhB,CADe;AAErBtB,EAAAA,KAAK,EAAEP,SAAS,CAAC8B,MAFI;AAGrB,gBAAc9B,SAAS,CAAC8B,MAHH;AAIrB,eAAa9B,SAAS,CAAC8B,MAJF;AAKrBxB,EAAAA,IAAI,EAAEN,SAAS,CAAC+B,KAAV,CAAgB;AACpBtB,IAAAA,QAAQ,EAAET,SAAS,CAAC6B,KAAV,CAAgB,CAAC,OAAD,EAAU,MAAV,CAAhB,CADU;AAEpBrB,IAAAA,IAAI,EAAER,SAAS,CAAC6B,KAAV,CAAgB,MAAK1B,KAAL,CAAhB;AAFc,GAAhB,CALe;AASrBe,EAAAA,OAAO,EAAElB,SAAS,CAACgC,IATE;AAUrBf,EAAAA,IAAI,EAAEjB,SAAS,CAAC+B,KAAV,CAAgB;AACpBE,IAAAA,IAAI,EAAEjC,SAAS,CAAC8B,MADI;AAEpBI,IAAAA,QAAQ,EAAElC,SAAS,CAACmC,IAFA;AAGpBC,IAAAA,MAAM,EAAEpC,SAAS,CAAC6B,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB;AAHY,GAAhB,CAVe;AAerBf,EAAAA,QAAQ,EAAEd,SAAS,CAACmC;AAfC,CAAvB;AAkBA,eAAevB,UAAf","sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport {ICONS} from '../../util/button-icons';\nimport style from './style.css';\n\nconst getButtonContent = (icon, label) => {\n const {type, position} = icon;\n const Icon = getOr(null, type, ICONS);\n\n if (!Icon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n );\n }\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? <Icon className={style.icon} /> : null}\n <span className={style.label}>{label}</span>\n {position === 'right' ? <Icon className={style.icon} /> : null}\n </div>\n );\n};\n\nconst ButtonLink = props => {\n const {\n type,\n label,\n disabled,\n icon = {},\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick\n } = props;\n const contentView = getButtonContent(icon, label);\n const styleButton = classnames(\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n if (link) {\n return (\n <Link\n {...link}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel || label}\n title={ariaLabel || label}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel || label}\n title={ariaLabel || label}\n data-name={dataName}\n className={styleButton}\n onClick={handleOnClick}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLink.propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n label: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS))\n }),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool\n};\n\nexport default ButtonLink;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/atom/button-link/index.js"],"names":["React","useCallback","PropTypes","classnames","Link","ICONS","style","getButtonContent","icon","label","type","position","Icon","buttonContent","ButtonLink","props","disabled","dataName","ariaLabel","link","onClick","className","customStyle","contentView","styleButton","button","primary","secondary","tertiary","text","dangerous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AI,EAAER,SAAS,CAAC+B,KAAV,CAAgB,CAAC,SAAD,EAAY,WAAZ,EAAyB,UAAzB,EAAqC,MAArC,EAA6C,WAA7C,CAAhB,CADe;AAErBxB,EAAAA,KAAK,EAAEP,SAAS,CAACgC,MAFI;AAGrB,gBAAchC,SAAS,CAACgC,MAHH;AAIrB,eAAahC,SAAS,CAACgC,MAJF;AAKrB1B,EAAAA,IAAI,EAAEN,SAAS,CAACiC,KAAV,CAAgB;AACpBxB,IAAAA,QAAQ,EAAET,SAAS,CAAC+B,KAAV,CAAgB,CAAC,OAAD,EAAU,MAAV,CAAhB,CADU;AAEpBvB,IAAAA,IAAI,EAAER,SAAS,CAAC+B,KAAV,CAAgB,MAAK5B,KAAL,CAAhB;AAFc,GAAhB,CALe;AASrBe,EAAAA,OAAO,EAAElB,SAAS,CAACkC,IATE;AAUrBjB,EAAAA,IAAI,EAAEjB,SAAS,CAACiC,KAAV,CAAgB;AACpBE,IAAAA,IAAI,EAAEnC,SAAS,CAACgC,MADI;AAEpBI,IAAAA,QAAQ,EAAEpC,SAAS,CAACqC,IAFA;AAGpBC,IAAAA,MAAM,EAAEtC,SAAS,CAAC+B,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB;AAHY,GAAhB,CAVe;AAerBjB,EAAAA,QAAQ,EAAEd,SAAS,CAACqC,IAfC;AAgBrBlB,EAAAA,SAAS,EAAEnB,SAAS,CAACgC,MAhBA;AAiBrBZ,EAAAA,WAAW,EAAEpB,SAAS,CAACiC,KAAV,CAAgB,EAAhB;AAjBQ,CAAvB;AAoBA,eAAerB,UAAf","sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys, noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport {ICONS} from '../../util/button-icons';\nimport style from './style.css';\n\nconst getButtonContent = (icon, label) => {\n const {type, position} = icon;\n const Icon = getOr(null, type, ICONS);\n\n if (!Icon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n );\n }\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? <Icon className={style.icon} /> : null}\n <span className={style.label}>{label}</span>\n {position === 'right' ? <Icon className={style.icon} /> : null}\n </div>\n );\n};\n\nconst ButtonLink = props => {\n const {\n type,\n label,\n disabled,\n icon = {},\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick = noop,\n className,\n customStyle\n } = props;\n const contentView = getButtonContent(icon, label);\n const styleButton = classnames(\n className,\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n if (link) {\n return (\n <Link\n {...link}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel || label}\n title={ariaLabel || label}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel || label}\n title={ariaLabel || label}\n data-name={dataName}\n style={customStyle}\n className={styleButton}\n onClick={handleOnClick}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLink.propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n label: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS))\n }),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool,\n className: PropTypes.string,\n customStyle: PropTypes.shape({})\n};\n\nexport default ButtonLink;\n"],"file":"index.js"}
@@ -17,7 +17,7 @@ const Tag = props => {
17
17
  } = props;
18
18
  return /*#__PURE__*/React.createElement("span", {
19
19
  className: TAG_STYLES[type],
20
- "data-name": `custom-playlist-tag-${label}`
20
+ "data-name": `content-tag-${label}`
21
21
  }, label);
22
22
  };
23
23
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/atom/tag/index.js"],"names":["React","PropTypes","style","TAG_STYLES","default","published","revised","archived","draft","Tag","props","label","type","propTypes","string","oneOf"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,OAAO,EAAEF,KAAK,CAACE,OADE;AAEjBC,EAAAA,SAAS,EAAEH,KAAK,CAACG,SAFA;AAGjBC,EAAAA,OAAO,EAAEJ,KAAK,CAACI,OAHE;AAIjBC,EAAAA,QAAQ,EAAEL,KAAK,CAACK,QAJC;AAKjBC,EAAAA,KAAK,EAAEN,KAAK,CAACM;AALI,CAAnB;;AAQA,MAAMC,GAAG,GAAGC,KAAK,IAAI;AACnB,QAAM;AAACC,IAAAA,KAAD;AAAQC,IAAAA,IAAI,GAAG;AAAf,MAA4BF,KAAlC;AAEA,sBACE;AAAM,IAAA,SAAS,EAAEP,UAAU,CAACS,IAAD,CAA3B;AAAmC,iBAAY,uBAAsBD,KAAM;AAA3E,KACGA,KADH,CADF;AAKD,CARD;;AAUAF,GAAG,CAACI,SAAJ,2CAAgB;AACdF,EAAAA,KAAK,EAAEV,SAAS,CAACa,MADH;AAEdF,EAAAA,IAAI,EAAEX,SAAS,CAACc,KAAV,CAAgB,MAAKZ,UAAL,CAAhB;AAFQ,CAAhB;AAKA,eAAeM,GAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport style from './style.css';\n\nconst TAG_STYLES = {\n default: style.default,\n published: style.published,\n revised: style.revised,\n archived: style.archived,\n draft: style.draft\n};\n\nconst Tag = props => {\n const {label, type = 'default'} = props;\n\n return (\n <span className={TAG_STYLES[type]} data-name={`custom-playlist-tag-${label}`}>\n {label}\n </span>\n );\n};\n\nTag.propTypes = {\n label: PropTypes.string,\n type: PropTypes.oneOf(keys(TAG_STYLES))\n};\n\nexport default Tag;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/atom/tag/index.js"],"names":["React","PropTypes","style","TAG_STYLES","default","published","revised","archived","draft","Tag","props","label","type","propTypes","string","oneOf"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,OAAO,EAAEF,KAAK,CAACE,OADE;AAEjBC,EAAAA,SAAS,EAAEH,KAAK,CAACG,SAFA;AAGjBC,EAAAA,OAAO,EAAEJ,KAAK,CAACI,OAHE;AAIjBC,EAAAA,QAAQ,EAAEL,KAAK,CAACK,QAJC;AAKjBC,EAAAA,KAAK,EAAEN,KAAK,CAACM;AALI,CAAnB;;AAQA,MAAMC,GAAG,GAAGC,KAAK,IAAI;AACnB,QAAM;AAACC,IAAAA,KAAD;AAAQC,IAAAA,IAAI,GAAG;AAAf,MAA4BF,KAAlC;AAEA,sBACE;AAAM,IAAA,SAAS,EAAEP,UAAU,CAACS,IAAD,CAA3B;AAAmC,iBAAY,eAAcD,KAAM;AAAnE,KACGA,KADH,CADF;AAKD,CARD;;AAUAF,GAAG,CAACI,SAAJ,2CAAgB;AACdF,EAAAA,KAAK,EAAEV,SAAS,CAACa,MADH;AAEdF,EAAAA,IAAI,EAAEX,SAAS,CAACc,KAAV,CAAgB,MAAKZ,UAAL,CAAhB;AAFQ,CAAhB;AAKA,eAAeM,GAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport style from './style.css';\n\nconst TAG_STYLES = {\n default: style.default,\n published: style.published,\n revised: style.revised,\n archived: style.archived,\n draft: style.draft\n};\n\nconst Tag = props => {\n const {label, type = 'default'} = props;\n\n return (\n <span className={TAG_STYLES[type]} data-name={`content-tag-${label}`}>\n {label}\n </span>\n );\n};\n\nTag.propTypes = {\n label: PropTypes.string,\n type: PropTypes.oneOf(keys(TAG_STYLES))\n};\n\nexport default Tag;\n"],"file":"index.js"}
@@ -0,0 +1,17 @@
1
+ import test from 'ava';
2
+ import forEach from 'lodash/forEach';
3
+ import renderComponentMacro from '../../../test/helpers/render-component';
4
+ import MoleculeCockpitPopin from '..';
5
+ import fixtureDefault from './fixtures/default';
6
+ import fixtureLoading from './fixtures/loading';
7
+ import fixtureVideoTranslate from './fixtures/video-translate';
8
+ test('Molecule › MoleculeCockpitPopin > should have valid propTypes', t => {
9
+ t.pass();
10
+ forEach(MoleculeCockpitPopin.propTypes, (value, key) => {
11
+ t.not(value, undefined, `PropType for "Molecule.MoleculeCockpitPopin.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
12
+ });
13
+ });
14
+ test('Molecule › MoleculeCockpitPopin › Default › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureDefault);
15
+ test('Molecule › MoleculeCockpitPopin › Loading › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureLoading);
16
+ test('Molecule › MoleculeCockpitPopin › VideoTranslate › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureVideoTranslate);
17
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/molecule/cockpit-popin/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCockpitPopin","fixtureDefault","fixtureLoading","fixtureVideoTranslate","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,oBAAP,MAAiC,IAAjC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AAEAN,IAAI,CAAC,+DAAD,EAAkEO,CAAC,IAAI;AACzEA,EAAAA,CAAC,CAACC,IAAF;AACAP,EAAAA,OAAO,CAACE,oBAAoB,CAACM,SAAtB,EAAiC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACtDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,yDAAwDF,GAAI,mEAArF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAX,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,oBAAzF,EAA+GC,cAA/G,CAAJ;AACAJ,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,oBAAzF,EAA+GE,cAA/G,CAAJ;AACAL,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,oBAAhG,EAAsHG,qBAAtH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCockpitPopin from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLoading from './fixtures/loading';\nimport fixtureVideoTranslate from './fixtures/video-translate';\n\ntest('Molecule › MoleculeCockpitPopin > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCockpitPopin.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCockpitPopin.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCockpitPopin › Default › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureDefault);\ntest('Molecule › MoleculeCockpitPopin › Loading › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureLoading);\ntest('Molecule › MoleculeCockpitPopin › VideoTranslate › should be rendered', renderComponentMacro, MoleculeCockpitPopin, fixtureVideoTranslate);\n"],"file":"fixtures.js"}
@@ -10,7 +10,7 @@
10
10
  border-radius: 7px;
11
11
  display: flex;
12
12
  font-size: 14px;
13
- justify-content: start;
13
+ justify-content: flex-start;
14
14
  margin-top: 8px;
15
15
  padding: 8px 16px;
16
16
  border-radius: 7px;
@@ -63,4 +63,4 @@
63
63
  .containerImage {
64
64
  min-height: 56px;
65
65
  min-width: 56px;
66
- }
66
+ }
@@ -0,0 +1,13 @@
1
+ import test from 'ava';
2
+ import forEach from 'lodash/forEach';
3
+ import renderComponentMacro from '../../../../test/helpers/render-component';
4
+ import MoleculeDashboardReviewBanner from '..';
5
+ import fixtureDefault from './fixtures/default';
6
+ test('MoleculeDashboard › MoleculeDashboardReviewBanner > should have valid propTypes', t => {
7
+ t.pass();
8
+ forEach(MoleculeDashboardReviewBanner.propTypes, (value, key) => {
9
+ t.not(value, undefined, `PropType for "MoleculeDashboard.MoleculeDashboardReviewBanner.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
10
+ });
11
+ });
12
+ test('MoleculeDashboard › MoleculeDashboardReviewBanner › Default › should be rendered', renderComponentMacro, MoleculeDashboardReviewBanner, fixtureDefault);
13
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/dashboard/review-banner/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeDashboardReviewBanner","fixtureDefault","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,2CAAjC;AACA,OAAOC,6BAAP,MAA0C,IAA1C;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AAEAJ,IAAI,CAAC,iFAAD,EAAoFK,CAAC,IAAI;AAC3FA,EAAAA,CAAC,CAACC,IAAF;AACAL,EAAAA,OAAO,CAACE,6BAA6B,CAACI,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC/DJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2EAA0EF,GAAI,mEAAvG;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAT,IAAI,CAAC,kFAAD,EAAqFE,oBAArF,EAA2GC,6BAA3G,EAA0IC,cAA1I,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../../test/helpers/render-component';\nimport MoleculeDashboardReviewBanner from '..';\nimport fixtureDefault from './fixtures/default';\n\ntest('MoleculeDashboard › MoleculeDashboardReviewBanner > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeDashboardReviewBanner.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"MoleculeDashboard.MoleculeDashboardReviewBanner.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('MoleculeDashboard › MoleculeDashboardReviewBanner › Default › should be rendered', renderComponentMacro, MoleculeDashboardReviewBanner, fixtureDefault);\n"],"file":"fixtures.js"}
@@ -0,0 +1,103 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ import classnames from 'classnames';
5
+ import PropTypes from 'prop-types';
6
+ import { NovaCompositionCoorpacademyCheck as RightIcon, NovaSolidStatusClose as WrongIcon } from '@coorpacademy/nova-icons';
7
+ import ButtonLink from '../../atom/button-link';
8
+ import style from './style.css';
9
+
10
+ const buildKlfButton = klf => {
11
+ const klfButtonProps = _extends(_extends({}, klf), {}, {
12
+ icon: {
13
+ position: 'left',
14
+ type: 'key'
15
+ },
16
+ type: 'primary'
17
+ });
18
+
19
+ return /*#__PURE__*/React.createElement("div", {
20
+ className: style.klfContainer
21
+ }, /*#__PURE__*/React.createElement("div", {
22
+ className: style.klfButtonContainer
23
+ }, /*#__PURE__*/React.createElement(ButtonLink, _extends({}, klfButtonProps, {
24
+ className: style.klfButton
25
+ }))), /*#__PURE__*/React.createElement("div", {
26
+ className: style.toolTip
27
+ }, /*#__PURE__*/React.createElement("div", {
28
+ className: style.tooltipText
29
+ }, klf.tooltip)));
30
+ };
31
+
32
+ const ReviewCorrectionPopin = props => {
33
+ const {
34
+ information,
35
+ resultLabel,
36
+ type,
37
+ klf,
38
+ next
39
+ } = props;
40
+
41
+ const nextQuestionButtonProps = _extends(_extends({}, next), {}, {
42
+ type: 'primary'
43
+ });
44
+
45
+ const cta = type === 'wrong' ? buildKlfButton(klf) : null;
46
+ const ICONS = {
47
+ right: RightIcon,
48
+ wrong: WrongIcon
49
+ };
50
+ const Icon = ICONS[type];
51
+ return /*#__PURE__*/React.createElement("div", {
52
+ className: style.wrapper
53
+ }, /*#__PURE__*/React.createElement("div", {
54
+ className: classnames(style.popin, type === 'right' ? style.right : style.wrong)
55
+ }, /*#__PURE__*/React.createElement("div", {
56
+ className: style.correctionSection
57
+ }, /*#__PURE__*/React.createElement("div", {
58
+ className: style.iconCircle
59
+ }, /*#__PURE__*/React.createElement(Icon, {
60
+ className: type === 'right' ? style.iconRight : style.iconWrong
61
+ })), /*#__PURE__*/React.createElement("div", {
62
+ className: style.resultLabel,
63
+ "aria-label": "result"
64
+ }, /*#__PURE__*/React.createElement("span", {
65
+ "aria-label": resultLabel
66
+ }, resultLabel))), /*#__PURE__*/React.createElement("div", {
67
+ className: style.feedbackSection
68
+ }, /*#__PURE__*/React.createElement("div", {
69
+ className: style.information,
70
+ "aria-label": "answer-information"
71
+ }, /*#__PURE__*/React.createElement("span", {
72
+ className: style.label,
73
+ "aria-label": information.label
74
+ }, information.label), /*#__PURE__*/React.createElement("span", {
75
+ className: style.message,
76
+ "aria-label": information.message
77
+ }, information.message))), /*#__PURE__*/React.createElement("div", {
78
+ className: type === 'right' ? style.actions : style.actionsWrong
79
+ }, cta, /*#__PURE__*/React.createElement("div", {
80
+ className: style.nextQuestionContainer
81
+ }, /*#__PURE__*/React.createElement(ButtonLink, _extends({}, nextQuestionButtonProps, {
82
+ className: style.nextQuestionButton
83
+ }))))));
84
+ };
85
+
86
+ ReviewCorrectionPopin.propTypes = process.env.NODE_ENV !== "production" ? {
87
+ type: PropTypes.oneOf(['right', 'wrong']),
88
+ resultLabel: PropTypes.string,
89
+ information: PropTypes.shape({
90
+ label: PropTypes.string,
91
+ message: PropTypes.string
92
+ }),
93
+ next: PropTypes.shape({
94
+ label: PropTypes.string,
95
+ onClick: PropTypes.func
96
+ }),
97
+ klf: PropTypes.shape({
98
+ label: PropTypes.string,
99
+ onClick: PropTypes.func
100
+ })
101
+ } : {};
102
+ export default ReviewCorrectionPopin;
103
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/molecule/review-correction-popin/index.js"],"names":["React","classnames","PropTypes","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","ButtonLink","style","buildKlfButton","klf","klfButtonProps","icon","position","type","klfContainer","klfButtonContainer","klfButton","toolTip","tooltipText","tooltip","ReviewCorrectionPopin","props","information","resultLabel","next","nextQuestionButtonProps","cta","ICONS","right","wrong","Icon","wrapper","popin","correctionSection","iconCircle","iconRight","iconWrong","feedbackSection","label","message","actions","actionsWrong","nextQuestionContainer","nextQuestionButton","propTypes","oneOf","string","shape","onClick","func"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SACEC,gCAAgC,IAAIC,SADtC,EAEEC,oBAAoB,IAAIC,SAF1B,QAGO,0BAHP;AAIA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAGC,GAAG,IAAI;AAC5B,QAAMC,cAAc,yBACfD,GADe;AAElBE,IAAAA,IAAI,EAAE;AACJC,MAAAA,QAAQ,EA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BT,IAAAA,KAAK,EAAErC,SAAS,CAAC6C,MADU;AAE3BP,IAAAA,OAAO,EAAEtC,SAAS,CAAC6C;AAFQ,GAAhB,CAHmB;AAOhCtB,EAAAA,IAAI,EAAEvB,SAAS,CAAC8C,KAAV,CAAgB;AACpBT,IAAAA,KAAK,EAAErC,SAAS,CAAC6C,MADG;AAEpBE,IAAAA,OAAO,EAAE/C,SAAS,CAACgD;AAFC,GAAhB,CAP0B;AAWhCxC,EAAAA,GAAG,EAAER,SAAS,CAAC8C,KAAV,CAAgB;AACnBT,IAAAA,KAAK,EAAErC,SAAS,CAAC6C,MADE;AAEnBE,IAAAA,OAAO,EAAE/C,SAAS,CAACgD;AAFA,GAAhB;AAX2B,CAAlC;AAiBA,eAAe7B,qBAAf","sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst buildKlfButton = klf => {\n const klfButtonProps = {\n ...klf,\n icon: {\n position: 'left',\n type: 'key'\n },\n type: 'primary'\n };\n\n return (\n <div className={style.klfContainer}>\n <div className={style.klfButtonContainer}>\n <ButtonLink {...klfButtonProps} className={style.klfButton} />\n </div>\n <div className={style.toolTip}>\n <div className={style.tooltipText}>{klf.tooltip}</div>\n </div>\n </div>\n );\n};\n\nconst ReviewCorrectionPopin = props => {\n const {information, resultLabel, type, klf, next} = props;\n\n const nextQuestionButtonProps = {\n ...next,\n type: 'primary'\n };\n\n const cta = type === 'wrong' ? buildKlfButton(klf) : null;\n\n const ICONS = {\n right: RightIcon,\n wrong: WrongIcon\n };\n const Icon = ICONS[type];\n\n return (\n <div className={style.wrapper}>\n <div className={classnames(style.popin, type === 'right' ? style.right : style.wrong)}>\n <div className={style.correctionSection}>\n <div className={style.iconCircle}>\n <Icon className={type === 'right' ? style.iconRight : style.iconWrong} />\n </div>\n <div className={style.resultLabel} aria-label=\"result\">\n <span aria-label={resultLabel}>{resultLabel}</span>\n </div>\n </div>\n <div className={style.feedbackSection}>\n <div className={style.information} aria-label=\"answer-information\">\n <span className={style.label} aria-label={information.label}>\n {information.label}\n </span>\n <span className={style.message} aria-label={information.message}>\n {information.message}\n </span>\n </div>\n </div>\n <div className={type === 'right' ? style.actions : style.actionsWrong}>\n {cta}\n <div className={style.nextQuestionContainer}>\n <ButtonLink {...nextQuestionButtonProps} className={style.nextQuestionButton} />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nReviewCorrectionPopin.propTypes = {\n type: PropTypes.oneOf(['right', 'wrong']),\n resultLabel: PropTypes.string,\n information: PropTypes.shape({\n label: PropTypes.string,\n message: PropTypes.string\n }),\n next: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n }),\n klf: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nexport default ReviewCorrectionPopin;\n"],"file":"index.js"}
@@ -0,0 +1,315 @@
1
+ @value colors: "../../variables/colors.css";
2
+ @value breakpoints: "../../variables/breakpoints.css";
3
+ @value tablet from breakpoints;
4
+ @value mobile from breakpoints;
5
+ @value white from colors;
6
+ @value cm_positive_100 from colors;
7
+ @value cm_negative_100 from colors;
8
+ @value cm_primary_blue from colors;
9
+ @value cm_blue_900 from colors;
10
+
11
+ .wrapper {
12
+ width: 100%;
13
+ height: auto;
14
+ font-family: Gilroy;
15
+ color: white;
16
+ display: flex;
17
+ justify-content: center;
18
+ overflow: visible;
19
+ padding: 0px;
20
+ }
21
+
22
+ .popin {
23
+ width: 100%;
24
+ padding: 40px;
25
+ border-radius: 16px;
26
+ display: flex;
27
+ flex-direction: row;
28
+ align-items: center;
29
+ }
30
+
31
+ .right {
32
+ background-color: cm_positive_100;
33
+ box-shadow: 0px 0px 68px rgba(cm_positive_100, 0.4);
34
+ }
35
+
36
+ .wrong {
37
+ background-color: cm_negative_100;
38
+ box-shadow: 0px 0px 68px rgba(cm_negative_100, 0.4);
39
+ }
40
+
41
+ .correctionSection {
42
+ flex: 0 1 auto;
43
+ min-width: 187px;
44
+ display: flex;
45
+ align-content: center;
46
+ align-items: center;
47
+ }
48
+
49
+ .feedbackSection {
50
+ display: flex;
51
+ margin: 0 23px;
52
+ flex-direction: row;
53
+ align-items: center;
54
+ justify-content: left;
55
+ flex: 1 1 100%;
56
+ }
57
+
58
+ .iconCircle {
59
+ width: 52px;
60
+ min-width: 52px;
61
+ height: 52px;
62
+ min-height: 52px;
63
+ background: white;
64
+ opacity: 0.7;
65
+ border-radius: 50%;
66
+ box-sizing: border-box;
67
+ }
68
+
69
+ .icon {
70
+ width: 24px;
71
+ height: 24px;
72
+ padding: 14px 0 0 14px;
73
+ }
74
+
75
+ .iconRight {
76
+ composes: icon;
77
+ color: cm_positive_100;
78
+ }
79
+
80
+ .iconWrong {
81
+ composes: icon;
82
+ color: cm_negative_100;
83
+ }
84
+
85
+ .resultLabel {
86
+ margin-left: 12px;
87
+ font-weight: 900;
88
+ font-size: 24px;
89
+ line-height: 24px;
90
+ hyphens: auto;
91
+ -ms-word-break: break-word;
92
+ word-break: break-word;
93
+ }
94
+
95
+ .information {
96
+ display: block;
97
+ flex-direction: column;
98
+ }
99
+
100
+ .information .label {
101
+ width: 140px;
102
+ height: 25px;
103
+ padding: 4px 8px;
104
+ background: rgba(255, 255, 255, 0.3);
105
+ border-radius: 56px;
106
+ font-style: normal;
107
+ font-weight: 900;
108
+ font-size: 14px;
109
+ line-height: 17px;
110
+ display: flex;
111
+ align-items: center;
112
+ justify-content: center;
113
+ hyphens: auto;
114
+ -ms-word-break: break-word;
115
+ word-break: break-word;
116
+ }
117
+
118
+ .information .message {
119
+ display: block;
120
+ margin-top: 4px;
121
+ }
122
+
123
+ .actions {
124
+ flex: 0 1 auto;
125
+ min-width: 138px;
126
+ display: flex;
127
+ align-items: center;
128
+ justify-content: flex-end;
129
+ }
130
+
131
+ .actionsWrong {
132
+ composes: actions;
133
+ min-width: 345px;
134
+ flex: 0 1 auto;
135
+ }
136
+
137
+ .toolTip {
138
+ visibility: hidden;
139
+ opacity: 0;
140
+ transition: opacity 0.8s;
141
+ position: absolute;
142
+ width: 273px;
143
+ border-radius: 15px;
144
+ background-color: white;
145
+ right: 17.5%;
146
+ top: -64px;
147
+ }
148
+
149
+ .toolTip::before {
150
+ content: '';
151
+ display: inline-block;
152
+ visibility: hidden;
153
+ opacity: 0;
154
+ width: 15px;
155
+ height: 15px;
156
+ transform: rotate(-45deg);
157
+ transition: opacity 0.8s;
158
+ background-color: white;
159
+ position: inherit;
160
+ bottom: -7px;
161
+ left: 129px;
162
+ }
163
+
164
+ .tooltipText {
165
+ display: inline-block;
166
+ margin: 16px;
167
+ border-radius: 3px;
168
+ word-wrap: break-word;
169
+ color: cm_blue_900;
170
+ max-width: 241px;
171
+ overflow: hidden;
172
+ text-align: center;
173
+ font-size: 16px;
174
+ }
175
+
176
+ .klfContainer {
177
+ overflow: visible;
178
+ width: calc(55% - 16px);
179
+ margin-right: 16px;
180
+ }
181
+
182
+ .klfButtonContainer:hover ~ .toolTip {
183
+ visibility: visible;
184
+ opacity: 1;
185
+ }
186
+
187
+ .klfButtonContainer:hover ~ .toolTip::before {
188
+ visibility: visible;
189
+ opacity: 1;
190
+ }
191
+
192
+ .klfButtonContainer {
193
+ width: 100%;
194
+ margin-right: 16px;
195
+ }
196
+
197
+ .klfButton {
198
+ background: rgba(255, 255, 255, 0.1);
199
+ color: white;
200
+ }
201
+
202
+ .klfButton:hover {
203
+ background: linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), rgba(255, 255, 255, 0.1)
204
+ }
205
+
206
+ .nextQuestionContainer {
207
+ width: 100%;
208
+ }
209
+
210
+ .actionsWrong .nextQuestionContainer {
211
+ width: 45%;
212
+ }
213
+
214
+ .nextQuestionButton {
215
+ background: white;
216
+ color: cm_primary_blue;
217
+ }
218
+
219
+ .nextQuestionButton:hover {
220
+ background: linear-gradient(0deg, rgba(0, 0, 0, 0.07), rgba(0, 0, 0, 0.07)), #FFFFFF;
221
+ }
222
+
223
+ @media tablet {
224
+ .resultLabel {
225
+ display: none;
226
+ }
227
+
228
+ .correctionSection {
229
+ min-width: 60px;
230
+ }
231
+
232
+ .actions {
233
+ width: 25%;
234
+ }
235
+
236
+ .actionsWrong {
237
+ width: 47%;
238
+ }
239
+
240
+ .toolTip {
241
+ width: 250px;
242
+ right: 25%;
243
+ }
244
+ }
245
+
246
+ @media mobile {
247
+ .popin {
248
+ width: 100%;
249
+ min-height: 100px;
250
+ padding: 32px;
251
+ flex-direction: column;
252
+ display: block;
253
+ }
254
+
255
+ .popin > div {
256
+ min-width: auto;
257
+ width: 100%;
258
+ }
259
+
260
+ .correctionSection {
261
+ justify-content: center;
262
+ margin-bottom: 32px;
263
+ }
264
+
265
+ .resultLabel {
266
+ display: block;
267
+ text-align: left;
268
+ width: calc(100% - 52px);
269
+ }
270
+
271
+ .feedbackSection {
272
+ margin: 0;
273
+ width: 100%;
274
+ display: block;
275
+ }
276
+
277
+ .information .message {
278
+ margin: 8px 0 32px 0;
279
+ }
280
+
281
+ .actions {
282
+ width: 100%;
283
+ }
284
+
285
+ .actionsWrong {
286
+ width: 100%;
287
+ flex-direction: column;
288
+ align-items: center;
289
+ }
290
+
291
+ .actionsWrong .nextQuestionContainer {
292
+ width: 100%;
293
+ }
294
+
295
+ .klfContainer {
296
+ width: 100%;
297
+ margin: 0 0 8px 0;
298
+ position: relative;
299
+ }
300
+
301
+ .klfButtonContainer {
302
+ margin: 0;
303
+ }
304
+
305
+ .toolTip {
306
+ width: 106%;
307
+ right: -3%;
308
+ top: auto;
309
+ bottom: 52px;
310
+ }
311
+
312
+ .tooltipText {
313
+ max-width: none;
314
+ }
315
+ }
@@ -0,0 +1,17 @@
1
+ export default {
2
+ props: {
3
+ type: 'right',
4
+ resultLabel: 'CORRECT ANSWER',
5
+ information: {
6
+ label: 'Key learning factor',
7
+ message: '17 frustrated software engineers grappling with the complexities of software development.'
8
+ },
9
+ next: {
10
+ label: 'Next Question',
11
+ 'aria-label': 'next question button',
12
+ 'data-name': 'next-question-button',
13
+ onClick: () => console.log('Next Question')
14
+ }
15
+ }
16
+ };
17
+ //# sourceMappingURL=right.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/review-correction-popin/test/fixtures/right.js"],"names":["props","type","resultLabel","information","label","message","next","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,OADD;AAELC,IAAAA,WAAW,EAAE,gBAFR;AAGLC,IAAAA,WAAW,EAAE;AACXC,MAAAA,KAAK,EAAE,qBADI;AAEXC,MAAAA,OAAO,EACL;AAHS,KAHR;AAQLC,IAAAA,IAAI,EAAE;AACJF,MAAAA,KAAK,EAAE,eADH;AAEJ,oBAAc,sBAFV;AAGJ,mBAAa,sBAHT;AAIJG,MAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,eAAZ;AAJX;AARD;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'right',\n resultLabel: 'CORRECT ANSWER',\n information: {\n label: 'Key learning factor',\n message:\n '17 frustrated software engineers grappling with the complexities of software development.'\n },\n next: {\n label: 'Next Question',\n 'aria-label': 'next question button',\n 'data-name': 'next-question-button',\n onClick: () => console.log('Next Question')\n }\n }\n};\n"],"file":"right.js"}
@@ -0,0 +1,19 @@
1
+ export default {
2
+ props: {
3
+ type: 'wrong',
4
+ resultLabel: 'WRONG ANSWER',
5
+ information: {
6
+ label: 'Correct Answer',
7
+ message: 'Corporate lawyers trying to understand software.'
8
+ },
9
+ klf: {
10
+ label: 'Key learning factor',
11
+ tooltip: '17 frustrated software engineers grappling with the complexities of software development.'
12
+ },
13
+ next: {
14
+ label: 'Next Question',
15
+ onClick: () => console.log('Next Question')
16
+ }
17
+ }
18
+ };
19
+ //# sourceMappingURL=wrong.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/review-correction-popin/test/fixtures/wrong.js"],"names":["props","type","resultLabel","information","label","message","klf","tooltip","next","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,OADD;AAELC,IAAAA,WAAW,EAAE,cAFR;AAGLC,IAAAA,WAAW,EAAE;AACXC,MAAAA,KAAK,EAAE,gBADI;AAEXC,MAAAA,OAAO,EAAE;AAFE,KAHR;AAOLC,IAAAA,GAAG,EAAE;AACHF,MAAAA,KAAK,EAAE,qBADJ;AAEHG,MAAAA,OAAO,EACL;AAHC,KAPA;AAYLC,IAAAA,IAAI,EAAE;AACJJ,MAAAA,KAAK,EAAE,eADH;AAEJK,MAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,eAAZ;AAFX;AAZD;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'wrong',\n resultLabel: 'WRONG ANSWER',\n information: {\n label: 'Correct Answer',\n message: 'Corporate lawyers trying to understand software.'\n },\n klf: {\n label: 'Key learning factor',\n tooltip:\n '17 frustrated software engineers grappling with the complexities of software development.'\n },\n next: {\n label: 'Next Question',\n onClick: () => console.log('Next Question')\n }\n }\n};\n"],"file":"wrong.js"}
@@ -0,0 +1,15 @@
1
+ import test from 'ava';
2
+ import forEach from 'lodash/forEach';
3
+ import renderComponentMacro from '../../../test/helpers/render-component';
4
+ import MoleculeReviewCorrectionPopin from '..';
5
+ import fixtureRight from './fixtures/right';
6
+ import fixtureWrong from './fixtures/wrong';
7
+ test('Molecule › MoleculeReviewCorrectionPopin > should have valid propTypes', t => {
8
+ t.pass();
9
+ forEach(MoleculeReviewCorrectionPopin.propTypes, (value, key) => {
10
+ t.not(value, undefined, `PropType for "Molecule.MoleculeReviewCorrectionPopin.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
11
+ });
12
+ });
13
+ test('Molecule › MoleculeReviewCorrectionPopin › Right › should be rendered', renderComponentMacro, MoleculeReviewCorrectionPopin, fixtureRight);
14
+ test('Molecule › MoleculeReviewCorrectionPopin › Wrong › should be rendered', renderComponentMacro, MoleculeReviewCorrectionPopin, fixtureWrong);
15
+ //# sourceMappingURL=fixtures.js.map