@coorpacademy/components 10.1.1 → 10.1.2

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 (173) hide show
  1. package/es/atom/bullet-point-menu-button/test/fixtures.js +27 -0
  2. package/es/atom/bullet-point-menu-button/test/fixtures.js.map +1 -0
  3. package/es/atom/button/index.js +3 -1
  4. package/es/atom/button/index.js.map +1 -1
  5. package/es/atom/content-badge/index.js +4 -4
  6. package/es/atom/content-badge/index.js.map +1 -1
  7. package/es/atom/input-checkbox/test/fixtures.js +0 -2
  8. package/es/atom/input-checkbox/test/fixtures.js.map +1 -1
  9. package/es/atom/input-text/index.js +1 -1
  10. package/es/atom/input-text/index.js.map +1 -1
  11. package/es/atom/input-text/style.css +16 -11
  12. package/es/atom/input-textarea/index.js +36 -11
  13. package/es/atom/input-textarea/index.js.map +1 -1
  14. package/es/atom/input-textarea/style.css +265 -0
  15. package/es/atom/input-textarea/test/fixtures/cm-default.js +17 -0
  16. package/es/atom/input-textarea/test/fixtures/cm-default.js.map +1 -0
  17. package/es/atom/input-textarea/test/fixtures/cm-empty.js +17 -0
  18. package/es/atom/input-textarea/test/fixtures/cm-empty.js.map +1 -0
  19. package/es/atom/title/test/fixtures.js +2 -6
  20. package/es/atom/title/test/fixtures.js.map +1 -1
  21. package/es/molecule/banner/index.js +46 -0
  22. package/es/molecule/banner/index.js.map +1 -0
  23. package/es/molecule/banner/style.css +63 -0
  24. package/es/molecule/banner/test/fixtures/default.js +11 -0
  25. package/es/molecule/banner/test/fixtures/default.js.map +1 -0
  26. package/es/molecule/banner/test/fixtures/error-banner.js +7 -0
  27. package/es/molecule/banner/test/fixtures/error-banner.js.map +1 -0
  28. package/es/molecule/brand-form-group/test/fixtures/cm-default.js +51 -0
  29. package/es/molecule/brand-form-group/test/fixtures/cm-default.js.map +1 -0
  30. package/es/molecule/brand-form-group/test/fixtures/default.js +12 -3
  31. package/es/molecule/brand-form-group/test/fixtures/default.js.map +1 -1
  32. package/es/molecule/card/index.js +16 -5
  33. package/es/molecule/card/index.js.map +1 -1
  34. package/es/molecule/card/selectable.css +71 -0
  35. package/es/molecule/card/selectable.js +32 -0
  36. package/es/molecule/card/selectable.js.map +1 -0
  37. package/es/molecule/card/test/fixtures/default.js +1 -0
  38. package/es/molecule/card/test/fixtures/default.js.map +1 -1
  39. package/es/molecule/card/test/fixtures/selectable-false.js +16 -0
  40. package/es/molecule/card/test/fixtures/selectable-false.js.map +1 -0
  41. package/es/molecule/card/test/fixtures/selectable-true.js +17 -0
  42. package/es/molecule/card/test/fixtures/selectable-true.js.map +1 -0
  43. package/es/molecule/card-content/index.js +13 -3
  44. package/es/molecule/card-content/index.js.map +1 -1
  45. package/es/molecule/card-content/style.css +13 -3
  46. package/es/molecule/cm-popin/index.js +76 -0
  47. package/es/molecule/cm-popin/index.js.map +1 -0
  48. package/es/molecule/cm-popin/style.css +157 -0
  49. package/es/molecule/cm-popin/test/fixtures/dangerous.js +16 -0
  50. package/es/molecule/cm-popin/test/fixtures/dangerous.js.map +1 -0
  51. package/es/molecule/cm-popin/test/fixtures/default.js +16 -0
  52. package/es/molecule/cm-popin/test/fixtures/default.js.map +1 -0
  53. package/es/molecule/cm-popin/test/fixtures/warning-with-close.js +17 -0
  54. package/es/molecule/cm-popin/test/fixtures/warning-with-close.js.map +1 -0
  55. package/es/molecule/cockpit-popin/test/fixtures.js +17 -0
  56. package/es/molecule/cockpit-popin/test/fixtures.js.map +1 -0
  57. package/es/molecule/wizard-summary/index.js +44 -17
  58. package/es/molecule/wizard-summary/index.js.map +1 -1
  59. package/es/molecule/wizard-summary/style.css +104 -7
  60. package/es/molecule/wizard-summary/test/fixtures/default.js +9 -3
  61. package/es/molecule/wizard-summary/test/fixtures/default.js.map +1 -1
  62. package/es/molecule/wizard-summary/test/fixtures/tablet-closed.js +117 -0
  63. package/es/molecule/wizard-summary/test/fixtures/tablet-closed.js.map +1 -0
  64. package/es/organism/accordion/coorp-manager/part/test/fixtures.js +0 -4
  65. package/es/organism/accordion/coorp-manager/part/test/fixtures.js.map +1 -1
  66. package/es/organism/brand-dashboard/test/fixtures.js +0 -2
  67. package/es/organism/brand-dashboard/test/fixtures.js.map +1 -1
  68. package/es/template/back-office/brand-update/test/fixtures.js +2 -2
  69. package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
  70. package/es/variables/colors.css +9 -3
  71. package/lib/atom/bullet-point-menu-button/test/fixtures.js +43 -0
  72. package/lib/atom/bullet-point-menu-button/test/fixtures.js.map +1 -0
  73. package/lib/atom/button/index.js +3 -1
  74. package/lib/atom/button/index.js.map +1 -1
  75. package/lib/atom/content-badge/index.js +4 -4
  76. package/lib/atom/content-badge/index.js.map +1 -1
  77. package/lib/atom/input-checkbox/test/fixtures.js +0 -3
  78. package/lib/atom/input-checkbox/test/fixtures.js.map +1 -1
  79. package/lib/atom/input-text/index.js +1 -1
  80. package/lib/atom/input-text/index.js.map +1 -1
  81. package/lib/atom/input-text/style.css +16 -11
  82. package/lib/atom/input-textarea/index.js +38 -11
  83. package/lib/atom/input-textarea/index.js.map +1 -1
  84. package/lib/atom/input-textarea/style.css +265 -0
  85. package/lib/atom/input-textarea/test/fixtures/cm-default.js +22 -0
  86. package/lib/atom/input-textarea/test/fixtures/cm-default.js.map +1 -0
  87. package/lib/atom/input-textarea/test/fixtures/cm-empty.js +22 -0
  88. package/lib/atom/input-textarea/test/fixtures/cm-empty.js.map +1 -0
  89. package/lib/atom/title/test/fixtures.js +2 -8
  90. package/lib/atom/title/test/fixtures.js.map +1 -1
  91. package/lib/molecule/banner/index.js +59 -0
  92. package/lib/molecule/banner/index.js.map +1 -0
  93. package/lib/molecule/banner/style.css +63 -0
  94. package/lib/molecule/banner/test/fixtures/default.js +16 -0
  95. package/lib/molecule/banner/test/fixtures/default.js.map +1 -0
  96. package/lib/molecule/banner/test/fixtures/error-banner.js +12 -0
  97. package/lib/molecule/banner/test/fixtures/error-banner.js.map +1 -0
  98. package/lib/molecule/brand-form-group/test/fixtures/cm-default.js +56 -0
  99. package/lib/molecule/brand-form-group/test/fixtures/cm-default.js.map +1 -0
  100. package/lib/molecule/brand-form-group/test/fixtures/default.js +12 -3
  101. package/lib/molecule/brand-form-group/test/fixtures/default.js.map +1 -1
  102. package/lib/molecule/card/index.js +17 -5
  103. package/lib/molecule/card/index.js.map +1 -1
  104. package/lib/molecule/card/selectable.css +71 -0
  105. package/lib/molecule/card/selectable.js +45 -0
  106. package/lib/molecule/card/selectable.js.map +1 -0
  107. package/lib/molecule/card/test/fixtures/default.js +1 -0
  108. package/lib/molecule/card/test/fixtures/default.js.map +1 -1
  109. package/lib/molecule/card/test/fixtures/selectable-false.js +26 -0
  110. package/lib/molecule/card/test/fixtures/selectable-false.js.map +1 -0
  111. package/lib/molecule/card/test/fixtures/selectable-true.js +27 -0
  112. package/lib/molecule/card/test/fixtures/selectable-true.js.map +1 -0
  113. package/lib/molecule/card-content/index.js +14 -3
  114. package/lib/molecule/card-content/index.js.map +1 -1
  115. package/lib/molecule/card-content/style.css +13 -3
  116. package/lib/molecule/cm-popin/index.js +89 -0
  117. package/lib/molecule/cm-popin/index.js.map +1 -0
  118. package/lib/molecule/cm-popin/style.css +157 -0
  119. package/lib/molecule/cm-popin/test/fixtures/dangerous.js +21 -0
  120. package/lib/molecule/cm-popin/test/fixtures/dangerous.js.map +1 -0
  121. package/lib/molecule/cm-popin/test/fixtures/default.js +21 -0
  122. package/lib/molecule/cm-popin/test/fixtures/default.js.map +1 -0
  123. package/lib/molecule/cm-popin/test/fixtures/warning-with-close.js +22 -0
  124. package/lib/molecule/cm-popin/test/fixtures/warning-with-close.js.map +1 -0
  125. package/lib/molecule/cockpit-popin/test/fixtures.js +28 -0
  126. package/lib/molecule/cockpit-popin/test/fixtures.js.map +1 -0
  127. package/lib/molecule/wizard-summary/index.js +41 -13
  128. package/lib/molecule/wizard-summary/index.js.map +1 -1
  129. package/lib/molecule/wizard-summary/style.css +104 -7
  130. package/lib/molecule/wizard-summary/test/fixtures/default.js +9 -3
  131. package/lib/molecule/wizard-summary/test/fixtures/default.js.map +1 -1
  132. package/lib/molecule/wizard-summary/test/fixtures/tablet-closed.js +122 -0
  133. package/lib/molecule/wizard-summary/test/fixtures/tablet-closed.js.map +1 -0
  134. package/lib/organism/accordion/coorp-manager/part/test/fixtures.js +0 -6
  135. package/lib/organism/accordion/coorp-manager/part/test/fixtures.js.map +1 -1
  136. package/lib/organism/brand-dashboard/test/fixtures.js +0 -3
  137. package/lib/organism/brand-dashboard/test/fixtures.js.map +1 -1
  138. package/lib/template/back-office/brand-update/test/fixtures.js +3 -3
  139. package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
  140. package/lib/variables/colors.css +9 -3
  141. package/package.json +3 -3
  142. package/es/atom/chips/test/fixtures.js +0 -15
  143. package/es/atom/chips/test/fixtures.js.map +0 -1
  144. package/es/atom/content-badge/test/fixtures.js +0 -27
  145. package/es/atom/content-badge/test/fixtures.js.map +0 -1
  146. package/es/atom/wizard-steps/test/fixtures.js +0 -17
  147. package/es/atom/wizard-steps/test/fixtures.js.map +0 -1
  148. package/es/molecule/coorp-manager-roles/test/fixtures.js +0 -13
  149. package/es/molecule/coorp-manager-roles/test/fixtures.js.map +0 -1
  150. package/es/molecule/quick-access-card/test/fixtures.js +0 -21
  151. package/es/molecule/quick-access-card/test/fixtures.js.map +0 -1
  152. package/es/molecule/quick-access-cards-group/test/fixtures.js +0 -21
  153. package/es/molecule/quick-access-cards-group/test/fixtures.js.map +0 -1
  154. package/es/molecule/vertical-tabs/test/fixtures.js +0 -15
  155. package/es/molecule/vertical-tabs/test/fixtures.js.map +0 -1
  156. package/es/molecule/wizard-summary/test/fixtures.js +0 -19
  157. package/es/molecule/wizard-summary/test/fixtures.js.map +0 -1
  158. package/lib/atom/chips/test/fixtures.js +0 -25
  159. package/lib/atom/chips/test/fixtures.js.map +0 -1
  160. package/lib/atom/content-badge/test/fixtures.js +0 -43
  161. package/lib/atom/content-badge/test/fixtures.js.map +0 -1
  162. package/lib/atom/wizard-steps/test/fixtures.js +0 -28
  163. package/lib/atom/wizard-steps/test/fixtures.js.map +0 -1
  164. package/lib/molecule/coorp-manager-roles/test/fixtures.js +0 -22
  165. package/lib/molecule/coorp-manager-roles/test/fixtures.js.map +0 -1
  166. package/lib/molecule/quick-access-card/test/fixtures.js +0 -34
  167. package/lib/molecule/quick-access-card/test/fixtures.js.map +0 -1
  168. package/lib/molecule/quick-access-cards-group/test/fixtures.js +0 -34
  169. package/lib/molecule/quick-access-cards-group/test/fixtures.js.map +0 -1
  170. package/lib/molecule/vertical-tabs/test/fixtures.js +0 -25
  171. package/lib/molecule/vertical-tabs/test/fixtures.js.map +0 -1
  172. package/lib/molecule/wizard-summary/test/fixtures.js +0 -31
  173. package/lib/molecule/wizard-summary/test/fixtures.js.map +0 -1
