@coorpacademy/components 11.11.2 → 11.11.3-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/es/atom/battle-opponent/index.d.ts +19 -0
  2. package/es/atom/battle-opponent/index.d.ts.map +1 -0
  3. package/es/atom/battle-opponent/index.js +52 -0
  4. package/es/atom/battle-opponent/index.js.map +1 -0
  5. package/es/atom/battle-opponent/prop-types.d.ts +19 -0
  6. package/es/atom/battle-opponent/prop-types.d.ts.map +1 -0
  7. package/es/atom/battle-opponent/prop-types.js +11 -0
  8. package/es/atom/battle-opponent/prop-types.js.map +1 -0
  9. package/es/atom/battle-opponent/style.css +124 -0
  10. package/es/atom/tooltip/index.d.ts +3 -1
  11. package/es/atom/tooltip/index.d.ts.map +1 -1
  12. package/es/atom/tooltip/index.js +17 -7
  13. package/es/atom/tooltip/index.js.map +1 -1
  14. package/es/atom/tooltip/style.css +10 -2
  15. package/es/globals.d.js.map +1 -1
  16. package/es/molecule/battle-opponent-list/index.d.ts +18 -0
  17. package/es/molecule/battle-opponent-list/index.d.ts.map +1 -0
  18. package/es/molecule/battle-opponent-list/index.js +25 -0
  19. package/es/molecule/battle-opponent-list/index.js.map +1 -0
  20. package/es/molecule/battle-opponent-list/prop-types.d.ts +26 -0
  21. package/es/molecule/battle-opponent-list/prop-types.d.ts.map +1 -0
  22. package/es/molecule/battle-opponent-list/prop-types.js +14 -0
  23. package/es/molecule/battle-opponent-list/prop-types.js.map +1 -0
  24. package/es/molecule/battle-opponent-list/style.css +5 -0
  25. package/es/organism/user-preferences/index.d.ts.map +1 -1
  26. package/es/organism/user-preferences/index.js +6 -3
  27. package/es/organism/user-preferences/index.js.map +1 -1
  28. package/lib/atom/battle-opponent/index.d.ts +19 -0
  29. package/lib/atom/battle-opponent/index.d.ts.map +1 -0
  30. package/lib/atom/battle-opponent/index.js +70 -0
  31. package/lib/atom/battle-opponent/index.js.map +1 -0
  32. package/lib/atom/battle-opponent/prop-types.d.ts +19 -0
  33. package/lib/atom/battle-opponent/prop-types.d.ts.map +1 -0
  34. package/lib/atom/battle-opponent/prop-types.js +20 -0
  35. package/lib/atom/battle-opponent/prop-types.js.map +1 -0
  36. package/lib/atom/battle-opponent/style.css +124 -0
  37. package/lib/atom/tooltip/index.d.ts +3 -1
  38. package/lib/atom/tooltip/index.d.ts.map +1 -1
  39. package/lib/atom/tooltip/index.js +18 -7
  40. package/lib/atom/tooltip/index.js.map +1 -1
  41. package/lib/atom/tooltip/style.css +10 -2
  42. package/lib/globals.d.js.map +1 -1
  43. package/lib/molecule/battle-opponent-list/index.d.ts +18 -0
  44. package/lib/molecule/battle-opponent-list/index.d.ts.map +1 -0
  45. package/lib/molecule/battle-opponent-list/index.js +43 -0
  46. package/lib/molecule/battle-opponent-list/index.js.map +1 -0
  47. package/lib/molecule/battle-opponent-list/prop-types.d.ts +26 -0
  48. package/lib/molecule/battle-opponent-list/prop-types.d.ts.map +1 -0
  49. package/lib/molecule/battle-opponent-list/prop-types.js +23 -0
  50. package/lib/molecule/battle-opponent-list/prop-types.js.map +1 -0
  51. package/lib/molecule/battle-opponent-list/style.css +5 -0
  52. package/lib/organism/user-preferences/index.d.ts.map +1 -1
  53. package/lib/organism/user-preferences/index.js +10 -3
  54. package/lib/organism/user-preferences/index.js.map +1 -1
  55. package/package.json +3 -2
  56. package/locales/.mtslconfig.json +0 -1
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import { WebContextValues } from '../provider/web-context';
3
+ import { BattleOpponentProps } from './prop-types';
4
+ declare const BattleOpponent: {
5
+ ({ isAlreadyEngaged, isRandom, userAvatarSrc, onClick, displayName, tooltipText }: BattleOpponentProps, legacyContext: WebContextValues): JSX.Element;
6
+ propTypes: {
7
+ isAlreadyEngaged: import("prop-types").Requireable<boolean>;
8
+ isRandom: import("prop-types").Requireable<boolean>;
9
+ userAvatarSrc: import("prop-types").Requireable<string>;
10
+ onClick: import("prop-types").Requireable<(...args: any[]) => any>;
11
+ displayName: import("prop-types").Requireable<string>;
12
+ tooltipText: import("prop-types").Requireable<string>;
13
+ };
14
+ contextTypes: {
15
+ translate: import("prop-types").Requireable<(...args: any[]) => any>;
16
+ };
17
+ };
18
+ export default BattleOpponent;
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/battle-opponent/index.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAkB,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAG5D,QAAA,MAAM,cAAc;uFAQf,mBAAmB,iBACP,gBAAgB;;;;;;;;;;;;CAsChC,CAAC;AAQF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _react = _interopRequireWildcard(require("react"));
7
+
8
+ var _classnames = _interopRequireDefault(require("classnames"));
9
+
10
+ var _novaIcons = require("@coorpacademy/nova-icons");
11
+
12
+ var _tooltip = _interopRequireDefault(require("../tooltip"));
13
+
14
+ var _provider = _interopRequireWildcard(require("../provider"));
15
+
16
+ var _propTypes = _interopRequireDefault(require("./prop-types"));
17
+
18
+ var _style = _interopRequireDefault(require("./style.css"));
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ 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); }
23
+
24
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
+
26
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
27
+
28
+ const BattleOpponent = ({
29
+ isAlreadyEngaged,
30
+ isRandom,
31
+ userAvatarSrc,
32
+ onClick,
33
+ displayName,
34
+ tooltipText
35
+ }, legacyContext) => {
36
+ const translate = (0, _provider.GetTranslateFromContext)(legacyContext);
37
+ const wrapperClassnames = (0, _react.useMemo)(() => (0, _classnames.default)(_style.default.card, _style.default['opponent-card'], isRandom ? _style.default.random : null), [isRandom]);
38
+ const displayNameClassnames = (0, _react.useMemo)(() => (0, _classnames.default)(_style.default.name, isAlreadyEngaged ? _style.default.alreadyEngaged : null), [isAlreadyEngaged]);
39
+ return /*#__PURE__*/_react.default.createElement("li", _extends({}, !isAlreadyEngaged && {
40
+ onClick
41
+ }, {
42
+ className: wrapperClassnames,
43
+ "data-testid": "battle-opponent-wrapper"
44
+ }), /*#__PURE__*/_react.default.createElement("div", {
45
+ className: _style.default.avatar
46
+ }, isRandom ? null : /*#__PURE__*/_react.default.createElement("img", {
47
+ src: userAvatarSrc,
48
+ "aria-hidden": "true"
49
+ })), /*#__PURE__*/_react.default.createElement("p", {
50
+ className: displayNameClassnames
51
+ }, " ", displayName), isAlreadyEngaged ? /*#__PURE__*/_react.default.createElement(_tooltip.default, {
52
+ fontSize: 12,
53
+ iconSize: "big",
54
+ TooltipContent: tooltipText,
55
+ closeToolTipInformationTextAriaLabel: translate('Press the escape key to close the information text'),
56
+ iconContainerClassName: _style.default.infoIconTooltip
57
+ }) : /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowRight, {
58
+ className: _style.default.rightArrow,
59
+ width: 16,
60
+ height: 16
61
+ }));
62
+ };
63
+
64
+ BattleOpponent.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
65
+ BattleOpponent.contextTypes = {
66
+ translate: _provider.default.childContextTypes.translate
67
+ };
68
+ var _default = BattleOpponent;
69
+ exports.default = _default;
70
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["BattleOpponent","isAlreadyEngaged","isRandom","userAvatarSrc","onClick","displayName","tooltipText","legacyContext","translate","GetTranslateFromContext","wrapperClassnames","useMemo","classnames","style","card","random","displayNameClassnames","name","alreadyEngaged","avatar","infoIconTooltip","rightArrow","propTypes","contextTypes","Provider","childContextTypes"],"sources":["../../../src/atom/battle-opponent/index.tsx"],"sourcesContent":["import React, {useMemo} from 'react';\nimport classnames from 'classnames';\nimport {NovaCompositionNavigationArrowRight as ArrowRight} from '@coorpacademy/nova-icons';\nimport ToolTip from '../tooltip';\nimport Provider, {GetTranslateFromContext} from '../provider';\nimport {WebContextValues} from '../provider/web-context';\nimport propTypes, {BattleOpponentProps} from './prop-types';\nimport style from './style.css';\n\nconst BattleOpponent = (\n {\n isAlreadyEngaged,\n isRandom,\n userAvatarSrc,\n onClick,\n displayName,\n tooltipText\n }: BattleOpponentProps,\n legacyContext: WebContextValues\n) => {\n const translate: Required<WebContextValues>['translate'] = GetTranslateFromContext(legacyContext);\n const wrapperClassnames = useMemo(\n () => classnames(style.card, style['opponent-card'], isRandom ? style.random : null),\n [isRandom]\n );\n\n const displayNameClassnames = useMemo(\n () => classnames(style.name, isAlreadyEngaged ? style.alreadyEngaged : null),\n [isAlreadyEngaged]\n );\n\n return (\n <li\n {...(!isAlreadyEngaged && {onClick})}\n className={wrapperClassnames}\n data-testid=\"battle-opponent-wrapper\"\n >\n <div className={style.avatar}>\n {isRandom ? null : <img src={userAvatarSrc} aria-hidden=\"true\" />}\n </div>\n <p className={displayNameClassnames}> {displayName}</p>\n {isAlreadyEngaged ? (\n <ToolTip\n fontSize={12}\n iconSize=\"big\"\n TooltipContent={tooltipText}\n closeToolTipInformationTextAriaLabel={translate(\n 'Press the escape key to close the information text'\n )}\n iconContainerClassName={style.infoIconTooltip}\n />\n ) : (\n <ArrowRight className={style.rightArrow} width={16} height={16} />\n )}\n </li>\n );\n};\n\nBattleOpponent.propTypes = propTypes;\n\nBattleOpponent.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default BattleOpponent;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,MAAMA,cAAc,GAAG,CACrB;EACEC,gBADF;EAEEC,QAFF;EAGEC,aAHF;EAIEC,OAJF;EAKEC,WALF;EAMEC;AANF,CADqB,EASrBC,aATqB,KAUlB;EACH,MAAMC,SAAkD,GAAG,IAAAC,iCAAA,EAAwBF,aAAxB,CAA3D;EACA,MAAMG,iBAAiB,GAAG,IAAAC,cAAA,EACxB,MAAM,IAAAC,mBAAA,EAAWC,cAAA,CAAMC,IAAjB,EAAuBD,cAAA,CAAM,eAAN,CAAvB,EAA+CX,QAAQ,GAAGW,cAAA,CAAME,MAAT,GAAkB,IAAzE,CADkB,EAExB,CAACb,QAAD,CAFwB,CAA1B;EAKA,MAAMc,qBAAqB,GAAG,IAAAL,cAAA,EAC5B,MAAM,IAAAC,mBAAA,EAAWC,cAAA,CAAMI,IAAjB,EAAuBhB,gBAAgB,GAAGY,cAAA,CAAMK,cAAT,GAA0B,IAAjE,CADsB,EAE5B,CAACjB,gBAAD,CAF4B,CAA9B;EAKA,oBACE,gDACO,CAACA,gBAAD,IAAqB;IAACG;EAAD,CAD5B;IAEE,SAAS,EAAEM,iBAFb;IAGE,eAAY;EAHd,iBAKE;IAAK,SAAS,EAAEG,cAAA,CAAMM;EAAtB,GACGjB,QAAQ,GAAG,IAAH,gBAAU;IAAK,GAAG,EAAEC,aAAV;IAAyB,eAAY;EAArC,EADrB,CALF,eAQE;IAAG,SAAS,EAAEa;EAAd,QAAuCX,WAAvC,CARF,EASGJ,gBAAgB,gBACf,6BAAC,gBAAD;IACE,QAAQ,EAAE,EADZ;IAEE,QAAQ,EAAC,KAFX;IAGE,cAAc,EAAEK,WAHlB;IAIE,oCAAoC,EAAEE,SAAS,CAC7C,oDAD6C,CAJjD;IAOE,sBAAsB,EAAEK,cAAA,CAAMO;EAPhC,EADe,gBAWf,6BAAC,8CAAD;IAAY,SAAS,EAAEP,cAAA,CAAMQ,UAA7B;IAAyC,KAAK,EAAE,EAAhD;IAAoD,MAAM,EAAE;EAA5D,EApBJ,CADF;AAyBD,CA/CD;;AAiDArB,cAAc,CAACsB,SAAf,2CAA2BA,kBAA3B;AAEAtB,cAAc,CAACuB,YAAf,GAA8B;EAC5Bf,SAAS,EAAEgB,iBAAA,CAASC,iBAAT,CAA2BjB;AADV,CAA9B;eAIeR,c"}
@@ -0,0 +1,19 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const propTypes: {
3
+ isAlreadyEngaged: PropTypes.Requireable<boolean>;
4
+ isRandom: PropTypes.Requireable<boolean>;
5
+ userAvatarSrc: PropTypes.Requireable<string>;
6
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
7
+ displayName: PropTypes.Requireable<string>;
8
+ tooltipText: PropTypes.Requireable<string>;
9
+ };
10
+ export declare type BattleOpponentProps = {
11
+ isAlreadyEngaged?: boolean;
12
+ isRandom?: boolean;
13
+ userAvatarSrc?: string;
14
+ onClick?: () => void;
15
+ displayName: string;
16
+ tooltipText?: string;
17
+ };
18
+ export default propTypes;
19
+ //# sourceMappingURL=prop-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/atom/battle-opponent/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,QAAA,MAAM,SAAS;;;;;;;CAOd,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _propTypes = _interopRequireDefault(require("prop-types"));
7
+
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+
10
+ const propTypes = {
11
+ isAlreadyEngaged: _propTypes.default.bool,
12
+ isRandom: _propTypes.default.bool,
13
+ userAvatarSrc: _propTypes.default.string,
14
+ onClick: _propTypes.default.func,
15
+ displayName: _propTypes.default.string,
16
+ tooltipText: _propTypes.default.string
17
+ };
18
+ var _default = propTypes;
19
+ exports.default = _default;
20
+ //# sourceMappingURL=prop-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-types.js","names":["propTypes","isAlreadyEngaged","PropTypes","bool","isRandom","userAvatarSrc","string","onClick","func","displayName","tooltipText"],"sources":["../../../src/atom/battle-opponent/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst propTypes = {\n isAlreadyEngaged: PropTypes.bool,\n isRandom: PropTypes.bool,\n userAvatarSrc: PropTypes.string,\n onClick: PropTypes.func,\n displayName: PropTypes.string,\n tooltipText: PropTypes.string\n};\n\nexport type BattleOpponentProps = {\n isAlreadyEngaged?: boolean;\n isRandom?: boolean;\n userAvatarSrc?: string;\n onClick?: () => void;\n displayName: string;\n tooltipText?: string;\n};\n\nexport default propTypes;\n"],"mappings":";;;;;AAAA;;;;AAEA,MAAMA,SAAS,GAAG;EAChBC,gBAAgB,EAAEC,kBAAA,CAAUC,IADZ;EAEhBC,QAAQ,EAAEF,kBAAA,CAAUC,IAFJ;EAGhBE,aAAa,EAAEH,kBAAA,CAAUI,MAHT;EAIhBC,OAAO,EAAEL,kBAAA,CAAUM,IAJH;EAKhBC,WAAW,EAAEP,kBAAA,CAAUI,MALP;EAMhBI,WAAW,EAAER,kBAAA,CAAUI;AANP,CAAlB;eAkBeN,S"}
@@ -0,0 +1,124 @@
1
+ @value breakpoints: "../../variables/breakpoints.css";
2
+ @value mobile from breakpoints;
3
+ @value colors: "../../variables/colors.css";
4
+ @value white from colors;
5
+ @value dark from colors;
6
+ @value black from colors;
7
+ @value cm_grey_75 from colors;
8
+ @value medium from colors;
9
+ @value light from colors;
10
+ @value brand from colors;
11
+
12
+ .rightArrow {
13
+ position: flex;
14
+ padding: 9px;
15
+ cursor: pointer;
16
+ opacity: 1;
17
+ user-select: none;
18
+ text-align: right;
19
+ color: dark;
20
+ }
21
+
22
+ .card {
23
+ margin: 5px;
24
+ }
25
+
26
+ .opponent-card {
27
+ flex: 1 1 350px;
28
+ height: 80px;
29
+ background-color: white;
30
+ box-shadow: 0 0 4px 1px rgba(0,0,0,0.10);
31
+ border-radius: 3px;
32
+ padding: 20px;
33
+ box-sizing: border-box;
34
+ display: flex;
35
+ align-items: center;
36
+ justify-content: space-between;
37
+ cursor: pointer;
38
+ }
39
+
40
+ .opponent-card .name {
41
+ font-family: 'Gilroy';
42
+ font-size: 15px;
43
+ font-weight: 700;
44
+ color: black;
45
+ flex-grow: 1;
46
+ }
47
+
48
+
49
+ .opponent-card .rightArrow {
50
+ margin-left: 20px;
51
+ }
52
+
53
+ .avatar {
54
+ width: 50px;
55
+ height: 50px;
56
+ border-radius: 50%;
57
+ overflow: hidden;
58
+ background-color: light;
59
+ margin-right: 20px;
60
+ flex-shrink: 0;
61
+ }
62
+
63
+ .avatar img {
64
+ width: 100%;
65
+ height: auto;
66
+ }
67
+
68
+
69
+ .random {
70
+ color: medium;
71
+ }
72
+
73
+ .alreadyEngaged.name,
74
+ .random .name {
75
+ color: medium;
76
+ }
77
+
78
+ .random .avatar {
79
+ background-color: brand;
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ }
84
+
85
+ .random .avatar:before {
86
+ content: '?';
87
+ font-family: 'Gilroy';
88
+ font-size: 32px;
89
+ font-weight: 600;
90
+ color: white;
91
+ text-align: center;
92
+ }
93
+
94
+ .random .avatar img {
95
+ display: none;
96
+ }
97
+
98
+ .opponent-card:hover {
99
+ background-color: cm_grey_75;
100
+ }
101
+
102
+ .card .infoIconTooltip {
103
+ background: transparent;
104
+ }
105
+
106
+ @media mobile {
107
+ .opponent-card {
108
+ width: 100%;
109
+ padding: 10px;
110
+ }
111
+
112
+ .opponent-card .avatar {
113
+ margin-right: 10px;
114
+ }
115
+
116
+ .opponent-card .rightArrow {
117
+ margin-left: 10px;
118
+ }
119
+
120
+ .card {
121
+ margin: 0 0 10px;
122
+ }
123
+ }
124
+
@@ -1,6 +1,6 @@
1
1
  export function toggleStateOnKeyPress(state: any, setState: any, ref: any): (event: any) => void;
