@coorpacademy/components 10.5.5 → 10.5.7-alpha.6.5

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 (117) hide show
  1. package/es/atom/range/handle.css +18 -2
  2. package/es/atom/range/handle.js +7 -3
  3. package/es/atom/range/handle.js.map +1 -1
  4. package/es/atom/range/style.css +2 -2
  5. package/es/molecule/cockpit-popin/test/fixtures.js +17 -0
  6. package/es/molecule/cockpit-popin/test/fixtures.js.map +1 -0
  7. package/es/molecule/course-section/index.js +5 -3
  8. package/es/molecule/course-section/index.js.map +1 -1
  9. package/es/molecule/course-section/style.css +2 -1
  10. package/es/molecule/course-section/test/fixtures/chapter.js +2 -1
  11. package/es/molecule/course-section/test/fixtures/chapter.js.map +1 -1
  12. package/es/molecule/course-section/test/fixtures/course.js +2 -1
  13. package/es/molecule/course-section/test/fixtures/course.js.map +1 -1
  14. package/es/molecule/course-sections/index.js +40 -0
  15. package/es/molecule/course-sections/index.js.map +1 -0
  16. package/es/molecule/course-sections/style.css +3 -0
  17. package/es/molecule/course-sections/test/fixtures/default.js +149 -0
  18. package/es/molecule/course-sections/test/fixtures/default.js.map +1 -0
  19. package/es/molecule/course-sections/test/fixtures/loading.js +9 -0
  20. package/es/molecule/course-sections/test/fixtures/loading.js.map +1 -0
  21. package/es/molecule/draggable/index.js +1 -1
  22. package/es/molecule/draggable/index.js.map +1 -1
  23. package/es/molecule/draggable/style.css +1 -5
  24. package/es/molecule/draggable-list/index.js +6 -4
  25. package/es/molecule/draggable-list/index.js.map +1 -1
  26. package/es/molecule/draggable-list/test/fixtures/course-sections.js +20 -0
  27. package/es/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
  28. package/es/molecule/draggable-list/test/on-drop.js +13 -13
  29. package/es/molecule/draggable-list/test/on-drop.js.map +1 -1
  30. package/es/molecule/questions/qcm/index.js +37 -25
  31. package/es/molecule/questions/qcm/index.js.map +1 -1
  32. package/es/molecule/questions/qcm/style.css +48 -14
  33. package/es/molecule/questions/qcm/test/fixtures/default.js +8 -0
  34. package/es/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
  35. package/es/molecule/questions/qcm/test/qcm.js +103 -0
  36. package/es/molecule/questions/qcm/test/qcm.js.map +1 -0
  37. package/es/molecule/questions/qcm-graphic/index.js +35 -17
  38. package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
  39. package/es/molecule/questions/qcm-graphic/style.css +64 -13
  40. package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js +65 -0
  41. package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
  42. package/es/molecule/questions/question-range/style.css +9 -8
  43. package/es/molecule/setup-section/style.css +1 -0
  44. package/es/molecule/wizard-summary/test/fixtures/organize-courses.js +106 -0
  45. package/es/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
  46. package/es/organism/wizard-contents/index.js +6 -0
  47. package/es/organism/wizard-contents/index.js.map +1 -1
  48. package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +45 -0
  49. package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
  50. package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +22 -0
  51. package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
  52. package/es/util/get-shadow-box-color-from-primary.js +4 -0
  53. package/es/util/get-shadow-box-color-from-primary.js.map +1 -0
  54. package/es/util/test/get-shadow-box-color-from-primary.js +33 -0
  55. package/es/util/test/get-shadow-box-color-from-primary.js.map +1 -0
  56. package/es/variables/colors.css +3 -0
  57. package/lib/atom/range/handle.css +18 -2
  58. package/lib/atom/range/handle.js +8 -3
  59. package/lib/atom/range/handle.js.map +1 -1
  60. package/lib/atom/range/style.css +2 -2
  61. package/lib/molecule/cockpit-popin/test/fixtures.js +28 -0
  62. package/lib/molecule/cockpit-popin/test/fixtures.js.map +1 -0
  63. package/lib/molecule/course-section/index.js +5 -3
  64. package/lib/molecule/course-section/index.js.map +1 -1
  65. package/lib/molecule/course-section/style.css +2 -1
  66. package/lib/molecule/course-section/test/fixtures/chapter.js +2 -1
  67. package/lib/molecule/course-section/test/fixtures/chapter.js.map +1 -1
  68. package/lib/molecule/course-section/test/fixtures/course.js +2 -1
  69. package/lib/molecule/course-section/test/fixtures/course.js.map +1 -1
  70. package/lib/molecule/course-sections/index.js +54 -0
  71. package/lib/molecule/course-sections/index.js.map +1 -0
  72. package/lib/molecule/course-sections/style.css +3 -0
  73. package/lib/molecule/course-sections/test/fixtures/default.js +154 -0
  74. package/lib/molecule/course-sections/test/fixtures/default.js.map +1 -0
  75. package/lib/molecule/course-sections/test/fixtures/loading.js +14 -0
  76. package/lib/molecule/course-sections/test/fixtures/loading.js.map +1 -0
  77. package/lib/molecule/draggable/index.js +1 -1
  78. package/lib/molecule/draggable/index.js.map +1 -1
  79. package/lib/molecule/draggable/style.css +1 -5
  80. package/lib/molecule/draggable-list/index.js +7 -4
  81. package/lib/molecule/draggable-list/index.js.map +1 -1
  82. package/lib/molecule/draggable-list/test/fixtures/course-sections.js +29 -0
  83. package/lib/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
  84. package/lib/molecule/draggable-list/test/on-drop.js +13 -13
  85. package/lib/molecule/draggable-list/test/on-drop.js.map +1 -1
  86. package/lib/molecule/questions/qcm/index.js +44 -23
  87. package/lib/molecule/questions/qcm/index.js.map +1 -1
  88. package/lib/molecule/questions/qcm/style.css +48 -14
  89. package/lib/molecule/questions/qcm/test/fixtures/default.js +8 -0
  90. package/lib/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
  91. package/lib/molecule/questions/qcm/test/qcm.js +115 -0
  92. package/lib/molecule/questions/qcm/test/qcm.js.map +1 -0
  93. package/lib/molecule/questions/qcm-graphic/index.js +33 -15
  94. package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
  95. package/lib/molecule/questions/qcm-graphic/style.css +64 -13
  96. package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js +76 -0
  97. package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
  98. package/lib/molecule/questions/question-range/style.css +9 -8
  99. package/lib/molecule/setup-section/style.css +1 -0
  100. package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js +111 -0
  101. package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
  102. package/lib/organism/wizard-contents/index.js +7 -0
  103. package/lib/organism/wizard-contents/index.js.map +1 -1
  104. package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +54 -0
  105. package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
  106. package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +32 -0
  107. package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
  108. package/lib/util/get-shadow-box-color-from-primary.js +12 -0
  109. package/lib/util/get-shadow-box-color-from-primary.js.map +1 -0
  110. package/lib/util/test/get-shadow-box-color-from-primary.js +40 -0
  111. package/lib/util/test/get-shadow-box-color-from-primary.js.map +1 -0
  112. package/lib/variables/colors.css +3 -0
  113. package/package.json +2 -2
  114. package/es/molecule/draggable-list/test/fixtures.js +0 -13
  115. package/es/molecule/draggable-list/test/fixtures.js.map +0 -1
  116. package/lib/molecule/draggable-list/test/fixtures.js +0 -22
  117. package/lib/molecule/draggable-list/test/fixtures.js.map +0 -1