@@ -193,7 +193,8 @@
193
193
  display: flex;
194
194
  flex-direction: column;
195
195
  align-items: flex-start;
196
- height: 0px;
196
+ position: relative;
197
+ height: 64px;
197
198
  }
198
199
 
199
200
  .coorpmanager .title {
@@ -206,7 +207,6 @@
206
207
  line-height: 1.2;
207
208
  letter-spacing: normal;
208
209
  text-align: left;
209
- margin: 7px 0px -19px 16px;
210
210
  z-index: 1;
211
211
  color: cm_grey_400;
212
212
  width: auto;
@@ -215,6 +215,9 @@
215
215
  display: flex;
216
216
  flex-direction: row;
217
217
  flex-wrap: nowrap;
218
+ position: absolute;
219
+ top: 7px;
220
+ left: 16px;
218
221
  }
219
222
 
220
223
  .coorpmanager .title.noValue .infoIcon {
@@ -256,14 +259,14 @@
256
259
  font-size: 14px;
257
260
  font-weight: 500;
258
261
  color: cm_grey_700;
259
- margin: 14px 0px -30px 16px;
262
+ top: 14px;
260
263
  }
261
264
 
262
265
  .coorpmanager:focus-within .title.noValue {
263
266
  font-size: 10px;
264
267
  font-weight: bold;
265
268
  color: cm_grey_400;
266
- margin: 7px 0px -19px 16px;
269
+ top: 7px;
267
270
  }
