@coorpacademy/components 11.32.3 → 11.32.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 (130) hide show
  1. package/es/atom/battle-opponent/index.d.ts.map +1 -1
  2. package/es/atom/battle-opponent/index.js +1 -1
  3. package/es/atom/battle-opponent/index.js.map +1 -1
  4. package/es/molecule/base-modal/index.d.ts +24 -1
  5. package/es/molecule/base-modal/index.d.ts.map +1 -1
  6. package/es/molecule/base-modal/index.js +26 -5
  7. package/es/molecule/base-modal/index.js.map +1 -1
  8. package/es/molecule/card/favorite.d.ts.map +1 -1
  9. package/es/molecule/card/favorite.js +1 -1
  10. package/es/molecule/card/favorite.js.map +1 -1
  11. package/es/molecule/discipline-associated-skills/index.d.ts +17 -0
  12. package/es/molecule/discipline-associated-skills/index.d.ts.map +1 -0
  13. package/es/molecule/discipline-associated-skills/index.js +73 -0
  14. package/es/molecule/discipline-associated-skills/index.js.map +1 -0
  15. package/es/molecule/discipline-associated-skills/style.css +71 -0
  16. package/es/molecule/learner-skill-card/index.d.ts +22 -0
  17. package/es/molecule/learner-skill-card/index.d.ts.map +1 -1
  18. package/es/molecule/learner-skill-card/index.js +7 -6
  19. package/es/molecule/learner-skill-card/index.js.map +1 -1
  20. package/es/molecule/learning-profile-radar-chart/index.d.ts +28 -1
  21. package/es/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
  22. package/es/molecule/learning-profile-radar-chart/index.js +115 -28
  23. package/es/molecule/learning-profile-radar-chart/index.js.map +1 -1
  24. package/es/molecule/learning-profile-radar-chart/style.css +14 -0
  25. package/es/molecule/learning-profile-radar-chart/types.d.ts +2 -0
  26. package/es/molecule/learning-profile-radar-chart/types.d.ts.map +1 -1
  27. package/es/molecule/learning-profile-radar-chart/types.js +2 -1
  28. package/es/molecule/learning-profile-radar-chart/types.js.map +1 -1
  29. package/es/molecule/review-correction-popin/index.d.ts.map +1 -1
  30. package/es/molecule/review-correction-popin/index.js +1 -1
  31. package/es/molecule/review-correction-popin/index.js.map +1 -1
  32. package/es/molecule/skill-picker-modal/index.d.ts.map +1 -1
  33. package/es/molecule/skill-picker-modal/index.js +2 -1
  34. package/es/molecule/skill-picker-modal/index.js.map +1 -1
  35. package/es/organism/user-preferences/index.d.ts.map +1 -1
  36. package/es/organism/user-preferences/index.js +1 -1
  37. package/es/organism/user-preferences/index.js.map +1 -1
  38. package/es/template/activity/engine-stars.d.ts.map +1 -1
  39. package/es/template/activity/engine-stars.js +1 -1
  40. package/es/template/activity/engine-stars.js.map +1 -1
  41. package/es/template/common/discipline/index.d.ts +6 -0
  42. package/es/template/common/discipline/index.d.ts.map +1 -1
  43. package/es/template/common/discipline/index.js +17 -2
  44. package/es/template/common/discipline/index.js.map +1 -1
  45. package/es/template/common/discipline/style.css +4 -1
  46. package/es/template/my-learning/index.d.ts +21 -0
  47. package/es/template/my-learning/index.d.ts.map +1 -1
  48. package/es/template/my-learning/index.js +41 -15
  49. package/es/template/my-learning/index.js.map +1 -1
  50. package/es/template/my-learning/style.css +6 -1
  51. package/lib/atom/battle-opponent/index.d.ts.map +1 -1
  52. package/lib/atom/battle-opponent/index.js +1 -1
  53. package/lib/atom/battle-opponent/index.js.map +1 -1
  54. package/lib/molecule/base-modal/index.d.ts +24 -1
  55. package/lib/molecule/base-modal/index.d.ts.map +1 -1
  56. package/lib/molecule/base-modal/index.js +26 -4
  57. package/lib/molecule/base-modal/index.js.map +1 -1
  58. package/lib/molecule/card/favorite.d.ts.map +1 -1
  59. package/lib/molecule/card/favorite.js +1 -1
  60. package/lib/molecule/card/favorite.js.map +1 -1
  61. package/lib/molecule/discipline-associated-skills/index.d.ts +17 -0
  62. package/lib/molecule/discipline-associated-skills/index.d.ts.map +1 -0
  63. package/lib/molecule/discipline-associated-skills/index.js +94 -0
  64. package/lib/molecule/discipline-associated-skills/index.js.map +1 -0
  65. package/lib/molecule/discipline-associated-skills/style.css +71 -0
  66. package/lib/molecule/learner-skill-card/index.d.ts +22 -0
  67. package/lib/molecule/learner-skill-card/index.d.ts.map +1 -1
  68. package/lib/molecule/learner-skill-card/index.js +7 -7
  69. package/lib/molecule/learner-skill-card/index.js.map +1 -1
  70. package/lib/molecule/learning-profile-radar-chart/index.d.ts +28 -1
  71. package/lib/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
  72. package/lib/molecule/learning-profile-radar-chart/index.js +117 -28
  73. package/lib/molecule/learning-profile-radar-chart/index.js.map +1 -1
  74. package/lib/molecule/learning-profile-radar-chart/style.css +14 -0
  75. package/lib/molecule/learning-profile-radar-chart/types.d.ts +2 -0
  76. package/lib/molecule/learning-profile-radar-chart/types.d.ts.map +1 -1
  77. package/lib/molecule/learning-profile-radar-chart/types.js +2 -1
  78. package/lib/molecule/learning-profile-radar-chart/types.js.map +1 -1
  79. package/lib/molecule/review-correction-popin/index.d.ts.map +1 -1
  80. package/lib/molecule/review-correction-popin/index.js +1 -1
  81. package/lib/molecule/review-correction-popin/index.js.map +1 -1
  82. package/lib/molecule/skill-picker-modal/index.d.ts.map +1 -1
  83. package/lib/molecule/skill-picker-modal/index.js +2 -1
  84. package/lib/molecule/skill-picker-modal/index.js.map +1 -1
  85. package/lib/organism/user-preferences/index.d.ts.map +1 -1
  86. package/lib/organism/user-preferences/index.js +1 -1
  87. package/lib/organism/user-preferences/index.js.map +1 -1
  88. package/lib/template/activity/engine-stars.d.ts.map +1 -1
  89. package/lib/template/activity/engine-stars.js +1 -1
  90. package/lib/template/activity/engine-stars.js.map +1 -1
  91. package/lib/template/common/discipline/index.d.ts +6 -0
  92. package/lib/template/common/discipline/index.d.ts.map +1 -1
  93. package/lib/template/common/discipline/index.js +18 -2
  94. package/lib/template/common/discipline/index.js.map +1 -1
  95. package/lib/template/common/discipline/style.css +4 -1
  96. package/lib/template/my-learning/index.d.ts +21 -0
  97. package/lib/template/my-learning/index.d.ts.map +1 -1
  98. package/lib/template/my-learning/index.js +39 -15
  99. package/lib/template/my-learning/index.js.map +1 -1
  100. package/lib/template/my-learning/style.css +6 -1
  101. package/locales/bs/global.json +3 -1
  102. package/locales/cs/global.json +4 -2
  103. package/locales/de/global.json +3 -1
  104. package/locales/en/global.json +3 -1
  105. package/locales/es/global.json +3 -1
  106. package/locales/et/global.json +3 -1
  107. package/locales/fi/global.json +3 -1
  108. package/locales/fr/global.json +3 -1
  109. package/locales/hr/global.json +3 -1
  110. package/locales/hu/global.json +3 -1
  111. package/locales/hy/global.json +3 -1
  112. package/locales/it/global.json +3 -1
  113. package/locales/ja/global.json +3 -1
  114. package/locales/ko/global.json +3 -1
  115. package/locales/nl/global.json +3 -1
  116. package/locales/pl/global.json +3 -1
  117. package/locales/pt/global.json +3 -1
  118. package/locales/ro/global.json +3 -1
  119. package/locales/ru/global.json +3 -1
  120. package/locales/sk/global.json +3 -1
  121. package/locales/sl/global.json +3 -1
  122. package/locales/sv/global.json +3 -1
  123. package/locales/th/global.json +1 -1
  124. package/locales/tl/global.json +4 -2
  125. package/locales/tr/global.json +3 -1
  126. package/locales/uk/global.json +3 -1
  127. package/locales/vi/global.json +4 -2
  128. package/locales/zh/global.json +3 -1
  129. package/locales/zh_TW/global.json +3 -1
  130. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/review-correction-popin/index.js"],"names":[],"mappings":";AA+EA,gEAqDC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/review-correction-popin/index.js"],"names":[],"mappings":";AA6EA,gEAqDC"}
@@ -37,7 +37,7 @@ const KlfButton = ({
37
37
  }
38
38
  }), [klf.tooltip]);
