@coorpacademy/components 10.1.2 → 10.1.3

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 (228) hide show
  1. package/es/atom/button-link/index.js +106 -0
  2. package/es/atom/button-link/index.js.map +1 -0
  3. package/es/atom/button-link/style.css +97 -0
  4. package/es/atom/button-link/test/fixtures/button-dangerous-no-icon.js +10 -0
  5. package/es/atom/button-link/test/fixtures/button-dangerous-no-icon.js.map +1 -0
  6. package/es/atom/button-link/test/fixtures/button-primary-icon-left.js +14 -0
  7. package/es/atom/button-link/test/fixtures/button-primary-icon-left.js.map +1 -0
  8. package/es/atom/button-link/test/fixtures/button-primary-no-icon.js +10 -0
  9. package/es/atom/button-link/test/fixtures/button-primary-no-icon.js.map +1 -0
  10. package/es/atom/button-link/test/fixtures/button-secondary-no-icon-disabled.js +11 -0
  11. package/es/atom/button-link/test/fixtures/button-secondary-no-icon-disabled.js.map +1 -0
  12. package/es/atom/button-link/test/fixtures/button-tertiary-icon-left.js +14 -0
  13. package/es/atom/button-link/test/fixtures/button-tertiary-icon-left.js.map +1 -0
  14. package/es/atom/button-link/test/fixtures/icon-button.js +13 -0
  15. package/es/atom/button-link/test/fixtures/icon-button.js.map +1 -0
  16. package/es/atom/button-link/test/fixtures/link-primary-disabled-icon-right.js +17 -0
  17. package/es/atom/button-link/test/fixtures/link-primary-disabled-icon-right.js.map +1 -0
  18. package/es/atom/button-link/test/fixtures/link-secondary-icon-right.js +20 -0
  19. package/es/atom/button-link/test/fixtures/link-secondary-icon-right.js.map +1 -0
  20. package/es/atom/button-link/test/fixtures/link-tertiary-no-icon.js +16 -0
  21. package/es/atom/button-link/test/fixtures/link-tertiary-no-icon.js.map +1 -0
  22. package/es/atom/button-link/test/fixtures/link-text-icon-right-target-blank.js +17 -0
  23. package/es/atom/button-link/test/fixtures/link-text-icon-right-target-blank.js.map +1 -0
  24. package/es/atom/button-link/test/fixtures/link-text-no-icon-download.js +13 -0
  25. package/es/atom/button-link/test/fixtures/link-text-no-icon-download.js.map +1 -0
  26. package/es/atom/input-checkbox/test/fixtures.js +2 -0
  27. package/es/atom/input-checkbox/test/fixtures.js.map +1 -1
  28. package/es/atom/input-search/index.js +65 -0
  29. package/es/atom/input-search/index.js.map +1 -0
  30. package/es/atom/input-search/style.css +201 -0
  31. package/es/{molecule/search → atom/input-search}/test/change.js +0 -0
  32. package/es/atom/input-search/test/change.js.map +1 -0
  33. package/es/atom/input-search/test/fixtures/coorpmanager-with-value.js +14 -0
  34. package/es/atom/input-search/test/fixtures/coorpmanager-with-value.js.map +1 -0
  35. package/es/atom/input-search/test/fixtures/coorpmanager.js +13 -0
  36. package/es/atom/input-search/test/fixtures/coorpmanager.js.map +1 -0
  37. package/es/{molecule/search → atom/input-search}/test/fixtures/default.js +0 -0
  38. package/es/atom/input-search/test/fixtures/default.js.map +1 -0
  39. package/es/{molecule/search → atom/input-search}/test/fixtures/with-value.js +0 -0
  40. package/es/atom/input-search/test/fixtures/with-value.js.map +1 -0
  41. package/es/atom/tag/index.js +27 -0
  42. package/es/atom/tag/index.js.map +1 -0
  43. package/es/atom/tag/style.css +38 -0
  44. package/es/atom/tag/test/fixtures/archived.js +7 -0
  45. package/es/atom/tag/test/fixtures/archived.js.map +1 -0
  46. package/es/atom/tag/test/fixtures/default.js +7 -0
  47. package/es/atom/tag/test/fixtures/default.js.map +1 -0
  48. package/es/atom/tag/test/fixtures/published.js +7 -0
  49. package/es/atom/tag/test/fixtures/published.js.map +1 -0
  50. package/es/atom/tag/test/fixtures/revision.js +7 -0
  51. package/es/atom/tag/test/fixtures/revision.js.map +1 -0
  52. package/es/atom/title/test/fixtures.js +6 -2
  53. package/es/atom/title/test/fixtures.js.map +1 -1
  54. package/es/molecule/banner/style.css +3 -3
  55. package/es/molecule/cm-popin/index.js +21 -15
  56. package/es/molecule/cm-popin/index.js.map +1 -1
  57. package/es/molecule/cm-popin/style.css +2 -44
  58. package/es/molecule/cm-popin/test/fixtures/dangerous.js +3 -0
  59. package/es/molecule/cm-popin/test/fixtures/dangerous.js.map +1 -1
  60. package/es/molecule/cm-popin/test/fixtures/default.js +6 -3
  61. package/es/molecule/cm-popin/test/fixtures/default.js.map +1 -1
  62. package/es/molecule/cm-popin/test/fixtures/warning-with-close.js +4 -1
  63. package/es/molecule/cm-popin/test/fixtures/warning-with-close.js.map +1 -1
  64. package/es/molecule/coorp-manager-roles/test/fixtures.js +13 -0
  65. package/es/molecule/coorp-manager-roles/test/fixtures.js.map +1 -0
  66. package/es/molecule/feedback/test/fixtures.js +2 -0
  67. package/es/molecule/feedback/test/fixtures.js.map +1 -1
  68. package/es/molecule/quick-access-card/test/fixtures.js +21 -0
  69. package/es/molecule/quick-access-card/test/fixtures.js.map +1 -0
  70. package/es/molecule/quick-access-cards-group/test/fixtures.js +21 -0
  71. package/es/molecule/quick-access-cards-group/test/fixtures.js.map +1 -0
  72. package/es/molecule/search-form/index.js +1 -1
  73. package/es/molecule/search-form/index.js.map +1 -1
  74. package/es/molecule/wizard-summary/index.js +18 -10
  75. package/es/molecule/wizard-summary/index.js.map +1 -1
  76. package/es/molecule/wizard-summary/style.css +4 -21
  77. package/es/molecule/wizard-summary/test/fixtures/default.js +2 -1
  78. package/es/molecule/wizard-summary/test/fixtures/default.js.map +1 -1
  79. package/es/molecule/wizard-summary/test/fixtures/one-section.js +2 -1
  80. package/es/molecule/wizard-summary/test/fixtures/one-section.js.map +1 -1
  81. package/es/molecule/wizard-summary/test/fixtures/tablet-closed.js +2 -1
  82. package/es/molecule/wizard-summary/test/fixtures/tablet-closed.js.map +1 -1
  83. package/es/molecule/wizard-summary/test/fixtures/three-sections.js +2 -1
  84. package/es/molecule/wizard-summary/test/fixtures/three-sections.js.map +1 -1
  85. package/es/molecule/wizard-summary/test/fixtures/two-sections.js +2 -1
  86. package/es/molecule/wizard-summary/test/fixtures/two-sections.js.map +1 -1
  87. package/es/organism/accordion/coorp-manager/part/test/fixtures.js +4 -0
  88. package/es/organism/accordion/coorp-manager/part/test/fixtures.js.map +1 -1
  89. package/es/organism/brand-dashboard/test/fixtures.js +2 -0
  90. package/es/organism/brand-dashboard/test/fixtures.js.map +1 -1
  91. package/es/organism/brand-table/index.js +1 -1
  92. package/es/organism/brand-table/index.js.map +1 -1
  93. package/es/organism/mooc-header/index.js +1 -1
  94. package/es/organism/mooc-header/index.js.map +1 -1
  95. package/es/organism/mooc-header/test/fixtures/default.js +1 -1
  96. package/es/organism/mooc-header/test/fixtures/default.js.map +1 -1
  97. package/es/organism/mooc-header/test/fixtures/logged-with-battle-notifications.js +1 -1
  98. package/es/organism/mooc-header/test/fixtures/logged-with-battle-notifications.js.map +1 -1
  99. package/es/template/app-player/popin-end/test/fixtures.js +2 -0
  100. package/es/template/app-player/popin-end/test/fixtures.js.map +1 -1
  101. package/es/template/back-office/brand-list/index.js +6 -2
  102. package/es/template/back-office/brand-list/index.js.map +1 -1
  103. package/es/template/back-office/brand-list/style.css +1 -0
  104. package/es/template/back-office/brand-update/test/fixtures.js +2 -2
  105. package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
  106. package/es/variables/colors.css +0 -2
  107. package/lib/atom/button-link/index.js +123 -0
  108. package/lib/atom/button-link/index.js.map +1 -0
  109. package/lib/atom/button-link/style.css +97 -0
  110. package/lib/atom/button-link/test/fixtures/button-dangerous-no-icon.js +15 -0
  111. package/lib/atom/button-link/test/fixtures/button-dangerous-no-icon.js.map +1 -0
  112. package/lib/atom/button-link/test/fixtures/button-primary-icon-left.js +19 -0
  113. package/lib/atom/button-link/test/fixtures/button-primary-icon-left.js.map +1 -0
  114. package/lib/atom/button-link/test/fixtures/button-primary-no-icon.js +15 -0
  115. package/lib/atom/button-link/test/fixtures/button-primary-no-icon.js.map +1 -0
  116. package/lib/atom/button-link/test/fixtures/button-secondary-no-icon-disabled.js +16 -0
  117. package/lib/atom/button-link/test/fixtures/button-secondary-no-icon-disabled.js.map +1 -0
  118. package/lib/atom/button-link/test/fixtures/button-tertiary-icon-left.js +19 -0
  119. package/lib/atom/button-link/test/fixtures/button-tertiary-icon-left.js.map +1 -0
  120. package/lib/atom/button-link/test/fixtures/icon-button.js +18 -0
  121. package/lib/atom/button-link/test/fixtures/icon-button.js.map +1 -0
  122. package/lib/atom/button-link/test/fixtures/link-primary-disabled-icon-right.js +22 -0
  123. package/lib/atom/button-link/test/fixtures/link-primary-disabled-icon-right.js.map +1 -0
  124. package/lib/atom/button-link/test/fixtures/link-secondary-icon-right.js +25 -0
  125. package/lib/atom/button-link/test/fixtures/link-secondary-icon-right.js.map +1 -0
  126. package/lib/atom/button-link/test/fixtures/link-tertiary-no-icon.js +21 -0
  127. package/lib/atom/button-link/test/fixtures/link-tertiary-no-icon.js.map +1 -0
  128. package/lib/atom/button-link/test/fixtures/link-text-icon-right-target-blank.js +22 -0
  129. package/lib/atom/button-link/test/fixtures/link-text-icon-right-target-blank.js.map +1 -0
  130. package/lib/atom/button-link/test/fixtures/link-text-no-icon-download.js +18 -0
  131. package/lib/atom/button-link/test/fixtures/link-text-no-icon-download.js.map +1 -0
  132. package/lib/atom/input-checkbox/test/fixtures.js +3 -0
  133. package/lib/atom/input-checkbox/test/fixtures.js.map +1 -1
  134. package/lib/{molecule/search → atom/input-search}/index.js +29 -18
  135. package/lib/atom/input-search/index.js.map +1 -0
  136. package/lib/atom/input-search/style.css +201 -0
  137. package/lib/{molecule/search → atom/input-search}/test/change.js +0 -0
  138. package/lib/atom/input-search/test/change.js.map +1 -0
  139. package/lib/atom/input-search/test/fixtures/coorpmanager-with-value.js +19 -0
  140. package/lib/atom/input-search/test/fixtures/coorpmanager-with-value.js.map +1 -0
  141. package/lib/atom/input-search/test/fixtures/coorpmanager.js +18 -0
  142. package/lib/atom/input-search/test/fixtures/coorpmanager.js.map +1 -0
  143. package/lib/{molecule/search → atom/input-search}/test/fixtures/default.js +0 -0
  144. package/lib/atom/input-search/test/fixtures/default.js.map +1 -0
  145. package/lib/{molecule/search → atom/input-search}/test/fixtures/with-value.js +0 -0
  146. package/lib/atom/input-search/test/fixtures/with-value.js.map +1 -0
  147. package/lib/atom/tag/index.js +39 -0
  148. package/lib/atom/tag/index.js.map +1 -0
  149. package/lib/atom/tag/style.css +38 -0
  150. package/lib/atom/tag/test/fixtures/archived.js +12 -0
  151. package/lib/atom/tag/test/fixtures/archived.js.map +1 -0
  152. package/lib/atom/tag/test/fixtures/default.js +12 -0
  153. package/lib/atom/tag/test/fixtures/default.js.map +1 -0
  154. package/lib/atom/tag/test/fixtures/published.js +12 -0
  155. package/lib/atom/tag/test/fixtures/published.js.map +1 -0
  156. package/lib/atom/tag/test/fixtures/revision.js +12 -0
  157. package/lib/atom/tag/test/fixtures/revision.js.map +1 -0
  158. package/lib/atom/title/test/fixtures.js +8 -2
  159. package/lib/atom/title/test/fixtures.js.map +1 -1
  160. package/lib/molecule/banner/style.css +3 -3
  161. package/lib/molecule/cm-popin/index.js +21 -16
  162. package/lib/molecule/cm-popin/index.js.map +1 -1
  163. package/lib/molecule/cm-popin/style.css +2 -44
  164. package/lib/molecule/cm-popin/test/fixtures/dangerous.js +3 -0
  165. package/lib/molecule/cm-popin/test/fixtures/dangerous.js.map +1 -1
  166. package/lib/molecule/cm-popin/test/fixtures/default.js +6 -3
  167. package/lib/molecule/cm-popin/test/fixtures/default.js.map +1 -1
  168. package/lib/molecule/cm-popin/test/fixtures/warning-with-close.js +4 -1
  169. package/lib/molecule/cm-popin/test/fixtures/warning-with-close.js.map +1 -1
  170. package/lib/molecule/coorp-manager-roles/test/fixtures.js +22 -0
  171. package/lib/molecule/coorp-manager-roles/test/fixtures.js.map +1 -0
  172. package/lib/molecule/feedback/test/fixtures.js +3 -0
  173. package/lib/molecule/feedback/test/fixtures.js.map +1 -1
  174. package/lib/molecule/quick-access-card/test/fixtures.js +34 -0
  175. package/lib/molecule/quick-access-card/test/fixtures.js.map +1 -0
  176. package/lib/molecule/quick-access-cards-group/test/fixtures.js +34 -0
  177. package/lib/molecule/quick-access-cards-group/test/fixtures.js.map +1 -0
  178. package/lib/molecule/search-form/index.js +3 -3
  179. package/lib/molecule/search-form/index.js.map +1 -1
  180. package/lib/molecule/wizard-summary/index.js +18 -10
  181. package/lib/molecule/wizard-summary/index.js.map +1 -1
  182. package/lib/molecule/wizard-summary/style.css +4 -21
  183. package/lib/molecule/wizard-summary/test/fixtures/default.js +2 -1
  184. package/lib/molecule/wizard-summary/test/fixtures/default.js.map +1 -1
  185. package/lib/molecule/wizard-summary/test/fixtures/one-section.js +2 -1
  186. package/lib/molecule/wizard-summary/test/fixtures/one-section.js.map +1 -1
  187. package/lib/molecule/wizard-summary/test/fixtures/tablet-closed.js +2 -1
  188. package/lib/molecule/wizard-summary/test/fixtures/tablet-closed.js.map +1 -1
  189. package/lib/molecule/wizard-summary/test/fixtures/three-sections.js +2 -1
  190. package/lib/molecule/wizard-summary/test/fixtures/three-sections.js.map +1 -1
  191. package/lib/molecule/wizard-summary/test/fixtures/two-sections.js +2 -1
  192. package/lib/molecule/wizard-summary/test/fixtures/two-sections.js.map +1 -1
  193. package/lib/organism/accordion/coorp-manager/part/test/fixtures.js +6 -0
  194. package/lib/organism/accordion/coorp-manager/part/test/fixtures.js.map +1 -1
  195. package/lib/organism/brand-dashboard/test/fixtures.js +3 -0
  196. package/lib/organism/brand-dashboard/test/fixtures.js.map +1 -1
  197. package/lib/organism/brand-table/index.js +3 -3
  198. package/lib/organism/brand-table/index.js.map +1 -1
  199. package/lib/organism/mooc-header/index.js +2 -2
  200. package/lib/organism/mooc-header/index.js.map +1 -1
  201. package/lib/organism/mooc-header/test/fixtures/default.js +1 -1
  202. package/lib/organism/mooc-header/test/fixtures/default.js.map +1 -1
  203. package/lib/organism/mooc-header/test/fixtures/logged-with-battle-notifications.js +1 -1
  204. package/lib/organism/mooc-header/test/fixtures/logged-with-battle-notifications.js.map +1 -1
  205. package/lib/template/app-player/popin-end/test/fixtures.js +3 -0
  206. package/lib/template/app-player/popin-end/test/fixtures.js.map +1 -1
  207. package/lib/template/back-office/brand-list/index.js +7 -3
  208. package/lib/template/back-office/brand-list/index.js.map +1 -1
  209. package/lib/template/back-office/brand-list/style.css +1 -0
  210. package/lib/template/back-office/brand-update/test/fixtures.js +3 -3
  211. package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
  212. package/lib/variables/colors.css +0 -2
  213. package/package.json +3 -3
  214. package/es/atom/bullet-point-menu-button/test/fixtures.js +0 -27
  215. package/es/atom/bullet-point-menu-button/test/fixtures.js.map +0 -1
  216. package/es/molecule/search/index.js +0 -57
  217. package/es/molecule/search/index.js.map +0 -1
  218. package/es/molecule/search/style.css +0 -86
  219. package/es/molecule/search/test/change.js.map +0 -1
  220. package/es/molecule/search/test/fixtures/default.js.map +0 -1
  221. package/es/molecule/search/test/fixtures/with-value.js.map +0 -1
  222. package/lib/atom/bullet-point-menu-button/test/fixtures.js +0 -43
  223. package/lib/atom/bullet-point-menu-button/test/fixtures.js.map +0 -1
  224. package/lib/molecule/search/index.js.map +0 -1
  225. package/lib/molecule/search/style.css +0 -86
  226. package/lib/molecule/search/test/change.js.map +0 -1
  227. package/lib/molecule/search/test/fixtures/default.js.map +0 -1
  228. package/lib/molecule/search/test/fixtures/with-value.js.map +0 -1