2
2
  export default ToolTip;
3
- declare function ToolTip({ anchorId, TooltipContent, "aria-label": ariaLabel, "data-testid": dataTestId, closeToolTipInformationTextAriaLabel, toolTipIsVisible: _toolTipIsVisible, iconContainerClassName, delayHide, fontSize }: {
3
+ declare function ToolTip({ anchorId, TooltipContent, "aria-label": ariaLabel, "data-testid": dataTestId, closeToolTipInformationTextAriaLabel, toolTipIsVisible: _toolTipIsVisible, iconContainerClassName, delayHide, fontSize, iconSize }: {
4
4
  anchorId: any;
5
5
  TooltipContent: any;
6
6
  "aria-label": any;
@@ -10,6 +10,7 @@ declare function ToolTip({ anchorId, TooltipContent, "aria-label": ariaLabel, "d
10
10
  iconContainerClassName: any;
11
11
  delayHide?: number | undefined;
12
12
  fontSize?: number | undefined;
13
+ iconSize?: string | undefined;
13
14
  }): JSX.Element;
14
15
  declare namespace ToolTip {
15
16
  const propTypes: {
@@ -20,6 +21,7 @@ declare namespace ToolTip {
20
21
  iconContainerClassName: PropTypes.Requireable<string>;
21
22
  delayHide: PropTypes.Requireable<number>;
22
23
  fontSize: PropTypes.Requireable<number>;
24
+ iconSize: PropTypes.Requireable<string>;
23
25
  anchorId: PropTypes.Requireable<string>;
24
26
  toolTipIsVisible: PropTypes.Requireable<boolean>;
25
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tooltip/index.js"],"names":[],"mappings":"AAwDO,iGASN;;AAED;;;;;;;;;;gBAwFC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tooltip/index.js"],"names":[],"mappings":"AAmEO,iGASN;;AAED;;;;;;;;;;;gBA0FC"}
@@ -13,6 +13,8 @@ var _reactTooltip = _interopRequireDefault(require("react-tooltip"));
13
13
 
14
14
  var _isString = _interopRequireDefault(require("lodash/fp/isString"));
15
15
 
16
+ var _keys = _interopRequireDefault(require("lodash/fp/keys"));
17
+
16
18
  var _novaIcons = require("@coorpacademy/nova-icons");
17
19
 
18
20
  var _style = _interopRequireDefault(require("./style.css"));
@@ -27,13 +29,18 @@ const FontSizes = {
27
29
  12: _style.default.tooltipContentFontSize12,
28
30
  14: _style.default.tooltipContentFontSize14
29
31
  };
32
+ const IconSizes = {
33
+ small: 12,
34
+ big: 20
35
+ };
30
36
 
31
37
  const ToolTipWrapper = ({
32
38
  toolTipIsVisible,
33
39
  anchorId,
34
40
  closeToolTipInformationTextAriaLabel,
35
41
  content,
36
- handleContentMouseOver
42
+ handleContentMouseOver,
43
+ iconSize
37
44
  }) => {
38
45
  if (!toolTipIsVisible) return null;
39
46
 
@@ -48,7 +55,7 @@ const ToolTipWrapper = ({
48
55
  }, content);
49
56
  } else {
50
57
  return /*#__PURE__*/_react.default.createElement("div", {
51
- className: _style.default.toolTip,
58
+ className: (0, _classnames.default)(_style.default.toolTip, iconSize === 'big' ? _style.default.bigIconToolTip : _style.default.smallIconToolTip),
52
59
  "data-testid": "tooltip",
53
60
  "aria-label": closeToolTipInformationTextAriaLabel,
54
61
  onMouseOver: handleContentMouseOver
@@ -61,7 +68,8 @@ ToolTipWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
61
68
  anchorId: _propTypes.default.string,
62
69
  closeToolTipInformationTextAriaLabel: _propTypes.default.string.isRequired,
63
70
  content: _propTypes.default.node,
64
- handleContentMouseOver: _propTypes.default.func
71
+ handleContentMouseOver: _propTypes.default.func,
72
+ iconSize: _propTypes.default.oneOf((0, _keys.default)(IconSizes))
65
73
  } : {};
66
74
 
67
75
  const toggleStateOnKeyPress = (state, setState, ref) => event => {
@@ -86,7 +94,8 @@ const ToolTip = ({
86
94
  toolTipIsVisible: _toolTipIsVisible,
87
95
  iconContainerClassName,
88
96
  delayHide = 250,
89
- fontSize = 14
97
+ fontSize = 14,
98
+ iconSize = 'small'
90
99
  }) => {
91
100
  const isComponent = (0, _react.useMemo)(() => !(0, _isString.default)(TooltipContent) && /*#__PURE__*/(0, _react.isValidElement)(TooltipContent()), [TooltipContent]);
92
101
  const [toolTipIsVisible, setToolTipIsVisible] = (0, _react.useState)(false);
@@ -131,8 +140,8 @@ const ToolTip = ({
131
140
  tabIndex: 0
132
141
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyInformationIcon, {
133
142
  className: _style.default.informationIcon,
134
- width: 12,
135
- height: 12,
143
+ width: IconSizes[iconSize],
144
+ height: IconSizes[iconSize],
136
145
  "aria-label": ariaLabel
137
146
  })), /*#__PURE__*/_react.default.createElement(ToolTipWrapper, {
138
147
  toolTipIsVisible: toolTipIsVisible,
@@ -140,7 +149,8 @@ const ToolTip = ({
140
149
  closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
141
150
  content: content,
142
151
  handleContentMouseOver: handleContentMouseOver,
143
- fontSize: fontSize
152
+ fontSize: fontSize,
153
+ iconSize: iconSize
144
154
  }));
145
155
  };
146
156
 
@@ -153,6 +163,7 @@ ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
153
163
  iconContainerClassName: _propTypes.default.string,
154
164
  delayHide: _propTypes.default.number,
155
165
  fontSize: _propTypes.default.oneOf([12, 14]),
166
+ iconSize: _propTypes.default.oneOf((0, _keys.default)(IconSizes)),
156
167
  // ---------- React Tooltip exclusive --------------
157
168
  // externalHandling: if passed down, React Tooltip is used instead, due to limitations on
158
169
  // parents overflow hidden controls
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["FontSizes","style","tooltipContentFontSize12","tooltipContentFontSize14","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","handleContentMouseOver","toolTipReact","toolTip","propTypes","PropTypes","bool","string","isRequired","node","func","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","iconContainerClassName","delayHide","fontSize","isComponent","useMemo","isString","isValidElement","setToolTipIsVisible","useState","mouseLeaveTimer","setMouseLeaveTimer","undefined","handleKeyPress","useCallback","clearTimeout","handleMouseOver","handleMouseLeave","setTimeout","classnames","tooltipContent","tooltipContainer","tooltipIconContainer","informationIcon","oneOfType","number","oneOf"],"sources":["../../../src/atom/tooltip/index.js"],"sourcesContent":["import React, {isValidElement, useState, useCallback, useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport ReactTooltip from 'react-tooltip';\nimport isString from 'lodash/fp/isString';\nimport {NovaCompositionCoorpacademyInformationIcon as InformationIcon} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst FontSizes = {\n 12: style.tooltipContentFontSize12,\n 14: style.tooltipContentFontSize14\n};\n\nconst ToolTipWrapper = ({\n toolTipIsVisible,\n anchorId,\n closeToolTipInformationTextAriaLabel,\n content,\n handleContentMouseOver\n}) => {\n if (!toolTipIsVisible) return null;\n if (anchorId) {\n return (\n <ReactTooltip\n id={anchorId}\n className={style.toolTipReact}\n data-event-off=\"click\"\n place=\"left\"\n effect=\"solid\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </ReactTooltip>\n );\n } else {\n return (\n <div\n className={style.toolTip}\n data-testid=\"tooltip\"\n aria-label={closeToolTipInformationTextAriaLabel}\n onMouseOver={handleContentMouseOver}\n >\n {content}\n </div>\n );\n }\n};\n\nToolTipWrapper.propTypes = {\n toolTipIsVisible: PropTypes.bool,\n anchorId: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n content: PropTypes.node,\n handleContentMouseOver: PropTypes.func\n};\n\nexport const toggleStateOnKeyPress = (state, setState, ref) => event => {\n if (event.key === 'Enter') {\n if (ref) ref.current.focus();\n event.stopPropagation();\n event.preventDefault();\n setState(!state);\n } else if (event.key === 'Tab' || event.key === 'Escape') {\n setState(false);\n }\n};\n\nconst ToolTip = ({\n anchorId,\n TooltipContent,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n closeToolTipInformationTextAriaLabel,\n toolTipIsVisible: _toolTipIsVisible,\n iconContainerClassName,\n delayHide = 250,\n fontSize = 14\n}) => {\n const isComponent = useMemo(\n () => !isString(TooltipContent) && isValidElement(TooltipContent()),\n [TooltipContent]\n );\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleContentMouseOver = useCallback(() => {\n mouseLeaveTimer && /* istanbul ignore next */ clearTimeout(mouseLeaveTimer);\n }, [mouseLeaveTimer]);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(setTimeout(() => setToolTipIsVisible(false), delayHide));\n }, [delayHide]);\n\n const content = useMemo(() => {\n return isComponent ? (\n <TooltipContent />\n ) : (\n <p className={classnames([style.tooltipContent, FontSizes[fontSize]])}>{TooltipContent}</p>\n );\n }, [TooltipContent, fontSize, isComponent]);\n\n return anchorId ? (\n <ToolTipWrapper\n toolTipIsVisible={_toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n fontSize={fontSize}\n />\n ) : (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={classnames([style.tooltipIconContainer, iconContainerClassName])}\n data-testid={dataTestId}\n onKeyDown={handleKeyPress}\n tabIndex={0}\n >\n <InformationIcon\n className={style.informationIcon}\n width={12}\n height={12}\n aria-label={ariaLabel}\n />\n </button>\n <ToolTipWrapper\n toolTipIsVisible={toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n handleContentMouseOver={handleContentMouseOver}\n fontSize={fontSize}\n />\n </div>\n );\n};\n\nToolTip.propTypes = {\n TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),\n 'data-testid': PropTypes.string,\n 'aria-label': PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n // ---------- Regular Tooltip exclusive --------------\n iconContainerClassName: PropTypes.string,\n delayHide: PropTypes.number,\n fontSize: PropTypes.oneOf([12, 14]),\n // ---------- React Tooltip exclusive --------------\n // externalHandling: if passed down, React Tooltip is used instead, due to limitations on\n // parents overflow hidden controls\n anchorId: PropTypes.string,\n toolTipIsVisible: PropTypes.bool\n};\n\nexport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BE,6BAAC,cAAD;IACE,gBAAgB,EAAE1B,gBADpB;IAEE,QAAQ,EAAEC,QAFZ;IAGE,oCAAoC,EAAEC,oCAHxC;IAIE,OAAO,EAAEC,OAJX;IAKE,sBAAsB,EAAEC,sBAL1B;IAME,QAAQ,EAAE2B;EANZ,EAnBF,CAXF;AAwCD,CAxFD;;AA0FAP,OAAO,CAACjB,SAAR,2CAAoB;EAClBkB,cAAc,EAAEjB,kBAAA,CAAU4C,SAAV,CAAoB,CAAC5C,kBAAA,CAAUK,IAAX,EAAiBL,kBAAA,CAAUI,IAA3B,EAAiCJ,kBAAA,CAAUE,MAA3C,CAApB,CADE;EAElB,eAAeF,kBAAA,CAAUE,MAFP;EAGlB,cAAcF,kBAAA,CAAUE,MAHN;EAIlBR,oCAAoC,EAAEM,kBAAA,CAAUE,MAAV,CAAiBC,UAJrC;EAKlB;EACAkB,sBAAsB,EAAErB,kBAAA,CAAUE,MANhB;EAOlBoB,SAAS,EAAEtB,kBAAA,CAAU6C,MAPH;EAQlBtB,QAAQ,EAAEvB,kBAAA,CAAU8C,KAAV,CAAgB,CAAC,EAAD,EAAK,EAAL,CAAhB,CARQ;EASlB;EACA;EACA;EACArD,QAAQ,EAAEO,kBAAA,CAAUE,MAZF;EAalBV,gBAAgB,EAAEQ,kBAAA,CAAUC;AAbV,CAApB;eAgBee,O"}
1
+ {"version":3,"file":"index.js","names":["FontSizes","style","tooltipContentFontSize12","tooltipContentFontSize14","IconSizes","small","big","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","handleContentMouseOver","iconSize","toolTipReact","classnames","toolTip","bigIconToolTip","smallIconToolTip","propTypes","PropTypes","bool","string","isRequired","node","func","oneOf","keys","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","iconContainerClassName","delayHide","fontSize","isComponent","useMemo","isString","isValidElement","setToolTipIsVisible","useState","mouseLeaveTimer","setMouseLeaveTimer","undefined","handleKeyPress","useCallback","clearTimeout","handleMouseOver","handleMouseLeave","setTimeout","tooltipContent","tooltipContainer","tooltipIconContainer","informationIcon","oneOfType","number"],"sources":["../../../src/atom/tooltip/index.js"],"sourcesContent":["import React, {isValidElement, useState, useCallback, useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport ReactTooltip from 'react-tooltip';\nimport isString from 'lodash/fp/isString';\nimport keys from 'lodash/fp/keys';\nimport {NovaCompositionCoorpacademyInformationIcon as InformationIcon} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst FontSizes = {\n 12: style.tooltipContentFontSize12,\n 14: style.tooltipContentFontSize14\n};\n\nconst IconSizes = {\n small: 12,\n big: 20\n};\n\nconst ToolTipWrapper = ({\n toolTipIsVisible,\n anchorId,\n closeToolTipInformationTextAriaLabel,\n content,\n handleContentMouseOver,\n iconSize\n}) => {\n if (!toolTipIsVisible) return null;\n if (anchorId) {\n return (\n <ReactTooltip\n id={anchorId}\n className={style.toolTipReact}\n data-event-off=\"click\"\n place=\"left\"\n effect=\"solid\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </ReactTooltip>\n );\n } else {\n return (\n <div\n className={classnames(\n style.toolTip,\n iconSize === 'big' ? style.bigIconToolTip : style.smallIconToolTip\n )}\n data-testid=\"tooltip\"\n aria-label={closeToolTipInformationTextAriaLabel}\n onMouseOver={handleContentMouseOver}\n >\n {content}\n </div>\n );\n }\n};\n\nToolTipWrapper.propTypes = {\n toolTipIsVisible: PropTypes.bool,\n anchorId: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n content: PropTypes.node,\n handleContentMouseOver: PropTypes.func,\n iconSize: PropTypes.oneOf(keys(IconSizes))\n};\n\nexport const toggleStateOnKeyPress = (state, setState, ref) => event => {\n if (event.key === 'Enter') {\n if (ref) ref.current.focus();\n event.stopPropagation();\n event.preventDefault();\n setState(!state);\n } else if (event.key === 'Tab' || event.key === 'Escape') {\n setState(false);\n }\n};\n\nconst ToolTip = ({\n anchorId,\n TooltipContent,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n closeToolTipInformationTextAriaLabel,\n toolTipIsVisible: _toolTipIsVisible,\n iconContainerClassName,\n delayHide = 250,\n fontSize = 14,\n iconSize = 'small'\n}) => {\n const isComponent = useMemo(\n () => !isString(TooltipContent) && isValidElement(TooltipContent()),\n [TooltipContent]\n );\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleContentMouseOver = useCallback(() => {\n mouseLeaveTimer && /* istanbul ignore next */ clearTimeout(mouseLeaveTimer);\n }, [mouseLeaveTimer]);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(setTimeout(() => setToolTipIsVisible(false), delayHide));\n }, [delayHide]);\n\n const content = useMemo(() => {\n return isComponent ? (\n <TooltipContent />\n ) : (\n <p className={classnames([style.tooltipContent, FontSizes[fontSize]])}>{TooltipContent}</p>\n );\n }, [TooltipContent, fontSize, isComponent]);\n\n return anchorId ? (\n <ToolTipWrapper\n toolTipIsVisible={_toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n fontSize={fontSize}\n />\n ) : (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={classnames([style.tooltipIconContainer, iconContainerClassName])}\n data-testid={dataTestId}\n onKeyDown={handleKeyPress}\n tabIndex={0}\n >\n <InformationIcon\n className={style.informationIcon}\n width={IconSizes[iconSize]}\n height={IconSizes[iconSize]}\n aria-label={ariaLabel}\n />\n </button>\n <ToolTipWrapper\n toolTipIsVisible={toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n handleContentMouseOver={handleContentMouseOver}\n fontSize={fontSize}\n iconSize={iconSize}\n />\n </div>\n );\n};\n\nToolTip.propTypes = {\n TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),\n 'data-testid': PropTypes.string,\n 'aria-label': PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n // ---------- Regular Tooltip exclusive --------------\n iconContainerClassName: PropTypes.string,\n delayHide: PropTypes.number,\n fontSize: PropTypes.oneOf([12, 14]),\n iconSize: PropTypes.oneOf(keys(IconSizes)),\n // ---------- React Tooltip exclusive --------------\n // externalHandling: if passed down, React Tooltip is used instead, due to limitations on\n // parents overflow hidden controls\n anchorId: PropTypes.string,\n toolTipIsVisible: PropTypes.bool\n};\n\nexport default ToolTip;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,SAAS,GAAG;EAChB,IAAIC,cAAA,CAAMC,wBADM;EAEhB,IAAID,cAAA,CAAME;AAFM,CAAlB;AAKA,MAAMC,SAAS,GAAG;EAChBC,KAAK,EAAE,EADS;EAEhBC,GAAG,EAAE;AAFW,CAAlB;;AAKA,MAAMC,cAAc,GAAG,CAAC;EACtBC,gBADsB;EAEtBC,QAFsB;EAGtBC,oCAHsB;EAItBC,OAJsB;EAKtBC,sBALsB;EAMtBC;AANsB,CAAD,KAOjB;EACJ,IAAI,CAACL,gBAAL,EAAuB,OAAO,IAAP;;EACvB,IAAIC,QAAJ,EAAc;IACZ,oBACE,6BAAC,qBAAD;MACE,EAAE,EAAEA,QADN;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AEC,sBAL1B;IAME,QAAQ,EAAEiC,QANZ;IAOE,QAAQ,EAAEhC;EAPZ,EAnBF,CAXF;AAyCD,CA1FD;;AA4FAyB,OAAO,CAACnB,SAAR,2CAAoB;EAClBoB,cAAc,EAAEnB,kBAAA,CAAU6C,SAAV,CAAoB,CAAC7C,kBAAA,CAAUK,IAAX,EAAiBL,kBAAA,CAAUI,IAA3B,EAAiCJ,kBAAA,CAAUE,MAA3C,CAApB,CADE;EAElB,eAAeF,kBAAA,CAAUE,MAFP;EAGlB,cAAcF,kBAAA,CAAUE,MAHN;EAIlBZ,oCAAoC,EAAEU,kBAAA,CAAUE,MAAV,CAAiBC,UAJrC;EAKlB;EACAoB,sBAAsB,EAAEvB,kBAAA,CAAUE,MANhB;EAOlBsB,SAAS,EAAExB,kBAAA,CAAU8C,MAPH;EAQlBrB,QAAQ,EAAEzB,kBAAA,CAAUM,KAAV,CAAgB,CAAC,EAAD,EAAK,EAAL,CAAhB,CARQ;EASlBb,QAAQ,EAAEO,kBAAA,CAAUM,KAAV,CAAgB,IAAAC,aAAA,EAAKvB,SAAL,CAAhB,CATQ;EAUlB;EACA;EACA;EACAK,QAAQ,EAAEW,kBAAA,CAAUE,MAbF;EAclBd,gBAAgB,EAAEY,kBAAA,CAAUC;AAdV,CAApB;eAiBeiB,O"}
@@ -34,12 +34,20 @@
34
34
  position: absolute;
35
35
  border-radius: 7px;
36
36
  background-color: cm_grey_700;
37
- right: -75px;
38
- bottom: 32px;
39
37
  height: auto;
40
38
  width: 200px;
41
39
  }
42
40
 
41
+ .bigIconToolTip {
42
+ right: -71px;
43
+ bottom: 31px;
44
+ }
45
+
46
+ .smallIconToolTip {
47
+ right: -75px;
48
+ bottom: 32px;
49
+ }
50
+
43
51
  .toolTip::before {
44
52
  content: '';
45
53
  display: inline-block;
@@ -1 +1 @@
1
- {"version":3,"file":"globals.d.js","names":[],"sources":["../src/globals.d.ts"],"sourcesContent":["declare module '@coorpacademy/nova-icons';\ndeclare module '@coorpacademy/react-native-slider';\ndeclare module '@react-native-community/blur';\ndeclare module '@coorpacademy/translate';\ndeclare module 'react-native/*';\ndeclare module 'color';\ndeclare module 'classnames';\ndeclare module '*.css';\n"],"mappings":""}
1
+ {"version":3,"file":"globals.d.js","names":[],"sources":["../src/globals.d.ts"],"sourcesContent":["declare module '@coorpacademy/nova-icons';\ndeclare module '@coorpacademy/react-native-slider';\ndeclare module '@react-native-community/blur';\ndeclare module '@coorpacademy/translate';\ndeclare module 'browser-env';\ndeclare module 'react-native/*';\ndeclare module 'color';\ndeclare module 'classnames';\ndeclare module '*.css';\n"],"mappings":""}
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { BattleOpponentListProps } from './prop-types';
3
+ declare const BattleOpponentList: {
4
+ ({ opponents }: BattleOpponentListProps): JSX.Element;
5
+ propTypes: {
6
+ opponents: import("prop-types").Requireable<(import("prop-types").InferProps<{
7
+ isAlreadyEngaged: import("prop-types").Requireable<boolean>;
8
+ isRandom: import("prop-types").Requireable<boolean>;
9
+ photo: import("prop-types").Requireable<string>;
10
+ onClick: import("prop-types").Requireable<(...args: any[]) => any>;
11
+ displayName: import("prop-types").Requireable<string>;
12
+ tooltipText: import("prop-types").Requireable<string>;
13
+ user_id: import("prop-types").Requireable<string>;
14
+ }> | null | undefined)[]>;
15
+ };
16
+ };
17
+ export default BattleOpponentList;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AAGhE,QAAA,MAAM,kBAAkB;oBAAiB,uBAAuB;;;;;;;;;;;;CAiB/D,CAAC;AAIF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _react = _interopRequireWildcard(require("react"));
7
+
8
+ var _get = _interopRequireDefault(require("lodash/fp/get"));
9
+
10
+ var _map = _interopRequireDefault(require("lodash/fp/map"));
11
+
12
+ var _uuid = require("uuid");
13
+
14
+ var _battleOpponent = _interopRequireDefault(require("../../atom/battle-opponent"));
15
+
16
+ var _propTypes = _interopRequireDefault(require("./prop-types"));
17
+
18
+ var _style = _interopRequireDefault(require("./style.css"));
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ 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); }
23
+
24
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
+
26
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
27
+
28
+ const BattleOpponentList = ({
29
+ opponents
30
+ }) => {
31
+ const opponentList = (0, _react.useMemo)(() => (0, _map.default)(opponent => /*#__PURE__*/_react.default.createElement(_battleOpponent.default, _extends({}, opponent, {
32
+ key: (0, _uuid.v5)('battle-', _uuid.v5.URL),
33
+ userAvatarSrc: (0, _get.default)('photo', opponent)
34
+ })), opponents), [opponents]);
35
+ return /*#__PURE__*/_react.default.createElement("ul", {
36
+ className: _style.default.opponentList
37
+ }, opponentList);
38
+ };
39
+
40
+ BattleOpponentList.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
41
+ var _default = BattleOpponentList;
42
+ exports.default = _default;
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["BattleOpponentList","opponents","opponentList","useMemo","map","opponent","uuidV5","URL","get","style","propTypes"],"sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"sourcesContent":["import React, {useMemo} from 'react';\nimport get from 'lodash/fp/get';\nimport map from 'lodash/fp/map';\nimport {v5 as uuidV5} from 'uuid';\nimport BattleOpponent from '../../atom/battle-opponent';\nimport propTypes, {BattleOpponentListProps} from './prop-types';\nimport style from './style.css';\n\nconst BattleOpponentList = ({opponents}: BattleOpponentListProps) => {\n const opponentList = useMemo(\n () =>\n map(\n opponent => (\n <BattleOpponent\n {...opponent}\n key={uuidV5('battle-', uuidV5.URL)}\n userAvatarSrc={get('photo', opponent)}\n />\n ),\n opponents\n ),\n [opponents]\n );\n\n return <ul className={style.opponentList}>{opponentList}</ul>;\n};\n\nBattleOpponentList.propTypes = propTypes;\n\nexport default BattleOpponentList;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,kBAAkB,GAAG,CAAC;EAACC;AAAD,CAAD,KAA0C;EACnE,MAAMC,YAAY,GAAG,IAAAC,cAAA,EACnB,MACE,IAAAC,YAAA,EACEC,QAAQ,iBACN,6BAAC,uBAAD,eACMA,QADN;IAEE,GAAG,EAAE,IAAAC,QAAA,EAAO,SAAP,EAAkBA,QAAA,CAAOC,GAAzB,CAFP;IAGE,aAAa,EAAE,IAAAC,YAAA,EAAI,OAAJ,EAAaH,QAAb;EAHjB,GAFJ,EAQEJ,SARF,CAFiB,EAYnB,CAACA,SAAD,CAZmB,CAArB;EAeA,oBAAO;IAAI,SAAS,EAAEQ,cAAA,CAAMP;EAArB,GAAoCA,YAApC,CAAP;AACD,CAjBD;;AAmBAF,kBAAkB,CAACU,SAAnB,2CAA+BA,kBAA/B;eAEeV,kB"}
@@ -0,0 +1,26 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const propTypes: {
3
+ opponents: PropTypes.Requireable<(PropTypes.InferProps<{
4
+ isAlreadyEngaged: PropTypes.Requireable<boolean>;
5
+ isRandom: PropTypes.Requireable<boolean>;
6
+ photo: PropTypes.Requireable<string>;
7
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
8
+ displayName: PropTypes.Requireable<string>;
9
+ tooltipText: PropTypes.Requireable<string>;
10
+ user_id: PropTypes.Requireable<string>;
11
+ }> | null | undefined)[]>;
12
+ };
13
+ declare type MoocBattleOpponent = {
14
+ isAlreadyEngaged?: boolean;
15
+ isRandom?: boolean;
16
+ photo?: string;
17
+ onClick?: () => void;
18
+ displayName: string;
19
+ tooltipText: string;
20
+ user_id: string;
21
+ };
22
+ export declare type BattleOpponentListProps = {
23
+ opponents: MoocBattleOpponent[];
24
+ };
25
+ export default propTypes;
26
+ //# sourceMappingURL=prop-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/molecule/battle-opponent-list/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,QAAA,MAAM,SAAS;;;;;;;;;;CAYd,CAAC;AAEF,aAAK,kBAAkB,GAAG;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,uBAAuB,GAAG;IAAC,SAAS,EAAE,kBAAkB,EAAE,CAAA;CAAC,CAAC;AAExE,eAAe,SAAS,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _propTypes = _interopRequireDefault(require("prop-types"));
7
+
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+
10
+ const propTypes = {
11
+ opponents: _propTypes.default.arrayOf(_propTypes.default.shape({
12
+ isAlreadyEngaged: _propTypes.default.bool,
13
+ isRandom: _propTypes.default.bool,
14
+ photo: _propTypes.default.string,
15
+ onClick: _propTypes.default.func,
16
+ displayName: _propTypes.default.string,
17
+ tooltipText: _propTypes.default.string,
18
+ user_id: _propTypes.default.string
19
+ }))
20
+ };
21
+ var _default = propTypes;
22
+ exports.default = _default;
23
+ //# sourceMappingURL=prop-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-types.js","names":["propTypes","opponents","PropTypes","arrayOf","shape","isAlreadyEngaged","bool","isRandom","photo","string","onClick","func","displayName","tooltipText","user_id"],"sources":["../../../src/molecule/battle-opponent-list/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst propTypes = {\n opponents: PropTypes.arrayOf(\n PropTypes.shape({\n isAlreadyEngaged: PropTypes.bool,\n isRandom: PropTypes.bool,\n photo: PropTypes.string,\n onClick: PropTypes.func,\n displayName: PropTypes.string,\n tooltipText: PropTypes.string,\n user_id: PropTypes.string\n })\n )\n};\n\ntype MoocBattleOpponent = {\n isAlreadyEngaged?: boolean;\n isRandom?: boolean;\n photo?: string;\n onClick?: () => void;\n displayName: string;\n tooltipText: string;\n user_id: string;\n};\n\nexport type BattleOpponentListProps = {opponents: MoocBattleOpponent[]};\n\nexport default propTypes;\n"],"mappings":";;;;;AAAA;;;;AAEA,MAAMA,SAAS,GAAG;EAChBC,SAAS,EAAEC,kBAAA,CAAUC,OAAV,CACTD,kBAAA,CAAUE,KAAV,CAAgB;IACdC,gBAAgB,EAAEH,kBAAA,CAAUI,IADd;IAEdC,QAAQ,EAAEL,kBAAA,CAAUI,IAFN;IAGdE,KAAK,EAAEN,kBAAA,CAAUO,MAHH;IAIdC,OAAO,EAAER,kBAAA,CAAUS,IAJL;IAKdC,WAAW,EAAEV,kBAAA,CAAUO,MALT;IAMdI,WAAW,EAAEX,kBAAA,CAAUO,MANT;IAOdK,OAAO,EAAEZ,kBAAA,CAAUO;EAPL,CAAhB,CADS;AADK,CAAlB;eA0BeT,S"}
@@ -0,0 +1,5 @@
1
+ .opponentList {
2
+ margin: 0;
3
+ padding: 0;
4
+ display: contents;
5
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/user-preferences/index.js"],"names":[],"mappings":";AAwCA,0DAeC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/user-preferences/index.js"],"names":[],"mappings":";AA4CA,0DAeC"}