@coorpacademy/components 10.22.2 → 10.22.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 (147) hide show
  1. package/es/atom/drag-and-drop/index.js +2 -1
  2. package/es/atom/drag-and-drop/index.js.map +1 -1
  3. package/es/atom/header-back-button/index.native.js +74 -0
  4. package/es/atom/header-back-button/index.native.js.map +1 -0
  5. package/es/atom/header-back-icon/index.native.js +27 -0
  6. package/es/atom/header-back-icon/index.native.js.map +1 -0
  7. package/es/atom/html/index.native.js +146 -0
  8. package/es/atom/html/index.native.js.map +1 -0
  9. package/es/atom/input-checkbox/index.js +3 -2
  10. package/es/atom/input-checkbox/index.js.map +1 -1
  11. package/es/atom/input-switch/index.js +45 -7
  12. package/es/atom/input-switch/index.js.map +1 -1
  13. package/es/atom/input-switch/style.css +56 -6
  14. package/es/atom/select-modal/index.native.js +113 -0
  15. package/es/atom/select-modal/index.native.js.map +1 -0
  16. package/es/atom/space/index.native.js +21 -0
  17. package/es/atom/space/index.native.js.map +1 -0
  18. package/es/atom/text/index.native.js +31 -0
  19. package/es/atom/text/index.native.js.map +1 -0
  20. package/es/hoc/modal/index.native.js +97 -0
  21. package/es/hoc/modal/index.native.js.map +1 -0
  22. package/es/hoc/modal/select/index.native.js +86 -0
  23. package/es/hoc/modal/select/index.native.js.map +1 -0
  24. package/es/hoc/modal/select-item/index.native.js +54 -0
  25. package/es/hoc/modal/select-item/index.native.js.map +1 -0
  26. package/es/hoc/touchable/index.native.js +8 -0
  27. package/es/hoc/touchable/index.native.js.map +1 -1
  28. package/es/index.js +2 -1
  29. package/es/index.js.map +1 -1
  30. package/es/molecule/answer/index.js +39 -32
  31. package/es/molecule/answer/index.js.map +1 -1
  32. package/es/molecule/cm-popin/index.js +125 -19
  33. package/es/molecule/cm-popin/index.js.map +1 -1
  34. package/es/molecule/cm-popin/style.css +176 -9
  35. package/es/molecule/feedback/index.js +7 -3
  36. package/es/molecule/feedback/index.js.map +1 -1
  37. package/es/molecule/feedback/style.css +24 -0
  38. package/es/molecule/questions/free-text/index.native.js +9 -10
  39. package/es/molecule/questions/free-text/index.native.js.map +1 -1
  40. package/es/molecule/questions/mobile/template/index.native.js +222 -0
  41. package/es/molecule/questions/mobile/template/index.native.js.map +1 -0
  42. package/es/template/app-player/player/index.js +6 -3
  43. package/es/template/app-player/player/index.js.map +1 -1
  44. package/es/template/app-player/popin-end/index.js +21 -6
  45. package/es/template/app-player/popin-end/index.js.map +1 -1
  46. package/es/template/app-player/popin-end/style.css +1 -1
  47. package/es/template/app-player/popin-end/summary.css +65 -0
  48. package/es/template/app-player/popin-end/summary.js +57 -7
  49. package/es/template/app-player/popin-end/summary.js.map +1 -1
  50. package/es/template/app-player/popin-header/index.js +33 -12
  51. package/es/template/app-player/popin-header/index.js.map +1 -1
  52. package/es/template/app-player/popin-header/style.css +93 -0
  53. package/es/template/app-player/popin-no-access/index.js +27 -0
  54. package/es/template/app-player/popin-no-access/index.js.map +1 -0
  55. package/es/template/app-review/prop-types.js +2 -1
  56. package/es/template/app-review/prop-types.js.map +1 -1
  57. package/es/template/app-review/slides/index.js +2 -2
  58. package/es/template/app-review/slides/index.js.map +1 -1
  59. package/es/template/app-review/template-context.js +5 -1
  60. package/es/template/app-review/template-context.js.map +1 -1
  61. package/es/template/common/dashboard/index.js +6 -3
  62. package/es/template/common/dashboard/index.js.map +1 -1
  63. package/es/types/app-review.d.js +2 -0
  64. package/es/types/app-review.d.js.map +1 -0
  65. package/es/types/progression-engine.d.js +2 -0
  66. package/es/types/progression-engine.d.js.map +1 -0
  67. package/es/types/translations.js +2 -0
  68. package/es/types/translations.js.map +1 -0
  69. package/es/util/parse-template-string.js +4 -2
  70. package/es/util/parse-template-string.js.map +1 -1
  71. package/es/variables/colors.css +1 -0
  72. package/es/variables/theme.native.js +1 -0
  73. package/es/variables/theme.native.js.map +1 -1
  74. package/lib/atom/drag-and-drop/index.js +2 -1
  75. package/lib/atom/drag-and-drop/index.js.map +1 -1
  76. package/lib/atom/header-back-button/index.native.js +95 -0
  77. package/lib/atom/header-back-button/index.native.js.map +1 -0
  78. package/lib/atom/header-back-icon/index.native.js +38 -0
  79. package/lib/atom/header-back-icon/index.native.js.map +1 -0
  80. package/lib/atom/html/index.native.js +163 -0
  81. package/lib/atom/html/index.native.js.map +1 -0
  82. package/lib/atom/input-checkbox/index.js +2 -1
  83. package/lib/atom/input-checkbox/index.js.map +1 -1
  84. package/lib/atom/input-switch/index.js +45 -7
  85. package/lib/atom/input-switch/index.js.map +1 -1
  86. package/lib/atom/input-switch/style.css +56 -6
  87. package/lib/atom/select-modal/index.native.js +135 -0
  88. package/lib/atom/select-modal/index.native.js.map +1 -0
  89. package/lib/atom/space/index.native.js +33 -0
  90. package/lib/atom/space/index.native.js.map +1 -0
  91. package/lib/atom/text/index.native.js +46 -0
  92. package/lib/atom/text/index.native.js.map +1 -0
  93. package/lib/hoc/modal/index.native.js +114 -0
  94. package/lib/hoc/modal/index.native.js.map +1 -0
  95. package/lib/hoc/modal/select/index.native.js +103 -0
  96. package/lib/hoc/modal/select/index.native.js.map +1 -0
  97. package/lib/hoc/modal/select-item/index.native.js +70 -0
  98. package/lib/hoc/modal/select-item/index.native.js.map +1 -0
  99. package/lib/hoc/touchable/index.native.js +9 -0
  100. package/lib/hoc/touchable/index.native.js.map +1 -1
  101. package/lib/index.js +4 -0
  102. package/lib/index.js.map +1 -1
  103. package/lib/molecule/answer/index.js +39 -32
  104. package/lib/molecule/answer/index.js.map +1 -1
  105. package/lib/molecule/cm-popin/index.js +126 -18
  106. package/lib/molecule/cm-popin/index.js.map +1 -1
  107. package/lib/molecule/cm-popin/style.css +176 -9
  108. package/lib/molecule/feedback/index.js +7 -3
  109. package/lib/molecule/feedback/index.js.map +1 -1
  110. package/lib/molecule/feedback/style.css +24 -0
  111. package/lib/molecule/questions/free-text/index.native.js +8 -9
  112. package/lib/molecule/questions/free-text/index.native.js.map +1 -1
  113. package/lib/molecule/questions/mobile/template/index.native.js +243 -0
  114. package/lib/molecule/questions/mobile/template/index.native.js.map +1 -0
  115. package/lib/template/app-player/player/index.js +7 -3
  116. package/lib/template/app-player/player/index.js.map +1 -1
  117. package/lib/template/app-player/popin-end/index.js +21 -6
  118. package/lib/template/app-player/popin-end/index.js.map +1 -1
  119. package/lib/template/app-player/popin-end/style.css +1 -1
  120. package/lib/template/app-player/popin-end/summary.css +65 -0
  121. package/lib/template/app-player/popin-end/summary.js +58 -7
  122. package/lib/template/app-player/popin-end/summary.js.map +1 -1
  123. package/lib/template/app-player/popin-header/index.js +32 -11
  124. package/lib/template/app-player/popin-header/index.js.map +1 -1
  125. package/lib/template/app-player/popin-header/style.css +93 -0
  126. package/lib/template/app-player/popin-no-access/index.js +37 -0
  127. package/lib/template/app-player/popin-no-access/index.js.map +1 -0
  128. package/lib/template/app-review/prop-types.js +2 -1
  129. package/lib/template/app-review/prop-types.js.map +1 -1
  130. package/lib/template/app-review/slides/index.js +2 -2
  131. package/lib/template/app-review/slides/index.js.map +1 -1
  132. package/lib/template/app-review/template-context.js +5 -1
  133. package/lib/template/app-review/template-context.js.map +1 -1
  134. package/lib/template/common/dashboard/index.js +7 -3
  135. package/lib/template/common/dashboard/index.js.map +1 -1
  136. package/lib/types/app-review.d.js +2 -0
  137. package/lib/types/app-review.d.js.map +1 -0
  138. package/lib/types/progression-engine.d.js +2 -0
  139. package/lib/types/progression-engine.d.js.map +1 -0
  140. package/lib/types/translations.js +2 -0
  141. package/lib/types/translations.js.map +1 -0
  142. package/lib/util/parse-template-string.js +4 -2
  143. package/lib/util/parse-template-string.js.map +1 -1
  144. package/lib/variables/colors.css +1 -0
  145. package/lib/variables/theme.native.js +3 -1
  146. package/lib/variables/theme.native.js.map +1 -1
  147. package/package.json +6 -4