@@ -0,0 +1,106 @@
1
+ import _getOr from "lodash/fp/getOr";
2
+
3
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+
5
+ import React, { useMemo } from 'react';
6
+ import PropTypes from 'prop-types';
7
+ import classnames from 'classnames';
8
+ import { NovaCompositionNavigationArrowLeft as ChevronLeftIcon, NovaCompositionNavigationArrowRight as ChevronRightIcon, NovaCompositionCoorpacademyEye as EyeIcon, NovaCompositionCoorpacademyAnalytics as AnalyticsIcon, NovaCompositionCoorpacademyNext as CloseIcon, NovaSolidComputersSdCard as SaveIcon } from '@coorpacademy/nova-icons';
9
+ import Link from '../link';
10
+ import style from './style.css';
11
+ const ICONS = {
12
+ analytics: AnalyticsIcon,
13
+ 'chevron-left': ChevronLeftIcon,
14
+ 'chevron-right': ChevronRightIcon,
15
+ close: CloseIcon,
16
+ save: SaveIcon,
17
+ see: EyeIcon
18
+ };
19
+
20
+ const getButtonContent = (icon, label) => {
21
+ const {
22
+ type,
23
+ position
24
+ } = icon;
25
+
26
+ const Icon = _getOr(null, type, ICONS);
27
+
28
+ if (!Icon) {
29
+ return /*#__PURE__*/React.createElement("div", {
30
+ className: style.buttonContent
31
+ }, /*#__PURE__*/React.createElement("span", {
32
+ className: style.label
33
+ }, label));
34
+ }
35
+
36
+ if (position === 'center' && Icon) {
37
+ return /*#__PURE__*/React.createElement("div", {
38
+ className: style.buttonContent
39
+ }, /*#__PURE__*/React.createElement(Icon, {
40
+ className: style.icon
41
+ }));
42
+ }
43
+
44
+ return /*#__PURE__*/React.createElement("div", {
45
+ className: style.buttonContent
46
+ }, position === 'left' ? /*#__PURE__*/React.createElement(Icon, {
47
+ className: style.icon
48
+ }) : null, /*#__PURE__*/React.createElement("span", {
49
+ className: style.label
50
+ }, label), position === 'right' ? /*#__PURE__*/React.createElement(Icon, {
51
+ className: style.icon
52
+ }) : null);
53
+ };
54
+
55
+ const ButtonLink = props => {
56
+ const {
57
+ type,
58
+ label,
59
+ disabled,
60
+ icon = {},
61
+ 'data-name': dataName,
62
+ 'aria-label': ariaLabel,
63
+ link,
64
+ onClick
65
+ } = props;
66
+ const contentView = getButtonContent(icon, label);
67
+ const styleButton = classnames(style.button, type === 'primary' && style.primary, type === 'secondary' && style.secondary, type === 'tertiary' && style.tertiary, type === 'text' && style.text, type === 'dangerous' && style.dangerous, link && style.link, disabled && style.disabled);
68
+
69
+ if (link) {
70
+ return /*#__PURE__*/React.createElement(Link, _extends({}, link, {
71
+ className: styleButton,
72
+ "data-name": dataName,
73
+ "aria-label": ariaLabel || label,
74
+ title: ariaLabel || label
75
+ }), contentView);
76
+ }
77
+
78
+ const handleOnClick = useMemo(() => () => onClick(), [onClick]);
79
+ return /*#__PURE__*/React.createElement("button", {
80
+ type: "button",
81
+ "aria-label": ariaLabel || label,
82
+ title: ariaLabel || label,
83
+ className: styleButton,
84
+ onClick: handleOnClick
85
+ }, contentView);
86
+ };
87
+
88
+ ButtonLink.propTypes = process.env.NODE_ENV !== "production" ? {
89
+ type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),
90
+ label: PropTypes.string,
91
+ 'aria-label': PropTypes.string,
92
+ 'data-name': PropTypes.string,
93
+ icon: PropTypes.shape({
94
+ position: PropTypes.oneOf(['right', 'left', 'center']),
95
+ type: PropTypes.string
96
+ }),
97
+ onClick: PropTypes.func,
98
+ link: PropTypes.shape({
99
+ href: PropTypes.string,
100
+ download: PropTypes.bool,
101
+ target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])
102
+ }),
103
+ disabled: PropTypes.bool
104
+ } : {};
105
+ export default ButtonLink;
106
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/atom/button-link/index.js"],"names":["React","useMemo","PropTypes","classnames","NovaCompositionNavigationArrowLeft","ChevronLeftIcon","NovaCompositionNavigationArrowRight","ChevronRightIcon","NovaCompositionCoorpacademyEye","EyeIcon","NovaCompositionCoorpacademyAnalytics","AnalyticsIcon","NovaCompositionCoorpacademyNext","CloseIcon","NovaSolidComputersSdCard","SaveIcon","Link","style","ICONS","analytics","close","save","see","getButtonContent","icon","label","type","position","Icon","buttonContent","ButtonLink","props","disabled","dataName","ariaLabel","link","onClick","contentView","styleButton","button","primary","secondary","tertiary","text","dangerous","handleOnClick","propTypes","oneOf","string","shape","func","href","download","bool","target"],"mappings":"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","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {\n NovaCompositionNavigationArrowLeft as ChevronLeftIcon,\n NovaCompositionNavigationArrowRight as ChevronRightIcon,\n NovaCompositionCoorpacademyEye as EyeIcon,\n NovaCompositionCoorpacademyAnalytics as AnalyticsIcon,\n NovaCompositionCoorpacademyNext as CloseIcon,\n NovaSolidComputersSdCard as SaveIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../link';\nimport style from './style.css';\n\nconst ICONS = {\n analytics: AnalyticsIcon,\n 'chevron-left': ChevronLeftIcon,\n 'chevron-right': ChevronRightIcon,\n close: CloseIcon,\n save: SaveIcon,\n see: EyeIcon\n};\n\nconst getButtonContent = (icon, label) => {\n const {type, position} = icon;\n const Icon = getOr(null, type, ICONS);\n\n if (!Icon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n );\n }\n\n if (position === 'center' && Icon) {\n return (\n <div className={style.buttonContent}>\n <Icon className={style.icon} />\n </div>\n );\n }\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? <Icon className={style.icon} /> : null}\n <span className={style.label}>{label}</span>\n {position === 'right' ? <Icon className={style.icon} /> : null}\n </div>\n );\n};\n\nconst ButtonLink = props => {\n const {\n type,\n label,\n disabled,\n icon = {},\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick\n } = props;\n const contentView = getButtonContent(icon, label);\n const styleButton = classnames(\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n if (link) {\n return (\n <Link\n {...link}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel || label}\n title={ariaLabel || label}\n >\n {contentView}\n </Link>\n );\n }\n\n const handleOnClick = useMemo(() => () => onClick(), [onClick]);\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel || label}\n title={ariaLabel || label}\n className={styleButton}\n onClick={handleOnClick}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLink.propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n label: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left', 'center']),\n type: PropTypes.string\n }),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool\n};\n\nexport default ButtonLink;\n"],"file":"index.js"}
@@ -0,0 +1,97 @@
1
+ @value colors: "../../variables/colors.css";
2
+ @value cm_primary_blue from colors;
3
+ @value cm_blue_600 from colors;
4
+ @value cm_grey_50 from colors;
5
+ @value cm_grey_100 from colors;
6
+ @value cm_grey_200 from colors;
7
+ @value cm_grey_900 from colors;
8
+ @value cm_negative_100 from colors;
9
+ @value cm_negative_200 from colors;
10
+ @value white from colors;
11
+
12
+ .button {
13
+ width: 100%;
14
+ height: 44px;
15
+ border-radius: 7px;
16
+ font-family: Gilroy;
17
+ font-size: 14px;
18
+ font-weight: bold;
19
+ display: flex;
20
+ justify-content: center;
21
+ align-items: center;
22
+ cursor: pointer;
23
+ border: none;
24
+ }
25
+
26
+ .disabled {
27
+ opacity: 0.1;
28
+ pointer-events: none;
29
+ }
30
+
31
+ .buttonContent {
32
+ display: flex;
33
+ justify-content: center;
34
+ align-items: center;
35
+ }
36
+
37
+ .link {
38
+ color: inherit;
39
+ text-decoration: none;
40
+ }
41
+
42
+ .icon {
43
+ width: 12px;
44
+ height: 12px;
45
+ }
46
+
47
+ .label {
48
+ margin: 0 8px 0 8px;
49
+ display: block;
50
+ }
51
+
52
+ .primary {
53
+ background-color: cm_primary_blue;
54
+ color: white;
55
+ }
56
+
57
+ .primary:hover {
58
+ background-color: cm_blue_600;
59
+ }
60
+
61
+ .secondary {
62
+ background-color: cm_grey_100;
63
+ color: cm_grey_900;
64
+ }
65
+
66
+ .secondary:hover {
67
+ background-color: cm_grey_200;
68
+ }
69
+
70
+ .tertiary {
71
+ background-color: cm_grey_50;
72
+ color: cm_grey_900;
73
+ border-radius: 0px;
74
+ }
75
+
76
+ .tertiary:hover {
77
+ background-color: cm_grey_100;
78
+ }
79
+
80
+ .dangerous {
81
+ background-color: cm_negative_100;
82
+ }
83
+
84
+ .dangerous:hover {
85
+ background-color: cm_negative_200;
86
+ }
87
+
88
+ .text {
89
+ background: transparent;
90
+ color: cm_grey_900;
91
+ border-radius: 0px;
92
+ height: auto;
93
+ }
94
+
95
+ .text:hover {
96
+ color: cm_primary_blue;
97
+ }
@@ -0,0 +1,10 @@
1
+ export default {
2
+ props: {
3
+ type: 'dangerous',
4
+ label: 'Delete',
5
+ 'aria-label': 'aria button',
6
+ 'data-name': 'default-button',
7
+ onClick: () => console.log('click')
8
+ }
9
+ };
10
+ //# sourceMappingURL=button-dangerous-no-icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/button-link/test/fixtures/button-dangerous-no-icon.js"],"names":["props","type","label","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,WADD;AAELC,IAAAA,KAAK,EAAE,QAFF;AAGL,kBAAc,aAHT;AAIL,iBAAa,gBAJR;AAKLC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AALV;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'dangerous',\n label: 'Delete',\n 'aria-label': 'aria button',\n 'data-name': 'default-button',\n onClick: () => console.log('click')\n }\n};\n"],"file":"button-dangerous-no-icon.js"}
@@ -0,0 +1,14 @@
1
+ export default {
2
+ props: {
3
+ type: 'primary',
4
+ label: 'See my platform',
5
+ 'aria-label': 'aria button',
6
+ 'data-name': 'default-button',
7
+ icon: {
8
+ position: 'left',
9
+ type: 'chevron-left'
10
+ },
11
+ onClick: () => console.log('click')
12
+ }
13
+ };
14
+ //# sourceMappingURL=button-primary-icon-left.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/button-link/test/fixtures/button-primary-icon-left.js"],"names":["props","type","label","icon","position","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,SADD;AAELC,IAAAA,KAAK,EAAE,iBAFF;AAGL,kBAAc,aAHT;AAIL,iBAAa,gBAJR;AAKLC,IAAAA,IAAI,EAAE;AACJC,MAAAA,QAAQ,EAAE,MADN;AAEJH,MAAAA,IAAI,EAAE;AAFF,KALD;AASLI,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AATV;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'primary',\n label: 'See my platform',\n 'aria-label': 'aria button',\n 'data-name': 'default-button',\n icon: {\n position: 'left',\n type: 'chevron-left'\n },\n onClick: () => console.log('click')\n }\n};\n"],"file":"button-primary-icon-left.js"}
@@ -0,0 +1,10 @@
1
+ export default {
2
+ props: {
3
+ type: 'primary',
4
+ label: 'See my platform',
5
+ 'aria-label': 'aria button',
6
+ 'data-name': 'default-button',
7
+ onClick: () => console.log('click')
8
+ }
9
+ };
10
+ //# sourceMappingURL=button-primary-no-icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/button-link/test/fixtures/button-primary-no-icon.js"],"names":["props","type","label","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,SADD;AAELC,IAAAA,KAAK,EAAE,iBAFF;AAGL,kBAAc,aAHT;AAIL,iBAAa,gBAJR;AAKLC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AALV;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'primary',\n label: 'See my platform',\n 'aria-label': 'aria button',\n 'data-name': 'default-button',\n onClick: () => console.log('click')\n }\n};\n"],"file":"button-primary-no-icon.js"}
@@ -0,0 +1,11 @@
1
+ export default {
2
+ props: {
3
+ type: 'secondary',
4
+ label: 'See my platform',
5
+ 'aria-label': 'aria button',
6
+ 'data-name': 'default-button',
7
+ onClick: () => console.log('click'),
8
+ disabled: true
9
+ }
10
+ };
11
+ //# sourceMappingURL=button-secondary-no-icon-disabled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/button-link/test/fixtures/button-secondary-no-icon-disabled.js"],"names":["props","type","label","onClick","console","log","disabled"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,WADD;AAELC,IAAAA,KAAK,EAAE,iBAFF;AAGL,kBAAc,aAHT;AAIL,iBAAa,gBAJR;AAKLC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ,CALV;AAMLC,IAAAA,QAAQ,EAAE;AANL;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'secondary',\n label: 'See my platform',\n 'aria-label': 'aria button',\n 'data-name': 'default-button',\n onClick: () => console.log('click'),\n disabled: true\n }\n};\n"],"file":"button-secondary-no-icon-disabled.js"}
@@ -0,0 +1,14 @@
1
+ export default {
2
+ props: {
3
+ type: 'tertiary',
4
+ label: 'Button',
5
+ 'aria-label': 'aria button',
6
+ 'data-name': 'default-button',
7
+ icon: {
8
+ position: 'left',
9
+ type: 'see'
10
+ },
11
+ onClick: () => console.log('click')
12
+ }
13
+ };
14
+ //# sourceMappingURL=button-tertiary-icon-left.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/button-link/test/fixtures/button-tertiary-icon-left.js"],"names":["props","type","label","icon","position","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,UADD;AAELC,IAAAA,KAAK,EAAE,QAFF;AAGL,kBAAc,aAHT;AAIL,iBAAa,gBAJR;AAKLC,IAAAA,IAAI,EAAE;AACJC,MAAAA,QAAQ,EAAE,MADN;AAEJH,MAAAA,IAAI,EAAE;AAFF,KALD;AASLI,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AATV;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'tertiary',\n label: 'Button',\n 'aria-label': 'aria button',\n 'data-name': 'default-button',\n icon: {\n position: 'left',\n type: 'see'\n },\n onClick: () => console.log('click')\n }\n};\n"],"file":"button-tertiary-icon-left.js"}
@@ -0,0 +1,13 @@
1
+ export default {
2
+ props: {
3
+ type: 'secondary',
4
+ 'data-name': 'default-button',
5
+ 'aria-label': 'aria button',
6
+ icon: {
7
+ position: 'center',
8
+ type: 'close'
9
+ },
10
+ onClick: () => console.log('click')
11
+ }
12
+ };
13
+ //# sourceMappingURL=icon-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/button-link/test/fixtures/icon-button.js"],"names":["props","type","icon","position","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,WADD;AAEL,iBAAa,gBAFR;AAGL,kBAAc,aAHT;AAILC,IAAAA,IAAI,EAAE;AACJC,MAAAA,QAAQ,EAAE,QADN;AAEJF,MAAAA,IAAI,EAAE;AAFF,KAJD;AAQLG,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AARV;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'secondary',\n 'data-name': 'default-button',\n 'aria-label': 'aria button',\n icon: {\n position: 'center',\n type: 'close'\n },\n onClick: () => console.log('click')\n }\n};\n"],"file":"icon-button.js"}
@@ -0,0 +1,17 @@
1
+ export default {
2
+ props: {
3
+ type: 'primary',
4
+ disabled: true,
5
+ label: 'Global Analytics',
6
+ 'aria-label': 'aria button',
7
+ 'data-name': 'default-button',
8
+ icon: {
9
+ position: 'right',
10
+ type: 'analytics'
11
+ },
12
+ link: {
13
+ href: 'https://www.google.com'
14
+ }
15
+ }
16
+ };
17
+ //# sourceMappingURL=link-primary-disabled-icon-right.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/button-link/test/fixtures/link-primary-disabled-icon-right.js"],"names":["props","type","disabled","label","icon","position","link","href"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,SADD;AAELC,IAAAA,QAAQ,EAAE,IAFL;AAGLC,IAAAA,KAAK,EAAE,kBAHF;AAIL,kBAAc,aAJT;AAKL,iBAAa,gBALR;AAMLC,IAAAA,IAAI,EAAE;AACJC,MAAAA,QAAQ,EAAE,OADN;AAEJJ,MAAAA,IAAI,EAAE;AAFF,KAND;AAULK,IAAAA,IAAI,EAAE;AACJC,MAAAA,IAAI,EAAE;AADF;AAVD;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'primary',\n disabled: true,\n label: 'Global Analytics',\n 'aria-label': 'aria button',\n 'data-name': 'default-button',\n icon: {\n position: 'right',\n type: 'analytics'\n },\n link: {\n href: 'https://www.google.com'\n }\n }\n};\n"],"file":"link-primary-disabled-icon-right.js"}
@@ -0,0 +1,20 @@
1
+ export default {
2
+ props: {
3
+ type: 'secondary',
4
+ label: 'Global Analytics',
5
+ 'data-name': 'default-button',
6
+ 'aria-label': 'aria button',
7
+ icon: {
8
+ position: 'right',
9
+ type: 'analytics'
10
+ },
11
+ onClick: () => {
12
+ console.log('Click on link');
13
+ return;
14
+ },
15
+ link: {
16
+ href: 'https://www.google.com'
17
+ }
18
+ }
19
+ };
20
+ //# sourceMappingURL=link-secondary-icon-right.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/button-link/test/fixtures/link-secondary-icon-right.js"],"names":["props","type","label","icon","position","onClick","console","log","link","href"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,WADD;AAELC,IAAAA,KAAK,EAAE,kBAFF;AAGL,iBAAa,gBAHR;AAIL,kBAAc,aAJT;AAKLC,IAAAA,IAAI,EAAE;AACJC,MAAAA,QAAQ,EAAE,OADN;AAEJH,MAAAA,IAAI,EAAE;AAFF,KALD;AASLI,IAAAA,OAAO,EAAE,MAAM;AACbC,MAAAA,OAAO,CAACC,GAAR,CAAY,eAAZ;AACA;AACD,KAZI;AAaLC,IAAAA,IAAI,EAAE;AACJC,MAAAA,IAAI,EAAE;AADF;AAbD;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'secondary',\n label: 'Global Analytics',\n 'data-name': 'default-button',\n 'aria-label': 'aria button',\n icon: {\n position: 'right',\n type: 'analytics'\n },\n onClick: () => {\n console.log('Click on link');\n return;\n },\n link: {\n href: 'https://www.google.com'\n }\n }\n};\n"],"file":"link-secondary-icon-right.js"}
@@ -0,0 +1,16 @@
1
+ export default {
2
+ props: {
3
+ type: 'tertiary',
4
+ label: 'Go to google',
5
+ 'data-name': 'default-button',
6
+ 'aria-label': 'aria button',
7
+ onClick: () => {
8
+ console.log('Click on link');
9
+ return;
10
+ },
11
+ link: {
12
+ href: 'https://www.google.com'
13
+ }
14
+ }
15
+ };
16
+ //# sourceMappingURL=link-tertiary-no-icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/button-link/test/fixtures/link-tertiary-no-icon.js"],"names":["props","type","label","onClick","console","log","link","href"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,UADD;AAELC,IAAAA,KAAK,EAAE,cAFF;AAGL,iBAAa,gBAHR;AAIL,kBAAc,aAJT;AAKLC,IAAAA,OAAO,EAAE,MAAM;AACbC,MAAAA,OAAO,CAACC,GAAR,CAAY,eAAZ;AACA;AACD,KARI;AASLC,IAAAA,IAAI,EAAE;AACJC,MAAAA,IAAI,EAAE;AADF;AATD;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'tertiary',\n label: 'Go to google',\n 'data-name': 'default-button',\n 'aria-label': 'aria button',\n onClick: () => {\n console.log('Click on link');\n return;\n },\n link: {\n href: 'https://www.google.com'\n }\n }\n};\n"],"file":"link-tertiary-no-icon.js"}
@@ -0,0 +1,17 @@
1
+ export default {
2
+ props: {
3
+ type: 'text',
4
+ label: 'Button',
5
+ 'data-name': 'default-button',
6
+ 'aria-label': 'aria button',
7
+ icon: {
8
+ position: 'right',
9
+ type: 'chevron-left'
10
+ },
11
+ link: {
12
+ href: 'http://www.google.com',
13
+ target: '_blank'
14
+ }
15
+ }
16
+ };
17
+ //# sourceMappingURL=link-text-icon-right-target-blank.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/button-link/test/fixtures/link-text-icon-right-target-blank.js"],"names":["props","type","label","icon","position","link","href","target"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,MADD;AAELC,IAAAA,KAAK,EAAE,QAFF;AAGL,iBAAa,gBAHR;AAIL,kBAAc,aAJT;AAKLC,IAAAA,IAAI,EAAE;AACJC,MAAAA,QAAQ,EAAE,OADN;AAEJH,MAAAA,IAAI,EAAE;AAFF,KALD;AASLI,IAAAA,IAAI,EAAE;AACJC,MAAAA,IAAI,EAAE,uBADF;AAEJC,MAAAA,MAAM,EAAE;AAFJ;AATD;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'text',\n label: 'Button',\n 'data-name': 'default-button',\n 'aria-label': 'aria button',\n icon: {\n position: 'right',\n type: 'chevron-left'\n },\n link: {\n href: 'http://www.google.com',\n target: '_blank'\n }\n }\n};\n"],"file":"link-text-icon-right-target-blank.js"}
@@ -0,0 +1,13 @@
1
+ export default {
2
+ props: {
3
+ type: 'text',
4
+ label: 'Download',
5
+ 'data-name': 'default-button',
6
+ 'aria-label': 'aria button',
7
+ link: {
8
+ href: 'https://setup.coorpacademy.com/assets/templates/import-users-template.xlsx',
9
+ download: true
10
+ }
11
+ }
12
+ };
13
+ //# sourceMappingURL=link-text-no-icon-download.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/button-link/test/fixtures/link-text-no-icon-download.js"],"names":["props","type","label","link","href","download"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,MADD;AAELC,IAAAA,KAAK,EAAE,UAFF;AAGL,iBAAa,gBAHR;AAIL,kBAAc,aAJT;AAKLC,IAAAA,IAAI,EAAE;AACJC,MAAAA,IAAI,EAAE,4EADF;AAEJC,MAAAA,QAAQ,EAAE;AAFN;AALD;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'text',\n label: 'Download',\n 'data-name': 'default-button',\n 'aria-label': 'aria button',\n link: {\n href: 'https://setup.coorpacademy.com/assets/templates/import-users-template.xlsx',\n download: true\n }\n }\n};\n"],"file":"link-text-no-icon-download.js"}
@@ -2,6 +2,7 @@ import test from 'ava';
2
2
  import forEach from 'lodash/forEach';
