@coorpacademy/components 11.12.5-alpha.0 → 11.12.6

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 (67) hide show
  1. package/es/atom/battle-opponent/index.d.ts.map +1 -1
  2. package/es/atom/battle-opponent/index.js +4 -2
  3. package/es/atom/battle-opponent/index.js.map +1 -1
  4. package/es/atom/battle-opponent/style.css +12 -0
  5. package/es/atom/button/index.d.ts +14 -3
  6. package/es/atom/button/index.d.ts.map +1 -1
  7. package/es/atom/button/index.js +60 -27
  8. package/es/atom/button/index.js.map +1 -1
  9. package/es/atom/drag-and-drop/index.d.ts.map +1 -1
  10. package/es/atom/drag-and-drop/index.js +29 -17
  11. package/es/atom/drag-and-drop/index.js.map +1 -1
  12. package/es/atom/drag-and-drop/style.css +4 -3
  13. package/es/atom/image-upload/index.js +1 -1
  14. package/es/atom/image-upload/index.js.map +1 -1
  15. package/es/atom/tooltip/index.d.ts.map +1 -1
  16. package/es/atom/tooltip/index.js +2 -1
  17. package/es/atom/tooltip/index.js.map +1 -1
  18. package/es/molecule/brand-form-group/index.d.ts +14 -3
  19. package/es/molecule/brand-form-group/style.css +11 -7
  20. package/es/molecule/card/customer.js +1 -1
  21. package/es/molecule/card/customer.js.map +1 -1
  22. package/es/molecule/card/favorite.css +15 -35
  23. package/es/molecule/card/favorite.d.ts +1 -0
  24. package/es/molecule/card/favorite.d.ts.map +1 -1
  25. package/es/molecule/card/favorite.js +73 -18
  26. package/es/molecule/card/favorite.js.map +1 -1
  27. package/es/molecule/card/selectable.js +1 -1
  28. package/es/molecule/card/selectable.js.map +1 -1
  29. package/es/molecule/drag-and-drop-wrapper/style.css +1 -1
  30. package/es/organism/brand-form/index.d.ts +14 -3
  31. package/es/organism/wizard-contents/index.d.ts +14 -3
  32. package/es/template/back-office/brand-update/index.d.ts +28 -6
  33. package/es/template/common/search-page/index.d.ts +14 -3
  34. package/lib/atom/battle-opponent/index.d.ts.map +1 -1
  35. package/lib/atom/battle-opponent/index.js +4 -2
  36. package/lib/atom/battle-opponent/index.js.map +1 -1
  37. package/lib/atom/battle-opponent/style.css +12 -0
  38. package/lib/atom/button/index.d.ts +14 -3
  39. package/lib/atom/button/index.d.ts.map +1 -1
  40. package/lib/atom/button/index.js +65 -27
  41. package/lib/atom/button/index.js.map +1 -1
  42. package/lib/atom/drag-and-drop/index.d.ts.map +1 -1
  43. package/lib/atom/drag-and-drop/index.js +29 -17
  44. package/lib/atom/drag-and-drop/index.js.map +1 -1
  45. package/lib/atom/drag-and-drop/style.css +4 -3
  46. package/lib/atom/image-upload/index.js +1 -1
  47. package/lib/atom/image-upload/index.js.map +1 -1
  48. package/lib/atom/tooltip/index.d.ts.map +1 -1
  49. package/lib/atom/tooltip/index.js +2 -1
  50. package/lib/atom/tooltip/index.js.map +1 -1
  51. package/lib/molecule/brand-form-group/index.d.ts +14 -3
  52. package/lib/molecule/brand-form-group/style.css +11 -7
  53. package/lib/molecule/card/customer.js +1 -1
  54. package/lib/molecule/card/customer.js.map +1 -1
  55. package/lib/molecule/card/favorite.css +15 -35
  56. package/lib/molecule/card/favorite.d.ts +1 -0
  57. package/lib/molecule/card/favorite.d.ts.map +1 -1
  58. package/lib/molecule/card/favorite.js +75 -16
  59. package/lib/molecule/card/favorite.js.map +1 -1
  60. package/lib/molecule/card/selectable.js +1 -1
  61. package/lib/molecule/card/selectable.js.map +1 -1
  62. package/lib/molecule/drag-and-drop-wrapper/style.css +1 -1
  63. package/lib/organism/brand-form/index.d.ts +14 -3
  64. package/lib/organism/wizard-contents/index.d.ts +14 -3
  65. package/lib/template/back-office/brand-update/index.d.ts +28 -6
  66. package/lib/template/common/search-page/index.d.ts +14 -3
  67. package/package.json +2 -2
@@ -386,16 +386,27 @@ declare namespace BrandFormGroup {
386
386
  color: any;
387
387
  submitValue: PropTypes.Requireable<string>;
388
388
  disabled: PropTypes.Requireable<boolean>;
389
- isLinkDisabled: PropTypes.Requireable<boolean>;
390
389
  href: PropTypes.Requireable<string>;
391
390
  download: PropTypes.Requireable<boolean>;
392
391
  target: PropTypes.Requireable<string>;
393
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
394
392
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
395
393
  className: PropTypes.Requireable<string>;
396
- buttonContentClassName: PropTypes.Requireable<string>;
397
394
  style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
398
395
  'data-name': PropTypes.Requireable<string>;
396
+ 'aria-label': PropTypes.Requireable<string>;
397
+ 'data-testid': PropTypes.Requireable<string>;
398
+ useButtonTag: PropTypes.Requireable<boolean>;
399
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
400
+ onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
401
+ onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
402
+ onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
403
+ buttonRef: PropTypes.Requireable<PropTypes.InferProps<{}>>;
404
+ 'data-for': PropTypes.Requireable<string>;
405
+ 'data-tooltip-place': PropTypes.Requireable<string>;
406
+ 'data-tip': PropTypes.Requireable<boolean>;
407
+ isLinkDisabled: PropTypes.Requireable<boolean>;
408
+ useWrapper: PropTypes.Requireable<boolean>;
409
+ buttonContentClassName: PropTypes.Requireable<string>;
399
410
  }> | PropTypes.InferProps<{
400
411
  buttonType: PropTypes.Requireable<string>;
401
412
  type: PropTypes.Requireable<string>;
@@ -42,10 +42,16 @@
42
42
  justify-content: space-evenly;
43
43
  }
44
44
 
45
+ .grid .field {
46
+ margin-right: 20px;
47
+ }
48
+
45
49
  .field {
46
- display: flex;
47
- margin: 0 32px 64px 0;
48
- flex: 1 0 0;
50
+ margin-bottom: 10px;
51
+ }
52
+
53
+ .field:last-child {
54
+ margin-bottom: 0;
49
55
  }
50
56
 
51
57
 
