@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
@@ -59,53 +59,60 @@ const MediaView = ({
59
59
 
60
60
  MediaView.propTypes = process.env.NODE_ENV !== "production" ? MediaViewPropTypes : {};
61
61
 
62
- const Answer = props => {
62
+ const Switch = ({
63
+ model,
64
+ help
65
+ }) => {
63
66
  const {
64
- model,
65
- media,
66
- help
67
- } = props;
67
+ type
68
+ } = model;
68
69
 
69
- const buildAnswer = () => {
70
- // (propTypes model.type is properly defined)
71
- // eslint-disable-next-line react/prop-types
72
- const {
73
- type
74
- } = model;
70
+ switch (type) {
71
+ case 'qcmDrag':
72
+ return /*#__PURE__*/React.createElement(QcmDrag, _extends({}, model, {
73
+ help: help
74
+ }));
75
75
 
76
- switch (type) {
77
- case 'qcmDrag':
78
- return /*#__PURE__*/React.createElement(QcmDrag, _extends({}, model, {
79
- help: help
80
- }));
76
+ case 'qcm':
77
+ return /*#__PURE__*/React.createElement(Qcm, model);
81
78
 
82
- case 'qcm':
83
- return /*#__PURE__*/React.createElement(Qcm, model);
79
+ case 'qcmGraphic':
80
+ return /*#__PURE__*/React.createElement(QcmGraphic, model);
84
81
 
85
- case 'qcmGraphic':
86
- return /*#__PURE__*/React.createElement(QcmGraphic, model);
82
+ case 'freeText':
83
+ return /*#__PURE__*/React.createElement(FreeText, model);
87
84
 
88
- case 'freeText':
89
- return /*#__PURE__*/React.createElement(FreeText, model);
85
+ case 'dropDown':
86
+ return /*#__PURE__*/React.createElement(DropDown, model);
90
87
 
91
- case 'dropDown':
92
- return /*#__PURE__*/React.createElement(DropDown, model);
88
+ case 'slider':
89
+ return /*#__PURE__*/React.createElement(QuestionRange, model);
93
90
 
94
- case 'slider':
95
- return /*#__PURE__*/React.createElement(QuestionRange, model);
91
+ case 'template':
92
+ return /*#__PURE__*/React.createElement(Template, model);
93
+ }
94
+ };
96
95
 
97
- case 'template':
98
- return /*#__PURE__*/React.createElement(Template, model);
99
- }
100
- };
96
+ Switch.propTypes = process.env.NODE_ENV !== "production" ? {
97
+ model: propTypes.model,
98
+ help: propTypes.help
99
+ } : {};
101
100
 
102
- const answerView = buildAnswer(model);
101
+ const Answer = props => {
102
+ const {
103
+ model,
104
+ media,
105
+ help
106
+ } = props;
103
107
  return /*#__PURE__*/React.createElement("div", {
104
108
  "data-name": "answer",
105
109
  className: style.wrapper
106
110
  }, media ? /*#__PURE__*/React.createElement(MediaView, {
107
111
  media: media
108
- }) : null, answerView);
112
+ }) : null, /*#__PURE__*/React.createElement(Switch, {
113
+ model: model,
114
+ help: help
115
+ }));
109
116
  };
110
117
 
