@coorpacademy/components 10.5.3 → 10.5.7-alpha.10

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 (207) 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/atom/select/index.js +38 -20
  6. package/es/atom/select/index.js.map +1 -1
  7. package/es/atom/select/style.css +129 -40
  8. package/es/atom/select/test/fixtures/player.js +11 -0
  9. package/es/atom/select/test/fixtures/player.js.map +1 -0
  10. package/es/atom/select/test/fixtures.js +2 -0
  11. package/es/atom/select/test/fixtures.js.map +1 -1
  12. package/es/atom/select/test/select.js +49 -0
  13. package/es/atom/select/test/select.js.map +1 -0
  14. package/es/molecule/course-section/index.js +5 -3
  15. package/es/molecule/course-section/index.js.map +1 -1
  16. package/es/molecule/course-section/style.css +2 -1
  17. package/es/molecule/course-section/test/fixtures/chapter.js +2 -1
  18. package/es/molecule/course-section/test/fixtures/chapter.js.map +1 -1
  19. package/es/molecule/course-section/test/fixtures/course.js +2 -1
  20. package/es/molecule/course-section/test/fixtures/course.js.map +1 -1
  21. package/es/molecule/course-section/test/fixtures.js +15 -0
  22. package/es/molecule/course-section/test/fixtures.js.map +1 -0
  23. package/es/molecule/course-sections/index.js +40 -0
  24. package/es/molecule/course-sections/index.js.map +1 -0
  25. package/es/molecule/course-sections/style.css +3 -0
  26. package/es/molecule/course-sections/test/fixtures/default.js +149 -0
  27. package/es/molecule/course-sections/test/fixtures/default.js.map +1 -0
  28. package/es/molecule/course-sections/test/fixtures/loading.js +9 -0
  29. package/es/molecule/course-sections/test/fixtures/loading.js.map +1 -0
  30. package/es/molecule/course-sections/test/fixtures.js +15 -0
  31. package/es/molecule/course-sections/test/fixtures.js.map +1 -0
  32. package/es/molecule/draggable/index.js +1 -1
  33. package/es/molecule/draggable/index.js.map +1 -1
  34. package/es/molecule/draggable/style.css +2 -16
  35. package/es/molecule/draggable-list/index.js +56 -0
  36. package/es/molecule/draggable-list/index.js.map +1 -0
  37. package/es/molecule/draggable-list/test/fixtures/course-sections.js +20 -0
  38. package/es/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
  39. package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js +26 -0
  40. package/es/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
  41. package/es/molecule/draggable-list/test/fixtures.js +15 -0
  42. package/es/molecule/draggable-list/test/fixtures.js.map +1 -0
  43. package/es/molecule/{setup-sections → draggable-list}/test/on-drop.js +17 -17
  44. package/es/molecule/draggable-list/test/on-drop.js.map +1 -0
  45. package/es/molecule/questions/drop-down/index.js +1 -6
  46. package/es/molecule/questions/drop-down/index.js.map +1 -1
  47. package/es/molecule/questions/free-text/index.js +35 -15
  48. package/es/molecule/questions/free-text/index.js.map +1 -1
  49. package/es/molecule/questions/free-text/style.css +34 -15
  50. package/es/molecule/questions/free-text/test/fixtures/default.js +1 -1
  51. package/es/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
  52. package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js +9 -0
  53. package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
  54. package/es/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
  55. package/es/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
  56. package/es/molecule/questions/free-text/test/fixtures.js +4 -2
  57. package/es/molecule/questions/free-text/test/fixtures.js.map +1 -1
  58. package/es/molecule/questions/free-text/test/free-text.js +106 -0
  59. package/es/molecule/questions/free-text/test/free-text.js.map +1 -0
  60. package/es/molecule/questions/qcm/index.js +37 -25
  61. package/es/molecule/questions/qcm/index.js.map +1 -1
  62. package/es/molecule/questions/qcm/style.css +48 -14
  63. package/es/molecule/questions/qcm/test/fixtures/default.js +8 -0
  64. package/es/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
  65. package/es/molecule/questions/qcm/test/qcm.js +103 -0
  66. package/es/molecule/questions/qcm/test/qcm.js.map +1 -0
  67. package/es/molecule/questions/qcm-graphic/index.js +35 -17
  68. package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
  69. package/es/molecule/questions/qcm-graphic/style.css +64 -13
  70. package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js +65 -0
  71. package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
  72. package/es/molecule/questions/question-range/style.css +9 -8
  73. package/es/molecule/questions/template/index.js +13 -10
  74. package/es/molecule/questions/template/index.js.map +1 -1
  75. package/es/molecule/select-multiple/style.css +8 -5
  76. package/es/molecule/setup-section/style.css +1 -0
  77. package/es/molecule/setup-sections/index.js +7 -33
  78. package/es/molecule/setup-sections/index.js.map +1 -1
  79. package/es/molecule/wizard-summary/test/fixtures/organize-courses.js +106 -0
  80. package/es/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
  81. package/es/molecule/wizard-summary/test/fixtures.js +2 -0
  82. package/es/molecule/wizard-summary/test/fixtures.js.map +1 -1
  83. package/es/organism/brand-form/test/fixtures/wizard-playlists.js +1 -1
  84. package/es/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
  85. package/es/organism/wizard-contents/index.js +6 -0
  86. package/es/organism/wizard-contents/index.js.map +1 -1
  87. package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +45 -0
  88. package/es/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
  89. package/es/organism/wizard-contents/test/fixtures.js +2 -0
  90. package/es/organism/wizard-contents/test/fixtures.js.map +1 -1
  91. package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +22 -0
  92. package/es/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
  93. package/es/template/back-office/brand-update/test/fixtures.js +2 -0
  94. package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
  95. package/es/util/get-shadow-box-color-from-primary.js +4 -0
  96. package/es/util/get-shadow-box-color-from-primary.js.map +1 -0
  97. package/es/util/test/get-shadow-box-color-from-primary.js +33 -0
  98. package/es/util/test/get-shadow-box-color-from-primary.js.map +1 -0
  99. package/es/variables/colors.css +3 -0
  100. package/lib/atom/range/handle.css +18 -2
  101. package/lib/atom/range/handle.js +8 -3
  102. package/lib/atom/range/handle.js.map +1 -1
  103. package/lib/atom/range/style.css +2 -2
  104. package/lib/atom/select/index.js +40 -17
  105. package/lib/atom/select/index.js.map +1 -1
  106. package/lib/atom/select/style.css +129 -40
  107. package/lib/atom/select/test/fixtures/player.js +21 -0
  108. package/lib/atom/select/test/fixtures/player.js.map +1 -0
  109. package/lib/atom/select/test/fixtures.js +3 -0
  110. package/lib/atom/select/test/fixtures.js.map +1 -1
  111. package/lib/atom/select/test/select.js +62 -0
  112. package/lib/atom/select/test/select.js.map +1 -0
  113. package/lib/molecule/course-section/index.js +5 -3
  114. package/lib/molecule/course-section/index.js.map +1 -1
  115. package/lib/molecule/course-section/style.css +2 -1
  116. package/lib/molecule/course-section/test/fixtures/chapter.js +2 -1
  117. package/lib/molecule/course-section/test/fixtures/chapter.js.map +1 -1
  118. package/lib/molecule/course-section/test/fixtures/course.js +2 -1
  119. package/lib/molecule/course-section/test/fixtures/course.js.map +1 -1
  120. package/lib/molecule/course-section/test/fixtures.js +25 -0
  121. package/lib/molecule/course-section/test/fixtures.js.map +1 -0
  122. package/lib/molecule/course-sections/index.js +54 -0
  123. package/lib/molecule/course-sections/index.js.map +1 -0
  124. package/lib/molecule/course-sections/style.css +3 -0
  125. package/lib/molecule/course-sections/test/fixtures/default.js +154 -0
  126. package/lib/molecule/course-sections/test/fixtures/default.js.map +1 -0
  127. package/lib/molecule/course-sections/test/fixtures/loading.js +14 -0
  128. package/lib/molecule/course-sections/test/fixtures/loading.js.map +1 -0
  129. package/lib/molecule/course-sections/test/fixtures.js +25 -0
  130. package/lib/molecule/course-sections/test/fixtures.js.map +1 -0
  131. package/lib/molecule/draggable/index.js +1 -1
  132. package/lib/molecule/draggable/index.js.map +1 -1
  133. package/lib/molecule/draggable/style.css +2 -16
  134. package/lib/molecule/draggable-list/index.js +73 -0
  135. package/lib/molecule/draggable-list/index.js.map +1 -0
  136. package/lib/molecule/draggable-list/test/fixtures/course-sections.js +29 -0
  137. package/lib/molecule/draggable-list/test/fixtures/course-sections.js.map +1 -0
  138. package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js +37 -0
  139. package/lib/molecule/draggable-list/test/fixtures/dashboard-sections.js.map +1 -0
  140. package/lib/molecule/draggable-list/test/fixtures.js +25 -0
  141. package/lib/molecule/draggable-list/test/fixtures.js.map +1 -0
  142. package/lib/molecule/{setup-sections → draggable-list}/test/on-drop.js +19 -19
  143. package/lib/molecule/draggable-list/test/on-drop.js.map +1 -0
  144. package/lib/molecule/questions/drop-down/index.js +1 -5
  145. package/lib/molecule/questions/drop-down/index.js.map +1 -1
  146. package/lib/molecule/questions/free-text/index.js +32 -14
  147. package/lib/molecule/questions/free-text/index.js.map +1 -1
  148. package/lib/molecule/questions/free-text/style.css +34 -15
  149. package/lib/molecule/questions/free-text/test/fixtures/default.js +1 -1
  150. package/lib/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
  151. package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js +14 -0
  152. package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
  153. package/lib/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
  154. package/lib/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
  155. package/lib/molecule/questions/free-text/test/fixtures.js +5 -2
  156. package/lib/molecule/questions/free-text/test/fixtures.js.map +1 -1
  157. package/lib/molecule/questions/free-text/test/free-text.js +119 -0
  158. package/lib/molecule/questions/free-text/test/free-text.js.map +1 -0
  159. package/lib/molecule/questions/qcm/index.js +44 -23
  160. package/lib/molecule/questions/qcm/index.js.map +1 -1
  161. package/lib/molecule/questions/qcm/style.css +48 -14
  162. package/lib/molecule/questions/qcm/test/fixtures/default.js +8 -0
  163. package/lib/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
  164. package/lib/molecule/questions/qcm/test/qcm.js +115 -0
  165. package/lib/molecule/questions/qcm/test/qcm.js.map +1 -0
  166. package/lib/molecule/questions/qcm-graphic/index.js +33 -15
  167. package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
  168. package/lib/molecule/questions/qcm-graphic/style.css +64 -13
  169. package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js +76 -0
  170. package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
  171. package/lib/molecule/questions/question-range/style.css +9 -8
  172. package/lib/molecule/questions/template/index.js +13 -10
  173. package/lib/molecule/questions/template/index.js.map +1 -1
  174. package/lib/molecule/select-multiple/style.css +8 -5
  175. package/lib/molecule/setup-section/style.css +1 -0
  176. package/lib/molecule/setup-sections/index.js +7 -37
  177. package/lib/molecule/setup-sections/index.js.map +1 -1
  178. package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js +111 -0
  179. package/lib/molecule/wizard-summary/test/fixtures/organize-courses.js.map +1 -0
  180. package/lib/molecule/wizard-summary/test/fixtures.js +3 -0
  181. package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -1
  182. package/lib/organism/brand-form/test/fixtures/wizard-playlists.js +1 -1
  183. package/lib/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
  184. package/lib/organism/wizard-contents/index.js +7 -0
  185. package/lib/organism/wizard-contents/index.js.map +1 -1
  186. package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js +54 -0
  187. package/lib/organism/wizard-contents/test/fixtures/playlist-organize-courses.js.map +1 -0
  188. package/lib/organism/wizard-contents/test/fixtures.js +3 -0
  189. package/lib/organism/wizard-contents/test/fixtures.js.map +1 -1
  190. package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js +32 -0
  191. package/lib/template/back-office/brand-update/test/fixtures/wizard-organize-courses-playlist.js.map +1 -0
  192. package/lib/template/back-office/brand-update/test/fixtures.js +3 -0
  193. package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
  194. package/lib/util/get-shadow-box-color-from-primary.js +12 -0
  195. package/lib/util/get-shadow-box-color-from-primary.js.map +1 -0
  196. package/lib/util/test/get-shadow-box-color-from-primary.js +40 -0
  197. package/lib/util/test/get-shadow-box-color-from-primary.js.map +1 -0
  198. package/lib/variables/colors.css +3 -0
  199. package/package.json +2 -2
  200. package/es/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
  201. package/es/molecule/search/test/fixtures.js +0 -15
  202. package/es/molecule/search/test/fixtures.js.map +0 -1
  203. package/es/molecule/setup-sections/test/on-drop.js.map +0 -1
  204. package/lib/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
  205. package/lib/molecule/search/test/fixtures.js +0 -25
  206. package/lib/molecule/search/test/fixtures.js.map +0 -1
  207. package/lib/molecule/setup-sections/test/on-drop.js.map +0 -1
