@coorpacademy/components 10.7.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 (63) 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/select/test/fixtures.js +4 -0
  4. package/es/atom/select/test/fixtures.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-sections/test/fixtures.js +15 -0
  8. package/es/molecule/course-sections/test/fixtures.js.map +1 -0
  9. package/es/molecule/dashboard/review-banner/test/fixtures.js +13 -0
  10. package/es/molecule/dashboard/review-banner/test/fixtures.js.map +1 -0
  11. package/es/molecule/draggable-list/test/fixtures.js +2 -0
  12. package/es/molecule/draggable-list/test/fixtures.js.map +1 -1
  13. package/es/molecule/questions/free-text/test/fixtures.js +4 -2
  14. package/es/molecule/questions/free-text/test/fixtures.js.map +1 -1
  15. package/es/molecule/review-correction-popin/index.js +103 -0
  16. package/es/molecule/review-correction-popin/index.js.map +1 -0
  17. package/es/molecule/review-correction-popin/style.css +315 -0
  18. package/es/molecule/review-correction-popin/test/fixtures/right.js +17 -0
  19. package/es/molecule/review-correction-popin/test/fixtures/right.js.map +1 -0
  20. package/es/molecule/review-correction-popin/test/fixtures/wrong.js +19 -0
  21. package/es/molecule/review-correction-popin/test/fixtures/wrong.js.map +1 -0
  22. package/es/molecule/review-correction-popin/test/fixtures.js +15 -0
  23. package/es/molecule/review-correction-popin/test/fixtures.js.map +1 -0
  24. package/es/molecule/wizard-summary/test/fixtures.js +2 -0
  25. package/es/molecule/wizard-summary/test/fixtures.js.map +1 -1
  26. package/es/organism/wizard-contents/test/fixtures.js +2 -0
  27. package/es/organism/wizard-contents/test/fixtures.js.map +1 -1
  28. package/es/template/back-office/brand-update/test/fixtures.js +2 -0
  29. package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
  30. package/es/util/button-icons.js +2 -1
  31. package/es/util/button-icons.js.map +1 -1
  32. package/lib/atom/button-link/index.js +11 -3
  33. package/lib/atom/button-link/index.js.map +1 -1
  34. package/lib/atom/select/test/fixtures.js +6 -0
  35. package/lib/atom/select/test/fixtures.js.map +1 -1
  36. package/lib/molecule/cockpit-popin/test/fixtures.js +28 -0
  37. package/lib/molecule/cockpit-popin/test/fixtures.js.map +1 -0
  38. package/lib/molecule/course-sections/test/fixtures.js +25 -0
  39. package/lib/molecule/course-sections/test/fixtures.js.map +1 -0
  40. package/lib/molecule/dashboard/review-banner/test/fixtures.js +22 -0
  41. package/lib/molecule/dashboard/review-banner/test/fixtures.js.map +1 -0
  42. package/lib/molecule/draggable-list/test/fixtures.js +3 -0
  43. package/lib/molecule/draggable-list/test/fixtures.js.map +1 -1
  44. package/lib/molecule/questions/free-text/test/fixtures.js +5 -2
  45. package/lib/molecule/questions/free-text/test/fixtures.js.map +1 -1
  46. package/lib/molecule/review-correction-popin/index.js +116 -0
  47. package/lib/molecule/review-correction-popin/index.js.map +1 -0
  48. package/lib/molecule/review-correction-popin/style.css +315 -0
  49. package/lib/molecule/review-correction-popin/test/fixtures/right.js +22 -0
  50. package/lib/molecule/review-correction-popin/test/fixtures/right.js.map +1 -0
  51. package/lib/molecule/review-correction-popin/test/fixtures/wrong.js +24 -0
  52. package/lib/molecule/review-correction-popin/test/fixtures/wrong.js.map +1 -0
  53. package/lib/molecule/review-correction-popin/test/fixtures.js +25 -0
  54. package/lib/molecule/review-correction-popin/test/fixtures.js.map +1 -0
  55. package/lib/molecule/wizard-summary/test/fixtures.js +3 -0
  56. package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -1
  57. package/lib/organism/wizard-contents/test/fixtures.js +3 -0
  58. package/lib/organism/wizard-contents/test/fixtures.js.map +1 -1
  59. package/lib/template/back-office/brand-update/test/fixtures.js +3 -0
  60. package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
  61. package/lib/util/button-icons.js +1 -0
  62. package/lib/util/button-icons.js.map +1 -1
  63. 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,GAAGC,KAAK,IAAI;AAC1B,QAAM;A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,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","handleOnClick","propTypes","oneOf","string","shape","func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,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"}
