@coorpacademy/components 11.35.2-alpha.4 → 11.35.2-forcedeploy.13

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 (282) hide show
  1. package/es/atom/button-link/index.js +1 -1
  2. package/es/atom/button-link/index.js.map +1 -1
  3. package/es/atom/button-link/style.css +2 -2
  4. package/es/atom/icon/index.d.ts +35 -17
  5. package/es/atom/icon/index.d.ts.map +1 -1
  6. package/es/atom/icon/index.js +32 -15
  7. package/es/atom/icon/index.js.map +1 -1
  8. package/es/atom/radio-with-title/index.d.ts +13 -3
  9. package/es/atom/radio-with-title/index.d.ts.map +1 -1
  10. package/es/atom/radio-with-title/types.d.ts +13 -2
  11. package/es/atom/radio-with-title/types.d.ts.map +1 -1
  12. package/es/atom/status-item/index.native.js +1 -1
  13. package/es/atom/status-item/index.native.js.map +1 -1
  14. package/es/atom/tag/index.d.ts +12 -1
  15. package/es/atom/tag/style.css +1 -0
  16. package/es/atom/title/index.d.ts +13 -2
  17. package/es/molecule/banner/style.css +1 -0
  18. package/es/molecule/base-modal/style.css +0 -1
  19. package/es/molecule/bulk-progress-bar/index.js +2 -2
  20. package/es/molecule/bulk-progress-bar/index.js.map +1 -1
  21. package/es/molecule/certification-card/index.js +1 -1
  22. package/es/molecule/certification-card/index.js.map +1 -1
  23. package/es/molecule/cm-popin/types.d.ts +28 -7
  24. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  25. package/es/molecule/cm-popin/types.js +1 -1
  26. package/es/molecule/cm-popin/types.js.map +1 -1
  27. package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
  28. package/es/molecule/dashboard/cards-list/index.js +2 -0
  29. package/es/molecule/dashboard/cards-list/index.js.map +1 -1
  30. package/es/molecule/learner-skill-card/index.d.ts +25 -40
  31. package/es/molecule/learner-skill-card/index.d.ts.map +1 -1
  32. package/es/molecule/learner-skill-card/index.js +95 -96
  33. package/es/molecule/learner-skill-card/index.js.map +1 -1
  34. package/es/molecule/learner-skill-card/prop-types.d.ts +37 -0
  35. package/es/molecule/learner-skill-card/prop-types.d.ts.map +1 -0
  36. package/es/molecule/learner-skill-card/prop-types.js +20 -0
  37. package/es/molecule/learner-skill-card/prop-types.js.map +1 -0
  38. package/es/molecule/learner-skill-card/style.css +62 -41
  39. package/es/molecule/learning-priority-modal/style.css +3 -2
  40. package/es/molecule/progress-wrapper/index.js +1 -1
  41. package/es/molecule/progress-wrapper/index.js.map +1 -1
  42. package/es/molecule/skills-chart-side-information-item/index.d.ts +1 -1
  43. package/es/molecule/skills-chart-side-information-panel/index.d.ts +1 -1
  44. package/es/molecule/title-and-checkbox-wrapper/index.d.ts +13 -2
  45. package/es/molecule/title-radio-wrapper/index.d.ts +13 -3
  46. package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
  47. package/es/molecule/title-radio-wrapper/types.d.ts +13 -2
  48. package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
  49. package/es/organism/cards-grid/index.d.ts +48 -10
  50. package/es/organism/cards-grid/index.d.ts.map +1 -1
  51. package/es/organism/cards-grid/index.js +3 -2
  52. package/es/organism/cards-grid/index.js.map +1 -1
  53. package/es/organism/content-skill-modal/index.d.ts +13 -3
  54. package/es/organism/content-skill-modal/index.d.ts.map +1 -1
  55. package/es/organism/content-skill-modal/types.d.ts +12 -2
  56. package/es/organism/content-skill-modal/types.d.ts.map +1 -1
  57. package/es/organism/header-with-actions/index.d.ts +8 -22
  58. package/es/organism/header-with-actions/index.d.ts.map +1 -1
  59. package/es/organism/header-with-actions/index.js +7 -85
  60. package/es/organism/header-with-actions/index.js.map +1 -1
  61. package/es/organism/header-with-actions/types.d.ts +13 -44
  62. package/es/organism/header-with-actions/types.d.ts.map +1 -1
  63. package/es/organism/header-with-actions/types.js +6 -22
  64. package/es/organism/header-with-actions/types.js.map +1 -1
  65. package/es/organism/list-item/index.js +5 -5
  66. package/es/organism/list-item/index.js.map +1 -1
  67. package/es/organism/list-item/style.css +23 -17
  68. package/es/organism/list-items/index.d.ts +13 -2
  69. package/es/organism/mooc-header/index.d.ts.map +1 -1
  70. package/es/organism/mooc-header/index.js +9 -7
  71. package/es/organism/mooc-header/index.js.map +1 -1
  72. package/es/organism/mooc-header/style.css +22 -18
  73. package/es/organism/rewards-form/index.d.ts +13 -2
  74. package/es/organism/select-opponents/index.d.ts +13 -3
  75. package/es/organism/select-opponents/index.d.ts.map +1 -1
  76. package/es/organism/select-opponents/types.d.ts +13 -2
  77. package/es/organism/select-opponents/types.d.ts.map +1 -1
  78. package/es/organism/sidebar/index.d.ts +2 -2
  79. package/es/organism/skill-edition/index.d.ts +37 -7
  80. package/es/organism/skill-edition/index.d.ts.map +1 -1
  81. package/es/organism/skill-edition/types.d.ts +37 -6
  82. package/es/organism/skill-edition/types.d.ts.map +1 -1
  83. package/es/organism/title-and-input/index.d.ts +25 -5
  84. package/es/organism/title-and-input/index.d.ts.map +1 -1
  85. package/es/organism/title-and-input/types.d.ts +24 -4
  86. package/es/organism/title-and-input/types.d.ts.map +1 -1
  87. package/es/organism/wizard-contents/index.d.ts +13 -2
  88. package/es/template/app-player/loading/index.d.ts +27 -6
  89. package/es/template/app-player/player/index.d.ts +53 -12
  90. package/es/template/app-player/player/slides/index.d.ts +27 -6
  91. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  92. package/es/template/app-player/popin-correction/index.d.ts +26 -6
  93. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  94. package/es/template/app-player/popin-end/index.d.ts +27 -6
  95. package/es/template/app-review/index.d.ts +27 -7
  96. package/es/template/app-review/index.d.ts.map +1 -1
  97. package/es/template/app-review/player/prop-types.d.ts +27 -6
  98. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  99. package/es/template/app-review/prop-types.d.ts +27 -6
  100. package/es/template/app-review/prop-types.d.ts.map +1 -1
  101. package/es/template/back-office/brand-update/index.d.ts +95 -38
  102. package/es/template/back-office/brand-update/index.d.ts.map +1 -1
  103. package/es/template/back-office/brand-update/index.js +2 -4
  104. package/es/template/back-office/brand-update/index.js.map +1 -1
  105. package/es/template/back-office/brand-update/style.css +1 -4
  106. package/es/template/back-office/brand-update/utils.d.ts +11 -39
  107. package/es/template/back-office/brand-update/utils.js +0 -19
  108. package/es/template/back-office/brand-update/utils.js.map +1 -1
  109. package/es/template/common/dashboard/index.d.ts +53 -12
  110. package/es/template/common/search-page/index.d.ts +27 -6
  111. package/es/template/external-course/index.d.ts +27 -6
  112. package/es/template/my-learning/index.d.ts +0 -1
  113. package/es/template/my-learning/index.d.ts.map +1 -1
  114. package/es/template/my-learning/index.js +26 -22
  115. package/es/template/my-learning/index.js.map +1 -1
  116. package/es/template/my-learning/style.css +9 -6
  117. package/es/template/skill-detail/all-courses.css +3 -2
  118. package/es/template/skill-detail/all-courses.d.ts +52 -17
  119. package/es/template/skill-detail/all-courses.d.ts.map +1 -1
  120. package/es/template/skill-detail/all-courses.js +12 -11
  121. package/es/template/skill-detail/all-courses.js.map +1 -1
  122. package/es/template/skill-detail/continue-learning.css +7 -2
  123. package/es/template/skill-detail/continue-learning.d.ts +25 -12
  124. package/es/template/skill-detail/continue-learning.d.ts.map +1 -1
  125. package/es/template/skill-detail/continue-learning.js.map +1 -1
  126. package/es/template/skill-detail/index.d.ts +81 -71
  127. package/es/template/skill-detail/index.d.ts.map +1 -1
  128. package/es/template/skill-detail/index.js +91 -58
  129. package/es/template/skill-detail/index.js.map +1 -1
  130. package/es/template/skill-detail/style.css +97 -39
  131. package/es/variables/colors.css +10 -1
  132. package/es/variables/colors.d.ts +13 -3
  133. package/es/variables/colors.d.ts.map +1 -1
  134. package/es/variables/colors.js +13 -3
  135. package/es/variables/colors.js.map +1 -1
  136. package/es/variables/theme.native.js +1 -1
  137. package/es/variables/theme.native.js.map +1 -1
  138. package/lib/atom/button-link/index.js +1 -1
  139. package/lib/atom/button-link/index.js.map +1 -1
  140. package/lib/atom/button-link/style.css +2 -2
  141. package/lib/atom/icon/index.d.ts +35 -17
  142. package/lib/atom/icon/index.d.ts.map +1 -1
  143. package/lib/atom/icon/index.js +34 -18
  144. package/lib/atom/icon/index.js.map +1 -1
  145. package/lib/atom/radio-with-title/index.d.ts +13 -3
  146. package/lib/atom/radio-with-title/index.d.ts.map +1 -1
  147. package/lib/atom/radio-with-title/types.d.ts +13 -2
  148. package/lib/atom/radio-with-title/types.d.ts.map +1 -1
  149. package/lib/atom/status-item/index.native.js +1 -1
  150. package/lib/atom/status-item/index.native.js.map +1 -1
  151. package/lib/atom/tag/index.d.ts +12 -1
  152. package/lib/atom/tag/style.css +1 -0
  153. package/lib/atom/title/index.d.ts +13 -2
  154. package/lib/molecule/banner/style.css +1 -0
  155. package/lib/molecule/base-modal/style.css +0 -1
  156. package/lib/molecule/bulk-progress-bar/index.js +2 -2
  157. package/lib/molecule/bulk-progress-bar/index.js.map +1 -1
  158. package/lib/molecule/certification-card/index.js +1 -1
  159. package/lib/molecule/certification-card/index.js.map +1 -1
  160. package/lib/molecule/cm-popin/types.d.ts +28 -7
  161. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  162. package/lib/molecule/cm-popin/types.js +1 -1
  163. package/lib/molecule/cm-popin/types.js.map +1 -1
  164. package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
  165. package/lib/molecule/dashboard/cards-list/index.js +2 -0
  166. package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
  167. package/lib/molecule/learner-skill-card/index.d.ts +25 -40
  168. package/lib/molecule/learner-skill-card/index.d.ts.map +1 -1
  169. package/lib/molecule/learner-skill-card/index.js +98 -96
  170. package/lib/molecule/learner-skill-card/index.js.map +1 -1
  171. package/lib/molecule/learner-skill-card/prop-types.d.ts +37 -0
  172. package/lib/molecule/learner-skill-card/prop-types.d.ts.map +1 -0
  173. package/lib/molecule/learner-skill-card/prop-types.js +25 -0
  174. package/lib/molecule/learner-skill-card/prop-types.js.map +1 -0
  175. package/lib/molecule/learner-skill-card/style.css +62 -41
  176. package/lib/molecule/learning-priority-modal/style.css +3 -2
  177. package/lib/molecule/progress-wrapper/index.js +1 -1
  178. package/lib/molecule/progress-wrapper/index.js.map +1 -1
  179. package/lib/molecule/skills-chart-side-information-item/index.d.ts +1 -1
  180. package/lib/molecule/skills-chart-side-information-panel/index.d.ts +1 -1
  181. package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +13 -2
  182. package/lib/molecule/title-radio-wrapper/index.d.ts +13 -3
  183. package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
  184. package/lib/molecule/title-radio-wrapper/types.d.ts +13 -2
  185. package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
  186. package/lib/organism/cards-grid/index.d.ts +48 -10
  187. package/lib/organism/cards-grid/index.d.ts.map +1 -1
  188. package/lib/organism/cards-grid/index.js +3 -2
  189. package/lib/organism/cards-grid/index.js.map +1 -1
  190. package/lib/organism/content-skill-modal/index.d.ts +13 -3
  191. package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
  192. package/lib/organism/content-skill-modal/types.d.ts +12 -2
  193. package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
  194. package/lib/organism/header-with-actions/index.d.ts +8 -22
  195. package/lib/organism/header-with-actions/index.d.ts.map +1 -1
  196. package/lib/organism/header-with-actions/index.js +7 -85
  197. package/lib/organism/header-with-actions/index.js.map +1 -1
  198. package/lib/organism/header-with-actions/types.d.ts +13 -44
  199. package/lib/organism/header-with-actions/types.d.ts.map +1 -1
  200. package/lib/organism/header-with-actions/types.js +6 -22
  201. package/lib/organism/header-with-actions/types.js.map +1 -1
  202. package/lib/organism/list-item/index.js +5 -5
  203. package/lib/organism/list-item/index.js.map +1 -1
  204. package/lib/organism/list-item/style.css +23 -17
  205. package/lib/organism/list-items/index.d.ts +13 -2
  206. package/lib/organism/mooc-header/index.d.ts.map +1 -1
  207. package/lib/organism/mooc-header/index.js +8 -6
  208. package/lib/organism/mooc-header/index.js.map +1 -1
  209. package/lib/organism/mooc-header/style.css +22 -18
  210. package/lib/organism/rewards-form/index.d.ts +13 -2
  211. package/lib/organism/select-opponents/index.d.ts +13 -3
  212. package/lib/organism/select-opponents/index.d.ts.map +1 -1
  213. package/lib/organism/select-opponents/types.d.ts +13 -2
  214. package/lib/organism/select-opponents/types.d.ts.map +1 -1
  215. package/lib/organism/sidebar/index.d.ts +2 -2
  216. package/lib/organism/skill-edition/index.d.ts +37 -7
  217. package/lib/organism/skill-edition/index.d.ts.map +1 -1
  218. package/lib/organism/skill-edition/types.d.ts +37 -6
  219. package/lib/organism/skill-edition/types.d.ts.map +1 -1
  220. package/lib/organism/title-and-input/index.d.ts +25 -5
  221. package/lib/organism/title-and-input/index.d.ts.map +1 -1
  222. package/lib/organism/title-and-input/types.d.ts +24 -4
  223. package/lib/organism/title-and-input/types.d.ts.map +1 -1
  224. package/lib/organism/wizard-contents/index.d.ts +13 -2
  225. package/lib/template/app-player/loading/index.d.ts +27 -6
  226. package/lib/template/app-player/player/index.d.ts +53 -12
  227. package/lib/template/app-player/player/slides/index.d.ts +27 -6
  228. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  229. package/lib/template/app-player/popin-correction/index.d.ts +26 -6
  230. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  231. package/lib/template/app-player/popin-end/index.d.ts +27 -6
  232. package/lib/template/app-review/index.d.ts +27 -7
  233. package/lib/template/app-review/index.d.ts.map +1 -1
  234. package/lib/template/app-review/player/prop-types.d.ts +27 -6
  235. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  236. package/lib/template/app-review/prop-types.d.ts +27 -6
  237. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  238. package/lib/template/back-office/brand-update/index.d.ts +95 -38
  239. package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
  240. package/lib/template/back-office/brand-update/index.js +2 -4
  241. package/lib/template/back-office/brand-update/index.js.map +1 -1
  242. package/lib/template/back-office/brand-update/style.css +1 -4
  243. package/lib/template/back-office/brand-update/utils.d.ts +11 -39
  244. package/lib/template/back-office/brand-update/utils.js +0 -19
  245. package/lib/template/back-office/brand-update/utils.js.map +1 -1
  246. package/lib/template/common/dashboard/index.d.ts +53 -12
  247. package/lib/template/common/search-page/index.d.ts +27 -6
  248. package/lib/template/external-course/index.d.ts +27 -6
  249. package/lib/template/my-learning/index.d.ts +0 -1
  250. package/lib/template/my-learning/index.d.ts.map +1 -1
  251. package/lib/template/my-learning/index.js +26 -22
  252. package/lib/template/my-learning/index.js.map +1 -1
  253. package/lib/template/my-learning/style.css +9 -6
  254. package/lib/template/skill-detail/all-courses.css +3 -2
  255. package/lib/template/skill-detail/all-courses.d.ts +52 -17
  256. package/lib/template/skill-detail/all-courses.d.ts.map +1 -1
  257. package/lib/template/skill-detail/all-courses.js +11 -11
  258. package/lib/template/skill-detail/all-courses.js.map +1 -1
  259. package/lib/template/skill-detail/continue-learning.css +7 -2
  260. package/lib/template/skill-detail/continue-learning.d.ts +25 -12
  261. package/lib/template/skill-detail/continue-learning.d.ts.map +1 -1
  262. package/lib/template/skill-detail/continue-learning.js.map +1 -1
  263. package/lib/template/skill-detail/index.d.ts +81 -71
  264. package/lib/template/skill-detail/index.d.ts.map +1 -1
  265. package/lib/template/skill-detail/index.js +91 -58
  266. package/lib/template/skill-detail/index.js.map +1 -1
  267. package/lib/template/skill-detail/style.css +97 -39
  268. package/lib/variables/colors.css +10 -1
  269. package/lib/variables/colors.d.ts +13 -3
  270. package/lib/variables/colors.d.ts.map +1 -1
  271. package/lib/variables/colors.js +13 -3
  272. package/lib/variables/colors.js.map +1 -1
  273. package/lib/variables/theme.native.js +1 -1
  274. package/lib/variables/theme.native.js.map +1 -1
  275. package/locales/cs/global.json +1 -0
  276. package/locales/en/global.json +1 -0
  277. package/locales/hr/global.json +1 -0
  278. package/locales/it/global.json +1 -0
  279. package/locales/ko/global.json +1 -0
  280. package/locales/ru/global.json +1 -0
  281. package/package.json +2 -2
  282. package/locales/.mtslconfig.json +0 -1