@@ -9,10 +9,14 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
10
  var _novaIcons = require("@coorpacademy/nova-icons");
11
11
 
12
+ var _map = _interopRequireDefault(require("lodash/fp/map"));
13
+
12
14
  var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
13
15
 
14
16
  var _buttonLinkIconOnly = _interopRequireDefault(require("../../atom/button-link-icon-only"));
15
17
 
18
+ var _inputSwitch = _interopRequireDefault(require("../../atom/input-switch"));
19
+
16
20
  var _style = _interopRequireDefault(require("./style.css"));
17
21
 
18
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -25,78 +29,182 @@ const CMPopin = props => {
25
29
  secondButton,
26
30
  onClose,
27
31
  header,
28
- icon
32
+ icon,
33
+ backgroundImageUrl,
34
+ descriptionText,
35
+ thirdButton,
36
+ cookieTitle,
37
+ descriptionBtnTxt,
38
+ listBtnSwicth
29
39
  } = props;
30
40
  const logo = {
31
41
  AlertDiamond: _novaIcons.NovaSolidInterfaceFeedbackInterfaceAlertDiamond,
32
42
  WindowUpload: _novaIcons.NovaSolidApplicationsWindowUpload3
33
43
  };
34
44
  const LogoComponent = logo[icon];
45
+ const backgroundImageStyle = backgroundImageUrl ? {
46
+ backgroundImage: `url(${backgroundImageUrl})`,
47
+ backgroundSize: 'cover'
48
+ } : null;
49
+
50
+ const renderHeader = () => {
51
+ if (header) return /*#__PURE__*/_react.default.createElement("img", {
52
+ className: _style.default.headerBackground,
53
+ src: header
54
+ });
55
+ if (mode === 'cookie') return /*#__PURE__*/_react.default.createElement("div", {
56
+ className: _style.default.cookieHeader
57
+ }, /*#__PURE__*/_react.default.createElement("div", {
58
+ className: _style.default.cookieIconContainer
59
+ }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaLineSettingsCookie, {
60
+ className: _style.default.cookieIcon
61
+ })), /*#__PURE__*/_react.default.createElement("div", {
62
+ className: _style.default.cookieTitle
63
+ }, cookieTitle));
64
+ return null;
65
+ };
66
+
67
+ const getClassBtnSwitch = (index, btnList) => {
68
+ switch (index) {
69
+ case 0:
70
+ return _style.default.firstBtnSwitchContainer;
71
+
72
+ case btnList.length - 1:
73
+ return _style.default.lastBtnSwitchContainer;
74
+
75
+ default:
76
+ return _style.default.singleSwitchContainer;
77
+ }
78
+ };
79
+
80
+ const renderBtnSwitch = () => {
81
+ return _map.default.convert({
82
+ cap: false
83
+ })((el, index) => {
84
+ const {
85
+ type,
86
+ title,
87
+ value,
88
+ onChange,
89
+ titlePosition,
90
+ theme,
91
+ details,
92
+ requiredSelection,
93
+ disabled
94
+ } = el;
95
+ return /*#__PURE__*/_react.default.createElement("div", {
96
+ key: index,
97
+ className: getClassBtnSwitch(index, listBtnSwicth)
98
+ }, /*#__PURE__*/_react.default.createElement(_inputSwitch.default, {
99
+ type,
100
+ title,
101
+ value,
102
+ onChange,
103
+ titlePosition,
104
+ theme,
105
+ details,
106
+ requiredSelection,
107
+ disabled
108
+ }));
109
+ })(listBtnSwicth);
110
+ };
111
+
35
112
  return /*#__PURE__*/_react.default.createElement("div", {
36
- className: _style.default.background
113
+ className: mode !== 'cookie' ? _style.default.background : null,
114
+ style: backgroundImageStyle,
115
+ "data-name": 'cm-popin-container'
37
116
  }, /*#__PURE__*/_react.default.createElement("div", {
38
- className: _style.default.popin
117
+ className: mode === 'cookie' ? _style.default.popinCookie : _style.default.popin
39
118
  }, /*#__PURE__*/_react.default.createElement("header", {
40
119
  className: _style.default.popinHeader
41
- }, header ? /*#__PURE__*/_react.default.createElement("img", {
42
- className: _style.default.headerBackground,
43
- src: header
44
- }) : null, onClose ? /*#__PURE__*/_react.default.createElement(_buttonLinkIconOnly.default, {
120
+ }, renderHeader(), onClose ? /*#__PURE__*/_react.default.createElement(_buttonLinkIconOnly.default, {
45
121
  onClick: onClose,
46
122
  "data-name": 'close-icon',
47
123
  "aria-label": 'close-icon',
48
124
  size: "small",
49
125
  icon: "close"
50
126
  }) : null), /*#__PURE__*/_react.default.createElement("div", {
127
+ className: _style.default.titleContainer
128
+ }, /*#__PURE__*/_react.default.createElement("div", {
51
129
  className: _style.default.contentSection
52
130
  }, LogoComponent ? /*#__PURE__*/_react.default.createElement(LogoComponent, {
53
131
  className: _style.default.icon
54
132
  }) : null, content ? /*#__PURE__*/_react.default.createElement("p", {
55
133
  className: mode === 'alert' ? _style.default.content : _style.default.message,
56
- "data-name": `cm-popin-content` // eslint-disable-next-line react/no-danger
134
+ "data-name": 'cm-popin-content' // eslint-disable-next-line react/no-danger
57
135
  ,
58
136
  dangerouslySetInnerHTML: {
59
137
  __html: content
60
138
  }
61
- }) : null), /*#__PURE__*/_react.default.createElement("div", {
139
+ }) : null), descriptionText ? /*#__PURE__*/_react.default.createElement("p", {
140
+ className: _style.default.descriptionText // eslint-disable-next-line react/no-danger
141
+ ,
142
+ dangerouslySetInnerHTML: {
143
+ __html: descriptionText
144
+ }
145
+ }) : null), descriptionBtnTxt ? /*#__PURE__*/_react.default.createElement("div", {
146
+ className: _style.default.descriptionBtn
147
+ }, descriptionBtnTxt) : null, renderBtnSwitch(), /*#__PURE__*/_react.default.createElement("div", {
62
148
  className: _style.default.buttonContainer
63
149
  }, firstButton ? /*#__PURE__*/_react.default.createElement("div", {
64
- className: _style.default.button
150
+ className: firstButton.largeButton ? _style.default.largeButton : _style.default.button
65
151
  }, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
66
152
  label: firstButton.label,
67
153
  onClick: firstButton.handleOnclick,
68
- "data-name": `cm-popin-cta`,
154
+ "data-name": 'cm-popin-cta',
69
155
  "aria-label": firstButton['aria-label'],
70
156
  type: firstButton.type
71
157
  })) : null, secondButton ? /*#__PURE__*/_react.default.createElement("div", {
72
- className: _style.default.button
158
+ className: secondButton.largeButton ? _style.default.largeButton : _style.default.button
73
159
  }, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
74
160
  label: secondButton.label,
75
161
  onClick: secondButton.handleOnclick,
76
162
  "data-name": `cm-popin-cta-${secondButton.type}`,
77
- "aria-label": firstButton['aria-label'],
163
+ "aria-label": secondButton['aria-label'],
78
164
  type: secondButton.type
165
+ })) : null, thirdButton ? /*#__PURE__*/_react.default.createElement("div", {
166
+ className: thirdButton.largeButton ? _style.default.largeButton : _style.default.button
167
+ }, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
168
+ label: thirdButton.label,
169
+ onClick: thirdButton.handleOnclick,
170
+ "data-name": `cm-popin-cta-${thirdButton.type}`,
171
+ "aria-label": thirdButton['aria-label'],
172
+ type: thirdButton.type
79
173
  })) : null)));
