@coorpacademy/components 11.32.24-alpha.6 → 11.32.25

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 (241) 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 +4 -2
  4. package/es/atom/button-link/index.js.map +1 -1
  5. package/es/atom/button-link/types.d.ts +2 -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/circular-progress-bar/index.d.ts.map +1 -1
  10. package/es/atom/circular-progress-bar/index.js +1 -10
  11. package/es/atom/circular-progress-bar/index.js.map +1 -1
  12. package/es/atom/input-doublestep/index.d.ts +1 -0
  13. package/es/atom/input-doublestep/index.d.ts.map +1 -1
  14. package/es/atom/input-doublestep/index.js +38 -13
  15. package/es/atom/input-doublestep/index.js.map +1 -1
  16. package/es/atom/input-doublestep/style.css +7 -67
  17. package/es/atom/select/index.js +1 -1
  18. package/es/atom/select/index.js.map +1 -1
  19. package/es/molecule/base-modal/index.d.ts +1 -0
  20. package/es/molecule/base-modal/index.d.ts.map +1 -1
  21. package/es/molecule/base-modal/index.js +8 -6
  22. package/es/molecule/base-modal/index.js.map +1 -1
  23. package/es/molecule/brand-create-form/index.d.ts.map +1 -1
  24. package/es/molecule/brand-create-form/index.js +9 -4
  25. package/es/molecule/brand-create-form/index.js.map +1 -1
  26. package/es/molecule/brand-download-box/index.d.ts.map +1 -1
  27. package/es/molecule/brand-download-box/index.js +11 -6
  28. package/es/molecule/brand-download-box/index.js.map +1 -1
  29. package/es/molecule/brand-download-box/style.css +6 -5
  30. package/es/molecule/brand-form-group/index.d.ts.map +1 -1
  31. package/es/molecule/brand-form-group/index.js +12 -1
  32. package/es/molecule/brand-form-group/index.js.map +1 -1
  33. package/es/molecule/cm-popin/style.css +1 -1
  34. package/es/molecule/cm-popin/types.d.ts +3 -0
  35. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  36. package/es/molecule/discipline-associated-skills/index.js +1 -1
  37. package/es/molecule/discipline-associated-skills/index.js.map +1 -1
  38. package/es/molecule/draggable-list/index.d.ts +1 -0
  39. package/es/molecule/expandible-actionable-table/index.d.ts +1 -0
  40. package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
  41. package/es/molecule/expandible-actionable-table/types.d.ts +1 -0
  42. package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
  43. package/es/molecule/learning-priority-modal/index.d.ts.map +1 -1
  44. package/es/molecule/learning-priority-modal/index.js +8 -15
  45. package/es/molecule/learning-priority-modal/index.js.map +1 -1
  46. package/es/molecule/learning-priority-modal/style.css +0 -1
  47. package/es/molecule/learning-priority-setup-item/index.d.ts.map +1 -1
  48. package/es/molecule/learning-priority-setup-item/index.js +1 -1
  49. package/es/molecule/learning-priority-setup-item/index.js.map +1 -1
  50. package/es/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
  51. package/es/molecule/learning-profile-radar-chart/index.js +0 -2
  52. package/es/molecule/learning-profile-radar-chart/index.js.map +1 -1
  53. package/es/molecule/playlist-detail-cover/index.d.ts +14 -0
  54. package/es/molecule/playlist-detail-cover/index.d.ts.map +1 -0
  55. package/es/molecule/playlist-detail-cover/index.js +52 -0
  56. package/es/molecule/playlist-detail-cover/index.js.map +1 -0
  57. package/es/molecule/playlist-detail-cover/style.css +17 -0
  58. package/es/molecule/setup-section/index.d.ts.map +1 -1
  59. package/es/molecule/setup-section/index.js +3 -1
  60. package/es/molecule/setup-section/index.js.map +1 -1
  61. package/es/molecule/setup-section/style.css +2 -2
  62. package/es/molecule/skill-picker-modal/index.js +1 -1
  63. package/es/molecule/skill-picker-modal/index.js.map +1 -1
  64. package/es/organism/brand-form/index.d.ts.map +1 -1
  65. package/es/organism/brand-form/index.js +24 -15
  66. package/es/organism/brand-form/index.js.map +1 -1
  67. package/es/organism/brand-learning-priorities/index.d.ts +1 -21
  68. package/es/organism/brand-learning-priorities/index.d.ts.map +1 -1
  69. package/es/organism/brand-learning-priorities/index.js +1 -14
  70. package/es/organism/brand-learning-priorities/index.js.map +1 -1
  71. package/es/organism/brand-learning-priorities/style.css +2 -0
  72. package/es/organism/list-item/index.d.ts +3 -1
  73. package/es/organism/list-item/index.d.ts.map +1 -1
  74. package/es/organism/list-item/index.js +7 -5
  75. package/es/organism/list-item/index.js.map +1 -1
  76. package/es/organism/list-items/index.d.ts +3 -0
  77. package/es/organism/setup-header/index.d.ts +4 -0
  78. package/es/organism/wizard-contents/index.d.ts +3 -0
  79. package/es/template/app-player/loading/index.d.ts +3 -0
  80. package/es/template/app-player/player/index.d.ts +6 -0
  81. package/es/template/app-player/player/slides/index.d.ts +3 -0
  82. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  83. package/es/template/app-player/popin-correction/index.d.ts +3 -0
  84. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  85. package/es/template/app-player/popin-end/index.d.ts +3 -0
  86. package/es/template/app-review/index.d.ts +3 -0
  87. package/es/template/app-review/index.d.ts.map +1 -1
  88. package/es/template/app-review/player/prop-types.d.ts +3 -0
  89. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  90. package/es/template/app-review/prop-types.d.ts +3 -0
  91. package/es/template/app-review/prop-types.d.ts.map +1 -1
  92. package/es/template/back-office/brand-create/index.d.ts +4 -0
  93. package/es/template/back-office/brand-create/index.d.ts.map +1 -1
  94. package/es/template/back-office/brand-list/index.d.ts +4 -0
  95. package/es/template/back-office/brand-list/index.d.ts.map +1 -1
  96. package/es/template/back-office/brand-update/index.d.ts +14 -0
  97. package/es/template/back-office/dashboard-preview/index.d.ts +4 -0
  98. package/es/template/back-office/layout/index.d.ts +4 -0
  99. package/es/template/back-office/layout/index.d.ts.map +1 -1
  100. package/es/template/common/dashboard/index.d.ts +6 -0
  101. package/es/template/common/search-page/index.d.ts +3 -0
  102. package/es/template/external-course/index.d.ts +3 -0
  103. package/es/template/my-learning/index.js +1 -1
  104. package/es/template/my-learning/index.js.map +1 -1
  105. package/es/template/playlist-detail/index.d.ts +96 -0
  106. package/es/template/playlist-detail/index.d.ts.map +1 -0
  107. package/es/template/playlist-detail/index.js +109 -0
  108. package/es/template/playlist-detail/index.js.map +1 -0
  109. package/es/template/playlist-detail/style.css +108 -0
  110. package/es/template/skill-detail/all-courses.d.ts +1 -1
  111. package/es/template/skill-detail/all-courses.js +3 -3
  112. package/es/template/skill-detail/all-courses.js.map +1 -1
  113. package/es/template/skill-detail/index.d.ts +39 -4
  114. package/es/template/skill-detail/index.d.ts.map +1 -1
  115. package/es/template/skill-detail/index.js +2 -4
  116. package/es/template/skill-detail/index.js.map +1 -1
  117. package/es/util/external-content.d.ts +1 -0
  118. package/es/util/external-content.d.ts.map +1 -1
  119. package/es/util/external-content.js +1 -0
  120. package/es/util/external-content.js.map +1 -1
  121. package/lib/atom/button-link/index.d.ts +1 -0
  122. package/lib/atom/button-link/index.d.ts.map +1 -1
  123. package/lib/atom/button-link/index.js +4 -2
  124. package/lib/atom/button-link/index.js.map +1 -1
  125. package/lib/atom/button-link/types.d.ts +2 -0
  126. package/lib/atom/button-link/types.d.ts.map +1 -1
  127. package/lib/atom/button-link/types.js +1 -0
  128. package/lib/atom/button-link/types.js.map +1 -1
  129. package/lib/atom/circular-progress-bar/index.d.ts.map +1 -1
  130. package/lib/atom/circular-progress-bar/index.js +1 -10
  131. package/lib/atom/circular-progress-bar/index.js.map +1 -1
  132. package/lib/atom/input-doublestep/index.d.ts +1 -0
  133. package/lib/atom/input-doublestep/index.d.ts.map +1 -1
  134. package/lib/atom/input-doublestep/index.js +39 -13
  135. package/lib/atom/input-doublestep/index.js.map +1 -1
  136. package/lib/atom/input-doublestep/style.css +7 -67
  137. package/lib/atom/select/index.js +1 -1
  138. package/lib/atom/select/index.js.map +1 -1
  139. package/lib/molecule/base-modal/index.d.ts +1 -0
  140. package/lib/molecule/base-modal/index.d.ts.map +1 -1
  141. package/lib/molecule/base-modal/index.js +8 -6
  142. package/lib/molecule/base-modal/index.js.map +1 -1
  143. package/lib/molecule/brand-create-form/index.d.ts.map +1 -1
  144. package/lib/molecule/brand-create-form/index.js +9 -4
  145. package/lib/molecule/brand-create-form/index.js.map +1 -1
  146. package/lib/molecule/brand-download-box/index.d.ts.map +1 -1
  147. package/lib/molecule/brand-download-box/index.js +11 -6
  148. package/lib/molecule/brand-download-box/index.js.map +1 -1
  149. package/lib/molecule/brand-download-box/style.css +6 -5
  150. package/lib/molecule/brand-form-group/index.d.ts.map +1 -1
  151. package/lib/molecule/brand-form-group/index.js +12 -1
  152. package/lib/molecule/brand-form-group/index.js.map +1 -1
  153. package/lib/molecule/cm-popin/style.css +1 -1
  154. package/lib/molecule/cm-popin/types.d.ts +3 -0
  155. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  156. package/lib/molecule/discipline-associated-skills/index.js +1 -1
  157. package/lib/molecule/discipline-associated-skills/index.js.map +1 -1
  158. package/lib/molecule/draggable-list/index.d.ts +1 -0
  159. package/lib/molecule/expandible-actionable-table/index.d.ts +1 -0
  160. package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
  161. package/lib/molecule/expandible-actionable-table/types.d.ts +1 -0
  162. package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
  163. package/lib/molecule/learning-priority-modal/index.d.ts.map +1 -1
  164. package/lib/molecule/learning-priority-modal/index.js +9 -14
  165. package/lib/molecule/learning-priority-modal/index.js.map +1 -1
  166. package/lib/molecule/learning-priority-modal/style.css +0 -1
  167. package/lib/molecule/learning-priority-setup-item/index.d.ts.map +1 -1
  168. package/lib/molecule/learning-priority-setup-item/index.js +1 -1
  169. package/lib/molecule/learning-priority-setup-item/index.js.map +1 -1
  170. package/lib/molecule/learning-profile-radar-chart/index.d.ts.map +1 -1
  171. package/lib/molecule/learning-profile-radar-chart/index.js +0 -2
  172. package/lib/molecule/learning-profile-radar-chart/index.js.map +1 -1
  173. package/lib/molecule/playlist-detail-cover/index.d.ts +14 -0
  174. package/lib/molecule/playlist-detail-cover/index.d.ts.map +1 -0
  175. package/lib/molecule/playlist-detail-cover/index.js +68 -0
  176. package/lib/molecule/playlist-detail-cover/index.js.map +1 -0
  177. package/lib/molecule/playlist-detail-cover/style.css +17 -0
  178. package/lib/molecule/setup-section/index.d.ts.map +1 -1
  179. package/lib/molecule/setup-section/index.js +4 -1
  180. package/lib/molecule/setup-section/index.js.map +1 -1
  181. package/lib/molecule/setup-section/style.css +2 -2
  182. package/lib/molecule/skill-picker-modal/index.js +1 -1
  183. package/lib/molecule/skill-picker-modal/index.js.map +1 -1
  184. package/lib/organism/brand-form/index.d.ts.map +1 -1
  185. package/lib/organism/brand-form/index.js +24 -15
  186. package/lib/organism/brand-form/index.js.map +1 -1
  187. package/lib/organism/brand-learning-priorities/index.d.ts +1 -21
  188. package/lib/organism/brand-learning-priorities/index.d.ts.map +1 -1
  189. package/lib/organism/brand-learning-priorities/index.js +3 -15
  190. package/lib/organism/brand-learning-priorities/index.js.map +1 -1
  191. package/lib/organism/brand-learning-priorities/style.css +2 -0
  192. package/lib/organism/list-item/index.d.ts +3 -1
  193. package/lib/organism/list-item/index.d.ts.map +1 -1
  194. package/lib/organism/list-item/index.js +7 -5
  195. package/lib/organism/list-item/index.js.map +1 -1
  196. package/lib/organism/list-items/index.d.ts +3 -0
  197. package/lib/organism/setup-header/index.d.ts +4 -0
  198. package/lib/organism/wizard-contents/index.d.ts +3 -0
  199. package/lib/template/app-player/loading/index.d.ts +3 -0
  200. package/lib/template/app-player/player/index.d.ts +6 -0
  201. package/lib/template/app-player/player/slides/index.d.ts +3 -0
  202. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  203. package/lib/template/app-player/popin-correction/index.d.ts +3 -0
  204. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  205. package/lib/template/app-player/popin-end/index.d.ts +3 -0
  206. package/lib/template/app-review/index.d.ts +3 -0
  207. package/lib/template/app-review/index.d.ts.map +1 -1
  208. package/lib/template/app-review/player/prop-types.d.ts +3 -0
  209. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  210. package/lib/template/app-review/prop-types.d.ts +3 -0
  211. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  212. package/lib/template/back-office/brand-create/index.d.ts +4 -0
  213. package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
  214. package/lib/template/back-office/brand-list/index.d.ts +4 -0
  215. package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
  216. package/lib/template/back-office/brand-update/index.d.ts +14 -0
  217. package/lib/template/back-office/dashboard-preview/index.d.ts +4 -0
  218. package/lib/template/back-office/layout/index.d.ts +4 -0
  219. package/lib/template/back-office/layout/index.d.ts.map +1 -1
  220. package/lib/template/common/dashboard/index.d.ts +6 -0
  221. package/lib/template/common/search-page/index.d.ts +3 -0
  222. package/lib/template/external-course/index.d.ts +3 -0
  223. package/lib/template/my-learning/index.js +1 -1
  224. package/lib/template/my-learning/index.js.map +1 -1
  225. package/lib/template/playlist-detail/index.d.ts +96 -0
  226. package/lib/template/playlist-detail/index.d.ts.map +1 -0
  227. package/lib/template/playlist-detail/index.js +134 -0
  228. package/lib/template/playlist-detail/index.js.map +1 -0
  229. package/lib/template/playlist-detail/style.css +108 -0
  230. package/lib/template/skill-detail/all-courses.d.ts +1 -1
  231. package/lib/template/skill-detail/all-courses.js +3 -3
  232. package/lib/template/skill-detail/all-courses.js.map +1 -1
  233. package/lib/template/skill-detail/index.d.ts +39 -4
  234. package/lib/template/skill-detail/index.d.ts.map +1 -1
  235. package/lib/template/skill-detail/index.js +3 -2
  236. package/lib/template/skill-detail/index.js.map +1 -1
  237. package/lib/util/external-content.d.ts +1 -0
  238. package/lib/util/external-content.d.ts.map +1 -1
  239. package/lib/util/external-content.js +3 -1
  240. package/lib/util/external-content.js.map +1 -1
  241. package/package.json +2 -2
