@coorpacademy/components 11.13.6 → 11.13.7-alpha.14

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AAcA,kDAiLC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AAeA,kDAkLC"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie, NovaSolidSpaceMoonRocket as MoonRocket } from '@coorpacademy/nova-icons';
2
+ import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie, NovaSolidSpaceMoonRocket as MoonRocket, NovaLineStatusCheckCircle1 as CheckCircle1 } from '@coorpacademy/nova-icons';
3
3
  import map from 'lodash/fp/map';
4
4
  import Cta from '../../atom/button-link';
5
5
  import ButtonLinkIconOnly from '../../atom/button-link-icon-only';
@@ -26,7 +26,8 @@ const CMPopin = props => {
26
26
  const logo = {
27
27
  AlertDiamond,
28
28
  WindowUpload,
29
- MoonRocket
29
+ MoonRocket,
30
+ CheckCircle1
30
31
  };
31
32
  const LogoComponent = logo[icon];
32
33
  const backgroundImageStyle = backgroundImageUrl ? {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","map","Cta","ButtonLinkIconOnly","InputSwitch","style","propTypes","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","id","dataName","background","popinCookie","popin","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket\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';\nimport propTypes from './types';\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 MoonRocket\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 id,\n 'data-name': dataName\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 id,\n 'data-name': dataName\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\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\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 customStyle={firstButton.customStyle}\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 customStyle={secondButton.customStyle}\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 customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,EAIEC,wBAAwB,IAAIC,UAJ9B,QAKO,0BALP;AAMA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,SAAtB;;AAEA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,kBARI;IASJC,eATI;IAUJC,WAVI;IAWJC,WAXI;IAYJC,iBAZI;IAaJC;EAbI,IAcFb,KAdJ;EAgBA,MAAMc,IAAI,GAAG;IACX5B,YADW;IAEXE,YAFW;IAGXI;EAHW,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KAAK,CAAC4D,WAAhC,GAA8C5D,KAAK,CAAC6D;EAApE,gBACE,oBAAC,GAAD;IACE,KAAK,EAAEhD,WAAW,CAACiD,KADrB;IAEE,OAAO,EAAEjD,WAAW,CAACkD,aAFvB;IAGE,aAAY,gBAAelD,WAAW,CAACyB,IAAK,EAH9C;IAIE,cAAYzB,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAACyB,IALpB;IAME,WAAW,EAAEzB,WAAW,CAACmD;EAN3B,EADF,CADU,GAWR,IApCN,CAzCF,CALF,CADF;AAwFD,CAjLD;;AAmLA9D,OAAO,CAACD,SAAR,2CAAoBA,SAApB;AAEA,eAAeC,OAAf"}
1
+ {"version":3,"file":"index.js","names":["React","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","NovaLineStatusCheckCircle1","CheckCircle1","map","Cta","ButtonLinkIconOnly","InputSwitch","style","propTypes","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","id","dataName","background","popinCookie","popin","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaLineStatusCheckCircle1 as CheckCircle1\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';\nimport propTypes from './types';\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 MoonRocket,\n CheckCircle1\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 id,\n 'data-name': dataName\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 id,\n 'data-name': dataName\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\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\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 customStyle={firstButton.customStyle}\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 customStyle={secondButton.customStyle}\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 customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>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47,7 +47,7 @@
47
47
 
48
48
  .popin {
49
49
  overflow: auto;
50
- width: 500px;
50
+ width: 434px;
51
51
  flex-grow: 0;
52
52
  margin: 16px;
53
53
  padding: 16px 16px 20px 16px;
@@ -114,12 +114,12 @@
114
114
 
115
115
  .button {
116
116
  min-width: max-content;
117
- width: 160px;
117
+ width: 161px;
118
118
  padding: 8px;
119
119
  }
120
120
 
121
121
  .largeButton {
122
- width: 100%;
122
+ width: 75%;
123
123
  padding: 8px;
124
124
  }
125
125
 
@@ -150,6 +150,11 @@
150
150
  margin-top: 0px;
151
151
  }
152
152
 
153
+ .descriptionText, .content, .message {
154
+ margin-left: 32px;
155
+ margin-right: 32px;
156
+ }
157
+
153
158
  .cookieTitleContainer {
154
159
  align-items: center;
155
160
  display: flex;
@@ -278,29 +283,21 @@ a {
278
283
  }
279
284
 
280
285
  @media tablet {
281
- .popin {
282
- position: fixed;
283
- }
284
-
285
286
  .popin {
286
287
  width: 80%;
288
+ overflow: hidden;
287
289
  }
288
290
 
289
291
  .buttonContainer {
290
292
  display: flex;
291
293
  flex-wrap: wrap-reverse;
292
- margin: 48px 24px 32px 24px;
293
- width: 85%;
294
+ margin: 12px 24px 32px 24px;
294
295
  }
295
296
 
296
- .button {
297
+ .largeButton, .button , .titleContainer {
297
298
  width: 100%;
298
299
  }
299
300
 
300
- .titleContainer {
301
- width: 85%;
302
- }
303
-
304
301
  .popinCookie {
305
302
  position: fixed;
306
303
  bottom: 10px;
@@ -316,34 +313,50 @@ a {
316
313
  }
317
314
 
318
315
  .popinCookie .largeButton {
319
- padding: 8px 0px 0px 0px
316
+ padding: 8px 0px 0px 0px;
320
317
  }
321
318
  .popinCookie .message {
322
319
  padding: 24px 24px 0px 24px
323
320
  }
324
321
 
325
- @media mobile {
326
- .popin {
327
- position: fixed;
328
- }
329
-
330
- .popin {
331
- width: 80%;
332
- }
333
-
334
- .buttonContainer {
335
- display: flex;
336
- margin: 48px 24px 32px 24px;
337
- width: 85%;
338
- }
339
-
340
- .button {
341
- width: 100%;
342
- }
343
-
344
- .titleContainer {
345
- width: 85%;
346
- }
322
+ .descriptionText, .content, .message {
323
+ margin-left: 16px;
324
+ margin-right: 16px;
325
+ }
326
+ }
327
+
328
+ @media mobile {
329
+ .background {
330
+ padding: 0;
331
+ }
332
+
333
+ .popin {
334
+ width: 80%;
335
+ overflow: hidden;
336
+ }
337
+
338
+ .buttonContainer {
339
+ display: flex;
340
+ margin: 12px 16px 32px 16px;
341
+ }
342
+
343
+ .button {
344
+ width: 100%;
345
+ }
346
+
347
+ .titleContainer {
348
+ width: 100%;
349
+ margin-left: 16px;
350
+ margin-right: 16px;
351
+ }
352
+
353
+ .content, .message, .descriptionText {
354
+ margin-left: 16px;
355
+ margin-right: 16px;
356
+ }
357
+ .largeButton {
358
+ margin-left: 32px;
359
+ margin-right: 32px;
347
360
  }
348
361
  }
349
362
 
@@ -355,7 +368,6 @@ button {
355
368
  }
356
369
 
357
370
  _:-ms-fullscreen,
358
- .descriptionText,
359
371
  .buttonContainer {
360
372
  width: 85%;
361
373
  }
@@ -1,29 +1,82 @@
1
1
  export default ExternalCourse;
2
- declare class ExternalCourse extends React.Component<any, any, any> {
3
- static propTypes: {
4
- name: PropTypes.Requireable<string>;
5
- type: PropTypes.Requireable<string>;
6
- url: PropTypes.Validator<string>;
7
- quit: PropTypes.Requireable<PropTypes.InferProps<{
2
+ declare function ExternalCourse(props: any, context: any): JSX.Element;
3
+ declare namespace ExternalCourse {
4
+ namespace propTypes {
5
+ const name: PropTypes.Requireable<string>;
6
+ const type: PropTypes.Requireable<string>;
7
+ const url: PropTypes.Validator<string>;
8
+ const quit: PropTypes.Requireable<PropTypes.InferProps<{
8
9
  label: PropTypes.Validator<string>;
9
10
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
10
11
  }>>;
11
- complete: PropTypes.Requireable<PropTypes.InferProps<{
12
+ const complete: PropTypes.Requireable<PropTypes.InferProps<{
12
13
  label: PropTypes.Validator<string>;
13
14
  disabled: PropTypes.Requireable<boolean>;
14
15
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
15
16
  }>>;
16
- warning: PropTypes.Requireable<PropTypes.InferProps<{
17
+ const warning: PropTypes.Requireable<PropTypes.InferProps<{
17
18
  label: PropTypes.Validator<string>;
18
19
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
19
20
  }>>;
20
- loading: PropTypes.Requireable<boolean>;
21
- backgroundImageUrl: PropTypes.Requireable<string>;
22
- contentType: PropTypes.Requireable<string>;
23
- mode: PropTypes.Requireable<string>;
24
- };
25
- static contextTypes: {
26
- skin: PropTypes.Requireable<PropTypes.InferProps<{
21
+ const loading: PropTypes.Requireable<boolean>;
22
+ const backgroundImageUrl: PropTypes.Requireable<string>;
23
+ const contentType: PropTypes.Requireable<string>;
24
+ const mode: PropTypes.Requireable<string>;
25
+ const closePopin: PropTypes.Requireable<PropTypes.InferProps<{
26
+ content: PropTypes.Requireable<string>;
27
+ mode: PropTypes.Requireable<string>;
28
+ header: PropTypes.Requireable<string>;
29
+ firstButton: PropTypes.Requireable<PropTypes.InferProps<{
30
+ label: PropTypes.Requireable<string>;
31
+ handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
32
+ 'aria-label': PropTypes.Requireable<string>;
33
+ largeButton: PropTypes.Requireable<boolean>;
34
+ type: PropTypes.Requireable<string>;
35
+ customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
36
+ }>>;
37
+ secondButton: PropTypes.Requireable<PropTypes.InferProps<{
38
+ label: PropTypes.Requireable<string>;
39
+ handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
40
+ type: PropTypes.Requireable<string>;
41
+ 'aria-label': PropTypes.Requireable<string>;
42
+ largeButton: PropTypes.Requireable<boolean>;
43
+ customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
44
+ }>>;
45
+ thirdButton: PropTypes.Requireable<PropTypes.InferProps<{
46
+ label: PropTypes.Requireable<string>;
47
+ handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
48
+ type: PropTypes.Requireable<string>;
49
+ 'aria-label': PropTypes.Requireable<string>;
50
+ largeButton: PropTypes.Requireable<boolean>;
51
+ customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
52
+ }>>;
53
+ onClose: PropTypes.Requireable<(...args: any[]) => any>;
54
+ icon: PropTypes.Requireable<string>;
55
+ backgroundImageUrl: PropTypes.Requireable<string>;
56
+ descriptionText: PropTypes.Requireable<string>;
57
+ cookieTitle: PropTypes.Requireable<string>;
58
+ descriptionBtnTxt: PropTypes.Requireable<string>;
59
+ listBtnSwicth: PropTypes.Requireable<(PropTypes.InferProps<{
60
+ title: PropTypes.Requireable<string>;
61
+ name: PropTypes.Requireable<string>;
62
+ id: PropTypes.Requireable<string>;
63
+ value: PropTypes.Requireable<boolean>;
64
+ disabled: PropTypes.Requireable<boolean>;
65
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
66
+ description: PropTypes.Requireable<string>;
67
+ 'aria-labelledby': PropTypes.Requireable<string>;
68
+ 'aria-label': PropTypes.Requireable<string>;
69
+ modified: PropTypes.Requireable<boolean>;
70
+ titlePosition: PropTypes.Requireable<string>;
71
+ theme: PropTypes.Requireable<string>;
72
+ details: PropTypes.Requireable<string>;
73
+ 'data-name': PropTypes.Requireable<string>;
74
+ requiredSelection: PropTypes.Requireable<boolean>;
75
+ }> | null | undefined)[]>;
76
+ }>>;
77
+ }
78
+ namespace contextTypes {
79
+ const skin: PropTypes.Requireable<PropTypes.InferProps<{
27
80
  common: PropTypes.Requireable<{
28
81
  [x: string]: any;
29
82
  }>;
@@ -44,12 +97,7 @@ declare class ExternalCourse extends React.Component<any, any, any> {
44
97
  [x: string]: any;
45
98
  }>;
46
99
  }>>;
47
- };
48
- constructor(props: any);
49
- constructor(props: any, context: any);
50
- handleOnClick: (field: any) => (e: any) => any;
51
- render(): JSX.Element;
100
+ }
52
101
  }
53
- import React from "react";
54
102
  import PropTypes from "prop-types";
55
103
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/external-course/index.js"],"names":[],"mappings":";AAmBA;IACE;;;;;;;;;;;;;;;;;;;;;MAqBE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IA4Hqsd,wBAA8C;IAAA,sCAAyJ;IA1H94d,+CAKE;IAEF,sBA+GC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/external-course/index.js"],"names":[],"mappings":";AAoBA,uEAuIC"}
@@ -3,8 +3,11 @@ import _isNil from "lodash/fp/isNil";
3
3
  import _identity from "lodash/fp/identity";
4
4
  import _keys from "lodash/fp/keys";
5
5
  import _getOr from "lodash/fp/getOr";
6
- import _get from "lodash/fp/get";
7
- import React from 'react';
6
+ import _noop from "lodash/fp/noop";
7
+
8
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
9
+
10
+ import React, { useCallback, useMemo } from 'react';
8
11
  import { NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon } from '@coorpacademy/nova-icons';
9
12
  import { convert } from 'css-color-function';
10
13
  import classnames from 'classnames';
@@ -14,6 +17,7 @@ import Provider from '../../atom/provider';
14
17
  import Loader from '../../atom/loader';
15
18
  import Button from '../../atom/button';
16
19
  import ExternalContentViewer from '../../molecule/external-content-viewer';
20
+ import CmPopin from '../../molecule/cm-popin';
17
21
  import style from './style.css';
18
22
  const defaultWrapperStyle = {
19
23
  default: style.default,
@@ -21,42 +25,40 @@ const defaultWrapperStyle = {
21
25
  mobile: style.default
22
26
  };
23
27
 
24
- class ExternalCourse extends React.Component {
25
- constructor(...args) {
26
- super(...args);
28
+ const ExternalCourse = (props, context) => {
29
+ const {
30
+ name,
31
+ type,
32
+ url,
33
+ quit,
34
+ complete,
35
+ warning,
36
+ loading,
37
+ backgroundImageUrl,
38
+ contentType,
39
+ mode = 'default',
40
+ closePopin
41
+ } = props;
42
+ const {
43
+ skin
44
+ } = context;
45
+
46
+ const primary = _getOr('#00B0FF', 'common.primary', skin);
27
47
 
28
- this.handleOnClick = field => e => {
48
+ const IconType = EXTERNAL_CONTENT_ICONS[type].icon;
49
+ const IconColor = EXTERNAL_CONTENT_ICONS[type].color;
50
+ const handleOnClick = useCallback(field => {
51
+ const {
52
+ onClick = _noop
53
+ } = field;
54
+ return e => {
29
55
  e.stopPropagation();
30
56
  e.preventDefault();
31
-
32
- const onClick = _get('onClick', field);
33
-
34
- return onClick && onClick(e);
57
+ return onClick(e);
35
58
  };
36
- }
37
-
38
- render() {
39
- const {
40
- name,
41
- type,
42
- url,
43
- warning,
44
- complete,
45
- quit,
46
- loading,
47
- backgroundImageUrl,
48
- contentType,
49
- mode = 'default'
50
- } = this.props;
51
- const {
52
- skin
53
- } = this.context;
54
-
55
- const primary = _getOr('#00B0FF', 'common.primary', skin);
56
-
57
- const IconType = EXTERNAL_CONTENT_ICONS[type].icon;
58
- const IconColor = EXTERNAL_CONTENT_ICONS[type].color;
59
- const mainContentSlot = loading ? /*#__PURE__*/React.createElement("div", {
59
+ }, []);
60
+ const mainContentSlot = useMemo(() => {
61
+ return loading ? /*#__PURE__*/React.createElement("div", {
60
62
  className: style.loader
61
63
  }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(ExternalContentViewer, {
62
64
  url: url,
@@ -64,10 +66,12 @@ class ExternalCourse extends React.Component {
64
66
  backgroundImageUrl: backgroundImageUrl,
65
67
  contentType: contentType
66
68
  });
67
- const completeButton = !_isNil(complete) ? /*#__PURE__*/React.createElement(Button, {
69
+ }, [loading, url, mode, contentType, backgroundImageUrl]);
70
+ const completeButton = useMemo(() => {
71
+ return !_isNil(complete) ? /*#__PURE__*/React.createElement(Button, {
68
72
  type: "button",
69
73
  disabled: loading ? true : complete.disabled,
70
- onClick: loading ? _identity : this.handleOnClick(complete),
74
+ onClick: loading ? _identity : handleOnClick(complete),
71
75
  submitValue: complete.label,
72
76
  style: {
73
77
  backgroundColor: complete.disabled || loading ? convert(`color(${primary} a(-50%))`) : primary,
@@ -75,23 +79,29 @@ class ExternalCourse extends React.Component {
75
79
  },
76
80
  className: classnames(style.completeCta, complete.disabled || loading ? style.disabled : null, loading ? style.loading : null)
77
81
  }) : null;
78
- const warningButton = !_isNil(warning) ? /*#__PURE__*/React.createElement("div", {
82
+ }, [complete, loading, primary, handleOnClick]);
83
+ const warningButton = useMemo(() => {
84
+ return !_isNil(warning) ? /*#__PURE__*/React.createElement("div", {
79
85
  className: style.leftSection
80
86
  }, /*#__PURE__*/React.createElement("div", {
81
- onClick: this.handleOnClick(warning),
87
+ onClick: handleOnClick(warning),
82
88
  className: classnames(style.iconLabel, style.link)
83
89
  }, /*#__PURE__*/React.createElement(QuestionIcon, {
84
90
  className: style.iconQuestion,
85
91
  width: 24,
86
92
  height: 24
87
93
  }), /*#__PURE__*/React.createElement("span", null, warning.label))) : null;
88
- const quitButton = !_isNil(quit) ? /*#__PURE__*/React.createElement("div", {
94
+ }, [warning, handleOnClick]);
95
+ const quitButton = useMemo(() => {
96
+ return !_isNil(quit) ? /*#__PURE__*/React.createElement("div", {
89
97
  className: style.leftSection
90
98
  }, /*#__PURE__*/React.createElement("span", {
91
99
  className: classnames(style.quitCta, loading ? style.loading : null),
92
- onClick: loading ? _identity : this.handleOnClick(quit)
100
+ onClick: loading ? _identity : handleOnClick(quit)
93
101
  }, quit.label)) : null;
94
- const titleSection = !_isNil(name) ? /*#__PURE__*/React.createElement("div", {
102
+ }, [quit, loading, handleOnClick]);
103
+ const titleSection = useMemo(() => {
104
+ return !_isNil(name) ? /*#__PURE__*/React.createElement("div", {
95
105
  className: classnames(style.iconLabel, style.title)
96
106
  }, /*#__PURE__*/React.createElement("div", {
97
107
  className: style.oval,
@@ -107,26 +117,29 @@ class ExternalCourse extends React.Component {
107
117
  __html: name
108
118
  }
109
119
  })) : null;
110
- const header = !_isNil(quit) || !_isEmpty(name) ? /*#__PURE__*/React.createElement("div", {
120
+ }, [name, IconColor]);
121
+ const header = useMemo(() => {
122
+ !_isNil(quit) || !_isEmpty(name) ? /*#__PURE__*/React.createElement("div", {
111
123
  className: style.header
112
124
  }, quitButton, titleSection, _isNil(quit) ? null : /*#__PURE__*/React.createElement("div", {
113
125
  className: style.rightSection
114
126
  })) : null;
115
- const footer = !_isNil(warning) || !_isNil(complete) ? /*#__PURE__*/React.createElement("div", {
127
+ }, [name, titleSection, quit, quitButton]);
128
+ const footer = useMemo(() => {
129
+ !_isNil(warning) || !_isNil(complete) ? /*#__PURE__*/React.createElement("div", {
116
130
  className: style.footer
117
131
  }, warningButton, completeButton, _isNil(warning) ? null : /*#__PURE__*/React.createElement("div", {
118
132
  className: style.rightSection
119
133
  })) : null;
120
- return /*#__PURE__*/React.createElement("div", {
121
- className: defaultWrapperStyle[mode]
122
- }, header, mainContentSlot, footer);
123
- }
124
-
125
- }
126
-
127
- ExternalCourse.contextTypes = {
128
- skin: Provider.childContextTypes.skin
134
+ }, [warning, warningButton, complete, completeButton]);
135
+ const popin = useMemo(() => {
136
+ return !_isNil(closePopin) ? /*#__PURE__*/React.createElement(CmPopin, closePopin) : null;
137
+ }, [closePopin]);
138
+ return /*#__PURE__*/React.createElement("div", {
139
+ className: defaultWrapperStyle[mode]
140
+ }, header, popin, mainContentSlot, footer);
129
141
  };
142
+
130
143
  ExternalCourse.propTypes = process.env.NODE_ENV !== "production" ? {
131
144
  name: PropTypes.string,
132
145
  type: PropTypes.oneOf(_keys(EXTERNAL_CONTENT_ICONS)),
@@ -147,7 +160,11 @@ ExternalCourse.propTypes = process.env.NODE_ENV !== "production" ? {
147
160
  loading: PropTypes.bool,
148
161
  backgroundImageUrl: PropTypes.string,
149
162
  contentType: PropTypes.string,
150
- mode: PropTypes.string
163
+ mode: PropTypes.string,
164
+ closePopin: PropTypes.shape(_extends({}, CmPopin.propTypes))
151
165
  } : {};
166
+ ExternalCourse.contextTypes = {
167
+ skin: Provider.childContextTypes.skin
168
+ };
152
169
  export default ExternalCourse;
153
170
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","NovaSolidInterfaceFeedbackInterfaceQuestionMark","QuestionIcon","convert","classnames","PropTypes","EXTERNAL_CONTENT_ICONS","Provider","Loader","Button","ExternalContentViewer","style","defaultWrapperStyle","default","cockpit","defaultCockpit","mobile","ExternalCourse","Component","handleOnClick","field","e","stopPropagation","preventDefault","onClick","render","name","type","url","warning","complete","quit","loading","backgroundImageUrl","contentType","mode","props","skin","context","primary","IconType","icon","IconColor","color","mainContentSlot","loader","completeButton","disabled","label","backgroundColor","cursor","completeCta","warningButton","leftSection","iconLabel","link","iconQuestion","quitButton","quitCta","titleSection","title","oval","iconHeader","innerHTML","__html","header","rightSection","footer","contextTypes","childContextTypes","propTypes","string","oneOf","isRequired","shape","func","bool"],"sources":["../../../src/template/external-course/index.js"],"sourcesContent":["import React from 'react';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {get, getOr, keys, identity, isNil, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport Loader from '../../atom/loader';\nimport Button from '../../atom/button';\nimport ExternalContentViewer from '../../molecule/external-content-viewer';\nimport style from './style.css';\n\nconst defaultWrapperStyle = {\n default: style.default,\n cockpit: style.defaultCockpit,\n mobile: style.default\n};\n\nclass ExternalCourse extends React.Component {\n static propTypes = {\n name: PropTypes.string,\n type: PropTypes.oneOf(keys(EXTERNAL_CONTENT_ICONS)),\n url: PropTypes.string.isRequired,\n quit: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n complete: PropTypes.shape({\n label: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n onClick: PropTypes.func\n }),\n warning: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n loading: PropTypes.bool,\n backgroundImageUrl: PropTypes.string,\n contentType: PropTypes.string,\n mode: PropTypes.string\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n handleOnClick = field => e => {\n e.stopPropagation();\n e.preventDefault();\n const onClick = get('onClick', field);\n return onClick && onClick(e);\n };\n\n render() {\n const {\n name,\n type,\n url,\n warning,\n complete,\n quit,\n loading,\n backgroundImageUrl,\n contentType,\n mode = 'default'\n } = this.props;\n const {skin} = this.context;\n const primary = getOr('#00B0FF', 'common.primary', skin);\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const IconColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n const mainContentSlot = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : (\n <ExternalContentViewer\n url={url}\n mode={mode}\n backgroundImageUrl={backgroundImageUrl}\n contentType={contentType}\n />\n );\n\n const completeButton = !isNil(complete) ? (\n <Button\n type=\"button\"\n disabled={loading ? true : complete.disabled}\n onClick={loading ? identity : this.handleOnClick(complete)}\n submitValue={complete.label}\n style={{\n backgroundColor:\n complete.disabled || loading ? convert(`color(${primary} a(-50%))`) : primary,\n cursor: loading ? 'progress' : 'pointer'\n }}\n className={classnames(\n style.completeCta,\n complete.disabled || loading ? style.disabled : null,\n loading ? style.loading : null\n )}\n />\n ) : null;\n\n const warningButton = !isNil(warning) ? (\n <div className={style.leftSection}>\n <div\n onClick={this.handleOnClick(warning)}\n className={classnames(style.iconLabel, style.link)}\n >\n <QuestionIcon className={style.iconQuestion} width={24} height={24} />\n <span>{warning.label}</span>\n </div>\n </div>\n ) : null;\n\n const quitButton = !isNil(quit) ? (\n <div className={style.leftSection}>\n <span\n className={classnames(style.quitCta, loading ? style.loading : null)}\n onClick={loading ? identity : this.handleOnClick(quit)}\n >\n {quit.label}\n </span>\n </div>\n ) : null;\n\n const titleSection = !isNil(name) ? (\n <div className={classnames(style.iconLabel, style.title)}>\n <div className={style.oval} style={{backgroundColor: IconColor}}>\n <IconType className={style.iconHeader} />\n </div>\n <span\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: name}}\n />\n </div>\n ) : null;\n\n const header =\n !isNil(quit) || !isEmpty(name) ? (\n <div className={style.header}>\n {quitButton}\n {titleSection}\n {isNil(quit) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n const footer =\n !isNil(warning) || !isNil(complete) ? (\n <div className={style.footer}>\n {warningButton}\n {completeButton}\n {isNil(warning) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n return (\n <div className={defaultWrapperStyle[mode]}>\n {header}\n {mainContentSlot}\n {footer}\n </div>\n );\n }\n}\n\nexport default ExternalCourse;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAQC,+CAA+C,IAAIC,YAA3D,QAA8E,0BAA9E;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,sBAAR,QAAqC,6BAArC;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,qBAAP,MAAkC,wCAAlC;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,mBAAmB,GAAG;EAC1BC,OAAO,EAAEF,KAAK,CAACE,OADW;EAE1BC,OAAO,EAAEH,KAAK,CAACI,cAFW;EAG1BC,MAAM,EAAEL,KAAK,CAACE;AAHY,CAA5B;;AAMA,MAAMI,cAAN,SAA6BjB,KAAK,CAACkB,SAAnC,CAA6C;EAAA;IAAA;;IAAA,KA4B3CC,aA5B2C,GA4B3BC,KAAK,IAAIC,CAAC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AFW;EAGjBsB,GAAG,EAAEvB,SAAS,CAACkE,MAAV,CAAiBE,UAHL;EAIjB1C,IAAI,EAAE1B,SAAS,CAACqE,KAAV,CAAgB;IACpB1B,KAAK,EAAE3C,SAAS,CAACkE,MAAV,CAAiBE,UADJ;IAEpBjD,OAAO,EAAEnB,SAAS,CAACsE;EAFC,CAAhB,CAJW;EAQjB7C,QAAQ,EAAEzB,SAAS,CAACqE,KAAV,CAAgB;IACxB1B,KAAK,EAAE3C,SAAS,CAACkE,MAAV,CAAiBE,UADA;IAExB1B,QAAQ,EAAE1C,SAAS,CAACuE,IAFI;IAGxBpD,OAAO,EAAEnB,SAAS,CAACsE;EAHK,CAAhB,CARO;EAajB9C,OAAO,EAAExB,SAAS,CAACqE,KAAV,CAAgB;IACvB1B,KAAK,EAAE3C,SAAS,CAACkE,MAAV,CAAiBE,UADD;IAEvBjD,OAAO,EAAEnB,SAAS,CAACsE;EAFI,CAAhB,CAbQ;EAiBjB3C,OAAO,EAAE3B,SAAS,CAACuE,IAjBF;EAkBjB3C,kBAAkB,EAAE5B,SAAS,CAACkE,MAlBb;EAmBjBrC,WAAW,EAAE7B,SAAS,CAACkE,MAnBN;EAoBjBpC,IAAI,EAAE9B,SAAS,CAACkE;AApBC,C;AAoJrB,eAAetD,cAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useMemo","NovaSolidInterfaceFeedbackInterfaceQuestionMark","QuestionIcon","convert","classnames","PropTypes","EXTERNAL_CONTENT_ICONS","Provider","Loader","Button","ExternalContentViewer","CmPopin","style","defaultWrapperStyle","default","cockpit","defaultCockpit","mobile","ExternalCourse","props","context","name","type","url","quit","complete","warning","loading","backgroundImageUrl","contentType","mode","closePopin","skin","primary","IconType","icon","IconColor","color","handleOnClick","field","onClick","e","stopPropagation","preventDefault","mainContentSlot","loader","completeButton","disabled","label","backgroundColor","cursor","completeCta","warningButton","leftSection","iconLabel","link","iconQuestion","quitButton","quitCta","titleSection","title","oval","iconHeader","innerHTML","__html","header","rightSection","footer","popin","propTypes","string","oneOf","isRequired","shape","func","bool","contextTypes","childContextTypes"],"sources":["../../../src/template/external-course/index.js"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {noop, getOr, keys, identity, isNil, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport Loader from '../../atom/loader';\nimport Button from '../../atom/button';\nimport ExternalContentViewer from '../../molecule/external-content-viewer';\nimport CmPopin from '../../molecule/cm-popin';\nimport style from './style.css';\n\nconst defaultWrapperStyle = {\n default: style.default,\n cockpit: style.defaultCockpit,\n mobile: style.default\n};\n\nconst ExternalCourse = (props, context) => {\n const {\n name,\n type,\n url,\n quit,\n complete,\n warning,\n loading,\n backgroundImageUrl,\n contentType,\n mode = 'default',\n closePopin\n } = props;\n const {skin} = context;\n const primary = getOr('#00B0FF', 'common.primary', skin);\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const IconColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n const handleOnClick = useCallback(field => {\n const {onClick = noop} = field;\n return e => {\n e.stopPropagation();\n e.preventDefault();\n return onClick(e);\n };\n }, []);\n\n const mainContentSlot = useMemo(() => {\n return loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : (\n <ExternalContentViewer\n url={url}\n mode={mode}\n backgroundImageUrl={backgroundImageUrl}\n contentType={contentType}\n />\n );\n }, [loading, url, mode, contentType, backgroundImageUrl]);\n\n const completeButton = useMemo(() => {\n return !isNil(complete) ? (\n <Button\n type=\"button\"\n disabled={loading ? true : complete.disabled}\n onClick={loading ? identity : handleOnClick(complete)}\n submitValue={complete.label}\n style={{\n backgroundColor:\n complete.disabled || loading ? convert(`color(${primary} a(-50%))`) : primary,\n cursor: loading ? 'progress' : 'pointer'\n }}\n className={classnames(\n style.completeCta,\n complete.disabled || loading ? style.disabled : null,\n loading ? style.loading : null\n )}\n />\n ) : null;\n }, [complete, loading, primary, handleOnClick]);\n\n const warningButton = useMemo(() => {\n return !isNil(warning) ? (\n <div className={style.leftSection}>\n <div onClick={handleOnClick(warning)} className={classnames(style.iconLabel, style.link)}>\n <QuestionIcon className={style.iconQuestion} width={24} height={24} />\n <span>{warning.label}</span>\n </div>\n </div>\n ) : null;\n }, [warning, handleOnClick]);\n\n const quitButton = useMemo(() => {\n return !isNil(quit) ? (\n <div className={style.leftSection}>\n <span\n className={classnames(style.quitCta, loading ? style.loading : null)}\n onClick={loading ? identity : handleOnClick(quit)}\n >\n {quit.label}\n </span>\n </div>\n ) : null;\n }, [quit, loading, handleOnClick]);\n\n const titleSection = useMemo(() => {\n return !isNil(name) ? (\n <div className={classnames(style.iconLabel, style.title)}>\n <div className={style.oval} style={{backgroundColor: IconColor}}>\n <IconType className={style.iconHeader} />\n </div>\n <span\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: name}}\n />\n </div>\n ) : null;\n }, [name, IconColor]);\n\n const header = useMemo(() => {\n !isNil(quit) || !isEmpty(name) ? (\n <div className={style.header}>\n {quitButton}\n {titleSection}\n {isNil(quit) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n }, [name, titleSection, quit, quitButton]);\n\n const footer = useMemo(() => {\n !isNil(warning) || !isNil(complete) ? (\n <div className={style.footer}>\n {warningButton}\n {completeButton}\n {isNil(warning) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n }, [warning, warningButton, complete, completeButton]);\n\n const popin = useMemo(() => {\n return !isNil(closePopin) ? <CmPopin {...closePopin} /> : null;\n }, [closePopin]);\n\n return (\n <div className={defaultWrapperStyle[mode]}>\n {header}\n {popin}\n {mainContentSlot}\n {footer}\n </div>\n );\n};\n\nExternalCourse.propTypes = {\n name: PropTypes.string,\n type: PropTypes.oneOf(keys(EXTERNAL_CONTENT_ICONS)),\n url: PropTypes.string.isRequired,\n quit: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n complete: PropTypes.shape({\n label: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n onClick: PropTypes.func\n }),\n warning: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n loading: PropTypes.bool,\n backgroundImageUrl: PropTypes.string,\n contentType: PropTypes.string,\n mode: PropTypes.string,\n closePopin: PropTypes.shape({...CmPopin.propTypes})\n};\n\nExternalCourse.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default ExternalCourse;\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,QAA0C,OAA1C;AACA,SAAQC,+CAA+C,IAAIC,YAA3D,QAA8E,0BAA9E;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,sBAAR,QAAqC,6BAArC;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,qBAAP,MAAkC,wCAAlC;AACA,OAAOC,OAAP,MAAoB,yBAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,mBAAmB,GAAG;EAC1BC,OAAO,EAAEF,KAAK,CAACE,OADW;EAE1BC,OAAO,EAAEH,KAAK,CAACI,cAFW;EAG1BC,MAAM,EAAEL,KAAK,CAACE;AAHY,CAA5B;;AAMA,MAAMI,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IACJC,IADI;IAEJC,IAFI;IAGJC,GAHI;IAIJC,IAJI;IAKJC,QALI;IAMJC,OANI;IAOJC,OAPI;IAQJC,kBARI;IASJC,WATI;I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azBhD,OAAO,EAAErB,SAAS,CAACoE,KAAV,CAAgB;IACvBzB,KAAK,EAAE3C,SAAS,CAACiE,MAAV,CAAiBE,UADD;IAEvBhC,OAAO,EAAEnC,SAAS,CAACqE;EAFI,CAAhB,CAbgB;EAiBzB/C,OAAO,EAAEtB,SAAS,CAACsE,IAjBM;EAkBzB/C,kBAAkB,EAAEvB,SAAS,CAACiE,MAlBL;EAmBzBzC,WAAW,EAAExB,SAAS,CAACiE,MAnBE;EAoBzBxC,IAAI,EAAEzB,SAAS,CAACiE,MApBS;EAqBzBvC,UAAU,EAAE1B,SAAS,CAACoE,KAAV,cAAoB9D,OAAO,CAAC0D,SAA5B;AArBa,CAA3B;AAwBAnD,cAAc,CAAC0D,YAAf,GAA8B;EAC5B5C,IAAI,EAAEzB,QAAQ,CAACsE,iBAAT,CAA2B7C;AADL,CAA9B;AAIA,eAAed,cAAf"}
@@ -24,7 +24,7 @@
24
24
  }
25
25
 
26
26
  .defaultCockpit{
27
- composes:default;
27
+ composes: default;
28
28
  height: 100%;
29
29
  }
30
30
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AAcA,kDAiLC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AAeA,kDAkLC"}
@@ -40,7 +40,8 @@ const CMPopin = props => {
40
40
  const logo = {
41
41
  AlertDiamond: _novaIcons.NovaSolidInterfaceFeedbackInterfaceAlertDiamond,
42
42
  WindowUpload: _novaIcons.NovaSolidApplicationsWindowUpload3,
43
- MoonRocket: _novaIcons.NovaSolidSpaceMoonRocket
43
+ MoonRocket: _novaIcons.NovaSolidSpaceMoonRocket,
44
+ CheckCircle1: _novaIcons.NovaLineStatusCheckCircle1
44
45
  };
45
46
  const LogoComponent = logo[icon];
46
47
  const backgroundImageStyle = backgroundImageUrl ? {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","AlertDiamond","WindowUpload","MoonRocket","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","id","dataName","background","popinCookie","popin","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle","propTypes"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket\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';\nimport propTypes from './types';\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 MoonRocket\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 id,\n 'data-name': dataName\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 id,\n 'data-name': dataName\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\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\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 customStyle={firstButton.customStyle}\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 customStyle={secondButton.customStyle}\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 customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":";;;;;AAAA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,kBARI;IASJC,eATI;IAUJC,WAVI;IAWJC,WAXI;IAYJC,iBAZI;IAaJC;EAbI,IAcFb,KAdJ;EAgBA,MAAMc,IAAI,GAAG;IACXC,YAAY,EAAZA,0DADW;IAEXC,YAAY,EAAZA,6CAFW;IAGXC,UAAU,EAAVA;EAHW,CAAb;EAKA,MAAMC,aAAa,GAAGJ,IAAI,CAACP,IAAD,CAA1B;EAEA,MAAMY,oBAAoB,GAAGX,kBAAkB,GAC3C;IACEY,eAAe,EAAG,OAAMZ,kBAAmB,GAD7C;IAEEa,cAAc,EAAE;EAF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W,CAACuD,aAFvB;IAGE,aAAY,gBAAevD,WAAW,CAAC8B,IAAK,EAH9C;IAIE,cAAY9B,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAAC8B,IALpB;IAME,WAAW,EAAE9B,WAAW,CAACwD;EAN3B,EADF,CADU,GAWR,IApCN,CAzCF,CALF,CADF;AAwFD,CAjLD;;AAmLAnE,OAAO,CAACoE,SAAR,2CAAoBA,cAApB;eAEepE,O"}
1
+ {"version":3,"file":"index.js","names":["CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","AlertDiamond","WindowUpload","MoonRocket","CheckCircle1","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","id","dataName","background","popinCookie","popin","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle","propTypes"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaLineStatusCheckCircle1 as CheckCircle1\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';\nimport propTypes from './types';\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 MoonRocket,\n CheckCircle1\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 id,\n 'data-name': dataName\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 id,\n 'data-name': dataName\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\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\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 customStyle={firstButton.customStyle}\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 customStyle={secondButton.customStyle}\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 customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":";;;;;AAAA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,kBAR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gBAAe9D,YAAY,CAACqC,IAAK,EAH/C;IAIE,cAAYrC,YAAY,CAAC,YAAD,CAJ1B;IAKE,IAAI,EAAEA,YAAY,CAACqC,IALrB;IAME,WAAW,EAAErC,YAAY,CAAC+D;EAN5B,EADF,CADW,GAWT,IAxBN,EAyBGzD,WAAW,gBACV;IAAK,SAAS,EAAEA,WAAW,CAACqD,WAAZ,GAA0BvC,cAAA,CAAMuC,WAAhC,GAA8CvC,cAAA,CAAMwC;EAApE,gBACE,6BAAC,mBAAD;IACE,KAAK,EAAEtD,WAAW,CAACuD,KADrB;IAEE,OAAO,EAAEvD,WAAW,CAACwD,aAFvB;IAGE,aAAY,gBAAexD,WAAW,CAAC+B,IAAK,EAH9C;IAIE,cAAY/B,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAAC+B,IALpB;IAME,WAAW,EAAE/B,WAAW,CAACyD;EAN3B,EADF,CADU,GAWR,IApCN,CAzCF,CALF,CADF;AAwFD,CAlLD;;AAoLApE,OAAO,CAACqE,SAAR,2CAAoBA,cAApB;eAEerE,O"}
@@ -47,7 +47,7 @@
47
47
 
48
48
  .popin {
49
49
  overflow: auto;
50
- width: 500px;
50
+ width: 434px;
51
51
  flex-grow: 0;
52
52
  margin: 16px;
53
53
  padding: 16px 16px 20px 16px;
@@ -114,12 +114,12 @@
114
114
 
115
115
  .button {
116
116
  min-width: max-content;
117
- width: 160px;
117
+ width: 161px;
118
118
  padding: 8px;
119
119
  }
120
120
 
121
121
  .largeButton {
122
- width: 100%;
122
+ width: 75%;
123
123
  padding: 8px;
124
124
  }
125
125
 
@@ -150,6 +150,11 @@
150
150
  margin-top: 0px;
151
151
  }
152
152
 
153
+ .descriptionText, .content, .message {
154
+ margin-left: 32px;
155
+ margin-right: 32px;
156
+ }
157
+
153
158
  .cookieTitleContainer {
154
159
  align-items: center;
155
160
  display: flex;
@@ -278,29 +283,21 @@ a {
278
283
  }
279
284
 
280
285
  @media tablet {
281
- .popin {
282
- position: fixed;
283
- }
284
-
285
286
  .popin {
286
287
  width: 80%;
288
+ overflow: hidden;
287
289
  }
288
290
 
289
291
  .buttonContainer {
290
292
  display: flex;
291
293
  flex-wrap: wrap-reverse;
292
- margin: 48px 24px 32px 24px;
293
- width: 85%;
294
+ margin: 12px 24px 32px 24px;
294
295
  }
295
296
 
296
- .button {
297
+ .largeButton, .button , .titleContainer {
297
298
  width: 100%;
298
299
  }
299
300
 
300
- .titleContainer {
301
- width: 85%;
302
- }
303
-
304
301
  .popinCookie {
305
302
  position: fixed;
306
303
  bottom: 10px;
@@ -316,34 +313,50 @@ a {
316
313
  }
317
314
 
318
315
  .popinCookie .largeButton {
319
- padding: 8px 0px 0px 0px
316
+ padding: 8px 0px 0px 0px;
320
317
  }
321
318
  .popinCookie .message {
322
319
  padding: 24px 24px 0px 24px
323
320
  }
324
321
 
325
- @media mobile {
326
- .popin {
327
- position: fixed;
328
- }
329
-
330
- .popin {
331
- width: 80%;
332
- }
333
-
334
- .buttonContainer {
335
- display: flex;
336
- margin: 48px 24px 32px 24px;
337
- width: 85%;
338
- }
339
-
340
- .button {
341
- width: 100%;
342
- }
343
-
344
- .titleContainer {
345
- width: 85%;
346
- }
322
+ .descriptionText, .content, .message {
323
+ margin-left: 16px;
324
+ margin-right: 16px;
325
+ }
326
+ }
327
+
328
+ @media mobile {
329
+ .background {
330
+ padding: 0;
331
+ }
332
+
333
+ .popin {
334
+ width: 80%;
335
+ overflow: hidden;
336
+ }
337
+
338
+ .buttonContainer {
339
+ display: flex;
340
+ margin: 12px 16px 32px 16px;
341
+ }
342
+
343
+ .button {
344
+ width: 100%;
345
+ }
346
+
347
+ .titleContainer {
348
+ width: 100%;
349
+ margin-left: 16px;
350
+ margin-right: 16px;
351
+ }
352
+
353
+ .content, .message, .descriptionText {
354
+ margin-left: 16px;
355
+ margin-right: 16px;
356
+ }
357
+ .largeButton {
358
+ margin-left: 32px;
359
+ margin-right: 32px;
347
360
  }
348
361
  }
349
362
 
@@ -355,7 +368,6 @@ button {
355
368
  }
356
369
 
357
370
  _:-ms-fullscreen,
358
- .descriptionText,
359
371
  .buttonContainer {
360
372
  width: 85%;
361
373
  }
@@ -1,29 +1,82 @@
1
1
  export default ExternalCourse;
2
- declare class ExternalCourse extends React.Component<any, any, any> {
3
- static propTypes: {
4
- name: PropTypes.Requireable<string>;
5
- type: PropTypes.Requireable<string>;
6
- url: PropTypes.Validator<string>;
7
- quit: PropTypes.Requireable<PropTypes.InferProps<{
2
+ declare function ExternalCourse(props: any, context: any): JSX.Element;
3
+ declare namespace ExternalCourse {
4
+ namespace propTypes {
5
+ const name: PropTypes.Requireable<string>;
6
+ const type: PropTypes.Requireable<string>;
7
+ const url: PropTypes.Validator<string>;
8
+ const quit: PropTypes.Requireable<PropTypes.InferProps<{
8
9
  label: PropTypes.Validator<string>;
9
10
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
10
11
  }>>;
11
- complete: PropTypes.Requireable<PropTypes.InferProps<{
12
+ const complete: PropTypes.Requireable<PropTypes.InferProps<{
12
13
  label: PropTypes.Validator<string>;
13
14
  disabled: PropTypes.Requireable<boolean>;
14
15
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
15
16
  }>>;
16
- warning: PropTypes.Requireable<PropTypes.InferProps<{
17
+ const warning: PropTypes.Requireable<PropTypes.InferProps<{
17
18
  label: PropTypes.Validator<string>;
18
19
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
19
20
  }>>;
20
- loading: PropTypes.Requireable<boolean>;
21
- backgroundImageUrl: PropTypes.Requireable<string>;
22
- contentType: PropTypes.Requireable<string>;
23
- mode: PropTypes.Requireable<string>;
24
- };
25
- static contextTypes: {
26
- skin: PropTypes.Requireable<PropTypes.InferProps<{
21
+ const loading: PropTypes.Requireable<boolean>;
22
+ const backgroundImageUrl: PropTypes.Requireable<string>;
23
+ const contentType: PropTypes.Requireable<string>;
24
+ const mode: PropTypes.Requireable<string>;
25
+ const closePopin: PropTypes.Requireable<PropTypes.InferProps<{
26
+ content: PropTypes.Requireable<string>;
27
+ mode: PropTypes.Requireable<string>;
28
+ header: PropTypes.Requireable<string>;
29
+ firstButton: PropTypes.Requireable<PropTypes.InferProps<{
30
+ label: PropTypes.Requireable<string>;
31
+ handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
32
+ 'aria-label': PropTypes.Requireable<string>;
33
+ largeButton: PropTypes.Requireable<boolean>;
34
+ type: PropTypes.Requireable<string>;
35
+ customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
36
+ }>>;
37
+ secondButton: PropTypes.Requireable<PropTypes.InferProps<{
38
+ label: PropTypes.Requireable<string>;
39
+ handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
40
+ type: PropTypes.Requireable<string>;
41
+ 'aria-label': PropTypes.Requireable<string>;
42
+ largeButton: PropTypes.Requireable<boolean>;
43
+ customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
44
+ }>>;
45
+ thirdButton: PropTypes.Requireable<PropTypes.InferProps<{
46
+ label: PropTypes.Requireable<string>;
47
+ handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
48
+ type: PropTypes.Requireable<string>;
49
+ 'aria-label': PropTypes.Requireable<string>;
50
+ largeButton: PropTypes.Requireable<boolean>;
51
+ customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
52
+ }>>;
53
+ onClose: PropTypes.Requireable<(...args: any[]) => any>;
54
+ icon: PropTypes.Requireable<string>;
55
+ backgroundImageUrl: PropTypes.Requireable<string>;
56
+ descriptionText: PropTypes.Requireable<string>;
57
+ cookieTitle: PropTypes.Requireable<string>;
58
+ descriptionBtnTxt: PropTypes.Requireable<string>;
59
+ listBtnSwicth: PropTypes.Requireable<(PropTypes.InferProps<{
60
+ title: PropTypes.Requireable<string>;
61
+ name: PropTypes.Requireable<string>;
62
+ id: PropTypes.Requireable<string>;
63
+ value: PropTypes.Requireable<boolean>;
64
+ disabled: PropTypes.Requireable<boolean>;
65
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
66
+ description: PropTypes.Requireable<string>;
67
+ 'aria-labelledby': PropTypes.Requireable<string>;
68
+ 'aria-label': PropTypes.Requireable<string>;
69
+ modified: PropTypes.Requireable<boolean>;
70
+ titlePosition: PropTypes.Requireable<string>;
71
+ theme: PropTypes.Requireable<string>;
72
+ details: PropTypes.Requireable<string>;
73
+ 'data-name': PropTypes.Requireable<string>;
74
+ requiredSelection: PropTypes.Requireable<boolean>;
75
+ }> | null | undefined)[]>;
76
+ }>>;
77
+ }
78
+ namespace contextTypes {
79
+ const skin: PropTypes.Requireable<PropTypes.InferProps<{
27
80
  common: PropTypes.Requireable<{
28
81
  [x: string]: any;
29
82
  }>;
@@ -44,12 +97,7 @@ declare class ExternalCourse extends React.Component<any, any, any> {
44
97
  [x: string]: any;
45
98
  }>;
46
99
  }>>;
47
- };
48
- constructor(props: any);
49
- constructor(props: any, context: any);
50
- handleOnClick: (field: any) => (e: any) => any;
51
- render(): JSX.Element;
100
+ }
52
101
  }
53
- import React from "react";
54
102
  import PropTypes from "prop-types";
55
103
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/external-course/index.js"],"names":[],"mappings":";AAmBA;IACE;;;;;;;;;;;;;;;;;;;;;MAqBE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IA4Hqsd,wBAA8C;IAAA,sCAAyJ;IA1H94d,+CAKE;IAEF,sBA+GC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/external-course/index.js"],"names":[],"mappings":";AAoBA,uEAuIC"}
@@ -13,9 +13,9 @@ var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
13
13
 
14
14
  var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
15
15
 
16
- var _get2 = _interopRequireDefault(require("lodash/fp/get"));
16
+ var _noop2 = _interopRequireDefault(require("lodash/fp/noop"));
17
17
 
18
- var _react = _interopRequireDefault(require("react"));
18
+ var _react = _interopRequireWildcard(require("react"));
19
19
 
20
20
  var _novaIcons = require("@coorpacademy/nova-icons");
21
21
 
@@ -35,48 +35,56 @@ var _button = _interopRequireDefault(require("../../atom/button"));
35
35
 
36
36
  var _externalContentViewer = _interopRequireDefault(require("../../molecule/external-content-viewer"));
37
37
 
38
+ var _cmPopin = _interopRequireDefault(require("../../molecule/cm-popin"));
39
+
38
40
  var _style = _interopRequireDefault(require("./style.css"));
39
41
 
42
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
43
+
44
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
45
+
40
46
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
47
 
48
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
49
+
42
50
  const defaultWrapperStyle = {
43
51
  default: _style.default.default,
44
52
  cockpit: _style.default.defaultCockpit,
45
53
  mobile: _style.default.default
46
54
  };
47
55
 
48
- class ExternalCourse extends _react.default.Component {
49
- constructor(...args) {
50
- super(...args);
51
-
52
- this.handleOnClick = field => e => {
56
+ const ExternalCourse = (props, context) => {
57
+ const {
58
+ name,
59
+ type,
60
+ url,
61
+ quit,
62
+ complete,
63
+ warning,
64
+ loading,
65
+ backgroundImageUrl,
66
+ contentType,
67
+ mode = 'default',
68
+ closePopin
69
+ } = props;
70
+ const {
71
+ skin
72
+ } = context;
73
+ const primary = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
74
+ const IconType = _externalContent.EXTERNAL_CONTENT_ICONS[type].icon;
75
+ const IconColor = _externalContent.EXTERNAL_CONTENT_ICONS[type].color;
76
+ const handleOnClick = (0, _react.useCallback)(field => {
77
+ const {
78
+ onClick = _noop2.default
79
+ } = field;
80
+ return e => {
53
81
  e.stopPropagation();
54
82
  e.preventDefault();
55
- const onClick = (0, _get2.default)('onClick', field);
56
- return onClick && onClick(e);
83
+ return onClick(e);
57
84
  };
58
- }
59
-
60
- render() {
61
- const {
62
- name,
63
- type,
64
- url,
65
- warning,
66
- complete,
67
- quit,
68
- loading,
69
- backgroundImageUrl,
70
- contentType,
71
- mode = 'default'
72
- } = this.props;
73
- const {
74
- skin
75
- } = this.context;
76
- const primary = (0, _getOr2.default)('#00B0FF', 'common.primary', skin);
77
- const IconType = _externalContent.EXTERNAL_CONTENT_ICONS[type].icon;
78
- const IconColor = _externalContent.EXTERNAL_CONTENT_ICONS[type].color;
79
- const mainContentSlot = loading ? /*#__PURE__*/_react.default.createElement("div", {
85
+ }, []);
86
+ const mainContentSlot = (0, _react.useMemo)(() => {
87
+ return loading ? /*#__PURE__*/_react.default.createElement("div", {
80
88
  className: _style.default.loader
81
89
  }, /*#__PURE__*/_react.default.createElement(_loader.default, null)) : /*#__PURE__*/_react.default.createElement(_externalContentViewer.default, {
82
90
  url: url,
@@ -84,10 +92,12 @@ class ExternalCourse extends _react.default.Component {
84
92
  backgroundImageUrl: backgroundImageUrl,
85
93
  contentType: contentType
86
94
  });
87
- const completeButton = !(0, _isNil2.default)(complete) ? /*#__PURE__*/_react.default.createElement(_button.default, {
95
+ }, [loading, url, mode, contentType, backgroundImageUrl]);
96
+ const completeButton = (0, _react.useMemo)(() => {
97
+ return !(0, _isNil2.default)(complete) ? /*#__PURE__*/_react.default.createElement(_button.default, {
88
98
  type: "button",
89
99
  disabled: loading ? true : complete.disabled,
90
- onClick: loading ? _identity2.default : this.handleOnClick(complete),
100
+ onClick: loading ? _identity2.default : handleOnClick(complete),
91
101
  submitValue: complete.label,
92
102
  style: {
93
103
  backgroundColor: complete.disabled || loading ? (0, _cssColorFunction.convert)(`color(${primary} a(-50%))`) : primary,
@@ -95,23 +105,29 @@ class ExternalCourse extends _react.default.Component {
95
105
  },
96
106
  className: (0, _classnames.default)(_style.default.completeCta, complete.disabled || loading ? _style.default.disabled : null, loading ? _style.default.loading : null)
97
107
  }) : null;
98
- const warningButton = !(0, _isNil2.default)(warning) ? /*#__PURE__*/_react.default.createElement("div", {
108
+ }, [complete, loading, primary, handleOnClick]);
109
+ const warningButton = (0, _react.useMemo)(() => {
110
+ return !(0, _isNil2.default)(warning) ? /*#__PURE__*/_react.default.createElement("div", {
99
111
  className: _style.default.leftSection
100
112
  }, /*#__PURE__*/_react.default.createElement("div", {
101
- onClick: this.handleOnClick(warning),
113
+ onClick: handleOnClick(warning),
102
114
  className: (0, _classnames.default)(_style.default.iconLabel, _style.default.link)
103
115
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidInterfaceFeedbackInterfaceQuestionMark, {
104
116
  className: _style.default.iconQuestion,
105
117
  width: 24,
106
118
  height: 24
107
119
  }), /*#__PURE__*/_react.default.createElement("span", null, warning.label))) : null;
108
- const quitButton = !(0, _isNil2.default)(quit) ? /*#__PURE__*/_react.default.createElement("div", {
120
+ }, [warning, handleOnClick]);
121
+ const quitButton = (0, _react.useMemo)(() => {
122
+ return !(0, _isNil2.default)(quit) ? /*#__PURE__*/_react.default.createElement("div", {
109
123
  className: _style.default.leftSection
110
124
  }, /*#__PURE__*/_react.default.createElement("span", {
111
125
  className: (0, _classnames.default)(_style.default.quitCta, loading ? _style.default.loading : null),
112
- onClick: loading ? _identity2.default : this.handleOnClick(quit)
126
+ onClick: loading ? _identity2.default : handleOnClick(quit)
113
127
  }, quit.label)) : null;
114
- const titleSection = !(0, _isNil2.default)(name) ? /*#__PURE__*/_react.default.createElement("div", {
128
+ }, [quit, loading, handleOnClick]);
129
+ const titleSection = (0, _react.useMemo)(() => {
130
+ return !(0, _isNil2.default)(name) ? /*#__PURE__*/_react.default.createElement("div", {
115
131
  className: (0, _classnames.default)(_style.default.iconLabel, _style.default.title)
116
132
  }, /*#__PURE__*/_react.default.createElement("div", {
117
133
  className: _style.default.oval,
@@ -127,26 +143,29 @@ class ExternalCourse extends _react.default.Component {
127
143
  __html: name
128
144
  }
129
145
  })) : null;
130
- const header = !(0, _isNil2.default)(quit) || !(0, _isEmpty2.default)(name) ? /*#__PURE__*/_react.default.createElement("div", {
146
+ }, [name, IconColor]);
147
+ const header = (0, _react.useMemo)(() => {
148
+ !(0, _isNil2.default)(quit) || !(0, _isEmpty2.default)(name) ? /*#__PURE__*/_react.default.createElement("div", {
131
149
  className: _style.default.header
132
150
  }, quitButton, titleSection, (0, _isNil2.default)(quit) ? null : /*#__PURE__*/_react.default.createElement("div", {
133
151
  className: _style.default.rightSection
134
152
  })) : null;
135
- const footer = !(0, _isNil2.default)(warning) || !(0, _isNil2.default)(complete) ? /*#__PURE__*/_react.default.createElement("div", {
153
+ }, [name, titleSection, quit, quitButton]);
154
+ const footer = (0, _react.useMemo)(() => {
155
+ !(0, _isNil2.default)(warning) || !(0, _isNil2.default)(complete) ? /*#__PURE__*/_react.default.createElement("div", {
136
156
  className: _style.default.footer
137
157
  }, warningButton, completeButton, (0, _isNil2.default)(warning) ? null : /*#__PURE__*/_react.default.createElement("div", {
138
158
  className: _style.default.rightSection
139
159
  })) : null;
140
- return /*#__PURE__*/_react.default.createElement("div", {
141
- className: defaultWrapperStyle[mode]
142
- }, header, mainContentSlot, footer);
143
- }
144
-
145
- }
146
-
147
- ExternalCourse.contextTypes = {
148
- skin: _provider.default.childContextTypes.skin
160
+ }, [warning, warningButton, complete, completeButton]);
161
+ const popin = (0, _react.useMemo)(() => {
162
+ return !(0, _isNil2.default)(closePopin) ? /*#__PURE__*/_react.default.createElement(_cmPopin.default, closePopin) : null;
163
+ }, [closePopin]);
164
+ return /*#__PURE__*/_react.default.createElement("div", {
165
+ className: defaultWrapperStyle[mode]
166
+ }, header, popin, mainContentSlot, footer);
149
167
  };
168
+
150
169
  ExternalCourse.propTypes = process.env.NODE_ENV !== "production" ? {
151
170
  name: _propTypes.default.string,
152
171
  type: _propTypes.default.oneOf((0, _keys2.default)(_externalContent.EXTERNAL_CONTENT_ICONS)),
@@ -167,8 +186,12 @@ ExternalCourse.propTypes = process.env.NODE_ENV !== "production" ? {
167
186
  loading: _propTypes.default.bool,
168
187
  backgroundImageUrl: _propTypes.default.string,
169
188
  contentType: _propTypes.default.string,
170
- mode: _propTypes.default.string
189
+ mode: _propTypes.default.string,
190
+ closePopin: _propTypes.default.shape(_extends({}, _cmPopin.default.propTypes))
171
191
  } : {};
192
+ ExternalCourse.contextTypes = {
193
+ skin: _provider.default.childContextTypes.skin
194
+ };
172
195
  var _default = ExternalCourse;
173
196
  exports.default = _default;
174
197
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["defaultWrapperStyle","default","style","cockpit","defaultCockpit","mobile","ExternalCourse","React","Component","handleOnClick","field","e","stopPropagation","preventDefault","onClick","render","name","type","url","warning","complete","quit","loading","backgroundImageUrl","contentType","mode","props","skin","context","primary","IconType","EXTERNAL_CONTENT_ICONS","icon","IconColor","color","mainContentSlot","loader","completeButton","disabled","label","backgroundColor","convert","cursor","classnames","completeCta","warningButton","leftSection","iconLabel","link","iconQuestion","quitButton","quitCta","titleSection","title","oval","iconHeader","innerHTML","__html","header","rightSection","footer","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","oneOf","isRequired","shape","func","bool"],"sources":["../../../src/template/external-course/index.js"],"sourcesContent":["import React from 'react';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {get, getOr, keys, identity, isNil, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport Loader from '../../atom/loader';\nimport Button from '../../atom/button';\nimport ExternalContentViewer from '../../molecule/external-content-viewer';\nimport style from './style.css';\n\nconst defaultWrapperStyle = {\n default: style.default,\n cockpit: style.defaultCockpit,\n mobile: style.default\n};\n\nclass ExternalCourse extends React.Component {\n static propTypes = {\n name: PropTypes.string,\n type: PropTypes.oneOf(keys(EXTERNAL_CONTENT_ICONS)),\n url: PropTypes.string.isRequired,\n quit: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n complete: PropTypes.shape({\n label: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n onClick: PropTypes.func\n }),\n warning: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n loading: PropTypes.bool,\n backgroundImageUrl: PropTypes.string,\n contentType: PropTypes.string,\n mode: PropTypes.string\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n handleOnClick = field => e => {\n e.stopPropagation();\n e.preventDefault();\n const onClick = get('onClick', field);\n return onClick && onClick(e);\n };\n\n render() {\n const {\n name,\n type,\n url,\n warning,\n complete,\n quit,\n loading,\n backgroundImageUrl,\n contentType,\n mode = 'default'\n } = this.props;\n const {skin} = this.context;\n const primary = getOr('#00B0FF', 'common.primary', skin);\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const IconColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n const mainContentSlot = loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : (\n <ExternalContentViewer\n url={url}\n mode={mode}\n backgroundImageUrl={backgroundImageUrl}\n contentType={contentType}\n />\n );\n\n const completeButton = !isNil(complete) ? (\n <Button\n type=\"button\"\n disabled={loading ? true : complete.disabled}\n onClick={loading ? identity : this.handleOnClick(complete)}\n submitValue={complete.label}\n style={{\n backgroundColor:\n complete.disabled || loading ? convert(`color(${primary} a(-50%))`) : primary,\n cursor: loading ? 'progress' : 'pointer'\n }}\n className={classnames(\n style.completeCta,\n complete.disabled || loading ? style.disabled : null,\n loading ? style.loading : null\n )}\n />\n ) : null;\n\n const warningButton = !isNil(warning) ? (\n <div className={style.leftSection}>\n <div\n onClick={this.handleOnClick(warning)}\n className={classnames(style.iconLabel, style.link)}\n >\n <QuestionIcon className={style.iconQuestion} width={24} height={24} />\n <span>{warning.label}</span>\n </div>\n </div>\n ) : null;\n\n const quitButton = !isNil(quit) ? (\n <div className={style.leftSection}>\n <span\n className={classnames(style.quitCta, loading ? style.loading : null)}\n onClick={loading ? identity : this.handleOnClick(quit)}\n >\n {quit.label}\n </span>\n </div>\n ) : null;\n\n const titleSection = !isNil(name) ? (\n <div className={classnames(style.iconLabel, style.title)}>\n <div className={style.oval} style={{backgroundColor: IconColor}}>\n <IconType className={style.iconHeader} />\n </div>\n <span\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: name}}\n />\n </div>\n ) : null;\n\n const header =\n !isNil(quit) || !isEmpty(name) ? (\n <div className={style.header}>\n {quitButton}\n {titleSection}\n {isNil(quit) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n const footer =\n !isNil(warning) || !isNil(complete) ? (\n <div className={style.footer}>\n {warningButton}\n {completeButton}\n {isNil(warning) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n\n return (\n <div className={defaultWrapperStyle[mode]}>\n {header}\n {mainContentSlot}\n {footer}\n </div>\n );\n }\n}\n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,CAAUC;AApBC,C;eAoJN5D,c"}
1
+ {"version":3,"file":"index.js","names":["defaultWrapperStyle","default","style","cockpit","defaultCockpit","mobile","ExternalCourse","props","context","name","type","url","quit","complete","warning","loading","backgroundImageUrl","contentType","mode","closePopin","skin","primary","IconType","EXTERNAL_CONTENT_ICONS","icon","IconColor","color","handleOnClick","useCallback","field","onClick","e","stopPropagation","preventDefault","mainContentSlot","useMemo","loader","completeButton","disabled","label","backgroundColor","convert","cursor","classnames","completeCta","warningButton","leftSection","iconLabel","link","iconQuestion","quitButton","quitCta","titleSection","title","oval","iconHeader","innerHTML","__html","header","rightSection","footer","popin","propTypes","PropTypes","string","oneOf","isRequired","shape","func","bool","CmPopin","contextTypes","Provider","childContextTypes"],"sources":["../../../src/template/external-course/index.js"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport {NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon} from '@coorpacademy/nova-icons';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {noop, getOr, keys, identity, isNil, isEmpty} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport {EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport Loader from '../../atom/loader';\nimport Button from '../../atom/button';\nimport ExternalContentViewer from '../../molecule/external-content-viewer';\nimport CmPopin from '../../molecule/cm-popin';\nimport style from './style.css';\n\nconst defaultWrapperStyle = {\n default: style.default,\n cockpit: style.defaultCockpit,\n mobile: style.default\n};\n\nconst ExternalCourse = (props, context) => {\n const {\n name,\n type,\n url,\n quit,\n complete,\n warning,\n loading,\n backgroundImageUrl,\n contentType,\n mode = 'default',\n closePopin\n } = props;\n const {skin} = context;\n const primary = getOr('#00B0FF', 'common.primary', skin);\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const IconColor = EXTERNAL_CONTENT_ICONS[type].color;\n\n const handleOnClick = useCallback(field => {\n const {onClick = noop} = field;\n return e => {\n e.stopPropagation();\n e.preventDefault();\n return onClick(e);\n };\n }, []);\n\n const mainContentSlot = useMemo(() => {\n return loading ? (\n <div className={style.loader}>\n <Loader />\n </div>\n ) : (\n <ExternalContentViewer\n url={url}\n mode={mode}\n backgroundImageUrl={backgroundImageUrl}\n contentType={contentType}\n />\n );\n }, [loading, url, mode, contentType, backgroundImageUrl]);\n\n const completeButton = useMemo(() => {\n return !isNil(complete) ? (\n <Button\n type=\"button\"\n disabled={loading ? true : complete.disabled}\n onClick={loading ? identity : handleOnClick(complete)}\n submitValue={complete.label}\n style={{\n backgroundColor:\n complete.disabled || loading ? convert(`color(${primary} a(-50%))`) : primary,\n cursor: loading ? 'progress' : 'pointer'\n }}\n className={classnames(\n style.completeCta,\n complete.disabled || loading ? style.disabled : null,\n loading ? style.loading : null\n )}\n />\n ) : null;\n }, [complete, loading, primary, handleOnClick]);\n\n const warningButton = useMemo(() => {\n return !isNil(warning) ? (\n <div className={style.leftSection}>\n <div onClick={handleOnClick(warning)} className={classnames(style.iconLabel, style.link)}>\n <QuestionIcon className={style.iconQuestion} width={24} height={24} />\n <span>{warning.label}</span>\n </div>\n </div>\n ) : null;\n }, [warning, handleOnClick]);\n\n const quitButton = useMemo(() => {\n return !isNil(quit) ? (\n <div className={style.leftSection}>\n <span\n className={classnames(style.quitCta, loading ? style.loading : null)}\n onClick={loading ? identity : handleOnClick(quit)}\n >\n {quit.label}\n </span>\n </div>\n ) : null;\n }, [quit, loading, handleOnClick]);\n\n const titleSection = useMemo(() => {\n return !isNil(name) ? (\n <div className={classnames(style.iconLabel, style.title)}>\n <div className={style.oval} style={{backgroundColor: IconColor}}>\n <IconType className={style.iconHeader} />\n </div>\n <span\n className={style.innerHTML}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: name}}\n />\n </div>\n ) : null;\n }, [name, IconColor]);\n\n const header = useMemo(() => {\n !isNil(quit) || !isEmpty(name) ? (\n <div className={style.header}>\n {quitButton}\n {titleSection}\n {isNil(quit) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n }, [name, titleSection, quit, quitButton]);\n\n const footer = useMemo(() => {\n !isNil(warning) || !isNil(complete) ? (\n <div className={style.footer}>\n {warningButton}\n {completeButton}\n {isNil(warning) ? null : <div className={style.rightSection} />}\n </div>\n ) : null;\n }, [warning, warningButton, complete, completeButton]);\n\n const popin = useMemo(() => {\n return !isNil(closePopin) ? <CmPopin {...closePopin} /> : null;\n }, [closePopin]);\n\n return (\n <div className={defaultWrapperStyle[mode]}>\n {header}\n {popin}\n {mainContentSlot}\n {footer}\n </div>\n );\n};\n\nExternalCourse.propTypes = {\n name: PropTypes.string,\n type: PropTypes.oneOf(keys(EXTERNAL_CONTENT_ICONS)),\n url: PropTypes.string.isRequired,\n quit: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n complete: PropTypes.shape({\n label: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n onClick: PropTypes.func\n }),\n warning: PropTypes.shape({\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func\n }),\n loading: PropTypes.bool,\n backgroundImageUrl: PropTypes.string,\n contentType: PropTypes.string,\n mode: PropTypes.string,\n closePopin: PropTypes.shape({...CmPopin.propTypes})\n};\n\nExternalCourse.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default ExternalCourse;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,mBAAmB,GAAG;EAC1BC,OAAO,EAAEC,cAAA,CAAMD,OADW;EAE1BE,OAAO,EAAED,cAAA,CAAME,cAFW;EAG1BC,MAAM,EAAEH,cAAA,CAAMD;AAHY,CAA5B;;AAMA,MAAMK,cAAc,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACzC,MAAM;IACJC,IADI;IAEJC,IAFI;IAGJC,GAHI;IAIJC,IAJI;IAKJC,QALI;IAMJC,O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B;IACxB5B,KAAK,EAAEwB,kBAAA,CAAUC,MAAV,CAAiBE,UADA;IAExB5B,QAAQ,EAAEyB,kBAAA,CAAUM,IAFI;IAGxBvC,OAAO,EAAEiC,kBAAA,CAAUK;EAHK,CAAhB,CARe;EAazBtD,OAAO,EAAEiD,kBAAA,CAAUI,KAAV,CAAgB;IACvB5B,KAAK,EAAEwB,kBAAA,CAAUC,MAAV,CAAiBE,UADD;IAEvBpC,OAAO,EAAEiC,kBAAA,CAAUK;EAFI,CAAhB,CAbgB;EAiBzBrD,OAAO,EAAEgD,kBAAA,CAAUM,IAjBM;EAkBzBrD,kBAAkB,EAAE+C,kBAAA,CAAUC,MAlBL;EAmBzB/C,WAAW,EAAE8C,kBAAA,CAAUC,MAnBE;EAoBzB9C,IAAI,EAAE6C,kBAAA,CAAUC,MApBS;EAqBzB7C,UAAU,EAAE4C,kBAAA,CAAUI,KAAV,cAAoBG,gBAAA,CAAQR,SAA5B;AArBa,CAA3B;AAwBAxD,cAAc,CAACiE,YAAf,GAA8B;EAC5BnD,IAAI,EAAEoD,iBAAA,CAASC,iBAAT,CAA2BrD;AADL,CAA9B;eAIed,c"}
@@ -24,7 +24,7 @@
24
24
  }
25
25
 
26
26
  .defaultCockpit{
27
- composes:default;
27
+ composes: default;
28
28
  height: 100%;
29
29
  }
30
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "11.13.6",
3
+ "version": "11.13.7-alpha.14+ec6c0cf629",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -166,5 +166,5 @@
166
166
  "last 2 versions",
167
167
  "IE 11"
168
168
  ],
169
- "gitHead": "476d89a1f34bb385367e7896ea204a482950ad70"
169
+ "gitHead": "ec6c0cf6297d0b00522d5e10df21fb80a0986fd5"
170
170
  }
@@ -1 +0,0 @@
1
- {"ignore_dirs":[]}