268
271
 
269
272
  .coorpmanager:focus-within input::placeholder {
@@ -283,6 +286,7 @@
283
286
 
284
287
  .coorpmanager input::placeholder {
285
288
  color: transparent;
289
+ transition: color 0.25s linear;
286
290
  }
287
291
 
288
292
  .coorpmanager .hint {
@@ -309,18 +313,19 @@
309
313
  color: white;
310
314
  border-radius: 50%;
311
315
  padding: 2px;
312
- width: 8px;
313
- height: 8px;
316
+ width: 10px;
317
+ height: 10px;
318
+ right: 17px;
319
+ top: 14px;
314
320
  }
315
321
 
316
322
  .coorpmanager .leftIcon {
317
323
  color: cm_positive_100;
318
- width: 14px;
319
- height: 14px;
324
+ width: 17px;
325
+ height: 17px;
320
326
  position: absolute;
321
- right: 15px;
322
- top: 16px;
323
- line-height: 16px;
327
+ right: 16px;
328
+ top: 13px;
324
329
  }
325
330
 
326
331
  .coorpmanager.disabled {
@@ -3,6 +3,8 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
5
 
6
+ var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
7
+
6
8
  var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
7
9
 
8
10
  var _noop2 = _interopRequireDefault(require("lodash/fp/noop"));
@@ -13,6 +15,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
13
15
 
14
16
  var _classnames = _interopRequireDefault(require("classnames"));
15
17
 
18
+ var _novaIcons = require("@coorpacademy/nova-icons");
19
+
16
20
  var _getClassState = _interopRequireDefault(require("../../util/get-class-state"));
17
21
 
18
22
  var _style = _interopRequireDefault(require("./style.css"));
@@ -25,6 +29,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
25
29
 
26
30
  const themeStyle = {
27
31
  setup: _style.default.setup,
32
+ coorpmanager: _style.default.coorpmanager,
28
33
  cockpit: _style.default.cockpit,
29
34
  default: _style.default.default
30
35
  };
@@ -35,9 +40,11 @@ const InputTextarea = props => {
35
40
  name,
36
41
  placeholder,
37
42
  value,
43
+ hint,
38
44
  theme = 'default',
39
45
  onChange = _noop2.default,
40
46
  error,
47
+ valid,
41
48
  required,
42
49
  description,
43
50
  disabled,
@@ -47,22 +54,40 @@ const InputTextarea = props => {
47
54
  const mainClass = themeStyle[theme];
48
55
  const className = (0, _getClassState.default)(_style.default.default, _style.default.modified, _style.default.error, modified, error);
49
56
  const handleChange = (0, _react.useMemo)(() => e => onChange(e.target.value), [onChange]);
57
+ const descriptionView = description && theme !== 'coorpmanager' ? /*#__PURE__*/_react.default.createElement("div", {
58
+ className: _style.default.description
59
+ }, description) : null;
60
+ const toolTipView = description && theme === 'coorpmanager' ? /*#__PURE__*/_react.default.createElement("div", {
61
+ className: _style.default.infoIconWrapper
62
+ }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyInformationIcon, {
63
+ className: _style.default.infoIcon
64
+ }), /*#__PURE__*/_react.default.createElement("div", {
65
+ className: _style.default.descriptionLabel
66
+ }, description)) : null;
67
+ const hintView = theme === 'coorpmanager' ? /*#__PURE__*/_react.default.createElement("div", {
68
+ className: _style.default.hint // eslint-disable-next-line react/no-danger
69
+ ,
70
+ dangerouslySetInnerHTML: {
71
+ __html: error || hint
72
+ }
73
+ }) : null;
74
+ const errorIconView = error ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidStatusClose, {
75
+ className: _style.default.leftIcon
76
+ }) : null;
77
+ const validIconView = valid ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidStatusCheckCircle2, {
78
+ className: _style.default.leftIcon
79
+ }) : null;
50
80
  return /*#__PURE__*/_react.default.createElement("div", {
51
- className: (0, _classnames.default)(mainClass, className)
81
+ className: (0, _classnames.default)(mainClass, className, disabled && _style.default.disabled)
52
82
  }, /*#__PURE__*/_react.default.createElement("label", null, /*#__PURE__*/_react.default.createElement("span", {
53
- className: _style.default.title
54
- }, title), /*#__PURE__*/_react.default.createElement("textarea", {
83
+ className: (0, _classnames.default)(_style.default.title, (0, _isEmpty2.default)(value) && _style.default.noValue)
84
+ }, title, toolTipView), /*#__PURE__*/_react.default.createElement("textarea", {
55
85
  name: name,
56
86
  defaultValue: value,
57
87
  placeholder: placeholder,
58
88
  onInput: handleChange,
59
- disabled: disabled,
60
- style: {
61
- resize: 'none'
62
- }
63
- })), /*#__PURE__*/_react.default.createElement("div", {
64
- className: _style.default.description
65
- }, description));
89
+ disabled: disabled
90
+ }), errorIconView, validIconView, hintView), descriptionView);
66
91
  };
67
92
 
68
93
  InputTextarea.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -73,10 +98,12 @@ InputTextarea.propTypes = process.env.NODE_ENV !== "production" ? {
73
98
  theme: _propTypes.default.oneOf((0, _keys2.default)(themeStyle)),
74
99
  disabled: _propTypes.default.bool,
75
100
  value: _propTypes.default.string,
101
+ hint: _propTypes.default.string,
76
102
  error: _propTypes.default.string,
77
103
  onChange: _propTypes.default.func,
78
104
  description: _propTypes.default.string,
79
- modified: _propTypes.default.bool
105
+ modified: _propTypes.default.bool,
106
+ valid: _propTypes.default.bool
80
107
  } : {};
81
108
  var _default = InputTextarea;