@@ -15,48 +15,65 @@ var _provider = _interopRequireDefault(require("../../../atom/provider"));
15
15
 
16
16
  var _style = require("../../../atom/label/style.css");
17
17
 
18
+ var _getShadowBoxColorFromPrimary = require("../../../util/get-shadow-box-color-from-primary");
19
+
18
20
  var _style2 = _interopRequireDefault(require("./style.css"));
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
23
 
24
+ 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); }
25
+
22
26
  const QCMImage = (props, context) => {
23
27
  const {
24
28
  answers
25
29
  } = props;
30
+ const {
31
+ skin
32
+ } = context;
33
+ const primarySkinColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
26
34
  const answersViews = answers.map((answer, key) => {
27
35
  const {
28
36
  onClick,
29
37
  title,
30
38
  selected,
31
- image
39
+ image,
40
+ ariaLabel
32
41
  } = answer;
33
- const {
34
- skin
35
- } = context;
36
- const primarySkinColor = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
37
- const selectedStyle = selected ? {
38
- backgroundColor: primarySkinColor,
39
- borderColor: primarySkinColor
40
- } : null;
41
42
  return /*#__PURE__*/_react.default.createElement("div", {
42
- className: selected ? _style2.default.selected : _style2.default.answer,
43
43
  onClick: onClick,
44
44
  "data-selected": selected,
45
- style: selectedStyle,
45
+ "data-name": "answerGraphic",
46
+ style: _extends({}, selected && {
47
+ boxShadow: `0 4px 16px ${(0, _getShadowBoxColorFromPrimary.getShadowBoxColorFromPrimary)(primarySkinColor)}`
48
+ }),
49
+ className: selected ? _style2.default.selected : _style2.default.answer,
46
50
  key: key
51
+ }, /*#__PURE__*/_react.default.createElement("div", {
52
+ "data-name": "answerBackground",
53
+ style: {
54
+ backgroundColor: selected ? primarySkinColor : '#F4F4F5'
55
+ },
56
+ className: _style2.default.background
57
+ }), /*#__PURE__*/_react.default.createElement("div", {
58
+ "data-name": "answerContent",
59
+ className: _style2.default.content
47
60
  }, /*#__PURE__*/_react.default.createElement("div", {
48
61
  className: _style2.default.imageWrapper,
49
- "data-name": "answerGraphic",
62
+ "data-name": "answerImage",
63
+ "aria-label": ariaLabel || title,
50
64
  style: {
51
65
  backgroundImage: `url(${image})`
52
66
  }
53
67
  }), /*#__PURE__*/_react.default.createElement("div", {
54
- className: (0, _classnames.default)(_style2.default.titleWrapper, _style.innerHTML) // eslint-disable-next-line react/no-danger
68
+ "data-name": "answerText",
69
+ className: _style2.default.titleWrapper
70
+ }, /*#__PURE__*/_react.default.createElement("div", {
71
+ className: (0, _classnames.default)(_style2.default.title, _style.innerHTML) // eslint-disable-next-line react/no-danger
55
72
  ,
56
73
  dangerouslySetInnerHTML: {
57
74
  __html: title
58
75
  }
59
- }));
76
+ }))));
60
77
  });
61
78
  return /*#__PURE__*/_react.default.createElement("div", {
62
79
  "data-name": "qcm-graphic-wrapper",
@@ -72,7 +89,8 @@ QCMImage.propTypes = process.env.NODE_ENV !== "production" ? {
72
89
  title: _propTypes.default.string,
73
90
  selected: _propTypes.default.bool,
74
91
  onClick: _propTypes.default.func,
75
- image: _propTypes.default.string
92
+ image: _propTypes.default.string,
93
+ ariaLabel: _propTypes.default.string
76
94
  }))
77
95
  } : {};