80
174
  };
81
175
 
82
176
  CMPopin.propTypes = process.env.NODE_ENV !== "production" ? {
83
177
  content: _propTypes.default.string,
84
- mode: _propTypes.default.oneOf(['alert', 'information']),
178
+ mode: _propTypes.default.oneOf(['alert', 'information', 'cookie']),
85
179
  header: _propTypes.default.string,
86
180
  firstButton: _propTypes.default.shape({
87
181
  label: _propTypes.default.string,
88
182
  handleOnclick: _propTypes.default.func,
89
183
  'aria-label': _propTypes.default.string,
90
- type: _propTypes.default.string
184
+ largeButton: _propTypes.default.bool,
185
+ type: _propTypes.default.oneOf(['dangerous', 'primary', 'secondary'])
91
186
  }),
92
187
  secondButton: _propTypes.default.shape({
93
188
  label: _propTypes.default.string,
94
189
  handleOnclick: _propTypes.default.func,
95
- type: _propTypes.default.oneOf(['dangerous', 'primary']),
96
- 'aria-label': _propTypes.default.string
190
+ type: _propTypes.default.oneOf(['dangerous', 'primary', 'secondary']),
191
+ 'aria-label': _propTypes.default.string,
192
+ largeButton: _propTypes.default.boolean
193
+ }),
194
+ thirdButton: _propTypes.default.shape({
195
+ label: _propTypes.default.string,
196
+ handleOnclick: _propTypes.default.func,
197
+ type: _propTypes.default.oneOf(['dangerous', 'primary', 'secondary']),
198
+ 'aria-label': _propTypes.default.string,
199
+ largeButton: _propTypes.default.boolean
97
200
  }),
98
201
  onClose: _propTypes.default.func,
99
- icon: _propTypes.default.string
202
+ icon: _propTypes.default.string,
203
+ backgroundImageUrl: _propTypes.default.string,
204
+ descriptionText: _propTypes.default.string,
205
+ cookieTitle: _propTypes.default.string,
206
+ descriptionBtnTxt: _propTypes.default.string,
207
+ listBtnSwicth: _propTypes.default.arrayOf(_propTypes.default.shape(_inputSwitch.default.propTypes))
100
208
  } : {};
