@coorpacademy/components 11.9.1 → 11.9.2-alpha.1

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 (51) hide show
  1. package/es/atom/review-presentation/index.d.ts.map +1 -1
  2. package/es/atom/review-presentation/index.js +12 -62
  3. package/es/atom/review-presentation/index.js.map +1 -1
  4. package/es/atom/review-presentation/style.css +7 -67
  5. package/es/atom/tooltip/index.d.ts +22 -0
  6. package/es/atom/tooltip/index.d.ts.map +1 -0
  7. package/es/atom/tooltip/index.js +117 -0
  8. package/es/atom/tooltip/index.js.map +1 -0
  9. package/es/atom/tooltip/style.css +96 -0
  10. package/es/template/activity/engine-stars.css +16 -33
  11. package/es/template/activity/engine-stars.d.ts +15 -17
  12. package/es/template/activity/engine-stars.d.ts.map +1 -1
  13. package/es/template/activity/engine-stars.js +128 -115
  14. package/es/template/activity/engine-stars.js.map +1 -1
  15. package/es/template/activity/index.d.ts +1 -0
  16. package/es/template/activity/index.d.ts.map +1 -1
  17. package/es/template/activity/index.js +18 -9
  18. package/es/template/activity/index.js.map +1 -1
  19. package/es/template/activity/progression-item.js +1 -1
  20. package/es/template/activity/progression-item.js.map +1 -1
  21. package/es/template/activity/stars-summary.d.ts +1 -0
  22. package/es/template/activity/stars-summary.d.ts.map +1 -1
  23. package/es/template/activity/stars-summary.js +10 -5
  24. package/es/template/activity/stars-summary.js.map +1 -1
  25. package/lib/atom/review-presentation/index.d.ts.map +1 -1
  26. package/lib/atom/review-presentation/index.js +13 -66
  27. package/lib/atom/review-presentation/index.js.map +1 -1
  28. package/lib/atom/review-presentation/style.css +7 -67
  29. package/lib/atom/tooltip/index.d.ts +22 -0
  30. package/lib/atom/tooltip/index.d.ts.map +1 -0
  31. package/lib/atom/tooltip/index.js +137 -0
  32. package/lib/atom/tooltip/index.js.map +1 -0
  33. package/lib/atom/tooltip/style.css +96 -0
  34. package/lib/template/activity/engine-stars.css +16 -33
  35. package/lib/template/activity/engine-stars.d.ts +15 -17
  36. package/lib/template/activity/engine-stars.d.ts.map +1 -1
  37. package/lib/template/activity/engine-stars.js +135 -116
  38. package/lib/template/activity/engine-stars.js.map +1 -1
  39. package/lib/template/activity/index.d.ts +1 -0
  40. package/lib/template/activity/index.d.ts.map +1 -1
  41. package/lib/template/activity/index.js +21 -9
  42. package/lib/template/activity/index.js.map +1 -1
  43. package/lib/template/activity/progression-item.js +1 -1
  44. package/lib/template/activity/progression-item.js.map +1 -1
  45. package/lib/template/activity/stars-summary.d.ts +1 -0
  46. package/lib/template/activity/stars-summary.d.ts.map +1 -1
  47. package/lib/template/activity/stars-summary.js +10 -5
  48. package/lib/template/activity/stars-summary.js.map +1 -1
  49. package/locales/en/global.json +1 -0
  50. package/package.json +4 -3
  51. package/locales/.mtslconfig.json +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/index.js"],"names":[],"mappings":";AAyGA,6DA+BC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/index.js"],"names":[],"mappings":";AA+CA,6DA+BC"}
@@ -1,10 +1,9 @@
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, { useState, useCallback } from 'react';
1
+ import React from 'react';
4
2
  import PropTypes from 'prop-types';
5
3
  import getOr from 'lodash/fp/getOr';
6
4
  import map from 'lodash/fp/map';
7
- import { NovaSolidStatusCheckCircle2 as CheckIcon, NovaSolidVoteRewardsVoteHeart as HeartIcon, NovaCompositionCoorpacademyInformationIcon as InformationIcon, NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon, NovaLineSelectionCursorsCursorArrowTarget as TargetIcon } from '@coorpacademy/nova-icons';
5
+ import { NovaSolidStatusCheckCircle2 as CheckIcon, NovaSolidVoteRewardsVoteHeart as HeartIcon, NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon, NovaLineSelectionCursorsCursorArrowTarget as TargetIcon } from '@coorpacademy/nova-icons';
6
+ import ToolTip from '../tooltip';
8
7
  import style from './style.css';
9
8
  import propTypes from './prop-types';
10
9
  const ICONS = {
@@ -31,50 +30,6 @@ const ReviewIcon = ({
31
30
  });
32
31
  };
33
32
 
