@coorpacademy/components 11.11.3-alpha.2 → 11.11.3-alpha.4

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 (55) hide show
  1. package/es/atom/input-switch/style.css +11 -12
  2. package/es/atom/tooltip/index.d.ts +1 -3
  3. package/es/atom/tooltip/index.d.ts.map +1 -1
  4. package/es/atom/tooltip/index.js +7 -17
  5. package/es/atom/tooltip/index.js.map +1 -1
  6. package/es/atom/tooltip/style.css +2 -10
  7. package/es/globals.d.js.map +1 -1
  8. package/es/organism/mooc-header/index.js +5 -4
  9. package/es/organism/mooc-header/index.js.map +1 -1
  10. package/es/organism/mooc-header/style.css +11 -1
  11. package/lib/atom/input-switch/style.css +11 -12
  12. package/lib/atom/tooltip/index.d.ts +1 -3
  13. package/lib/atom/tooltip/index.d.ts.map +1 -1
  14. package/lib/atom/tooltip/index.js +7 -18
  15. package/lib/atom/tooltip/index.js.map +1 -1
  16. package/lib/atom/tooltip/style.css +2 -10
  17. package/lib/globals.d.js.map +1 -1
  18. package/lib/organism/mooc-header/index.js +5 -4
  19. package/lib/organism/mooc-header/index.js.map +1 -1
  20. package/lib/organism/mooc-header/style.css +11 -1
  21. package/package.json +2 -2
  22. package/es/atom/battle-opponent/index.d.ts +0 -19
  23. package/es/atom/battle-opponent/index.d.ts.map +0 -1
  24. package/es/atom/battle-opponent/index.js +0 -52
  25. package/es/atom/battle-opponent/index.js.map +0 -1
  26. package/es/atom/battle-opponent/prop-types.d.ts +0 -19
  27. package/es/atom/battle-opponent/prop-types.d.ts.map +0 -1
  28. package/es/atom/battle-opponent/prop-types.js +0 -11
  29. package/es/atom/battle-opponent/prop-types.js.map +0 -1
  30. package/es/atom/battle-opponent/style.css +0 -126
  31. package/es/molecule/battle-opponent-list/index.d.ts +0 -18
  32. package/es/molecule/battle-opponent-list/index.d.ts.map +0 -1
  33. package/es/molecule/battle-opponent-list/index.js +0 -21
  34. package/es/molecule/battle-opponent-list/index.js.map +0 -1
  35. package/es/molecule/battle-opponent-list/prop-types.d.ts +0 -26
  36. package/es/molecule/battle-opponent-list/prop-types.d.ts.map +0 -1
  37. package/es/molecule/battle-opponent-list/prop-types.js +0 -14
  38. package/es/molecule/battle-opponent-list/prop-types.js.map +0 -1
  39. package/lib/atom/battle-opponent/index.d.ts +0 -19
  40. package/lib/atom/battle-opponent/index.d.ts.map +0 -1
  41. package/lib/atom/battle-opponent/index.js +0 -70
  42. package/lib/atom/battle-opponent/index.js.map +0 -1
  43. package/lib/atom/battle-opponent/prop-types.d.ts +0 -19
  44. package/lib/atom/battle-opponent/prop-types.d.ts.map +0 -1
  45. package/lib/atom/battle-opponent/prop-types.js +0 -20
  46. package/lib/atom/battle-opponent/prop-types.js.map +0 -1
  47. package/lib/atom/battle-opponent/style.css +0 -126
  48. package/lib/molecule/battle-opponent-list/index.d.ts +0 -18
  49. package/lib/molecule/battle-opponent-list/index.d.ts.map +0 -1
  50. package/lib/molecule/battle-opponent-list/index.js +0 -37
  51. package/lib/molecule/battle-opponent-list/index.js.map +0 -1
  52. package/lib/molecule/battle-opponent-list/prop-types.d.ts +0 -26
  53. package/lib/molecule/battle-opponent-list/prop-types.d.ts.map +0 -1
  54. package/lib/molecule/battle-opponent-list/prop-types.js +0 -23
  55. package/lib/molecule/battle-opponent-list/prop-types.js.map +0 -1