101
209
  var _default = CMPopin;
102
210
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/cm-popin/index.js"],"names":["CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","logo","AlertDiamond","WindowUpload","LogoComponent","style","background","popin","popinHeader","headerBackground","contentSection","message","__html","buttonContainer","button","label","handleOnclick","type","propTypes","PropTypes","string","oneOf","shape","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAGC,KAAK,IAAI;AACvB,QAAM;AAACC,IAAAA,OAAD;AAAUC,IAAAA,IAAI,GAAG,OAAjB;AAA0BC,IAAAA,WAA1B;AAAuCC,IAAAA,YAAvC;AAAqDC,IAAAA,OAArD;AAA8DC,IAAAA,MAA9D;AAAsEC,IAAAA;AAAtE,MAA8EP,KAApF;AAEA,QAAMQ,IAAI,GAAG;AACXC,IAAAA,YAAY,EAAZA,0DADW;AAEXC,IAAAA,YAAY,EAAZA;AAFW,GAAb;AAIA,QAAMC,aAAa,GAAGH,IAAI,CAACD,IAAD,CAA1B;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEK,eAAMC;AAAtB,kBACE;AAAK,IAAA,SAAS,EAAED,eAAME;AAAtB,kBACE;AAAQ,IAAA,SAAS,EAAEF,eAAMG;AAAzB,KACGT,MAAM,gBAAG;AAAK,IAAA,SAAS,EAAEM,eAAMI,gBAAtB;AAAwC,IAAA,GAAG,EAAEV;AAA7C,IAAH,GAA6D,IADtE,EAEGD,OAAO,gBACN,6BAAC,2BAAD;AACE,IAAA,OAAO,EAAEA,OADX;AAEE,iBAAW,YAFb;AAGE,kBAAY,YAHd;AAIE,IAAA,IAAI,EAAC,OAJP;AAKE,IAAA,IAAI,EAAC;AALP,IADM,GAQJ,IAVN,CADF,eAaE;AAAK,IAAA,SAAS,EAAEO,eAAMK;AAAtB,KACGN,aAAa,gBAAG,6BAAC,aAAD;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AAEuB,mBAAUG,KAAV,CAAgB;AAC3BP,IAAAA,KAAK,EAAEI,mBAAUC,MADU;AAE3BJ,IAAAA,aAAa,EAAEG,mBAAUI,IAFE;AAG3B,kBAAcJ,mBAAUC,MAHG;AAI3BH,IAAAA,IAAI,EAAEE,mBAAUC;AAJW,GAAhB,CAJK;AAUlBvB,EAAAA,YAAY,EAAEsB,mBAAUG,KAAV,CAAgB;AAC5BP,IAAAA,KAAK,EAAEI,mBAAUC,MADW;AAE5BJ,IAAAA,aAAa,EAAEG,mBAAUI,IAFG;AAG5BN,IAAAA,IAAI,EAAEE,mBAAUE,KAAV,CAAgB,CAAC,WAAD,EAAc,SAAd,CAAhB,CAHsB;AAI5B,kBAAcF,mBAAUC;AAJI,GAAhB,CAVI;AAgBlBtB,EAAAA,OAAO,EAAEqB,mBAAUI,IAhBD;AAiBlBvB,EAAAA,IAAI,EAAEmB,mBAAUC;AAjBE,CAApB;eAoBe5B,O","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload\n} from '@coorpacademy/nova-icons';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport style from './style.css';\n\nconst CMPopin = props => {\n const {content, mode = 'alert', firstButton, secondButton, onClose, header, icon} = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload\n };\n const LogoComponent = logo[icon];\n\n return (\n <div className={style.background}>\n <div className={style.popin}>\n <header className={style.popinHeader}>\n {header ? <img className={style.headerBackground} src={header} /> : null}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={`cm-popin-content`}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={`cm-popin-cta`}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={firstButton['aria-label']}\n type={secondButton.type}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = {\n content: PropTypes.string,\n mode: PropTypes.oneOf(['alert', 'information']),\n header: PropTypes.string,\n firstButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n 'aria-label': PropTypes.string,\n type: PropTypes.string\n }),\n secondButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary']),\n 'aria-label': PropTypes.string\n }),\n onClose: PropTypes.func,\n icon: PropTypes.string\n};\n\nexport default CMPopin;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/molecule/cm-popin/index.js"],"names":["CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","AlertDiamond","WindowUpload","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","style","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","map","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","background","popinCookie","popin","popinHeader","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","propTypes","PropTypes","string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AAUG,KAAV,CAAgBK,qBAAYT,SAA5B,CAAlB;AA/BG,CAApB;eAkCe/D,O","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth\n } = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n return null;\n };\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n <div className={style.titleContainer}>\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderBtnSwitch()}\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = {\n content: PropTypes.string,\n mode: PropTypes.oneOf(['alert', 'information', 'cookie']),\n header: PropTypes.string,\n firstButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary'])\n }),\n secondButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.boolean\n }),\n thirdButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.boolean\n }),\n onClose: PropTypes.func,\n icon: PropTypes.string,\n backgroundImageUrl: PropTypes.string,\n descriptionText: PropTypes.string,\n cookieTitle: PropTypes.string,\n descriptionBtnTxt: PropTypes.string,\n listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes))\n};\n\nexport default CMPopin;\n"],"file":"index.js"}
@@ -14,6 +14,14 @@
14
14
  @value cm_grey_100 from colors;
