@coorpacademy/components 11.32.0 → 11.32.1-alpha.16

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 (146) hide show
  1. package/es/atom/button-link/index.d.ts +1 -0
  2. package/es/atom/button-link/index.d.ts.map +1 -1
  3. package/es/atom/button-link/index.js +6 -5
  4. package/es/atom/button-link/index.js.map +1 -1
  5. package/es/atom/button-link/types.d.ts +3 -0
  6. package/es/atom/button-link/types.d.ts.map +1 -1
  7. package/es/atom/button-link/types.js +1 -0
  8. package/es/atom/button-link/types.js.map +1 -1
  9. package/es/atom/chip/style.css +2 -2
  10. package/es/molecule/base-modal/index.d.ts +33 -0
  11. package/es/molecule/base-modal/index.d.ts.map +1 -0
  12. package/es/molecule/base-modal/index.js +142 -0
  13. package/es/molecule/base-modal/index.js.map +1 -0
  14. package/es/molecule/base-modal/style.css +125 -0
  15. package/es/molecule/cm-popin/types.d.ts +2 -0
  16. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  17. package/es/molecule/expandible-actionable-table/index.d.ts +1 -0
  18. package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
  19. package/es/molecule/expandible-actionable-table/types.d.ts +1 -0
  20. package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
  21. package/es/molecule/learner-skill-card/index.d.ts +2 -0
  22. package/es/molecule/learner-skill-card/index.d.ts.map +1 -1
  23. package/es/molecule/learner-skill-card/index.js +9 -4
  24. package/es/molecule/learner-skill-card/index.js.map +1 -1
  25. package/es/molecule/learning-profile-radar-chart/index.d.ts +1 -1
  26. package/es/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
  27. package/es/molecule/learning-profile-radar-chart/index.js +16 -11
  28. package/es/molecule/learning-profile-radar-chart/index.js.map +1 -1
  29. package/es/molecule/learning-profile-radar-chart/types.d.ts +7 -1
  30. package/es/molecule/learning-profile-radar-chart/types.d.ts.map +1 -1
  31. package/es/molecule/learning-profile-radar-chart/types.js.map +1 -1
  32. package/es/molecule/skill-picker-modal/index.d.ts +23 -0
  33. package/es/molecule/skill-picker-modal/index.d.ts.map +1 -0
  34. package/es/molecule/skill-picker-modal/index.js +138 -0
  35. package/es/molecule/skill-picker-modal/index.js.map +1 -0
  36. package/es/molecule/skill-picker-modal/style.css +28 -0
  37. package/es/molecule/skills-chart-side-information-item/index.d.ts +1 -1
  38. package/es/molecule/skills-chart-side-information-item/index.js +1 -1
  39. package/es/molecule/skills-chart-side-information-item/index.js.map +1 -1
  40. package/es/molecule/skills-chart-side-information-panel/index.d.ts +1 -1
  41. package/es/organism/list-items/index.d.ts +2 -0
  42. package/es/organism/setup-header/index.d.ts +4 -0
  43. package/es/organism/wizard-contents/index.d.ts +3 -0
  44. package/es/template/app-player/loading/index.d.ts +2 -0
  45. package/es/template/app-player/player/index.d.ts +4 -0
  46. package/es/template/app-player/player/slides/index.d.ts +2 -0
  47. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  48. package/es/template/app-player/popin-correction/index.d.ts +2 -0
  49. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  50. package/es/template/app-player/popin-end/index.d.ts +2 -0
  51. package/es/template/app-review/index.d.ts +2 -0
  52. package/es/template/app-review/index.d.ts.map +1 -1
  53. package/es/template/app-review/player/prop-types.d.ts +2 -0
  54. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  55. package/es/template/app-review/prop-types.d.ts +2 -0
  56. package/es/template/app-review/prop-types.d.ts.map +1 -1
  57. package/es/template/back-office/brand-create/index.d.ts +4 -0
  58. package/es/template/back-office/brand-create/index.d.ts.map +1 -1
  59. package/es/template/back-office/brand-list/index.d.ts +4 -0
  60. package/es/template/back-office/brand-list/index.d.ts.map +1 -1
  61. package/es/template/back-office/brand-update/index.d.ts +11 -0
  62. package/es/template/back-office/dashboard-preview/index.d.ts +4 -0
  63. package/es/template/back-office/layout/index.d.ts +4 -0
  64. package/es/template/back-office/layout/index.d.ts.map +1 -1
  65. package/es/template/common/dashboard/index.d.ts +4 -0
  66. package/es/template/common/search-page/index.d.ts +2 -0
  67. package/es/template/external-course/index.d.ts +2 -0
  68. package/es/template/my-learning/index.d.ts +34 -0
  69. package/es/template/my-learning/index.d.ts.map +1 -0
  70. package/es/template/my-learning/index.js +354 -0
  71. package/es/template/my-learning/index.js.map +1 -0
  72. package/es/template/my-learning/style.css +179 -0
  73. package/lib/atom/button-link/index.d.ts +1 -0
  74. package/lib/atom/button-link/index.d.ts.map +1 -1
  75. package/lib/atom/button-link/index.js +6 -5
  76. package/lib/atom/button-link/index.js.map +1 -1
  77. package/lib/atom/button-link/types.d.ts +3 -0
  78. package/lib/atom/button-link/types.d.ts.map +1 -1
  79. package/lib/atom/button-link/types.js +1 -0
  80. package/lib/atom/button-link/types.js.map +1 -1
  81. package/lib/atom/chip/style.css +2 -2
  82. package/lib/molecule/base-modal/index.d.ts +33 -0
  83. package/lib/molecule/base-modal/index.d.ts.map +1 -0
  84. package/lib/molecule/base-modal/index.js +158 -0
  85. package/lib/molecule/base-modal/index.js.map +1 -0
  86. package/lib/molecule/base-modal/style.css +125 -0
  87. package/lib/molecule/cm-popin/types.d.ts +2 -0
  88. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  89. package/lib/molecule/expandible-actionable-table/index.d.ts +1 -0
  90. package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
  91. package/lib/molecule/expandible-actionable-table/types.d.ts +1 -0
  92. package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
  93. package/lib/molecule/learner-skill-card/index.d.ts +2 -0
  94. package/lib/molecule/learner-skill-card/index.d.ts.map +1 -1
  95. package/lib/molecule/learner-skill-card/index.js +9 -4
  96. package/lib/molecule/learner-skill-card/index.js.map +1 -1
  97. package/lib/molecule/learning-profile-radar-chart/index.d.ts +1 -1
  98. package/lib/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
  99. package/lib/molecule/learning-profile-radar-chart/index.js +16 -11
  100. package/lib/molecule/learning-profile-radar-chart/index.js.map +1 -1
  101. package/lib/molecule/learning-profile-radar-chart/types.d.ts +7 -1
  102. package/lib/molecule/learning-profile-radar-chart/types.d.ts.map +1 -1
  103. package/lib/molecule/learning-profile-radar-chart/types.js.map +1 -1
  104. package/lib/molecule/skill-picker-modal/index.d.ts +23 -0
  105. package/lib/molecule/skill-picker-modal/index.d.ts.map +1 -0
  106. package/lib/molecule/skill-picker-modal/index.js +156 -0
  107. package/lib/molecule/skill-picker-modal/index.js.map +1 -0
  108. package/lib/molecule/skill-picker-modal/style.css +28 -0
  109. package/lib/molecule/skills-chart-side-information-item/index.d.ts +1 -1
  110. package/lib/molecule/skills-chart-side-information-item/index.js +1 -1
  111. package/lib/molecule/skills-chart-side-information-item/index.js.map +1 -1
  112. package/lib/molecule/skills-chart-side-information-panel/index.d.ts +1 -1
  113. package/lib/organism/list-items/index.d.ts +2 -0
  114. package/lib/organism/setup-header/index.d.ts +4 -0
  115. package/lib/organism/wizard-contents/index.d.ts +3 -0
  116. package/lib/template/app-player/loading/index.d.ts +2 -0
  117. package/lib/template/app-player/player/index.d.ts +4 -0
  118. package/lib/template/app-player/player/slides/index.d.ts +2 -0
  119. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  120. package/lib/template/app-player/popin-correction/index.d.ts +2 -0
  121. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  122. package/lib/template/app-player/popin-end/index.d.ts +2 -0
  123. package/lib/template/app-review/index.d.ts +2 -0
  124. package/lib/template/app-review/index.d.ts.map +1 -1
  125. package/lib/template/app-review/player/prop-types.d.ts +2 -0
  126. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  127. package/lib/template/app-review/prop-types.d.ts +2 -0
  128. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  129. package/lib/template/back-office/brand-create/index.d.ts +4 -0
  130. package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
  131. package/lib/template/back-office/brand-list/index.d.ts +4 -0
  132. package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
  133. package/lib/template/back-office/brand-update/index.d.ts +11 -0
  134. package/lib/template/back-office/dashboard-preview/index.d.ts +4 -0
  135. package/lib/template/back-office/layout/index.d.ts +4 -0
  136. package/lib/template/back-office/layout/index.d.ts.map +1 -1
  137. package/lib/template/common/dashboard/index.d.ts +4 -0
  138. package/lib/template/common/search-page/index.d.ts +2 -0
  139. package/lib/template/external-course/index.d.ts +2 -0
  140. package/lib/template/my-learning/index.d.ts +34 -0
  141. package/lib/template/my-learning/index.d.ts.map +1 -0
  142. package/lib/template/my-learning/index.js +375 -0
  143. package/lib/template/my-learning/index.js.map +1 -0
  144. package/lib/template/my-learning/style.css +179 -0
  145. package/locales/en/global.json +25 -0
  146. package/package.json +3 -3