82
109
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/atom/input-textarea/index.js"],"names":["themeStyle","setup","style","cockpit","default","InputTextarea","props","title","propsTitle","name","placeholder","value","theme","onChange","error","required","description","disabled","modified","mainClass","className","handleChange","e","target","resize","propTypes","PropTypes","string","bool","oneOf","func"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,UAAU,GAAG;AACjBC,EAAAA,KAAK,EAAEC,eAAMD,KADI;AAEjBE,EAAAA,OAAO,EAAED,eAAMC,OAFE;AAGjBC,EAAAA,OAAO,EAAEF,eAAME;AAHE,CAAnB;;AAKA,MAAMC,aAAa,GAAGC,KAAK,IAAI;AAC7B,QAAM;AACJC,IAAAA,KAAK,EAAEC,UADH;AAEJC,IAAAA,IAFI;AAGJC,IAAAA,WAHI;AAIJC,IAAAA,KAJI;AAKJC,IAAAA,KAAK,GAAG,SALJ;AAMJC,IAAAA,QAAQ,iBANJ;AAOJC,IAAAA,KAPI;AAQJC,IAAAA,QARI;AASJC,IAAAA,WATI;AAUJC,IAAAA,QAVI;AAWJC,IAAAA,QAAQ,GAAG;AAXP,MAYFZ,KAZJ;AAcA,QAAMC,KAAK,GAAI,GAAEC,UAAW,GAAEO,QAAQ,GAAG,IAAH,GAAU,GAAI,EAApD;AACA,QAAMI,SAAS,GAAGnB,UAAU,CAACY,KAAD,CAA5B;AACA,QAAMQ,SAAS,GAAG,4BAAclB,eAAME,OAApB,EAA6BF,eAAMgB,QAAnC,EAA6ChB,eAAMY,KAAnD,EAA0DI,QAA1D,EAAoEJ,KAApE,CAAlB;AACA,QAAMO,YAAY,GAAG,oBAAQ,MAAMC,CAAC,IAAIT,QAAQ,CAACS,CAAC,CAACC,MAAF,CAASZ,KAAV,CAA3B,EAA6C,CAACE,QAAD,CAA7C,CAArB;AAEA,sBACE;AAAK,IAAA,SAAS,EAAE,yBAAWM,SAAX,EAAsBC,SAAtB;AAAhB,kBACE,yDACE;AAAM,IAAA,SAAS,EAAElB,eAAMK;AAAvB,KAA+BA,KAA/B,CADF,eAEE;AACE,IAAA,IAAI,EAAEE,IADR;AAEE,IAAA,YAAY,EAAEE,KAFhB;AAGE,IAAA,WAAW,EAAED,WAHf;AAIE,IAAA,OAAO,EAAEW,YAJX;AAKE,IAAA,QAAQ,EAAEJ,QALZ;AAME,IAAA,KAAK,EAAE;AACLO,MAAAA,MAAM,EAAE;AADH;AANT,IAFF,CADF,eAcE;AAAK,IAAA,SAAS,EAAEtB,eAAMc;AAAtB,KAAoCA,WAApC,CAdF,CADF;AAkBD,CAtCD;;AAwCAX,aAAa,CAACoB,SAAd,2CAA0B;AACxBf,EAAAA,WAAW,EAAEgB,mBAAUC,MADC;AAExBpB,EAAAA,KAAK,EAAEmB,mBAAUC,MAFO;AAGxBZ,EAAAA,QAAQ,EAAEW,mBAAUE,IAHI;AAIxBnB,EAAAA,IAAI,EAAEiB,mBAAUC,MAJQ;AAKxBf,EAAAA,KAAK,EAAEc,mBAAUG,KAAV,CAAgB,oBAAK7B,UAAL,CAAhB,CALiB;AAMxBiB,EAAAA,QAAQ,EAAES,mBAAUE,IANI;AAOxBjB,EAAAA,KAAK,EAAEe,mBAAUC,MAPO;AAQxBb,EAAAA,KAAK,EAAEY,mBAAUC,MARO;AASxBd,EAAAA,QAAQ,EAAEa,mBAAUI,IATI;AAUxBd,EAAAA,WAAW,EAAEU,mBAAUC,MAVC;AAWxBT,EAAAA,QAAQ,EAAEQ,mBAAUE;AAXI,CAA1B;eAaevB,a","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n cockpit: style.cockpit,\n default: style.default\n};\nconst InputTextarea = props => {\n const {\n title: propsTitle,\n name,\n placeholder,\n value,\n theme = 'default',\n onChange = noop,\n error,\n required,\n description,\n disabled,\n modified = false\n } = props;\n\n const title = `${propsTitle}${required ? '* ' : ' '}`;\n const mainClass = themeStyle[theme];\n const className = getClassState(style.default, style.modified, style.error, modified, error);\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n\n return (\n <div className={classnames(mainClass, className)}>\n <label>\n <span className={style.title}>{title}</span>\n <textarea\n name={name}\n defaultValue={value}\n placeholder={placeholder}\n onInput={handleChange}\n disabled={disabled}\n style={{\n resize: 'none'\n }}\n />\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nInputTextarea.propTypes = {\n placeholder: PropTypes.string,\n title: PropTypes.string,\n required: PropTypes.bool,\n name: PropTypes.string,\n theme: PropTypes.oneOf(keys(themeStyle)),\n disabled: PropTypes.bool,\n value: PropTypes.string,\n error: PropTypes.string,\n onChange: PropTypes.func,\n description: PropTypes.string,\n modified: PropTypes.bool\n};\nexport default InputTextarea;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/atom/input-textarea/index.js"],"names":["themeStyle","setup","style","coorpmanager","cockpit","default","InputTextarea","props","title","propsTitle","name","placeholder","value","hint","theme","onChange","error","valid","required","description","disabled","modified","mainClass","className","handleChange","e","target","descriptionView","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","hintView","__html","errorIconView","leftIcon","validIconView","noValue","propTypes","PropTypes","string","bool","oneOf","func"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AAKA;;AACA;;;;;;;;AAEA,MAAMA,UAAU,GAAG;AACjBC,EAAAA,KAAK,EAAEC,eAAMD,KADI;AAEjBE,EAAAA,YAAY,EAAED,eAAMC,YAFH;AAGjBC,EAAAA,OAAO,EAAEF,eAAME,OAHE;AAIjBC,EAAAA,OAAO,EAAEH,eAAMG;AAJE,CAAnB;;AAMA,MAAMC,aAAa,GAAGC,KAAK,IAAI;AAC7B,QAAM;AACJC,IAAAA,KAAK,EAAEC,UADH;AAEJC,IAAAA,IAFI;AAGJC,IAAAA,WAHI;AAIJC,IAAAA,KAJI;AAKJC,IAAAA,IALI;AAMJC,IAAAA,KAAK,GAAG,SANJ;AAOJC,IAAAA,QAAQ,iBAPJ;AAQJC,IAAAA,KARI;AASJC,IAAAA,KATI;AAUJC,IAAAA,QAVI;AAWJC,IAAAA,WAXI;AAYJC,IAAAA,QAZI;AAaJC,IAAAA,QAAQ,GAAG;AAbP,MAcFd,KAdJ;AAgBA,QAAMC,KAAK,GAAI,GAAEC,UAAW,GAAES,QAAQ,GAAG,IAAH,GAAU,GAAI,EAApD;AACA,QAAMI,SAAS,GAAGtB,UAAU,CAACc,KAAD,CAA5B;AACA,QAAMS,SAAS,GAAG,4BAAcrB,eAAMG,OAApB,EAA6BH,eAAMmB,QAAnC,EAA6CnB,eAAMc,KAAnD,EAA0DK,QAA1D,EAAoEL,KAApE,CAAlB;AACA,QAAMQ,YAAY,GAAG,oBAAQ,MAAMC,CAAC,IAAIV,QAAQ,CAACU,CAAC,CAACC,MAAF,CAASd,KAAV,CAA3B,EAA6C,CAACG,QAAD,CAA7C,CAArB;AAEA,QAAMY,eAAe,GACnBR,WAAW,IAAIL,KAAK,KAAK,cAAzB,gBACE;AAAK,IAAA,SAAS,EAAEZ,eAAMiB;AAAtB,KAAoCA,WAApC,CADF,GAEI,IAHN;AAIA,QAAMS,WAAW,GACfT,WAAW,IAAIL,KAAK,KAAK,cAAzB,gBACE;AAAK,IAAA,SAAS,EAAEZ,eAAM2B;AAAtB,kBACE,6BAAC,qDAAD;AAAU,IAAA,SAAS,EAAE3B,eAAM4B;AAA3B,IADF,eAEE;AAAK,IAAA,SAAS,EAAE5B,eAAM6B;AAAtB,KAAyCZ,WAAzC,CAFF,CADF,GAKI,IANN;AAOA,QAAMa,QAAQ,GACZlB,KAAK,KAAK,cAAV,gBACE;AACE,IAAA,SAAS,EAAEZ,eAAMW,IADnB,CAEE;AAFF;AAGE,IAAA,uBAAuB,EAAE;AAACoB,MAAAA,MAAM,EAAEjB,KAAK,IAAIH;AAAlB;AAH3B,IADF,GAMI,IAPN;AAQA,QAAMqB,aAAa,GAAGlB,KAAK,gBAAG,6BAAC,+BAAD;AAAW,IAAA,SAAS,EAAEd,eAAMiC;AAA5B,IAAH,GAA8C,IAAzE;AACA,QAAMC,aAAa,GAAGnB,KAAK,gBAAG,6BAAC,sCAAD;AAAW,IAAA,SAAS,EAAEf,eAAMiC;AAA5B,IAAH,GAA8C,IAAzE;AAEA,sBACE;AAAK,IAAA,SAAS,EAAE,yBAAWb,SAAX,EAAsBC,SAAtB,EAAiCH,QAAQ,IAAIlB,eAAMkB,QAAnD;AAAhB,kBACE,yDACE;AAAM,IAAA,SAAS,EAAE,yBAAWlB,eAAMM,KAAjB,EAAwB,uBAAQI,KAAR,KAAkBV,eAAMmC,OAAhD;AAAjB,KACG7B,KADH,EAEGoB,WAFH,CADF,eAKE;AACE,IAAA,IAAI,EAAElB,IADR;AAEE,IAAA,YAAY,EAAEE,KAFhB;AAGE,IAAA,WAAW,EAAED,WAHf;AAIE,IAAA,OAAO,EAAEa,YAJX;AAKE,IAAA,QAAQ,EAAEJ;AALZ,IALF,EAYGc,aAZH,EAaGE,aAbH,EAcGJ,QAdH,CADF,EAiBGL,eAjBH,CADF;AAqBD,CAjED;;AAmEArB,aAAa,CAACgC,SAAd,2CAA0B;AACxB3B,EAAAA,WAAW,EAAE4B,mBAAUC,MADC;AAExBhC,EAAAA,KAAK,EAAE+B,mBAAUC,MAFO;AAGxBtB,EAAAA,QAAQ,EAAEqB,mBAAUE,IAHI;AAIxB/B,EAAAA,IAAI,EAAE6B,mBAAUC,MAJQ;AAKxB1B,EAAAA,KAAK,EAAEyB,mBAAUG,KAAV,CAAgB,oBAAK1C,UAAL,CAAhB,CALiB;AAMxBoB,EAAAA,QAAQ,EAAEmB,mBAAUE,IANI;AAOxB7B,EAAAA,KAAK,EAAE2B,mBAAUC,MAPO;AAQxB3B,EAAAA,IAAI,EAAE0B,mBAAUC,MARQ;AASxBxB,EAAAA,KAAK,EAAEuB,mBAAUC,MATO;AAUxBzB,EAAAA,QAAQ,EAAEwB,mBAAUI,IAVI;AAWxBxB,EAAAA,WAAW,EAAEoB,mBAAUC,MAXC;AAYxBnB,EAAAA,QAAQ,EAAEkB,mBAAUE,IAZI;AAaxBxB,EAAAA,KAAK,EAAEsB,mBAAUE;AAbO,CAA1B;eAeenC,a","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, keys, isEmpty} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n coorpmanager: style.coorpmanager,\n cockpit: style.cockpit,\n default: style.default\n};\nconst InputTextarea = props => {\n const {\n title: propsTitle,\n name,\n placeholder,\n value,\n hint,\n theme = 'default',\n onChange = noop,\n error,\n valid,\n required,\n description,\n disabled,\n modified = false\n } = props;\n\n const title = `${propsTitle}${required ? '* ' : ' '}`;\n const mainClass = themeStyle[theme];\n const className = getClassState(style.default, style.modified, style.error, modified, error);\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n\n const descriptionView =\n description && theme !== 'coorpmanager' ? (\n <div className={style.description}>{description}</div>\n ) : null;\n const toolTipView =\n description && theme === 'coorpmanager' ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null;\n const hintView =\n theme === 'coorpmanager' ? (\n <div\n className={style.hint}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: error || hint}}\n />\n ) : null;\n const errorIconView = error ? <ErrorIcon className={style.leftIcon} /> : null;\n const validIconView = valid ? <CheckIcon className={style.leftIcon} /> : null;\n\n return (\n <div className={classnames(mainClass, className, disabled && style.disabled)}>\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {title}\n {toolTipView}\n </span>\n <textarea\n name={name}\n defaultValue={value}\n placeholder={placeholder}\n onInput={handleChange}\n disabled={disabled}\n />\n {errorIconView}\n {validIconView}\n {hintView}\n </label>\n {descriptionView}\n </div>\n );\n};\n\nInputTextarea.propTypes = {\n placeholder: PropTypes.string,\n title: PropTypes.string,\n required: PropTypes.bool,\n name: PropTypes.string,\n theme: PropTypes.oneOf(keys(themeStyle)),\n disabled: PropTypes.bool,\n value: PropTypes.string,\n hint: PropTypes.string,\n error: PropTypes.string,\n onChange: PropTypes.func,\n description: PropTypes.string,\n modified: PropTypes.bool,\n valid: PropTypes.bool\n};\nexport default InputTextarea;\n"],"file":"index.js"}
@@ -3,6 +3,15 @@
3
3
  @value medium from colors;
