@coorpacademy/components 11.14.13-alpha.2 → 11.14.14-alpha.10

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 (257) hide show
  1. package/es/atom/cta/index.d.ts +34 -8
  2. package/es/atom/cta/index.d.ts.map +1 -1
  3. package/es/atom/cta/index.js +80 -58
  4. package/es/atom/cta/index.js.map +1 -1
  5. package/es/atom/link/index.d.ts +0 -1
  6. package/es/atom/link/index.d.ts.map +1 -1
  7. package/es/atom/link/index.js +11 -17
  8. package/es/atom/link/index.js.map +1 -1
  9. package/es/atom/slide/index.d.ts +0 -2
  10. package/es/molecule/expandable-item/index.d.ts +19 -0
  11. package/es/molecule/expandable-item/index.d.ts.map +1 -0
  12. package/es/molecule/expandable-item/index.js +44 -0
  13. package/es/molecule/expandable-item/index.js.map +1 -0
  14. package/es/molecule/expandable-item/style.css +135 -0
  15. package/es/molecule/expandable-item/types.d.ts +20 -0
  16. package/es/molecule/expandable-item/types.d.ts.map +1 -0
  17. package/es/molecule/expandable-item/types.js +11 -0
  18. package/es/molecule/expandable-item/types.js.map +1 -0
  19. package/es/molecule/expandable-list/index.d.ts +18 -0
  20. package/es/molecule/expandable-list/index.d.ts.map +1 -0
  21. package/es/molecule/expandable-list/index.js +22 -0
  22. package/es/molecule/expandable-list/index.js.map +1 -0
  23. package/es/molecule/expandable-list/style.css +20 -0
  24. package/es/molecule/expandable-list/types.d.ts +17 -0
  25. package/es/molecule/expandable-list/types.d.ts.map +1 -0
  26. package/es/molecule/expandable-list/types.js +6 -0
  27. package/es/molecule/expandable-list/types.js.map +1 -0
  28. package/es/molecule/hero/index.d.ts +30 -26
  29. package/es/molecule/hero/index.d.ts.map +1 -1
  30. package/es/molecule/hero/index.js +14 -13
  31. package/es/molecule/hero/index.js.map +1 -1
  32. package/es/molecule/hero/style.css +42 -0
  33. package/es/molecule/hero/types.d.ts +22 -0
  34. package/es/molecule/hero/types.d.ts.map +1 -0
  35. package/es/molecule/hero/types.js +14 -0
  36. package/es/molecule/hero/types.js.map +1 -0
  37. package/es/molecule/menu-links/index.d.ts +22 -0
  38. package/es/molecule/menu-links/index.d.ts.map +1 -0
  39. package/es/molecule/menu-links/index.js +70 -0
  40. package/es/molecule/menu-links/index.js.map +1 -0
  41. package/es/molecule/menu-links/style.css +161 -0
  42. package/es/molecule/menu-links/types.d.ts +35 -0
  43. package/es/molecule/menu-links/types.d.ts.map +1 -0
  44. package/es/molecule/menu-links/types.js +17 -0
  45. package/es/molecule/menu-links/types.js.map +1 -0
  46. package/es/molecule/news/index.d.ts +0 -2
  47. package/es/molecule/privacy-policy-contact/index.d.ts +14 -0
  48. package/es/molecule/privacy-policy-contact/index.d.ts.map +1 -0
  49. package/es/molecule/privacy-policy-contact/index.js +28 -0
  50. package/es/molecule/privacy-policy-contact/index.js.map +1 -0
  51. package/es/molecule/privacy-policy-contact/style.css +38 -0
  52. package/es/molecule/privacy-policy-contact/types.d.ts +10 -0
  53. package/es/molecule/privacy-policy-contact/types.d.ts.map +1 -0
  54. package/es/molecule/privacy-policy-contact/types.js +6 -0
  55. package/es/molecule/privacy-policy-contact/types.js.map +1 -0
  56. package/es/molecule/privacy-policy-download/index.d.ts +38 -0
  57. package/es/molecule/privacy-policy-download/index.d.ts.map +1 -0
  58. package/es/molecule/privacy-policy-download/index.js +27 -0
  59. package/es/molecule/privacy-policy-download/index.js.map +1 -0
  60. package/es/molecule/privacy-policy-download/style.css +65 -0
  61. package/es/molecule/privacy-policy-download/types.d.ts +50 -0
  62. package/es/molecule/privacy-policy-download/types.d.ts.map +1 -0
  63. package/es/molecule/privacy-policy-download/types.js +8 -0
  64. package/es/molecule/privacy-policy-download/types.js.map +1 -0
  65. package/es/molecule/quick-access-card/index.d.ts +1 -0
  66. package/es/molecule/quick-access-card/index.d.ts.map +1 -1
  67. package/es/molecule/quick-access-card/index.js +88 -25
  68. package/es/molecule/quick-access-card/index.js.map +1 -1
  69. package/es/molecule/quick-access-card/style.css +28 -17
  70. package/es/molecule/quick-access-cards-group/index.d.ts +1 -0
  71. package/es/organism/brand-dashboard/index.d.ts +1 -0
  72. package/es/organism/mooc/image-slider/index.d.ts +0 -2
  73. package/es/organism/mooc-header/index.d.ts +0 -2
  74. package/es/organism/mooc-header/index.d.ts.map +1 -1
  75. package/es/organism/sidebar/index.d.ts +0 -2
  76. package/es/organism/sidebar/index.d.ts.map +1 -1
  77. package/es/template/app-player/player/index.d.ts +0 -2
  78. package/es/template/app-player/player/slides/index.d.ts +0 -2
  79. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  80. package/es/template/app-player/popin-correction/index.d.ts +0 -2
  81. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  82. package/es/template/app-player/popin-end/index.d.ts +0 -1
  83. package/es/template/app-player/popin-end/summary.d.ts +0 -1
  84. package/es/template/app-player/popin-header/index.d.ts +0 -1
  85. package/es/template/app-player/popin-header/index.d.ts.map +1 -1
  86. package/es/template/back-office/brand-update/index.d.ts +1 -0
  87. package/es/template/common/faq-article-page/index.d.ts +27 -0
  88. package/es/template/common/faq-article-page/index.d.ts.map +1 -0
  89. package/es/template/common/faq-article-page/index.js +55 -0
  90. package/es/template/common/faq-article-page/index.js.map +1 -0
  91. package/es/template/common/faq-article-page/style.css +110 -0
  92. package/es/template/common/faq-article-page/types.d.ts +41 -0
  93. package/es/template/common/faq-article-page/types.d.ts.map +1 -0
  94. package/es/template/common/faq-article-page/types.js +20 -0
  95. package/es/template/common/faq-article-page/types.js.map +1 -0
  96. package/es/template/common/faq-cards-page/index.d.ts +33 -0
  97. package/es/template/common/faq-cards-page/index.d.ts.map +1 -0
  98. package/es/template/common/faq-cards-page/index.js +45 -0
  99. package/es/template/common/faq-cards-page/index.js.map +1 -0
  100. package/es/template/common/faq-cards-page/style.css +95 -0
  101. package/es/template/common/faq-cards-page/types.d.ts +45 -0
  102. package/es/template/common/faq-cards-page/types.d.ts.map +1 -0
  103. package/es/template/common/faq-cards-page/types.js +18 -0
  104. package/es/template/common/faq-cards-page/types.js.map +1 -0
  105. package/es/template/common/faq-page/index.d.ts +80 -0
  106. package/es/template/common/faq-page/index.d.ts.map +1 -0
  107. package/es/template/common/faq-page/index.js +44 -0
  108. package/es/template/common/faq-page/index.js.map +1 -0
  109. package/es/template/common/faq-page/style.css +104 -0
  110. package/es/template/common/faq-page/types.d.ts +87 -0
  111. package/es/template/common/faq-page/types.d.ts.map +1 -0
  112. package/es/template/common/faq-page/types.js +14 -0
  113. package/es/template/common/faq-page/types.js.map +1 -0
  114. package/es/template/common/privacy-policy-page/index.d.ts +80 -0
  115. package/es/template/common/privacy-policy-page/index.d.ts.map +1 -0
  116. package/es/template/common/privacy-policy-page/index.js +50 -0
  117. package/es/template/common/privacy-policy-page/index.js.map +1 -0
  118. package/es/template/common/privacy-policy-page/style.css +123 -0
  119. package/es/template/common/privacy-policy-page/types.d.ts +87 -0
  120. package/es/template/common/privacy-policy-page/types.d.ts.map +1 -0
  121. package/es/template/common/privacy-policy-page/types.js +14 -0
  122. package/es/template/common/privacy-policy-page/types.js.map +1 -0
  123. package/es/template/teams-dashboard/index.d.ts +0 -2
  124. package/es/util/button-icons.d.ts +1 -0
  125. package/es/util/button-icons.d.ts.map +1 -1
  126. package/es/util/button-icons.js +3 -2
  127. package/es/util/button-icons.js.map +1 -1
  128. package/es/variables/breakpoints.css +1 -1
  129. package/lib/atom/cta/index.d.ts +34 -8
  130. package/lib/atom/cta/index.d.ts.map +1 -1
  131. package/lib/atom/cta/index.js +79 -62
  132. package/lib/atom/cta/index.js.map +1 -1
  133. package/lib/atom/link/index.d.ts +0 -1
  134. package/lib/atom/link/index.d.ts.map +1 -1
  135. package/lib/atom/link/index.js +11 -17
  136. package/lib/atom/link/index.js.map +1 -1
  137. package/lib/atom/slide/index.d.ts +0 -2
  138. package/lib/molecule/expandable-item/index.d.ts +19 -0
  139. package/lib/molecule/expandable-item/index.d.ts.map +1 -0
  140. package/lib/molecule/expandable-item/index.js +58 -0
  141. package/lib/molecule/expandable-item/index.js.map +1 -0
  142. package/lib/molecule/expandable-item/style.css +135 -0
  143. package/lib/molecule/expandable-item/types.d.ts +20 -0
  144. package/lib/molecule/expandable-item/types.d.ts.map +1 -0
  145. package/lib/molecule/expandable-item/types.js +20 -0
  146. package/lib/molecule/expandable-item/types.js.map +1 -0
  147. package/lib/molecule/expandable-list/index.d.ts +18 -0
  148. package/lib/molecule/expandable-list/index.d.ts.map +1 -0
  149. package/lib/molecule/expandable-list/index.js +33 -0
  150. package/lib/molecule/expandable-list/index.js.map +1 -0
  151. package/lib/molecule/expandable-list/style.css +20 -0
  152. package/lib/molecule/expandable-list/types.d.ts +17 -0
  153. package/lib/molecule/expandable-list/types.d.ts.map +1 -0
  154. package/lib/molecule/expandable-list/types.js +16 -0
  155. package/lib/molecule/expandable-list/types.js.map +1 -0
  156. package/lib/molecule/hero/index.d.ts +30 -26
  157. package/lib/molecule/hero/index.d.ts.map +1 -1
  158. package/lib/molecule/hero/index.js +15 -14
  159. package/lib/molecule/hero/index.js.map +1 -1
  160. package/lib/molecule/hero/style.css +42 -0
  161. package/lib/molecule/hero/types.d.ts +22 -0
  162. package/lib/molecule/hero/types.d.ts.map +1 -0
  163. package/lib/molecule/hero/types.js +25 -0
  164. package/lib/molecule/hero/types.js.map +1 -0
  165. package/lib/molecule/menu-links/index.d.ts +22 -0
  166. package/lib/molecule/menu-links/index.d.ts.map +1 -0
  167. package/lib/molecule/menu-links/index.js +88 -0
  168. package/lib/molecule/menu-links/index.js.map +1 -0
  169. package/lib/molecule/menu-links/style.css +161 -0
  170. package/lib/molecule/menu-links/types.d.ts +35 -0
  171. package/lib/molecule/menu-links/types.d.ts.map +1 -0
  172. package/lib/molecule/menu-links/types.js +26 -0
  173. package/lib/molecule/menu-links/types.js.map +1 -0
  174. package/lib/molecule/news/index.d.ts +0 -2
  175. package/lib/molecule/privacy-policy-contact/index.d.ts +14 -0
  176. package/lib/molecule/privacy-policy-contact/index.d.ts.map +1 -0
  177. package/lib/molecule/privacy-policy-contact/index.js +41 -0
  178. package/lib/molecule/privacy-policy-contact/index.js.map +1 -0
  179. package/lib/molecule/privacy-policy-contact/style.css +38 -0
  180. package/lib/molecule/privacy-policy-contact/types.d.ts +10 -0
  181. package/lib/molecule/privacy-policy-contact/types.d.ts.map +1 -0
  182. package/lib/molecule/privacy-policy-contact/types.js +15 -0
  183. package/lib/molecule/privacy-policy-contact/types.js.map +1 -0
  184. package/lib/molecule/privacy-policy-download/index.d.ts +38 -0
  185. package/lib/molecule/privacy-policy-download/index.d.ts.map +1 -0
  186. package/lib/molecule/privacy-policy-download/index.js +38 -0
  187. package/lib/molecule/privacy-policy-download/index.js.map +1 -0
  188. package/lib/molecule/privacy-policy-download/style.css +65 -0
  189. package/lib/molecule/privacy-policy-download/types.d.ts +50 -0
  190. package/lib/molecule/privacy-policy-download/types.d.ts.map +1 -0
  191. package/lib/molecule/privacy-policy-download/types.js +18 -0
  192. package/lib/molecule/privacy-policy-download/types.js.map +1 -0
  193. package/lib/molecule/quick-access-card/index.d.ts +1 -0
  194. package/lib/molecule/quick-access-card/index.d.ts.map +1 -1
  195. package/lib/molecule/quick-access-card/index.js +87 -24
  196. package/lib/molecule/quick-access-card/index.js.map +1 -1
  197. package/lib/molecule/quick-access-card/style.css +28 -17
  198. package/lib/molecule/quick-access-cards-group/index.d.ts +1 -0
  199. package/lib/organism/brand-dashboard/index.d.ts +1 -0
  200. package/lib/organism/mooc/image-slider/index.d.ts +0 -2
  201. package/lib/organism/mooc-header/index.d.ts +0 -2
  202. package/lib/organism/mooc-header/index.d.ts.map +1 -1
  203. package/lib/organism/sidebar/index.d.ts +0 -2
  204. package/lib/organism/sidebar/index.d.ts.map +1 -1
  205. package/lib/template/app-player/player/index.d.ts +0 -2
  206. package/lib/template/app-player/player/slides/index.d.ts +0 -2
  207. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  208. package/lib/template/app-player/popin-correction/index.d.ts +0 -2
  209. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  210. package/lib/template/app-player/popin-end/index.d.ts +0 -1
  211. package/lib/template/app-player/popin-end/summary.d.ts +0 -1
  212. package/lib/template/app-player/popin-header/index.d.ts +0 -1
  213. package/lib/template/app-player/popin-header/index.d.ts.map +1 -1
  214. package/lib/template/back-office/brand-update/index.d.ts +1 -0
  215. package/lib/template/common/faq-article-page/index.d.ts +27 -0
  216. package/lib/template/common/faq-article-page/index.d.ts.map +1 -0
  217. package/lib/template/common/faq-article-page/index.js +69 -0
  218. package/lib/template/common/faq-article-page/index.js.map +1 -0
  219. package/lib/template/common/faq-article-page/style.css +110 -0
  220. package/lib/template/common/faq-article-page/types.d.ts +41 -0
  221. package/lib/template/common/faq-article-page/types.d.ts.map +1 -0
  222. package/lib/template/common/faq-article-page/types.js +30 -0
  223. package/lib/template/common/faq-article-page/types.js.map +1 -0
  224. package/lib/template/common/faq-cards-page/index.d.ts +33 -0
  225. package/lib/template/common/faq-cards-page/index.d.ts.map +1 -0
  226. package/lib/template/common/faq-cards-page/index.js +58 -0
  227. package/lib/template/common/faq-cards-page/index.js.map +1 -0
  228. package/lib/template/common/faq-cards-page/style.css +95 -0
  229. package/lib/template/common/faq-cards-page/types.d.ts +45 -0
  230. package/lib/template/common/faq-cards-page/types.d.ts.map +1 -0
  231. package/lib/template/common/faq-cards-page/types.js +29 -0
  232. package/lib/template/common/faq-cards-page/types.js.map +1 -0
  233. package/lib/template/common/faq-page/index.d.ts +80 -0
  234. package/lib/template/common/faq-page/index.d.ts.map +1 -0
  235. package/lib/template/common/faq-page/index.js +58 -0
  236. package/lib/template/common/faq-page/index.js.map +1 -0
  237. package/lib/template/common/faq-page/style.css +104 -0
  238. package/lib/template/common/faq-page/types.d.ts +87 -0
  239. package/lib/template/common/faq-page/types.d.ts.map +1 -0
  240. package/lib/template/common/faq-page/types.js +28 -0
  241. package/lib/template/common/faq-page/types.js.map +1 -0
  242. package/lib/template/common/privacy-policy-page/index.d.ts +80 -0
  243. package/lib/template/common/privacy-policy-page/index.d.ts.map +1 -0
  244. package/lib/template/common/privacy-policy-page/index.js +65 -0
  245. package/lib/template/common/privacy-policy-page/index.js.map +1 -0
  246. package/lib/template/common/privacy-policy-page/style.css +123 -0
  247. package/lib/template/common/privacy-policy-page/types.d.ts +87 -0
  248. package/lib/template/common/privacy-policy-page/types.d.ts.map +1 -0
  249. package/lib/template/common/privacy-policy-page/types.js +28 -0
  250. package/lib/template/common/privacy-policy-page/types.js.map +1 -0
  251. package/lib/template/teams-dashboard/index.d.ts +0 -2
  252. package/lib/util/button-icons.d.ts +1 -0
  253. package/lib/util/button-icons.d.ts.map +1 -1
  254. package/lib/util/button-icons.js +2 -1
  255. package/lib/util/button-icons.js.map +1 -1
  256. package/lib/variables/breakpoints.css +1 -1
  257. package/package.json +3 -3