111
118
  Answer.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/answer/index.js"],"names":["React","VideoPlayer","DropDown","FreeText","QcmDrag","Qcm","QcmGraphic","QuestionRange","Template","Audio","style","propTypes","MediaViewPropTypes","TYPE_AUDIO","TYPE_IMAGE","TYPE_VIDEO","MediaView","media","videoId","type","childProps","backgroundImage","url","video","audio","Answer","props","model","help","buildAnswer","answerView","wrapper"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AACA,OAAOC,GAAP,MAAgB,kBAAhB;AACA,OAAOC,UAAP,MAAuB,0BAAvB;AACA,OAAOC,aAAP,MAA0B,6BAA1B;AACA,OAAOC,QAAP,MAAqB,uBAArB;AACA,OAAOC,KAAP,MAAkB,UAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,IAAmBC,kBAAnB,EAAuCC,UAAvC,EAAmDC,UAAnD,EAA+DC,UAA/D,QAAgF,cAAhF;;AAEA,MAAMC,SAAS,GAAG,CAAC;AAACC,EAAAA;AAAD,CAAD,KAAa;AAC7B,QAAM;AAACC,IAAAA,OAAD;AAAUC,IAAAA;AAAV,MAAiCF,KAAvC;AAAA,QAAyBG,UAAzB,iCAAuCH,KAAvC;;AACA,UAAQE,IAAR;AACE,SAAKL,UAAL;AACE,0BACE;AACE,QAAA,SAAS,EAAEJ,KAAK,CAACO,KADnB;AAEE,QAAA,KAAK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,oBAAC,aAAD,EAAmBA,KAAnB,CAAP;;AACF,WAAK,UAAL;AACE,4BAAO,oBAAC,QAAD,EAAcA,KAAd,CAAP;AAdJ;AAgBD,GArBD;;AAsBA,QAAMG,UAAU,GAAGD,WAAW,CAACF,KAAD,CAA9B;AAEA,sBACE;AAAK,iBAAU,QAAf;AAAwB,IAAA,SAAS,EAAEjB,KAAK,CAACqB;AAAzC,KACGd,KAAK,gBAAG,oBAAC,SAAD;AAAW,IAAA,KAAK,EAAEA;AAAlB,IAAH,GAAiC,IADzC,EAEGa,UAFH,CADF;AAMD,CAhCD;;AAkCAL,MAAM,CAACd,SAAP,2CAAmBA,SAAnB;AAEA,eAAec,MAAf","sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Answer = props => {\n const {model, media, help} = props;\n const buildAnswer = () => {\n // (propTypes model.type is properly defined)\n // eslint-disable-next-line react/prop-types\n const {type} = model;\n\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} />;\n case 'qcm':\n return <Qcm {...model} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} />;\n case 'slider':\n return <QuestionRange {...model} />;\n case 'template':\n return <Template {...model} />;\n }\n };\n const answerView = buildAnswer(model);\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n {answerView}\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/molecule/answer/index.js"],"names":["React","VideoPlayer","DropDown","FreeText","QcmDrag","Qcm","QcmGraphic","QuestionRange","Template","Audio","style","propTypes","MediaViewPropTypes","TYPE_AUDIO","TYPE_IMAGE","TYPE_VIDEO","MediaView","media","videoId","type","childProps","backgroundImage","url","video","audio","Switch","model","help","Answer","props","wrapper"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AACA,OAAOC,GAAP,MAAgB,kBAAhB;AACA,OAAOC,UAAP,MAAuB,0BAAvB;AACA,OAAOC,aAAP,MAA0B,6BAA1B;AACA,OAAOC,QAAP,MAAqB,uBAArB;AACA,OAAOC,KAAP,MAAkB,UAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,IAAmBC,kBAAnB,EAAuCC,UAAvC,EAAmDC,UAAnD,EAA+DC,UAA/D,QAAgF,cAAhF;;AAEA,MAAMC,SAAS,GAAG,CAAC;AAACC,EAAAA;AAAD,CAAD,KAAa;AAC7B,QAAM;AAACC,IAAAA,OAAD;AAAUC,IAAAA;AAAV,MAAiCF,KAAvC;AAAA,QAAyBG,UAA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A,KAAd,CAAP;;AACF,SAAK,QAAL;AACE,0BAAO,oBAAC,aAAD,EAAmBA,KAAnB,CAAP;;AACF,SAAK,UAAL;AACE,0BAAO,oBAAC,QAAD,EAAcA,KAAd,CAAP;AAdJ;AAgBD,CAnBD;;AAqBAD,MAAM,CAACd,SAAP,2CAAmB;AACjBe,EAAAA,KAAK,EAAEf,SAAS,CAACe,KADA;AAEjBC,EAAAA,IAAI,EAAEhB,SAAS,CAACgB;AAFC,CAAnB;;AAKA,MAAMC,MAAM,GAAGC,KAAK,IAAI;AACtB,QAAM;AAACH,IAAAA,KAAD;AAAQT,IAAAA,KAAR;AAAeU,IAAAA;AAAf,MAAuBE,KAA7B;AAEA,sBACE;AAAK,iBAAU,QAAf;AAAwB,IAAA,SAAS,EAAEnB,KAAK,CAACoB;AAAzC,KACGb,KAAK,gBAAG,oBAAC,SAAD;AAAW,IAAA,KAAK,EAAEA;AAAlB,IAAH,GAAiC,IADzC,eAEE,oBAAC,MAAD;AAAQ,IAAA,KAAK,EAAES,KAAf;AAAsB,IAAA,IAAI,EAAEC;AAA5B,IAFF,CADF;AAMD,CATD;;AAWAC,MAAM,CAACjB,SAAP,2CAAmBA,SAAnB;AAEA,eAAeiB,MAAf","sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}) => {\n const {type} = model;\n\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} />;\n case 'qcm':\n return <Qcm {...model} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} />;\n case 'slider':\n return <QuestionRange {...model} />;\n case 'template':\n return <Template {...model} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <Switch model={model} help={help} />\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"file":"index.js"}
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload } from '@coorpacademy/nova-icons';
3
+ import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie } from '@coorpacademy/nova-icons';
4
+ import map from 'lodash/fp/map';
4
5
  import Cta from '../../atom/button-link';