@@ -2,6 +2,7 @@ import test from 'ava';
2
2
  import forEach from 'lodash/forEach';
3
3
  import renderComponentMacro from '../../../test/helpers/render-component';
4
4
  import AtomSelect from '..';
5
+ import fixtureCoorpmanager from './fixtures/coorpmanager';
5
6
  import fixtureDefault from './fixtures/default';
6
7
  import fixtureDisabled from './fixtures/disabled';
7
8
  import fixtureError from './fixtures/error';
@@ -11,6 +12,7 @@ import fixtureModified from './fixtures/modified';
11
12
  import fixtureMooc from './fixtures/mooc';
12
13
  import fixtureMultipleSelected from './fixtures/multiple-selected';
13
14
  import fixtureMultiple from './fixtures/multiple';
15
+ import fixturePlayer from './fixtures/player';
14
16
  import fixtureQuestion from './fixtures/question';
15
17
  import fixtureRequiredWithTitle from './fixtures/required-with-title';
16
18
  import fixtureRequired from './fixtures/required';
@@ -24,6 +26,7 @@ test('Atom › AtomSelect > should have valid propTypes', t => {
24
26
  t.not(value, undefined, `PropType for "Atom.AtomSelect.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
25
27
  });
26
28
  });
29
+ test('Atom › AtomSelect › Coorpmanager › should be rendered', renderComponentMacro, AtomSelect, fixtureCoorpmanager);
27
30
  test('Atom › AtomSelect › Default › should be rendered', renderComponentMacro, AtomSelect, fixtureDefault);
28
31
  test('Atom › AtomSelect › Disabled › should be rendered', renderComponentMacro, AtomSelect, fixtureDisabled);
29
32
  test('Atom › AtomSelect › Error › should be rendered', renderComponentMacro, AtomSelect, fixtureError);
@@ -33,6 +36,7 @@ test('Atom › AtomSelect › Modified › should be rendered', renderComponentM
33
36
  test('Atom › AtomSelect › Mooc › should be rendered', renderComponentMacro, AtomSelect, fixtureMooc);
34
37
  test('Atom › AtomSelect › MultipleSelected › should be rendered', renderComponentMacro, AtomSelect, fixtureMultipleSelected);
35
38
  test('Atom › AtomSelect › Multiple › should be rendered', renderComponentMacro, AtomSelect, fixtureMultiple);
39
+ test('Atom › AtomSelect › Player › should be rendered', renderComponentMacro, AtomSelect, fixturePlayer);
36
40
  test('Atom › AtomSelect › Question › should be rendered', renderComponentMacro, AtomSelect, fixtureQuestion);
37
41
  test('Atom › AtomSelect › RequiredWithTitle › should be rendered', renderComponentMacro, AtomSelect, fixtureRequiredWithTitle);
38
42
  test('Atom › AtomSelect › Required › should be rendered', renderComponentMacro, AtomSelect, fixtureRequired);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/atom/select/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomSelect","fixtureDefault","fixtureDisabled","fixtureError","fixtureFilter","fixtureInvalid","fixtureModified","fixtureMooc","fixtureMultipleSelected","fixtureMultiple","fixtureQuestion","fixtureRequiredWithTitle","fixtureRequired","fixtureSort","fixtureTemplate","fixtureThematiquesLong","fixtureThematiques","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,UAAP,MAAuB,IAAvB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,wBAAP,MAAqC,gCAArC;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AAEAnB,IAAI,CAAC,iDAAD,EAAoDoB,CAAC,IAAI;AAC3DA,EAAAA,CAAC,CAACC,IAAF;AACApB,EAAAA,OAAO,CAACE,UAAU,CAACmB,SAAZ,EAAuB,CAACC,KAAD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BAAtD,EAA4EC,UAA5E,EAAwFc,eAAxF,CAAJ;AACAjB,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,UAAnF,EAA+Fe,sBAA/F,CAAJ;AACAlB,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,UAA/E,EAA2FgB,kBAA3F,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomSelect from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDisabled from './fixtures/disabled';\nimport fixtureError from './fixtures/error';\nimport fixtureFilter from './fixtures/filter';\nimport fixtureInvalid from './fixtures/invalid';\nimport fixtureModified from './fixtures/modified';\nimport fixtureMooc from './fixtures/mooc';\nimport fixtureMultipleSelected from './fixtures/multiple-selected';\nimport fixtureMultiple from './fixtures/multiple';\nimport fixtureQuestion from './fixtures/question';\nimport fixtureRequiredWithTitle from './fixtures/required-with-title';\nimport fixtureRequired from './fixtures/required';\nimport fixtureSort from './fixtures/sort';\nimport fixtureTemplate from './fixtures/template';\nimport fixtureThematiquesLong from './fixtures/thematiques-long';\nimport fixtureThematiques from './fixtures/thematiques';\n\ntest('Atom › AtomSelect > should have valid propTypes', t => {\n t.pass();\n forEach(AtomSelect.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomSelect.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomSelect › Default › should be rendered', renderComponentMacro, AtomSelect, fixtureDefault);\ntest('Atom › AtomSelect › Disabled › should be rendered', renderComponentMacro, AtomSelect, fixtureDisabled);\ntest('Atom › AtomSelect › Error › should be rendered', renderComponentMacro, AtomSelect, fixtureError);\ntest('Atom › AtomSelect › Filter › should be rendered', renderComponentMacro, AtomSelect, fixtureFilter);\ntest('Atom › AtomSelect › Invalid › should be rendered', renderComponentMacro, AtomSelect, fixtureInvalid);\ntest('Atom › AtomSelect › Modified › should be rendered', renderComponentMacro, AtomSelect, fixtureModified);\ntest('Atom › AtomSelect › Mooc › should be rendered', renderComponentMacro, AtomSelect, fixtureMooc);\ntest('Atom › AtomSelect › MultipleSelected › should be rendered', renderComponentMacro, AtomSelect, fixtureMultipleSelected);\ntest('Atom › AtomSelect › Multiple › should be rendered', renderComponentMacro, AtomSelect, fixtureMultiple);\ntest('Atom › AtomSelect › Question › should be rendered', renderComponentMacro, AtomSelect, fixtureQuestion);\ntest('Atom › AtomSelect › RequiredWithTitle › should be rendered', renderComponentMacro, AtomSelect, fixtureRequiredWithTitle);\ntest('Atom › AtomSelect › Required › should be rendered', renderComponentMacro, AtomSelect, fixtureRequired);\ntest('Atom › AtomSelect › Sort › should be rendered', renderComponentMacro, AtomSelect, fixtureSort);\ntest('Atom › AtomSelect › Template › should be rendered', renderComponentMacro, AtomSelect, fixtureTemplate);\ntest('Atom › AtomSelect › ThematiquesLong › should be rendered', renderComponentMacro, AtomSelect, fixtureThematiquesLong);\ntest('Atom › AtomSelect › Thematiques › should be rendered', renderComponentMacro, AtomSelect, fixtureThematiques);\n"],"file":"fixtures.js"}
1
+ {"version":3,"sources":["../../../../src/atom/select/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomSelect","fixtureCoorpmanager","fixtureDefault","fixtureDisabled","fixtureError","fixtureFilter","fixtureInvalid","fixtureModified","fixtureMooc","fixtureMultipleSelected","fixtureMultiple","fixturePlayer","fixtureQuestion","fixtureRequiredWithTitle","fixtureRequired","fixtureSort","fixtureTemplate","fixtureThematiquesLong","fixtureThematiques","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,UAAP,MAAuB,IAAvB;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;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,EAAqDE,oBAArD,EAA2EC,UAA3E,EAAuFM,cAAvF,CAAJ;AACAT,IAAI,CAAC,mDAAD,EAAsDE,oBAAtD,EAA4EC,UAA5E,EAAwFO,eAAxF,CAAJ;AACAV,IAAI,CAAC,+CAAD,EAAkDE,oBAAlD,EAAwEC,UAAxE,EAAoFQ,WAApF,CAAJ;AACAX,IAAI,CAAC,2DAAD,EAA8DE,oBAA9D,EAAoFC,UAApF,EAAgGS,uBAAhG,CAAJ;AACAZ,IAAI,CAAC,mDAAD,EAAsDE,oBAAtD,EAA4EC,UAA5E,EAAwFU,eAAxF,CAAJ;AACAb,IAAI,CAAC,iDAAD,EAAoDE,oBAApD,EAA0EC,UAA1E,EAAsFW,aAAtF,CAAJ;AACAd,IAAI,CAAC,mDAAD,EAAsDE,oBAAtD,EAA4EC,UAA5E,EAAwFY,eAAxF,CAAJ;AACAf,IAAI,CAAC,4DAAD,EAA+DE,oBAA/D,EAAqFC,UAArF,EAAiGa,wBAAjG,CAAJ;AACAhB,IAAI,CAAC,mDAAD,EAAsDE,oBAAtD,EAA4EC,UAA5E,EAAwFc,eAAxF,CAAJ;AACAjB,IAAI,CAAC,+CAAD,EAAkDE,oBAAlD,EAAwEC,UAAxE,EAAoFe,WAApF,CAAJ;AACAlB,IAAI,CAAC,mDAAD,EAAsDE,oBAAtD,EAA4EC,UAA5E,EAAwFgB,eAAxF,CAAJ;AACAnB,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,UAAnF,EAA+FiB,sBAA/F,CAAJ;AACApB,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,UAA/E,EAA2FkB,kBAA3F,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomSelect from '..';\nimport fixtureCoorpmanager from './fixtures/coorpmanager';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDisabled from './fixtures/disabled';\nimport fixtureError from './fixtures/error';\nimport fixtureFilter from './fixtures/filter';\nimport fixtureInvalid from './fixtures/invalid';\nimport fixtureModified from './fixtures/modified';\nimport fixtureMooc from './fixtures/mooc';\nimport fixtureMultipleSelected from './fixtures/multiple-selected';\nimport fixtureMultiple from './fixtures/multiple';\nimport fixturePlayer from './fixtures/player';\nimport fixtureQuestion from './fixtures/question';\nimport fixtureRequiredWithTitle from './fixtures/required-with-title';\nimport fixtureRequired from './fixtures/required';\nimport fixtureSort from './fixtures/sort';\nimport fixtureTemplate from './fixtures/template';\nimport fixtureThematiquesLong from './fixtures/thematiques-long';\nimport fixtureThematiques from './fixtures/thematiques';\n\ntest('Atom › AtomSelect > should have valid propTypes', t => {\n t.pass();\n forEach(AtomSelect.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomSelect.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomSelect › Coorpmanager › should be rendered', renderComponentMacro, AtomSelect, fixtureCoorpmanager);\ntest('Atom › AtomSelect › Default › should be rendered', renderComponentMacro, AtomSelect, fixtureDefault);\ntest('Atom › AtomSelect › Disabled › should be rendered', renderComponentMacro, AtomSelect, fixtureDisabled);\ntest('Atom › AtomSelect › Error › should be rendered', renderComponentMacro, AtomSelect, fixtureError);\ntest('Atom › AtomSelect › Filter › should be rendered', renderComponentMacro, AtomSelect, fixtureFilter);\ntest('Atom › AtomSelect › Invalid › should be rendered', renderComponentMacro, AtomSelect, fixtureInvalid);\ntest('Atom › AtomSelect › Modified › should be rendered', renderComponentMacro, AtomSelect, fixtureModified);\ntest('Atom › AtomSelect › Mooc › should be rendered', renderComponentMacro, AtomSelect, fixtureMooc);\ntest('Atom › AtomSelect › MultipleSelected › should be rendered', renderComponentMacro, AtomSelect, fixtureMultipleSelected);\ntest('Atom › AtomSelect › Multiple › should be rendered', renderComponentMacro, AtomSelect, fixtureMultiple);\ntest('Atom › AtomSelect › Player › should be rendered', renderComponentMacro, AtomSelect, fixturePlayer);\ntest('Atom › AtomSelect › Question › should be rendered', renderComponentMacro, AtomSelect, fixtureQuestion);\ntest('Atom › AtomSelect › RequiredWithTitle › should be rendered', renderComponentMacro, AtomSelect, fixtureRequiredWithTitle);\ntest('Atom › AtomSelect › Required › should be rendered', renderComponentMacro, AtomSelect, fixtureRequired);\ntest('Atom › AtomSelect › Sort › should be rendered', renderComponentMacro, AtomSelect, fixtureSort);\ntest('Atom › AtomSelect › Template › should be rendered', renderComponentMacro, AtomSelect, fixtureTemplate);\ntest('Atom › AtomSelect › ThematiquesLong › should be rendered', renderComponentMacro, AtomSelect, fixtureThematiquesLong);\ntest('Atom › AtomSelect › Thematiques › should be rendered', renderComponentMacro, AtomSelect, fixtureThematiques);\n"],"file":"fixtures.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"}
@@ -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 MoleculeCourseSections from '..';
5
+ import fixtureDefault from './fixtures/default';
6
+ import fixtureLoading from './fixtures/loading';
7
+ test('Molecule › MoleculeCourseSections > should have valid propTypes', t => {
8
+ t.pass();
9
+ forEach(MoleculeCourseSections.propTypes, (value, key) => {
10
+ t.not(value, undefined, `PropType for "Molecule.MoleculeCourseSections.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
11
+ });
12
+ });
13
+ test('Molecule › MoleculeCourseSections › Default › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureDefault);
14
+ test('Molecule › MoleculeCourseSections › Loading › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureLoading);
15
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/molecule/course-sections/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCourseSections","fixtureDefault","fixtureLoading","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,sBAAP,MAAmC,IAAnC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AAEAL,IAAI,CAAC,iEAAD,EAAoEM,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,sBAAsB,CAACK,SAAxB,EAAmC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2DAA0DF,GAAI,mEAAvF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,kEAAD,EAAqEE,oBAArE,EAA2FC,sBAA3F,EAAmHC,cAAnH,CAAJ;AACAJ,IAAI,CAAC,kEAAD,EAAqEE,oBAArE,EAA2FC,sBAA3F,EAAmHE,cAAnH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCourseSections from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLoading from './fixtures/loading';\n\ntest('Molecule › MoleculeCourseSections > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCourseSections.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCourseSections.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCourseSections › Default › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureDefault);\ntest('Molecule › MoleculeCourseSections › Loading › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureLoading);\n"],"file":"fixtures.js"}
@@ -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"}
@@ -2,6 +2,7 @@ import test from 'ava';
2
2
  import forEach from 'lodash/forEach';
3
3
  import renderComponentMacro from '../../../test/helpers/render-component';
4
4
  import MoleculeDraggableList from '..';
5
+ import fixtureCourseSections from './fixtures/course-sections';
5
6
  import fixtureDashboardSections from './fixtures/dashboard-sections';
6
7
  test('Molecule › MoleculeDraggableList > should have valid propTypes', t => {
7
8
  t.pass();
@@ -9,5 +10,6 @@ test('Molecule › MoleculeDraggableList > should have valid propTypes', t => {
9
10
  t.not(value, undefined, `PropType for "Molecule.MoleculeDraggableList.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
10
11
  });
11
12
  });
13
+ test('Molecule › MoleculeDraggableList › CourseSections › should be rendered', renderComponentMacro, MoleculeDraggableList, fixtureCourseSections);
12
14
  test('Molecule › MoleculeDraggableList › DashboardSections › should be rendered', renderComponentMacro, MoleculeDraggableList, fixtureDashboardSections);
13
15
  //# sourceMappingURL=fixtures.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/molecule/draggable-list/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeDraggableList","fixtureDashboardSections","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,qBAAP,MAAkC,IAAlC;AACA,OAAOC,wBAAP,MAAqC,+BAArC;AAEAJ,IAAI,CAAC,gEAAD,EAAmEK,CAAC,IAAI;AAC1EA,EAAAA,CAAC,CAACC,IAAF;AACAL,EAAAA,OAAO,CAACE,qBAAqB,CAACI,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0DAAyDF,GAAI,mEAAtF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAT,IAAI,CAAC,2EAAD,EAA8EE,oBAA9E,EAAoGC,qBAApG,EAA2HC,wBAA3H,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeDraggableList from '..';\nimport fixtureDashboardSections from './fixtures/dashboard-sections';\n\ntest('Molecule › MoleculeDraggableList > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeDraggableList.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeDraggableList.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeDraggableList › DashboardSections › should be rendered', renderComponentMacro, MoleculeDraggableList, fixtureDashboardSections);\n"],"file":"fixtures.js"}
1
+ {"version":3,"sources":["../../../../src/molecule/draggable-list/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeDraggableList","fixtureCourseSections","fixtureDashboardSections","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,qBAAP,MAAkC,IAAlC;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,OAAOC,wBAAP,MAAqC,+BAArC;AAEAL,IAAI,CAAC,gEAAD,EAAmEM,CAAC,IAAI;AAC1EA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,qBAAqB,CAACK,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0DAAyDF,GAAI,mEAAtF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,wEAAD,EAA2EE,oBAA3E,EAAiGC,qBAAjG,EAAwHC,qBAAxH,CAAJ;AACAJ,IAAI,CAAC,2EAAD,EAA8EE,oBAA9E,EAAoGC,qBAApG,EAA2HE,wBAA3H,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeDraggableList from '..';\nimport fixtureCourseSections from './fixtures/course-sections';\nimport fixtureDashboardSections from './fixtures/dashboard-sections';\n\ntest('Molecule › MoleculeDraggableList > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeDraggableList.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeDraggableList.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeDraggableList › CourseSections › should be rendered', renderComponentMacro, MoleculeDraggableList, fixtureCourseSections);\ntest('Molecule › MoleculeDraggableList › DashboardSections › should be rendered', renderComponentMacro, MoleculeDraggableList, fixtureDashboardSections);\n"],"file":"fixtures.js"}
@@ -3,7 +3,8 @@ import forEach from 'lodash/forEach';
3
3
  import renderComponentMacro from '../../../../test/helpers/render-component';
4
4
  import MoleculeQuestionsFreeText from '..';
5
5
  import fixtureDefault from './fixtures/default';
6
- import fixtureWithDefaultValue from './fixtures/with-default-value';
6
+ import fixtureWithValueOnChange from './fixtures/with-value-on-change';
7
+ import fixtureWithValue from './fixtures/with-value';
7
8
  test('MoleculeQuestions › MoleculeQuestionsFreeText > should have valid propTypes', t => {
8
9
  t.pass();
9
10
  forEach(MoleculeQuestionsFreeText.propTypes, (value, key) => {
@@ -11,5 +12,6 @@ test('MoleculeQuestions › MoleculeQuestionsFreeText > should have valid propTy
11
12
  });
12
13
  });
13
14
  test('MoleculeQuestions › MoleculeQuestionsFreeText › Default › should be rendered', renderComponentMacro, MoleculeQuestionsFreeText, fixtureDefault);
14
- test('MoleculeQuestions › MoleculeQuestionsFreeText › WithDefaultValue › should be rendered', renderComponentMacro, MoleculeQuestionsFreeText, fixtureWithDefaultValue);
15
+ test('MoleculeQuestions › MoleculeQuestionsFreeText › WithValueOnChange › should be rendered', renderComponentMacro, MoleculeQuestionsFreeText, fixtureWithValueOnChange);
16
+ test('MoleculeQuestions › MoleculeQuestionsFreeText › WithValue › should be rendered', renderComponentMacro, MoleculeQuestionsFreeText, fixtureWithValue);
15
17
  //# sourceMappingURL=fixtures.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/molecule/questions/free-text/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeQuestionsFreeText","fixtureDefault","fixtureWithDefaultValue","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,yBAAP,MAAsC,IAAtC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,uBAAP,MAAoC,+BAApC;AAEAL,IAAI,CAAC,6EAAD,EAAgFM,CAAC,IAAI;AACvFA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,yBAAyB,CAACK,SAA3B,EAAsC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC3DJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,uEAAsEF,GAAI,mEAAnG;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,8EAAD,EAAiFE,oBAAjF,EAAuGC,yBAAvG,EAAkIC,cAAlI,CAAJ;AACAJ,IAAI,CAAC,uFAAD,EAA0FE,oBAA1F,EAAgHC,yBAAhH,EAA2IE,uBAA3I,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../../test/helpers/render-component';\nimport MoleculeQuestionsFreeText from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithDefaultValue from './fixtures/with-default-value';\n\ntest('MoleculeQuestions › MoleculeQuestionsFreeText > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeQuestionsFreeText.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"MoleculeQuestions.MoleculeQuestionsFreeText.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('MoleculeQuestions › MoleculeQuestionsFreeText › Default › should be rendered', renderComponentMacro, MoleculeQuestionsFreeText, fixtureDefault);\ntest('MoleculeQuestions › MoleculeQuestionsFreeText › WithDefaultValue › should be rendered', renderComponentMacro, MoleculeQuestionsFreeText, fixtureWithDefaultValue);\n"],"file":"fixtures.js"}
1
+ {"version":3,"sources":["../../../../../src/molecule/questions/free-text/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeQuestionsFreeText","fixtureDefault","fixtureWithValueOnChange","fixtureWithValue","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,yBAAP,MAAsC,IAAtC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,wBAAP,MAAqC,iCAArC;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AAEAN,IAAI,CAAC,6EAAD,EAAgFO,CAAC,IAAI;AACvFA,EAAAA,CAAC,CAACC,IAAF;AACAP,EAAAA,OAAO,CAACE,yBAAyB,CAACM,SAA3B,EAAsC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC3DJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,uEAAsEF,GAAI,mEAAnG;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAX,IAAI,CAAC,8EAAD,EAAiFE,oBAAjF,EAAuGC,yBAAvG,EAAkIC,cAAlI,CAAJ;AACAJ,IAAI,CAAC,wFAAD,EAA2FE,oBAA3F,EAAiHC,yBAAjH,EAA4IE,wBAA5I,CAAJ;AACAL,IAAI,CAAC,gFAAD,EAAmFE,oBAAnF,EAAyGC,yBAAzG,EAAoIG,gBAApI,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../../test/helpers/render-component';\nimport MoleculeQuestionsFreeText from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithValueOnChange from './fixtures/with-value-on-change';\nimport fixtureWithValue from './fixtures/with-value';\n\ntest('MoleculeQuestions › MoleculeQuestionsFreeText > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeQuestionsFreeText.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"MoleculeQuestions.MoleculeQuestionsFreeText.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('MoleculeQuestions › MoleculeQuestionsFreeText › Default › should be rendered', renderComponentMacro, MoleculeQuestionsFreeText, fixtureDefault);\ntest('MoleculeQuestions › MoleculeQuestionsFreeText › WithValueOnChange › should be rendered', renderComponentMacro, MoleculeQuestionsFreeText, fixtureWithValueOnChange);\ntest('MoleculeQuestions › MoleculeQuestionsFreeText › WithValue › should be rendered', renderComponentMacro, MoleculeQuestionsFreeText, fixtureWithValue);\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,cAA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AAAA,WAAW,EAAEtB,SAAS,CAAC6C,MAFS;AAGhCxB,EAAAA,WAAW,EAAErB,SAAS,CAAC8C,KAAV,CAAgB;AAC3BT,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"}