78
96
  var _default = QCMImage;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"names":["QCMImage","props","context","answers","answersViews","map","answer","key","onClick","title","selected","image","skin","primarySkinColor","selectedStyle","backgroundColor","borderColor","style","imageWrapper","backgroundImage","titleWrapper","innerHTML","__html","wrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","string","bool","func"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,QAAQ,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AACnC,QAAM;AAACC,IAAAA;AAAD,MAAYF,KAAlB;AAEA,QAAMG,YAAY,GAAGD,OAAO,CAACE,GAAR,CAAY,CAACC,MAAD,EAASC,GAAT,KAAiB;AAChD,UAAM;AAACC,MAAAA,OAAD;AAAUC,MAAAA,KAAV;AAAiBC,MAAAA,QAAjB;AAA2BC,MAAAA;AAA3B,QAAoCL,MAA1C;AACA,UAAM;AAACM,MAAAA;AAAD,QAASV,OAAf;AAEA,UAAMW,gBAAgB,GAAG,qBAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAAzB;AACA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-types';\nimport {getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider from '../../../atom/provider';\nimport {innerHTML} from '../../../atom/label/style.css';\nimport style from './style.css';\n\nconst QCMImage = (props, context) => {\n const {answers} = props;\n\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected, image} = answer;\n const {skin} = context;\n\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n const selectedStyle = selected\n ? {backgroundColor: primarySkinColor, borderColor: primarySkinColor}\n : null;\n return (\n <div\n className={selected ? style.selected : style.answer}\n onClick={onClick}\n data-selected={selected}\n style={selectedStyle}\n key={key}\n >\n <div\n className={style.imageWrapper}\n data-name=\"answerGraphic\"\n style={{\n backgroundImage: `url(${image})`\n }}\n />\n <div\n className={classnames(style.titleWrapper, innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n );\n });\n\n return (\n <div data-name=\"qcm-graphic-wrapper\" className={style.wrapper}>\n {answersViews}\n </div>\n );\n};\n\nQCMImage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQCMImage.propTypes = {\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n selected: PropTypes.bool,\n onClick: PropTypes.func,\n image: PropTypes.string\n })\n )\n};\n\nexport default QCMImage;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/molecule/questions/qcm-graphic/index.js"],"names":["QCMImage","props","context","answers","skin","primarySkinColor","answersViews","map","answer","key","onClick","title","selected","image","ariaLabel","boxShadow","style","backgroundColor","background","content","imageWrapper","backgroundImage","titleWrapper","innerHTML","__html","wrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","arrayOf","shape","string","bool","func"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,QAAQ,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AACnC,QAAM;AAACC,IAAAA;AAAD,MAAYF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,EAAE;AAACC,QAAAA,MAAM,EAAEb;AAAT;AAH3B,MADF,CATF,CAnBF,CADF;AAuCD,GA1CoB,CAArB;AA4CA,sBACE;AAAK,iBAAU,qBAAf;AAAqC,IAAA,SAAS,EAAEK,gBAAMS;AAAtD,KACGnB,YADH,CADF;AAKD,CAtDD;;AAwDAN,QAAQ,CAAC0B,YAAT,GAAwB;AACtBtB,EAAAA,IAAI,EAAEuB,kBAASC,iBAAT,CAA2BxB;AADX,CAAxB;AAIAJ,QAAQ,CAAC6B,SAAT,2CAAqB;AACnB1B,EAAAA,OAAO,EAAE2B,mBAAUC,OAAV,CACPD,mBAAUE,KAAV,CAAgB;AACdrB,IAAAA,KAAK,EAAEmB,mBAAUG,MADH;AAEdrB,IAAAA,QAAQ,EAAEkB,mBAAUI,IAFN;AAGdxB,IAAAA,OAAO,EAAEoB,mBAAUK,IAHL;AAIdtB,IAAAA,KAAK,EAAEiB,mBAAUG,MAJH;AAKdnB,IAAAA,SAAS,EAAEgB,mBAAUG;AALP,GAAhB,CADO;AADU,CAArB;eAYejC,Q","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Provider from '../../../atom/provider';\nimport {innerHTML} from '../../../atom/label/style.css';\nimport {getShadowBoxColorFromPrimary} from '../../../util/get-shadow-box-color-from-primary';\nimport style from './style.css';\n\nconst QCMImage = (props, context) => {\n const {answers} = props;\n const {skin} = context;\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const answersViews = answers.map((answer, key) => {\n const {onClick, title, selected, image, ariaLabel} = answer;\n\n return (\n <div\n onClick={onClick}\n data-selected={selected}\n data-name=\"answerGraphic\"\n style={{\n ...(selected && {\n boxShadow: `0 4px 16px ${getShadowBoxColorFromPrimary(primarySkinColor)}`\n })\n }}\n className={selected ? style.selected : style.answer}\n key={key}\n >\n <div\n data-name=\"answerBackground\"\n style={{\n backgroundColor: selected ? primarySkinColor : '#F4F4F5'\n }}\n className={style.background}\n />\n <div data-name=\"answerContent\" className={style.content}>\n <div\n className={style.imageWrapper}\n data-name=\"answerImage\"\n aria-label={ariaLabel || title}\n style={{\n backgroundImage: `url(${image})`\n }}\n />\n <div data-name=\"answerText\" className={style.titleWrapper}>\n <div\n className={classnames(style.title, innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n </div>\n </div>\n );\n });\n\n return (\n <div data-name=\"qcm-graphic-wrapper\" className={style.wrapper}>\n {answersViews}\n </div>\n );\n};\n\nQCMImage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nQCMImage.propTypes = {\n answers: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n selected: PropTypes.bool,\n onClick: PropTypes.func,\n image: PropTypes.string,\n ariaLabel: PropTypes.string\n })\n )\n};\n\nexport default QCMImage;\n"],"file":"index.js"}
@@ -2,9 +2,10 @@
2
2
  @value mobile from breakpoints;
3
3
  @value colors: "../../../variables/colors.css";
4
4
  @value white from colors;
5
- @value xtraLightGrey from colors;
6
- @value light from colors;
7
5
  @value black from colors;
6
+ @value cm_grey_75 from colors;
7
+ @value cm_primary_blue from colors;
8
+ @value cm_blue_900 from colors;
8
9
 
9
10
  .wrapper {
10
11
  display: flex;
@@ -15,16 +16,34 @@
15
16
  }
16
17
 
17
18
  .answer {
18
- color: black;
19
+ position: relative;
20
+ color: cm_blue_900;
19
21
  background-color: white;
20
- border: 1px solid color(black lightness(85%));
21
- border-radius: 3px;
22
22
  box-sizing: border-box;
23
23
  cursor: pointer;
24
24
  padding: 8px;
25
25
  width: 200px;
26
26
  min-height: 245px;
27
27
  margin: 0 4px 8px;
28
+ box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12);
29
+ border-radius: 16px;
30
+ transition: background-color 0.25s linear;
31
+ }
32
+
33
+ .background {
34
+ top: 0;
35
+ left: 0;
36
+ position: absolute;
37
+ border-radius: 16px;
38
+ height: 100%;
39
+ width: 100%;
40
+ transition: opacity 0.25s linear, background-color 0.25s linear;
41
+ }
42
+
43
+ .content {
44
+ height: 100%;
45
+ width: 100%;
46
+ position: relative;
28
47
  }
29
48
 
30
49
  .imageWrapper {
@@ -33,12 +52,21 @@
33
52
  align-items: center;
34
53
  height: 110px;
35
54
  margin-bottom: 16px;
36
- background-size: contain;
55
+ background-size: cover;
37
56
  background-repeat: no-repeat;
38
57
  background-position: center center;
58
+ border-radius: 12px;
39
59
  }
40
60
 
41
61
  .titleWrapper {
62
+ display: flex;
63
+ height: calc(100% - 126px);
64
+ width: 100%;
65
+ align-items: center;
66
+ justify-content: center;
67
+ }
68
+
69
+ .title {
42
70
  font-family: 'Gilroy';
43
71
  font-size: 17px;
44
72
  line-height: 20px;
@@ -49,7 +77,16 @@
49
77
  }
50
78
 
51
79
  .answer:hover {
52
- background-color: xtraLightGrey;
80
+ background: cm_grey_75;
81
+ box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12);
82
+ }
83
+
84
+ .answer .background{
85
+ opacity: 0;
86
+ }
87
+
88
+ .answer:hover .background{
89
+ opacity: 1;
53
90
  }
54
91
 
55
92
  .selected {
@@ -57,10 +94,23 @@
57
94
  color: white;
58
95
  }
59
96
 