@@ -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,65 @@
1
+ import _identity from "lodash/fp/identity";
2
+
3
+ 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); }
4
+
5
+ import browserEnv from 'browser-env';
6
+ import test from 'ava';
7
+ import React from 'react';
8
+ import { shallow, configure } from 'enzyme';
9
+ import Adapter from 'enzyme-adapter-react-16';
10
+ import QCMImage from '..';
11
+ import defaultFixture from './fixtures/default';
12
+ browserEnv();
13
+ configure({
14
+ adapter: new Adapter()
15
+ });
16
+ const translate = _identity;
17
+ test('onClick should be reachable, should match given aria-label', t => {
18
+ let answerWasClicked = false;
19
+ defaultFixture.props.answers[1] = _extends(_extends({}, defaultFixture.props.answers[1]), {}, {
20
+ onClick: () => {
21
+ answerWasClicked = true;
22
+ }
23
+ });
24
+ const wrapper = shallow( /*#__PURE__*/React.createElement(QCMImage, defaultFixture.props), {
25
+ context: {
26
+ translate
27
+ }
28
+ });
29
+ const answersImages = wrapper.find('[data-name="answerImage"]');
30
+ t.true(answersImages.at(1).exists());
31
+ t.is(answersImages.at(1).props()['aria-label'], 'Lorem ipsum');
32
+ const answers = wrapper.find('[data-name="answerGraphic"]');
33
+ answers.at(1).simulate('click');
34
+ t.true(answerWasClicked);
35
+ t.pass();
36
+ });
37
+ test("should set: selected's background to Primary, unselected's no background", t => {
38
+ const wrapper = shallow( /*#__PURE__*/React.createElement(QCMImage, defaultFixture.props), {
39
+ context: {
40
+ translate
41
+ }
42
+ });
43
+ const answers = wrapper.find('[data-name="answerGraphic"]');
44
+ const firstAnswer = answers.at(0);
45
+ t.true(firstAnswer.exists());
46
+ t.deepEqual(firstAnswer.props().style, {});
47
+ const unselectedBackgroundAnswer = firstAnswer.children().at(0);
48
+ t.true(unselectedBackgroundAnswer.exists());
49
+ t.deepEqual(unselectedBackgroundAnswer.props().style, {
50
+ backgroundColor: '#F4F4F5'
51
+ });
52
+ const firstAnswerText = firstAnswer.children().at(1).children().at(1).children().at(0);
53
+ t.true(firstAnswerText.exists());
54
+ const thirdAnswer = answers.at(2);
55
+ t.true(thirdAnswer.exists());
56
+ t.deepEqual(thirdAnswer.props().style, {
57
+ boxShadow: '0 4px 16px rgba(0, 122, 179, 0.25)'
58
+ });
59
+ const selectedBackgroundAnswer = thirdAnswer.children().at(0);
60
+ t.true(selectedBackgroundAnswer.exists());
61
+ t.deepEqual(selectedBackgroundAnswer.props().style, {
62
+ backgroundColor: '#00B0FF'
63
+ });
64
+ });
65
+ //# sourceMappingURL=qcm-graphic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/questions/qcm-graphic/test/qcm-graphic.js"],"names":["browserEnv","test","React","shallow","configure","Adapter","QCMImage","defaultFixture","adapter","translate","t","answerWasClicked","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,OAAOA,UAAP,MAAuB,aAAvB;AACA,OAAOC,IAAP,MAAiB,KAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,OAAR,EAAiBC,SAAjB,QAAiC,QAAjC;AAEA,OAAOC,OAAP,MAAoB,yBAApB;AACA,OAAOC,QAAP,MAAqB,IAArB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AAEAP,UAAU;AACVI,S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C,CAACgB,SAAF,CAAYQ,wBAAwB,CAACtB,KAAzB,GAAiCe,KAA7C,EAAoD;AAACG,IAAAA,eAAe,EAAE;AAAlB,GAApD;AACD,CArBG,CAAJ","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 {
@@ -3,6 +3,8 @@ import _map from "lodash/fp/map";
3
3
 
