@coorpacademy/components 11.9.2-alpha.1 → 11.9.2-alpha.4

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 (228) hide show
  1. package/es/atom/avatar/index.js +0 -1
  2. package/es/atom/avatar/index.js.map +1 -1
  3. package/es/atom/avatar/style.css +1 -0
  4. package/es/atom/card-image-preview/index.d.ts.map +1 -1
  5. package/es/atom/card-image-preview/index.js +3 -1
  6. package/es/atom/card-image-preview/index.js.map +1 -1
  7. package/es/atom/difficulty-level/index.js +4 -8
  8. package/es/atom/difficulty-level/index.js.map +1 -1
  9. package/es/atom/difficulty-level/style.css +1 -0
  10. package/es/atom/input-html/index.js +6 -2
  11. package/es/atom/input-html/index.js.map +1 -1
  12. package/es/atom/life/index.js +9 -3
  13. package/es/atom/life/index.js.map +1 -1
  14. package/es/atom/resource-miniature/index.js +3 -1
  15. package/es/atom/resource-miniature/index.js.map +1 -1
  16. package/es/atom/review-presentation/index.d.ts.map +1 -1
  17. package/es/atom/review-presentation/index.js +62 -12
  18. package/es/atom/review-presentation/index.js.map +1 -1
  19. package/es/atom/review-presentation/style.css +67 -7
  20. package/es/molecule/audio/index.js +3 -1
  21. package/es/molecule/audio/index.js.map +1 -1
  22. package/es/molecule/battle-request/index.js +3 -1
  23. package/es/molecule/battle-request/index.js.map +1 -1
  24. package/es/molecule/brand-download-box/index.js +3 -1
  25. package/es/molecule/brand-download-box/index.js.map +1 -1
  26. package/es/molecule/brand-upload-box/index.js +3 -1
  27. package/es/molecule/brand-upload-box/index.js.map +1 -1
  28. package/es/molecule/card/favorite.js +6 -2
  29. package/es/molecule/card/favorite.js.map +1 -1
  30. package/es/molecule/card/index.d.ts.map +1 -1
  31. package/es/molecule/card/index.js +6 -2
  32. package/es/molecule/card/index.js.map +1 -1
  33. package/es/molecule/card/notification.js +3 -1
  34. package/es/molecule/card/notification.js.map +1 -1
  35. package/es/molecule/card-content/index.d.ts.map +1 -1
  36. package/es/molecule/card-content/index.js +1 -2
  37. package/es/molecule/card-content/index.js.map +1 -1
  38. package/es/molecule/card-content/style.css +1 -0
  39. package/es/molecule/dashboard/cards-list/index.js +9 -3
  40. package/es/molecule/dashboard/cards-list/index.js.map +1 -1
  41. package/es/molecule/discipline-partners/index.js +3 -1
  42. package/es/molecule/discipline-partners/index.js.map +1 -1
  43. package/es/molecule/drag-and-drop/overlay.js +3 -1
  44. package/es/molecule/drag-and-drop/overlay.js.map +1 -1
  45. package/es/molecule/drag-and-drop/upload-report.js +3 -1
  46. package/es/molecule/drag-and-drop/upload-report.js.map +1 -1
  47. package/es/molecule/filters/index.js +6 -2
  48. package/es/molecule/filters/index.js.map +1 -1
  49. package/es/molecule/pdf/index.js +3 -1
  50. package/es/molecule/pdf/index.js.map +1 -1
  51. package/es/molecule/resource-player/index.js +3 -1
  52. package/es/molecule/resource-player/index.js.map +1 -1
  53. package/es/molecule/search-form/index.js +3 -1
  54. package/es/molecule/search-form/index.js.map +1 -1
  55. package/es/molecule/select-multiple/index.js +6 -2
  56. package/es/molecule/select-multiple/index.js.map +1 -1
  57. package/es/molecule/setup-section/index.js +3 -1
  58. package/es/molecule/setup-section/index.js.map +1 -1
  59. package/es/molecule/table/index.js +6 -2
  60. package/es/molecule/table/index.js.map +1 -1
  61. package/es/molecule/titled-checkbox/index.js +1 -2
  62. package/es/molecule/titled-checkbox/index.js.map +1 -1
  63. package/es/molecule/titled-checkbox/style.css +1 -0
  64. package/es/organism/accordion/coorp-manager/part/index.d.ts.map +1 -1
  65. package/es/organism/accordion/coorp-manager/part/index.js +13 -6
  66. package/es/organism/accordion/coorp-manager/part/index.js.map +1 -1
  67. package/es/organism/accordion/coorp-manager/part/style.css +1 -0
  68. package/es/organism/accordion/part/index.js +7 -4
  69. package/es/organism/accordion/part/index.js.map +1 -1
  70. package/es/organism/accordion/part/style.css +1 -0
  71. package/es/organism/brand-form/index.js +3 -1
  72. package/es/organism/brand-form/index.js.map +1 -1
  73. package/es/organism/get-the-app/index.js +3 -1
  74. package/es/organism/get-the-app/index.js.map +1 -1
  75. package/es/organism/mooc-header/index.d.ts.map +1 -1
  76. package/es/organism/mooc-header/index.js +21 -7
  77. package/es/organism/mooc-header/index.js.map +1 -1
  78. package/es/organism/slider/index.js +6 -2
  79. package/es/organism/slider/index.js.map +1 -1
  80. package/es/template/activity/engine-stars.css +33 -16
  81. package/es/template/activity/engine-stars.d.ts +17 -15
  82. package/es/template/activity/engine-stars.d.ts.map +1 -1
  83. package/es/template/activity/engine-stars.js +122 -129
  84. package/es/template/activity/engine-stars.js.map +1 -1
  85. package/es/template/activity/index.d.ts +0 -1
  86. package/es/template/activity/index.d.ts.map +1 -1
  87. package/es/template/activity/index.js +9 -18
  88. package/es/template/activity/index.js.map +1 -1
  89. package/es/template/activity/progression-item.js +13 -5
  90. package/es/template/activity/progression-item.js.map +1 -1
  91. package/es/template/activity/stars-summary.d.ts +0 -1
  92. package/es/template/activity/stars-summary.d.ts.map +1 -1
  93. package/es/template/activity/stars-summary.js +14 -13
  94. package/es/template/activity/stars-summary.js.map +1 -1
  95. package/es/template/app-player/player/slides/header/learner.css +1 -0
  96. package/es/template/app-player/player/slides/header/learner.js +1 -2
  97. package/es/template/app-player/player/slides/header/learner.js.map +1 -1
  98. package/es/template/app-player/player/slides/header/microlearning.css +1 -0
  99. package/es/template/app-player/player/slides/header/microlearning.js +1 -2
  100. package/es/template/app-player/player/slides/header/microlearning.js.map +1 -1
  101. package/es/template/app-player/popin-correction/index.js +4 -3
  102. package/es/template/app-player/popin-correction/index.js.map +1 -1
  103. package/es/template/app-player/popin-correction/style.css +1 -0
  104. package/es/template/app-player/popin-end/summary.js +3 -1
  105. package/es/template/app-player/popin-end/summary.js.map +1 -1
  106. package/es/template/app-player/popin-header/index.js +6 -3
  107. package/es/template/app-player/popin-header/index.js.map +1 -1
  108. package/es/template/app-player/popin-header/style.css +1 -0
  109. package/lib/atom/avatar/index.js +0 -1
  110. package/lib/atom/avatar/index.js.map +1 -1
  111. package/lib/atom/avatar/style.css +1 -0
  112. package/lib/atom/card-image-preview/index.d.ts.map +1 -1
  113. package/lib/atom/card-image-preview/index.js +3 -1
  114. package/lib/atom/card-image-preview/index.js.map +1 -1
  115. package/lib/atom/difficulty-level/index.js +4 -8
  116. package/lib/atom/difficulty-level/index.js.map +1 -1
  117. package/lib/atom/difficulty-level/style.css +1 -0
  118. package/lib/atom/input-html/index.js +6 -2
  119. package/lib/atom/input-html/index.js.map +1 -1
  120. package/lib/atom/life/index.js +9 -3
  121. package/lib/atom/life/index.js.map +1 -1
  122. package/lib/atom/resource-miniature/index.js +3 -1
  123. package/lib/atom/resource-miniature/index.js.map +1 -1
  124. package/lib/atom/review-presentation/index.d.ts.map +1 -1
  125. package/lib/atom/review-presentation/index.js +66 -13
  126. package/lib/atom/review-presentation/index.js.map +1 -1
  127. package/lib/atom/review-presentation/style.css +67 -7
  128. package/lib/molecule/audio/index.js +3 -1
  129. package/lib/molecule/audio/index.js.map +1 -1
  130. package/lib/molecule/battle-request/index.js +3 -1
  131. package/lib/molecule/battle-request/index.js.map +1 -1
  132. package/lib/molecule/brand-download-box/index.js +3 -1
  133. package/lib/molecule/brand-download-box/index.js.map +1 -1
  134. package/lib/molecule/brand-upload-box/index.js +3 -1
  135. package/lib/molecule/brand-upload-box/index.js.map +1 -1
  136. package/lib/molecule/card/favorite.js +6 -2
  137. package/lib/molecule/card/favorite.js.map +1 -1
  138. package/lib/molecule/card/index.d.ts.map +1 -1
  139. package/lib/molecule/card/index.js +6 -2
  140. package/lib/molecule/card/index.js.map +1 -1
  141. package/lib/molecule/card/notification.js +3 -1
  142. package/lib/molecule/card/notification.js.map +1 -1
  143. package/lib/molecule/card-content/index.d.ts.map +1 -1
  144. package/lib/molecule/card-content/index.js +1 -2
  145. package/lib/molecule/card-content/index.js.map +1 -1
  146. package/lib/molecule/card-content/style.css +1 -0
  147. package/lib/molecule/dashboard/cards-list/index.js +9 -3
  148. package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
  149. package/lib/molecule/discipline-partners/index.js +3 -1
  150. package/lib/molecule/discipline-partners/index.js.map +1 -1
  151. package/lib/molecule/drag-and-drop/overlay.js +3 -1
  152. package/lib/molecule/drag-and-drop/overlay.js.map +1 -1
  153. package/lib/molecule/drag-and-drop/upload-report.js +3 -1
  154. package/lib/molecule/drag-and-drop/upload-report.js.map +1 -1
  155. package/lib/molecule/filters/index.js +6 -2
  156. package/lib/molecule/filters/index.js.map +1 -1
  157. package/lib/molecule/pdf/index.js +3 -1
  158. package/lib/molecule/pdf/index.js.map +1 -1
  159. package/lib/molecule/resource-player/index.js +3 -1
  160. package/lib/molecule/resource-player/index.js.map +1 -1
  161. package/lib/molecule/search-form/index.js +3 -1
  162. package/lib/molecule/search-form/index.js.map +1 -1
  163. package/lib/molecule/select-multiple/index.js +6 -2
  164. package/lib/molecule/select-multiple/index.js.map +1 -1
  165. package/lib/molecule/setup-section/index.js +3 -1
  166. package/lib/molecule/setup-section/index.js.map +1 -1
  167. package/lib/molecule/table/index.js +6 -2
  168. package/lib/molecule/table/index.js.map +1 -1
  169. package/lib/molecule/titled-checkbox/index.js +1 -2
  170. package/lib/molecule/titled-checkbox/index.js.map +1 -1
  171. package/lib/molecule/titled-checkbox/style.css +1 -0
  172. package/lib/organism/accordion/coorp-manager/part/index.d.ts.map +1 -1
  173. package/lib/organism/accordion/coorp-manager/part/index.js +13 -6
  174. package/lib/organism/accordion/coorp-manager/part/index.js.map +1 -1
  175. package/lib/organism/accordion/coorp-manager/part/style.css +1 -0
  176. package/lib/organism/accordion/part/index.js +7 -4
  177. package/lib/organism/accordion/part/index.js.map +1 -1
  178. package/lib/organism/accordion/part/style.css +1 -0
  179. package/lib/organism/brand-form/index.js +3 -1
  180. package/lib/organism/brand-form/index.js.map +1 -1
  181. package/lib/organism/get-the-app/index.js +3 -1
  182. package/lib/organism/get-the-app/index.js.map +1 -1
  183. package/lib/organism/mooc-header/index.d.ts.map +1 -1
  184. package/lib/organism/mooc-header/index.js +21 -7
  185. package/lib/organism/mooc-header/index.js.map +1 -1
  186. package/lib/organism/slider/index.js +6 -2
  187. package/lib/organism/slider/index.js.map +1 -1
  188. package/lib/template/activity/engine-stars.css +33 -16
  189. package/lib/template/activity/engine-stars.d.ts +17 -15
  190. package/lib/template/activity/engine-stars.d.ts.map +1 -1
  191. package/lib/template/activity/engine-stars.js +122 -135
  192. package/lib/template/activity/engine-stars.js.map +1 -1
  193. package/lib/template/activity/index.d.ts +0 -1
  194. package/lib/template/activity/index.d.ts.map +1 -1
  195. package/lib/template/activity/index.js +9 -21
  196. package/lib/template/activity/index.js.map +1 -1
  197. package/lib/template/activity/progression-item.js +13 -5
  198. package/lib/template/activity/progression-item.js.map +1 -1
  199. package/lib/template/activity/stars-summary.d.ts +0 -1
  200. package/lib/template/activity/stars-summary.d.ts.map +1 -1
  201. package/lib/template/activity/stars-summary.js +14 -13
  202. package/lib/template/activity/stars-summary.js.map +1 -1
  203. package/lib/template/app-player/player/slides/header/learner.css +1 -0
  204. package/lib/template/app-player/player/slides/header/learner.js +1 -2
  205. package/lib/template/app-player/player/slides/header/learner.js.map +1 -1
  206. package/lib/template/app-player/player/slides/header/microlearning.css +1 -0
  207. package/lib/template/app-player/player/slides/header/microlearning.js +1 -2
  208. package/lib/template/app-player/player/slides/header/microlearning.js.map +1 -1
  209. package/lib/template/app-player/popin-correction/index.js +4 -3
  210. package/lib/template/app-player/popin-correction/index.js.map +1 -1
  211. package/lib/template/app-player/popin-correction/style.css +1 -0
  212. package/lib/template/app-player/popin-end/summary.js +3 -1
  213. package/lib/template/app-player/popin-end/summary.js.map +1 -1
  214. package/lib/template/app-player/popin-header/index.js +6 -3
  215. package/lib/template/app-player/popin-header/index.js.map +1 -1
  216. package/lib/template/app-player/popin-header/style.css +1 -0
  217. package/locales/en/global.json +0 -1
  218. package/package.json +3 -4
  219. package/es/atom/tooltip/index.d.ts +0 -22
  220. package/es/atom/tooltip/index.d.ts.map +0 -1
  221. package/es/atom/tooltip/index.js +0 -117
  222. package/es/atom/tooltip/index.js.map +0 -1
  223. package/es/atom/tooltip/style.css +0 -96
  224. package/lib/atom/tooltip/index.d.ts +0 -22
  225. package/lib/atom/tooltip/index.d.ts.map +0 -1
  226. package/lib/atom/tooltip/index.js +0 -137
  227. package/lib/atom/tooltip/index.js.map +0 -1
  228. package/lib/atom/tooltip/style.css +0 -96
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["separator","index","style","answerSeparator","joinBySeparator","elements","separators","length","AnswersCorrection","corrections","answers","map","correction","key","isCorrect","classnames","correctAnswer","wrongAnswer","innerHTML","__html","answer","fullAnswer","propTypes","PropTypes","arrayOf","shape","string","isRequired","bool","formatPlusSign","value","Rank","failed","rank","animated","onAnimationEnd","skin","positive","centerContent","bumped","iconBubble","icon","iconText","EASE_OUT_CUBIC","progress","Animation","contextTypes","Provider","childContextTypes","Stars","stars","Lifes","lives","revival","life","Life","count","IconsPart","props","iconsWrapper","AnimationScheduler","buildClass","success","loading","scormStyle","mode","getLinkStyle","gameOver","extraLifeGranted","oneMoreLife","renderIconStatusScorm","iconCloseContainer","iconSuccessContainer","failIcon","checkIcon","buildDefaultOrScormStyle","defaultStyle","styleScorm","failedStyle","CorrectionPart","title","subtitle","isLoading","className","correctionSectionEndSuccess","correctionSectionSuccess","correctionSectionFailGameOver","correctionSectionFail","correctionSectionLoading","resultContenantContainerScorm","titlesWrapper","titlesWrapperScorm","resultTitleScorm","resultSubtitleScorm","statusPlayerResultFailScorm","NextQuestionPart","context","cta","type","nextStepTitle","showNextLevel","linkProps","dataNext","nextStep","gameOverSubtitle","nextSection","wrapperNextSection","nextButton","nextButtonIcon","Link","oneOf","number","PopinHeader","state","nextLink","scorm","header","headerWithoutCTA","headerTitle"],"sources":["../../../../src/template/app-player/popin-header/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n compact,\n flatten,\n get,\n isNil,\n pipe,\n times,\n zip,\n round,\n parseInt as _parseInt,\n multiply,\n isEmpty\n} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaCompositionCoorpacademyCharts as ChartsIcon,\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaSolidStatusClose as Close\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport Loader from '../../../atom/loader';\nimport Life from '../../../atom/life';\nimport Link from '../../../atom/link';\nimport Animation, {EASE_OUT_CUBIC} from '../../../hoc/animation';\nimport Transition from '../../../hoc/transition';\nimport AnimationScheduler, {AnimationAdapter} from '../../../hoc/animation-scheduler';\nimport Provider from '../../../atom/provider';\nimport style from './style.css';\n\nconst separator = index => (\n <span key={index} className={style.answerSeparator}>\n /\n </span>\n);\n\nconst joinBySeparator = elements => {\n const separators = times(separator, elements.length - 1);\n return pipe(zip, flatten, compact)(elements, separators);\n};\n\nconst AnswersCorrection = ({corrections}) => {\n const answers = corrections.map((correction, index) => {\n const key = `answer_${index}`;\n return (\n <span\n key={key}\n data-name=\"answer\"\n data-correct={correction.isCorrect}\n className={classnames(\n correction.isCorrect ? style.correctAnswer : style.wrongAnswer,\n style.innerHTML\n )}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: correction.answer}}\n />\n );\n }, corrections);\n return <p className={style.fullAnswer}>{joinBySeparator(answers)}</p>;\n};\n\nAnswersCorrection.propTypes = {\n corrections: PropTypes.arrayOf(\n PropTypes.shape({\n answer: PropTypes.string.isRequired,\n isCorrect: PropTypes.bool.isRequired\n })\n )\n};\n\nconst formatPlusSign = value => (value >= 0 ? '+' : '') + value;\n\nconst Rank = ({failed, rank, animated, onAnimationEnd}, {skin}) => {\n const positive = get('common.positive', skin);\n if (failed || isNil(rank)) return null;\n return (\n <AnimationScheduler animated={animated} onAnimationEnd={onAnimationEnd}>\n <div className={style.centerContent}>\n <Transition name=\"label\" after=\"counter\" className={style.bumped}>\n <div className={style.iconBubble}>\n <ChartsIcon className={style.icon} color={positive} />\n </div>\n </Transition>\n <span className={style.iconText}>\n <Animation name=\"counter\" bezier={EASE_OUT_CUBIC} duration={1000}>\n {progress => pipe(_parseInt(10), multiply(progress), round, formatPlusSign)(rank)}\n </Animation>\n </span>\n </div>\n </AnimationScheduler>\n );\n};\n\nRank.propTypes = {\n failed: PropTypes.bool,\n rank: PropTypes.string,\n animated: Animation.propTypes.animated,\n onAnimationEnd: Animation.propTypes.onAnimationEnd\n};\n\nRank.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nconst Stars = ({failed, stars, animated, onAnimationEnd}, {skin}) => {\n const positive = get('common.positive', skin);\n if (failed || isNil(stars)) return null;\n\n return (\n <AnimationScheduler animated={animated} onAnimationEnd={onAnimationEnd}>\n <div className={style.centerContent}>\n <Transition name=\"label\" after=\"counter\" className={style.bumped}>\n <div className={style.iconBubble}>\n <StarIcon className={style.icon} color={positive} />\n </div>\n </Transition>\n <span data-name=\"iconText\" className={style.iconText}>\n <Animation name=\"counter\" bezier={EASE_OUT_CUBIC} duration={1000}>\n {progress => pipe(_parseInt(10), multiply(progress), round, formatPlusSign)(stars)}\n </Animation>\n </span>\n </div>\n </AnimationScheduler>\n );\n};\n\nStars.propTypes = {\n failed: PropTypes.bool,\n stars: PropTypes.string,\n animated: Animation.propTypes.animated,\n onAnimationEnd: Animation.propTypes.onAnimationEnd\n};\n\nStars.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nconst Lifes = ({lives, failed, animated, revival}) => {\n if (isNil(lives)) return null;\n\n return (\n <Life\n failed={failed}\n count={lives}\n animated={animated}\n revival={revival}\n className={style.life}\n />\n );\n};\n\nLifes.propTypes = {\n lives: Life.propTypes.count,\n failed: Life.propTypes.failed,\n animated: Life.propTypes.animated,\n revival: Life.propTypes.revival\n};\n\nconst IconsPart = props => {\n const {lives, failed, stars, rank, animated, revival} = props;\n return (\n <AnimationScheduler animated>\n <div className={style.iconsWrapper}>\n <Lifes lives={lives} failed={failed} animated={animated} revival={revival} />\n\n <AnimationAdapter name=\"stars\">\n <Stars stars={stars} fail={failed} />\n </AnimationAdapter>\n <AnimationAdapter name=\"rank\" after=\"stars\">\n <Rank rank={rank} fail={failed} />\n </AnimationAdapter>\n </div>\n </AnimationScheduler>\n );\n};\n\nIconsPart.propTypes = {\n lives: Lifes.propTypes.lives,\n failed: Lifes.propTypes.failed,\n stars: Stars.propTypes.stars,\n rank: Rank.propTypes.rank,\n animated: AnimationScheduler.propTypes.animated,\n revival: PropTypes.bool\n};\n\nconst buildClass = (value, success, failed, loading, scormStyle, mode = 'default') => {\n if (loading && isNil(value)) return loading;\n if (mode === 'scorm') return scormStyle;\n return value ? failed : success;\n};\n\nconst getLinkStyle = ({gameOver, extraLifeGranted}) => {\n if (extraLifeGranted) {\n return style.oneMoreLife;\n } else if (gameOver) {\n return style.gameOver;\n } else {\n return null;\n }\n};\nconst renderIconStatusScorm = failed => {\n return (\n <div className={failed ? style.iconCloseContainer : style.iconSuccessContainer}>\n {failed ? <Close className={style.failIcon} /> : <CheckIcon className={style.checkIcon} />}\n </div>\n );\n};\nconst buildDefaultOrScormStyle = (\n defaultStyle,\n styleScorm,\n failed,\n mode = 'default',\n failedStyle = null\n) => {\n if (mode === 'scorm' && failed && failedStyle) return failedStyle;\n if (mode === 'scorm') return styleScorm;\n return defaultStyle;\n};\nconst CorrectionPart = props => {\n const {failed, corrections, title, subtitle, stars, rank, gameOver, mode = 'default'} = props;\n const isLoading = isNil(failed);\n const className = buildClass(\n failed,\n stars && rank ? style.correctionSectionEndSuccess : style.correctionSectionSuccess,\n gameOver ? style.correctionSectionFailGameOver : style.correctionSectionFail,\n style.correctionSectionLoading,\n style.resultContenantContainerScorm,\n mode\n );\n return (\n <div data-name=\"correctionSection\" className={className}>\n {mode === 'scorm' && !isLoading && renderIconStatusScorm(failed)}\n <div\n className={buildDefaultOrScormStyle(\n style.titlesWrapper,\n style.titlesWrapperScorm,\n failed,\n mode\n )}\n >\n {isLoading ? <Loader /> : null}\n <h1\n data-name=\"title\"\n className={buildDefaultOrScormStyle(\n classnames(style.title, style.innerHTML),\n style.resultTitleScorm,\n failed,\n mode\n )}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <h2\n className={buildDefaultOrScormStyle(\n style.subtitle,\n style.resultSubtitleScorm,\n failed,\n mode,\n style.statusPlayerResultFailScorm\n )}\n >\n {subtitle}\n </h2>\n {failed && !isEmpty(corrections) ? <AnswersCorrection corrections={corrections} /> : null}\n </div>\n {mode !== 'scorm' ? <IconsPart {...props} /> : null}\n </div>\n );\n};\n\nCorrectionPart.propTypes = {\n ...IconsPart.propTypes,\n failed: PropTypes.bool,\n corrections: AnswersCorrection.propTypes.corrections,\n title: PropTypes.string,\n subtitle: PropTypes.string,\n stars: PropTypes.string,\n rank: PropTypes.string,\n gameOver: PropTypes.bool\n};\n\nconst NextQuestionPart = (props, context) => {\n const {cta, type, extraLifeGranted, gameOver, failed = false, lives = 0, mode} = props;\n const {title, nextStepTitle, showNextLevel = false, ...linkProps} = cta || {};\n let dataNext;\n\n switch (type) {\n case 'popinCorrection': {\n if (gameOver) {\n dataNext = 'game-over';\n } else if (failed) {\n if (lives > 0) {\n dataNext = 'continue-failure';\n } else if (extraLifeGranted) {\n dataNext = 'continue-used-extra-life';\n }\n } else {\n dataNext = 'continue-success';\n }\n break;\n }\n\n case 'popinEnd': {\n if (failed) {\n dataNext = 'redo-content';\n } else if (showNextLevel) {\n dataNext = 'next-level';\n } else {\n dataNext = 'home';\n }\n }\n }\n\n const nextStep = nextStepTitle ? (\n <div\n className={classnames(\n gameOver ? style.gameOverSubtitle : style.nextStepTitle,\n style.innerHTML\n )}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: nextStepTitle}}\n />\n ) : null;\n\n return mode !== 'scorm' ? (\n <Link\n {...linkProps}\n className={classnames(style.nextSection, getLinkStyle({gameOver, extraLifeGranted}))}\n data-name=\"nextLink\"\n data-popin={type}\n data-next={dataNext}\n >\n <div className={style.wrapperNextSection}>\n <div className={style.nextButton}>\n {title}\n <ArrowRight color=\"inherit\" className={style.nextButtonIcon} />\n </div>\n {nextStep}\n </div>\n </Link>\n ) : null;\n};\n\nNextQuestionPart.propTypes = {\n cta: PropTypes.shape({\n ...Link.propTypes,\n title: PropTypes.string,\n nextStepTitle: PropTypes.string,\n showNextLevel: PropTypes.bool\n }),\n type: PropTypes.oneOf(['popinCorrection', 'popinEnd']).isRequired,\n extraLifeGranted: PropTypes.bool,\n gameOver: PropTypes.bool,\n failed: PropTypes.bool,\n lives: PropTypes.number,\n mode: PropTypes.string\n};\n\nconst PopinHeader = (props, context) => {\n const {\n animated,\n failed,\n title,\n subtitle,\n lives,\n stars,\n rank,\n corrections,\n cta,\n extraLifeGranted,\n gameOver = false,\n type,\n mode = 'default'\n } = props;\n const state = buildClass(failed, 'success', 'failed', null);\n\n const nextLink = cta ? (\n <NextQuestionPart\n cta={cta}\n type={type}\n extraLifeGranted={extraLifeGranted}\n failed={failed}\n gameOver={gameOver}\n lives={lives}\n mode={mode}\n />\n ) : null;\n\n return (\n <div\n className={classnames(\n mode === 'scorm' && style.scorm,\n cta ? mode !== 'scorm' && style.header : mode !== 'scorm' && style.headerWithoutCTA\n )}\n data-name=\"popinHeader\"\n data-state={state}\n >\n <div className={classnames(mode !== 'scorm' && style.headerTitle)}>\n <CorrectionPart\n title={title}\n subtitle={subtitle}\n lives={lives}\n animated={animated}\n stars={stars}\n rank={rank}\n failed={failed}\n gameOver={gameOver}\n revival={extraLifeGranted}\n corrections={corrections}\n mode={mode}\n />\n {nextLink}\n </div>\n </div>\n );\n};\n\nPopinHeader.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nPopinHeader.propTypes = {\n cta: NextQuestionPart.propTypes.cta,\n type: NextQuestionPart.propTypes.type,\n extraLifeGranted: NextQuestionPart.propTypes.extraLifeGranted,\n failed: NextQuestionPart.propTypes.failed,\n gameOver: NextQuestionPart.propTypes.gameOver,\n lives: NextQuestionPart.propTypes.lives,\n title: CorrectionPart.propTypes.title,\n subtitle: CorrectionPart.propTypes.subtitle,\n animated: CorrectionPart.propTypes.animated,\n stars: CorrectionPart.propTypes.stars,\n rank: CorrectionPart.propTypes.rank,\n corrections: CorrectionPart.propTypes.corrections,\n mode: PropTypes.oneOf(['scorm', 'default'])\n};\n\nexport default PopinHeader;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAcA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,MAAMA,SAAS,GAAGC,KAAK,iBACrB;EAAM,GAAG,EAAEA,KAAX;EAAkB,SAAS,EAAEC,cAAA,CAAMC;AAAnC,OADF;;AAMA,MAAMC,eAAe,GAAGC,QAAQ,IAAI;EAClC,MAAMC,UAAU,GAAG,qBAAMN,SAAN,EAAiBK,QAAQ,CAACE,MAAT,GAAkB,CAAnC,CAAnB;EACA,OAAO,yEAA4BF,QAA5B,EAAsCC,UAAtC,CAAP;AACD,CAHD;;AAKA,MAAME,iBAAiB,GAAG,CAAC;EAACC;AAAD,CAAD,KAAmB;EAC3C,MAAMC,OAAO,GAAGD,WAAW,CAACE,GAAZ,CAAgB,CAACC,UAAD,EAAaX,KAAb,KAAuB;IACrD,MAAMY,GAAG,GAAI,UAASZ,KAAM,EAA5B;IACA,oBACE;MACE,GAAG,EAAEY,GADP;MAEE,aAAU,QAFZ;MAGE,gBAAcD,UAAU,CAACE,SAH3B;MAIE,SAAS,EAAE,IAAAC,mBAAA,EACTH,UAAU,CAACE,SAAX,GAAuBZ,cAAA,CAAMc,aAA7B,GAA6Cd,cAAA,CAAMe,WAD1C,EAETf,cAAA,CAAMgB,SAFG,CAJb,CAQE;MARF;MASE,uBAAuB,EAAE;QAACC,MAAM,EAAEP,UAAU,CAACQ;MAApB;IAT3B,EADF;EAaD,CAfe,EAebX,WAfa,CAAhB;EAgBA,oBAAO;IAAG,SAAS,EAAEP,cAAA,CA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XT;EAYtBxB,WAAW,EAAEsE,cAAc,CAACzD,SAAf,CAAyBb,WAZhB;EAatBwD,IAAI,EAAE1C,kBAAA,CAAUuF,KAAV,CAAgB,CAAC,OAAD,EAAU,SAAV,CAAhB;AAbgB,CAAxB;eAgBeE,W"}
1
+ {"version":3,"file":"index.js","names":["separator","index","style","answerSeparator","joinBySeparator","elements","separators","length","AnswersCorrection","corrections","answers","map","correction","key","isCorrect","classnames","correctAnswer","wrongAnswer","innerHTML","__html","answer","fullAnswer","propTypes","PropTypes","arrayOf","shape","string","isRequired","bool","formatPlusSign","value","Rank","failed","rank","animated","onAnimationEnd","skin","positive","centerContent","bumped","iconBubble","icon","color","iconText","EASE_OUT_CUBIC","progress","Animation","contextTypes","Provider","childContextTypes","Stars","stars","Lifes","lives","revival","life","Life","count","IconsPart","props","iconsWrapper","AnimationScheduler","buildClass","success","loading","scormStyle","mode","getLinkStyle","gameOver","extraLifeGranted","oneMoreLife","renderIconStatusScorm","iconCloseContainer","iconSuccessContainer","failIcon","checkIcon","buildDefaultOrScormStyle","defaultStyle","styleScorm","failedStyle","CorrectionPart","title","subtitle","isLoading","className","correctionSectionEndSuccess","correctionSectionSuccess","correctionSectionFailGameOver","correctionSectionFail","correctionSectionLoading","resultContenantContainerScorm","titlesWrapper","titlesWrapperScorm","resultTitleScorm","resultSubtitleScorm","statusPlayerResultFailScorm","NextQuestionPart","context","cta","type","nextStepTitle","showNextLevel","linkProps","dataNext","nextStep","gameOverSubtitle","nextSection","wrapperNextSection","nextButton","nextButtonIcon","Link","oneOf","number","PopinHeader","state","nextLink","scorm","header","headerWithoutCTA","headerTitle"],"sources":["../../../../src/template/app-player/popin-header/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n compact,\n flatten,\n get,\n isNil,\n pipe,\n times,\n zip,\n round,\n parseInt as _parseInt,\n multiply,\n isEmpty\n} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaCompositionCoorpacademyCharts as ChartsIcon,\n NovaCompositionCoorpacademyStar as StarIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon,\n NovaSolidStatusClose as Close\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport Loader from '../../../atom/loader';\nimport Life from '../../../atom/life';\nimport Link from '../../../atom/link';\nimport Animation, {EASE_OUT_CUBIC} from '../../../hoc/animation';\nimport Transition from '../../../hoc/transition';\nimport AnimationScheduler, {AnimationAdapter} from '../../../hoc/animation-scheduler';\nimport Provider from '../../../atom/provider';\nimport style from './style.css';\n\nconst separator = index => (\n <span key={index} className={style.answerSeparator}>\n /\n </span>\n);\n\nconst joinBySeparator = elements => {\n const separators = times(separator, elements.length - 1);\n return pipe(zip, flatten, compact)(elements, separators);\n};\n\nconst AnswersCorrection = ({corrections}) => {\n const answers = corrections.map((correction, index) => {\n const key = `answer_${index}`;\n return (\n <span\n key={key}\n data-name=\"answer\"\n data-correct={correction.isCorrect}\n className={classnames(\n correction.isCorrect ? style.correctAnswer : style.wrongAnswer,\n style.innerHTML\n )}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: correction.answer}}\n />\n );\n }, corrections);\n return <p className={style.fullAnswer}>{joinBySeparator(answers)}</p>;\n};\n\nAnswersCorrection.propTypes = {\n corrections: PropTypes.arrayOf(\n PropTypes.shape({\n answer: PropTypes.string.isRequired,\n isCorrect: PropTypes.bool.isRequired\n })\n )\n};\n\nconst formatPlusSign = value => (value >= 0 ? '+' : '') + value;\n\nconst Rank = ({failed, rank, animated, onAnimationEnd}, {skin}) => {\n const positive = get('common.positive', skin);\n if (failed || isNil(rank)) return null;\n return (\n <AnimationScheduler animated={animated} onAnimationEnd={onAnimationEnd}>\n <div className={style.centerContent}>\n <Transition name=\"label\" after=\"counter\" className={style.bumped}>\n <div className={style.iconBubble}>\n <ChartsIcon className={style.icon} style={{color: positive}} />\n </div>\n </Transition>\n <span className={style.iconText}>\n <Animation name=\"counter\" bezier={EASE_OUT_CUBIC} duration={1000}>\n {progress => pipe(_parseInt(10), multiply(progress), round, formatPlusSign)(rank)}\n </Animation>\n </span>\n </div>\n </AnimationScheduler>\n );\n};\n\nRank.propTypes = {\n failed: PropTypes.bool,\n rank: PropTypes.string,\n animated: Animation.propTypes.animated,\n onAnimationEnd: Animation.propTypes.onAnimationEnd\n};\n\nRank.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nconst Stars = ({failed, stars, animated, onAnimationEnd}, {skin}) => {\n const positive = get('common.positive', skin);\n if (failed || isNil(stars)) return null;\n\n return (\n <AnimationScheduler animated={animated} onAnimationEnd={onAnimationEnd}>\n <div className={style.centerContent}>\n <Transition name=\"label\" after=\"counter\" className={style.bumped}>\n <div className={style.iconBubble}>\n <StarIcon className={style.icon} style={{color: positive}} />\n </div>\n </Transition>\n <span data-name=\"iconText\" className={style.iconText}>\n <Animation name=\"counter\" bezier={EASE_OUT_CUBIC} duration={1000}>\n {progress => pipe(_parseInt(10), multiply(progress), round, formatPlusSign)(stars)}\n </Animation>\n </span>\n </div>\n </AnimationScheduler>\n );\n};\n\nStars.propTypes = {\n failed: PropTypes.bool,\n stars: PropTypes.string,\n animated: Animation.propTypes.animated,\n onAnimationEnd: Animation.propTypes.onAnimationEnd\n};\n\nStars.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nconst Lifes = ({lives, failed, animated, revival}) => {\n if (isNil(lives)) return null;\n\n return (\n <Life\n failed={failed}\n count={lives}\n animated={animated}\n revival={revival}\n className={style.life}\n />\n );\n};\n\nLifes.propTypes = {\n lives: Life.propTypes.count,\n failed: Life.propTypes.failed,\n animated: Life.propTypes.animated,\n revival: Life.propTypes.revival\n};\n\nconst IconsPart = props => {\n const {lives, failed, stars, rank, animated, revival} = props;\n return (\n <AnimationScheduler animated>\n <div className={style.iconsWrapper}>\n <Lifes lives={lives} failed={failed} animated={animated} revival={revival} />\n\n <AnimationAdapter name=\"stars\">\n <Stars stars={stars} fail={failed} />\n </AnimationAdapter>\n <AnimationAdapter name=\"rank\" after=\"stars\">\n <Rank rank={rank} fail={failed} />\n </AnimationAdapter>\n </div>\n </AnimationScheduler>\n );\n};\n\nIconsPart.propTypes = {\n lives: Lifes.propTypes.lives,\n failed: Lifes.propTypes.failed,\n stars: Stars.propTypes.stars,\n rank: Rank.propTypes.rank,\n animated: AnimationScheduler.propTypes.animated,\n revival: PropTypes.bool\n};\n\nconst buildClass = (value, success, failed, loading, scormStyle, mode = 'default') => {\n if (loading && isNil(value)) return loading;\n if (mode === 'scorm') return scormStyle;\n return value ? failed : success;\n};\n\nconst getLinkStyle = ({gameOver, extraLifeGranted}) => {\n if (extraLifeGranted) {\n return style.oneMoreLife;\n } else if (gameOver) {\n return style.gameOver;\n } else {\n return null;\n }\n};\nconst renderIconStatusScorm = failed => {\n return (\n <div className={failed ? style.iconCloseContainer : style.iconSuccessContainer}>\n {failed ? <Close className={style.failIcon} /> : <CheckIcon className={style.checkIcon} />}\n </div>\n );\n};\nconst buildDefaultOrScormStyle = (\n defaultStyle,\n styleScorm,\n failed,\n mode = 'default',\n failedStyle = null\n) => {\n if (mode === 'scorm' && failed && failedStyle) return failedStyle;\n if (mode === 'scorm') return styleScorm;\n return defaultStyle;\n};\nconst CorrectionPart = props => {\n const {failed, corrections, title, subtitle, stars, rank, gameOver, mode = 'default'} = props;\n const isLoading = isNil(failed);\n const className = buildClass(\n failed,\n stars && rank ? style.correctionSectionEndSuccess : style.correctionSectionSuccess,\n gameOver ? style.correctionSectionFailGameOver : style.correctionSectionFail,\n style.correctionSectionLoading,\n style.resultContenantContainerScorm,\n mode\n );\n return (\n <div data-name=\"correctionSection\" className={className}>\n {mode === 'scorm' && !isLoading && renderIconStatusScorm(failed)}\n <div\n className={buildDefaultOrScormStyle(\n style.titlesWrapper,\n style.titlesWrapperScorm,\n failed,\n mode\n )}\n >\n {isLoading ? <Loader /> : null}\n <h1\n data-name=\"title\"\n className={buildDefaultOrScormStyle(\n classnames(style.title, style.innerHTML),\n style.resultTitleScorm,\n failed,\n mode\n )}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <h2\n className={buildDefaultOrScormStyle(\n style.subtitle,\n style.resultSubtitleScorm,\n failed,\n mode,\n style.statusPlayerResultFailScorm\n )}\n >\n {subtitle}\n </h2>\n {failed && !isEmpty(corrections) ? <AnswersCorrection corrections={corrections} /> : null}\n </div>\n {mode !== 'scorm' ? <IconsPart {...props} /> : null}\n </div>\n );\n};\n\nCorrectionPart.propTypes = {\n ...IconsPart.propTypes,\n failed: PropTypes.bool,\n corrections: AnswersCorrection.propTypes.corrections,\n title: PropTypes.string,\n subtitle: PropTypes.string,\n stars: PropTypes.string,\n rank: PropTypes.string,\n gameOver: PropTypes.bool\n};\n\nconst NextQuestionPart = (props, context) => {\n const {cta, type, extraLifeGranted, gameOver, failed = false, lives = 0, mode} = props;\n const {title, nextStepTitle, showNextLevel = false, ...linkProps} = cta || {};\n let dataNext;\n\n switch (type) {\n case 'popinCorrection': {\n if (gameOver) {\n dataNext = 'game-over';\n } else if (failed) {\n if (lives > 0) {\n dataNext = 'continue-failure';\n } else if (extraLifeGranted) {\n dataNext = 'continue-used-extra-life';\n }\n } else {\n dataNext = 'continue-success';\n }\n break;\n }\n\n case 'popinEnd': {\n if (failed) {\n dataNext = 'redo-content';\n } else if (showNextLevel) {\n dataNext = 'next-level';\n } else {\n dataNext = 'home';\n }\n }\n }\n\n const nextStep = nextStepTitle ? (\n <div\n className={classnames(\n gameOver ? style.gameOverSubtitle : style.nextStepTitle,\n style.innerHTML\n )}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: nextStepTitle}}\n />\n ) : null;\n\n return mode !== 'scorm' ? (\n <Link\n {...linkProps}\n className={classnames(style.nextSection, getLinkStyle({gameOver, extraLifeGranted}))}\n data-name=\"nextLink\"\n data-popin={type}\n data-next={dataNext}\n >\n <div className={style.wrapperNextSection}>\n <div className={style.nextButton}>\n {title}\n <ArrowRight className={style.nextButtonIcon} />\n </div>\n {nextStep}\n </div>\n </Link>\n ) : null;\n};\n\nNextQuestionPart.propTypes = {\n cta: PropTypes.shape({\n ...Link.propTypes,\n title: PropTypes.string,\n nextStepTitle: PropTypes.string,\n showNextLevel: PropTypes.bool\n }),\n type: PropTypes.oneOf(['popinCorrection', 'popinEnd']).isRequired,\n extraLifeGranted: PropTypes.bool,\n gameOver: PropTypes.bool,\n failed: PropTypes.bool,\n lives: PropTypes.number,\n mode: PropTypes.string\n};\n\nconst PopinHeader = (props, context) => {\n const {\n animated,\n failed,\n title,\n subtitle,\n lives,\n stars,\n rank,\n corrections,\n cta,\n extraLifeGranted,\n gameOver = false,\n type,\n mode = 'default'\n } = props;\n const state = buildClass(failed, 'success', 'failed', null);\n\n const nextLink = cta ? (\n <NextQuestionPart\n cta={cta}\n type={type}\n extraLifeGranted={extraLifeGranted}\n failed={failed}\n gameOver={gameOver}\n lives={lives}\n mode={mode}\n />\n ) : null;\n\n return (\n <div\n className={classnames(\n mode === 'scorm' && style.scorm,\n cta ? mode !== 'scorm' && style.header : mode !== 'scorm' && style.headerWithoutCTA\n )}\n data-name=\"popinHeader\"\n data-state={state}\n >\n <div className={classnames(mode !== 'scorm' && style.headerTitle)}>\n <CorrectionPart\n title={title}\n subtitle={subtitle}\n lives={lives}\n animated={animated}\n stars={stars}\n rank={rank}\n failed={failed}\n gameOver={gameOver}\n revival={extraLifeGranted}\n corrections={corrections}\n mode={mode}\n />\n {nextLink}\n </div>\n </div>\n );\n};\n\nPopinHeader.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nPopinHeader.propTypes = {\n cta: NextQuestionPart.propTypes.cta,\n type: NextQuestionPart.propTypes.type,\n extraLifeGranted: NextQuestionPart.propTypes.extraLifeGranted,\n failed: NextQuestionPart.propTypes.failed,\n gameOver: NextQuestionPart.propTypes.gameOver,\n lives: NextQuestionPart.propTypes.lives,\n title: CorrectionPart.propTypes.title,\n subtitle: CorrectionPart.propTypes.subtitle,\n animated: CorrectionPart.propTypes.animated,\n stars: CorrectionPart.propTypes.stars,\n rank: CorrectionPart.propTypes.rank,\n corrections: CorrectionPart.propTypes.corrections,\n mode: PropTypes.oneOf(['scorm', 'default'])\n};\n\nexport default PopinHeader;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAcA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,MAAMA,SAAS,GAAGC,KAAK,iBACrB;EAAM,GAAG,EAAEA,KAAX;EAAkB,SAAS,EAAEC,cAAA,CAAMC;AAAnC,OADF;;AAMA,MAAMC,eAAe,GAAGC,QAAQ,IAAI;EAClC,MAAMC,UAAU,GAAG,qBAAMN,SAAN,EAAiBK,QAAQ,CAACE,MAAT,GAAkB,CAAnC,CAAnB;EACA,OAAO,yEAA4BF,QAA5B,EAAsCC,UAAtC,CAAP;AACD,CAHD;;AAKA,MAAME,iBAAiB,GAAG,CAAC;EAACC;AAAD,CAAD,KAAmB;EAC3C,MAAMC,OAAO,GAAGD,WAAW,CAACE,GAAZ,CAAgB,CAACC,UAAD,EAAaX,KAAb,KAAuB;IACrD,MAAMY,GAAG,GAAI,UAASZ,KAAM,EAA5B;IACA,oBACE;MACE,GAAG,EAAEY,GADP;MAEE,aAAU,QAFZ;MAGE,gBAAcD,UAAU,CAACE,SAH3B;MAIE,SAAS,EAAE,IAAAC,mBAAA,EACTH,UAAU,CAACE,SAAX,GAAuBZ,cAAA,CAAMc,aAA7B,GAA6Cd,cAAA,CAAMe,WAD1C,EAETf,cAAA,CAAMgB,SAFG,CAJb,CAQE;MARF;MASE,uBAAuB,EAAE;QAACC,MAAM,EAAEP,UAAU,CAACQ;MAApB;IAT3B,EADF;EAaD,CAfe,EAebX,WAfa,CAAhB;EAgBA,oBAAO;IAAG,SAAS,EAAEP,cAAA,CAAMmB;EAApB,GAAiCjB,eAAe,CAACM,OAAD,CAAhD,CAAP;AACD,CAlBD;;AAo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AAC1D,SAAf,CAAyBb,WAZhB;EAatByD,IAAI,EAAE3C,kBAAA,CAAUwF,KAAV,CAAgB,CAAC,OAAD,EAAU,SAAV,CAAhB;AAbgB,CAAxB;eAgBeE,W"}
@@ -359,6 +359,7 @@
359
359
  padding: 0;
360
360
  box-sizing: border-box;
361
361
  margin-left: 2px;
362
+ color: inherit;
362
363
  }