97
+ .selected .background{
98
+ opacity: 1;
99
+ }
100
+
101
+ .selected:hover .background{
102
+ opacity: 0.8;
103
+ }
104
+
105
+ .selected.answer:hover {
106
+ background-color: black;
107
+ }
108
+
60
109
  @media mobile {
61
110
  .wrapper {
62
111
  flex-direction: column;
63
- align-items: stretch;
112
+ display: flex;
113
+ align-items: center;
64
114
  width: 100%;
65
115
  padding-bottom: 0;
66
116
  }
@@ -69,17 +119,18 @@
69
119
  display: flex;
70
120
  align-items: center;
71
121
  flex-flow: row nowrap;
72
- width: 100%;
122
+ width: calc(100% - 45px);
73
123
  min-height: 82px;
74
124
  height: inherit;
75
125
  margin: 0 0 8px;
76
126
  overflow: hidden;
77
127
  }
78
128
 
79
- .answer:hover {
80
- background-color: white;
129
+ .content {
130
+ display: flex;
131
+ align-items: center;
81
132
  }
82
-
133
+
83
134
  .answer:last-child {
84
135
  margin-bottom: 0;
85
136
  }
@@ -96,7 +147,7 @@
96
147
  white-space: wrap;
97
148
  overflow: hidden;
98
149
  padding: 0;
99
- text-align: left;
150
+ justify-content: left;
100
151
  font-size: 15px;
101
152
  }
102
153
  }
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+
3
+ var _identity2 = _interopRequireDefault(require("lodash/fp/identity"));
4
+
5
+ var _browserEnv = _interopRequireDefault(require("browser-env"));
6
+
7
+ var _ava = _interopRequireDefault(require("ava"));
8
+
9
+ var _react = _interopRequireDefault(require("react"));
10
+
11
+ var _enzyme = require("enzyme");
12
+
13
+ var _enzymeAdapterReact = _interopRequireDefault(require("enzyme-adapter-react-16"));
14
+
15
+ var _ = _interopRequireDefault(require(".."));
16
+
17
+ var _default = _interopRequireDefault(require("./fixtures/default"));
18
+
19
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
+
21
+ 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); }
22
+
23
+ (0, _browserEnv.default)();
24
+ (0, _enzyme.configure)({
25
+ adapter: new _enzymeAdapterReact.default()
26
+ });
27
+ const translate = _identity2.default;
28
+ (0, _ava.default)('onClick should be reachable, should match given aria-label', t => {
29
+ let answerWasClicked = false;
30
+ _default.default.props.answers[1] = _extends(_extends({}, _default.default.props.answers[1]), {}, {
31
+ onClick: () => {
32
+ answerWasClicked = true;
33
+ }
34
+ });
35
+ const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_.default, _default.default.props), {
36
+ context: {
37
+ translate
38
+ }
39
+ });
40
+ const answersImages = wrapper.find('[data-name="answerImage"]');
41
+ t.true(answersImages.at(1).exists());
42
+ t.is(answersImages.at(1).props()['aria-label'], 'Lorem ipsum');
43
+ const answers = wrapper.find('[data-name="answerGraphic"]');
44
+ answers.at(1).simulate('click');
45
+ t.true(answerWasClicked);
46
+ t.pass();
47
+ });
48
+ (0, _ava.default)("should set: selected's background to Primary, unselected's no background", t => {
49
+ const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_.default, _default.default.props), {
50
+ context: {
51
+ translate
52
+ }
53
+ });
54
+ const answers = wrapper.find('[data-name="answerGraphic"]');
55
+ const firstAnswer = answers.at(0);
56
+ t.true(firstAnswer.exists());
57
+ t.deepEqual(firstAnswer.props().style, {});
58
+ const unselectedBackgroundAnswer = firstAnswer.children().at(0);
59
+ t.true(unselectedBackgroundAnswer.exists());
60
+ t.deepEqual(unselectedBackgroundAnswer.props().style, {
61
+ backgroundColor: '#F4F4F5'
62
+ });
63
+ const firstAnswerText = firstAnswer.children().at(1).children().at(1).children().at(0);
64
+ t.true(firstAnswerText.exists());
65
+ const thirdAnswer = answers.at(2);
66
+ t.true(thirdAnswer.exists());
67
+ t.deepEqual(thirdAnswer.props().style, {
68
+ boxShadow: '0 4px 16px rgba(0, 122, 179, 0.25)'
69
+ });
70
+ const selectedBackgroundAnswer = thirdAnswer.children().at(0);
71
+ t.true(selectedBackgroundAnswer.exists());
72
+ t.deepEqual(selectedBackgroundAnswer.props().style, {
73
+ backgroundColor: '#00B0FF'
74
+ });
75
+ });
76
+ //# sourceMappingURL=qcm-graphic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/questions/qcm-graphic/test/qcm-graphic.js"],"names":["adapter","Adapter","translate","t","answerWasClicked","defaultFixture","props","answers","onClick","wrapper","context","answersImages","find","true","at","exists","is","simulate","pass","firstAnswer","deepEqual","style","unselectedBackgroundAnswer","children","backgroundColor","firstAnswerText","thirdAnswer","boxShadow","selectedBackgroundAnswer"],"mappings":";;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAEA;AACA,uB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AA7C,EAAoD;AAACG,IAAAA,eAAe,EAAE;AAAlB,GAApD;AACD,CArBD","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {shallow, configure} from 'enzyme';\nimport {identity} from 'lodash/fp';\nimport Adapter from 'enzyme-adapter-react-16';\nimport QCMImage from '..';\nimport defaultFixture from './fixtures/default';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\nconst translate = identity;\n\ntest('onClick should be reachable, should match given aria-label', t => {\n let answerWasClicked = false;\n defaultFixture.props.answers[1] = {\n ...defaultFixture.props.answers[1],\n onClick: () => {\n answerWasClicked = true;\n }\n };\n\n const wrapper = shallow(<QCMImage {...defaultFixture.props} />, {\n context: {translate}\n });\n\n const answersImages = wrapper.find('[data-name=\"answerImage\"]');\n t.true(answersImages.at(1).exists());\n t.is(answersImages.at(1).props()['aria-label'], 'Lorem ipsum');\n\n const answers = wrapper.find('[data-name=\"answerGraphic\"]');\n answers.at(1).simulate('click');\n t.true(answerWasClicked);\n t.pass();\n});\n\ntest(\"should set: selected's background to Primary, unselected's no background\", t => {\n const wrapper = shallow(<QCMImage {...defaultFixture.props} />, {\n context: {translate}\n });\n const answers = wrapper.find('[data-name=\"answerGraphic\"]');\n\n const firstAnswer = answers.at(0);\n t.true(firstAnswer.exists());\n t.deepEqual(firstAnswer.props().style, {});\n const unselectedBackgroundAnswer = firstAnswer.children().at(0);\n t.true(unselectedBackgroundAnswer.exists());\n t.deepEqual(unselectedBackgroundAnswer.props().style, {backgroundColor: '#F4F4F5'});\n const firstAnswerText = firstAnswer.children().at(1).children().at(1).children().at(0);\n t.true(firstAnswerText.exists());\n\n const thirdAnswer = answers.at(2);\n t.true(thirdAnswer.exists());\n t.deepEqual(thirdAnswer.props().style, {boxShadow: '0 4px 16px rgba(0, 122, 179, 0.25)'});\n const selectedBackgroundAnswer = thirdAnswer.children().at(0);\n t.true(selectedBackgroundAnswer.exists());\n t.deepEqual(selectedBackgroundAnswer.props().style, {backgroundColor: '#00B0FF'});\n});\n"],"file":"qcm-graphic.js"}
@@ -1,19 +1,18 @@
1
1
  @value breakpoints: "../../../variables/breakpoints.css";