@@ -71,8 +77,8 @@
71
77
  .imageUploadContainer {
72
78
  display: flex;
73
79
  flex-direction: column;
74
- width: 100%;
75
- min-width: 230px;
80
+ height: 300px;
81
+ width: 360px;
76
82
  }
77
83
 
78
84
  @media desktop {
@@ -81,8 +87,6 @@
81
87
  }
82
88
 
83
89
  .groupGrid .grid {
84
- display: flex;
85
- flex-direction: row;
86
90
  justify-content: flex-start;
87
91
  margin-top: 0;
88
92
  }
@@ -27,7 +27,7 @@ const Customer = props => {
27
27
  type,
28
28
  coorpOriginal,
29
29
  theme,
30
- disabled = false,
30
+ disabled,
31
31
  'aria-label': ariaLabel
32
32
  } = props;
33
33
  const className = (0, _classnames.default)(THEMES[theme], _customer.default.customer, type === 'chapter' ? _customer.default.chapterCustomer : null);
@@ -1 +1 @@
1
- {"version":3,"file":"customer.js","names":["THEMES","default","coorpmanager","style","Customer","props","name","type","coorpOriginal","theme","disabled","ariaLabel","className","classnames","customer","chapterCustomer","content","coorp","original","propTypes","PropTypes","oneOf","string","bool","isRequired"],"sources":["../../../src/molecule/card/customer.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport style from './customer.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst Customer = props => {\n const {name, type, coorpOriginal, theme, disabled = false, 'aria-label': ariaLabel} = props;\n const className = classnames(\n THEMES[theme],\n style.customer,\n type === 'chapter' ? style.chapterCustomer : null\n );\n\n return (\n <div className={className} disabled={disabled} aria-label={ariaLabel}>\n <div className={style.content}>\n {coorpOriginal ? <span className={style.coorp}>Coorp </span> : null}\n {coorpOriginal ? <span className={style.original}>Original </span> : null}\n {!coorpOriginal && name}\n </div>\n </div>\n );\n};\n\nCustomer.propTypes = {\n theme: PropTypes.oneOf(keys(THEMES)),\n type: PropTypes.string,\n name: PropTypes.string,\n coorpOriginal: PropTypes.bool.isRequired,\n disabled: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Customer;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;AAEO,MAAMA,MAAM,GAAG;EACpBC,OAAO,EAAE,IADW;EAEpBC,YAAY,EAAEC,iBAAA,CAAMD;AAFA,CAAf;;;AAKP,MAAME,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAM;IAACC,IAAD;IAAOC,IAAP;IAAaC,aAAb;IAA4BC,KAA5B;IAAmCC,QAAQ,GAAG,KAA9C;IAAqD,cAAcC;EAAnE,IAAgFN,KAAtF;EACA,MAAMO,SAAS,GAAG,IAAAC,mBAAA,EAChBb,MAAM,CAACS,KAAD,CADU,EAEhBN,iBAAA,CAAMW,QAFU,EAGhBP,IAAI,KAAK,SAAT,GAAqBJ,iBAAA,CAAMY,eAA3B,GAA6C,IAH7B,CAAlB;EAMA,oBACE;IAAK,SAAS,EAAEH,SAAhB;IAA2B,QAAQ,EAAEF,QAArC;IAA+C,cAAYC;EAA3D,gBACE;IAAK,SAAS,EAAER,iBAAA,CAAMa;EAAtB,GACGR,aAAa,gBAAG;IAAM,SAAS,EAAEL,iBAAA,CAAMc;EAAvB,YAAH,GAAiD,IADjE,EAEGT,aAAa,gBAAG;IAAM,SAAS,EAAEL,iBAAA,CAAMe;EAAvB,eAAH,GAAuD,IAFvE,EAGG,CAACV,aAAD,IAAkBF,IAHrB,CADF,CADF;AASD,CAjBD;;AAmBAF,QAAQ,CAACe,SAAT,2CAAqB;EACnBV,KAAK,EAAEW,kBAAA,CAAUC,KAAV,CAAgB,oBAAKrB,MAAL,CAAhB,CADY;EAEnBO,IAAI,EAAEa,kBAAA,CAAUE,MAFG;EAGnBhB,IAAI,EAAEc,kBAAA,CAAUE,MAHG;EAInBd,aAAa,EAAEY,kBAAA,CAAUG,IAAV,CAAeC,UAJX;EAKnBd,QAAQ,EAAEU,kBAAA,CAAUG,IALD;EAMnB,cAAcH,kBAAA,CAAUE;AANL,CAArB;eASelB,Q"}
1
+ {"version":3,"file":"customer.js","names":["THEMES","default","coorpmanager","style","Customer","props","name","type","coorpOriginal","theme","disabled","ariaLabel","className","classnames","customer","chapterCustomer","content","coorp","original","propTypes","PropTypes","oneOf","string","bool","isRequired"],"sources":["../../../src/molecule/card/customer.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport style from './customer.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst Customer = props => {\n const {name, type, coorpOriginal, theme, disabled, 'aria-label': ariaLabel} = props;\n const className = classnames(\n THEMES[theme],\n style.customer,\n type === 'chapter' ? style.chapterCustomer : null\n );\n\n return (\n <div className={className} disabled={disabled} aria-label={ariaLabel}>\n <div className={style.content}>\n {coorpOriginal ? <span className={style.coorp}>Coorp </span> : null}\n {coorpOriginal ? <span className={style.original}>Original </span> : null}\n {!coorpOriginal && name}\n </div>\n </div>\n );\n};\n\nCustomer.propTypes = {\n theme: PropTypes.oneOf(keys(THEMES)),\n type: PropTypes.string,\n name: PropTypes.string,\n coorpOriginal: PropTypes.bool.isRequired,\n disabled: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Customer;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;AAEO,MAAMA,MAAM,GAAG;EACpBC,OAAO,EAAE,IADW;EAEpBC,YAAY,EAAEC,iBAAA,CAAMD;AAFA,CAAf;;;AAKP,MAAME,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAM;IAACC,IAAD;IAAOC,IAAP;IAAaC,aAAb;IAA4BC,KAA5B;IAAmCC,QAAnC;IAA6C,cAAcC;EAA3D,IAAwEN,KAA9E;EACA,MAAMO,SAAS,GAAG,IAAAC,mBAAA,EAChBb,MAAM,CAACS,KAAD,CADU,EAEhBN,iBAAA,CAAMW,QAFU,EAGhBP,IAAI,KAAK,SAAT,GAAqBJ,iBAAA,CAAMY,eAA3B,GAA6C,IAH7B,CAAlB;EAMA,oBACE;IAAK,SAAS,EAAEH,SAAhB;IAA2B,QAAQ,EAAEF,QAArC;IAA+C,cAAYC;EAA3D,gBACE;IAAK,SAAS,EAAER,iBAAA,CAAMa;EAAtB,GACGR,aAAa,gBAAG;IAAM,SAAS,EAAEL,iBAAA,CAAMc;EAAvB,YAAH,GAAiD,IADjE,EAEGT,aAAa,gBAAG;IAAM,SAAS,EAAEL,iBAAA,CAAMe;EAAvB,eAAH,GAAuD,IAFvE,EAGG,CAACV,aAAD,IAAkBF,IAHrB,CADF,CADF;AASD,CAjBD;;AAmBAF,QAAQ,CAACe,SAAT,2CAAqB;EACnBV,KAAK,EAAEW,kBAAA,CAAUC,KAAV,CAAgB,oBAAKrB,MAAL,CAAhB,CADY;EAEnBO,IAAI,EAAEa,kBAAA,CAAUE,MAFG;EAGnBhB,IAAI,EAAEc,kBAAA,CAAUE,MAHG;EAInBd,aAAa,EAAEY,kBAAA,CAAUG,IAAV,CAAeC,UAJX;EAKnBd,QAAQ,EAAEU,kBAAA,CAAUG,IALD;EAMnB,cAAcH,kBAAA,CAAUE;AANL,CAArB;eASelB,Q"}
@@ -16,10 +16,12 @@
16
16
  z-index: 1;
17
17
  font-size: 30px;
18
18
  overflow: hidden;
19
- line-height: 20px;
19
+ line-height: 0px;
20
20
  box-shadow: 0 0 13px 0 rgba(0, 0, 0, 0.11);
21
21
  background-color: #ffffff;
22
22
  border-radius: 100%;
23
+ border: none;
24
+ padding: 0;
23
25
  }
24
26
 
25
27
  .favorite:hover .moreIcon {
@@ -29,10 +31,6 @@
29
31
  .favorite .moreIcon {
30
32
  color: color(black a(63%));
31
33
  transition: color 0.25s ease-in-out;
32
- margin: 6px;
33
- }
34
- .favorite .checkIcon {
35
- margin: 6px;
36
34
  }
37
35
 
38
36
  .favorite.selected .moreIcon {
@@ -47,48 +45,30 @@
47
45
  color: inherit;
48
46
  }
49
47
 
50
- .showToolTip {
51
- visibility: hidden;
52
- background-color: color(black a(80%));
53
- color: #fff;
54
- text-align: center;
55
- border-radius: 3px;
56
- z-index: 1;
57
- opacity: 0;
58
- transition: opacity 0.8s;
48
+ .favoriteWrapper {
59
49
  position: absolute;
60
- max-width: 104px;
61
- right: 45px;
62
- top: 8px;
50
+ width: 100%;
63
51
  }
64
52
 
65
- .showToolTip::after {
66
- content: "";
67
- position: absolute;
68
- top: 8px;
69
- left: 100%;
70
- border: solid 5px ;
71
- border-color: transparent transparent transparent color(black a(80%));
53
+ .favoriteWrapper .favorite + [class*="__react_component_tooltip"]:not([class*="toolTipReact"]) {
54
+ position: sticky;
55
+ top: unset !important;
56
+ left: unset !important;
57
+ transform: translateX(25%);
72
58
  }
73
59
 
74
- .blocFavorite:hover .showToolTip {
75
- visibility: visible;
76
- opacity: 1;
60
+ .favoriteWrapper .favorite + [class*="__react_component_tooltip"] {
61
+ opacity: 0.95!important;
77
62
  }
78
63
 
79
- .showToolTip span {
80
- display: block;
81
- word-wrap: break-word;
82
- padding: 3px 10px 5px;
83
- font-family: "Gilroy";
84
- font-size: 12px;
85
- font-weight: bold;
86
- }
87
64
 
88
65
  @media mobile {
89
66
  .favorite {
90
67
  font-size: 33px;
91
68
  }
69
+ .favoriteWrapper .favorite + [class*="__react_component_tooltip"]:not([class*="toolTipReact"]) {
70
+ transform: translateX(10%);
71
+ }
92
72
  }
93
73
 
94
74
  @media (hover: none) {
@@ -44,6 +44,7 @@ declare namespace Favorite {
44
44
  [x: string]: any;
45
45
  }>;
46
46
  }>>;
47
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
47
48
  }
48
49
  }
49
50
  import PropTypes from "prop-types";
@@ -1 +1 @@
1
- {"version":3,"file":"favorite.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/favorite.js"],"names":[],"mappings":";AAWA;;;;;;;;oCAoEC"}
1
+ {"version":3,"file":"favorite.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/favorite.js"],"names":[],"mappings":";AAcA;;;;;;;;oCA0IC"}
@@ -7,6 +7,8 @@ var _noop2 = _interopRequireDefault(require("lodash/fp/noop"));
7
7
 
8
8
  var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
9
9
 
10
+ var _has2 = _interopRequireDefault(require("lodash/fp/has"));
11
+
10
12
  var _get2 = _interopRequireDefault(require("lodash/fp/get"));
11
13
 
12
14
  var _react = _interopRequireWildcard(require("react"));
@@ -15,10 +17,16 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
15
17
 
16
18
  var _classnames = _interopRequireDefault(require("classnames"));
17
19
 
20
+ var _uuid = require("uuid");
21
+
18
22
  var _novaIcons = require("@coorpacademy/nova-icons");
19
23
 
20
24
  var _provider = _interopRequireWildcard(require("../../atom/provider"));
21
25
 
26
+ var _tooltip = _interopRequireWildcard(require("../../atom/tooltip"));
27
+
28
+ var _button = _interopRequireDefault(require("../../atom/button"));
29
+
22
30
  var _favorite = _interopRequireDefault(require("./favorite.css"));
23
31
 
24
32
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -37,6 +45,7 @@ const Favorite = ({
37
45
  disabled
38
46
  }, legacyContext) => {
39
47
  const skin = (0, _provider.GetSkinFromContext)(legacyContext);
48
+ const translate = (0, _provider.GetTranslateFromContext)(legacyContext);
40
49
  const handleFavoriteClick = (0, _react.useCallback)(e => {
41
50
  e.stopPropagation();
42
51
  e.preventDefault();
@@ -45,26 +54,43 @@ const Favorite = ({
45
54
  const primaryColor = (0, _get2.default)('common.primary', skin);
46
55
  const darkColor = (0, _get2.default)('common.dark', skin);
47
56
  const brandColor = (0, _get2.default)('common.brand', skin);
48
- const toolTipView = (0, _react.useMemo)(() => !(0, _isEmpty2.default)(removeFavoriteToolTip) && !(0, _isEmpty2.default)(addFavoriteToolTip) ? /*#__PURE__*/_react.default.createElement("div", {
49
- className: _favorite.default.showToolTip
50
- }, /*#__PURE__*/_react.default.createElement("span", null, favorite ? removeFavoriteToolTip : addFavoriteToolTip)) : null, [addFavoriteToolTip, favorite, removeFavoriteToolTip]);
51
- return /*#__PURE__*/_react.default.createElement("div", {
52
- className: _favorite.default.blocFavorite
53
- }, toolTipView, /*#__PURE__*/_react.default.createElement("div", {
54
- "data-name": "favorite",
55
- "aria-label": ariaLabel.favorite,
56
- className: (0, _classnames.default)(_favorite.default.favorite, className, favorite && _favorite.default.selected),
57
- onClick: handleFavoriteClick,
58
- style: {
59
- color: primaryColor
60
- }
61
- }, favorite ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyCheck, {
57
+ const buttonRef = (0, _react.useRef)(null);
58
+ const allowToolTip = (0, _react.useMemo)(() => !(0, _isEmpty2.default)(removeFavoriteToolTip) && !(0, _isEmpty2.default)(addFavoriteToolTip), [addFavoriteToolTip, removeFavoriteToolTip]); // to be replaced by useId when React17 is bumped to React18
59
+
60
+ const [favoriteButtonAnchorId] = (0, _react.useState)(allowToolTip ? (0, _uuid.v5)('engaged-battle-', _uuid.v5.URL) : undefined);
61
+ const toolTipContent = (0, _react.useMemo)( // eslint-disable-next-line no-nested-ternary
62
+ () => allowToolTip ? favorite ? removeFavoriteToolTip : addFavoriteToolTip : null, [addFavoriteToolTip, favorite, removeFavoriteToolTip, allowToolTip]);
63
+ const [mouseLeaveTimer, setMouseLeaveTimer] = (0, _react.useState)(undefined);
64
+ const [toolTipIsVisible, setToolTipIsVisible] = (0, _react.useState)(false);
65
+ const handleMouseOver = (0, _react.useCallback)(() => {
66
+ mouseLeaveTimer && clearTimeout(mouseLeaveTimer);
67
+ /* istanbul ignore next */
68
+
69
+ (0, _has2.default)(['current', 'focus'], buttonRef) && buttonRef.current.focus();
70
+ setToolTipIsVisible(true);
71
+ }, [mouseLeaveTimer]);
72
+ const handleMouseLeave = (0, _react.useCallback)(() => {
73
+ setMouseLeaveTimer(setTimeout(() => {
74
+ setToolTipIsVisible(false); // @ts-expect-error (error: blur does not exists on type never)
75
+
76
+ /* istanbul ignore next */
77
+
78
+ (0, _has2.default)(['current', 'blur'], buttonRef) && buttonRef.current.blur();
79
+ }, 500));
80
+ }, []);
81
+ const handleKeyPress = (0, _react.useCallback)(event => {
82
+ (0, _tooltip.toggleStateOnKeyPress)(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);
83
+ }, [toolTipIsVisible]);
84
+ const iconWrapperClassName = (0, _react.useMemo)(() => (0, _classnames.default)(_favorite.default.favorite, className, favorite && _favorite.default.selected), [className, favorite]);
85
+ const icon = (0, _react.useMemo)(() => favorite ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyCheck // eslint-disable-next-line css-modules/no-undef-class
86
+ , {
62
87
  className: _favorite.default.checkIcon,
63
88
  style: {
64
89
  color: brandColor
65
90
  },
66
91
  width: 13,
67
92
  height: 13,
93
+ "data-testid": "favorite-check-icon",
68
94
  "aria-label": ariaLabel.removeFromFavorite
69
95
  }) : /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationMore, {
70
96
  className: _favorite.default.moreIcon,
@@ -73,8 +99,40 @@ const Favorite = ({
73
99
  },
74
100
  width: 13,
75
101
  height: 13,
102
+ "data-testid": "favorite-add-icon",
76
103
  "aria-label": ariaLabel.addToFavorite
77
- })));
104
+ }), [ariaLabel.addToFavorite, ariaLabel.removeFromFavorite, brandColor, darkColor, favorite]);
105
+ return /*#__PURE__*/_react.default.createElement("div", {
106
+ className: _favorite.default.favoriteWrapper,
107
+ "data-testid": "favorite-wrapper"
108
+ }, /*#__PURE__*/_react.default.createElement(_button.default, {
109
+ buttonRef: buttonRef,
110
+ type: "button",
111
+ "data-for": favoriteButtonAnchorId,
112
+ "data-tooltip-place": "left",
113
+ "data-tip": allowToolTip,
114
+ "data-name": "favorite",
115
+ "data-testid": "favorite-button",
116
+ "aria-label": ariaLabel.favorite,
117
+ buttonContentClassName: iconWrapperClassName,
118
+ onClick: handleFavoriteClick,
119
+ style: {
120
+ color: primaryColor
121
+ },
122
+ onKeyDown: handleKeyPress,
123
+ onMouseLeave: handleMouseLeave,
124
+ onMouseOver: handleMouseOver,
125
+ tabIndex: 0,
126
+ useButtonTag: true,
127
+ useWrapper: false
128
+ }, icon), /*#__PURE__*/_react.default.createElement(_tooltip.default, {
129
+ fontSize: 12,
130
+ anchorId: favoriteButtonAnchorId,
131
+ toolTipIsVisible: toolTipIsVisible,
132
+ TooltipContent: toolTipContent,
133
+ closeToolTipInformationTextAriaLabel: translate('Press the escape key to close the information text'),
134
+ stickyOnKeyboardNavigation: true
135
+ }));
78
136
  };
79
137
 
80
138
  Favorite.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -91,7 +149,8 @@ Favorite.propTypes = process.env.NODE_ENV !== "production" ? {
91
149
  })
92
150
  } : {};
93
151
  Favorite.contextTypes = {
94
- skin: _provider.default.childContextTypes.skin
152
+ skin: _provider.default.childContextTypes.skin,
153
+ translate: _provider.default.childContextTypes.translate
95
154
  };
96
155
  var _default = Favorite;
97
156
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"favorite.js","names":["Favorite","favorite","addFavoriteToolTip","removeFavoriteToolTip","className","ariaLabel","onFavoriteClick","disabled","legacyContext","skin","GetSkinFromContext","handleFavoriteClick","useCallback","e","stopPropagation","preventDefault","primaryColor","darkColor","brandColor","toolTipView","useMemo","style","showToolTip","blocFavorite","classnames","selected","color","checkIcon","removeFromFavorite","moreIcon","addToFavorite","propTypes","PropTypes","string","bool","func","shape","contextTypes","Provider","childContextTypes"],"sources":["../../../src/molecule/card/favorite.js"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, noop} from 'lodash/fp';\nimport {\n NovaCompositionNavigationMore as MoreIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../../atom/provider';\nimport style from './favorite.css';\n\nconst Favorite = (\n {\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n className,\n 'aria-label': ariaLabel = {},\n onFavoriteClick = noop,\n disabled\n },\n legacyContext\n) => {\n const skin = GetSkinFromContext(legacyContext);\n const handleFavoriteClick = useCallback(\n e => {\n e.stopPropagation();\n e.preventDefault();\n if (!disabled) onFavoriteClick(e);\n },\n [disabled, onFavoriteClick]\n );\n\n const primaryColor = get('common.primary', skin);\n const darkColor = get('common.dark', skin);\n const brandColor = get('common.brand', skin);\n\n const toolTipView = useMemo(\n () =>\n !isEmpty(removeFavoriteToolTip) && !isEmpty(addFavoriteToolTip) ? (\n <div className={style.showToolTip}>\n <span>{favorite ? removeFavoriteToolTip : addFavoriteToolTip}</span>\n </div>\n ) : null,\n [addFavoriteToolTip, favorite, removeFavoriteToolTip]\n );\n\n return (\n <div className={style.blocFavorite}>\n {toolTipView}\n <div\n data-name=\"favorite\"\n aria-label={ariaLabel.favorite}\n className={classnames(style.favorite, className, favorite && style.selected)}\n onClick={handleFavoriteClick}\n style={{\n color: primaryColor\n }}\n >\n {favorite ? (\n <CheckIcon\n className={style.checkIcon}\n style={{color: brandColor}}\n width={13}\n height={13}\n aria-label={ariaLabel.removeFromFavorite}\n />\n ) : (\n <MoreIcon\n className={style.moreIcon}\n style={{color: darkColor}}\n width={13}\n height={13}\n aria-label={ariaLabel.addToFavorite}\n />\n )}\n </div>\n </div>\n );\n};\n\nFavorite.propTypes = {\n className: PropTypes.string,\n favorite: PropTypes.bool,\n disabled: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onFavoriteClick: PropTypes.func,\n 'aria-label': PropTypes.shape({\n favorite: PropTypes.string,\n addToFavorite: PropTypes.string,\n removeFromFavorite: PropTypes.string\n })\n};\n\nFavorite.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default Favorite;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;;;;;;;AAEA,MAAMA,QAAQ,GAAG,CACf;EACEC,QADF;EAEEC,kBAFF;EAGEC,qBAHF;EAIEC,SAJF;EA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B,iBAAA,CAAMM,SADnB;IAEE,KAAK,EAAE;MAACD,KAAK,EAAER;IAAR,CAFT;IAGE,KAAK,EAAE,EAHT;IAIE,MAAM,EAAE,EAJV;IAKE,cAAYb,SAAS,CAACuB;EALxB,EADO,gBASP,6BAAC,wCAAD;IACE,SAAS,EAAEP,iBAAA,CAAMQ,QADnB;IAEE,KAAK,EAAE;MAACH,KAAK,EAAET;IAAR,CAFT;IAGE,KAAK,EAAE,EAHT;IAIE,MAAM,EAAE,EAJV;IAKE,cAAYZ,SAAS,CAACyB;EALxB,EAlBJ,CAFF,CADF;AAgCD,CApED;;AAsEA9B,QAAQ,CAAC+B,SAAT,2CAAqB;EACnB3B,SAAS,EAAE4B,kBAAA,CAAUC,MADF;EAEnBhC,QAAQ,EAAE+B,kBAAA,CAAUE,IAFD;EAGnB3B,QAAQ,EAAEyB,kBAAA,CAAUE,IAHD;EAInBhC,kBAAkB,EAAE8B,kBAAA,CAAUC,MAJX;EAKnB9B,qBAAqB,EAAE6B,kBAAA,CAAUC,MALd;EAMnB3B,eAAe,EAAE0B,kBAAA,CAAUG,IANR;EAOnB,cAAcH,kBAAA,CAAUI,KAAV,CAAgB;IAC5BnC,QAAQ,EAAE+B,kBAAA,CAAUC,MADQ;IAE5BH,aAAa,EAAEE,kBAAA,CAAUC,MAFG;IAG5BL,kBAAkB,EAAEI,kBAAA,CAAUC;EAHF,CAAhB;AAPK,CAArB;AAcAjC,QAAQ,CAACqC,YAAT,GAAwB;EACtB5B,IAAI,EAAE6B,iBAAA,CAASC,iBAAT,CAA2B9B;AADX,CAAxB;eAIeT,Q"}
1
+ {"version":3,"file":"favorite.js","names":["Favorite","favorite","addFavoriteToolTip","removeFavoriteToolTip","className","ariaLabel","onFavoriteClick","disabled","legacyContext","skin","GetSkinFromContext","translate","GetTranslateFromContext","handleFavoriteClick","useCallback","e","stopPropagation","preventDefault","primaryColor","darkColor","brandColor","buttonRef","useRef","allowToolTip","useMemo","favoriteButtonAnchorId","useState","uuidV5","URL","undefined","toolTipContent","mouseLeaveTimer","setMouseLeaveTimer","toolTipIsVisible","setToolTipIsVisible","handleMouseOver","clearTimeout","current","focus","handleMouseLeave","setTimeout","blur","handleKeyPress","event","toggleStateOnKeyPress","iconWrapperClassName","classnames","style","selected","icon","checkIcon","color","removeFromFavorite","moreIcon","addToFavorite","favoriteWrapper","propTypes","PropTypes","string","bool","func","shape","contextTypes","Provider","childContextTypes"],"sources":["../../../src/molecule/card/favorite.js"],"sourcesContent":["import React, {useCallback, useMemo, useRef, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {v5 as uuidV5} from 'uuid';\nimport {get, has, isEmpty, noop} from 'lodash/fp';\nimport {\n NovaCompositionNavigationMore as MoreIcon,\n NovaCompositionCoorpacademyCheck as CheckIcon\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext, GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip, {toggleStateOnKeyPress} from '../../atom/tooltip';\nimport Button from '../../atom/button';\nimport style from './favorite.css';\n\nconst Favorite = (\n {\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n className,\n 'aria-label': ariaLabel = {},\n onFavoriteClick = noop,\n disabled\n },\n legacyContext\n) => {\n const skin = GetSkinFromContext(legacyContext);\n const translate = GetTranslateFromContext(legacyContext);\n const handleFavoriteClick = useCallback(\n e => {\n e.stopPropagation();\n e.preventDefault();\n if (!disabled) onFavoriteClick(e);\n },\n [disabled, onFavoriteClick]\n );\n\n const primaryColor = get('common.primary', skin);\n const darkColor = get('common.dark', skin);\n const brandColor = get('common.brand', skin);\n\n const buttonRef = useRef(null);\n\n const allowToolTip = useMemo(\n () => !isEmpty(removeFavoriteToolTip) && !isEmpty(addFavoriteToolTip),\n [addFavoriteToolTip, removeFavoriteToolTip]\n );\n\n // to be replaced by useId when React17 is bumped to React18\n const [favoriteButtonAnchorId] = useState(\n allowToolTip ? uuidV5('engaged-battle-', uuidV5.URL) : undefined\n );\n\n const toolTipContent = useMemo(\n // eslint-disable-next-line no-nested-ternary\n () => (allowToolTip ? (favorite ? removeFavoriteToolTip : addFavoriteToolTip) : null),\n [addFavoriteToolTip, favorite, removeFavoriteToolTip, allowToolTip]\n );\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n /* istanbul ignore next */ has(['current', 'focus'], buttonRef) && buttonRef.current.focus();\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(\n setTimeout(() => {\n setToolTipIsVisible(false);\n // @ts-expect-error (error: blur does not exists on type never)\n /* istanbul ignore next */ has(['current', 'blur'], buttonRef) && buttonRef.current.blur();\n }, 500)\n );\n }, []);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);\n },\n [toolTipIsVisible]\n );\n\n const iconWrapperClassName = useMemo(\n () => classnames(style.favorite, className, favorite && style.selected),\n [className, favorite]\n );\n const icon = useMemo(\n () =>\n favorite ? (\n <CheckIcon\n // eslint-disable-next-line css-modules/no-undef-class\n className={style.checkIcon}\n style={{color: brandColor}}\n width={13}\n height={13}\n data-testid=\"favorite-check-icon\"\n aria-label={ariaLabel.removeFromFavorite}\n />\n ) : (\n <MoreIcon\n className={style.moreIcon}\n style={{color: darkColor}}\n width={13}\n height={13}\n data-testid=\"favorite-add-icon\"\n aria-label={ariaLabel.addToFavorite}\n />\n ),\n [ariaLabel.addToFavorite, ariaLabel.removeFromFavorite, brandColor, darkColor, favorite]\n );\n\n return (\n <div className={style.favoriteWrapper} data-testid=\"favorite-wrapper\">\n <Button\n buttonRef={buttonRef}\n type=\"button\"\n data-for={favoriteButtonAnchorId}\n data-tooltip-place=\"left\"\n data-tip={allowToolTip}\n data-name=\"favorite\"\n data-testid=\"favorite-button\"\n aria-label={ariaLabel.favorite}\n buttonContentClassName={iconWrapperClassName}\n onClick={handleFavoriteClick}\n style={{\n color: primaryColor\n }}\n onKeyDown={handleKeyPress}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n tabIndex={0}\n useButtonTag\n useWrapper={false}\n >\n {icon}\n </Button>\n <ToolTip\n fontSize={12}\n anchorId={favoriteButtonAnchorId}\n toolTipIsVisible={toolTipIsVisible}\n TooltipContent={toolTipContent}\n closeToolTipInformationTextAriaLabel={translate(\n 'Press the escape key to close the information text'\n )}\n stickyOnKeyboardNavigation\n />\n </div>\n );\n};\n\nFavorite.propTypes = {\n className: PropTypes.string,\n favorite: PropTypes.bool,\n disabled: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onFavoriteClick: PropTypes.func,\n 'aria-label': PropTypes.shape({\n favorite: PropTypes.string,\n addToFavorite: PropTypes.string,\n removeFromFavorite: PropTypes.string\n })\n};\n\nFavorite.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nexport default Favorite;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AAIA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,QAAQ,GAAG,CACf;EACEC,QADF;EAEEC,kBAFF;EAGEC,qBAHF;EAIEC,SAJF;EAKE,cAAcC,SAAS,GAAG,EAL5B;EAMEC,eAAe,iBANjB;EAOEC;AAPF,CADe,EAUfC,aAVe,KAWZ;EACH,MAAMC,IAAI,GAAG,IAAAC,4BAAA,EAAmBF,aAAnB,CAAb;EACA,MAAMG,SAAS,GAAG,IAAAC,iCAAA,EAAwBJ,aAAxB,CAAlB;EACA,MAAMK,mBAAmB,GAAG,IAAAC,kBAAA,EAC1BC,CAAC,IAAI;IACHA,CAAC,CAACC,eAAF;IACAD,CAAC,CAACE,cAAF;IACA,IAAI,CAACV,QAA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AAA,CAAUC,MAJX;EAKnBvD,qBAAqB,EAAEsD,kBAAA,CAAUC,MALd;EAMnBpD,eAAe,EAAEmD,kBAAA,CAAUG,IANR;EAOnB,cAAcH,kBAAA,CAAUI,KAAV,CAAgB;IAC5B5D,QAAQ,EAAEwD,kBAAA,CAAUC,MADQ;IAE5BJ,aAAa,EAAEG,kBAAA,CAAUC,MAFG;IAG5BN,kBAAkB,EAAEK,kBAAA,CAAUC;EAHF,CAAhB;AAPK,CAArB;AAcA1D,QAAQ,CAAC8D,YAAT,GAAwB;EACtBrD,IAAI,EAAEsD,iBAAA,CAASC,iBAAT,CAA2BvD,IADX;EAEtBE,SAAS,EAAEoD,iBAAA,CAASC,iBAAT,CAA2BrD;AAFhB,CAAxB;eAKeX,Q"}
@@ -20,7 +20,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
20
20
  const Selectable = props => {
21
21
  const {
22
22
  isSelected,
23
- hidden = false,
23
+ hidden,
24
24
  'aria-label': ariaLabel = {}
25
25
  } = props;
26
26
  if ((0, _isUndefined2.default)(isSelected)) return null;
@@ -1 +1 @@
1
- {"version":3,"file":"selectable.js","names":["Selectable","props","isSelected","hidden","ariaLabel","classnames","style","selectable","selected","circle","iconWrapper","addIcon","select","checkIcon","unSelect","hideIcon","hide","showIcon","show","propTypes","PropTypes","bool","shape","string"],"sources":["../../../src/molecule/card/selectable.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isUndefined} from 'lodash/fp';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidRemoveAddAddCircle1 as AddIcon,\n NovaLineContentEditionHide as HideIcon,\n NovaCompositionCoorpacademyEye as ShowIcon\n} from '@coorpacademy/nova-icons';\nimport style from './selectable.css';\n\nconst Selectable = props => {\n const {isSelected, hidden = false, 'aria-label': ariaLabel = {}} = props;\n\n if (isUndefined(isSelected)) return null;\n\n return (\n <div\n className={classnames(style.selectable, isSelected && style.selected, hidden && style.hidden)}\n >\n <div className={style.circle} />\n <div className={style.iconWrapper}>\n <AddIcon className={style.addIcon} aria-label={ariaLabel.select} />\n <CheckIcon className={style.checkIcon} aria-label={ariaLabel.unSelect} />\n <HideIcon className={style.hideIcon} aria-label={ariaLabel.hide} />\n <ShowIcon className={style.showIcon} aria-label={ariaLabel.show} />\n </div>\n </div>\n );\n};\n\nSelectable.propTypes = {\n isSelected: PropTypes.bool,\n hidden: PropTypes.bool,\n 'aria-label': PropTypes.shape({\n select: PropTypes.string,\n unSelect: PropTypes.string\n })\n};\n\nexport default Selectable;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAMA;;;;AAEA,MAAMA,UAAU,GAAGC,KAAK,IAAI;EAC1B,MAAM;IAACC,UAAD;IAAaC,MAAM,GAAG,KAAtB;IAA6B,cAAcC,SAAS,GAAG;EAAvD,IAA6DH,KAAnE;EAEA,IAAI,2BAAYC,UAAZ,CAAJ,EAA6B,OAAO,IAAP;EAE7B,oBACE;IACE,SAAS,EAAE,IAAAG,mBAAA,EAAWC,mBAAA,CAAMC,UAAjB,EAA6BL,UAAU,IAAII,mBAAA,CAAME,QAAjD,EAA2DL,MAAM,IAAIG,mBAAA,CAAMH,MAA3E;EADb,gBAGE;IAAK,SAAS,EAAEG,mBAAA,CAAMG;EAAtB,EAHF,eAIE;IAAK,SAAS,EAAEH,mBAAA,CAAMI;EAAtB,gBACE,6BAAC,uCAAD;IAAS,SAAS,EAAEJ,mBAAA,CAAMK,OAA1B;IAAmC,cAAYP,SAAS,CAACQ;EAAzD,EADF,eAEE,6BAAC,sCAAD;IAAW,SAAS,EAAEN,mBAAA,CAAMO,SAA5B;IAAuC,cAAYT,SAAS,CAACU;EAA7D,EAFF,eAGE,6BAAC,qCAAD;IAAU,SAAS,EAAER,mBAAA,CAAMS,QAA3B;IAAqC,cAAYX,SAAS,CAACY;EAA3D,EAHF,eAIE,6BAAC,yCAAD;IAAU,SAAS,EAAEV,mBAAA,CAAMW,QAA3B;IAAqC,cAAYb,SAAS,CAACc;EAA3D,EAJF,CAJF,CADF;AAaD,CAlBD;;AAoBAlB,UAAU,CAACmB,SAAX,2CAAuB;EACrBjB,UAAU,EAAEkB,kBAAA,CAAUC,IADD;EAErBlB,MAAM,EAAEiB,kBAAA,CAAUC,IAFG;EAGrB,cAAcD,kBAAA,CAAUE,KAAV,CAAgB;IAC5BV,MAAM,EAAEQ,kBAAA,CAAUG,MADU;IAE5BT,QAAQ,EAAEM,kBAAA,CAAUG;EAFQ,CAAhB;AAHO,CAAvB;eASevB,U"}
1
+ {"version":3,"file":"selectable.js","names":["Selectable","props","isSelected","hidden","ariaLabel","classnames","style","selectable","selected","circle","iconWrapper","addIcon","select","checkIcon","unSelect","hideIcon","hide","showIcon","show","propTypes","PropTypes","bool","shape","string"],"sources":["../../../src/molecule/card/selectable.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {isUndefined} from 'lodash/fp';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidRemoveAddAddCircle1 as AddIcon,\n NovaLineContentEditionHide as HideIcon,\n NovaCompositionCoorpacademyEye as ShowIcon\n} from '@coorpacademy/nova-icons';\nimport style from './selectable.css';\n\nconst Selectable = props => {\n const {isSelected, hidden, 'aria-label': ariaLabel = {}} = props;\n\n if (isUndefined(isSelected)) return null;\n\n return (\n <div\n className={classnames(style.selectable, isSelected && style.selected, hidden && style.hidden)}\n >\n <div className={style.circle} />\n <div className={style.iconWrapper}>\n <AddIcon className={style.addIcon} aria-label={ariaLabel.select} />\n <CheckIcon className={style.checkIcon} aria-label={ariaLabel.unSelect} />\n <HideIcon className={style.hideIcon} aria-label={ariaLabel.hide} />\n <ShowIcon className={style.showIcon} aria-label={ariaLabel.show} />\n </div>\n </div>\n );\n};\n\nSelectable.propTypes = {\n isSelected: PropTypes.bool,\n hidden: PropTypes.bool,\n 'aria-label': PropTypes.shape({\n select: PropTypes.string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,CAAvB;eASevB,U"}
@@ -10,5 +10,5 @@
10
10
  .dragAndDrop {
11
11
  margin-right: 16px;
12
12
  width: 202px;
13
- min-height: 183px;
13
+ height: 183px;
14
14
  }
@@ -416,16 +416,27 @@ declare namespace BrandForm {
416
416
  color: any;
417
417
  submitValue: PropTypes.Requireable<string>;
418
418
  disabled: PropTypes.Requireable<boolean>;
419
- isLinkDisabled: PropTypes.Requireable<boolean>;
420
419
  href: PropTypes.Requireable<string>;
421
420
  download: PropTypes.Requireable<boolean>;
422
421
  target: PropTypes.Requireable<string>;
423
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
424
422
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
425
423
  className: PropTypes.Requireable<string>;
426
- buttonContentClassName: PropTypes.Requireable<string>;
427
424
  style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
428
425
  'data-name': PropTypes.Requireable<string>;
426
+ 'aria-label': PropTypes.Requireable<string>;
427
+ 'data-testid': PropTypes.Requireable<string>;
428
+ useButtonTag: PropTypes.Requireable<boolean>;
429
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
430
+ onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
431
+ onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
432
+ onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
433
+ buttonRef: PropTypes.Requireable<PropTypes.InferProps<{}>>;
434
+ 'data-for': PropTypes.Requireable<string>;
435
+ 'data-tooltip-place': PropTypes.Requireable<string>;
436
+ 'data-tip': PropTypes.Requireable<boolean>;
437
+ isLinkDisabled: PropTypes.Requireable<boolean>;
438
+ useWrapper: PropTypes.Requireable<boolean>;
439
+ buttonContentClassName: PropTypes.Requireable<string>;
429
440
  }> | PropTypes.InferProps<{
430
441
  buttonType: PropTypes.Requireable<string>;
431
442
  type: PropTypes.Requireable<string>;
@@ -433,16 +433,27 @@ declare namespace WizardContents {
433
433
  color: any;
434
434
  submitValue: PropTypes.Requireable<string>;
435
435
  disabled: PropTypes.Requireable<boolean>;
436
- isLinkDisabled: PropTypes.Requireable<boolean>;
437
436
  href: PropTypes.Requireable<string>;
438
437
  download: PropTypes.Requireable<boolean>;
439
438
  target: PropTypes.Requireable<string>;
440
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
441
439
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
442
440
  className: PropTypes.Requireable<string>;
443
- buttonContentClassName: PropTypes.Requireable<string>;
444
441
  style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
445
442
  'data-name': PropTypes.Requireable<string>;
443
+ 'aria-label': PropTypes.Requireable<string>;
444
+ 'data-testid': PropTypes.Requireable<string>;
445
+ useButtonTag: PropTypes.Requireable<boolean>;
446
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
447
+ onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
448
+ onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
449
+ onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
450
+ buttonRef: PropTypes.Requireable<PropTypes.InferProps<{}>>;
451
+ 'data-for': PropTypes.Requireable<string>;
452
+ 'data-tooltip-place': PropTypes.Requireable<string>;
453
+ 'data-tip': PropTypes.Requireable<boolean>;
454
+ isLinkDisabled: PropTypes.Requireable<boolean>;
455
+ useWrapper: PropTypes.Requireable<boolean>;
456
+ buttonContentClassName: PropTypes.Requireable<string>;
446
457
  }> | PropTypes.InferProps<{
447
458
  buttonType: PropTypes.Requireable<string>;
448
459
  type: PropTypes.Requireable<string>;
@@ -518,16 +518,27 @@ declare namespace BrandUpdate {
518
518
  color: any;
519
519
  submitValue: PropTypes.Requireable<string>;
520
520
  disabled: PropTypes.Requireable<boolean>;
521
- isLinkDisabled: PropTypes.Requireable<boolean>;
522
521
  href: PropTypes.Requireable<string>;
523
522
  download: PropTypes.Requireable<boolean>;
524
523
  target: PropTypes.Requireable<string>;
525
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
526
524
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
527
525
  className: PropTypes.Requireable<string>;
528
- buttonContentClassName: PropTypes.Requireable<string>;
529
526
  style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
530
527
  'data-name': PropTypes.Requireable<string>;
528
+ 'aria-label': PropTypes.Requireable<string>;
529
+ 'data-testid': PropTypes.Requireable<string>;
530
+ useButtonTag: PropTypes.Requireable<boolean>;
531
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
532
+ onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
533
+ onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
534
+ onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
535
+ buttonRef: PropTypes.Requireable<PropTypes.InferProps<{}>>;
536
+ 'data-for': PropTypes.Requireable<string>;
537
+ 'data-tooltip-place': PropTypes.Requireable<string>;
538
+ 'data-tip': PropTypes.Requireable<boolean>;
539
+ isLinkDisabled: PropTypes.Requireable<boolean>;
540
+ useWrapper: PropTypes.Requireable<boolean>;
541
+ buttonContentClassName: PropTypes.Requireable<string>;
531
542
  }> | PropTypes.InferProps<{
532
543
  buttonType: PropTypes.Requireable<string>;
533
544
  type: PropTypes.Requireable<string>;
@@ -1176,16 +1187,27 @@ declare namespace BrandUpdate {
1176
1187
  color: any;
1177
1188
  submitValue: PropTypes.Requireable<string>;
1178
1189
  disabled: PropTypes.Requireable<boolean>;
1179
- isLinkDisabled: PropTypes.Requireable<boolean>;
1180
1190
  href: PropTypes.Requireable<string>;
1181
1191
  download: PropTypes.Requireable<boolean>;
1182
1192
  target: PropTypes.Requireable<string>;
1183
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
1184
1193
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
1185
1194
  className: PropTypes.Requireable<string>;
1186
- buttonContentClassName: PropTypes.Requireable<string>;
1187
1195
  style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
1188
1196
  'data-name': PropTypes.Requireable<string>;
1197
+ 'aria-label': PropTypes.Requireable<string>;
1198
+ 'data-testid': PropTypes.Requireable<string>;
1199
+ useButtonTag: PropTypes.Requireable<boolean>;
1200
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
1201
+ onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
1202
+ onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
1203
+ onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
1204
+ buttonRef: PropTypes.Requireable<PropTypes.InferProps<{}>>;
1205
+ 'data-for': PropTypes.Requireable<string>;
1206
+ 'data-tooltip-place': PropTypes.Requireable<string>;
1207
+ 'data-tip': PropTypes.Requireable<boolean>;
1208
+ isLinkDisabled: PropTypes.Requireable<boolean>;
1209
+ useWrapper: PropTypes.Requireable<boolean>;
1210
+ buttonContentClassName: PropTypes.Requireable<string>;
1189
1211
  }> | PropTypes.InferProps<{
1190
1212
  buttonType: PropTypes.Requireable<string>;
1191
1213
  type: PropTypes.Requireable<string>;
@@ -85,17 +85,28 @@ declare namespace SearchPage {
85
85
  color: any;
86
86
  submitValue: PropTypes.Requireable<string>;
87
87
  disabled: PropTypes.Requireable<boolean>;
88
- isLinkDisabled: PropTypes.Requireable<boolean>;
89
88
  href: PropTypes.Requireable<string>;
90
89
  download: PropTypes.Requireable<boolean>;
91
90
  target: PropTypes.Requireable<string>;
92
91
  type: PropTypes.Requireable<string>;
93
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
94
92
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
95
93
  className: PropTypes.Requireable<string>;
96
- buttonContentClassName: PropTypes.Requireable<string>;
97
94
  style: PropTypes.Requireable<PropTypes.InferProps<{}>>;
98
95
  'data-name': PropTypes.Requireable<string>;
96
+ 'aria-label': PropTypes.Requireable<string>;
97
+ 'data-testid': PropTypes.Requireable<string>;
98
+ useButtonTag: PropTypes.Requireable<boolean>;
99
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
100
+ onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
101
+ onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
102
+ onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
103
+ buttonRef: PropTypes.Requireable<PropTypes.InferProps<{}>>;
104
+ 'data-for': PropTypes.Requireable<string>;
105
+ 'data-tooltip-place': PropTypes.Requireable<string>;
106
+ 'data-tip': PropTypes.Requireable<boolean>;
107
+ isLinkDisabled: PropTypes.Requireable<boolean>;
108
+ useWrapper: PropTypes.Requireable<boolean>;
109
+ buttonContentClassName: PropTypes.Requireable<string>;
99
110
  }>>;
100
111
  const recommendations: PropTypes.Requireable<PropTypes.InferProps<{
101
112
  contentType: PropTypes.Requireable<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "11.12.5-alpha.0+17f96fb1f",
3
+ "version": "11.12.6",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -166,5 +166,5 @@
166
166
  "last 2 versions",
167
167
  "IE 11"
168
168
  ],
169
- "gitHead": "17f96fb1f3c903f186714156cbf7b500d04a1823"
169
+ "gitHead": "838193c375908efafac2e727e39cf39bec90161e"
170
170
  }