363
364
 
364
365
  .nextStepTitle {
@@ -38,7 +38,6 @@
38
38
  "payment_form_submit": "Start Coorpacademy subscription",
39
39
  "Post": "Post",
40
40
  "premium_unsubscribe_confirmation": "We confirm the cancelling of your subscription which will be effective starting from next month.\n\nIn the meantime, you can continue to enjoy our content on the Coorpacademy platform.",
41
- "Press the escape key to close the information text": "Press the escape key to close the information text",
42
41
  "product_cancel": "Cancel at any time.",
43
42
  "product_desc_battle": "Battle mode",
44
43
  "product_desc_certificates": "Coorpacademy certificates",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "11.9.2-alpha.1+921b4b1d4",
3
+ "version": "11.9.2-alpha.4+c0946e65e",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -78,8 +78,7 @@
78
78
  "qs": "6.11.0",
79
79
  "react-autosuggest": "^10.0.2",
80
80
  "react-dropzone": "^9.0.0",
81
- "react-tooltip": "4.5.1",
82
- "uuid": "^9.0.0"
81
+ "react-tooltip": "^4.2.6"
83
82
  },
84
83
  "peerDependencies": {
85
84
  "react": "^17.0.2"
@@ -161,5 +160,5 @@
161
160
  "last 2 versions",
162
161
  "IE 11"
163
162
  ],