2
2
  @value mobile from breakpoints;
3
3
  @value colors: "../../../variables/colors.css";
4
- @value brand from colors;
5
- @value black from colors;
4
+ @value cm_blue_900 from colors;
6
5
 
7
6
  .wrapper {
8
7
  width: 500px;
9
8
  }
10
9
 
11
10
  .title {
12
- color: brand;
13
11
  display: table;
14
12
  font-family: "Gilroy";
15
- font-size: 24px;
16
- font-weight: 700;
13
+ font-size: 28px;
14
+ font-weight: bold;
15
+ line-height: 36px;
17
16
  margin: 0 auto 15px;
18
17
  text-align: center;
19
18
  user-select: none;
@@ -27,11 +26,13 @@
27
26
 
28
27
  .label {
29
28
  font-family: "Gilroy";
30
- color: black;
31
- font-size: 15px;
32
- font-weight: 700;
29
+ color: cm_blue_900;
30
+ font-size: 18px;
31
+ font-weight: 600;
33
32
  display: inline-block;
33
+ line-height: 24px;
34
34
  user-select: none;
35
+ font-style: normal;
35
36
  }
36
37
 
37
38
  @media mobile {
@@ -14,6 +14,7 @@
14
14
  justify-content: space-between;
15
15
  padding: 0 24px 0 48px;
16
16
  box-sizing: border-box;
17
+ border-radius: 7px;
17
18
  }
18
19
 
19
20
  .title {
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _default = {
6
+ props: {
7
+ title: 'Certification summary',
8
+ sections: [{
9
+ items: [{
10
+ type: 'mainElement',
11
+ title: 'Language',
12
+ value: '🇬🇧 English'
13
+ }, {
14
+ type: 'mainElement',
15
+ title: 'Name',
16
+ value: 'Marketing expert'
17
+ }]
18
+ }, {
19
+ title: 'Translation',
20
+ items: [{
21
+ type: 'text',
22
+ text: '🇫🇷 French'
23
+ }, {
24
+ type: 'text',
25
+ text: '🇪🇸 Spanish'
26
+ }, {
27
+ type: 'text',
28
+ text: '🇮🇹 Italian'
29
+ }]
30
+ }, {
31
+ title: 'Populations',
32
+ items: [{
33
+ type: 'text',
34
+ text: 'Population 2'
35
+ }],
36
+ counterText: '1 population'
37
+ }, {
38
+ title: 'Courses',
39
+ items: [{
40
+ type: 'content',
41
+ title: 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',
42
+ author: 'Author',
43
+ category: 'course',
44
+ label: 'Course'
45
+ }, {
46
+ type: 'content',
47
+ title: 'Social networks',
48
+ author: 'Author',
49
+ category: 'chapter',
50
+ label: "5' learning"
51
+ }, {
52
+ type: 'content',
53
+ title: 'Other title',
54
+ author: 'Author 2',
55
+ category: 'course',
56
+ label: 'Course'
57
+ }, {
58
+ type: 'content',
59
+ title: 'Social others',
60
+ author: 'Author XXX',
61
+ category: 'chapter',
62
+ label: "5' learning"
63
+ }, {
64
+ type: 'content',
65
+ title: 'Social others others',
66
+ author: 'Author XXX',
67
+ label: "5' learning",
68
+ category: 'chapter'
69
+ }, {
70
+ type: 'content',
71
+ title: 'Something about empowerment',
72
+ author: 'Author XXX',
73
+ label: 'course',
74
+ category: 'course'
75
+ }, {
76
+ type: 'content',
77
+ title: 'Be a better human being',
78
+ author: 'Author XXX',
79
+ label: "5' learning",
80
+ category: 'chapter'
81
+ }, {
82
+ type: 'content',
83
+ title: 'Stronger faster better',
84
+ author: 'Author XXX',
85
+ label: 'course',
86
+ category: 'course'
87
+ }, {
88
+ type: 'content',
89
+ title: 'Relativity beyond time',
90
+ author: 'Author XXX',
91
+ label: 'course',
92
+ category: 'course'
93
+ }, {
94
+ type: 'content',
95
+ title: 'Are you awake?',
96
+ author: 'Author XXX',
97
+ label: "5' learning",
98
+ category: 'chapter'
99
+ }],
100
+ counterText: '12 courses'
101
+ }],
102
+ action: {
103
+ icon: 'save',
104
+ text: 'Save in drafts',
105
+ 'aria-label': 'Save in drafts',
106
+ onClick: () => console.log('save')
107
+ }
108
+ }
109
+ };
110
+ exports.default = _default;
111
+ //# sourceMappingURL=organize-courses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/wizard-summary/test/fixtures/organize-courses.js"],"names":["props","title","sections","items","type","value","text","counterText","author","category","label","action","icon","onClick","console","log"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,uBADF;AAELC,IAAAA,QAAQ,EAAE,CACR;AACEC,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,aADR;AAEEH,QAAAA,KAAK,EAAE,UAFT;AAGEI,QAAAA,KAAK,EAAE;AAHT,OADK,EAML;AACED,QAAAA,IAAI,EAAE,aADR;AAEEH,QAAAA,KAAK,EAAE,MAFT;AAGEI,QAAAA,KAAK,EAAE;AAHT,OANK;AADT,KADQ,EAeR;AACEJ,MAAAA,KAAK,EAAE,aADT;AAEEE,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OADK,EAKL;AACEF,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OALK,EASL;AACEF,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OATK;AAFT,KAfQ,EAgCR;AACEL,MAAAA,KAAK,EAAE,aADT;AAEEE,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,MADR;AAEEE,QAAAA,IAAI,EAAE;AAFR,OADK,CAFT;AAQEC,MAAAA,WAAW,EAAE;AARf,KAhCQ,EA0CR;AACEN,MAAAA,KAAK,EAAE,SADT;AAEEE,MAAAA,KAAK,EAAE,CACL;AACEC,QAAAA,IAAI,EAAE,SADR;AAEEH,QAAAA,KAAK,EACH,qIAHJ;AAIEO,QAAAA,MAAM,EAAE,QAJV;AAKEC,QAAAA,QAAQ,EAAE,QALZ;AAMEC,QAAAA,KAAK,EAAE;AANT,OADK,EASL;AACEN,QAAAA,IAAI,EAAE,SADR;AAEEH,QAAAA,KAAK,EAAE,iBAFT;AAG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AAAA,MAAM,EAAE,YAHV;AAIEE,QAAAA,KAAK,EAAE,QAJT;AAKED,QAAAA,QAAQ,EAAE;AALZ,OA1DK,EAiEL;AACEL,QAAAA,IAAI,EAAE,SADR;AAEEH,QAAAA,KAAK,EAAE,gBAFT;AAGEO,QAAAA,MAAM,EAAE,YAHV;AAIEE,QAAAA,KAAK,EAAE,aAJT;AAKED,QAAAA,QAAQ,EAAE;AALZ,OAjEK,CAFT;AA2EEF,MAAAA,WAAW,EAAE;AA3Ef,KA1CQ,CAFL;AA0HLI,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAE,MADA;AAENN,MAAAA,IAAI,EAAE,gBAFA;AAGN,oBAAc,gBAHR;AAINO,MAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,MAAZ;AAJT;AA1HH;AADM,C","sourcesContent":["export default {\n props: {\n title: 'Certification summary',\n sections: [\n {\n items: [\n {\n type: 'mainElement',\n title: 'Language',\n value: '🇬🇧 English'\n },\n {\n type: 'mainElement',\n title: 'Name',\n value: 'Marketing expert'\n }\n ]\n },\n {\n title: 'Translation',\n items: [\n {\n type: 'text',\n text: '🇫🇷 French'\n },\n {\n type: 'text',\n text: '🇪🇸 Spanish'\n },\n {\n type: 'text',\n text: '🇮🇹 Italian'\n }\n ]\n },\n {\n title: 'Populations',\n items: [\n {\n type: 'text',\n text: 'Population 2'\n }\n ],\n counterText: '1 population'\n },\n {\n title: 'Courses',\n items: [\n {\n type: 'content',\n title:\n 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',\n author: 'Author',\n category: 'course',\n label: 'Course'\n },\n {\n type: 'content',\n title: 'Social networks',\n author: 'Author',\n category: 'chapter',\n label: \"5' learning\"\n },\n {\n type: 'content',\n title: 'Other title',\n author: 'Author 2',\n category: 'course',\n label: 'Course'\n },\n {\n type: 'content',\n title: 'Social others',\n author: 'Author XXX',\n category: 'chapter',\n label: \"5' learning\"\n },\n {\n type: 'content',\n title: 'Social others others',\n author: 'Author XXX',\n label: \"5' learning\",\n category: 'chapter'\n },\n {\n type: 'content',\n title: 'Something about empowerment',\n author: 'Author XXX',\n label: 'course',\n category: 'course'\n },\n {\n type: 'content',\n title: 'Be a better human being',\n author: 'Author XXX',\n label: \"5' learning\",\n category: 'chapter'\n },\n {\n type: 'content',\n title: 'Stronger faster better',\n author: 'Author XXX',\n label: 'course',\n category: 'course'\n },\n {\n type: 'content',\n title: 'Relativity beyond time',\n author: 'Author XXX',\n label: 'course',\n category: 'course'\n },\n {\n type: 'content',\n title: 'Are you awake?',\n author: 'Author XXX',\n label: \"5' learning\",\n category: 'chapter'\n }\n ],\n counterText: '12 courses'\n }\n ],\n action: {\n icon: 'save',\n text: 'Save in drafts',\n 'aria-label': 'Save in drafts',\n onClick: () => console.log('save')\n }\n }\n};\n"],"file":"organize-courses.js"}
@@ -25,6 +25,8 @@ var _searchAndChipsResults = _interopRequireDefault(require("../search-and-chips
25
25
 
26
26
  var _courseSelection = _interopRequireDefault(require("../course-selection"));
27
27
 
28
+ var _courseSections = _interopRequireDefault(require("../../molecule/course-sections"));
29
+
28
30
  var _style = _interopRequireDefault(require("./style.css"));
29
31
 
30
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -70,6 +72,9 @@ const buildForm = content => {
70
72
 
71
73
  case 'courses':
72
74
  return /*#__PURE__*/_react.default.createElement(_courseSelection.default, content);
75
+
76
+ case 'organize-courses':
77
+ return /*#__PURE__*/_react.default.createElement(_courseSections.default, content);
73
78
  }
74
79
  };
75
80
 
@@ -177,6 +182,8 @@ WizardContents.propTypes = process.env.NODE_ENV !== "production" ? {
177
182
  type: _propTypes.default.oneOf(['populations'])
178
183
  })), _propTypes.default.shape(_extends(_extends({}, _courseSelection.default.propTypes), {}, {
179
184
  type: _propTypes.default.oneOf(['courses'])
185
+ })), _propTypes.default.shape(_extends(_extends({}, _courseSections.default.propTypes), {}, {
186
+ type: _propTypes.default.oneOf(['organize-courses'])
180
187
  }))]),