@@ -5,6 +5,7 @@ declare const ButtonLink: {
5
5
  propTypes: {
6
6
  type: import("prop-types").Requireable<string>;
7
7
  label: import("prop-types").Requireable<string>;
8
+ content: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
8
9
  'aria-label': import("prop-types").Requireable<string>;
9
10
  'data-name': import("prop-types").Requireable<string>;
10
11
  'data-testid': import("prop-types").Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAMA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;AAwC7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;CAqEzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAMA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;AAwC7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;CAsEzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
@@ -10,7 +10,7 @@ import { ICONS } from '../../util/button-icons';
10
10
  import propTypes from './types';
11
11
  import style from './style.css';
12
12
 
13
- const getButtonContent = (icon, label) => {
13
+ const getButtonContent = (icon, content) => {
14
14
  const {
15
15
  type,
16
16
  faIcon,
@@ -26,7 +26,7 @@ const getButtonContent = (icon, label) => {
26
26
  className: style.buttonContent
27
27
  }, /*#__PURE__*/React.createElement("span", {
28
28
  className: style.label
29
- }, label));
29
+ }, content));
30
30
  }
31
31
 
32
32
  const iconComponent = faIcon ? /*#__PURE__*/React.createElement(FaIcon, {
@@ -43,15 +43,16 @@ const getButtonContent = (icon, label) => {
43
43
  });
44
44
  return /*#__PURE__*/React.createElement("div", {
45
45
  className: style.buttonContent
46
- }, position === 'left' ? iconComponent : null, label ? /*#__PURE__*/React.createElement("span", {
46
+ }, position === 'left' ? iconComponent : null, content ? /*#__PURE__*/React.createElement("span", {
47
47
  className: style.label
48
- }, label) : null, position === 'right' ? iconComponent : null);
48
+ }, content) : null, position === 'right' ? iconComponent : null);
49
49
  };
50
50
 