4
4
  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); }
5
5
 
6
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
7
+
6
8
  import React from 'react';
7
9
  import PropTypes from 'prop-types';
8
10
  import parseTemplateString from '../../../util/parse-template-string';
@@ -37,10 +39,16 @@ const Template = ({
37
39
  }, answers);
38
40
 
39
41
  if (!field) return null;
40
- const fieldView = field.type === 'text' ? /*#__PURE__*/React.createElement(FreeText, _extends({}, field, {
42
+
43
+ const {
44
+ type: fieldType
45
+ } = field,
46
+ fieldProps = _objectWithoutPropertiesLoose(field, ["type"]);
47
+
48
+ const fieldView = fieldType === 'text' ? /*#__PURE__*/React.createElement(FreeText, _extends({}, fieldProps, {
41
49
  className: style.text
42
- })) : /*#__PURE__*/React.createElement(DropDown, _extends({}, field, {
43
- theme: "template"
50
+ })) : /*#__PURE__*/React.createElement(DropDown, _extends({}, fieldProps, {
51
+ theme: "player"
44
52
  }));
45
53
  return /*#__PURE__*/React.createElement("div", {
46
54
  className: style.answerType,
@@ -56,16 +64,11 @@ const Template = ({
56
64
  };
57
65
 
58
66
  const TextPropTypes = process.env.NODE_ENV !== "production" ? _extends(_extends({}, DropDown.propTypes), {}, {
59
- type: PropTypes.string,
60
- name: PropTypes.string
61
- }) : {};
62
- const DropDownPropTypes = process.env.NODE_ENV !== "production" ? _extends(_extends({}, DropDown.propTypes), {}, {
63
- type: PropTypes.string,
64
- name: PropTypes.string
67
+ type: PropTypes.string
65
68
  }) : {};
66
69
  Template.propTypes = process.env.NODE_ENV !== "production" ? {
67
70
  template: PropTypes.string,
68
- answers: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(DropDownPropTypes), PropTypes.shape(TextPropTypes)]))
71
+ answers: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(DropDown.propTypes), PropTypes.shape(TextPropTypes)]))
69
72
  } : {};
70
73
  export default Template;
