@coorpacademy/components 10.12.0 → 10.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/es/{molecule → atom}/checkbox-with-title/index.js +0 -0
  2. package/es/atom/checkbox-with-title/index.js.map +1 -0
  3. package/es/{molecule → atom}/checkbox-with-title/style.css +0 -0
  4. package/es/{molecule → atom}/checkbox-with-title/test/fixtures/checked.js +0 -0
  5. package/es/atom/checkbox-with-title/test/fixtures/checked.js.map +1 -0
  6. package/es/{molecule → atom}/checkbox-with-title/test/fixtures/unchecked.js +0 -0
  7. package/es/atom/checkbox-with-title/test/fixtures/unchecked.js.map +1 -0
  8. package/es/atom/checkbox-with-title/test/fixtures.js +15 -0
  9. package/es/atom/checkbox-with-title/test/fixtures.js.map +1 -0
  10. package/es/atom/input-text/index.js +9 -3
  11. package/es/atom/input-text/index.js.map +1 -1
  12. package/es/atom/input-text-with-title/index.js +35 -0
  13. package/es/atom/input-text-with-title/index.js.map +1 -0
  14. package/es/atom/input-text-with-title/style.css +24 -0
  15. package/es/atom/input-text-with-title/test/fixtures/default.js +12 -0
  16. package/es/atom/input-text-with-title/test/fixtures/default.js.map +1 -0
  17. package/es/atom/input-text-with-title/test/fixtures/error.js +13 -0
  18. package/es/atom/input-text-with-title/test/fixtures/error.js.map +1 -0
  19. package/es/atom/input-text-with-title/test/fixtures.js +15 -0
  20. package/es/atom/input-text-with-title/test/fixtures.js.map +1 -0
  21. package/es/atom/review-header-step-item/index.js +55 -0
  22. package/es/atom/review-header-step-item/index.js.map +1 -0
  23. package/es/atom/review-header-step-item/style.css +71 -0
  24. package/es/atom/review-header-step-item/test/fixtures/current.js +8 -0
  25. package/es/atom/review-header-step-item/test/fixtures/current.js.map +1 -0
  26. package/es/atom/review-header-step-item/test/fixtures/default.js +8 -0
  27. package/es/atom/review-header-step-item/test/fixtures/default.js.map +1 -0
  28. package/es/atom/review-header-step-item/test/fixtures/right.js +8 -0
  29. package/es/atom/review-header-step-item/test/fixtures/right.js.map +1 -0
  30. package/es/atom/review-header-step-item/test/fixtures/wrong.js +8 -0
  31. package/es/atom/review-header-step-item/test/fixtures/wrong.js.map +1 -0
  32. package/es/atom/select/style.css +1 -0
  33. package/es/molecule/course-sections/index.js +16 -3
  34. package/es/molecule/course-sections/index.js.map +1 -1
  35. package/es/molecule/course-sections/style.css +4 -0
  36. package/es/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js +11 -0
  37. package/es/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js.map +1 -0
  38. package/es/molecule/course-sections/test/fixtures.js +2 -0
  39. package/es/molecule/course-sections/test/fixtures.js.map +1 -1
  40. package/es/molecule/input-text-with-titeled-checkbox/index.js +63 -0
  41. package/es/molecule/input-text-with-titeled-checkbox/index.js.map +1 -0
  42. package/es/molecule/input-text-with-titeled-checkbox/style.css +3 -0
  43. package/es/molecule/input-text-with-titeled-checkbox/test/fixtures/checked.js +16 -0
  44. package/es/molecule/input-text-with-titeled-checkbox/test/fixtures/checked.js.map +1 -0
  45. package/es/molecule/input-text-with-titeled-checkbox/test/fixtures/unchecked.js +18 -0
  46. package/es/molecule/input-text-with-titeled-checkbox/test/fixtures/unchecked.js.map +1 -0
  47. package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js +15 -0
  48. package/es/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +1 -0
  49. package/es/molecule/review-header-steps/index.js +26 -0
  50. package/es/molecule/review-header-steps/index.js.map +1 -0
  51. package/es/molecule/review-header-steps/style.css +6 -0
  52. package/es/molecule/review-header-steps/test/fixtures/all-questions-ok.js +26 -0
  53. package/es/molecule/review-header-steps/test/fixtures/all-questions-ok.js.map +1 -0
  54. package/es/molecule/review-header-steps/test/fixtures/current-question-no-aswered.js +26 -0
  55. package/es/molecule/review-header-steps/test/fixtures/current-question-no-aswered.js.map +1 -0
  56. package/es/molecule/review-header-steps/test/fixtures/current-question-wrong.js +26 -0
  57. package/es/molecule/review-header-steps/test/fixtures/current-question-wrong.js.map +1 -0
  58. package/es/molecule/review-header-steps/test/fixtures/first-question-current-right.js +26 -0
  59. package/es/molecule/review-header-steps/test/fixtures/first-question-current-right.js.map +1 -0
  60. package/es/molecule/review-header-steps/test/fixtures/no-answered-question.js +26 -0
  61. package/es/molecule/review-header-steps/test/fixtures/no-answered-question.js.map +1 -0
  62. package/es/molecule/review-header-steps/test/fixtures/question-to-repeat.js +26 -0
  63. package/es/molecule/review-header-steps/test/fixtures/question-to-repeat.js.map +1 -0
  64. package/es/organism/wizard-contents/style.css +0 -1
  65. package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +1 -1
  66. package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -1
  67. package/lib/{molecule → atom}/checkbox-with-title/index.js +0 -0
  68. package/lib/atom/checkbox-with-title/index.js.map +1 -0
  69. package/lib/{molecule → atom}/checkbox-with-title/style.css +0 -0
  70. package/lib/{molecule → atom}/checkbox-with-title/test/fixtures/checked.js +0 -0
  71. package/lib/atom/checkbox-with-title/test/fixtures/checked.js.map +1 -0
  72. package/lib/{molecule → atom}/checkbox-with-title/test/fixtures/unchecked.js +0 -0
  73. package/lib/atom/checkbox-with-title/test/fixtures/unchecked.js.map +1 -0
  74. package/lib/atom/checkbox-with-title/test/fixtures.js +25 -0
  75. package/lib/atom/checkbox-with-title/test/fixtures.js.map +1 -0
  76. package/lib/atom/input-text/index.js +9 -3
  77. package/lib/atom/input-text/index.js.map +1 -1
  78. package/lib/atom/input-text-with-title/index.js +46 -0
  79. package/lib/atom/input-text-with-title/index.js.map +1 -0
  80. package/lib/atom/input-text-with-title/style.css +24 -0
  81. package/lib/atom/input-text-with-title/test/fixtures/default.js +21 -0
  82. package/lib/atom/input-text-with-title/test/fixtures/default.js.map +1 -0
  83. package/lib/atom/input-text-with-title/test/fixtures/error.js +22 -0
  84. package/lib/atom/input-text-with-title/test/fixtures/error.js.map +1 -0
  85. package/lib/atom/input-text-with-title/test/fixtures.js +25 -0
  86. package/lib/atom/input-text-with-title/test/fixtures.js.map +1 -0
  87. package/lib/atom/review-header-step-item/index.js +67 -0
  88. package/lib/atom/review-header-step-item/index.js.map +1 -0
  89. package/lib/atom/review-header-step-item/style.css +71 -0
  90. package/lib/atom/review-header-step-item/test/fixtures/current.js +13 -0
  91. package/lib/atom/review-header-step-item/test/fixtures/current.js.map +1 -0
  92. package/lib/atom/review-header-step-item/test/fixtures/default.js +13 -0
  93. package/lib/atom/review-header-step-item/test/fixtures/default.js.map +1 -0
  94. package/lib/atom/review-header-step-item/test/fixtures/right.js +13 -0
  95. package/lib/atom/review-header-step-item/test/fixtures/right.js.map +1 -0
  96. package/lib/atom/review-header-step-item/test/fixtures/wrong.js +13 -0
  97. package/lib/atom/review-header-step-item/test/fixtures/wrong.js.map +1 -0
  98. package/lib/atom/select/style.css +1 -0
  99. package/lib/molecule/course-sections/index.js +17 -3
  100. package/lib/molecule/course-sections/index.js.map +1 -1
  101. package/lib/molecule/course-sections/style.css +4 -0
  102. package/lib/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js +21 -0
  103. package/lib/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js.map +1 -0
  104. package/lib/molecule/course-sections/test/fixtures.js +3 -0
  105. package/lib/molecule/course-sections/test/fixtures.js.map +1 -1
  106. package/lib/molecule/input-text-with-titeled-checkbox/index.js +75 -0
  107. package/lib/molecule/input-text-with-titeled-checkbox/index.js.map +1 -0
  108. package/lib/molecule/input-text-with-titeled-checkbox/style.css +3 -0
  109. package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures/checked.js +21 -0
  110. package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures/checked.js.map +1 -0
  111. package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures/unchecked.js +23 -0
  112. package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures/unchecked.js.map +1 -0
  113. package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js +25 -0
  114. package/lib/molecule/input-text-with-titeled-checkbox/test/fixtures.js.map +1 -0
  115. package/lib/molecule/review-header-steps/index.js +38 -0
  116. package/lib/molecule/review-header-steps/index.js.map +1 -0
  117. package/lib/molecule/review-header-steps/style.css +6 -0
  118. package/lib/molecule/review-header-steps/test/fixtures/all-questions-ok.js +31 -0
  119. package/lib/molecule/review-header-steps/test/fixtures/all-questions-ok.js.map +1 -0
  120. package/lib/molecule/review-header-steps/test/fixtures/current-question-no-aswered.js +31 -0
  121. package/lib/molecule/review-header-steps/test/fixtures/current-question-no-aswered.js.map +1 -0
  122. package/lib/molecule/review-header-steps/test/fixtures/current-question-wrong.js +31 -0
  123. package/lib/molecule/review-header-steps/test/fixtures/current-question-wrong.js.map +1 -0
  124. package/lib/molecule/review-header-steps/test/fixtures/first-question-current-right.js +31 -0
  125. package/lib/molecule/review-header-steps/test/fixtures/first-question-current-right.js.map +1 -0
  126. package/lib/molecule/review-header-steps/test/fixtures/no-answered-question.js +31 -0
  127. package/lib/molecule/review-header-steps/test/fixtures/no-answered-question.js.map +1 -0
  128. package/lib/molecule/review-header-steps/test/fixtures/question-to-repeat.js +31 -0
  129. package/lib/molecule/review-header-steps/test/fixtures/question-to-repeat.js.map +1 -0
  130. package/lib/organism/wizard-contents/style.css +0 -1
  131. package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +2 -2
  132. package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -1
  133. package/package.json +2 -2
  134. package/es/molecule/checkbox-with-title/index.js.map +0 -1
  135. package/es/molecule/checkbox-with-title/test/fixtures/checked.js.map +0 -1
  136. package/es/molecule/checkbox-with-title/test/fixtures/unchecked.js.map +0 -1
  137. package/es/molecule/cockpit-popin/test/fixtures.js +0 -17
  138. package/es/molecule/cockpit-popin/test/fixtures.js.map +0 -1
  139. package/lib/molecule/checkbox-with-title/index.js.map +0 -1
  140. package/lib/molecule/checkbox-with-title/test/fixtures/checked.js.map +0 -1
  141. package/lib/molecule/checkbox-with-title/test/fixtures/unchecked.js.map +0 -1
  142. package/lib/molecule/cockpit-popin/test/fixtures.js +0 -28
  143. package/lib/molecule/cockpit-popin/test/fixtures.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/atom/checkbox-with-title/index.js"],"names":["React","useMemo","PropTypes","NovaSolidStatusValidate","CheckIcon","style","CheckboxWithTitle","props","title","name","checked","onChange","dataName","ariaLabel","idCheckbox","handleChange","e","target","container","checkbox","label","icon","propTypes","string","bool","func"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,uBAAuB,IAAIC,SAAnC,QAAmD,0BAAnD;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,iBAAiB,GAAGC,KAAK,IAAI;AACjC,QAAM;AACJC,IAAAA,KADI;AAEJC,IAAAA,IAFI;AAGJC,IAAAA,OAHI;AAIJC,IAAAA,QAAQ,QAJJ;AAKJ,iBAAaC,QALT;AAMJ,kBAAcC;AANV,MAOFN,KAPJ;;AASA,QAAMO,UAAU,GAAG,UAAS,iBAAT,CAAnB;;AACA,QAAMC,YAAY,GAAGd,OAAO,CAAC,MAAMe,CAAC,IAAIL,QAAQ,CAACK,CAAC,CAACC,MAAF,CAASP,OAAV,CAApB,EAAwC,CAACC,QAAD,CAAxC,CAA5B;AAEA,sBACE;AAAO,IAAA,SAAS,EAAEN,KAAK,CAACa,SAAxB;AAAmC,IAAA,OAAO,EAAEJ;AAA5C,kBACE;AACE,IAAA,IAAI,EAAC,UADP;AAEE,IAAA,EAAE,EAAEA,UAFN;AAGE,IAAA,IAAI,EAAEL,IAHR;AAIE,IAAA,QAAQ,EAAEM,YAJZ;AAKE,IAAA,OAAO,EAAEL,OALX;AAME,IAAA,SAAS,EAAEL,KAAK,CAACc,QANnB;AAOE,iBAAWP,QAPb;AAQE,kBAAYC;AARd,IADF,eAWE;AAAK,IAAA,SAAS,EAAER,KAAK,CAACe;AAAtB,kBACE,oBAAC,SAAD;AAAW,IAAA,SAAS,EAAEf,KAAK,CAACgB;AAA5B,IADF,CAXF,eAcE;AAAM,IAAA,SAAS,EAAEhB,KAAK,CAACG;AAAvB,KAA+BA,KAA/B,CAdF,CADF;AAkBD,CA/BD;;AAiCAF,iBAAiB,CAACgB,SAAlB,2CAA8B;AAC5Bd,EAAAA,KAAK,EAAEN,SAAS,CAACqB,MADW;AAE5Bd,EAAAA,IAAI,EAAEP,SAAS,CAACqB,MAFY;AAG5Bb,EAAAA,OAAO,EAAER,SAAS,CAACsB,IAHS;AAI5Bb,EAAAA,QAAQ,EAAET,SAAS,CAACuB,IAJQ;AAK5B,gBAAcvB,SAAS,CAACqB,MALI;AAM5B,eAAarB,SAAS,CAACqB;AANK,CAA9B;AAQA,eAAejB,iBAAf","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, uniqueId} from 'lodash/fp';\nimport {NovaSolidStatusValidate as CheckIcon} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst CheckboxWithTitle = props => {\n const {\n title,\n name,\n checked,\n onChange = noop,\n 'data-name': dataName,\n 'aria-label': ariaLabel\n } = props;\n\n const idCheckbox = uniqueId('input-checkbox-');\n const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);\n\n return (\n <label className={style.container} htmlFor={idCheckbox}>\n <input\n type=\"checkbox\"\n id={idCheckbox}\n name={name}\n onChange={handleChange}\n checked={checked}\n className={style.checkbox}\n data-name={dataName}\n aria-label={ariaLabel}\n />\n <div className={style.label}>\n <CheckIcon className={style.icon} />\n </div>\n <span className={style.title}>{title}</span>\n </label>\n );\n};\n\nCheckboxWithTitle.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n checked: PropTypes.bool,\n onChange: PropTypes.func,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string\n};\nexport default CheckboxWithTitle;\n"],"file":"index.js"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/checkbox-with-title/test/fixtures/checked.js"],"names":["props","title","checked","onChange","value","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,WADF;AAELC,IAAAA,OAAO,EAAE,IAFJ;AAGLC,IAAAA,QAAQ,EAAEC,KAAK,IAAIC,OAAO,CAACC,GAAR,CAAYF,KAAZ;AAHd;AADM,CAAf","sourcesContent":["export default {\n props: {\n title: 'Add stars',\n checked: true,\n onChange: value => console.log(value)\n }\n};\n"],"file":"checked.js"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/checkbox-with-title/test/fixtures/unchecked.js"],"names":["props","title","checked","onChange","value","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,cADF;AAELC,IAAAA,OAAO,EAAE,KAFJ;AAGLC,IAAAA,QAAQ,EAAEC,KAAK,IAAIC,OAAO,CAACC,GAAR,CAAYF,KAAZ;AAHd;AADM,CAAf","sourcesContent":["export default {\n props: {\n title: 'Create badge',\n checked: false,\n onChange: value => console.log(value)\n }\n};\n"],"file":"unchecked.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 AtomCheckboxWithTitle from '..';
5
+ import fixtureChecked from './fixtures/checked';
6
+ import fixtureUnchecked from './fixtures/unchecked';
7
+ test('Atom › AtomCheckboxWithTitle > should have valid propTypes', t => {
8
+ t.pass();
9
+ forEach(AtomCheckboxWithTitle.propTypes, (value, key) => {
10
+ t.not(value, undefined, `PropType for "Atom.AtomCheckboxWithTitle.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
11
+ });
12
+ });
13
+ test('Atom › AtomCheckboxWithTitle › Checked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureChecked);
14
+ test('Atom › AtomCheckboxWithTitle › Unchecked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureUnchecked);
15
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/atom/checkbox-with-title/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomCheckboxWithTitle","fixtureChecked","fixtureUnchecked","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,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AAEAL,IAAI,CAAC,4DAAD,EAA+DM,CAAC,IAAI;AACtEA,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,sDAAqDF,GAAI,mEAAlF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,6DAAD,EAAgEE,oBAAhE,EAAsFC,qBAAtF,EAA6GC,cAA7G,CAAJ;AACAJ,IAAI,CAAC,+DAAD,EAAkEE,oBAAlE,EAAwFC,qBAAxF,EAA+GE,gBAA/G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomCheckboxWithTitle from '..';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureUnchecked from './fixtures/unchecked';\n\ntest('Atom › AtomCheckboxWithTitle > should have valid propTypes', t => {\n t.pass();\n forEach(AtomCheckboxWithTitle.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomCheckboxWithTitle.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomCheckboxWithTitle › Checked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureChecked);\ntest('Atom › AtomCheckboxWithTitle › Unchecked › should be rendered', renderComponentMacro, AtomCheckboxWithTitle, fixtureUnchecked);\n"],"file":"fixtures.js"}
@@ -29,7 +29,9 @@ const InputText = props => {
29
29
  description,
30
30
  disabled,
31
31
  modified = false,
32
- title: propsTitle
32
+ title: propsTitle,
33
+ 'data-name': dataName = 'input-text',
34
+ 'aria-label': ariaLabel = 'Input Text'
33
35
  } = props;
34
36
  const isCMTheme = theme === 'coorpmanager';
35
37
  const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);
@@ -73,7 +75,9 @@ const InputText = props => {
73
75
  value: value,
74
76
  onInput: handleChange,
75
77
  disabled: disabled,
76
- onChange: _noop
78
+ onChange: _noop,
79
+ "data-name": dataName,
80
+ "aria-label": ariaLabel
77
81
  }), errorIconView, validIconView, hintView), descriptionView);
78
82
  };
79
83
 
@@ -90,7 +94,9 @@ InputText.propTypes = process.env.NODE_ENV !== "production" ? {
90
94
  onChange: PropTypes.func,
91
95
  description: PropTypes.string,
92
96
  modified: PropTypes.bool,
93
- valid: PropTypes.bool
97
+ valid: PropTypes.bool,
98
+ 'aria-label': PropTypes.string,
99
+ 'data-name': PropTypes.string
94
100
  } : {};
95
101
  export default InputText;
96
102
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/atom/input-text/index.js"],"names":["React","useMemo","PropTypes","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","classnames","getClassState","style","themeStyle","setup","coorpmanager","cockpit","default","InputText","props","autoFocus","placeholder","value","hint","defaultValue","onChange","error","valid","theme","description","disabled","modified","title","propsTitle","isCMTheme","handleChange","e","target","mainClass","className","descriptionView","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","hintView","__html","errorIconView","leftIcon","validIconView","isNoTitle","noValue","input","propTypes","bool","string","oneOf","func"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,2BAA2B,IAAIC,SADjC,EAEEC,oBAAoB,IAAIC,SAF1B,EAGEC,0CAA0C,IAAIC,QAHhD,QAIO,0BAJP;AAKA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,KAAK,EAAEF,KAAK,CAACE,KADI;AAEjBC,EAAAA,YAAY,EAAEH,KAAK,CAACG,YAFH;AAGjBC,EAAAA,OAAO,EAAEJ,KAAK,CAACI,OAHE;AAIjBC,EAAAA,OAAO,EAAEL,KAAK,CAACK;AAJE,CAAnB;;AAMA,MAAMC,SAAS,GAAGC,KAAK,IAAI;AACzB,QAAM;AACJC,IAAAA,SAAS,GAAG,KADR;AAEJC,IAAAA,WAAW,GAAG,EAFV;AAGJC,IAAAA,KAHI;AAIJC,IAAAA,IAJI;AAKJC,IAAAA,YALI;AAMJC,IAAAA,QAAQ,QANJ;AAOJC,IAAAA,KAPI;AAQJC,IAAAA,KARI;AASJC,IAAAA,KAAK,GAAG,SATJ;AAUJC,IAAAA,WAVI;AAWJC,IAAAA,QAXI;AAYJC,IAAAA,QAAQ,GAAG,KAZP;AAaJC,IAAAA,KAAK,EAAEC;AAbH,MAcFd,KAdJ;AAgBA,QAAMe,SAAS,GAAGN,KAAK,KAAK,cAA5B;AACA,QAAMO,YAAY,GAAGjC,OAAO,CAAC,MAAMkC,CAAC,IAAIX,QAAQ,CAACW,CAAC,CAACC,MAAF,CAASf,KAAV,CAApB,EAAsC,CAACG,QAAD,CAAtC,CAA5B;AACA,QAAMa,SAAS,GAAGzB,UAAU,CAACe,KAAD,CAA5B;AACA,QAAMW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ACmD,IAZA;AAapB3B,EAAAA,KAAK,EAAExB,SAAS,CAACmD;AAbG,CAAtB;AAeA,eAAepC,SAAf","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, isNil, keys, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n coorpmanager: style.coorpmanager,\n cockpit: style.cockpit,\n default: style.default\n};\nconst InputText = props => {\n const {\n autoFocus = false,\n placeholder = '',\n value,\n hint,\n defaultValue,\n onChange = noop,\n error,\n valid,\n theme = 'default',\n description,\n disabled,\n modified = false,\n title: propsTitle\n } = props;\n\n const isCMTheme = theme === 'coorpmanager';\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const mainClass = themeStyle[theme];\n const className = getClassState(style.default, style.modified, style.error, modified, error);\n const descriptionView =\n description && theme !== 'coorpmanager' ? (\n <div className={style.description}>{description}</div>\n ) : null;\n const toolTipView =\n description && theme === 'coorpmanager' ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null;\n const hintView =\n theme === 'coorpmanager' ? (\n <div\n className={style.hint}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: error || hint}}\n />\n ) : null;\n const errorIconView = isCMTheme && error ? <ErrorIcon className={style.leftIcon} /> : null;\n const validIconView = isCMTheme && valid ? <CheckIcon className={style.leftIcon} /> : null;\n\n return (\n <div\n className={classnames(\n mainClass,\n className,\n disabled && style.disabled,\n isNil(propsTitle) && style.isNoTitle\n )}\n >\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {propsTitle}\n {toolTipView}\n </span>\n\n <input\n autoFocus={autoFocus}\n type=\"text\"\n name={propsTitle}\n className={style.input}\n placeholder={placeholder}\n defaultValue={defaultValue}\n autoComplete={'off'}\n value={value}\n onInput={handleChange}\n disabled={disabled}\n onChange={noop}\n />\n {errorIconView}\n {validIconView}\n {hintView}\n </label>\n {descriptionView}\n </div>\n );\n};\n\nInputText.propTypes = {\n autoFocus: PropTypes.bool,\n title: PropTypes.string,\n placeholder: PropTypes.string,\n defaultValue: PropTypes.string,\n theme: PropTypes.oneOf(keys(themeStyle)),\n disabled: PropTypes.bool,\n value: PropTypes.string,\n hint: PropTypes.string,\n error: PropTypes.string,\n onChange: PropTypes.func,\n description: PropTypes.string,\n modified: PropTypes.bool,\n valid: PropTypes.bool\n};\nexport default InputText;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/atom/input-text/index.js"],"names":["React","useMemo","PropTypes","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","classnames","getClassState","style","themeStyle","setup","coorpmanager","cockpit","default","InputText","props","autoFocus","placeholder","value","hint","defaultValue","onChange","error","valid","theme","description","disabled","modified","title","propsTitle","dataName","ariaLabel","isCMTheme","handleChange","e","target","mainClass","className","descriptionView","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","hintView","__html","errorIconView","leftIcon","validIconView","isNoTitle","noValue","input","propTypes","bool","string","oneOf","func"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,2BAA2B,IAAIC,SADjC,EAEEC,oBAAoB,IAAIC,SAF1B,EAGEC,0CAA0C,IAAIC,QAHhD,QAIO,0BAJP;AAKA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,KAAK,E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IAAA,YAAY,EAAE,KAPhB;AAQE,IAAA,KAAK,EAAEF,KART;AASE,IAAA,OAAO,EAAEe,YATX;AAUE,IAAA,QAAQ,EAAEP,QAVZ;AAWE,IAAA,QAAQ,OAXV;AAYE,iBAAWI,QAZb;AAaE,kBAAYC;AAbd,IANF,EAqBGc,aArBH,EAsBGE,aAtBH,EAuBGJ,QAvBH,CARF,EAiCGL,eAjCH,CADF;AAqCD,CAlFD;;AAoFAxB,SAAS,CAACqC,SAAV,2CAAsB;AACpBnC,EAAAA,SAAS,EAAEjB,SAAS,CAACqD,IADD;AAEpBxB,EAAAA,KAAK,EAAE7B,SAAS,CAACsD,MAFG;AAGpBpC,EAAAA,WAAW,EAAElB,SAAS,CAACsD,MAHH;AAIpBjC,EAAAA,YAAY,EAAErB,SAAS,CAACsD,MAJJ;AAKpB7B,EAAAA,KAAK,EAAEzB,SAAS,CAACuD,KAAV,CAAgB,MAAK7C,UAAL,CAAhB,CALa;AAMpBiB,EAAAA,QAAQ,EAAE3B,SAAS,CAACqD,IANA;AAOpBlC,EAAAA,KAAK,EAAEnB,SAAS,CAACsD,MAPG;AAQpBlC,EAAAA,IAAI,EAAEpB,SAAS,CAACsD,MARI;AASpB/B,EAAAA,KAAK,EAAEvB,SAAS,CAACsD,MATG;AAUpBhC,EAAAA,QAAQ,EAAEtB,SAAS,CAACwD,IAVA;AAWpB9B,EAAAA,WAAW,EAAE1B,SAAS,CAACsD,MAXH;AAYpB1B,EAAAA,QAAQ,EAAE5B,SAAS,CAACqD,IAZA;AAapB7B,EAAAA,KAAK,EAAExB,SAAS,CAACqD,IAbG;AAcpB,gBAAcrD,SAAS,CAACsD,MAdJ;AAepB,eAAatD,SAAS,CAACsD;AAfH,CAAtB;AAiBA,eAAevC,SAAf","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, isNil, keys, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n coorpmanager: style.coorpmanager,\n cockpit: style.cockpit,\n default: style.default\n};\nconst InputText = props => {\n const {\n autoFocus = false,\n placeholder = '',\n value,\n hint,\n defaultValue,\n onChange = noop,\n error,\n valid,\n theme = 'default',\n description,\n disabled,\n modified = false,\n title: propsTitle,\n 'data-name': dataName = 'input-text',\n 'aria-label': ariaLabel = 'Input Text'\n } = props;\n\n const isCMTheme = theme === 'coorpmanager';\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const mainClass = themeStyle[theme];\n const className = getClassState(style.default, style.modified, style.error, modified, error);\n const descriptionView =\n description && theme !== 'coorpmanager' ? (\n <div className={style.description}>{description}</div>\n ) : null;\n const toolTipView =\n description && theme === 'coorpmanager' ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null;\n const hintView =\n theme === 'coorpmanager' ? (\n <div\n className={style.hint}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: error || hint}}\n />\n ) : null;\n const errorIconView = isCMTheme && error ? <ErrorIcon className={style.leftIcon} /> : null;\n const validIconView = isCMTheme && valid ? <CheckIcon className={style.leftIcon} /> : null;\n\n return (\n <div\n className={classnames(\n mainClass,\n className,\n disabled && style.disabled,\n isNil(propsTitle) && style.isNoTitle\n )}\n >\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {propsTitle}\n {toolTipView}\n </span>\n\n <input\n autoFocus={autoFocus}\n type=\"text\"\n name={propsTitle}\n className={style.input}\n placeholder={placeholder}\n defaultValue={defaultValue}\n autoComplete={'off'}\n value={value}\n onInput={handleChange}\n disabled={disabled}\n onChange={noop}\n data-name={dataName}\n aria-label={ariaLabel}\n />\n {errorIconView}\n {validIconView}\n {hintView}\n </label>\n {descriptionView}\n </div>\n );\n};\n\nInputText.propTypes = {\n autoFocus: PropTypes.bool,\n title: PropTypes.string,\n placeholder: PropTypes.string,\n defaultValue: PropTypes.string,\n theme: PropTypes.oneOf(keys(themeStyle)),\n disabled: PropTypes.bool,\n value: PropTypes.string,\n hint: PropTypes.string,\n error: PropTypes.string,\n onChange: PropTypes.func,\n description: PropTypes.string,\n modified: PropTypes.bool,\n valid: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string\n};\nexport default InputText;\n"],"file":"index.js"}
@@ -0,0 +1,35 @@
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 PropTypes from 'prop-types';
5
+ import InputText from '../input-text';
6
+ import style from './style.css';
7
+
8
+ const InputTextWithTitle = props => {
9
+ const {
10
+ inputText,
11
+ title,
12
+ 'data-name': dataName,
13
+ 'aria-label': ariaLabel
14
+ } = props;
15
+ return /*#__PURE__*/React.createElement("div", {
16
+ className: style.container,
17
+ "data-name": dataName,
18
+ "aria-label": ariaLabel
19
+ }, /*#__PURE__*/React.createElement("span", {
20
+ className: style.title
21
+ }, title), /*#__PURE__*/React.createElement("div", {
22
+ className: style.inputText
23
+ }, /*#__PURE__*/React.createElement(InputText, inputText)));
24
+ };
25
+
26
+ InputTextWithTitle.propTypes = process.env.NODE_ENV !== "production" ? {
27
+ inputText: PropTypes.shape(_extends(_extends({}, InputText.propTypes), {}, {
28
+ theme: PropTypes.string
29
+ })),
30
+ title: PropTypes.string,
31
+ 'aria-label': PropTypes.string,
32
+ 'data-name': PropTypes.string
33
+ } : {};
34
+ export default InputTextWithTitle;
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/atom/input-text-with-title/index.js"],"names":["React","PropTypes","InputText","style","InputTextWithTitle","props","inputText","title","dataName","ariaLabel","container","propTypes","shape","theme","string"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AAACC,IAAAA,SAAD;AAAYC,IAAAA,KAAZ;AAAmB,iBAAaC,QAAhC;AAA0C,kBAAcC;AAAxD,MAAqEJ,KAA3E;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEF,KAAK,CAACO,SAAtB;AAAiC,iBAAWF,QAA5C;AAAsD,kBAAYC;AAAlE,kBACE;AAAM,IAAA,SAAS,EAAEN,KAAK,CAACI;AAAvB,KAA+BA,KAA/B,CADF,eAEE;AAAK,IAAA,SAAS,EAAEJ,KAAK,CAACG;AAAtB,kBACE,oBAAC,SAAD,EAAeA,SAAf,CADF,CAFF,CADF;AAQD,CAXD;;AAaAF,kBAAkB,CAACO,SAAnB,2CAA+B;AAC7BL,EAAAA,SAAS,EAAEL,SAAS,CAACW,KAAV,uBAAoBV,SAAS,CAACS,SAA9B;AAAyCE,IAAAA,KAAK,EAAEZ,SAAS,CAACa;AAA1D,KADkB;AAE7BP,EAAAA,KAAK,EAAEN,SAAS,CAACa,MAFY;AAG7B,gBAAcb,SAAS,CAACa,MAHK;AAI7B,eAAab,SAAS,CAACa;AAJM,CAA/B;AAMA,eAAeV,kBAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport InputText from '../input-text';\nimport style from './style.css';\n\nconst InputTextWithTitle = props => {\n const {inputText, title, 'data-name': dataName, 'aria-label': ariaLabel} = props;\n\n return (\n <div className={style.container} data-name={dataName} aria-label={ariaLabel}>\n <span className={style.title}>{title}</span>\n <div className={style.inputText}>\n <InputText {...inputText} />\n </div>\n </div>\n );\n};\n\nInputTextWithTitle.propTypes = {\n inputText: PropTypes.shape({...InputText.propTypes, theme: PropTypes.string}),\n title: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string\n};\nexport default InputTextWithTitle;\n"],"file":"index.js"}
@@ -0,0 +1,24 @@
1
+ @value colors: "../../variables/colors.css";
2
+ @value white from colors;
3
+ @value dark from colors;
4
+ @value cm_grey_200 from colors;
5
+ @value cm_grey_100 from colors;
6
+ @value black from colors;
7
+ @value cm_primary_blue from colors;
8
+
9
+ .container {
10
+ display: flex;
11
+ flex-direction: column;
12
+ }
13
+
14
+ .title {
15
+ padding-bottom: 8px;
16
+ font-family: "Gilroy";
17
+ font-weight: bold;
18
+ font-size: 16px;
19
+ font-style: normal;
20
+ }
21
+
22
+ .inputText {
23
+ width: 173px;
24
+ }
@@ -0,0 +1,12 @@
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 inputText from '../../../input-text/test/fixtures/cm-default';
4
+ export default {
5
+ props: {
6
+ title: 'Mandatory courses to complete certification',
7
+ inputText: _extends(_extends({}, inputText.props), {}, {
8
+ hint: ''
9
+ })
10
+ }
11
+ };
12
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/input-text-with-title/test/fixtures/default.js"],"names":["inputText","props","title","hint"],"mappings":";;AAAA,OAAOA,SAAP,MAAsB,8CAAtB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,6CADF;AAELF,IAAAA,SAAS,wBAAMA,SAAS,CAACC,KAAhB;AAAuBE,MAAAA,IAAI,EAAE;AAA7B;AAFJ;AADM,CAAf","sourcesContent":["import inputText from '../../../input-text/test/fixtures/cm-default';\n\nexport default {\n props: {\n title: 'Mandatory courses to complete certification',\n inputText: {...inputText.props, hint: ''}\n }\n};\n"],"file":"default.js"}
@@ -0,0 +1,13 @@
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 inputText from '../../../input-text/test/fixtures/cm-default';
4
+ export default {
5
+ props: {
6
+ title: 'Mandatory courses to complete certification',
7
+ inputText: _extends(_extends({}, inputText.props), {}, {
8
+ error: 'this is error',
9
+ hint: ''
10
+ })
11
+ }
12
+ };
13
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/input-text-with-title/test/fixtures/error.js"],"names":["inputText","props","title","error","hint"],"mappings":";;AAAA,OAAOA,SAAP,MAAsB,8CAAtB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,6CADF;AAELF,IAAAA,SAAS,wBAAMA,SAAS,CAACC,KAAhB;AAAuBE,MAAAA,KAAK,EAAE,eAA9B;AAA+CC,MAAAA,IAAI,EAAE;AAArD;AAFJ;AADM,CAAf","sourcesContent":["import inputText from '../../../input-text/test/fixtures/cm-default';\n\nexport default {\n props: {\n title: 'Mandatory courses to complete certification',\n inputText: {...inputText.props, error: 'this is error', hint: ''}\n }\n};\n"],"file":"error.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 AtomInputTextWithTitle from '..';
5
+ import fixtureDefault from './fixtures/default';
6
+ import fixtureError from './fixtures/error';
7
+ test('Atom › AtomInputTextWithTitle > should have valid propTypes', t => {
8
+ t.pass();
9
+ forEach(AtomInputTextWithTitle.propTypes, (value, key) => {
10
+ t.not(value, undefined, `PropType for "Atom.AtomInputTextWithTitle.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
11
+ });
12
+ });
13
+ test('Atom › AtomInputTextWithTitle › Default › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureDefault);
14
+ test('Atom › AtomInputTextWithTitle › Error › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureError);
15
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/atom/input-text-with-title/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomInputTextWithTitle","fixtureDefault","fixtureError","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,YAAP,MAAyB,kBAAzB;AAEAL,IAAI,CAAC,6DAAD,EAAgEM,CAAC,IAAI;AACvEA,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,uDAAsDF,GAAI,mEAAnF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,sBAAvF,EAA+GC,cAA/G,CAAJ;AACAJ,IAAI,CAAC,4DAAD,EAA+DE,oBAA/D,EAAqFC,sBAArF,EAA6GE,YAA7G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomInputTextWithTitle from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureError from './fixtures/error';\n\ntest('Atom › AtomInputTextWithTitle > should have valid propTypes', t => {\n t.pass();\n forEach(AtomInputTextWithTitle.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomInputTextWithTitle.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomInputTextWithTitle › Default › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureDefault);\ntest('Atom › AtomInputTextWithTitle › Error › should be rendered', renderComponentMacro, AtomInputTextWithTitle, fixtureError);\n"],"file":"fixtures.js"}
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ import classnames from 'classnames';
3
+ import PropTypes from 'prop-types';
4
+ import { NovaCompositionCoorpacademyCheck as RightIcon, NovaSolidStatusClose as WrongIcon } from '@coorpacademy/nova-icons';
5
+ import style from './style.css';
6
+
7
+ const Content = ({
8
+ icon,
9
+ current,
10
+ value
11
+ }) => {
12
+ if (!icon) {
13
+ return /*#__PURE__*/React.createElement("span", {
14
+ className: style.value,
15
+ "aria-label": `step ${value}`
16
+ }, value);
17
+ }
18
+
19
+ if (icon === 'right') {
20
+ return /*#__PURE__*/React.createElement("span", {
21
+ className: style.value,
22
+ "aria-label": `step ${value}`
23
+ }, /*#__PURE__*/React.createElement(RightIcon, {
24
+ className: current ? style.currentRightIcon : style.rightIcon
25
+ }));
26
+ }
27
+
28
+ if (icon === 'wrong') {
29
+ return /*#__PURE__*/React.createElement("span", {
30
+ className: style.value,
31
+ "aria-label": `step ${value}`
32
+ }, /*#__PURE__*/React.createElement(WrongIcon, {
33
+ className: current ? style.currentWrongIcon : style.wrongIcon
34
+ }));
35
+ }
36
+ };
37
+
38
+ const ReviewHeaderStepItem = props => {
39
+ const {
40
+ icon,
41
+ current
42
+ } = props;
43
+ return /*#__PURE__*/React.createElement("div", {
44
+ className: classnames(icon === 'right' ? style.right : null, icon === 'wrong' ? style.wrong : null, current ? style.current : style.default),
45
+ "data-name": "header-step-item"
46
+ }, /*#__PURE__*/React.createElement(Content, props));
47
+ };
48
+
49
+ ReviewHeaderStepItem.propTypes = process.env.NODE_ENV !== "production" ? {
50
+ icon: PropTypes.string,
51
+ current: PropTypes.bool,
52
+ value: PropTypes.string
53
+ } : {};
54
+ export default ReviewHeaderStepItem;
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/atom/review-header-step-item/index.js"],"names":["React","classnames","PropTypes","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","style","Content","icon","current","value","currentRightIcon","rightIcon","currentWrongIcon","wrongIcon","ReviewHeaderStepItem","props","right","wrong","default","propTypes","string","bool"],"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,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOC,EAAAA,OAAP;AAAgBC,EAAAA;AAAhB,CAAD,KAA4B;AAC1C,MAAI,CAACF,IAAL,EAAW;AACT,wBACE;AAAM,MAAA,SAAS,EAAEF,KAAK,CAACI,KAAvB;AAA8B,oBAAa,QAAOA,KAAM;AAAxD,OACGA,KADH,CADF;AAKD;;AAED,MAAIF,IAAI,KAAK,OAAb,EAAsB;AACpB,wBACE;AAAM,MAAA,SAAS,EAAEF,KAAK,CAACI,KAAvB;AAA8B,oBAAa,QAAOA,KAAM;AAAxD,oBACE,oBAAC,SAAD;AAAW,MAAA,SAAS,EAAED,OAAO,GAAGH,KAAK,CAACK,gBAAT,GAA4BL,KAAK,CAACM;AAA/D,MADF,CADF;AAKD;;AAED,MAAIJ,IAAI,KAAK,OAAb,EAAsB;AACpB,wBACE;AAAM,MAAA,SAAS,EAAEF,KAAK,CAACI,KAAvB;AAA8B,oBAAa,QAAOA,KAAM;AAAxD,oBACE,oBAAC,SAAD;AAAW,MAAA,SAAS,EAAED,OAAO,GAAGH,KAAK,CAACO,gBAAT,GAA4BP,KAAK,CAACQ;AAA/D,MADF,CADF;AAKD;AACF,CAxBD;;AA0BA,MAAMC,oBAAoB,GAAGC,KAAK,IAAI;AACpC,QAAM;AAACR,IAAAA,IAAD;AAAOC,IAAAA;AAAP,MAAkBO,KAAxB;AACA,sBACE;AACE,IAAA,SAAS,EAAEhB,UAAU,CACnBQ,IAAI,KAAK,OAAT,GAAmBF,KAAK,CAACW,KAAzB,GAAiC,IADd,EAEnBT,IAAI,KAAK,OAAT,GAAmBF,KAAK,CAACY,KAAzB,GAAiC,IAFd,EAGnBT,OAAO,GAAGH,KAAK,CAACG,OAAT,GAAmBH,KAAK,CAACa,OAHb,CADvB;AAME,iBAAU;AANZ,kBAQE,oBAAC,OAAD,EAAaH,KAAb,CARF,CADF;AAYD,CAdD;;AAgBAD,oBAAoB,CAACK,SAArB,2CAAiC;AAC/BZ,EAAAA,IAAI,EAAEP,SAAS,CAACoB,MADe;AAE/BZ,EAAAA,OAAO,EAAER,SAAS,CAACqB,IAFY;AAG/BZ,EAAAA,KAAK,EAAET,SAAS,CAACoB;AAHc,CAAjC;AAMA,eAAeN,oBAAf","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 style from './style.css';\n\nconst Content = ({icon, current, value}) => {\n if (!icon) {\n return (\n <span className={style.value} aria-label={`step ${value}`}>\n {value}\n </span>\n );\n }\n\n if (icon === 'right') {\n return (\n <span className={style.value} aria-label={`step ${value}`}>\n <RightIcon className={current ? style.currentRightIcon : style.rightIcon} />\n </span>\n );\n }\n\n if (icon === 'wrong') {\n return (\n <span className={style.value} aria-label={`step ${value}`}>\n <WrongIcon className={current ? style.currentWrongIcon : style.wrongIcon} />\n </span>\n );\n }\n};\n\nconst ReviewHeaderStepItem = props => {\n const {icon, current} = props;\n return (\n <div\n className={classnames(\n icon === 'right' ? style.right : null,\n icon === 'wrong' ? style.wrong : null,\n current ? style.current : style.default\n )}\n data-name=\"header-step-item\"\n >\n <Content {...props} />\n </div>\n );\n};\n\nReviewHeaderStepItem.propTypes = {\n icon: PropTypes.string,\n current: PropTypes.bool,\n value: PropTypes.string\n};\n\nexport default ReviewHeaderStepItem;\n"],"file":"index.js"}
@@ -0,0 +1,71 @@
1
+ @value colors: "../../variables/colors.css";
2
+ @value cm_grey_100 from colors;
3
+ @value cm_positive_100 from colors;
4
+ @value cm_negative_100 from colors;
5
+ @value white from colors;
6
+
7
+ .default {
8
+ width: 32px;
9
+ height: 32px;
10
+ opacity: 0.5;
11
+ border-radius: 50%;
12
+ background-color: cm_grey_100;
13
+ font-weight: 600;
14
+ font-size: 12px;
15
+ line-height: 16px;
16
+ font-family: Gilroy;
17
+ display: flex;
18
+ justify-content: center;
19
+ align-items: center;
20
+ }
21
+
22
+ .current {
23
+ composes: default;
24
+ width: 40px;
25
+ height: 40px;
26
+ opacity: 1;
27
+ font-size: 16px;
28
+ line-height: 22px;
29
+ }
30
+
31
+ .right {
32
+ background-color: cm_positive_100;
33
+ }
34
+
35
+ .wrong {
36
+ background-color: cm_negative_100;
37
+ }
38
+
39
+ .value {
40
+ display: block;
41
+ }
42
+
43
+ .rightIcon {
44
+ color: white;
45
+ width: 12px;
46
+ height: 10px;
47
+ margin: 2px 0px 0px 1px;
48
+ }
49
+
50
+ .currentRightIcon {
51
+ composes: rightIcon;
52
+ width: 16px;
53
+ height: 14px;
54
+ margin: 3px 0px 0px 1px;
55
+ }
56
+
57
+ .wrongIcon {
58
+ color: white;
59
+ width: 10px;
60
+ height: 10px;
61
+ margin-top: 3px;
62
+ }
63
+
64
+ .currentWrongIcon {
65
+ composes: wrongIcon;
66
+ width: 15px;
67
+ height: 15px;
68
+ margin-top: 5px;
69
+ }
70
+
71
+
@@ -0,0 +1,8 @@
1
+ export default {
2
+ props: {
3
+ icon: null,
4
+ current: true,
5
+ value: '2'
6
+ }
7
+ };
8
+ //# sourceMappingURL=current.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/review-header-step-item/test/fixtures/current.js"],"names":["props","icon","current","value"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,IADD;AAELC,IAAAA,OAAO,EAAE,IAFJ;AAGLC,IAAAA,KAAK,EAAE;AAHF;AADM,CAAf","sourcesContent":["export default {\n props: {\n icon: null,\n current: true,\n value: '2'\n }\n};\n"],"file":"current.js"}
@@ -0,0 +1,8 @@
1
+ export default {
2
+ props: {
3
+ icon: null,
4
+ current: false,
5
+ value: '2'
6
+ }
7
+ };
8
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/review-header-step-item/test/fixtures/default.js"],"names":["props","icon","current","value"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,IADD;AAELC,IAAAA,OAAO,EAAE,KAFJ;AAGLC,IAAAA,KAAK,EAAE;AAHF;AADM,CAAf","sourcesContent":["export default {\n props: {\n icon: null,\n current: false,\n value: '2'\n }\n};\n"],"file":"default.js"}
@@ -0,0 +1,8 @@
1
+ export default {
2
+ props: {
3
+ icon: 'right',
4
+ current: false,
5
+ value: '2'
6
+ }
7
+ };
8
+ //# sourceMappingURL=right.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/review-header-step-item/test/fixtures/right.js"],"names":["props","icon","current","value"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,OADD;AAELC,IAAAA,OAAO,EAAE,KAFJ;AAGLC,IAAAA,KAAK,EAAE;AAHF;AADM,CAAf","sourcesContent":["export default {\n props: {\n icon: 'right',\n current: false,\n value: '2'\n }\n};\n"],"file":"right.js"}
@@ -0,0 +1,8 @@
1
+ export default {
2
+ props: {
3
+ icon: 'wrong',
4
+ current: false,
5
+ value: '2'
6
+ }
7
+ };
8
+ //# sourceMappingURL=wrong.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/review-header-step-item/test/fixtures/wrong.js"],"names":["props","icon","current","value"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,OADD;AAELC,IAAAA,OAAO,EAAE,KAFJ;AAGLC,IAAAA,KAAK,EAAE;AAHF;AADM,CAAf","sourcesContent":["export default {\n props: {\n icon: 'wrong',\n current: false,\n value: '2'\n }\n};\n"],"file":"wrong.js"}
@@ -504,6 +504,7 @@ div.player:hover span.selectSpan {
504
504
  padding: 0 15px;
505
505
  color: dark;
506
506
  cursor: pointer;
507
+ position: absolute;
507
508
  }
508
509
 
509
510
  /*
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import InputTextWithTitle from '../../atom/input-text-with-title';
3
4
  import CourseSection from '../course-section';
4
5
  import DraggableList from '../draggable-list';
5
6
  import Loader from '../../atom/loader';
@@ -14,10 +15,20 @@ const CourseSections = ({
14
15
  sections,
15
16
  onDrop,
16
17
  isLoading,
17
- title
18
+ title,
19
+ mandatoryCoursesInput,
20
+ inputTitle
18
21
  }) => {
19
22
  if (isLoading) return /*#__PURE__*/React.createElement(Loading, null);
20
- return /*#__PURE__*/React.createElement("div", null, title ? /*#__PURE__*/React.createElement("div", {
23
+ return /*#__PURE__*/React.createElement("div", null, inputTitle ? /*#__PURE__*/React.createElement("div", {
24
+ className: style.title
25
+ }, /*#__PURE__*/React.createElement(Title, {
26
+ title: inputTitle,
27
+ type: 'form-group',
28
+ "data-name": 'mandatory-courses-input-title'
29
+ })) : null, mandatoryCoursesInput ? /*#__PURE__*/React.createElement("div", {
30
+ className: style.mandatoryCoursesInput
31
+ }, /*#__PURE__*/React.createElement(InputTextWithTitle, mandatoryCoursesInput)) : null, title ? /*#__PURE__*/React.createElement("div", {
21
32
  className: style.title
22
33
  }, /*#__PURE__*/React.createElement(Title, {
23
34
  title: title,
@@ -31,10 +42,12 @@ const CourseSections = ({
31
42
  };
32
43
 
33
44
  CourseSections.propTypes = process.env.NODE_ENV !== "production" ? {
45
+ inputTitle: PropTypes.string,
34
46
  title: PropTypes.string,
35
47
  sections: PropTypes.arrayOf(PropTypes.shape(CourseSection.propTypes)),
36
48
  onDrop: PropTypes.func,
37
- isLoading: PropTypes.bool
49
+ isLoading: PropTypes.bool,
50
+ mandatoryCoursesInput: PropTypes.shape(InputTextWithTitle.propTypes)
38
51
  } : {};
39
52
  export default CourseSections;
40
53
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/course-sections/index.js"],"names":["React","PropTypes","CourseSection","DraggableList","Loader","Title","style","Loading","CourseSections","sections","onDrop","isLoading","title","propTypes","string","arrayOf","shape","func","bool"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAG,mBACd,8CACE,oBAAC,MAAD;AAAQ,EAAA,KAAK,EAAC;AAAd,EADF,CADF;;AAMA,MAAMC,cAAc,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWC,EAAAA,MAAX;AAAmBC,EAAAA,SAAnB;AAA8BC,EAAAA;AAA9B,CAAD,KAA0C;AAC/D,MAAID,SAAJ,EAAe,oBAAO,oBAAC,OAAD,OAAP;AAEf,sBACE,iCACGC,KAAK,gBACJ;AAAK,IAAA,SAAS,EAAEN,KAAK,CAACM;AAAtB,kBACE,oBAAC,KAAD;AAAO,IAAA,KAAK,EAAEA,KAAd;AAAqB,IAAA,IAAI,EAAE,YAA3B;AAAyC,iBAAW;AAApD,IADF,CADI,GAIF,IALN,eAME,oBAAC,aAAD;AAAe,IAAA,QAAQ,EAAC,gBAAxB;AAAyC,IAAA,KAAK,EAAEH,QAAhD;AAA0D,IAAA,MAAM,EAAEC;AAAlE,IANF,CADF;AAUD,CAbD;;AAeAF,cAAc,CAACK,SAAf,2CAA2B;AACzBD,EAAAA,KAAK,EAAEX,SAAS,CAACa,MADQ;AAEzBL,EAAAA,QAAQ,EAAER,SAAS,CAACc,OAAV,CAAkBd,SAAS,CAACe,KAAV,CAAgBd,aAAa,CAACW,SAA9B,CAAlB,CAFe;AAGzBH,EAAAA,MAAM,EAAET,SAAS,CAACgB,IAHO;AAIzBN,EAAAA,SAAS,EAAEV,SAAS,CAACiB;AAJI,CAA3B;AAOA,eAAeV,cAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport CourseSection from '../course-section';\nimport DraggableList from '../draggable-list';\nimport Loader from '../../atom/loader';\nimport Title from '../../atom/title';\nimport style from './style.css';\n\nconst Loading = () => (\n <div>\n <Loader theme=\"coorpmanager\" />\n </div>\n);\n\nconst CourseSections = ({sections, onDrop, isLoading, title}) => {\n if (isLoading) return <Loading />;\n\n return (\n <div>\n {title ? (\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'course-sections-title'} />\n </div>\n ) : null}\n <DraggableList itemType=\"course-section\" items={sections} onDrop={onDrop} />\n </div>\n );\n};\n\nCourseSections.propTypes = {\n title: PropTypes.string,\n sections: PropTypes.arrayOf(PropTypes.shape(CourseSection.propTypes)),\n onDrop: PropTypes.func,\n isLoading: PropTypes.bool\n};\n\nexport default CourseSections;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/molecule/course-sections/index.js"],"names":["React","PropTypes","InputTextWithTitle","CourseSection","DraggableList","Loader","Title","style","Loading","CourseSections","sections","onDrop","isLoading","title","mandatoryCoursesInput","inputTitle","propTypes","string","arrayOf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AAEC;AAAlE,IApBF,CADF;AAwBD,CAlCD;;AAoCAF,cAAc,CAACO,SAAf,2CAA2B;AACzBD,EAAAA,UAAU,EAAEd,SAAS,CAACgB,MADG;AAEzBJ,EAAAA,KAAK,EAAEZ,SAAS,CAACgB,MAFQ;AAGzBP,EAAAA,QAAQ,EAAET,SAAS,CAACiB,OAAV,CAAkBjB,SAAS,CAACkB,KAAV,CAAgBhB,aAAa,CAACa,SAA9B,CAAlB,CAHe;AAIzBL,EAAAA,MAAM,EAAEV,SAAS,CAACmB,IAJO;AAKzBR,EAAAA,SAAS,EAAEX,SAAS,CAACoB,IALI;AAMzBP,EAAAA,qBAAqB,EAAEb,SAAS,CAACkB,KAAV,CAAgBjB,kBAAkB,CAACc,SAAnC;AANE,CAA3B;AASA,eAAeP,cAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport InputTextWithTitle from '../../atom/input-text-with-title';\nimport CourseSection from '../course-section';\nimport DraggableList from '../draggable-list';\nimport Loader from '../../atom/loader';\nimport Title from '../../atom/title';\nimport style from './style.css';\n\nconst Loading = () => (\n <div>\n <Loader theme=\"coorpmanager\" />\n </div>\n);\n\nconst CourseSections = ({\n sections,\n onDrop,\n isLoading,\n title,\n mandatoryCoursesInput,\n inputTitle\n}) => {\n if (isLoading) return <Loading />;\n\n return (\n <div>\n {inputTitle ? (\n <div className={style.title}>\n <Title\n title={inputTitle}\n type={'form-group'}\n data-name={'mandatory-courses-input-title'}\n />\n </div>\n ) : null}\n {mandatoryCoursesInput ? (\n <div className={style.mandatoryCoursesInput}>\n <InputTextWithTitle {...mandatoryCoursesInput} />\n </div>\n ) : null}\n {title ? (\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'course-sections-title'} />\n </div>\n ) : null}\n <DraggableList itemType=\"course-section\" items={sections} onDrop={onDrop} />\n </div>\n );\n};\n\nCourseSections.propTypes = {\n inputTitle: PropTypes.string,\n title: PropTypes.string,\n sections: PropTypes.arrayOf(PropTypes.shape(CourseSection.propTypes)),\n onDrop: PropTypes.func,\n isLoading: PropTypes.bool,\n mandatoryCoursesInput: PropTypes.shape(InputTextWithTitle.propTypes)\n};\n\nexport default CourseSections;\n"],"file":"index.js"}
@@ -1,3 +1,7 @@
1
1
  .title {
2
2
  margin-bottom: 16px;
3
3
  }
4
+
5
+ .mandatoryCoursesInput {
6
+ margin: 0 0 16px 16px;
7
+ }
@@ -0,0 +1,11 @@
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 mandatoryCoursesInput from '../../../../atom/input-text-with-title/test/fixtures/error';
4
+ import props from './default';
5
+ export default {
6
+ props: _extends(_extends({}, props.props), {}, {
7
+ mandatoryCoursesInput: mandatoryCoursesInput.props,
8
+ inputTitle: 'Minimun courses completion'
9
+ })
10
+ };
11
+ //# sourceMappingURL=with-mandatory-courses-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/course-sections/test/fixtures/with-mandatory-courses-input.js"],"names":["mandatoryCoursesInput","props","inputTitle"],"mappings":";;AAAA,OAAOA,qBAAP,MAAkC,4DAAlC;AACA,OAAOC,KAAP,MAAkB,WAAlB;AAEA,eAAe;AACbA,EAAAA,KAAK,wBACAA,KAAK,CAACA,KADN;AAEHD,IAAAA,qBAAqB,EAAEA,qBAAqB,CAACC,KAF1C;AAGHC,IAAAA,UAAU,EAAE;AAHT;AADQ,CAAf","sourcesContent":["import mandatoryCoursesInput from '../../../../atom/input-text-with-title/test/fixtures/error';\nimport props from './default';\n\nexport default {\n props: {\n ...props.props,\n mandatoryCoursesInput: mandatoryCoursesInput.props,\n inputTitle: 'Minimun courses completion'\n }\n};\n"],"file":"with-mandatory-courses-input.js"}
@@ -4,6 +4,7 @@ import renderComponentMacro from '../../../test/helpers/render-component';
4
4
  import MoleculeCourseSections from '..';
5
5
  import fixtureDefault from './fixtures/default';
6
6
  import fixtureLoading from './fixtures/loading';
7
+ import fixtureWithMandatoryCoursesInput from './fixtures/with-mandatory-courses-input';
7
8
  test('Molecule › MoleculeCourseSections > should have valid propTypes', t => {
8
9
  t.pass();
9
10
  forEach(MoleculeCourseSections.propTypes, (value, key) => {
@@ -12,4 +13,5 @@ test('Molecule › MoleculeCourseSections > should have valid propTypes', t => {
12
13
  });
13
14
  test('Molecule › MoleculeCourseSections › Default › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureDefault);
14
15
  test('Molecule › MoleculeCourseSections › Loading › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureLoading);
16
+ test('Molecule › MoleculeCourseSections › WithMandatoryCoursesInput › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureWithMandatoryCoursesInput);
15
17
  //# sourceMappingURL=fixtures.js.map
@@ -1 +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"}
1
+ {"version":3,"sources":["../../../../src/molecule/course-sections/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCourseSections","fixtureDefault","fixtureLoading","fixtureWithMandatoryCoursesInput","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;AACA,OAAOC,gCAAP,MAA6C,yCAA7C;AAEAN,IAAI,CAAC,iEAAD,EAAoEO,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACAP,EAAAA,OAAO,CAACE,sBAAsB,CAACM,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;AAOAX,IAAI,CAAC,kEAAD,EAAqEE,oBAArE,EAA2FC,sBAA3F,EAAmHC,cAAnH,CAAJ;AACAJ,IAAI,CAAC,kEAAD,EAAqEE,oBAArE,EAA2FC,sBAA3F,EAAmHE,cAAnH,CAAJ;AACAL,IAAI,CAAC,oFAAD,EAAuFE,oBAAvF,EAA6GC,sBAA7G,EAAqIG,gCAArI,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';\nimport fixtureWithMandatoryCoursesInput from './fixtures/with-mandatory-courses-input';\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);\ntest('Molecule › MoleculeCourseSections › WithMandatoryCoursesInput › should be rendered', renderComponentMacro, MoleculeCourseSections, fixtureWithMandatoryCoursesInput);\n"],"file":"fixtures.js"}