4
4
  @value light from colors;
5
5
  @value negative from colors;
6
+ @value xtraLightGrey from colors;
7
+ @value cm_positive_100 from colors;
8
+ @value cm_negative_100 from colors;
9
+ @value cm_grey_100 from colors;
10
+ @value cm_grey_150 from colors;
11
+ @value cm_grey_200 from colors;
12
+ @value cm_grey_400 from colors;
13
+ @value cm_grey_500 from colors;
14
+ @value cm_grey_700 from colors;
6
15
 
7
16
  .default {
8
17
  display: flex;
@@ -169,3 +178,259 @@
169
178
  align-self: flex-start;
170
179
  padding-left: 13px;
171
180
  }
181
+
182
+ /******************************* coorpmanager theme ***************************************/
183
+
184
+
185
+ .coorpmanager {
186
+ width: 300px;
187
+ position: relative;
188
+ display: flex;
189
+ flex-direction: column;
190
+ align-items: flex-start;
191
+ flex-wrap: nowrap;
192
+ }
193
+
194
+ .coorpmanager label {
195
+ display: flex;
196
+ flex-direction: column;
197
+ align-items: flex-start;
198
+ height: auto;
199
+ position: relative;
200
+ }
201
+
202
+ .coorpmanager .title {
203
+ flex-grow: 0;
204
+ font-family: Gilroy;
205
+ font-size: 10px;
206
+ font-weight: bold;
207
+ font-stretch: normal;
208
+ font-style: normal;
209
+ line-height: 1.2;
210
+ letter-spacing: normal;
211
+ text-align: left;
212
+ z-index: 1;
213
+ color: cm_grey_400;
214
+ width: auto;
215
+ transition: all 0.25s linear;
216
+ pointer-events: none;
217
+ display: flex;
218
+ flex-direction: row;
219
+ flex-wrap: nowrap;
220
+ top: 15px;
221
+ left: 16px;
222
+ position: absolute;
223
+ margin: 0;
224
+ }
225
+
226
+ .coorpmanager .title.noValue .infoIcon {
227
+ height: 10px;
228
+ width: 10px;
229
+ line-height: 12px;
230
+ color: cm_grey_500;
231
+ }
232
+
233
+ .coorpmanager textarea {
234
+ width: 285px;
235
+ min-height: 145px;
236
+ resize: vertical;
237
+ margin: 0px;
238
+ flex-grow: 0;
239
+ display: flex;
240
+ box-sizing: border-box;
241
+ flex-direction: column;
242
+ justify-content: center;
243
+ align-items: flex-start;
244
+ padding: 35px 0px 0px 17px;
245
+ border-radius: 7px;
246
+ background-color: transparent;
247
+ font-family: Gilroy;
248
+ font-size: 14px;
249
+ font-weight: 500;
250
+ font-stretch: normal;
251
+ font-style: normal;
252
+ line-height: 21px;
253
+ letter-spacing: normal;
254
+ text-align: left;
255
+ color: cm_grey_700;
256
+ border: none;
257
+ transition: all 0.25s linear;
258
+ outline: none;
259
+ display: flex;
260
+ margin: 0px 16px 13px 0px;
261
+ box-sizing: border-box;
262
+ position: relative;
263
+ }
264
+
265
+ .coorpmanager label::before {
266
+ content: '';
267
+ top: 0px;
268
+ bottom: 20px;
269
+ left: 0px;
270
+ right: 0px;
271
+ position: absolute;
272
+ background-color: cm_grey_100;
273
+ border-radius: 7px;
274
+ transition: all 0.25s linear;
275
+ }
276
+
277
+ .coorpmanager .title.noValue{
278
+ font-size: 14px;
279
+ font-weight: 500;
280
+ color: cm_grey_700;
281
+ }
282
+
283
+ .coorpmanager:focus-within .title.noValue {
284
+ font-size: 10px;
285
+ font-weight: bold;
286
+ color: cm_grey_400;
287
+ top: 15px;
288
+ }
289
+
290
+ .coorpmanager:focus-within textarea::placeholder {
291
+ color: cm_grey_400;
292
+ }
293
+
294
+ .coorpmanager:focus-within .title.noValue .infoIcon {
295
+ width: 8px;
296
+ height: 8px;
297
+ line-height: 12px;
298
+ color: cm_grey_400;
299
+ }
300
+
301
+
302
+
303
+ .coorpmanager label:hover:before {
304
+ background-color: cm_grey_150;
305
+ }
306
+
307
+ .coorpmanager textarea::placeholder {
308
+ color: transparent;
309
+ transition: all 0.25s linear;
310
+ }
311
+
312
+ .coorpmanager .hint {
313
+ flex-grow: 0;
314
+ opacity: 0.5;
315
+ font-family: Gilroy;
316
+ font-size: 10px;
317
+ font-weight: 500;
318
+ font-stretch: normal;
319
+ font-style: normal;
320
+ line-height: 1.2;
321
+ letter-spacing: normal;
322
+ text-align: left;
323
+ padding-top: 8px;
324
+ color: cm_grey_700;
325
+ height: 12px;
326
+ }
327
+
328
+ .coorpmanager.error .hint {
329
+ color: cm_negative_100;
330
+ }
331
+
332
+ .coorpmanager.error .leftIcon {
333
+ background-color: cm_negative_100;
334
+ color: white;
335
+ border-radius: 50%;
336
+ padding: 2px;
337
+ width: 11px;
338
+ height: 11px;
339
+ right: 17px;
340
+ top: 13px;
341
+ }
342
+
343
+ .coorpmanager .leftIcon {
344
+ color: cm_positive_100;
345
+ width: 17px;
346
+ height: 17px;
347
+ position: absolute;
348
+ right: 15px;
349
+ top: 12px;
350
+ }
351
+
352
+ .coorpmanager.disabled {
353
+ opacity: 0.5;
354
+ }
355
+
356
+ .coorpmanager .infoIconWrapper {
357
+ overflow: visible;
358
+ height: 12px;
359
+ margin: 0px 4px;
360
+ cursor: pointer;
361
+ pointer-events: fill;
362
+ position: relative;
363
+ }
364
+
365
+ .coorpmanager .infoIcon {
366
+ cursor: pointer;
367
+ width: 8px;
368
+ height: 8px;
369
+ line-height: 16px;
370
+ color: cm_grey_400;
371
+ transition: all 0.25s linear;
372
+ }
373
+
374
+ .coorpmanager .infoIconWrapper:hover .descriptionLabel {
375
+ visibility: visible;
376
+ opacity: 1;
377
+ }
378
+
379
+ .coorpmanager .descriptionLabel {
380
+ margin: 0 1px 18px 0;
381
+ padding: 8px 16px;
382
+ border-radius: 7px;
383
+ background-color: cm_grey_700;
384
+ flex-grow: 0;
385
+ font-family: Gilroy;
386
+ font-size: 14px;
387
+ font-weight: 500;
388
+ font-stretch: normal;
389
+ font-style: normal;
390
+ line-height: 1.43;
391
+ letter-spacing: normal;
392
+ text-align: center;
393
+ color: white;
394
+ padding: 8px 16px;
395
+ max-width: 200px;
396
+ position: absolute;
397
+ left: -24px;
398
+ z-index: 3;
399
+ bottom: 5px;
400
+ width: max-content;
401
+ visibility: hidden;
402
+ opacity: 0s
403
+ }
404
+
405
+ .coorpmanager .descriptionLabel::after{
406
+ content:'';
407
+ border-left: 6px solid transparent;
408
+ border-right: 6px solid transparent;
409
+ border-top: 6px solid cm_grey_700;
410
+ position: absolute;
411
+ bottom: -6px;
412
+ left: 21px;
413
+ }
414
+ .coorpmanager .title.noValue .descriptionLabel::after{
415
+ left: 22px;
416
+ }
417
+ .coorpmanager:focus-within .title.noValue .descriptionLabel::after{
418
+ left: 21px;
419
+ }
420
+ .coorpmanager textarea::-webkit-resizer {
421
+ background: repeating-linear-gradient(
422
+ 135deg,
423
+ transparent,
424
+ transparent 14px,
425
+ cm_grey_400 14px,
426
+ cm_grey_400 15.5px,
427
+ transparent 15.5px,
428
+ transparent 17px,
429
+ cm_grey_400 17px,
430
+ cm_grey_400 18.5px,
431
+ transparent 18.5px,
432
+ transparent 20px,
433
+ cm_grey_400 20px,
434
+ cm_grey_400 21.5px
435
+ );
436
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _default = {
6
+ props: {
7
+ type: 'textarea',
8
+ title: 'Input name',
9
+ hint: 'Hint <span style="color:red;">10<span>/40',
10
+ placeholder: 'This is an input',
11
+ theme: 'coorpmanager',
12
+ description: 'This is the tooltip text',
13
+ value: 'This is an input',
14
+ disabled: false,
15
+ valid: false,
16
+ error: '',
17
+ required: true,
18
+ onChange: value => console.log(value)
19
+ }
20
+ };
21
+ exports.default = _default;
22
+ //# sourceMappingURL=cm-default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/input-textarea/test/fixtures/cm-default.js"],"names":["props","type","title","hint","placeholder","theme","description","value","disabled","valid","error","required","onChange","console","log"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,UADD;AAELC,IAAAA,KAAK,EAAE,YAFF;AAGLC,IAAAA,IAAI,EAAE,2CAHD;AAILC,IAAAA,WAAW,EAAE,kBAJR;AAKLC,IAAAA,KAAK,EAAE,cALF;AAMLC,IAAAA,WAAW,EAAE,0BANR;AAOLC,IAAAA,KAAK,EAAE,kBAPF;AAQLC,IAAAA,QAAQ,EAAE,KARL;AASLC,IAAAA,KAAK,EAAE,KATF;AAULC,IAAAA,KAAK,EAAE,EAVF;AAWLC,IAAAA,QAAQ,EAAE,IAXL;AAYLC,IAAAA,QAAQ,EAAEL,KAAK,IAAIM,OAAO,CAACC,GAAR,CAAYP,KAAZ;AAZd;AADM,C","sourcesContent":["export default {\n props: {\n type: 'textarea',\n title: 'Input name',\n hint: 'Hint <span style=\"color:red;\">10<span>/40',\n placeholder: 'This is an input',\n theme: 'coorpmanager',\n description: 'This is the tooltip text',\n value: 'This is an input',\n disabled: false,\n valid: false,\n error: '',\n required: true,\n onChange: value => console.log(value)\n }\n};\n"],"file":"cm-default.js"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _default = {
6
+ props: {
7
+ type: 'textarea',
8
+ title: 'Input name',
9
+ hint: 'Hint <span style="color:red;">10<span>/40',
10
+ placeholder: 'This is an input',
11
+ theme: 'coorpmanager',
12
+ description: 'This is the tooltip text',
13
+ value: '',
14
+ disabled: false,
15
+ valid: false,
16
+ error: '',
17
+ required: true,
18
+ onChange: value => console.log(value)
19
+ }
20
+ };
21
+ exports.default = _default;
22
+ //# sourceMappingURL=cm-empty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/input-textarea/test/fixtures/cm-empty.js"],"names":["props","type","title","hint","placeholder","theme","description","value","disabled","valid","error","required","onChange","console","log"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,UADD;AAELC,IAAAA,KAAK,EAAE,YAFF;AAGLC,IAAAA,IAAI,EAAE,2CAHD;AAILC,IAAAA,WAAW,EAAE,kBAJR;AAKLC,IAAAA,KAAK,EAAE,cALF;AAMLC,IAAAA,WAAW,EAAE,0BANR;AAOLC,IAAAA,KAAK,EAAE,EAPF;AAQLC,IAAAA,QAAQ,EAAE,KARL;AASLC,IAAAA,KAAK,EAAE,KATF;AAULC,IAAAA,KAAK,EAAE,EAVF;AAWLC,IAAAA,QAAQ,EAAE,IAXL;AAYLC,IAAAA,QAAQ,EAAEL,KAAK,IAAIM,OAAO,CAACC,GAAR,CAAYP,KAAZ;AAZd;AADM,C","sourcesContent":["export default {\n props: {\n type: 'textarea',\n title: 'Input name',\n hint: 'Hint <span style=\"color:red;\">10<span>/40',\n placeholder: 'This is an input',\n theme: 'coorpmanager',\n description: 'This is the tooltip text',\n value: '',\n disabled: false,\n valid: false,\n error: '',\n required: true,\n onChange: value => console.log(value)\n }\n};\n"],"file":"cm-empty.js"}
@@ -8,11 +8,7 @@ var _renderComponent = _interopRequireDefault(require("../../../test/helpers/ren
8
8
 
9
9
  var _ = _interopRequireDefault(require(".."));
10
10
 
11
- var _formGroupTitleWithoutSubtitle = _interopRequireDefault(require("./fixtures/form-group-title-without-subtitle"));
12
-
13
- var _formGroupTitle = _interopRequireDefault(require("./fixtures/form-group-title"));
14
-
15
- var _pageTitle = _interopRequireDefault(require("./fixtures/page-title"));
11
+ var _fixture = _interopRequireDefault(require("./fixtures/fixture"));
16
12
 
17
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
14
 
@@ -22,7 +18,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
22
18
  t.not(value, undefined, `PropType for "Atom.AtomTitle.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
23
19
  });
24
20
  });
25
- (0, _ava.default)('Atom › AtomTitle › FormGroupTitleWithoutSubtitle › should be rendered', _renderComponent.default, _.default, _formGroupTitleWithoutSubtitle.default);
26
- (0, _ava.default)('Atom › AtomTitle › FormGroupTitle › should be rendered', _renderComponent.default, _.default, _formGroupTitle.default);
27
- (0, _ava.default)('Atom › AtomTitle › PageTitle › should be rendered', _renderComponent.default, _.default, _pageTitle.default);
21
+ (0, _ava.default)('Atom › AtomTitle › Fixture › should be rendered', _renderComponent.default, _.default, _fixture.default);
28
22
  //# sourceMappingURL=fixtures.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/atom/title/test/fixtures.js"],"names":["t","pass","AtomTitle","propTypes","value","key","not","undefined","renderComponentMacro","fixtureFormGroupTitleWithoutSubtitle","fixtureFormGroupTitle","fixturePageTitle"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,gDAAL,EAAuDA,CAAC,IAAI;AAC1DA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAUC,SAAlB,EAA6B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC3CL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0CAAyCF,GAAI,mEAAtE;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,uEAAL,EAA8EG,wBAA9E,EAAoGN,SAApG,EAA+GO,sCAA/G;AACA,kBAAK,wDAAL,EAA+DD,wBAA/D,EAAqFN,SAArF,EAAgGQ,uBAAhG;AACA,kBAAK,mDAAL,EAA0DF,wBAA1D,EAAgFN,SAAhF,EAA2FS,kBAA3F","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomTitle from '..';\nimport fixtureFormGroupTitleWithoutSubtitle from './fixtures/form-group-title-without-subtitle';\nimport fixtureFormGroupTitle from './fixtures/form-group-title';\nimport fixturePageTitle from './fixtures/page-title';\n\ntest('Atom › AtomTitle > should have valid propTypes', t => {\n t.pass();\n forEach(AtomTitle.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomTitle.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomTitle › FormGroupTitleWithoutSubtitle › should be rendered', renderComponentMacro, AtomTitle, fixtureFormGroupTitleWithoutSubtitle);\ntest('Atom › AtomTitle › FormGroupTitle › should be rendered', renderComponentMacro, AtomTitle, fixtureFormGroupTitle);\ntest('Atom › AtomTitle › PageTitle › should be rendered', renderComponentMacro, AtomTitle, fixturePageTitle);\n"],"file":"fixtures.js"}
1
+ {"version":3,"sources":["../../../../src/atom/title/test/fixtures.js"],"names":["t","pass","AtomTitle","propTypes","value","key","not","undefined","renderComponentMacro","fixtureFixture"],"mappings":";;AAAA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,kBAAK,gDAAL,EAAuDA,CAAC,IAAI;AAC1DA,EAAAA,CAAC,CAACC,IAAF;AACA,wBAAQC,UAAUC,SAAlB,EAA6B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC3CL,IAAAA,CAAC,CAACM,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0CAAyCF,GAAI,mEAAtE;AACD,GAFD;AAGD,CALD;AAOA,kBAAK,iDAAL,EAAwDG,wBAAxD,EAA8EN,SAA9E,EAAyFO,gBAAzF","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomTitle from '..';\nimport fixtureFixture from './fixtures/fixture';\n\ntest('Atom › AtomTitle > should have valid propTypes', t => {\n t.pass();\n forEach(AtomTitle.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomTitle.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomTitle › Fixture › should be rendered', renderComponentMacro, AtomTitle, fixtureFixture);\n"],"file":"fixtures.js"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _react = _interopRequireDefault(require("react"));
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+
12
+ var _novaIcons = require("@coorpacademy/nova-icons");
13
+
14
+ var _link = _interopRequireDefault(require("../../atom/link"));
15
+
16
+ var _style = _interopRequireDefault(require("./style.css"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ const Banner = props => {
21
+ const {
22
+ type,
23
+ message,
24
+ firstCTA,
25
+ firstCTALabel,
26
+ secondCTALabel,
27
+ secondCTA
28
+ } = props;
29
+ return /*#__PURE__*/_react.default.createElement("div", {
30
+ className: (0, _classnames.default)(_style.default.banner, type === 'error' && _style.default.errorBanner)
31
+ }, /*#__PURE__*/_react.default.createElement("div", {
32
+ "data-name": `${type}-banner-message`,
33
+ className: _style.default.message
34
+ }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidInterfaceFeedbackInterfaceAlertDiamond, {
35
+ className: _style.default.icon
36
+ }), message), firstCTALabel ? /*#__PURE__*/_react.default.createElement(_link.default, {
37
+ "data-name": "first-banner-cta",
38
+ className: _style.default.button,
39
+ onClick: firstCTA
40
+ }, firstCTALabel) : null, firstCTALabel && secondCTALabel ? /*#__PURE__*/_react.default.createElement("div", {
41
+ className: _style.default.buttonsBar
42
+ }) : null, secondCTALabel ? /*#__PURE__*/_react.default.createElement(_link.default, {
43
+ "data-name": "second-banner-cta",
44
+ className: _style.default.button,
45
+ onClick: secondCTA
46
+ }, secondCTALabel) : null);
47
+ };
48
+
49
+ Banner.propTypes = process.env.NODE_ENV !== "production" ? {
50
+ type: _propTypes.default.oneOf(['information', 'error']),
51
+ message: _propTypes.default.string.isRequired,
52
+ firstCTA: _propTypes.default.func,
53
+ firstCTALabel: _propTypes.default.string,
54
+ secondCTALabel: _propTypes.default.string,
55
+ secondCTA: _propTypes.default.func
56
+ } : {};
57
+ var _default = Banner;
58
+ exports.default = _default;
59
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/molecule/banner/index.js"],"names":["Banner","props","type","message","firstCTA","firstCTALabel","secondCTALabel","secondCTA","style","banner","errorBanner","icon","button","buttonsBar","propTypes","PropTypes","oneOf","string","isRequired","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,MAAM,GAAGC,KAAK,IAAI;AACtB,QAAM;AAACC,IAAAA,IAAD;AAAOC,IAAAA,OAAP;AAAgBC,IAAAA,QAAhB;AAA0BC,IAAAA,aAA1B;AAAyCC,IAAAA,cAAzC;AAAyDC,IAAAA;AAAzD,MAAsEN,KAA5E;AACA,sBACE;AAAK,IAAA,SAAS,EAAE,yBAAWO,eAAMC,MAAjB,EAAyBP,IAAI,KAAK,OAAT,IAAoBM,eAAME,WAAnD;AAAhB,kBACE;AAAK,iBAAY,GAAER,IAAK,iBAAxB;AAA0C,IAAA,SAAS,EAAEM,eAAML;AAA3D,kBACE,6BAAC,0DAAD;AAAc,IAAA,SAAS,EAAEK,eAAMG;AAA/B,IADF,EAEGR,OAFH,CADF,EAKGE,aAAa,gBACZ,6BAAC,aAAD;AAAM,iBAAU,kBAAhB;AAAmC,IAAA,SAAS,EAAEG,eAAMI,MAApD;AAA4D,IAAA,OAAO,EAAER;AAArE,KACGC,aADH,CADY,GAIV,IATN,EAUGA,aAAa,IAAIC,cAAjB,gBAAkC;AAAK,IAAA,SAAS,EAAEE,eAAMK;AAAtB,IAAlC,GAAyE,IAV5E,EAWGP,cAAc,gBACb,6BAAC,aAAD;AAAM,iBAAU,mBAAhB;AAAoC,IAAA,SAAS,EAAEE,eAAMI,MAArD;AAA6D,IAAA,OAAO,EAAEL;AAAtE,KACGD,cADH,CADa,GAIX,IAfN,CADF;AAmBD,CArBD;;AAuBAN,MAAM,CAACc,SAAP,2CAAmB;AACjBZ,EAAAA,IAAI,EAAEa,mBAAUC,KAAV,CAAgB,CAAC,aAAD,EAAgB,OAAhB,CAAhB,CADW;AAEjBb,EAAAA,OAAO,EAAEY,mBAAUE,MAAV,CAAiBC,UAFT;AAGjBd,EAAAA,QAAQ,EAAEW,mBAAUI,IAHH;AAIjBd,EAAAA,aAAa,EAAEU,mBAAUE,MAJR;AAKjBX,EAAAA,cAAc,EAAES,mBAAUE,MALT;AAMjBV,EAAAA,SAAS,EAAEQ,mBAAUI;AANJ,CAAnB;eASenB,M","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {NovaSolidInterfaceFeedbackInterfaceAlertDiamond as QuestionIcon} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport style from './style.css';\n\nconst Banner = props => {\n const {type, message, firstCTA, firstCTALabel, secondCTALabel, secondCTA} = props;\n return (\n <div className={classnames(style.banner, type === 'error' && style.errorBanner)}>\n <div data-name={`${type}-banner-message`} className={style.message}>\n <QuestionIcon className={style.icon} />\n {message}\n </div>\n {firstCTALabel ? (\n <Link data-name=\"first-banner-cta\" className={style.button} onClick={firstCTA}>\n {firstCTALabel}\n </Link>\n ) : null}\n {firstCTALabel && secondCTALabel ? <div className={style.buttonsBar} /> : null}\n {secondCTALabel ? (\n <Link data-name=\"second-banner-cta\" className={style.button} onClick={secondCTA}>\n {secondCTALabel}\n </Link>\n ) : null}\n </div>\n );\n};\n\nBanner.propTypes = {\n type: PropTypes.oneOf(['information', 'error']),\n message: PropTypes.string.isRequired,\n firstCTA: PropTypes.func,\n firstCTALabel: PropTypes.string,\n secondCTALabel: PropTypes.string,\n secondCTA: PropTypes.func\n};\n\nexport default Banner;\n"],"file":"index.js"}