3
3
  import renderComponentMacro from '../../../test/helpers/render-component';
4
4
  import AtomInputCheckbox from '..';
5
+ import fixtureCheckedDisabled from './fixtures/checked-disabled';
5
6
  import fixtureChecked from './fixtures/checked';
6
7
  import fixtureDefault from './fixtures/default';
7
8
  import fixtureDisabled from './fixtures/disabled';
@@ -14,6 +15,7 @@ test('Atom › AtomInputCheckbox > should have valid propTypes', t => {
14
15
  t.not(value, undefined, `PropType for "Atom.AtomInputCheckbox.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
15
16
  });
16
17
  });
18
+ test('Atom › AtomInputCheckbox › CheckedDisabled › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureCheckedDisabled);
17
19
  test('Atom › AtomInputCheckbox › Checked › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureChecked);
18
20
  test('Atom › AtomInputCheckbox › Default › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureDefault);
19
21
  test('Atom › AtomInputCheckbox › Disabled › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureDisabled);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/atom/input-checkbox/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomInputCheckbox","fixtureChecked","fixtureDefault","fixtureDisabled","fixtureError","fixtureModified","fixtureRequired","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,iBAAP,MAA8B,IAA9B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AAEAT,IAAI,CAAC,wDAAD,EAA2DU,CAAC,IAAI;AAClEA,EAAAA,CAAC,CAACC,IAAF;AACAV,EAAAA,OAAO,CAACE,iBAAiB,CAACS,SAAnB,EAA8B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACnDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,kDAAiDF,GAAI,mEAA9E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAd,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,iBAAlF,EAAqGC,cAArG,CAAJ;AACAJ,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,iBAAlF,EAAqGE,cAArG,CAAJ;AACAL,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,iBAAnF,EAAsGG,eAAtG,CAAJ;AACAN,IAAI,CAAC,uDAAD,EAA0DE,oBAA1D,EAAgFC,iBAAhF,EAAmGI,YAAnG,CAAJ;AACAP,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,iBAAnF,EAAsGK,eAAtG,CAAJ;AACAR,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,iBAAnF,EAAsGM,eAAtG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomInputCheckbox from '..';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDisabled from './fixtures/disabled';\nimport fixtureError from './fixtures/error';\nimport fixtureModified from './fixtures/modified';\nimport fixtureRequired from './fixtures/required';\n\ntest('Atom › AtomInputCheckbox > should have valid propTypes', t => {\n t.pass();\n forEach(AtomInputCheckbox.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomInputCheckbox.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomInputCheckbox › Checked › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureChecked);\ntest('Atom › AtomInputCheckbox › Default › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureDefault);\ntest('Atom › AtomInputCheckbox › Disabled › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureDisabled);\ntest('Atom › AtomInputCheckbox › Error › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureError);\ntest('Atom › AtomInputCheckbox › Modified › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureModified);\ntest('Atom › AtomInputCheckbox › Required › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureRequired);\n"],"file":"fixtures.js"}
1
+ {"version":3,"sources":["../../../../src/atom/input-checkbox/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomInputCheckbox","fixtureCheckedDisabled","fixtureChecked","fixtureDefault","fixtureDisabled","fixtureError","fixtureModified","fixtureRequired","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,iBAAP,MAA8B,IAA9B;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AAEAV,IAAI,CAAC,wDAAD,EAA2DW,CAAC,IAAI;AAClEA,EAAAA,CAAC,CAACC,IAAF;AACAX,EAAAA,OAAO,CAACE,iBAAiB,CAACU,SAAnB,EAA8B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACnDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,kDAAiDF,GAAI,mEAA9E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAf,IAAI,CAAC,iEAAD,EAAoEE,oBAApE,EAA0FC,iBAA1F,EAA6GC,sBAA7G,CAAJ;AACAJ,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,iBAAlF,EAAqGE,cAArG,CAAJ;AACAL,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,iBAAlF,EAAqGG,cAArG,CAAJ;AACAN,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,iBAAnF,EAAsGI,eAAtG,CAAJ;AACAP,IAAI,CAAC,uDAAD,EAA0DE,oBAA1D,EAAgFC,iBAAhF,EAAmGK,YAAnG,CAAJ;AACAR,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,iBAAnF,EAAsGM,eAAtG,CAAJ;AACAT,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,iBAAnF,EAAsGO,eAAtG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomInputCheckbox from '..';\nimport fixtureCheckedDisabled from './fixtures/checked-disabled';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDisabled from './fixtures/disabled';\nimport fixtureError from './fixtures/error';\nimport fixtureModified from './fixtures/modified';\nimport fixtureRequired from './fixtures/required';\n\ntest('Atom › AtomInputCheckbox > should have valid propTypes', t => {\n t.pass();\n forEach(AtomInputCheckbox.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomInputCheckbox.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomInputCheckbox › CheckedDisabled › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureCheckedDisabled);\ntest('Atom › AtomInputCheckbox › Checked › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureChecked);\ntest('Atom › AtomInputCheckbox › Default › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureDefault);\ntest('Atom › AtomInputCheckbox › Disabled › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureDisabled);\ntest('Atom › AtomInputCheckbox › Error › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureError);\ntest('Atom › AtomInputCheckbox › Modified › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureModified);\ntest('Atom › AtomInputCheckbox › Required › should be rendered', renderComponentMacro, AtomInputCheckbox, fixtureRequired);\n"],"file":"fixtures.js"}
@@ -0,0 +1,65 @@
1
+ import _isEmpty from "lodash/fp/isEmpty";
2
+ import _noop from "lodash/fp/noop";
3
+ import React, { useMemo } from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import classnames from 'classnames';
6
+ import { NovaCompositionCoorpacademySearch1 as CMSearchIcon, NovaCompositionCoorpacademySearch as SearchIcon, NovaSolidStatusClose as CloseIcon } from '@coorpacademy/nova-icons';
7
+ import Provider from '../provider';
8
+ import style from './style.css';
9
+
10
+ const Search = props => {
11
+ const {
12
+ value,
13
+ placeholder,
14
+ onChange = _noop,
15
+ onClear = _noop,
16
+ onFocus,
17
+ onBlur,
18
+ theme = 'default'
19
+ } = props;
20
+ const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);
21
+ const cmStyle = classnames(style.coorpmanager);
22
+ const isDefaultTheme = theme === 'default';
23
+ return /*#__PURE__*/React.createElement("div", {
24
+ className: isDefaultTheme ? style.wrapperSearch : cmStyle
25
+ }, /*#__PURE__*/React.createElement("label", {
26
+ htmlFor: "search",
27
+ title: placeholder
28
+ }, !isDefaultTheme ? /*#__PURE__*/React.createElement(CMSearchIcon, {
29
+ className: style.searchIcon
30
+ }) : /*#__PURE__*/React.createElement(SearchIcon, {
31
+ className: style.searchIcon
32
+ }), !isDefaultTheme ? /*#__PURE__*/React.createElement("span", {
33
+ className: classnames(style.title, _isEmpty(value) && style.noValue)
34
+ }, placeholder) : null), /*#__PURE__*/React.createElement("input", {
35
+ "data-name": "search-input",
36
+ className: style.search,
37
+ type: "text",
38
+ name: "search",
39
+ id: "search",
40
+ placeholder: placeholder,
41
+ value: value,
42
+ onInput: handleChange,
43
+ onFocus: onFocus,
44
+ onChange: _noop,
45
+ onBlur: onBlur
46
+ }), value && !isDefaultTheme ? /*#__PURE__*/React.createElement(CloseIcon, {
47
+ onClick: onClear,
48
+ className: style.clearIcon
49
+ }) : null);
50
+ };
51
+
52
+ Search.contextTypes = {
53
+ skin: Provider.childContextTypes.skin
54
+ };
55
+ Search.propTypes = process.env.NODE_ENV !== "production" ? {
56
+ value: PropTypes.string,
57
+ placeholder: PropTypes.string.isRequired,
58
+ onChange: PropTypes.func,
59
+ onClear: PropTypes.func,
60
+ onFocus: PropTypes.func,
61
+ onBlur: PropTypes.func,
62
+ theme: PropTypes.oneOf(['default', 'coorpmanager'])
63
+ } : {};
64
+ export default Search;
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/atom/input-search/index.js"],"names":["React","useMemo","PropTypes","classnames","NovaCompositionCoorpacademySearch1","CMSearchIcon","NovaCompositionCoorpacademySearch","SearchIcon","NovaSolidStatusClose","CloseIcon","Provider","style","Search","props","value","placeholder","onChange","onClear","onFocus","onBlur","theme","handleChange","e","target","cmStyle","coorpmanager","isDefaultTheme","wrapperSearch","searchIcon","title","noValue","search","clearIcon","contextTypes","skin","childContextTypes","propTypes","string","isRequired","func","oneOf"],"mappings":"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","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademySearch1 as CMSearchIcon,\n NovaCompositionCoorpacademySearch as SearchIcon,\n NovaSolidStatusClose as CloseIcon\n} from '@coorpacademy/nova-icons';\nimport {noop, isEmpty} from 'lodash/fp';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst Search = props => {\n const {\n value,\n placeholder,\n onChange = noop,\n onClear = noop,\n onFocus,\n onBlur,\n theme = 'default'\n } = props;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const cmStyle = classnames(style.coorpmanager);\n const isDefaultTheme = theme === 'default';\n\n return (\n <div className={isDefaultTheme ? style.wrapperSearch : cmStyle}>\n <label htmlFor=\"search\" title={placeholder}>\n {!isDefaultTheme ? (\n <CMSearchIcon className={style.searchIcon} />\n ) : (\n <SearchIcon className={style.searchIcon} />\n )}\n {!isDefaultTheme ? (\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {placeholder}\n </span>\n ) : null}\n </label>\n <input\n data-name=\"search-input\"\n className={style.search}\n type=\"text\"\n name=\"search\"\n id=\"search\"\n placeholder={placeholder}\n value={value}\n onInput={handleChange}\n onFocus={onFocus}\n onChange={noop}\n onBlur={onBlur}\n />\n {value && !isDefaultTheme ? (\n <CloseIcon onClick={onClear} className={style.clearIcon} />\n ) : null}\n </div>\n );\n};\n\nSearch.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearch.propTypes = {\n value: PropTypes.string,\n placeholder: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n onClear: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n theme: PropTypes.oneOf(['default', 'coorpmanager'])\n};\n\nexport default Search;\n"],"file":"index.js"}