@@ -7,6 +7,7 @@
7
7
  @value cm_grey_200 from colors;
8
8
  @value cm_grey_400 from colors;
9
9
  @value cm_grey_500 from colors;
10
+ @value purple_600 from colors;
10
11
 
11
12
  .textBase {
12
13
  font-family: "Gilroy";
@@ -22,12 +23,7 @@
22
23
  .container {
23
24
  composes: textBase;
24
25
  background-color: white;
25
- font-family: "Gilroy";
26
- font-style: normal;
27
- margin-top: 48px;
28
- margin-bottom: 48px;
29
- margin-left: auto;
30
- margin-right: auto;
26
+ margin: 48px auto;
31
27
  padding: 0 16px;
32
28
  position: relative;
33
29
  box-sizing: border-box;
@@ -36,14 +32,48 @@
36
32
  max-width: calc(1080px + 40px);
37
33
  }
38
34
 
39
- .backButton {
40
- margin-bottom: 16px;
35
+ .topSection {
36
+ display: flex;
41
37
  }
42
38
 
43
- .ctaContainer {
39
+ .mainSection {
44
40
  display: flex;
45
- width: 100%;
46
- justify-content: space-between;
41
+ align-items: flex-start;
42
+ gap: 40px;
43
+ }
44
+
45
+ .leftSide {
46
+ width: 420px;
47
+ height: 280px;
48
+ display: flex;
49
+ flex-direction: column;
50
+ gap: 16px;
51
+ }
52
+
53
+ .rightSide {
54
+ max-width: 620px;
55
+ height: 280px;
56
+ display: flex;
57
+ gap: 8px;
58
+ flex-direction: column;
59
+ }
60
+
61
+ .title {
62
+ gap: 8px;
63
+ margin: 0;
64
+ font-size: 24px;
65
+ font-weight: 700;
66
+ line-height: 32px;
67
+ }
68
+
69
+ .ctaWrapper {
70
+ display: flex;
71
+ gap: 8px;
72
+ margin-top: 16px;
73
+ }
74
+
75
+ .backButton {
76
+ margin-bottom: 16px;
47
77
  }
48
78
 
49
79
  .skillFocusBadge {
@@ -57,35 +87,39 @@
57
87
  font-size: 12px;
58
88
  line-height: 16px;
59
89
  font-weight: 600;
60
- color: #3900D6;
61
- margin-bottom: 16px;
90
+ color: purple_600;
62
91
  }
63
92
 
64
- .ctaWrapper,
65
- .showMoreWrapper {
93
+ .skillBadge {
66
94
  display: flex;
67
- gap: 8px;
95
+ height: 12px;
96
+ width: fit-content;
97
+ align-items: center;
98
+ background-color: cm_grey_100;
99
+ border-radius: 24px;
100
+ padding: 4px 8px;
101
+ font-size: 12px;
102
+ line-height: 12px;
103
+ font-weight: 600;
104
+ color: cm_grey_500;
68
105
  }
69
106
 
70
107
  .showMoreWrapper {
108
+ display: flex;
71
109
  align-items: center;
72
- margin-top: 8px;
110
+ color: cm_grey_500;
73
111
  font-weight: 600;
74
112
  cursor: pointer;
75
- }
76
-
77
- .title {
78
- font-size: 24px;
79
- font-weight: 700;
80
- line-height: 32px;
113
+ font-size: 14px;
81
114
  }
82
115
 
83
116
  .description {
84
- margin-top: 8px;
85
- max-width: 734px;
117
+ max-width: 620px;
86
118
  font-size: 14px;
87
119
  font-weight: 500;
88
120
  line-height: 20px;
121
+ flex: 1 0 0;
122
+ align-self: stretch;
89
123
  color: cm_grey_400;
90
124
  }
91
125
 
@@ -105,27 +139,37 @@
105
139
  color: cm_grey_400;
106
140
  margin-top: 16px;
107
141
  }
108
-
109
- .skillInformationNumber {
110
- color: #000;
142
+ .noDescriptionSpacing {
143
+ margin-top: 48px ;
111
144
  }
112
145
 
146
+
113
147
  .progressContainer {
114
148
  display: flex;
115
149
  align-items: center;
116
150
  gap: 8px;
117
- margin: 16px 0 40px 0;
118
151
  }
119
152
 
120
153
  .progressInformationNumber {
154
+ font-size: 14px;
155
+ font-weight: 600;
121
156
  color: cm_grey_500;
157
+ flex-shrink: 0;
158
+ }
159
+
160
+ .progressBarRow {
161
+ display: flex;
162
+ align-items: center;
163
+ flex-direction: row;
164
+ width: 100%;
165
+ gap: 8px;
122
166
  }
123
167
 
124
168
  .progressBarWrapper {
125
169
  position: relative;
126
170
  left: 0;
127
171
  max-width: 300px;
128
- width: 100%;
172
+ flex: 1;
129
173
  height: 4px;
130
174
  border-radius: 2px;
131
175
  overflow: hidden;
@@ -133,27 +177,41 @@
133
177
  }
134
178
 
135
179
  .progress {
136
- display: block;
180
+ display: flex;
137
181
  height: 8px;
138
182
  animation: progressbar 2s ease-in-out;
139
183
  }
140
184
 
141
185
  @media tablet {
142
- .ctaContainer {
143
- flex-direction: column;
186
+ .topSection {
187
+ flex-direction: row;
188
+ align-items: flex-start;
144
189
  }
145
-
146
- .ctaWrapper {
147
- margin-top: 32px;
190
+ .leftSide,
191
+ .rightSide {
192
+ width: 50%;
148
193
  }
149
194
  }
150
195
 
151
196
  @media mobile {
197
+ .topSection {
198
+ flex-direction: column;
199
+ align-items: center;
200
+ }
201
+
202
+ .leftSide,
203
+ .rightSide {
204
+ width: 100%;
205
+ align-items: center;
206
+ }
207
+
152
208
  .ctaWrapper {
153
209
  flex-direction: column;
210
+ gap: 8px;
211
+ margin-top: 16px;
212
+ }
154
213
 
155
- button {
156
- width: 100% !important;
157
- }
214
+ .ctaWrapper button {
215
+ width: 100% !important;
158
216
  }
159
217
  }
@@ -91,4 +91,13 @@
91
91
  @value red_100: #FFD1D1;
92
92
 
93
93
  @value warning_100: #FFEECC;
94
- @value warning_700: #B87A00;
94
+ @value warning_700: #B87A00;
95
+
96
+ @value negative_600 #C91214;
97
+ @value red_200 #FF9E9E;
98
+ @value turquoise_100: '#D9F4F7';
99
+ @value pink_100: '#FAD6DE';
100
+ @value orange_100: '#FFDCD1';
101
+ @value primary_100: '#D6E6FF';
102
+ @value purple_100: #DDD1FF;
103
+ @value purple_600: #3900D6;
@@ -2,12 +2,12 @@ export declare const COLORS: {
2
2
  readonly gray: "#EAEAEB";
3
3
  readonly negative: "#ed3436";
4
4
  readonly cm_negative_200: "#B81400";
5
- readonly positive: "#35CC7F";
6
5
  readonly cm_positive_200: "#05944F";
7
- readonly white: "#ffffff";
6
+ readonly white: "#FFFFFF";
8
7
  readonly cm_blue_50: "#f1f6fe";
9
8
  readonly cm_grey_400: "#9999A8";
10
9
  readonly cm_grey_800: "#171721";
10
+ readonly cm_grey_150: "#E1E1E3";
11
11
  readonly cm_primary_blue: "#0061FF";
12
12
  readonly cm_blue_700: "#0042AD";
13
13
  readonly primary_100: "#D6E6FF";
@@ -22,7 +22,17 @@ export declare const COLORS: {
22
22
  readonly red_100: "#FFD1D1";
23
23
  readonly cm_turquoise_strong: "#1B7B88";
24
24
  readonly yellow_500: "#FFCE0A";
25
- readonly neutral_400: "#9999A8";
25
+ readonly neutral_75: " #F4F4F5";
26
+ readonly neutral_400: " #9999A8";
27
+ readonly neutral_500: "#515161";
28
+ readonly negative_700: "#B81400";
29
+ readonly cm_orange_800: "#A32700";
30
+ readonly purple_700: "#2B00A3";
31
+ readonly purple_100: "#DDD1FF";
32
+ readonly turquoise_100: "#D9F4F7";
33
+ readonly pink_100: "#FAD6DE";
34
+ readonly orange_100: "#FFDCD1";
35
+ readonly cm_positive_500: "#35CC7F";
26
36
  };
27
37
  export declare type Colors = typeof COLORS;
28
38
  //# sourceMappingURL=colors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/variables/colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;CAyBT,CAAC;AAEX,oBAAY,MAAM,GAAG,OAAO,MAAM,CAAC"}
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/variables/colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCT,CAAC;AAEX,oBAAY,MAAM,GAAG,OAAO,MAAM,CAAC"}
@@ -2,12 +2,12 @@ export const COLORS = {
2
2
  gray: '#EAEAEB',
3
3
  negative: '#ed3436',
4
4
  cm_negative_200: '#B81400',
5
- positive: '#35CC7F',
6
5
  cm_positive_200: '#05944F',
7
- white: '#ffffff',
6
+ white: '#FFFFFF',
8
7
  cm_blue_50: '#f1f6fe',
9
8
  cm_grey_400: '#9999A8',
10
9
  cm_grey_800: '#171721',
10
+ cm_grey_150: '#E1E1E3',
11
11
  cm_primary_blue: '#0061FF',
12
12
  cm_blue_700: '#0042AD',
13
13
  primary_100: '#D6E6FF',
@@ -22,6 +22,16 @@ export const COLORS = {
22
22
  red_100: '#FFD1D1',
23
23
  cm_turquoise_strong: '#1B7B88',
24
24
  yellow_500: '#FFCE0A',
25
- neutral_400: '#9999A8'
25
+ neutral_75: ' #F4F4F5',
26
+ neutral_400: ' #9999A8',
27
+ neutral_500: '#515161',
28
+ negative_700: '#B81400',
29
+ cm_orange_800: '#A32700',
30
+ purple_700: '#2B00A3',
31
+ purple_100: '#DDD1FF',
32
+ turquoise_100: '#D9F4F7',
33
+ pink_100: '#FAD6DE',
34
+ orange_100: '#FFDCD1',
35
+ cm_positive_500: '#35CC7F'
26
36
  };
27
37
  //# sourceMappingURL=colors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"colors.js","names":["COLORS","gray","negative","cm_negative_200","positive","cm_positive_200","white","cm_blue_50","cm_grey_400","cm_grey_800","cm_primary_blue","cm_blue_700","primary_100","primary_600","cm_grey_500","cm_grey_700","cm_yellow_400","brand","yellow_700","yellow_100","red_700","red_100","cm_turquoise_strong","yellow_500","neutral_400"],"sources":["../../src/variables/colors.ts"],"sourcesContent":["export const COLORS = {\n gray: '#EAEAEB',\n negative: '#ed3436',\n cm_negative_200: '#B81400',\n positive: '#35CC7F',\n cm_positive_200: '#05944F',\n white: '#ffffff',\n cm_blue_50: '#f1f6fe',\n cm_grey_400: '#9999A8',\n cm_grey_800: '#171721',\n cm_primary_blue: '#0061FF',\n cm_blue_700: '#0042AD',\n primary_100: '#D6E6FF',\n primary_600: '#0051D6',\n cm_grey_500: '#9999A8',\n cm_grey_700: '#1D1D2B',\n cm_yellow_400: '#bd7e00',\n brand: '#00B0FF',\n yellow_700: '#A38300',\n yellow_100: '#FFF9D1',\n red_700: '#A30000',\n red_100: '#FFD1D1',\n cm_turquoise_strong: '#1B7B88',\n yellow_500: '#FFCE0A',\n neutral_400: '#9999A8'\n} as const;\n\nexport type Colors = typeof COLORS;\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,IAAI,EAAE,SAAS;EACfC,QAAQ,EAAE,SAAS;EACnBC,eAAe,EAAE,SAAS;EAC1BC,QAAQ,EAAE,SAAS;EACnBC,eAAe,EAAE,SAAS;EAC1BC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,eAAe,EAAE,SAAS;EAC1BC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,SAAS;EACxBC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,mBAAmB,EAAE,SAAS;EAC9BC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE;AACf,CAAU","ignoreList":[]}
1
+ {"version":3,"file":"colors.js","names":["COLORS","gray","negative","cm_negative_200","cm_positive_200","white","cm_blue_50","cm_grey_400","cm_grey_800","cm_grey_150","cm_primary_blue","cm_blue_700","primary_100","primary_600","cm_grey_500","cm_grey_700","cm_yellow_400","brand","yellow_700","yellow_100","red_700","red_100","cm_turquoise_strong","yellow_500","neutral_75","neutral_400","neutral_500","negative_700","cm_orange_800","purple_700","purple_100","turquoise_100","pink_100","orange_100","cm_positive_500"],"sources":["../../src/variables/colors.ts"],"sourcesContent":["export const COLORS = {\n gray: '#EAEAEB',\n negative: '#ed3436',\n cm_negative_200: '#B81400',\n cm_positive_200: '#05944F',\n white: '#FFFFFF',\n cm_blue_50: '#f1f6fe',\n cm_grey_400: '#9999A8',\n cm_grey_800: '#171721',\n cm_grey_150: '#E1E1E3',\n cm_primary_blue: '#0061FF',\n cm_blue_700: '#0042AD',\n primary_100: '#D6E6FF',\n primary_600: '#0051D6',\n cm_grey_500: '#9999A8',\n cm_grey_700: '#1D1D2B',\n cm_yellow_400: '#bd7e00',\n brand: '#00B0FF',\n yellow_700: '#A38300',\n yellow_100: '#FFF9D1',\n red_700: '#A30000',\n red_100: '#FFD1D1',\n cm_turquoise_strong: '#1B7B88',\n yellow_500: '#FFCE0A',\n neutral_75: ' #F4F4F5',\n neutral_400: ' #9999A8',\n neutral_500: '#515161',\n negative_700: '#B81400',\n cm_orange_800: '#A32700',\n purple_700: '#2B00A3',\n purple_100: '#DDD1FF',\n turquoise_100: '#D9F4F7',\n pink_100: '#FAD6DE',\n orange_100: '#FFDCD1',\n cm_positive_500: '#35CC7F'\n} as const;\n\nexport type Colors = typeof COLORS;\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,IAAI,EAAE,SAAS;EACfC,QAAQ,EAAE,SAAS;EACnBC,eAAe,EAAE,SAAS;EAC1BC,eAAe,EAAE,SAAS;EAC1BC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,eAAe,EAAE,SAAS;EAC1BC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,SAAS;EACxBC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,mBAAmB,EAAE,SAAS;EAC9BC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,UAAU;EACtBC,WAAW,EAAE,UAAU;EACvBC,WAAW,EAAE,SAAS;EACtBC,YAAY,EAAE,SAAS;EACvBC,aAAa,EAAE,SAAS;EACxBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,aAAa,EAAE,SAAS;EACxBC,QAAQ,EAAE,SAAS;EACnBC,UAAU,EAAE,SAAS;EACrBC,eAAe,EAAE;AACnB,CAAU","ignoreList":[]}
@@ -21,7 +21,7 @@ const defaultTheme = {
21
21
  },
22
22
  cta: cm_primary_blue,
23
23
  negative: COLORS.negative,
24
- positive: COLORS.positive,
24
+ positive: COLORS.cm_positive_500,
25
25
  white: '#FFFFFF',
26
26
  black: '#14171A',
27
27
  battle: '#FFDE03',
@@ -1 +1 @@
1
- {"version":3,"file":"theme.native.js","names":["COLORS","HTML_ANCHOR_TEXT_COLOR","cm_primary_blue","defaultTheme","colors","border","gray","extra","lighter","light","lightMedium","medium","dark","extraDark","text","primary","secondary","cta","negative","positive","white","black","battle","notification","salmon","podcast","background","cm_grey_800","spacing","micro","tiny","small","base","large","xlarge","radius","common","card","regular","search","button","thumbnail","fontWeight","semiBold","bold","extraBold","fontSize","extraSmall","xxlarge","xxxlarge","letterSpacing","header"],"sources":["../../src/variables/theme.native.ts"],"sourcesContent":["import {TextStyle} from 'react-native';\nimport {COLORS} from './colors';\n\nexport type SpaceType = 'micro' | 'tiny' | 'small' | 'base' | 'medium' | 'large' | 'xlarge';\n\nexport const HTML_ANCHOR_TEXT_COLOR = '#002BDB';\n\nconst {cm_primary_blue} = COLORS;\n\nexport type Colors = {\n border: string;\n gray: {\n extra: string;\n light: string;\n lighter: string;\n lightMedium: string;\n medium: string;\n dark: string;\n extraDark: string;\n };\n podcast: {\n background: string;\n primary: string;\n };\n text: {\n primary: string;\n secondary: string;\n };\n cta: string;\n negative: string;\n positive: string;\n white: string;\n black: string;\n battle: string;\n notification: string;\n salmon: string;\n};\n\nexport type Theme = {\n colors: Colors;\n spacing: {\n micro: number;\n tiny: number;\n small: number;\n base: number;\n medium: number;\n large: number;\n xlarge: number;\n };\n radius: {\n button: number;\n common: number;\n card: number;\n medium: number;\n regular: number;\n search: number;\n thumbnail: number;\n };\n fontWeight: {\n regular: TextStyle['fontWeight'];\n semiBold: TextStyle['fontWeight'];\n bold: TextStyle['fontWeight'];\n extraBold: TextStyle['fontWeight'];\n };\n fontSize: {\n extraSmall: TextStyle['fontSize'];\n small: TextStyle['fontSize'];\n medium: TextStyle['fontSize'];\n regular: TextStyle['fontSize'];\n large: TextStyle['fontSize'];\n xlarge: TextStyle['fontSize'];\n xxlarge: TextStyle['fontSize'];\n xxxlarge: TextStyle['fontSize'];\n };\n letterSpacing: {\n header: number;\n };\n};\n\nconst defaultTheme: Theme = {\n colors: {\n border: 'rgba(0, 0, 0, 0.1)',\n gray: {\n extra: '#FAFAFA',\n lighter: '#F4F4F5',\n light: '#ededed',\n lightMedium: '#CFD8DC',\n medium: '#90A4AE',\n dark: '#546E7A',\n extraDark: '#323232'\n },\n text: {\n primary: '#06265B',\n secondary: '#FFFFFF'\n },\n cta: cm_primary_blue,\n negative: COLORS.negative,\n positive: COLORS.positive,\n white: '#FFFFFF',\n black: '#14171A',\n battle: '#FFDE03',\n notification: '#FF7043',\n salmon: '#FDE2E5',\n podcast: {\n background: COLORS.cm_grey_800,\n primary: '#FF541F'\n }\n },\n spacing: {\n micro: 4,\n tiny: 8,\n small: 16,\n base: 24,\n medium: 32,\n large: 48,\n xlarge: 64\n },\n radius: {\n common: 3,\n card: 5,\n regular: 8,\n medium: 12,\n search: 24,\n button: 32,\n thumbnail: 1000\n },\n fontWeight: {\n regular: '400',\n semiBold: '500',\n bold: '700',\n extraBold: '900'\n },\n fontSize: {\n extraSmall: 10,\n small: 12,\n medium: 13,\n regular: 15,\n large: 17,\n xlarge: 22,\n xxlarge: 28,\n xxxlarge: 40\n },\n letterSpacing: {\n header: 5\n }\n};\n\nexport default defaultTheme;\n"],"mappings":"AACA,SAAQA,MAAM,QAAO,UAAU;AAI/B,OAAO,MAAMC,sBAAsB,GAAG,SAAS;AAE/C,MAAM;EAACC;AAAe,CAAC,GAAGF,MAAM;AAwEhC,MAAMG,YAAmB,GAAG;EAC1BC,MAAM,EAAE;IACNC,MAAM,EAAE,oBAAoB;IAC5BC,IAAI,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,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVc,OAAO,EAAE,EAAE;IACXC,QAAQ,EAAE;EACZ,CAAC;EACDC,aAAa,EAAE;IACbC,MAAM,EAAE;EACV;AACF,CAAC;AAED,eAAehD,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"theme.native.js","names":["COLORS","HTML_ANCHOR_TEXT_COLOR","cm_primary_blue","defaultTheme","colors","border","gray","extra","lighter","light","lightMedium","medium","dark","extraDark","text","primary","secondary","cta","negative","positive","cm_positive_500","white","black","battle","notification","salmon","podcast","background","cm_grey_800","spacing","micro","tiny","small","base","large","xlarge","radius","common","card","regular","search","button","thumbnail","fontWeight","semiBold","bold","extraBold","fontSize","extraSmall","xxlarge","xxxlarge","letterSpacing","header"],"sources":["../../src/variables/theme.native.ts"],"sourcesContent":["import {TextStyle} from 'react-native';\nimport {COLORS} from './colors';\n\nexport type SpaceType = 'micro' | 'tiny' | 'small' | 'base' | 'medium' | 'large' | 'xlarge';\n\nexport const HTML_ANCHOR_TEXT_COLOR = '#002BDB';\n\nconst {cm_primary_blue} = COLORS;\n\nexport type Colors = {\n border: string;\n gray: {\n extra: string;\n light: string;\n lighter: string;\n lightMedium: string;\n medium: string;\n dark: string;\n extraDark: string;\n };\n podcast: {\n background: string;\n primary: string;\n };\n text: {\n primary: string;\n secondary: string;\n };\n cta: string;\n negative: string;\n positive: string;\n white: string;\n black: string;\n battle: string;\n notification: string;\n salmon: string;\n};\n\nexport type Theme = {\n colors: Colors;\n spacing: {\n micro: number;\n tiny: number;\n small: number;\n base: number;\n medium: number;\n large: number;\n xlarge: number;\n };\n radius: {\n button: number;\n common: number;\n card: number;\n medium: number;\n regular: number;\n search: number;\n thumbnail: number;\n };\n fontWeight: {\n regular: TextStyle['fontWeight'];\n semiBold: TextStyle['fontWeight'];\n bold: TextStyle['fontWeight'];\n extraBold: TextStyle['fontWeight'];\n };\n fontSize: {\n extraSmall: TextStyle['fontSize'];\n small: TextStyle['fontSize'];\n medium: TextStyle['fontSize'];\n regular: TextStyle['fontSize'];\n large: TextStyle['fontSize'];\n xlarge: TextStyle['fontSize'];\n xxlarge: TextStyle['fontSize'];\n xxxlarge: TextStyle['fontSize'];\n };\n letterSpacing: {\n header: number;\n };\n};\n\nconst defaultTheme: Theme = {\n colors: {\n border: 'rgba(0, 0, 0, 0.1)',\n gray: {\n extra: '#FAFAFA',\n lighter: '#F4F4F5',\n light: '#ededed',\n lightMedium: '#CFD8DC',\n medium: '#90A4AE',\n dark: '#546E7A',\n extraDark: '#323232'\n },\n text: {\n primary: '#06265B',\n secondary: '#FFFFFF'\n },\n cta: cm_primary_blue,\n negative: COLORS.negative,\n positive: COLORS.cm_positive_500,\n white: '#FFFFFF',\n black: '#14171A',\n battle: '#FFDE03',\n notification: '#FF7043',\n salmon: '#FDE2E5',\n podcast: {\n background: COLORS.cm_grey_800,\n primary: '#FF541F'\n }\n },\n spacing: {\n micro: 4,\n tiny: 8,\n small: 16,\n base: 24,\n medium: 32,\n large: 48,\n xlarge: 64\n },\n radius: {\n common: 3,\n card: 5,\n regular: 8,\n medium: 12,\n search: 24,\n button: 32,\n thumbnail: 1000\n },\n fontWeight: {\n regular: '400',\n semiBold: '500',\n bold: '700',\n extraBold: '900'\n },\n fontSize: {\n extraSmall: 10,\n small: 12,\n medium: 13,\n regular: 15,\n large: 17,\n xlarge: 22,\n xxlarge: 28,\n xxxlarge: 40\n },\n letterSpacing: {\n header: 5\n }\n};\n\nexport default defaultTheme;\n"],"mappings":"AACA,SAAQA,MAAM,QAAO,UAAU;AAI/B,OAAO,MAAMC,sBAAsB,GAAG,SAAS;AAE/C,MAAM;EAACC;AAAe,CAAC,GAAGF,MAAM;AAwEhC,MAAMG,YAAmB,GAAG;EAC1BC,MAAM,EAAE;IACNC,MAAM,EAAE,oBAAoB;IAC5BC,IAAI,EAAE;MACJC,KAAK,EAAE,SAAS;MAChBC,OAAO,EAAE,SAAS;MAClBC,KAAK,EAAE,SAAS;MAChBC,WAAW,EAAE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AAa,EAAE;IACbC,MAAM,EAAE;EACV;AACF,CAAC;AAED,eAAejD,YAAY","ignoreList":[]}
@@ -36,7 +36,7 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
36
36
  iconName: faIcon.name,
37
37
  iconColor: hovered && hoverColor ? hoverColor : faIcon.color ?? _icon.DEFAULT_ICON_COLOR,
38
38
  // eslint-disable-next-line no-nested-ternary
39
- backgroundColor: !faIcon?.backgroundColor ? 'transparent' : hovered && hoverBackgroundColor ? hoverBackgroundColor : faIcon.backgroundColor,
39
+ backgroundColor: !faIcon?.backgroundColor ? null : hovered && hoverBackgroundColor ? hoverBackgroundColor : faIcon.backgroundColor,
40
40
  size: {
41
41
  faSize: faIcon.size,
42
42
  wrapperSize: faIcon.size
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_link","_icon","_buttonIcons","_tooltip","_types","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","ICONS","createElement","className","style","buttonContent","label","iconComponent","iconName","name","iconColor","color","DEFAULT_ICON_COLOR","backgroundColor","size","faSize","wrapperSize","customStyle","theme","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","tooltipText","tooltipPlacement","link","onClick","_noop2","onKeyDown","useTitle","styleButton","classnames","button","iconButton","primary","secondary","tertiary","text","dangerous","setHovered","useState","handleOnClick","useCallback","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","TooltipContent","tooltipContentWrapper","renderToolTip","closeToolTipInformationTextAriaLabel","fontSize","anchorId","toolTipIsVisible","placement","_customStyle","useMemo","title","onMouseEnter","onMouseLeave","onMouseOver","tabIndex","propTypes","process","env","NODE_ENV","_default","exports"],"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, {DEFAULT_ICON_COLOR} from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\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\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: hovered && hoverColor ? hoverColor : faIcon.color ?? DEFAULT_ICON_COLOR,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? 'transparent'\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\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 tooltipText,\n tooltipPlacement = 'left',\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 !label && style.iconButton,\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(() => {\n setHovered(true);\n }, [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\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 hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n {...(ariaLabel && !label\n ? {\n 'data-for': 'button-icon',\n 'data-tip': hovered\n }\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 {renderToolTip()}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,MAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,MAAA,GAAAN,sBAAA,CAAAF,OAAA;AAAgC,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MA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iB;IAC/Be,QAAQ,EAAE,CAAE;IACZ1C,QAAQ,EAAEA;EAAS,IAElB/B,gBAAgB,CAACC,IAAI,EAAEC,OAAO,IAAIa,KAAK,EAAEZ,OAAO,EAAEC,oBAAoB,EAAEC,UAAU,CAAC,EACnFwD,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAEDjC,UAAU,CAAC8C,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,cAAS;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAnG,OAAA,GAElBgD,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_link","_icon","_buttonIcons","_tooltip","_types","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","ICONS","createElement","className","style","buttonContent","label","iconComponent","iconName","name","iconColor","color","DEFAULT_ICON_COLOR","backgroundColor","size","faSize","wrapperSize","customStyle","theme","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","tooltipText","tooltipPlacement","link","onClick","_noop2","onKeyDown","useTitle","styleButton","classnames","button","iconButton","primary","secondary","tertiary","text","dangerous","setHovered","useState","handleOnClick","useCallback","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","TooltipContent","tooltipContentWrapper","renderToolTip","closeToolTipInformationTextAriaLabel","fontSize","anchorId","toolTipIsVisible","placement","_customStyle","useMemo","title","onMouseEnter","onMouseLeave","onMouseOver","tabIndex","propTypes","process","env","NODE_ENV","_default","exports"],"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, {DEFAULT_ICON_COLOR, IconProps} from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\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\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: hovered && hoverColor ? hoverColor : faIcon.color ?? DEFAULT_ICON_COLOR,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? null\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n } as IconProps)}\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 tooltipText,\n tooltipPlacement = 'left',\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 !label && style.iconButton,\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(() => {\n setHovered(true);\n }, [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\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 hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n {...(ariaLabel && !label\n ? {\n 'data-for': 'button-icon',\n 'data-tip': hovered\n }\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 {renderToolTip()}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,MAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,MAAA,GAAAN,sBAAA,CAAAF,OAAA;AAAgC,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB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EZ,OAAO,EAAEC,oBAAoB,EAAEC,UAAU,CAAC,EACnFwD,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAEDjC,UAAU,CAAC8C,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,cAAS;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAnG,OAAA,GAElBgD,UAAU","ignoreList":[]}
@@ -22,7 +22,7 @@
22
22
  align-items: center;
23
23
  cursor: pointer;
24
24
  border: none;
25
- padding: 0px 16px;
25
+ padding: 12px 16px;
26
26
  /* prevents text selection when dragging
27
27
  the mouse over the button */
28
28
  user-select: none;
@@ -39,6 +39,7 @@
39
39
  }
40
40
 
41
41
  .buttonContent {
42
+ gap: 8px;
42
43
  display: flex;
43
44
  justify-content: center;
44
45
  align-items: center;
@@ -55,7 +56,6 @@
55
56
  }
56
57
 
57
58
  .label {
58
- margin: 0 8px 0 8px;
59
59
  text-wrap: nowrap;
60
60
  display: block;
61
61
  }
@@ -1,22 +1,40 @@
1
- export const DEFAULT_ICON_COLOR: "hsl(0, 0%, 32%)";
2
- export function getForegroundColor(backgroundColor: any): any;
3
- export namespace iconPropTypes {
4
- const iconName: PropTypes.Validator<string>;
5
- const iconColor: PropTypes.Requireable<string>;
6
- const backgroundColor: PropTypes.Requireable<string>;
7
- const gradientBackground: PropTypes.Requireable<boolean>;
8
- const borderRadius: PropTypes.Requireable<string>;
9
- const preset: PropTypes.Requireable<string>;
10
- const size: PropTypes.Requireable<PropTypes.InferProps<{
11
- faSize: PropTypes.Requireable<number>;
12
- wrapperSize: PropTypes.Requireable<number>;
1
+ import React, { CSSProperties } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ export declare const DEFAULT_PRESET = "m";
4
+ export declare const ICON_LUMINOSITY = 32;
5
+ export declare const DEFAULT_WRAPPER_SIZE = 40;
6
+ export declare const ICON_PADDING = 8;
7
+ export declare const DEFAULT_ICON_COLOR = "hsl(0, 0%, 32%)";
8
+ export interface IconSize {
9
+ faSize: number;
10
+ wrapperSize: number;
11
+ }
12
+ export interface IconProps {
13
+ iconName: string;
14
+ iconColor?: string;
15
+ backgroundColor?: string;
16
+ gradientBackground?: boolean;
17
+ borderRadius?: string;
18
+ preset?: string;
19
+ size?: IconSize;
20
+ customStyle?: CSSProperties;
21
+ }
22
+ export declare function getForegroundColor(backgroundColor: string): string;
23
+ declare const Icon: React.FC<IconProps>;
24
+ export declare const propTypes: {
25
+ iconName: PropTypes.Validator<string>;
26
+ iconColor: PropTypes.Requireable<string>;
27
+ backgroundColor: PropTypes.Requireable<string>;
28
+ gradientBackground: PropTypes.Requireable<boolean>;
29
+ borderRadius: PropTypes.Requireable<string>;
30
+ preset: PropTypes.Requireable<string>;
31
+ size: PropTypes.Requireable<PropTypes.InferProps<{
32
+ faSize: PropTypes.Validator<number>;
33
+ wrapperSize: PropTypes.Validator<number>;
13
34
  }>>;
14
- const customStyle: PropTypes.Requireable<{
35
+ customStyle: PropTypes.Requireable<{
15
36
  [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
16
37
  }>;
17
- }
38
+ };
18
39
  export default Icon;
19
- import PropTypes from "prop-types";
20
- declare const Icon: React.NamedExoticComponent<object>;
21
- import React from "react";
22
40
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.js"],"names":[],"mappings":"AAkBA,mDAAoD;AAiB7C,8DAC8D;;;;;;;;;;;;;;;;;;AAGrE,uDAsCG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAC3C,OAAO,SAAS,MAAM,YAAY,CAAC;AAanC,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,kBAAkB,oBAAoB,CAAC;AAEpD,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B;AAED,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAElE;AAiBD,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAiD7B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;CAYrB,CAAC;AAUF,eAAe,IAAI,CAAC"}
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.iconPropTypes = exports.getForegroundColor = exports.default = exports.DEFAULT_ICON_COLOR = void 0;
4
+ exports.default = exports.ICON_PADDING = exports.ICON_LUMINOSITY = exports.DEFAULT_WRAPPER_SIZE = exports.DEFAULT_PRESET = exports.DEFAULT_ICON_COLOR = void 0;
5
+ exports.getForegroundColor = getForegroundColor;
6
+ exports.propTypes = void 0;
5
7
  var _react = _interopRequireDefault(require("react"));
6
- var _propTypes = _interopRequireWildcard(require("prop-types"));
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
7
9
  var _reactFontawesome = require("@fortawesome/react-fontawesome");
8
10
  var _proSolidSvgIcons = require("@fortawesome/pro-solid-svg-icons");
9
11
  var _fontawesomeSvgCore = require("@fortawesome/fontawesome-svg-core");
@@ -13,15 +15,16 @@ var _getOr = _interopRequireDefault(require("lodash/fp/getOr"));
13
15
  var _cssColorFunction = require("css-color-function");
14
16
  var _getBackgroundGradientColor = require("../../util/get-background-gradient-color");
15
17
  var _style = _interopRequireDefault(require("./style.css"));
16
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
17
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
19
  _fontawesomeSvgCore.library.add(_proSolidSvgIcons.fas);
20
- const DEFAULT_PRESET = 'm';
21
- const ICON_LUMINOSITY = 32;
22
- const DEFAULT_WRAPPER_SIZE = 40;
23
- const ICON_PADDING = 8;
20
+ const DEFAULT_PRESET = exports.DEFAULT_PRESET = 'm';
21
+ const ICON_LUMINOSITY = exports.ICON_LUMINOSITY = 32;
22
+ const DEFAULT_WRAPPER_SIZE = exports.DEFAULT_WRAPPER_SIZE = 40;
23
+ const ICON_PADDING = exports.ICON_PADDING = 8;
24
24
  const DEFAULT_ICON_COLOR = exports.DEFAULT_ICON_COLOR = 'hsl(0, 0%, 32%)';
25
+ function getForegroundColor(backgroundColor) {
26
+ return (0, _cssColorFunction.convert)(`color(${backgroundColor} lightness(${ICON_LUMINOSITY}%))`);
27
+ }
25
28
  const SIZE_CONFIGS = {
26
29
  s: {
27
30
  faSize: 12,
@@ -36,10 +39,7 @@ const SIZE_CONFIGS = {
36
39
  wrapperSize: 48
37
40
  }
38
41
  };
39
- const getForegroundColor = backgroundColor => (0, _cssColorFunction.convert)(`color(${backgroundColor} lightness(${ICON_LUMINOSITY}%))`);
40
- // set lightness to 32%
41
- exports.getForegroundColor = getForegroundColor;
42
- const Icon = /*#__PURE__*/_react.default.memo(function Icon({
42
+ const Icon = ({
43
43
  iconName,
44
44
  iconColor,
45
45
  backgroundColor,
@@ -48,9 +48,18 @@ const Icon = /*#__PURE__*/_react.default.memo(function Icon({
48
48
  preset = DEFAULT_PRESET,
49
49
  size,
50
50
  customStyle
51
- }) {
51
+ }) => {
52
52
  const effectiveIconColor = iconColor || (backgroundColor ? getForegroundColor(backgroundColor) : DEFAULT_ICON_COLOR);
53
53
  const effectiveSize = size ? (0, _merge.default)(SIZE_CONFIGS[DEFAULT_PRESET], size) : (0, _getOr.default)(SIZE_CONFIGS[DEFAULT_PRESET], (0, _toLower.default)(preset), SIZE_CONFIGS);
54
+ const hasBackground = backgroundColor || gradientBackground;
55
+ if (!hasBackground) {
56
+ return /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
57
+ icon: `fa-${iconName}`,
58
+ color: effectiveIconColor,
59
+ fontSize: effectiveSize.faSize,
60
+ style: customStyle
61
+ });
62
+ }
54
63
  const wrapperSize = effectiveSize.wrapperSize - ICON_PADDING * 2;
55
64
  const iconWrapperStyle = {
56
65
  background: gradientBackground ? (0, _getBackgroundGradientColor.createGradientBackground)(effectiveIconColor, '81%', '91%') : backgroundColor,
@@ -70,8 +79,8 @@ const Icon = /*#__PURE__*/_react.default.memo(function Icon({
70
79
  color: effectiveIconColor,
71
80
  fontSize: effectiveSize.faSize
72
81
  }));
73
- });
74
- const iconPropTypes = exports.iconPropTypes = {
82
+ };
83
+ const propTypes = exports.propTypes = {
75
84
  iconName: _propTypes.default.string.isRequired,
76
85
  iconColor: _propTypes.default.string,
77
86
  backgroundColor: _propTypes.default.string,
@@ -79,11 +88,18 @@ const iconPropTypes = exports.iconPropTypes = {
79
88
  borderRadius: _propTypes.default.string,
80
89
  preset: _propTypes.default.oneOf(['s', 'm', 'xl']),
81
90
  size: _propTypes.default.shape({
82
- faSize: _propTypes.number,
83
- wrapperSize: _propTypes.default.number
91
+ faSize: _propTypes.default.number.isRequired,
92
+ wrapperSize: _propTypes.default.number.isRequired
84
93
  }),
85
94
  customStyle: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]))
86
95
  };
87
- Icon.propTypes = process.env.NODE_ENV !== "production" ? iconPropTypes : {};
96
+
97
+ // const MemoizedIcon = React.memo(Icon) as React.MemoExoticComponent<React.FC<IconProps>> & {
98
+ // propTypes?: React.WeakValidationMap<IconProps>;
99
+ // defaultProps?: Partial<IconProps>;
100
+ // };
101
+
102
+ Icon.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
103
+ // MemoizedIcon.propTypes = Icon.propTypes;
88
104
  var _default = exports.default = Icon;
89
105
  //# sourceMappingURL=index.js.map