@coorpacademy/components 11.32.1-alpha.25 → 11.32.1

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 (156) hide show
  1. package/es/atom/button-link/index.d.ts +0 -1
  2. package/es/atom/button-link/index.d.ts.map +1 -1
  3. package/es/atom/button-link/index.js +5 -6
  4. package/es/atom/button-link/index.js.map +1 -1
  5. package/es/atom/button-link/types.d.ts +0 -3
  6. package/es/atom/button-link/types.d.ts.map +1 -1
  7. package/es/atom/button-link/types.js +0 -1
  8. package/es/atom/button-link/types.js.map +1 -1
  9. package/es/atom/icon/index.d.ts.map +1 -1
  10. package/es/atom/icon/index.js +0 -3
  11. package/es/atom/icon/index.js.map +1 -1
  12. package/es/atom/input-search/style.css +0 -1
  13. package/es/molecule/cm-popin/types.d.ts +0 -2
  14. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  15. package/es/molecule/expandible-actionable-table/index.d.ts +0 -1
  16. package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
  17. package/es/molecule/expandible-actionable-table/types.d.ts +0 -1
  18. package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
  19. package/es/molecule/learner-skill-card/index.d.ts +0 -2
  20. package/es/molecule/learner-skill-card/index.d.ts.map +1 -1
  21. package/es/molecule/learner-skill-card/index.js +2 -7
  22. package/es/molecule/learner-skill-card/index.js.map +1 -1
  23. package/es/molecule/learning-profile-radar-chart/index.d.ts +1 -1
  24. package/es/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
  25. package/es/molecule/learning-profile-radar-chart/index.js +13 -27
  26. package/es/molecule/learning-profile-radar-chart/index.js.map +1 -1
  27. package/es/molecule/learning-profile-radar-chart/style.css +40 -43
  28. package/es/molecule/learning-profile-radar-chart/types.d.ts +1 -7
  29. package/es/molecule/learning-profile-radar-chart/types.d.ts.map +1 -1
  30. package/es/molecule/learning-profile-radar-chart/types.js.map +1 -1
  31. package/es/molecule/skills-chart-side-information-item/index.d.ts +1 -1
  32. package/es/molecule/skills-chart-side-information-item/index.js +1 -1
  33. package/es/molecule/skills-chart-side-information-item/index.js.map +1 -1
  34. package/es/molecule/skills-chart-side-information-panel/index.d.ts +1 -1
  35. package/es/molecule/skills-chart-side-information-panel/style.css +9 -25
  36. package/es/organism/list-items/index.d.ts +0 -2
  37. package/es/organism/review-no-skills/index.d.ts +1 -2
  38. package/es/organism/review-no-skills/index.d.ts.map +1 -1
  39. package/es/organism/review-no-skills/index.js +4 -8
  40. package/es/organism/review-no-skills/index.js.map +1 -1
  41. package/es/organism/review-no-skills/prop-types.d.ts +0 -2
  42. package/es/organism/review-no-skills/prop-types.d.ts.map +1 -1
  43. package/es/organism/review-no-skills/prop-types.js +1 -2
  44. package/es/organism/review-no-skills/prop-types.js.map +1 -1
  45. package/es/organism/review-no-skills/style.css +0 -7
  46. package/es/organism/setup-header/index.d.ts +0 -4
  47. package/es/organism/wizard-contents/index.d.ts +0 -3
  48. package/es/template/app-player/loading/index.d.ts +0 -2
  49. package/es/template/app-player/player/index.d.ts +0 -4
  50. package/es/template/app-player/player/slides/index.d.ts +0 -2
  51. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  52. package/es/template/app-player/popin-correction/index.d.ts +0 -2
  53. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  54. package/es/template/app-player/popin-end/index.d.ts +0 -2
  55. package/es/template/app-player/popin-header/style.css +1 -1
  56. package/es/template/app-review/index.d.ts +0 -2
  57. package/es/template/app-review/index.d.ts.map +1 -1
  58. package/es/template/app-review/player/prop-types.d.ts +0 -2
  59. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  60. package/es/template/app-review/prop-types.d.ts +0 -2
  61. package/es/template/app-review/prop-types.d.ts.map +1 -1
  62. package/es/template/back-office/brand-create/index.d.ts +0 -4
  63. package/es/template/back-office/brand-create/index.d.ts.map +1 -1
  64. package/es/template/back-office/brand-list/index.d.ts +0 -4
  65. package/es/template/back-office/brand-list/index.d.ts.map +1 -1
  66. package/es/template/back-office/brand-update/index.d.ts +0 -11
  67. package/es/template/back-office/dashboard-preview/index.d.ts +0 -4
  68. package/es/template/back-office/layout/index.d.ts +0 -4
  69. package/es/template/back-office/layout/index.d.ts.map +1 -1
  70. package/es/template/common/dashboard/index.d.ts +0 -4
  71. package/es/template/common/search-page/index.d.ts +0 -2
  72. package/es/template/external-course/index.d.ts +0 -2
  73. package/lib/atom/button-link/index.d.ts +0 -1
  74. package/lib/atom/button-link/index.d.ts.map +1 -1
  75. package/lib/atom/button-link/index.js +5 -6
  76. package/lib/atom/button-link/index.js.map +1 -1
  77. package/lib/atom/button-link/types.d.ts +0 -3
  78. package/lib/atom/button-link/types.d.ts.map +1 -1
  79. package/lib/atom/button-link/types.js +0 -1
  80. package/lib/atom/button-link/types.js.map +1 -1
  81. package/lib/atom/icon/index.d.ts.map +1 -1
  82. package/lib/atom/icon/index.js +0 -3
  83. package/lib/atom/icon/index.js.map +1 -1
  84. package/lib/atom/input-search/style.css +0 -1
  85. package/lib/molecule/cm-popin/types.d.ts +0 -2
  86. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  87. package/lib/molecule/expandible-actionable-table/index.d.ts +0 -1
  88. package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
  89. package/lib/molecule/expandible-actionable-table/types.d.ts +0 -1
  90. package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
  91. package/lib/molecule/learner-skill-card/index.d.ts +0 -2
  92. package/lib/molecule/learner-skill-card/index.d.ts.map +1 -1
  93. package/lib/molecule/learner-skill-card/index.js +2 -7
  94. package/lib/molecule/learner-skill-card/index.js.map +1 -1
  95. package/lib/molecule/learning-profile-radar-chart/index.d.ts +1 -1
  96. package/lib/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
  97. package/lib/molecule/learning-profile-radar-chart/index.js +13 -27
  98. package/lib/molecule/learning-profile-radar-chart/index.js.map +1 -1
  99. package/lib/molecule/learning-profile-radar-chart/style.css +40 -43
  100. package/lib/molecule/learning-profile-radar-chart/types.d.ts +1 -7
  101. package/lib/molecule/learning-profile-radar-chart/types.d.ts.map +1 -1
  102. package/lib/molecule/learning-profile-radar-chart/types.js.map +1 -1
  103. package/lib/molecule/skills-chart-side-information-item/index.d.ts +1 -1
  104. package/lib/molecule/skills-chart-side-information-item/index.js +1 -1
  105. package/lib/molecule/skills-chart-side-information-item/index.js.map +1 -1
  106. package/lib/molecule/skills-chart-side-information-panel/index.d.ts +1 -1
  107. package/lib/molecule/skills-chart-side-information-panel/style.css +9 -25
  108. package/lib/organism/list-items/index.d.ts +0 -2
  109. package/lib/organism/review-no-skills/index.d.ts +1 -2
  110. package/lib/organism/review-no-skills/index.d.ts.map +1 -1
  111. package/lib/organism/review-no-skills/index.js +4 -8
  112. package/lib/organism/review-no-skills/index.js.map +1 -1
  113. package/lib/organism/review-no-skills/prop-types.d.ts +0 -2
  114. package/lib/organism/review-no-skills/prop-types.d.ts.map +1 -1
  115. package/lib/organism/review-no-skills/prop-types.js +1 -2
  116. package/lib/organism/review-no-skills/prop-types.js.map +1 -1
  117. package/lib/organism/review-no-skills/style.css +0 -7
  118. package/lib/organism/setup-header/index.d.ts +0 -4
  119. package/lib/organism/wizard-contents/index.d.ts +0 -3
  120. package/lib/template/app-player/loading/index.d.ts +0 -2
  121. package/lib/template/app-player/player/index.d.ts +0 -4
  122. package/lib/template/app-player/player/slides/index.d.ts +0 -2
  123. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  124. package/lib/template/app-player/popin-correction/index.d.ts +0 -2
  125. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  126. package/lib/template/app-player/popin-end/index.d.ts +0 -2
  127. package/lib/template/app-player/popin-header/style.css +1 -1
  128. package/lib/template/app-review/index.d.ts +0 -2
  129. package/lib/template/app-review/index.d.ts.map +1 -1
  130. package/lib/template/app-review/player/prop-types.d.ts +0 -2
  131. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  132. package/lib/template/app-review/prop-types.d.ts +0 -2
  133. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  134. package/lib/template/back-office/brand-create/index.d.ts +0 -4
  135. package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
  136. package/lib/template/back-office/brand-list/index.d.ts +0 -4
  137. package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
  138. package/lib/template/back-office/brand-update/index.d.ts +0 -11
  139. package/lib/template/back-office/dashboard-preview/index.d.ts +0 -4
  140. package/lib/template/back-office/layout/index.d.ts +0 -4
  141. package/lib/template/back-office/layout/index.d.ts.map +1 -1
  142. package/lib/template/common/dashboard/index.d.ts +0 -4
  143. package/lib/template/common/search-page/index.d.ts +0 -2
  144. package/lib/template/external-course/index.d.ts +0 -2
  145. package/locales/en/global.json +1 -27
  146. package/package.json +2 -2
  147. package/es/template/my-learning/index.d.ts +0 -33
  148. package/es/template/my-learning/index.d.ts.map +0 -1
  149. package/es/template/my-learning/index.js +0 -394
  150. package/es/template/my-learning/index.js.map +0 -1
  151. package/es/template/my-learning/style.css +0 -269
  152. package/lib/template/my-learning/index.d.ts +0 -33
  153. package/lib/template/my-learning/index.d.ts.map +0 -1
  154. package/lib/template/my-learning/index.js +0 -422
  155. package/lib/template/my-learning/index.js.map +0 -1
  156. package/lib/template/my-learning/style.css +0 -269
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["propTypes","type","PropTypes","oneOf","label","string","content","node","icon","shape","position","ICONS","onClick","func","link","href","download","bool","target","disabled","className","customStyle"],"sources":["../../../src/atom/button-link/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport {ICONS} from '../../util/button-icons';\n\nconst propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n label: PropTypes.string,\n content: PropTypes.node,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n 'data-testid': PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS))\n }),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool,\n className: PropTypes.string,\n customStyle: PropTypes.shape({})\n};\n\nexport type FaIcontype = {\n name: string;\n color?: string;\n backgroundColor?: string;\n size?: number;\n};\n\nexport type IconType = {\n position: 'right' | 'left';\n type?: keyof typeof ICONS;\n faIcon?: FaIcontype;\n};\nexport type ButtonLinkProps = {\n type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';\n label?: string;\n content?: React.ReactNode;\n 'aria-label'?: string;\n 'data-name'?: string;\n 'data-testid'?: string;\n icon?: IconType;\n onClick?: () => void;\n onKeyDown?: () => void;\n link?: {\n href?: string;\n download?: boolean;\n target?: '_self' | '_blank' | '_parent' | '_top';\n };\n disabled?: boolean;\n className?: string;\n customStyle?: Record<string, unknown>;\n useTitle?: boolean;\n};\n\nexport type Fixture = {props: ButtonLinkProps};\n\nexport default propTypes;\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;AAEA,MAAMA,SAAS,GAAG;EAChBC,IAAI,EAAEC,kBAAA,CAAUC,KAAV,CAAgB,CAAC,SAAD,EAAY,WAAZ,EAAyB,UAAzB,EAAqC,MAArC,EAA6C,WAA7C,CAAhB,CADU;EAEhBC,KAAK,EAAEF,kBAAA,CAAUG,MAFD;EAGhBC,OAAO,EAAEJ,kBAAA,CAAUK,IAHH;EAIhB,cAAcL,kBAAA,CAAUG,MAJR;EAKhB,aAAaH,kBAAA,CAAUG,MALP;EAMhB,eAAeH,kBAAA,CAAUG,MANT;EAOhBG,IAAI,EAAEN,kBAAA,CAAUO,KAAV,CAAgB;IACpBC,QAAQ,EAAER,kBAAA,CAAUC,KAAV,CAAgB,CAAC,OAAD,EAAU,MAAV,CAAhB,CADU;IAEpBF,IAAI,EAAEC,kBAAA,CAAUC,KAAV,CAAgB,oBAAKQ,kBAAL,CAAhB;EAFc,CAAhB,CAPU;EAWhBC,OAAO,EAAEV,kBAAA,CAAUW,IAXH;EAYhBC,IAAI,EAAEZ,kBAAA,CAAUO,KAAV,CAAgB;IACpBM,IAAI,EAAEb,kBAAA,CAAUG,MADI;IAEpBW,QAAQ,EAAEd,kBAAA,CAAUe,IAFA;IAGpBC,MAAM,EAAEhB,kBAAA,CAAUC,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB;EAHY,CAAhB,CAZU;EAiBhBgB,QAAQ,EAAEjB,kBAAA,CAAUe,IAjBJ;EAkBhBG,SAAS,EAAElB,kBAAA,CAAUG,MAlBL;EAmBhBgB,WAAW,EAAEnB,kBAAA,CAAUO,KAAV,CAAgB,EAAhB;AAnBG,CAAlB;eAyDeT,S"}
1
+ {"version":3,"file":"types.js","names":["propTypes","type","PropTypes","oneOf","label","string","icon","shape","position","ICONS","onClick","func","link","href","download","bool","target","disabled","className","customStyle"],"sources":["../../../src/atom/button-link/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport {ICONS} from '../../util/button-icons';\n\nconst propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n label: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n 'data-testid': PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS))\n }),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool,\n className: PropTypes.string,\n customStyle: PropTypes.shape({})\n};\n\nexport type FaIcontype = {\n name: string;\n color?: string;\n backgroundColor?: string;\n size?: number;\n};\n\nexport type IconType = {\n position: 'right' | 'left';\n type?: keyof typeof ICONS;\n faIcon?: FaIcontype;\n};\nexport type ButtonLinkProps = {\n type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';\n label?: string;\n 'aria-label'?: string;\n 'data-name'?: string;\n 'data-testid'?: string;\n icon?: IconType;\n onClick?: () => void;\n onKeyDown?: () => void;\n link?: {\n href?: string;\n download?: boolean;\n target?: '_self' | '_blank' | '_parent' | '_top';\n };\n disabled?: boolean;\n className?: string;\n customStyle?: Record<string, unknown>;\n useTitle?: boolean;\n};\n\nexport type Fixture = {props: ButtonLinkProps};\n\nexport default propTypes;\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;AAEA,MAAMA,SAAS,GAAG;EAChBC,IAAI,EAAEC,kBAAA,CAAUC,KAAV,CAAgB,CAAC,SAAD,EAAY,WAAZ,EAAyB,UAAzB,EAAqC,MAArC,EAA6C,WAA7C,CAAhB,CADU;EAEhBC,KAAK,EAAEF,kBAAA,CAAUG,MAFD;EAGhB,cAAcH,kBAAA,CAAUG,MAHR;EAIhB,aAAaH,kBAAA,CAAUG,MAJP;EAKhB,eAAeH,kBAAA,CAAUG,MALT;EAMhBC,IAAI,EAAEJ,kBAAA,CAAUK,KAAV,CAAgB;IACpBC,QAAQ,EAAEN,kBAAA,CAAUC,KAAV,CAAgB,CAAC,OAAD,EAAU,MAAV,CAAhB,CADU;IAEpBF,IAAI,EAAEC,kBAAA,CAAUC,KAAV,CAAgB,oBAAKM,kBAAL,CAAhB;EAFc,CAAhB,CANU;EAUhBC,OAAO,EAAER,kBAAA,CAAUS,IAVH;EAWhBC,IAAI,EAAEV,kBAAA,CAAUK,KAAV,CAAgB;IACpBM,IAAI,EAAEX,kBAAA,CAAUG,MADI;IAEpBS,QAAQ,EAAEZ,kBAAA,CAAUa,IAFA;IAGpBC,MAAM,EAAEd,kBAAA,CAAUC,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB;EAHY,CAAhB,CAXU;EAgBhBc,QAAQ,EAAEf,kBAAA,CAAUa,IAhBJ;EAiBhBG,SAAS,EAAEhB,kBAAA,CAAUG,MAjBL;EAkBhBc,WAAW,EAAEjB,kBAAA,CAAUK,KAAV,CAAgB,EAAhB;AAlBG,CAAlB;eAuDeP,S"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.js"],"names":[],"mappings":"AAiBA,mDAAoD;AAiB7C,8DAC8D;;AAGrE,uDAkCG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.js"],"names":[],"mappings":"AAiBA,mDAAoD;AAiB7C,8DAC8D;;AAGrE,uDAgCG"}
@@ -61,7 +61,6 @@ const Icon = /*#__PURE__*/_react.default.memo(function Icon({
61
61
  iconName,
62
62
  iconColor,
63
63
  backgroundColor,
64
- borderRadius,
65
64
  preset = DEFAULT_PRESET,
66
65
  size
67
66
  }) {
@@ -70,7 +69,6 @@ const Icon = /*#__PURE__*/_react.default.memo(function Icon({
70
69
  const wrapperSize = effectiveSize.wrapperSize - ICON_PADDING * 2;
71
70
  const iconWrapperStyle = {
72
71
  backgroundColor,
73
- borderRadius,
74
72
  width: wrapperSize,
75
73
  height: wrapperSize,
76
74
  padding: ICON_PADDING
@@ -89,7 +87,6 @@ Icon.propTypes = process.env.NODE_ENV !== "production" ? {
89
87
  iconName: _propTypes.default.string.isRequired,
90
88
  iconColor: _propTypes.default.string,
91
89
  backgroundColor: _propTypes.default.string,
92
- borderRadius: _propTypes.default.string,
93
90
  preset: _propTypes.default.oneOf(['s', 'm', 'xl']),
94
91
  size: _propTypes.default.shape({
95
92
  faSize: _propTypes.number,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["library","add","fas","DEFAULT_PRESET","ICON_LUMINOSITY","DEFAULT_WRAPPER_SIZE","ICON_PADDING","DEFAULT_ICON_COLOR","SIZE_CONFIGS","s","faSize","wrapperSize","m","xl","getForegroundColor","backgroundColor","convert","Icon","React","memo","iconName","iconColor","borderRadius","preset","size","effectiveIconColor","effectiveSize","merge","getOr","toLower","iconWrapperStyle","width","height","padding","style","iconWrapper","propTypes","PropTypes","string","isRequired","oneOf","shape","number"],"sources":["../../../src/atom/icon/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes, {number} from 'prop-types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {fas} from '@fortawesome/pro-solid-svg-icons';\nimport {library} from '@fortawesome/fontawesome-svg-core';\nimport toLower from 'lodash/fp/toLower';\nimport merge from 'lodash/fp/merge';\nimport getOr from 'lodash/fp/getOr';\nimport {convert} from 'css-color-function';\nimport style from './style.css';\n\nlibrary.add(fas);\n\nconst DEFAULT_PRESET = 'm';\nconst ICON_LUMINOSITY = 32;\nconst DEFAULT_WRAPPER_SIZE = 40;\nconst ICON_PADDING = 8;\nexport const DEFAULT_ICON_COLOR = 'hsl(0, 0%, 32%)';\n\nconst SIZE_CONFIGS = {\n s: {\n faSize: 12,\n wrapperSize: 32\n },\n m: {\n faSize: 16,\n wrapperSize: DEFAULT_WRAPPER_SIZE\n },\n xl: {\n faSize: 20,\n wrapperSize: 48\n }\n};\n\nexport const getForegroundColor = backgroundColor =>\n convert(`color(${backgroundColor} lightness(${ICON_LUMINOSITY}%))`);\n// set lightness to 32%\n\nconst Icon = React.memo(function Icon({\n iconName,\n iconColor,\n backgroundColor,\n borderRadius,\n preset = DEFAULT_PRESET,\n size\n}) {\n const effectiveIconColor =\n iconColor || (backgroundColor ? getForegroundColor(backgroundColor) : DEFAULT_ICON_COLOR);\n\n const effectiveSize = size\n ? merge(SIZE_CONFIGS[DEFAULT_PRESET], size)\n : getOr(SIZE_CONFIGS[DEFAULT_PRESET], toLower(preset), SIZE_CONFIGS);\n\n const wrapperSize = effectiveSize.wrapperSize - ICON_PADDING * 2;\n\n const iconWrapperStyle = {\n backgroundColor,\n borderRadius,\n width: wrapperSize,\n height: wrapperSize,\n padding: ICON_PADDING\n };\n\n return (\n <div className={style.iconWrapper} style={iconWrapperStyle}>\n <FontAwesomeIcon\n icon={`fa-${iconName}`}\n color={effectiveIconColor}\n fontSize={effectiveSize.faSize}\n />\n </div>\n );\n});\n\nIcon.propTypes = {\n iconName: PropTypes.string.isRequired,\n iconColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n borderRadius: PropTypes.string,\n preset: PropTypes.oneOf(['s', 'm', 'xl']),\n size: PropTypes.shape({\n faSize: number,\n wrapperSize: PropTypes.number\n })\n};\n\nexport default Icon;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEAA,2BAAA,CAAQC,GAAR,CAAYC,qBAAZ;;AAEA,MAAMC,cAAc,GAAG,GAAvB;AACA,MAAMC,eAAe,GAAG,EAAxB;AACA,MAAMC,oBAAoB,GAAG,EAA7B;AACA,MAAMC,YAAY,GAAG,CAArB;AACO,MAAMC,kBAAkB,GAAG,iBAA3B;;AAEP,MAAMC,YAAY,GAAG;EACnBC,CAAC,EAAE;IACDC,MAAM,EAAE,EADP;IAEDC,WAAW,EAAE;EAFZ,CADgB;EAKnBC,CAAC,EAAE;IACDF,MAAM,EAAE,EADP;IAEDC,WAAW,EAAEN;EAFZ,CALgB;EASnBQ,EAAE,EAAE;IACFH,MAAM,EAAE,EADN;IAEFC,WAAW,EAAE;EAFX;AATe,CAArB;;AAeO,MAAMG,kBAAkB,GAAGC,eAAe,IAC/C,IAAAC,yBAAA,EAAS,SAAQD,eAAgB,cAAaX,eAAgB,KAA9D,CADK,C,CAEP;;;;;AAEA,MAAMa,IAAI,gBAAGC,cAAA,CAAMC,IAAN,CAAW,SAASF,IAAT,CAAc;EACpCG,QADoC;EAEpCC,SAFoC;EAGpCN,eAHoC;EAIpCO,YAJoC;EAKpCC,MAAM,GAAGpB,cAL2B;EAMpCqB;AANoC,CAAd,EAOrB;EACD,MAAMC,kBAAkB,GACtBJ,SAAS,KAAKN,eAAe,GAAGD,kBAAkB,CAACC,eAAD,C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ICON_LUMINOSITY","DEFAULT_WRAPPER_SIZE","ICON_PADDING","DEFAULT_ICON_COLOR","SIZE_CONFIGS","s","faSize","wrapperSize","m","xl","getForegroundColor","backgroundColor","convert","Icon","React","memo","iconName","iconColor","preset","size","effectiveIconColor","effectiveSize","merge","getOr","toLower","iconWrapperStyle","width","height","padding","style","iconWrapper","propTypes","PropTypes","string","isRequired","oneOf","shape","number"],"sources":["../../../src/atom/icon/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes, {number} from 'prop-types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {fas} from '@fortawesome/pro-solid-svg-icons';\nimport {library} from '@fortawesome/fontawesome-svg-core';\nimport toLower from 'lodash/fp/toLower';\nimport merge from 'lodash/fp/merge';\nimport getOr from 'lodash/fp/getOr';\nimport {convert} from 'css-color-function';\nimport style from './style.css';\n\nlibrary.add(fas);\n\nconst DEFAULT_PRESET = 'm';\nconst ICON_LUMINOSITY = 32;\nconst DEFAULT_WRAPPER_SIZE = 40;\nconst ICON_PADDING = 8;\nexport const DEFAULT_ICON_COLOR = 'hsl(0, 0%, 32%)';\n\nconst SIZE_CONFIGS = {\n s: {\n faSize: 12,\n wrapperSize: 32\n },\n m: {\n faSize: 16,\n wrapperSize: DEFAULT_WRAPPER_SIZE\n },\n xl: {\n faSize: 20,\n wrapperSize: 48\n }\n};\n\nexport const getForegroundColor = backgroundColor =>\n convert(`color(${backgroundColor} lightness(${ICON_LUMINOSITY}%))`);\n// set lightness to 32%\n\nconst Icon = React.memo(function Icon({\n iconName,\n iconColor,\n backgroundColor,\n preset = DEFAULT_PRESET,\n size\n}) {\n const effectiveIconColor =\n iconColor || (backgroundColor ? getForegroundColor(backgroundColor) : DEFAULT_ICON_COLOR);\n\n const effectiveSize = size\n ? merge(SIZE_CONFIGS[DEFAULT_PRESET], size)\n : getOr(SIZE_CONFIGS[DEFAULT_PRESET], toLower(preset), SIZE_CONFIGS);\n\n const wrapperSize = effectiveSize.wrapperSize - ICON_PADDING * 2;\n\n const iconWrapperStyle = {\n backgroundColor,\n width: wrapperSize,\n height: wrapperSize,\n padding: ICON_PADDING\n };\n\n return (\n <div className={style.iconWrapper} style={iconWrapperStyle}>\n <FontAwesomeIcon\n icon={`fa-${iconName}`}\n color={effectiveIconColor}\n fontSize={effectiveSize.faSize}\n />\n </div>\n );\n});\n\nIcon.propTypes = {\n iconName: PropTypes.string.isRequired,\n iconColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n preset: PropTypes.oneOf(['s', 'm', 'xl']),\n size: PropTypes.shape({\n faSize: number,\n wrapperSize: PropTypes.number\n })\n};\n\nexport default Icon;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEAA,2BAAA,CAAQC,GAAR,CAAYC,qBAAZ;;AAEA,MAAMC,cAAc,GAAG,GAAvB;AACA,MAAMC,eAAe,GAAG,EAAxB;AACA,MAAMC,oBAAoB,GAAG,EAA7B;AACA,MAAMC,YAAY,GAAG,CAArB;AACO,MAAMC,kBAAkB,GAAG,iBAA3B;;AAEP,MAAMC,YAAY,GAAG;EACnBC,CAAC,EAAE;IACDC,MAAM,EAAE,EADP;IAEDC,WAAW,EAAE;EAFZ,CADgB;EAKnBC,CAAC,EAAE;IACDF,MAAM,EAAE,EADP;IAEDC,WAAW,EAAEN;EAFZ,CALgB;EASnBQ,EAAE,EAAE;IACFH,MAAM,EAAE,EADN;IAEFC,WAAW,EAAE;EAFX;AATe,CAArB;;AAeO,MAAMG,kBAAkB,GAAGC,eAAe,IAC/C,IAAAC,yBAAA,EAAS,SAAQD,eAAgB,cAAaX,eAAgB,KAA9D,CADK,C,CAEP;;;;;AAEA,MAAMa,IAAI,gBAAGC,cAAA,CAAMC,IAAN,CAAW,SAASF,IAAT,CAAc;EACpCG,QADoC;EAEpCC,SAFoC;EAGpCN,eAHoC;EAIpCO,MAAM,GAAGnB,cAJ2B;EAKpCoB;AALoC,CA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33
  }
34
34
 
35
35
  .search {
36
- background-color: unset;
37
36
  font-family: "Gilroy";
38
37
  text-transform: none;
39
38
  margin: 0 3px;
@@ -80,7 +80,6 @@ declare const propTypes: {
80
80
  buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
81
81
  type: PropTypes.Requireable<string>;
82
82
  label: PropTypes.Requireable<string>;
83
- content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
84
83
  'aria-label': PropTypes.Requireable<string>;
85
84
  'data-name': PropTypes.Requireable<string>;
86
85
  'data-testid': PropTypes.Requireable<string>;
@@ -212,7 +211,6 @@ declare const propTypes: {
212
211
  componentType: PropTypes.Requireable<string>;
213
212
  type: PropTypes.Requireable<string>;
214
213
  label: PropTypes.Requireable<string>;
215
- content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
216
214
  'aria-label': PropTypes.Requireable<string>;
217
215
  'data-name': PropTypes.Requireable<string>;
218
216
  'data-testid': PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAKnC,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAGlD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC;IAC9B,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;QACzB,IAAI,EACA,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,GAChD,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;KACtD,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;CACpD,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -65,7 +65,6 @@ declare const ActionableExpandableTable: {
65
65
  componentType: import("prop-types").Requireable<string>;
66
66
  type: import("prop-types").Requireable<string>;
67
67
  label: import("prop-types").Requireable<string>;
68
- content: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
69
68
  'aria-label': import("prop-types").Requireable<string>;
70
69
  'data-name': import("prop-types").Requireable<string>;
71
70
  'data-testid': import("prop-types").Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandible-actionable-table/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAOjE,OAAO,EAA2C,KAAK,EAAY,MAAM,SAAS,CAAC;AAqCnF,QAAA,MAAM,yBAAyB;YAAW,KAAK,iBAAiB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoL/E,CAAC;AASF,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandible-actionable-table/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAOjE,OAAO,EAA2C,KAAK,EAAY,MAAM,SAAS,CAAC;AAqCnF,QAAA,MAAM,yBAAyB;YAAW,KAAK,iBAAiB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoL/E,CAAC;AASF,eAAe,yBAAyB,CAAC"}
@@ -42,7 +42,6 @@ export declare const propTypes: {
42
42
  componentType: PropTypes.Requireable<string>;
43
43
  type: PropTypes.Requireable<string>;
44
44
  label: PropTypes.Requireable<string>;
45
- content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
46
45
  'aria-label': PropTypes.Requireable<string>;
47
46
  'data-name': PropTypes.Requireable<string>;
48
47
  'data-testid': PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandible-actionable-table/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,OAAO,EAAC,0BAA0B,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,KAAK,IAAI,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAC,KAAK,IAAI,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AA0BzE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBrB,CAAC;AAEF,oBAAY,KAAK,GACb,MAAM,GACN,CAAC,eAAe,GAAG;IACjB,aAAa,EAAE,QAAQ,CAAC;CACzB,CAAC,GACF,CAAC,oBAAoB,GAAG;IACtB,aAAa,EAAE,cAAc,CAAC;CAC/B,CAAC,CAAC;AAEP,oBAAY,SAAS,GACjB,CAA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B,oBAAY,KAAK,GAAG;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,GAAG,MAAM,GAAG,IAAI,GAAG,GAAG,EAAE,CAAC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC,CAAC;AAEF,oBAAY,WAAW,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,CAAC"}
@@ -8,13 +8,11 @@ declare namespace LearnerSkillCard {
8
8
  'aria-label': PropTypes.Requireable<string>;
9
9
  skillTitle: PropTypes.Requireable<string>;
10
10
  skillAriaLabel: PropTypes.Requireable<string>;
11
- focus: PropTypes.Requireable<boolean>;
12
11
  metrics: PropTypes.Requireable<PropTypes.InferProps<{
13
12
  skillCourses: PropTypes.Requireable<number>;
14
13
  skillQuestions: PropTypes.Requireable<number>;
15
14
  completedCourses: PropTypes.Requireable<number>;
16
15
  }>>;
17
- review: PropTypes.Requireable<boolean>;
18
16
  onReviewClick: PropTypes.Requireable<(...args: any[]) => any>;
19
17
  onExploreClick: PropTypes.Requireable<(...args: any[]) => any>;
20
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.js"],"names":[],"mappings":";AASA,yEA2JC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.js"],"names":[],"mappings":";AASA,yEAsJC"}
@@ -32,9 +32,7 @@ const LearnerSkillCard = (props, context) => {
32
32
  'aria-label': ariaLabel,
33
33
  skillTitle,
34
34
  skillAriaLabel,
35
- focus = false,
36
35
  metrics,
37
- review = false,
38
36
  onReviewClick,
39
37
  onExploreClick
40
38
  } = props;
@@ -62,7 +60,6 @@ const LearnerSkillCard = (props, context) => {
62
60
  backgroundColor: '#FFF',
63
61
  transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'
64
62
  },
65
- disabled: !review,
66
63
  onClick: onReviewClick,
67
64
  'aria-label': `${skillTitle}, ${reviewLocale}`,
68
65
  label: reviewLocale,
@@ -128,7 +125,7 @@ const LearnerSkillCard = (props, context) => {
128
125
  "data-name": "skill-title",
129
126
  className: _style.default.skillTitle,
130
127
  "aria-label": skillAriaLabel || skillTitle
131
- }, skillTitle), focus ? /*#__PURE__*/_react.default.createElement("div", {
128
+ }, skillTitle), /*#__PURE__*/_react.default.createElement("div", {
132
129
  className: _style.default.skillFocusBadge
133
130
  }, /*#__PURE__*/_react.default.createElement(_icon.default, {
134
131
  iconName: "bullseye-arrow",
@@ -137,7 +134,7 @@ const LearnerSkillCard = (props, context) => {
137
134
  faSize: 10,
138
135
  wrapperSize: 16
139
136
  }
140
- }), skillFocusLocale) : null), /*#__PURE__*/_react.default.createElement(ProgressBar, null), /*#__PURE__*/_react.default.createElement("div", {
137
+ }), skillFocusLocale)), /*#__PURE__*/_react.default.createElement(ProgressBar, null), /*#__PURE__*/_react.default.createElement("div", {
141
138
  className: _style.default.progressInformations
142
139
  }, skillCourses && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
143
140
  className: _style.default.progressInformation,
@@ -167,13 +164,11 @@ LearnerSkillCard.propTypes = process.env.NODE_ENV !== "production" ? {
167
164
  'aria-label': _propTypes.default.string,
168
165
  skillTitle: _propTypes.default.string,
169
166
  skillAriaLabel: _propTypes.default.string,
170
- focus: _propTypes.default.bool,
171
167
  metrics: _propTypes.default.shape({
172
168
  skillCourses: _propTypes.default.number,
173
169
  skillQuestions: _propTypes.default.number,
174
170
  completedCourses: _propTypes.default.number
175
171
  }),
176
- review: _propTypes.default.bool,
177
172
  onReviewClick: _propTypes.default.func,
178
173
  onExploreClick: _propTypes.default.func
179
174
  } : {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["LearnerSkillCard","props","context","ariaLabel","skillTitle","skillAriaLabel","focus","metrics","review","onReviewClick","onExploreClick","skillCourses","skillQuestions","completedCourses","skin","translate","hovered","setHovered","useState","primarySkinColor","reviewLocale","exploreLocale","coursesLocale","questionsLocale","skillFocusLocale","coursesCompletedLocale","handleMouseOver","useCallback","handleMouseLeave","buttonReviewProps","customStyle","backgroundColor","transition","disabled","onClick","label","buttonExploreProps","convert","color","icon","position","faIcon","name","size","completedPercentage","Number","parseInt","ProgressBar","progressBarColor","inlineProgressValueStyle","width","style","progressWrapper","progress","learnerSkillCardWrapper","skillCoursesAndQuestionsWrapper","skillInformation","skillInformationNumber","skillTitleWrapper","skillFocusBadge","faSize","wrapperSize","progressInformations","progressInformation","progressInformationNumber","ctaWrapper","buttonWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","bool","shape","number","func"],"sources":["../../../src/molecule/learner-skill-card/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport {convert} from 'css-color-function';\nimport {get, getOr} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst LearnerSkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n skillTitle,\n skillAriaLabel,\n focus = false,\n metrics,\n review = false,\n onReviewClick,\n onExploreClick\n } = props;\n const {skillCourses, skillQuestions, completedCourses = 0} = metrics;\n const {skin, translate} = context;\n const [hovered, setHovered] = useState(false);\n const primarySkinColor = getOr('#0061FF', 'common.primary', skin);\n\n const reviewLocale = translate('Review');\n const exploreLocale = translate('Explore');\n const coursesLocale = translate('courses');\n const questionsLocale = translate('questions');\n const skillFocusLocale = translate('skill_focus');\n const coursesCompletedLocale = translate('courses_completed');\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const buttonReviewProps = {\n customStyle: {\n backgroundColor: '#FFF',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n disabled: !review,\n onClick: onReviewClick,\n 'aria-label': `${skillTitle}, ${reviewLocale}`,\n label: reviewLocale,\n 'data-name': 'learner-skill-card-review-button'\n };\n\n const buttonExploreProps = {\n customStyle: {\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n onClick: onExploreClick,\n 'aria-label': `${skillTitle}, ${exploreLocale}`,\n label: exploreLocale,\n 'data-name': 'learner-skill-card-explore-button',\n icon: {\n position: 'left',\n faIcon: {\n name: 'compass',\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n size: 16\n }\n }\n };\n\n const completedPercentage =\n skillCourses && Number.parseInt((completedCourses / skillCourses) * 100);\n\n const ProgressBar = useCallback(() => {\n if (!skillCourses) return null;\n\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${completedPercentage}%`\n };\n\n return (\n <div className={style.progressWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressValueStyle}\n role=\"progressbar\"\n aria-label={get('progression', ariaLabel)}\n />\n </div>\n );\n }, [completedPercentage, ariaLabel, skillCourses]);\n\n return (\n <div\n className={style.learnerSkillCardWrapper}\n data-name=\"learner-skill-card-wrapper\"\n aria-label={ariaLabel}\n >\n {skillCourses || skillQuestions ? (\n <div className={style.skillCoursesAndQuestionsWrapper}>\n {skillCourses ? (\n <div className={style.skillInformation} data-name=\"skill-courses\">\n <span className={style.skillInformationNumber}>{skillCourses}</span> {coursesLocale}\n </div>\n ) : null}\n {skillQuestions ? (\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{skillQuestions}</span>\n &nbsp;{questionsLocale}\n </div>\n ) : null}\n </div>\n ) : null}\n <div className={style.skillTitleWrapper}>\n <div\n data-name=\"skill-title\"\n className={style.skillTitle}\n aria-label={skillAriaLabel || skillTitle}\n >\n {skillTitle}\n </div>\n {focus ? (\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 10,\n wrapperSize: 16\n }}\n />\n {skillFocusLocale}\n </div>\n ) : null}\n </div>\n <ProgressBar />\n <div className={style.progressInformations}>\n {skillCourses && (\n <>\n <div className={style.progressInformation} data-name=\"skill-completed-courses\">\n <span className={style.progressInformationNumber}>{completedCourses}</span>\n {coursesCompletedLocale}\n </div>\n <div className={style.progressInformation} data-name=\"completed-percentage\">\n <span className={style.progressInformationNumber}>{completedPercentage}%</span>\n </div>\n </>\n )}\n </div>\n <div className={style.ctaWrapper} data-name=\"cta-wrapper\">\n <ButtonLink {...buttonReviewProps} />\n <div\n className={style.buttonWrapper}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n data-name=\"button-explore-wrapper\"\n >\n <ButtonLink {...buttonExploreProps} />\n </div>\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = {\n 'aria-label': PropTypes.string,\n skillTitle: PropTypes.string,\n skillAriaLabel: PropTypes.string,\n focus: PropTypes.bool,\n metrics: PropTypes.shape({\n skillCourses: PropTypes.number,\n skillQuestions: PropTypes.number,\n completedCourses: PropTypes.number\n }),\n review: PropTypes.bool,\n onReviewClick: PropTypes.func,\n onExploreClick: PropTypes.func\n};\n\nexport default LearnerSkillCard;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;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6D,kBAAA,CAAUK;AAZC,CAA7B;eAee5E,gB"}
1
+ {"version":3,"file":"index.js","names":["LearnerSkillCard","props","context","ariaLabel","skillTitle","skillAriaLabel","metrics","onReviewClick","onExploreClick","skillCourses","skillQuestions","completedCourses","skin","translate","hovered","setHovered","useState","primarySkinColor","reviewLocale","exploreLocale","coursesLocale","questionsLocale","skillFocusLocale","coursesCompletedLocale","handleMouseOver","useCallback","handleMouseLeave","buttonReviewProps","customStyle","backgroundColor","transition","onClick","label","buttonExploreProps","convert","color","icon","position","faIcon","name","size","completedPercentage","Number","parseInt","ProgressBar","progressBarColor","inlineProgressValueStyle","width","style","progressWrapper","progress","learnerSkillCardWrapper","skillCoursesAndQuestionsWrapper","skillInformation","skillInformationNumber","skillTitleWrapper","skillFocusBadge","faSize","wrapperSize","progressInformations","progressInformation","progressInformationNumber","ctaWrapper","buttonWrapper","contextTypes","Provider","childContextTypes","propTypes","PropTypes","string","shape","number","func"],"sources":["../../../src/molecule/learner-skill-card/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport {convert} from 'css-color-function';\nimport {get, getOr} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst LearnerSkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n skillTitle,\n skillAriaLabel,\n metrics,\n onReviewClick,\n onExploreClick\n } = props;\n const {skillCourses, skillQuestions, completedCourses = 0} = metrics;\n const {skin, translate} = context;\n const [hovered, setHovered] = useState(false);\n const primarySkinColor = getOr('#0061FF', 'common.primary', skin);\n\n const reviewLocale = translate('Review');\n const exploreLocale = translate('Explore');\n const coursesLocale = translate('courses');\n const questionsLocale = translate('questions');\n const skillFocusLocale = translate('skill_focus');\n const coursesCompletedLocale = translate('courses_completed');\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const buttonReviewProps = {\n customStyle: {\n backgroundColor: '#FFF',\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n onClick: onReviewClick,\n 'aria-label': `${skillTitle}, ${reviewLocale}`,\n label: reviewLocale,\n 'data-name': 'learner-skill-card-review-button'\n };\n\n const buttonExploreProps = {\n customStyle: {\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'\n },\n onClick: onExploreClick,\n 'aria-label': `${skillTitle}, ${exploreLocale}`,\n label: exploreLocale,\n 'data-name': 'learner-skill-card-explore-button',\n icon: {\n position: 'left',\n faIcon: {\n name: 'compass',\n backgroundColor: hovered ? primarySkinColor : convert(`color(${primarySkinColor} a(0.07))`),\n color: hovered ? '#FFFFFF' : primarySkinColor,\n size: 16\n }\n }\n };\n\n const completedPercentage =\n skillCourses && Number.parseInt((completedCourses / skillCourses) * 100);\n\n const ProgressBar = useCallback(() => {\n if (!skillCourses) return null;\n\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${completedPercentage}%`\n };\n\n return (\n <div className={style.progressWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressValueStyle}\n role=\"progressbar\"\n aria-label={get('progression', ariaLabel)}\n />\n </div>\n );\n }, [completedPercentage, ariaLabel, skillCourses]);\n\n return (\n <div\n className={style.learnerSkillCardWrapper}\n data-name=\"learner-skill-card-wrapper\"\n aria-label={ariaLabel}\n >\n {skillCourses || skillQuestions ? (\n <div className={style.skillCoursesAndQuestionsWrapper}>\n {skillCourses ? (\n <div className={style.skillInformation} data-name=\"skill-courses\">\n <span className={style.skillInformationNumber}>{skillCourses}</span> {coursesLocale}\n </div>\n ) : null}\n {skillQuestions ? (\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{skillQuestions}</span>\n &nbsp;{questionsLocale}\n </div>\n ) : null}\n </div>\n ) : null}\n <div className={style.skillTitleWrapper}>\n <div\n data-name=\"skill-title\"\n className={style.skillTitle}\n aria-label={skillAriaLabel || skillTitle}\n >\n {skillTitle}\n </div>\n <div className={style.skillFocusBadge}>\n <Icon\n iconName=\"bullseye-arrow\"\n backgroundColor=\"#DDD1FF\"\n size={{\n faSize: 10,\n wrapperSize: 16\n }}\n />\n {skillFocusLocale}\n </div>\n </div>\n <ProgressBar />\n <div className={style.progressInformations}>\n {skillCourses && (\n <>\n <div className={style.progressInformation} data-name=\"skill-completed-courses\">\n <span className={style.progressInformationNumber}>{completedCourses}</span>\n {coursesCompletedLocale}\n </div>\n <div className={style.progressInformation} data-name=\"completed-percentage\">\n <span className={style.progressInformationNumber}>{completedPercentage}%</span>\n </div>\n </>\n )}\n </div>\n <div className={style.ctaWrapper} data-name=\"cta-wrapper\">\n <ButtonLink {...buttonReviewProps} />\n <div\n className={style.buttonWrapper}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n data-name=\"button-explore-wrapper\"\n >\n <ButtonLink {...buttonExploreProps} />\n </div>\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = {\n 'aria-label': PropTypes.string,\n skillTitle: PropTypes.string,\n skillAriaLabel: PropTypes.string,\n metrics: PropTypes.shape({\n skillCourses: PropTypes.number,\n skillQuestions: PropTypes.number,\n completedCourses: PropTypes.number\n }),\n onReviewClick: PropTypes.func,\n onExploreClick: PropTypes.func\n};\n\nexport default LearnerSkillCard;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC3C,MAAM;IACJ,cAAcC,SADV;IAEJC,UAFI;IAGJC,cAHI;IAIJC,OAJI;IAKJC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F,CALF,CAFJ,CAzCF,eAsDE;IAAK,SAAS,EAAEO,cAAA,CAAMc,UAAtB;IAAkC,aAAU;EAA5C,gBACE,6BAAC,mBAAD,EAAgBnC,iBAAhB,CADF,eAEE;IACE,SAAS,EAAEqB,cAAA,CAAMe,aADnB;IAEE,WAAW,EAAEvC,eAFf;IAGE,YAAY,EAAEE,gBAHhB;IAIE,aAAU;EAJZ,gBAME,6BAAC,mBAAD,EAAgBO,kBAAhB,CANF,CAFF,CAtDF,CADF;AAoED,CAtJD;;AAwJAjC,gBAAgB,CAACgE,YAAjB,GAAgC;EAC9BnD,SAAS,EAAEoD,iBAAA,CAASC,iBAAT,CAA2BrD;AADR,CAAhC;AAIAb,gBAAgB,CAACmE,SAAjB,2CAA6B;EAC3B,cAAcC,kBAAA,CAAUC,MADG;EAE3BjE,UAAU,EAAEgE,kBAAA,CAAUC,MAFK;EAG3BhE,cAAc,EAAE+D,kBAAA,CAAUC,MAHC;EAI3B/D,OAAO,EAAE8D,kBAAA,CAAUE,KAAV,CAAgB;IACvB7D,YAAY,EAAE2D,kBAAA,CAAUG,MADD;IAEvB7D,cAAc,EAAE0D,kBAAA,CAAUG,MAFH;IAGvB5D,gBAAgB,EAAEyD,kBAAA,CAAUG;EAHL,CAAhB,CAJkB;EAS3BhE,aAAa,EAAE6D,kBAAA,CAAUI,IATE;EAU3BhE,cAAc,EAAE4D,kBAAA,CAAUI;AAVC,CAA7B;eAaexE,gB"}
@@ -4,7 +4,7 @@ export declare const formatData: (legend: {
4
4
  [ref: string]: string;
5
5
  }, data_: LearningProfileRadarChartPropTypes['data']) => FormatedDataType[];
6
6
  export declare const LearningProfileRadarChart: {
7
- ({ data, legend, totalDataset, colors: colorsProps, onClick, width, height, margin }: LearningProfileRadarChartPropTypes): JSX.Element;
7
+ ({ data, legend, totalDataset, colors: colorsProps, onClick, width, height }: LearningProfileRadarChartPropTypes): JSX.Element;
8
8
  propTypes: {
9
9
  data: import("prop-types").Validator<{
10
10
  [x: string]: NonNullable<number | (number | null | undefined)[] | null | undefined> | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learning-profile-radar-chart/index.tsx"],"names":[],"mappings":";AA6BA,OAAO,EAGL,gBAAgB,EAChB,kCAAkC,EAGnC,MAAM,SAAS,CAAC;AAkQjB,eAAO,MAAM,UAAU,EAAE,CACvB,MAAM,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAC,EAC/B,KAAK,EAAE,kCAAkC,CAAC,MAAM,CAAC,KAC9C,gBAAgB,EAOX,CAAC;AAEX,eAAO,MAAM,yBAAyB;0FASnC,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;CAqHpC,CAAC;AAEF,QAAA,MAAM,mCAAmC;YAAW,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;CAIrF,CAAC;AAKF,eAAe,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learning-profile-radar-chart/index.tsx"],"names":[],"mappings":";AA6BA,OAAO,EAGL,gBAAgB,EAChB,kCAAkC,EAGnC,MAAM,SAAS,CAAC;AAwPjB,eAAO,MAAM,UAAU,EAAE,CACvB,MAAM,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAC,EAC/B,KAAK,EAAE,kCAAkC,CAAC,MAAM,CAAC,KAC9C,gBAAgB,EAOX,CAAC;AAEX,eAAO,MAAM,yBAAyB;kFAQnC,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;CAiHpC,CAAC;AAEF,QAAA,MAAM,mCAAmC;YAAW,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;CAIrF,CAAC;AAKF,eAAe,mCAAmC,CAAC"}
@@ -59,7 +59,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
59
59
  const top = {
60
60
  offset: {
61
61
  x: -100,
62
- y: -75
62
+ y: -65
63
63
  },
64
64
  alignment: 'center',
65
65
  margin: 'auto'
@@ -129,10 +129,10 @@ const CHART_CONFIGS = {
129
129
  }
130
130
  };
131
131
  const DOT_DEFAULT_PROPS = {
132
- strokeWidth: 2,
133
- strokeOpacity: 0.4,
132
+ strokeWidth: 4,
133
+ strokeOpacity: 0.2,
134
134
  fill: '#fff',
135
- r: 4,
135
+ r: 8,
136
136
  pointerEvents: 'all',
137
137
  style: {
138
138
  cursor: 'pointer'
@@ -140,12 +140,12 @@ const DOT_DEFAULT_PROPS = {
140
140
  };
141
141
  const DOT_ACTIVE_PROPS = {
142
142
  fill: '#fff',
143
- r: 6,
144
- strokeWidth: 4,
145
- strokeOpacity: 0.6
143
+ r: 8,
144
+ strokeWidth: 6,
145
+ strokeOpacity: 0.5
146
146
  };
147
147
  const RADAR_DEFAULT_PROPS = {
148
- strokeWidth: 3,
148
+ strokeWidth: 6,
149
149
  strokeOpacity: 0.2,
150
150
  fillOpacity: 0.2
151
151
  };
@@ -192,10 +192,6 @@ const CustomDot = ({
192
192
  stroke,
193
193
  cx,
194
194
  cy,
195
- onTouchStart: () => {
196
- if (!payload?.name) return;
197
- onDotClick(payload.name);
198
- },
199
195
  onClick: e => {
200
196
  e.stopPropagation();
201
197
  if (!payload?.name) return;
@@ -258,7 +254,6 @@ const buildCustomLabel = ({
258
254
  }
259
255
 
260
256
  return /*#__PURE__*/_react.default.createElement("g", null, /*#__PURE__*/_react.default.createElement("foreignObject", {
261
- className: _style.default.tickeForeignObject,
262
257
  x: x + offsetX,
263
258
  y: y + offsetY,
264
259
  width: "200",
@@ -315,8 +310,7 @@ const LearningProfileRadarChart = ({
315
310
  colors: colorsProps,
316
311
  onClick,
317
312
  width,
318
- height,
319
- margin
313
+ height
320
314
  }) => {
321
315
  const [isMobile, setIsMobile] = (0, _react.useState)(false);
322
316
  const [activeDot, setActiveDot] = (0, _react.useState)();
@@ -347,16 +341,13 @@ const LearningProfileRadarChart = ({
347
341
  }, [isMobile_]);
348
342
  (0, _react.useEffect)(() => setIsMobile_(), [setIsMobile_]);
349
343
  (0, _react.useEffect)(() => {
350
- const handleClick = () => {
351
- setActiveDot(undefined);
352
- onClick(undefined);
353
- };
344
+ const handleClick = () => setActiveDot(undefined);
354
345
 
355
346
  !(0, _isEmpty2.default)(activeDot) && window.addEventListener('click', handleClick);
356
347
  return () => {
357
348
  window.removeEventListener('click', handleClick);
358
349
  };
359
- }, [activeDot, onClick, setActiveDot]);
350
+ }, [activeDot]);
360
351
 
361
352
  function handleOnDotClick(label) {
362
353
  const payload = formatedData.find(({
@@ -406,18 +397,13 @@ const LearningProfileRadarChart = ({
406
397
  return /*#__PURE__*/_react.default.createElement(_recharts.RadarChart, {
407
398
  width: width,
408
399
  height: height,
409
- margin: margin ?? (isMobile ? {
410
- top: 80
411
- } : {
412
- top: 180
413
- }),
414
400
  cx: "50%",
415
401
  cy: "50%",
416
402
  outerRadius: "80%",
417
403
  data: formatedData
418
404
  }, gradients, buildRadars(totalDataset, handleOnDotClick, activeDot), /*#__PURE__*/_react.default.createElement(_recharts.PolarGrid, {
419
- strokeDasharray: 10,
420
- strokeWidth: 2,
405
+ strokeDasharray: 15,
406
+ strokeWidth: 3,
421
407
  radialLines: false
422
408
  }), /*#__PURE__*/_react.default.createElement(_recharts.PolarAngleAxis, {
423
409
  dataKey: "subject",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["top","offset","x","y","alignment","margin","bottom","right","marginRight","left","marginLeft","BLACK","WHITE","DEFAULT_MAIN_COLOR","DEFAULT_COLORS","gradient","fill","stroke","percentage","color","background","label","CHART_CONFIGS","triangle","name","ticks","sideCount","quadrilateral","pentagon","hexagon","DOT_DEFAULT_PROPS","strokeWidth","strokeOpacity","r","pointerEvents","style","cursor","DOT_ACTIVE_PROPS","RADAR_DEFAULT_PROPS","fillOpacity","Gradient","type","colors","firstColor","secondColor","CustomTooltip","active","payload","length","tooltip","tooltipLabel","tooltipValue","value","CustomDot","cx","cy","onDotClick","activeDot","dataName","subject","onTouchStart","onClick","e","stopPropagation","buildRadars","totalDataset","handleOnDotClick","index","datakey","dataset","buildCustomLabel","percentagesValues","chartType","formatedColors","isCurrentDotActive","offsetX","offsetY","rest","onLabelClick","tickeForeignObject","classnames","tickWrapper","tickWrapperFocus","alignItems","textAlign","opacity","map","colorLabel","i","tickValue","tickLabel","CHART_CONFIGS_BY_SIDE_COUNT","formatValues","values_","val","formatData","legend","data_","ref","LearningProfileRadarChart","data","colorsProps","width","height","isMobile","setIsMobile","useState","setActiveDot","Object","assign","useMemo","gradients","userAgent","navigator","isMobile_","getIsMobile","setIsMobile_","useCallback","useEffect","handleClick","undefined","window","addEventListener","removeEventListener","formatedData","find","indexOf","skillRef","key","renderCustomLabel","currentData","ResponsiveLearningProfileRadarChart","props","propTypes","learningProfileRadarChartPropTypes"],"sources":["../../../src/molecule/learning-profile-radar-chart/index.tsx"],"sourcesContent":["import React, {Fragment, useCallback, useEffect, useMemo, useState} from 'react';\nimport {\n Radar,\n RadarChart,\n PolarGrid,\n PolarAngleAxis,\n ResponsiveContainer,\n Tooltip,\n PolarRadiusAxis\n} from 'recharts';\nimport {\n pipe,\n keyBy,\n mapValues,\n size,\n getOr,\n map,\n toPairs,\n values,\n isEmpty,\n omit,\n fromPairs,\n times,\n flatten,\n findKey\n} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {isMobile as getIsMobile} from '../../util/check-is-mobile';\nimport style from './style.css';\nimport {\n ActiveDotType,\n FormatedColorsType,\n FormatedDataType,\n LearningProfileRadarChartPropTypes,\n TickType,\n learningProfileRadarChartPropTypes\n} from './types';\n\ntype CHART_TYPE_TYPE = keyof typeof CHART_CONFIGS;\n\n/* TICK_POSITIONS */\nconst top: TickType = {offset: {x: -100, y: -75}, alignment: 'center', margin: 'auto'};\nconst bottom: TickType = {offset: {x: -100, y: 10}, alignment: 'center', margin: 'auto'};\nconst right: TickType = {offset: {x: 30, y: -10}, alignment: 'start', marginRight: 'auto'};\nconst left: TickType = {offset: {x: -230, y: -10}, alignment: 'end', marginLeft: 'auto'};\n\n/* CONSTANTS */\nconst BLACK = '#000000ff';\nconst WHITE = '#ffffffff';\nconst DEFAULT_MAIN_COLOR = '#0062ffff';\n\nconst DEFAULT_COLORS: FormatedColorsType = {\n gradient: {\n fill: [DEFAULT_MAIN_COLOR, DEFAULT_MAIN_COLOR],\n stroke: [DEFAULT_MAIN_COLOR, DEFAULT_MAIN_COLOR]\n },\n percentage: {\n color: BLACK,\n background: WHITE\n },\n label: {\n color: BLACK\n }\n};\n\nconst CHART_CONFIGS = {\n triangle: {\n name: 'triangle',\n ticks: [top, right, left],\n sideCount: 3\n },\n quadrilateral: {\n name: 'quadrilateral',\n ticks: [top, right, bottom, left],\n sideCount: 4\n },\n pentagon: {\n name: 'pentagon',\n ticks: [top, right, right, left, left],\n sideCount: 5\n },\n hexagon: {\n name: 'hexagon',\n ticks: [top, right, right, bottom, left, left],\n sideCount: 6\n }\n} as const;\n\nconst DOT_DEFAULT_PROPS = {\n strokeWidth: 2,\n strokeOpacity: 0.4,\n fill: '#fff',\n r: 4,\n pointerEvents: 'all',\n style: {cursor: 'pointer'}\n} as const;\n\nconst DOT_ACTIVE_PROPS = {\n fill: '#fff',\n r: 6,\n strokeWidth: 4,\n strokeOpacity: 0.6\n} as const;\n\nconst RADAR_DEFAULT_PROPS = {\n strokeWidth: 3,\n strokeOpacity: 0.2,\n fillOpacity: 0.2\n} as const;\n\n/* COMPONENTS */\nconst Gradient = ({type, colors: [firstColor, secondColor]}: {type: string; colors: string[]}) => (\n <defs>\n <linearGradient id={`gradient-${type}`} x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">\n <stop offset=\"0%\" stopColor={firstColor} />\n <stop offset=\"100%\" stopColor={secondColor} />\n </linearGradient>\n </defs>\n);\n\nconst CustomTooltip = ({\n active,\n payload,\n label\n}: {\n active?: boolean;\n payload?: {value: number}[];\n label?: string;\n}) =>\n active && !!payload?.length ? (\n <div className={style.tooltip}>\n <span className={style.tooltipLabel}>{label}</span>\n <span className={style.tooltipValue}>{payload[0].value}%</span>\n </div>\n ) : null;\n\nconst CustomDot = ({\n cx,\n cy,\n payload,\n onDotClick,\n stroke,\n activeDot,\n dataName\n}: {\n cx?: number;\n cy?: number;\n payload?: {payload: {subject: string} & {[datakey: string]: number}; name: string};\n onDotClick: (name: string) => void;\n dataKey: string;\n stroke: string;\n activeDot?: ActiveDotType;\n dataName: string;\n}) => (\n <circle\n {...{\n ...DOT_DEFAULT_PROPS,\n ...(payload?.payload.subject === activeDot?.label && DOT_ACTIVE_PROPS),\n stroke,\n cx,\n cy,\n onTouchStart: () => {\n if (!payload?.name) return;\n onDotClick(payload.name);\n },\n onClick: e => {\n e.stopPropagation();\n\n if (!payload?.name) return;\n onDotClick(payload.name);\n },\n 'data-name': dataName\n }}\n />\n);\n\nconst buildRadars = (\n totalDataset: number,\n handleOnDotClick: (name: string) => void,\n activeDot?: ActiveDotType\n) =>\n times(index => {\n const datakey = `value${index + 1}`;\n const dataset = `dataset-${index + 1}`;\n\n return (\n <Radar\n {...RADAR_DEFAULT_PROPS}\n fill={`url(#gradient-fill-${index})`}\n stroke={`url(#gradient-stroke-${index})`}\n key={dataset}\n name={dataset}\n dataKey={datakey}\n activeDot={{\n ...DOT_ACTIVE_PROPS,\n stroke: `url(#gradient-stroke-${index})`\n }}\n // only on mobile\n // to handle dot style on hover (convert to click)\n // use with the tooltip component\n dot={\n <CustomDot\n onDotClick={handleOnDotClick}\n activeDot={activeDot}\n dataKey={datakey}\n stroke={`url(#gradient-stroke-${index})`}\n dataName={`dot-${dataset}`}\n />\n }\n />\n );\n }, totalDataset);\n\nconst buildCustomLabel = ({\n index,\n x,\n y,\n percentagesValues,\n label,\n activeDot,\n chartType,\n formatedColors,\n onClick\n}: {\n index: number;\n x: number;\n y: number;\n percentagesValues: number[];\n label: string;\n chartType: CHART_TYPE_TYPE;\n formatedColors: FormatedColorsType[];\n activeDot?: ActiveDotType;\n onClick: (name: string) => void;\n}) => {\n const isCurrentDotActive = activeDot?.label === label;\n const {\n offset: {x: offsetX, y: offsetY},\n alignment,\n ...rest\n } = CHART_CONFIGS[chartType].ticks[index];\n\n function onLabelClick(e: React.MouseEvent) {\n e.stopPropagation();\n onClick(label);\n }\n\n return (\n <g>\n <foreignObject\n className={style.tickeForeignObject}\n x={x + offsetX}\n y={y + offsetY}\n width=\"200\"\n height=\"65\"\n >\n <div\n data-name={label}\n onClick={onLabelClick}\n className={classnames(style.tickWrapper, isCurrentDotActive && style.tickWrapperFocus)}\n style={{\n ...rest,\n alignItems: alignment,\n textAlign: alignment,\n opacity: !isEmpty(activeDot) && !isCurrentDotActive ? 0.3 : 1\n }}\n >\n {formatedColors.map(\n ({percentage: {color, background}, label: {color: colorLabel}}, i) => (\n <Fragment key={i}>\n <span className={style.tickValue} style={{color, background}}>\n {percentagesValues[i]}\n </span>\n <span className={style.tickLabel} style={{color: colorLabel}}>\n {label}\n </span>\n </Fragment>\n )\n )}\n </div>\n </foreignObject>\n </g>\n );\n};\n\n/* UTILS */\nconst CHART_CONFIGS_BY_SIDE_COUNT = pipe(keyBy('sideCount'), mapValues('name'))(CHART_CONFIGS);\n\nconst formatValues: (values_: number | number[]) => Record<string, number> = pipe(\n values_ => flatten([values_]),\n values_ => values_.map((val: number, i: number): [string, number] => [`value${i + 1}`, val]),\n fromPairs\n);\n\n/* this convert incoming component data to rechart data structure */\nexport const formatData: (\n legend: {[ref: string]: string},\n data_: LearningProfileRadarChartPropTypes['data']\n) => FormatedDataType[] = (legend, data_) =>\n pipe(\n toPairs,\n map(([ref, values_]: [string, number | number[]]) => ({\n ...formatValues(values_),\n subject: legend[ref]\n }))\n )(data_);\n\nexport const LearningProfileRadarChart = ({\n data,\n legend,\n totalDataset,\n colors: colorsProps,\n onClick,\n width,\n height,\n margin\n}: LearningProfileRadarChartPropTypes) => {\n const [isMobile, setIsMobile] = useState(false);\n const [activeDot, setActiveDot] = useState<ActiveDotType>();\n\n const formatedColors = times(i => {\n if (!colorsProps?.length) return DEFAULT_COLORS;\n\n const colors = colorsProps[i];\n return colors ? Object.assign({}, DEFAULT_COLORS, colors) : DEFAULT_COLORS;\n })(totalDataset);\n\n const chartType: CHART_TYPE_TYPE = useMemo(\n () => getOr('hexagon', size(data), CHART_CONFIGS_BY_SIDE_COUNT),\n [data]\n );\n\n const gradients = useMemo(\n () =>\n formatedColors.map(({gradient: {fill, stroke}}, index) => (\n <svg key={`gradient-${index}`}>\n <Gradient type={`fill-${index}`} colors={fill} />\n <Gradient type={`stroke-${index}`} colors={stroke} />\n </svg>\n )),\n [formatedColors]\n );\n\n const userAgent = navigator?.userAgent;\n const isMobile_ = useMemo(() => getIsMobile(userAgent), [userAgent]);\n\n const setIsMobile_ = useCallback(() => {\n setIsMobile(isMobile_);\n }, [isMobile_]);\n\n useEffect(() => setIsMobile_(), [setIsMobile_]);\n\n useEffect(() => {\n const handleClick = () => {\n setActiveDot(undefined);\n onClick(undefined);\n };\n\n !isEmpty(activeDot) && window.addEventListener('click', handleClick);\n\n return () => {\n window.removeEventListener('click', handleClick);\n };\n }, [activeDot, onClick, setActiveDot]);\n\n function handleOnDotClick(label: string) {\n const payload = formatedData.find(({subject}) => subject === label);\n if (!payload) return;\n\n const index = formatedData.indexOf(payload);\n const datakey = `value${index + 1}`;\n const skillRef = findKey(val => val === payload?.subject, legend);\n\n if (skillRef) {\n setActiveDot({\n key: datakey,\n value: payload[datakey],\n label: payload.subject\n });\n onClick(skillRef);\n }\n }\n\n function renderCustomLabel({\n x,\n y,\n payload: {value: label},\n index\n }: {\n x: number;\n y: number;\n payload: {value: string};\n index: number;\n }) {\n const currentData = formatedData.find(({subject}) => subject === label);\n const percentagesValues: number[] = pipe(\n omit('subject'),\n mapValues(value => `${value}%`),\n values\n )(currentData);\n\n return buildCustomLabel({\n index,\n x,\n y,\n percentagesValues,\n label,\n activeDot,\n chartType,\n formatedColors,\n onClick: handleOnDotClick\n });\n }\n const formatedData = useMemo(() => formatData(legend, data), [legend, data]);\n\n return (\n <RadarChart\n width={width}\n height={height}\n margin={margin ?? (isMobile ? {top: 80} : {top: 180})}\n cx=\"50%\"\n cy=\"50%\"\n outerRadius=\"80%\"\n data={formatedData}\n >\n {gradients}\n {buildRadars(totalDataset, handleOnDotClick, activeDot)}\n <PolarGrid strokeDasharray={10} strokeWidth={2} radialLines={false} />\n <PolarAngleAxis dataKey=\"subject\" tick={!isMobile && renderCustomLabel} />\n <PolarRadiusAxis tick={false} axisLine={false} domain={[0, 100]} />\n {isMobile ? <Tooltip cursor={false} content={<CustomTooltip />} /> : null}\n </RadarChart>\n );\n};\n\nconst ResponsiveLearningProfileRadarChart = (props: LearningProfileRadarChartPropTypes) => (\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <LearningProfileRadarChart {...props} />\n </ResponsiveContainer>\n);\n\nLearningProfileRadarChart.propTypes = learningProfileRadarChartPropTypes;\nResponsiveLearningProfileRadarChart.propTypes = learningProfileRadarChartPropTypes;\n\nexport default ResponsiveLearningProfileRadarChart;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAyBA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAWA;AACA,MAAMA,GAAa,GAAG;EAACC,MAAM,EAAE;IAACC,CAAC,EAAE,CAAC,GAAL;IAAUC,CAAC,EAAE,CAAC;EAAd,CAAT;EAA4BC,SAAS,EAAE,QAAvC;EAAiDC,MAAM,EAAE;AAAzD,CAAtB;AACA,MAAMC,MAAgB,GAAG;EAACL,MAAM,EAAE;IAACC,CAAC,EAAE,CAAC,GAAL;IAAUC,CAAC,EAAE;EAAb,CAAT;EAA2BC,SAAS,EAAE,QAAtC;EAAgDC,MAAM,EAAE;AAAxD,CAAzB;AACA,MAAME,KAAe,GAAG;EAACN,MAAM,EAAE;IAACC,CAAC,EAAE,EAAJ;IAAQC,CAAC,EAAE,CAAC;EAAZ,CAAT;EAA0BC,SAAS,EAAE,OAArC;EAA8CI,WAAW,EAAE;AAA3D,CAAxB;AACA,MAAM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F,eAYE,6BAAC,wBAAD;IAAgB,OAAO,EAAC,SAAxB;IAAkC,IAAI,EAAE,CAAC+C,QAAD,IAAayB;EAArD,EAZF,eAaE,6BAAC,yBAAD;IAAiB,IAAI,EAAE,KAAvB;IAA8B,QAAQ,EAAE,KAAxC;IAA+C,MAAM,EAAE,CAAC,CAAD,EAAI,GAAJ;EAAvD,EAbF,EAcGzB,QAAQ,gBAAG,6BAAC,iBAAD;IAAS,MAAM,EAAE,KAAjB;IAAwB,OAAO,eAAE,6BAAC,aAAD;EAAjC,EAAH,GAA4D,IAdvE,CADF;AAkBD,CA9HM;;;;AAgIP,MAAM2B,mCAAmC,GAAIC,KAAD,iBAC1C,6BAAC,6BAAD;EAAqB,KAAK,EAAC,MAA3B;EAAkC,MAAM,EAAC;AAAzC,gBACE,6BAAC,yBAAD,EAA+BA,KAA/B,CADF,CADF;;AAMAjC,yBAAyB,CAACkC,SAA1B,2CAAsCC,yCAAtC;AACAH,mCAAmC,CAACE,SAApC,2CAAgDC,yCAAhD;eAEeH,mC"}
1
+ {"version":3,"file":"index.js","names":["top","offset","x","y","alignment","margin","bottom","right","marginRight","left","marginLeft","BLACK","WHITE","DEFAULT_MAIN_COLOR","DEFAULT_COLORS","gradient","fill","stroke","percentage","color","background","label","CHART_CONFIGS","triangle","name","ticks","sideCount","quadrilateral","pentagon","hexagon","DOT_DEFAULT_PROPS","strokeWidth","strokeOpacity","r","pointerEvents","style","cursor","DOT_ACTIVE_PROPS","RADAR_DEFAULT_PROPS","fillOpacity","Gradient","type","colors","firstColor","secondColor","CustomTooltip","active","payload","length","tooltip","tooltipLabel","tooltipValue","value","CustomDot","cx","cy","onDotClick","activeDot","dataName","subject","onClick","e","stopPropagation","buildRadars","totalDataset","handleOnDotClick","index","datakey","dataset","buildCustomLabel","percentagesValues","chartType","formatedColors","isCurrentDotActive","offsetX","offsetY","rest","onLabelClick","classnames","tickWrapper","tickWrapperFocus","alignItems","textAlign","opacity","map","colorLabel","i","tickValue","tickLabel","CHART_CONFIGS_BY_SIDE_COUNT","formatValues","values_","val","formatData","legend","data_","ref","LearningProfileRadarChart","data","colorsProps","width","height","isMobile","setIsMobile","useState","setActiveDot","Object","assign","useMemo","gradients","userAgent","navigator","isMobile_","getIsMobile","setIsMobile_","useCallback","useEffect","handleClick","undefined","window","addEventListener","removeEventListener","formatedData","find","indexOf","skillRef","key","renderCustomLabel","currentData","ResponsiveLearningProfileRadarChart","props","propTypes","learningProfileRadarChartPropTypes"],"sources":["../../../src/molecule/learning-profile-radar-chart/index.tsx"],"sourcesContent":["import React, {Fragment, useCallback, useEffect, useMemo, useState} from 'react';\nimport {\n Radar,\n RadarChart,\n PolarGrid,\n PolarAngleAxis,\n ResponsiveContainer,\n Tooltip,\n PolarRadiusAxis\n} from 'recharts';\nimport {\n pipe,\n keyBy,\n mapValues,\n size,\n getOr,\n map,\n toPairs,\n values,\n isEmpty,\n omit,\n fromPairs,\n times,\n flatten,\n findKey\n} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {isMobile as getIsMobile} from '../../util/check-is-mobile';\nimport style from './style.css';\nimport {\n ActiveDotType,\n FormatedColorsType,\n FormatedDataType,\n LearningProfileRadarChartPropTypes,\n TickType,\n learningProfileRadarChartPropTypes\n} from './types';\n\ntype CHART_TYPE_TYPE = keyof typeof CHART_CONFIGS;\n\n/* TICK_POSITIONS */\nconst top: TickType = {offset: {x: -100, y: -65}, alignment: 'center', margin: 'auto'};\nconst bottom: TickType = {offset: {x: -100, y: 10}, alignment: 'center', margin: 'auto'};\nconst right: TickType = {offset: {x: 30, y: -10}, alignment: 'start', marginRight: 'auto'};\nconst left: TickType = {offset: {x: -230, y: -10}, alignment: 'end', marginLeft: 'auto'};\n\n/* CONSTANTS */\nconst BLACK = '#000000ff';\nconst WHITE = '#ffffffff';\nconst DEFAULT_MAIN_COLOR = '#0062ffff';\n\nconst DEFAULT_COLORS: FormatedColorsType = {\n gradient: {\n fill: [DEFAULT_MAIN_COLOR, DEFAULT_MAIN_COLOR],\n stroke: [DEFAULT_MAIN_COLOR, DEFAULT_MAIN_COLOR]\n },\n percentage: {\n color: BLACK,\n background: WHITE\n },\n label: {\n color: BLACK\n }\n};\n\nconst CHART_CONFIGS = {\n triangle: {\n name: 'triangle',\n ticks: [top, right, left],\n sideCount: 3\n },\n quadrilateral: {\n name: 'quadrilateral',\n ticks: [top, right, bottom, left],\n sideCount: 4\n },\n pentagon: {\n name: 'pentagon',\n ticks: [top, right, right, left, left],\n sideCount: 5\n },\n hexagon: {\n name: 'hexagon',\n ticks: [top, right, right, bottom, left, left],\n sideCount: 6\n }\n} as const;\n\nconst DOT_DEFAULT_PROPS = {\n strokeWidth: 4,\n strokeOpacity: 0.2,\n fill: '#fff',\n r: 8,\n pointerEvents: 'all',\n style: {cursor: 'pointer'}\n} as const;\n\nconst DOT_ACTIVE_PROPS = {\n fill: '#fff',\n r: 8,\n strokeWidth: 6,\n strokeOpacity: 0.5\n} as const;\n\nconst RADAR_DEFAULT_PROPS = {\n strokeWidth: 6,\n strokeOpacity: 0.2,\n fillOpacity: 0.2\n} as const;\n\n/* COMPONENTS */\nconst Gradient = ({type, colors: [firstColor, secondColor]}: {type: string; colors: string[]}) => (\n <defs>\n <linearGradient id={`gradient-${type}`} x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">\n <stop offset=\"0%\" stopColor={firstColor} />\n <stop offset=\"100%\" stopColor={secondColor} />\n </linearGradient>\n </defs>\n);\n\nconst CustomTooltip = ({\n active,\n payload,\n label\n}: {\n active?: boolean;\n payload?: {value: number}[];\n label?: string;\n}) =>\n active && !!payload?.length ? (\n <div className={style.tooltip}>\n <span className={style.tooltipLabel}>{label}</span>\n <span className={style.tooltipValue}>{payload[0].value}%</span>\n </div>\n ) : null;\n\nconst CustomDot = ({\n cx,\n cy,\n payload,\n onDotClick,\n stroke,\n activeDot,\n dataName\n}: {\n cx?: number;\n cy?: number;\n payload?: {payload: {subject: string} & {[datakey: string]: number}; name: string};\n onDotClick: (name: string) => void;\n dataKey: string;\n stroke: string;\n activeDot?: ActiveDotType;\n dataName: string;\n}) => (\n <circle\n {...{\n ...DOT_DEFAULT_PROPS,\n ...(payload?.payload.subject === activeDot?.label && DOT_ACTIVE_PROPS),\n stroke,\n cx,\n cy,\n onClick: e => {\n e.stopPropagation();\n\n if (!payload?.name) return;\n onDotClick(payload.name);\n },\n 'data-name': dataName\n }}\n />\n);\n\nconst buildRadars = (\n totalDataset: number,\n handleOnDotClick: (name: string) => void,\n activeDot?: ActiveDotType\n) =>\n times(index => {\n const datakey = `value${index + 1}`;\n const dataset = `dataset-${index + 1}`;\n\n return (\n <Radar\n {...RADAR_DEFAULT_PROPS}\n fill={`url(#gradient-fill-${index})`}\n stroke={`url(#gradient-stroke-${index})`}\n key={dataset}\n name={dataset}\n dataKey={datakey}\n activeDot={{\n ...DOT_ACTIVE_PROPS,\n stroke: `url(#gradient-stroke-${index})`\n }}\n // only on mobile\n // to handle dot style on hover (convert to click)\n // use with the tooltip component\n dot={\n <CustomDot\n onDotClick={handleOnDotClick}\n activeDot={activeDot}\n dataKey={datakey}\n stroke={`url(#gradient-stroke-${index})`}\n dataName={`dot-${dataset}`}\n />\n }\n />\n );\n }, totalDataset);\n\nconst buildCustomLabel = ({\n index,\n x,\n y,\n percentagesValues,\n label,\n activeDot,\n chartType,\n formatedColors,\n onClick\n}: {\n index: number;\n x: number;\n y: number;\n percentagesValues: number[];\n label: string;\n chartType: CHART_TYPE_TYPE;\n formatedColors: FormatedColorsType[];\n activeDot?: ActiveDotType;\n onClick: (name: string) => void;\n}) => {\n const isCurrentDotActive = activeDot?.label === label;\n const {\n offset: {x: offsetX, y: offsetY},\n alignment,\n ...rest\n } = CHART_CONFIGS[chartType].ticks[index];\n\n function onLabelClick(e: React.MouseEvent) {\n e.stopPropagation();\n onClick(label);\n }\n\n return (\n <g>\n <foreignObject x={x + offsetX} y={y + offsetY} width=\"200\" height=\"65\">\n <div\n data-name={label}\n onClick={onLabelClick}\n className={classnames(style.tickWrapper, isCurrentDotActive && style.tickWrapperFocus)}\n style={{\n ...rest,\n alignItems: alignment,\n textAlign: alignment,\n opacity: !isEmpty(activeDot) && !isCurrentDotActive ? 0.3 : 1\n }}\n >\n {formatedColors.map(\n ({percentage: {color, background}, label: {color: colorLabel}}, i) => (\n <Fragment key={i}>\n <span className={style.tickValue} style={{color, background}}>\n {percentagesValues[i]}\n </span>\n <span className={style.tickLabel} style={{color: colorLabel}}>\n {label}\n </span>\n </Fragment>\n )\n )}\n </div>\n </foreignObject>\n </g>\n );\n};\n\n/* UTILS */\nconst CHART_CONFIGS_BY_SIDE_COUNT = pipe(keyBy('sideCount'), mapValues('name'))(CHART_CONFIGS);\n\nconst formatValues: (values_: number | number[]) => Record<string, number> = pipe(\n values_ => flatten([values_]),\n values_ => values_.map((val: number, i: number): [string, number] => [`value${i + 1}`, val]),\n fromPairs\n);\n\n/* this convert incoming component data to rechart data structure */\nexport const formatData: (\n legend: {[ref: string]: string},\n data_: LearningProfileRadarChartPropTypes['data']\n) => FormatedDataType[] = (legend, data_) =>\n pipe(\n toPairs,\n map(([ref, values_]: [string, number | number[]]) => ({\n ...formatValues(values_),\n subject: legend[ref]\n }))\n )(data_);\n\nexport const LearningProfileRadarChart = ({\n data,\n legend,\n totalDataset,\n colors: colorsProps,\n onClick,\n width,\n height\n}: LearningProfileRadarChartPropTypes) => {\n const [isMobile, setIsMobile] = useState(false);\n const [activeDot, setActiveDot] = useState<ActiveDotType>();\n\n const formatedColors = times(i => {\n if (!colorsProps?.length) return DEFAULT_COLORS;\n\n const colors = colorsProps[i];\n return colors ? Object.assign({}, DEFAULT_COLORS, colors) : DEFAULT_COLORS;\n })(totalDataset);\n\n const chartType: CHART_TYPE_TYPE = useMemo(\n () => getOr('hexagon', size(data), CHART_CONFIGS_BY_SIDE_COUNT),\n [data]\n );\n\n const gradients = useMemo(\n () =>\n formatedColors.map(({gradient: {fill, stroke}}, index) => (\n <svg key={`gradient-${index}`}>\n <Gradient type={`fill-${index}`} colors={fill} />\n <Gradient type={`stroke-${index}`} colors={stroke} />\n </svg>\n )),\n [formatedColors]\n );\n\n const userAgent = navigator?.userAgent;\n const isMobile_ = useMemo(() => getIsMobile(userAgent), [userAgent]);\n\n const setIsMobile_ = useCallback(() => {\n setIsMobile(isMobile_);\n }, [isMobile_]);\n\n useEffect(() => setIsMobile_(), [setIsMobile_]);\n\n useEffect(() => {\n const handleClick = () => setActiveDot(undefined);\n\n !isEmpty(activeDot) && window.addEventListener('click', handleClick);\n\n return () => {\n window.removeEventListener('click', handleClick);\n };\n }, [activeDot]);\n\n function handleOnDotClick(label: string) {\n const payload = formatedData.find(({subject}) => subject === label);\n if (!payload) return;\n\n const index = formatedData.indexOf(payload);\n const datakey = `value${index + 1}`;\n const skillRef = findKey(val => val === payload?.subject, legend);\n\n if (skillRef) {\n setActiveDot({\n key: datakey,\n value: payload[datakey],\n label: payload.subject\n });\n onClick(skillRef);\n }\n }\n\n function renderCustomLabel({\n x,\n y,\n payload: {value: label},\n index\n }: {\n x: number;\n y: number;\n payload: {value: string};\n index: number;\n }) {\n const currentData = formatedData.find(({subject}) => subject === label);\n const percentagesValues: number[] = pipe(\n omit('subject'),\n mapValues(value => `${value}%`),\n values\n )(currentData);\n\n return buildCustomLabel({\n index,\n x,\n y,\n percentagesValues,\n label,\n activeDot,\n chartType,\n formatedColors,\n onClick: handleOnDotClick\n });\n }\n const formatedData = useMemo(() => formatData(legend, data), [legend, data]);\n\n return (\n <RadarChart\n width={width}\n height={height}\n cx=\"50%\"\n cy=\"50%\"\n outerRadius=\"80%\"\n data={formatedData}\n >\n {gradients}\n {buildRadars(totalDataset, handleOnDotClick, activeDot)}\n <PolarGrid strokeDasharray={15} strokeWidth={3} radialLines={false} />\n <PolarAngleAxis dataKey=\"subject\" tick={!isMobile && renderCustomLabel} />\n <PolarRadiusAxis tick={false} axisLine={false} domain={[0, 100]} />\n {isMobile ? <Tooltip cursor={false} content={<CustomTooltip />} /> : null}\n </RadarChart>\n );\n};\n\nconst ResponsiveLearningProfileRadarChart = (props: LearningProfileRadarChartPropTypes) => (\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <LearningProfileRadarChart {...props} />\n </ResponsiveContainer>\n);\n\nLearningProfileRadarChart.propTypes = learningProfileRadarChartPropTypes;\nResponsiveLearningProfileRadarChart.propTypes = learningProfileRadarChartPropTypes;\n\nexport default ResponsiveLearningProfileRadarChart;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAyBA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAWA;AACA,MAAMA,GAAa,GAAG;EAACC,MAAM,EAAE;IAACC,CAAC,EAAE,CAAC,GAAL;IAAUC,CAAC,EAAE,CAAC;EAAd,CAAT;EAA4BC,SAAS,EAAE,QAAvC;EAAiDC,MAAM,EAAE;AAAzD,CAAtB;AACA,MAAMC,MAAgB,GAAG;EAACL,MAAM,EAAE;IAACC,CAAC,EAAE,CAAC,GAAL;IAAUC,CAAC,EAAE;EAAb,CAAT;EAA2BC,SAAS,EAAE,QAAtC;EAAgDC,MAAM,EAAE;AAAxD,CAAzB;AACA,MAAME,KAAe,GAAG;EAACN,MAAM,EAAE;IAACC,CAAC,EAAE,EAAJ;IAAQC,CAAC,EAAE,CAAC;EAAZ,CAAT;EAA0BC,SAAS,EAAE,OAArC;EAA8CI,WAAW,EAAE;AAA3D,CAAxB;AACA,MAAMC,IAAc,GAAG;EAACR,MAAM,EAAE;IAACC,CAAC,EAAE,CAAC,GAAL;IAAUC,CAAC,EAAE,CAAC;EAAd,CAAT;EAA4BC,SAAS,EAAE,KAAvC;EAA8CM,UAAU,EAAE;AAA1D,CAAvB;AAEA;;AACA,MAAMC,KAAK,GAAG,WAAd;AACA,MAAMC,KAAK,GAAG,WAAd;AACA,MAAMC,kBAAkB,GAAG,WAA3B;AAEA,MAAMC,cAAkC,GAAG;EACzCC,QAAQ,EAAE;IACRC,IAAI,EAAE,CAACH,kBAAD,EAAqBA,kB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