5
6
  import ButtonLinkIconOnly from '../../atom/button-link-icon-only';
7
+ import InputSwitch from '../../atom/input-switch';
6
8
  import style from './style.css';
7
9
 
8
10
  const CMPopin = props => {
@@ -13,78 +15,182 @@ const CMPopin = props => {
13
15
  secondButton,
14
16
  onClose,
15
17
  header,
16
- icon
18
+ icon,
19
+ backgroundImageUrl,
20
+ descriptionText,
21
+ thirdButton,
22
+ cookieTitle,
23
+ descriptionBtnTxt,
24
+ listBtnSwicth
17
25
  } = props;
18
26
  const logo = {
19
27
  AlertDiamond,
20
28
  WindowUpload
21
29
  };
22
30
  const LogoComponent = logo[icon];
31
+ const backgroundImageStyle = backgroundImageUrl ? {
32
+ backgroundImage: `url(${backgroundImageUrl})`,
33
+ backgroundSize: 'cover'
34
+ } : null;
35
+
36
+ const renderHeader = () => {
37
+ if (header) return /*#__PURE__*/React.createElement("img", {
38
+ className: style.headerBackground,
39
+ src: header
40
+ });
41
+ if (mode === 'cookie') return /*#__PURE__*/React.createElement("div", {
42
+ className: style.cookieHeader
43
+ }, /*#__PURE__*/React.createElement("div", {
44
+ className: style.cookieIconContainer
45
+ }, /*#__PURE__*/React.createElement(Cookie, {
46
+ className: style.cookieIcon
47
+ })), /*#__PURE__*/React.createElement("div", {
48
+ className: style.cookieTitle
49
+ }, cookieTitle));
50
+ return null;
51
+ };
52
+
53
+ const getClassBtnSwitch = (index, btnList) => {
54
+ switch (index) {
55
+ case 0:
56
+ return style.firstBtnSwitchContainer;
57
+
58
+ case btnList.length - 1:
59
+ return style.lastBtnSwitchContainer;
60
+
61
+ default:
62
+ return style.singleSwitchContainer;
63
+ }
64
+ };
65
+
66
+ const renderBtnSwitch = () => {
67
+ return map.convert({
68
+ cap: false
69
+ })((el, index) => {
70
+ const {
71
+ type,
72
+ title,
73
+ value,
74
+ onChange,
75
+ titlePosition,
76
+ theme,
77
+ details,
78
+ requiredSelection,
79
+ disabled
80
+ } = el;
81
+ return /*#__PURE__*/React.createElement("div", {
82
+ key: index,
83
+ className: getClassBtnSwitch(index, listBtnSwicth)
84
+ }, /*#__PURE__*/React.createElement(InputSwitch, {
85
+ type,
86
+ title,
87
+ value,
88
+ onChange,
89
+ titlePosition,
90
+ theme,
91
+ details,
92
+ requiredSelection,
93
+ disabled
94
+ }));
95
+ })(listBtnSwicth);
96
+ };
97
+
23
98
  return /*#__PURE__*/React.createElement("div", {
24
- className: style.background
99
+ className: mode !== 'cookie' ? style.background : null,
100
+ style: backgroundImageStyle,
101
+ "data-name": 'cm-popin-container'
25
102
  }, /*#__PURE__*/React.createElement("div", {
26
- className: style.popin
103
+ className: mode === 'cookie' ? style.popinCookie : style.popin
27
104
  }, /*#__PURE__*/React.createElement("header", {
28
105
  className: style.popinHeader
29
- }, header ? /*#__PURE__*/React.createElement("img", {
30
- className: style.headerBackground,
31
- src: header
32
- }) : null, onClose ? /*#__PURE__*/React.createElement(ButtonLinkIconOnly, {
106
+ }, renderHeader(), onClose ? /*#__PURE__*/React.createElement(ButtonLinkIconOnly, {
33
107
  onClick: onClose,
34
108
  "data-name": 'close-icon',
35
109
  "aria-label": 'close-icon',
36
110
  size: "small",
37
111
  icon: "close"
38
112
  }) : null), /*#__PURE__*/React.createElement("div", {
113
+ className: style.titleContainer
114
+ }, /*#__PURE__*/React.createElement("div", {
39
115
  className: style.contentSection
40
116
  }, LogoComponent ? /*#__PURE__*/React.createElement(LogoComponent, {
41
117
  className: style.icon
42
118
  }) : null, content ? /*#__PURE__*/React.createElement("p", {
43
119
  className: mode === 'alert' ? style.content : style.message,
44
- "data-name": `cm-popin-content` // eslint-disable-next-line react/no-danger
120
+ "data-name": 'cm-popin-content' // eslint-disable-next-line react/no-danger
45
121
  ,
46
122
  dangerouslySetInnerHTML: {
47
123
  __html: content
48
124
  }
49
- }) : null), /*#__PURE__*/React.createElement("div", {
125
+ }) : null), descriptionText ? /*#__PURE__*/React.createElement("p", {
126
+ className: style.descriptionText // eslint-disable-next-line react/no-danger
127
+ ,
128
+ dangerouslySetInnerHTML: {
129
+ __html: descriptionText
130
+ }
131
+ }) : null), descriptionBtnTxt ? /*#__PURE__*/React.createElement("div", {
132
+ className: style.descriptionBtn
133
+ }, descriptionBtnTxt) : null, renderBtnSwitch(), /*#__PURE__*/React.createElement("div", {
50
134
  className: style.buttonContainer
51
135
  }, firstButton ? /*#__PURE__*/React.createElement("div", {
52
- className: style.button
136
+ className: firstButton.largeButton ? style.largeButton : style.button
53
137
  }, /*#__PURE__*/React.createElement(Cta, {
54
138
  label: firstButton.label,
55
139
  onClick: firstButton.handleOnclick,
56
- "data-name": `cm-popin-cta`,
140
+ "data-name": 'cm-popin-cta',
57
141
  "aria-label": firstButton['aria-label'],
58
142
  type: firstButton.type
59
143
  })) : null, secondButton ? /*#__PURE__*/React.createElement("div", {
60
- className: style.button
144
+ className: secondButton.largeButton ? style.largeButton : style.button
61
145
  }, /*#__PURE__*/React.createElement(Cta, {
62
146
  label: secondButton.label,
63
147
  onClick: secondButton.handleOnclick,
64
148
  "data-name": `cm-popin-cta-${secondButton.type}`,
65
- "aria-label": firstButton['aria-label'],
149
+ "aria-label": secondButton['aria-label'],
66
150
  type: secondButton.type
151
+ })) : null, thirdButton ? /*#__PURE__*/React.createElement("div", {
152
+ className: thirdButton.largeButton ? style.largeButton : style.button
153
+ }, /*#__PURE__*/React.createElement(Cta, {
154
+ label: thirdButton.label,
155
+ onClick: thirdButton.handleOnclick,
156
+ "data-name": `cm-popin-cta-${thirdButton.type}`,
157
+ "aria-label": thirdButton['aria-label'],
158
+ type: thirdButton.type
67
159
  })) : null)));
68
160
  };