71
74
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/molecule/questions/template/index.js"],"names":["React","PropTypes","parseTemplateString","DropDown","FreeText","style","Template","template","answers","totalTemplate","templateCompose","convert","cap","part","key","type","__html","value","field","name","fieldView","text","answerType","wrapper","TextPropTypes","propTypes","string","DropDownPropTypes","arrayOf","oneOfType","shape"],"mappings":";;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;A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,iBAAU,kBAAf;AAAkC,IAAA,SAAS,EAAEJ,KAAK,CAACkB;AAAnD,KACGb,eADH,CADF;AAKD,CApCD;;AAsCA,MAAMc,aAAN,iEACKrB,QAAQ,CAACsB,SADd;AAEEV,EAAAA,IAAI,EAAEd,SAAS,CAACyB,MAFlB;AAGEP,EAAAA,IAAI,EAAElB,SAAS,CAACyB;AAHlB;AAMA,MAAMC,iBAAN,iEACKxB,QAAQ,CAACsB,SADd;AAEEV,EAAAA,IAAI,EAAEd,SAAS,CAACyB,MAFlB;AAGEP,EAAAA,IAAI,EAAElB,SAAS,CAACyB;AAHlB;AAMApB,QAAQ,CAACmB,SAAT,2CAAqB;AACnBlB,EAAAA,QAAQ,EAAEN,SAAS,CAACyB,MADD;AAEnBlB,EAAAA,OAAO,EAAEP,SAAS,CAAC2B,OAAV,CACP3B,SAAS,CAAC4B,SAAV,CAAoB,CAAC5B,SAAS,CAAC6B,KAAV,CAAgBH,iBAAhB,CAAD,EAAqC1B,SAAS,CAAC6B,KAAV,CAAgBN,aAAhB,CAArC,CAApB,CADO;AAFU,CAArB;AAOA,eAAelB,QAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, find} from 'lodash/fp';\nimport parseTemplateString from '../../../util/parse-template-string';\nimport DropDown from '../drop-down';\nimport FreeText from '../free-text';\nimport style from './style.css';\n\nconst Template = ({template, answers}) => {\n const totalTemplate = parseTemplateString(template);\n const templateCompose = map.convert({cap: false})((part, key) => {\n const type = part.type;\n if (type === 'string') {\n return (\n <span\n key={key}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: part.value}}\n />\n );\n }\n if (type === 'answerField') {\n const field = find({name: part.value}, answers);\n if (!field) return null;\n const fieldView =\n field.type === 'text' ? (\n <FreeText {...field} className={style.text} />\n ) : (\n <DropDown {...field} theme=\"template\" />\n );\n\n return (\n <div className={style.answerType} key={part.value}>\n {fieldView}\n </div>\n );\n }\n }, totalTemplate);\n\n return (\n <div data-name=\"template-wrapper\" className={style.wrapper}>\n {templateCompose}\n </div>\n );\n};\n\nconst TextPropTypes = {\n ...DropDown.propTypes,\n type: PropTypes.string,\n name: PropTypes.string\n};\n\nconst DropDownPropTypes = {\n ...DropDown.propTypes,\n type: PropTypes.string,\n name: PropTypes.string\n};\n\nTemplate.propTypes = {\n template: PropTypes.string,\n answers: PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.shape(DropDownPropTypes), PropTypes.shape(TextPropTypes)])\n )\n};\n\nexport default Template;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../src/molecule/questions/template/index.js"],"names":["React","PropTypes","parseTemplateString","DropDown","FreeText","style","Template","template","answers","totalTemplate","templateCompose","convert","cap","part","key","type","__html","value","field","name","fieldType","fieldProps","fieldView","text","answerType","wrapper","TextPropTypes","propTypes","string","arrayOf","oneOfType","shape"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,mBAAP,MAAgC,qCAAhC;AACA,OAAOC,QAAP,MAAqB,cAArB;AACA,OAAOC,QAAP,MAAqB,cAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWC,EAAAA;AAAX,CAAD,KAAyB;AACxC,QAAMC,aAAa,GAAGP,mBAAmB,CAACK,QAAD,CAAzC;;AACA,QAAMG,eAAe,GAAG,KAAIC,OAAJ,CAAY;AAACC,IAAAA,GAAG,EAAE;AAAN,GAAZ,EAA0B,CAACC,IAAD,EAAOC,GAAP,KAAe;AAC/D,UAAMC,IAAI,GAAGF,IAAI,CAACE,IAAlB;;AACA,QAAIA,IAAI,KAAK,QAAb,EAAuB;AACrB,0BACE;AACE,QAAA,GAAG,EAAED,GADP,CAEE;AAFF;AAGE,QAAA,uBAAuB,EAAE;AAACE,UAAAA,MAAM,EAAEH,IAAI,CAACI;AAAd;AAH3B,QADF;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es from 'prop-types';\nimport {map, find} from 'lodash/fp';\nimport parseTemplateString from '../../../util/parse-template-string';\nimport DropDown from '../drop-down';\nimport FreeText from '../free-text';\nimport style from './style.css';\n\nconst Template = ({template, answers}) => {\n const totalTemplate = parseTemplateString(template);\n const templateCompose = map.convert({cap: false})((part, key) => {\n const type = part.type;\n if (type === 'string') {\n return (\n <span\n key={key}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: part.value}}\n />\n );\n }\n if (type === 'answerField') {\n const field = find({name: part.value}, answers);\n if (!field) return null;\n const {type: fieldType, ...fieldProps} = field;\n const fieldView =\n fieldType === 'text' ? (\n <FreeText {...fieldProps} className={style.text} />\n ) : (\n <DropDown {...fieldProps} theme=\"player\" />\n );\n\n return (\n <div className={style.answerType} key={part.value}>\n {fieldView}\n </div>\n );\n }\n }, totalTemplate);\n\n return (\n <div data-name=\"template-wrapper\" className={style.wrapper}>\n {templateCompose}\n </div>\n );\n};\n\nconst TextPropTypes = {\n ...DropDown.propTypes,\n type: PropTypes.string\n};\n\nTemplate.propTypes = {\n template: PropTypes.string,\n answers: PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.shape(DropDown.propTypes), PropTypes.shape(TextPropTypes)])\n )\n};\n\nexport default Template;\n"],"file":"index.js"}
@@ -352,6 +352,7 @@
352
352
 
353
353
  .coorpmanager .descriptionLabel {
354
354
  margin: 0 1px 18px 0;
355
+ padding: 8px 16px;
355
356
  border-radius: 7px;
356
357
  background-color: cm_grey_700;
357
358
  flex-grow: 0;
@@ -365,14 +366,16 @@
365
366
  text-align: center;
366
367
  color: white;
367
368
  padding: 8px 16px;
368
- max-width: 200px;
369
- position: absolute;
370
- left: -20px;
371
- z-index: 999;
372
- bottom: 18px;
369
+ max-width: 348px;
373
370
  width: max-content;
371
+ position: absolute;
372
+ left: -24px;
373
+ z-index: 3;
374
+ bottom: 5px;
374
375
  visibility: hidden;
375
376
  opacity: 0;
377
+ overflow-wrap: break-word;
378
+ white-space: break-spaces;
376
379
  }
377
380
 
378
381
  .coorpmanager .title.titleWithSelection .descriptionLabel,
@@ -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 {
@@ -1,8 +1,6 @@
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, { useState, useCallback } from 'react';
1
+ import React from 'react';
4
2
  import PropTypes from 'prop-types';
5
- import Draggable from '../draggable';
3
+ import DraggableList from '../draggable-list';
6
4
  import SetupSection from '../setup-section';
7
5
  import Loader from '../../atom/loader';
8
6
  import style from './style.css';
@@ -16,36 +14,12 @@ const SetupSections = ({
16
14
  loading,
17
15
  onDrop
18
16
  }) => {
19
- const [dragTo, setDragTo] = useState(null);
20
- const [dragFrom, setDragFrom] = useState(null);
21
- const dragStartHandler = useCallback(id => {
22
- setDragFrom(id);
23
- }, [setDragFrom]);
24
- const dragOverHandler = useCallback(id => {
25
- if (dragTo === id) return;
26
- setDragTo(id);
27
- }, [dragTo, setDragTo]);
28
- const dragLeaveHandler = useCallback(id => {
29
- setDragTo(null);
30
- }, [setDragTo]);
31
- const dropHandler = useCallback(id => {
32
- if (onDrop && dragFrom) onDrop(dragFrom, id);
33
- setDragTo(null);
34
- setDragFrom(null);
35
- }, [onDrop, setDragTo, setDragFrom, dragFrom]);
36
17
  if (loading) return /*#__PURE__*/React.createElement(Loading, null);
37
- const sectionsView = sections.map(section => /*#__PURE__*/React.createElement(Draggable, {
38
- key: section.id,
39
- id: section.id,
40
- dragging: dragTo === section.id,
41
- onDragStart: dragStartHandler,
42
- onDragOver: dragOverHandler,
43
- onDragLeave: dragLeaveHandler,
44
- onDrop: dropHandler
45
- }, /*#__PURE__*/React.createElement(SetupSection, _extends({}, section, {
46
- key: section.id
47
- }))));
48
- return /*#__PURE__*/React.createElement("div", null, sectionsView);
18
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(DraggableList, {
19
+ itemType: "setup-section",
20
+ items: sections,
21
+ onDrop: onDrop
22
+ }));
49
23
  };
50
24
 
51
25
  SetupSections.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/setup-sections/index.js"],"names":["React","useState","useCallback","PropTypes","Draggable","SetupSection","Loader","style","Loading","loading","SetupSections","sections","onDrop","dragTo","setDragTo","dragFrom","setDragFrom","dragStartHandler","id","dragOverHandler","dragLeaveHandler","dropHandler","sectionsView","map","section","propTypes","arrayOf","shape","bool","func"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAG,mBACd;AAAK,EAAA,SAAS,EAAED,KAAK,CAACE;AAAtB,gBACE,oBAAC,MAAD,OADF,CADF;;AAMA,MAAMC,aAAa,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWF,EAAAA,OAAX;AAAoBG,EAAAA;AAApB,CAAD,KAAiC;AACrD,QAAM,CAACC,MAAD,EAASC,SAAT,IAAsBb,QAAQ,CAAC,IAAD,CAApC;AACA,QAAM,CAACc,QAAD,EAAWC,WAAX,IAA0Bf,QAAQ,CAAC,IAAD,CAAxC;AAEA,QAAMgB,gBAAgB,GAAGf,WAAW,CAClCgB,EAAE,IAAI;AACJF,IAAAA,WAAW,CAACE,EAAD,CAAX;AACD,GAHiC,EAIlC,CAACF,WAAD,CAJkC,CAApC;AAOA,QAAMG,eAAe,GAAGjB,WAAW,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AS,CAACwB,KAAV,CAAgBtB,YAAY,CAACoB,SAA7B,CAAlB,CADc;AAExBhB,EAAAA,OAAO,EAAEN,SAAS,CAACyB,IAFK;AAGxBhB,EAAAA,MAAM,EAAET,SAAS,CAAC0B;AAHM,CAA1B;AAMA,eAAenB,aAAf","sourcesContent":["import React, {useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport Draggable from '../draggable';\nimport SetupSection from '../setup-section';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nconst Loading = () => (\n <div className={style.loading}>\n <Loader />\n </div>\n);\n\nconst SetupSections = ({sections, loading, onDrop}) => {\n const [dragTo, setDragTo] = useState(null);\n const [dragFrom, setDragFrom] = useState(null);\n\n const dragStartHandler = useCallback(\n id => {\n setDragFrom(id);\n },\n [setDragFrom]\n );\n\n const dragOverHandler = useCallback(\n id => {\n if (dragTo === id) return;\n setDragTo(id);\n },\n [dragTo, setDragTo]\n );\n\n const dragLeaveHandler = useCallback(\n id => {\n setDragTo(null);\n },\n [setDragTo]\n );\n\n const dropHandler = useCallback(\n id => {\n if (onDrop && dragFrom) onDrop(dragFrom, id);\n\n setDragTo(null);\n setDragFrom(null);\n },\n [onDrop, setDragTo, setDragFrom, dragFrom]\n );\n\n if (loading) return <Loading />;\n\n const sectionsView = sections.map(section => (\n <Draggable\n key={section.id}\n id={section.id}\n dragging={dragTo === section.id}\n onDragStart={dragStartHandler}\n onDragOver={dragOverHandler}\n onDragLeave={dragLeaveHandler}\n onDrop={dropHandler}\n >\n <SetupSection {...section} key={section.id} />\n </Draggable>\n ));\n return <div>{sectionsView}</div>;\n};\n\nSetupSections.propTypes = {\n sections: PropTypes.arrayOf(PropTypes.shape(SetupSection.propTypes)),\n loading: PropTypes.bool,\n onDrop: PropTypes.func\n};\n\nexport default SetupSections;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/molecule/setup-sections/index.js"],"names":["React","PropTypes","DraggableList","SetupSection","Loader","style","Loading","loading","SetupSections","sections","onDrop","propTypes","arrayOf","shape","bool","func"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAG,mBACd;AAAK,EAAA,SAAS,EAAED,KAAK,CAACE;AAAtB,gBACE,oBAAC,MAAD,OADF,CADF;;AAMA,MAAMC,aAAa,GAAG,CAAC;AAACC,EAAAA,QAAD;AAAWF,EAAAA,OAAX;AAAoBG,EAAAA;AAApB,CAAD,KAAiC;AACrD,MAAIH,OAAJ,EAAa,oBAAO,oBAAC,OAAD,OAAP;AAEb,sBACE,8CACE,oBAAC,aAAD;AAAe,IAAA,QAAQ,EAAC,eAAxB;AAAwC,IAAA,KAAK,EAAEE,QAA/C;AAAyD,IAAA,MAAM,EAAEC;AAAjE,IADF,CADF;AAKD,CARD;;AAUAF,aAAa,CAACG,SAAd,2CAA0B;AACxBF,EAAAA,QAAQ,EAAER,SAAS,CAACW,OAAV,CAAkBX,SAAS,CAACY,KAAV,CAAgBV,YAAY,CAACQ,SAA7B,CAAlB,CADc;AAExBJ,EAAAA,OAAO,EAAEN,SAAS,CAACa,IAFK;AAGxBJ,EAAAA,MAAM,EAAET,SAAS,CAACc;AAHM,CAA1B;AAMA,eAAeP,aAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport DraggableList from '../draggable-list';\nimport SetupSection from '../setup-section';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nconst Loading = () => (\n <div className={style.loading}>\n <Loader />\n </div>\n);\n\nconst SetupSections = ({sections, loading, onDrop}) => {\n if (loading) return <Loading />;\n\n return (\n <div>\n <DraggableList itemType=\"setup-section\" items={sections} onDrop={onDrop} />\n </div>\n );\n};\n\nSetupSections.propTypes = {\n sections: PropTypes.arrayOf(PropTypes.shape(SetupSection.propTypes)),\n loading: PropTypes.bool,\n onDrop: PropTypes.func\n};\n\nexport default SetupSections;\n"],"file":"index.js"}
@@ -0,0 +1,106 @@
1
+ export default {
2
+ props: {
3
+ title: 'Certification summary',
4
+ sections: [{
5
+ items: [{
6
+ type: 'mainElement',
7
+ title: 'Language',
8
+ value: '🇬🇧 English'
9
+ }, {
10
+ type: 'mainElement',
11
+ title: 'Name',
12
+ value: 'Marketing expert'
13
+ }]
14
+ }, {
15
+ title: 'Translation',
16
+ items: [{
17
+ type: 'text',
18
+ text: '🇫🇷 French'
19
+ }, {
20
+ type: 'text',
21
+ text: '🇪🇸 Spanish'
22
+ }, {
23
+ type: 'text',
24
+ text: '🇮🇹 Italian'
25
+ }]
26
+ }, {
27
+ title: 'Populations',
28
+ items: [{
29
+ type: 'text',
30
+ text: 'Population 2'
31
+ }],
32
+ counterText: '1 population'
33
+ }, {
34
+ title: 'Courses',
35
+ items: [{
36
+ type: 'content',
37
+ title: 'Marketing and online advertising Marketing and online advertising Marketing and online advertising Marketing and online advertising',
38
+ author: 'Author',
39
+ category: 'course',
40
+ label: 'Course'
41
+ }, {
42
+ type: 'content',
43
+ title: 'Social networks',
44
+ author: 'Author',
45
+ category: 'chapter',
46
+ label: "5' learning"
47
+ }, {
48
+ type: 'content',
49
+ title: 'Other title',
50
+ author: 'Author 2',
51
+ category: 'course',
52
+ label: 'Course'
53
+ }, {
54
+ type: 'content',
55
+ title: 'Social others',
56
+ author: 'Author XXX',
57
+ category: 'chapter',
58
+ label: "5' learning"
59
+ }, {
60
+ type: 'content',
61
+ title: 'Social others others',
62
+ author: 'Author XXX',
63
+ label: "5' learning",
64
+ category: 'chapter'
65
+ }, {
66
+ type: 'content',
67
+ title: 'Something about empowerment',
68
+ author: 'Author XXX',
69
+ label: 'course',
70
+ category: 'course'
71
+ }, {
72
+ type: 'content',
73
+ title: 'Be a better human being',
74
+ author: 'Author XXX',
75
+ label: "5' learning",
76
+ category: 'chapter'
77
+ }, {
78
+ type: 'content',
79
+ title: 'Stronger faster better',
80
+ author: 'Author XXX',
81
+ label: 'course',
82
+ category: 'course'
83
+ }, {
84
+ type: 'content',
85
+ title: 'Relativity beyond time',
86
+ author: 'Author XXX',
87
+ label: 'course',
88
+ category: 'course'
89
+ }, {
90
+ type: 'content',
91
+ title: 'Are you awake?',
92
+ author: 'Author XXX',
93
+ label: "5' learning",
94
+ category: 'chapter'
95
+ }],
96
+ counterText: '12 courses'
97
+ }],
98
+ action: {
99
+ icon: 'save',
100
+ text: 'Save in drafts',
101
+ 'aria-label': 'Save in drafts',
102
+ onClick: () => console.log('save')
103
+ }
104
+ }
105
+ };
106
+ //# 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":"AAAA,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;AAC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AE,QAJT;AAKED,QAAAA,QAAQ,EAAE;AALZ,OArCK,EA4CL;AACEL,QAAAA,IAAI,EAAE,SADR;AAEEH,QAAAA,KAAK,EAAE,yBAFT;AAGEO,QAAAA,MAAM,EAAE,YAHV;AAIEE,QAAAA,KAAK,EAAE,aAJT;AAKED,QAAAA,QAAQ,EAAE;AALZ,OA5CK,EAmDL;AACEL,QAAAA,IAAI,EAAE,SADR;AAEEH,QAAAA,KAAK,EAAE,wBAFT;AAGEO,QAAAA,MAAM,EAAE,YAHV;AAIEE,QAAAA,KAAK,EAAE,QAJT;AAKED,QAAAA,QAAQ,EAAE;AALZ,OAnDK,EA0DL;AACEL,QAAAA,IAAI,EAAE,SADR;AAEEH,QAAAA,KAAK,EAAE,wBAFT;AAGEO,QAAAA,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,CAAf","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"}
@@ -4,6 +4,7 @@ import renderComponentMacro from '../../../test/helpers/render-component';
4
4
  import MoleculeWizardSummary from '..';
5
5
  import fixtureDefault from './fixtures/default';
6
6
  import fixtureOneSection from './fixtures/one-section';
7
+ import fixtureOrganizeCourses from './fixtures/organize-courses';
7
8
  import fixtureTabletClosed from './fixtures/tablet-closed';
8
9
  import fixtureThreeSections from './fixtures/three-sections';
9
10
  import fixtureTwoSections from './fixtures/two-sections';
@@ -15,6 +16,7 @@ test('Molecule › MoleculeWizardSummary > should have valid propTypes', t => {
15
16
  });
16
17
  test('Molecule › MoleculeWizardSummary › Default › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureDefault);
17
18
  test('Molecule › MoleculeWizardSummary › OneSection › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureOneSection);
19
+ test('Molecule › MoleculeWizardSummary › OrganizeCourses › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureOrganizeCourses);
18
20
  test('Molecule › MoleculeWizardSummary › TabletClosed › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureTabletClosed);
19
21
  test('Molecule › MoleculeWizardSummary › ThreeSections › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureThreeSections);
20
22
  test('Molecule › MoleculeWizardSummary › TwoSections › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureTwoSections);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/molecule/wizard-summary/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeWizardSummary","fixtureDefault","fixtureOneSection","fixtureTabletClosed","fixtureThreeSections","fixtureTwoSections","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,iBAAP,MAA8B,wBAA9B;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AAEAR,IAAI,CAAC,gEAAD,EAAmES,CAAC,IAAI;AAC1EA,EAAAA,CAAC,CAACC,IAAF;AACAT,EAAAA,OAAO,CAACE,qBAAqB,CAACQ,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0DAAyDF,GAAI,mEAAtF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAb,IAAI,CAAC,iEAAD,EAAoEE,oBAApE,EAA0FC,qBAA1F,EAAiHC,cAAjH,CAAJ;AACAJ,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,qBAA7F,EAAoHE,iBAApH,CAAJ;AACAL,IAAI,CAAC,sEAAD,EAAyEE,oBAAzE,EAA+FC,qBAA/F,EAAsHG,mBAAtH,CAAJ;AACAN,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,qBAAhG,EAAuHI,oBAAvH,CAAJ;AACAP,IAAI,CAAC,qEAAD,EAAwEE,oBAAxE,EAA8FC,qBAA9F,EAAqHK,kBAArH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeWizardSummary from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureOneSection from './fixtures/one-section';\nimport fixtureTabletClosed from './fixtures/tablet-closed';\nimport fixtureThreeSections from './fixtures/three-sections';\nimport fixtureTwoSections from './fixtures/two-sections';\n\ntest('Molecule › MoleculeWizardSummary > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeWizardSummary.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeWizardSummary.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeWizardSummary › Default › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureDefault);\ntest('Molecule › MoleculeWizardSummary › OneSection › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureOneSection);\ntest('Molecule › MoleculeWizardSummary › TabletClosed › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureTabletClosed);\ntest('Molecule › MoleculeWizardSummary › ThreeSections › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureThreeSections);\ntest('Molecule › MoleculeWizardSummary › TwoSections › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureTwoSections);\n"],"file":"fixtures.js"}
1
+ {"version":3,"sources":["../../../../src/molecule/wizard-summary/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeWizardSummary","fixtureDefault","fixtureOneSection","fixtureOrganizeCourses","fixtureTabletClosed","fixtureThreeSections","fixtureTwoSections","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,iBAAP,MAA8B,wBAA9B;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AAEAT,IAAI,CAAC,gEAAD,EAAmEU,CAAC,IAAI;AAC1EA,EAAAA,CAAC,CAACC,IAAF;AACAV,EAAAA,OAAO,CAACE,qBAAqB,CAACS,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0DAAyDF,GAAI,mEAAtF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAd,IAAI,CAAC,iEAAD,EAAoEE,oBAApE,EAA0FC,qBAA1F,EAAiHC,cAAjH,CAAJ;AACAJ,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,qBAA7F,EAAoHE,iBAApH,CAAJ;AACAL,IAAI,CAAC,yEAAD,EAA4EE,oBAA5E,EAAkGC,qBAAlG,EAAyHG,sBAAzH,CAAJ;AACAN,IAAI,CAAC,sEAAD,EAAyEE,oBAAzE,EAA+FC,qBAA/F,EAAsHI,mBAAtH,CAAJ;AACAP,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,qBAAhG,EAAuHK,oBAAvH,CAAJ;AACAR,IAAI,CAAC,qEAAD,EAAwEE,oBAAxE,EAA8FC,qBAA9F,EAAqHM,kBAArH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeWizardSummary from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureOneSection from './fixtures/one-section';\nimport fixtureOrganizeCourses from './fixtures/organize-courses';\nimport fixtureTabletClosed from './fixtures/tablet-closed';\nimport fixtureThreeSections from './fixtures/three-sections';\nimport fixtureTwoSections from './fixtures/two-sections';\n\ntest('Molecule › MoleculeWizardSummary > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeWizardSummary.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeWizardSummary.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeWizardSummary › Default › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureDefault);\ntest('Molecule › MoleculeWizardSummary › OneSection › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureOneSection);\ntest('Molecule › MoleculeWizardSummary › OrganizeCourses › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureOrganizeCourses);\ntest('Molecule › MoleculeWizardSummary › TabletClosed › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureTabletClosed);\ntest('Molecule › MoleculeWizardSummary › ThreeSections › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureThreeSections);\ntest('Molecule › MoleculeWizardSummary › TwoSections › should be rendered', renderComponentMacro, MoleculeWizardSummary, fixtureTwoSections);\n"],"file":"fixtures.js"}
@@ -5,7 +5,7 @@ export default {
5
5
  type: 'selectMultiple',
6
6
  title: 'Languages',
7
7
  placeholder: 'Language selection',
8
- description: 'This is the tooltip text',
8
+ description: 'The name and description of your custom playlist will be displayed in the selected language. Only the selected language will be saved. You can translate during step 2 "Translations".',
9
9
  theme: 'coorpmanager',
10
10
  hint: '15 / 30 characters',
11
11
  size: 'default',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/organism/brand-form/test/fixtures/wizard-playlists.js"],"names":["props","groups","fields","type","title","placeholder","description","theme","hint","size","options","name","value","selected","multiple"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,CACN;AACEC,MAAAA,MAAM,EAAE,CACN;AACEC,QAAAA,IAAI,EAAE,gBADR;AAEEC,QAAAA,KAAK,EAAE,WAFT;AAGEC,QAAAA,WAAW,EAAE,oBAHf;AAIEC,QAAAA,WAAW,EAAE,0BAJf;AAKEC,QAAAA,KAAK,EAAE,cALT;AAMEC,QAAAA,IAAI,EAAE,oBANR;AAOEC,QAAAA,IAAI,EAAE,SAPR;AAQEC,QAAAA,OAAO,EAAE,CACP;AACEC,UAAAA,IAAI,EAAE,cADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SADO,EAMP;AACEF,UAAAA,IAAI,EAAE,aADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SANO,EAWP;AACEF,UAAAA,IAAI,EAAE,WADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SAXO,EAgBP;AACEF,UAAAA,IAAI,EAAE,cADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SAhBO,CARX;AA8BEC,QAAAA,QAAQ,EAAE;AA9BZ,OADM,EAiCN;AACEX,QAAAA,IAAI,EAAE,MADR;AAEEC,QAAAA,KAAK,EAAE,eAFT;AAGEC,QAAAA,WAAW,EAAE,eAHf;AAIEC,QAAAA,WAAW,EAAE,0BAJf;AAKEC,QAAAA,KAAK,EAAE,cALT;AAMEC,QAAAA,IAAI,EAAE,oBANR;AAOEI,QAAAA,KAAK,EAAE,kBAPT;AAQEH,QAAAA,IAAI,EAAE;AARR,OAjCM,EA2CN;AACEN,QAAAA,IAAI,EAAE,UADR;AAEEC,QAAAA,KAAK,EAAE,aAFT;AAGEC,QAAAA,WAAW,EAAE,aAHf;AAIEC,QAAAA,WAAW,EAAE,0BAJf;AAKEC,QAAAA,KAAK,EAAE,cALT;AAMEC,QAAAA,IAAI,EAAE,qBANR;AAOEC,QAAAA,IAAI,EAAE,QAPR;AAQEG,QAAAA,KAAK,EACH;AATJ,OA3CM;AADV,KADM;AADH;AADM,CAAf","sourcesContent":["export default {\n props: {\n groups: [\n {\n fields: [\n {\n type: 'selectMultiple',\n title: 'Languages',\n placeholder: 'Language selection',\n description: 'This is the tooltip text',\n theme: 'coorpmanager',\n hint: '15 / 30 characters',\n size: 'default',\n options: [\n {\n name: '🇬🇧 English',\n value: 'en',\n selected: true\n },\n {\n name: '🇩🇪 German',\n value: 'de',\n selected: false\n },\n {\n name: '🇹🇭 Thai',\n value: 'th',\n selected: false\n },\n {\n name: '🇪🇸 Spanish',\n value: 'es',\n selected: false\n }\n ],\n multiple: false\n },\n {\n type: 'text',\n title: 'Playlist name',\n placeholder: 'Playlist name',\n description: 'This is the tooltip text',\n theme: 'coorpmanager',\n hint: '15 / 30 characters',\n value: 'Marketing expert',\n size: 'default'\n },\n {\n type: 'textarea',\n title: 'Description',\n placeholder: 'Description',\n description: 'This is the tooltip text',\n theme: 'coorpmanager',\n hint: '80 / 200 characters',\n size: 'medium',\n value:\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis fermentum sem ac fermentum luctus. Integer eu dui magna. Donec ut tristique dui. Vestibulum non accumsan tellus. Donec luctus erat vitae aliquet viverra. Mauris malesuada tortor quis viverra vestibulum. Nullam laoreet porta massa vitae porta.'\n }\n ]\n }\n ]\n }\n};\n"],"file":"wizard-playlists.js"}
1
+ {"version":3,"sources":["../../../../../src/organism/brand-form/test/fixtures/wizard-playlists.js"],"names":["props","groups","fields","type","title","placeholder","description","theme","hint","size","options","name","value","selected","multiple"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,CACN;AACEC,MAAAA,MAAM,EAAE,CACN;AACEC,QAAAA,IAAI,EAAE,gBADR;AAEEC,QAAAA,KAAK,EAAE,WAFT;AAGEC,QAAAA,WAAW,EAAE,oBAHf;AAIEC,QAAAA,WAAW,EACT,wLALJ;AAMEC,QAAAA,KAAK,EAAE,cANT;AAOEC,QAAAA,IAAI,EAAE,oBAPR;AAQEC,QAAAA,IAAI,EAAE,SARR;AASEC,QAAAA,OAAO,EAAE,CACP;AACEC,UAAAA,IAAI,EAAE,cADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SADO,EAMP;AACEF,UAAAA,IAAI,EAAE,aADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SANO,EAWP;AACEF,UAAAA,IAAI,EAAE,WADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SAXO,EAgBP;AACEF,UAAAA,IAAI,EAAE,cADR;AAEEC,UAAAA,KAAK,EAAE,IAFT;AAGEC,UAAAA,QAAQ,EAAE;AAHZ,SAhBO,CATX;AA+BEC,QAAAA,QAAQ,EAAE;AA/BZ,OADM,EAkCN;AACEX,QAAAA,IAAI,EAAE,MADR;AAEEC,QAAAA,KAAK,EAAE,eAFT;AAGEC,QAAAA,WAAW,EAAE,eAHf;AAIEC,QAAAA,WAAW,EAAE,0BAJf;AAKEC,QAAAA,KAAK,EAAE,cALT;AAMEC,QAAAA,IAAI,EAAE,oBANR;AAOEI,QAAAA,KAAK,EAAE,kBAPT;AAQEH,QAAAA,IAAI,EAAE;AARR,OAlCM,EA4CN;AACEN,QAAAA,IAAI,EAAE,UADR;AAEEC,QAAAA,KAAK,EAAE,aAFT;AAGEC,QAAAA,WAAW,EAAE,aAHf;AAIEC,QAAAA,WAAW,EAAE,0BAJf;AAKEC,QAAAA,KAAK,EAAE,cALT;AAMEC,QAAAA,IAAI,EAAE,qBANR;AAOEC,QAAAA,IAAI,EAAE,QAPR;AAQEG,QAAAA,KAAK,EACH;AATJ,OA5CM;AADV,KADM;AADH;AADM,CAAf","sourcesContent":["export default {\n props: {\n groups: [\n {\n fields: [\n {\n type: 'selectMultiple',\n title: 'Languages',\n placeholder: 'Language selection',\n description:\n 'The name and description of your custom playlist will be displayed in the selected language. Only the selected language will be saved. You can translate during step 2 \"Translations\".',\n theme: 'coorpmanager',\n hint: '15 / 30 characters',\n size: 'default',\n options: [\n {\n name: '🇬🇧 English',\n value: 'en',\n selected: true\n },\n {\n name: '🇩🇪 German',\n value: 'de',\n selected: false\n },\n {\n name: '🇹🇭 Thai',\n value: 'th',\n selected: false\n },\n {\n name: '🇪🇸 Spanish',\n value: 'es',\n selected: false\n }\n ],\n multiple: false\n },\n {\n type: 'text',\n title: 'Playlist name',\n placeholder: 'Playlist name',\n description: 'This is the tooltip text',\n theme: 'coorpmanager',\n hint: '15 / 30 characters',\n value: 'Marketing expert',\n size: 'default'\n },\n {\n type: 'textarea',\n title: 'Description',\n placeholder: 'Description',\n description: 'This is the tooltip text',\n theme: 'coorpmanager',\n hint: '80 / 200 characters',\n size: 'medium',\n value:\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis fermentum sem ac fermentum luctus. Integer eu dui magna. Donec ut tristique dui. Vestibulum non accumsan tellus. Donec luctus erat vitae aliquet viverra. Mauris malesuada tortor quis viverra vestibulum. Nullam laoreet porta massa vitae porta.'\n }\n ]\n }\n ]\n }\n};\n"],"file":"wizard-playlists.js"}