@coorpacademy/components 11.10.5 → 11.11.1-alpha.0

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 (85) 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 +126 -0
  10. package/es/atom/provider/web-context.d.ts +2 -2
  11. package/es/atom/provider/web-context.d.ts.map +1 -1
  12. package/es/atom/provider/web-context.js +1 -4
  13. package/es/atom/provider/web-context.js.map +1 -1
  14. package/es/atom/review-header-step-item/index.d.ts.map +1 -1
  15. package/es/atom/review-header-step-item/index.js +8 -3
  16. package/es/atom/review-header-step-item/index.js.map +1 -1
  17. package/es/atom/tooltip/index.d.ts +3 -1
  18. package/es/atom/tooltip/index.d.ts.map +1 -1
  19. package/es/atom/tooltip/index.js +17 -7
  20. package/es/atom/tooltip/index.js.map +1 -1
  21. package/es/atom/tooltip/style.css +10 -2
  22. package/es/globals.d.js.map +1 -1
  23. package/es/molecule/answer/index.d.ts +3 -0
  24. package/es/molecule/answer/index.d.ts.map +1 -1
  25. package/es/molecule/answer/index.js +9 -3
  26. package/es/molecule/answer/index.js.map +1 -1
  27. package/es/organism/review-header/index.d.ts +23 -0
  28. package/es/organism/review-header/index.d.ts.map +1 -1
  29. package/es/organism/review-header/index.js +4 -0
  30. package/es/organism/review-header/index.js.map +1 -1
  31. package/es/template/activity/engine-stars.d.ts +1 -0
  32. package/es/template/activity/engine-stars.js +2 -1
  33. package/es/template/activity/engine-stars.js.map +1 -1
  34. package/es/template/activity/index.d.ts +1 -0
  35. package/es/template/activity/index.js +2 -1
  36. package/es/template/activity/index.js.map +1 -1
  37. package/es/template/activity/stars-summary.d.ts +1 -0
  38. package/es/template/activity/stars-summary.js +2 -1
  39. package/es/template/activity/stars-summary.js.map +1 -1
  40. package/es/util/render-with-context.d.ts.map +1 -1
  41. package/es/util/render-with-context.js +13 -6
  42. package/es/util/render-with-context.js.map +1 -1
  43. package/lib/atom/battle-opponent/index.d.ts +19 -0
  44. package/lib/atom/battle-opponent/index.d.ts.map +1 -0
  45. package/lib/atom/battle-opponent/index.js +70 -0
  46. package/lib/atom/battle-opponent/index.js.map +1 -0
  47. package/lib/atom/battle-opponent/prop-types.d.ts +19 -0
  48. package/lib/atom/battle-opponent/prop-types.d.ts.map +1 -0
  49. package/lib/atom/battle-opponent/prop-types.js +20 -0
  50. package/lib/atom/battle-opponent/prop-types.js.map +1 -0
  51. package/lib/atom/battle-opponent/style.css +126 -0
  52. package/lib/atom/provider/web-context.d.ts +2 -2
  53. package/lib/atom/provider/web-context.d.ts.map +1 -1
  54. package/lib/atom/provider/web-context.js +1 -5
  55. package/lib/atom/provider/web-context.js.map +1 -1
  56. package/lib/atom/review-header-step-item/index.d.ts.map +1 -1
  57. package/lib/atom/review-header-step-item/index.js +12 -3
  58. package/lib/atom/review-header-step-item/index.js.map +1 -1
  59. package/lib/atom/tooltip/index.d.ts +3 -1
  60. package/lib/atom/tooltip/index.d.ts.map +1 -1
  61. package/lib/atom/tooltip/index.js +18 -7
  62. package/lib/atom/tooltip/index.js.map +1 -1
  63. package/lib/atom/tooltip/style.css +10 -2
  64. package/lib/globals.d.js.map +1 -1
  65. package/lib/molecule/answer/index.d.ts +3 -0
  66. package/lib/molecule/answer/index.d.ts.map +1 -1
  67. package/lib/molecule/answer/index.js +9 -3
  68. package/lib/molecule/answer/index.js.map +1 -1
  69. package/lib/organism/review-header/index.d.ts +23 -0
  70. package/lib/organism/review-header/index.d.ts.map +1 -1
  71. package/lib/organism/review-header/index.js +5 -0
  72. package/lib/organism/review-header/index.js.map +1 -1
  73. package/lib/template/activity/engine-stars.d.ts +1 -0
  74. package/lib/template/activity/engine-stars.js +2 -1
  75. package/lib/template/activity/engine-stars.js.map +1 -1
  76. package/lib/template/activity/index.d.ts +1 -0
  77. package/lib/template/activity/index.js +2 -1
  78. package/lib/template/activity/index.js.map +1 -1
  79. package/lib/template/activity/stars-summary.d.ts +1 -0
  80. package/lib/template/activity/stars-summary.js +2 -1
  81. package/lib/template/activity/stars-summary.js.map +1 -1
  82. package/lib/util/render-with-context.d.ts.map +1 -1
  83. package/lib/util/render-with-context.js +18 -6
  84. package/lib/util/render-with-context.js.map +1 -1
  85. package/package.json +2 -2
@@ -0,0 +1,126 @@
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
+
@@ -4,9 +4,9 @@ declare type Skin = {
4
4
  primary: string;
5
5
  };
6
6
  };