34
- const ToolTip = ({
35
- tooltipText,
36
- 'aria-label': moreDetailsAriaLabel,
37
- 'data-testid': dataTestId,
38
- closeToolTipInformationTextAriaLabel
39
- }) => {
40
- const [toolTipIsVisible, setToolTipIsVisible] = useState(false);
41
- const handleKeyPress = useCallback(event => {
42
- if (event.key === 'Enter') {
43
- setToolTipIsVisible(!toolTipIsVisible);
44
- } else if (event.key === 'Tab' || event.key === 'Escape') {
45
- setToolTipIsVisible(false);
46
- }
47
- }, [setToolTipIsVisible, toolTipIsVisible]);
48
- const handleMouseOver = useCallback(() => {
49
- setToolTipIsVisible(true);
50
- }, [setToolTipIsVisible]);
51
- const handleMouseLeave = useCallback(() => {
52
- setToolTipIsVisible(false);
53
- }, [setToolTipIsVisible]);
54
- return /*#__PURE__*/React.createElement("div", {
55
- className: style.tooltipContainer,
56
- onMouseLeave: handleMouseLeave,
57
- onMouseOver: handleMouseOver
58
- }, /*#__PURE__*/React.createElement("button", {
59
- type: "button",
60
- className: style.tooltipIconContainer,
61
- "data-testid": dataTestId,
62
- onKeyDown: handleKeyPress,
63
- tabIndex: 0
64
- }, /*#__PURE__*/React.createElement(InformationIcon, {
65
- className: style.informationIcon,
66
- width: 12,
67
- height: 12,
68
- "aria-label": moreDetailsAriaLabel
69
- })), toolTipIsVisible ? /*#__PURE__*/React.createElement("div", {
70
- className: style.toolTip,
71
- "data-testid": "review-presentation-tooltip",
72
- "aria-label": closeToolTipInformationTextAriaLabel
73
- }, /*#__PURE__*/React.createElement("p", {
74
- className: style.tooltipText
75
- }, tooltipText)) : null);
76
- };
77
-
78
33
  const ReviewListItemWrapper = ({
79
34
  iconKey,
80
35
  label
@@ -89,10 +44,10 @@ const ReviewListItemWrapper = ({
89
44
  }, /*#__PURE__*/React.createElement(ReviewIcon, {
90
45
  icon: iconKey
91
46
  }), " ", label.text), /*#__PURE__*/React.createElement(ToolTip, {
92
- tooltipText: label.tooltipText,
93
- "aria-label": label.moreDetailsAriaLabel,
47
+ TooltipContent: label.tooltipText,
94
48
  closeToolTipInformationTextAriaLabel: label.closeToolTipInformationTextAriaLabel,
95
- "data-testid": `review-list-item-tooltip-button-${iconKey}`
49
+ "data-testid": `review-list-item-tooltip-button-${iconKey}`,
50
+ "aria-label": label.moreDetailsAriaLabel
96
51
  }));
97
52
  };
98
53
 
@@ -135,23 +90,18 @@ const ReviewPresentation = props => {
135
90
  }, labelsList)));
136
91
  };
137
92
 
138
- ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
139
- tooltipText: PropTypes.string,
140
- 'aria-label': PropTypes.string,
141
- 'data-testid': PropTypes.string,
142
- closeToolTipInformationTextAriaLabel: PropTypes.string
143
- } : {};
144
93
  ReviewIcon.propTypes = process.env.NODE_ENV !== "production" ? {
145
94
  icon: PropTypes.string
146
95
  } : {};
147
- ReviewListItemWrapper.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, ToolTip.propTypes, {
96
+ ReviewListItemWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
148
97
  iconKey: PropTypes.string,
149
98
  label: PropTypes.shape({
150
- tooltipText: PropTypes.string,
151
- moreDetailsAriaLabel: PropTypes.string,
152
- closeToolTipInformationTextAriaLabel: PropTypes.string
99
+ tooltipText: ToolTip.propTypes.tooltipText,
100
+ moreDetailsAriaLabel: ToolTip.propTypes['aria-label'],
101
+ closeToolTipInformationTextAriaLabel: ToolTip.propTypes.closeToolTipInformationTextAriaLabel,
102
+ text: PropTypes.string
153
103
  })
154
- }) : {};
104
+ } : {};
155
105
  ReviewPresentation.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
156
106
  export default ReviewPresentation;