15
15
  @value cm_grey_200 from colors;
16
16
  @value cm_blue_600 from colors;
17
+ @value cm_grey_500 from colors;
18
+ @value cm_grey_700 from colors;
19
+ @value white from colors;
20
+ @value cm_blue_50 from colors;
21
+ @value breakpoints: '../../variables/breakpoints.css';
22
+ @value mobile from breakpoints;
23
+ @value tablet from breakpoints;
24
+ @value cm_grey_75 from colors;
17
25
 
18
26
  .background {
19
27
  top: 0px;
@@ -27,7 +35,8 @@
27
35
  box-sizing: border-box;
28
36
  overflow: hidden;
29
37
  display: flex;
30
- position:fixed;
38
+ position: fixed;
39
+ z-index: 3;
31
40
  }
32
41
 
33
42
  .headerBackground {
@@ -37,7 +46,6 @@
37
46
  }
38
47
 
39
48
  .popin {
40
- position: absolute;
41
49
  overflow: auto;
42
50
  width: 500px;
43
51
  height: 414px;
@@ -59,7 +67,6 @@
59
67
  justify-content: center;
60
68
  align-items: center;
61
69
  padding: 40px 40px 0px;
62
- position: absolute;
63
70
  background: xtraLightGrey;
64
71
  font-family: 'Gilroy';
65
72
  font-weight: 500;
@@ -71,10 +78,10 @@
71
78
  margin: 10px 0px;
72
79
  }
73
80
  @keyframes popup {
74
- 0%{
81
+ 0% {
75
82
  transform: scale(0);
76
83
  }
77
- 100%{
84
+ 100% {
78
85
  transform: scale(1);
79
86
  }
80
87
  }
@@ -84,7 +91,6 @@
84
91
  flex-direction: column;
85
92
  align-items: center;
86
93
  justify-content: center;
87
- width: 65%;
88
94
  }
89
95
 
90
96
  .content {
@@ -100,9 +106,9 @@
100
106
  }
101
107
 
102
108
  .buttonContainer {
103
- width: 100%;
104
- height: 80px;
109
+ min-height: 80px;
105
110
  display: flex;
111
+ width: 100%;
106
112
  align-items: center;
107
113
  justify-content: center;
108
114
  }
@@ -112,6 +118,11 @@
112
118
  padding: 8px;
113
119
  }
114
120
 