39
39
  const toolTipProps = useMemo(() => ({
40
- closeToolTipInformationTextAriaLabel: translate('Press the escape key to close the information text'),
40
+ closeToolTipInformationTextAriaLabel: translate('close_tooltip_information'),
41
41
  AnchorElement: AnchorButton,
42
42
  TooltipContent,
43
43
  'aria-label': translate('More details'),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useMemo","classnames","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","ButtonLink","Provider","GetTranslateFromContext","Tooltip","style","propTypes","KlfButton","klf","legacyContext","translate","klfButtonProps","icon","position","type","AnchorButton","onKeyDown","klfButtonContainer","klfButton","TooltipContent","tooltipText","__html","tooltip","toolTipProps","closeToolTipInformationTextAriaLabel","AnchorElement","tooltipClassName","toolTipCustomization","klfContainer","contextTypes","childContextTypes","ReviewCorrectionPopin","props","information","resultLabel","next","nextQuestionButtonProps","cta","ICONS","right","wrong","Icon","wrapper","popin","correctionSection","iconCircle","iconRight","iconWrong","feedbackSection","labelContainer","label","message","actions","actionsWrong","nextQuestionContainer","nextQuestionButton"],"sources":["../../../src/molecule/review-correction-popin/index.js"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport ButtonLink from '../../atom/button-link';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport Tooltip from '../../atom/tooltip';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst KlfButton = ({klf}, legacyContext) => {\n const translate = GetTranslateFromContext(legacyContext);\n const klfButtonProps = useMemo(\n () => ({\n ...klf,\n icon: {\n position: 'left',\n type: 'key'\n },\n type: 'primary'\n }),\n [klf]\n );\n\n const AnchorButton = useCallback(\n ({onKeyDown}) => (\n <div className={style.klfButtonContainer}>\n <ButtonLink\n {...klfButtonProps}\n className={style.klfButton}\n onKeyDown={onKeyDown}\n useTitle={false}\n />\n </div>\n ),\n [klfButtonProps]\n );\n\n const TooltipContent = useCallback(\n () => (\n <span\n className={style.tooltipText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: klf.tooltip}}\n />\n ),\n [klf.tooltip]\n );\n\n const toolTipProps = useMemo(\n () => ({\n closeToolTipInformationTextAriaLabel: translate(\n 'Press the escape key to close the information text'\n ),\n AnchorElement: AnchorButton,\n TooltipContent,\n 'aria-label': translate('More details'),\n tooltipClassName: style.toolTipCustomization\n }),\n [AnchorButton, TooltipContent, translate]\n );\n\n return (\n <div className={style.klfContainer}>\n <Tooltip {...toolTipProps} />\n </div>\n );\n};\n\nKlfButton.propTypes = {\n klf: propTypes.klf\n};\n\nKlfButton.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nconst ReviewCorrectionPopin = props => {\n const {information, resultLabel, type, klf, next} = props;\n\n const nextQuestionButtonProps = {\n ...next,\n type: 'primary'\n };\n\n const cta = type === 'wrong' ? <KlfButton klf={klf} /> : null;\n\n const ICONS = {\n right: RightIcon,\n wrong: WrongIcon\n };\n const Icon = ICONS[type];\n\n return (\n <div className={style.wrapper} data-testid=\"review-correction-popin\">\n <div className={classnames(style.popin, type === 'right' ? style.right : style.wrong)}>\n <div className={style.correctionSection}>\n <div className={style.iconCircle}>\n <Icon className={type === 'right' ? style.iconRight : style.iconWrong} />\n </div>\n <div className={style.resultLabel}>\n <span aria-label={resultLabel} role=\"status\">\n {resultLabel}\n </span>\n </div>\n </div>\n <div className={style.feedbackSection}>\n <div className={style.information} aria-label=\"answer-information\">\n <div className={style.labelContainer}>\n <span className={style.label} aria-label={information.label}>\n {information.label}\n </span>\n </div>\n <span\n className={style.message}\n aria-label={information.message}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: information.message}}\n />\n </div>\n </div>\n <div className={type === 'right' ? style.actions : style.actionsWrong}>\n {cta}\n <div className={style.nextQuestionContainer} data-testid=\"next-question-button-container\">\n <ButtonLink {...nextQuestionButtonProps} className={style.nextQuestionButton} />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nReviewCorrectionPopin.propTypes = propTypes;\n\nexport default ReviewCorrectionPopin;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,QAA0C,OAA1C;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA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AE/B,IAAI,KAAK,OAAT,GAAmBT,KAAK,CAACyC,SAAzB,GAAqCzC,KAAK,CAAC0C;EAA5D,EADF,CADF,eAIE;IAAK,SAAS,EAAE1C,KAAK,CAAC6B;EAAtB,gBACE;IAAM,cAAYA,WAAlB;IAA+B,IAAI,EAAC;EAApC,GACGA,WADH,CADF,CAJF,CADF,eAWE;IAAK,SAAS,EAAE7B,KAAK,CAAC2C;EAAtB,gBACE;IAAK,SAAS,EAAE3C,KAAK,CAAC4B,WAAtB;IAAmC,cAAW;EAA9C,gBACE;IAAK,SAAS,EAAE5B,KAAK,CAAC4C;EAAtB,gBACE;IAAM,SAAS,EAAE5C,KAAK,CAAC6C,KAAvB;IAA8B,cAAYjB,WAAW,CAACiB;EAAtD,GACGjB,WAAW,CAACiB,KADf,CADF,CADF,eAME;IACE,SAAS,EAAE7C,KAAK,CAAC8C,OADnB;IAEE,cAAYlB,WAAW,CAACkB,OAF1B,CAGE;IAHF;IAIE,uBAAuB,EAAE;MAAC9B,MAAM,EAAEY,WAAW,CAACkB;IAArB;EAJ3B,EANF,CADF,CAXF,eA0BE;IAAK,SAAS,EAAErC,IAAI,KAAK,OAAT,GAAmBT,KAAK,CAAC+C,OAAzB,GAAmC/C,KAAK,CAACgD;EAAzD,GACGhB,GADH,eAEE;IAAK,SAAS,EAAEhC,KAAK,CAACiD,qBAAtB;IAA6C,eAAY;EAAzD,gBACE,oBAAC,UAAD,eAAgBlB,uBAAhB;IAAyC,SAAS,EAAE/B,KAAK,CAACkD;EAA1D,GADF,CAFF,CA1BF,CADF,CADF;AAqCD,CArDD;;AAuDAxB,qBAAqB,CAACzB,SAAtB,2CAAkCA,SAAlC;AAEA,eAAeyB,qBAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useMemo","classnames","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","ButtonLink","Provider","GetTranslateFromContext","Tooltip","style","propTypes","KlfButton","klf","legacyContext","translate","klfButtonProps","icon","position","type","AnchorButton","onKeyDown","klfButtonContainer","klfButton","TooltipContent","tooltipText","__html","tooltip","toolTipProps","closeToolTipInformationTextAriaLabel","AnchorElement","tooltipClassName","toolTipCustomization","klfContainer","contextTypes","childContextTypes","ReviewCorrectionPopin","props","information","resultLabel","next","nextQuestionButtonProps","cta","ICONS","right","wrong","Icon","wrapper","popin","correctionSection","iconCircle","iconRight","iconWrong","feedbackSection","labelContainer","label","message","actions","actionsWrong","nextQuestionContainer","nextQuestionButton"],"sources":["../../../src/molecule/review-correction-popin/index.js"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport ButtonLink from '../../atom/button-link';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport Tooltip from '../../atom/tooltip';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst KlfButton = ({klf}, legacyContext) => {\n const translate = GetTranslateFromContext(legacyContext);\n const klfButtonProps = useMemo(\n () => ({\n ...klf,\n icon: {\n position: 'left',\n type: 'key'\n },\n type: 'primary'\n }),\n [klf]\n );\n\n const AnchorButton = useCallback(\n ({onKeyDown}) => (\n <div className={style.klfButtonContainer}>\n <ButtonLink\n {...klfButtonProps}\n className={style.klfButton}\n onKeyDown={onKeyDown}\n useTitle={false}\n />\n </div>\n ),\n [klfButtonProps]\n );\n\n const TooltipContent = useCallback(\n () => (\n <span\n className={style.tooltipText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: klf.tooltip}}\n />\n ),\n [klf.tooltip]\n );\n\n const toolTipProps = useMemo(\n () => ({\n closeToolTipInformationTextAriaLabel: translate('close_tooltip_information'),\n AnchorElement: AnchorButton,\n TooltipContent,\n 'aria-label': translate('More details'),\n tooltipClassName: style.toolTipCustomization\n }),\n [AnchorButton, TooltipContent, translate]\n );\n\n return (\n <div className={style.klfContainer}>\n <Tooltip {...toolTipProps} />\n </div>\n );\n};\n\nKlfButton.propTypes = {\n klf: propTypes.klf\n};\n\nKlfButton.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nconst ReviewCorrectionPopin = props => {\n const {information, resultLabel, type, klf, next} = props;\n\n const nextQuestionButtonProps = {\n ...next,\n type: 'primary'\n };\n\n const cta = type === 'wrong' ? <KlfButton klf={klf} /> : null;\n\n const ICONS = {\n right: RightIcon,\n wrong: WrongIcon\n };\n const Icon = ICONS[type];\n\n return (\n <div className={style.wrapper} data-testid=\"review-correction-popin\">\n <div className={classnames(style.popin, type === 'right' ? style.right : style.wrong)}>\n <div className={style.correctionSection}>\n <div className={style.iconCircle}>\n <Icon className={type === 'right' ? style.iconRight : style.iconWrong} />\n </div>\n <div className={style.resultLabel}>\n <span aria-label={resultLabel} role=\"status\">\n {resultLabel}\n </span>\n </div>\n </div>\n <div className={style.feedbackSection}>\n <div className={style.information} aria-label=\"answer-information\">\n <div className={style.labelContainer}>\n <span className={style.label} aria-label={information.label}>\n {information.label}\n </span>\n </div>\n <span\n className={style.message}\n aria-label={information.message}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: information.message}}\n />\n </div>\n </div>\n <div className={type === 'right' ? style.actions : style.actionsWrong}>\n {cta}\n <div className={style.nextQuestionContainer} data-testid=\"next-question-button-container\">\n <ButtonLink {...nextQuestionButtonProps} className={style.nextQuestionButton} />\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nReviewCorrectionPopin.propTypes = propTypes;\n\nexport default ReviewCorrectionPopin;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,QAA0C,OAA1C;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,gCAAgC,IAAIC,SADtC,EAEEC,oBAAoB,IAAIC,SAF1B,QAGO,0BAHP;AAIA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,QAAP,IAAkBC,uBAAlB,QAAgD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;IAAM,cAAYA,WAAlB;IAA+B,IAAI,EAAC;EAApC,GACGA,WADH,CADF,CAJF,CADF,eAWE;IAAK,SAAS,EAAE7B,KAAK,CAAC2C;EAAtB,gBACE;IAAK,SAAS,EAAE3C,KAAK,CAAC4B,WAAtB;IAAmC,cAAW;EAA9C,gBACE;IAAK,SAAS,EAAE5B,KAAK,CAAC4C;EAAtB,gBACE;IAAM,SAAS,EAAE5C,KAAK,CAAC6C,KAAvB;IAA8B,cAAYjB,WAAW,CAACiB;EAAtD,GACGjB,WAAW,CAACiB,KADf,CADF,CADF,eAME;IACE,SAAS,EAAE7C,KAAK,CAAC8C,OADnB;IAEE,cAAYlB,WAAW,CAACkB,OAF1B,CAGE;IAHF;IAIE,uBAAuB,EAAE;MAAC9B,MAAM,EAAEY,WAAW,CAACkB;IAArB;EAJ3B,EANF,CADF,CAXF,eA0BE;IAAK,SAAS,EAAErC,IAAI,KAAK,OAAT,GAAmBT,KAAK,CAAC+C,OAAzB,GAAmC/C,KAAK,CAACgD;EAAzD,GACGhB,GADH,eAEE;IAAK,SAAS,EAAEhC,KAAK,CAACiD,qBAAtB;IAA6C,eAAY;EAAzD,gBACE,oBAAC,UAAD,eAAgBlB,uBAAhB;IAAyC,SAAS,EAAE/B,KAAK,CAACkD;EAA1D,GADF,CAFF,CA1BF,CADF,CADF;AAqCD,CArDD;;AAuDAxB,qBAAqB,CAACzB,SAAtB,2CAAkCA,SAAlC;AAEA,eAAeyB,qBAAf"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/skill-picker-modal/index.js"],"names":[],"mappings":";AASA,gFA0HC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/skill-picker-modal/index.js"],"names":[],"mappings":";AASA,gFAgIC"}
@@ -108,7 +108,8 @@ const SkillPickerModal = (props, context) => {
108
108
  text: skillTitle,
109
109
  selected: focus,
110
110
  onClick: handleChipClick,
111
- key: index
111
+ key: index,
112
+ backgroundColor: "skin"
112
113
  });
113
114
  })))));