@@ -1,126 +0,0 @@
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
- /* div:not(.random) */
54
- .avatar {
55
- width: 50px;
56
- height: 50px;
57
- border-radius: 50%;
58
- overflow: hidden;
59
- background-color: light;
60
- margin-right: 20px;
61
- flex-shrink: 0;
62
- }
63
-
64
- .avatar img {
65
- width: 100%;
66
- height: auto;
67
- }
68
-
69
-
70
- .random {
71
- color: medium;
72
- }
73
-
74
- .alreadyEngaged.name,
75
- .random .name {
76
- color: medium;
77
- }
78
-
79
- .random .avatar {
80
- background-color: brand;
81
- display: flex;
82
- align-items: center;
83
- justify-content: center;
84
- }
85
-
86
- .random .avatar:before {
87
- content: '?';
88
- font-family: 'Gilroy';
89
- font-size: 32px;
90
- font-weight: 600;
91
- color: white;
92
- text-align: center;
93
- }
94
-
95
- .random .avatar img {
96
- display: none;
97
- }
98
-
99
- .opponent-card:hover {
100
- background-color: cm_grey_75;
101
- }
102
-
103
- .card .infoIconTooltip {
104
- background: transparent;
105
- /* height: 100%; */
106
- }
107
-
108
- @media mobile {
109
- .opponent-card {
110
- width: 100%;
111
- padding: 10px;
112
- }
113
-
114
- .opponent-card .avatar {
115
- margin-right: 10px;
116
- }
117
-
118
- .opponent-card .rightArrow {
119
- margin-left: 10px;
120
- }
121
-
122
- .card {
123
- margin: 0 0 10px;
124
- }
125
- }
126
-
@@ -1,18 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"names":[],"mappings":";AAIA,OAAkB,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AAEhE,QAAA,MAAM,kBAAkB;oBAAiB,uBAAuB;;;;;;;;;;;;CAiB/D,CAAC;AAIF,eAAe,kBAAkB,CAAC"}
@@ -1,21 +0,0 @@
1
- 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); }
2
-
3
- import React, { useMemo } from 'react';
4
- import get from 'lodash/fp/get';
5
- import map from 'lodash/fp/map';
6
- import BattleOpponent from '../../atom/battle-opponent';
7
- import propTypes from './prop-types';
8
-
9
- const BattleOpponentList = ({
10
- opponents
11
- }) => {
12
- const opponentList = useMemo(() => map(opponent => /*#__PURE__*/React.createElement(BattleOpponent, _extends({}, opponent, {
13
- key: opponent.user_id,
14
- userAvatarSrc: get('photo', opponent)
15
- })), opponents), [opponents]);
16
- return opponentList;
17
- };
18
-
19
- BattleOpponentList.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
20
- export default BattleOpponentList;
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","get","map","BattleOpponent","propTypes","BattleOpponentList","opponents","opponentList","opponent","user_id"],"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 BattleOpponent from '../../atom/battle-opponent';\nimport propTypes, {BattleOpponentListProps} from './prop-types';\n\nconst BattleOpponentList = ({opponents}: BattleOpponentListProps) => {\n const opponentList = useMemo(\n () =>\n map(\n opponent => (\n <BattleOpponent\n {...opponent}\n key={opponent.user_id}\n userAvatarSrc={get('photo', opponent)}\n />\n ),\n opponents\n ),\n [opponents]\n );\n\n return opponentList;\n};\n\nBattleOpponentList.propTypes = propTypes;\n\nexport default BattleOpponentList;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,cAAP,MAA2B,4BAA3B;AACA,OAAOC,SAAP,MAAiD,cAAjD;;AAEA,MAAMC,kBAAkB,GAAG,CAAC;EAACC;AAAD,CAAD,KAA0C;EACnE,MAAMC,YAAY,GAAGP,OAAO,CAC1B,MACEE,GAAG,CACDM,QAAQ,iBACN,oBAAC,cAAD,eACMA,QADN;IAEE,GAAG,EAAEA,QAAQ,CAACC,OAFhB;IAGE,aAAa,EAAER,GAAG,CAAC,OAAD,EAAUO,QAAV;EAHpB,GAFD,EAQDF,SARC,CAFqB,EAY1B,CAACA,SAAD,CAZ0B,CAA5B;EAeA,OAAOC,YAAP;AACD,CAjBD;;AAmBAF,kBAAkB,CAACD,SAAnB,2CAA+BA,SAA/B;AAEA,eAAeC,kBAAf"}
@@ -1,26 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,14 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- const propTypes = {
3
- opponents: PropTypes.arrayOf(PropTypes.shape({
4
- isAlreadyEngaged: PropTypes.bool,
5
- isRandom: PropTypes.bool,
6
- photo: PropTypes.string,
7
- onClick: PropTypes.func,
8
- displayName: PropTypes.string,
9
- tooltipText: PropTypes.string,
10
- user_id: PropTypes.string
11
- }))
12
- };
13
- export default propTypes;
14
- //# sourceMappingURL=prop-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prop-types.js","names":["PropTypes","propTypes","opponents","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,OAAOA,SAAP,MAAsB,YAAtB;AAEA,MAAMC,SAAS,GAAG;EAChBC,SAAS,EAAEF,SAAS,CAACG,OAAV,CACTH,SAAS,CAACI,KAAV,CAAgB;IACdC,gBAAgB,EAAEL,SAAS,CAACM,IADd;IAEdC,QAAQ,EAAEP,SAAS,CAACM,IAFN;IAGdE,KAAK,EAAER,SAAS,CAACS,MAHH;IAIdC,OAAO,EAAEV,SAAS,CAACW,IAJL;IAKdC,WAAW,EAAEZ,SAAS,CAACS,MALT;IAMdI,WAAW,EAAEb,SAAS,CAACS,MANT;IAOdK,OAAO,EAAEd,SAAS,CAACS;EAPL,CAAhB,CADS;AADK,CAAlB;AA0BA,eAAeR,SAAf"}
@@ -1,19 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,70 +0,0 @@
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("div", _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
@@ -1 +0,0 @@
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 <div\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 </div>\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,iDACO,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"}
@@ -1,19 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,20 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,126 +0,0 @@
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
- /* div:not(.random) */
54
- .avatar {
55
- width: 50px;
56
- height: 50px;
57
- border-radius: 50%;
58
- overflow: hidden;
59
- background-color: light;
60
- margin-right: 20px;
61
- flex-shrink: 0;
62
- }
63
-
64
- .avatar img {
65
- width: 100%;
66
- height: auto;
67
- }
68
-
69
-
70
- .random {
71
- color: medium;
72
- }
73
-
74
- .alreadyEngaged.name,
75
- .random .name {
76
- color: medium;
77
- }
78
-
79
- .random .avatar {
80
- background-color: brand;
81
- display: flex;
82
- align-items: center;
83
- justify-content: center;
84
- }
85
-
86
- .random .avatar:before {
87
- content: '?';
88
- font-family: 'Gilroy';
89
- font-size: 32px;
90
- font-weight: 600;
91
- color: white;
92
- text-align: center;
93
- }
94
-
95
- .random .avatar img {
96
- display: none;
97
- }
98
-
99
- .opponent-card:hover {
100
- background-color: cm_grey_75;
101
- }
102
-
103
- .card .infoIconTooltip {
104
- background: transparent;
105
- /* height: 100%; */
106
- }
107
-
108
- @media mobile {
109
- .opponent-card {
110
- width: 100%;
111
- padding: 10px;
112
- }
113
-
114
- .opponent-card .avatar {
115
- margin-right: 10px;
116
- }
117
-
118
- .opponent-card .rightArrow {
119
- margin-left: 10px;
120
- }
121
-
122
- .card {
123
- margin: 0 0 10px;
124
- }
125
- }
126
-
@@ -1,18 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"names":[],"mappings":";AAIA,OAAkB,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AAEhE,QAAA,MAAM,kBAAkB;oBAAiB,uBAAuB;;;;;;;;;;;;CAiB/D,CAAC;AAIF,eAAe,kBAAkB,CAAC"}
@@ -1,37 +0,0 @@
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 _battleOpponent = _interopRequireDefault(require("../../atom/battle-opponent"));
13
-
14
- var _propTypes = _interopRequireDefault(require("./prop-types"));
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
- 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); }
19
-
20
- 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; }
21
-
22
- 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); }
23
-
24
- const BattleOpponentList = ({
25
- opponents
26
- }) => {
27
- const opponentList = (0, _react.useMemo)(() => (0, _map.default)(opponent => /*#__PURE__*/_react.default.createElement(_battleOpponent.default, _extends({}, opponent, {
28
- key: opponent.user_id,
29
- userAvatarSrc: (0, _get.default)('photo', opponent)
30
- })), opponents), [opponents]);
31
- return opponentList;
32
- };
33
-
34
- BattleOpponentList.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
35
- var _default = BattleOpponentList;
36
- exports.default = _default;
37
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["BattleOpponentList","opponents","opponentList","useMemo","map","opponent","user_id","get","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 BattleOpponent from '../../atom/battle-opponent';\nimport propTypes, {BattleOpponentListProps} from './prop-types';\n\nconst BattleOpponentList = ({opponents}: BattleOpponentListProps) => {\n const opponentList = useMemo(\n () =>\n map(\n opponent => (\n <BattleOpponent\n {...opponent}\n key={opponent.user_id}\n userAvatarSrc={get('photo', opponent)}\n />\n ),\n opponents\n ),\n [opponents]\n );\n\n return opponentList;\n};\n\nBattleOpponentList.propTypes = propTypes;\n\nexport default BattleOpponentList;\n"],"mappings":";;;;;AAAA;;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,EAAEA,QAAQ,CAACC,OAFhB;IAGE,aAAa,EAAE,IAAAC,YAAA,EAAI,OAAJ,EAAaF,QAAb;EAHjB,GAFJ,EAQEJ,SARF,CAFiB,EAYnB,CAACA,SAAD,CAZmB,CAArB;EAeA,OAAOC,YAAP;AACD,CAjBD;;AAmBAF,kBAAkB,CAACQ,SAAnB,2CAA+BA,kBAA/B;eAEeR,kB"}
@@ -1,26 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,23 +0,0 @@
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
@@ -1 +0,0 @@
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"}