@@ -1,6 +1,5 @@
1
- export default SkillDetail;
2
- declare function SkillDetail(props: any, context: any): JSX.Element;
3
- declare namespace SkillDetail {
1
+ export function ContinueLearningButton(props: any, context: any): JSX.Element;
2
+ export namespace ContinueLearningButton {
4
3
  namespace contextTypes {
5
4
  const skin: PropTypes.Requireable<PropTypes.InferProps<{
6
5
  common: PropTypes.Requireable<{
@@ -26,6 +25,42 @@ declare namespace SkillDetail {
26
25
  const translate: PropTypes.Requireable<(...args: any[]) => any>;
27
26
  }
28
27
  namespace propTypes {
28
+ const ongoingCoursesAvailable: PropTypes.Requireable<boolean>;
29
+ const onClick: PropTypes.Requireable<(...args: any[]) => any>;
30
+ }
31
+ }
32
+ export default SkillDetail;
33
+ import PropTypes from "prop-types";
34
+ declare function SkillDetail(props: any, context: any): JSX.Element;
35
+ declare namespace SkillDetail {
36
+ export namespace contextTypes_1 {
37
+ const skin_1: PropTypes.Requireable<PropTypes.InferProps<{
38
+ common: PropTypes.Requireable<{
39
+ [x: string]: any;
40
+ }>;
41
+ images: PropTypes.Requireable<PropTypes.InferProps<{
42
+ 'logo-mobile': PropTypes.Requireable<any>;
43
+ logo: PropTypes.Requireable<any>;
44
+ 'logo-email': PropTypes.Requireable<any>;
45
+ login: PropTypes.Requireable<any>;
46
+ }>>;
47
+ icons: PropTypes.Requireable<{
48
+ [x: string]: any;
49
+ }>;
50
+ mod: PropTypes.Requireable<{
51
+ [x: string]: any;
52
+ }>;
53
+ courses: PropTypes.Requireable<any[]>;
54
+ texts: PropTypes.Requireable<{
55
+ [x: string]: any;
56
+ }>;
57
+ }>>;
58
+ export { skin_1 as skin };
59
+ const translate_1: PropTypes.Requireable<(...args: any[]) => any>;
60
+ export { translate_1 as translate };
61
+ }
62
+ export { contextTypes_1 as contextTypes };
63
+ export namespace propTypes_1 {
29
64
  const title: PropTypes.Validator<string>;
30
65
  const skillRef: PropTypes.Validator<string>;
31
66
  const description: PropTypes.Requireable<string>;
@@ -96,6 +131,6 @@ declare namespace SkillDetail {
96
131
  const onReviewClick: PropTypes.Requireable<(...args: any[]) => any>;
97
132
  const onContinueLearningClick: PropTypes.Requireable<(...args: any[]) => any>;
98
133
  }
134
+ export { propTypes_1 as propTypes };
99
135
  }
100
- import PropTypes from "prop-types";
101
136
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":";AAyDA,oEA+JC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/skill-detail/index.js"],"names":[],"mappings":"AAcO,8EA+BN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYD,oEA+JC"}
@@ -11,8 +11,7 @@ import CardsGrid from '../../organism/cards-grid';
11
11
  import style from './style.css';
12
12
  import AllCourses from './all-courses';
13
13
  import ContinueLearning from './continue-learning';
14
-
15
- const ContinueLearningButton = (props, context) => {
14
+ export const ContinueLearningButton = (props, context) => {
16
15
  const {
17
16
  ongoingCoursesAvailable,
18
17
  onClick
@@ -45,7 +44,6 @@ const ContinueLearningButton = (props, context) => {
45
44
  onClick: onClick
46
45
  }));
47
46
  };
48
-
49
47
  ContinueLearningButton.contextTypes = {
50
48
  skin: Provider.childContextTypes.skin,
51
49
  translate: Provider.childContextTypes.translate
@@ -185,7 +183,7 @@ const SkillDetail = (props, context) => {
185
183
  }, score.toFixed(1), "%"))))) : null, /*#__PURE__*/React.createElement(ContinueLearning, {
186
184
  ongoingCourses: ongoingCourses
187
185
  }), /*#__PURE__*/React.createElement(AllCourses, {
188
- skillIncludedCourses: skillIncludedCourses,
186
+ courses: skillIncludedCourses,
189
187
  totalCourses: totalCourses,
190
188
  filters: filters,
191
189
  sorting: sorting
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useState","PropTypes","convert","classnames","Provider","Select","SelectOptionPropTypes","ButtonLink","Icon","CardsGrid","style","AllCourses","ContinueLearning","ContinueLearningButton","props","context","ongoingCoursesAvailable","onClick","skin","translate","primarySkinColor","width","borderRadius","backgroundColor","position","faIcon","name","color","size","contextTypes","childContextTypes","propTypes","bool","func","SkillDetail","title","skillRef","description","metrics","focused","availableForReview","ongoingCourses","skillIncludedCourses","totalCourses","filters","sorting","onBackClick","onReviewClick","onContinueLearningClick","score","content","questionsToReview","contentCompleted","showMore","setShowMore","handleShowMore","Description","truncate","ProgressBar","undefined","progressBarColor","inlineProgressValueStyle","progressBarWrapper","progress","backgroundContainer","container","backButtonWrapper","faSize","wrapperSize","ctaContainer","skillFocusBadge","length","showMoreWrapper","ctaWrapper","list","progressInformationsWrapper","progressTitle","skillCoursesAndQuestionsWrapper","skillInformation","skillInformationNumber","progressInformations","progressInformation","progressInformationNumber","toFixed","string","isRequired","shape","number","onChange","options","arrayOf"],"sources":["../../../src/template/skill-detail/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport style from './style.css';\nimport AllCourses from './all-courses';\nimport ContinueLearning from './continue-learning';\n\nconst ContinueLearningButton = (props, context) => {\n const {ongoingCoursesAvailable, onClick} = props;\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n return (\n <div>\n <ButtonLink\n label={\n ongoingCoursesAvailable ? translate('continue_learning') : translate('start_learning')\n }\n type=\"primary\"\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px',\n backgroundColor: primarySkinColor\n }}\n hoverBackgroundColor={convert(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`)}\n hoverColor=\"#FFFFFF\"\n icon={{\n position: 'left',\n faIcon: {\n name: 'play',\n color: '#FFFFFF',\n size: 16\n }\n }}\n onClick={onClick}\n />\n </div>\n );\n};\n\nContinueLearningButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearningButton.propTypes = {\n ongoingCoursesAvailable: PropTypes.bool,\n onClick: PropTypes.func\n};\n\nconst SkillDetail = (props, context) => {\n const {\n title,\n skillRef,\n description,\n metrics = {},\n focused,\n availableForReview,\n ongoingCourses,\n skillIncludedCourses,\n totalCourses,\n filters,\n sorting,\n onBackClick,\n onReviewClick,\n onContinueLearningClick\n } = props;\n const {score, content, questionsToReview, contentCompleted = 0} = metrics;\n const {translate} = context;\n\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n {description}\n </div>\n );\n }, [showMore, description]);\n\n const ProgressBar = useCallback(() => {\n if (score === undefined) return null;\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${score}%`\n };\n\n return (\n <div className={style.progressBarWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressValueStyle}\n role=\"progressbar\"\n />\n </div>\n );\n }, [score]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={skillRef}>\n <div className={style.backButtonWrapper} onClick={onBackClick}>\n <Icon\n iconName=\"arrow-left\"\n size={{\n faSize: 14,\n wrapperSize: 14\n }}\n />\n </div>\n <div className={style.ctaContainer}>\n <div>\n {focused ? (\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 {translate('skill_focus')}\n </div>\n ) : null}\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {description.length >= 226 ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {showMore ? translate('Show less') : translate('Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{\n faSize: 14,\n wrapperSize: 16\n }}\n />\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n\n <div className={style.ctaWrapper}>\n <ButtonLink\n type=\"secondary\"\n onClick={onReviewClick}\n label={translate('review_this_skill')}\n disabled={!availableForReview}\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px'\n }}\n />\n <ContinueLearningButton\n ongoingCoursesAvailable={!!ongoingCourses.list.length}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n {score !== undefined ? (\n <div className={style.progressInformationsWrapper}>\n <div className={style.progressTitle}>{translate('your_progress')}</div>\n <div className={style.skillCoursesAndQuestionsWrapper}>\n {content ? (\n <div className={style.skillInformation} data-name=\"skill-courses\">\n <span className={style.skillInformationNumber}>{content}</span>{' '}\n {translate('courses')}\n </div>\n ) : null}\n {questionsToReview ? (\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{questionsToReview}</span>\n &nbsp;{translate('questions')}\n </div>\n ) : null}\n </div>\n <ProgressBar />\n <div className={style.progressInformations}>\n {content && (\n <>\n <div className={style.progressInformation} data-name=\"skill-completed-courses\">\n <span className={style.progressInformationNumber}>{contentCompleted}</span>\n {` ${translate('courses_completed')}`}\n </div>\n <div className={style.progressInformation} data-name=\"completed-percentage\">\n <span className={style.progressInformationNumber}>{score.toFixed(1)}%</span>\n </div>\n </>\n )}\n </div>\n </div>\n ) : null}\n <ContinueLearning ongoingCourses={ongoingCourses} />\n <AllCourses\n skillIncludedCourses={skillIncludedCourses}\n totalCourses={totalCourses}\n filters={filters}\n sorting={sorting}\n />\n </div>\n </div>\n );\n};\n\nSkillDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nSkillDetail.propTypes = {\n title: PropTypes.string.isRequired,\n skillRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n content: PropTypes.number,\n questionsToReview: PropTypes.number,\n contentCompleted: PropTypes.number\n }),\n focused: PropTypes.bool,\n availableForReview: PropTypes.bool,\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes),\n skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onReviewClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default SkillDetail;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;;AAEA,MAAMC,sBAAsB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACjD,MAAM;IAACC,uBAAD;IAA0BC;EAA1B,IAAqCH,KAA3C;EACA,MAAM;IAACI,IAAD;IAAOC;EAAP,IAAoBJ,OAA1B;;EACA,MAAMK,gBAAgB,GAAG,KAAI,gBAAJ,EAAsBF,IAAtB,CAAzB;;EAEA,oBACE,8CACE,oBAAC,UAAD;IACE,KAAK,EACHF,uBAAuB,GAAGG,SAAS,CAAC,mBAAD,CAAZ,GAAoCA,SAAS,CAAC,gBAAD,CAFxE;IAIE,IAAI,EAAC,SAJP;IAKE,WAAW,EAAE;MACXE,KAAK,EAAE,aADI;MAEXC,YAAY,EAAE,MAFH;MAGXC,eAAe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"index.js","names":["React","useCallback","useState","PropTypes","convert","classnames","Provider","Select","SelectOptionPropTypes","ButtonLink","Icon","CardsGrid","style","AllCourses","ContinueLearning","ContinueLearningButton","props","context","ongoingCoursesAvailable","onClick","skin","translate","primarySkinColor","width","borderRadius","backgroundColor","position","faIcon","name","color","size","contextTypes","childContextTypes","propTypes","bool","func","SkillDetail","title","skillRef","description","metrics","focused","availableForReview","ongoingCourses","skillIncludedCourses","totalCourses","filters","sorting","onBackClick","onReviewClick","onContinueLearningClick","score","content","questionsToReview","contentCompleted","showMore","setShowMore","handleShowMore","Description","truncate","ProgressBar","undefined","progressBarColor","inlineProgressValueStyle","progressBarWrapper","progress","backgroundContainer","container","backButtonWrapper","faSize","wrapperSize","ctaContainer","skillFocusBadge","length","showMoreWrapper","ctaWrapper","list","progressInformationsWrapper","progressTitle","skillCoursesAndQuestionsWrapper","skillInformation","skillInformationNumber","progressInformations","progressInformation","progressInformationNumber","toFixed","string","isRequired","shape","number","onChange","options","arrayOf"],"sources":["../../../src/template/skill-detail/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport {get} from 'lodash/fp';\nimport Provider from '../../atom/provider';\nimport Select, {SelectOptionPropTypes} from '../../atom/select';\nimport ButtonLink from '../../atom/button-link';\nimport Icon from '../../atom/icon';\nimport CardsGrid from '../../organism/cards-grid';\nimport style from './style.css';\nimport AllCourses from './all-courses';\nimport ContinueLearning from './continue-learning';\n\nexport const ContinueLearningButton = (props, context) => {\n const {ongoingCoursesAvailable, onClick} = props;\n const {skin, translate} = context;\n const primarySkinColor = get('common.primary', skin);\n\n return (\n <div>\n <ButtonLink\n label={\n ongoingCoursesAvailable ? translate('continue_learning') : translate('start_learning')\n }\n type=\"primary\"\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px',\n backgroundColor: primarySkinColor\n }}\n hoverBackgroundColor={convert(`hsl(from ${primarySkinColor} h s calc(l*(1 - 0.08)))`)}\n hoverColor=\"#FFFFFF\"\n icon={{\n position: 'left',\n faIcon: {\n name: 'play',\n color: '#FFFFFF',\n size: 16\n }\n }}\n onClick={onClick}\n />\n </div>\n );\n};\n\nContinueLearningButton.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nContinueLearningButton.propTypes = {\n ongoingCoursesAvailable: PropTypes.bool,\n onClick: PropTypes.func\n};\n\nconst SkillDetail = (props, context) => {\n const {\n title,\n skillRef,\n description,\n metrics = {},\n focused,\n availableForReview,\n ongoingCourses,\n skillIncludedCourses,\n totalCourses,\n filters,\n sorting,\n onBackClick,\n onReviewClick,\n onContinueLearningClick\n } = props;\n const {score, content, questionsToReview, contentCompleted = 0} = metrics;\n const {translate} = context;\n\n const [showMore, setShowMore] = useState(false);\n\n const handleShowMore = useCallback(() => setShowMore(!showMore), [setShowMore, showMore]);\n\n const Description = useCallback(() => {\n return (\n <div className={classnames(style.description, !showMore && style.truncate)}>\n {description}\n </div>\n );\n }, [showMore, description]);\n\n const ProgressBar = useCallback(() => {\n if (score === undefined) return null;\n const progressBarColor = '#3EC483';\n const inlineProgressValueStyle = {\n backgroundColor: progressBarColor,\n width: `${score}%`\n };\n\n return (\n <div className={style.progressBarWrapper}>\n <div\n data-name=\"progress\"\n className={style.progress}\n style={inlineProgressValueStyle}\n role=\"progressbar\"\n />\n </div>\n );\n }, [score]);\n\n return (\n <div className={style.backgroundContainer}>\n <div className={style.container} data-name={skillRef}>\n <div className={style.backButtonWrapper} onClick={onBackClick}>\n <Icon\n iconName=\"arrow-left\"\n size={{\n faSize: 14,\n wrapperSize: 14\n }}\n />\n </div>\n <div className={style.ctaContainer}>\n <div>\n {focused ? (\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 {translate('skill_focus')}\n </div>\n ) : null}\n <div className={style.title}>{title}</div>\n {description ? (\n <>\n <Description />\n {description.length >= 226 ? (\n <div className={style.showMoreWrapper} onClick={handleShowMore}>\n {showMore ? translate('Show less') : translate('Show more')}\n <Icon\n iconName={showMore ? 'chevron-up' : 'chevron-down'}\n size={{\n faSize: 14,\n wrapperSize: 16\n }}\n />\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n\n <div className={style.ctaWrapper}>\n <ButtonLink\n type=\"secondary\"\n onClick={onReviewClick}\n label={translate('review_this_skill')}\n disabled={!availableForReview}\n customStyle={{\n width: 'fit-content',\n borderRadius: '12px'\n }}\n />\n <ContinueLearningButton\n ongoingCoursesAvailable={!!ongoingCourses.list.length}\n onClick={onContinueLearningClick}\n />\n </div>\n </div>\n {score !== undefined ? (\n <div className={style.progressInformationsWrapper}>\n <div className={style.progressTitle}>{translate('your_progress')}</div>\n <div className={style.skillCoursesAndQuestionsWrapper}>\n {content ? (\n <div className={style.skillInformation} data-name=\"skill-courses\">\n <span className={style.skillInformationNumber}>{content}</span>{' '}\n {translate('courses')}\n </div>\n ) : null}\n {questionsToReview ? (\n <div className={style.skillInformation} data-name=\"skill-questions\">\n <span className={style.skillInformationNumber}>{questionsToReview}</span>\n &nbsp;{translate('questions')}\n </div>\n ) : null}\n </div>\n <ProgressBar />\n <div className={style.progressInformations}>\n {content && (\n <>\n <div className={style.progressInformation} data-name=\"skill-completed-courses\">\n <span className={style.progressInformationNumber}>{contentCompleted}</span>\n {` ${translate('courses_completed')}`}\n </div>\n <div className={style.progressInformation} data-name=\"completed-percentage\">\n <span className={style.progressInformationNumber}>{score.toFixed(1)}%</span>\n </div>\n </>\n )}\n </div>\n </div>\n ) : null}\n <ContinueLearning ongoingCourses={ongoingCourses} />\n <AllCourses\n courses={skillIncludedCourses}\n totalCourses={totalCourses}\n filters={filters}\n sorting={sorting}\n />\n </div>\n </div>\n );\n};\n\nSkillDetail.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nSkillDetail.propTypes = {\n title: PropTypes.string.isRequired,\n skillRef: PropTypes.string.isRequired,\n description: PropTypes.string,\n metrics: PropTypes.shape({\n score: PropTypes.number,\n content: PropTypes.number,\n questionsToReview: PropTypes.number,\n contentCompleted: PropTypes.number\n }),\n focused: PropTypes.bool,\n availableForReview: PropTypes.bool,\n ongoingCourses: PropTypes.shape(CardsGrid.propTypes),\n skillIncludedCourses: PropTypes.shape(CardsGrid.propTypes),\n totalCourses: PropTypes.number,\n filters: PropTypes.shape({\n onChange: PropTypes.func,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n }),\n sorting: PropTypes.shape(Select.propTypes),\n onBackClick: PropTypes.func,\n onReviewClick: PropTypes.func,\n onContinueLearningClick: PropTypes.func\n};\n\nexport default SkillDetail;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,MAAP,IAAgBC,qBAAhB,QAA4C,mBAA5C;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,IAAP,MAAiB,iBAAjB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,gBAAP,MAA6B,qBAA7B;AAEA,OAAO,MAAMC,sBAAsB,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACxD,MAAM;IAACC,uBAAD;IAA0BC;EAA1B,IAAqCH,KAA3C;EACA,MAAM;IAACI,IAAD;IAAOC;EAAP,IAAoBJ,OAA1B;;EACA,MAAMK,gBAAgB,GAAG,KAAI,gBAAJ,EAAsBF,IAAtB,CAAzB;;EAEA,oBACE,8CACE,oBAAC,UAAD;IACE,KAAK,EACHF,uB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e,WAAW,EAAE7C,SAAS,CAACgC,IApBD;EAqBtBc,aAAa,EAAE9C,SAAS,CAACgC,IArBH;EAsBtBe,uBAAuB,EAAE/C,SAAS,CAACgC;AAtBb,CAAxB;AAyBA,eAAeC,WAAf"}
@@ -1,5 +1,6 @@
1
1
  /// <reference path="../../src/globals.d.ts" />
2
2
  export function isExternalContent(type: any): boolean;
3
+ export const EXTERNAL_COURSE_TYPES: string[];
3
4
  export namespace EXTERNAL_CONTENT_ICONS {
4
5
  namespace scorm {
5
6
  export { ScormIcon as icon };
@@ -1 +1 @@
1
- {"version":3,"file":"external-content.d.ts","sourceRoot":"","sources":["../../src/util/external-content.js"],"names":[],"mappings":";AAQO,sDAA0F"}
1
+ {"version":3,"file":"external-content.d.ts","sourceRoot":"","sources":["../../src/util/external-content.js"],"names":[],"mappings":";AAQO,sDAA0F;AAEjG,6CAAqF"}
@@ -1,6 +1,7 @@
1
1
  import includes from 'lodash/fp/includes';
2
2
  import { NovaCompositionCoorpacademyScorm as ScormIcon, NovaCompositionCoorpacademyArticle as ArticleIcon, NovaCompositionCoorpacademyVideo as VideoIcon, NovaCompositionCoorpacademyMicrophone as PodcastIcon } from '@coorpacademy/nova-icons';
3
3
  export const isExternalContent = type => includes(type, ['scorm', 'video', 'article', 'podcast']);
4
+ export const EXTERNAL_COURSE_TYPES = ['podcast', 'video', 'interactive', 'document'];
4
5
  export const EXTERNAL_CONTENT_ICONS = {
5
6
  scorm: {
6
7
  icon: ScormIcon,
@@ -1 +1 @@
1
- {"version":3,"file":"external-content.js","names":["includes","NovaCompositionCoorpacademyScorm","ScormIcon","NovaCompositionCoorpacademyArticle","ArticleIcon","NovaCompositionCoorpacademyVideo","VideoIcon","NovaCompositionCoorpacademyMicrophone","PodcastIcon","isExternalContent","type","EXTERNAL_CONTENT_ICONS","scorm","icon","color","article","video","podcast"],"sources":["../../src/util/external-content.js"],"sourcesContent":["import includes from 'lodash/fp/includes';\nimport {\n NovaCompositionCoorpacademyScorm as ScormIcon,\n NovaCompositionCoorpacademyArticle as ArticleIcon,\n NovaCompositionCoorpacademyVideo as VideoIcon,\n NovaCompositionCoorpacademyMicrophone as PodcastIcon\n} from '@coorpacademy/nova-icons';\n\nexport const isExternalContent = type => includes(type, ['scorm', 'video', 'article', 'podcast']);\n\nexport const EXTERNAL_CONTENT_ICONS = {\n scorm: {icon: ScormIcon, color: '#FFB800'},\n article: {icon: ArticleIcon, color: '#365FCD'},\n video: {icon: VideoIcon, color: '#E8335E'},\n podcast: {icon: PodcastIcon, color: '#432ba7'}\n};\n"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oBAArB;AACA,SACEC,gCAAgC,IAAIC,SADtC,EAEEC,kCAAkC,IAAIC,WAFxC,EAGEC,gCAAgC,IAAIC,SAHtC,EAIEC,qCAAqC,IAAIC,WAJ3C,QAKO,0BALP;AAOA,OAAO,MAAMC,iBAAiB,GAAGC,IAAI,IAAIV,QAAQ,CAACU,IAAD,EAAO,CAAC,OAAD,EAAU,OAAV,EAAmB,SAAnB,EAA8B,SAA9B,CAAP,CAA1C;AAEP,OAAO,MAAMC,sBAAsB,GAAG;EACpCC,KAAK,EAAE;IAACC,IAAI,EAAEX,SAAP;IAAkBY,KAAK,EAAE;EAAzB,CAD6B;EAEpCC,OAAO,EAAE;IAACF,IAAI,EAAET,WAAP;IAAoBU,KAAK,EAAE;EAA3B,CAF2B;EAGpCE,KAAK,EAAE;IAACH,IAAI,EAAEP,SAAP;IAAkBQ,KAAK,EAAE;EAAzB,CAH6B;EAIpCG,OAAO,EAAE;IAACJ,IAAI,EAAEL,WAAP;IAAoBM,KAAK,EAAE;EAA3B;AAJ2B,CAA/B"}
1
+ {"version":3,"file":"external-content.js","names":["includes","NovaCompositionCoorpacademyScorm","ScormIcon","NovaCompositionCoorpacademyArticle","ArticleIcon","NovaCompositionCoorpacademyVideo","VideoIcon","NovaCompositionCoorpacademyMicrophone","PodcastIcon","isExternalContent","type","EXTERNAL_COURSE_TYPES","EXTERNAL_CONTENT_ICONS","scorm","icon","color","article","video","podcast"],"sources":["../../src/util/external-content.js"],"sourcesContent":["import includes from 'lodash/fp/includes';\nimport {\n NovaCompositionCoorpacademyScorm as ScormIcon,\n NovaCompositionCoorpacademyArticle as ArticleIcon,\n NovaCompositionCoorpacademyVideo as VideoIcon,\n NovaCompositionCoorpacademyMicrophone as PodcastIcon\n} from '@coorpacademy/nova-icons';\n\nexport const isExternalContent = type => includes(type, ['scorm', 'video', 'article', 'podcast']);\n\nexport const EXTERNAL_COURSE_TYPES = ['podcast', 'video', 'interactive', 'document'];\n\nexport const EXTERNAL_CONTENT_ICONS = {\n scorm: {icon: ScormIcon, color: '#FFB800'},\n article: {icon: ArticleIcon, color: '#365FCD'},\n video: {icon: VideoIcon, color: '#E8335E'},\n podcast: {icon: PodcastIcon, color: '#432ba7'}\n};\n"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oBAArB;AACA,SACEC,gCAAgC,IAAIC,SADtC,EAEEC,kCAAkC,IAAIC,WAFxC,EAGEC,gCAAgC,IAAIC,SAHtC,EAIEC,qCAAqC,IAAIC,WAJ3C,QAKO,0BALP;AAOA,OAAO,MAAMC,iBAAiB,GAAGC,IAAI,IAAIV,QAAQ,CAACU,IAAD,EAAO,CAAC,OAAD,EAAU,OAAV,EAAmB,SAAnB,EAA8B,SAA9B,CAAP,CAA1C;AAEP,OAAO,MAAMC,qBAAqB,GAAG,CAAC,SAAD,EAAY,OAAZ,EAAqB,aAArB,EAAoC,UAApC,CAA9B;AAEP,OAAO,MAAMC,sBAAsB,GAAG;EACpCC,KAAK,EAAE;IAACC,IAAI,EAAEZ,SAAP;IAAkBa,KAAK,EAAE;EAAzB,CAD6B;EAEpCC,OAAO,EAAE;IAACF,IAAI,EAAEV,WAAP;IAAoBW,KAAK,EAAE;EAA3B,CAF2B;EAGpCE,KAAK,EAAE;IAACH,IAAI,EAAER,SAAP;IAAkBS,KAAK,EAAE;EAAzB,CAH6B;EAIpCG,OAAO,EAAE;IAACJ,IAAI,EAAEN,WAAP;IAAoBO,KAAK,EAAE;EAA3B;AAJ2B,CAA/B"}
@@ -4,6 +4,7 @@ declare const ButtonLink: {
4
4
  (props: ButtonLinkProps): JSX.Element;
5
5
  propTypes: {
6
6
  type: import("prop-types").Requireable<string>;
7
+ usage: import("prop-types").Requireable<string>;
7
8
  label: import("prop-types").Requireable<string>;
8
9
  content: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
9
10
  'aria-label': 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;AA+C7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;CA4FzC,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;AA+C7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;CA8FzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
@@ -69,6 +69,7 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
69
69
  const ButtonLink = props => {
70
70
  const {
71
71
  type,
72
+ usage = 'button',
72
73
  label,
73
74
  content,
74
75
  hoverBackgroundColor,
@@ -87,7 +88,7 @@ const ButtonLink = props => {
87
88
  } = props;
88
89
  const styleButton = (0, _classnames.default)(className, _style.default.button, type === 'primary' && _style.default.primary, type === 'secondary' && _style.default.secondary, type === 'tertiary' && _style.default.tertiary, type === 'text' && _style.default.text, type === 'dangerous' && _style.default.dangerous, link && _style.default.link, disabled && _style.default.disabled);
89
90
  const [hovered, setHovered] = (0, _react.useState)(false);
90
- const handleOnClick = (0, _react.useCallback)(() => onClick(), [onClick]);
91
+ const handleOnClick = (0, _react.useCallback)(event => onClick(event), [onClick]);
91
92
  const handleOnKeyDown = (0, _react.useCallback)(event => onKeyDown(event), [onKeyDown]);
92
93
  const handleMouseOver = (0, _react.useCallback)(() => setHovered(true), [setHovered]);
93
94
  const handleMouseLeave = (0, _react.useCallback)(() => setHovered(false), [setHovered]);
@@ -114,7 +115,8 @@ const ButtonLink = props => {
114
115
  return /*#__PURE__*/_react.default.createElement("button", _extends({}, useTitle && {
115
116
  title: ariaLabel || label
116
117
  }, {
117
- type: "button",
118
+ // eslint-disable-next-line react/button-has-type
119
+ type: usage,
118
120
  "aria-label": ariaLabel || label,
119
121
  "data-name": dataName,
120
122
  "data-testid": dataTestId,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","ICONS","isApplyHover","style","buttonContent","label","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","ButtonLink","props","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","customStyle","useTitle","styleButton","classnames","button","primary","secondary","tertiary","text","dangerous","setHovered","useState","handleOnClick","useCallback","handleOnKeyDown","event","handleMouseOver","handleMouseLeave","_customStyle","useMemo","title","propTypes"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback, useState, useMemo} 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 = (\n icon?: IconType,\n content?: string | React.ReactNode,\n hovered?: boolean,\n hoverBackgroundColor?: string,\n hoverColor?: string\n) => {\n const {type, faIcon, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n const isApplyHover = hovered && hoverBackgroundColor && hoverColor;\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: isApplyHover ? hoverColor : faIcon.color,\n backgroundColor: isApplyHover ? hoverBackgroundColor : 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 hoverBackgroundColor,\n hoverColor,\n disabled = false,\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 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 [hovered, setHovered] = useState(false);\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\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 {getButtonContent(icon, content ?? label)}\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 onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n tabIndex={0}\n disabled={disabled}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,CACvBC,IADuB,EAEvBC,OAFuB,EAGvBC,OAHuB,EAIvBC,oBAJuB,EAKvBC,UALuB,KAMpB;EACH,MAAM;IAACC,IAAD;IAAOC,MAAP;IAAeC;EAAf,IAA2BP,IAAI,IAAI;IAACK,IAAI,EAAE,EAAP;IAAWE,QAAQ,EAAE;EAArB,CAAzC;EACA,MAAMC,IAAI,GAAGH,IAAI,IAAII,kBAAA,CAAMJ,IAAN,CAArB;EACA,MAAMK,YAAY,GAAGR,OAAO,IAAIC,oBAAX,IAAmCC,UAAxD;;EAEA,IAAI,CAACI,IAAD,IAAS,CAACF,MAAd,EAAsB;IACpB,oBACE;MAAK,SAAS,EAAEK,cAAA,CAAMC;IAAtB,gBACE;MAAM,SAAS,EAAED,cAAA,CAAME;IAAvB,GAA+BZ,OAA/B,CADF,CADF;EAKD;;EAED,MAAMa,aAAa,GAAGR,MAAM,gBAC1B,6BAAC,aAAD;IAEIS,QAAQ,EAAET,MAAM,CAACU,IAFrB;IAGIC,SAAS,EAAEP,YAAY,GAAGN,UAAH,GAAgBE,MAAM,CAACY,KAHlD;IAIIC,eAAe,EAAET,YAAY,GAAGP,oBAAH,GAA0BG,MAAM,CAACa,eAJlE;IAKIC,IAA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AI;IACfmB,KAAK,EAAEzB,SAAS,IAAIf;EADL,CADnB;IAIE,IAAI,EAAC,QAJP;IAKE,cAAYe,SAAS,IAAIf,KAL3B;IAME,aAAWa,QANb;IAOE,eAAaC,UAPf;IAQE,KAAK,EAAEwB,YART;IASE,SAAS,EAAEhB,WATb;IAUE,OAAO,EAAEU,aAVX;IAWE,SAAS,EAAEE,eAXb;IAYE,WAAW,EAAEE,eAZf;IAaE,YAAY,EAAEC,gBAbhB;IAcE,QAAQ,EAAE,CAdZ;IAeE,QAAQ,EAAEzB;EAfZ,IAiBG1B,gBAAgB,CAACC,IAAD,EAAOC,OAAO,IAAIY,KAAlB,EAAyBX,OAAzB,EAAkCC,oBAAlC,EAAwDC,UAAxD,CAjBnB,CADF;AAqBD,CA5FD;;AA8FAmB,UAAU,CAAC+B,SAAX,2CAAuBA,cAAvB;eAEe/B,U"}
1
+ {"version":3,"file":"index.js","names":["getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","ICONS","isApplyHover","style","buttonContent","label","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","link","onClick","onKeyDown","className","customStyle","useTitle","styleButton","classnames","button","primary","secondary","tertiary","text","dangerous","setHovered","useState","handleOnClick","useCallback","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","_customStyle","useMemo","title","propTypes"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback, useState, useMemo} 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 = (\n icon?: IconType,\n content?: string | React.ReactNode,\n hovered?: boolean,\n hoverBackgroundColor?: string,\n hoverColor?: string\n) => {\n const {type, faIcon, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n const isApplyHover = hovered && hoverBackgroundColor && hoverColor;\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: isApplyHover ? hoverColor : faIcon.color,\n backgroundColor: isApplyHover ? hoverBackgroundColor : 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 usage = 'button',\n label,\n content,\n hoverBackgroundColor,\n hoverColor,\n disabled = false,\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 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 [hovered, setHovered] = useState(false);\n\n const handleOnClick = useCallback(event => onClick(event), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n const handleMouseOver = useCallback(() => setHovered(true), [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\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 {getButtonContent(icon, content ?? label)}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n // eslint-disable-next-line react/button-has-type\n type={usage}\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 onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n tabIndex={0}\n disabled={disabled}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,gBAAgB,GAAG,CACvBC,IADuB,EAEvBC,OAFuB,EAGvBC,OAHuB,EAIvBC,oBAJuB,EAKvBC,UALuB,KAMpB;EACH,MAAM;IAACC,IAAD;IAAOC,MAAP;IAAeC;EAAf,IAA2BP,IAAI,IAAI;IAACK,IAAI,EAAE,EAAP;IAAWE,QAAQ,EAAE;EAArB,CAAzC;EACA,MAAMC,IAAI,GAAGH,IAAI,IAAII,kBAAA,CAAMJ,IAAN,CAArB;EACA,MAAMK,YAAY,GAAGR,OAAO,IAAIC,oBAAX,IAAmCC,UAAxD;;EAEA,IAAI,CAACI,IAAD,IAAS,CAACF,MAAd,EAAsB;IACpB,oBACE;MAAK,SAAS,EAAEK,cAAA,CAAMC;IAAtB,gBACE;MAAM,SAAS,EAAED,cAAA,CAAME;IAAvB,GAA+BZ,OAA/B,CADF,CADF;EAKD;;EAED,MAAMa,aAAa,GAAGR,MAAM,gBAC1B,6BAAC,aAAD;IAEIS,QAAQ,EAAET,MAAM,CAACU,IAFrB;IAGIC,SAAS,EAAEP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E,WANb;MAOE,aAAWT,QAPb;MAQE,eAAaC,UARf;MASE,cAAYC,SAAS,IAAIhB;IAT3B,IAWGd,gBAAgB,CAACC,IAAD,EAAOC,OAAO,IAAIY,KAAlB,CAXnB,CADF;EAeD;;EAED,oBACE,oDACOsB,QAAQ,IAAI;IACfmB,KAAK,EAAEzB,SAAS,IAAIhB;EADL,CADnB;IAIE;IACA,IAAI,EAAEY,KALR;IAME,cAAYI,SAAS,IAAIhB,KAN3B;IAOE,aAAWc,QAPb;IAQE,eAAaC,UARf;IASE,KAAK,EAAEwB,YATT;IAUE,SAAS,EAAEhB,WAVb;IAWE,OAAO,EAAEU,aAXX;IAYE,SAAS,EAAEG,eAZb;IAaE,WAAW,EAAEC,eAbf;IAcE,YAAY,EAAEC,gBAdhB;IAeE,QAAQ,EAAE,CAfZ;IAgBE,QAAQ,EAAEzB;EAhBZ,IAkBG3B,gBAAgB,CAACC,IAAD,EAAOC,OAAO,IAAIY,KAAlB,EAAyBX,OAAzB,EAAkCC,oBAAlC,EAAwDC,UAAxD,CAlBnB,CADF;AAsBD,CA9FD;;AAgGAmB,UAAU,CAACgC,SAAX,2CAAuBA,cAAvB;eAEehC,U"}
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import { ICONS } from '../../util/button-icons';
4
4
  declare const propTypes: {
5
5
  type: PropTypes.Requireable<string>;
6
+ usage: PropTypes.Requireable<string>;
6
7
  label: PropTypes.Requireable<string>;
7
8
  content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
8
9
  'aria-label': PropTypes.Requireable<string>;
@@ -37,6 +38,7 @@ export declare type IconType = {
37
38
  };
38
39
  export declare type ButtonLinkProps = {
39
40
  type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';
41
+ usage?: 'button' | 'submit' | 'reset';
40
42
  label?: string;
41
43
  content?: React.ReactNode;
42
44
  'aria-label'?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/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O,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,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,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"}
@@ -13,6 +13,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
13
13
 
14
14
  const propTypes = {
15
15
  type: _propTypes.default.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),
16
+ usage: _propTypes.default.oneOf(['button', 'submit', 'reset']),
16
17
  label: _propTypes.default.string,
17
18
  content: _propTypes.default.node,
18
19
  'aria-label': _propTypes.default.string,
@@ -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","hoverBackgroundColor","hoverColor","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 hoverBackgroundColor: PropTypes.string,\n hoverColor: PropTypes.string,\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 hoverBackgroundColor?: string;\n hoverColor?: string;\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,oBAAoB,EAAEjB,kBAAA,CAAUG,MAjBhB;EAkBhBe,UAAU,EAAElB,kBAAA,CAAUG,MAlBN;EAmBhBgB,QAAQ,EAAEnB,kBAAA,CAAUe,IAnBJ;EAoBhBK,SAAS,EAAEpB,kBAAA,CAAUG,MApBL;EAqBhBkB,WAAW,EAAErB,kBAAA,CAAUO,KAAV,CAAgB,EAAhB;AArBG,CAAlB;eA6DeT,S"}
1
+ {"version":3,"file":"types.js","names":["propTypes","type","PropTypes","oneOf","usage","label","string","content","node","icon","shape","position","ICONS","onClick","func","link","href","download","bool","target","hoverBackgroundColor","hoverColor","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 usage: PropTypes.oneOf(['button', 'submit', 'reset']),\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 hoverBackgroundColor: PropTypes.string,\n hoverColor: PropTypes.string,\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 usage?: 'button' | 'submit' | 'reset';\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 hoverBackgroundColor?: string;\n hoverColor?: string;\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,CAAUC,KAAV,CAAgB,CAAC,QAAD,EAAW,QAAX,EAAqB,OAArB,CAAhB,CAFS;EAGhBE,KAAK,EAAEH,kBAAA,CAAUI,MAHD;EAIhBC,OAAO,EAAEL,kBAAA,CAAUM,IAJH;EAKhB,cAAcN,kBAAA,CAAUI,MALR;EAMhB,aAAaJ,kBAAA,CAAUI,MANP;EAOhB,eAAeJ,kBAAA,CAAUI,MAPT;EAQhBG,IAAI,EAAEP,kBAAA,CAAUQ,KAAV,CAAgB;IACpBC,QAAQ,EAAET,kBAAA,CAAUC,KAAV,CAAgB,CAAC,OAAD,EAAU,MAAV,CAAhB,CADU;IAEpBF,IAAI,EAAEC,kBAAA,CAAUC,KAAV,CAAgB,oBAAKS,kBAAL,CAAhB;EAFc,CAAhB,CARU;EAYhBC,OAAO,EAAEX,kBAAA,CAAUY,IAZH;EAahBC,IAAI,EAAEb,kBAAA,CAAUQ,KAAV,CAAgB;IACpBM,IAAI,EAAEd,kBAAA,CAAUI,MADI;IAEpBW,QAAQ,EAAEf,kBAAA,CAAUgB,IAFA;IAGpBC,MAAM,EAAEjB,kBAAA,CAAUC,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB;EAHY,CAAhB,CAbU;EAkBhBiB,oBAAoB,EAAElB,kBAAA,CAAUI,MAlBhB;EAmBhBe,UAAU,EAAEnB,kBAAA,CAAUI,MAnBN;EAoBhBgB,QAAQ,EAAEpB,kBAAA,CAAUgB,IApBJ;EAqBhBK,SAAS,EAAErB,kBAAA,CAAUI,MArBL;EAsBhBkB,WAAW,EAAEtB,kBAAA,CAAUQ,KAAV,CAAgB,EAAhB;AAtBG,CAAlB;eA+DeV,S"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/circular-progress-bar/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,6BAA6B,EAA+B,MAAM,SAAS,CAAC;AAmBpF,QAAA,MAAM,mBAAmB;gGAOtB,6BAA6B;;;;;;;;;CAwD/B,CAAC;AAIF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/circular-progress-bar/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,6BAA6B,EAA+B,MAAM,SAAS,CAAC;AAmBpF,QAAA,MAAM,mBAAmB;gGAOtB,6BAA6B;;;;;;;;;CAgD/B,CAAC;AAIF,eAAe,mBAAmB,CAAC"}
@@ -54,16 +54,7 @@ const CircularProgressBar = ({
54
54
  length: length_
55
55
  };
56
56
  }, [size, strokeWidth]);
57
- (0, _react.useEffect)(() => {
58
- console.log('CircularProgressBar mounted');
59
- const timeoutId = setTimeout(() => {
60
- setOffset(Math.ceil(length * ((100 - progression) / 100)));
61
- }, 1000);
62
- return () => {
63
- console.log('CircularProgressBar unmounted');
64
- clearTimeout(timeoutId);
65
- };
66
- }, [length, progression]);
57
+ (0, _react.useEffect)(() => setOffset(Math.ceil(length * ((100 - progression) / 100))), [length, progression]);
67
58
  return /*#__PURE__*/_react.default.createElement("div", {
68
59
  className: _style.default.container,
69
60
  "aria-label": ariaLabel,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ProgressionGradient","CircularProgressBar","label","progression","size","strokeWidth","ariaLabel","dataName","offset","setOffset","useState","center","radius","length","useMemo","center_","radius_","length_","Math","ceil","PI","useEffect","console","log","timeoutId","setTimeout","clearTimeout","style","container","svg","mainCircle","progressionCircle","infos","propTypes","CircularProgressBarPropTypes"],"sources":["../../../src/atom/circular-progress-bar/index.tsx"],"sourcesContent":["import React, {useMemo, useState, useEffect, useRef} from 'react';\nimport {isNull} from 'lodash/fp';\nimport {LearningPriorityCardPropTypes, CircularProgressBarPropTypes} from './types';\nimport style from './style.css';\n\nconst ProgressionGradient = () => (\n <defs>\n <linearGradient\n id=\"gradient-stroke-progression\"\n x1=\"81\"\n y1=\"0\"\n x2=\"81\"\n y2=\"162\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#35CC7F\" />\n <stop offset=\"1\" stopColor=\"#55F2A7\" />\n </linearGradient>\n </defs>\n);\n\nconst CircularProgressBar = ({\n label,\n progression,\n size,\n strokeWidth,\n 'aria-label': ariaLabel,\n 'data-name': dataName\n}: LearningPriorityCardPropTypes) => {\n const [offset, setOffset] = useState<null | number>(null);\n\n const {center, radius, length} = useMemo(() => {\n const center_ = size / 2;\n const radius_ = center_ - strokeWidth;\n const length_ = Math.ceil(2 * Math.PI * radius_);\n\n return {center: center_, radius: radius_, length: length_};\n }, [size, strokeWidth]);\n\n useEffect(() => {\n console.log('CircularProgressBar mounted');\n\n const timeoutId = setTimeout(() => {\n setOffset(Math.ceil(length * ((100 - progression) / 100)));\n }, 1000);\n\n return () => {\n console.log('CircularProgressBar unmounted');\n clearTimeout(timeoutId);\n };\n }, [length, progression]);\n\n return (\n <div className={style.container} aria-label={ariaLabel} data-name={dataName}>\n <svg className={style.svg} width={size} height={size}>\n <ProgressionGradient />\n <circle\n className={style.mainCircle}\n cx={center}\n cy={center}\n r={radius}\n strokeWidth={3}\n fill=\"transparent\"\n />\n <circle cx={center} cy={center} r={radius - (10 / radius) * 100} fill=\"#fafafa\" />\n <circle\n className={style.progressionCircle}\n cx={center}\n cy={center}\n r={radius}\n stroke={`url(#gradient-stroke-progression)`}\n strokeWidth={strokeWidth}\n strokeDasharray={length}\n strokeDashoffset={isNull(offset) ? length : offset}\n fill=\"transparent\"\n strokeLinecap=\"round\"\n />\n </svg>\n <div className={style.infos}>\n <span className={style.progression}>{progression}%</span>\n <span className={style.label}>{label}</span>\n </div>\n </div>\n );\n};\n\nCircularProgressBar.propTypes = CircularProgressBarPropTypes;\n\nexport default CircularProgressBar;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;;;;;;;AAEA,MAAMA,mBAAmB,GAAG,mBAC1B,wDACE;EACE,EAAE,EAAC,6BADL;EAEE,EAAE,EAAC,IAFL;EAGE,EAAE,EAAC,GAHL;EAIE,EAAE,EAAC,IAJL;EAKE,EAAE,EAAC,KALL;EAME,aAAa,EAAC;AANhB,gBAQE;EAAM,SAAS,EAAC;AAAhB,EARF,eASE;EAAM,MAAM,EAAC,GAAb;EAAiB,SAAS,EAAC;AAA3B,EATF,CADF,CADF;;AAgBA,MAAMC,mBAAmB,GAAG,CAA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D,gBACE,6BAAC,mBAAD,OADF,eAEE;IACE,SAAS,EAAEuB,cAAA,CAAMG,UADnB;IAEE,EAAE,EAAEnB,MAFN;IAGE,EAAE,EAAEA,MAHN;IAIE,CAAC,EAAEC,MAJL;IAKE,WAAW,EAAE,CALf;IAME,IAAI,EAAC;EANP,EAFF,eAUE;IAAQ,EAAE,EAAED,MAAZ;IAAoB,EAAE,EAAEA,MAAxB;IAAgC,CAAC,EAAEC,MAAM,GAAI,KAAKA,MAAN,GAAgB,GAA5D;IAAiE,IAAI,EAAC;EAAtE,EAVF,eAWE;IACE,SAAS,EAAEe,cAAA,CAAMI,iBADnB;IAEE,EAAE,EAAEpB,MAFN;IAGE,EAAE,EAAEA,MAHN;IAIE,CAAC,EAAEC,MAJL;IAKE,MAAM,EAAG,mCALX;IAME,WAAW,EAAEP,WANf;IAOE,eAAe,EAAEQ,MAPnB;IAQE,gBAAgB,EAAE,sBAAOL,MAAP,IAAiBK,MAAjB,GAA0BL,MAR9C;IASE,IAAI,EAAC,aATP;IAUE,aAAa,EAAC;EAVhB,EAXF,CADF,eAyBE;IAAK,SAAS,EAAEmB,cAAA,CAAMK;EAAtB,gBACE;IAAM,SAAS,EAAEL,cAAA,CAAMxB;EAAvB,GAAqCA,WAArC,MADF,eAEE;IAAM,SAAS,EAAEwB,cAAA,CAAMzB;EAAvB,GAA+BA,KAA/B,CAFF,CAzBF,CADF;AAgCD,CA/DD;;AAiEAD,mBAAmB,CAACgC,SAApB,2CAAgCC,mCAAhC;eAEejC,mB"}
1
+ {"version":3,"file":"index.js","names":["ProgressionGradient","CircularProgressBar","label","progression","size","strokeWidth","ariaLabel","dataName","offset","setOffset","useState","center","radius","length","useMemo","center_","radius_","length_","Math","ceil","PI","useEffect","style","container","svg","mainCircle","progressionCircle","infos","propTypes","CircularProgressBarPropTypes"],"sources":["../../../src/atom/circular-progress-bar/index.tsx"],"sourcesContent":["import React, {useMemo, useState, useEffect} from 'react';\nimport {isNull} from 'lodash/fp';\nimport {LearningPriorityCardPropTypes, CircularProgressBarPropTypes} from './types';\nimport style from './style.css';\n\nconst ProgressionGradient = () => (\n <defs>\n <linearGradient\n id=\"gradient-stroke-progression\"\n x1=\"81\"\n y1=\"0\"\n x2=\"81\"\n y2=\"162\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#35CC7F\" />\n <stop offset=\"1\" stopColor=\"#55F2A7\" />\n </linearGradient>\n </defs>\n);\n\nconst CircularProgressBar = ({\n label,\n progression,\n size,\n strokeWidth,\n 'aria-label': ariaLabel,\n 'data-name': dataName\n}: LearningPriorityCardPropTypes) => {\n const [offset, setOffset] = useState<null | number>(null);\n\n const {center, radius, length} = useMemo(() => {\n const center_ = size / 2;\n const radius_ = center_ - strokeWidth;\n const length_ = Math.ceil(2 * Math.PI * radius_);\n\n return {center: center_, radius: radius_, length: length_};\n }, [size, strokeWidth]);\n\n useEffect(\n () => setOffset(Math.ceil(length * ((100 - progression) / 100))),\n [length, progression]\n );\n\n return (\n <div className={style.container} aria-label={ariaLabel} data-name={dataName}>\n <svg className={style.svg} width={size} height={size}>\n <ProgressionGradient />\n <circle\n className={style.mainCircle}\n cx={center}\n cy={center}\n r={radius}\n strokeWidth={3}\n fill=\"transparent\"\n />\n <circle cx={center} cy={center} r={radius - (10 / radius) * 100} fill=\"#fafafa\" />\n <circle\n className={style.progressionCircle}\n cx={center}\n cy={center}\n r={radius}\n stroke={`url(#gradient-stroke-progression)`}\n strokeWidth={strokeWidth}\n strokeDasharray={length}\n strokeDashoffset={isNull(offset) ? length : offset}\n fill=\"transparent\"\n strokeLinecap=\"round\"\n />\n </svg>\n <div className={style.infos}>\n <span className={style.progression}>{progression}%</span>\n <span className={style.label}>{label}</span>\n </div>\n </div>\n );\n};\n\nCircularProgressBar.propTypes = CircularProgressBarPropTypes;\n\nexport default CircularProgressBar;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;;;;;;;AAEA,MAAMA,mBAAmB,GAAG,mBAC1B,wDACE;E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AAK,EAAEpB,IAAlC;IAAwC,MAAM,EAAEA;EAAhD,gBACE,6BAAC,mBAAD,OADF,eAEE;IACE,SAAS,EAAEkB,cAAA,CAAMG,UADnB;IAEE,EAAE,EAAEd,MAFN;IAGE,EAAE,EAAEA,MAHN;IAIE,CAAC,EAAEC,MAJL;IAKE,WAAW,EAAE,CALf;IAME,IAAI,EAAC;EANP,EAFF,eAUE;IAAQ,EAAE,EAAED,MAAZ;IAAoB,EAAE,EAAEA,MAAxB;IAAgC,CAAC,EAAEC,MAAM,GAAI,KAAKA,MAAN,GAAgB,GAA5D;IAAiE,IAAI,EAAC;EAAtE,EAVF,eAWE;IACE,SAAS,EAAEU,cAAA,CAAMI,iBADnB;IAEE,EAAE,EAAEf,MAFN;IAGE,EAAE,EAAEA,MAHN;IAIE,CAAC,EAAEC,MAJL;IAKE,MAAM,EAAG,mCALX;IAME,WAAW,EAAEP,WANf;IAOE,eAAe,EAAEQ,MAPnB;IAQE,gBAAgB,EAAE,sBAAOL,MAAP,IAAiBK,MAAjB,GAA0BL,MAR9C;IASE,IAAI,EAAC,aATP;IAUE,aAAa,EAAC;EAVhB,EAXF,CADF,eAyBE;IAAK,SAAS,EAAEc,cAAA,CAAMK;EAAtB,gBACE;IAAM,SAAS,EAAEL,cAAA,CAAMnB;EAAvB,GAAqCA,WAArC,MADF,eAEE;IAAM,SAAS,EAAEmB,cAAA,CAAMpB;EAAvB,GAA+BA,KAA/B,CAFF,CAzBF,CADF;AAgCD,CAvDD;;AAyDAD,mBAAmB,CAAC2B,SAApB,2CAAgCC,mCAAhC;eAEe5B,mB"}
@@ -6,6 +6,7 @@ declare class InputDoublestep extends React.Component<any, any, any> {
6
6
  onClick: PropTypes.Validator<(...args: any[]) => any>;
7
7
  onOpenConfirmation: PropTypes.Requireable<(...args: any[]) => any>;
8
8
  onCloseConfirmation: PropTypes.Requireable<(...args: any[]) => any>;
9
+ icon: PropTypes.Requireable<string>;
9
10
  };
10
11
  constructor(props: any, context: any);
11
12
  state: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-doublestep/index.js"],"names":[],"mappings":";AAiGA;IACE;;;;;;MAME;IAEF,sCAOC;IALC;;MAEC;IAKH,qBAQC;IAED,2BAKC;IAED,sBA0BC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-doublestep/index.js"],"names":[],"mappings":";AAwGA;IACE;;;;;;;MAOE;IAEF,sCAOC;IALC;;MAEC;IAKH,qBAQC;IAED,2BAKC;IAED,sBAuCC;CACF"}
@@ -15,6 +15,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
15
15
 
16
16
  var _loader = _interopRequireDefault(require("../loader"));
17
17
 
18
+ var _buttonLink = _interopRequireDefault(require("../button-link"));
19
+
18
20
  var _style = _interopRequireDefault(require("./style.css"));
19
21
 
20
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -33,6 +35,7 @@ const ConfirmationInput = ({
33
35
  return onChange(e.target.value);
34
36
  }, [onChange]);
35
37
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("input", {
38
+ "data-testid": "input",
36
39
  onInput: handleOnChange,
37
40
  placeholder: placeholder,
38
41
  className: _style.default.input,
@@ -65,13 +68,22 @@ const ConfirmationForm = props => {
65
68
  placeholder: placeholder
66
69
  }) : /*#__PURE__*/_react.default.createElement("div", {
67
70
  className: _style.default.confirmEmptySpace
68
- }), /*#__PURE__*/_react.default.createElement("span", {
69
- onClick: onHandleClose,
70
- className: _style.default.cancel
71
- }, cancelValue), /*#__PURE__*/_react.default.createElement("span", {
72
- onClick: confirmDisabled ? _noop2.default : onConfirm,
73
- className: confirmDisabled ? _style.default.disabled : _style.default.delete
74
- }, confirmValue));
71
+ }), /*#__PURE__*/_react.default.createElement("div", {
72
+ className: _style.default.confirmationCTAWrapper
73
+ }, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
74
+ label: cancelValue,
75
+ "data-testid": "cancel-confirmation-button",
76
+ onClick: onHandleClose
77
+ }), /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
78
+ label: confirmValue,
79
+ disabled: confirmDisabled,
80
+ "data-testid": "confirm-delete-button",
81
+ onClick: onConfirm,
82
+ customStyle: {
83
+ backgroundColor: 'orange',
84
+ color: 'white'
85
+ }
86
+ })));
75
87
 
76
88
  return isPending ? /*#__PURE__*/_react.default.createElement("div", {
77
89
  className: _style.default.confirmForm
@@ -142,15 +154,28 @@ class InputDoublestep extends _react.default.Component {
142
154
  render() {
143
155
  const {
144
156
  toggleValue,
145
- disabled
157
+ disabled,
158
+ icon
146
159
  } = this.props;
147
160
  const {
148
161
  open
149
162
  } = this.state;
150
- const formView = !open ? /*#__PURE__*/_react.default.createElement("span", {
151
- onClick: disabled ? _noop2.default : this.handleToggle,
152
- className: disabled ? _style.default.toggleDisabled : _style.default.toggle
153
- }, toggleValue) : /*#__PURE__*/_react.default.createElement(Confirmation, _extends({}, this.props, {
163
+ const formView = !open ? /*#__PURE__*/_react.default.createElement(_buttonLink.default, _extends({}, icon ? {
164
+ icon: {
165
+ position: 'left',
166
+ faIcon: {
167
+ name: icon,
168
+ color: '#ffffff',
169
+ size: 16
170
+ }
171
+ }
172
+ } : {}, {
173
+ type: "dangerous",
174
+ label: toggleValue,
175
+ disabled: disabled,
176
+ "data-testid": "input-toggle-button",
177
+ onClick: this.handleToggle
178
+ })) : /*#__PURE__*/_react.default.createElement(Confirmation, _extends({}, this.props, {
154
179
  onHandleClose: this.handleToggle,
155
180
  onConfirm: this.handleOnClick
156
181
  }));
@@ -168,7 +193,8 @@ InputDoublestep.propTypes = process.env.NODE_ENV !== "production" ? _extends({
168
193
  toggleValue: _propTypes.default.string.isRequired,
169
194
  onClick: _propTypes.default.func.isRequired,
170
195
  onOpenConfirmation: _propTypes.default.func,
171
- onCloseConfirmation: _propTypes.default.func
196
+ onCloseConfirmation: _propTypes.default.func,
197
+ icon: _propTypes.default.string
172
198
  }, inputDoubleProps) : {};
173
199
  var _default = InputDoublestep;
174
200
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ConfirmationInput","onChange","placeholder","handleOnChange","useMemo","e","target","value","style","input","propTypes","PropTypes","func","string","ConfirmationForm","props","confirmValue","confirmDisabled","onConfirm","cancelValue","onHandleClose","textValidation","isPending","form","confirmForm","confirmEmptySpace","cancel","disabled","delete","isRequired","bool","Confirmation","description","sectionConfirm","inputDoubleProps","InputDoublestep","React","Component","constructor","context","state","open","handleToggle","bind","handleOnClick","setState","onCloseConfirmation","onOpenConfirmation","preventDefault","onClick","render","toggleValue","formView","toggleDisabled","toggle","wrapper"],"sources":["../../../src/atom/input-doublestep/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {snakeCase, omit, noop} from 'lodash/fp';\nimport Loader from '../loader';\nimport style from './style.css';\n\nconst ConfirmationInput = ({onChange, placeholder = ''}) => {\n const handleOnChange = useMemo(\n () => e => {\n return onChange(e.target.value);\n },\n [onChange]\n );\n\n return (\n <div>\n <input\n onInput={handleOnChange}\n placeholder={placeholder}\n className={style.input}\n onChange={noop}\n />\n </div>\n );\n};\n\nConfirmationInput.propTypes = {\n onChange: PropTypes.func,\n placeholder: PropTypes.string\n};\n\nconst ConfirmationForm = props => {\n const {\n confirmValue,\n confirmDisabled = false,\n onConfirm,\n cancelValue,\n onHandleClose,\n onChange,\n textValidation,\n placeholder,\n isPending = false\n } = props;\n\n const form = (\n <div className={style.confirmForm}>\n {textValidation ? (\n <ConfirmationInput onChange={onChange} placeholder={placeholder} />\n ) : (\n <div className={style.confirmEmptySpace} />\n )}\n <span onClick={onHandleClose} className={style.cancel}>\n {cancelValue}\n </span>\n <span\n onClick={confirmDisabled ? noop : onConfirm}\n className={confirmDisabled ? style.disabled : style.delete}\n >\n {confirmValue}\n </span>\n </div>\n );\n\n return isPending ? (\n <div className={style.confirmForm}>\n <Loader />\n </div>\n ) : (\n form\n );\n};\nConfirmationForm.propTypes = {\n confirmValue: PropTypes.string.isRequired,\n confirmDisabled: PropTypes.bool,\n onConfirm: PropTypes.func.isRequired,\n cancelValue: PropTypes.string.isRequired,\n onHandleClose: PropTypes.func.isRequired,\n textValidation: PropTypes.bool,\n isPending: PropTypes.bool,\n ...ConfirmationInput.propTypes\n};\n\nconst Confirmation = props => {\n const {description} = props;\n\n return (\n <div className={style.sectionConfirm}>\n <div className={style.description}>{description}</div>\n <ConfirmationForm {...props} />\n </div>\n );\n};\nConfirmation.propTypes = {\n description: PropTypes.string\n};\n\nconst inputDoubleProps = omit(['onConfirm', 'onHandleClose'], {...Confirmation.propTypes});\nclass InputDoublestep extends React.Component {\n static propTypes = {\n toggleValue: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n onOpenConfirmation: PropTypes.func,\n onCloseConfirmation: PropTypes.func,\n ...inputDoubleProps\n };\n\n constructor(props, context) {\n super(props);\n this.state = {\n open: false\n };\n this.handleToggle = this.handleToggle.bind(this);\n this.handleOnClick = this.handleOnClick.bind(this);\n }\n\n handleToggle() {\n this.setState(state => ({\n open: !state.open\n }));\n\n const {open} = this.state;\n const {onCloseConfirmation = noop, onOpenConfirmation = noop} = this.props;\n open ? onCloseConfirmation() : onOpenConfirmation();\n }\n\n handleOnClick(e) {\n e.preventDefault();\n this.setState({open: false});\n const {onClick = noop} = this.props;\n return onClick(e);\n }\n\n render() {\n const {toggleValue, disabled} = this.props;\n const {open} = this.state;\n\n const formView = !open ? (\n <span\n onClick={disabled ? noop : this.handleToggle}\n className={disabled ? style.toggleDisabled : style.toggle}\n >\n {toggleValue}\n </span>\n ) : (\n <Confirmation\n {...this.props}\n onHandleClose={this.handleToggle}\n onConfirm={this.handleOnClick}\n />\n );\n\n return (\n <div className={style.wrapper}>\n <div data-name={`input_doublestep_${snakeCase(toggleValue)}`} className={style.value}>\n {formView}\n </div>\n </div>\n );\n }\n}\n\nexport default InputDoublestep;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,MAAMA,iBAAiB,GAAG,CAAC;EAACC,QAAD;EAAWC,WAAW,GAAG;AAAzB,CAAD,KAAkC;EAC1D,MAAMC,cAAc,GAAG,IAAAC,cAAA,EACrB,MAAMC,CAAC,IAAI;IACT,OAAOJ,QAAQ,CAACI,CAAC,CAACC,MAAF,CAASC,KAAV,CAAf;EACD,CAHoB,EAIrB,CAACN,QAAD,CAJqB,CAAvB;EAOA,oBACE,uDACE;IACE,OAAO,EAAEE,cADX;IAEE,WAAW,EAAED,WAFf;IAGE,SAAS,EAAEM,cAAA,CAAMC,KAHnB;IAIE,QAAQ;EAJV,EADF,CADF;AAUD,CAlBD;;AAoBAT,iBAAiB,CAACU,SAAlB,2CAA8B;EAC5BT,QAAQ,EAAEU,kBAAA,CAAUC,IADQ;EAE5BV,WAAW,EAAES,kBAAA,CAAUE;AAFK,CAA9B;;AAKA,MAAMC,gBAAgB,GAAGC,KAAK,IAAI;EAChC,MAAM;IACJC,YADI;IAEJC,eAAe,GAAG,KAFd;IAGJC,SAHI;IAIJC,WAJI;IAKJC,aALI;IAMJnB,QANI;IAOJoB,cAPI;IAQJnB,WARI;IASJoB,SAAS,GAAG;EATR,IAUFP,KAVJ;;EAYA,MAAMQ,IAAI,gBACR;IAAK,SAAS,EAAEf,cAAA,CAAMgB;EAAtB,GACGH,cAAc,gBACb,6BAAC,iBAAD;IAAmB,QAAQ,EAAEpB,QAA7B;IAAuC,WAAW,EAAEC;EAApD,EADa,gBAGb;IAAK,SAAS,EAAEM,cAAA,CAAMiB;EAAtB,EAJJ,eAME;IAAM,OAAO,EAAEL,aAAf;IAA8B,SAAS,EAAEZ,cAAA,CAAMkB;EAA/C,GACGP,WADH,CANF,eASE;IACE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ACE;MAAK,aAAY,oBAAmB,yBAAUJ,WAAV,CAAuB,EAA3D;MAA8D,SAAS,EAAE3C,cAAA,CAAMD;IAA/E,GACG6C,QADH,CADF,CADF;EAOD;;AA7D2C;;AAAxCjB,e,CACGzB,S;EACLyC,WAAW,EAAExC,kBAAA,CAAUE,MAAV,CAAiBgB,U;EAC9BoB,OAAO,EAAEtC,kBAAA,CAAUC,IAAV,CAAeiB,U;EACxBkB,kBAAkB,EAAEpC,kBAAA,CAAUC,I;EAC9BkC,mBAAmB,EAAEnC,kBAAA,CAAUC;GAC5BsB,gB;eA0DQC,e"}
1
+ {"version":3,"file":"index.js","names":["ConfirmationInput","onChange","placeholder","handleOnChange","useMemo","e","target","value","style","input","propTypes","PropTypes","func","string","ConfirmationForm","props","confirmValue","confirmDisabled","onConfirm","cancelValue","onHandleClose","textValidation","isPending","form","confirmForm","confirmEmptySpace","confirmationCTAWrapper","backgroundColor","color","isRequired","bool","Confirmation","description","sectionConfirm","inputDoubleProps","InputDoublestep","React","Component","constructor","context","state","open","handleToggle","bind","handleOnClick","setState","onCloseConfirmation","onOpenConfirmation","preventDefault","onClick","render","toggleValue","disabled","icon","formView","position","faIcon","name","size","wrapper"],"sources":["../../../src/atom/input-doublestep/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {snakeCase, omit, noop} from 'lodash/fp';\nimport Loader from '../loader';\nimport ButtonLink from '../button-link';\nimport style from './style.css';\n\nconst ConfirmationInput = ({onChange, placeholder = ''}) => {\n const handleOnChange = useMemo(\n () => e => {\n return onChange(e.target.value);\n },\n [onChange]\n );\n\n return (\n <div>\n <input\n data-testid=\"input\"\n onInput={handleOnChange}\n placeholder={placeholder}\n className={style.input}\n onChange={noop}\n />\n </div>\n );\n};\n\nConfirmationInput.propTypes = {\n onChange: PropTypes.func,\n placeholder: PropTypes.string\n};\n\nconst ConfirmationForm = props => {\n const {\n confirmValue,\n confirmDisabled = false,\n onConfirm,\n cancelValue,\n onHandleClose,\n onChange,\n textValidation,\n placeholder,\n isPending = false\n } = props;\n\n const form = (\n <div className={style.confirmForm}>\n {textValidation ? (\n <ConfirmationInput onChange={onChange} placeholder={placeholder} />\n ) : (\n <div className={style.confirmEmptySpace} />\n )}\n <div className={style.confirmationCTAWrapper}>\n <ButtonLink\n label={cancelValue}\n data-testid=\"cancel-confirmation-button\"\n onClick={onHandleClose}\n />\n <ButtonLink\n label={confirmValue}\n disabled={confirmDisabled}\n data-testid=\"confirm-delete-button\"\n onClick={onConfirm}\n customStyle={{backgroundColor: 'orange', color: 'white'}}\n />\n </div>\n </div>\n );\n\n return isPending ? (\n <div className={style.confirmForm}>\n <Loader />\n </div>\n ) : (\n form\n );\n};\nConfirmationForm.propTypes = {\n confirmValue: PropTypes.string.isRequired,\n confirmDisabled: PropTypes.bool,\n onConfirm: PropTypes.func.isRequired,\n cancelValue: PropTypes.string.isRequired,\n onHandleClose: PropTypes.func.isRequired,\n textValidation: PropTypes.bool,\n isPending: PropTypes.bool,\n ...ConfirmationInput.propTypes\n};\n\nconst Confirmation = props => {\n const {description} = props;\n\n return (\n <div className={style.sectionConfirm}>\n <div className={style.description}>{description}</div>\n <ConfirmationForm {...props} />\n </div>\n );\n};\nConfirmation.propTypes = {\n description: PropTypes.string\n};\n\nconst inputDoubleProps = omit(['onConfirm', 'onHandleClose'], {...Confirmation.propTypes});\nclass InputDoublestep extends React.Component {\n static propTypes = {\n toggleValue: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n onOpenConfirmation: PropTypes.func,\n onCloseConfirmation: PropTypes.func,\n icon: PropTypes.string,\n ...inputDoubleProps\n };\n\n constructor(props, context) {\n super(props);\n this.state = {\n open: false\n };\n this.handleToggle = this.handleToggle.bind(this);\n this.handleOnClick = this.handleOnClick.bind(this);\n }\n\n handleToggle() {\n this.setState(state => ({\n open: !state.open\n }));\n\n const {open} = this.state;\n const {onCloseConfirmation = noop, onOpenConfirmation = noop} = this.props;\n open ? onCloseConfirmation() : onOpenConfirmation();\n }\n\n handleOnClick(e) {\n e.preventDefault();\n this.setState({open: false});\n const {onClick = noop} = this.props;\n return onClick(e);\n }\n\n render() {\n const {toggleValue, disabled, icon} = this.props;\n const {open} = this.state;\n\n const formView = !open ? (\n <ButtonLink\n {...(icon\n ? {\n icon: {\n position: 'left',\n faIcon: {\n name: icon,\n color: '#ffffff',\n size: 16\n }\n }\n }\n : {})}\n type=\"dangerous\"\n label={toggleValue}\n disabled={disabled}\n data-testid=\"input-toggle-button\"\n onClick={this.handleToggle}\n />\n ) : (\n <Confirmation\n {...this.props}\n onHandleClose={this.handleToggle}\n onConfirm={this.handleOnClick}\n />\n );\n\n return (\n <div className={style.wrapper}>\n <div data-name={`input_doublestep_${snakeCase(toggleValue)}`} className={style.value}>\n {formView}\n </div>\n </div>\n );\n }\n}\n\nexport default InputDoublestep;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,iBAAiB,GAAG,CAAC;EAACC,QAAD;EAAWC,WAAW,GAAG;AAAzB,CAAD,KAAkC;EAC1D,MAAMC,cAAc,GAAG,IAAAC,cAAA,EACrB,MAAMC,CAAC,IAAI;IACT,OAAOJ,QAAQ,CAACI,CAAC,CAACC,MAAF,CAASC,KAAV,CAAf;EACD,CAHoB,EAIrB,CAACN,QAAD,CAJqB,CAAvB;EAOA,oBACE,uDACE;IACE,eAAY,OADd;IAEE,OAAO,EAAEE,cAFX;IAGE,WAAW,EAAED,WAHf;IAIE,SAAS,EAAEM,cAAA,CAAMC,KAJnB;IAKE,QAAQ;EALV,EADF,CADF;AAWD,CAnBD;;AAqBAT,iBAAiB,CAACU,SAAlB,2CAA8B;EAC5BT,QAAQ,EAAEU,kBAAA,CAAUC,IADQ;EAE5BV,WAAW,EAAES,kBAAA,CAAUE;AAFK,CAA9B;;AAKA,MAAMC,gBAAgB,GAAGC,KAAK,IAAI;EAChC,MAAM;IACJC,YADI;IAEJC,eAAe,GAA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