164
- "gitHead": "921b4b1d42abb1c57a2f70cea9aee082ee88e026"
163
+ "gitHead": "c0946e65ed2d9bc255b781dfd85ec0952c8a1ace"
165
164
  }
@@ -1,22 +0,0 @@
1
- export function toggleStateOnKeyPress(state: any, setState: any, ref: any): (event: any) => void;
2
- export default ToolTip;
3
- declare function ToolTip({ anchorId, TooltipContent, "aria-label": ariaLabel, "data-testid": dataTestId, closeToolTipInformationTextAriaLabel, toolTipIsVisible: _toolTipIsVisible }: {
4
- anchorId: any;
5
- TooltipContent: any;
6
- "aria-label": any;
7
- "data-testid": any;
8
- closeToolTipInformationTextAriaLabel: any;
9
- toolTipIsVisible: any;
10
- }): JSX.Element;
11
- declare namespace ToolTip {
12
- const propTypes: {
13
- TooltipContent: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.ReactNodeLike>>;
14
- 'data-testid': PropTypes.Requireable<string>;
15
- 'aria-label': PropTypes.Requireable<string>;
16
- closeToolTipInformationTextAriaLabel: PropTypes.Validator<string>;
17
- anchorId: PropTypes.Requireable<string>;
18
- toolTipIsVisible: PropTypes.Requireable<boolean>;
19
- };
20
- }
21
- import PropTypes from "prop-types";
22
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tooltip/index.js"],"names":[],"mappings":"AA+CO,iGASN;;AAED;;;;;;;gBA2EC"}
@@ -1,117 +0,0 @@
1
- import React, { isValidElement, useState, useCallback, useMemo } from 'react';
2
- import PropTypes from 'prop-types';
3
- import ReactTooltip from 'react-tooltip';
4
- import isString from 'lodash/fp/isString';
5
- import { NovaCompositionCoorpacademyInformationIcon as InformationIcon } from '@coorpacademy/nova-icons';
6
- import style from './style.css';
7
-
8
- const ToolTipWrapper = ({
9
- toolTipIsVisible,
10
- anchorId,
11
- closeToolTipInformationTextAriaLabel,
12
- content
13
- }) => {
14
- if (!toolTipIsVisible) return null;
15
-
16
- if (anchorId) {
17
- return /*#__PURE__*/React.createElement(ReactTooltip, {
18
- id: anchorId,
19
- className: style.toolTipReact,
20
- "data-event-off": "click",
21
- place: "left",
22
- effect: "solid",
23
- "aria-label": closeToolTipInformationTextAriaLabel
24
- }, content);
25
- } else {
26
- return /*#__PURE__*/React.createElement("div", {
27
- className: style.toolTip,
28
- "data-testid": "tooltip",
29
- "aria-label": closeToolTipInformationTextAriaLabel
30
- }, content);
31
- }
32
- };
33
-
34
- ToolTipWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
35
- toolTipIsVisible: PropTypes.bool,
36
- anchorId: PropTypes.string,
37
- closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,
38
- content: PropTypes.node
39
- } : {};
40
- export const toggleStateOnKeyPress = (state, setState, ref) => event => {
41
- if (event.key === 'Enter') {
42
- if (ref) ref.current.focus();
43
- event.stopPropagation();
44
- event.preventDefault();
45
- setState(!state);
46
- } else if (event.key === 'Tab' || event.key === 'Escape') {
47
- setState(false);
48
- }
49
- };
50
-
51
- const ToolTip = ({
52
- anchorId,
53
- TooltipContent,
54
- 'aria-label': ariaLabel,
55
- 'data-testid': dataTestId,
56
- closeToolTipInformationTextAriaLabel,
57
- toolTipIsVisible: _toolTipIsVisible
58
- }) => {
59
- const isComponent = useMemo(() => !isString(TooltipContent) && /*#__PURE__*/isValidElement(TooltipContent()), [TooltipContent]);
60
- const [toolTipIsVisible, setToolTipIsVisible] = useState(false);
61
- const handleKeyPress = useCallback(event => {
62
- toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);
63
- }, [toolTipIsVisible]);
64
- const handleMouseOver = useCallback(() => {
65
- setToolTipIsVisible(true);
66
- }, []);
67
- const handleMouseLeave = useCallback(() => {
68
- setToolTipIsVisible(false);
69
- }, []);
70
- const content = useMemo(() => {
71
- return isComponent ? /*#__PURE__*/React.createElement(TooltipContent, null) : /*#__PURE__*/React.createElement("p", {
72
- className: style.tooltipContent
73
- }, TooltipContent);
74
- }, [TooltipContent, isComponent]);
75
- return anchorId ? /*#__PURE__*/React.createElement(ToolTipWrapper, {
76
- toolTipIsVisible: _toolTipIsVisible,
77
- anchorId: anchorId,
78
- closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
79
- content: content,
80
- onMouseLeave: handleMouseLeave,
81
- onMouseOver: handleMouseOver
82
- }) : /*#__PURE__*/React.createElement("div", {
83
- className: style.tooltipContainer,
84
- onMouseLeave: handleMouseLeave,
85
- onMouseOver: handleMouseOver
86
- }, /*#__PURE__*/React.createElement("button", {
87
- type: "button",
88
- className: style.tooltipIconContainer,
89
- "data-testid": dataTestId,
90
- onKeyDown: handleKeyPress,
91
- tabIndex: 0
92
- }, /*#__PURE__*/React.createElement(InformationIcon, {
93
- className: style.informationIcon,
94
- width: 12,
95
- height: 12,
96
- "aria-label": ariaLabel
97
- })), /*#__PURE__*/React.createElement(ToolTipWrapper, {
98
- toolTipIsVisible: toolTipIsVisible,
99
- anchorId: anchorId,
100
- closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
101
- content: content
102
- }));
103
- };
104
-
105
- ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
106
- TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),
107
- 'data-testid': PropTypes.string,
108
- 'aria-label': PropTypes.string,
109
- closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,
110
- // ---------- externalHandling --------------
111
- // if passed down, React Tooltip is used instead, due to limitations on
112
- // parents overflow hidden controls
113
- anchorId: PropTypes.string,
114
- toolTipIsVisible: PropTypes.bool
115
- } : {};
116
- export default ToolTip;
117
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["React","isValidElement","useState","useCallback","useMemo","PropTypes","ReactTooltip","isString","NovaCompositionCoorpacademyInformationIcon","InformationIcon","style","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","toolTipReact","toolTip","propTypes","bool","string","isRequired","node","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","isComponent","setToolTipIsVisible","handleKeyPress","handleMouseOver","handleMouseLeave","tooltipContent","tooltipContainer","tooltipIconContainer","informationIcon","oneOfType","func"],"sources":["../../../src/atom/tooltip/index.js"],"sourcesContent":["import React, {isValidElement, useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport ReactTooltip from 'react-tooltip';\nimport isString from 'lodash/fp/isString';\nimport {NovaCompositionCoorpacademyInformationIcon as InformationIcon} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst ToolTipWrapper = ({\n toolTipIsVisible,\n anchorId,\n closeToolTipInformationTextAriaLabel,\n content\n}) => {\n if (!toolTipIsVisible) return null;\n if (anchorId) {\n return (\n <ReactTooltip\n id={anchorId}\n className={style.toolTipReact}\n data-event-off=\"click\"\n place=\"left\"\n effect=\"solid\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </ReactTooltip>\n );\n } else {\n return (\n <div\n className={style.toolTip}\n data-testid=\"tooltip\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </div>\n );\n }\n};\n\nToolTipWrapper.propTypes = {\n toolTipIsVisible: PropTypes.bool,\n anchorId: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n content: PropTypes.node\n};\n\nexport const toggleStateOnKeyPress = (state, setState, ref) => event => {\n if (event.key === 'Enter') {\n if (ref) ref.current.focus();\n event.stopPropagation();\n event.preventDefault();\n setState(!state);\n } else if (event.key === 'Tab' || event.key === 'Escape') {\n setState(false);\n }\n};\n\nconst ToolTip = ({\n anchorId,\n TooltipContent,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n closeToolTipInformationTextAriaLabel,\n toolTipIsVisible: _toolTipIsVisible\n}) => {\n const isComponent = useMemo(\n () => !isString(TooltipContent) && isValidElement(TooltipContent()),\n [TooltipContent]\n );\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleMouseOver = useCallback(() => {\n setToolTipIsVisible(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setToolTipIsVisible(false);\n }, []);\n\n const content = useMemo(() => {\n return isComponent ? (\n <TooltipContent />\n ) : (\n <p className={style.tooltipContent}>{TooltipContent}</p>\n );\n }, [TooltipContent, isComponent]);\n\n return anchorId ? (\n <ToolTipWrapper\n toolTipIsVisible={_toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n />\n ) : (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={style.tooltipIconContainer}\n data-testid={dataTestId}\n onKeyDown={handleKeyPress}\n tabIndex={0}\n >\n <InformationIcon\n className={style.informationIcon}\n width={12}\n height={12}\n aria-label={ariaLabel}\n />\n </button>\n <ToolTipWrapper\n toolTipIsVisible={toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n />\n </div>\n );\n};\n\nToolTip.propTypes = {\n TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),\n 'data-testid': PropTypes.string,\n 'aria-label': PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n // ---------- externalHandling --------------\n // if passed down, React Tooltip is used instead, due to limitations on\n // parents overflow hidden controls\n anchorId: PropTypes.string,\n toolTipIsVisible: PropTypes.bool\n};\n\nexport default ToolTip;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,cAAf,EAA+BC,QAA/B,EAAyCC,WAAzC,EAAsDC,OAAtD,QAAoE,OAApE;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,YAAP,MAAyB,eAAzB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,SAAQC,0CAA0C,IAAIC,eAAtD,QAA4E,0BAA5E;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cA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EAHf,gBAKE;IACE,IAAI,EAAC,QADP;IAEE,SAAS,EAAE/B,KAAK,CAACmC,oBAFnB;IAGE,eAAaT,UAHf;IAIE,SAAS,EAAEI,cAJb;IAKE,QAAQ,EAAE;EALZ,gBAOE,oBAAC,eAAD;IACE,SAAS,EAAE9B,KAAK,CAACoC,eADnB;IAEE,KAAK,EAAE,EAFT;IAGE,MAAM,EAAE,EAHV;IAIE,cAAYX;EAJd,EAPF,CALF,eAmBE,oBAAC,cAAD;IACE,gBAAgB,EAAEvB,gBADpB;IAEE,QAAQ,EAAEC,QAFZ;IAGE,oCAAoC,EAAEC,oCAHxC;IAIE,OAAO,EAAEC;EAJX,EAnBF,CAVF;AAqCD,CA3ED;;AA6EAkB,OAAO,CAACf,SAAR,2CAAoB;EAClBgB,cAAc,EAAE7B,SAAS,CAAC0C,SAAV,CAAoB,CAAC1C,SAAS,CAAC2C,IAAX,EAAiB3C,SAAS,CAACiB,IAA3B,EAAiCjB,SAAS,CAACe,MAA3C,CAApB,CADE;EAElB,eAAef,SAAS,CAACe,MAFP;EAGlB,cAAcf,SAAS,CAACe,MAHN;EAIlBN,oCAAoC,EAAET,SAAS,CAACe,MAAV,CAAiBC,UAJrC;EAKlB;EACA;EACA;EACAR,QAAQ,EAAER,SAAS,CAACe,MARF;EASlBR,gBAAgB,EAAEP,SAAS,CAACc;AATV,CAApB;AAYA,eAAec,OAAf"}
@@ -1,96 +0,0 @@
1
- @value colors: "../../variables/colors.css";
2
- @value cm_blue_900 from colors;
3
- @value cm_grey_75 from colors;
4
- @value cm_grey_500 from colors;
5
- @value cm_grey_700 from colors;
6
-
7
- .textBase {
8
- font-family: "Gilroy";
9
- font-style: normal;
10
- color: cm_blue_900;
11
- user-select: none;
12
- }
13
-
14
- .tooltipContainer {
15
- overflow: visible;
16
- position: relative;
17
- z-index: 10;
18
- display: flex;
19
- justify-content: center;
20
- justify-self: center;
21
- }
22
-
23
- .tooltipIconContainer {
24
- display: flex;
25
- justify-content: flex-end;
26
- border: none;
27
- background: cm_grey_75;
28
- height: 25px;
29
- align-items: center;
30
- }
31
-
32
- .toolTip {
33
- transition: opacity 0.8s;
34
- position: absolute;
35
- border-radius: 7px;
36
- background-color: cm_grey_700;
37
- right: -75px;
38
- bottom: 32px;
39
- height: auto;
40
- width: 200px;
41
- }
42
-
43
- .toolTip::before {
44
- content: '';
45
- display: inline-block;
46
- visibility: inherit;
47
- opacity: inherit;
48
- width: 15px;
49
- height: 15px;
50
- transform: rotate(-45deg);
51
- background-color: cm_grey_700;
52
- position: inherit;
53
- border-radius: 2px;
54
- bottom: -5px;
55
- right: 40%;
56
- }
57
-
58
- .tooltipContent {
59
- composes: textBase;
60
- font-weight: 500;
61
- font-size: 14px;
62
- display: inline-block;
63
- border-radius: 3px;
64
- word-wrap: break-word;
65
- color: white;
66
- padding: 8px 14px;
67
- text-align: center;
68
- }
69
-
70
- .informationIcon {
71
- color: cm_grey_500;
72
- }
73
-
74
- /* ----------------------- ReactToolTip exclusive classes ------------------------- */
75
- .toolTipReact {
76
- pointer-events: all !important;
77
- background-color: cm_grey_700;
78
- border-radius: 7px !important;
79
- visibility: visible !important;
80
- opacity: 1 !important;
81
- left: 5px;
82
- }
83
-
84
- /* for keyboard navigation, the position can't be obtained from the mouse */
85
- [class*="__react_component_tooltip"]:not(.toolTipReact) {
86
- border-radius: 7px !important;
87
- top: 97px!important;
88
- left: 628px!important;
89
- visibility: visible !important;
90
- opacity: 1!important;
91
- }
92
-
93
- /* same reason, arrow can't be placed effectively */
94
- [class*="__react_component_tooltip"]:not(.toolTipReact)::after {
95
- content: none !important;
96
- }
@@ -1,22 +0,0 @@
1
- export function toggleStateOnKeyPress(state: any, setState: any, ref: any): (event: any) => void;
2
- export default ToolTip;
3
- declare function ToolTip({ anchorId, TooltipContent, "aria-label": ariaLabel, "data-testid": dataTestId, closeToolTipInformationTextAriaLabel, toolTipIsVisible: _toolTipIsVisible }: {
4
- anchorId: any;
5
- TooltipContent: any;
6
- "aria-label": any;
7
- "data-testid": any;
8
- closeToolTipInformationTextAriaLabel: any;
9
- toolTipIsVisible: any;
10
- }): JSX.Element;
11
- declare namespace ToolTip {
12
- const propTypes: {
13
- TooltipContent: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.ReactNodeLike>>;
14
- 'data-testid': PropTypes.Requireable<string>;
15
- 'aria-label': PropTypes.Requireable<string>;
16
- closeToolTipInformationTextAriaLabel: PropTypes.Validator<string>;
17
- anchorId: PropTypes.Requireable<string>;
18
- toolTipIsVisible: PropTypes.Requireable<boolean>;
19
- };
20
- }
21
- import PropTypes from "prop-types";
22
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tooltip/index.js"],"names":[],"mappings":"AA+CO,iGASN;;AAED;;;;;;;gBA2EC"}
@@ -1,137 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.toggleStateOnKeyPress = exports.default = void 0;
5
-
6
- var _react = _interopRequireWildcard(require("react"));
7
-
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
-
10
- var _reactTooltip = _interopRequireDefault(require("react-tooltip"));
11
-
12
- var _isString = _interopRequireDefault(require("lodash/fp/isString"));
13
-
14
- var _novaIcons = require("@coorpacademy/nova-icons");
15
-
16
- var _style = _interopRequireDefault(require("./style.css"));
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- 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); }
21
-
22
- 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; }
23
-
24
- const ToolTipWrapper = ({
25
- toolTipIsVisible,
26
- anchorId,
27
- closeToolTipInformationTextAriaLabel,
28
- content
29
- }) => {
30
- if (!toolTipIsVisible) return null;
31
-
32
- if (anchorId) {
33
- return /*#__PURE__*/_react.default.createElement(_reactTooltip.default, {
34
- id: anchorId,
35
- className: _style.default.toolTipReact,
36
- "data-event-off": "click",
37
- place: "left",
38
- effect: "solid",
39
- "aria-label": closeToolTipInformationTextAriaLabel
40
- }, content);
41
- } else {
42
- return /*#__PURE__*/_react.default.createElement("div", {
43
- className: _style.default.toolTip,
44
- "data-testid": "tooltip",
45
- "aria-label": closeToolTipInformationTextAriaLabel
46
- }, content);
47
- }
48
- };
49
-
50
- ToolTipWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
51
- toolTipIsVisible: _propTypes.default.bool,
52
- anchorId: _propTypes.default.string,
53
- closeToolTipInformationTextAriaLabel: _propTypes.default.string.isRequired,
54
- content: _propTypes.default.node
55
- } : {};
56
-
57
- const toggleStateOnKeyPress = (state, setState, ref) => event => {
58
- if (event.key === 'Enter') {
59
- if (ref) ref.current.focus();
60
- event.stopPropagation();
61
- event.preventDefault();
62
- setState(!state);
63
- } else if (event.key === 'Tab' || event.key === 'Escape') {
64
- setState(false);
65
- }
66
- };
67
-
68
- exports.toggleStateOnKeyPress = toggleStateOnKeyPress;
69
-
70
- const ToolTip = ({
71
- anchorId,
72
- TooltipContent,
73
- 'aria-label': ariaLabel,
74
- 'data-testid': dataTestId,
75
- closeToolTipInformationTextAriaLabel,
76
- toolTipIsVisible: _toolTipIsVisible
77
- }) => {
78
- const isComponent = (0, _react.useMemo)(() => !(0, _isString.default)(TooltipContent) && /*#__PURE__*/(0, _react.isValidElement)(TooltipContent()), [TooltipContent]);
79
- const [toolTipIsVisible, setToolTipIsVisible] = (0, _react.useState)(false);
80
- const handleKeyPress = (0, _react.useCallback)(event => {
81
- toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);
82
- }, [toolTipIsVisible]);
83
- const handleMouseOver = (0, _react.useCallback)(() => {
84
- setToolTipIsVisible(true);
85
- }, []);
86
- const handleMouseLeave = (0, _react.useCallback)(() => {
87
- setToolTipIsVisible(false);
88
- }, []);
89
- const content = (0, _react.useMemo)(() => {
90
- return isComponent ? /*#__PURE__*/_react.default.createElement(TooltipContent, null) : /*#__PURE__*/_react.default.createElement("p", {
91
- className: _style.default.tooltipContent
92
- }, TooltipContent);
93
- }, [TooltipContent, isComponent]);
94
- return anchorId ? /*#__PURE__*/_react.default.createElement(ToolTipWrapper, {
95
- toolTipIsVisible: _toolTipIsVisible,
96
- anchorId: anchorId,
97
- closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
98
- content: content,
99
- onMouseLeave: handleMouseLeave,
100
- onMouseOver: handleMouseOver
101
- }) : /*#__PURE__*/_react.default.createElement("div", {
102
- className: _style.default.tooltipContainer,
103
- onMouseLeave: handleMouseLeave,
104
- onMouseOver: handleMouseOver
105
- }, /*#__PURE__*/_react.default.createElement("button", {
106
- type: "button",
107
- className: _style.default.tooltipIconContainer,
108
- "data-testid": dataTestId,
109
- onKeyDown: handleKeyPress,
110
- tabIndex: 0
111
- }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyInformationIcon, {
112
- className: _style.default.informationIcon,
113
- width: 12,
114
- height: 12,
115
- "aria-label": ariaLabel
116
- })), /*#__PURE__*/_react.default.createElement(ToolTipWrapper, {
117
- toolTipIsVisible: toolTipIsVisible,
118
- anchorId: anchorId,
119
- closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
120
- content: content
121
- }));
122
- };
123
-
124
- ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
125
- TooltipContent: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node, _propTypes.default.string]),
126
- 'data-testid': _propTypes.default.string,
127
- 'aria-label': _propTypes.default.string,
128
- closeToolTipInformationTextAriaLabel: _propTypes.default.string.isRequired,
129
- // ---------- externalHandling --------------
130
- // if passed down, React Tooltip is used instead, due to limitations on
131
- // parents overflow hidden controls
132
- anchorId: _propTypes.default.string,
133
- toolTipIsVisible: _propTypes.default.bool
134
- } : {};
135
- var _default = ToolTip;
136
- exports.default = _default;
137
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","style","toolTipReact","toolTip","propTypes","PropTypes","bool","string","isRequired","node","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","isComponent","useMemo","isString","isValidElement","setToolTipIsVisible","useState","handleKeyPress","useCallback","handleMouseOver","handleMouseLeave","tooltipContent","tooltipContainer","tooltipIconContainer","informationIcon","oneOfType","func"],"sources":["../../../src/atom/tooltip/index.js"],"sourcesContent":["import React, {isValidElement, useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport ReactTooltip from 'react-tooltip';\nimport isString from 'lodash/fp/isString';\nimport {NovaCompositionCoorpacademyInformationIcon as InformationIcon} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst ToolTipWrapper = ({\n toolTipIsVisible,\n anchorId,\n closeToolTipInformationTextAriaLabel,\n content\n}) => {\n if (!toolTipIsVisible) return null;\n if (anchorId) {\n return (\n <ReactTooltip\n id={anchorId}\n className={style.toolTipReact}\n data-event-off=\"click\"\n place=\"left\"\n effect=\"solid\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </ReactTooltip>\n );\n } else {\n return (\n <div\n className={style.toolTip}\n data-testid=\"tooltip\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </div>\n );\n }\n};\n\nToolTipWrapper.propTypes = {\n toolTipIsVisible: PropTypes.bool,\n anchorId: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n content: PropTypes.node\n};\n\nexport const toggleStateOnKeyPress = (state, setState, ref) => event => {\n if (event.key === 'Enter') {\n if (ref) ref.current.focus();\n event.stopPropagation();\n event.preventDefault();\n setState(!state);\n } else if (event.key === 'Tab' || event.key === 'Escape') {\n setState(false);\n }\n};\n\nconst ToolTip = ({\n anchorId,\n TooltipContent,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n closeToolTipInformationTextAriaLabel,\n toolTipIsVisible: _toolTipIsVisible\n}) => {\n const isComponent = useMemo(\n () => !isString(TooltipContent) && isValidElement(TooltipContent()),\n [TooltipContent]\n );\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleMouseOver = useCallback(() => {\n setToolTipIsVisible(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setToolTipIsVisible(false);\n }, []);\n\n const content = useMemo(() => {\n return isComponent ? (\n <TooltipContent />\n ) : (\n <p className={style.tooltipContent}>{TooltipContent}</p>\n );\n }, [TooltipContent, isComponent]);\n\n return anchorId ? (\n <ToolTipWrapper\n toolTipIsVisible={_toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n />\n ) : (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={style.tooltipIconContainer}\n data-testid={dataTestId}\n onKeyDown={handleKeyPress}\n tabIndex={0}\n >\n <InformationIcon\n className={style.informationIcon}\n width={12}\n height={12}\n aria-label={ariaLabel}\n />\n </button>\n <ToolTipWrapper\n toolTipIsVisible={toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n />\n </div>\n );\n};\n\nToolTip.propTypes = {\n TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),\n 'data-testid': PropTypes.string,\n 'aria-label': PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n // ---------- externalHandling --------------\n // if passed down, React Tooltip is used instead, due to limitations on\n // parents overflow hidden controls\n anchorId: PropTypes.string,\n toolTipIsVisible: PropTypes.bool\n};\n\nexport default ToolTip;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,cAAc,GAAG,CAAC;EACtBC,gBADsB;EAEtBC,QAFsB;EAGtBC,oCAHsB;EAItBC;AAJsB,CAAD,KAKjB;EACJ,IAAI,CAACH,gBAAL,EAAuB,OAAO,IAAP;;EACvB,IAAIC,QAAJ,EAAc;IACZ,oBACE,6BAAC,qBAAD;MACE,EAAE,EAAEA,QADN;MAEE,SAAS,EAAEG,cAAA,CAAMC,YAFnB;MAGE,kBAAe,OAHjB;MAIE,KAAK,EAAC,MAJR;MAKE,MAAM,EAAC,OALT;MAME,cAAYH;IANd,GAQGC,OARH,CADF;EAYD,CAbD,MAaO;IACL,oBACE;MACE,SAAS,EAAEC,cAAA,CAAME,OADnB;MAEE,eAAY,SAFd;MAGE,cAAYJ;IAHd,GAKGC,OALH,CADF;EASD;AACF,CA/BD;;AAiCAJ,cAAc,CAACQ,SAAf,2CAA2B;EACzBP,gBAAgB,EAAEQ,kBAAA,CAAUC,IADH;EAEzBR,QAA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