69
161
 
70
162
  CMPopin.propTypes = process.env.NODE_ENV !== "production" ? {
71
163
  content: PropTypes.string,
72
- mode: PropTypes.oneOf(['alert', 'information']),
164
+ mode: PropTypes.oneOf(['alert', 'information', 'cookie']),
73
165
  header: PropTypes.string,
74
166
  firstButton: PropTypes.shape({
75
167
  label: PropTypes.string,
76
168
  handleOnclick: PropTypes.func,
77
169
  'aria-label': PropTypes.string,
78
- type: PropTypes.string
170
+ largeButton: PropTypes.bool,
171
+ type: PropTypes.oneOf(['dangerous', 'primary', 'secondary'])
79
172
  }),
80
173
  secondButton: PropTypes.shape({
81
174
  label: PropTypes.string,
82
175
  handleOnclick: PropTypes.func,
83
- type: PropTypes.oneOf(['dangerous', 'primary']),
84
- 'aria-label': PropTypes.string
176
+ type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),
177
+ 'aria-label': PropTypes.string,
178
+ largeButton: PropTypes.boolean
179
+ }),
180
+ thirdButton: PropTypes.shape({
181
+ label: PropTypes.string,
182
+ handleOnclick: PropTypes.func,
183
+ type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),
184
+ 'aria-label': PropTypes.string,
185
+ largeButton: PropTypes.boolean
85
186
  }),