121
+ .largeButton {
122
+ width: 100%;
123
+ padding: 8px;
124
+ }
125
+
115
126
  .icon {
116
127
  width: 60px;
117
128
  height: 60px;
@@ -126,4 +137,160 @@
126
137
 
127
138
  .popinHeader button {
128
139
  position: absolute;
129
- }
140
+ }
141
+ .descriptionText {
142
+ text-align: center;
143
+ font-family: Gilroy;
144
+ font-weight: 500;
145
+ font-size: 16px;
146
+ line-height: 22px;
147
+ color: cm_grey_500;
148
+ font-style: normal;
149
+ white-space: pre-line;
150
+ margin-top: 0px;
151
+ }
152
+ .titleContainer {
153
+ align-items: center;
154
+ display: flex;
155
+ flex-direction: column;
156
+ width: 100%;
157
+ }
158
+
159
+ .cookieHeader {
160
+ width: 100%;
161
+ background-color: cm_grey_700;
162
+ padding: 16px 24px;
163
+ border-radius: 10px 10px 0px 0px;
164
+ display: flex;
165
+ align-items: center;
166
+ }
167
+
168
+ .popinCookie {
169
+ max-width: 550px;
170
+ flex-grow: 0;
171
+ margin: 16px;
172
+ border-radius: 10px;
173
+ background-color: cm_grey_50;
174
+ animation: popup 0.7s;
175
+ position: fixed;
176
+ bottom: 32px;
177
+ left: 32px;
178
+ z-index: 2;
179
+ }
180
+ .cookieTitle {
181
+ font-family: "Gilroy";
182
+ font-style: normal;
183
+ font-weight: 700;
184
+ font-size: 24px;
185
+ line-height: 32px;
186
+ color: white;
187
+ padding-left: 16px;
188
+ width: 60%;
189
+ }
190
+ .cookieIcon {
191
+ height: 20px;
192
+ width: 20px;
193
+ }
194
+ .cookieIconContainer {
195
+ width: 39px;
196
+ height: 39px;
197
+ border-radius: 8px;
198
+ background-color: cm_blue_50;
199
+ display: flex;
200
+ justify-content: center;
201
+ align-items: center;
202
+ }
203
+ .popinCookie .button {
204
+ width: 100%;
205
+ padding: 0px 8px 0px 0px
206
+ }
207
+ .popinCookie .button span {
208
+ margin: 0
209
+ }
210
+
211
+ .popinCookie .message {
212
+ padding: 24px 24px 40px 24px
213
+ }
214
+
215
+ .descriptionBtn {
216
+ font-family: "Gilroy";
217
+ font-weight: 500;
218
+ font-size: 16px;
219
+ line-height: 22px;
220
+ color: cm_grey_500;
221
+ font-style: normal;
222
+ white-space: pre-line;
223
+ margin-top: 24px;
224
+ width: calc(100% - 24px);
225
+ padding-left: 24px;
226
+ margin-bottom: 24px;
227
+ }
228
+
229
+
230
+ .firstBtnSwitchContainer {
231
+ height: 56px;
232
+ background-color: cm_grey_75;
233
+ width: 100%;
234
+ display: flex;
235
+ align-items: center;
236
+ }
237
+ .firstBtnSwitchContainer div:first-child {
238
+ margin-left: 9px;
239
+ }
240
+ .singleSwitchContainer div:first-child {
241
+ margin-left: 9px;
242
+ }
243
+
244
+ .lastBtnSwitchContainer {
245
+ composes: singleSwitchContainer;
246
+ margin-bottom: 28px;
247
+ }
248
+
249
+ .singleSwitchContainer {
250
+ width: 100%;
251
+ display: flex;
252
+ align-items: center;
253
+ width: 100%;
254
+ margin-top: 24px;
255
+ }
256
+ a {
257
+ color: cm_primary_blue;
258
+ text-decoration: none;
259
+ }
260
+
261
+ .popinCookie .buttonContainer {
262
+ min-height: 44px;
263
+ padding-bottom: 16px;
264
+ width: auto;
265
+ padding-left: 24px;
266
+ padding-right: 16px;
267
+ }
268
+ .popinCookie .largeButton {
269
+ padding: 0px 8px 0px 0px
270
+ }
271
+ @media tablet {
272
+ .popinCookie {
273
+ position: fixed;
274
+ bottom: 10px;
275
+ left: unset;
276
+ align-self: center;
277
+ max-height: calc(100vh - 50px);
278
+ overflow-x: hidden;
279
+ overflow-y: auto;
280
+ }
281
+ .popinCookie .button{
282
+ width: 100%;
283
+ padding: 0px 0px 8px 0px
284
+ }
285
+ .buttonContainer {
286
+ flex-wrap: wrap;
287
+ margin-top: 40px;
288
+ }
289
+ .popinCookie .largeButton {
290
+ padding: 8px 0px 0px 0px
291
+ }
292
+ .popinCookie .message {
293
+ padding: 24px 24px 0px 24px
294
+ }
295
+
296
+ }
@@ -32,7 +32,8 @@ const Feedback = (props, context) => {
32
32
  media,
33
33
  mediaDescription,
34
34
  title,
35
- description
35
+ description,
36
+ mode = 'default'
36
37
  } = props;
37
38
 
38
39
  const resource = media && media.type && _extends(_extends({}, media), (0, _pipe2.default)((0, _get2.default)('src.0'), (0, _extend2.default)({
@@ -40,8 +41,11 @@ const Feedback = (props, context) => {
40
41
  }))(media));
41
42
 
42
43
  return (resource || title || description ? /*#__PURE__*/_react.default.createElement("div", {
44
+ className: mode === 'scorm' ? _style.default.feedbackContainerScorm : null
45
+ }, /*#__PURE__*/_react.default.createElement("div", {
43
46
  className: _style.default.feedback,
44
- "data-name": "feedback"
47
+ "data-name": "feedback",
48
+ id: "feedback"
45
49
  }, /*#__PURE__*/_react.default.createElement("div", {
46
50
  className: (0, _classnames.default)(_style.default.title, _style.default.innerHTML),
47
51
  "data-name": "title" // eslint-disable-next-line react/no-danger
@@ -68,7 +72,7 @@ const Feedback = (props, context) => {
68
72
  dangerouslySetInnerHTML: {
69
73
  __html: mediaDescription
70
74
  }
71
- })) : null)) : null) || '';
75
+ })) : null))) : null) || '';
72
76
  };
73
77
 