157
107
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useState","useCallback","PropTypes","getOr","map","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidVoteRewardsVoteHeart","HeartIcon","NovaCompositionCoorpacademyInformationIcon","InformationIcon","NovaSolidInterfaceFeedbackInterfaceQuestionMark","QuestionIcon","NovaLineSelectionCursorsCursorArrowTarget","TargetIcon","style","propTypes","ICONS","skills","questions","lifes","allright","ReviewIcon","icon","Icon","labelIcon","ToolTip","tooltipText","moreDetailsAriaLabel","dataTestId","closeToolTipInformationTextAriaLabel","toolTipIsVisible","setToolTipIsVisible","handleKeyPress","event","key","handleMouseOver","handleMouseLeave","tooltipContainer","tooltipIconContainer","informationIcon","toolTip","ReviewListItemWrapper","iconKey","label","reviewListItemWrapper","reviewListText","text","ReviewPresentation","props","ariaLabel","reviewTitle","reviewText","labelsList","reviewWrapper","__html","reviewListWrapper","convert","cap","reviewList","string","shape"],"sources":["../../../src/atom/review-presentation/index.js"],"sourcesContent":["import React, {useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport getOr from 'lodash/fp/getOr';\nimport map from 'lodash/fp/map';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidVoteRewardsVoteHeart as HeartIcon,\n NovaCompositionCoorpacademyInformationIcon as InformationIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon,\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon\n} from '@coorpacademy/nova-icons';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst ICONS = {\n skills: TargetIcon,\n questions: QuestionIcon,\n lifes: HeartIcon,\n allright: CheckIcon\n};\n\nconst ReviewIcon = ({icon}) => {\n const Icon = getOr(null, icon, ICONS);\n\n /* istanbul ignore next */\n if (!Icon) {\n return <div className={style.labelIcon} />;\n }\n return <Icon className={style.labelIcon} />;\n};\n\nconst ToolTip = ({\n tooltipText,\n 'aria-label': moreDetailsAriaLabel,\n 'data-testid': dataTestId,\n closeToolTipInformationTextAriaLabel\n}) => {\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n const handleKeyPress = useCallback(\n event => {\n if (event.key === 'Enter') {\n setToolTipIsVisible(!toolTipIsVisible);\n } else if (event.key === 'Tab' || event.key === 'Escape') {\n setToolTipIsVisible(false);\n }\n },\n [setToolTipIsVisible, toolTipIsVisible]\n );\n const handleMouseOver = useCallback(() => {\n setToolTipIsVisible(true);\n }, [setToolTipIsVisible]);\n\n const handleMouseLeave = useCallback(() => {\n setToolTipIsVisible(false);\n }, [setToolTipIsVisible]);\n\n return (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={style.tooltipIconContainer}\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={moreDetailsAriaLabel}\n />\n </button>\n {toolTipIsVisible ? (\n <div\n className={style.toolTip}\n data-testid=\"review-presentation-tooltip\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n <p className={style.tooltipText}>{tooltipText}</p>\n </div>\n ) : null}\n </div>\n );\n};\n\nconst ReviewListItemWrapper = ({iconKey, label}) => {\n return (\n <div className={style.reviewListItemWrapper} data-tip data-for=\"reviewListItem\" tabIndex={0}>\n <div className={style.reviewListText}>\n <ReviewIcon icon={iconKey} /> {label.text}\n </div>\n <ToolTip\n tooltipText={label.tooltipText}\n aria-label={label.moreDetailsAriaLabel}\n closeToolTipInformationTextAriaLabel={label.closeToolTipInformationTextAriaLabel}\n data-testid={`review-list-item-tooltip-button-${iconKey}`}\n />\n </div>\n );\n};\n\nconst ReviewPresentation = props => {\n const {'aria-label': ariaLabel, reviewTitle, reviewText, labelsList} = props;\n\n return (\n <div className={style.reviewWrapper} aria-label={ariaLabel}>\n <div\n className={style.reviewTitle}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: reviewTitle}}\n />\n <div\n className={style.reviewText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: reviewText}}\n />\n <ul className={style.reviewListWrapper}>\n {map.convert({cap: false})((label, key) => {\n return (\n <li key={`step-${key}`} className={style.reviewList}>\n <ReviewListItemWrapper\n iconKey={key}\n label={label}\n tooltipText={label.tooltipText}\n aria-label={label.moreDetailsAriaLabel}\n />\n </li>\n );\n }, labelsList)}\n </ul>\n </div>\n );\n};\n\nToolTip.propTypes = {\n tooltipText: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-testid': PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string\n};\n\nReviewIcon.propTypes = {\n icon: PropTypes.string\n};\n\nReviewListItemWrapper.propTypes = {\n ...ToolTip.propTypes,\n iconKey: PropTypes.string,\n label: PropTypes.shape({\n tooltipText: PropTypes.string,\n moreDetailsAriaLabel: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string\n })\n};\n\nReviewPresentation.propTypes = propTypes;\n\nexport default ReviewPresentation;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,WAAzB,QAA2C,OAA3C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,SACEC,2BAA2B,IAAIC,SADjC,EAEEC,6BAA6B,IAAIC,SAFnC,EAGEC,0CAA0C,IAAIC,eAHhD,EAIEC,+CAA+C,IAAIC,YAJrD,EAKEC,yCAAyC,IAAIC,UAL/C,QAMO,0BANP;AAOA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,cAAtB;AAEA,MAAMC,KAAK,GAAG;EACZC,MAAM,EAAEJ,UADI;EAEZK,SAAS,EAAEP,YAFC;EAGZQ,KAAK,EAAEZ,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,SAAS,CAAC0D;EAH3B,CAAhB;AAHT;AAUAZ,kBAAkB,CAAChC,SAAnB,2CAA+BA,SAA/B;AAEA,eAAegC,kBAAf"}
1
+ {"version":3,"file":"index.js","names":["React","PropTypes","getOr","map","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidVoteRewardsVoteHeart","HeartIcon","NovaSolidInterfaceFeedbackInterfaceQuestionMark","QuestionIcon","NovaLineSelectionCursorsCursorArrowTarget","TargetIcon","ToolTip","style","propTypes","ICONS","skills","questions","lifes","allright","ReviewIcon","icon","Icon","labelIcon","ReviewListItemWrapper","iconKey","label","reviewListItemWrapper","reviewListText","text","tooltipText","closeToolTipInformationTextAriaLabel","moreDetailsAriaLabel","ReviewPresentation","props","ariaLabel","reviewTitle","reviewText","labelsList","reviewWrapper","__html","reviewListWrapper","convert","cap","key","reviewList","string","shape"],"sources":["../../../src/atom/review-presentation/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport getOr from 'lodash/fp/getOr';\nimport map from 'lodash/fp/map';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidVoteRewardsVoteHeart as HeartIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon,\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon\n} from '@coorpacademy/nova-icons';\nimport ToolTip from '../tooltip';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst ICONS = {\n skills: TargetIcon,\n questions: QuestionIcon,\n lifes: HeartIcon,\n allright: CheckIcon\n};\n\nconst ReviewIcon = ({icon}) => {\n const Icon = getOr(null, icon, ICONS);\n\n /* istanbul ignore next */\n if (!Icon) {\n return <div className={style.labelIcon} />;\n }\n return <Icon className={style.labelIcon} />;\n};\n\nconst ReviewListItemWrapper = ({iconKey, label}) => {\n return (\n <div className={style.reviewListItemWrapper} data-tip data-for=\"reviewListItem\" tabIndex={0}>\n <div className={style.reviewListText}>\n <ReviewIcon icon={iconKey} /> {label.text}\n </div>\n <ToolTip\n TooltipContent={label.tooltipText}\n closeToolTipInformationTextAriaLabel={label.closeToolTipInformationTextAriaLabel}\n data-testid={`review-list-item-tooltip-button-${iconKey}`}\n aria-label={label.moreDetailsAriaLabel}\n />\n </div>\n );\n};\n\nconst ReviewPresentation = props => {\n const {'aria-label': ariaLabel, reviewTitle, reviewText, labelsList} = props;\n\n return (\n <div className={style.reviewWrapper} aria-label={ariaLabel}>\n <div\n className={style.reviewTitle}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: reviewTitle}}\n />\n <div\n className={style.reviewText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: reviewText}}\n />\n <ul className={style.reviewListWrapper}>\n {map.convert({cap: false})((label, key) => {\n return (\n <li key={`step-${key}`} className={style.reviewList}>\n <ReviewListItemWrapper\n iconKey={key}\n label={label}\n tooltipText={label.tooltipText}\n aria-label={label.moreDetailsAriaLabel}\n />\n </li>\n );\n }, labelsList)}\n </ul>\n </div>\n );\n};\n\nReviewIcon.propTypes = {\n icon: PropTypes.string\n};\n\nReviewListItemWrapper.propTypes = {\n iconKey: PropTypes.string,\n label: PropTypes.shape({\n tooltipText: ToolTip.propTypes.tooltipText,\n moreDetailsAriaLabel: ToolTip.propTypes['aria-label'],\n closeToolTipInformationTextAriaLabel: ToolTip.propTypes.closeToolTipInformationTextAriaLabel,\n text: PropTypes.string\n })\n};\n\nReviewPresentation.propTypes = propTypes;\n\nexport default ReviewPresentation;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,SACEC,2BAA2B,IAAIC,SADjC,EAEEC,6BAA6B,IAAIC,SAFnC,EAGEC,+CAA+C,IAAIC,YAHrD,EAIEC,yCAAyC,IAAIC,UAJ/C,QAKO,0BALP;AAMA,OAAOC,OAAP,MAAoB,Y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
3
3
  @value mobile from breakpoints;
4
4
  @value colors: "../../variables/colors.css";
5
5
  @value xtraLightGrey from colors;
6
- @value cm_blue_900 from colors;
7
6
  @value cm_grey_75 from colors;
8
- @value cm_grey_500 from colors;
9
- @value cm_grey_700 from colors;
10
- @value white from colors;
11
7
 
8
+ .reviewWrapper {
9
+ width: 100%;
10
+ border-radius: 16px;
11
+ background-color: xtraLightGrey;
12
+ padding-bottom: 40px;
13
+ }
12
14
 
13
15
  .textBase {
14
16
  font-family: "Gilroy";
@@ -17,13 +19,6 @@
17
19
  user-select: none;
18
20
  }
19
21
 
20
- .reviewWrapper {
21
- width: 100%;
22
- border-radius: 16px;
23
- background-color: xtraLightGrey;
24
- padding-bottom: 40px;
25
- }
26
-
27
22
  .reviewTitle {
28
23
  composes: textBase;
29
24
  font-weight: 700;
@@ -77,61 +72,6 @@
77
72
  width: 16px;
78
73
  }
79
74
 
80
- .informationIcon {
81
- color: cm_grey_500;
82
- }
83
-
84
- .toolTip {
85
- transition: opacity 0.8s;
86
- position: absolute;
87
- height: auto;
88
- width: 200px;
89
- border-radius: 7px;
90
- background-color: cm_grey_700;
91
- right: -81px;
92
- bottom: 32px;
93
- }
94
-
95
- .toolTip::before {
96
- content: '';
97
- display: inline-block;
98
- visibility: inherit;
99
- opacity: inherit;
100
- width: 15px;
101
- height: 15px;
102
- transform: rotate(-45deg);
103
- background-color: cm_grey_700;
104
- position: inherit;
105
- bottom: -5px;
106
- right: 40%;
107
- border-radius: 2px;
108
- }
109
-
110
- .tooltipText {
111
- composes: textBase;
112
- font-weight: 500;
113
- font-size: 14px;
114
- display: inline-block;
115
- border-radius: 3px;
116
- word-wrap: break-word;
117
- color: white;
118
- padding: 8px 14px;
119
- text-align: center;
120
- }
121
-
122
- .tooltipContainer {
123
- overflow: visible;
124
- position: relative;
125
- }
126
-
127
- .tooltipIconContainer {
128
- display: flex;
129
- justify-content: flex-end;
130
- border: none;
131
- background: cm_grey_75;
132
- height: 25px;
133
- }
134
-
135
75
  @media tablet {
136
76
  .reviewWrapper{
137
77
  width: 100%;
@@ -142,4 +82,4 @@
142
82
  .reviewWrapper{
143
83
  width: 100%;
144
84
  }
145
- }
85
+ }
@@ -0,0 +1,22 @@
1
+ export function toggleStateOnKeyPress(state: any, setState: any, ref: any): (event: any) => void;
2
+ export default ToolTip;
3
+ declare function ToolTip({ anchorId, TooltipContent, "aria-label": ariaLabel, "data-testid": dataTestId, closeToolTipInformationTextAriaLabel, toolTipIsVisible: _toolTipIsVisible }: {
4
+ anchorId: any;
5
+ TooltipContent: any;
6
+ "aria-label": any;
7
+ "data-testid": any;
8
+ closeToolTipInformationTextAriaLabel: any;
9
+ toolTipIsVisible: any;
10
+ }): JSX.Element;
11
+ declare namespace ToolTip {
12
+ const propTypes: {
13
+ TooltipContent: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.ReactNodeLike>>;
14
+ 'data-testid': PropTypes.Requireable<string>;
15
+ 'aria-label': PropTypes.Requireable<string>;
16
+ closeToolTipInformationTextAriaLabel: PropTypes.Validator<string>;
17
+ anchorId: PropTypes.Requireable<string>;
18
+ toolTipIsVisible: PropTypes.Requireable<boolean>;
19
+ };
20
+ }
21
+ import PropTypes from "prop-types";
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tooltip/index.js"],"names":[],"mappings":"AA+CO,iGASN;;AAED;;;;;;;gBA2EC"}
@@ -0,0 +1,117 @@
1
+ import React, { isValidElement, useState, useCallback, useMemo } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import ReactTooltip from 'react-tooltip';
4
+ import isString from 'lodash/fp/isString';
5
+ import { NovaCompositionCoorpacademyInformationIcon as InformationIcon } from '@coorpacademy/nova-icons';
6
+ import style from './style.css';
7
+
8
+ const ToolTipWrapper = ({
9
+ toolTipIsVisible,
10
+ anchorId,
11
+ closeToolTipInformationTextAriaLabel,
12
+ content
13
+ }) => {
14
+ if (!toolTipIsVisible) return null;
15
+
16
+ if (anchorId) {
17
+ return /*#__PURE__*/React.createElement(ReactTooltip, {
18
+ id: anchorId,
19
+ className: style.toolTipReact,
20
+ "data-event-off": "click",
21
+ place: "left",
22
+ effect: "solid",
23
+ "aria-label": closeToolTipInformationTextAriaLabel
24
+ }, content);
25
+ } else {
26
+ return /*#__PURE__*/React.createElement("div", {
27
+ className: style.toolTip,
28
+ "data-testid": "tooltip",
29
+ "aria-label": closeToolTipInformationTextAriaLabel
30
+ }, content);
31
+ }
32
+ };
33
+
34
+ ToolTipWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
35
+ toolTipIsVisible: PropTypes.bool,
36
+ anchorId: PropTypes.string,
37
+ closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,
38
+ content: PropTypes.node
39
+ } : {};
40
+ export const toggleStateOnKeyPress = (state, setState, ref) => event => {
41
+ if (event.key === 'Enter') {
42
+ if (ref) ref.current.focus();
43
+ event.stopPropagation();
44
+ event.preventDefault();
45
+ setState(!state);
46
+ } else if (event.key === 'Tab' || event.key === 'Escape') {
47
+ setState(false);
48
+ }
49
+ };
50
+
51
+ const ToolTip = ({
52
+ anchorId,
53
+ TooltipContent,
54
+ 'aria-label': ariaLabel,
55
+ 'data-testid': dataTestId,
56
+ closeToolTipInformationTextAriaLabel,
57
+ toolTipIsVisible: _toolTipIsVisible
58
+ }) => {
59
+ const isComponent = useMemo(() => !isString(TooltipContent) && /*#__PURE__*/isValidElement(TooltipContent()), [TooltipContent]);
60
+ const [toolTipIsVisible, setToolTipIsVisible] = useState(false);
61
+ const handleKeyPress = useCallback(event => {
62
+ toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);
63
+ }, [toolTipIsVisible]);
64
+ const handleMouseOver = useCallback(() => {
65
+ setToolTipIsVisible(true);
66
+ }, []);
67
+ const handleMouseLeave = useCallback(() => {
68
+ setToolTipIsVisible(false);
69
+ }, []);
70
+ const content = useMemo(() => {
71
+ return isComponent ? /*#__PURE__*/React.createElement(TooltipContent, null) : /*#__PURE__*/React.createElement("p", {
72
+ className: style.tooltipContent
73
+ }, TooltipContent);
74
+ }, [TooltipContent, isComponent]);
75
+ return anchorId ? /*#__PURE__*/React.createElement(ToolTipWrapper, {
76
+ toolTipIsVisible: _toolTipIsVisible,
77
+ anchorId: anchorId,
78
+ closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
79
+ content: content,
80
+ onMouseLeave: handleMouseLeave,
81
+ onMouseOver: handleMouseOver
82
+ }) : /*#__PURE__*/React.createElement("div", {
83
+ className: style.tooltipContainer,
84
+ onMouseLeave: handleMouseLeave,
85
+ onMouseOver: handleMouseOver
86
+ }, /*#__PURE__*/React.createElement("button", {
87
+ type: "button",
88
+ className: style.tooltipIconContainer,
89
+ "data-testid": dataTestId,
90
+ onKeyDown: handleKeyPress,
91
+ tabIndex: 0
92
+ }, /*#__PURE__*/React.createElement(InformationIcon, {
93
+ className: style.informationIcon,
94
+ width: 12,
95
+ height: 12,
96
+ "aria-label": ariaLabel
97
+ })), /*#__PURE__*/React.createElement(ToolTipWrapper, {
98
+ toolTipIsVisible: toolTipIsVisible,
99
+ anchorId: anchorId,
100
+ closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
101
+ content: content
102
+ }));
103
+ };
104
+
105
+ ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
106
+ TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),
107
+ 'data-testid': PropTypes.string,
108
+ 'aria-label': PropTypes.string,
109
+ closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,
110
+ // ---------- externalHandling --------------
111
+ // if passed down, React Tooltip is used instead, due to limitations on
112
+ // parents overflow hidden controls
113
+ anchorId: PropTypes.string,
114
+ toolTipIsVisible: PropTypes.bool
115
+ } : {};
116
+ export default ToolTip;
117
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["React","isValidElement","useState","useCallback","useMemo","PropTypes","ReactTooltip","isString","NovaCompositionCoorpacademyInformationIcon","InformationIcon","style","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","toolTipReact","toolTip","propTypes","bool","string","isRequired","node","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","isComponent","setToolTipIsVisible","handleKeyPress","handleMouseOver","handleMouseLeave","tooltipContent","tooltipContainer","tooltipIconContainer","informationIcon","oneOfType","func"],"sources":["../../../src/atom/tooltip/index.js"],"sourcesContent":["import React, {isValidElement, useState, useCallback, useMemo} from 'react';\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 ToolTipWrapper = ({\n toolTipIsVisible,\n anchorId,\n closeToolTipInformationTextAriaLabel,\n content\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 >\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};\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}) => {\n const isComponent = useMemo(\n () => !isString(TooltipContent) && isValidElement(TooltipContent()),\n [TooltipContent]\n );\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleMouseOver = useCallback(() => {\n setToolTipIsVisible(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setToolTipIsVisible(false);\n }, []);\n\n const content = useMemo(() => {\n return isComponent ? (\n <TooltipContent />\n ) : (\n <p className={style.tooltipContent}>{TooltipContent}</p>\n );\n }, [TooltipContent, 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 />\n ) : (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={style.tooltipIconContainer}\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 />\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 // ---------- externalHandling --------------\n // 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,OAAOA,KAAP,IAAeC,cAAf,EAA+BC,QAA/B,EAAyCC,WAAzC,EAAsDC,OAAtD,QAAoE,OAApE;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,YAAP,MAAyB,eAAzB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,SAAQC,0CAA0C,IAAIC,eAAtD,QAA4E,0BAA5E;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAG,CAAC;EACtBC,gBADsB;EAEtBC,QAFsB;EAGtBC,oCAHsB;EAItBC;AAJsB,CAAD,KAKjB;EACJ,IAAI,CAACH,gBAAL,EAAuB,OAAO,IAAP;;EACvB,IAAIC,QAAJ,EAAc;IACZ,oBACE,oBAAC,YAAD;MACE,EAAE,EAAEA,QADN;MAEE,SAAS,EAAEH,KAAK,CAACM,YAFnB;MAGE,kBAAe,OAHjB;MAIE,KAAK,EAAC,MAJR;MAKE,MAAM,EAAC,OALT;MAME,cAAYF;IANd,GAQGC,OARH,CADF;EAYD,CAbD,MAaO;IACL,oBACE;MACE,SAAS,EAAEL,KAAK,CAACO,OADnB;MAEE,eAAY,SAFd;MAGE,cAAYH;IAHd,GAKGC,OALH,CADF;EASD;AACF,CA/BD;;AAiCAJ,cAAc,CAACO,SAAf,2CAA2B;EACzBN,gBAAgB,EAAEP,SAAS,CAACc,IADH;EAEzBN,QAAQ,EAAER,SAAS,CAACe,MAFK;EAGzBN,oCAAoC,EAAET,SAAS,CAACe,MAAV,CAAiBC,UAH9B;EAIzBN,OAAO,EAAEV,SAAS,CAACiB;AAJM,CAA3B;AAOA,OAAO,MAAMC,qBAAqB,GAAG,CAACC,KAAD,EAAQC,QAAR,EAAkBC,GAAlB,KAA0BC,KAAK,IAAI;EACtE,IAAIA,KAAK,CAACC,GAA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CAACc;AATV,CAApB;AAYA,eAAec,OAAf"}
@@ -0,0 +1,96 @@
1
+ @value colors: "../../variables/colors.css";
2
+ @value cm_blue_900 from colors;
3
+ @value cm_grey_75 from colors;
4
+ @value cm_grey_500 from colors;
5
+ @value cm_grey_700 from colors;
6
+
7
+ .textBase {
8
+ font-family: "Gilroy";
9
+ font-style: normal;
10
+ color: cm_blue_900;
11
+ user-select: none;
12
+ }
13
+
14
+ .tooltipContainer {
15
+ overflow: visible;
16
+ position: relative;
17
+ z-index: 10;
18
+ display: flex;
19
+ justify-content: center;
20
+ justify-self: center;
21
+ }
22
+
23
+ .tooltipIconContainer {
24
+ display: flex;
25
+ justify-content: flex-end;
26
+ border: none;
27
+ background: cm_grey_75;
28
+ height: 25px;
29
+ align-items: center;
30
+ }
31
+
32
+ .toolTip {
33
+ transition: opacity 0.8s;
34
+ position: absolute;
35
+ border-radius: 7px;
36
+ background-color: cm_grey_700;
37
+ right: -75px;
38
+ bottom: 32px;
39
+ height: auto;
40
+ width: 200px;
41
+ }
42
+
43
+ .toolTip::before {
44
+ content: '';
45
+ display: inline-block;
46
+ visibility: inherit;
47
+ opacity: inherit;
48
+ width: 15px;
49
+ height: 15px;
50
+ transform: rotate(-45deg);
51
+ background-color: cm_grey_700;
52
+ position: inherit;
53
+ border-radius: 2px;
54
+ bottom: -5px;
55
+ right: 40%;
56
+ }
57
+
58
+ .tooltipContent {
59
+ composes: textBase;
60
+ font-weight: 500;
61
+ font-size: 14px;
62
+ display: inline-block;
63
+ border-radius: 3px;
64
+ word-wrap: break-word;
65
+ color: white;
66
+ padding: 8px 14px;
67
+ text-align: center;
68
+ }
69
+
70
+ .informationIcon {
71
+ color: cm_grey_500;
72
+ }
73
+
74
+ /* ----------------------- ReactToolTip exclusive classes ------------------------- */
75
+ .toolTipReact {
76
+ pointer-events: all !important;
77
+ background-color: cm_grey_700;
78
+ border-radius: 7px !important;
79
+ visibility: visible !important;
80
+ opacity: 1 !important;
81
+ left: 5px;
82
+ }
83
+
84
+ /* for keyboard navigation, the position can't be obtained from the mouse */
85
+ [class*="__react_component_tooltip"]:not(.toolTipReact) {
86
+ border-radius: 7px !important;
87
+ top: 97px!important;
88
+ left: 628px!important;
89
+ visibility: visible !important;
90
+ opacity: 1!important;
91
+ }
92
+
93
+ /* same reason, arrow can't be placed effectively */
94
+ [class*="__react_component_tooltip"]:not(.toolTipReact)::after {
95
+ content: none !important;
96
+ }
@@ -21,6 +21,10 @@
21
21
 
22
22
  user-select: none;
23
23
  position: relative;
24
+ border-bottom: none;
25
+ border-right: 0px;
26
+ border-width: 1px 0 0 1px;
27
+ background: inherit;
24
28
  }