86
187
  onClose: PropTypes.func,
87
- icon: PropTypes.string
188
+ icon: PropTypes.string,
189
+ backgroundImageUrl: PropTypes.string,
190
+ descriptionText: PropTypes.string,
191
+ cookieTitle: PropTypes.string,
192
+ descriptionBtnTxt: PropTypes.string,
193
+ listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes))
88
194
  } : {};
89
195
  export default CMPopin;
90
196
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/cm-popin/index.js"],"names":["React","PropTypes","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","Cta","ButtonLinkIconOnly","style","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","logo","LogoComponent","background","popin","popinHeader","headerBackground","contentSection","message","__html","buttonContainer","button","label","handleOnclick","type","propTypes","string","oneOf","shape","func"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,QAGO,0BAHP;AAIA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAGC,KAAK,IAAI;AACvB,QAAM;AAACC,IAAAA,OAAD;AAAUC,IAAAA,IAAI,GAAG,OAAjB;AAA0BC,IAAAA,WAA1B;AAAuC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AV,CAAgB,CAAC,WAAD,EAAc,SAAd,CAAhB,CAHsB;AAI5B,kBAAcjC,SAAS,CAACgC;AAJI,GAAhB,CAVI;AAgBlBlB,EAAAA,OAAO,EAAEd,SAAS,CAACmC,IAhBD;AAiBlBnB,EAAAA,IAAI,EAAEhB,SAAS,CAACgC;AAjBE,CAApB;AAoBA,eAAexB,OAAf","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":["React","PropTypes","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","map","Cta","ButtonLinkIconOnly","InputSwitch","style","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","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","string","oneOf","shape","func","bool","boolean","arrayOf"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,QAIO,0BAJP;AAKA,OAAOC,GAAP,MAAgB,eAAhB;AACA,O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E,MA1BE;AA2BlBnD,EAAAA,kBAAkB,EAAErB,SAAS,CAACwE,MA3BZ;AA4BlBlD,EAAAA,eAAe,EAAEtB,SAAS,CAACwE,MA5BT;AA6BlBhD,EAAAA,WAAW,EAAExB,SAAS,CAACwE,MA7BL;AA8BlB/C,EAAAA,iBAAiB,EAAEzB,SAAS,CAACwE,MA9BX;AA+BlB9C,EAAAA,aAAa,EAAE1B,SAAS,CAAC8E,OAAV,CAAkB9E,SAAS,CAAC0E,KAAV,CAAgBhE,WAAW,CAAC6D,SAA5B,CAAlB;AA/BG,CAApB;AAkCA,eAAe3D,OAAf","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
+ }
@@ -15,7 +15,8 @@ const Feedback = (props, context) => {
15
15
  media,
16
16
  mediaDescription,
17
17
  title,
18
- description
18
+ description,
19
+ mode = 'default'
19
20
  } = props;
20
21
 
21
22
  const resource = media && media.type && _extends(_extends({}, media), _pipe(_get('src.0'), _extend({
@@ -23,8 +24,11 @@ const Feedback = (props, context) => {
23
24
  }))(media));
24
25
 
25
26
  return (resource || title || description ? /*#__PURE__*/React.createElement("div", {
27
+ className: mode === 'scorm' ? style.feedbackContainerScorm : null
28
+ }, /*#__PURE__*/React.createElement("div", {
26
29
  className: style.feedback,
27
- "data-name": "feedback"
30
+ "data-name": "feedback",
31
+ id: "feedback"
28
32
  }, /*#__PURE__*/React.createElement("div", {
29
33
  className: classnames(style.title, style.innerHTML),
30
34
  "data-name": "title" // eslint-disable-next-line react/no-danger
@@ -51,7 +55,7 @@ const Feedback = (props, context) => {
51
55
  dangerouslySetInnerHTML: {
52
56
  __html: mediaDescription
53
57
  }
54
- })) : null)) : null) || '';
58
+ })) : null))) : null) || '';
55
59
  };
56
60
 
57
61
  Feedback.propTypes = process.env.NODE_ENV !== "production" ? {