51
51
  const ButtonLink = props => {
52
52
  const {
53
53
  type,
54
54
  label,
55
+ content,
55
56
  disabled,
56
57
  icon,
57
58
  'data-name': dataName,
@@ -64,7 +65,7 @@ const ButtonLink = props => {
64
65
  customStyle,
65
66
  useTitle = true
66
67
  } = props;
67
- const contentView = getButtonContent(icon, label);
68
+ const contentView = getButtonContent(icon, content ?? label);
68
69
  const styleButton = classnames(className, style.button, type === 'primary' && style.primary, type === 'secondary' && style.secondary, type === 'tertiary' && style.tertiary, type === 'text' && style.text, type === 'dangerous' && style.dangerous, link && style.link, disabled && style.disabled);
69
70
  const handleOnClick = useCallback(() => onClick(), [onClick]);
70
71
  const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","classnames","Link","FaIcon","ICONS","propTypes","style","getButtonContent","icon","label","type","faIcon","position","Icon","buttonContent","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","ButtonLink","props","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","customStyle","useTitle","contentView","styleButton","button","primary","secondary","tertiary","text","dangerous","handleOnClick","handleOnKeyDown","event","title"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport FaIcon from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (icon?: IconType, label?: string) => {\n const {type, faIcon, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon && !faIcon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n );\n }\n\n const iconComponent = faIcon ? (\n <FaIcon\n {...{\n iconName: faIcon.name,\n iconColor: faIcon.color,\n backgroundColor: faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n }\n }}\n />\n ) : (\n <Icon className={style.icon} theme=\"coorpmanager\" />\n );\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? iconComponent : null}\n {label ? <span className={style.label}>{label}</span> : null}\n {position === 'right' ? iconComponent : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n label,\n disabled,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const contentView = getButtonContent(icon, label);\n const styleButton = classnames(\n className,\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n type=\"button\"\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n tabIndex={0}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,OAAOC,MAAP,MAAmB,SAAnB;AACA,SAAQC,KAAR,QAAoB,yBAApB;AACA,OAAOC,SAAP,MAAmD,SAAnD;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,IAAD,EAAkBC,KAAlB,KAAqC;EAC5D,MAAM;IAACC,IAAD;IAAOC,MAAP;IAAeC;EAAf,IAA2BJ,IAAI,IAAI;IAACE,IAAI,EAAE,EAAP;IAAWE,QAAQ,EAAE;EAArB,CAAzC;EACA,MAAMC,IAAI,GAAGH,IAAI,IAAIN,KAAK,CAACM,IAAD,CAA1B;;EAEA,IAAI,CAACG,IAAD,IAAS,CAACF,MAAd,EAAsB;IACpB,oBACE;MAAK,SAAS,EAAEL,KAAK,CAACQ;IAAtB,gBACE;MAAM,SAAS,EAAER,KAAK,CAACG;IAAvB,GAA+BA,KAA/B,CADF,CADF;EAKD;;EAED,MAAMM,aAAa,GAAGJ,MAAM,gBAC1B,oBAAC,MAAD;IAEIK,QAAQ,EAAEL,MAAM,CAACM,IAFrB;IAGIC,SAAS,EAAEP,MAAM,CAACQ,KAHtB;IAIIC,eAAe,EAAET,MAA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AI,IAAIxB,KAAK,CAACwB,IARc,EAS5BJ,QAAQ,IAAIpB,KAAK,CAACoB,QATU,CAA9B;EAYA,MAAMkB,aAAa,GAAG5C,WAAW,CAAC,MAAM+B,OAAO,EAAd,EAAkB,CAACA,OAAD,CAAlB,CAAjC;EAEA,MAAMc,eAAe,GAAG7C,WAAW,CAAC8C,KAAK,IAAId,SAAS,CAACc,KAAD,CAAnB,EAA4B,CAACd,SAAD,CAA5B,CAAnC;;EAEA,IAAIF,IAAJ,EAAU;IACR,oBACE,oBAAC,IAAD,eACMA,IADN,EAEOK,QAAQ,IAAI;MACfY,KAAK,EAAElB,SAAS,IAAIpB;IADL,CAFnB;MAKE,KAAK,EAAEyB,WALT;MAME,SAAS,EAAEG,WANb;MAOE,aAAWV,QAPb;MAQE,eAAaC,UARf;MASE,cAAYC,SAAS,IAAIpB;IAT3B,IAWG2B,WAXH,CADF;EAeD;;EAED,oBACE,2CACOD,QAAQ,IAAI;IACfY,KAAK,EAAElB,SAAS,IAAIpB;EADL,CADnB;IAIE,IAAI,EAAC,QAJP;IAKE,cAAYoB,SAAS,IAAIpB,KAL3B;IAME,aAAWkB,QANb;IAOE,eAAaC,UAPf;IAQE,KAAK,EAAEM,WART;IASE,SAAS,EAAEG,WATb;IAUE,OAAO,EAAEO,aAVX;IAWE,SAAS,EAAEC,eAXb;IAYE,QAAQ,EAAE;EAZZ,IAcGT,WAdH,CADF;AAkBD,CArED;;AAuEAZ,UAAU,CAACnB,SAAX,2CAAuBA,SAAvB;AAEA,eAAemB,UAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","classnames","Link","FaIcon","ICONS","propTypes","style","getButtonContent","icon","content","type","faIcon","position","Icon","buttonContent","label","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","ButtonLink","props","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","customStyle","useTitle","contentView","styleButton","button","primary","secondary","tertiary","text","dangerous","handleOnClick","handleOnKeyDown","event","title"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport FaIcon from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (icon?: IconType, content?: string | React.ReactNode) => {\n const {type, faIcon, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon && !faIcon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{content}</span>\n </div>\n );\n }\n\n const iconComponent = faIcon ? (\n <FaIcon\n {...{\n iconName: faIcon.name,\n iconColor: faIcon.color,\n backgroundColor: faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n }\n }}\n />\n ) : (\n <Icon className={style.icon} theme=\"coorpmanager\" />\n );\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? iconComponent : null}\n {content ? <span className={style.label}>{content}</span> : null}\n {position === 'right' ? iconComponent : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n label,\n content,\n disabled,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const contentView = getButtonContent(icon, content ?? label);\n const styleButton = classnames(\n className,\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n type=\"button\"\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n tabIndex={0}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,OAAOC,MAAP,MAAmB,SAAnB;AACA,SAAQC,KAAR,QAAoB,yBAApB;AACA,OAAOC,SAAP,MAAmD,SAAnD;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,IAAD,EAAkBC,OAAlB,KAAyD;EAChF,MAAM;IAACC,IAAD;IAAOC,MAAP;IAAeC;EAAf,IAA2BJ,IAAI,IAAI;IAACE,IAAI,EAAE,EAAP;IAAWE,QAAQ,EAAE;EAArB,CAAzC;EACA,MAAMC,IAAI,GAAGH,IAAI,IAAIN,KAAK,CAACM,IAAD,CAA1B;;EAEA,IAAI,CAACG,IAAD,IAAS,CAACF,MAAd,EAAsB;IACpB,oBACE;MAAK,SAAS,EAAEL,KAAK,CAACQ;IAAtB,gBACE;MAAM,SAAS,EAAER,KAAK,CAACS;IAAvB,GAA+BN,OAA/B,CADF,CADF;EAKD;;EAED,MAAMO,aAAa,GAAGL,MAAM,gBAC1B,oBAAC,MAAD;IAEIM,QAAQ,EAAEN,MAAM,CAACO,IAFrB;IAGIC,SAAS,EAAER,MAAM,CAACS,KAHtB;IAIIC,eAAe,EAAEV,MAAM,CAACU,eAJ5B;IAKIC,IAAI,EAAE;MACJC,MAAM,EAAEZ,MAAM,CAACW,IADX;MAEJE,WAAW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B,KAAK,CAACqB,QATU,CAA9B;EAYA,MAAMkB,aAAa,GAAG7C,WAAW,CAAC,MAAMgC,OAAO,EAAd,EAAkB,CAACA,OAAD,CAAlB,CAAjC;EAEA,MAAMc,eAAe,GAAG9C,WAAW,CAAC+C,KAAK,IAAId,SAAS,CAACc,KAAD,CAAnB,EAA4B,CAACd,SAAD,CAA5B,CAAnC;;EAEA,IAAIF,IAAJ,EAAU;IACR,oBACE,oBAAC,IAAD,eACMA,IADN,EAEOK,QAAQ,IAAI;MACfY,KAAK,EAAElB,SAAS,IAAIf;IADL,CAFnB;MAKE,KAAK,EAAEoB,WALT;MAME,SAAS,EAAEG,WANb;MAOE,aAAWV,QAPb;MAQE,eAAaC,UARf;MASE,cAAYC,SAAS,IAAIf;IAT3B,IAWGsB,WAXH,CADF;EAeD;;EAED,oBACE,2CACOD,QAAQ,IAAI;IACfY,KAAK,EAAElB,SAAS,IAAIf;EADL,CADnB;IAIE,IAAI,EAAC,QAJP;IAKE,cAAYe,SAAS,IAAIf,KAL3B;IAME,aAAWa,QANb;IAOE,eAAaC,UAPf;IAQE,KAAK,EAAEM,WART;IASE,SAAS,EAAEG,WATb;IAUE,OAAO,EAAEO,aAVX;IAWE,SAAS,EAAEC,eAXb;IAYE,QAAQ,EAAE;EAZZ,IAcGT,WAdH,CADF;AAkBD,CAtED;;AAwEAZ,UAAU,CAACpB,SAAX,2CAAuBA,SAAvB;AAEA,eAAeoB,UAAf"}
@@ -1,8 +1,10 @@
1
+ /// <reference types="react" />
1
2
  import PropTypes from 'prop-types';
2
3
  import { ICONS } from '../../util/button-icons';
3
4
  declare const propTypes: {
4
5
  type: PropTypes.Requireable<string>;
5
6
  label: PropTypes.Requireable<string>;
7
+ content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
6
8
  'aria-label': PropTypes.Requireable<string>;
7
9
  'data-name': PropTypes.Requireable<string>;
8
10
  'data-testid': PropTypes.Requireable<string>;
@@ -34,6 +36,7 @@ export declare type IconType = {
34
36
  export declare type ButtonLinkProps = {
35
37
  type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';
36
38
  label?: string;
39
+ content?: React.ReactNode;
37
40
  'aria-label'?: string;
38
41
  'data-name'?: string;
39
42
  'data-testid'?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAE9C,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;CAmBd,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC1B,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AACF,oBAAY,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,OA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,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;KAClD,CAAC;IACF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC;AAE/C,eAAe,SAAS,CAAC"}
@@ -4,6 +4,7 @@ import { ICONS } from '../../util/button-icons';
4
4
  const propTypes = {
5
5
  type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),
6
6
  label: PropTypes.string,
7
+ content: PropTypes.node,
7
8
  'aria-label': PropTypes.string,
8
9
  'data-name': PropTypes.string,
9
10
  'data-testid': PropTypes.string,
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["PropTypes","ICONS","propTypes","type","oneOf","label","string","icon","shape","position","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,OAAOA,SAAP,MAAsB,YAAtB;AAEA,SAAQC,KAAR,QAAoB,yBAApB;AAEA,MAAMC,SAAS,GAAG;EAChBC,IAAI,EAAEH,SAAS,CAACI,KAAV,CAAgB,CAAC,SAAD,EAAY,WAAZ,EAAyB,UAAzB,EAAqC,MAArC,EAA6C,WAA7C,CAAhB,CADU;EAEhBC,KAAK,EAAEL,SAAS,CAACM,MAFD;EAGhB,cAAcN,SAAS,CAACM,MAHR;EAIhB,aAAaN,SAAS,CAACM,MAJP;EAKhB,eAAeN,SAAS,CAACM,MALT;EAMhBC,IAAI,EAAEP,SAAS,CAACQ,KAAV,CAAgB;IACpBC,QAAQ,EAAET,SAAS,CAACI,KAAV,CAAgB,CAAC,OAAD,EAAU,MAAV,CAAhB,CADU;IAEpBD,IAAI,EAAEH,SAAS,CAACI,KAAV,CAAgB,MAAKH,KAAL,CAAhB;EAFc,CAAhB,CANU;EAUhBS,OAAO,EAAEV,SAAS,CAACW,IAVH;EAWhBC,IAAI,EAAEZ,SAAS,CAACQ,KAAV,CAAgB;IACpBK,IAAI,EAAEb,SAAS,CAACM,MADI;IAEpBQ,QAAQ,EAAEd,SAAS,CAACe,IAFA;IAGpBC,MAAM,EAAEhB,SAAS,CAACI,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB;EAHY,CAAhB,CAXU;EAgBhBa,QAAQ,EAAEjB,SAAS,CAACe,IAhBJ;EAiBhBG,SAAS,EAAElB,SAAS,CAACM,MAjBL;EAkBhBa,WAAW,EAAEnB,SAAS,CAACQ,KAAV,CAAgB,EAAhB;AAlBG,CAAlB;AAuDA,eAAeN,SAAf"}
1
+ {"version":3,"file":"types.js","names":["PropTypes","ICONS","propTypes","type","oneOf","label","string","content","node","icon","shape","position","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,OAAOA,SAAP,MAAsB,YAAtB;AAEA,SAAQC,KAAR,QAAoB,yBAApB;AAEA,MAAMC,SAAS,GAAG;EAChBC,IAAI,EAAEH,SAAS,CAACI,KAAV,CAAgB,CAAC,SAAD,EAAY,WAAZ,EAAyB,UAAzB,EAAqC,MAArC,EAA6C,WAA7C,CAAhB,CADU;EAEhBC,KAAK,EAAEL,SAAS,CAACM,MAFD;EAGhBC,OAAO,EAAEP,SAAS,CAACQ,IAHH;EAIhB,cAAcR,SAAS,CAACM,MAJR;EAKhB,aAAaN,SAAS,CAACM,MALP;EAMhB,eAAeN,SAAS,CAACM,MANT;EAOhBG,IAAI,EAAET,SAAS,CAACU,KAAV,CAAgB;IACpBC,QAAQ,EAAEX,SAAS,CAACI,KAAV,CAAgB,CAAC,OAAD,EAAU,MAAV,CAAhB,CADU;IAEpBD,IAAI,EAAEH,SAAS,CAACI,KAAV,CAAgB,MAAKH,KAAL,CAAhB;EAFc,CAAhB,CAPU;EAWhBW,OAAO,EAAEZ,SAAS,CAACa,IAXH;EAYhBC,IAAI,EAAEd,SAAS,CAACU,KAAV,CAAgB;IACpBK,IAAI,EAAEf,SAAS,CAACM,MADI;IAEpBU,QAAQ,EAAEhB,SAAS,CAACiB,IAFA;IAGpBC,MAAM,EAAElB,SAAS,CAACI,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB;EAHY,CAAhB,CAZU;EAiBhBe,QAAQ,EAAEnB,SAAS,CAACiB,IAjBJ;EAkBhBG,SAAS,EAAEpB,SAAS,CAACM,MAlBL;EAmBhBe,WAAW,EAAErB,SAAS,CAACU,KAAV,CAAgB,EAAhB;AAnBG,CAAlB;AAyDA,eAAeR,SAAf"}
@@ -7,8 +7,8 @@
7
7
  @value white from colors;
8
8
 
9
9
  .container {
10
- width: 100%;
11
- height: 52px;
10
+ width: fit-content;
11
+ height: 44px;
12
12
  border-radius: 10px;
13
13
  padding: 10px 16px;
14
14
  position: relative;
@@ -0,0 +1,33 @@
1
+ export default BaseModal;
2
+ declare function BaseModal(props: any): JSX.Element | null;
3
+ declare namespace BaseModal {
4
+ namespace propTypes {
5
+ const title: PropTypes.Requireable<string>;
6
+ const headerIcon: PropTypes.Requireable<PropTypes.InferProps<{
7
+ name: PropTypes.Requireable<string>;
8
+ color: PropTypes.Requireable<string>;
9
+ backgroundColor: PropTypes.Requireable<string>;
10
+ }>>;
11
+ const description: PropTypes.Requireable<string>;
12
+ const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
13
+ const isOpen: PropTypes.Requireable<boolean>;
14
+ const footer: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.InferProps<{
15
+ text: PropTypes.Requireable<string>;
16
+ isError: any;
17
+ cancelButton: PropTypes.Requireable<PropTypes.InferProps<{
18
+ label: PropTypes.Requireable<string>;
19
+ onCancel: PropTypes.Requireable<(...args: any[]) => any>;
20
+ disabled: PropTypes.Requireable<boolean>;
21
+ }>>;
22
+ confirmButton: PropTypes.Requireable<PropTypes.InferProps<{
23
+ label: PropTypes.Requireable<string>;
24
+ onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
25
+ iconName: PropTypes.Requireable<string>;
26
+ disabled: PropTypes.Requireable<boolean>;
27
+ }>>;
28
+ }> | null | undefined>>;
29
+ const onClose: PropTypes.Requireable<(...args: any[]) => any>;
30
+ }
31
+ }
32
+ import PropTypes from "prop-types";
33
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/base-modal/index.js"],"names":[],"mappings":";AAOA,2DAmGC"}
@@ -0,0 +1,142 @@
1
+ import _isEmpty from "lodash/fp/isEmpty";
2
+
3
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+
5
+ import React, { useCallback } from 'react';
6
+ import PropTypes from 'prop-types';
7
+ import Icon from '../../atom/icon';
8
+ import ButtonLink from '../../atom/button-link';
9
+ import style from './style.css';
10
+
11
+ const BaseModal = props => {
12
+ const {
13
+ title,
14
+ description,
15
+ headerIcon,
16
+ children,
17
+ isOpen,
18
+ footer,
19
+ onClose
20
+ } = props;
21
+ const Footer = useCallback(() => {
22
+ if (_isEmpty(footer)) return null;
23
+ if (typeof footer === 'function') return footer();
24
+ const {
25
+ cancelButton,
26
+ confirmButton,
27
+ text,
28
+ isError
29
+ } = footer;
30
+ const {
31
+ label: cancelLabel,
32
+ onCancel,
33
+ disabled: cancelDisabled
34
+ } = cancelButton || {};
35
+ const {
36
+ label: confirmLabel,
37
+ onConfirm,
38
+ disabled: confirmDisabled,
39
+ iconName
40
+ } = confirmButton || {};
41
+ return /*#__PURE__*/React.createElement("div", {
42
+ className: style.footer
43
+ }, /*#__PURE__*/React.createElement("div", {
44
+ className: style.footerCTAWrapper
45
+ }, onCancel && cancelLabel ? /*#__PURE__*/React.createElement(ButtonLink, {
46
+ className: style.footerCancelButton,
47
+ type: 'secondary',
48
+ onClick: onCancel,
49
+ label: cancelLabel,
50
+ disabled: cancelDisabled
51
+ }) : null, onConfirm && confirmLabel ? /*#__PURE__*/React.createElement(ButtonLink, _extends({
52
+ className: style.footerConfirmButton,
53
+ type: 'primary',
54
+ onClick: onConfirm,
55
+ label: confirmLabel,
56
+ disabled: confirmDisabled
57
+ }, iconName ? {
58
+ icon: {
59
+ position: 'left',
60
+ faIcon: {
61
+ name: iconName,
62
+ color: '#FFFFFF',
63
+ size: 16
64
+ }
65
+ }
66
+ } : {})) : null), text ? /*#__PURE__*/React.createElement("div", {
67
+ className: `${style.footerDescription} ${isError ? style.footerDescriptionError : ''}`
68
+ }, text) : null);
69
+ }, [footer]);
70
+ if (!isOpen || !title || !children) return null;
71
+
72
+ function handleOnClose(e) {
73
+ e?.stopPropagation();
74
+ onClose();
75
+ }
76
+
77
+ return /*#__PURE__*/React.createElement("div", {
78
+ className: style.modalWrapper
79
+ }, /*#__PURE__*/React.createElement("div", {
80
+ className: style.modal
81
+ }, /*#__PURE__*/React.createElement("header", {
82
+ className: style.header
83
+ }, headerIcon?.name ? /*#__PURE__*/React.createElement("div", {
84
+ className: style.headerIcon
85
+ }, /*#__PURE__*/React.createElement(Icon, {
86
+ iconName: headerIcon.name,
87
+ iconColor: headerIcon.color,
88
+ backgroundColor: headerIcon.backgroundColor,
89
+ size: {
90
+ faSize: 20,
91
+ wrapperSize: 48
92
+ }
93
+ })) : null, /*#__PURE__*/React.createElement("div", {
94
+ className: style.headerContent
95
+ }, /*#__PURE__*/React.createElement("div", {
96
+ className: style.headerTitle
97
+ }, title), description ? /*#__PURE__*/React.createElement("div", {
98
+ className: style.headerDescription
99
+ }, description) : null), /*#__PURE__*/React.createElement("div", {
100
+ className: style.headerCloseIcon,
101
+ onClick: handleOnClose
102
+ }, /*#__PURE__*/React.createElement(Icon, {
103
+ iconName: "close",
104
+ backgroundColor: "#F4F4F5",
105
+ size: {
106
+ faSize: 14,
107
+ wrapperSize: 28
108
+ }
109
+ }))), /*#__PURE__*/React.createElement("div", {
110
+ className: style.body
111
+ }, children), /*#__PURE__*/React.createElement(Footer, null)));
112
+ };
113
+
114
+ BaseModal.propTypes = process.env.NODE_ENV !== "production" ? {
115
+ title: PropTypes.string,
116
+ headerIcon: PropTypes.shape({
117
+ name: PropTypes.string,
118
+ color: PropTypes.string,
119
+ backgroundColor: PropTypes.string
120
+ }),
121
+ description: PropTypes.string,
122
+ children: PropTypes.node,
123
+ isOpen: PropTypes.bool,
124
+ footer: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
125
+ text: PropTypes.string,
126
+ isError: PropTypes.boolean,
127
+ cancelButton: PropTypes.shape({
128
+ label: PropTypes.string,
129
+ onCancel: PropTypes.func,
130
+ disabled: PropTypes.bool
131
+ }),
132
+ confirmButton: PropTypes.shape({
133
+ label: PropTypes.string,
134
+ onConfirm: PropTypes.func,
135
+ iconName: PropTypes.string,
136
+ disabled: PropTypes.bool
137
+ })
138
+ })]),
139
+ onClose: PropTypes.func
140
+ } : {};
141
+ export default BaseModal;
142
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["React","useCallback","PropTypes","Icon","ButtonLink","style","BaseModal","props","title","description","headerIcon","children","isOpen","footer","onClose","Footer","cancelButton","confirmButton","text","isError","label","cancelLabel","onCancel","disabled","cancelDisabled","confirmLabel","onConfirm","confirmDisabled","iconName","footerCTAWrapper","className","footerCancelButton","type","onClick","footerConfirmButton","icon","position","faIcon","name","color","size","footerDescription","footerDescriptionError","handleOnClose","e","stopPropagation","modalWrapper","modal","header","backgroundColor","faSize","wrapperSize","headerContent","headerTitle","headerDescription","headerCloseIcon","body","propTypes","string","shape","node","bool","oneOfType","func","boolean"],"sources":["../../../src/molecule/base-modal/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty} from 'lodash/fp';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst BaseModal = props => {\n const {title, description, headerIcon, children, isOpen, footer, onClose} = props;\n\n const Footer = useCallback(() => {\n if (isEmpty(footer)) return null;\n if (typeof footer === 'function') return footer();\n\n const {cancelButton, confirmButton, text, isError} = footer;\n const {label: cancelLabel, onCancel, disabled: cancelDisabled} = cancelButton || {};\n const {\n label: confirmLabel,\n onConfirm,\n disabled: confirmDisabled,\n iconName\n } = confirmButton || {};\n\n return (\n <div className={style.footer}>\n <div className={style.footerCTAWrapper}>\n {onCancel && cancelLabel ? (\n <ButtonLink\n {...{\n className: style.footerCancelButton,\n type: 'secondary',\n onClick: onCancel,\n label: cancelLabel,\n disabled: cancelDisabled\n }}\n />\n ) : null}\n {onConfirm && confirmLabel ? (\n <ButtonLink\n {...{\n className: style.footerConfirmButton,\n type: 'primary',\n onClick: onConfirm,\n label: confirmLabel,\n disabled: confirmDisabled,\n ...(iconName\n ? {\n icon: {\n position: 'left',\n faIcon: {\n name: iconName,\n color: '#FFFFFF',\n size: 16\n }\n }\n }\n : {})\n }}\n />\n ) : null}\n </div>\n {text ? (\n <div\n className={`${style.footerDescription} ${isError ? style.footerDescriptionError : ''}`}\n >\n {text}\n </div>\n ) : null}\n </div>\n );\n }, [footer]);\n\n if (!isOpen || !title || !children) return null;\n\n function handleOnClose(e) {\n e?.stopPropagation();\n onClose();\n }\n\n return (\n <div className={style.modalWrapper}>\n <div className={style.modal}>\n <header className={style.header}>\n {headerIcon?.name ? (\n <div className={style.headerIcon}>\n <Icon\n iconName={headerIcon.name}\n iconColor={headerIcon.color}\n backgroundColor={headerIcon.backgroundColor}\n size={{faSize: 20, wrapperSize: 48}}\n />\n </div>\n ) : null}\n <div className={style.headerContent}>\n <div className={style.headerTitle}>{title}</div>\n {description ? <div className={style.headerDescription}>{description}</div> : null}\n </div>\n <div className={style.headerCloseIcon} onClick={handleOnClose}>\n <Icon iconName=\"close\" backgroundColor=\"#F4F4F5\" size={{faSize: 14, wrapperSize: 28}} />\n </div>\n </header>\n <div className={style.body}>{children}</div>\n <Footer />\n </div>\n </div>\n );\n};\n\nBaseModal.propTypes = {\n title: PropTypes.string,\n headerIcon: PropTypes.shape({\n name: PropTypes.string,\n color: PropTypes.string,\n backgroundColor: PropTypes.string\n }),\n description: PropTypes.string,\n children: PropTypes.node,\n isOpen: PropTypes.bool,\n footer: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n text: PropTypes.string,\n isError: PropTypes.boolean,\n cancelButton: PropTypes.shape({\n label: PropTypes.string,\n onCancel: PropTypes.func,\n disabled: PropTypes.bool\n }),\n confirmButton: PropTypes.shape({\n label: PropTypes.string,\n onConfirm: PropTypes.func,\n iconName: PropTypes.string,\n disabled: PropTypes.bool\n })\n })\n ]),\n onClose: PropTypes.func\n};\n\nexport default BaseModal;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,SAAS,GAAGC,KAAK,IAAI;EACzB,MAAM;IAACC,KAAD;IAAQC,WAAR;IAAqBC,UAArB;IAAiCC,QAAjC;IAA2CC,MAA3C;IAAmDC,MAAnD;IAA2DC;EAA3D,IAAsEP,KAA5E;EAEA,MAAMQ,MAAM,GAAGd,WAAW,CAAC,MAAM;IAC/B,IAAI,SAAQY,MAAR,CAAJ,EAAqB,OAAO,IAAP;IACrB,IAAI,OAAOA,MAAP,KAAkB,UAAtB,EAAkC,OAAOA,MAAM,EAAb;IAElC,MAAM;MAACG,YAAD;MAAeC,aAAf;MAA8BC,IAA9B;MAAoCC;IAApC,IAA+CN,MAArD;IACA,MAAM;MAACO,KAAK,EAAEC,WAAR;MAAqBC,QAArB;MAA+BC,QAAQ,EAAEC;IAAzC,IAA2DR,YAAY,IAAI,EAAjF;IACA,MAAM;MACJI,KAAK,EAAEK,YADH;MAEJC,SAFI;MAGJH,QAAQ,EAAEI,eAHN;MAIJC;IAJI,IAKFX,aAAa,IAAI,EALrB;IAOA,oBACE;MAAK,SAAS,EAAEZ,KAAK,CAACQ;IAAtB,gBACE;MAAK,SAAS,EAAER,KAAK,CAACwB;IAAtB,GACGP,QAAQ,IAAID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AoB,CAC1B5D,SAAS,CAAC6D,IADgB,EAE1B7D,SAAS,CAACyD,KAAV,CAAgB;IACdzC,IAAI,EAAEhB,SAAS,CAACwD,MADF;IAEdvC,OAAO,EAAEjB,SAAS,CAAC8D,OAFL;IAGdhD,YAAY,EAAEd,SAAS,CAACyD,KAAV,CAAgB;MAC5BvC,KAAK,EAAElB,SAAS,CAACwD,MADW;MAE5BpC,QAAQ,EAAEpB,SAAS,CAAC6D,IAFQ;MAG5BxC,QAAQ,EAAErB,SAAS,CAAC2D;IAHQ,CAAhB,CAHA;IAQd5C,aAAa,EAAEf,SAAS,CAACyD,KAAV,CAAgB;MAC7BvC,KAAK,EAAElB,SAAS,CAACwD,MADY;MAE7BhC,SAAS,EAAExB,SAAS,CAAC6D,IAFQ;MAG7BnC,QAAQ,EAAE1B,SAAS,CAACwD,MAHS;MAI7BnC,QAAQ,EAAErB,SAAS,CAAC2D;IAJS,CAAhB;EARD,CAAhB,CAF0B,CAApB,CAVY;EA4BpB/C,OAAO,EAAEZ,SAAS,CAAC6D;AA5BC,CAAtB;AA+BA,eAAezD,SAAf"}
@@ -0,0 +1,125 @@
1
+ @value colors: "../../variables/colors.css";
2
+ @value breakpoints: "../../variables/breakpoints.css";
3
+ @value tablet from breakpoints;
4
+ @value mobile from breakpoints;
5
+ @value white from colors;
6
+ @value lightDark from colors;
7
+ @value dark from colors;
8
+ @value light from colors;
9
+ @value xtraLightGrey from colors;
10
+ @value cm_grey_150 from colors;
11
+
12
+ .modalWrapper {
13
+ position: fixed;
14
+ z-index: 1000;
15
+ bottom: 0;
16
+ right: 0;
17
+ height: 100vh;
18
+ width: 100vw;
19
+ display: flex;
20
+ font-family: "Gilroy";
21
+ justify-content: center;
22
+ align-items: center;
23
+ background-color: lightDark;
24
+ }
25
+
26
+ .modal {
27
+ max-width: 660px;
28
+ min-width: 450px;
29
+ min-height: 165px;
30
+ overflow: hidden;
31
+ border-radius: 16px;
32
+ background-color: white;
33
+ }
34
+
35
+ .header {
36
+ padding: 24px;
37
+ display: flex;
38
+ position: relative;
39
+ }
40
+
41
+ .headerIcon {
42
+ border-radius: 12px;
43
+ overflow: hidden;
44
+ margin-right: 16px;
45
+ }
46
+
47
+ .headerContent {
48
+ flex: 1;
49
+ }
50
+
51
+ .headerTitle {
52
+ font-size: 18px;
53
+ font-weight: 600;
54
+ line-height: 24px;
55
+ }
56
+
57
+ .headerDescription {
58
+ font-size: 14px;
59
+ font-weight: 500;
60
+ line-height: 20px;
61
+ }
62
+
63
+ .headerCloseIcon {
64
+ position: absolute;
65
+ top: 12px;
66
+ right: 12px;
67
+ cursor: pointer;
68
+ }
69
+
70
+ .body {
71
+ background-color: xtraLightGrey;
72
+ padding: 32px 32px 16px 32px;
73
+ min-height: 100px;
74
+ border-top: 1px solid cm_grey_150;
75
+ border-bottom: 1px solid cm_grey_150;
76
+ }
77
+
78
+ .footer {
79
+ padding: 24px;
80
+ display: flex;
81
+ flex-direction: row-reverse;
82
+ justify-content: space-between;
83
+ align-items: center;
84
+ }
85
+
86
+ .footerDescriptionError {
87
+ color: #991100;
88
+ }
89
+
90
+ .footerCTAWrapper {
91
+ display: flex;
92
+ gap: 8px;
93
+ }
94
+
95
+ .footerCancelButton {
96
+ width: 94px;
97
+ }
98
+
99
+ .footerConfirmButton {
100
+ width: 121px;
101
+ }
102
+
103
+ @media mobile {
104
+ .modal {
105
+ min-width: unset;
106
+ flex: 1;
107
+ margin: 0 16px;
108
+ }
109
+
110
+ .footerCTAWrapper,
111
+ .footer {
112
+ flex-direction: column-reverse;
113
+ }
114
+
115
+ .footerCTAWrapper,
116
+ .footerCancelButton,
117
+ .footerConfirmButton,
118
+ .footerDescription {
119
+ width: 100%;
120
+ }
121
+
122
+ .footerDescription {
123
+ margin-bottom: 16px;
124
+ }
125
+ }
@@ -80,6 +80,7 @@ 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>;
83
84
  'aria-label': PropTypes.Requireable<string>;
84
85
  'data-name': PropTypes.Requireable<string>;
85
86
  'data-testid': PropTypes.Requireable<string>;
@@ -211,6 +212,7 @@ declare const propTypes: {
211
212
  componentType: PropTypes.Requireable<string>;
212
213
  type: PropTypes.Requireable<string>;
213
214
  label: PropTypes.Requireable<string>;
215
+ content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
214
216
  'aria-label': PropTypes.Requireable<string>;
215
217
  'data-name': PropTypes.Requireable<string>;
216
218
  '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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDd,CAAC;AAEF,aAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,UAAU,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,K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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,6 +65,7 @@ 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>;
68
69
  'aria-label': import("prop-types").Requireable<string>;
69
70
  'data-name': import("prop-types").Requireable<string>;
70
71
  '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,6 +42,7 @@ 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>;
45
46
  'aria-label': PropTypes.Requireable<string>;
46
47
  'data-name': PropTypes.Requireable<string>;
47
48
  '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,CAAC,eAAe,GAAG;IACjB,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC,GACF,CAAC,0BAA0B,GAAG;IAC5B,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC,CAAC;AAEP,oBAAY,SAAS,GACjB,CAAC,gBAAgB,GAAG;IAClB,aAAa,EAAE,cAAc,CAAC;CAC/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AI,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,11 +8,13 @@ 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>;
11
12
  metrics: PropTypes.Requireable<PropTypes.InferProps<{
12
13
  skillCourses: PropTypes.Requireable<number>;
13
14
  skillQuestions: PropTypes.Requireable<number>;
14
15
  completedCourses: PropTypes.Requireable<number>;
15
16
  }>>;
17
+ review: PropTypes.Requireable<boolean>;
16
18
  onReviewClick: PropTypes.Requireable<(...args: any[]) => any>;
17
19
  onExploreClick: PropTypes.Requireable<(...args: any[]) => any>;
18
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.js"],"names":[],"mappings":";AASA,yEAsJC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learner-skill-card/index.js"],"names":[],"mappings":";AASA,yEA2JC"}
@@ -13,7 +13,9 @@ const LearnerSkillCard = (props, context) => {
13
13
  'aria-label': ariaLabel,
14
14
  skillTitle,
15
15
  skillAriaLabel,
16
+ focus = false,
16
17
  metrics,
18
+ review = false,
17
19
  onReviewClick,
18
20
  onExploreClick
19
21
  } = props;
@@ -43,7 +45,8 @@ const LearnerSkillCard = (props, context) => {
43
45
  backgroundColor: '#FFF',
44
46
  transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'
45
47
  },
46
- onReviewClick,
48
+ disabled: !review,
49
+ onClick: () => onReviewClick(skillTitle),
47
50
  'aria-label': `${skillTitle}, ${reviewLocale}`,
48
51
  label: reviewLocale,
49
52
  'data-name': 'learner-skill-card-review-button'
@@ -54,7 +57,7 @@ const LearnerSkillCard = (props, context) => {
54
57
  color: hovered ? '#FFFFFF' : primarySkinColor,
55
58
  transition: 'background-color 0.15s ease-in-out, color 0.15s ease-in-out'
56
59
  },
57
- onExploreClick,
60
+ onClick: () => onExploreClick(skillTitle),
58
61
  'aria-label': `${skillTitle}, ${exploreLocale}`,
59
62
  label: exploreLocale,
60
63
  'data-name': 'learner-skill-card-explore-button',
@@ -108,7 +111,7 @@ const LearnerSkillCard = (props, context) => {
108
111
  "data-name": "skill-title",
109
112
  className: style.skillTitle,
110
113
  "aria-label": skillAriaLabel || skillTitle
111
- }, skillTitle), /*#__PURE__*/React.createElement("div", {
114
+ }, skillTitle), focus ? /*#__PURE__*/React.createElement("div", {
112
115
  className: style.skillFocusBadge
113
116
  }, /*#__PURE__*/React.createElement(Icon, {
114
117
  iconName: "bullseye-arrow",
@@ -117,7 +120,7 @@ const LearnerSkillCard = (props, context) => {
117
120
  faSize: 10,
118
121
  wrapperSize: 16
119
122
  }
120
- }), skillFocusLocale)), /*#__PURE__*/React.createElement(ProgressBar, null), /*#__PURE__*/React.createElement("div", {
123
+ }), skillFocusLocale) : null), /*#__PURE__*/React.createElement(ProgressBar, null), /*#__PURE__*/React.createElement("div", {
121
124
  className: style.progressInformations
122
125
  }, skillCourses && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
123
126
  className: style.progressInformation,
@@ -147,11 +150,13 @@ LearnerSkillCard.propTypes = process.env.NODE_ENV !== "production" ? {
147
150
  'aria-label': PropTypes.string,
148
151
  skillTitle: PropTypes.string,
149
152
  skillAriaLabel: PropTypes.string,
153
+ focus: PropTypes.bool,
150
154
  metrics: PropTypes.shape({
151
155
  skillCourses: PropTypes.number,
152
156
  skillQuestions: PropTypes.number,
153
157
  completedCourses: PropTypes.number
154
158
  }),
159
+ review: PropTypes.bool,
155
160
  onReviewClick: PropTypes.func,
156
161
  onExploreClick: PropTypes.func
157
162
  } : {};