25
29
 
26
30
  .engineIcon {
@@ -156,28 +160,22 @@
156
160
  opacity: 0.4;
157
161
  }
158
162
 
159
- .toolTip {
160
- opacity: 1 !important;
161
- padding: 0;
162
- pointer-events: all;
163
- background-color: transparent !important;
164
- }
165
-
166
- .toolTip::after {
167
- border-left-color: transparent !important;
163
+ .textBase {
164
+ font-family: "Gilroy";
165
+ font-style: normal;
166
+ color: white;
168
167
  }
169
168
 
170
169
  .toolTipContent {
171
- padding: 10px;
172
- margin: 0;
173
- border-radius: 3px;
174
- font-family: 'Gilroy';
175
- font-size: 12px;
170
+ composes: textBase;
176
171
  width: 270px;
177
- background-color: white;
178
- border: 1px solid white;
179
- color: dark;
180
- box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 8px 3px 10px rgba(0, 0, 0, 0.23);
172
+ font-weight: 500;
173
+ font-size: 14px;
174
+ display: inline-block;
175
+ border-radius: 3px;
176
+ word-wrap: break-word;
177
+ padding: 8px 14px;
178
+ text-align: center;
181
179
  }
182
180
 
183
181
  .toolTipContent > a {
@@ -191,21 +189,6 @@
191
189
  text-decoration: underline;
192
190
  }
193
191
 
194
- .toolTipContent::after {
195
- content: '';
196
- width: 0;
197
- height: 0;
198
- position: absolute;
199
- border-left-color: inherit;
200
- border-left-style: solid;
201
- border-left-width: 6px;
202
- border-top: 5px solid transparent;
203
- border-bottom: 5px solid transparent;
204
- right: -6px;
205
- top: 50%;
206
- margin-top: -4px;
207
- }
208
-
209
192
  /* ------------------------------------------------------ */
210
193
 
211
194
  @media tablet, mobile {
@@ -1,21 +1,23 @@
1
1
  export default EngineStars;
2
- declare class EngineStars extends React.Component<any, any, any> {
3
- static propTypes: {
4
- type: PropTypes.Validator<string>;
5
- stars: PropTypes.Validator<number>;
6
- title: PropTypes.Validator<string>;
7
- active: PropTypes.Requireable<boolean>;
8
- disabled: PropTypes.Requireable<boolean>;
9
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
10
- toolTip: PropTypes.Requireable<PropTypes.InferProps<{
2
+ declare function EngineStars(props: any, legacyContext: any): JSX.Element;
3
+ declare namespace EngineStars {
4
+ namespace propTypes {
5
+ const type: PropTypes.Validator<string>;
6
+ const stars: PropTypes.Validator<number>;
7
+ const title: PropTypes.Validator<string>;
8
+ const active: PropTypes.Requireable<boolean>;
9
+ const disabled: PropTypes.Requireable<boolean>;
10
+ const onClick: PropTypes.Requireable<(...args: any[]) => any>;
11
+ const className: PropTypes.Requireable<string>;
12
+ const toolTip: PropTypes.Requireable<PropTypes.InferProps<{
11
13
  preMessage: PropTypes.Requireable<string>;
12
14
  linkMessage: PropTypes.Requireable<string>;
13
15
  endMessage: PropTypes.Requireable<string>;
14
16
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
15
17
  }>>;
16
- };
17
- static contextTypes: {
18
- skin: PropTypes.Requireable<PropTypes.InferProps<{
18
+ }
19
+ namespace contextTypes {
20
+ const skin: PropTypes.Requireable<PropTypes.InferProps<{
19
21
  common: PropTypes.Requireable<{
20
22
  [x: string]: any;
21
23
  }>;
@@ -36,11 +38,7 @@ declare class EngineStars extends React.Component<any, any, any> {
36
38
  [x: string]: any;
37
39
  }>;
38
40
  }>>;
39
- };
40
- constructor(props: any, context: any);
41
- handleClick: (e: any) => void;
42
- render(): JSX.Element;
41
+ }
43
42
  }
44
- import React from "react";
45
43
  import PropTypes from "prop-types";
46
44
  //# sourceMappingURL=engine-stars.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"engine-stars.d.ts","sourceRoot":"","sources":["../../../src/template/activity/engine-stars.js"],"names":[],"mappings":";AAqFA;IACE;;;;;;;;;;;;;MAaE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,sCAGC;IAED,8BAKE;IAEF,sBAqDC;CACF"}
1
+ {"version":3,"file":"engine-stars.d.ts","sourceRoot":"","sources":["../../../src/template/activity/engine-stars.js"],"names":[],"mappings":";AAuEA,0EAwIC"}