114
115
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","useState","useCallback","PropTypes","filter","BaseModal","Chip","Loader","Provider","style","SkillPickerModal","props","context","skills","selectedSkills","skillsLocales","isOpen","isLoading","maxSelectedSkills","minSelectedSkills","onCancel","onConfirm","onClose","translate","selectedSkillList","setSelectedSkillList","handleCancel","handleClose","skillList","map","skill","skillTitle","skillRef","focus","includes","isError","length","footer","footerDescription","skillNumber","text","cancelButton","label","disabled","confirmButton","iconName","name","backgroundColor","skillPickerContainer","loaderContainer","loader","marginBottom","display","gap","flexWrap","index","handleChipClick","newSelectedSkillList","selectedSkill","contextTypes","childContextTypes","propTypes","arrayOf","string","objectOf","bool","number","func"],"sources":["../../../src/molecule/skill-picker-modal/index.js"],"sourcesContent":["import React, {useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport filter from 'lodash/fp/filter';\nimport BaseModal from '../base-modal';\nimport Chip from '../../atom/chip';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst SkillPickerModal = (props, context) => {\n const {\n skills,\n selectedSkills,\n skillsLocales,\n isOpen,\n isLoading,\n maxSelectedSkills = 6,\n minSelectedSkills = 3,\n onCancel,\n onConfirm,\n onClose\n } = props;\n const {translate} = context;\n\n const [selectedSkillList, setSelectedSkillList] = useState(selectedSkills);\n\n const handleCancel = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onCancel();\n }, [setSelectedSkillList, selectedSkills, onCancel]);\n\n const handleClose = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onClose();\n }, [setSelectedSkillList, selectedSkills, onClose]);\n\n const skillList = useMemo(() => {\n return skills.map(skill => {\n return {\n skillTitle: skillsLocales[skill],\n skillRef: skill,\n focus: selectedSkillList.includes(skill)\n };\n });\n }, [skills, selectedSkillList, skillsLocales]);\n\n const isError = useMemo(\n () =>\n selectedSkillList.length > maxSelectedSkills || selectedSkillList.length < minSelectedSkills,\n [selectedSkillList, maxSelectedSkills]\n );\n\n const footer = useMemo(() => {\n const footerDescription =\n selectedSkillList.length > maxSelectedSkills\n ? translate('skill_focus_footer_error_description', {\n skillNumber: selectedSkillList.length - maxSelectedSkills\n })\n : translate('skill_focus_footer_description', {\n skillNumber: minSelectedSkills - selectedSkillList.length\n });\n return {\n text: isLoading || !isError ? '' : footerDescription,\n isError,\n cancelButton: {\n onCancel: handleCancel,\n label: translate('cancel'),\n disabled: isLoading || isError\n },\n confirmButton: {\n onConfirm: () => onConfirm(selectedSkillList),\n label: translate('confirm'),\n iconName: 'circle-check',\n disabled: isLoading || isError\n }\n };\n }, [\n isError,\n handleCancel,\n onConfirm,\n translate,\n selectedSkillList,\n isLoading,\n maxSelectedSkills,\n minSelectedSkills\n ]);\n\n if ((!isLoading && !skills) || !isOpen) return null;\n\n return (\n <BaseModal\n title={translate('skill_focus')}\n description={translate('skill_focus_description')}\n isOpen={isOpen}\n onClose={handleClose}\n footer={footer}\n headerIcon={{\n name: 'bullseye-arrow',\n backgroundColor: '#DDD1FF'\n }}\n >\n <div className={style.skillPickerContainer}>\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <>\n <div style={{marginBottom: '16px'}}>\n {`${selectedSkillList.length} ${translate('selected')}`}\n </div>\n <div style={{display: 'flex', gap: '16px', flexWrap: 'wrap'}}>\n {skillList.map((skill, index) => {\n const {skillTitle, skillRef, focus} = skill;\n function handleChipClick() {\n const newSelectedSkillList = focus\n ? filter(selectedSkill => selectedSkill !== skillRef, selectedSkillList)\n : [...selectedSkillList, skill.skillRef];\n setSelectedSkillList(newSelectedSkillList);\n }\n\n return (\n <Chip text={skillTitle} selected={focus} onClick={handleChipClick} key={index} />\n );\n })}\n </div>\n </>\n )}\n </div>\n </BaseModal>\n );\n};\n\nSkillPickerModal.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nSkillPickerModal.propTypes = {\n skills: PropTypes.arrayOf(PropTypes.string),\n selectedSkills: PropTypes.arrayOf(PropTypes.string),\n skillsLocales: PropTypes.objectOf(PropTypes.string),\n isOpen: PropTypes.bool,\n isLoading: PropTypes.bool,\n minSelectedSkills: PropTypes.number,\n maxSelectedSkills: PropTypes.number,\n onCancel: PropTypes.func,\n onConfirm: PropTypes.func,\n onClose: PropTypes.func\n};\n\nexport default SkillPickerModal;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,QAAxB,EAAkCC,WAAlC,QAAoD,OAApD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IACJC,MADI;IAEJC,cAFI;IAGJC,aAHI;IAIJC,MAJI;IAKJC,SALI;IAMJC,iBAAiB,GAAG,CANhB;IAOJC,iBAAiB,GAAG,CAPhB;IAQJC,QARI;IASJC,SATI;IAUJC;EAVI,IAWFX,KAXJ;EAYA,MAAM;IAACY;EAAD,IAAcX,OAApB;EAEA,MAAM,CAACY,iBAAD,EAAoBC,oBAApB,IAA4CxB,QAAQ,CAACa,cAAD,CAA1D;EAEA,MAAMY,YAAY,GAAGxB,WAAW,CAAC,MAAM;IACrCuB,oBAAoB,CAACX,cAAD,CAApB;IACAM,QAAQ;EACT,CAH+B,EAG7B,CAACK,oBAAD,EAAuBX,cAAvB,EAAuCM,QAAvC,CAH6B,CAAhC;EAKA,MAAMO,WAAW,GAAGzB,WAAW,CAAC,MAAM;IACpCuB,oBAAoB,CAACX,cAAD,CAApB;IACAQ,OAAO;EACR,CA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AAT,GAA2B;MACzB,MAAMC,oBAAoB,GAAGxB,KAAK,GAC9B7B,MAAM,CAACsD,aAAa,IAAIA,aAAa,KAAK1B,QAApC,EAA8CR,iBAA9C,CADwB,GAE9B,CAAC,GAAGA,iBAAJ,EAAuBM,KAAK,CAACE,QAA7B,CAFJ;MAGAP,oBAAoB,CAACgC,oBAAD,CAApB;IACD;;IAED,oBACE,oBAAC,IAAD;MAAM,IAAI,EAAE1B,UAAZ;MAAwB,QAAQ,EAAEE,KAAlC;MAAyC,OAAO,EAAEuB,eAAlD;MAAmE,GAAG,EAAED;IAAxE,EADF;EAGD,CAZA,CADH,CAJF,CANJ,CAXF,CADF;AA0CD,CA1HD;;AA4HA7C,gBAAgB,CAACiD,YAAjB,GAAgC;EAC9BpC,SAAS,EAAEf,QAAQ,CAACoD,iBAAT,CAA2BrC;AADR,CAAhC;AAIAb,gBAAgB,CAACmD,SAAjB,2CAA6B;EAC3BhD,MAAM,EAAEV,SAAS,CAAC2D,OAAV,CAAkB3D,SAAS,CAAC4D,MAA5B,CADmB;EAE3BjD,cAAc,EAAEX,SAAS,CAAC2D,OAAV,CAAkB3D,SAAS,CAAC4D,MAA5B,CAFW;EAG3BhD,aAAa,EAAEZ,SAAS,CAAC6D,QAAV,CAAmB7D,SAAS,CAAC4D,MAA7B,CAHY;EAI3B/C,MAAM,EAAEb,SAAS,CAAC8D,IAJS;EAK3BhD,SAAS,EAAEd,SAAS,CAAC8D,IALM;EAM3B9C,iBAAiB,EAAEhB,SAAS,CAAC+D,MANF;EAO3BhD,iBAAiB,EAAEf,SAAS,CAAC+D,MAPF;EAQ3B9C,QAAQ,EAAEjB,SAAS,CAACgE,IARO;EAS3B9C,SAAS,EAAElB,SAAS,CAACgE,IATM;EAU3B7C,OAAO,EAAEnB,SAAS,CAACgE;AAVQ,CAA7B;AAaA,eAAezD,gBAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useMemo","useState","useCallback","PropTypes","filter","BaseModal","Chip","Loader","Provider","style","SkillPickerModal","props","context","skills","selectedSkills","skillsLocales","isOpen","isLoading","maxSelectedSkills","minSelectedSkills","onCancel","onConfirm","onClose","translate","selectedSkillList","setSelectedSkillList","handleCancel","handleClose","skillList","map","skill","skillTitle","skillRef","focus","includes","isError","length","footer","footerDescription","skillNumber","text","cancelButton","label","disabled","confirmButton","iconName","name","backgroundColor","skillPickerContainer","loaderContainer","loader","marginBottom","display","gap","flexWrap","index","handleChipClick","newSelectedSkillList","selectedSkill","contextTypes","childContextTypes","propTypes","arrayOf","string","objectOf","bool","number","func"],"sources":["../../../src/molecule/skill-picker-modal/index.js"],"sourcesContent":["import React, {useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport filter from 'lodash/fp/filter';\nimport BaseModal from '../base-modal';\nimport Chip from '../../atom/chip';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst SkillPickerModal = (props, context) => {\n const {\n skills,\n selectedSkills,\n skillsLocales,\n isOpen,\n isLoading,\n maxSelectedSkills = 6,\n minSelectedSkills = 3,\n onCancel,\n onConfirm,\n onClose\n } = props;\n const {translate} = context;\n\n const [selectedSkillList, setSelectedSkillList] = useState(selectedSkills);\n\n const handleCancel = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onCancel();\n }, [setSelectedSkillList, selectedSkills, onCancel]);\n\n const handleClose = useCallback(() => {\n setSelectedSkillList(selectedSkills);\n onClose();\n }, [setSelectedSkillList, selectedSkills, onClose]);\n\n const skillList = useMemo(() => {\n return skills.map(skill => {\n return {\n skillTitle: skillsLocales[skill],\n skillRef: skill,\n focus: selectedSkillList.includes(skill)\n };\n });\n }, [skills, selectedSkillList, skillsLocales]);\n\n const isError = useMemo(\n () =>\n selectedSkillList.length > maxSelectedSkills || selectedSkillList.length < minSelectedSkills,\n [selectedSkillList, maxSelectedSkills]\n );\n\n const footer = useMemo(() => {\n const footerDescription =\n selectedSkillList.length > maxSelectedSkills\n ? translate('skill_focus_footer_error_description', {\n skillNumber: selectedSkillList.length - maxSelectedSkills\n })\n : translate('skill_focus_footer_description', {\n skillNumber: minSelectedSkills - selectedSkillList.length\n });\n return {\n text: isLoading || !isError ? '' : footerDescription,\n isError,\n cancelButton: {\n onCancel: handleCancel,\n label: translate('cancel'),\n disabled: isLoading || isError\n },\n confirmButton: {\n onConfirm: () => onConfirm(selectedSkillList),\n label: translate('confirm'),\n iconName: 'circle-check',\n disabled: isLoading || isError\n }\n };\n }, [\n isError,\n handleCancel,\n onConfirm,\n translate,\n selectedSkillList,\n isLoading,\n maxSelectedSkills,\n minSelectedSkills\n ]);\n\n if ((!isLoading && !skills) || !isOpen) return null;\n\n return (\n <BaseModal\n title={translate('skill_focus')}\n description={translate('skill_focus_description')}\n isOpen={isOpen}\n onClose={handleClose}\n footer={footer}\n headerIcon={{\n name: 'bullseye-arrow',\n backgroundColor: '#DDD1FF'\n }}\n >\n <div className={style.skillPickerContainer}>\n {isLoading ? (\n <div className={style.loaderContainer}>\n <Loader className={style.loader} theme=\"coorpmanager\" />\n </div>\n ) : (\n <>\n <div style={{marginBottom: '16px'}}>\n {`${selectedSkillList.length} ${translate('selected')}`}\n </div>\n <div style={{display: 'flex', gap: '16px', flexWrap: 'wrap'}}>\n {skillList.map((skill, index) => {\n const {skillTitle, skillRef, focus} = skill;\n function handleChipClick() {\n const newSelectedSkillList = focus\n ? filter(selectedSkill => selectedSkill !== skillRef, selectedSkillList)\n : [...selectedSkillList, skill.skillRef];\n setSelectedSkillList(newSelectedSkillList);\n }\n\n return (\n <Chip\n text={skillTitle}\n selected={focus}\n onClick={handleChipClick}\n key={index}\n backgroundColor=\"skin\"\n />\n );\n })}\n </div>\n </>\n )}\n </div>\n </BaseModal>\n );\n};\n\nSkillPickerModal.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nSkillPickerModal.propTypes = {\n skills: PropTypes.arrayOf(PropTypes.string),\n selectedSkills: PropTypes.arrayOf(PropTypes.string),\n skillsLocales: PropTypes.objectOf(PropTypes.string),\n isOpen: PropTypes.bool,\n isLoading: PropTypes.bool,\n minSelectedSkills: PropTypes.number,\n maxSelectedSkills: PropTypes.number,\n onCancel: PropTypes.func,\n onConfirm: PropTypes.func,\n onClose: PropTypes.func\n};\n\nexport default SkillPickerModal;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,QAAxB,EAAkCC,WAAlC,QAAoD,OAApD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IACJC,MADI;IAEJC,cAFI;IAGJC,aAHI;IAIJC,MAJI;IAKJC,SALI;IAMJC,iBAAiB,GAAG,CANhB;IAOJC,iBAAiB,GAAG,CAPhB;IAQJC,QARI;IASJC,SATI;IAUJC;EAVI,IAWFX,KAXJ;EAYA,MAAM;IAACY;EAAD,IAAcX,OAApB;EAEA,MAAM,CAACY,iBAAD,EAAoBC,oBAApB,IAA4CxB,QAAQ,CAACa,cAAD,CAA1D;EAEA,MAAMY,YAAY,GAAGxB,WAAW,CAAC,MAAM;IACrCuB,oBAAoB,CAACX,cAAD,CAApB;IACAM,QAAQ;EACT,CAH+B,EAG7B,CAACK,oBAAD,EAAuBX,cAAvB,EAAuCM,QAAvC,CAH6B,CAAhC;EAKA,MAAMO,WAAW,GAAGzB,WAAW,CAAC,MAAM;IACpCuB,oBAAoB,CAACX,cAAD,CAApB;IACAQ,OAAO;EACR,CAH8B,EAG5B,CAACG,oBAAD,EAAuBX,cAAvB,EAAuCQ,OAAvC,CAH4B,CAA/B;EAKA,MAAMM,SAAS,GAAG5B,OAAO,CAAC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R,iBAA9C,CADwB,GAE9B,CAAC,GAAGA,iBAAJ,EAAuBM,KAAK,CAACE,QAA7B,CAFJ;MAGAP,oBAAoB,CAACgC,oBAAD,CAApB;IACD;;IAED,oBACE,oBAAC,IAAD;MACE,IAAI,EAAE1B,UADR;MAEE,QAAQ,EAAEE,KAFZ;MAGE,OAAO,EAAEuB,eAHX;MAIE,GAAG,EAAED,KAJP;MAKE,eAAe,EAAC;IALlB,EADF;EASD,CAlBA,CADH,CAJF,CANJ,CAXF,CADF;AAgDD,CAhID;;AAkIA7C,gBAAgB,CAACiD,YAAjB,GAAgC;EAC9BpC,SAAS,EAAEf,QAAQ,CAACoD,iBAAT,CAA2BrC;AADR,CAAhC;AAIAb,gBAAgB,CAACmD,SAAjB,2CAA6B;EAC3BhD,MAAM,EAAEV,SAAS,CAAC2D,OAAV,CAAkB3D,SAAS,CAAC4D,MAA5B,CADmB;EAE3BjD,cAAc,EAAEX,SAAS,CAAC2D,OAAV,CAAkB3D,SAAS,CAAC4D,MAA5B,CAFW;EAG3BhD,aAAa,EAAEZ,SAAS,CAAC6D,QAAV,CAAmB7D,SAAS,CAAC4D,MAA7B,CAHY;EAI3B/C,MAAM,EAAEb,SAAS,CAAC8D,IAJS;EAK3BhD,SAAS,EAAEd,SAAS,CAAC8D,IALM;EAM3B9C,iBAAiB,EAAEhB,SAAS,CAAC+D,MANF;EAO3BhD,iBAAiB,EAAEf,SAAS,CAAC+D,MAPF;EAQ3B9C,QAAQ,EAAEjB,SAAS,CAACgE,IARO;EAS3B9C,SAAS,EAAElB,SAAS,CAACgE,IATM;EAU3B7C,OAAO,EAAEnB,SAAS,CAACgE;AAVQ,CAA7B;AAaA,eAAezD,gBAAf"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/user-preferences/index.js"],"names":[],"mappings":";AA4CA,0DAeC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/user-preferences/index.js"],"names":[],"mappings":";AA0CA,0DAeC"}
@@ -32,7 +32,7 @@ const Settings = (props, legacyContext) => {
32
32
  tabIndex: 0
33
33
  }, label), isEmpty(description) ? null : /*#__PURE__*/React.createElement(ToolTip, {
34
34
  TooltipContent: description,
35
- closeToolTipInformationTextAriaLabel: translate('Press the escape key to close the information text'),
35
+ closeToolTipInformationTextAriaLabel: translate('close_tooltip_information'),
36
36
  "data-testid": "user-preferences-tooltip",
37
37
  "aria-label": moreInfoAriaLabel,
38
38
  iconContainerClassName: style.infoIconTooltip,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","isEmpty","map","Provider","GetTranslateFromContext","ToolTip","InputSwitch","style","Settings","props","legacyContext","translate","label","description","moreInfoAriaLabel","settings","infoIconTooltip","propTypes","string","isRequired","contextTypes","childContextTypes","UserPreferences","preferences","groupAriaLabel","arrayOf","shape"],"sources":["../../../src/organism/user-preferences/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip from '../../atom/tooltip';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst Settings = (props, legacyContext) => {\n const translate = GetTranslateFromContext(legacyContext);\n const {label, description, moreInfoAriaLabel, ...settings} = props;\n return (\n <div className={style.settings}>\n <InputSwitch {...{...settings, 'aria-label': label}} />\n <span className={style.label} tabIndex={0}>\n {label}\n </span>\n {isEmpty(description) ? null : (\n <ToolTip\n TooltipContent={description}\n closeToolTipInformationTextAriaLabel={translate(\n 'Press the escape key to close the information text'\n )}\n data-testid=\"user-preferences-tooltip\"\n aria-label={moreInfoAriaLabel}\n iconContainerClassName={style.infoIconTooltip}\n fontSize={12}\n />\n )}\n </div>\n );\n};\n\nSettings.propTypes = {\n ...InputSwitch.propTypes,\n label: PropTypes.string.isRequired,\n description: PropTypes.string\n};\n\nSettings.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nconst UserPreferences = props => {\n const {preferences, moreInfoAriaLabel, groupAriaLabel} = props;\n\n return (\n <form>\n <div className={style.preferences} role=\"group\" aria-label={groupAriaLabel} tabIndex={0}>\n {map(\n settings => (\n <Settings {...settings} key={settings.label} moreInfoAriaLabel={moreInfoAriaLabel} />\n ),\n preferences\n )}\n </div>\n </form>\n );\n};\n\nUserPreferences.propTypes = {\n preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes)),\n moreInfoAriaLabel: PropTypes.string,\n groupAriaLabel: PropTypes.string\n};\n\nexport default UserPreferences;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,QAAP,IAAkBC,uBAAlB,QAAgD,qBAAhD;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACzC,MAAMC,SAAS,GAAGP,uBAAuB,CAACM,aAAD,CAAzC;;EACA,MAAM;IAACE,KAAD;IAAQC,WAAR;IAAqBC;EAArB,IAAuDL,KAA7D;EAAA,MAAiDM,QAAjD,iCAA6DN,KAA7D;;EACA,oBACE;IAAK,SAAS,EAAEF,KAAK,CAACQ;EAAtB,gBACE,oBAAC,WAAD,eAAqBA,QAArB;IAA+B,cAAcH;EAA7C,GADF,eAEE;IAAM,SAAS,EAAEL,KAAK,CAACK,KAAvB;IAA8B,QAAQ,EAAE;EAAxC,GACGA,KADH,CAFF,EAKGX,OAAO,CAACY,WAAD,CAAP,GAAuB,IAAvB,gBACC,oBAAC,OAAD;IACE,cAAc,EAAEA,WADlB;IAEE,oCAAoC,EAAEF,SAAS,CAC7C,oDAD6C,CAFjD;IAKE,eAAY,0BALd;IAME,cAAYG,iBANd;IAOE,sBAAsB,EAAEP,KAAK,CAACS,eAPhC;IAQE,QAAQ,EAAE;EARZ,EANJ,CADF;AAoBD,CAvBD;;AAyBAR,QAAQ,CAACS,SAAT,wDACKX,WAAW,CAACW,SADjB;EAEEL,KAAK,EAAEZ,SAAS,CAACkB,MAAV,CAAiBC,UAF1B;EAGEN,WAAW,EAAEb,SAAS,CAACkB;AAHzB;AAMAV,QAAQ,CAACY,YAAT,GAAwB;EACtBT,SAAS,EAAER,QAAQ,CAACkB,iBAAT,CAA2BV;AADhB,CAAxB;;AAIA,MAAMW,eAAe,GAAGb,KAAK,IAAI;EAC/B,MAAM;IAACc,WAAD;IAAcT,iBAAd;IAAiCU;EAAjC,IAAmDf,KAAzD;EAEA,oBACE,+CACE;IAAK,SAAS,EAAEF,KAAK,CAACgB,WAAtB;IAAmC,IAAI,EAAC,OAAxC;IAAgD,cAAYC,cAA5D;IAA4E,QAAQ,EAAE;EAAtF,GACGtB,GAAG,CACFa,QAAQ,iBACN,oBAAC,QAAD,eAAcA,QAAd;IAAwB,GAAG,EAAEA,QAAQ,CAACH,KAAtC;IAA6C,iBAAiB,EAAEE;EAAhE,GAFA,EAIFS,WAJE,CADN,CADF,CADF;AAYD,CAfD;;AAiBAD,eAAe,CAACL,SAAhB,2CAA4B;EAC1BM,WAAW,EAAEvB,SAAS,CAACyB,OAAV,CAAkBzB,SAAS,CAAC0B,KAAV,CAAgBlB,QAAQ,CAACS,SAAzB,CAAlB,CADa;EAE1BH,iBAAiB,EAAEd,SAAS,CAACkB,MAFH;EAG1BM,cAAc,EAAExB,SAAS,CAACkB;AAHA,CAA5B;AAMA,eAAeI,eAAf"}
1
+ {"version":3,"file":"index.js","names":["React","PropTypes","isEmpty","map","Provider","GetTranslateFromContext","ToolTip","InputSwitch","style","Settings","props","legacyContext","translate","label","description","moreInfoAriaLabel","settings","infoIconTooltip","propTypes","string","isRequired","contextTypes","childContextTypes","UserPreferences","preferences","groupAriaLabel","arrayOf","shape"],"sources":["../../../src/organism/user-preferences/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip from '../../atom/tooltip';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst Settings = (props, legacyContext) => {\n const translate = GetTranslateFromContext(legacyContext);\n const {label, description, moreInfoAriaLabel, ...settings} = props;\n return (\n <div className={style.settings}>\n <InputSwitch {...{...settings, 'aria-label': label}} />\n <span className={style.label} tabIndex={0}>\n {label}\n </span>\n {isEmpty(description) ? null : (\n <ToolTip\n TooltipContent={description}\n closeToolTipInformationTextAriaLabel={translate('close_tooltip_information')}\n data-testid=\"user-preferences-tooltip\"\n aria-label={moreInfoAriaLabel}\n iconContainerClassName={style.infoIconTooltip}\n fontSize={12}\n />\n )}\n </div>\n );\n};\n\nSettings.propTypes = {\n ...InputSwitch.propTypes,\n label: PropTypes.string.isRequired,\n description: PropTypes.string\n};\n\nSettings.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nconst UserPreferences = props => {\n const {preferences, moreInfoAriaLabel, groupAriaLabel} = props;\n\n return (\n <form>\n <div className={style.preferences} role=\"group\" aria-label={groupAriaLabel} tabIndex={0}>\n {map(\n settings => (\n <Settings {...settings} key={settings.label} moreInfoAriaLabel={moreInfoAriaLabel} />\n ),\n preferences\n )}\n </div>\n </form>\n );\n};\n\nUserPreferences.propTypes = {\n preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes)),\n moreInfoAriaLabel: PropTypes.string,\n groupAriaLabel: PropTypes.string\n};\n\nexport default UserPreferences;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,GAAP,MAAgB,eAAh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,KAAK,CAACgB,WAAtB;IAAmC,IAAI,EAAC,OAAxC;IAAgD,cAAYC,cAA5D;IAA4E,QAAQ,EAAE;EAAtF,GACGtB,GAAG,CACFa,QAAQ,iBACN,oBAAC,QAAD,eAAcA,QAAd;IAAwB,GAAG,EAAEA,QAAQ,CAACH,KAAtC;IAA6C,iBAAiB,EAAEE;EAAhE,GAFA,EAIFS,WAJE,CADN,CADF,CADF;AAYD,CAfD;;AAiBAD,eAAe,CAACL,SAAhB,2CAA4B;EAC1BM,WAAW,EAAEvB,SAAS,CAACyB,OAAV,CAAkBzB,SAAS,CAAC0B,KAAV,CAAgBlB,QAAQ,CAACS,SAAzB,CAAlB,CADa;EAE1BH,iBAAiB,EAAEd,SAAS,CAACkB,MAFH;EAG1BM,cAAc,EAAExB,SAAS,CAACkB;AAHA,CAA5B;AAMA,eAAeI,eAAf"}
@@ -1 +1 @@
1
- {"version":3,"file":"engine-stars.d.ts","sourceRoot":"","sources":["../../../src/template/activity/engine-stars.js"],"names":[],"mappings":";AAuEA,0EA8IC"}
1
+ {"version":3,"file":"engine-stars.d.ts","sourceRoot":"","sources":["../../../src/template/activity/engine-stars.js"],"names":[],"mappings":";AAuEA,0EA4IC"}
@@ -108,7 +108,7 @@ const EngineStars = (props, legacyContext) => {
108
108
  onClick: toolTip.onClick
109
109
  } : null, [primary, toolTip]);
110
110
  const toolTipProps = {
111
- closeToolTipInformationTextAriaLabel: translate('Press the escape key to close the information text')
111
+ closeToolTipInformationTextAriaLabel: translate('close_tooltip_information')
112
112
  };
113
113
  const TooltipContent = useCallback(_props => /*#__PURE__*/React.createElement(ToolTipContent, _extends({}, _extends({}, toolTipContentProps, _props), {
114
114
  handleContentMouseOver: handleContentMouseOver
@@ -1 +1 @@
1
- {"version":3,"file":"engine-stars.js","names":["classnames","React","useCallback","useMemo","useState","useRef","PropTypes","v5","uuidV5","NovaCompositionCoorpacademyStar","StarIcon","NovaCompositionCoorpacademyTimer","TimerIcon","NovaCompositionCoorpacademyBolt","BoltIcon","NovaSolidSchoolScienceGraduationHat","CertificationIcon","NovaSolidContentContentBook1","LearnerIcon","NovaSolidVoteRewardsRewardsBadge1","BonusIcon","NovaCompositionCoorpacademyScorm","ScormIcon","NovaCompositionCoorpacademyArticle","ArticleIcon","NovaCompositionCoorpacademyVideo","VideoIcon","NovaCompositionCoorpacademyMicrophone","PodcastIcon","NovaCompositionCoorpacademyRevision","RevisionIcon","Provider","GetSkinFromContext","GetTranslateFromContext","ToolTip","toggleStateOnKeyPress","Link","style","ICONS","microlearning","learner","battle","certifications","bonus","article","scorm","video","podcast","review","ToolTipContent","preMessage","linkMessage","endMessage","onClick","color","handleContentMouseOver","toolTipContent","propTypes","string","func","EngineStars","props","legacyContext","skin","translate","toolTip","disabled","type","stars","title","active","className","handleClick","e","stopPropagation","preventDefault","dark","light","IconType","primary","engineStarsContentId","URL","undefined","toolTipIsVisible","setToolTipIsVisible","mouseLeaveTimer","setMouseLeaveTimer","buttonRef","handleKeyPress","event","handleMouseOver","clearTimeout","handleMouseLeave","setTimeout","toolTipContentProps","toolTipProps","closeToolTipInformationTextAriaLabel","TooltipContent","_props","engineStars","clickable","engineIcon","backgroundColor","iconHeader","score","iconStar","scoreTitle","isRequired","number","bool","shape","contextTypes","childContextTypes"],"sources":["../../../src/template/activity/engine-stars.js"],"sourcesContent":["import classnames from 'classnames';\nimport React, {useCallback, useMemo, useState, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, noop} from 'lodash/fp';\nimport {v5 as uuidV5} from 'uuid';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon,\n NovaCompositionCoorpacademyBolt as BoltIcon,\n NovaSolidSchoolScienceGraduationHat as CertificationIcon,\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaSolidVoteRewardsRewardsBadge1 as BonusIcon,\n NovaCompositionCoorpacademyScorm as ScormIcon,\n NovaCompositionCoorpacademyArticle as ArticleIcon,\n NovaCompositionCoorpacademyVideo as VideoIcon,\n NovaCompositionCoorpacademyMicrophone as PodcastIcon,\n NovaCompositionCoorpacademyRevision as RevisionIcon\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext, GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip, {toggleStateOnKeyPress} from '../../atom/tooltip';\nimport Link from '../../atom/link';\nimport style from './engine-stars.css';\n\nconst ICONS = {\n microlearning: TimerIcon,\n learner: LearnerIcon,\n battle: BoltIcon,\n certifications: CertificationIcon,\n bonus: BonusIcon,\n article: ArticleIcon,\n scorm: ScormIcon,\n video: VideoIcon,\n podcast: PodcastIcon,\n review: RevisionIcon\n};\n\nconst ToolTipContent = ({\n preMessage,\n linkMessage,\n endMessage,\n onClick,\n color,\n handleContentMouseOver\n}) => (\n <p\n className={style.toolTipContent}\n onMouseOver={handleContentMouseOver}\n data-testid=\"react-tooltip-content\"\n >\n <span>{preMessage}</span>\n <Link\n onClick={onClick}\n style={{\n color\n }}\n >\n {linkMessage}\n </Link>\n <span>{endMessage}</span>\n </p>\n);\n\nToolTipContent.propTypes = {\n preMessage: PropTypes.string,\n linkMessage: PropTypes.string,\n endMessage: PropTypes.string,\n color: PropTypes.string,\n onClick: PropTypes.func,\n handleContentMouseOver: PropTypes.func\n};\n\nconst EngineStars = (props, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const translate = GetTranslateFromContext(legacyContext);\n const {\n toolTip = null,\n disabled,\n type,\n stars,\n title,\n active = false,\n onClick = noop,\n className\n } = props;\n\n const handleClick = e => {\n e.stopPropagation();\n e.preventDefault();\n onClick(e);\n };\n const dark = get('common.dark', skin);\n const light = get('common.light', skin);\n const IconType = ICONS[type];\n\n const primary = get('common.primary', skin);\n\n // to replace by useId when React17 is bumped to React18\n const [engineStarsContentId] = useState(\n disabled ? uuidV5('engine-stars', uuidV5.URL) : undefined\n );\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n const buttonRef = useRef(null);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleContentMouseOver = useCallback(() => {\n mouseLeaveTimer && /* istanbul ignore next */ clearTimeout(mouseLeaveTimer);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(setTimeout(() => setToolTipIsVisible(false), 500));\n }, []);\n\n const toolTipContentProps = useMemo(\n () =>\n toolTip\n ? {\n preMessage: toolTip.preMessage,\n linkMessage: toolTip.linkMessage,\n endMessage: toolTip.endMessage,\n color: primary,\n onClick: toolTip.onClick\n }\n : null,\n [primary, toolTip]\n );\n\n const toolTipProps = {\n closeToolTipInformationTextAriaLabel: translate(\n 'Press the escape key to close the information text'\n )\n };\n\n const TooltipContent = useCallback(\n _props => (\n <ToolTipContent\n {...{...toolTipContentProps, ..._props}}\n handleContentMouseOver={handleContentMouseOver}\n />\n ),\n [handleContentMouseOver, toolTipContentProps]\n );\n\n return (\n <button\n ref={buttonRef}\n data-tip={disabled}\n data-engine={type}\n data-testid={`engine-stars-${type}`}\n // eslint-disable-next-line no-nested-ternary\n onClick={disabled ? handleKeyPress : active ? noop : handleClick}\n data-for={engineStarsContentId}\n className={classnames([\n style.engineStars,\n disabled ? style.disabled : '',\n active ? style.active : '',\n onClick !== noop ? style.clickable : null,\n className\n ])}\n type=\"button\"\n data-tooltip-place=\"left\"\n onKeyDown={handleKeyPress}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n aria-label={`${title} - ${stars} ${translate('stars')}`}\n >\n {disabled ? (\n <ToolTip\n {...toolTipProps}\n anchorId={engineStarsContentId}\n toolTipIsVisible={toolTipIsVisible}\n TooltipContent={TooltipContent}\n mouseLeaveTimer={mouseLeaveTimer}\n />\n ) : null}\n <span\n className={style.engineIcon}\n style={{\n backgroundColor: onClick === noop ? light : primary\n }}\n >\n <IconType className={style.iconHeader} width=\"30\" />\n </span>\n <div\n className={style.score}\n style={{\n color: active ? primary : dark\n }}\n >\n <p data-name=\"star-counter\">{stars}</p>\n <span>\n <StarIcon\n className={style.iconStar}\n style={{\n color: active ? primary : dark\n }}\n />\n </span>\n </div>\n <div className={style.scoreTitle}>{title}</div>\n </button>\n );\n};\n\nEngineStars.propTypes = {\n type: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired,\n title: PropTypes.string.isRequired,\n active: PropTypes.bool,\n disabled: PropTypes.bool,\n onClick: PropTypes.func,\n className: PropTypes.string,\n toolTip: PropTypes.shape({\n preMessage: PropTypes.string,\n linkMessage: PropTypes.string,\n endMessage: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nEngineStars.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nexport default EngineStars;\n"],"mappings":";;;;;AAAA,OAAOA,UAAP,MAAuB,YAAvB;AACA,OAAOC,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,EAAqCC,QAArC,EAA+CC,MAA/C,QAA4D,OAA5D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,EAAE,IAAIC,MAAd,QAA2B,MAA3B;AACA,SACEC,+BAA+B,IAAIC,QADrC,EAEEC,gCAAgC,IAAIC,SAFtC,EAGEC,+BAA+B,IAAIC,QAHrC,EAIEC,mCAAmC,IAAIC,iBAJzC,EAKEC,4BAA4B,IAAIC,WALlC,EAMEC,iCAAiC,IAAIC,SANvC,EAOEC,gCAAgC,IAAIC,SAPtC,EAQEC,kCAAkC,IAAIC,WARxC,EASEC,gCAAgC,IAAIC,SATtC,EAUEC,qCAAqC,IAAIC,WAV3C,EAWEC,mCAAmC,IAAIC,YAXzC,QAYO,0BAZP;AAaA,OAAOC,QAAP,IAAkBC,kBA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AAEvC,KAAK,CAACqE;EAAtB,GAAmCrC,KAAnC,CAvDF,CADF;AA2DD,CA9ID;;AAgJAT,WAAW,CAACH,SAAZ,2CAAwB;EACtBU,IAAI,EAAE7D,SAAS,CAACoD,MAAV,CAAiBiD,UADD;EAEtBvC,KAAK,EAAE9D,SAAS,CAACsG,MAAV,CAAiBD,UAFF;EAGtBtC,KAAK,EAAE/D,SAAS,CAACoD,MAAV,CAAiBiD,UAHF;EAItBrC,MAAM,EAAEhE,SAAS,CAACuG,IAJI;EAKtB3C,QAAQ,EAAE5D,SAAS,CAACuG,IALE;EAMtBxD,OAAO,EAAE/C,SAAS,CAACqD,IANG;EAOtBY,SAAS,EAAEjE,SAAS,CAACoD,MAPC;EAQtBO,OAAO,EAAE3D,SAAS,CAACwG,KAAV,CAAgB;IACvB5D,UAAU,EAAE5C,SAAS,CAACoD,MADC;IAEvBP,WAAW,EAAE7C,SAAS,CAACoD,MAFA;IAGvBN,UAAU,EAAE9C,SAAS,CAACoD,MAHC;IAIvBL,OAAO,EAAE/C,SAAS,CAACqD;EAJI,CAAhB;AARa,CAAxB;AAgBAC,WAAW,CAACmD,YAAZ,GAA2B;EACzBhD,IAAI,EAAEhC,QAAQ,CAACiF,iBAAT,CAA2BjD,IADR;EAEzBC,SAAS,EAAEjC,QAAQ,CAACiF,iBAAT,CAA2BhD;AAFb,CAA3B;AAKA,eAAeJ,WAAf"}
1
+ {"version":3,"file":"engine-stars.js","names":["classnames","React","useCallback","useMemo","useState","useRef","PropTypes","v5","uuidV5","NovaCompositionCoorpacademyStar","StarIcon","NovaCompositionCoorpacademyTimer","TimerIcon","NovaCompositionCoorpacademyBolt","BoltIcon","NovaSolidSchoolScienceGraduationHat","CertificationIcon","NovaSolidContentContentBook1","LearnerIcon","NovaSolidVoteRewardsRewardsBadge1","BonusIcon","NovaCompositionCoorpacademyScorm","ScormIcon","NovaCompositionCoorpacademyArticle","ArticleIcon","NovaCompositionCoorpacademyVideo","VideoIcon","NovaCompositionCoorpacademyMicrophone","PodcastIcon","NovaCompositionCoorpacademyRevision","RevisionIcon","Provider","GetSkinFromContext","GetTranslateFromContext","ToolTip","toggleStateOnKeyPress","Link","style","ICONS","microlearning","learner","battle","certifications","bonus","article","scorm","video","podcast","review","ToolTipContent","preMessage","linkMessage","endMessage","onClick","color","handleContentMouseOver","toolTipContent","propTypes","string","func","EngineStars","props","legacyContext","skin","translate","toolTip","disabled","type","stars","title","active","className","handleClick","e","stopPropagation","preventDefault","dark","light","IconType","primary","engineStarsContentId","URL","undefined","toolTipIsVisible","setToolTipIsVisible","mouseLeaveTimer","setMouseLeaveTimer","buttonRef","handleKeyPress","event","handleMouseOver","clearTimeout","handleMouseLeave","setTimeout","toolTipContentProps","toolTipProps","closeToolTipInformationTextAriaLabel","TooltipContent","_props","engineStars","clickable","engineIcon","backgroundColor","iconHeader","score","iconStar","scoreTitle","isRequired","number","bool","shape","contextTypes","childContextTypes"],"sources":["../../../src/template/activity/engine-stars.js"],"sourcesContent":["import classnames from 'classnames';\nimport React, {useCallback, useMemo, useState, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {get, noop} from 'lodash/fp';\nimport {v5 as uuidV5} from 'uuid';\nimport {\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaCompositionCoorpacademyTimer as TimerIcon,\n NovaCompositionCoorpacademyBolt as BoltIcon,\n NovaSolidSchoolScienceGraduationHat as CertificationIcon,\n NovaSolidContentContentBook1 as LearnerIcon,\n NovaSolidVoteRewardsRewardsBadge1 as BonusIcon,\n NovaCompositionCoorpacademyScorm as ScormIcon,\n NovaCompositionCoorpacademyArticle as ArticleIcon,\n NovaCompositionCoorpacademyVideo as VideoIcon,\n NovaCompositionCoorpacademyMicrophone as PodcastIcon,\n NovaCompositionCoorpacademyRevision as RevisionIcon\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext, GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip, {toggleStateOnKeyPress} from '../../atom/tooltip';\nimport Link from '../../atom/link';\nimport style from './engine-stars.css';\n\nconst ICONS = {\n microlearning: TimerIcon,\n learner: LearnerIcon,\n battle: BoltIcon,\n certifications: CertificationIcon,\n bonus: BonusIcon,\n article: ArticleIcon,\n scorm: ScormIcon,\n video: VideoIcon,\n podcast: PodcastIcon,\n review: RevisionIcon\n};\n\nconst ToolTipContent = ({\n preMessage,\n linkMessage,\n endMessage,\n onClick,\n color,\n handleContentMouseOver\n}) => (\n <p\n className={style.toolTipContent}\n onMouseOver={handleContentMouseOver}\n data-testid=\"react-tooltip-content\"\n >\n <span>{preMessage}</span>\n <Link\n onClick={onClick}\n style={{\n color\n }}\n >\n {linkMessage}\n </Link>\n <span>{endMessage}</span>\n </p>\n);\n\nToolTipContent.propTypes = {\n preMessage: PropTypes.string,\n linkMessage: PropTypes.string,\n endMessage: PropTypes.string,\n color: PropTypes.string,\n onClick: PropTypes.func,\n handleContentMouseOver: PropTypes.func\n};\n\nconst EngineStars = (props, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const translate = GetTranslateFromContext(legacyContext);\n const {\n toolTip = null,\n disabled,\n type,\n stars,\n title,\n active = false,\n onClick = noop,\n className\n } = props;\n\n const handleClick = e => {\n e.stopPropagation();\n e.preventDefault();\n onClick(e);\n };\n const dark = get('common.dark', skin);\n const light = get('common.light', skin);\n const IconType = ICONS[type];\n\n const primary = get('common.primary', skin);\n\n // to replace by useId when React17 is bumped to React18\n const [engineStarsContentId] = useState(\n disabled ? uuidV5('engine-stars', uuidV5.URL) : undefined\n );\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n const buttonRef = useRef(null);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleContentMouseOver = useCallback(() => {\n mouseLeaveTimer && /* istanbul ignore next */ clearTimeout(mouseLeaveTimer);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(setTimeout(() => setToolTipIsVisible(false), 500));\n }, []);\n\n const toolTipContentProps = useMemo(\n () =>\n toolTip\n ? {\n preMessage: toolTip.preMessage,\n linkMessage: toolTip.linkMessage,\n endMessage: toolTip.endMessage,\n color: primary,\n onClick: toolTip.onClick\n }\n : null,\n [primary, toolTip]\n );\n\n const toolTipProps = {\n closeToolTipInformationTextAriaLabel: translate('close_tooltip_information')\n };\n\n const TooltipContent = useCallback(\n _props => (\n <ToolTipContent\n {...{...toolTipContentProps, ..._props}}\n handleContentMouseOver={handleContentMouseOver}\n />\n ),\n [handleContentMouseOver, toolTipContentProps]\n );\n\n return (\n <button\n ref={buttonRef}\n data-tip={disabled}\n data-engine={type}\n data-testid={`engine-stars-${type}`}\n // eslint-disable-next-line no-nested-ternary\n onClick={disabled ? handleKeyPress : active ? noop : handleClick}\n data-for={engineStarsContentId}\n className={classnames([\n style.engineStars,\n disabled ? style.disabled : '',\n active ? style.active : '',\n onClick !== noop ? style.clickable : null,\n className\n ])}\n type=\"button\"\n data-tooltip-place=\"left\"\n onKeyDown={handleKeyPress}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n aria-label={`${title} - ${stars} ${translate('stars')}`}\n >\n {disabled ? (\n <ToolTip\n {...toolTipProps}\n anchorId={engineStarsContentId}\n toolTipIsVisible={toolTipIsVisible}\n TooltipContent={TooltipContent}\n mouseLeaveTimer={mouseLeaveTimer}\n />\n ) : null}\n <span\n className={style.engineIcon}\n style={{\n backgroundColor: onClick === noop ? light : primary\n }}\n >\n <IconType className={style.iconHeader} width=\"30\" />\n </span>\n <div\n className={style.score}\n style={{\n color: active ? primary : dark\n }}\n >\n <p data-name=\"star-counter\">{stars}</p>\n <span>\n <StarIcon\n className={style.iconStar}\n style={{\n color: active ? primary : dark\n }}\n />\n </span>\n </div>\n <div className={style.scoreTitle}>{title}</div>\n </button>\n );\n};\n\nEngineStars.propTypes = {\n type: PropTypes.string.isRequired,\n stars: PropTypes.number.isRequired,\n title: PropTypes.string.isRequired,\n active: PropTypes.bool,\n disabled: PropTypes.bool,\n onClick: PropTypes.func,\n className: PropTypes.string,\n toolTip: PropTypes.shape({\n preMessage: PropTypes.string,\n linkMessage: PropTypes.string,\n endMessage: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nEngineStars.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nexport default EngineStars;\n"],"mappings":";;;;;AAAA,OAAOA,UAAP,MAAuB,YAAvB;AACA,OAAOC,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,EAAqCC,QAArC,EAA+CC,MAA/C,QAA4D,OAA5D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,EAAE,IAAIC,MAAd,QAA2B,MAA3B;AACA,SACEC,+BAA+B,IAAIC,QADrC,EAEEC,gCAAgC,IAAIC,SAFtC,EAGEC,+BAA+B,IAAIC,QAHrC,EAIEC,mCAAmC,IAAIC,iBAJzC,EAKEC,4BAA4B,IAAIC,WALlC,EAMEC,iCAAiC,IAAIC,SANvC,EAOEC,gCAAgC,IAAIC,SAPtC,EAQEC,kCAAkC,IAAIC,WARxC,EASEC,gCAAgC,IAAIC,SATtC,EAUEC,qCAAqC,IAAIC,WAV3C,EAWEC,mCAAmC,IAAIC,YAXzC,QAYO,0BAZP;AAaA,OAAOC,QAAP,IAAkBC,kBAAlB,EAAsCC,uBAAtC,QAAoE,qBAApE;AACA,OAAOC,OAAP,IAAiBC,qBAAjB,QAA6C,oBAA7C;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,KAAP,MAAkB,oBAAlB;AAEA,MAAMC,KAAK,GAAG;EACZC,aAAa,EAAE3B,SADH;EAEZ4B,OAAO,E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GtBtC,KAAK,EAAE/D,SAAS,CAACoD,MAAV,CAAiBiD,UAHF;EAItBrC,MAAM,EAAEhE,SAAS,CAACuG,IAJI;EAKtB3C,QAAQ,EAAE5D,SAAS,CAACuG,IALE;EAMtBxD,OAAO,EAAE/C,SAAS,CAACqD,IANG;EAOtBY,SAAS,EAAEjE,SAAS,CAACoD,MAPC;EAQtBO,OAAO,EAAE3D,SAAS,CAACwG,KAAV,CAAgB;IACvB5D,UAAU,EAAE5C,SAAS,CAACoD,MADC;IAEvBP,WAAW,EAAE7C,SAAS,CAACoD,MAFA;IAGvBN,UAAU,EAAE9C,SAAS,CAACoD,MAHC;IAIvBL,OAAO,EAAE/C,SAAS,CAACqD;EAJI,CAAhB;AARa,CAAxB;AAgBAC,WAAW,CAACmD,YAAZ,GAA2B;EACzBhD,IAAI,EAAEhC,QAAQ,CAACiF,iBAAT,CAA2BjD,IADR;EAEzBC,SAAS,EAAEjC,QAAQ,CAACiF,iBAAT,CAA2BhD;AAFb,CAA3B;AAKA,eAAeJ,WAAf"}
@@ -117,6 +117,12 @@ declare namespace Discipline {
117
117
  const shareText: PropTypes.Requireable<string>;
118
118
  const shareSuccessWording: PropTypes.Requireable<string>;
119
119
  const shareErrorWording: PropTypes.Requireable<string>;
120
+ const skills: PropTypes.Requireable<(PropTypes.InferProps<{
121
+ ref: PropTypes.Requireable<string>;
122
+ locale: PropTypes.Requireable<string>;
123
+ focused: PropTypes.Requireable<boolean>;
124
+ }> | null | undefined)[]>;
125
+ const onSkillClick: PropTypes.Requireable<(...args: any[]) => any>;
120
126
  const addToMyListText: PropTypes.Requireable<string>;
121
127
  const removeFromMyListText: PropTypes.Requireable<string>;
122
128
  const addToMyListButton: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/discipline/index.js"],"names":[],"mappings":";AAcA,mEA+JC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/discipline/index.js"],"names":[],"mappings":";AAeA,mEAmKC"}
@@ -5,6 +5,7 @@ import DisciplineCTA from '../../../molecule/discipline-cta';
5
5
  import DisciplineHeader from '../../../molecule/discipline-header';
6
6
  import DisciplinePartners from '../../../molecule/discipline-partners';
7
7
  import DisciplineScope from '../../../molecule/discipline-scope';
8
+ import DisciplineAssociatedSkills from '../../../molecule/discipline-associated-skills';
8
9
  import Share, { ShareFeedback, ShareStatusProvider } from '../../../molecule/share';
9
10
  import AddToMyList, { AddToMyListFeedback, AddToMyListStatusProvider } from '../../../molecule/add-to-my-list';
10
11
  import style from './style.css';
@@ -23,6 +24,8 @@ const Discipline = (props, context) => {
23
24
  start,
24
25
  buy,
25
26
  startLabel,
27
+ skills = [],
28
+ onSkillClick,
26
29
  buyLabel,
27
30
  shareWording,
28
31
  shareText,
@@ -89,7 +92,10 @@ const Discipline = (props, context) => {
89
92
  wording: shareWording,
90
93
  text: shareText,
91
94
  key: 'shareTablet'
92
- })), authorSection), disciplineContent), /*#__PURE__*/React.createElement("div", {
95
+ })), /*#__PURE__*/React.createElement(DisciplineAssociatedSkills, {
96
+ skills: skills,
97
+ onSkillClick: onSkillClick
98
+ }), authorSection), disciplineContent), /*#__PURE__*/React.createElement("div", {
93
99
  className: style.rightSection
94
100
  }, /*#__PURE__*/React.createElement("div", {
95
101
  className: style.stickySection
@@ -108,7 +114,10 @@ const Discipline = (props, context) => {
108
114
  favorite: favorite,
109
115
  onFavoriteClick: onFavoriteClick,
110
116
  key: 'addToMyListDesktop'
111
- }))), authorSection)));
117
+ }))), /*#__PURE__*/React.createElement(DisciplineAssociatedSkills, {
118
+ skills: skills,
119
+ onSkillClick: onSkillClick
120
+ }), authorSection)));
112
121
  const shareFeedBack = disableShare ? null : /*#__PURE__*/React.createElement(ShareFeedback, {
113
122
  errorWording: shareErrorWording,
114
123
  successWording: shareSuccessWording,
@@ -142,6 +151,12 @@ Discipline.propTypes = process.env.NODE_ENV !== "production" ? {
142
151
  shareText: Share.propTypes.text,
143
152
  shareSuccessWording: ShareFeedback.propTypes.successWording,
144
153
  shareErrorWording: ShareFeedback.propTypes.errorWording,
154
+ skills: PropTypes.arrayOf(PropTypes.shape({
155
+ ref: PropTypes.string,
156
+ locale: PropTypes.string,
157
+ focused: PropTypes.bool
158
+ })),
159
+ onSkillClick: PropTypes.func,
145
160
  addToMyListText: AddToMyListFeedback.propTypes.addToMyListText,
146
161
  removeFromMyListText: AddToMyListFeedback.propTypes.removeFromMyListText,
147
162
  addToMyListButton: AddToMyList.propTypes.addToMyListButton,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","isEmpty","PropTypes","DisciplineCTA","DisciplineHeader","DisciplinePartners","DisciplineScope","Share","ShareFeedback","ShareStatusProvider","AddToMyList","AddToMyListFeedback","AddToMyListStatusProvider","style","Discipline","props","context","selected","level","levels","changeLevel","image","title","video","authors","description","start","buy","startLabel","buyLabel","shareWording","shareText","shareSuccessWording","shareErrorWording","addToMyListButton","favorite","onFavoriteClick","addToMyListText","removeFromMyListText","disableShare","disableAddToMyList","lastUpdated","authorSection","partners","disciplineCTA","disciplineContent","content","disciplineHeader","header","discipline","container","leftSection","mobileAuthorCtaSection","columnReverse","cta","addToMyListBtn","shareBtn","rightSection","stickySection","buttons","shareFeedBack","addToMyListFeedback","addToMyListProviderWrap","shareProviderWrap","propTypes","onClick","wording","text","successWording","errorWording","bool","contextTypes","translate","func"],"sources":["../../../../src/template/common/discipline/index.js"],"sourcesContent":["import React from 'react';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport PropTypes from 'prop-types';\nimport DisciplineCTA from '../../../molecule/discipline-cta';\nimport DisciplineHeader from '../../../molecule/discipline-header';\nimport DisciplinePartners from '../../../molecule/discipline-partners';\nimport DisciplineScope from '../../../molecule/discipline-scope';\nimport Share, {ShareFeedback, ShareStatusProvider} from '../../../molecule/share';\nimport AddToMyList, {\n AddToMyListFeedback,\n AddToMyListStatusProvider\n} from '../../../molecule/add-to-my-list';\nimport style from './style.css';\n\nconst Discipline = (props, context) => {\n const {\n selected = 0,\n level,\n levels,\n changeLevel,\n image,\n title = '',\n video,\n authors = [],\n description = '',\n start,\n buy,\n startLabel,\n buyLabel,\n shareWording,\n shareText,\n shareSuccessWording,\n shareErrorWording,\n addToMyListButton,\n favorite,\n onFavoriteClick,\n addToMyListText,\n removeFromMyListText,\n disableShare = false,\n disableAddToMyList = false,\n lastUpdated\n } = props;\n\n const authorSection = isEmpty(authors) ? null : (\n <div className={style.partners}>\n <DisciplinePartners authors={authors} />\n </div>\n );\n\n const disciplineCTA = (\n <DisciplineCTA\n type={'discipline'}\n start={start}\n buy={buy}\n startLabel={startLabel}\n buyLabel={buyLabel}\n />\n );\n\n const disciplineContent = (\n <div className={style.content}>\n <DisciplineScope content={level} levels={levels} selected={selected} onClick={changeLevel} />\n </div>\n );\n\n const disciplineHeader = (\n <div className={style.header}>\n <DisciplineHeader\n image={image}\n video={video}\n title={title}\n description={description}\n lastUpdated={lastUpdated}\n />\n </div>\n );\n\n const discipline = (\n <div data-name=\"discipline\" className={style.container} key=\"discipline\">\n <div className={style.leftSection}>\n {disciplineHeader}\n <div className={style.mobileAuthorCtaSection}>\n <div className={style.columnReverse}>\n <div className={style.cta}>{disciplineCTA}</div>\n {disableAddToMyList ? null : (\n <AddToMyList\n style={style.addToMyListBtn}\n addToMyListButton={addToMyListButton}\n favorite={favorite}\n onFavoriteClick={onFavoriteClick}\n key={'addToMyListTablet'}\n />\n )}\n {disableShare ? null : (\n <Share\n style={style.shareBtn}\n wording={shareWording}\n text={shareText}\n key={'shareTablet'}\n />\n )}\n </div>\n {authorSection}\n </div>\n {disciplineContent}\n </div>\n <div className={style.rightSection}>\n <div className={style.stickySection}>\n <div className={style.cta}>\n {disciplineCTA}\n {disableShare && disableAddToMyList ? null : (\n <div className={style.buttons}>\n {disableShare ? null : (\n <Share\n style={style.shareBtn}\n wording={shareWording}\n text={shareText}\n key={'shareDesktop'}\n />\n )}\n {disableAddToMyList ? null : (\n <AddToMyList\n style={style.addToMyListBtn}\n addToMyListButton={addToMyListButton}\n favorite={favorite}\n onFavoriteClick={onFavoriteClick}\n key={'addToMyListDesktop'}\n />\n )}\n </div>\n )}\n </div>\n {authorSection}\n </div>\n </div>\n </div>\n );\n\n const shareFeedBack = disableShare ? null : (\n <ShareFeedback\n errorWording={shareErrorWording}\n successWording={shareSuccessWording}\n key=\"shareFeedBack\"\n />\n );\n\n const addToMyListFeedback = disableAddToMyList ? null : (\n <AddToMyListFeedback\n addToMyListText={addToMyListText}\n removeFromMyListText={removeFromMyListText}\n favorite={favorite}\n />\n );\n\n const addToMyListProviderWrap = disableAddToMyList ? (\n <>\n {shareFeedBack}\n {discipline}\n </>\n ) : (\n <AddToMyListStatusProvider>\n {shareFeedBack}\n {addToMyListFeedback}\n {discipline}\n </AddToMyListStatusProvider>\n );\n const shareProviderWrap = disableShare ? (\n addToMyListProviderWrap\n ) : (\n <ShareStatusProvider>{addToMyListProviderWrap}</ShareStatusProvider>\n );\n\n return shareProviderWrap;\n};\n\nDiscipline.propTypes = {\n image: DisciplineHeader.propTypes.image,\n video: DisciplineHeader.propTypes.video,\n title: DisciplineHeader.propTypes.title,\n description: DisciplineHeader.propTypes.description,\n start: DisciplineCTA.propTypes.start,\n buy: DisciplineCTA.propTypes.buy,\n startLabel: DisciplineCTA.propTypes.startLabel,\n buyLabel: DisciplineCTA.propTypes.buyLabel,\n authors: DisciplinePartners.propTypes.authors,\n level: DisciplineScope.propTypes.content,\n levels: DisciplineScope.propTypes.levels,\n selected: DisciplineScope.propTypes.selected,\n changeLevel: DisciplineScope.propTypes.onClick,\n shareWording: Share.propTypes.wording,\n shareText: Share.propTypes.text,\n shareSuccessWording: ShareFeedback.propTypes.successWording,\n shareErrorWording: ShareFeedback.propTypes.errorWording,\n addToMyListText: AddToMyListFeedback.propTypes.addToMyListText,\n removeFromMyListText: AddToMyListFeedback.propTypes.removeFromMyListText,\n addToMyListButton: AddToMyList.propTypes.addToMyListButton,\n onFavoriteClick: AddToMyList.propTypes.onFavoriteClick,\n favorite: AddToMyList.propTypes.favorite,\n disableShare: PropTypes.bool,\n disableAddToMyList: PropTypes.bool\n};\n\nDiscipline.contextTypes = {\n translate: PropTypes.func\n};\n\nexport default Discipline;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,aAAP,MAA0B,kCAA1B;AACA,OAAOC,gBAAP,MAA6B,qCAA7B;AACA,OAAOC,kBAAP,MAA+B,uCAA/B;AACA,OAAOC,eAAP,MAA4B,oCAA5B;AACA,OAAOC,KAAP,IAAeC,aAAf,EAA8BC,mBAA9B,QAAwD,yBAAxD;AACA,OAAOC,WAAP,IACEC,mBADF,EAEEC,yBAFF,QAGO,kCAHP;AAIA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,UAAU,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACrC,MAAM;IACJC,QAAQ,GAAG,CADP;IAEJC,KAFI;IAGJC,MAHI;IAIJC,WAJI;IAKJC,KALI;IAMJC,KAAK,GAAG,EANJ;IAOJC,KAPI;IAQJC,OAAO,GAAG,EARN;IASJC,WAAW,GAAG,EATV;IAUJC,KAVI;IAWJC,GAXI;IAYJC,UAZI;IAaJC,QAbI;IAcJC,YAdI;IAeJC,SAfI;IAgBJC,mBAhBI;IAiBJC,iBAjBI;IAkBJC,iBAlBI;IAmBJC,QAnBI;IAoBJC,eApBI;IAqBJC,eArBI;IAsBJC,oBAtBI;IAuBJC,YAAY,GAAG,KAvBX;IAwBJC,kBAAkB,GAAG,KAxBjB;IAyBJC;EAzBI,IA0BF1B,KA1BJ;EA4BA,MAAM2B,aAAa,GAAGzC,OAAO,CAACuB,OAAD,CAAP,GAAmB,IAAnB,gBACpB;IAAK,SAAS,EAAEX,KAAK,CAAC8B;EAAtB,gBACE,oBAAC,kBAAD;IAAoB,OAAO,EAAEnB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BAAmB,CAACqD,SAApB,CAA8B3B,eAlB1B;EAmBrBC,oBAAoB,EAAE3B,mBAAmB,CAACqD,SAApB,CAA8B1B,oBAnB/B;EAoBrBJ,iBAAiB,EAAExB,WAAW,CAACsD,SAAZ,CAAsB9B,iBApBpB;EAqBrBE,eAAe,EAAE1B,WAAW,CAACsD,SAAZ,CAAsB5B,eArBlB;EAsBrBD,QAAQ,EAAEzB,WAAW,CAACsD,SAAZ,CAAsB7B,QAtBX;EAuBrBI,YAAY,EAAErC,SAAS,CAACoE,IAvBH;EAwBrB9B,kBAAkB,EAAEtC,SAAS,CAACoE;AAxBT,CAAvB;AA2BAxD,UAAU,CAACyD,YAAX,GAA0B;EACxBC,SAAS,EAAEtE,SAAS,CAACuE;AADG,CAA1B;AAIA,eAAe3D,UAAf"}
1
+ {"version":3,"file":"index.js","names":["React","isEmpty","PropTypes","DisciplineCTA","DisciplineHeader","DisciplinePartners","DisciplineScope","DisciplineAssociatedSkills","Share","ShareFeedback","ShareStatusProvider","AddToMyList","AddToMyListFeedback","AddToMyListStatusProvider","style","Discipline","props","context","selected","level","levels","changeLevel","image","title","video","authors","description","start","buy","startLabel","skills","onSkillClick","buyLabel","shareWording","shareText","shareSuccessWording","shareErrorWording","addToMyListButton","favorite","onFavoriteClick","addToMyListText","removeFromMyListText","disableShare","disableAddToMyList","lastUpdated","authorSection","partners","disciplineCTA","disciplineContent","content","disciplineHeader","header","discipline","container","leftSection","mobileAuthorCtaSection","columnReverse","cta","addToMyListBtn","shareBtn","rightSection","stickySection","buttons","shareFeedBack","addToMyListFeedback","addToMyListProviderWrap","shareProviderWrap","propTypes","onClick","wording","text","successWording","errorWording","arrayOf","shape","ref","string","locale","focused","bool","func","contextTypes","translate"],"sources":["../../../../src/template/common/discipline/index.js"],"sourcesContent":["import React from 'react';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport PropTypes from 'prop-types';\nimport DisciplineCTA from '../../../molecule/discipline-cta';\nimport DisciplineHeader from '../../../molecule/discipline-header';\nimport DisciplinePartners from '../../../molecule/discipline-partners';\nimport DisciplineScope from '../../../molecule/discipline-scope';\nimport DisciplineAssociatedSkills from '../../../molecule/discipline-associated-skills';\nimport Share, {ShareFeedback, ShareStatusProvider} from '../../../molecule/share';\nimport AddToMyList, {\n AddToMyListFeedback,\n AddToMyListStatusProvider\n} from '../../../molecule/add-to-my-list';\nimport style from './style.css';\n\nconst Discipline = (props, context) => {\n const {\n selected = 0,\n level,\n levels,\n changeLevel,\n image,\n title = '',\n video,\n authors = [],\n description = '',\n start,\n buy,\n startLabel,\n skills = [],\n onSkillClick,\n buyLabel,\n shareWording,\n shareText,\n shareSuccessWording,\n shareErrorWording,\n addToMyListButton,\n favorite,\n onFavoriteClick,\n addToMyListText,\n removeFromMyListText,\n disableShare = false,\n disableAddToMyList = false,\n lastUpdated\n } = props;\n\n const authorSection = isEmpty(authors) ? null : (\n <div className={style.partners}>\n <DisciplinePartners authors={authors} />\n </div>\n );\n\n const disciplineCTA = (\n <DisciplineCTA\n type={'discipline'}\n start={start}\n buy={buy}\n startLabel={startLabel}\n buyLabel={buyLabel}\n />\n );\n\n const disciplineContent = (\n <div className={style.content}>\n <DisciplineScope content={level} levels={levels} selected={selected} onClick={changeLevel} />\n </div>\n );\n\n const disciplineHeader = (\n <div className={style.header}>\n <DisciplineHeader\n image={image}\n video={video}\n title={title}\n description={description}\n lastUpdated={lastUpdated}\n />\n </div>\n );\n\n const discipline = (\n <div data-name=\"discipline\" className={style.container} key=\"discipline\">\n <div className={style.leftSection}>\n {disciplineHeader}\n <div className={style.mobileAuthorCtaSection}>\n <div className={style.columnReverse}>\n <div className={style.cta}>{disciplineCTA}</div>\n {disableAddToMyList ? null : (\n <AddToMyList\n style={style.addToMyListBtn}\n addToMyListButton={addToMyListButton}\n favorite={favorite}\n onFavoriteClick={onFavoriteClick}\n key={'addToMyListTablet'}\n />\n )}\n {disableShare ? null : (\n <Share\n style={style.shareBtn}\n wording={shareWording}\n text={shareText}\n key={'shareTablet'}\n />\n )}\n </div>\n <DisciplineAssociatedSkills skills={skills} onSkillClick={onSkillClick} />\n {authorSection}\n </div>\n {disciplineContent}\n </div>\n <div className={style.rightSection}>\n <div className={style.stickySection}>\n <div className={style.cta}>\n {disciplineCTA}\n {disableShare && disableAddToMyList ? null : (\n <div className={style.buttons}>\n {disableShare ? null : (\n <Share\n style={style.shareBtn}\n wording={shareWording}\n text={shareText}\n key={'shareDesktop'}\n />\n )}\n {disableAddToMyList ? null : (\n <AddToMyList\n style={style.addToMyListBtn}\n addToMyListButton={addToMyListButton}\n favorite={favorite}\n onFavoriteClick={onFavoriteClick}\n key={'addToMyListDesktop'}\n />\n )}\n </div>\n )}\n </div>\n <DisciplineAssociatedSkills skills={skills} onSkillClick={onSkillClick} />\n {authorSection}\n </div>\n </div>\n </div>\n );\n\n const shareFeedBack = disableShare ? null : (\n <ShareFeedback\n errorWording={shareErrorWording}\n successWording={shareSuccessWording}\n key=\"shareFeedBack\"\n />\n );\n\n const addToMyListFeedback = disableAddToMyList ? null : (\n <AddToMyListFeedback\n addToMyListText={addToMyListText}\n removeFromMyListText={removeFromMyListText}\n favorite={favorite}\n />\n );\n\n const addToMyListProviderWrap = disableAddToMyList ? (\n <>\n {shareFeedBack}\n {discipline}\n </>\n ) : (\n <AddToMyListStatusProvider>\n {shareFeedBack}\n {addToMyListFeedback}\n {discipline}\n </AddToMyListStatusProvider>\n );\n const shareProviderWrap = disableShare ? (\n addToMyListProviderWrap\n ) : (\n <ShareStatusProvider>{addToMyListProviderWrap}</ShareStatusProvider>\n );\n\n return shareProviderWrap;\n};\n\nDiscipline.propTypes = {\n image: DisciplineHeader.propTypes.image,\n video: DisciplineHeader.propTypes.video,\n title: DisciplineHeader.propTypes.title,\n description: DisciplineHeader.propTypes.description,\n start: DisciplineCTA.propTypes.start,\n buy: DisciplineCTA.propTypes.buy,\n startLabel: DisciplineCTA.propTypes.startLabel,\n buyLabel: DisciplineCTA.propTypes.buyLabel,\n authors: DisciplinePartners.propTypes.authors,\n level: DisciplineScope.propTypes.content,\n levels: DisciplineScope.propTypes.levels,\n selected: DisciplineScope.propTypes.selected,\n changeLevel: DisciplineScope.propTypes.onClick,\n shareWording: Share.propTypes.wording,\n shareText: Share.propTypes.text,\n shareSuccessWording: ShareFeedback.propTypes.successWording,\n shareErrorWording: ShareFeedback.propTypes.errorWording,\n skills: PropTypes.arrayOf(\n PropTypes.shape({\n ref: PropTypes.string,\n locale: PropTypes.string,\n focused: PropTypes.bool\n })\n ),\n onSkillClick: PropTypes.func,\n addToMyListText: AddToMyListFeedback.propTypes.addToMyListText,\n removeFromMyListText: AddToMyListFeedback.propTypes.removeFromMyListText,\n addToMyListButton: AddToMyList.propTypes.addToMyListButton,\n onFavoriteClick: AddToMyList.propTypes.onFavoriteClick,\n favorite: AddToMyList.propTypes.favorite,\n disableShare: PropTypes.bool,\n disableAddToMyList: PropTypes.bool\n};\n\nDiscipline.contextTypes = {\n translate: PropTypes.func\n};\n\nexport default Discipline;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,aAAP,MAA0B,kCAA1B;AACA,OAAOC,gBAAP,MAA6B,qCAA7B;AACA,OAAOC,kBAAP,MAA+B,uCAA/B;AACA,OAAOC,eAAP,MAA4B,oCAA5B;AACA,OAAOC,0BAAP,MAAuC,gDAAvC;AACA,OAAOC,KAAP,IAAeC,aAAf,EAA8BC,mBAA9B,QAAwD,yBAAxD;AACA,OAAOC,WAAP,IACEC,mBADF,EAEEC,yBAFF,QAGO,kCAHP;AAIA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,UAAU,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACrC,MAAM;IACJC,QAAQ,GAAG,CADP;IAEJC,KAFI;IAGJC,MAHI;IAIJC,WAJI;IAKJC,KALI;IAMJC,KAAK,GAAG,EANJ;IAOJC,KAP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AAE3B,WAAW,CAACwD,SAAZ,CAAsB7B,QA9BX;EA+BrBI,YAAY,EAAExC,SAAS,CAAC6E,IA/BH;EAgCrBpC,kBAAkB,EAAEzC,SAAS,CAAC6E;AAhCT,CAAvB;AAmCAhE,UAAU,CAACkE,YAAX,GAA0B;EACxBC,SAAS,EAAEhF,SAAS,CAAC8E;AADG,CAA1B;AAIA,eAAejE,UAAf"}
@@ -14,7 +14,6 @@
14
14
 
15
15
  .leftSection {
16
16
  display: block;
17
- overflow: hidden;
18
17
  padding: 20px;
19
18
  box-sizing: border-box;
20
19
  position: relative;
@@ -109,6 +108,10 @@
109
108
  margin-left: 0px;
110
109
  }
111
110
 
111
+ .leftSection {
112
+ width: 100%
113
+ }
114
+
112
115
  .mobileAuthorCtaSection {
113
116
  composes: wrapper from '../layout.css';
114
117
  position: inherit;
@@ -2,6 +2,27 @@ export default MyLearning;
2
2
  declare function MyLearning(props: any, context: any): JSX.Element;
3
3
  declare namespace MyLearning {
4
4
  namespace contextTypes {
5
+ const skin: PropTypes.Requireable<PropTypes.InferProps<{
6
+ common: PropTypes.Requireable<{
7
+ [x: string]: any;
8
+ }>;
9
+ images: PropTypes.Requireable<PropTypes.InferProps<{
10
+ 'logo-mobile': PropTypes.Requireable<any>;
11
+ logo: PropTypes.Requireable<any>;
12
+ 'logo-email': PropTypes.Requireable<any>;
13
+ login: PropTypes.Requireable<any>;
14
+ }>>;
15
+ icons: PropTypes.Requireable<{
16
+ [x: string]: any;
17
+ }>;
18
+ mod: PropTypes.Requireable<{
19
+ [x: string]: any;
20
+ }>;
21
+ courses: PropTypes.Requireable<any[]>;
22
+ texts: PropTypes.Requireable<{
23
+ [x: string]: any;
24
+ }>;
25
+ }>>;
5
26
  const translate: PropTypes.Requireable<(...args: any[]) => any>;
6
27
  }
7
28
  namespace propTypes {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/my-learning/index.js"],"names":[],"mappings":";AAgHA,mEAuVC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/my-learning/index.js"],"names":[],"mappings":";AAwHA,mEA2WC"}
@@ -3,7 +3,7 @@ import _pipe from "lodash/fp/pipe";
3
3
  import _fromPairs from "lodash/fp/fromPairs";
4
4
  import _map from "lodash/fp/map";
5
5
  import _keys from "lodash/fp/keys";
6
- import _getOr from "lodash/fp/getOr";
6
+ import _get from "lodash/fp/get";
7
7
  import React, { useCallback, useState, useMemo } from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import { convert } from 'css-color-function';
@@ -31,7 +31,7 @@ const ChangeSkillFocusButton = (props, context) => {
31
31
  translate
32
32
  } = context;
33
33
 
34
- const primarySkinColor = _getOr('#0061FF', 'common.primary', skin);
34
+ const primarySkinColor = _get('common.primary', skin);
35
35
 
36
36
  const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);
37
37
  const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);
@@ -61,6 +61,7 @@ const ChangeSkillFocusButton = (props, context) => {
61
61
  };
62
62
 
63
63
  ChangeSkillFocusButton.contextTypes = {
64
+ skin: Provider.childContextTypes.skin,
64
65
  translate: Provider.childContextTypes.translate
65
66
  };
66
67
  ChangeSkillFocusButton.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -79,10 +80,14 @@ const FilterButton = (props, context) => {
79
80
  translate
80
81
  } = context;
81
82
 
82
- const primarySkinColor = _getOr('#0061FF', 'common.primary', skin);
83
+ const primarySkinColor = _get('common.primary', skin);
83
84
 
84
85
  const Content = useCallback(() => /*#__PURE__*/React.createElement("div", null, filter, /*#__PURE__*/React.createElement("span", {
85
- className: active ? style.skillFilterNumber : style.skillFilterNumberInActive
86
+ className: active ? style.skillFilterNumber : style.skillFilterNumberInActive,
87
+ style: {
88
+ backgroundColor: active ? convert(`color(${primarySkinColor} a(0.07))`) : '#EAEAEB',
89
+ color: active ? primarySkinColor : '#515161'
90
+ }
86
91
  }, skillTotal)), [filter, skillTotal, active]);
87
92
  const buttonProps = {
88
93
  customStyle: {
@@ -99,6 +104,7 @@ const FilterButton = (props, context) => {
99
104
  };
100
105
 
101
106
  FilterButton.contextTypes = {
107
+ skin: Provider.childContextTypes.skin,
102
108
  translate: Provider.childContextTypes.translate
103
109
  };
104
110
  FilterButton.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -121,14 +127,21 @@ const MyLearning = (props, context) => {
121
127
  onExploreSkill
122
128
  } = props;
123
129
  const {
130
+ skin,
124
131
  translate
125
132
  } = context;
133
+
134
+ const primarySkinColor = _get('common.primary', skin);
135
+
126
136
  const [open, setOpen] = useState(false);
127
137
  const [selectedSkillsList, setSelectedSkillsList] = useState(selectedSkills);
128
138
  const [skillFocusSelectedOnChart, setSkillFocusSelectedOnChart] = useState(undefined);
129
139
  const [searchValue, setSearchValue] = useState('');
130
- const [searchResults, setSearchResults] = useState(skills);
140
+ const [searchResults, setSearchResults] = useState(skills.sort((a, b) => skillsInformation[b].stats.score - skillsInformation[a].stats.score));
131
141
  const [activeFilter, setActiveFilter] = useState('all');
142
+ const [hovered, setHovered] = useState(false);
143
+ const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);
144
+ const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);
132
145
  const skillsReviewReady = useMemo(() => {
133
146
  return searchResults.filter(skill => skillsInformation[skill].availableForReview);
134
147
  }, [searchResults, skillsInformation]);
@@ -173,7 +186,7 @@ const MyLearning = (props, context) => {
173
186
  }
174
187
  }];
175
188
  const handleOnDotClick = useCallback(skillRef => {
176
- skillRef && setSkillFocusSelectedOnChart(skillRef);
189
+ setSkillFocusSelectedOnChart(skillRef);
177
190
  }, [setSkillFocusSelectedOnChart]);
178
191
  const handleOpenSkillPicker = useCallback(() => setOpen(true), [setOpen]);
179
192
  const handleCloseSkillPicker = useCallback(() => setOpen(false), [setOpen]);
@@ -242,14 +255,15 @@ const MyLearning = (props, context) => {
242
255
  data: graphDatas,
243
256
  legend: graphLegends,
244
257
  onClick: handleOnDotClick,
258
+ onExploreClick: onExploreSkill,
245
259
  colors: [{
246
260
  gradient: {
247
261
  fill: ['#0062ffff', '#8000ff85'],
248
262
  stroke: ['#0062ffff', '#8000FF']
249
263
  },
250
264
  percentage: {
251
- color: '#0061FF',
252
- background: 'linear-gradient(180deg, rgba(0, 97, 255, 0.10) 0%, rgba(147, 107, 255, 0.10) 100%)'
265
+ color: primarySkinColor,
266
+ background: convert(`color(${primarySkinColor} a(0.07))`)
253
267
  },
254
268
  label: {
255
269
  color: '#020202ff'
@@ -267,14 +281,18 @@ const MyLearning = (props, context) => {
267
281
  className: style.skillFocusEmptyTitle
268
282
  }, translate('skills_focus_empty_title')), /*#__PURE__*/React.createElement("div", {
269
283
  className: style.skillFocusEmptyDescription
270
- }, translate('skills_focus_empty_description')), /*#__PURE__*/React.createElement(ButtonLink, {
284
+ }, translate('skills_focus_empty_description')), /*#__PURE__*/React.createElement("div", {
285
+ onMouseOver: handleMouseOver,
286
+ onMouseLeave: handleMouseLeave
287
+ }, /*#__PURE__*/React.createElement(ButtonLink, {
271
288
  label: translate('skills_choose_focus'),
272
289
  type: "primary",
273
290
  customStyle: {
274
- width: '168px'
291
+ width: '168px',
292
+ backgroundColor: hovered ? convert(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`) : primarySkinColor
275
293
  },
276
294
  onClick: handleOpenSkillPicker
277
- }))) : null, /*#__PURE__*/React.createElement("header", {
295
+ })))) : null, /*#__PURE__*/React.createElement("header", {
278
296
  className: style.skillListHeader
279
297
  }, /*#__PURE__*/React.createElement("div", {
280
298
  className: style.skillListHeaderIcon
@@ -296,7 +314,7 @@ const MyLearning = (props, context) => {
296
314
  iconContainerClassName: style.infoIconTooltip,
297
315
  tooltipClassName: style.tooltip,
298
316
  TooltipContent: ReviewTooltipContent,
299
- closeToolTipInformationTextAriaLabel: translate('Press the escape key to close the information text')
317
+ closeToolTipInformationTextAriaLabel: translate('close_tooltip_information')
300
318
  })))), /*#__PURE__*/React.createElement("div", {
301
319
  className: style.toolBarContainer
302
320
  }, /*#__PURE__*/React.createElement("div", {
@@ -352,15 +370,22 @@ const MyLearning = (props, context) => {
352
370
  onExploreSkill(skill);
353
371
  }
354
372
 
373
+ const {
374
+ score,
375
+ courses: skillCourses,
376
+ questionsAnswered: skillQuestions,
377
+ coursesCompleted: completedCourses
378
+ } = skillsInformation[skill].stats;
355
379
  return /*#__PURE__*/React.createElement("div", {
356
380
  key: index
357
381
  }, /*#__PURE__*/React.createElement(LearnerSkillCard, {
358
382
  skillTitle: skillsLocales[skill],
359
383
  focus: selectedSkills.includes(skill),
360
384
  metrics: {
361
- skillCourses: skillsInformation[skill].stats.courses,
362
- skillQuestions: skillsInformation[skill].stats.questionsAnswered,
363
- completedCourses: skillsInformation[skill].stats.coursesCompleted
385
+ score,
386
+ skillCourses,
387
+ skillQuestions,
388
+ completedCourses
364
389
  },
365
390
  review: skillsInformation[skill].availableForReview,
366
391
  onReviewClick: handleReviewSkill,
@@ -370,6 +395,7 @@ const MyLearning = (props, context) => {
370
395
  };
371
396
 
372
397
  MyLearning.contextTypes = {
398
+ skin: Provider.childContextTypes.skin,
373
399
  translate: Provider.childContextTypes.translate
374
400
  };
375
401
  MyLearning.propTypes = process.env.NODE_ENV !== "production" ? {