181
188
  previousStep: _propTypes.default.shape({
182
189
  label: _propTypes.default.string,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/organism/wizard-contents/index.js"],"names":["buildHeader","wizardHeader","steps","title","onClick","buttonCloseIcon","size","icon","style","header","headerTitle","buildForm","content","type","buildButton","step","side","ICONS","previous","position","next","publish","label","buttonProps","buildActionZone","previousStep","nextStep","previousButton","nextStepType","nextButton","actionZone","button","WizardContents","props","isLoading","summary","headerView","formView","rightActionView","footerActionView","container","leftSection","form","rightSection","stickySection","summaryZone","footer","summaryFooter","actionFooter","propTypes","PropTypes","bool","shape","string","func","isRequired","WizardSteps","WizardSummary","oneOfType","BrandForm","oneOf","ContentTranslate","OrganismSearchAndChipsResults","CourseSelection"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,WAAW,GAAG,CAACC,YAAD,EAAeC,KAAf,KAAyB;AAC3C,QAAM;AAACC,IAAAA,KAAD;AAAQC,IAAAA;AAAR,MAAmBH,YAAzB;AAEA,QAAMI,eAAe,GAAG;AACtBC,IAAAA,IAAI,EAAE,OADgB;AAEtB,iBAAa,cAFS;AAGtB,kBAAc,cAHQ;AAItBC,IAAAA,IAAI,EAAE,OAJgB;AAKtBH,IAAAA;AALsB,GAAxB;AAQA,sBACE,uDACE;AAAK,IAAA,SAAS,EAAEI,eAAMC;AAAtB,kBACE,6BAAC,2BAAD,EAAwBJ,eAAxB,CADF,eAEE;AAAK,IAAA,SAAS,EAAEG,eAAME,WAAtB;AAAmC,iBAAW;AAA9C,KACGP,KADH,CAFF,CADF,eAOE,6BAAC,oBAAD;AAAa,IAAA,KAAK,EAAED;AAApB,IAPF,CADF;AAWD,CAtBD;;AAwBA,MAAMS,SAAS,GAAGC,OAAO,IAAI;AAC3B,QAAM;AAACC,IAAAA;AAAD,MAASD,OAAf;;AACA,UAAQC,IAAR;AACE,SAAK,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C;AAEEpC,IAAAA,IAAI,EAAEqC,mBAAUU,KAAV,CAAgB,CAAC,aAAD,CAAhB;AAFR,KAT2B,EAa3BV,mBAAUE,KAAV,uBACKW,yBAAgBd,SADrB;AAEEpC,IAAAA,IAAI,EAAEqC,mBAAUU,KAAV,CAAgB,CAAC,SAAD,CAAhB;AAFR,KAb2B,CAApB,CAVgB;AA4BzBnC,EAAAA,YAAY,EAAEyB,mBAAUE,KAAV,CAAgB;AAC5B9B,IAAAA,KAAK,EAAE4B,mBAAUG,MADW;AAE5BjD,IAAAA,OAAO,EAAE8C,mBAAUI;AAFS,GAAhB,CA5BW;AAgCzB5B,EAAAA,QAAQ,EAAEwB,mBAAUE,KAAV,CAAgB;AACxBvC,IAAAA,IAAI,EAAEqC,mBAAUU,KAAV,CAAgB,CAAC,MAAD,EAAS,SAAT,CAAhB,CADkB;AAExBtC,IAAAA,KAAK,EAAE4B,mBAAUG,MAFO;AAGxBjD,IAAAA,OAAO,EAAE8C,mBAAUI;AAHK,GAAhB;AAhCe,CAA3B;eAuCetB,c","sourcesContent":["import React from 'react';\nimport getOr from 'lodash/fp/getOr';\nimport PropTypes from 'prop-types';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport WizardSteps from '../../atom/wizard-steps';\nimport WizardSummary from '../../molecule/wizard-summary';\nimport BrandForm from '../brand-form';\nimport ContentTranslate from '../content-translation';\nimport OrganismSearchAndChipsResults from '../search-and-chips-results';\nimport CourseSelection from '../course-selection';\nimport style from './style.css';\n\nconst buildHeader = (wizardHeader, steps) => {\n const {title, onClick} = wizardHeader;\n\n const buttonCloseIcon = {\n size: 'small',\n 'data-name': 'close-button',\n 'aria-label': 'close button',\n icon: 'close',\n onClick\n };\n\n return (\n <div>\n <div className={style.header}>\n <ButtonLinkIconOnly {...buttonCloseIcon} />\n <div className={style.headerTitle} data-name={'custom-playlist-title'}>\n {title}\n </div>\n </div>\n <WizardSteps steps={steps} />\n </div>\n );\n};\n\nconst buildForm = content => {\n const {type} = content;\n switch (type) {\n case 'form':\n return <BrandForm {...content} />;\n case 'translate':\n return <ContentTranslate {...content} />;\n case 'populations':\n return <OrganismSearchAndChipsResults {...content} />;\n case 'courses':\n return <CourseSelection {...content} />;\n }\n};\n\nconst buildButton = (type, step, side) => {\n const ICONS = {\n previous: {\n position: 'left',\n type: 'chevron-left'\n },\n next: {\n position: 'right',\n type: 'chevron-right'\n },\n publish: {\n position: 'left',\n type: 'publish'\n }\n };\n\n const {label, onClick} = step;\n const buttonProps = {\n type: type === 'previous' ? 'secondary' : 'primary',\n 'aria-label': `${type} step button`,\n 'data-name': `${type}-step-button-${side}`,\n icon: ICONS[type],\n label,\n onClick\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nconst buildActionZone = (previousStep, nextStep, side) => {\n const previousButton = previousStep ? buildButton('previous', previousStep, side) : null;\n const nextStepType = getOr('next', 'type', nextStep);\n const nextButton = nextStep ? buildButton(nextStepType, nextStep, side) : null;\n return (\n <div className={style.actionZone}>\n <div className={style.button}>{previousButton}</div>\n <div className={style.button}>{nextButton}</div>\n </div>\n );\n};\n\nconst WizardContents = props => {\n const {isLoading, wizardHeader, steps, summary, content, nextStep, previousStep} = props;\n const headerView = buildHeader(wizardHeader, steps);\n const formView = buildForm({...content, isLoading});\n const rightActionView = buildActionZone(previousStep, nextStep, 'right');\n const footerActionView = buildActionZone(previousStep, nextStep, 'footer');\n\n return (\n <div className={style.container} data-name=\"custom-playlist-summary\">\n <div className={style.leftSection}>\n {headerView}\n <div className={style.form}>{formView}</div>\n </div>\n <div className={style.rightSection} data-name=\"summary-right-section\">\n <div className={style.stickySection}>\n <div className={style.summaryZone} data-name=\"summary-zone\">\n <WizardSummary {...summary} side={'right'} />\n </div>\n {rightActionView}\n </div>\n </div>\n <div className={style.footer} data-name=\"summary-footer-section\">\n <div className={style.summaryFooter}>\n <WizardSummary {...summary} side={'footer'} />\n </div>\n <div className={style.actionFooter}>{footerActionView}</div>\n </div>\n </div>\n );\n};\n\nWizardContents.propTypes = {\n isLoading: PropTypes.bool,\n wizardHeader: PropTypes.shape({\n title: PropTypes.string,\n onClick: PropTypes.func\n }).isRequired,\n steps: WizardSteps.propTypes.steps,\n summary: PropTypes.shape({\n ...WizardSummary.propTypes\n }).isRequired,\n content: PropTypes.oneOfType([\n PropTypes.shape({\n ...BrandForm.propTypes,\n type: PropTypes.oneOf(['form'])\n }),\n PropTypes.shape({\n ...ContentTranslate.propTypes,\n type: PropTypes.oneOf(['translate'])\n }),\n PropTypes.shape({\n ...OrganismSearchAndChipsResults.propTypes,\n type: PropTypes.oneOf(['populations'])\n }),\n PropTypes.shape({\n ...CourseSelection.propTypes,\n type: PropTypes.oneOf(['courses'])\n })\n ]),\n previousStep: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n }),\n nextStep: PropTypes.shape({\n type: PropTypes.oneOf(['next', 'publish']),\n label: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nexport default WizardContents;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/organism/wizard-contents/index.js"],"names":["buildHeader","wizardHeader","steps","title","onClick","buttonCloseIcon","size","icon","style","header","headerTitle","buildForm","content","type","buildButton","step","side","ICONS","previous","position","next","publish","label","buttonProps","buildActionZone","previousStep","nextStep","previousButton","nextStepType","nextButton","actionZone","button","WizardContents","props","isLoading","summary","headerView","formView","rightActionView","footerActionView","container","leftSection","form","rightSection","stickySection","summaryZone","footer","summaryFooter","actionFooter","propTypes","PropTypes","bool","shape","string","func","isRequired","WizardSteps","WizardSummary","oneOfType","BrandForm","oneOf","ContentTranslate","OrganismSearchAndChipsResults","CourseSelection","CourseSections"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,WAAW,GAAG,CAACC,YAAD,EAAeC,KAAf,KAAyB;AAC3C,QAAM;AAACC,IAAAA,KAAD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AAA,IAAI,EAAEqC,mBAAUU,KAAV,CAAgB,CAAC,MAAD,EAAS,SAAT,CAAhB,CADkB;AAExBtC,IAAAA,KAAK,EAAE4B,mBAAUG,MAFO;AAGxBjD,IAAAA,OAAO,EAAE8C,mBAAUI;AAHK,GAAhB;AApCe,CAA3B;eA2CetB,c","sourcesContent":["import React from 'react';\nimport getOr from 'lodash/fp/getOr';\nimport PropTypes from 'prop-types';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport WizardSteps from '../../atom/wizard-steps';\nimport WizardSummary from '../../molecule/wizard-summary';\nimport BrandForm from '../brand-form';\nimport ContentTranslate from '../content-translation';\nimport OrganismSearchAndChipsResults from '../search-and-chips-results';\nimport CourseSelection from '../course-selection';\nimport CourseSections from '../../molecule/course-sections';\nimport style from './style.css';\n\nconst buildHeader = (wizardHeader, steps) => {\n const {title, onClick} = wizardHeader;\n\n const buttonCloseIcon = {\n size: 'small',\n 'data-name': 'close-button',\n 'aria-label': 'close button',\n icon: 'close',\n onClick\n };\n\n return (\n <div>\n <div className={style.header}>\n <ButtonLinkIconOnly {...buttonCloseIcon} />\n <div className={style.headerTitle} data-name={'custom-playlist-title'}>\n {title}\n </div>\n </div>\n <WizardSteps steps={steps} />\n </div>\n );\n};\n\nconst buildForm = content => {\n const {type} = content;\n switch (type) {\n case 'form':\n return <BrandForm {...content} />;\n case 'translate':\n return <ContentTranslate {...content} />;\n case 'populations':\n return <OrganismSearchAndChipsResults {...content} />;\n case 'courses':\n return <CourseSelection {...content} />;\n case 'organize-courses':\n return <CourseSections {...content} />;\n }\n};\n\nconst buildButton = (type, step, side) => {\n const ICONS = {\n previous: {\n position: 'left',\n type: 'chevron-left'\n },\n next: {\n position: 'right',\n type: 'chevron-right'\n },\n publish: {\n position: 'left',\n type: 'publish'\n }\n };\n\n const {label, onClick} = step;\n const buttonProps = {\n type: type === 'previous' ? 'secondary' : 'primary',\n 'aria-label': `${type} step button`,\n 'data-name': `${type}-step-button-${side}`,\n icon: ICONS[type],\n label,\n onClick\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nconst buildActionZone = (previousStep, nextStep, side) => {\n const previousButton = previousStep ? buildButton('previous', previousStep, side) : null;\n const nextStepType = getOr('next', 'type', nextStep);\n const nextButton = nextStep ? buildButton(nextStepType, nextStep, side) : null;\n return (\n <div className={style.actionZone}>\n <div className={style.button}>{previousButton}</div>\n <div className={style.button}>{nextButton}</div>\n </div>\n );\n};\n\nconst WizardContents = props => {\n const {isLoading, wizardHeader, steps, summary, content, nextStep, previousStep} = props;\n const headerView = buildHeader(wizardHeader, steps);\n const formView = buildForm({...content, isLoading});\n const rightActionView = buildActionZone(previousStep, nextStep, 'right');\n const footerActionView = buildActionZone(previousStep, nextStep, 'footer');\n\n return (\n <div className={style.container} data-name=\"custom-playlist-summary\">\n <div className={style.leftSection}>\n {headerView}\n <div className={style.form}>{formView}</div>\n </div>\n <div className={style.rightSection} data-name=\"summary-right-section\">\n <div className={style.stickySection}>\n <div className={style.summaryZone} data-name=\"summary-zone\">\n <WizardSummary {...summary} side={'right'} />\n </div>\n {rightActionView}\n </div>\n </div>\n <div className={style.footer} data-name=\"summary-footer-section\">\n <div className={style.summaryFooter}>\n <WizardSummary {...summary} side={'footer'} />\n </div>\n <div className={style.actionFooter}>{footerActionView}</div>\n </div>\n </div>\n );\n};\n\nWizardContents.propTypes = {\n isLoading: PropTypes.bool,\n wizardHeader: PropTypes.shape({\n title: PropTypes.string,\n onClick: PropTypes.func\n }).isRequired,\n steps: WizardSteps.propTypes.steps,\n summary: PropTypes.shape({\n ...WizardSummary.propTypes\n }).isRequired,\n content: PropTypes.oneOfType([\n PropTypes.shape({\n ...BrandForm.propTypes,\n type: PropTypes.oneOf(['form'])\n }),\n PropTypes.shape({\n ...ContentTranslate.propTypes,\n type: PropTypes.oneOf(['translate'])\n }),\n PropTypes.shape({\n ...OrganismSearchAndChipsResults.propTypes,\n type: PropTypes.oneOf(['populations'])\n }),\n PropTypes.shape({\n ...CourseSelection.propTypes,\n type: PropTypes.oneOf(['courses'])\n }),\n PropTypes.shape({\n ...CourseSections.propTypes,\n type: PropTypes.oneOf(['organize-courses'])\n })\n ]),\n previousStep: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n }),\n nextStep: PropTypes.shape({\n type: PropTypes.oneOf(['next', 'publish']),\n label: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nexport default WizardContents;\n"],"file":"index.js"}