7
- declare type WebContextValues = {
7
+ export declare type WebContextValues = {
8
8
  skin?: Skin;
9
- translate: (key: string, data?: Record<string, string>) => string;
9
+ translate?: (key: string, data?: Record<string, string>) => string;
10
10
  };
11
11
  declare type Props = WebContextValues & {
12
12
  children: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"web-context.d.ts","sourceRoot":"","sources":["../../../src/atom/provider/web-context.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,SAAS,EAAa,MAAM,OAAO,CAAC;AAGlE,aAAK,IAAI,GAAG;IACV,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,aAAK,gBAAgB,GAAG;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC;CACnE,CAAC;AAMF,aAAK,KAAK,GAAG,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,UAAU,2BAA0B,KAAK,gBAE9C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAO,gBAQhC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"web-context.d.ts","sourceRoot":"","sources":["../../../src/atom/provider/web-context.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAgB,SAAS,EAAa,MAAM,OAAO,CAAC;AAElE,aAAK,IAAI,GAAG;IACV,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC;CACpE,CAAC;AAIF,aAAK,KAAK,GAAG,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,UAAU,2BAA0B,KAAK,gBAE9C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAO,gBAQhC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -5,8 +5,6 @@ exports.useWebContext = exports.default = void 0;
5
5
 
6
6
  var _react = _interopRequireWildcard(require("react"));
7
7
 
8
- var _translate = require("@coorpacademy/translate");
9
-
10
8
  const _excluded = ["children"];
11
9
 
12
10
  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); }
@@ -15,9 +13,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
15
13
 
16
14
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
17
15
 
18
- const Context = /*#__PURE__*/(0, _react.createContext)({
19
- translate: _translate.mockTranslate
20
- });
16
+ const Context = /*#__PURE__*/(0, _react.createContext)({});
21
17
 
22
18
  const WebContext = _ref => {
23
19
  let {
@@ -1 +1 @@
1
- {"version":3,"file":"web-context.js","names":["Context","createContext","translate","mockTranslate","WebContext","children","value","useWebContext","context","useContext","Error"],"sources":["../../../src/atom/provider/web-context.tsx"],"sourcesContent":["import React, {createContext, ReactNode, useContext} from 'react';\nimport {mockTranslate} from '@coorpacademy/translate';\n\ntype Skin = {\n common: {\n primary: string;\n };\n};\n\ntype WebContextValues = {\n skin?: Skin;\n translate: (key: string, data?: Record<string, string>) => string;\n};\n\nconst Context = createContext({\n translate: mockTranslate\n});\n\ntype Props = WebContextValues & {\n children: ReactNode;\n};\n\nconst WebContext = ({children, ...value}: Props) => {\n return <Context.Provider value={value}>{children}</Context.Provider>;\n};\n\nexport const useWebContext = (): WebContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error('❌ [WebContext] useWebContext must be used within a provider <WebContext>');\n }\n\n return context;\n};\n\nexport default WebContext;\n"],"mappings":";;;;;AAAA;;AACA;;;;;;;;;;AAaA,MAAMA,OAAO,gBAAG,IAAAC,oBAAA,EAAc;EAC5BC,SAAS,EAAEC;AADiB,CAAd,CAAhB;;AAQA,MAAMC,UAAU,GAAG,QAAiC;EAAA,IAAhC;IAACC;EAAD,CAAgC;EAAA,IAAlBC,KAAkB;;EAClD,oBAAO,6BAAC,OAAD,CAAS,QAAT;IAAkB,KAAK,EAAEA;EAAzB,GAAiCD,QAAjC,CAAP;AACD,CAFD;;AAIO,MAAME,aAAa,GAAG,MAAwB;EACnD,MAAMC,OAAO,GAAG,IAAAC,iBAAA,EAAWT,OAAX,CAAhB;;EAEA,IAAI,CAACQ,OAAL,EAAc;IACZ,MAAM,IAAIE,KAAJ,CAAU,0EAAV,CAAN;EACD;;EAED,OAAOF,OAAP;AACD,CARM;;;eAUQJ,U"}
1
+ {"version":3,"file":"web-context.js","names":["Context","createContext","WebContext","children","value","useWebContext","context","useContext","Error"],"sources":["../../../src/atom/provider/web-context.tsx"],"sourcesContent":["import React, {createContext, ReactNode, useContext} from 'react';\n\ntype Skin = {\n common: {\n primary: string;\n };\n};\n\nexport type WebContextValues = {\n skin?: Skin;\n translate?: (key: string, data?: Record<string, string>) => string;\n};\n\nconst Context = createContext({});\n\ntype Props = WebContextValues & {\n children: ReactNode;\n};\n\nconst WebContext = ({children, ...value}: Props) => {\n return <Context.Provider value={value}>{children}</Context.Provider>;\n};\n\nexport const useWebContext = (): WebContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error('❌ [WebContext] useWebContext must be used within a provider <WebContext>');\n }\n\n return context;\n};\n\nexport default WebContext;\n"],"mappings":";;;;;AAAA;;;;;;;;;;AAaA,MAAMA,OAAO,gBAAG,IAAAC,oBAAA,EAAc,EAAd,CAAhB;;AAMA,MAAMC,UAAU,GAAG,QAAiC;EAAA,IAAhC;IAACC;EAAD,CAAgC;EAAA,IAAlBC,KAAkB;;EAClD,oBAAO,6BAAC,OAAD,CAAS,QAAT;IAAkB,KAAK,EAAEA;EAAzB,GAAiCD,QAAjC,CAAP;AACD,CAFD;;AAIO,MAAME,aAAa,GAAG,MAAwB;EACnD,MAAMC,OAAO,GAAG,IAAAC,iBAAA,EAAWP,OAAX,CAAhB;;EAEA,IAAI,CAACM,OAAL,EAAc;IACZ,MAAM,IAAIE,KAAJ,CAAU,0EAAV,CAAN;EACD;;EAED,OAAOF,OAAP;AACD,CARM;;;eAUQJ,U"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-header-step-item/index.tsx"],"names":[],"mappings":";AAQA,OAAkB,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAsDvD,QAAA,MAAM,oBAAoB;YAAW,mBAAmB;;;;;;CAevD,CAAC;AAIF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-header-step-item/index.tsx"],"names":[],"mappings":";AASA,OAAkB,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAsDvD,QAAA,MAAM,oBAAoB;YAAW,mBAAmB;;;;;;CAevD,CAAC;AAWF,eAAe,oBAAoB,CAAC"}
@@ -9,21 +9,25 @@ var _classnames = _interopRequireDefault(require("classnames"));
9
9
 
10
10
  var _novaIcons = require("@coorpacademy/nova-icons");
11
11
 
12
- var _provider = require("../provider");
12
+ var _provider = _interopRequireWildcard(require("../provider"));
13
13
 
14
14
  var _style = _interopRequireDefault(require("./style.css"));
15
15
 
16
16
  var _types = _interopRequireDefault(require("./types"));
17
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
+
18
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
23
 
20
- const Content = props => {
24
+ const Content = (props, legacyContext) => {
21
25
  const {
22
26
  icon,
23
27
  current,
24
28
  value
25
29
  } = props;
26
- const translate = (0, _provider.GetTranslateFromContext)();
30
+ const translate = (0, _provider.GetTranslateFromContext)(legacyContext);
27
31
  let child;
28
32
  let ariaDescription;
29
33
 
@@ -79,6 +83,11 @@ const ReviewHeaderStepItem = props => {
79
83
  }, /*#__PURE__*/_react.default.createElement(Content, props));
80
84
  };
81
85
 
86
+ Content.propTypes = process.env.NODE_ENV !== "production" ? _types.default : {};
87
+ Content.contextTypes = {
88
+ skin: _provider.default.childContextTypes.skin,
89
+ translate: _provider.default.childContextTypes.translate
90
+ };
82
91
  ReviewHeaderStepItem.propTypes = process.env.NODE_ENV !== "production" ? _types.default : {};
83
92
  var _default = ReviewHeaderStepItem;
84
93
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Content","props","icon","current","value","translate","GetTranslateFromContext","child","ariaDescription","headerStepValue","classnames","style","rightIcon","currentRightIcon","wrongIcon","currentWrongIcon","ReviewHeaderStepItem","default","right","wrong","propTypes"],"sources":["../../../src/atom/review-header-step-item/index.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport {GetTranslateFromContext} from '../provider';\nimport style from './style.css';\nimport propTypes, {HeaderStepItemProps} from './types';\n\nconst Content = (props: HeaderStepItemProps) => {\n const {icon, current, value} = props;\n const translate = GetTranslateFromContext();\n let child;\n let ariaDescription;\n switch (icon) {\n case 'no-answer':\n child = value;\n ariaDescription = current\n ? translate('review_header_step_item.current_question', {\n headerStepValue: value\n })\n : translate('review_header_step_item.not_answered_question', {\n headerStepValue: value\n });\n break;\n\n case 'right':\n child = (\n <RightIcon className={classnames(style.rightIcon, current && style.currentRightIcon)} />\n );\n ariaDescription = translate('review_header_step_item.correct_question', {\n headerStepValue: value\n });\n break;\n\n case 'wrong':\n child = (\n <WrongIcon className={classnames(style.wrongIcon, current && style.currentWrongIcon)} />\n );\n ariaDescription = translate('review_header_step_item.incorrect_question', {\n headerStepValue: value\n });\n break;\n\n default:\n return null;\n }\n\n return (\n <span\n className={style.value}\n aria-label={translate('review_header_step_item.aria_label', {\n headerStepValue: value\n })}\n aria-describedby={ariaDescription}\n >\n {child}\n </span>\n );\n};\n\nconst ReviewHeaderStepItem = (props: HeaderStepItemProps) => {\n const {icon, current} = props;\n return (\n <div\n className={classnames(\n style.default,\n icon === 'right' && style.right,\n icon === 'wrong' && style.wrong,\n current && style.current\n )}\n data-name=\"header-step-item\"\n >\n <Content {...props} />\n </div>\n );\n};\n\nReviewHeaderStepItem.propTypes = propTypes;\n\nexport default ReviewHeaderStepItem;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAIC,KAAD,IAAgC;EAC9C,MAAM;IAACC,IAAD;IAAOC,OAAP;IAAgBC;EAAhB,IAAyBH,KAA/B;EACA,MAAMI,SAAS,GAAG,IAAAC,iCAAA,GAAlB;EACA,IAAIC,KAAJ;EACA,IAAIC,eAAJ;;EACA,QAAQN,IAAR;IACE,KAAK,WAAL;MACEK,KAAK,GAAGH,KAAR;MACAI,eAAe,GAAGL,OAAO,GACrBE,SAAS,CAAC,0CAAD,EAA6C;QACpDI,eAAe,EAAEL;MADmC,CAA7C,CADY,GAIrBC,SAAS,CAAC,+CAAD,EAAkD;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J,oB"}
1
+ {"version":3,"file":"index.js","names":["Content","props","legacyContext","icon","current","value","translate","GetTranslateFromContext","child","ariaDescription","headerStepValue","classnames","style","rightIcon","currentRightIcon","wrongIcon","currentWrongIcon","ReviewHeaderStepItem","default","right","wrong","propTypes","contextTypes","skin","Provider","childContextTypes"],"sources":["../../../src/atom/review-header-step-item/index.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetTranslateFromContext} from '../provider';\nimport {WebContextValues} from '../provider/web-context';\nimport style from './style.css';\nimport propTypes, {HeaderStepItemProps} from './types';\n\nconst Content = (props: HeaderStepItemProps, legacyContext: WebContextValues) => {\n const {icon, current, value} = props;\n const translate = GetTranslateFromContext(legacyContext);\n let child;\n let ariaDescription;\n switch (icon) {\n case 'no-answer':\n child = value;\n ariaDescription = current\n ? translate('review_header_step_item.current_question', {\n headerStepValue: value\n })\n : translate('review_header_step_item.not_answered_question', {\n headerStepValue: value\n });\n break;\n\n case 'right':\n child = (\n <RightIcon className={classnames(style.rightIcon, current && style.currentRightIcon)} />\n );\n ariaDescription = translate('review_header_step_item.correct_question', {\n headerStepValue: value\n });\n break;\n\n case 'wrong':\n child = (\n <WrongIcon className={classnames(style.wrongIcon, current && style.currentWrongIcon)} />\n );\n ariaDescription = translate('review_header_step_item.incorrect_question', {\n headerStepValue: value\n });\n break;\n\n default:\n return null;\n }\n\n return (\n <span\n className={style.value}\n aria-label={translate('review_header_step_item.aria_label', {\n headerStepValue: value\n })}\n aria-describedby={ariaDescription}\n >\n {child}\n </span>\n );\n};\n\nconst ReviewHeaderStepItem = (props: HeaderStepItemProps) => {\n const {icon, current} = props;\n return (\n <div\n className={classnames(\n style.default,\n icon === 'right' && style.right,\n icon === 'wrong' && style.wrong,\n current && style.current\n )}\n data-name=\"header-step-item\"\n >\n <Content {...props} />\n </div>\n );\n};\n\nContent.propTypes = propTypes;\n\nContent.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nReviewHeaderStepItem.propTypes = propTypes;\n\nexport default ReviewHeaderStepItem;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAIA;;AAEA;;AACA;;;;;;;;AAEA,MAAMA,OAAO,GAAG,CAACC,KAAD,EAA6BC,aAA7B,KAAiE;EAC/E,MAAM;IAACC,IAAD;IAAOC,OAAP;IAAgBC;EAAhB,IAAyBJ,KAA/B;EACA,MAAMK,SAAS,GAAG,IAAAC,iCAAA,EAAwBL,aAAxB,CAAlB;EACA,IAAIM,KAAJ;EACA,IAAIC,eAAJ;;EACA,QAAQN,IAAR;IACE,KAAK,WAAL;MACEK,KAAK,GAAGH,KAAR;MACAI,eAAe,GAAGL,OAAO,GACrBE,SAAS,CAAC,0CAAD,EAA6C;QACpDI,eAAe,EAAEL;MADmC,CAA7C,CADY,GAIrBC,SAAS,CAAC,+CAAD,EAAkD;QACzDI,eAAe,EAAEL;MADwC,CAAlD,CAJb;MAOA;;IAEF,KAAK,OAAL;MACEG,KAAK,gBACH,6BAAC,2CAAD;QAAW,SAAS,EAAE,IAAAG,mBAAA,EAAWC,cAAA,CAAMC,SAAjB,EAA4BT,OAAO,IAAIQ,cAAA,CAAME,gBAA7C;MAAtB,EADF;MAGAL,eAAe,GAAGH,SAAS,CAAC,0CAAD,EAA6C;QACtEI,eAAe,EAAEL;MADqD,CAA7C,CAA3B;MAGA;;IAEF,KAAK,OAAL;MACEG,KAAK,gBACH,6BAAC,+BAAD;QAAW,SAAS,EAAE,IAAAG,mBAAA,EAAWC,cAAA,CAAMG,SAAjB,EAA4BX,OAAO,IAAIQ,cAAA,CAAMI,gBAA7C;MAAtB,EADF;MAGAP,eAAe,GAAGH,SAAS,CAAC,4CAAD,EAA+C;QACxEI,eAAe,EAAEL;MADuD,CAA/C,CAA3B;MAGA;;IAEF;MACE,OAAO,IAAP;EA/BJ;;EAkCA,oBACE;IACE,SAAS,EAAEO,cAAA,CAAMP,KADnB;IAEE,cAAYC,SAAS,CAAC,oCAAD,EAAuC;MAC1DI,eAAe,EAAEL;IADyC,CAAvC,CAFvB;IAKE,oBAAkBI;EALpB,GAOGD,KAPH,CADF;AAWD,CAlDD;;AAoDA,MAAMS,oBAAoB,GAAIhB,KAAD,IAAgC;EAC3D,MAAM;IAACE,IAAD;IAAOC;EAAP,IAAkBH,KAAxB;EACA,oBACE;IACE,SAAS,EAAE,IAAAU,mBAAA,EACTC,cAAA,CAAMM,OADG,EAETf,IAAI,KAAK,OAAT,IAAoBS,cAAA,CAAMO,KAFjB,EAGThB,IAAI,KAAK,OAAT,IAAoBS,cAAA,CAAMQ,KAHjB,EAIThB,OAAO,IAAIQ,cAAA,CAAMR,OAJR,CADb;IAOE,aAAU;EAPZ,gBASE,6BAAC,OAAD,EAAaH,KAAb,CATF,CADF;AAaD,CAfD;;AAiBAD,OAAO,CAACqB,SAAR,2CAAoBA,cAApB;AAEArB,OAAO,CAACsB,YAAR,GAAuB;EACrBC,IAAI,EAAEC,iBAAA,CAASC,iBAAT,CAA2BF,IADZ;EAErBjB,SAAS,EAAEkB,iBAAA,CAASC,iBAAT,CAA2BnB;AAFjB,CAAvB;AAKAW,oBAAoB,CAACI,SAArB,2CAAiCA,cAAjC;eAEeJ,oB"}
@@ -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 default ToolTip;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,SAAS,GAAG;EAChB,IAAIC,cAAA,CAAMC,wBADM;EAEhB,IAAID,cAAA,CAAME;AAFM,CAAlB;;AAKA,MAAMC,cAAc,GAAG,CAAC;EACtBC,gBADsB;EAEtBC,QAFsB;EAGtBC,oCAHsB;EAItBC,OAJsB;EAKtBC;AALsB,CAAD,KAMjB;EACJ,IAAI,CAACJ,gBAAL,EAAuB,OAAO,IAAP;;EACvB,IAAIC,QAAJ,EAAc;IACZ,oBACE,6BAAC,qBAAD;MACE,EAAE,EAAEA,QADN;MAEE,SAAS,EAAEL,cAAA,CAAMS,YAFnB;MAGE,kBAAe,OAHjB;MAIE,KAAK,EAAC,MAJR;MAKE,MAAM,EAAC,OALT;MAME,cAAYH;IANd,GAQGC,OARH,CADF;EAYD,CAbD,MAaO;IACL,oBACE;MACE,SAAS,EAAEP,cAAA,CAAMU,OADnB;MAEE,eAAY,SAFd;MAGE,cAAYJ,oCAHd;MAIE,WAAW,EAAEE;IAJf,GAMGD,OANH,CADF;EAUD;AACF,CAjCD;;AAmCAJ,cAAc,CAACQ,SAAf,2CAA2B;EACzBP,gBAAgB,EAAEQ,kBAAA,CAAUC,IADH;EAEzBR,QAAQ,EAAEO,kBAAA,CAAUE,MAFK;EAGzBR,oCAAoC,EAAEM,kBAAA,CAAUE,MAAV,CAAiBC,UAH9B;EAIzBR,OAAO,EAAEK,kBAAA,CAAUI,IAJM;EAKzBR,sBAAsB,EAAEI,kBAAA,CAAUK;AALT,CAA3B;;AAQO,MAAMC,qBAAqB,GAAG,CAACC,KAAD,EAAQC,QAAR,EAAkBC,GAAlB,KAA0BC,KAAK,IAAI;EACtE,IAAIA,KAAK,CAACC,GAAN,KAA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C,cAAA,CAAMuD,eADnB;IAEE,KAAK,EAAE,EAFT;IAGE,MAAM,EAAE,EAHV;IAIE,cAAYzB;EAJd,EAPF,CALF,eAmBE,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,CAAC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BADpB;IAEE,QAAQ,EAAEC,QAFZ;IAGE,oCAAoC,EAAEC,oCAHxC;IAIE,OAAO,EAAEC,OAJX;IAKE,sBAAsB,EAAEC,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":""}
@@ -2,6 +2,9 @@ export default Answer;
2
2
  declare function Answer(props: any): JSX.Element;
3
3
  declare namespace Answer {
4
4
  export { propTypes };
5
+ export namespace contextTypes {
6
+ const translate: import("prop-types").Requireable<(...args: any[]) => any>;
7
+ }
5
8
  }
6
9
  import propTypes from "./prop-types";
7
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AAwEA,iDAWC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AA4EA,iDAWC"}
@@ -25,7 +25,7 @@ var _template = _interopRequireDefault(require("../questions/template"));
25
25
 
26
26
  var _audio = _interopRequireDefault(require("../audio"));
27
27
 
28
- var _provider = require("../../atom/provider");
28
+ var _provider = _interopRequireWildcard(require("../../atom/provider"));
29
29
 
30
30
  var _style = _interopRequireDefault(require("./style.css"));
31
31
 
@@ -88,11 +88,11 @@ MediaView.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.MediaVi
88
88
  const Switch = ({
89
89
  model,
90
90
  help
91
- }) => {
91
+ }, legacyContext) => {
92
92
  const {
93
93
  type
94
94
  } = model;
95
- const translate = (0, _provider.GetTranslateFromContext)();
95
+ const translate = (0, _provider.GetTranslateFromContext)(legacyContext);
96
96
 
97
97
  switch (type) {
98
98
  case 'qcmDrag':
@@ -135,6 +135,9 @@ Switch.propTypes = process.env.NODE_ENV !== "production" ? {
135
135
  model: _propTypes.default.model,
136
136
  help: _propTypes.default.help
137
137
  } : {};
138
+ Switch.contextTypes = {
139
+ translate: _provider.default.childContextTypes.translate
140
+ };
138
141
 
139
142
  const Answer = props => {
140
143
  const {
@@ -154,6 +157,9 @@ const Answer = props => {
154
157
  };
155
158
 
156
159
  Answer.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
160
+ Answer.contextTypes = {
161
+ translate: _provider.default.childContextTypes.translate
162
+ };
157
163
  var _default = Answer;
158
164
  exports.default = _default;
159
165
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","translate","GetTranslateFromContext","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport {GetTranslateFromContext} from '../../atom/provider';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}) => {\n const {type} = model;\n const translate = GetTranslateFromContext();\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcm':\n return <Qcm {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'slider':\n return <QuestionRange {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'template':\n return <Template {...model} groupAriaLabel={translate('answer_the_question')} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <form>\n <Switch model={model} help={help} />\n </form>\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,MAAMA,SAAS,GAAG,CAAC;EAACC;AAAD,CAAD,KAAa;EAC7B,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAiCF,KAAvC;EAAA,MAAyBG,UAAzB,iCAAuCH,KAAvC;;EACA,QAAQE,IAAR;IACE,KAAKE,qBAAL;MACE,oBACE;QACE,SAAS,EAAEC,cAAA,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,iBAAD,eAAcA,KAAd;QAAqB,cAAc,EAAEE,SAAS,CAAC,qBAAD;MAA9C,GAAP;;IACF,KAAK,QAAL;MACE,oBAAO,6BAAC,sBAAD,eAAmBF,KAAnB;QAA0B,cAAc,EAAEE,SAAS,CAAC,qBAAD;MAAnD,GAAP;;IACF,KAAK,UAAL;MACE,oBAAO,6BAAC,iBAAD,eAAcF,KAAd;QAAqB,cAAc,EAAEE,SAAS,CAAC,qBAAD;MAA9C,GAAP;EAdJ;AAgBD,CAnBD;;AAqBAH,MAAM,CAACF,SAAP,2CAAmB;EACjBG,KAAK,EAAEH,kBAAA,CAAUG,KADA;EAEjBC,IAAI,EAAEJ,kBAAA,CAAUI;AAFC,CAAnB;;AAKA,MAAMG,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IAACL,KAAD;IAAQf,KAAR;IAAegB;EAAf,IAAuBI,KAA7B;EAEA,oBACE;IAAK,aAAU,QAAf;IAAwB,SAAS,EAAEf,cAAA,CAAMgB;EAAzC,GACGrB,KAAK,gBAAG,6BAAC,SAAD;IAAW,KAAK,EAAEA;EAAlB,EAAH,GAAiC,IADzC,eAEE,wDACE,6BAAC,MAAD;IAAQ,KAAK,EAAEe,KAAf;IAAsB,IAAI,EAAEC;EAA5B,EADF,CAFF,CADF;AAQD,CAXD;;AAaAG,MAAM,CAACP,SAAP,2CAAmBA,kBAAnB;eAEeO,M"}
1
+ {"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","legacyContext","translate","GetTranslateFromContext","contextTypes","Provider","childContextTypes","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}, legacyContext) => {\n const {type} = model;\n const translate = GetTranslateFromContext(legacyContext);\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcm':\n return <Qcm {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'slider':\n return <QuestionRange {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'template':\n return <Template {...model} groupAriaLabel={translate('answer_the_question')} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nSwitch.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <form>\n <Switch model={model} help={help} />\n </form>\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nAnswer.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default Answer;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,MAAMA,SAAS,GAAG,CAAC;EAACC;AAAD,CAAD,KAAa;EAC7B,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAiCF,KAAvC;EAAA,MAAyBG,UAAzB,iCAAuCH,KAAvC;;EACA,QAAQE,IAAR;IACE,KAAKE,qBAAL;MACE,oBACE;QACE,SAAS,EAAEC,cAAA,CAAML,KADnB;QAEE,KAAK,EAAE;UACLM,eAAe,EAAG,OAAMN,KAAK,CAACO,GAAI;QAD7B;MAFT,EADF;;IAQF,KAAKC,qBAAL;MACE,oBACE;QAAK,SAAS,EAAEH,cAAA,CAAMI;MAAtB,gBACE,6BAAC,oBAAD,eAAiB,oBAAK,IAAL,EAAWN,UAAX,CAAjB;QAAyC,EAAE,EAAEF,OAA7C;QAAsD,MAAM,EAAC,MAA7D;QAAoE,KAAK,EAAC;MAA1E,GADF,CADF;;IAKF,KAAKS,qBAAL;MACE,oBACE;QAAK,SAAS,EAAEL,cAAA,CAAMM;MAAtB,gBACE,6BAAC,cAAD,eAAW,oBAAK,IAAL,EAAWR,UAAX,CAAX;QAAmC,MAAM,EAAC,MAA1C;QAAiD,KAAK,EAAC;MAAvD,GADF,CADF;;IAKF;MACE,OAAO,IAAP;EAvBJ;AAyBD,CA3BD;;AA6BAJ,SAAS,CAACa,SAAV,2CAAsBC,6BAAtB;;AAEA,MAAMC,MAAM,GAAG,CAAC;EAACC,KAAD;EAAQC;AAAR,CAAD,EAAgBC,aAAhB,KAAkC;EAC/C,MAAM;IAACf;EAAD,IAASa,KAAf;EACA,MAAMG,SAAS,GAAG,IAAAC,iCAAA,EAAwBF,aAAxB,CAAlB;;EACA,QAA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KAAK,EAAEA;EAAlB,EAAH,GAAiC,IADzC,eAEE,wDACE,6BAAC,MAAD;IAAQ,KAAK,EAAEe,KAAf;IAAsB,IAAI,EAAEC;EAA5B,EADF,CAFF,CADF;AAQD,CAXD;;AAaAO,MAAM,CAACX,SAAP,2CAAmBA,kBAAnB;AAEAW,MAAM,CAACH,YAAP,GAAsB;EACpBF,SAAS,EAAEG,iBAAA,CAASC,iBAAT,CAA2BJ;AADlB,CAAtB;eAIeK,M"}
@@ -2,6 +2,29 @@ export default ReviewHeader;
2
2
  declare function ReviewHeader(props: any, context: any): JSX.Element;
3
3
  declare namespace ReviewHeader {
4
4
  export { propTypes };
5
+ export namespace contextTypes {
6
+ const skin: import("prop-types").Requireable<import("prop-types").InferProps<{
7
+ common: import("prop-types").Requireable<{
8
+ [x: string]: any;
9
+ }>;
10
+ images: import("prop-types").Requireable<import("prop-types").InferProps<{
11
+ 'logo-mobile': import("prop-types").Requireable<any>;
12
+ logo: import("prop-types").Requireable<any>;
13
+ 'logo-email': import("prop-types").Requireable<any>;
14
+ login: import("prop-types").Requireable<any>;
15
+ }>>;
16
+ icons: import("prop-types").Requireable<{
17
+ [x: string]: any;
18
+ }>;
19
+ mod: import("prop-types").Requireable<{
20
+ [x: string]: any;
21
+ }>;
22
+ courses: import("prop-types").Requireable<any[]>;
23
+ texts: import("prop-types").Requireable<{
24
+ [x: string]: any;
25
+ }>;
26
+ }>>;
27
+ }
5
28
  }
6
29
  import propTypes from "./types";
7
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/review-header/index.js"],"names":[],"mappings":";AAQA,qEAuDC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/review-header/index.js"],"names":[],"mappings":";AASA,qEAuDC"}
@@ -9,6 +9,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
9
9
 
10
10
  var _getOr = _interopRequireDefault(require("lodash/fp/getOr"));
11
11
 
12
+ var _provider = _interopRequireDefault(require("../../atom/provider"));
13
+
12
14
  var _buttonLinkIconOnly = _interopRequireDefault(require("../../atom/button-link-icon-only"));
13
15
 
14
16
  var _reviewHeaderSteps = _interopRequireDefault(require("../../molecule/review-header-steps"));
@@ -73,6 +75,9 @@ const ReviewHeader = (props, context) => {
73
75
  };
74
76
 
75
77
  ReviewHeader.propTypes = process.env.NODE_ENV !== "production" ? _types.default : {};
78
+ ReviewHeader.contextTypes = {
79
+ skin: _provider.default.childContextTypes.skin
80
+ };
76
81
  var _default = ReviewHeader;
77
82
  exports.default = _default;
78
83
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReviewHeader","props","context","steps","mode","skillName","ariaLabel","closeButtonAriaLabel","onQuitClick","hiddenSteps","skin","primarySkinColor","getOr","buttonProps","icon","onClick","size","className","style","review","stepsWrapper","classnames","stepsWrapperAnimation","headerWrapper","titlesWrapper","title","color","iconButtonWrapper","propTypes"],"sources":["../../../src/organism/review-header/index.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport getOr from 'lodash/fp/getOr';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport ReviewHeaderSteps from '../../molecule/review-header-steps';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst ReviewHeader = (props, context) => {\n const {\n steps,\n mode,\n skillName,\n 'aria-label': ariaLabel,\n closeButtonAriaLabel,\n onQuitClick,\n hiddenSteps\n } = props;\n const {skin} = context;\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const buttonProps = {\n icon: 'close',\n 'data-name': 'review-header-close-button',\n 'aria-label': closeButtonAriaLabel,\n onClick: onQuitClick,\n size: 'responsive',\n className: style.review\n };\n\n const stepsWrapper = classnames(\n style.stepsWrapper,\n hiddenSteps ? style.stepsWrapperAnimation : null\n );\n\n return (\n <div className={style.headerWrapper} data-name=\"review-header\" aria-label={ariaLabel}>\n <div className={style.titlesWrapper}>\n <div className={style.title} title={mode} aria-label={mode} data-name=\"review-header-mode\">\n {mode}\n </div>\n <div\n className={style.skillName}\n style={{\n color: primarySkinColor\n }}\n title={skillName}\n aria-label={skillName}\n data-name=\"review-header-skill-name\"\n >\n {skillName}\n </div>\n </div>\n\n <div className={stepsWrapper}>\n <ReviewHeaderSteps steps={steps} key={'review-header-steps'} />\n </div>\n\n <div className={style.iconButtonWrapper} data-testid=\"review-header-close-button-wrapper\">\n <ButtonLinkIconOnly {...buttonProps} />\n </div>\n </div>\n );\n};\n\nReviewHeader.propTypes = propTypes;\n\nexport default ReviewHeader;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IACJC,KADI;IAEJC,IAFI;IAGJC,SAHI;IAIJ,cAAcC,SAJV;IAKJC,oBALI;IAMJC,WANI;IAOJC;EAPI,IAQFR,KARJ;EASA,MAAM;IAACS;EAAD,IAASR,OAAf;EACA,MAAMS,gBAAgB,GAAG,IAAAC,cAAA,EAAM,SAAN,EAAiB,gBAAjB,EAAmCF,IAAnC,CAAzB;EAEA,MAAMG,WAAW,GAAG;IAClBC,IAAI,EAAE,OADY;IAElB,aAAa,4BAFK;IAGlB,cAAcP,oBAHI;IAIlBQ,OAAO,EAAEP,WAJS;IAKlBQ,IAAI,EAAE,YALY;IAMlBC,SAAS,EAAEC,cAAA,CAAMC;EANC,CAApB;EASA,MAAMC,YAAY,GAAG,IAAAC,mBAAA,EACnBH,cAAA,CAAME,YADa,EAEnBX,WAAW,GAAGS,cAAA,CAAMI,qBAAT,GAAiC,IAFzB,CAArB;EAKA,oBACE;IAAK,SAAS,EAAEJ,cAAA,CAAMK,aAAtB;IAAqC,aAAU,eAA/C;IAA+D,cAAYjB;EAA3E,gBACE;IAAK,SAAS,EAAEY,cAAA,CAAMM;EAAtB,gBACE;IAAK,SAAS,EAAEN,cAAA,CAAMO,KAAtB;IAA6B,KAAK,EAAErB,IAApC;IAA0C,cAAYA,IAAtD;IAA4D,aAAU;EAAtE,GACGA,IADH,CADF,eAIE;IACE,SAAS,EAAEc,cAAA,CAAMb,SADnB;IAEE,KAAK,EAAE;MACLqB,KAAK,EAAEf;IADF,CAFT;IAKE,KAAK,EAAEN,SALT;IAME,cAAYA,SANd;IAOE,aAAU;EAPZ,GASGA,SATH,CAJF,CADF,eAkBE;IAAK,SAAS,EAAEe;EAAhB,gBACE,6BAAC,0BAAD;IAAmB,KAAK,EAAEjB,KAA1B;IAAiC,GAAG,EAAE;EAAtC,EADF,CAlBF,eAsBE;IAAK,SAAS,EAAEe,cAAA,CAAMS,iBAAtB;IAAyC,eAAY;EAArD,gBACE,6BAAC,2BAAD,EAAwBd,WAAxB,CADF,CAtBF,CADF;AA4BD,CAvDD;;AAyDAb,YAAY,CAAC4B,SAAb,2CAAyBA,cAAzB;eAEe5B,Y"}
1
+ {"version":3,"file":"index.js","names":["ReviewHeader","props","context","steps","mode","skillName","ariaLabel","closeButtonAriaLabel","onQuitClick","hiddenSteps","skin","primarySkinColor","getOr","buttonProps","icon","onClick","size","className","style","review","stepsWrapper","classnames","stepsWrapperAnimation","headerWrapper","titlesWrapper","title","color","iconButtonWrapper","propTypes","contextTypes","Provider","childContextTypes"],"sources":["../../../src/organism/review-header/index.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport getOr from 'lodash/fp/getOr';\nimport Provider from '../../atom/provider';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport ReviewHeaderSteps from '../../molecule/review-header-steps';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst ReviewHeader = (props, context) => {\n const {\n steps,\n mode,\n skillName,\n 'aria-label': ariaLabel,\n closeButtonAriaLabel,\n onQuitClick,\n hiddenSteps\n } = props;\n const {skin} = context;\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const buttonProps = {\n icon: 'close',\n 'data-name': 'review-header-close-button',\n 'aria-label': closeButtonAriaLabel,\n onClick: onQuitClick,\n size: 'responsive',\n className: style.review\n };\n\n const stepsWrapper = classnames(\n style.stepsWrapper,\n hiddenSteps ? style.stepsWrapperAnimation : null\n );\n\n return (\n <div className={style.headerWrapper} data-name=\"review-header\" aria-label={ariaLabel}>\n <div className={style.titlesWrapper}>\n <div className={style.title} title={mode} aria-label={mode} data-name=\"review-header-mode\">\n {mode}\n </div>\n <div\n className={style.skillName}\n style={{\n color: primarySkinColor\n }}\n title={skillName}\n aria-label={skillName}\n data-name=\"review-header-skill-name\"\n >\n {skillName}\n </div>\n </div>\n\n <div className={stepsWrapper}>\n <ReviewHeaderSteps steps={steps} key={'review-header-steps'} />\n </div>\n\n <div className={style.iconButtonWrapper} data-testid=\"review-header-close-button-wrapper\">\n <ButtonLinkIconOnly {...buttonProps} />\n </div>\n </div>\n );\n};\n\nReviewHeader.propTypes = propTypes;\n\nReviewHeader.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default ReviewHeader;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IACJC,KADI;IAEJC,IAFI;IAGJC,SAHI;IAIJ,cAAcC,SAJV;IAKJC,oBALI;IAMJC,WANI;IAOJC;EAPI,IAQFR,KARJ;EASA,MAAM;IAACS;EAAD,IAASR,OAAf;EACA,MAAMS,gBAAgB,GAAG,IAAAC,cAAA,EAAM,SAAN,EAAiB,gBAAjB,EAAmCF,IAAnC,CAAzB;EAEA,MAAMG,WAAW,GAAG;IAClBC,IAAI,EAAE,OADY;IAElB,aAAa,4BAFK;IAGlB,cAAcP,oBAHI;IAIlBQ,OAAO,EAAEP,WAJS;IAKlBQ,IAAI,EAAE,YALY;IAMlBC,SAAS,EAAEC,cAAA,CAAMC;EANC,CAApB;EASA,MAAMC,YAAY,GAAG,IAAAC,mBAAA,EACnBH,cAAA,CAAME,YADa,EAEnBX,WAAW,GAAGS,cAAA,CAAMI,qBAAT,GAAiC,IAFzB,CAArB;EAKA,oBACE;IAAK,SAAS,EAAEJ,cAAA,CAAMK,aAAtB;IAAqC,aAAU,eAA/C;IAA+D,cAAYjB;EAA3E,gBACE;IAAK,SAAS,EAAEY,cAAA,CAAMM;EAAtB,gBACE;IAAK,SAAS,EAAEN,cAAA,CAAMO,KAAtB;IAA6B,KAAK,EAAErB,IAApC;IAA0C,cAAYA,IAAtD;IAA4D,aAAU;EAAtE,GACGA,IADH,CADF,eAIE;IACE,SAAS,EAAEc,cAAA,CAAMb,SADnB;IAEE,KAAK,EAAE;MACLqB,KAAK,EAAEf;IADF,CAFT;IAKE,KAAK,EAAEN,SALT;IAME,cAAYA,SANd;IAOE,aAAU;EAPZ,GASGA,SATH,CAJF,CADF,eAkBE;IAAK,SAAS,EAAEe;EAAhB,gBACE,6BAAC,0BAAD;IAAmB,KAAK,EAAEjB,KAA1B;IAAiC,GAAG,EAAE;EAAtC,EADF,CAlBF,eAsBE;IAAK,SAAS,EAAEe,cAAA,CAAMS,iBAAtB;IAAyC,eAAY;EAArD,gBACE,6BAAC,2BAAD,EAAwBd,WAAxB,CADF,CAtBF,CADF;AA4BD,CAvDD;;AAyDAb,YAAY,CAAC4B,SAAb,2CAAyBA,cAAzB;AAEA5B,YAAY,CAAC6B,YAAb,GAA4B;EAC1BnB,IAAI,EAAEoB,iBAAA,CAASC,iBAAT,CAA2BrB;AADP,CAA5B;eAIeV,Y"}
@@ -38,6 +38,7 @@ declare namespace EngineStars {
38
38
  [x: string]: any;
39
39
  }>;
40
40
  }>>;
41
+ const translate: PropTypes.Requireable<(...args: any[]) => any>;
41
42
  }
42
43
  }
43
44
  import PropTypes from "prop-types";
@@ -188,7 +188,8 @@ EngineStars.propTypes = process.env.NODE_ENV !== "production" ? {
188
188
  })
189
189
  } : {};
190
190
  EngineStars.contextTypes = {
191
- skin: _provider.default.childContextTypes.skin
191
+ skin: _provider.default.childContextTypes.skin,
192
+ translate: _provider.default.childContextTypes.translate
192
193
  };
193
194
  var _default = EngineStars;
194
195
  exports.default = _default;