@@ -1,8 +1,6 @@
1
1
  export default CTA;
2
- declare function CTA(props: any, legacyContext: any): JSX.Element;
3
- declare namespace CTA {
4
- const propTypes: {
5
- 'aria-label': PropTypes.Requireable<string>;
2
+ declare class CTA extends React.Component<any, any, any> {
3
+ static propTypes: {
6
4
  submitValue: PropTypes.Requireable<PropTypes.ReactNodeLike>;
7
5
  href: PropTypes.Requireable<string>;
8
6
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
@@ -17,10 +15,9 @@ declare namespace CTA {
17
15
  rectangular: PropTypes.Requireable<boolean>;
18
16
  fullWidth: PropTypes.Requireable<boolean>;
19
17
  certificationButton: PropTypes.Requireable<boolean>;
20
- useButtonTag: PropTypes.Requireable<boolean>;
21
18
  };
22
- namespace contextTypes {
23
- const skin: PropTypes.Requireable<PropTypes.InferProps<{
19
+ static contextTypes: {
20
+ skin: PropTypes.Requireable<PropTypes.InferProps<{
24
21
  common: PropTypes.Requireable<{
25
22
  [x: string]: any;
26
23
  }>;
@@ -41,7 +38,36 @@ declare namespace CTA {
41
38
  [x: string]: any;
42
39
  }>;
43
40
  }>>;
44
- }
41
+ };
42
+ constructor(props: any);
43
+ state: {
44
+ hovered: boolean;
45
+ };
46
+ handleMouseEnter(): void;
47
+ handleMouseLeave(): void;
48
+ getStyle(): {
49
+ backgroundColor: any;
50
+ borderColor: any;
51
+ opacity: string;
52
+ color?: undefined;
53
+ } | {
54
+ backgroundColor: any;
55
+ borderColor: any;
56
+ opacity?: undefined;
57
+ color?: undefined;
58
+ } | {
59
+ color: any;
60
+ borderColor: any;
61
+ backgroundColor?: undefined;
62
+ opacity?: undefined;
63
+ } | {
64
+ color: any;
65
+ backgroundColor?: undefined;
66
+ borderColor?: undefined;
67
+ opacity?: undefined;
68
+ } | undefined;
69
+ render(): JSX.Element;
45
70
  }
71
+ import React from "react";
46
72
  import PropTypes from "prop-types";
47
73
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/cta/index.js"],"names":[],"mappings":";AAUA,kEAuGC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/cta/index.js"],"names":[],"mappings":";AAUA;IACE;;;;;;;;;;;;;;;MAeE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBAOC;IALC;;MAEC;IAKH,yBAIC;IAED,yBAIC;IAED;;;;;;;;;;;;;;;;;;;;kBAwCC;IAED,sBAkDC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import _noop from "lodash/fp/noop";
2
2
  import _get from "lodash/fp/get";
3
- import React, { useCallback, useState } from 'react';
3
+ import React from 'react';
4
4
  import { convert } from 'css-color-function';
5
5
  import PropTypes from 'prop-types';
6
6
  import classnames from 'classnames';
@@ -9,36 +9,42 @@ import Provider from '../provider';
9
9
  import Link from '../link';
10
10
  import style from './style.css';
11
11
 
12
- const CTA = (props, legacyContext) => {
13
- const {
14
- skin
15
- } = legacyContext;
16
- const {
17
- 'aria-label': ariaLabel,
18
- submitValue = 'submit',
19
- name: ctaName,
20
- href,
21
- target,
22
- disabled = false,
23
- light = false,
24
- small = false,
25
- secondary = false,
26
- onClick,
27
- className,
28
- logout = false,
29
- rectangular = false,
30
- fullWidth = false,
31
- certificationButton = false,
32
- useButtonTag = false
33
- } = props;
34
- const [hovered, setHovered] = useState(false);
35
- const handleMouseEnter = useCallback(() => {
36
- setHovered(true);
37
- }, []);
38
- const handleMouseLeave = useCallback(() => {
39
- setHovered(false);
40
- }, []);
41
- const getStyle = useCallback(() => {
12
+ class CTA extends React.Component {
13
+ constructor(props) {
14
+ super(props);
15
+ this.state = {
16
+ hovered: false
17
+ };
18
+ this.handleMouseEnter = this.handleMouseEnter.bind(this);
19
+ this.handleMouseLeave = this.handleMouseLeave.bind(this);
20
+ }
21
+
22
+ handleMouseEnter() {
23
+ return this.setState({
24
+ hovered: true
25
+ });
26
+ }
27
+
28
+ handleMouseLeave() {
29
+ return this.setState({
30
+ hovered: false
31
+ });
32
+ }
33
+
34
+ getStyle() {
35
+ const {
36
+ skin
37
+ } = this.context;
38
+ const {
39
+ hovered
40
+ } = this.state;
41
+ const {
42
+ disabled = false,
43
+ light = false,
44
+ secondary = false,
45
+ logout = false
46
+ } = this.props;
47
+
42
48
  const color = _get('common.primary', skin);
43
49
 
44
50
  const grey = _get('common.grey', skin);
@@ -72,30 +78,50 @@ const CTA = (props, legacyContext) => {
72
78
  borderColor: color,
73
79
  backgroundColor: color
74
80
  };
75
- }, [disabled, hovered, light, logout, secondary, skin]);
76
- return /*#__PURE__*/React.createElement(Link, {
77
- href: href,
78
- onClick: disabled ? _noop : onClick,
79
- onMouseEnter: handleMouseEnter,
80
- onMouseLeave: handleMouseLeave,
81
- target: target,
82
- className: classnames(style.button, disabled ? style.disabled : null, small ? style.smallButton : null, light ? style.lightButton : null, secondary ? style.secondaryButton : null, logout ? style.logoutButton : null, rectangular ? style.rectangularButton : null, fullWidth ? style.fullWidth : null, certificationButton ? style.certificationButton : null, className),
83
- "data-name": ctaName || 'cta',
84
- style: getStyle(),
85
- "aria-label": ariaLabel,
86
- useButtonTag: useButtonTag
87
- }, logout ? /*#__PURE__*/React.createElement("div", {
88
- className: style.logoutWrapper,
89
- "data-name": "cta-logout-label"
90
- }, /*#__PURE__*/React.createElement(LogoutIcon, {
91
- height: 15,
92
- width: 15,
93
- className: style.logoutIcon
94
- }), submitValue) : submitValue);
95
- };
81
+ }
82
+
83
+ render() {
84
+ const {
85
+ submitValue = 'submit',
86
+ name: ctaName,
87
+ href,
88
+ target,
89
+ disabled = false,
90
+ light = false,
91
+ small = false,
92
+ secondary = false,
93
+ onClick,
94
+ className,
95
+ logout = false,
96
+ rectangular = false,
97
+ fullWidth = false,
98
+ certificationButton = false
99
+ } = this.props;
100
+ return /*#__PURE__*/React.createElement(Link, {
101
+ href: href,
102
+ onClick: disabled ? _noop : onClick,
103
+ onMouseEnter: this.handleMouseEnter,
104
+ onMouseLeave: this.handleMouseLeave,
105
+ target: target,
106
+ className: classnames(style.button, disabled ? style.disabled : null, small ? style.smallButton : null, light ? style.lightButton : null, secondary ? style.secondaryButton : null, logout ? style.logoutButton : null, rectangular ? style.rectangularButton : null, fullWidth ? style.fullWidth : null, certificationButton ? style.certificationButton : null, className),
107
+ "data-name": ctaName || 'cta',
108
+ style: this.getStyle()
109
+ }, logout ? /*#__PURE__*/React.createElement("div", {
110
+ className: style.logoutWrapper,
111
+ "data-name": "cta-logout-label"
112
+ }, /*#__PURE__*/React.createElement(LogoutIcon, {
113
+ height: 15,
114
+ width: 15,
115
+ className: style.logoutIcon
116
+ }), submitValue) : submitValue);
117
+ }
96
118
 
119
+ }
120
+
121
+ CTA.contextTypes = {
122
+ skin: Provider.childContextTypes.skin
123
+ };
97
124
  CTA.propTypes = process.env.NODE_ENV !== "production" ? {
98
- 'aria-label': Link.propTypes['aria-label'],
99
125
  submitValue: Link.propTypes.children,
100
126
  href: Link.propTypes.href,
101
127
  onClick: Link.propTypes.onClick,
@@ -109,11 +135,7 @@ CTA.propTypes = process.env.NODE_ENV !== "production" ? {
109
135
  logout: PropTypes.bool,
110
136
  rectangular: PropTypes.bool,
111
137
  fullWidth: PropTypes.bool,
112
- certificationButton: PropTypes.bool,
113
- useButtonTag: Link.propTypes.useButtonTag
138
+ certificationButton: PropTypes.bool
114
139
  } : {};
115
- CTA.contextTypes = {
116
- skin: Provider.childContextTypes.skin
117
- };
118
140
  export default CTA;
119
141
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useState","convert","PropTypes","classnames","NovaCompositionCoorpacademyLogout","LogoutIcon","Provider","Link","style","CTA","props","legacyContext","skin","ariaLabel","submitValue","name","ctaName","href","target","disabled","light","small","secondary","onClick","className","logout","rectangular","fullWidth","certificationButton","useButtonTag","hovered","setHovered","handleMouseEnter","handleMouseLeave","getStyle","color","grey","backgroundColor","borderColor","opacity","darkenColor","button","smallButton","lightButton","secondaryButton","logoutButton","rectangularButton","logoutWrapper","logoutIcon","propTypes","children","string","bool","contextTypes","childContextTypes"],"sources":["../../../src/atom/cta/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport {convert} from 'css-color-function';\nimport PropTypes from 'prop-types';\nimport {get, noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {NovaCompositionCoorpacademyLogout as LogoutIcon} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport Link from '../link';\nimport style from './style.css';\n\nconst CTA = (props, legacyContext) => {\n const {skin} = legacyContext;\n const {\n 'aria-label': ariaLabel,\n submitValue = 'submit',\n name: ctaName,\n href,\n target,\n disabled = false,\n light = false,\n small = false,\n secondary = false,\n onClick,\n className,\n logout = false,\n rectangular = false,\n fullWidth = false,\n certificationButton = false,\n useButtonTag = false\n } = props;\n const [hovered, setHovered] = useState(false);\n\n const handleMouseEnter = useCallback(() => {\n setHovered(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setHovered(false);\n }, []);\n\n const getStyle = useCallback(() => {\n const color = get('common.primary', skin);\n const grey = get('common.grey', skin);\n\n if (logout) return;\n\n if (disabled) {\n return {\n backgroundColor: grey,\n borderColor: grey,\n opacity: '0.3'\n };\n }\n\n if (hovered) {\n const darkenColor = convert(`color(${color} blackness(+10%))`);\n return {\n backgroundColor: darkenColor,\n borderColor: darkenColor\n };\n }\n\n if (secondary)\n return {\n color,\n borderColor: color\n };\n\n if (light)\n return {\n color\n };\n\n return {\n borderColor: color,\n backgroundColor: color\n };\n }, [disabled, hovered, light, logout, secondary, skin]);\n\n return (\n <Link\n href={href}\n onClick={disabled ? noop : onClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n target={target}\n className={classnames(\n style.button,\n disabled ? style.disabled : null,\n small ? style.smallButton : null,\n light ? style.lightButton : null,\n secondary ? style.secondaryButton : null,\n logout ? style.logoutButton : null,\n rectangular ? style.rectangularButton : null,\n fullWidth ? style.fullWidth : null,\n certificationButton ? style.certificationButton : null,\n className\n )}\n data-name={ctaName || 'cta'}\n style={getStyle()}\n aria-label={ariaLabel}\n useButtonTag={useButtonTag}\n >\n {logout ? (\n <div className={style.logoutWrapper} data-name=\"cta-logout-label\">\n <LogoutIcon height={15} width={15} className={style.logoutIcon} />\n {submitValue}\n </div>\n ) : (\n submitValue\n )}\n </Link>\n );\n};\n\nCTA.propTypes = {\n 'aria-label': Link.propTypes['aria-label'],\n submitValue: Link.propTypes.children,\n href: Link.propTypes.href,\n onClick: Link.propTypes.onClick,\n target: Link.propTypes.target,\n name: PropTypes.string,\n disabled: PropTypes.bool,\n light: PropTypes.bool,\n secondary: PropTypes.bool,\n small: PropTypes.bool,\n className: PropTypes.string,\n logout: PropTypes.bool,\n rectangular: PropTypes.bool,\n fullWidth: PropTypes.bool,\n certificationButton: PropTypes.bool,\n useButtonTag: Link.propTypes.useButtonTag\n};\n\nCTA.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default CTA;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,QAA5B,QAA2C,OAA3C;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,SAAP,MAAsB,YAAt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CAACgD,iBAAT,CAA2B1C;AADhB,CAAnB;AAIA,eAAeH,GAAf"}
1
+ {"version":3,"file":"index.js","names":["React","convert","PropTypes","classnames","NovaCompositionCoorpacademyLogout","LogoutIcon","Provider","Link","style","CTA","Component","constructor","props","state","hovered","handleMouseEnter","bind","handleMouseLeave","setState","getStyle","skin","context","disabled","light","secondary","logout","color","grey","backgroundColor","borderColor","opacity","darkenColor","render","submitValue","name","ctaName","href","target","small","onClick","className","rectangular","fullWidth","certificationButton","button","smallButton","lightButton","secondaryButton","logoutButton","rectangularButton","logoutWrapper","logoutIcon","contextTypes","childContextTypes","propTypes","children","string","bool"],"sources":["../../../src/atom/cta/index.js"],"sourcesContent":["import React from 'react';\nimport {convert} from 'css-color-function';\nimport PropTypes from 'prop-types';\nimport {get, noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {NovaCompositionCoorpacademyLogout as LogoutIcon} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport Link from '../link';\nimport style from './style.css';\n\nclass CTA extends React.Component {\n static propTypes = {\n submitValue: Link.propTypes.children,\n href: Link.propTypes.href,\n onClick: Link.propTypes.onClick,\n target: Link.propTypes.target,\n name: PropTypes.string,\n disabled: PropTypes.bool,\n light: PropTypes.bool,\n secondary: PropTypes.bool,\n small: PropTypes.bool,\n className: PropTypes.string,\n logout: PropTypes.bool,\n rectangular: PropTypes.bool,\n fullWidth: PropTypes.bool,\n certificationButton: PropTypes.bool\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props) {\n super(props);\n this.state = {\n hovered: false\n };\n this.handleMouseEnter = this.handleMouseEnter.bind(this);\n this.handleMouseLeave = this.handleMouseLeave.bind(this);\n }\n\n handleMouseEnter() {\n return this.setState({\n hovered: true\n });\n }\n\n handleMouseLeave() {\n return this.setState({\n hovered: false\n });\n }\n\n getStyle() {\n const {skin} = this.context;\n const {hovered} = this.state;\n const {disabled = false, light = false, secondary = false, logout = false} = this.props;\n const color = get('common.primary', skin);\n const grey = get('common.grey', skin);\n\n if (logout) return;\n\n if (disabled) {\n return {\n backgroundColor: grey,\n borderColor: grey,\n opacity: '0.3'\n };\n }\n\n if (hovered) {\n const darkenColor = convert(`color(${color} blackness(+10%))`);\n return {\n backgroundColor: darkenColor,\n borderColor: darkenColor\n };\n }\n\n if (secondary)\n return {\n color,\n borderColor: color\n };\n\n if (light)\n return {\n color\n };\n\n return {\n borderColor: color,\n backgroundColor: color\n };\n }\n\n render() {\n const {\n submitValue = 'submit',\n name: ctaName,\n href,\n target,\n disabled = false,\n light = false,\n small = false,\n secondary = false,\n onClick,\n className,\n logout = false,\n rectangular = false,\n fullWidth = false,\n certificationButton = false\n } = this.props;\n\n return (\n <Link\n href={href}\n onClick={disabled ? noop : onClick}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n target={target}\n className={classnames(\n style.button,\n disabled ? style.disabled : null,\n small ? style.smallButton : null,\n light ? style.lightButton : null,\n secondary ? style.secondaryButton : null,\n logout ? style.logoutButton : null,\n rectangular ? style.rectangularButton : null,\n fullWidth ? style.fullWidth : null,\n certificationButton ? style.certificationButton : null,\n className\n )}\n data-name={ctaName || 'cta'}\n style={this.getStyle()}\n >\n {logout ? (\n <div className={style.logoutWrapper} data-name=\"cta-logout-label\">\n <LogoutIcon height={15} width={15} className={style.logoutIcon} />\n {submitValue}\n </div>\n ) : (\n submitValue\n )}\n </Link>\n );\n }\n}\n\nexport default CTA;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAQC,OAAR,QAAsB,oBAAtB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,iCAAiC,IAAIC,UAA7C,QAA8D,0BAA9D;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,GAAN,SAAkBT,KA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,IAAI,KAlBxB;MAmBE,KAAK,EAAE,KAAKhB,QAAL;IAnBT,GAqBGM,MAAM,gBACL;MAAK,SAAS,EAAEjB,KAAK,CAAC0C,aAAtB;MAAqC,aAAU;IAA/C,gBACE,oBAAC,UAAD;MAAY,MAAM,EAAE,EAApB;MAAwB,KAAK,EAAE,EAA/B;MAAmC,SAAS,EAAE1C,KAAK,CAAC2C;IAApD,EADF,EAEGlB,WAFH,CADK,GAMLA,WA3BJ,CADF;EAgCD;;AAvI+B;;AAA5BxB,G,CAkBG2C,Y,GAAe;EACpBhC,IAAI,EAAEd,QAAQ,CAAC+C,iBAAT,CAA2BjC;AADb,C;AAlBlBX,G,CACG6C,S,2CAAY;EACjBrB,WAAW,EAAE1B,IAAI,CAAC+C,SAAL,CAAeC,QADX;EAEjBnB,IAAI,EAAE7B,IAAI,CAAC+C,SAAL,CAAelB,IAFJ;EAGjBG,OAAO,EAAEhC,IAAI,CAAC+C,SAAL,CAAef,OAHP;EAIjBF,MAAM,EAAE9B,IAAI,CAAC+C,SAAL,CAAejB,MAJN;EAKjBH,IAAI,EAAEhC,SAAS,CAACsD,MALC;EAMjBlC,QAAQ,EAAEpB,SAAS,CAACuD,IANH;EAOjBlC,KAAK,EAAErB,SAAS,CAACuD,IAPA;EAQjBjC,SAAS,EAAEtB,SAAS,CAACuD,IARJ;EASjBnB,KAAK,EAAEpC,SAAS,CAACuD,IATA;EAUjBjB,SAAS,EAAEtC,SAAS,CAACsD,MAVJ;EAWjB/B,MAAM,EAAEvB,SAAS,CAACuD,IAXD;EAYjBhB,WAAW,EAAEvC,SAAS,CAACuD,IAZN;EAajBf,SAAS,EAAExC,SAAS,CAACuD,IAbJ;EAcjBd,mBAAmB,EAAEzC,SAAS,CAACuD;AAdd,C;AAyIrB,eAAehD,GAAf"}
@@ -15,7 +15,6 @@ declare namespace Link {
15
15
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
16
16
  onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
17
17
  onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
18
- useButtonTag: PropTypes.Requireable<boolean>;
19
18
  style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
20
19
  };
21
20
  namespace contextTypes {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/link/index.js"],"names":[],"mappings":";AAMA,mEA0GC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/link/index.js"],"names":[],"mappings":";AAMA,mEA+EC"}
@@ -1,7 +1,7 @@
1
1
  import _noop from "lodash/fp/noop";
2
2
  import _getOr from "lodash/fp/getOr";
3
3
  import _identity from "lodash/fp/identity";
4
- const _excluded = ["skinHover", "hoverColor", "data-name", "aria-label", "useButtonTag"];
4
+ const _excluded = ["skinHover", "hoverColor", "data-name", "aria-label"];
5
5
 
6
6
  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); }
7
7
 
@@ -25,8 +25,7 @@ const Link = (props, legacyContext) => {
25
25
  skinHover,
26
26
  hoverColor = _getOr('#00B0FF', 'common.primary', skin),
27
27
  'data-name': dataName = 'link',
28
- 'aria-label': ariaLabel,
29
- useButtonTag = false
28
+ 'aria-label': ariaLabel
30
29
  } = props,
31
30
  linKElementProps = _objectWithoutPropertiesLoose(props, _excluded);
32
31
 
@@ -59,28 +58,24 @@ const Link = (props, legacyContext) => {
59
58
  }
60
59
  }, [download, navigate, onClick]);
61
60
 
62
- const _style = useMemo(() => href || onClick ? null : {
61
+ const _style = href || onClick ? null : {
63
62
  pointerEvents: 'none'
64
- }, [href, onClick]);
63
+ };
65
64
 
66
- const _hoverStyle = useMemo(() => skinHover && hovered ? {
65
+ const _hoverStyle = skinHover && hovered ? {
67
66
  color: hoverColor
68
- } : null, [hoverColor, hovered, skinHover]);
67
+ } : null;
69
68
 
70
- const _props = useMemo(() => _extends({}, linKElementProps, {
71
- 'data-name': dataName,
72
- 'aria-label': ariaLabel,
69
+ return /*#__PURE__*/React.createElement("a", _extends({}, linKElementProps, {
70
+ "data-name": dataName,
71
+ "aria-label": ariaLabel,
73
72
  href: href ? createHref(href) : undefined,
74
73
  onClick: handleOnClick,
75
74
  onMouseEnter: handleMouseEnter,
76
75
  onMouseLeave: handleMouseLeave,
77
- className,
76
+ className: className,
78
77
  style: _extends({}, propsStyle, _style, _hoverStyle)
79
- }), [_hoverStyle, _style, ariaLabel, className, createHref, dataName, handleMouseEnter, handleMouseLeave, handleOnClick, href, linKElementProps, propsStyle]);
80
-
81
- return useButtonTag ? /*#__PURE__*/React.createElement("button", _extends({}, _props, {
82
- type: "button"
83
- }), children) : /*#__PURE__*/React.createElement("a", _props, children);
78
+ }), children);
84
79
  };
85
80
 
86
81
  Link.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -97,7 +92,6 @@ Link.propTypes = process.env.NODE_ENV !== "production" ? {
97
92
  onClick: PropTypes.func,
98
93
  onMouseEnter: PropTypes.func,
99
94
  onMouseLeave: PropTypes.func,
100
- useButtonTag: PropTypes.bool,
101
95
  style: PropTypes.shape({})
102
96
  } : {};
103
97
  Link.contextTypes = {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","Provider","GetSkinFromContext","pushToHistory","Link","props","legacyContext","skin","hovered","setHovered","history","createHref","skinHover","hoverColor","dataName","ariaLabel","useButtonTag","linKElementProps","href","onClick","className","style","propsStyle","children","onMouseLeave","onMouseEnter","download","handleMouseEnter","handleMouseLeave","navigate","handleOnClick","e","_style","pointerEvents","_hoverStyle","color","_props","undefined","propTypes","node","string","title","target","oneOf","bool","func","shape","contextTypes","childContextTypes"],"sources":["../../../src/atom/link/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {identity, getOr, noop} from 'lodash/fp';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport pushToHistory from '../../util/navigation';\n\nconst Link = (props, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const [hovered, setHovered] = useState(false);\n const {history: {createHref = identity} = {}} = legacyContext;\n const {\n skinHover,\n hoverColor = getOr('#00B0FF', 'common.primary', skin),\n 'data-name': dataName = 'link',\n 'aria-label': ariaLabel,\n useButtonTag = false,\n ...linKElementProps\n } = props;\n const {\n href,\n onClick = noop,\n className,\n style: propsStyle,\n children,\n onMouseLeave = noop,\n onMouseEnter = noop,\n download\n } = props;\n\n const handleMouseEnter = useCallback(() => {\n setHovered(true);\n\n onMouseEnter();\n }, [onMouseEnter]);\n\n const handleMouseLeave = useCallback(() => {\n setHovered(false);\n\n onMouseLeave();\n }, [onMouseLeave]);\n\n const navigate = useMemo(() => pushToHistory(legacyContext)({href}), [href, legacyContext]);\n\n const handleOnClick = useCallback(\n e => {\n onClick(e);\n\n if (!download) {\n navigate(e);\n }\n },\n [download, navigate, onClick]\n );\n\n const _style = useMemo(\n () =>\n href || onClick\n ? null\n : {\n pointerEvents: 'none'\n },\n [href, onClick]\n );\n const _hoverStyle = useMemo(\n () =>\n skinHover && hovered\n ? {\n color: hoverColor\n }\n : null,\n [hoverColor, hovered, skinHover]\n );\n\n const _props = useMemo(\n () => ({\n ...linKElementProps,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n href: href ? createHref(href) : undefined,\n onClick: handleOnClick,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n className,\n style: {\n ...propsStyle,\n ..._style,\n ..._hoverStyle\n }\n }),\n [\n _hoverStyle,\n _style,\n ariaLabel,\n className,\n createHref,\n dataName,\n handleMouseEnter,\n handleMouseLeave,\n handleOnClick,\n href,\n linKElementProps,\n propsStyle\n ]\n );\n\n return useButtonTag ? (\n <button {..._props} type=\"button\">\n {children}\n </button>\n ) : (\n <a {..._props}>{children}</a>\n );\n};\n\nLink.propTypes = {\n children: PropTypes.node,\n className: PropTypes.string,\n href: PropTypes.string,\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string,\n title: PropTypes.string,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),\n skinHover: PropTypes.bool,\n hoverColor: PropTypes.string,\n download: PropTypes.bool,\n onClick: PropTypes.func,\n onMouseEnter: PropTypes.func,\n onMouseLeave: PropTypes.func,\n useButtonTag: PropTypes.bool,\n style: PropTypes.shape({})\n};\n\nLink.contextTypes = {\n skin: Provider.childContextTypes.skin,\n history: Provider.childContextTypes.history\n};\n\nexport default Link;\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,EAAqCC,QAArC,QAAoD,OAApD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,aAA3C;AACA,OAAOC,aAAP,MAA0B,uBAA1B;;AAEA,MAAMC,IAAI,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACrC,MAAMC,IAAI,GAAGL,kBAAkB,CAACI,aAAD,CAA/B;EACA,MAAM,CAACE,OAAD,EAAUC,UAAV,IAAwBV,QAAQ,CAAC,KAAD,CAAtC;EACA,MAAM;IAACW,OAAO,EAAE;MAACC,UAAU;IAAX,IAA0B;EAApC,IAA0CL,aAAhD;;EACA,MAAM;IACJM,SADI;IAEJC,UAAU,GAAG,OAAM,SAAN,EAAiB,gBAAjB,EAAmCN,IAAnC,CAFT;IAGJ,aAAaO,QAAQ,GAAG,MAHpB;IAIJ,cAAcC,SAJV;IAKJC,YAAY,GAAG;EALX,IAOFX,KAPJ;EAAA,MAMKY,gBANL,iCAOIZ,KAPJ;;EAQA,MAAM;IACJa,IADI;IAEJC,OAAO,QAFH;IAGJC,SAHI;IAIJC,KAAK,EAAEC,UAJH;IAKJC,QALI;IAMJC,YAAY,QANR;IAOJC,YAAY,QAPR;IAQJC;EARI,IASFrB,KATJ;EA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AT,CAA2BzC,IADf;EAElBG,OAAO,EAAET,QAAQ,CAAC+C,iBAAT,CAA2BtC;AAFlB,CAApB;AAKA,eAAeN,IAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","Provider","GetSkinFromContext","pushToHistory","Link","props","legacyContext","skin","hovered","setHovered","history","createHref","skinHover","hoverColor","dataName","ariaLabel","linKElementProps","href","onClick","className","style","propsStyle","children","onMouseLeave","onMouseEnter","download","handleMouseEnter","handleMouseLeave","navigate","handleOnClick","e","_style","pointerEvents","_hoverStyle","color","undefined","propTypes","node","string","title","target","oneOf","bool","func","shape","contextTypes","childContextTypes"],"sources":["../../../src/atom/link/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {identity, getOr, noop} from 'lodash/fp';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport pushToHistory from '../../util/navigation';\n\nconst Link = (props, legacyContext) => {\n const skin = GetSkinFromContext(legacyContext);\n const [hovered, setHovered] = useState(false);\n const {history: {createHref = identity} = {}} = legacyContext;\n const {\n skinHover,\n hoverColor = getOr('#00B0FF', 'common.primary', skin),\n 'data-name': dataName = 'link',\n 'aria-label': ariaLabel,\n ...linKElementProps\n } = props;\n const {\n href,\n onClick = noop,\n className,\n style: propsStyle,\n children,\n onMouseLeave = noop,\n onMouseEnter = noop,\n download\n } = props;\n\n const handleMouseEnter = useCallback(() => {\n setHovered(true);\n\n onMouseEnter();\n }, [onMouseEnter]);\n\n const handleMouseLeave = useCallback(() => {\n setHovered(false);\n\n onMouseLeave();\n }, [onMouseLeave]);\n\n const navigate = useMemo(() => pushToHistory(legacyContext)({href}), [href, legacyContext]);\n\n const handleOnClick = useCallback(\n e => {\n onClick(e);\n\n if (!download) {\n navigate(e);\n }\n },\n [download, navigate, onClick]\n );\n\n const _style =\n href || onClick\n ? null\n : {\n pointerEvents: 'none'\n };\n const _hoverStyle =\n skinHover && hovered\n ? {\n color: hoverColor\n }\n : null;\n\n return (\n <a\n {...linKElementProps}\n data-name={dataName}\n aria-label={ariaLabel}\n href={href ? createHref(href) : undefined}\n onClick={handleOnClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n className={className}\n style={{\n ...propsStyle,\n ..._style,\n ..._hoverStyle\n }}\n >\n {children}\n </a>\n );\n};\n\nLink.propTypes = {\n children: PropTypes.node,\n className: PropTypes.string,\n href: PropTypes.string,\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string,\n title: PropTypes.string,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),\n skinHover: PropTypes.bool,\n hoverColor: PropTypes.string,\n download: PropTypes.bool,\n onClick: PropTypes.func,\n onMouseEnter: PropTypes.func,\n onMouseLeave: PropTypes.func,\n style: PropTypes.shape({})\n};\n\nLink.contextTypes = {\n skin: Provider.childContextTypes.skin,\n history: Provider.childContextTypes.history\n};\n\nexport default Link;\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,EAAqCC,QAArC,QAAoD,OAApD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,QAAP,IAAkBC,kBAAlB,QAA2C,aAA3C;AACA,OAAOC,aAAP,MAA0B,uBAA1B;;AAEA,MAAMC,IAAI,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACrC,MAAMC,IAAI,GAAGL,kBAAkB,CAACI,aAAD,CAA/B;EACA,MAAM,CAACE,OAAD,EAAUC,UAAV,IAAwBV,QAAQ,CAAC,KAAD,CAAtC;EACA,MAAM;IAACW,OAAO,EAAE;MAACC,UAAU;IAAX,IAA0B;EAApC,IAA0CL,aAAhD;;EACA,MAAM;IACJM,SADI;IAEJC,UAAU,GAAG,OAAM,SAAN,EAAiB,gBAAjB,EAAmCN,IAAnC,CAFT;IAGJ,aAAaO,QAAQ,GAAG,MAHpB;IAIJ,cAAcC;EAJV,IAMFV,KANJ;EAAA,MAKKW,g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hB;IAQE,SAAS,EAAER,SARb;IASE,KAAK,eACAE,UADA,EAEAU,MAFA,EAGAE,WAHA;EATP,IAeGX,QAfH,CADF;AAmBD,CA/ED;;AAiFAlB,IAAI,CAACgC,SAAL,2CAAiB;EACfd,QAAQ,EAAEtB,SAAS,CAACqC,IADL;EAEflB,SAAS,EAAEnB,SAAS,CAACsC,MAFN;EAGfrB,IAAI,EAAEjB,SAAS,CAACsC,MAHD;EAIf,aAAatC,SAAS,CAACsC,MAJR;EAKf,cAActC,SAAS,CAACsC,MALT;EAMfC,KAAK,EAAEvC,SAAS,CAACsC,MANF;EAOfE,MAAM,EAAExC,SAAS,CAACyC,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB,CAPO;EAQf7B,SAAS,EAAEZ,SAAS,CAAC0C,IARN;EASf7B,UAAU,EAAEb,SAAS,CAACsC,MATP;EAUfb,QAAQ,EAAEzB,SAAS,CAAC0C,IAVL;EAWfxB,OAAO,EAAElB,SAAS,CAAC2C,IAXJ;EAYfnB,YAAY,EAAExB,SAAS,CAAC2C,IAZT;EAafpB,YAAY,EAAEvB,SAAS,CAAC2C,IAbT;EAcfvB,KAAK,EAAEpB,SAAS,CAAC4C,KAAV,CAAgB,EAAhB;AAdQ,CAAjB;AAiBAxC,IAAI,CAACyC,YAAL,GAAoB;EAClBtC,IAAI,EAAEN,QAAQ,CAAC6C,iBAAT,CAA2BvC,IADf;EAElBG,OAAO,EAAET,QAAQ,CAAC6C,iBAAT,CAA2BpC;AAFlB,CAApB;AAKA,eAAeN,IAAf"}
@@ -7,7 +7,6 @@ declare namespace Slide {
7
7
  const subtitle: PropTypes.Requireable<string>;
8
8
  const light: PropTypes.Requireable<boolean>;
9
9
  const cta: PropTypes.Requireable<PropTypes.InferProps<{
10
- 'aria-label': PropTypes.Requireable<string>;
11
10
  submitValue: PropTypes.Requireable<PropTypes.ReactNodeLike>;
12
11
  href: PropTypes.Requireable<string>;
13
12
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
@@ -22,7 +21,6 @@ declare namespace Slide {
22
21
  rectangular: PropTypes.Requireable<boolean>;
23
22
  fullWidth: PropTypes.Requireable<boolean>;
24
23
  certificationButton: PropTypes.Requireable<boolean>;
25
- useButtonTag: PropTypes.Requireable<boolean>;
26
24
  }>>;
27
25
  const alignment: PropTypes.Requireable<string>;
28
26
  }
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import { Props } from './types';
3
+ export declare const ICONS: {
4
+ arrow: any;
5
+ };
6
+ declare const ExpandableItem: {
7
+ ({ icon, title, isExpended, isLink, content, onClick, image }: Props): JSX.Element;
8
+ propTypes: {
9
+ title: import("prop-types").Requireable<string>;
10
+ icon: import("prop-types").Requireable<string>;
11
+ isExpended: import("prop-types").Requireable<boolean>;
12
+ isLink: import("prop-types").Requireable<boolean>;
13
+ content: import("prop-types").Requireable<string>;
14
+ image: import("prop-types").Requireable<string>;
15
+ onClick: import("prop-types").Requireable<(...args: any[]) => any>;
16
+ };
17
+ };
18
+ export default ExpandableItem;
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandable-item/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAY,KAAK,EAAC,MAAM,SAAS,CAAC;AAGzC,eAAO,MAAM,KAAK;;CAEjB,CAAC;AAEF,QAAA,MAAM,cAAc;mEAAgE,KAAK;;;;;;;;;;CA2BxF,CAAC;AAGF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import classnames from 'classnames';
3
+ import { NovaCompositionNavigationArrowDown as ArrowIcon } from '@coorpacademy/nova-icons';
4
+ import { propTypes } from './types';
5
+ import styles from './style.css';
6
+ export const ICONS = {
7
+ arrow: ArrowIcon
8
+ };
9
+
10
+ const ExpandableItem = ({
11
+ icon,
12
+ title,
13
+ isExpended,
14
+ isLink,
15
+ content,
16
+ onClick,
17
+ image
18
+ }) => {
19
+ const Icon = ICONS[icon];
20
+ return /*#__PURE__*/React.createElement("div", {
21
+ className: isExpended ? styles.expendedContainer : styles.container,
22
+ onClick: onClick
23
+ }, /*#__PURE__*/React.createElement("div", {
24
+ className: classnames(styles.header, isExpended ? styles.expendedHeader : null)
25
+ }, /*#__PURE__*/React.createElement("h3", {
26
+ className: styles.title
27
+ }, title), Icon ? /*#__PURE__*/React.createElement(Icon, {
28
+ className: classnames(styles.icon, isExpended ? styles.expendedIcon : null, isLink ? styles.linkIcon : null)
29
+ }) : null), isExpended ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
30
+ className: styles.content // eslint-disable-next-line react/no-danger
31
+ ,
32
+ dangerouslySetInnerHTML: {
33
+ __html: content
34
+ }
35
+ }), image ? /*#__PURE__*/React.createElement("img", {
36
+ className: styles.image,
37
+ src: image,
38
+ alt: ''
39
+ }) : null) : null);
40
+ };
41
+
42
+ ExpandableItem.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
43
+ export default ExpandableItem;
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["React","classnames","NovaCompositionNavigationArrowDown","ArrowIcon","propTypes","styles","ICONS","arrow","ExpandableItem","icon","title","isExpended","isLink","content","onClick","image","Icon","expendedContainer","container","header","expendedHeader","expendedIcon","linkIcon","__html"],"sources":["../../../src/molecule/expandable-item/index.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport {NovaCompositionNavigationArrowDown as ArrowIcon} from '@coorpacademy/nova-icons';\nimport {propTypes, Props} from './types';\nimport styles from './style.css';\n\nexport const ICONS = {\n arrow: ArrowIcon\n};\n\nconst ExpandableItem = ({icon, title, isExpended, isLink, content, onClick, image}: Props) => {\n const Icon = ICONS[icon];\n return (\n <div className={isExpended ? styles.expendedContainer : styles.container} onClick={onClick}>\n <div className={classnames(styles.header, isExpended ? styles.expendedHeader : null)}>\n <h3 className={styles.title}>{title}</h3>\n {Icon ? (\n <Icon\n className={classnames(\n styles.icon,\n isExpended ? styles.expendedIcon : null,\n isLink ? styles.linkIcon : null\n )}\n />\n ) : null}\n </div>\n {isExpended ? (\n <div>\n <div\n className={styles.content} // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n {image ? <img className={styles.image} src={image} alt={''} /> : null}\n </div>\n ) : null}\n </div>\n );\n};\n\nExpandableItem.propTypes = propTypes;\nexport default ExpandableItem;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;AACA,SAAQC,SAAR,QAA+B,SAA/B;AACA,OAAOC,MAAP,MAAmB,aAAnB;AAEA,OAAO,MAAMC,KAAK,GAAG;EACnBC,KAAK,EAAEJ;AADY,CAAd;;AAIP,MAAMK,cAAc,GAAG,CAAC;EAACC,IAAD;EAAOC,KAAP;EAAcC,UAAd;EAA0BC,MAA1B;EAAkCC,OAAlC;EAA2CC,OAA3C;EAAoDC;AAApD,CAAD,KAAuE;EAC5F,MAAMC,IAAI,GAAGV,KAAK,CAACG,IAAD,CAAlB;EACA,oBACE;IAAK,SAAS,EAAEE,UAAU,GAAGN,MAAM,CAACY,iBAAV,GAA8BZ,MAAM,CAACa,SAA/D;IAA0E,OAAO,EAAEJ;EAAnF,gBACE;IAAK,SAAS,EAAEb,UAAU,CAACI,MAAM,CAACc,MAAR,EAAgBR,UAAU,GAAGN,MAAM,CAACe,cAAV,GAA2B,IAArD;EAA1B,gBACE;IAAI,SAAS,EAAEf,MAAM,CAACK;EAAtB,GAA8BA,KAA9B,CADF,EAEGM,IAAI,gBACH,oBAAC,IAAD;IACE,SAAS,EAAEf,UAAU,CACnBI,MAAM,CAACI,IADY,EAEnBE,UAAU,GAAGN,MAAM,CAACgB,YAAV,GAAyB,IAFhB,EAGnBT,MAAM,GAAGP,MAAM,CAACiB,QAAV,GAAqB,IAHR;EADvB,EADG,GAQD,IAVN,CADF,EAaGX,UAAU,gBACT,8CACE;IACE,SAAS,EAAEN,MAAM,CAACQ,OADpB,CAC6B;IAD7B;IAEE,uBAAuB,EAAE;MAACU,MAAM,EAAEV;IAAT;EAF3B,EADF,EAKGE,KAAK,gBAAG;IAAK,SAAS,EAAEV,MAAM,CAACU,KAAvB;IAA8B,GAAG,EAAEA,KAAnC;IAA0C,GAAG,EAAE;EAA/C,EAAH,GAA2D,IALnE,CADS,GAQP,IArBN,CADF;AAyBD,CA3BD;;AA6BAP,cAAc,CAACJ,SAAf,2CAA2BA,SAA3B;AACA,eAAeI,cAAf"}
@@ -0,0 +1,135 @@
1
+ @value colors: "../../variables/colors.css";
2
+ @value breakpoints: "../../variables/breakpoints.css";
3
+ @value mobile from breakpoints;
4
+ @value tablet from breakpoints;
5
+ @value cm_primary_blue from colors;
6
+ @value cm_grey_500 from colors;
7
+ @value cm_grey_600 from colors;
8
+ @value cm_grey_800 from colors;
9
+ @value cm_grey_700 from colors;
10
+ @value white from colors;
11
+
12
+ .container {
13
+ display: flex;
14
+ flex-direction: column;
15
+ background: white;
16
+ gap: 16px;
17
+ border-radius: 8px;
18
+ width: 100%;
19
+ display: flex;
20
+ height: 72px;
21
+ justify-content: center;
22
+ }
23
+
24
+ .header {
25
+ display: flex;
26
+ flex-direction: row;
27
+ flex: none;
28
+ order: 0;
29
+ flex-grow: 0;
30
+ justify-content: space-between;
31
+ align-items: center;
32
+ cursor: pointer;
33
+ padding: 24px;
34
+ gap: 16px;
35
+ }
36
+
37
+ .expendedContainer {
38
+ display: flex;
39
+ flex-direction: column;
40
+ background: white;
41
+ gap: 16px;
42
+ border-radius: 2px;
43
+ width: 100%;
44
+ display: flex;
45
+ justify-content: center;
46
+ }
47
+
48
+ .expendedHeader {
49
+ padding: 24px 24px 0px 24px;
50
+ }
51
+
52
+ .title {
53
+ font-family: Gilroy;
54
+ color: cm_grey_700;
55
+ margin: 0;
56
+ font-weight: inherit;
57
+ font-family: Gilroy;
58
+ font-size: 18px;
59
+ font-weight: 600;
60
+ line-height: 24px;
61
+ letter-spacing: 0px;
62
+ text-align: left;
63
+ }
64
+
65
+ .icon {
66
+ width: 16px;
67
+ height: 16px;
68
+ width: 14px;
69
+ left: 5px;
70
+ top: 9px;
71
+ border-radius: 0px;
72
+ color: cm_grey_500;
73
+ flex-shrink: 0;
74
+ min-width: 16px;
75
+ flex-basis: 16px;
76
+ }
77
+
78
+ .expendedIcon {
79
+ transform: rotateZ(180deg);
80
+ }
81
+
82
+ .linkIcon {
83
+ transform: rotateZ(270deg);
84
+ }
85
+
86
+ .content {
87
+ font-family: Gilroy;
88
+ font-size: 20px;
89
+ font-weight: 400;
90
+ line-height: 28px;
91
+ letter-spacing: 0px;
92
+ text-align: left;
93
+ padding: 0px 40px 32px 40px;
94
+
95
+ }
96
+
97
+ .image {
98
+ width: 100%;
99
+ }
100
+
101
+ .content span{
102
+ font-family: Gilroy;
103
+ font-size: 20px;
104
+ font-weight: 400;
105
+ line-height: 28px;
106
+ letter-spacing: 0px;
107
+ text-align: left;
108
+ color: cm_grey_600;
109
+ }
110
+
111
+ @media mobile {
112
+ .container {
113
+ display: flex;
114
+ flex-direction: column;
115
+ background: white;
116
+ gap: 16px;
117
+ border-radius: 2px;
118
+ width: 100%;
119
+ display: flex;
120
+ justify-content: center;
121
+ height: max-content;
122
+ }
123
+ .header {
124
+ display: flex;
125
+ flex-direction: row;
126
+ flex: none;
127
+ order: 0;
128
+ flex-grow: 0;
129
+ justify-content: space-between;
130
+ align-items: center;
131
+ cursor: pointer;
132
+ padding: 12px 40px;
133
+ height: max-content;
134
+ }
135
+ }