74
78
  Feedback.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/feedback/index.js"],"names":["Feedback","props","context","media","mediaDescription","title","description","resource","type","style","feedback","innerHTML","__html","descWrapper","resourcePlayer","propTypes","PropTypes","string","shape","oneOf","TYPE_IMAGE","TYPE_PDF","TYPE_VIDEO","TYPE_AUDIO","src","array"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,QAAQ,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AACnC,QAAM;AAACC,IAAAA,KAAD;AAAQC,IAAAA,gBAAR;AAA0BC,IAAAA,KAA1B;AAAiCC,IAAAA;AAAjC,MAAgDL,KAAtD;;AACA,QAAMM,QAAQ,GAAGJ,KAAK,IACpBA,KAAK,CAACK,IADS,0BAEVL,KAFU,GAGV,oBAAK,mBAAI,OAAJ,CAAL,EAAmB,sBAAO;AAACG,IAAAA,WAAW,EAAEF;AAAd,GAAP,CAAnB,EAA4DD,KAA5D,CAHU,CAAjB;;AAMA,SACE,CAACI,QAAQ,IAAIF,KAAZ,IAAqBC,WAArB,gBACC;AAAK,IAAA,SAAS,EAAEG,eAAMC,QAAtB;AAAgC,iBAAU;AAA1C,kBACE;AACE,IAAA,SAAS,EAAE,yBAAWD,eAAMJ,KAAjB,EAAwBI,eAAME,SAA9B,CADb;AAEE,iBAAU,OAFZ,CAGE;AAHF;AAIE,IAAA,uBAAuB,EAAE;AAACC,MAAAA,MAAM,EAAEP;AAAT;AAJ3B,IADF,eAOE;AAAK,IAAA,SAAS,EAAEI,eAAMI;AAAtB,kBACE;AACE,IAAA,SAAS,EAAE,yBAAWJ,eAAMH,WAAjB,EAA8BG,eAAME,SAApC,CADb;AAEE,iBAAU,aAFZ,CAGE;AAHF;AAIE,IAAA,uBAAuB,EAAE;AAACC,MAAAA,MAAM,EAAEN;AAAT;AAJ3B,IADF,EAOGC,QAAQ,gBACP,uDACE,6BAAC,uBAAD;AAAgB,IAAA,SAAS,EAAEE,eAAMK,cAAjC;AAAiD,IAAA,QAAQ,EAAEP;AAA3D,IADF,eAEE;AACE,iBAAU,kBADZ;AAEE,IAAA,SAAS,EAAE,yBAAWE,eAAML,gBAAjB,EAAmCK,eAAME,SAAzC,CAFb,CAGE;AAHF;AAIE,IAAA,uBAAuB,EAAE;AAACC,MAAAA,MAAM,EAAER;AAAT;AAJ3B,IAFF,CADO,GAUL,IAjBN,CAPF,CADD,GA4BG,IA5BJ,KA4Ba,EA7Bf;AA+BD,CAvCD;;AAyCAJ,QAAQ,CAACe,SAAT,2CAAqB;AACnBV,EAAAA,KAAK,EAAEW,mBAAUC,MADE;AAEnBX,EAAAA,WAAW,EAAEU,mBAAUC,MAFJ;AAGnBd,EAAAA,KAAK,EAAEa,mBAAUE,KAAV,CAAgB;AACrBV,IAAAA,IAAI,EAAEQ,mBAAUG,KAAV,CAAgB,CAACC,0BAAD,EAAaC,wBAAb,EAAuBC,0BAAvB,EAAmCC,0BAAnC,CAAhB,CADe;AAErBC,IAAAA,GAAG,EAAER,mBAAUS;AAFM,GAAhB,CAHY;AAOnBrB,EAAAA,gBAAgB,EAAEY,mBAAUC;AAPT,CAArB;eAUejB,Q","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {pipe, get, extend} from 'lodash/fp';\nimport classnames from 'classnames';\nimport ResourcePlayer, {TYPE_IMAGE, TYPE_VIDEO, TYPE_PDF, TYPE_AUDIO} from '../resource-player';\nimport style from './style.css';\n\nconst Feedback = (props, context) => {\n const {media, mediaDescription, title, description} = props;\n const resource = media &&\n media.type && {\n ...media,\n ...pipe(get('src.0'), extend({description: mediaDescription}))(media)\n };\n\n return (\n (resource || title || description ? (\n <div className={style.feedback} data-name=\"feedback\">\n <div\n className={classnames(style.title, style.innerHTML)}\n data-name=\"title\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <div className={style.descWrapper}>\n <div\n className={classnames(style.description, style.innerHTML)}\n data-name=\"description\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: description}}\n />\n {resource ? (\n <div>\n <ResourcePlayer className={style.resourcePlayer} resource={resource} />\n <div\n data-name=\"mediaDescription\"\n className={classnames(style.mediaDescription, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: mediaDescription}}\n />\n </div>\n ) : null}\n </div>\n </div>\n ) : null) || ''\n );\n};\n\nFeedback.propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n media: PropTypes.shape({\n type: PropTypes.oneOf([TYPE_IMAGE, TYPE_PDF, TYPE_VIDEO, TYPE_AUDIO]),\n src: PropTypes.array\n }),\n mediaDescription: PropTypes.string\n};\n\nexport default Feedback;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/molecule/feedback/index.js"],"names":["Feedback","props","context","media","mediaDescription","title","description","mode","resource","type","style","feedbackContainerScorm","feedback","innerHTML","__html","descWrapper","resourcePlayer","propTypes","PropTypes","string","shape","oneOf","TYPE_IMAGE","TYPE_PDF","TYPE_VIDEO","TYPE_AUDIO","src","array"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,QAAQ,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AACnC,QAAM;AAACC,IAAAA,KAAD;AAAQC,IAAAA,gBAAR;AAA0BC,IAAAA,KAA1B;AAAiCC,IAAAA,WAAjC;AAA8CC,IAAAA,IAAI,GAAG;AAArD,MAAkEN,KAAxE;;AACA,QAAMO,QAAQ,GAAGL,KAAK,IACpBA,KAAK,CAACM,IADS,0BAEVN,KAFU,GAGV,oBAAK,mBAAI,OAAJ,CAAL,EAAmB,sBAAO;AAACG,IAAAA,WAAW,EAAEF;AAAd,GAAP,CAAnB,EAA4DD,KAA5D,CAHU,C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AAA,IAAI,EAAES,mBAAUG,KAAV,CAAgB,CAACC,0BAAD,EAAaC,wBAAb,EAAuBC,0BAAvB,EAAmCC,0BAAnC,CAAhB,CADe;AAErBC,IAAAA,GAAG,EAAER,mBAAUS;AAFM,GAAhB,CAHY;AAOnBvB,EAAAA,gBAAgB,EAAEc,mBAAUC;AAPT,CAArB;eAUenB,Q","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {pipe, get, extend} from 'lodash/fp';\nimport classnames from 'classnames';\nimport ResourcePlayer, {TYPE_IMAGE, TYPE_VIDEO, TYPE_PDF, TYPE_AUDIO} from '../resource-player';\nimport style from './style.css';\n\nconst Feedback = (props, context) => {\n const {media, mediaDescription, title, description, mode = 'default'} = props;\n const resource = media &&\n media.type && {\n ...media,\n ...pipe(get('src.0'), extend({description: mediaDescription}))(media)\n };\n\n return (\n (resource || title || description ? (\n <div className={mode === 'scorm' ? style.feedbackContainerScorm : null}>\n <div className={style.feedback} data-name=\"feedback\" id=\"feedback\">\n <div\n className={classnames(style.title, style.innerHTML)}\n data-name=\"title\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <div className={style.descWrapper}>\n <div\n className={classnames(style.description, style.innerHTML)}\n data-name=\"description\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: description}}\n />\n {resource ? (\n <div>\n <ResourcePlayer className={style.resourcePlayer} resource={resource} />\n <div\n data-name=\"mediaDescription\"\n className={classnames(style.mediaDescription, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: mediaDescription}}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n ) : null) || ''\n );\n};\n\nFeedback.propTypes = {\n title: PropTypes.string,\n description: PropTypes.string,\n media: PropTypes.shape({\n type: PropTypes.oneOf([TYPE_IMAGE, TYPE_PDF, TYPE_VIDEO, TYPE_AUDIO]),\n src: PropTypes.array\n }),\n mediaDescription: PropTypes.string\n};\n\nexport default Feedback;\n"],"file":"index.js"}
@@ -9,6 +9,8 @@
9
9
  @value medium from colors;
10
10
  @value xtraLightGrey from colors;
11
11
  @value white from colors;
12
+ @value cm_grey_75 from colors;
13
+
12
14
 
13
15
  .feedback {
14
16
  width: 100%;
@@ -19,6 +21,24 @@
19
21
  flex-direction: column;
20
22
  }
21
23
 
24
+ .feedbackContainerScorm {
25
+ background-color: white;
26
+ max-width: 884px;
27
+ height: 386px;
28
+ padding-bottom: 10px;
29
+ overflow-x: auto;
30
+ border: 1px solid cm_grey_75;
31
+ border-top: 0px;
32
+ z-index: 2;
33
+ margin-top: 60px;
34
+ position: relative;
35
+ }
36
+
37
+ .feedbackContainerScorm > .feedback {
38
+ border-bottom: 0px;
39
+ height: 100%;
40
+ }
41
+
22
42
  .title {
23
43
  width: 100%;
24
44
  margin-bottom: 20px;
@@ -90,6 +110,10 @@
90
110
  width: 100%;
91
111
  margin-bottom: 8px;
92
112
  }
113
+ .feedbackContainerScorm {
114
+ width: 100%;
115
+ height: 100%;
116
+ }
93
117
  }
94
118
 
95
119
  .innerHTML {
@@ -51,23 +51,23 @@ const FreeText = props => {
51
51
  const [styleSheet, setStylesheet] = (0, _react.useState)(null);
52
52
  const {
53
53
  brandTheme,
54
- theme
54
+ theme,
55
+ translations
55
56
  } = templateContext;
56
57
  const PLACEHOLDER_COLOR = theme.colors.gray.medium; // ------------------------------------
57
58
 
58
59
  const {
59
60
  analytics,
60
61
  questionType,
61
- fullWitdh,
62
+ fullWitdh = false,
62
63
  testID,
63
64
  onChange,
64
65
  isDisabled,
65
- value,
66
- placeholder
66
+ value
67
67
  } = props; // ------------------------------------
68
68
 
69
- const handleFocus = (0, _react.useMemo)(() => analytics && logEvent(_analytics.ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType), [analytics, questionType]);
70
- const handleBlur = (0, _react.useMemo)(() => analytics && logEvent(_analytics.ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType), [analytics, questionType]); // ------------------------------------
69
+ const handleFocus = (0, _react.useCallback)(() => analytics && logEvent(_analytics.ANALYTICS_EVENT_TYPE.INPUT_FOCUS, analytics, questionType), [analytics, questionType]);
70
+ const handleBlur = (0, _react.useCallback)(() => analytics && logEvent(_analytics.ANALYTICS_EVENT_TYPE.INPUT_BLUR, analytics, questionType), [analytics, questionType]); // ------------------------------------
71
71
 
72
72
  (0, _react.useEffect)(() => {
73
73
  const _stylesheet = createStyleSheet(brandTheme, theme);
@@ -80,14 +80,13 @@ const FreeText = props => {
80
80
  }
81
81
 
82
82
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
83
- style: [styleSheet.spaced, fullWitdh && styleSheet.fullWitdh],
84
- testID: testID
83
+ style: [styleSheet.spaced, fullWitdh && styleSheet.fullWitdh]
85
84
  }, /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, {
86
85
  style: [styleSheet.input, styleSheet.text],
87
86
  onFocus: handleFocus,
88
87
  onBlur: handleBlur,
89
88
  onChangeText: onChange,
90
- placeholder: placeholder,
89
+ placeholder: translations.typeHere,
91
90
  placeholderTextColor: PLACEHOLDER_COLOR,
92
91
  value: value,
93
92
  testID: testID,